codex-workflow-v2 2.0.0-beta.12.8 → 2.0.0-beta.13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (124) hide show
  1. package/README.md +60 -16
  2. package/dist/reviewer-runtime-build.json +1092 -0
  3. package/dist/src/alpha6/check-support-anchor.d.ts +24 -0
  4. package/dist/src/alpha6/check-support-anchor.js +102 -0
  5. package/dist/src/alpha6/check-support-anchor.js.map +1 -0
  6. package/dist/src/alpha6/component-owner.d.ts +28 -0
  7. package/dist/src/alpha6/component-owner.js +95 -0
  8. package/dist/src/alpha6/component-owner.js.map +1 -0
  9. package/dist/src/alpha6/downstream-proof.js +4 -2
  10. package/dist/src/alpha6/downstream-proof.js.map +1 -1
  11. package/dist/src/alpha6/mechanical-feasibility.js +42 -12
  12. package/dist/src/alpha6/mechanical-feasibility.js.map +1 -1
  13. package/dist/src/alpha6/milestone.d.ts +6 -2
  14. package/dist/src/alpha6/milestone.js +164 -10
  15. package/dist/src/alpha6/milestone.js.map +1 -1
  16. package/dist/src/alpha6/npm-check-contract.d.ts +11 -0
  17. package/dist/src/alpha6/npm-check-contract.js +36 -0
  18. package/dist/src/alpha6/npm-check-contract.js.map +1 -0
  19. package/dist/src/alpha6/plan-integrity.js +157 -27
  20. package/dist/src/alpha6/plan-integrity.js.map +1 -1
  21. package/dist/src/alpha6/plan-risk.js +3 -1
  22. package/dist/src/alpha6/plan-risk.js.map +1 -1
  23. package/dist/src/alpha6/remediation-cause.d.ts +13 -0
  24. package/dist/src/alpha6/remediation-cause.js +77 -0
  25. package/dist/src/alpha6/remediation-cause.js.map +1 -0
  26. package/dist/src/alpha6/remediation.d.ts +15 -4
  27. package/dist/src/alpha6/remediation.js +430 -67
  28. package/dist/src/alpha6/remediation.js.map +1 -1
  29. package/dist/src/alpha6/review.d.ts +6 -0
  30. package/dist/src/alpha6/review.js +46 -4
  31. package/dist/src/alpha6/review.js.map +1 -1
  32. package/dist/src/artifacts.js +6 -0
  33. package/dist/src/artifacts.js.map +1 -1
  34. package/dist/src/cli-actions.d.ts +25 -0
  35. package/dist/src/cli-actions.js +109 -0
  36. package/dist/src/cli-actions.js.map +1 -0
  37. package/dist/src/cli.js +244 -253
  38. package/dist/src/cli.js.map +1 -1
  39. package/dist/src/contracts.d.ts +202 -5
  40. package/dist/src/credential-transport.d.ts +38 -0
  41. package/dist/src/credential-transport.js +156 -0
  42. package/dist/src/credential-transport.js.map +1 -0
  43. package/dist/src/dependency-provenance.d.ts +23 -2
  44. package/dist/src/dependency-provenance.js +239 -36
  45. package/dist/src/dependency-provenance.js.map +1 -1
  46. package/dist/src/domain/completed-step-carryover.d.ts +13 -0
  47. package/dist/src/domain/completed-step-carryover.js +71 -0
  48. package/dist/src/domain/completed-step-carryover.js.map +1 -0
  49. package/dist/src/domain/validation.d.ts +9 -1
  50. package/dist/src/domain/validation.js +86 -0
  51. package/dist/src/domain/validation.js.map +1 -1
  52. package/dist/src/gateway-handshake.d.ts +11 -0
  53. package/dist/src/gateway-handshake.js +92 -0
  54. package/dist/src/gateway-handshake.js.map +1 -0
  55. package/dist/src/git.js +1 -0
  56. package/dist/src/git.js.map +1 -1
  57. package/dist/src/historical-step-provenance.d.ts +20 -0
  58. package/dist/src/historical-step-provenance.js +111 -0
  59. package/dist/src/historical-step-provenance.js.map +1 -0
  60. package/dist/src/index.d.ts +2 -0
  61. package/dist/src/index.js +2 -0
  62. package/dist/src/index.js.map +1 -1
  63. package/dist/src/lifecycle/corrective-replan-binding-manifest.d.ts +5 -0
  64. package/dist/src/lifecycle/corrective-replan-binding-manifest.js +9 -0
  65. package/dist/src/lifecycle/corrective-replan-binding-manifest.js.map +1 -1
  66. package/dist/src/lifecycle/corrective-replan.js +1 -1
  67. package/dist/src/lifecycle/corrective-replan.js.map +1 -1
  68. package/dist/src/lifecycle/semantic-registry.js +1 -1
  69. package/dist/src/observation.js +1 -2
  70. package/dist/src/observation.js.map +1 -1
  71. package/dist/src/observed-routes.d.ts +114 -0
  72. package/dist/src/observed-routes.js +545 -0
  73. package/dist/src/observed-routes.js.map +1 -0
  74. package/dist/src/operational-contract.d.ts +26 -0
  75. package/dist/src/operational-contract.js +94 -0
  76. package/dist/src/operational-contract.js.map +1 -0
  77. package/dist/src/reviewer.d.ts +218 -8
  78. package/dist/src/reviewer.js +927 -25
  79. package/dist/src/reviewer.js.map +1 -1
  80. package/dist/src/state/corrective-replan-executor.js +23 -15
  81. package/dist/src/state/corrective-replan-executor.js.map +1 -1
  82. package/dist/src/state/corrective-replan-public.js +35 -10
  83. package/dist/src/state/corrective-replan-public.js.map +1 -1
  84. package/dist/src/state/corrective-replan-transaction.js +12 -4
  85. package/dist/src/state/corrective-replan-transaction.js.map +1 -1
  86. package/dist/src/state/corrective-yield-transaction.js +11 -2
  87. package/dist/src/state/corrective-yield-transaction.js.map +1 -1
  88. package/dist/src/state/lock.d.ts +1 -0
  89. package/dist/src/state/lock.js +24 -0
  90. package/dist/src/state/lock.js.map +1 -1
  91. package/dist/src/version.d.ts +1 -1
  92. package/dist/src/version.js +1 -1
  93. package/dist/src/version.js.map +1 -1
  94. package/dist/src/workflow.d.ts +70 -4
  95. package/dist/src/workflow.js +1888 -152
  96. package/dist/src/workflow.js.map +1 -1
  97. package/docs/autonomy-guardrails.md +41 -14
  98. package/docs/delegated-approval.md +6 -1
  99. package/docs/development-flow.md +42 -12
  100. package/docs/pdf/codex-workflow-v2-architecture-ru.pdf +0 -0
  101. package/docs/pdf/codex-workflow-v2-chat-only-guide-ru.pdf +0 -0
  102. package/docs/pdf/codex-workflow-v2-technical-reference-ru.pdf +0 -0
  103. package/docs/pdf/sources/codex-workflow-v2-architecture-ru.md +191 -22
  104. package/docs/pdf/sources/codex-workflow-v2-chat-only-guide-ru.md +163 -45
  105. package/docs/pdf/sources/codex-workflow-v2-technical-reference-ru.md +346 -52
  106. package/docs/problem-briefs/01-pre-implementation-integrity.md +11 -7
  107. package/docs/problem-briefs/04-task-dependency-and-structural-replacement-integrity.md +13 -6
  108. package/docs/problem-briefs/README.md +11 -11
  109. package/docs/release.md +89 -9
  110. package/docs/updating-existing-project.md +235 -0
  111. package/docs/validation-report.md +156 -98
  112. package/package.json +12 -3
  113. package/plugins/codex-workflow-gateway/.codex-plugin/plugin.json +1 -1
  114. package/plugins/codex-workflow-gateway/references/protocol.md +9 -0
  115. package/plugins/codex-workflow-gateway/skills/codex-workflow-gateway/SKILL.md +67 -1
  116. package/schemas/authorization-event.schema.json +10 -3
  117. package/schemas/corrective-decision-event.schema.json +164 -9
  118. package/schemas/corrective-replan-credentials.private.schema.json +4 -2
  119. package/schemas/milestone-scope-change-event.schema.json +25 -1
  120. package/schemas/remediation-event.schema.json +17 -1
  121. package/schemas/review-result.schema.json +1 -0
  122. package/schemas/step-review-event.schema.json +15 -0
  123. package/schemas/task.schema.json +104 -1
  124. package/schemas/transition-definition.schema.json +8 -0
