codex-workflow-v2 2.0.0-alpha.7.2.1 → 2.0.0-beta.10

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 (164) hide show
  1. package/README.md +63 -7
  2. package/dist/src/alpha6/adoption.js +13 -3
  3. package/dist/src/alpha6/adoption.js.map +1 -1
  4. package/dist/src/alpha6/handoff.d.ts +23 -0
  5. package/dist/src/alpha6/handoff.js +221 -28
  6. package/dist/src/alpha6/handoff.js.map +1 -1
  7. package/dist/src/alpha6/milestone.d.ts +29 -0
  8. package/dist/src/alpha6/milestone.js +167 -1
  9. package/dist/src/alpha6/milestone.js.map +1 -1
  10. package/dist/src/alpha6/plan-risk.d.ts +1 -0
  11. package/dist/src/alpha6/plan-risk.js +15 -7
  12. package/dist/src/alpha6/plan-risk.js.map +1 -1
  13. package/dist/src/alpha6/remediation.js +18 -6
  14. package/dist/src/alpha6/remediation.js.map +1 -1
  15. package/dist/src/alpha6/review.d.ts +3 -0
  16. package/dist/src/alpha6/review.js +24 -0
  17. package/dist/src/alpha6/review.js.map +1 -1
  18. package/dist/src/beta1/project-transaction.d.ts +52 -0
  19. package/dist/src/beta1/project-transaction.js +297 -0
  20. package/dist/src/beta1/project-transaction.js.map +1 -0
  21. package/dist/src/cli.js +478 -32
  22. package/dist/src/cli.js.map +1 -1
  23. package/dist/src/contracts.d.ts +189 -5
  24. package/dist/src/contracts.js +1 -1
  25. package/dist/src/credential-output.d.ts +10 -0
  26. package/dist/src/credential-output.js +73 -0
  27. package/dist/src/credential-output.js.map +1 -0
  28. package/dist/src/dependency-provenance.d.ts +19 -0
  29. package/dist/src/dependency-provenance.js +185 -0
  30. package/dist/src/dependency-provenance.js.map +1 -0
  31. package/dist/src/diagnostics.d.ts +11 -0
  32. package/dist/src/diagnostics.js +54 -0
  33. package/dist/src/diagnostics.js.map +1 -1
  34. package/dist/src/errors.d.ts +1 -1
  35. package/dist/src/errors.js.map +1 -1
  36. package/dist/src/git.js +7 -9
  37. package/dist/src/git.js.map +1 -1
  38. package/dist/src/index.d.ts +1 -1
  39. package/dist/src/index.js +1 -1
  40. package/dist/src/index.js.map +1 -1
  41. package/dist/src/lifecycle/canonical-hash.d.ts +6 -0
  42. package/dist/src/lifecycle/canonical-hash.js +24 -0
  43. package/dist/src/lifecycle/canonical-hash.js.map +1 -0
  44. package/dist/src/lifecycle/catalog.d.ts +26 -0
  45. package/dist/src/lifecycle/catalog.js +208 -0
  46. package/dist/src/lifecycle/catalog.js.map +1 -0
  47. package/dist/src/lifecycle/compiler-inspection.d.ts +48 -0
  48. package/dist/src/lifecycle/compiler-inspection.js +29 -0
  49. package/dist/src/lifecycle/compiler-inspection.js.map +1 -0
  50. package/dist/src/lifecycle/core-static-readiness.d.ts +6 -0
  51. package/dist/src/lifecycle/core-static-readiness.js +130 -0
  52. package/dist/src/lifecycle/core-static-readiness.js.map +1 -0
  53. package/dist/src/lifecycle/corrective-replan-authority.d.ts +53 -0
  54. package/dist/src/lifecycle/corrective-replan-authority.js +139 -0
  55. package/dist/src/lifecycle/corrective-replan-authority.js.map +1 -0
  56. package/dist/src/lifecycle/corrective-replan-binding-manifest.d.ts +21 -0
  57. package/dist/src/lifecycle/corrective-replan-binding-manifest.js +35 -0
  58. package/dist/src/lifecycle/corrective-replan-binding-manifest.js.map +1 -0
  59. package/dist/src/lifecycle/corrective-replan-credential-core.d.ts +86 -0
  60. package/dist/src/lifecycle/corrective-replan-credential-core.js +563 -0
  61. package/dist/src/lifecycle/corrective-replan-credential-core.js.map +1 -0
  62. package/dist/src/lifecycle/corrective-replan-credential-schema.d.ts +17 -0
  63. package/dist/src/lifecycle/corrective-replan-credential-schema.js +44 -0
  64. package/dist/src/lifecycle/corrective-replan-credential-schema.js.map +1 -0
  65. package/dist/src/lifecycle/corrective-replan-credentials.d.ts +47 -0
  66. package/dist/src/lifecycle/corrective-replan-credentials.js +103 -0
  67. package/dist/src/lifecycle/corrective-replan-credentials.js.map +1 -0
  68. package/dist/src/lifecycle/corrective-replan.d.ts +64 -0
  69. package/dist/src/lifecycle/corrective-replan.js +548 -0
  70. package/dist/src/lifecycle/corrective-replan.js.map +1 -0
  71. package/dist/src/lifecycle/evaluator.d.ts +2 -0
  72. package/dist/src/lifecycle/evaluator.js +35 -0
  73. package/dist/src/lifecycle/evaluator.js.map +1 -0
  74. package/dist/src/lifecycle/fingerprint.d.ts +31 -0
  75. package/dist/src/lifecycle/fingerprint.js +388 -0
  76. package/dist/src/lifecycle/fingerprint.js.map +1 -0
  77. package/dist/src/lifecycle/immutable.d.ts +1 -0
  78. package/dist/src/lifecycle/immutable.js +10 -0
  79. package/dist/src/lifecycle/immutable.js.map +1 -0
  80. package/dist/src/lifecycle/implementation-table.d.ts +29 -0
  81. package/dist/src/lifecycle/implementation-table.js +87 -0
  82. package/dist/src/lifecycle/implementation-table.js.map +1 -0
  83. package/dist/src/lifecycle/index.d.ts +4 -0
  84. package/dist/src/lifecycle/index.js +5 -0
  85. package/dist/src/lifecycle/index.js.map +1 -0
  86. package/dist/src/lifecycle/schema-artifact.d.ts +12 -0
  87. package/dist/src/lifecycle/schema-artifact.js +214 -0
  88. package/dist/src/lifecycle/schema-artifact.js.map +1 -0
  89. package/dist/src/lifecycle/semantic-registry.d.ts +6 -0
  90. package/dist/src/lifecycle/semantic-registry.js +489 -0
  91. package/dist/src/lifecycle/semantic-registry.js.map +1 -0
  92. package/dist/src/lifecycle/types.d.ts +718 -0
  93. package/dist/src/lifecycle/types.js +4 -0
  94. package/dist/src/lifecycle/types.js.map +1 -0
  95. package/dist/src/observation.d.ts +20 -0
  96. package/dist/src/observation.js +171 -0
  97. package/dist/src/observation.js.map +1 -0
  98. package/dist/src/reviewer.d.ts +43 -1
  99. package/dist/src/reviewer.js +203 -50
  100. package/dist/src/reviewer.js.map +1 -1
  101. package/dist/src/state/corrective-replan-executor.d.ts +64 -0
  102. package/dist/src/state/corrective-replan-executor.js +608 -0
  103. package/dist/src/state/corrective-replan-executor.js.map +1 -0
  104. package/dist/src/state/corrective-replan-public-schema.d.ts +3 -0
  105. package/dist/src/state/corrective-replan-public-schema.js +43 -0
  106. package/dist/src/state/corrective-replan-public-schema.js.map +1 -0
  107. package/dist/src/state/corrective-replan-public.d.ts +95 -0
  108. package/dist/src/state/corrective-replan-public.js +665 -0
  109. package/dist/src/state/corrective-replan-public.js.map +1 -0
  110. package/dist/src/state/corrective-replan-transaction.d.ts +160 -0
  111. package/dist/src/state/corrective-replan-transaction.js +730 -0
  112. package/dist/src/state/corrective-replan-transaction.js.map +1 -0
  113. package/dist/src/state/corrective-yield-executor.d.ts +31 -0
  114. package/dist/src/state/corrective-yield-executor.js +236 -0
  115. package/dist/src/state/corrective-yield-executor.js.map +1 -0
  116. package/dist/src/state/corrective-yield-transaction.d.ts +97 -0
  117. package/dist/src/state/corrective-yield-transaction.js +591 -0
  118. package/dist/src/state/corrective-yield-transaction.js.map +1 -0
  119. package/dist/src/state/lock.d.ts +76 -3
  120. package/dist/src/state/lock.js +611 -30
  121. package/dist/src/state/lock.js.map +1 -1
  122. package/dist/src/state/store.d.ts +3 -0
  123. package/dist/src/state/store.js +65 -12
  124. package/dist/src/state/store.js.map +1 -1
  125. package/dist/src/transition-core.d.ts +67 -0
  126. package/dist/src/transition-core.js +318 -0
  127. package/dist/src/transition-core.js.map +1 -0
  128. package/dist/src/version.d.ts +1 -1
  129. package/dist/src/version.js +1 -1
  130. package/dist/src/version.js.map +1 -1
  131. package/dist/src/workflow.d.ts +93 -25
  132. package/dist/src/workflow.js +1712 -218
  133. package/dist/src/workflow.js.map +1 -1
  134. package/docs/autonomy-guardrails.md +43 -3
  135. package/docs/beta1-stabilization-brief.md +165 -0
  136. package/docs/beta2-initial-assembly-navigation-brief.md +616 -0
  137. package/docs/delegated-approval.md +30 -4
  138. package/docs/development-flow.md +38 -6
  139. package/docs/lifecycle/state-machine-stabilization.md +641 -0
  140. package/docs/project-memory.md +7 -5
  141. package/docs/release.md +25 -3
  142. package/docs/split-required-recovery.md +54 -0
  143. package/docs/stable-release-defect-register.md +730 -0
  144. package/docs/updating-existing-project.md +59 -4
  145. package/docs/validation-report.md +85 -56
  146. package/package.json +6 -2
  147. package/plugins/codex-workflow-gateway/.codex-plugin/plugin.json +10 -3
  148. package/plugins/codex-workflow-gateway/references/protocol.md +80 -5
  149. package/plugins/codex-workflow-gateway/scripts/chat-registry.mjs +376 -0
  150. package/plugins/codex-workflow-gateway/skills/codex-workflow-gateway/SKILL.md +255 -3
  151. package/references/state-machine.md +4 -1
  152. package/roles/delivery-coordinator.md +39 -0
  153. package/schemas/adoption-posture-event.schema.json +1 -1
  154. package/schemas/context-envelope.schema.json +1 -1
  155. package/schemas/corrective-replan-credentials.private.schema.json +98 -0
  156. package/schemas/corrective-replan-execution-event.private.schema.json +53 -0
  157. package/schemas/corrective-replan-public.schema.json +142 -0
  158. package/schemas/corrective-replan-task-transaction.private.schema.json +151 -0
  159. package/schemas/corrective-yield-task-transaction.private.schema.json +98 -0
  160. package/schemas/remediation-event.schema.json +11 -1
  161. package/schemas/task-handoff-event.schema.json +1 -1
  162. package/schemas/task.schema.json +25 -0
  163. package/schemas/transition-definition.schema.json +2609 -0
  164. package/schemas/transition-payloads.schema.json +140 -0
