codex-workflow-v2 2.0.0-beta.13.8 → 2.0.0-beta.14

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 (281) hide show
  1. package/README.md +27 -388
  2. package/dist/reviewer-runtime-build.json +96 -32
  3. package/dist/src/alpha6/adoption.d.ts +2 -0
  4. package/dist/src/alpha6/adoption.js +22 -0
  5. package/dist/src/alpha6/adoption.js.map +1 -1
  6. package/dist/src/alpha6/captured-check-evidence.d.ts +51 -0
  7. package/dist/src/alpha6/captured-check-evidence.js +152 -0
  8. package/dist/src/alpha6/captured-check-evidence.js.map +1 -0
  9. package/dist/src/alpha6/component-owner.d.ts +15 -1
  10. package/dist/src/alpha6/component-owner.js +44 -2
  11. package/dist/src/alpha6/component-owner.js.map +1 -1
  12. package/dist/src/alpha6/corrective-decision-boundary.d.ts +4 -0
  13. package/dist/src/alpha6/corrective-decision-boundary.js +47 -0
  14. package/dist/src/alpha6/corrective-decision-boundary.js.map +1 -0
  15. package/dist/src/alpha6/downstream-proof.d.ts +1 -25
  16. package/dist/src/alpha6/downstream-proof.js +0 -171
  17. package/dist/src/alpha6/downstream-proof.js.map +1 -1
  18. package/dist/src/alpha6/failed-step-planning-recovery.d.ts +10 -0
  19. package/dist/src/alpha6/failed-step-planning-recovery.js +93 -0
  20. package/dist/src/alpha6/failed-step-planning-recovery.js.map +1 -0
  21. package/dist/src/alpha6/literal-test-invocation.d.ts +2 -0
  22. package/dist/src/alpha6/literal-test-invocation.js +106 -0
  23. package/dist/src/alpha6/literal-test-invocation.js.map +1 -0
  24. package/dist/src/alpha6/milestone.d.ts +2 -0
  25. package/dist/src/alpha6/milestone.js +10 -1
  26. package/dist/src/alpha6/milestone.js.map +1 -1
  27. package/dist/src/alpha6/navigation-dirty-carryover.d.ts +11 -0
  28. package/dist/src/alpha6/navigation-dirty-carryover.js +130 -0
  29. package/dist/src/alpha6/navigation-dirty-carryover.js.map +1 -0
  30. package/dist/src/alpha6/plan-integrity.js +7 -5
  31. package/dist/src/alpha6/plan-integrity.js.map +1 -1
  32. package/dist/src/alpha6/plan-risk.d.ts +2 -0
  33. package/dist/src/alpha6/plan-risk.js +10 -3
  34. package/dist/src/alpha6/plan-risk.js.map +1 -1
  35. package/dist/src/alpha6/remediation.d.ts +6 -21
  36. package/dist/src/alpha6/remediation.js +161 -476
  37. package/dist/src/alpha6/remediation.js.map +1 -1
  38. package/dist/src/alpha6/root-cause-replan-carryover.d.ts +4 -1
  39. package/dist/src/alpha6/root-cause-replan-carryover.js +29 -5
  40. package/dist/src/alpha6/root-cause-replan-carryover.js.map +1 -1
  41. package/dist/src/beta1/project-transaction.d.ts +3 -1
  42. package/dist/src/beta1/project-transaction.js +6 -2
  43. package/dist/src/beta1/project-transaction.js.map +1 -1
  44. package/dist/src/checks/runner.d.ts +26 -0
  45. package/dist/src/checks/runner.js +223 -0
  46. package/dist/src/checks/runner.js.map +1 -0
  47. package/dist/src/checks/task-sync.d.ts +10 -0
  48. package/dist/src/checks/task-sync.js +41 -0
  49. package/dist/src/checks/task-sync.js.map +1 -0
  50. package/dist/src/checks/worker.d.ts +1 -0
  51. package/dist/src/checks/worker.js +154 -0
  52. package/dist/src/checks/worker.js.map +1 -0
  53. package/dist/src/cli-actions.d.ts +2 -2
  54. package/dist/src/cli-actions.js +3 -15
  55. package/dist/src/cli-actions.js.map +1 -1
  56. package/dist/src/cli.js +14 -98
  57. package/dist/src/cli.js.map +1 -1
  58. package/dist/src/contracts.d.ts +35 -32
  59. package/dist/src/dependency-provenance.d.ts +2 -2
  60. package/dist/src/dependency-provenance.js +12 -69
  61. package/dist/src/dependency-provenance.js.map +1 -1
  62. package/dist/src/domain/base-sync-conflict.d.ts +13 -0
  63. package/dist/src/domain/base-sync-conflict.js +32 -0
  64. package/dist/src/domain/base-sync-conflict.js.map +1 -0
  65. package/dist/src/domain/step-start-admission.d.ts +4 -0
  66. package/dist/src/domain/step-start-admission.js +9 -0
  67. package/dist/src/domain/step-start-admission.js.map +1 -0
  68. package/dist/src/domain/virgin-registration.d.ts +3 -0
  69. package/dist/src/domain/virgin-registration.js +65 -0
  70. package/dist/src/domain/virgin-registration.js.map +1 -0
  71. package/dist/src/errors.d.ts +1 -1
  72. package/dist/src/errors.js.map +1 -1
  73. package/dist/src/gateway-handshake.js +0 -8
  74. package/dist/src/gateway-handshake.js.map +1 -1
  75. package/dist/src/git.d.ts +3 -1
  76. package/dist/src/git.js +41 -14
  77. package/dist/src/git.js.map +1 -1
  78. package/dist/src/graph.js +25 -3
  79. package/dist/src/graph.js.map +1 -1
  80. package/dist/src/index.d.ts +1 -0
  81. package/dist/src/lifecycle/corrective-replan.js +3 -3
  82. package/dist/src/lifecycle/corrective-replan.js.map +1 -1
  83. package/dist/src/navigation-actions.d.ts +9 -0
  84. package/dist/src/navigation-actions.js +72 -0
  85. package/dist/src/navigation-actions.js.map +1 -0
  86. package/dist/src/navigation-update-artifact.d.ts +5 -0
  87. package/dist/src/navigation-update-artifact.js +227 -0
  88. package/dist/src/navigation-update-artifact.js.map +1 -0
  89. package/dist/src/navigation-update.d.ts +39 -0
  90. package/dist/src/navigation-update.js +82 -0
  91. package/dist/src/navigation-update.js.map +1 -0
  92. package/dist/src/observation.js +52 -29
  93. package/dist/src/observation.js.map +1 -1
  94. package/dist/src/observed-routes.js +5 -6
  95. package/dist/src/observed-routes.js.map +1 -1
  96. package/dist/src/pending-review-update.d.ts +0 -13
  97. package/dist/src/pending-review-update.js +1 -6
  98. package/dist/src/pending-review-update.js.map +1 -1
  99. package/dist/src/reviewer.d.ts +1 -1
  100. package/dist/src/reviewer.js +20 -17
  101. package/dist/src/reviewer.js.map +1 -1
  102. package/dist/src/runtime.d.ts +3 -0
  103. package/dist/src/runtime.js +6 -0
  104. package/dist/src/runtime.js.map +1 -0
  105. package/dist/src/state/corrective-replan-executor.d.ts +10 -0
  106. package/dist/src/state/corrective-replan-executor.js +37 -1
  107. package/dist/src/state/corrective-replan-executor.js.map +1 -1
  108. package/dist/src/state/corrective-replan-public-schema.js +15 -2
  109. package/dist/src/state/corrective-replan-public-schema.js.map +1 -1
  110. package/dist/src/state/corrective-replan-public.js +6 -5
  111. package/dist/src/state/corrective-replan-public.js.map +1 -1
  112. package/dist/src/state/corrective-replan-transaction.d.ts +1 -0
  113. package/dist/src/state/corrective-replan-transaction.js +12 -11
  114. package/dist/src/state/corrective-replan-transaction.js.map +1 -1
  115. package/dist/src/state/corrective-yield-executor.js +2 -2
  116. package/dist/src/state/corrective-yield-executor.js.map +1 -1
  117. package/dist/src/state/corrective-yield-transaction.d.ts +1 -0
  118. package/dist/src/state/corrective-yield-transaction.js +11 -10
  119. package/dist/src/state/corrective-yield-transaction.js.map +1 -1
  120. package/dist/src/state/lock.d.ts +4 -0
  121. package/dist/src/state/lock.js +21 -0
  122. package/dist/src/state/lock.js.map +1 -1
  123. package/dist/src/version.d.ts +1 -1
  124. package/dist/src/version.js +1 -1
  125. package/dist/src/version.js.map +1 -1
  126. package/dist/src/workflow-blocker-route.d.ts +8 -0
  127. package/dist/src/workflow-blocker-route.js +106 -0
  128. package/dist/src/workflow-blocker-route.js.map +1 -0
  129. package/dist/src/workflow.d.ts +48 -63
  130. package/dist/src/workflow.js +698 -1470
  131. package/dist/src/workflow.js.map +1 -1
  132. package/docs/autonomy-guardrails.md +26 -304
  133. package/docs/decisions.md +14 -112
  134. package/docs/development-flow.md +35 -238
  135. package/docs/project-memory.md +31 -50
  136. package/docs/release-app-evidence.md +190 -0
  137. package/docs/release.md +95 -363
  138. package/docs/updating-existing-project.md +19 -717
  139. package/package.json +11 -13
  140. package/plugins/codex-workflow-gateway/.codex-plugin/plugin.json +2 -2
  141. package/plugins/codex-workflow-gateway/references/chat-dispatch.md +73 -197
  142. package/plugins/codex-workflow-gateway/references/codebase-memory-routing.md +57 -0
  143. package/plugins/codex-workflow-gateway/references/protocol.md +42 -445
  144. package/plugins/codex-workflow-gateway/scripts/chat-dispatch.mjs +7 -1
  145. package/plugins/codex-workflow-gateway/scripts/chat-model-policy.mjs +10 -8
  146. package/plugins/codex-workflow-gateway/scripts/chat-registry.mjs +23 -5
  147. package/plugins/codex-workflow-gateway/skills/codex-workflow-gateway/SKILL.md +66 -740
  148. package/references/state-machine.md +4 -4
  149. package/roles/technical-planner.md +1 -1
  150. package/schemas/corrective-decision-event.schema.json +3 -1
  151. package/schemas/project-knowledge-map.schema.json +3 -1
  152. package/schemas/remediation-event.schema.json +10 -1
  153. package/schemas/task.schema.json +46 -2
  154. package/schemas/transition-payloads.schema.json +16 -1
  155. package/src/alpha6/adoption.ts +1123 -0
  156. package/src/alpha6/captured-check-evidence.ts +132 -0
  157. package/src/alpha6/check-support-anchor.ts +128 -0
  158. package/src/alpha6/component-owner.ts +168 -0
  159. package/src/alpha6/corrective-decision-boundary.ts +39 -0
  160. package/src/alpha6/downstream-proof.ts +520 -0
  161. package/src/alpha6/failed-step-planning-recovery.ts +88 -0
  162. package/src/alpha6/handoff.ts +1443 -0
  163. package/src/alpha6/journal.ts +473 -0
  164. package/src/alpha6/literal-test-invocation.ts +84 -0
  165. package/src/alpha6/mechanical-feasibility.ts +488 -0
  166. package/src/alpha6/milestone.ts +2192 -0
  167. package/src/alpha6/navigation-dirty-carryover.ts +154 -0
  168. package/src/alpha6/npm-check-contract.ts +47 -0
  169. package/src/alpha6/plan-integrity.ts +298 -0
  170. package/src/alpha6/plan-risk.ts +1480 -0
  171. package/src/alpha6/preexecution-replan.ts +187 -0
  172. package/src/alpha6/remediation-cause.ts +98 -0
  173. package/src/alpha6/remediation.ts +2438 -0
  174. package/src/alpha6/review.ts +1198 -0
  175. package/src/alpha6/root-cause-replan-carryover.ts +491 -0
  176. package/src/alpha6/store-sidecars.ts +335 -0
  177. package/src/alpha7/autonomy.ts +411 -0
  178. package/src/alpha7/corrective-recovery.ts +1332 -0
  179. package/src/artifacts.ts +130 -0
  180. package/src/beta1/project-transaction.ts +355 -0
  181. package/src/change-explanation.ts +153 -0
  182. package/src/checks/runner.ts +245 -0
  183. package/src/checks/task-sync.ts +41 -0
  184. package/src/checks/worker.ts +149 -0
  185. package/src/cli-actions.ts +107 -0
  186. package/src/cli.ts +1457 -0
  187. package/src/contracts.ts +1494 -0
  188. package/src/credential-output.ts +89 -0
  189. package/src/credential-transport.ts +215 -0
  190. package/src/delegation.ts +190 -0
  191. package/src/dependency-provenance.ts +472 -0
  192. package/src/diagnostics.ts +93 -0
  193. package/src/domain/base-sync-conflict.ts +35 -0
  194. package/src/domain/completed-step-carryover.ts +76 -0
  195. package/src/domain/discovery.ts +27 -0
  196. package/src/domain/plan-semantics.ts +58 -0
  197. package/src/domain/step-start-admission.ts +10 -0
  198. package/src/domain/validation.ts +177 -0
  199. package/src/domain/virgin-registration.ts +46 -0
  200. package/src/errors.ts +24 -0
  201. package/src/fs-utils.ts +61 -0
  202. package/src/gateway-handshake.ts +95 -0
  203. package/src/git.ts +183 -0
  204. package/src/graph.ts +342 -0
  205. package/src/historical-step-provenance.ts +136 -0
  206. package/src/index.ts +23 -0
  207. package/src/lifecycle/canonical-hash.ts +28 -0
  208. package/src/lifecycle/catalog.ts +202 -0
  209. package/src/lifecycle/compiler-inspection.ts +29 -0
  210. package/src/lifecycle/core-static-readiness.ts +132 -0
  211. package/src/lifecycle/corrective-replan-authority.ts +136 -0
  212. package/src/lifecycle/corrective-replan-binding-manifest.ts +51 -0
  213. package/src/lifecycle/corrective-replan-credential-core.ts +408 -0
  214. package/src/lifecycle/corrective-replan-credential-schema.ts +54 -0
  215. package/src/lifecycle/corrective-replan-credentials.ts +48 -0
  216. package/src/lifecycle/corrective-replan.ts +843 -0
  217. package/src/lifecycle/evaluator.ts +48 -0
  218. package/src/lifecycle/fingerprint.ts +488 -0
  219. package/src/lifecycle/immutable.ts +8 -0
  220. package/src/lifecycle/implementation-table.ts +118 -0
  221. package/src/lifecycle/index.ts +8 -0
  222. package/src/lifecycle/schema-artifact.ts +263 -0
  223. package/src/lifecycle/semantic-registry.ts +572 -0
  224. package/src/lifecycle/types.ts +838 -0
  225. package/src/memory.ts +273 -0
  226. package/src/migration.ts +161 -0
  227. package/src/navigation-actions.ts +70 -0
  228. package/src/navigation-update-artifact.ts +198 -0
  229. package/src/navigation-update.ts +121 -0
  230. package/src/observation.ts +225 -0
  231. package/src/observed-routes.ts +660 -0
  232. package/src/operational-contract.ts +125 -0
  233. package/src/pending-review-update.ts +175 -0
  234. package/src/repository.ts +99 -0
  235. package/src/reviewer.ts +1879 -0
  236. package/src/runtime.ts +6 -0
  237. package/src/state/corrective-replan-executor.ts +818 -0
  238. package/src/state/corrective-replan-public-schema.ts +83 -0
  239. package/src/state/corrective-replan-public.ts +908 -0
  240. package/src/state/corrective-replan-transaction.ts +949 -0
  241. package/src/state/corrective-yield-executor.ts +327 -0
  242. package/src/state/corrective-yield-transaction.ts +730 -0
  243. package/src/state/lock.ts +902 -0
  244. package/src/state/store.ts +567 -0
  245. package/src/transition-core.ts +330 -0
  246. package/src/ulid.ts +24 -0
  247. package/src/version.ts +2 -0
  248. package/src/workflow-blocker-route.ts +109 -0
  249. package/src/workflow.ts +10172 -0
  250. package/docs/alpha7.1-implementation-brief.md +0 -268
  251. package/docs/alpha7.2-corrective-context-refresh-brief.md +0 -484
  252. package/docs/alpha7.2.1-remediation-recovery-brief.md +0 -86
  253. package/docs/beta1-stabilization-brief.md +0 -165
  254. package/docs/beta11-plan-integrity-recovery-brief.md +0 -38
  255. package/docs/beta13.2-signal-review-recovery.md +0 -38
  256. package/docs/beta2-initial-assembly-navigation-brief.md +0 -616
  257. package/docs/change-model.md +0 -118
  258. package/docs/delegated-approval.md +0 -254
  259. package/docs/lifecycle/state-machine-stabilization.md +0 -641
  260. package/docs/pdf/README.md +0 -24
  261. package/docs/pdf/codex-workflow-v2-architecture-ru.pdf +0 -0
  262. package/docs/pdf/codex-workflow-v2-chat-only-guide-ru.pdf +0 -0
  263. package/docs/pdf/codex-workflow-v2-technical-reference-ru.pdf +0 -0
  264. package/docs/pdf/requirements.txt +0 -1
  265. package/docs/pdf/sources/codex-workflow-v2-architecture-ru.md +0 -478
  266. package/docs/pdf/sources/codex-workflow-v2-chat-only-guide-ru.md +0 -508
  267. package/docs/pdf/sources/codex-workflow-v2-technical-reference-ru.md +0 -778
  268. package/docs/pending-review-update.md +0 -15
  269. package/docs/problem-briefs/01-pre-implementation-integrity.md +0 -482
  270. package/docs/problem-briefs/02-minimal-step-integrity.md +0 -411
  271. package/docs/problem-briefs/03-minimal-agent-context-integrity.md +0 -358
  272. package/docs/problem-briefs/04-task-dependency-and-structural-replacement-integrity.md +0 -573
  273. package/docs/problem-briefs/BRIEF-TEMPLATE.md +0 -56
  274. package/docs/problem-briefs/README.md +0 -120
  275. package/docs/problem-briefs/evidence/p01-mechanical-feasibility-corpus.md +0 -90
  276. package/docs/problem-briefs/evidence/signal-v4-pre-m3-replay.md +0 -246
  277. package/docs/split-required-recovery.md +0 -47
  278. package/docs/stable-release-defect-register.md +0 -730
  279. package/docs/validation-report.md +0 -182
  280. package/scripts/generate-pdf-docs.py +0 -524
  281. package/scripts/run-pdf-docs.mjs +0 -62
