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.
- package/README.md +27 -388
- package/dist/reviewer-runtime-build.json +96 -32
- package/dist/src/alpha6/adoption.d.ts +2 -0
- package/dist/src/alpha6/adoption.js +22 -0
- package/dist/src/alpha6/adoption.js.map +1 -1
- package/dist/src/alpha6/captured-check-evidence.d.ts +51 -0
- package/dist/src/alpha6/captured-check-evidence.js +152 -0
- package/dist/src/alpha6/captured-check-evidence.js.map +1 -0
- package/dist/src/alpha6/component-owner.d.ts +15 -1
- package/dist/src/alpha6/component-owner.js +44 -2
- package/dist/src/alpha6/component-owner.js.map +1 -1
- package/dist/src/alpha6/corrective-decision-boundary.d.ts +4 -0
- package/dist/src/alpha6/corrective-decision-boundary.js +47 -0
- package/dist/src/alpha6/corrective-decision-boundary.js.map +1 -0
- package/dist/src/alpha6/downstream-proof.d.ts +1 -25
- package/dist/src/alpha6/downstream-proof.js +0 -171
- package/dist/src/alpha6/downstream-proof.js.map +1 -1
- package/dist/src/alpha6/failed-step-planning-recovery.d.ts +10 -0
- package/dist/src/alpha6/failed-step-planning-recovery.js +93 -0
- package/dist/src/alpha6/failed-step-planning-recovery.js.map +1 -0
- package/dist/src/alpha6/literal-test-invocation.d.ts +2 -0
- package/dist/src/alpha6/literal-test-invocation.js +106 -0
- package/dist/src/alpha6/literal-test-invocation.js.map +1 -0
- package/dist/src/alpha6/milestone.d.ts +2 -0
- package/dist/src/alpha6/milestone.js +10 -1
- package/dist/src/alpha6/milestone.js.map +1 -1
- package/dist/src/alpha6/navigation-dirty-carryover.d.ts +11 -0
- package/dist/src/alpha6/navigation-dirty-carryover.js +130 -0
- package/dist/src/alpha6/navigation-dirty-carryover.js.map +1 -0
- package/dist/src/alpha6/plan-integrity.js +7 -5
- package/dist/src/alpha6/plan-integrity.js.map +1 -1
- package/dist/src/alpha6/plan-risk.d.ts +2 -0
- package/dist/src/alpha6/plan-risk.js +10 -3
- package/dist/src/alpha6/plan-risk.js.map +1 -1
- package/dist/src/alpha6/remediation.d.ts +6 -21
- package/dist/src/alpha6/remediation.js +161 -476
- package/dist/src/alpha6/remediation.js.map +1 -1
- package/dist/src/alpha6/root-cause-replan-carryover.d.ts +4 -1
- package/dist/src/alpha6/root-cause-replan-carryover.js +29 -5
- package/dist/src/alpha6/root-cause-replan-carryover.js.map +1 -1
- package/dist/src/beta1/project-transaction.d.ts +3 -1
- package/dist/src/beta1/project-transaction.js +6 -2
- package/dist/src/beta1/project-transaction.js.map +1 -1
- package/dist/src/checks/runner.d.ts +26 -0
- package/dist/src/checks/runner.js +223 -0
- package/dist/src/checks/runner.js.map +1 -0
- package/dist/src/checks/task-sync.d.ts +10 -0
- package/dist/src/checks/task-sync.js +41 -0
- package/dist/src/checks/task-sync.js.map +1 -0
- package/dist/src/checks/worker.d.ts +1 -0
- package/dist/src/checks/worker.js +154 -0
- package/dist/src/checks/worker.js.map +1 -0
- package/dist/src/cli-actions.d.ts +2 -2
- package/dist/src/cli-actions.js +3 -15
- package/dist/src/cli-actions.js.map +1 -1
- package/dist/src/cli.js +14 -98
- package/dist/src/cli.js.map +1 -1
- package/dist/src/contracts.d.ts +35 -32
- package/dist/src/dependency-provenance.d.ts +2 -2
- package/dist/src/dependency-provenance.js +12 -69
- package/dist/src/dependency-provenance.js.map +1 -1
- package/dist/src/domain/base-sync-conflict.d.ts +13 -0
- package/dist/src/domain/base-sync-conflict.js +32 -0
- package/dist/src/domain/base-sync-conflict.js.map +1 -0
- package/dist/src/domain/step-start-admission.d.ts +4 -0
- package/dist/src/domain/step-start-admission.js +9 -0
- package/dist/src/domain/step-start-admission.js.map +1 -0
- package/dist/src/domain/virgin-registration.d.ts +3 -0
- package/dist/src/domain/virgin-registration.js +65 -0
- package/dist/src/domain/virgin-registration.js.map +1 -0
- package/dist/src/errors.d.ts +1 -1
- package/dist/src/errors.js.map +1 -1
- package/dist/src/gateway-handshake.js +0 -8
- package/dist/src/gateway-handshake.js.map +1 -1
- package/dist/src/git.d.ts +3 -1
- package/dist/src/git.js +41 -14
- package/dist/src/git.js.map +1 -1
- package/dist/src/graph.js +25 -3
- package/dist/src/graph.js.map +1 -1
- package/dist/src/index.d.ts +1 -0
- package/dist/src/lifecycle/corrective-replan.js +3 -3
- package/dist/src/lifecycle/corrective-replan.js.map +1 -1
- package/dist/src/navigation-actions.d.ts +9 -0
- package/dist/src/navigation-actions.js +72 -0
- package/dist/src/navigation-actions.js.map +1 -0
- package/dist/src/navigation-update-artifact.d.ts +5 -0
- package/dist/src/navigation-update-artifact.js +227 -0
- package/dist/src/navigation-update-artifact.js.map +1 -0
- package/dist/src/navigation-update.d.ts +39 -0
- package/dist/src/navigation-update.js +82 -0
- package/dist/src/navigation-update.js.map +1 -0
- package/dist/src/observation.js +52 -29
- package/dist/src/observation.js.map +1 -1
- package/dist/src/observed-routes.js +5 -6
- package/dist/src/observed-routes.js.map +1 -1
- package/dist/src/pending-review-update.d.ts +0 -13
- package/dist/src/pending-review-update.js +1 -6
- package/dist/src/pending-review-update.js.map +1 -1
- package/dist/src/reviewer.d.ts +1 -1
- package/dist/src/reviewer.js +20 -17
- package/dist/src/reviewer.js.map +1 -1
- package/dist/src/runtime.d.ts +3 -0
- package/dist/src/runtime.js +6 -0
- package/dist/src/runtime.js.map +1 -0
- package/dist/src/state/corrective-replan-executor.d.ts +10 -0
- package/dist/src/state/corrective-replan-executor.js +37 -1
- package/dist/src/state/corrective-replan-executor.js.map +1 -1
- package/dist/src/state/corrective-replan-public-schema.js +15 -2
- package/dist/src/state/corrective-replan-public-schema.js.map +1 -1
- package/dist/src/state/corrective-replan-public.js +6 -5
- package/dist/src/state/corrective-replan-public.js.map +1 -1
- package/dist/src/state/corrective-replan-transaction.d.ts +1 -0
- package/dist/src/state/corrective-replan-transaction.js +12 -11
- package/dist/src/state/corrective-replan-transaction.js.map +1 -1
- package/dist/src/state/corrective-yield-executor.js +2 -2
- package/dist/src/state/corrective-yield-executor.js.map +1 -1
- package/dist/src/state/corrective-yield-transaction.d.ts +1 -0
- package/dist/src/state/corrective-yield-transaction.js +11 -10
- package/dist/src/state/corrective-yield-transaction.js.map +1 -1
- package/dist/src/state/lock.d.ts +4 -0
- package/dist/src/state/lock.js +21 -0
- package/dist/src/state/lock.js.map +1 -1
- 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-blocker-route.d.ts +8 -0
- package/dist/src/workflow-blocker-route.js +106 -0
- package/dist/src/workflow-blocker-route.js.map +1 -0
- package/dist/src/workflow.d.ts +48 -63
- package/dist/src/workflow.js +698 -1470
- package/dist/src/workflow.js.map +1 -1
- package/docs/autonomy-guardrails.md +26 -304
- package/docs/decisions.md +14 -112
- package/docs/development-flow.md +35 -238
- package/docs/project-memory.md +31 -50
- package/docs/release-app-evidence.md +190 -0
- package/docs/release.md +95 -363
- package/docs/updating-existing-project.md +19 -717
- package/package.json +11 -13
- package/plugins/codex-workflow-gateway/.codex-plugin/plugin.json +2 -2
- package/plugins/codex-workflow-gateway/references/chat-dispatch.md +73 -197
- package/plugins/codex-workflow-gateway/references/codebase-memory-routing.md +57 -0
- package/plugins/codex-workflow-gateway/references/protocol.md +42 -445
- package/plugins/codex-workflow-gateway/scripts/chat-dispatch.mjs +7 -1
- package/plugins/codex-workflow-gateway/scripts/chat-model-policy.mjs +10 -8
- package/plugins/codex-workflow-gateway/scripts/chat-registry.mjs +23 -5
- package/plugins/codex-workflow-gateway/skills/codex-workflow-gateway/SKILL.md +66 -740
- package/references/state-machine.md +4 -4
- package/roles/technical-planner.md +1 -1
- package/schemas/corrective-decision-event.schema.json +3 -1
- package/schemas/project-knowledge-map.schema.json +3 -1
- package/schemas/remediation-event.schema.json +10 -1
- package/schemas/task.schema.json +46 -2
- package/schemas/transition-payloads.schema.json +16 -1
- package/src/alpha6/adoption.ts +1123 -0
- package/src/alpha6/captured-check-evidence.ts +132 -0
- package/src/alpha6/check-support-anchor.ts +128 -0
- package/src/alpha6/component-owner.ts +168 -0
- package/src/alpha6/corrective-decision-boundary.ts +39 -0
- package/src/alpha6/downstream-proof.ts +520 -0
- package/src/alpha6/failed-step-planning-recovery.ts +88 -0
- package/src/alpha6/handoff.ts +1443 -0
- package/src/alpha6/journal.ts +473 -0
- package/src/alpha6/literal-test-invocation.ts +84 -0
- package/src/alpha6/mechanical-feasibility.ts +488 -0
- package/src/alpha6/milestone.ts +2192 -0
- package/src/alpha6/navigation-dirty-carryover.ts +154 -0
- package/src/alpha6/npm-check-contract.ts +47 -0
- package/src/alpha6/plan-integrity.ts +298 -0
- package/src/alpha6/plan-risk.ts +1480 -0
- package/src/alpha6/preexecution-replan.ts +187 -0
- package/src/alpha6/remediation-cause.ts +98 -0
- package/src/alpha6/remediation.ts +2438 -0
- package/src/alpha6/review.ts +1198 -0
- package/src/alpha6/root-cause-replan-carryover.ts +491 -0
- package/src/alpha6/store-sidecars.ts +335 -0
- package/src/alpha7/autonomy.ts +411 -0
- package/src/alpha7/corrective-recovery.ts +1332 -0
- package/src/artifacts.ts +130 -0
- package/src/beta1/project-transaction.ts +355 -0
- package/src/change-explanation.ts +153 -0
- package/src/checks/runner.ts +245 -0
- package/src/checks/task-sync.ts +41 -0
- package/src/checks/worker.ts +149 -0
- package/src/cli-actions.ts +107 -0
- package/src/cli.ts +1457 -0
- package/src/contracts.ts +1494 -0
- package/src/credential-output.ts +89 -0
- package/src/credential-transport.ts +215 -0
- package/src/delegation.ts +190 -0
- package/src/dependency-provenance.ts +472 -0
- package/src/diagnostics.ts +93 -0
- package/src/domain/base-sync-conflict.ts +35 -0
- package/src/domain/completed-step-carryover.ts +76 -0
- package/src/domain/discovery.ts +27 -0
- package/src/domain/plan-semantics.ts +58 -0
- package/src/domain/step-start-admission.ts +10 -0
- package/src/domain/validation.ts +177 -0
- package/src/domain/virgin-registration.ts +46 -0
- package/src/errors.ts +24 -0
- package/src/fs-utils.ts +61 -0
- package/src/gateway-handshake.ts +95 -0
- package/src/git.ts +183 -0
- package/src/graph.ts +342 -0
- package/src/historical-step-provenance.ts +136 -0
- package/src/index.ts +23 -0
- package/src/lifecycle/canonical-hash.ts +28 -0
- package/src/lifecycle/catalog.ts +202 -0
- package/src/lifecycle/compiler-inspection.ts +29 -0
- package/src/lifecycle/core-static-readiness.ts +132 -0
- package/src/lifecycle/corrective-replan-authority.ts +136 -0
- package/src/lifecycle/corrective-replan-binding-manifest.ts +51 -0
- package/src/lifecycle/corrective-replan-credential-core.ts +408 -0
- package/src/lifecycle/corrective-replan-credential-schema.ts +54 -0
- package/src/lifecycle/corrective-replan-credentials.ts +48 -0
- package/src/lifecycle/corrective-replan.ts +843 -0
- package/src/lifecycle/evaluator.ts +48 -0
- package/src/lifecycle/fingerprint.ts +488 -0
- package/src/lifecycle/immutable.ts +8 -0
- package/src/lifecycle/implementation-table.ts +118 -0
- package/src/lifecycle/index.ts +8 -0
- package/src/lifecycle/schema-artifact.ts +263 -0
- package/src/lifecycle/semantic-registry.ts +572 -0
- package/src/lifecycle/types.ts +838 -0
- package/src/memory.ts +273 -0
- package/src/migration.ts +161 -0
- package/src/navigation-actions.ts +70 -0
- package/src/navigation-update-artifact.ts +198 -0
- package/src/navigation-update.ts +121 -0
- package/src/observation.ts +225 -0
- package/src/observed-routes.ts +660 -0
- package/src/operational-contract.ts +125 -0
- package/src/pending-review-update.ts +175 -0
- package/src/repository.ts +99 -0
- package/src/reviewer.ts +1879 -0
- package/src/runtime.ts +6 -0
- package/src/state/corrective-replan-executor.ts +818 -0
- package/src/state/corrective-replan-public-schema.ts +83 -0
- package/src/state/corrective-replan-public.ts +908 -0
- package/src/state/corrective-replan-transaction.ts +949 -0
- package/src/state/corrective-yield-executor.ts +327 -0
- package/src/state/corrective-yield-transaction.ts +730 -0
- package/src/state/lock.ts +902 -0
- package/src/state/store.ts +567 -0
- package/src/transition-core.ts +330 -0
- package/src/ulid.ts +24 -0
- package/src/version.ts +2 -0
- package/src/workflow-blocker-route.ts +109 -0
- package/src/workflow.ts +10172 -0
- package/docs/alpha7.1-implementation-brief.md +0 -268
- package/docs/alpha7.2-corrective-context-refresh-brief.md +0 -484
- package/docs/alpha7.2.1-remediation-recovery-brief.md +0 -86
- package/docs/beta1-stabilization-brief.md +0 -165
- package/docs/beta11-plan-integrity-recovery-brief.md +0 -38
- package/docs/beta13.2-signal-review-recovery.md +0 -38
- package/docs/beta2-initial-assembly-navigation-brief.md +0 -616
- package/docs/change-model.md +0 -118
- package/docs/delegated-approval.md +0 -254
- package/docs/lifecycle/state-machine-stabilization.md +0 -641
- package/docs/pdf/README.md +0 -24
- 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 +0 -1
- package/docs/pdf/sources/codex-workflow-v2-architecture-ru.md +0 -478
- package/docs/pdf/sources/codex-workflow-v2-chat-only-guide-ru.md +0 -508
- package/docs/pdf/sources/codex-workflow-v2-technical-reference-ru.md +0 -778
- package/docs/pending-review-update.md +0 -15
- package/docs/problem-briefs/01-pre-implementation-integrity.md +0 -482
- package/docs/problem-briefs/02-minimal-step-integrity.md +0 -411
- package/docs/problem-briefs/03-minimal-agent-context-integrity.md +0 -358
- package/docs/problem-briefs/04-task-dependency-and-structural-replacement-integrity.md +0 -573
- package/docs/problem-briefs/BRIEF-TEMPLATE.md +0 -56
- package/docs/problem-briefs/README.md +0 -120
- package/docs/problem-briefs/evidence/p01-mechanical-feasibility-corpus.md +0 -90
- package/docs/problem-briefs/evidence/signal-v4-pre-m3-replay.md +0 -246
- package/docs/split-required-recovery.md +0 -47
- package/docs/stable-release-defect-register.md +0 -730
- package/docs/validation-report.md +0 -182
- package/scripts/generate-pdf-docs.py +0 -524
- package/scripts/run-pdf-docs.mjs +0 -62
|
@@ -1,458 +1,55 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Current action inputs
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Read this reference when preparing a Plan, a context refresh or a sealed review. Fresh Core
|
|
4
|
+
navigation is the eligibility authority; command help and current schemas define serialization.
|
|
5
|
+
This reference does not enumerate transitions or provide another compatibility contract.
|
|
4
6
|
|
|
5
|
-
|
|
6
|
-
Step, actor, and writer-token contract. This route is valid only for the Core-derived
|
|
7
|
-
first-failure missing-root-npm-script evidence and must be followed by fresh `status -> next`.
|
|
8
|
-
It records a replan posture without changing Plan or product files; corrective yield and the
|
|
9
|
-
existing state-bound corrective-replan Human gate remain mandatory.
|
|
7
|
+
## Planning and Knowledge
|
|
10
8
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
execution authorization are fresh authority; no Task or Milestone recreation is involved.
|
|
9
|
+
When `next` advertises `task plan-set`, consume its `taskPlanContract`. Preserve every
|
|
10
|
+
`requiredRequirementIds` and `requiredAcceptanceIds` member in the corresponding Plan arrays;
|
|
11
|
+
prose does not replace IDs. Bind the returned Brief hash and Knowledge Map revision/hash.
|
|
12
|
+
Preserve completed Step evidence and the current semantic/safety boundaries when replanning.
|
|
13
|
+
Missing or contradictory bindings stop Plan submission.
|
|
17
14
|
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
`next` must then advertise `update downstream-proof-dependency-recover`. Its preflight proves the
|
|
23
|
-
Task history at `HEAD^`, the dependency candidate at `HEAD`, aligned version surfaces, no lease or
|
|
24
|
-
transaction, exact predecessor ownership, and a content hash of the dirty set. Recovery registers
|
|
25
|
-
only the dependency commit. It does not mutate product files or Step state; fresh `next` must
|
|
26
|
-
proceed to `task downstream-proof-recover`, which outranks manifest-induced Knowledge staleness.
|
|
15
|
+
Compare planned exact `allowedWrites` and output paths with scanner classifications. A planned
|
|
16
|
+
new Knowledge source requires `knowledgeImpact: create` and an exact normalized path/category
|
|
17
|
+
in `knowledgeTargets`. A wildcard or directory is not an exact declaration. Source authority
|
|
18
|
+
comes from approved repository evidence; the planner cannot infer delegated approval eligibility.
|
|
27
19
|
|
|
28
|
-
- `
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
strict-review plus verified reviewer-attestation chains and remain separately auditable as
|
|
33
|
-
`retainedHistoricalCommits`.
|
|
34
|
-
Task-local manifest/lock fields from recorded history may differ from the base, but the candidate
|
|
35
|
-
commit must preserve them exactly while changing only the Workflow dependency entries.
|
|
36
|
-
- `task historical-step-provenance-preflight --id <TASK-ID>` is read-only. The matching
|
|
37
|
-
`task historical-step-provenance-recover` is available only for one unexpected product commit
|
|
38
|
-
with an intact passed strict-review chain, matching prior final acceptance, no lease or pending
|
|
39
|
-
operation, and dirty files confined to the current active Step. It retains historical authority
|
|
40
|
-
without changing Git, worktree bytes, or the current Plan.
|
|
41
|
-
- `update historical-step-dependency-preflight/recover` handles the same proof when the beta.12.9
|
|
42
|
-
dependency-only commit is the unregistered HEAD. It binds the exact dependency candidate and the
|
|
43
|
-
reviewed historical Step commit in one recovery record, preserves active product bytes, and then
|
|
44
|
-
requires fresh `status` and `next`.
|
|
45
|
-
- `task stop-override-prepare` is a read-only Human gate for the exact beta.11 attempt-four stop
|
|
46
|
-
shape. `task stop-override-apply` requires the same Task revision, Step, actor, reason, Plan, HEAD,
|
|
47
|
-
evidence binding, and returned `SOO-*` code in a later user turn. It appends evidence without
|
|
48
|
-
deleting `stop-escalate`; it never applies to `split-required`.
|
|
49
|
-
- After an applied stop override, one or more ordinary delegated `task context-refresh` transitions
|
|
50
|
-
may rebind the Plan before attempt four. Fresh `next` returns `task run` only when Core validates
|
|
51
|
-
the complete contiguous Plan/rebind/audit chain, mechanical equivalence at every hop, shared
|
|
52
|
-
delegated authority, and append-only chronology. HEAD may differ from the override only when every
|
|
53
|
-
intervening commit is an exact registered dependency-provenance recovery changing only
|
|
54
|
-
`package.json` and `package-lock.json`. If C1 remains claimed but the lease was lost at the Human
|
|
55
|
-
boundary, use only the simultaneously advertised `task writer-credential-replace` action.
|
|
56
|
-
A provenance recovery recorded after the final context-refresh audit may explain exactly one
|
|
57
|
-
additional Task revision only when it belongs to that verified Git chain. Any unexplained
|
|
58
|
-
revision remains a `doctor` boundary.
|
|
59
|
-
- Before a credential-consuming mutation, check the public `writerCredentialReference.expiresAt`
|
|
60
|
-
against the current time and its actor/action binding. Lease heartbeat or renewal does not
|
|
61
|
-
extend that reference's expiry. An expired, missing, consumed or unverifiable reference requires
|
|
62
|
-
the simultaneously advertised `next.writerCredentialRecovery` action with its exact Task,
|
|
63
|
-
revision and `requiredActor`, followed by fresh `status` and `next`; use the new reference.
|
|
64
|
-
If no recovery is advertised, stop before mutation. Never read or patch the vault, extend expiry
|
|
65
|
-
manually, or reuse the old reference. This check also applies after independent reviews and pauses.
|
|
66
|
-
- `milestone progress --id <MS-ID>` is a read-only projection and the sole source for Coordinator
|
|
67
|
-
progress tables. It preserves cancelled/replacement Tasks as distinct membership rows.
|
|
68
|
-
- `scripts/chat-registry.mjs` atomically allocates project-monotonic `#NNN`, builds all six title
|
|
69
|
-
families, verifies exact readback, supplies deterministic fallbacks, and binds the verified chat.
|
|
70
|
-
It also journals a single creation permit, pending/actual IDs, evidence-based resolution and
|
|
71
|
-
supervision cursors. Missing App listings never permit a retry. See `chat-dispatch.md` for
|
|
72
|
-
dispatch commands and the explicit role/phase model + thinking policy. These are App routing
|
|
73
|
-
helpers; they do not change Workflow protocol/state schema or grant approval authority.
|
|
20
|
+
If top-level `next` advertises `task context-refresh`, execute that atomic action with the returned
|
|
21
|
+
Task/map revisions, named delegate and grant. Do not approve/reconcile Knowledge separately first.
|
|
22
|
+
Unsafe differences use the visible Knowledge approval route returned by Core. For additional
|
|
23
|
+
implementation scope, `change explain` consumes a closed proposal; its diagnostic is not approval.
|
|
74
24
|
|
|
75
|
-
##
|
|
25
|
+
## Sealed review
|
|
76
26
|
|
|
77
|
-
|
|
27
|
+
For `external-sealed`, request the advertised Step or Task review packet and dispatch an independent
|
|
28
|
+
reviewer with only the immutable evidence and its read-only role. A separate thread identity alone
|
|
29
|
+
does not establish that a review occurred. Obtain the actual result and verify unchanged bindings.
|
|
30
|
+
Do not launch a nested local reviewer in an App sandbox when external-sealed is recommended.
|
|
78
31
|
|
|
79
|
-
|
|
80
|
-
codex-workflow gateway handshake --repo <git-root>
|
|
81
|
-
```
|
|
32
|
+
The record input is the full envelope, not a flattened review:
|
|
82
33
|
|
|
83
|
-
|
|
34
|
+
- `protocol`: the current Step/Task envelope protocol;
|
|
35
|
+
- `packetHash`, `repositorySealHash`, `reviewerThreadId`, `reviewMode`: exact packet/result bindings;
|
|
36
|
+
- `review`: the closed object containing `status`, `reviewer`, `summary`, and `findings`.
|
|
84
37
|
|
|
85
|
-
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
38
|
+
Consult `task step-review-record --help` or `task review-sealed-record --help` for the applicable
|
|
39
|
+
schema/example. Mode belongs in the envelope; do not invent an extra record-command option.
|
|
40
|
+
Use the lifecycle actor from `next`, separately from the independent reviewer identity, and the
|
|
41
|
+
advertised credential reference. Discard a review whose packet, commit or seal changed.
|
|
42
|
+
An unverified launch or permission denial is not evidence of a semantic implementation failure.
|
|
89
43
|
|
|
90
|
-
|
|
44
|
+
## Context and authority changes
|
|
91
45
|
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
- `delegated-approval-v1`
|
|
98
|
-
- `task-knowledge-rebind-v1`
|
|
99
|
-
- `task-context-refresh-v1`
|
|
100
|
-
- `structural-task-replacement-disabled-v1`
|
|
101
|
-
- `project-composite-transaction-journal-v1`
|
|
102
|
-
- `corrective-plan-audit-v1`
|
|
103
|
-
- `safe-update-preflight-v1`
|
|
104
|
-
- `bounded-dependency-provenance-recovery-v1`
|
|
105
|
-
- `task-local-dependency-provenance-recovery-v1`
|
|
106
|
-
- `legacy-stop-escalate-override-v1`
|
|
107
|
-
- `stop-override-context-rebind-v1`
|
|
108
|
-
- `stop-override-context-rebind-chain-v1`
|
|
109
|
-
- `stop-override-post-audit-dependency-revision-v1`
|
|
110
|
-
- `retained-reviewed-history-recovery-v1`
|
|
111
|
-
- `milestone-progress-projection-v1`
|
|
112
|
-
- `strict-reviewer-v1`
|
|
113
|
-
- `legacy-snapshot-v1`
|
|
114
|
-
- `plan-risk-audit-sidecar-v1`
|
|
115
|
-
- `step-strict-review-sidecar-v1`
|
|
116
|
-
- `step-remediation-circuit-breaker-sidecar-v1`
|
|
117
|
-
- `milestone-scope-change-sidecar-v1`
|
|
118
|
-
- `milestone-membership-integrity-v1`
|
|
119
|
-
- `milestone-task-dependency-dag-v1`
|
|
120
|
-
- `milestone-initial-plan-transaction-v1`
|
|
121
|
-
- `task-c1-handoff-sidecar-v1`
|
|
122
|
-
- `task-mechanical-feasibility-v1`
|
|
123
|
-
- `semantic-plan-risk-audit-v2`
|
|
124
|
-
- `guarded-remediation-continuation-v1`
|
|
125
|
-
- `milestone-reverse-membership-integrity-v1`
|
|
126
|
-
- `task-c1-handoff-bundle-v2`
|
|
127
|
-
- `alpha6-adoption-posture-v1`
|
|
128
|
-
- `alpha6-strict-review-rescue-v1`
|
|
129
|
-
- `milestone-initial-assembly-v1`
|
|
130
|
-
- `milestone-initial-assembly-navigation-v2`
|
|
131
|
-
- `milestone-autonomy-contract-v1`
|
|
132
|
-
- `milestone-autonomy-content-refresh-v1`
|
|
133
|
-
- `milestone-autonomous-membership-evolution-v1`
|
|
134
|
-
- `task-c1-derived-worker-actor-v1`
|
|
135
|
-
- `guarded-corrective-auditor-routing-v1`
|
|
136
|
-
- `corrective-decision-context-recovery-v1`
|
|
137
|
-
- `remediation-mode-recovery-v1`
|
|
138
|
-
- `plan-proof-obligations-v1`
|
|
139
|
-
- `bounded-plan-integrity-recovery-v1`
|
|
140
|
-
- `downstream-proof-predecessor-recovery-v1`
|
|
141
|
-
- `active-downstream-proof-dependency-recovery-v1`
|
|
142
|
-
- `corrective-yield-journal-v1`
|
|
143
|
-
- `corrective-replan-journal-v1`
|
|
144
|
-
- `corrective-replan-human-gate-v1`
|
|
145
|
-
- `corrective-replan-protocol-v2`
|
|
46
|
+
Help cannot waive any current claim, lease, independent audit or human gate. An actor derived by
|
|
47
|
+
Core removes a naming question, not its authority checks. A new review finding does not by itself
|
|
48
|
+
permit scope expansion or a new Task. Follow its current fix/replan/stop route and preserve history.
|
|
49
|
+
When the response offers several alternatives, choose only one consistent with the user's intent;
|
|
50
|
+
cancellation, publication and delegation issuance do not acquire authorization by appearing there.
|
|
146
51
|
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
For an existing schema 2 project without alpha.6 posture, repository-level `next` blocks
|
|
153
|
-
execution behind adoption:
|
|
154
|
-
|
|
155
|
-
- `action: "state adoption-apply"` when the repository is already at a safe boundary
|
|
156
|
-
- `action: "restore safe boundary, then state adoption-prepare"` otherwise
|
|
157
|
-
|
|
158
|
-
Use:
|
|
159
|
-
|
|
160
|
-
```text
|
|
161
|
-
codex-workflow state adoption-prepare --repo <git-root>
|
|
162
|
-
codex-workflow state adoption-apply --repo <git-root> \
|
|
163
|
-
--actor <HUMAN-ACTOR> --confirmation-code <ADA-CODE>
|
|
164
|
-
```
|
|
165
|
-
|
|
166
|
-
The confirmation is bound to project identity, package version, protocol version, schema
|
|
167
|
-
version, canonical entity summaries, and the current sidecar baseline hash. Adoption is not
|
|
168
|
-
`state migrate`.
|
|
169
|
-
|
|
170
|
-
## Worker Step completion and strict Step Review
|
|
171
|
-
|
|
172
|
-
`task run` dispatches one Step and returns a first-field `writerLeaseReceipt`, followed by the
|
|
173
|
-
credential-free lease metadata, Task state, and Worker envelope. Consume the receipt before the
|
|
174
|
-
remaining payload and retain its token only in working memory. The Worker
|
|
175
|
-
must leave all changes uncommitted and must not stage, commit, amend, reset, rebase, or
|
|
176
|
-
modify Git history.
|
|
177
|
-
|
|
178
|
-
While that Step is `in_progress`, repository-level `next` normally returns
|
|
179
|
-
`action: "task step-complete"`, the exact `stepId`, and a `commitPolicy` declaring
|
|
180
|
-
`workflow-core` ownership. The coordinator invokes that transition with the current revision
|
|
181
|
-
and writer token. Core then runs configured checks, validates `allowedWrites`, stages the
|
|
182
|
-
changes, creates the atomic commit, and records evidence.
|
|
183
|
-
When `next` also includes `gitMutationPolicy`, obtain bounded permission for that exact
|
|
184
|
-
Git-writing transition before the first call; do not probe and retry after a
|
|
185
|
-
`.git/index.lock` failure. For `task start`, the policy applies only when the coordinator
|
|
186
|
-
chooses `--workspace-owner local`.
|
|
187
|
-
|
|
188
|
-
When `next` also includes `writerTokenContract`, the coordinator must retain the active writer
|
|
189
|
-
lease from `writerLeaseReceipt` and pass it with the advertised option on the first transition call.
|
|
190
|
-
The contract never contains the token value. Do not print, persist, reconstruct, or replace the
|
|
191
|
-
token with a redacted fingerprint; stop before mutation when the active lease is unavailable.
|
|
192
|
-
Satisfy this contract separately from any `gitMutationPolicy` on the same response.
|
|
193
|
-
|
|
194
|
-
`codex-workflow <noun> [action] --help` is a read-only command-discovery route. It exits without
|
|
195
|
-
constructing workflow state or validating lifecycle inputs. Use exact option lists only when the
|
|
196
|
-
response says `exactOptionContractAvailable=true`; otherwise consult this packaged protocol. After
|
|
197
|
-
help, obtain a fresh `next` before invoking the lifecycle transition.
|
|
198
|
-
|
|
199
|
-
If the current Plan Risk Audit marks that Step for strict review, the commit is still
|
|
200
|
-
workflow-owned, but `next` then returns `action: "task step-review"` with the same `stepId`
|
|
201
|
-
and the exact `completionCommit`. Canonical Step completion remains blocked until the strict
|
|
202
|
-
review and reviewer attestation sidecars verify against that exact commit.
|
|
203
|
-
Invoke `task step-review` with the same lifecycle actor advertised by `next`
|
|
204
|
-
(`c1Handoff.claimant` or `requiredActor` when present). The isolated reviewer is launched
|
|
205
|
-
inside Core; do not substitute the reviewer identity into `--actor`. In claimed C1 posture,
|
|
206
|
-
`next.writerTokenContract` is mandatory for both `task step-review` and the later
|
|
207
|
-
`task review-launch`; pass the retained active lease on the first call of each exact action.
|
|
208
|
-
|
|
209
|
-
After submission, a pending Task review is advertised as `action: "task review-launch"`, not
|
|
210
|
-
`task review-record`. That compound route launches the read-only reviewer and atomically
|
|
211
|
-
records the returned review. If claimant-bound mutation is active, pass the same lifecycle
|
|
212
|
-
actor through `--actor`; reviewer identity remains internal to the route.
|
|
213
|
-
|
|
214
|
-
An unrecorded commit is Git history drift. Stop instead of adding another commit or editing
|
|
215
|
-
workflow state manually; recovery remains coordinator-controlled.
|
|
216
|
-
|
|
217
|
-
If a Docker proof fails with `EPERM`, `operation not permitted`, or `permission denied` at the
|
|
218
|
-
Docker socket/CLI boundary, classify it as sandbox access, not daemon failure. Re-run the exact
|
|
219
|
-
read-only health probe or Plan command once with sandbox escalation; do not charge an infrastructure
|
|
220
|
-
retry. Restarting Docker Desktop or pulling another image is forbidden on this evidence alone. A
|
|
221
|
-
Docker infrastructure failure exists only when an escalated call reaches Docker and independently
|
|
222
|
-
proves the daemon unavailable.
|
|
223
|
-
|
|
224
|
-
## Plan Risk Audit and remediation breaker
|
|
225
|
-
|
|
226
|
-
Before `task authorize`, every new alpha.7 Task requires:
|
|
227
|
-
|
|
228
|
-
```text
|
|
229
|
-
codex-workflow task plan-risk-audit --repo <git-root> \
|
|
230
|
-
--id <TASK-ID> --expected-revision <REVISION> --file <audit.json>
|
|
231
|
-
```
|
|
232
|
-
|
|
233
|
-
The audit must classify every current Step exactly once, name distinct planner/auditor
|
|
234
|
-
actors, bind guarded failure modes to exact Step checks, and map each guarded failure mode to
|
|
235
|
-
one hostile counterexample, expected safe result, and exact executable evidence command. Use `decision=approved` for an
|
|
236
|
-
unguarded Plan. Missing, stale, `split-required`, or `stop-escalate` evidence blocks
|
|
237
|
-
authorization.
|
|
238
|
-
|
|
239
|
-
For guarded remediation, the first two failed cycles are recorded as `ordinary` and later cycles as
|
|
240
|
-
`corrective`. This mode is diagnostic: a third or later retry remains executable and still requires
|
|
241
|
-
a fresh strict review. A finding defaults to `route=fix`; `route=replan` is accepted only with exact
|
|
242
|
-
Plan-conflict evidence and routes to ordinary `task plan-set` for implementation-Step changes.
|
|
243
|
-
|
|
244
|
-
An explicit corrective disposition can still be recorded when the actor deliberately chooses a
|
|
245
|
-
stop, split, or compatible historical recovery route:
|
|
246
|
-
|
|
247
|
-
```text
|
|
248
|
-
codex-workflow task corrective-decision --repo <git-root> \
|
|
249
|
-
--id <TASK-ID> --step <STEP-ID> --expected-revision <REVISION> --file <decision.json>
|
|
250
|
-
```
|
|
251
|
-
|
|
252
|
-
`continue-fix` permits continuation; `replan-required`, `split-required`, and `stop-escalate` are
|
|
253
|
-
explicit stop or redirection decisions. They are never inferred from attempt count. Without such an
|
|
254
|
-
explicit decision, another failed strict review continues the same Task through its evidence-bound
|
|
255
|
-
`fix`/`replan` route.
|
|
256
|
-
|
|
257
|
-
One append-only compatibility exception exists for a beta.11 policy-created attempt-four stop.
|
|
258
|
-
Fresh `next` must advertise `task stop-override-prepare`; run it with exact human inputs, present the
|
|
259
|
-
complete binding, and stop. A later explicit user turn may run `task stop-override-apply` with the
|
|
260
|
-
same inputs and confirmation code. Any split decision, Plan/revision/HEAD drift, missing attempt-3
|
|
261
|
-
continue authority, lease, transaction, or journal damage blocks the route.
|
|
262
|
-
|
|
263
|
-
## Context refresh
|
|
264
|
-
|
|
265
|
-
Before `task plan-set`, compare exact Step `allowedWrites` and expected output paths with scanner
|
|
266
|
-
classifications. A planned new scanner-visible Knowledge file must be declared with
|
|
267
|
-
`knowledgeImpact: create` and an exact path/category `knowledgeTargets` entry. Wildcards,
|
|
268
|
-
directories, and inferred authority are not declarations; only Core may decide whether the final
|
|
269
|
-
diff is eligible for delegated refresh.
|
|
270
|
-
|
|
271
|
-
For every `task plan-set` navigation, consume `next.taskPlanContract` before building the Plan.
|
|
272
|
-
Its `requiredRequirementIds` and `requiredAcceptanceIds` are exact-membership preconditions, not
|
|
273
|
-
descriptive hints. Preserve each ID verbatim in the corresponding Plan array and use the returned
|
|
274
|
-
Brief hash plus Knowledge Map revision/hash as the planning binding. Missing or stale contract data
|
|
275
|
-
is a stop condition.
|
|
276
|
-
|
|
277
|
-
Use `task context-refresh` only when the same `next` response returns it as the top-level action and
|
|
278
|
-
exposes `contextRefresh` for the exact grant. Pass Task revision, map revision, delegate actor, and
|
|
279
|
-
grant ID. Never run standalone `project-memory reconcile` first; Core blocks that non-atomic route
|
|
280
|
-
when the exact delegated composite is available. The composite
|
|
281
|
-
operation accepts content-hash-only drift and, under a Milestone Autonomy Grant, an exact
|
|
282
|
-
supporting-source addition predeclared by the current execution-authorized Task Plan. Core checks
|
|
283
|
-
the full fail-closed predicate; do not reconstruct it in the gateway. When `next` instead returns
|
|
284
|
-
`contextRefreshBlocked.unsafeDifferences`, keep the change on the normal visible Knowledge path.
|
|
285
|
-
|
|
286
|
-
Before updating the installed package, run `update preflight`. Continue only for `safe=true`.
|
|
287
|
-
For an alpha.6 project trapped between a pending strict review and forbidden Knowledge rebind,
|
|
288
|
-
an exact external alpha.7 runner may run `update rescue-preflight`. Continue only for
|
|
289
|
-
`eligible=true` and only with the returned lock-repair and strict-review actions.
|
|
290
|
-
|
|
291
|
-
## C1 handoff
|
|
292
|
-
|
|
293
|
-
`C1` coordination is machine-bound and local. Use:
|
|
294
|
-
|
|
295
|
-
```text
|
|
296
|
-
codex-workflow task handoff-prepare --repo <git-root> --id <TASK-ID> \
|
|
297
|
-
--expected-revision <REVISION> --actor <CURRENT-ACTOR> \
|
|
298
|
-
[--target-actor <TARGET-ACTOR>] --reason <TEXT> [--writer-token <TOKEN>] \
|
|
299
|
-
[--delegation-grant <GRANT>] [--expires-at <ISO-TIMESTAMP>]
|
|
300
|
-
codex-workflow task handoff-show --repo <git-root> --id <TASK-ID>
|
|
301
|
-
codex-workflow task claim --repo <git-root> --id <TASK-ID> \
|
|
302
|
-
--expected-revision <REVISION> --actor <TARGET-ACTOR> --claim-token <TOKEN> \
|
|
303
|
-
[--writer-token <WRITER-TOKEN>]
|
|
304
|
-
codex-workflow task handback-create --repo <git-root> --id <TASK-ID> \
|
|
305
|
-
--expected-revision <REVISION> --actor <CLAIMANT> --reason <TEXT> \
|
|
306
|
-
--recommended-next <TEXT> [--limitation <TEXT>] [--writer-token <TOKEN>]
|
|
307
|
-
```
|
|
308
|
-
|
|
309
|
-
While a handoff is pending, `next` blocks the previous action behind `task claim`. While
|
|
310
|
-
claimed, only the claimant may mutate the Task, and lease-bound mutations must present the
|
|
311
|
-
bound writer token. Milestone-linked Tasks must be claimed before start, and handback is
|
|
312
|
-
terminal and evidence-bound. When target actor is omitted, Core derives
|
|
313
|
-
`agent:worker:<task-id>`. No thread id is required or accepted as authority.
|
|
314
|
-
The successful prepare response begins with `credentialHandoff`. Consume that receipt before the
|
|
315
|
-
Task/event/bundle payload, retain its token only in working memory, and pass it exactly once to the
|
|
316
|
-
declared `task claim --claim-token` action for the declared target actor. The later bundle remains
|
|
317
|
-
contextual and intentionally contains no second copy of the claim token.
|
|
318
|
-
The successful claim response then begins with `writerLeaseReceipt`. Retain that token only in
|
|
319
|
-
working memory. In claimed C1 posture, fresh `next` exposes `writerTokenContract` on `task run`;
|
|
320
|
-
pass the receipt token through its declared `--writer-token` option on the first run call. The
|
|
321
|
-
successful run returns the refreshed writer receipt for later lease-bound transitions.
|
|
322
|
-
|
|
323
|
-
`task result-set` is also lease-bound. It requires the active `--writer-token` and the exact C1
|
|
324
|
-
claimant in `--actor` when the Task is claimed. Success releases the lease before the Task enters
|
|
325
|
-
`awaiting_final_acceptance`; the token is no longer valid. The Human gate must therefore remain
|
|
326
|
-
lease-free for an arbitrary amount of time. After acceptance, obtain the new merge credential only
|
|
327
|
-
through the `writerCredentialRecovery` action advertised by fresh `next`.
|
|
328
|
-
|
|
329
|
-
## Milestone assembly, autonomy, and human gate
|
|
330
|
-
|
|
331
|
-
During initial planning, materialize every linked Task and then call `milestone plan-set` once
|
|
332
|
-
with the complete membership. Execution is blocked while reverse membership is incomplete.
|
|
333
|
-
Before Task 1 and between linked Tasks, follow top-level `next.action = "milestone initial-assembly"`.
|
|
334
|
-
Its `linked-task-assembly.commands` permit `discovery start` and `discovery materialize`; after the
|
|
335
|
-
first linked Task exists, the separate closing option permits `milestone plan-set`. If `status` or `next` fails, stop: never label
|
|
336
|
-
the gap expected and invoke `milestone plan-set` directly.
|
|
337
|
-
|
|
338
|
-
Every required navigation checkpoint is strictly sequential: start `status`, wait until its
|
|
339
|
-
terminal result is recorded, then start `next` and wait for its terminal result. Never issue the
|
|
340
|
-
pair concurrently or through a parallel tool call. The trusted transcript validator treats a
|
|
341
|
-
second invocation before the first terminal result as indeterminate release evidence.
|
|
342
|
-
|
|
343
|
-
After that Plan, one human may prepare and grant a maximum-72-hour Milestone Autonomy Contract:
|
|
344
|
-
|
|
345
|
-
```text
|
|
346
|
-
codex-workflow milestone autonomy-prepare --repo <git-root> --id <MS-ID> \
|
|
347
|
-
--expected-revision <REVISION> --principal <HUMAN> --delegate <AGENT> --expires-at <ISO>
|
|
348
|
-
codex-workflow milestone autonomy-grant --repo <git-root> --id <MS-ID> \
|
|
349
|
-
--expected-revision <REVISION> --principal <HUMAN> --delegate <AGENT> --expires-at <ISO> \
|
|
350
|
-
--confirmation-code <MAC-CODE>
|
|
351
|
-
```
|
|
352
|
-
|
|
353
|
-
The contract issues a milestone-scoped grant for the existing Task/Milestone approval transitions
|
|
354
|
-
and Project Memory approval only inside an atomic Task context refresh for the same Milestone.
|
|
355
|
-
That composite path covers content-only drift plus exact Plan-bounded supporting-source additions;
|
|
356
|
-
it cannot approve Project Memory independently. `milestone autonomy-evolve --file
|
|
357
|
-
<plan.json>` is permitted only when outcome, success signal, acceptance, checks, discovery, and
|
|
358
|
-
base branch still match the contract. It journals agent actor plus contract evidence and requires
|
|
359
|
-
reauthorization afterward.
|
|
360
|
-
|
|
361
|
-
After the initial empty planning posture, Milestone scope updates use:
|
|
362
|
-
|
|
363
|
-
```text
|
|
364
|
-
codex-workflow milestone scope-change-prepare --repo <git-root> \
|
|
365
|
-
--id <MS-ID> --expected-revision <REVISION> --actor <HUMAN-ACTOR> --file <plan.json>
|
|
366
|
-
codex-workflow milestone scope-change-apply --repo <git-root> \
|
|
367
|
-
--id <MS-ID> --expected-revision <REVISION> --actor <HUMAN-ACTOR> \
|
|
368
|
-
--confirmation-code <MSC-CODE> --file <plan.json>
|
|
369
|
-
```
|
|
370
|
-
|
|
371
|
-
This ordinary semantic-change path is human-only. Generic delegated approval never authorizes it.
|
|
372
|
-
|
|
373
|
-
At `awaiting_final_acceptance`, `next` returns `requiredHumanGate` with kind
|
|
374
|
-
`milestone_final_acceptance`, Milestone ID, revision, Plan/Result/evidence hashes, validated
|
|
375
|
-
HEAD, and a confirmation code. Display the complete object and end the turn. Only a later
|
|
376
|
-
explicit user message that approves the same code authorizes:
|
|
377
|
-
|
|
378
|
-
```text
|
|
379
|
-
codex-workflow milestone accept --repo <git-root> --id <MS-ID> \
|
|
380
|
-
--expected-revision <REVISION> --actor <USER-ACTOR> \
|
|
381
|
-
--confirmation-code <MSA-CODE>
|
|
382
|
-
```
|
|
383
|
-
|
|
384
|
-
Do not infer approval from the request that initiated validation. A changed revision, hash,
|
|
385
|
-
or HEAD requires a new gate.
|
|
386
|
-
|
|
387
|
-
## Delegated Approval
|
|
388
|
-
|
|
389
|
-
`delegation prepare --file <policy.json>` returns a `delegation_grant_issuance` gate with a
|
|
390
|
-
project-bound policy hash and `DGA-*` confirmation code. Display it and end the turn. A later
|
|
391
|
-
explicit user message containing the exact code permits `delegation grant`.
|
|
392
|
-
|
|
393
|
-
Active eligible grants appear in `next.delegatedApprovalOptions`. Use only the option whose
|
|
394
|
-
transition matches the requested command, with the named delegate as actor and the grant ID
|
|
395
|
-
as `--delegation-grant`. The resulting authorization event records the grant and both actors.
|
|
396
|
-
For `milestone.final_accept`, also pass the current `MSA-*` code; the existing grant replaces
|
|
397
|
-
the later-message requirement, not the state binding.
|
|
398
|
-
Do not pass `--delegation-grant` to ordinary C1 handoff, claim, run, step-complete,
|
|
399
|
-
step-review, merge, or sync-base calls. Those transitions are not authorized by a Milestone
|
|
400
|
-
approval grant unless the same `next` response explicitly advertises an eligible grant for the
|
|
401
|
-
exact transition.
|
|
402
|
-
|
|
403
|
-
Delegated approval does not cover adoption apply or the ordinary semantic Milestone scope-change
|
|
404
|
-
path. Membership-only evolution requires the separate Milestone Autonomy Contract.
|
|
405
|
-
|
|
406
|
-
## Graph Refresh Request
|
|
407
|
-
|
|
408
|
-
The package returns:
|
|
409
|
-
|
|
410
|
-
```json
|
|
411
|
-
{
|
|
412
|
-
"protocolVersion": 1,
|
|
413
|
-
"requestId": "uuid",
|
|
414
|
-
"projectId": "local-project-id",
|
|
415
|
-
"graphKind": "product",
|
|
416
|
-
"sourceRoot": "/absolute/local/path",
|
|
417
|
-
"rootFingerprint": "sha256",
|
|
418
|
-
"indexedHead": "git-sha-or-null",
|
|
419
|
-
"packageVersion": null,
|
|
420
|
-
"manifestHash": null,
|
|
421
|
-
"mode": "moderate",
|
|
422
|
-
"persistence": false,
|
|
423
|
-
"issuedAt": "ISO-8601"
|
|
424
|
-
}
|
|
425
|
-
```
|
|
426
|
-
|
|
427
|
-
`workflow` requests set packageVersion and manifestHash and point sourceRoot to
|
|
428
|
-
the prepared versioned workflow view.
|
|
429
|
-
|
|
430
|
-
## Evidence
|
|
431
|
-
|
|
432
|
-
Return the request unchanged with:
|
|
433
|
-
|
|
434
|
-
```json
|
|
435
|
-
{
|
|
436
|
-
"requestId": "same-uuid",
|
|
437
|
-
"provider": "codebase-memory-mcp",
|
|
438
|
-
"projectKey": "provider-project-key",
|
|
439
|
-
"rootFingerprint": "same-sha256",
|
|
440
|
-
"indexedHead": "same-git-sha-or-null",
|
|
441
|
-
"packageVersion": null,
|
|
442
|
-
"manifestHash": null,
|
|
443
|
-
"mode": "moderate",
|
|
444
|
-
"status": "ready",
|
|
445
|
-
"nodeCount": 100,
|
|
446
|
-
"edgeCount": 200,
|
|
447
|
-
"observedAt": "ISO-8601"
|
|
448
|
-
}
|
|
449
|
-
```
|
|
450
|
-
|
|
451
|
-
The package rejects mismatched or stale requests. Absolute source paths remain
|
|
452
|
-
local workflow data and are not project knowledge.
|
|
453
|
-
|
|
454
|
-
## Retention
|
|
455
|
-
|
|
456
|
-
Product binding stores only the current evidence. Workflow binding stores the
|
|
457
|
-
current package evidence plus one previous package snapshot. A new snapshot is
|
|
458
|
-
retained only after the new binding is ready.
|
|
52
|
+
A successful result submission can release the execution lease before final acceptance. After a
|
|
53
|
+
human pause, use fresh navigation and its credential recovery; do not reuse the earlier reference.
|
|
54
|
+
Before a package update, require the installed package's `update preflight` to report `safe=true`.
|
|
55
|
+
An unsafe boundary is a diagnostic, not permission to edit state or clean away retained work.
|
|
@@ -64,7 +64,13 @@ export function dispatchAction(action, entry, input = {}) {
|
|
|
64
64
|
const selection = selectChatModel(entry.type, input.modelRequest);
|
|
65
65
|
const id = randomUUID();
|
|
66
66
|
const marker = `[workflow-dispatch:${id}:${hash(prompt)}]`;
|
|
67
|
-
|
|
67
|
+
// Only the registry's explicit review/audit roles receive a read-only boundary.
|
|
68
|
+
// A model phase or packet prose cannot turn a product Worker into a reviewer.
|
|
69
|
+
const reviewRole = ['step-review', 'final-review', 'corrective-audit', 'plan-audit'].includes(entry.type);
|
|
70
|
+
const boundary = reviewRole
|
|
71
|
+
? 'Review boundary: use the exact canonical repository and immutable commit, packet/seal or audit-request bindings supplied for this independent review. Verify those bindings before reading evidence and before returning the result; stop if they change. The App checkout may be detached or on another branch: do not switch it or require Task-branch dispatch-context-check for read-only inspection. Do not modify product files, Git history, or Workflow state, and do not invoke lifecycle mutations. Save the review result only to an explicitly requested artifact path outside all repository checkouts, under actual filesystem permissions; this instruction grants no filesystem access. A repository path identifies read evidence, never write authority.'
|
|
72
|
+
: 'Execution boundary: use the actual child checkout returned by App readback. Before any product or repository write, reconcile it with the exact Task branch and run dispatch-context-check. A repository path in this packet is identity context, not authorization to write outside that checkout.';
|
|
73
|
+
const dispatchedPrompt = `${marker}\n${prompt}\n${boundary}`;
|
|
68
74
|
entry.dispatch = {
|
|
69
75
|
version: 1, id, state: 'creating', appProjectId, hostId, repositoryRoot, gitDir, executionMode,
|
|
70
76
|
promptPath, promptHash: hash(prompt), dispatchedPromptHash: hash(dispatchedPrompt), marker,
|
|
@@ -1,15 +1,17 @@
|
|
|
1
1
|
// Relative cost/latency policy, not a price list or an availability oracle.
|
|
2
|
-
export const MODEL_POLICY_VERSION = 'chat-model-policy-
|
|
2
|
+
export const MODEL_POLICY_VERSION = 'chat-model-policy-v2';
|
|
3
3
|
const PROFILES = {
|
|
4
4
|
mechanical: [['gpt-5.4-mini', 'low'], ['gpt-5.6-luna', 'low']],
|
|
5
|
-
scoped: [['gpt-5.6-luna', '
|
|
6
|
-
implementation: [['gpt-5.6-terra', '
|
|
7
|
-
planning: [['gpt-5.6-
|
|
8
|
-
review: [['gpt-5.6-
|
|
9
|
-
'scoped-review': [['gpt-5.6-
|
|
10
|
-
complex: [['gpt-6-
|
|
5
|
+
scoped: [['gpt-5.6-luna', 'low'], ['gpt-5.4-mini', 'medium']],
|
|
6
|
+
implementation: [['gpt-5.6-terra', 'low'], ['gpt-5.6-luna', 'medium']],
|
|
7
|
+
planning: [['gpt-5.6-terra', 'low'], ['gpt-5.6-luna', 'medium']],
|
|
8
|
+
review: [['gpt-5.6-terra', 'low'], ['gpt-5.6-luna', 'medium']],
|
|
9
|
+
'scoped-review': [['gpt-5.6-luna', 'low'], ['gpt-5.4-mini', 'medium']],
|
|
10
|
+
complex: [['gpt-5.6-terra', 'medium'], ['gpt-5.6-luna', 'medium']],
|
|
11
11
|
};
|
|
12
|
-
const TYPES = [
|
|
12
|
+
const TYPES = [
|
|
13
|
+
'coordinator', 'task', 'step-review', 'final-review', 'corrective-audit', 'plan-audit', 'workflow-blocker',
|
|
14
|
+
];
|
|
13
15
|
export function selectChatModel(type, request) {
|
|
14
16
|
if (!TYPES.includes(type)) throw new Error('Unknown chat type.');
|
|
15
17
|
if (!request || !['routine', 'standard', 'complex'].includes(request.complexity)
|
|
@@ -14,7 +14,9 @@ import process from 'node:process';
|
|
|
14
14
|
import { randomUUID } from 'node:crypto';
|
|
15
15
|
import { dispatchAction, dispatchInput } from './chat-dispatch.mjs';
|
|
16
16
|
|
|
17
|
-
const TYPES = new Set([
|
|
17
|
+
const TYPES = new Set([
|
|
18
|
+
'coordinator', 'task', 'step-review', 'final-review', 'corrective-audit', 'plan-audit', 'workflow-blocker',
|
|
19
|
+
]);
|
|
18
20
|
const LOCK_STALE_MS = 30_000;
|
|
19
21
|
const LOCK_WAIT_MS = 2_000;
|
|
20
22
|
|
|
@@ -26,9 +28,12 @@ export function allocateChat(options) {
|
|
|
26
28
|
const sequence = registry.nextSequence;
|
|
27
29
|
const reservationId = randomUUID();
|
|
28
30
|
const candidates = buildTitleCandidates({ ...options, sequence });
|
|
31
|
+
const milestoneOrdinal = options.type === 'workflow-blocker'
|
|
32
|
+
? null
|
|
33
|
+
: requiredOrdinal(options.milestoneOrdinal, 'M');
|
|
29
34
|
const existing = registry.entries.find(entry => entry.status !== 'abandoned'
|
|
30
35
|
&& entry.type === options.type && entry.entityId === options.entityId
|
|
31
|
-
&& entry.milestoneOrdinal ===
|
|
36
|
+
&& entry.milestoneOrdinal === milestoneOrdinal
|
|
32
37
|
&& entry.taskOrdinal === optionalOrdinal(options.taskOrdinal, 'T')
|
|
33
38
|
&& entry.stepOrdinal === optionalOrdinal(options.stepOrdinal, 'S')
|
|
34
39
|
&& (['task', 'coordinator'].includes(options.type)
|
|
@@ -38,7 +43,7 @@ export function allocateChat(options) {
|
|
|
38
43
|
sequence,
|
|
39
44
|
reservationId,
|
|
40
45
|
type: options.type,
|
|
41
|
-
milestoneOrdinal
|
|
46
|
+
milestoneOrdinal,
|
|
42
47
|
taskOrdinal: optionalOrdinal(options.taskOrdinal, 'T'),
|
|
43
48
|
stepOrdinal: optionalOrdinal(options.stepOrdinal, 'S'),
|
|
44
49
|
entityId: requiredText(options.entityId, 'entityId'),
|
|
@@ -191,6 +196,15 @@ export function showRegistry(options) {
|
|
|
191
196
|
}
|
|
192
197
|
|
|
193
198
|
export function buildTitleCandidates(options) {
|
|
199
|
+
if (options.type === 'workflow-blocker') {
|
|
200
|
+
const entityId = requiredText(options.entityId, 'entityId');
|
|
201
|
+
const semantic = compactWhitespace(requiredText(options.semanticTitle, 'semanticTitle'));
|
|
202
|
+
validateTypeBindings(options.type, null, null, entityId);
|
|
203
|
+
if (!/^\d+\.\d+\.\d+-beta(?:\.\d+)+$/u.test(semantic)) {
|
|
204
|
+
throw new Error('workflow-blocker title must be the exact target beta patch version.');
|
|
205
|
+
}
|
|
206
|
+
return [semantic];
|
|
207
|
+
}
|
|
194
208
|
const prefix = `#${String(positiveInteger(options.sequence, 'sequence')).padStart(3, '0')}`;
|
|
195
209
|
const milestone = requiredOrdinal(options.milestoneOrdinal, 'M');
|
|
196
210
|
const task = optionalOrdinal(options.taskOrdinal, 'T');
|
|
@@ -331,11 +345,15 @@ function validateProjectId(projectId) {
|
|
|
331
345
|
|
|
332
346
|
function validateTypeBindings(type, taskOrdinal, stepOrdinal, entityId) {
|
|
333
347
|
if (!TYPES.has(type)) throw new Error(`Unsupported chat type: ${type}`);
|
|
334
|
-
if (
|
|
348
|
+
if (!['coordinator', 'workflow-blocker'].includes(type) && !taskOrdinal) {
|
|
349
|
+
throw new Error(`${type} requires a Task membership ordinal.`);
|
|
350
|
+
}
|
|
335
351
|
if ((type === 'step-review' || type === 'corrective-audit') && !stepOrdinal) {
|
|
336
352
|
throw new Error(`${type} requires a Step membership ordinal.`);
|
|
337
353
|
}
|
|
338
|
-
const validEntity = type === '
|
|
354
|
+
const validEntity = type === 'workflow-blocker'
|
|
355
|
+
? /^[a-f0-9]{64}$/u.test(entityId)
|
|
356
|
+
: type === 'coordinator'
|
|
339
357
|
? entityId === 'DISCOVERY' || /^MS-[0-9A-HJKMNP-TV-Z]{26}$/.test(entityId)
|
|
340
358
|
: /^TASK-[0-9A-HJKMNP-TV-Z]{26}$/.test(entityId);
|
|
341
359
|
if (!validEntity) throw new Error(`${type} requires its full authoritative entity ID.`);
|