@@ -118,7 +118,32 @@ project, status active, delegate, scope, transitions и expiresAt. Не созд
118
118
  всегда agent:deputy, никогда user.
119
119
 
120
120
  Required Tasks выполняй последовательно. Для каждой Task обязательно создай
121
- отдельный пользовательский Codex-чат, передав ему Task delegate prompt, тот же actor и DGR-ID.
121
+ новую standalone Codex task через create_thread, а не fork/handoff/продолжение этого чата.
122
+ Передай только TaskContextPacket из свежего Workflow state: repository, exact Milestone/Task ID,
123
+ membership ordinal, Task revision/title, Brief/Plan bindings, requirements/acceptance, Task-local
124
+ scope/checks/stop conditions, маршрут status -> next --task <exact Task ID> и тот же actor/DGR-ID
125
+ только когда они требуются. Не передавай transcript этого чата, sibling Tasks, recovery narrative,
126
+ reasoning, confirmation codes, handoff credentials или writer tokens.
127
+ Title обязателен и выделяется проектным registry:
128
+ #NNN · M<NN>/T<NN> · Task · <Task title> · <TASK-ID>. До dispatch проверь уникальность
129
+ Task-ID-to-thread mapping, выполни exact registry readback и проверь Task-only input. Служебный
130
+ codex_delegation envelope с source_thread_id допустим, parent turns/transcript запрещены. Если
131
+ title отсутствует или изменён, явно переименуй и перепроверь. Ошибка create_thread не разрешает
132
+ fallback на fork_thread.
133
+ Если readback изменён, применяй только deterministic fallback registry; полный `#NNN`, ordinal и
134
+ entity ID сохраняются. В
135
+ TaskContextPacket потребуй закрытый secret-free CoordinatorReport на terminal/attention boundary:
136
+ Task ID, observed revision/status, outcome, next action, requiresUser, blocker class,
137
+ commits/checks/review evidence; никаких confirmation/handoff/writer bearer values.
138
+ После dispatch не завершай coordinator turn. Жди текущий Task-чат через bounded wait_threads,
139
+ сохраняй cursor, а при completed/attention прочитай чат и выполни свежий status -> общий next.
140
+ Если та же Task остаётся nonterminal и точный next допускает non-human continuation, продолжи тот
141
+ же чат через send_message_to_thread. Пользователя привлекай только для mandatory human/semantic
142
+ gate, external permission, unrecoverable integrity conflict или исчерпанного infrastructure retry.
143
+ Следующий Task-чат создавай только после подтверждённого Core terminal+merged результата текущей
144
+ Task. Завершать Milestone-чат при работающей nonterminal Task можно лишь по явной команде
145
+ checkpoint либо при таком блокере; обязательно сохрани Task/thread/host/title/cursor mapping и
146
+ fresh next для возобновления без duplicate dispatch.
122
147
  Milestone-чат не реализует Steps и не накапливает fix-loop всех Tasks;