@@ -1,264 +1,61 @@
1
- # Development Flow
1
+ # Current development flow
2
2
 
3
- ## Task lifecycle
3
+ ## Task and Milestone
4
4
 
5
- ```text
6
- Project Knowledge Map scan and approval
7
- -> Discovery
8
- -> Task materialization
9
- -> Plan with STEP-* entries and knowledge/graph declarations
10
- -> execution authorization
11
- -> local task branch or externally owned workspace
12
- -> one writer and one commit per Step
13
- -> submission evidence
14
- -> strict independent review
15
- -> Result
16
- -> final acceptance
17
- -> local merge or external merge confirmation
18
- ```
5
+ Project Knowledge → Discovery → Task/Brief → Plan and independent Risk Audit → execution authorization → claimed workspace → Steps → submission → independent review → Result → final acceptance → merge.
19
6
 
20
- Materialization requires an observable outcome, scope, acceptance criteria, and no
21
- blocking unknowns. No Task identifier or branch exists before this gate. Task authorization
22
- is hash-bound to Brief and Plan. Later Plan changes supersede it.
7
+ A Milestone orders required Tasks through an explicit dependency DAG and validates their combined result on its clean base branch. It has no integration branch. Initial assembly creates the linked Tasks before one complete membership Plan; `next` supplies the available assembly options. Required predecessors must be merged before a consumer starts. Started Tasks and completed evidence are retained in history.
23
8
 