@@ -24,6 +24,30 @@ and self-contradictory classifications. `split-required` and `stop-escalate` blo
24
24
  authorization. The sidecar, not informal Plan prose, is
25
25
  the source of truth for which Steps require strict review.
26
26
 
27
+ ## Audited remediation topology
28
+
29
+ A current pre-execution `stop-escalate` may prove that the Plan is blocked by a missing upstream
30
+ capability rather than by an implementation defect inside the Task. Beta.12.10 handles only this
31
+ shape without a new human approval. Repository `next` first requires one ordinary Discovery whose
32
+ facts, scope, constraints, and acceptance describe the exact missing capability. When ready, it
33
+ advertises `milestone remediation-materialize` with the blocked Task/Milestone revisions, audit
34
+ binding, and required predecessor frontier.
35
+
36
+ The transition is safe by construction rather than by agent judgment. Its input cannot supply a
37
+ replacement Milestone outcome, success signal, acceptance, checks, or arbitrary membership graph.
38
+ Core appends one required Task, copies the blocked Task's exact direct predecessor frontier, adds
39
+ the remediation Task as one new dependency of the blocked Task, and changes nothing else. It runs
40
+ under an idle, clean observation boundary and records one hash-chained `audited-remediation`
41
+ scope-change event. Reuse of the same Plan Risk Audit is rejected.
42
+
43
+ The previous current Milestone execution authorization and exact blocking audit derive a new
44
+ `corrective-derived` Milestone execution authorization. While that authority remains current,
45
+ `next.correctiveDerivedApproval` may authorize and finally accept required Tasks using the exact
46
+ derived actor, without a human or delegation grant. This does not bypass Plan Risk Audit,
47
+ mechanical feasibility, C1 handoff, Step checks/commits, strict review, Task review, dependency
48
+ runnability, clean-Git requirements, or final Milestone acceptance. Any later arbitrary scope
49
+ change supersedes this authority.
50
+
27
51
  Guarded categories cover:
28
52
 
29
53
  - forward database or state migrations;
@@ -121,25 +145,28 @@ commit, or unverified recovery remains blocked.
121
145
 
122
146
  ### First-failure Plan-integrity recovery
123
147
 
124
- A mechanically impossible Plan check must not consume the second ordinary remediation attempt
125
- only to unlock corrective replan. After the first guarded `checks-failed` event, Core performs a
126
- read-only bounded assessment. `next` advertises `task plan-integrity-recover` only when all of the
127
- following are true:
128
-
129
- - the failed Step contains an exact root `npm run <script>` or `npm run-script <script>` check;
130
- - the named script is absent from the current root `package.json`;
131
- - `package.json` is outside the failed Step's `allowedWrites`;
148
+ A mechanically impossible Plan check must not consume another attempt merely to unlock its known
149
+ correction. After the first guarded `checks-failed` event, Core performs a read-only bounded
150
+ assessment. Existing missing-script and required-selector conflicts route to corrective replan.
151
+ beta.12.16 additionally recognizes one exact check-support conflict when all of the following hold:
152
+
153
+ - the failed Step contains an exact root `npm run <script>` check and declares an absent migration
154
+ output path that is inside its original `allowedWrites`;
155
+ - the root script resolves to a repository-local runner whose direct static import resolves to a
156
+ tracked checksum/catalog support module;
157
+ - that support module has SHA-256 anchors and names an existing migration in the same file family,
158
+ but is outside the Step's `allowedWrites` and `forbiddenScope`;
132
159
  - exactly one ordinary `checks-failed` remediation event exists for the Step;
