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
@@ -30,12 +30,14 @@ definition, status, and evidence record, records the old/new binding, supersedes
30
30
  authorization, and cannot run while a Step is in progress. If local state is lost, the map
31
31
  is rebuilt from repository files.
32
32
 
33
- For delegated autonomy, repository `next` may expose `contextRefresh` when the stored map was
34
- active and inspection proves content-hash-only drift. `task context-refresh` then performs
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
35
36
  reconcile, delegated map approval, Task rebind, and delegated execution authorization while
36
- preserving the ordinary audit events. The command rejects new/removed sources, category,
37
- scope or authority changes, changed gaps, and conflicts. Those changes always remain visible
38
- for normal classification and approval.
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.
39
41
 
40
42
  ## Codebase graph
41
43
 
package/docs/release.md CHANGED
@@ -15,19 +15,41 @@ Before tagging a release:
15
15
  5. `npm run plugin:check`
16
16
  6. `npm run release:check`
17
17
  7. validate `plugins/codex-workflow-gateway` with the Codex plugin validator
18
+ 8. validate the append-only real-agent log with
19
+ `node scripts/validate-lifecycle-transcript.mjs --file <lifecycle-log.jsonl>`
18
20
 
19
21
  The downstream smoke packs the actual tarball, installs it into an empty temporary project,
20
22
  runs the packaged CLI handshake, and proves installation created none of `.codex`, `.tasks`,
21
23
  `.increments`, or `.memory-bank` in that project.
22
24
 
23
- For alpha.7, the release gate also relies on `npm run release:check` to fail if:
25
+ For beta.10, the release gate also relies on `npm run release:check` to fail if:
24
26
 
25
27
  - canonical entity schema 2 shapes drift;
26
- - protocol 1 compatibility is no longer additive;
28
+ - protocol 2 is not the active public contract, or intact protocol-1 adoption evidence stops being readable through the bounded compatibility window;
27
29
  - the delegated transition allow-list expands;
28
30
  - schema-2 adoption is presented as `state migrate` instead of posture sidecars;
29
31
  - alpha.7 rescue, Milestone autonomy (including guarded content refresh), derived actor, or
30
- proof-obligation capabilities and schemas are absent from the packaged surface.
32
+ proof-obligation capabilities and schemas are absent from the packaged surface;
33
+ - terminal Task replacement, project-level transaction recovery, secret-safe lock diagnostics,
34
+ version/base diagnostics, or serialized maintainer validation are missing.
35
+ - truthful initial-assembly navigation capability is absent from the packaged surface.
36
+ - corrective-yield/replan protocol-v2 commands, closed schemas, Human gate, retained journals,
37
+ explicit recovery, or dual-readback capabilities are absent from the packaged surface.
38
+ - scoped Task navigation, credential replacement recovery, or sealed external Task/Step review
39
+ commands are absent from the packaged surface.
40
+ - bounded dependency-provenance recovery, retained passed-review provenance, the exact Signal T04
41
+ revision-26 fixture, or pending/corrupt-review rejection regressions are absent.
42
+ - the read-only Milestone progress projection, replacement regression, project-monotonic chat
43
+ registry, title fallback/readback, or long-Cyrillic multi-attempt E2E evidence is absent.
44
+
45
+ The separate lifecycle transcript validator fails if the real-agent log contains a mutation that
46
+ bypasses failed `status`/`next`, an unadvertised or failed mutation, an unresolved syntax-only
47
+ retry, or missing post-mutation checkpoints.
48
+
49
+ Full `npm test` and `npm run validate` invocations share destructive build outputs and are therefore
50
+ single-owner operations. A concurrent invocation fails immediately with
51
+ `VALIDATION_ALREADY_RUNNING`; retry it after the owner exits. Stale process locks are recovered
52
+ automatically.
31
53
 
32
54
  Tag releases as `v<package-version>`. The tag workflow verifies the tag/package match and
33
55
  uses npm trusted publishing with public access. For a public GitHub repository and public
@@ -0,0 +1,54 @@
1
+ # Canonical `split-required` recovery
2
+
3
+ Use this procedure only when the exact package-local `next` response identifies a terminal
4
+ `split-required` decision. Never rebind, refresh, replan, authorize, or resume the historical Task.
5
+
6
+ ## Delegate prompt
7
+
8
+ ```text
9
+ Continue the active Milestone through the package-local codex-workflow-v2 Core only.
10
+
11
+ 1. Run `codex-workflow status --repo .` and `codex-workflow next --repo .`. Treat every returned
12
+ revision and action as authoritative. Stop on corruption, stop-escalate, version divergence, or
13
+ an unexpected action. Do not edit workflow state or sidecars.
14
+ 2. Confirm that `next` reports the historical Task as `split-required`. Do not run
15
+ `task knowledge-rebind`, `task context-refresh`, `task plan-set`, `task authorize`, or `task run`
16
+ for that Task.
17
+ 3. If `next` says `discovery start`, create one thin replacement Discovery containing only the
18
+ failed Step's remaining outcome, exact acceptance, constraints, and explicit out-of-scope. Make
19
+ it `ready_to_materialize`, then run `status` and `next` again.
20
+ 4. When `next` returns `task replacement-materialize`, run that exact command with its old Task,
21
+ Discovery, and Milestone revisions, a precise replacement title, and the current authorized
22
+ actor. This single transaction must consume the Discovery, cancel/link the historical Task,
23
+ create/link the replacement Task, change both memberships, supersede Milestone execution
24
+ authorization, and leave the Milestone awaiting reauthorization. Do not perform a separate
25
+ scope change for these effects.
26
+ 5. Run `status`, wait for terminal success, then run `next`; never issue the pair in parallel.
27
+ Verify: old Task `cancelled`; old membership `cancelled`; new Task
28
+ `planning` and `replacementForTaskId` points to the old Task; new membership `required`;
29
+ Milestone `awaiting_execution_authorization`. If any relation is missing, stop and run `doctor`.
30
+ 6. Follow the exact `next` transition to reauthorize the changed Milestone. Run `status` to
31
+ terminal success and then `next` again. Do not reuse the historical Task's Plan or authorization.
32
+ 7. Plan the replacement Task from its own Brief, record the required Plan Risk Audit, authorize it,
33
+ prepare and claim its C1 handoff, and execute only the exact Step returned by `next`. Run
34
+ sequential `status` then `next` checkpoints after every state boundary.
35
+ 8. Complete review, final acceptance, merge, remaining required Tasks, Milestone validation, and
36
+ Milestone final acceptance through exact Core transitions. Never create a fourth remediation
37
+ attempt for the historical Task.
38
+ ```
39
+
40
+ ## Exact replacement command shape
41
+
42
+ ```sh
43
+ codex-workflow task replacement-materialize --repo . \
44
+ --id TASK-OLD \
45
+ --expected-revision OLD_TASK_REVISION \
46
+ --discovery DISC-REPLACEMENT \
47
+ --expected-discovery-revision DISCOVERY_REVISION \
48
+ --expected-milestone-revision MILESTONE_REVISION \
49
+ --title "Thin replacement title" \
50
+ --actor agent:milestone-coordinator
51
+ ```
52
+
53
+ Copy revisions from the same `next` response. If multiple ready Discoveries exist, Core refuses to
54
+ guess; choose the intended Discovery explicitly after reviewing its raw content.