24
- In alpha.7, execution authorization also requires a current Plan Risk Audit bound to the same
25
- Brief, Plan, Knowledge Map, and exact Step set. For existing schema 2 projects upgraded into
26
- alpha.7, execution additionally requires adoption posture first; remaining legacy scope then
27
- uses a bootstrap audit over the preserved non-`completed`, non-`skipped` Steps only.
28
- The audit names a Plan author and independent auditor, binds each guarded failure mode to
29
- exact executable evidence, and blocks authorization on `split-required` or `stop-escalate`.
9
+ Every mutation uses the current revision and exact Brief/Plan/HEAD bindings. Read `status`, then `next`; execute the advertised transition and refresh both after success. A failed observation or mutation does not authorize another route. `next` is navigation, not proof that arbitrary implementation work will finish.
30
10
 
31
- P01-A adds a second, bounded admission check without adding a lifecycle stage. Before
32
- `task authorize`, Core reads the selected committed source and recognizes only three versioned
33
- mechanical forms: an exact root `npm run <literal-script>`, an exact structured
34
- `path:<repository-relative POSIX path>` output, and that same path supplied by an exact transitive
35
- Step predecessor with write authority. A proved contradiction returns to `task plan-set` without
36
- writing an approval. Unsupported commands, prose, or ambiguous future creation remain
37
- `unverified`, not pass or failure. A clear payload is stored inside the execution authorization,
38
- bound to the Brief, Plan, analyzer inputs/set, selected HEAD, and phase-aware base/Task branch.
39
- Freshness is checked before claim lease acquisition, Task start, and direct execution entry.
11
+ ## Planning and execution
40
12
 
41
- Local execution creates `codex/task-<id>-<slug>` from a clean base only after authorization.
42
- An externally owned checkout must already use a dedicated non-base branch. The core never
43
- creates or removes external worktrees. Each Step declares allowed writes, dependencies, and
44
- checks. `task run` dispatches exactly one Step and returns a writer lease. The Worker changes
45
- only allowed files and leaves them uncommitted. Repository-level `next` then returns the exact
46
- `task step-complete` transition for the active Step. That core transition runs checks, stages
47
- the allowed changes, creates the atomic Step commit, and records evidence. Unexpected paths,
48
- failed checks, or any manual/unrecorded Worker commit block completion.
13
+ Discovery must establish an observable outcome, scope, acceptance and resolved blocking unknowns before materialization. A Plan maps requirements to Steps, dependencies, exact allowed paths, checks, outputs and Knowledge impact. The independent Plan Risk Audit binds the same Plan and source context. A proved mechanical contradiction returns to planning; unsupported analysis is `unverified`, not a pass.
49
14
 
50
- If the current Plan Risk Audit marks the Step for strict review, the atomic commit is still
51
- created by core, but the Step remains non-terminal and `next` routes to `task step-review`
52
- until commit-bound strict review and reviewer attestation pass.
53
- Use the exact claimant or required actor from `next` as `--actor`; the independent reviewer
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.
58
- When `next` includes `gitMutationPolicy`, obtain bounded permission for that exact Git-writing
59
- transition before the first call instead of probing and retrying after a `.git/index.lock`
60
- failure. For `task start`, this applies only when invoking `--workspace-owner local`.
15
+ Authorization binds the Plan and its audit. Plan changes supersede it. Local execution starts on the Task branch; an externally owned workspace must already be on a dedicated non-base branch. A current claimant and local credential reference are required wherever fresh `next` specifies them.
61
16
 
62
- After a Step changes approved project knowledge, the Delivery Coordinator reconciles and
63
- reapproves the Project Knowledge Map, then runs `task knowledge-rebind` between Steps. The
64
- transition rebuilds `plan.md` from the stored semantic Plan and the active map binding,
65
- preserves Step status and evidence, records the rebind, supersedes every current execution
66
- authorization, and moves the Task to `awaiting_execution_authorization`. It rejects an
67
- active Worker Step, a no-op binding, an invalid knowledge target, or a modified Plan
68
- artifact. After the user authorizes the rebound Plan, execution resumes in the existing
69
- workspace; if all Steps are complete, the next action is submission.
17
+ The Worker changes only the dispatched Step's effective allowed paths and leaves changes uncommitted. Core `task step-complete` runs checks, verifies history, makes the atomic Step commit and records evidence. Guarded Steps remain pending until an independent strict review and attestation bind that exact commit. Never substitute a manual commit or a self-authored review.
70
18
 