133
160
  - no corrective decision exists for its second-attempt binding;
134
161
  - every dirty file remains inside the Step's current `allowedWrites` and outside its
135
162
  `forbiddenScope`.
136
163
 
137
- The recovery appends one hash-bound `replan-required` decision for attempt ordinal 2. It preserves
138
- the worktree and does not edit the Plan. A claimed C1 Task must present its current writer token and
139
- then follow `task corrective-yield`; the replacement Plan still requires the existing independent
140
- validation, Risk Audit, Human confirmation, journaled execution, readback, and renewed execution
141
- authorization. Other check failures use the normal continuable remediation route; they do not
142
- receive the narrow Plan-integrity shortcut, but attempt count alone never stops them.
164
+ The recovery appends one hash-bound `continue-fix` decision for attempt ordinal 2 and the exact
165
+ support path. It preserves the worktree and Plan hash; it does not alter source or Git. The current
166
+ C1 actor presents the existing writer token and fresh `task run` exposes the effective scope.
167
+ `task step-complete` remains the only commit owner, all checks rerun, and strict review packets name
168
+ the derived scope. Missing-script/selector conflicts still use `replan-required` plus the normal
169
+ Human-confirmed corrective replan. Unproved or broader scope changes never receive this authority.
143
170
 
144
171
  ### Downstream-proof predecessor recovery
145
172
 
@@ -90,7 +90,12 @@ uses the grant and passes `--delegation-grant` to the Core transition.
90
90
 
91
91
  Ordinary semantic Milestone scope changes remain journaled, human-only lifecycle actions. A
92
92
  contract delegate may evolve only the membership graph inside the cryptographically bound
93
- semantic scope.
93
+ semantic scope. The separate beta.12.11 `milestone remediation-materialize` route is not delegation
94
+ and does not widen this allow-list: Core derives it only from a current blocking Plan Risk Audit and
95
+ a previously authorized active Milestone. Its topology effect is fixed to one new required upstream
96
+ Task plus one dependency edge, with all Milestone semantics preserved. The resulting
97
+ `corrective-derived` Task approvals remain valid only while that exact derived Milestone authority
98
+ is current; final Milestone acceptance is unaffected.
94
99
 
95
100
  ### Milestone delegate prompt
96
101
 
@@ -52,6 +52,9 @@ created by core, but the Step remains non-terminal and `next` routes to `task st
52
52
  until commit-bound strict review and reviewer attestation pass.
53
53
  Use the exact claimant or required actor from `next` as `--actor`; the independent reviewer
54
54
  runs inside Core and is not supplied as the CLI actor.
55
+ The native reviewer uses one closed strict-output schema: every declared object property is
56
+ required, while semantically optional finding fields are represented explicitly as nullable.
57
+ Malformed output fails closed as an unverified review and cannot become remediation authority.
55
58
  When `next` includes `gitMutationPolicy`, obtain bounded permission for that exact Git-writing
56
59
  transition before the first call instead of probing and retrying after a `.git/index.lock`
57
60
  failure. For `task start`, this applies only when invoking `--workspace-owner local`.
@@ -76,8 +79,10 @@ Submission requires a clean, auditable Task history and records evidence for the
76
79
  Task head. `task review-launch` starts a separate read-only reviewer and atomically records its
77
80
  result. If C1 handoff is active, keep `--actor` equal to the current claimant or required actor
78
81
  from `next`; the reviewer identity remains internal to the compound route. A passing fresh review
79
- permits Result creation. Human final acceptance binds Brief, Plan, Result, evidence, and
80
- the accepted head. Base advancement forces synchronization, checks, review, and acceptance
82
+ permits Result creation. Final Task acceptance binds Brief, Plan, Result, evidence, and
83
+ the accepted head. It is human/delegated by default; a Task covered by the current audited-remediation
84
+ Milestone authority uses the exact `correctiveDerivedApproval` actor returned by `next` without a
85
+ new human gate. Base advancement forces synchronization, checks, review, and acceptance
81
86
  to be repeated before merge.
82
87
 
83
88
  The Technical Planner performs a risk review before authorization. Migration work includes a
@@ -91,13 +96,13 @@ executable. A reviewer routes to `replan` only with an exact Plan obstruction an
91
96
  change; ordinary findings default to `fix`. Remediation cannot change the Task objective,
92
97
  requirements, or acceptance.
93
98
 
94
- One bounded exception avoids a deliberately repeated failure for an older authorization without
95
- P01-A evidence or a contradiction that becomes observable only after execution starts. If the first guarded check failure
96
- is caused by an absent root npm script that the Step cannot add because `package.json` is outside
97
- its `allowedWrites`, fresh `next` advertises `task plan-integrity-recover`. The command records only
98
- the exact evidence-bound early `replan-required` posture; it never edits source, Plan, or Git.
99
- Continue through the advertised corrective yield and corrective replan rather than calling
100
- `task run` again.
99
+ One bounded exception avoids deliberately repeating an already-proved Plan-integrity failure.
100
+ Missing root scripts and missing mandatory selectors use the advertised evidence-bound
101
+ `replan-required` path. For beta.12.16's exact direct check-support case, fresh `next` instead binds
102
+ the imported SHA/catalog support module and records a machine-derived `continue-fix` scope. Continue
103
+ with fresh `task run`; its envelope contains the original Step paths plus that one support path.
104
+ Core still owns the commit and review packet. Do not add adjacent files or treat this as generic
105
+ permission to change the Plan.
101
106
 
102
107
  If a later proof Step leaves changes both in its own scope and in files owned by a completed
103
108
  transitive predecessor, fresh `next` advertises `task downstream-proof-recover` instead of
@@ -127,7 +132,8 @@ daemon check. Re-run the exact probe/check once with sandbox escalation without
127
132
  Restart Docker Desktop only with separate authorization after the escalated call reaches Docker and
128
133
  proves the daemon unavailable.
129
134
 
130
- Execution authorization and final acceptance use the human path by default. If the user has
135
+ Execution authorization and final acceptance use the human path by default. The only Core-derived
136
+ exception is a current audited-remediation Milestone authority described below. If the user has
131
137
  previously issued an active delegation grant for the exact transition and scope, the named
132
138
  delegate may perform that transition with `--delegation-grant`. The event keeps the delegate
133
139
  as actor and separately records the principal and policy hash. Expired, revoked, wrong-scope,
@@ -169,6 +175,30 @@ journaled recovery across `state.json`, `plan.json`, and `scope-change-events.js
169
175
  Plan uses the same recovery machinery for its exact two-file `state.json` + `plan.json` commit and