123
148
  не запускай два writer на одном checkout. Worker и Reviewer не используют
124
149
  grant: approval-команды выполняет только delegate-координатор после их evidence.
@@ -160,9 +185,10 @@ exact `task step-complete` из `next`, а core выполняет checks, со
160
185
  записывает evidence. Worker не использует grant. При изменении Knowledge Map
161
186
  выполни reconcile; approve разрешён только при exact project_memory.approve
162
187
  option этого project-scoped grant. Затем knowledge-rebind и новая authorization.
163
- Если next содержит exact `contextRefresh` для того же grant, можешь вместо четырёх
164
- команд выполнить `task context-refresh`; при любом изменении source set,
165
- category/authority, gaps или conflicts используй обычный видимый процесс.
188
+ Если next возвращает top-level `action: task context-refresh` и exact `contextRefresh` для того же
189
+ grant, выполни только `task context-refresh`; не запускай перед ним standalone reconcile. Exact
190
+ Plan-declared supporting additions допустимы только когда их признал Core. При любом другом
191
+ изменении source set, category/authority, gaps или conflicts используй обычный видимый процесс.
166
192
 
167
193
  После submit запусти отдельный Independent Reviewer; Reviewer не использует
168
194
  grant и не исправляет код. После второго failed review не запускай очередной
