NEXT temporary contract 3.5 — Lifecycle compatibility and post-state causality
01Temporary normative staging unit. Its body is the accepted architecture from refined plan revision 4, section 3.5. Before production code cites this law, promote the relevant clauses into permanent specifications. This file is consumed only after semantic coverage, implemented behavior and retained evidence are accepted. The task/retirement checker cannot perform semantic acceptance.
02D-002/D-018 приняты: create производит/меняет code; build алгоритмически собирает; verify проверяет результат; full pass имеет отдельный явный вход. Existing internal nine-phase declarations/order remain reusable machinery; прежнее правило безусловного producer dispatch из inclusive verify изменяется по D-002. Обычный verify и verify --change могут remeasure/rebuild/retest и reuse/adopt completed exact transition, но не dispatch нового producer. Если creation ещё нужна, возвращает creation-required и не выдаёт это за успешную проверку. Прежнее public inclusive behavior фиксируется как historical source contract и мигрируется в M-13/M-03, а не остаётся незаметным вторым поведением обычного verify. Build/verify не dispatch declared production даже из prerequisite slot; явные trusted verification/judge operations могут выпускать evidence, но не редактировать product source. Unknown effect classification отказывает до execution.
03Предлагаемый convenience entry — change apply: fixed create→verify application composition, без нового workflow language, next-task selection или repair loop. Он показывает полный план, выполняет не более одной production operation для exact request, может park для host, затем проверяет новую source state. Verification failure завершает invocation; новое исправление выбирает внешний процесс. Спецификация command grammar и legacy build feat explanation обновляется M-13/M-03-A; build feat generation promise переносится в explicit create/full-pass journey, не объявляется уже реализованной старой формой.
04Machine state workspace-rooted, один active/parked scoped continuation на workspace. Другой scope/node не displaces его автоматически. Cancel/displace explicit; foreign outputs сохраняются. Отдельная worktree имеет собственный state root.
05Carriage: CLI/MCP, lower RunMetadata/Context, state header/records, plan/report/tasks wires, outbox/resume descriptor, slot continuation, artifact records и verification frames. Production request identity отдельно от observing invocation: переход create→verify не должен сам менять identity уже выполненного producer из-за requested-phase/chain observers. New recipe задаёт именно реально consumed inputs/artifacts и selected work/intent/world/declaration. Legacy fingerprint recipe остаётся legacy.
06M-03-D может начать proof с disjoint outputs, но такой proof не закрывает milestone. Transition atom M-11-D сохраняет свой ID и выполняется раньше, после M-03-C, до complete M-03-D/E; он не ждёт завершения всего brownfield M-11.
07Required transition contract:
08Requirement: - Immutable baseline capture фиксирует pre-read set, write-before images, directory membership, intent/production request/declaration/consumed provider identities. - Completion связывает declared write set и post witnesses; executed producer и explicitly adopted host output различаются по authority. Non-empty file — shape acceptance, не semantic proof. - Outside write set все required inputs сохраняют baseline witnesses. Overlap хранит оба pre/post; новые/deleted files и parent directory changes включены. - Legacy pre-dispatch measurements не переписываются. Scoped evidence явно различает historical consumed pre-state, admitted transition и current post-output observation; старые input bytes не relabelled matched current bytes. - Producer reuse: same production request/declaration/genuinely consumed captured inputs плюс current owned outputs==post. Unrelated rebuilt predecessor output не invalidates producer просто из-за нахождения в общем artifact registry. - Build/test старого source остаются историческими/неприменимыми. Scoped verify выполняет нужный deterministic prefix на post-source и требует новые current-source measurements, затем checks transition/output. Gate не «прощает» произвольный stale: только exact admitted transition переносит applicability; остальные drift/missing/unstable отказывают. - Если genuinely consumed input изменился, verify возвращает typed stale/creation-required; не запускает repair. Full pass не превращает этот отказ в retry loop. - Concurrent outside-write edits, lost ownership, unsafe aliases или отсутствующий comparable witness запрещают acceptance. Captured proof заявляет ровно измеренную stability, не невозможность hostile ABA. - При crash recovery доступны exact before/after/third-state distinctions; не присваивать unknown state и не считать external native code sandboxed.
09- Immutable baseline capture фиксирует pre-read set, write-before images, directory membership, intent/production request/declaration/consumed provider identities.
- Completion связывает declared write set и post witnesses; executed producer и explicitly adopted host output различаются по authority. Non-empty file — shape acceptance, не semantic proof.
- Outside write set все required inputs сохраняют baseline witnesses. Overlap хранит оба pre/post; новые/deleted files и parent directory changes включены.
- Legacy pre-dispatch measurements не переписываются. Scoped evidence явно различает historical consumed pre-state, admitted transition и current post-output observation; старые input bytes не relabelled matched current bytes.
- Producer reuse: same production request/declaration/genuinely consumed captured inputs плюс current owned outputs==post. Unrelated rebuilt predecessor output не invalidates producer просто из-за нахождения в общем artifact registry.
- Build/test старого source остаются историческими/неприменимыми. Scoped verify выполняет нужный deterministic prefix на post-source и требует новые current-source measurements, затем checks transition/output. Gate не «прощает» произвольный stale: только exact admitted transition переносит applicability; остальные drift/missing/unstable отказывают.
- Если genuinely consumed input изменился, verify возвращает typed stale/creation-required; не запускает repair. Full pass не превращает этот отказ в retry loop.
- Concurrent outside-write edits, lost ownership, unsafe aliases или отсутствующий comparable witness запрещают acceptance. Captured proof заявляет ровно измеренную stability, не невозможность hostile ABA.
- При crash recovery доступны exact before/after/third-state distinctions; не присваивать unknown state и не считать external native code sandboxed.
10Exit complete scenario: агент меняет существующий исходник, проверяются разрешённые effects, новая версия реально собирается/тестируется, повторный verify fresh не создаёт код снова. Это обязательный результат первой полноценной change delivery.