170
176
  does not manufacture a scope-change event.
171
177
 
178
+ There is one narrower route for a confirmed pre-execution topology defect. When the current Plan
179
+ Risk Audit for an unstarted required Task records `stop-escalate`, repository `next` routes through
180
+ a remediation Discovery and then `milestone remediation-materialize`. Core accepts no free-form
181
+ Milestone Plan. It atomically:
182
+
183
+ - consumes one ready Discovery and creates one new required remediation Task;
184
+ - makes that Task inherit the blocked Task's exact direct predecessor frontier, all already merged;
185
+ - adds exactly one dependency edge from the blocked Task to the remediation Task;
186
+ - preserves Milestone outcome, success signal, acceptance, checks, prior memberships, discovery,
187
+ and base branch;
188
+ - binds the scope-change sidecar to the exact rejected Task revision, Brief/Plan hashes, and
189
+ `stop-escalate` audit event/hash;
190
+ - supersedes the old execution authorization and records a `corrective-derived` replacement bound
191
+ to the prior authorization and audit.
192
+
193
+ No confirmation code or human approval is used for this route. It is idempotent per audit and
194
+ rejects dirty checkout, active/stale leases, pending operations, a started Task, a non-current
195
+ audit, a changed predecessor frontier, a non-merged predecessor, or any attempt to change Milestone
196
+ semantics. Repository `next` prioritizes the remediation Task. After it merges, `next` returns the
197
+ original Task to `task plan-set`; its replacement Plan and Risk Audit are evaluated normally.
198
+ Current required Tasks may use the exact `correctiveDerivedApproval.actor` returned by `next` for
199
+ Task execution authorization and final acceptance. Worker handoff, checks, commits, strict review,
200
+ and final Milestone acceptance remain ordinary independent gates.
201
+
172
202
  A Milestone has no integration branch. Validation requires all required Tasks to be
173
203
  `merged`, checks the current clean base branch, and writes evidence plus Result. Final
174
204
  acceptance binds those artifacts to the unchanged base HEAD. Cancellation records a reason
@@ -221,11 +251,11 @@ wake a coordinator that has already ended its turn.
221
251
 
222
252
  | Participant | Responsible for | Cannot decide |
223
253
  | --- | --- | --- |
224
- | User / principal | map classifications, direct approvals, delegation policy and revocation, scope changes | implementation evidence |
254
+ | User / principal | map classifications, direct approvals, delegation policy and revocation, arbitrary scope changes | implementation evidence |
225
255
  | Delegate | only transitions explicitly allowed by an active grant | grant creation, expansion, impersonating the principal |
226
256
  | Scope Lead | discovery, facts, unknowns, Task/Milestone recommendation | production edits |
227
257
  | Technical Planner | requirements mapping, Steps, checks, knowledge impact | authorization |
228
- | Delivery Coordinator | valid transitions, dispatch, evidence collection | scope expansion |
258
+ | Delivery Coordinator | valid transitions, dispatch, evidence collection, exact audited-remediation route | arbitrary scope expansion |
229
259
  | Worker | one dispatched Step within allowed paths | adjacent Steps or Plan changes |
230
260
  | Independent Reviewer | isolated comparison of requirements, diff, checks, and evidence | fixes or acceptance |
231
261
  | Core CLI | state, revisions, hashes, locks, Git mechanics, diagnostics | semantic product choices |
@@ -1,10 +1,10 @@
1
1
  ---
2
- title: Codex Workflow V2: архитектура beta.12.8
2
+ title: Codex Workflow V2: архитектура beta.13
3
3
  subtitle: Источники истины, lifecycle, роли, delegation, зависимости Tasks и границы доверия
4
4
  part: Часть 1 из 3 | Архитектура
5
5
  document_version: 2.0
6
- date: 29 августа 2026
7
- subject: Архитектура и границы Codex Workflow V2 beta.12.8
6
+ date: 2 сентября 2026
7
+ subject: Архитектура и границы Codex Workflow V2 beta.13
8
8
  ---
9
9
 
10
10
  # 1. Назначение и граница системы
@@ -18,14 +18,15 @@ Codex Workflow V2 - локальный state machine поверх Codex App, Git
18
18
  Система рассчитана на одного пользователя и одну машину. Она не предоставляет distributed locking,
19
19
  криптографическую идентификацию actor string или безопасную синхронизацию state между компьютерами.
20
20
 
21
- ## 1.1. Что beta.12.8 гарантирует
21
+ ## 1.1. Что beta.13 гарантирует
22
22
 