@@ -40,6 +40,11 @@ failed checks, or any manual/unrecorded Worker commit block completion.
40
40
  If the current Plan Risk Audit marks the Step for strict review, the atomic commit is still
41
41
  created by core, but the Step remains non-terminal and `next` routes to `task step-review`
42
42
  until commit-bound strict review and reviewer attestation pass.
43
+ Use the exact claimant or required actor from `next` as `--actor`; the independent reviewer
44
+ runs inside Core and is not supplied as the CLI actor.
45
+ When `next` includes `gitMutationPolicy`, obtain bounded permission for that exact Git-writing
46
+ transition before the first call instead of probing and retrying after a `.git/index.lock`
47
+ failure. For `task start`, this applies only when invoking `--workspace-owner local`.
43
48
 
44
49
  After a Step changes approved project knowledge, the Delivery Coordinator reconciles and
45
50
  reapproves the Project Knowledge Map, then runs `task knowledge-rebind` between Steps. The
@@ -50,13 +55,17 @@ active Worker Step, a no-op binding, an invalid knowledge target, or a modified
50
55
  artifact. After the user authorizes the rebound Plan, execution resumes in the existing
51
56
  workspace; if all Steps are complete, the next action is submission.
52
57
 
53
- When `next.contextRefresh` exposes an eligible project-scoped grant and content-only mode,
54
- `task context-refresh` may compose reconcile, delegated map approval, rebind, and delegated
55
- execution reauthorization. Core validates both approval transitions before writing and
56
- rejects any source-set, category, scope, authority, gap, or conflict change.
58
+ When `next` returns top-level `action: task context-refresh` with an eligible grant,
59
+ `task context-refresh` composes reconcile, delegated map approval, rebind, and delegated
60
+ execution reauthorization. Do not run standalone reconcile first. Core validates both approval
61
+ transitions before writing. It permits content-only drift and exact Plan-declared supporting-source
62
+ additions under Milestone autonomy; every unsafe source-set, category, scope, authority, gap, or
63
+ conflict change is rejected.
57
64
 