71
- When `next` returns top-level `action: task context-refresh` with an eligible grant,
72
- `task context-refresh` composes reconcile, delegated map approval, rebind, and delegated
73
- execution reauthorization. Do not run standalone reconcile first. Core validates both approval
74
- transitions before writing. It permits content-only drift and exact Plan-declared supporting-source
75
- additions under Milestone autonomy; every unsafe source-set, category, scope, authority, gap, or
76
- conflict change is rejected.
19
+ Failed review ordinarily returns to a fix in the same Task. Attempt count does not authorize success or impose an artificial terminal stop. A replan requires recorded evidence of a Plan obstruction and preserves Task objective, requirements and acceptance. Completed Steps remain verified history. See [guardrails](autonomy-guardrails.md) for recovery and authority boundaries.
77
20
 
78
- Submission requires a clean, auditable Task history and records evidence for the exact
79
- Task head. `task review-launch` starts a separate read-only reviewer and atomically records its
80
- result. If C1 handoff is active, keep `--actor` equal to the current claimant or required actor
81
- from `next`; the reviewer identity remains internal to the compound route. A passing fresh review
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
86
- to be repeated before merge.
21
+ After Knowledge changes between Steps, use the current rebind or atomic context-refresh route described in [project memory](project-memory.md). Pending completion/review and already-started failed-Step recovery must not be bypassed with a Knowledge refresh. A fresh execution authorization is required where Core superseded the prior one.
87
22
 
88
- The Technical Planner performs a risk review before authorization. Migration work includes a
89
- populated forward-upgrade check; concurrent state includes deterministic races; restart,
90
- replay, and crash claims include restart/crash-window evidence; provider work includes
91
- failure injection and hidden-default verification. Repeated failed reviews remain on the same
92
- Task. They require a new remediation Step for final Task review, or another implementation and
93
- fresh strict review for a failed guarded Step; they do not require a separate corrective Auditor
94
- based only on attempt count. Guarded attempts above two are recorded as `corrective` and remain
95
- executable. A reviewer routes to `replan` only with an exact Plan obstruction and minimal Plan
96
- change; ordinary findings default to `fix`. Remediation cannot change the Task objective,
97
- requirements, or acceptance.
23
+ Submission binds a clean, auditable Task HEAD. Passing independent review permits Result creation. Result entry releases the execution lease before the human final-acceptance wait; reacquire the credential through fresh `next` before merge. Base advancement can require synchronization, validation and acceptance again.
98
24
 
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.
25
+ After every required Task is merged, Milestone validation binds Result, checks and the clean base HEAD. Acceptance uses its exact current confirmation binding. Cancellation retains history and never reverts merged code.
106
26
 
107
- If a later proof Step leaves changes both in its own scope and in files owned by a completed
108
- transitive predecessor, fresh `next` advertises `task downstream-proof-recover` instead of
109
- `task step-complete`. The command preserves the dirty worktree and HEAD, append-only records the
110
- invalidated predecessor completion, yields its C1 lease, and returns the same Task to `task plan-set`.
111
- The replacement Plan must cover the unfinished remainder and pass a fresh Risk Audit and execution
112
- authorization. Do not stash, reset, commit, or recreate the Task around this route.
27
+ ## Roles and supervision
113
28
 
114
- If the repository is still on a package version that cannot advertise that route, beta.12.6 has
115
- one update-only bridge. After exact dependency-only commits have aligned the active Milestone base
116
- and Task branch, `update downstream-proof-dependency-recover` validates recorded history at the
117
- candidate parent, binds the active proof dirty set by content hash, and registers only the Task
118
- dependency commit. Product bytes and Step state remain unchanged; fresh `next` must then advertise
119
- the ordinary `task downstream-proof-recover`. This is not a general dirty-update permission.
29
+ | Role | Owns | Does not grant |
30
+ |---|---|---|
31
+ | User / principal | Semantic scope, classifications, consent and grant policy | Fabricated evidence |
32
+ | Scope Lead | Discovery and unresolved questions | Product edits |
33
+ | Technical Planner | Plan and requirement/check mapping | Execution approval |
34
+ | Coordinator | Current route, dispatch, supervision and closure | Arbitrary authority or scope expansion |
35
+ | Worker | One dispatched Step | Plan changes, self-review or manual Core commits |
36
+ | Independent Reviewer | Immutable review packet and evidence | Fixes or acceptance |
37
+ | Core | State, hashes, transactions, ownership and Git mechanics | Semantic product decisions |
120
38
 
121
- If beta.12.6 already performed that recovery but a subsequent Knowledge approval mechanically
122
- rebound its rejected Plan, use only the beta.12.7 stranded-replan bridge advertised by fresh `next`.
123
- The source preflight runs before dependency transport and binds the exact beta.12.6 Task revision,
124
- HEAD, dirty paths, and content hash. After dependency-only base/Task commits and provenance recovery,
125
- `task downstream-proof-replan-recover` restores `needs_fix`. Reconcile/approve stale Project Knowledge,
126
- then replace the full unfinished Plan. The preserved dirty set may enter execution only through one
127
- new Step whose `allowedWrites` owns every path and whose fresh `next` reports validated carryover.
128
- Completing that Step still requires its checks, Core-owned commit, and any guarded strict review.
39
+ Use one dedicated Task chat per required Task and a supervising Milestone coordinator. Dispatch uses the packaged registry's unique mapping and fresh TaskContextPacket. A completed chat is not a merged Task: inspect Core state before dispatching a successor. Recoverable continuation stays in the same Task chat. The coordinator waits on active work and stops for a real user gate, an unrecoverable blocker or terminal closure.
129
40
 
130
- A sandboxed Docker `EPERM`, `operation not permitted`, or `permission denied` result is not a failed
131
- daemon check. Re-run the exact probe/check once with sandbox escalation without consuming a retry.
132
- Restart Docker Desktop only with separate authorization after the escalated call reaches Docker and
133
- proves the daemon unavailable.
41
+ For a tracked Worker, verify the real App checkout with `dispatch-context-check` before the first write and after a checkout/branch change. A match is not a writer credential or filesystem permission. Independent reviewers inspect only the bound immutable packet and repository evidence; a different reviewer checkout is not a reason to mutate or reconcile it.
134
42
 
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
137
- previously issued an active delegation grant for the exact transition and scope, the named
138
- delegate may perform that transition with `--delegation-grant`. The event keeps the delegate
139
- as actor and separately records the principal and policy hash. Expired, revoked, wrong-scope,
140
- wrong-transition, and wrong-actor grants are rejected before the lifecycle state changes.
43
+ ## Explaining a change
141
44
 
142
- ## Milestone lifecycle
45
+ Use `change explain --task <id> --file <proposal.json>` to assess additional paths, membership or semantic scope against current state. Its closed proposal binds revision, request, HEAD and dirty bytes; it grants no permission. `requiresUser: null` is unknown, not approval. An external permission denial remains separate from Workflow grants.
143
46
 
144
- ```text
145
- Discovery -> Milestone planning -> execution authorization -> active
146
- -> required Tasks merge independently into base
147
- -> cross-Task validation on clean base HEAD
148
- -> final acceptance -> accepted
149
- ```
47
+ Machine-proved check-support scope may use the exact advertised recovery. Unproved additional paths require Plan review. Membership changes and semantic scope changes use their own authority; never widen `allowedWrites` manually. Command input shapes come from the current local CLI `--help`, not copied historical recipes.
150
48
 
151
- A Milestone Plan records outcome, success signal, acceptance, checks, Task membership, and the
152
- canonical Task dependency DAG. Every membership explicitly supplies `dependsOnTaskIds`, including
153
- `[]`. A required consumer may depend only on required members of the same Milestone; duplicate,
154
- self, dangling, external, non-required-provider, and cyclic edges are rejected before commit.
155
- Membership is `required`, `waived`, or `cancelled`; non-required entries require a reason.
156
- Changing the Plan increments the membership revision, supersedes execution authorization,
157
- and prevents new linked Tasks from starting. A Task that has started cannot be removed;
158
- it can be retained as waived/cancelled with history and reason. Tasks already in progress
159
- may finish while an amendment awaits authorization.
49
+ ## Check execution failures
160
50
 