23
23
  - exact project-local npm package и совместимый handshake до lifecycle действий;
24
24
  - Discovery до materialization Task или Milestone;
25
25
  - утверждённую Project Knowledge Map и Plan, связанный с её точной revision/hash;
26
26
  - mechanical-feasibility проверку поддерживаемых форм Plan до новой Task authorization;
27
27
  - явный Milestone dependency DAG и один общий runnable predicate для routing, handoff, claim и start;
28
- - один C1 writer lease, секретные one-time credentials и Core-owned Step commits;
28
+ - один C1 writer lease, host-safe credential references и Core-owned Step commits: secret хранится
29
+ только в project-bound local vault с mode `0600`, а argv и CLI output содержат только reference;
29
30
  - lease-free Human final-acceptance gate: `task result-set` проверяет и освобождает active writer
30
31
  lease, а после acceptance merge получает новый credential только через fresh recovery route;
31
32
  - external-sealed Step/Task review в отдельных Codex tasks;
@@ -35,14 +36,44 @@ Codex Workflow V2 - локальный state machine поверх Codex App, Git
35
36
  worktree и HEAD сохраняются, stale completion authority снимается, та же Task возвращается в planning.
36
37
  - bounded compatibility recovery, если beta.12.6 после этого recovery ошибочно rebind-нула отвергнутый
37
38
  Plan: exact dirty bytes сохраняются до нового consolidated Step, а Knowledge refresh не отменяет `plan-set`.
38
-
39
- ## 1.2. Что beta.12.8 не гарантирует
39
+ - corrective Plan сохраняет authority исключённых completed Step commits, а beta.12.9 bounded recovery
40
+ исправляет уже stranded state только при passed strict review и прежнем hash-bound final acceptance.
41
+ - pre-execution `stop-escalate`, доказавший отсутствующую upstream capability, может materialize ровно
42
+ один additive remediation Task без нового Human gate; Core сохраняет Milestone semantics и выводит
43
+ authority из текущей Milestone authorization и exact audit evidence.
44
+ - исторический check-support decision проверяется против собственного Plan hash, а новый Plan может
45
+ продолжить только после явного принятия каждого support path в `allowedWrites` и `expectedOutputs`;
46
+ implicit scope carry-over и Human approval для этого exact machine-proved случая отсутствуют.
47
+ - после dependency registration и Knowledge rebind один общий fail-closed assessor управляет и
48
+ навигацией, и `task run`: переносится только точный dirty set с тем же content hash, registered HEAD,
49
+ непрерывной Plan/rebind chain и явным scope текущей Step; drift переводит route в `doctor`.
50
+ - failed check фиксируется одной project transaction: Core связывает checks и dirty-worktree hashes,
51
+ сохраняет неизменные product bytes, переводит Task в `needs_fix` и освобождает writer lease;
52
+ - failed strict review так же атомарно связывает remediation, Task pause и lease release; при повторной
53
+ authoritative reviewer cause та же transaction добавляет C1 yield до рекламы root-cause replan;
54
+ - rolling cause-bound refinement без числового лимита: новая причина остаётся в той же Task, а повтор
55
+ mechanically normalized cause либо stable reviewer `causeId` с `planConflict=true` требует replan
56
+ первопричины;
57
+ - evidence-bound transitive component-owner augmentation при неизменной semantic boundary и
58
+ PRA-derived production-edge obligation для multi-Step `runtime-composition` consumer с transitive
59
+ owner и исполняемым consumer check; простой one-Step runtime исключён;
60
+ - компактный `status` по умолчанию, подготовительный reviewer-runtime preflight вне sealed checkout и
61
+ явный review mode `ordinary|security` без неявного security scan;
62
+ - versioned matrix для route classes, реально наблюдавшихся в Signal: unique priority, predicate,
63
+ CLI/executor binding и successor witness; unsupported действия перечисляются явно.
64
+
65
+ ## 1.2. Что beta.13 не гарантирует
40
66
 
41
67
  - правильность продуктовой идеи или автоматически выбранного provider Task;
42
68
  - semantic sufficiency Plan, если точные факты нельзя доказать поддерживаемым analyzer;
43
69
  - параллельную работу нескольких writers в одном checkout;
44
70
  - автоматический structural replacement после `split-required`;
45
71
  - восстановление вручную повреждённого state без штатной recovery transition.
72
+ - product truth только из structural production-edge contract: он доказывает форму owner/consumer/check,
73
+ но не корректность требований, поведения продукта или Step-validity authority P02;
74
+ - глобально полный каталог state machine: observed-route matrix ограничена route classes из Signal и
75
+ хранит отдельный unsupported inventory;
76
+ - generic import product-first/shadow history либо синтетическое принятие Step, Task или Milestone.
46
77
 
47
78
  # 2. Шесть уровней и источники истины
48
79
 
@@ -68,7 +99,8 @@ Gateway разрешает только `node_modules/codex-workflow-v2/dist/src
68
99
  AGENTS.md
69
100
  -> project-local gateway
70
101
  -> gateway handshake
71
- -> status
102
+ -> status # bounded compact projection
103
+ -> status --full # только когда действительно нужна полная historical projection
72
104
  -> next [--task <exact TASK-ID>]
73
105
  -> только рекламируемая transition
74
106
  ```
@@ -86,7 +118,7 @@ AGENTS.md
86
118
  | Discovery state | Local Workflow state | Discovery transitions |
87
119
  | Brief, Plan, Result, evidence | Local Workflow state с versioned artifacts | Core transitions |
88
120
  | Task/Milestone state и sidecars | Local Workflow state | Core, CAS и schema validation |
89
- | Writer locks и private credentials | Local Workflow state | Lock manager и C1 transitions |
121
+ | Writer locks и private credentials | Local Workflow state; credential vault files mode `0600` | Lock manager и C1 transitions |
90
122
  | Transaction journals | Local Workflow state | Composite transition recovery |