58
65
  Submission requires a clean, auditable Task history and records evidence for the exact
59
- Task head. `task review-launch` starts a separate read-only reviewer. A passing fresh review
66
+ Task head. `task review-launch` starts a separate read-only reviewer and atomically records its
67
+ result. If C1 handoff is active, keep `--actor` equal to the current claimant or required actor
68
+ from `next`; the reviewer identity remains internal to the compound route. A passing fresh review
60
69
  permits Result creation. Human final acceptance binds Brief, Plan, Result, evidence, and
61
70
  the accepted head. Base advancement forces synchronization, checks, review, and acceptance
62
71
  to be repeated before merge.
@@ -95,7 +104,12 @@ may finish while an amendment awaits authorization.
95
104
 
96
105
  During initial planning, all linked Tasks may be materialized before one complete
97
106
  `milestone plan-set`; no execution is available until the Plan classifies every reverse
98
- membership. After that boundary, semantic changes use human-only
107
+ membership. Repository `next` returns `milestone initial-assembly` both before Task 1 and between
108
+ linked Tasks. Its `linked-task-assembly` option explicitly permits `discovery start` and
109
+ `discovery materialize`; after the first linked Task exists, its closing option permits one
110
+ complete `milestone plan-set`. A failed
111
+ `status` or `next` is not permission to call the closing command directly. After that boundary,
112
+ semantic changes use human-only
99
113
  `milestone scope-change-prepare` and `milestone scope-change-apply`. A previously issued
100
114
  Milestone Autonomy Contract may instead use `milestone autonomy-evolve` for membership-only
101
115
  changes while the outcome, success signal, acceptance, checks, discovery, and base branch
@@ -126,11 +140,29 @@ With an eligible `milestone.final_accept` grant, `next` additionally returns
126
140
  `delegatedApprovalOptions`. The delegate may then use the current `MSA-*` code in the same
127
141
  turn because the earlier grant-issuance turn is the controlling user decision. Without such
128
142
  an option, the ordinary later-message human gate remains mandatory.
143
+ Pass `--delegation-grant` only when the same `next` response exposes an exact eligible
144
+ `delegatedApprovalOptions` entry for that transition. Ordinary C1 handoff, claim, run,
145
+ step-complete, step-review, merge, and sync-base do not consume a Milestone approval grant.
129
146
 
130
147
  The Milestone coordinator keeps implementation out of its long-lived context: every required
131
148
  Task runs in a dedicated user-visible Task chat. The Milestone chat owns ordering, exact
132
149
  delegated transitions, merge observation, cross-Task validation, and final acceptance.
133
150
 
151
+ The coordinator creates that chat as a new standalone Codex task, never as a fork/handoff of its
152
+ own thread, and sends only a fresh TaskContextPacket for the exact Task. It creates or reuses the
153
+ chat just before dispatch, not as an empty membership placeholder. The project registry allocates
154
+ one monotonic `#NNN` and builds `#NNN · M<NN> · Coord · <Milestone title> · <MS-ID>` or
155
+ `#NNN · M<NN>/T<NN> · Task · <Task title> · <TASK-ID>`; the Task ordinal still comes from approved
156
+ membership order. Exact readback and registry-owned fallback are mandatory.
157
+
158
+ Dispatch is followed by an explicit coordinator supervision loop. The Milestone chat waits on the
159
+ one currently routed Task chat with bounded `wait_threads` calls, reads it when it completes or
160
+ needs attention, and then verifies repository `status -> next`. A recoverable non-human boundary is
161
+ returned to the same chat with `send_message_to_thread`; only a genuine user/semantic gate or
162
+ unrecoverable blocker ends the coordinator turn. The next Task chat is created only after Core
163
+ confirms that the prior required Task is terminal and merged. Task completion does not implicitly
164
+ wake a coordinator that has already ended its turn.
165
+
134
166
  ## Responsibility boundaries
135
167
 
136
168
  | Participant | Responsible for | Cannot decide |