161
- During initial planning, all linked Tasks may be materialized before one complete
162
- `milestone plan-set`; no execution is available until the Plan classifies every reverse
163
- membership. Repository `next` returns `milestone initial-assembly` both before Task 1 and between
164
- linked Tasks. Its `linked-task-assembly` option explicitly permits `discovery start` and
165
- `discovery materialize`; after the first linked Task exists, its closing option permits one
166
- complete `milestone plan-set`. A failed
167
- `status` or `next` is not permission to call the closing command directly. After that boundary,
168
- semantic changes use human-only
169
- `milestone scope-change-prepare` and `milestone scope-change-apply`. A previously issued
170
- Milestone Autonomy Contract may instead use `milestone autonomy-evolve` for membership-only
171
- changes while the outcome, success signal, acceptance, checks, discovery, and base branch
172
- remain unchanged. The same contract may complete an atomic content-only Task context refresh
173
- without a new human gate, but cannot approve Project Memory independently. Both paths retain
174
- journaled recovery across `state.json`, `plan.json`, and `scope-change-events.jsonl`. The initial
175
- Plan uses the same recovery machinery for its exact two-file `state.json` + `plan.json` commit and
176
- does not manufacture a scope-change event.
51
+ Core drains stdout and stderr while checks run and retains a bounded output tail; large output alone is not a failed check. An ordinary nonzero exit follows the existing product-check failure route. Spawn failures, shell command-unavailable exits (126/127), signals, deadlines, cancellation and unconfirmed cleanup return `CHECK_INFRASTRUCTURE_FAILED` with diagnostic results instead. They do not create a failed-Step cause or authorize fix/replan. Stop the failed invocation, diagnose its infrastructure result, then obtain fresh `status` and `next` before an explicit retry; there is no automatic retry.
177
52
 
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:
53
+ Checks default to 120 seconds per command and 600 seconds for the command batch, plus bounded process cleanup. Configure positive millisecond limits with `CODEX_WORKFLOW_CHECK_TIMEOUT_MS` and `CODEX_WORKFLOW_CHECK_TOTAL_TIMEOUT_MS` (maximum 600000). Library callers can supply `CheckExecutionOptions` as the fourth `WorkflowService` constructor argument. These limits are independent of the repository's development-test deadlines.
182
54
 
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.
55
+ The synchronous API does not promise delivery of a live JavaScript `AbortSignal` while it blocks. An absolute `CODEX_WORKFLOW_CHECK_CANCEL_FILE` path (or `cancellationFile` option) provides explicit cancellation: creating the file cancels the current check; an existing file prevents launch. The caller owns this file and must clear its cancellation request before an intentional retry. Caller termination is monitored by the separate supervisor. The command and batch deadlines include helper startup.
192
56
 
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.
57
+ On the supported POSIX host, each check has an owned process group. Timeout/cancellation sends TERM then KILL and verifies cleanup before returning success or a product failure; unconfirmed cleanup is an infrastructure failure. The result explicitly reports `cleanupScope: owned-process-group`. Check commands must remain in that owned group: arbitrary daemonization into another session is not an isolation or containment guarantee. Checks have no interactive stdin. Normal shell exit codes are preserved; Core does not invent a signal from a conventional numeric shell exit.
201
58
 
202
- A Milestone has no integration branch. Validation requires all required Tasks to be
203
- `merged`, checks the current clean base branch, and writes evidence plus Result. Final
204
- acceptance binds those artifacts to the unchanged base HEAD. Cancellation records a reason
205
- and never changes Task state or reverts merged commits.
59
+ Infrastructure failure preserves uncommitted files and does not reset Git or manufacture new approvals. Step completion remains retryable under its existing state; Milestone validation leaves its prior result and approvals unchanged. After a Task base sync, Core records the new Git history and invalidates the old final acceptance before checks. Pending sync validation must finish through fresh `task sync-base` without another merge; review, result and acceptance cannot bypass it. A changed Task HEAD, check binding or dirty checkout requires diagnosis and blocks that continuation without deleting files.
206
60
 