91
123
  | codebase graph binding | Local Workflow state | Derived evidence, не product authority |
92
124
 
@@ -112,8 +144,8 @@ Discovery -> materialize -> Plan -> Plan Risk Audit
112
144
  -> final acceptance -> merge
113
145
  ```
114
146
 
115
- `task result-set` является последним execution lease-bound переходом. Он требует рекламируемый
116
- writer token, освобождает lease до `awaiting_final_acceptance` и тем самым допускает неограниченную
147
+ `task result-set` является последним execution lease-bound переходом. Он требует рекламируемую
148
+ writer credential reference, освобождает lease до `awaiting_final_acceptance` и тем самым допускает неограниченную
117
149
  по времени Human pause без stale-lock блокировки repository. После acceptance прежний token не
118
150
  переиспользуется: fresh `next` выдаёт bounded `task writer-credential-replace` для merge.
119
151
 
@@ -192,12 +224,15 @@ repository `status -> next`. Завершение дочернего чата с
192
224
 
193
225
  # 7. C1 handoff, lease и Git ownership
194
226
 
195
- `task handoff-prepare` возвращает одноразовый `credentialHandoff`. Он используется ровно один раз
196
- целевым actor в `task claim`. Claim проверяет Task/Milestone dependency binding и только затем выдаёт
197
- `writerLeaseReceipt`. `task run` обновляет активный lease и возвращает Step context.
227
+ `task handoff-prepare` возвращает `claimCredentialReference`, связанную с project, Task, target actor,
228
+ action и expiry. CLI разрешает `task claim` только с `--claim-credential-ref`, после успешного claim
229
+ удаляет одноразовый reference и возвращает `writerCredentialReference`. Lease-bound действия используют
230
+ только `--writer-credential-ref`. Legacy `--claim-token` и `--writer-token` отклоняются до transition.
198
231
 
199
- Bearer credentials нельзя печатать, сохранять в файлы, передавать Reviewer или включать в evidence.
200
- Если token утерян, используется только рекламируемая credential recovery transition.
232
+ Underlying bearer secret хранится только в regular local-vault file с mode `0600`; он не появляется в
233
+ argv, stdout, stderr, errors, packets или evidence. Reference не является переносимой authority: Core
234
+ проверяет project/entity/action/actor/expiry и integrity hash. Если reference утрачен или lease истёк,
235
+ используется только рекламируемая `task writer-credential-replace` для exact claimant.
201
236
 
202
237
  Worker меняет только `allowedWrites` и оставляет изменения uncommitted. Coordinator вызывает точный
203
238
  `task step-complete`; Core запускает checks, проверяет scope/history, создаёт один commit и evidence.
@@ -224,10 +259,59 @@ execution-authorized Plan и покрытое тем же Milestone Autonomy Con
224
259
  3. Reviewer возвращает закрытый schema-valid result без mutations.
225
260
  4. Core записывает его только если packet и seals не изменились.
226
261
 
227
- Failed review не ограничивает число попыток. Попытки 1-2 имеют mode `ordinary`, последующие —
228
- `corrective`; все исполнимы и требуют нового strict review. `route=fix` продолжает Task, а
229
- `route=replan` допустим только с точным Plan conflict и меняет лишь implementation Steps, не objective,
230
- requirements или acceptance. Explicit `split-required` и `stop-escalate` остаются stop/redirect decisions.
262
+ Native reviewer использует API-compatible strict Structured Output schema: каждый объявленный ключ object
263
+ обязателен, а семантически необязательные значения finding передаются как nullable. Malformed сочетание
264
+ `route`, `causeId` и `planConflict` не превращается в remediation authority и даёт unverified review.
265
+
266
+ Каждый packet создаётся только с явным `--review-mode ordinary|security`. Mode `ordinary` не запускает
267
+ и не подменяет проверку неявным security scan; mode `security` используется только когда security focus
268
+ запрошен явно. До выдачи packet Core формирует read-only reviewer-runtime preflight: exact Node и package
269
+ provenance, exact declared/locked/repository-local installed Workflow version, hash-verified runtime
270
+ build manifest и writable temporary cache за пределами sealed checkout. Перед каждым packet preflight
271
+ заново с диска разрешает фактический recursive dependency graph по parent-aware, nested-first правилам
272
+ Node и сверяет exact package manifests и SHA-256 runtime-файлов с build attestation. Поэтому уже
273
+ прогретый module cache не может скрыть удалённую, подменённую, конфликтующую либо symlink-redirected
274
+ dependency. Только после этой проверки preflight синхронно загружает через Node exact installed gateway,
275
+ reviewer и workflow graph. Общий gateway descriptor, который использует и CLI, подтверждает exact
276
+ package/protocol/schema; отдельный child process, произвольный timeout, cached trust decision и process
277
+ output не используются. Missing/stale build или dependency closure и failed runtime contract дают
278
+ `prepared=false`. Preflight не устанавливает dependencies и не изменяет checkout.
279
+
280
+ Новая beta.13 history не ограничивает число исправлений счётчиком. Каждый failure получает cause
281
+ bindings. Новая или неавторитетная причина продолжает ту же Task и проходит новый strict review.
282
+ Повтор одной authoritative причины после заявленного fix требует root-cause replan: для checks это
283
+ mechanically normalized fingerprint; для внешнего review — тот же stable `causeId` только вместе с
284
+ `planConflict=true`. Сходство текста и номер попытки authority не создают. `route=replan` меняет лишь
285
+ implementation Steps, не objective, requirements или acceptance. Legacy history без cause bindings
286
+ сохраняет прежний compatibility circuit; explicit `split-required` и `stop-escalate` остаются
287
+ stop/redirect decisions.
288
+
289
+ Если Step check не пройден, beta.13 одной transaction записывает remediation event, Task `needs_fix` с
290
+ hash-bound `failurePause` и удаление lease. Git HEAD и dirty bytes не меняются. Readback сверяет revision,
291
+ status, remediation hash, отсутствие lease, HEAD, dirty paths и их aggregate hash. Fresh `next` сначала
292
+ выдаёт credential replacement при отсутствии usable lease, затем route той же Task — fix или root-cause
293
+ replan. Ручной commit, state edit или потеря worktree не являются продолжением.
294
+
295
+ Failed strict review использует тот же continuation principle: review sidecars остаются append-only, а
296
+ одна project transaction записывает remediation и Task pause и удаляет exact proven lease. Если новый
297
+ event повторяет authoritative reviewer cause, transaction одновременно добавляет C1 yield. Поэтому
298
+ `task plan-set` рекламируется только при отсутствии writer lease и C1 claim; crash после durable review
299
+ sidecars восстанавливает один pause без duplicate remediation.
300
+
301
+ Для доказанного failed check Core может найти transitive component owner только по bounded static import
302
+ graph repository-local runner и только внутри уже затронутой component boundary. Same-Task augmentation
303
+ разрешена при неизменных objective, requirements, acceptance и security boundary hashes. Для multi-Step
304
+ Task независимая PRA-классификация consumer как `runtime-composition` требует
305
+ `requiresProductionEdges=true` и edge к существующему transitive owner Step с exact `checkRef`, который
306
+ действительно выполняет consumer. Пропуск planner-owned flag или edge блокирует admission; простой
307
+ one-Step runtime не требует искусственного predecessor. Это структурная admission-проверка, а не
308
+ доказательство product truth и не реализация Step-validity authority P02.
309
+
310
+ Versioned observed-route matrix v2 связывает все 13 Signal-observed route classes с unique priority и
311
+ одним exact production-transition witness либо real terminal observation на класс. Это class-level
312
+ доказательство: action-level metadata отдельно различает `executable-witnessed`, `unwitnessed` и
313
+ `unsupported`. Действия без CLI authority находятся в explicit unsupported inventory. Boundary
314
+ `signal-observed-route-class-witnesses` не заявляет полноту всех actions или будущих transition families.
231
315
 
232
316
  Beta.12.1 добавила одну append-only compatibility оговорку: beta.11 attempt-four
233
317
  `stop-escalate` после exact `ordinary, ordinary, corrective` и prior attempt-3 `continue-fix` можно
@@ -283,6 +367,85 @@ Task в `needs_fix`; stale Knowledge можно reconciliate/approve, но fresh
283
367
  всем dirty set. `task run` принимает carryover лишь при exact HEAD/path/hash match, после чего Step
284
368
  проходит обычные checks, Core-owned commit и strict review.
285
369
 
370
+ beta.12.9 закрывает исторический provenance gap corrective replan. Новые replan transitions автоматически
371
+ переносят evidence commits исключённых Steps в `invalidatedStepCommits`. Для уже существующего gap Core
372
+ требует один неожиданный commit, complete passed strict-review chain, verified reviewer attestation и
373
+ совпадающий прежний final acceptance. Если пакет уже зарегистрирован, recovery меняет только Task state.
374
+ Если exact beta.12.9 dependency commit ещё находится в HEAD, отдельный update compatibility route
375
+ регистрирует dependency и historical authority одной revision. Оба пути сохраняют dirty bytes текущего
376
+ Step, не переписывают Git и завершаются fresh обычным `step-complete` flow.
377
+
378
+ beta.12.11 закрывает иной класс тупика до начала выполнения. Если current Plan Risk Audit required Task
379
+ записал `stop-escalate`, потому что нужной upstream capability нет в scope этой Task, Core рекламирует
380
+ audited remediation. Coordinator сначала формализует capability обычным Discovery. Затем одна Project
381
+ transaction append-only создаёт required remediation Task на exact merged predecessor frontier исходной
382
+ Task, добавляет dependency blocked -> remediation и сохраняет все Milestone semantic fields и старые
383
+ memberships. Scope-change event связан с Task revision, Brief/Plan и audit hashes; повторное применение
384
+ того же audit невозможно. Текущая Milestone execution authorization и audit выводят
385
+ `corrective-derived` authority для Task authorize/accept без нового Human gate. Remediation Task проходит
386
+ обычный Plan, audit, C1, commits и reviews. После её merge исходная Task обязана заменить отвергнутый Plan,
387
+ пройти fresh audit и продолжить Step. Final Milestone acceptance не выводится автоматически.
388
+
389
+ Dependency-only update не должен создавать промежуточный Human gate. Если stale Knowledge отличается
390
+ только content hash `package.json`, все package surfaces уже равны runtime version, checkout clean, а
391
+ каждый Git commit, менявший `package.json` после approved hash, затрагивает ровно manifest/lock и только
392
+ Workflow pin, Core переносит reconcile и `corrective-derived` approval внутрь той же atomic remediation
393
+ transaction. Изменение любого другого Knowledge source, classification, gap или conflict fail-closed
394
+ остаётся в обычном явном approval flow.
395
+
396
+ beta.12.12 закрывает доказанный runtime Plan-integrity gap. Mechanical feasibility теперь статически
397
+ распознаёт repository-local `node <runner> affected`, когда исходник runner явно требует selector,
398
+ и блокирует authorization для `npm run <script>` без `--base`, `--head` или `--files`. Для уже начатой
399
+ Task recovery связывает не только первую, а всю последовательную checks-failed history, точный Plan,
400
+ manifest/runner hashes, HEAD и dirty allowlist. Exact beta.12.11 update bridge сохраняет product bytes,
401
+ регистрирует только dependency commit и атомарно обновляет Knowledge, если изменился только Workflow pin.
402
+ Результат — один `replan-required` decision и обычный corrective replan с исполняемой check command;
403
+ повтор старой команды, ручной commit product files и state editing не допускаются.
404
+
405
+ beta.12.15 устраняет следующий доказанный разрыв этого пути. Corrective-replan credential раздельно
406
+ связывает исходную Knowledge revision/hash Task и целевую active Knowledge revision/hash replacement
407
+ Plan. Различие разрешено только при exact Plan-integrity dependency recovery: текущий system commit,
408
+ package version, failed Step, Plan, полная remediation history, dirty file set и их bytes должны
409
+ совпасть. Один или несколько последовательных dependency-only updates после corrective yield могут
410
+ перенести ту же compatibility на новый HEAD: Core идёт назад до последнего зарегистрированного system
411
+ commit, проверяет каждый промежуточный commit как exact manifest/lock-only Workflow pin update и
412
+ атомарно регистрирует всю цепочку. Любой product diff, разрыв parent chain или изменённый worktree
413
+ fail-closed. Completed corrective-yield journal
414
+ остаётся историческим prefix-доказательством и не блокирует последующие append-only handoff events.
415
+ Completed corrective-replan journal также остаётся читаемым после эволюции binding manifest, но только
416
+ если его завершённый manifest/runtime/catalog tuple есть в append-only historical registry. Pending и
417
+ неизвестные identity по-прежнему fail-closed, поэтому compatibility не выдаёт новую authority.
418
+
419
+ beta.12.16 закрывает следующий доказанный разрыв: migration Step мог владеть новой SQL migration,
420
+ manifest и bootstrap, но не владеть TypeScript-модулем, который direct import из обязательного check
421
+ использовал как независимую SHA/catalog authority. Новый `wf2.check-support-anchor@1` блокирует такой
422
+ Plan до execution authorization. Для уже выполняемой Task после первого `checks-failed` Core связывает
423
+ Plan/Step/HEAD, полный dirty set, runner/support hashes, direct import, отсутствующий declared output и
424
+ существующие anchors. Если доказательство однозначно, append-only decision `continue-fix` выдаёт только
425
+ один exact support path как effective Step scope. Human replan не нужен, Plan hash и product bytes не
426
+ меняются, а Worker envelope, Core commit и sealed review packet явно используют и раскрывают derived
427
+ scope. Indirect import, dynamic shell, forbidden path, unrelated dirty file или отсутствие SHA anchors
428
+ fail-closed и не расширяют authority.
429
+
430
+ beta.12.17 закрывает transport-разрыв перед этим recovery: внешний runner больше не ожидает один
431
+ зашитый source release. Он выводит exact beta.12 source из declared dependency, требует равенства
432
+ locked, installed, current Task branch и active Milestone base и допускает только patch от .11 до
433
+ версии ниже runner. Dirty scope, отсутствие lease/transaction и dependency-only Git transport
434
+ остаются обязательными; product bytes и Workflow state вручную не изменяются.
435
+
436
+ beta.12.18 закрывает следующий post-rebind разрыв. Исторический check-support event остаётся валиден
437
+ по Plan hash, при котором был создан, даже если новый Plan теперь прямо владеет derived support path.
438
+ External preflight допускает продолжение только при одном таком event, неизменных dirty bytes,
439
+ отсутствии активного Step/lease/transaction и полном explicit scope adoption в planned Step. После
440
+ dependency-only transport Core заново связывает Knowledge и authorization; старый event не создаёт
441
+ скрытой authority и не модифицируется задним числом.
442
+
443
+ beta.12.19 закрывает оставшийся execution-boundary разрыв. Успешные transport, rebind, PRA и
444
+ authorization больше не заканчиваются рекламируемым, но невыполнимым `task run`: `next` и `runStep`
445
+ используют одну проверку registered recovery commit, exact dirty paths/content hash, historical
446
+ decision, Plan/rebind ancestry и current Step ownership. Совпадение разрешает только принятие уже
447
+ доказанных байтов; любое отличие блокирует запуск и не создаёт lease или commit.
448
+
286
449
  Docker socket `EPERM` в sandbox не является доказательством сломанного daemon. Gateway один раз
287
450
  повторяет exact health probe или Plan check с sandbox escalation без расходования remediation attempt.
288
451
  Restart Docker Desktop требует отдельного разрешения и допустим только после escalated daemon failure.
@@ -292,10 +455,16 @@ Restart Docker Desktop требует отдельного разрешения
292
455
  # 10. Operational checklist
293
456
 
294
457
  - exact package version установлен, bundled gateway соответствует release и переустановлен;
295
- - handshake подтверждает protocol 2, state schema 2 и beta.12.8 capabilities;
458
+ - handshake подтверждает `packageVersion=2.0.0-beta.13`, protocol 2, state schema 2 и beta.13
459
+ capabilities;
460
+ - routine observation начинается с компактного `status`; `status --full` запрашивается только для
461
+ расследования, которому действительно нужна полная historical projection;
296
462
  - каждый mutation следует свежему `status -> next` и exact option contract;
297
463
  - Docker permission failure сначала классифицируется как sandbox boundary, а не как infra retry;
298
464
  - semantic unknowns и human gates не маскируются delegation;
299
- - Task chats создаёт coordinator, credentials остаются только в памяти;
465
+ - Task chats создаёт coordinator; CLI получает только local-vault references и никогда не bearer secret;
466
+ - Reviewer packet прошёл runtime preflight и явно связан с `ordinary` либо `security` mode;
467
+ - production-edge contract трактуется как structural admission, а не как product acceptance;
468
+ - advertised route имеет Signal-observed matrix binding либо явно помечен unsupported;
300
469
  - dependencies, progress и review posture берутся из Core projections;
301
470
  - local state не редактируется вручную; release и package update выполняются только после safe preflight и обязательных checks.