codex-workflow-v2 2.0.0-beta.1 → 2.0.0-beta.11
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.
- package/README.md +94 -12
- package/dist/src/alpha6/adoption.js +13 -3
- package/dist/src/alpha6/adoption.js.map +1 -1
- package/dist/src/alpha6/handoff.d.ts +26 -2
- package/dist/src/alpha6/handoff.js +277 -29
- package/dist/src/alpha6/handoff.js.map +1 -1
- package/dist/src/alpha6/mechanical-feasibility.d.ts +7 -0
- package/dist/src/alpha6/mechanical-feasibility.js +303 -0
- package/dist/src/alpha6/mechanical-feasibility.js.map +1 -0
- package/dist/src/alpha6/milestone.d.ts +37 -2
- package/dist/src/alpha6/milestone.js +472 -33
- package/dist/src/alpha6/milestone.js.map +1 -1
- package/dist/src/alpha6/plan-integrity.d.ts +14 -0
- package/dist/src/alpha6/plan-integrity.js +127 -0
- package/dist/src/alpha6/plan-integrity.js.map +1 -0
- package/dist/src/alpha6/plan-risk.d.ts +1 -0
- package/dist/src/alpha6/plan-risk.js +15 -7
- package/dist/src/alpha6/plan-risk.js.map +1 -1
- package/dist/src/alpha6/remediation.d.ts +2 -1
- package/dist/src/alpha6/remediation.js +186 -9
- package/dist/src/alpha6/remediation.js.map +1 -1
- package/dist/src/alpha6/review.d.ts +3 -0
- package/dist/src/alpha6/review.js +24 -0
- package/dist/src/alpha6/review.js.map +1 -1
- package/dist/src/cli.js +486 -46
- package/dist/src/cli.js.map +1 -1
- package/dist/src/contracts.d.ts +238 -6
- package/dist/src/contracts.js +1 -1
- package/dist/src/credential-output.d.ts +10 -0
- package/dist/src/credential-output.js +73 -0
- package/dist/src/credential-output.js.map +1 -0
- package/dist/src/dependency-provenance.d.ts +19 -0
- package/dist/src/dependency-provenance.js +185 -0
- package/dist/src/dependency-provenance.js.map +1 -0
- package/dist/src/errors.d.ts +1 -1
- package/dist/src/errors.js.map +1 -1
- package/dist/src/git.d.ts +1 -1
- package/dist/src/git.js +13 -5
- package/dist/src/git.js.map +1 -1
- package/dist/src/index.d.ts +2 -1
- package/dist/src/index.js +2 -1
- package/dist/src/index.js.map +1 -1
- package/dist/src/lifecycle/canonical-hash.d.ts +6 -0
- package/dist/src/lifecycle/canonical-hash.js +24 -0
- package/dist/src/lifecycle/canonical-hash.js.map +1 -0
- package/dist/src/lifecycle/catalog.d.ts +26 -0
- package/dist/src/lifecycle/catalog.js +208 -0
- package/dist/src/lifecycle/catalog.js.map +1 -0
- package/dist/src/lifecycle/compiler-inspection.d.ts +48 -0
- package/dist/src/lifecycle/compiler-inspection.js +29 -0
- package/dist/src/lifecycle/compiler-inspection.js.map +1 -0
- package/dist/src/lifecycle/core-static-readiness.d.ts +6 -0
- package/dist/src/lifecycle/core-static-readiness.js +130 -0
- package/dist/src/lifecycle/core-static-readiness.js.map +1 -0
- package/dist/src/lifecycle/corrective-replan-authority.d.ts +53 -0
- package/dist/src/lifecycle/corrective-replan-authority.js +139 -0
- package/dist/src/lifecycle/corrective-replan-authority.js.map +1 -0
- package/dist/src/lifecycle/corrective-replan-binding-manifest.d.ts +21 -0
- package/dist/src/lifecycle/corrective-replan-binding-manifest.js +35 -0
- package/dist/src/lifecycle/corrective-replan-binding-manifest.js.map +1 -0
- package/dist/src/lifecycle/corrective-replan-credential-core.d.ts +86 -0
- package/dist/src/lifecycle/corrective-replan-credential-core.js +563 -0
- package/dist/src/lifecycle/corrective-replan-credential-core.js.map +1 -0
- package/dist/src/lifecycle/corrective-replan-credential-schema.d.ts +17 -0
- package/dist/src/lifecycle/corrective-replan-credential-schema.js +44 -0
- package/dist/src/lifecycle/corrective-replan-credential-schema.js.map +1 -0
- package/dist/src/lifecycle/corrective-replan-credentials.d.ts +47 -0
- package/dist/src/lifecycle/corrective-replan-credentials.js +103 -0
- package/dist/src/lifecycle/corrective-replan-credentials.js.map +1 -0
- package/dist/src/lifecycle/corrective-replan.d.ts +64 -0
- package/dist/src/lifecycle/corrective-replan.js +553 -0
- package/dist/src/lifecycle/corrective-replan.js.map +1 -0
- package/dist/src/lifecycle/evaluator.d.ts +2 -0
- package/dist/src/lifecycle/evaluator.js +35 -0
- package/dist/src/lifecycle/evaluator.js.map +1 -0
- package/dist/src/lifecycle/fingerprint.d.ts +31 -0
- package/dist/src/lifecycle/fingerprint.js +388 -0
- package/dist/src/lifecycle/fingerprint.js.map +1 -0
- package/dist/src/lifecycle/immutable.d.ts +1 -0
- package/dist/src/lifecycle/immutable.js +10 -0
- package/dist/src/lifecycle/immutable.js.map +1 -0
- package/dist/src/lifecycle/implementation-table.d.ts +29 -0
- package/dist/src/lifecycle/implementation-table.js +87 -0
- package/dist/src/lifecycle/implementation-table.js.map +1 -0
- package/dist/src/lifecycle/index.d.ts +4 -0
- package/dist/src/lifecycle/index.js +5 -0
- package/dist/src/lifecycle/index.js.map +1 -0
- package/dist/src/lifecycle/schema-artifact.d.ts +12 -0
- package/dist/src/lifecycle/schema-artifact.js +214 -0
- package/dist/src/lifecycle/schema-artifact.js.map +1 -0
- package/dist/src/lifecycle/semantic-registry.d.ts +6 -0
- package/dist/src/lifecycle/semantic-registry.js +489 -0
- package/dist/src/lifecycle/semantic-registry.js.map +1 -0
- package/dist/src/lifecycle/types.d.ts +718 -0
- package/dist/src/lifecycle/types.js +4 -0
- package/dist/src/lifecycle/types.js.map +1 -0
- package/dist/src/observation.d.ts +20 -0
- package/dist/src/observation.js +171 -0
- package/dist/src/observation.js.map +1 -0
- package/dist/src/reviewer.d.ts +43 -1
- package/dist/src/reviewer.js +203 -50
- package/dist/src/reviewer.js.map +1 -1
- package/dist/src/state/corrective-replan-executor.d.ts +64 -0
- package/dist/src/state/corrective-replan-executor.js +608 -0
- package/dist/src/state/corrective-replan-executor.js.map +1 -0
- package/dist/src/state/corrective-replan-public-schema.d.ts +3 -0
- package/dist/src/state/corrective-replan-public-schema.js +43 -0
- package/dist/src/state/corrective-replan-public-schema.js.map +1 -0
- package/dist/src/state/corrective-replan-public.d.ts +95 -0
- package/dist/src/state/corrective-replan-public.js +665 -0
- package/dist/src/state/corrective-replan-public.js.map +1 -0
- package/dist/src/state/corrective-replan-transaction.d.ts +160 -0
- package/dist/src/state/corrective-replan-transaction.js +730 -0
- package/dist/src/state/corrective-replan-transaction.js.map +1 -0
- package/dist/src/state/corrective-yield-executor.d.ts +31 -0
- package/dist/src/state/corrective-yield-executor.js +236 -0
- package/dist/src/state/corrective-yield-executor.js.map +1 -0
- package/dist/src/state/corrective-yield-transaction.d.ts +97 -0
- package/dist/src/state/corrective-yield-transaction.js +591 -0
- package/dist/src/state/corrective-yield-transaction.js.map +1 -0
- package/dist/src/state/lock.d.ts +76 -3
- package/dist/src/state/lock.js +611 -30
- package/dist/src/state/lock.js.map +1 -1
- package/dist/src/state/store.d.ts +3 -0
- package/dist/src/state/store.js +65 -12
- package/dist/src/state/store.js.map +1 -1
- package/dist/src/transition-core.d.ts +67 -0
- package/dist/src/transition-core.js +318 -0
- package/dist/src/transition-core.js.map +1 -0
- package/dist/src/version.d.ts +1 -1
- package/dist/src/version.js +1 -1
- package/dist/src/version.js.map +1 -1
- package/dist/src/workflow.d.ts +88 -24
- package/dist/src/workflow.js +1647 -270
- package/dist/src/workflow.js.map +1 -1
- package/docs/autonomy-guardrails.md +61 -1
- package/docs/beta11-plan-integrity-recovery-brief.md +38 -0
- package/docs/beta2-initial-assembly-navigation-brief.md +616 -0
- package/docs/delegated-approval.md +26 -1
- package/docs/development-flow.md +63 -8
- package/docs/lifecycle/state-machine-stabilization.md +641 -0
- package/docs/pdf/README.md +24 -0
- package/docs/pdf/codex-workflow-v2-architecture-ru.pdf +0 -0
- package/docs/pdf/codex-workflow-v2-chat-only-guide-ru.pdf +0 -0
- package/docs/pdf/codex-workflow-v2-technical-reference-ru.pdf +0 -0
- package/docs/pdf/requirements.txt +1 -0
- package/docs/pdf/sources/codex-workflow-v2-architecture-ru.md +234 -0
- package/docs/pdf/sources/codex-workflow-v2-chat-only-guide-ru.md +334 -0
- package/docs/pdf/sources/codex-workflow-v2-technical-reference-ru.md +413 -0
- package/docs/problem-briefs/01-pre-implementation-integrity.md +478 -0
- package/docs/problem-briefs/02-minimal-step-integrity.md +411 -0
- package/docs/problem-briefs/03-minimal-agent-context-integrity.md +358 -0
- package/docs/problem-briefs/04-task-dependency-and-structural-replacement-integrity.md +566 -0
- package/docs/problem-briefs/BRIEF-TEMPLATE.md +56 -0
- package/docs/problem-briefs/README.md +120 -0
- package/docs/problem-briefs/evidence/p01-mechanical-feasibility-corpus.md +90 -0
- package/docs/problem-briefs/evidence/signal-v4-pre-m3-replay.md +246 -0
- package/docs/release.md +30 -6
- package/docs/split-required-recovery.md +19 -25
- package/docs/stable-release-defect-register.md +465 -3
- package/docs/updating-existing-project.md +59 -4
- package/docs/validation-report.md +124 -56
- package/package.json +9 -1
- package/plugins/codex-workflow-gateway/.codex-plugin/plugin.json +10 -3
- package/plugins/codex-workflow-gateway/references/protocol.md +92 -4
- package/plugins/codex-workflow-gateway/scripts/chat-registry.mjs +376 -0
- package/plugins/codex-workflow-gateway/skills/codex-workflow-gateway/SKILL.md +263 -4
- package/references/state-machine.md +13 -6
- package/roles/delivery-coordinator.md +39 -0
- package/schemas/adoption-posture-event.schema.json +1 -1
- package/schemas/authorization-event.schema.json +64 -1
- package/schemas/context-envelope.schema.json +1 -1
- package/schemas/corrective-decision-event.schema.json +48 -3
- package/schemas/corrective-replan-credentials.private.schema.json +98 -0
- package/schemas/corrective-replan-execution-event.private.schema.json +53 -0
- package/schemas/corrective-replan-public.schema.json +142 -0
- package/schemas/corrective-replan-task-transaction.private.schema.json +151 -0
- package/schemas/corrective-yield-task-transaction.private.schema.json +98 -0
- package/schemas/milestone-scope-change-event.schema.json +6 -1
- package/schemas/milestone.schema.json +6 -1
- package/schemas/remediation-event.schema.json +11 -1
- package/schemas/task-handoff-event.schema.json +19 -3
- package/schemas/task.schema.json +24 -1
- package/schemas/transition-definition.schema.json +2609 -0
- package/schemas/transition-payloads.schema.json +140 -0
- package/scripts/generate-pdf-docs.py +512 -0
- package/scripts/run-pdf-docs.mjs +62 -0
package/docs/development-flow.md
CHANGED
|
@@ -28,6 +28,16 @@ uses a bootstrap audit over the preserved non-`completed`, non-`skipped` Steps o
|
|
|
28
28
|
The audit names a Plan author and independent auditor, binds each guarded failure mode to
|
|
29
29
|
exact executable evidence, and blocks authorization on `split-required` or `stop-escalate`.
|
|
30
30
|
|
|
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.
|
|
40
|
+
|
|
31
41
|
Local execution creates `codex/task-<id>-<slug>` from a clean base only after authorization.
|
|
32
42
|
An externally owned checkout must already use a dedicated non-base branch. The core never
|
|
33
43
|
creates or removes external worktrees. Each Step declares allowed writes, dependencies, and
|
|
@@ -40,6 +50,11 @@ failed checks, or any manual/unrecorded Worker commit block completion.
|
|
|
40
50
|
If the current Plan Risk Audit marks the Step for strict review, the atomic commit is still
|
|
41
51
|
created by core, but the Step remains non-terminal and `next` routes to `task step-review`
|
|
42
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
|
+
When `next` includes `gitMutationPolicy`, obtain bounded permission for that exact Git-writing
|
|
56
|
+
transition before the first call instead of probing and retrying after a `.git/index.lock`
|
|
57
|
+
failure. For `task start`, this applies only when invoking `--workspace-owner local`.
|
|
43
58
|
|
|
44
59
|
After a Step changes approved project knowledge, the Delivery Coordinator reconciles and
|
|
45
60
|
reapproves the Project Knowledge Map, then runs `task knowledge-rebind` between Steps. The
|
|
@@ -58,7 +73,9 @@ additions under Milestone autonomy; every unsafe source-set, category, scope, au
|
|
|
58
73
|
conflict change is rejected.
|
|
59
74
|
|
|
60
75
|
Submission requires a clean, auditable Task history and records evidence for the exact
|
|
61
|
-
Task head. `task review-launch` starts a separate read-only reviewer
|
|
76
|
+
Task head. `task review-launch` starts a separate read-only reviewer and atomically records its
|
|
77
|
+
result. If C1 handoff is active, keep `--actor` equal to the current claimant or required actor
|
|
78
|
+
from `next`; the reviewer identity remains internal to the compound route. A passing fresh review
|
|
62
79
|
permits Result creation. Human final acceptance binds Brief, Plan, Result, evidence, and
|
|
63
80
|
the accepted head. Base advancement forces synchronization, checks, review, and acceptance
|
|
64
81
|
to be repeated before merge.
|
|
@@ -73,6 +90,14 @@ For guarded remediation, a third ordinary retry is blocked until a current
|
|
|
73
90
|
`task corrective-decision` exists for the same Step and Plan binding. If that corrective
|
|
74
91
|
attempt fails review, the third failure is a hard stop and no fourth run is permitted.
|
|
75
92
|
|
|
93
|
+
One bounded exception avoids a deliberately repeated failure for an older authorization without
|
|
94
|
+
P01-A evidence or a contradiction that becomes observable only after execution starts. If the first guarded check failure
|
|
95
|
+
is caused by an absent root npm script that the Step cannot add because `package.json` is outside
|
|
96
|
+
its `allowedWrites`, fresh `next` advertises `task plan-integrity-recover`. The command records only
|
|
97
|
+
the exact evidence-bound early `replan-required` posture; it never edits source, Plan, or Git.
|
|
98
|
+
Continue through the advertised corrective yield and corrective replan rather than calling
|
|
99
|
+
`task run` again.
|
|
100
|
+
|
|
76
101
|
Execution authorization and final acceptance use the human path by default. If the user has
|
|
77
102
|
previously issued an active delegation grant for the exact transition and scope, the named
|
|
78
103
|
delegate may perform that transition with `--delegation-grant`. The event keeps the delegate
|
|
@@ -88,7 +113,10 @@ Discovery -> Milestone planning -> execution authorization -> active
|
|
|
88
113
|
-> final acceptance -> accepted
|
|
89
114
|
```
|
|
90
115
|
|
|
91
|
-
A Milestone Plan records outcome, success signal, acceptance, checks,
|
|
116
|
+
A Milestone Plan records outcome, success signal, acceptance, checks, Task membership, and the
|
|
117
|
+
canonical Task dependency DAG. Every membership explicitly supplies `dependsOnTaskIds`, including
|
|
118
|
+
`[]`. A required consumer may depend only on required members of the same Milestone; duplicate,
|
|
119
|
+
self, dangling, external, non-required-provider, and cyclic edges are rejected before commit.
|
|
92
120
|
Membership is `required`, `waived`, or `cancelled`; non-required entries require a reason.
|
|
93
121
|
Changing the Plan increments the membership revision, supersedes execution authorization,
|
|
94
122
|
and prevents new linked Tasks from starting. A Task that has started cannot be removed;
|
|
@@ -97,24 +125,33 @@ may finish while an amendment awaits authorization.
|
|
|
97
125
|
|
|
98
126
|
During initial planning, all linked Tasks may be materialized before one complete
|
|
99
127
|
`milestone plan-set`; no execution is available until the Plan classifies every reverse
|
|
100
|
-
membership.
|
|
128
|
+
membership. Repository `next` returns `milestone initial-assembly` both before Task 1 and between
|
|
129
|
+
linked Tasks. Its `linked-task-assembly` option explicitly permits `discovery start` and
|
|
130
|
+
`discovery materialize`; after the first linked Task exists, its closing option permits one
|
|
131
|
+
complete `milestone plan-set`. A failed
|
|
132
|
+
`status` or `next` is not permission to call the closing command directly. After that boundary,
|
|
133
|
+
semantic changes use human-only
|
|
101
134
|
`milestone scope-change-prepare` and `milestone scope-change-apply`. A previously issued
|
|
102
135
|
Milestone Autonomy Contract may instead use `milestone autonomy-evolve` for membership-only
|
|
103
136
|
changes while the outcome, success signal, acceptance, checks, discovery, and base branch
|
|
104
137
|
remain unchanged. The same contract may complete an atomic content-only Task context refresh
|
|
105
138
|
without a new human gate, but cannot approve Project Memory independently. Both paths retain
|
|
106
|
-
journaled recovery across `state.json`, `plan.json`, and `scope-change-events.jsonl`.
|
|
139
|
+
journaled recovery across `state.json`, `plan.json`, and `scope-change-events.jsonl`. The initial
|
|
140
|
+
Plan uses the same recovery machinery for its exact two-file `state.json` + `plan.json` commit and
|
|
141
|
+
does not manufacture a scope-change event.
|
|
107
142
|
|
|
108
143
|
A Milestone has no integration branch. Validation requires all required Tasks to be
|
|
109
144
|
`merged`, checks the current clean base branch, and writes evidence plus Result. Final
|
|
110
145
|
acceptance binds those artifacts to the unchanged base HEAD. Cancellation records a reason
|
|
111
146
|
and never changes Task state or reverts merged commits.
|
|
112
147
|
|
|
113
|
-
Repository-level `next` considers Milestone membership before it dispatches a
|
|
114
|
-
|
|
115
|
-
|
|
148
|
+
Repository-level `next` considers Milestone membership and dependencies before it dispatches a
|
|
149
|
+
Task. A linked Task is actionable only while its Milestone is `active`, its current membership is
|
|
150
|
+
`required`, and every declared required predecessor is `merged`. Handoff prepare, claim before
|
|
151
|
+
lease acquisition, and Task start use the same predicate. Unstarted `waived`/`cancelled`
|
|
152
|
+
memberships and Tasks belonging to
|
|
116
153
|
an accepted/cancelled Milestone are historical records, not work. A Task that already owns
|
|
117
|
-
a workspace
|
|
154
|
+
a workspace does not bypass an unsatisfied Milestone predecessor.
|
|
118
155
|
|
|
119
156
|
After successful Milestone validation, `next` emits `requiredHumanGate` containing the
|
|
120
157
|
Milestone revision, Plan/Result/evidence hashes, validated base HEAD, and a deterministic
|
|
@@ -128,11 +165,29 @@ With an eligible `milestone.final_accept` grant, `next` additionally returns
|
|
|
128
165
|
`delegatedApprovalOptions`. The delegate may then use the current `MSA-*` code in the same
|
|
129
166
|
turn because the earlier grant-issuance turn is the controlling user decision. Without such
|
|
130
167
|
an option, the ordinary later-message human gate remains mandatory.
|
|
168
|
+
Pass `--delegation-grant` only when the same `next` response exposes an exact eligible
|
|
169
|
+
`delegatedApprovalOptions` entry for that transition. Ordinary C1 handoff, claim, run,
|
|
170
|
+
step-complete, step-review, merge, and sync-base do not consume a Milestone approval grant.
|
|
131
171
|
|
|
132
172
|
The Milestone coordinator keeps implementation out of its long-lived context: every required
|
|
133
173
|
Task runs in a dedicated user-visible Task chat. The Milestone chat owns ordering, exact
|
|
134
174
|
delegated transitions, merge observation, cross-Task validation, and final acceptance.
|
|
135
175
|
|
|
176
|
+
The coordinator creates that chat as a new standalone Codex task, never as a fork/handoff of its
|
|
177
|
+
own thread, and sends only a fresh TaskContextPacket for the exact Task. It creates or reuses the
|
|
178
|
+
chat just before dispatch, not as an empty membership placeholder. The project registry allocates
|
|
179
|
+
one monotonic `#NNN` and builds `#NNN · M<NN> · Coord · <Milestone title> · <MS-ID>` or
|
|
180
|
+
`#NNN · M<NN>/T<NN> · Task · <Task title> · <TASK-ID>`; the Task ordinal still comes from approved
|
|
181
|
+
membership order. Exact readback and registry-owned fallback are mandatory.
|
|
182
|
+
|
|
183
|
+
Dispatch is followed by an explicit coordinator supervision loop. The Milestone chat waits on the
|
|
184
|
+
one currently routed Task chat with bounded `wait_threads` calls, reads it when it completes or
|
|
185
|
+
needs attention, and then verifies repository `status -> next`. A recoverable non-human boundary is
|
|
186
|
+
returned to the same chat with `send_message_to_thread`; only a genuine user/semantic gate or
|
|
187
|
+
unrecoverable blocker ends the coordinator turn. The next Task chat is created only after Core
|
|
188
|
+
confirms that the prior required Task is terminal and merged. Task completion does not implicitly
|
|
189
|
+
wake a coordinator that has already ended its turn.
|
|
190
|
+
|
|
136
191
|
## Responsibility boundaries
|
|
137
192
|
|
|
138
193
|
| Participant | Responsible for | Cannot decide |
|