207
- Repository-level `next` considers Milestone membership and dependencies before it dispatches a
208
- Task. A linked Task is actionable only while its Milestone is `active`, its current membership is
209
- `required`, and every declared required predecessor is `merged`. Handoff prepare, claim before
210
- lease acquisition, and Task start use the same predicate. Unstarted `waived`/`cancelled`
211
- memberships and Tasks belonging to
212
- an accepted/cancelled Milestone are historical records, not work. A Task that already owns
213
- a workspace does not bypass an unsatisfied Milestone predecessor.
214
-
215
- After successful Milestone validation, `next` emits `requiredHumanGate` containing the
216
- Milestone revision, Plan/Result/evidence hashes, validated base HEAD, and a deterministic
217
- confirmation code. The coordinator must show this complete binding and stop. Only a later,
218
- explicit user response containing that code permits `milestone accept --actor ...
219
- --confirmation-code ...`. The CLI rejects a missing, stale, or mismatched code. This proves
220
- that the recorded confirmation matches the displayed state; identity still depends on the
221
- trusted Codex/user interaction boundary rather than on the local npm package alone.
222
-
223
- With an eligible `milestone.final_accept` grant, `next` additionally returns
224
- `delegatedApprovalOptions`. The delegate may then use the current `MSA-*` code in the same
225
- turn because the earlier grant-issuance turn is the controlling user decision. Without such
226
- an option, the ordinary later-message human gate remains mandatory.
227
- Pass `--delegation-grant` only when the same `next` response exposes an exact eligible
228
- `delegatedApprovalOptions` entry for that transition. Ordinary C1 handoff, claim, run,
229
- step-complete, step-review, merge, and sync-base do not consume a Milestone approval grant.
230
-
231
- The Milestone coordinator keeps implementation out of its long-lived context: every required
232
- Task runs in a dedicated user-visible Task chat. The Milestone chat owns ordering, exact
233
- delegated transitions, merge observation, cross-Task validation, and final acceptance.
234
-
235
- The coordinator creates that chat as a new standalone Codex task, never as a fork/handoff of its
236
- own thread, and sends only a fresh TaskContextPacket for the exact Task. It creates or reuses the
237
- chat just before dispatch, not as an empty membership placeholder. The project registry allocates
238
- one monotonic `#NNN` and builds `#NNN · M<NN> · Coord · <Milestone title> · <MS-ID>` or
239
- `#NNN · M<NN>/T<NN> · Task · <Task title> · <TASK-ID>`; the Task ordinal still comes from approved
240
- membership order. Exact readback and registry-owned fallback are mandatory.
241
-
242
- Dispatch is followed by an explicit coordinator supervision loop. The Milestone chat waits on the
243
- one currently routed Task chat with bounded `wait_threads` calls, reads it when it completes or
244
- needs attention, and then verifies repository `status -> next`. A recoverable non-human boundary is
245
- returned to the same chat with `send_message_to_thread`; only a genuine user/semantic gate or
246
- unrecoverable blocker ends the coordinator turn. The next Task chat is created only after Core
247
- confirms that the prior required Task is terminal and merged. Task completion does not implicitly
248
- wake a coordinator that has already ended its turn.
249
-
250
- ## Responsibility boundaries
251
-
252
- | Participant | Responsible for | Cannot decide |
253
- | --- | --- | --- |
254
- | User / principal | map classifications, direct approvals, delegation policy and revocation, arbitrary scope changes | implementation evidence |
255
- | Delegate | only transitions explicitly allowed by an active grant | grant creation, expansion, impersonating the principal |
256
- | Scope Lead | discovery, facts, unknowns, Task/Milestone recommendation | production edits |
257
- | Technical Planner | requirements mapping, Steps, checks, knowledge impact | authorization |
258
- | Delivery Coordinator | valid transitions, dispatch, evidence collection, exact audited-remediation route | arbitrary scope expansion |
259
- | Worker | one dispatched Step within allowed paths | adjacent Steps or Plan changes |
260
- | Independent Reviewer | isolated comparison of requirements, diff, checks, and evidence | fixes or acceptance |
261
- | Core CLI | state, revisions, hashes, locks, Git mechanics, diagnostics | semantic product choices |
262
-
263
- All mutations use revision compare-and-swap. Dirty state, stale hashes, concurrent writers,
264
- scope drift, failed checks, invalid reviewer isolation, and changed base HEAD fail closed.
61
+ A base branch that advances again while Task sync validation is pending does not block validation of the recorded Task snapshot. After renewed review and acceptance, the usual base-sync route handles the newer base. If cleanup cannot be verified, retain the reported `cleanupEvidencePath` for diagnosis; it is not permission to signal arbitrary processes or to retry blindly.
@@ -1,50 +1,31 @@
1
- # Project Memory
2
-
3
- ## Durable source
4
-
5
- Ordinary version-controlled project files are the only durable project memory. Examples
6
- include `AGENTS.md`, `README.md`, architecture and decision documents, command references,
7
- ownership rules, testing guidance, operations runbooks, and domain documentation. V2 does
8
- not create a parallel repository memory bank and does not store file contents in local state.
9
-
10
- ## Project Knowledge Map
11
-
12
- `project-memory scan` deterministically discovers candidate files and stores only path,
13
- category, scope, authority, content hash, and verification metadata in local state. The user
14
- approves canonical/supporting choices. Conflicts and missing categories remain explicit.
15
-
16
- - Scope Lead scans, presents gaps/conflicts, and requests classification decisions.
17
- - User owns canonical/supporting approval and resolves semantic conflicts.
18
- - Technical Planner reads approved sources and declares knowledge impact and targets in Plan.
19
- - Worker reads canonical sources plus approved Step targets and updates only targets allowed
20
- by the Plan.
21
- - Independent Reviewer checks that required durable knowledge changes are present and bound
22
- to the reviewed commit.
23
- - Delivery Coordinator re-scans after relevant changes, reconciles and reapproves the map,
24
- then uses `task knowledge-rebind` before requesting fresh execution authorization.
25
-
26
- If any approved file changes, the derived map becomes stale. `project-memory reconcile`
27
- updates discovered metadata; changed classifications require user approval. A knowledge
28
- rebind is mechanical: it may change only the Plan's map revision/hash, preserves every Step
29
- definition, status, and evidence record, records the old/new binding, supersedes execution
30
- authorization, and cannot run while a Step is in progress. If local state is lost, the map
31
- is rebuilt from repository files.
32
-
33
- For delegated autonomy, repository `next` returns top-level `action: task context-refresh` and an
34
- exact `contextRefresh` option when the stored map was active and inspection proves eligible drift.
35
- Do not run standalone reconcile first. `task context-refresh` then performs
36
- reconcile, delegated map approval, Task rebind, and delegated execution authorization while
37
- preserving the ordinary audit events. In addition to content-only drift, a Milestone Autonomy Grant
38
- may admit one or more exact Plan-declared supporting sources. The command rejects removed,
39
- undeclared, canonical, category/scope/authority-changing, gap-changing, and conflicting sources.
40
- Those changes remain visible for normal classification and approval.
41
-
42
- ## Codebase graph
43
-
44
- The graph is an optional derived index, never the durable memory authority. The gateway asks
45
- the core for a fingerprinted refresh request, invokes `codebase-memory-mcp`, and returns
46
- evidence. The core accepts evidence only for the current root, HEAD/package fingerprint,
47
- mode, and request ID. The product graph retains its current binding. The workflow graph also
48
- retains one previous package-version binding. A stale or unavailable provider is recorded
49
- as explicit fallback; agents continue from approved repository sources and must not present
50
- fallback as fresh graph evidence.
1
+ # Project Knowledge and code orientation
2
+
3
+ Version-controlled repository files are durable project knowledge. The local Knowledge Map stores paths, classification, scope, authority and hashes; it does not create a second memory bank or make an MCP index authoritative.
4
+
5
+ Scope Lead discovers sources and unresolved conflicts; the user approves canonical/supporting classifications. Plans bind approved sources and declare Knowledge impact. Workers update only authorized targets, reviewers verify the result, and coordinators reconcile changed source bindings.
6
+
7
+ A changed approved file makes its map binding stale. Rebind is mechanical: it preserves Step definitions, status and evidence, records old/new bindings and supersedes execution authorization. It cannot run over an active Worker Step or conceal a Plan obstruction. Pending strict review retains its immutable historical binding and precedes current-map rebind.
8
+
9
+ When fresh `next` returns `task context-refresh`, use its exact eligible delegate/grant and Task/Knowledge revisions without standalone reconcile first. Core atomically combines reconciliation, scoped approval, rebind and, where execution is eligible, reauthorization. A planning-only refresh preserves stopped planning without execution authority. Content-only drift is eligible only with unchanged classifications, scope, authority, gaps and conflicts. A Milestone contract may additionally admit exact supporting sources already declared by the authorized Plan. Removed, canonical, undeclared or conflicting sources require ordinary classification/approval.
10
+
11
+ ## Workflow code discovery
12
+
13
+ Use `codebase-memory-mcp` first for workflow implementation orientation. Match the exact workflow source Git root, or the exact installed package root returned by Core for consumer-side workflow diagnostics. Never select a graph by similar project name or use the consumer's product graph to explain package internals.
14
+
15
+ For source work, verify graph status and refresh the exact checkout when HEAD changes. For installed packages, use the current Core graph request and bind evidence only to that exact root/package fingerprint. Use symbol search, call tracing and selected snippets; do not repeatedly scan the whole tree after a ready graph exists.
16
+
17
+ Core `graph status` is read-only: it returns the current request, inspected binding and structural `observation` without registering a project, creating locks or recovering journals. A graph result does not authorize lifecycle continuation; use fresh `next` for the permissible transition. `graph refresh-request`, bind and fallback remain explicit mutation commands.
18
+
19
+ If the provider is unavailable, indexing/refresh cannot complete, or the exact new/non-code artifact is absent, record the operation, source root and reason before scoped filesystem fallback. Do not label fallback as fresh graph evidence. The gateway governs workflow orientation; it does not require indexing product code. Knowledge approval is never evidence that a graph is ready.
20
+
21
+ ## Product graph: inactive
22
+
23
+ Product graph indexing is not used by the active workflow. Do not request its refresh or binding.
24
+ Absent or stale product bindings do not gate next, Plans, Knowledge approval or context refresh.
25
+ Existing bindings remain readable through explicit diagnostic commands; they are not Knowledge authority.
26
+ Project Knowledge Map continues to use deterministic repository file scanning and its existing approval contract.
27
+ Keep the Plan schema field `graphUse`; use `not-applicable` for new product Plans. Existing `code-aware`
28
+ values do not require an index or a new Knowledge approval. No product refresh owner or schedule is introduced.
29
+
30
+ The installed-workflow graph indexes the exact installed package. The maintainer graph indexes the
31
+ exact workflow development checkout. Neither is the product graph or a replacement for Knowledge Map.
@@ -0,0 +1,190 @@
1
+ # Supplied Codex App release evidence
2
+
3
+ This is the external-artifact interface used by [release policy](release.md) and `scripts/release-app-evidence.mjs`. It describes how a release owner supplies evidence after a **real Codex App run on a disposable synthetic project**. It does not authorize a run, approve publication or create an App task. Automatic regression fixtures are never live evidence.
4
+
5
+ ## Candidate and collection
6
+
7
+ Finish automated qualification for the committed candidate first. Retain `.release/candidate.tgz`, `.release/automated.json`, `.release/passport.json` and their referenced files. Use that retained archive for the App installation; do not repack it. Copy the exact `candidate` object from the passport. `automatedEvidenceSha256` is SHA-256 of the **file bytes** of `.release/automated.json`, including its formatting and final newline.
8
+
9
+ Preserve and inspect the original Coordinator, Worker and reviewer records. A new Worker task must be created by Coordinator with `create_thread`; a new independent reviewer task can be created by Coordinator or Worker. Three distinct thread IDs are mandatory. A fork, a pending `clientThreadId`, a role description alone or an agent's assertion that another task exists is insufficient.
10
+
11
+ The actual captured route must include installed `gateway handshake`, Task execution and Step completion, an external sealed review, and a later `merged` outcome for the same Workflow Task. Preserve failures and subsequent checkpoints. The generic lifecycle validator rejects failed navigation, unadvertised mutations, missing checkpoints and unfinished calls; passing that validator alone does not establish App provenance or independent review.
12
+
13
+ Preserve six separate files:
14
+
15
+ | Artifact key | Required contents |
16
+ | --- | --- |
17
+ | `dispatch` | Original Coordinator App JSON export containing its identity and Worker creation record; optionally reviewer creation. |
18
+ | `worker` | Original Worker App JSON export containing its identity and its actual App-selected gateway resolution record; reviewer creation if Worker dispatched it. |
19
+ | `reviewer` | Original independent reviewer App JSON export containing its identity and its own exact external review result. |
20
+ | `packet` | Exact Core packet value returned by `task step-review-packet` or `task review-packet`. |
21
+ | `reviewResult` | Exact external review envelope produced by that reviewer, as described below. |
22
+ | `lifecycle` | Actual append-only capture JSONL, with original command results, timestamps and provenance. |
23
+
24
+ Use the provider's JSON export rather than rewriting its records to fit a sample structure. Preserve provider redactions; never add credentials, confirmation codes or vault contents to the bundle. JSON pointers below locate fields in the available original format. A malformed or unsupported export needs an explicit supported export procedure, not invented tool results.
25
+
26
+ ## Capture interface
27
+
28
+ The existing bootstrap accepts:
29
+
30
+ ```sh
31
+ node scripts/bootstrap-disposable-release-fixture.mjs \
32
+ --candidate "$CANDIDATE_TARBALL_ABSOLUTE_PATH" \
33
+ --sha256 "$EXACT_TARBALL_SHA256" \
34
+ --version "$EXACT_PACKAGE_VERSION"
35
+ ```
36
+
37
+ `--preflight` performs archive inspection only. Without it, bootstrap creates an isolated repository/state root and synthetic authority; its receipt explicitly records simulated approval and no production consent. Use only the returned disposable paths. Bootstrap success is not an App lifecycle result.
38
+
39
+ Prepare a capture configuration with these fields. References use `{ "file": "<absolute path>", "sha256": "<actual file SHA-256>" }`:
40
+
41
+ | Capture configuration field | Binding |
42
+ | --- | --- |
43
+ | `candidate` | Exact workflow candidate commit SHA, a string. |
44
+ | `version` | Exact package version. |
45
+ | `artifact` | Retained candidate tarball reference. |
46
+ | `bootstrapReceipt` | Actual disposable-bootstrap receipt reference. |
47
+ | `repository`, `stateRoot` | Absolute disposable paths from that receipt. |
48
+ | `cli` | Installed `node_modules/codex-workflow-v2/dist/src/cli.js` reference. |
49
+ | `projector` | Installed `dist/src/navigation-actions.js` reference. |
50
+ | `validator` | Exact candidate `scripts/validate-lifecycle-transcript.mjs` reference. |
51
+ | `captureFiles` | Exactly the candidate recorder and its helper references: `scripts/capture-lifecycle.mjs` and `scripts/lifecycle-capture-evidence.mjs`. |
52
+ | `runId` | Unique nonempty identifier for this live capture. |
53
+ | `workerThreadId` | Actual new Worker App thread ID. |
54
+ | `log` | Absolute path of this run's append-only JSONL. |
55
+
56
+ Run actual lifecycle commands through the recorder from the App task. For example, the initial installed-package observation is:
57
+
58
+ ```sh
59
+ WORKFLOW_CAPTURE_CONFIG="$CAPTURE_CONFIG_ABSOLUTE_PATH" \
60
+ node scripts/capture-lifecycle.mjs gateway handshake
61
+ ```
62
+
63
+ The recorder supplies the bound repository and JSON output options. Then execute the current package's advertised lifecycle actions with their exact inputs; this document is not a replacement action plan. After each mutation, complete `status`, then `next`. Run `scripts/validate-lifecycle-transcript.mjs --file "$CAPTURE_LOG_ABSOLUTE_PATH"` against the current candidate build to diagnose the collected log.
64
+
65
+ The recorder emits original provenance fields `candidate`, `artifact.sha256`, `runId`, `workerThreadId`, `cliSource`, `projectorSource`, `validatorSource` and `captureSources`. Release verification compares CLI/projector hashes with bytes extracted from the retained tarball and recorder/helper/validator hashes with candidate source files. Historical absolute paths in provenance are not followed to recover missing evidence. The current native producer format is mandatory: provenance needs `configSha256`; invocation/result events need `phase: "agent"` and `invocationId`; each unique invocation BEGIN must have a matching terminal `invocationId`; terminal results need `exitStatus`, `timedOut`, `stdoutSha256`, `stderrSha256`, `expectedRevision`, `errorCode`, and coherent `ok`/`result` fields. Flattened historical logs or summaries missing these fields are rejected even if the generic lifecycle validator would accept them. Every event needs a valid nondecreasing `recordedAt`, no later than evidence collection; the whole run must remain within the release contract's freshness window.
66
+
67
+ ## Closed evidence envelope
68
+
69
+ `evidence.json` has **exactly** `schema` and `payload`. All objects explicitly listed as closed below reject additional or missing fields. Original provider exports and the original Core packet remain their native structures.
70
+
71
+ | Closed object | Exact fields and constraints |
72
+ | --- | --- |
73
+ | Envelope | `schema`: `codex-workflow.release-app-evidence/v1`; `payload`. |
74
+ | `payload` | `candidate`, `automatedEvidenceSha256`, `observedAt`, `environment`, `runId`, `threads`, `taskId`, `artifacts`, `appBindings`. |
75
+ | `candidate` | `version`: exact nonempty version; `commitSha`: 40 lowercase hex characters; `tarballSha256`: 64 lowercase hex characters. All must match the passport. |
76
+ | `environment` | `node`: exact `.node-version` value used by the App run; `platform`: actual `darwin` or `linux`. Windows is not admitted. |
77
+ | `threads` | `coordinator`, `worker`, `reviewer`: distinct actual nonempty App thread IDs. |
78
+ | `artifacts` | Exactly `dispatch`, `worker`, `reviewer`, `packet`, `reviewResult`, `lifecycle`. |
79
+ | Each artifact reference | `path`: relative to `evidence.json`'s directory; `sha256`: 64 lowercase hex characters hashing actual file bytes. |
80
+ | `appBindings` | `dispatches`, `coordinatorThreadPointer`, `workerThreadPointer`, `reviewerThreadPointer`, `reviewerResultPointer`, `gatewayResolutionPointer`. |
81
+ | Original gateway resolution record | `packageVersion`, `skillPath`, `skillSha256`, `pluginManifestSha256`. The record is selected inside the original Worker export, not supplied as a separate summary. |
82
+ | Each of exactly two `dispatches` | `role`, `source`, `recordPointer`, `toolPointer`, `threadPointer`. One role is `worker`, one is `reviewer`. `source` is `dispatch` or `worker`; Worker creation must use `dispatch`. |
83
+
84
+ `runId` must equal the capture run ID. `taskId` identifies the single Workflow Task whose execution, review and merged outcome are being demonstrated. `observedAt` is the actual ISO timestamp of collecting and checking this run and automated report; it must not precede automated qualification completion. Both automated and App evidence currently expire after seven days, according to the executable contract. A new timestamp cannot refresh old capture events.
85
+
86
+ No owner attestation, release decision, signature or signing key is part of the evidence contract. Publication authorization is a separate explicit user decision; a complete evidence bundle does not grant that authorization.
87
+
88
+ Artifact files must be nonempty regular files of at most 32 MiB each. All six paths must differ. Absolute paths, empty components, `.`/`..`, backslashes and symlink traversal are rejected. Keep the complete directory together when transferring the bundle.
89
+
90
+ The following **placeholder envelope is deliberately invalid and is not live evidence or release approval**. Every angle-bracket value must come from actual records:
91
+
92
+ ```json
93
+ {
94
+ "schema": "codex-workflow.release-app-evidence/v1",
95
+ "payload": {
96
+ "candidate": {
97
+ "version": "<exact candidate version>",
98
+ "commitSha": "<exact 40-character commit SHA>",
99
+ "tarballSha256": "<actual retained tarball SHA-256>"
100
+ },
101
+ "automatedEvidenceSha256": "<actual .release/automated.json SHA-256>",
102
+ "observedAt": "<actual evidence collection ISO timestamp>",
103
+ "environment": { "node": "<actual pinned Node>", "platform": "<actual darwin or linux>" },
104
+ "runId": "<actual capture runId>",
105
+ "threads": { "coordinator": "<actual ID>", "worker": "<different actual ID>", "reviewer": "<third actual ID>" },
106
+ "taskId": "<actual Workflow Task ID>",
107
+ "artifacts": {
108
+ "dispatch": { "path": "coordinator.json", "sha256": "<actual file hash>" },
109
+ "worker": { "path": "worker.json", "sha256": "<actual file hash>" },
110
+ "reviewer": { "path": "reviewer.json", "sha256": "<actual file hash>" },
111
+ "packet": { "path": "packet.json", "sha256": "<actual file hash>" },
112
+ "reviewResult": { "path": "review-result.json", "sha256": "<actual file hash>" },
113
+ "lifecycle": { "path": "lifecycle.jsonl", "sha256": "<actual file hash>" }
114
+ },
115
+ "appBindings": {
116
+ "coordinatorThreadPointer": "<pointer into coordinator.json>",
117
+ "workerThreadPointer": "<pointer into worker.json>",
118
+ "reviewerThreadPointer": "<pointer into reviewer.json>",
119
+ "reviewerResultPointer": "<pointer into reviewer.json>",
120
+ "gatewayResolutionPointer": "<pointer to original gateway resolution result in worker.json>",
121
+ "dispatches": [
122
+ { "role": "worker", "source": "dispatch", "recordPointer": "<pointer to original creation record>", "toolPointer": "<relative pointer to tool name>", "threadPointer": "<relative pointer to successful result ID>" },
123
+ { "role": "reviewer", "source": "worker", "recordPointer": "<pointer to original creation record>", "toolPointer": "<relative pointer to tool name>", "threadPointer": "<relative pointer to successful result ID>" }
124
+ ]
125
+ }
126
+ }
127
+ }
128
+ ```
129
+
130
+ ## Original App pointers and reviewer result
131
+
132
+ Pointers use JSON Pointer syntax: `""` selects the document, `/field/0/value` traverses properties and array indexes, `~0` represents `~`, and `~1` represents `/`. Identity/result pointers start at their named export. A dispatch `recordPointer` first selects one original tool record in its `source` export; `toolPointer` and `threadPointer` are evaluated **inside that record**, not globally.
133
+
134
+ The tool pointer supports fully qualified exports (`mcp__codex_app__create_thread` or `mcp__codex_app.create_thread`) and native App session records. For a native record, select the original `payload.item` with `recordPointer`: it must have `type: "McpToolCall"`, `server: "codex_app"`, `tool: "create_thread"`, `status: "completed"`, no error and `result.isError: false`. Use `toolPointer: "/tool"` and `threadPointer: "/result/content/0/text/threadId"` (or the actual text block index); JSON inside the original text is traversed directly. Failed calls, forks, another server and pending client IDs are rejected. Preserve the original record; do not rewrite it into a fully qualified synthetic record. The result pointer must resolve to the returned persistent `threadId` of the expected role. If setup returned only a `clientThreadId`, retain the later resolved creation record before proceeding. Do not substitute the client ID.
135
+
136
+ MCP exports sometimes store JSON inside a string. While following an explicit pointer, the validator parses such an intermediate string before traversing its next property. For example, `/result/content/0/text/threadId` can traverse a `text` string containing `{"threadId":"..."}`. It does not search arbitrary text for a matching substring. `reviewerResultPointer` may also end at a JSON string, which is parsed as the exact review envelope. Markdown prose or fenced JSON is not parsed automatically; retain an original structured result export.
137
+
138
+ `gatewayResolutionPointer` selects the original Worker's recorded result of reading and hashing the gateway skill selected by its actual App skill catalog. It may end at a JSON-encoded result string, like the reviewer result pointer. The selected record is closed:
139
+
140
+ ```json
141
+ {
142
+ "packageVersion": "<exact installed workflow package version>",
143
+ "skillPath": "<actual absolute catalog-selected path ending in SKILL.md>",
144
+ "skillSha256": "<SHA-256 of the actual selected skill bytes>",
145
+ "pluginManifestSha256": "<SHA-256 of that installed plugin manifest bytes>"
146
+ }
147
+ ```
148
+
149
+ Verify the original App catalog selection, corresponding skill read/hash operation and installed plugin manifest read/hash operation in that Worker export. A newly authored summary, an arbitrary repository copy or the package handshake alone does not prove which skill App loaded. Preserve the original operation and its result; the JSON pointer selects that result inside the original export. If those original records are absent, collect the missing real App evidence before attachment.
150
+
151
+ Verification compares `skillSha256` with `plugins/codex-workflow-gateway/skills/codex-workflow-gateway/SKILL.md` extracted from the retained tarball, and `pluginManifestSha256` with its packed `plugins/codex-workflow-gateway/.codex-plugin/plugin.json`. These are the mandatory `gatewaySkillSha256` and `pluginManifestSha256` entries in the verifier's trusted `captureHashes`; they are computed from the candidate archive, not taken on trust from the Worker. An old personal plugin with different bytes fails even if its CLI handshake reports the correct package version. The actual absolute skill path is recorded, never guessed from the repository path or a previous installation. These hashes establish byte bindings, not independent App-provider provenance.
152
+
153
+ `reviewResult` uses Core's external envelope, not `schemas/review-result.schema.json`'s local process output shape:
154
+
155
+ ```json
156
+ {
157
+ "protocol": "codex-workflow-external-strict-task-review-v1",
158
+ "packetHash": "<packet.packetHash>",
159
+ "repositorySealHash": "<packet.repositorySealHash>",
160
+ "reviewerThreadId": "<actual independent reviewer ID>",
161
+ "reviewMode": "ordinary",
162
+ "review": {
163
+ "status": "passed",
164
+ "reviewer": "<actual independent reviewer actor>",
165
+ "summary": "<reviewer's original summary>",
166
+ "findings": []
167
+ }
168
+ }
169
+ ```
170
+
171
+ The two displayed objects are closed. Step packets use `codex-workflow-external-strict-step-review-v1`. `reviewMode` is `ordinary` or `security`, matching the packet; **`external-sealed` is the Core recording mode, not a `reviewMode` value**. An admitted review has status `passed` and no findings. Worker/Coordinator must not author it.
172
+
173
+ The original packet includes its `packet`, `packetHash`, `repositorySeal`, `repositorySealHash`, `reviewedCommit`, `taskId`, protocol, review mode and native runtime fields; preserve the entire returned value. Packet and seal hashes are SHA-256 of Core's recursively key-sorted canonical JSON, unlike ordinary artifact byte hashes. The sealed repository HEAD must equal `reviewedCommit`. This reviewed commit is the disposable product commit, not the workflow package candidate commit.
174
+
175
+ The lifecycle must contain that exact packet observation followed by Core's successful sealed-record response with matching packet hash, seal hash, reviewer thread, mode and Task. Actual `task run` returns a nested `value.task`; `task step-complete` returns the Task directly. The verifier follows these Core shapes and requires a later merged Task result. Merely supplying a favorable reviewer JSON file is insufficient.
176
+
177
+ ## Evidence attachment
178
+
179
+ Prepare `evidence.json` with the exact `schema` and `payload` fields described above. No signature, owner attestation or release-decision field is accepted. Preserve the six original artifacts and their relative paths in the same directory; compute their hashes from the original file bytes. The bundle must bind the retained automated report and exact candidate archive.
180
+
181
+ Place the intact directory under `.release/app/`, then run:
182
+
183
+ ```sh
184
+ npm run release:passport -- --passport .release/passport.json --app .release/app/evidence.json
185
+ npm run release:verify -- --passport .release/passport.json
186
+ ```
187
+
188
+ Attachment verifies before replacing the passport. It does not publish or infer user consent, and needs no signing key. Release verification rechecks freshness, exact candidate bytes and all required records each time; the stored `releaseEligible` field cannot grant admission. Missing evidence or mismatched hashes blocks with an `APP_EVIDENCE_*` or `RELEASE_*` diagnostic. Preserve the evidence directory and diagnose the stated binding rather than editing old records to manufacture green.
189
+
190
+ The verifier checks artifact integrity, structure and cross-record consistency. It cannot independently authenticate App-provider provenance: supplied JSON and its hashes are not cryptographic proof of a live App run. Original live records and the independent reviewer remain required; automated fixtures cannot substitute for them. Publication requires separate explicit user authorization and configured registry/release access. R2's detached-process limitation and broader A4 autonomy limitations remain separate known findings even when this specific candidate has complete release evidence.