codex-workflow-v2 2.0.0-beta.13.14 → 2.0.0-beta.13.16
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 +17 -0
- package/dist/reviewer-runtime-build.json +20 -8
- package/dist/src/alpha6/captured-check-evidence.d.ts +49 -0
- package/dist/src/alpha6/captured-check-evidence.js +146 -0
- package/dist/src/alpha6/captured-check-evidence.js.map +1 -0
- 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/root-cause-replan-carryover.d.ts +3 -1
- package/dist/src/alpha6/root-cause-replan-carryover.js +4 -0
- package/dist/src/alpha6/root-cause-replan-carryover.js.map +1 -1
- package/dist/src/contracts.d.ts +5 -1
- package/dist/src/dependency-provenance.js +10 -0
- package/dist/src/dependency-provenance.js.map +1 -1
- package/dist/src/graph.js +25 -3
- package/dist/src/graph.js.map +1 -1
- package/dist/src/version.d.ts +1 -1
- package/dist/src/version.js +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 +1 -0
- package/dist/src/workflow.js +139 -19
- package/dist/src/workflow.js.map +1 -1
- 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/sources/codex-workflow-v2-architecture-ru.md +1 -1
- package/docs/pdf/sources/codex-workflow-v2-chat-only-guide-ru.md +2 -2
- package/docs/pdf/sources/codex-workflow-v2-technical-reference-ru.md +2 -2
- package/docs/release.md +49 -0
- package/package.json +2 -1
- package/plugins/codex-workflow-gateway/.codex-plugin/plugin.json +1 -1
- package/plugins/codex-workflow-gateway/references/chat-dispatch.md +40 -11
- package/plugins/codex-workflow-gateway/references/codebase-memory-routing.md +55 -0
- 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 +78 -12
- package/src/alpha6/adoption.ts +1105 -0
- package/src/alpha6/captured-check-evidence.ts +126 -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 +732 -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 +2182 -0
- package/src/alpha6/npm-check-contract.ts +47 -0
- package/src/alpha6/plan-integrity-update.ts +20 -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 +2965 -0
- package/src/alpha6/review.ts +1198 -0
- package/src/alpha6/root-cause-replan-carryover.ts +471 -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 +351 -0
- package/src/change-explanation.ts +153 -0
- package/src/cli-actions.ts +119 -0
- package/src/cli.ts +1583 -0
- package/src/contracts.ts +1510 -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 +538 -0
- package/src/diagnostics.ts +93 -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/validation.ts +177 -0
- package/src/errors.ts +23 -0
- package/src/fs-utils.ts +61 -0
- package/src/gateway-handshake.ts +103 -0
- package/src/git.ts +158 -0
- package/src/graph.ts +342 -0
- package/src/historical-step-provenance.ts +136 -0
- package/src/index.ts +21 -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/observation.ts +198 -0
- package/src/observed-routes.ts +661 -0
- package/src/operational-contract.ts +125 -0
- package/src/pending-review-update.ts +191 -0
- package/src/repository.ts +99 -0
- package/src/reviewer.ts +1876 -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 +947 -0
- package/src/state/corrective-yield-executor.ts +327 -0
- package/src/state/corrective-yield-transaction.ts +728 -0
- package/src/state/lock.ts +880 -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 +11436 -0
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -463,7 +463,7 @@ Restart Docker Desktop требует отдельного разрешения
|
|
|
463
463
|
# 10. Operational checklist
|
|
464
464
|
|
|
465
465
|
- exact package version установлен, bundled gateway соответствует release и переустановлен;
|
|
466
|
-
- handshake подтверждает `packageVersion=2.0.0-beta.13.
|
|
466
|
+
- handshake подтверждает `packageVersion=2.0.0-beta.13.16`, protocol 2, state schema 2 и beta.13
|
|
467
467
|
capabilities;
|
|
468
468
|
- routine observation начинается с компактного `status`; `status --full` запрашивается только для
|
|
469
469
|
расследования, которому действительно нужна полная historical projection;
|
|
@@ -57,7 +57,7 @@ AGENTS.md
|
|
|
57
57
|
-> doctor только как дополнительная диагностика
|
|
58
58
|
```
|
|
59
59
|
|
|
60
|
-
Handshake beta.13.
|
|
60
|
+
Handshake beta.13.15 должен сообщать `packageVersion=2.0.0-beta.13.16`, `protocolVersion=2`,
|
|
61
61
|
`stateSchemaVersion=2`, dependency DAG, initial Plan transaction, mechanical feasibility,
|
|
62
62
|
Milestone autonomy, host-safe credential reference, failed-Step continuation transaction,
|
|
63
63
|
cause-bound rolling refinement, structural production edge, compact status, reviewer runtime preflight,
|
|
@@ -480,7 +480,7 @@ Task/project DGR. `dependencyBinding` для standalone handoff равен null.
|
|
|
480
480
|
# 14. Итоговый checklist пользователя
|
|
481
481
|
|
|
482
482
|
- beta.13.10 exact package и новый bundled gateway установлены; handshake показывает
|
|
483
|
-
`packageVersion=2.0.0-beta.13.
|
|
483
|
+
`packageVersion=2.0.0-beta.13.16`, protocol/state schema `2/2` и beta.13 capabilities;
|
|
484
484
|
- новый Coordinator chat не является fork старого Milestone;
|
|
485
485
|
- bootstrap DGR, если нужен, выдан отдельным exact human confirmation;
|
|
486
486
|
- Discovery не materialized при blocking unknowns;
|
|
@@ -15,7 +15,7 @@ authority сами: mutating permission определяется runtime state
|
|
|
15
15
|
|
|
16
16
|
| Параметр beta.13 | Значение |
|
|
17
17
|
|---|---|
|
|
18
|
-
| npm package | `codex-workflow-v2@2.0.0-beta.13.
|
|
18
|
+
| npm package | `codex-workflow-v2@2.0.0-beta.13.16` |
|
|
19
19
|
| protocolVersion | 2 |
|
|
20
20
|
| stateSchemaVersion | 2 |
|
|
21
21
|
| lifecycle epoch | 2 |
|
|
@@ -775,7 +775,7 @@ dirty update.
|
|
|
775
775
|
observed-route matrix/compact-status/reviewer-runtime tests, legacy compatibility regressions,
|
|
776
776
|
`npm run test:signal-t10-check-support-e2e`, `npm run test:signal-remediation-e2e`,
|
|
777
777
|
`npm run pack:check`, `npm run smoke:downstream`, `npm run plugin:check`, official plugin/skill validators,
|
|
778
|
-
`npm run docs:pdf:check` и `npm run release:check` с exact `v2.0.0-beta.13.
|
|
778
|
+
`npm run docs:pdf:check` и `npm run release:check` с exact `v2.0.0-beta.13.16` tag binding и append-only
|
|
779
779
|
real-agent lifecycle log. Candidate проверяется из clean source checkout; missing built module не должен
|
|
780
780
|
превращаться в stack trace, а обязан быть детерминированно собран или диагностирован release gate.
|
|
781
781
|
|
package/docs/release.md
CHANGED
|
@@ -1,5 +1,54 @@
|
|
|
1
1
|
# Release Policy
|
|
2
2
|
|
|
3
|
+
## beta.13.15: retained failed checks and consistent corrective navigation
|
|
4
|
+
|
|
5
|
+
Root-cause dirty carryover now requires one exact terminal corrective-yield witness and assesses
|
|
6
|
+
only that terminal failed-check head. Older failed attempts can no longer turn a later review or
|
|
7
|
+
corrective continuation into an unwitnessed `doctor` route. The regression includes the stopped
|
|
8
|
+
Signal topology: multiple historical failures, no terminal corrective-yield witness, and ordinary
|
|
9
|
+
writer recovery remaining visible.
|
|
10
|
+
|
|
11
|
+
Core now emits a declarative `workflowBlockerRoute` only for a confirmed navigation dead end. The
|
|
12
|
+
descriptor grants no effects. The originating Coordinator confirms the dead end and uses the
|
|
13
|
+
packaged gateway to idempotently dispatch an exact-version patch chat in `codex-workflow-v2`.
|
|
14
|
+
That patch chat owns diagnosis, implementation, verification, and publication; the Coordinator
|
|
15
|
+
owns callback handling, the downstream update, and resuming the stopped product chat. Chat policy
|
|
16
|
+
v2 selects only Mini, Luna, or Terra with low/medium effort; Sol, Astra, and high effort are
|
|
17
|
+
excluded from automatic creation.
|
|
18
|
+
|
|
19
|
+
The gateway now distinguishes approved Knowledge Map sources from codebase-memory indexes. Agents
|
|
20
|
+
must route code discovery through the MCP project whose normalized root exactly matches the fresh
|
|
21
|
+
Core graph request. The intent table separates product source, the exact installed workflow package,
|
|
22
|
+
and a workflow-development checkout; stale/missing indexes are refreshed and direct code search
|
|
23
|
+
requires a recorded MCP fallback. Workflow source support uses full indexing so plugin scripts and
|
|
24
|
+
tests are not silently excluded.
|
|
25
|
+
|
|
26
|
+
Captured check results are persisted in the existing failed-Step transaction with
|
|
27
|
+
separate capture/check hashes and exact readback. Rollback covers the new artifact;
|
|
28
|
+
legacy failures remain explicitly uncaptured. Private output can contain process
|
|
29
|
+
secrets. The opt-in excerpt is best-effort redacted and never used as authority or
|
|
30
|
+
published automatically in status. This release does not alter v1 cause semantics.
|
|
31
|
+
|
|
32
|
+
Optional independent corrective decisions accept a clean checkout or an exact current
|
|
33
|
+
failed-checkpoint file set and byte hash, bound to the verified remediation event,
|
|
34
|
+
Task HEAD/history and effective allowed/forbidden scope. Navigation and executor share
|
|
35
|
+
that boundary. C1 actor/credential, transaction, independent review and human corrective
|
|
36
|
+
Plan gates remain mandatory. This is not scope-amendment authority or a generic dirty
|
|
37
|
+
update transport. Required regressions cover distinct mechanical failures, dirty C1
|
|
38
|
+
wrong/missing credentials, changed bytes, outside paths and altered immutable history.
|
|
39
|
+
|
|
40
|
+
Previously unreleased dispatch changes distinguish sealed review roles from product
|
|
41
|
+
writers without granting repository writes. Explicit zero-write reviews must avoid
|
|
42
|
+
runtime-preflight APIs that create temporary caches. The shared carryover phase
|
|
43
|
+
predicate retains planned-Step safety checks and avoids masking failed successors;
|
|
44
|
+
both successful and failed replacement successor regressions remain required.
|
|
45
|
+
|
|
46
|
+
The existing source13.6 consumed-carryover profile remains source-pinned; its exact
|
|
47
|
+
current target and transcript validator additionally recognize beta13.15. No historical
|
|
48
|
+
receipt or source-version predicate is rewritten. Full candidate CI, ordinary release
|
|
49
|
+
checks and the documented real App boundary remain required before publication.
|
|
50
|
+
|
|
51
|
+
|
|
3
52
|
## beta.13.14: keep carryover navigation in its execution phase
|
|
4
53
|
|
|
5
54
|
A retained root-cause carryover belongs to the start of a planned replacement
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "codex-workflow-v2",
|
|
3
|
-
"version": "2.0.0-beta.13.
|
|
3
|
+
"version": "2.0.0-beta.13.16",
|
|
4
4
|
"description": "Requirements-first Codex development workflow with local state and explicit Git ownership.",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -28,6 +28,7 @@
|
|
|
28
28
|
},
|
|
29
29
|
"files": [
|
|
30
30
|
"dist",
|
|
31
|
+
"src",
|
|
31
32
|
"schemas",
|
|
32
33
|
"templates",
|
|
33
34
|
"roles",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "codex-workflow-gateway",
|
|
3
|
-
"version": "0.1.0+codex.
|
|
3
|
+
"version": "0.1.0+codex.20260909130631",
|
|
4
4
|
"description": "Thin personal Codex gateway for exact project-local Codex Workflow V2 packages and codebase-memory-mcp.",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "Codex Workflow Maintainers"
|
|
@@ -31,7 +31,8 @@ those using real App/source evidence before using the new dispatch flow.
|
|
|
31
31
|
"highRisk": false,
|
|
32
32
|
"rationale": "New multi-file implementation plan with established requirements.",
|
|
33
33
|
"availableModels": [
|
|
34
|
-
{"id": "gpt-5.6-
|
|
34
|
+
{"id": "gpt-5.6-terra", "reasoningEfforts": ["low", "medium", "high", "xhigh", "max", "ultra"]},
|
|
35
|
+
{"id": "gpt-5.6-luna", "reasoningEfforts": ["low", "medium", "high", "xhigh", "max"]}
|
|
35
36
|
]
|
|
36
37
|
}
|
|
37
38
|
}
|
|
@@ -98,12 +99,12 @@ cost/latency preference, not measured savings or guaranteed account availability
|
|
|
98
99
|
| Work | Preferred model | App thinking | Compatible fallback |
|
|
99
100
|
| --- | --- | --- | --- |
|
|
100
101
|
| Routine mechanical transitions, formatting, retrieval | gpt-5.4-mini | low | gpt-5.6-luna / low |
|
|
101
|
-
| Coordinator supervision; small implementation | gpt-5.6-luna |
|
|
102
|
-
| Standard implementation | gpt-5.6-terra |
|
|
103
|
-
| Task planning | gpt-5.6-
|
|
104
|
-
| Routine Step review | gpt-5.6-
|
|
105
|
-
| Standard Step review, final review, plan/corrective audit | gpt-5.6-
|
|
106
|
-
| Complex work or high risk, any role | gpt-6-
|
|
102
|
+
| Coordinator supervision; small implementation | gpt-5.6-luna | low | gpt-5.4-mini / medium |
|
|
103
|
+
| Standard implementation | gpt-5.6-terra | low | gpt-5.6-luna / medium |
|
|
104
|
+
| Task planning | gpt-5.6-terra | low | gpt-5.6-luna / medium |
|
|
105
|
+
| Routine Step review | gpt-5.6-luna | low | gpt-5.4-mini / medium |
|
|
106
|
+
| Standard Step review, final review, plan/corrective audit | gpt-5.6-terra | low | gpt-5.6-luna / medium |
|
|
107
|
+
| Complex work or high risk, any role | gpt-5.6-terra | medium | gpt-5.6-luna / medium |
|
|
107
108
|
|
|
108
109
|
`routine` means a small, well-specified change or mechanical action with an existing check;
|
|
109
110
|
`standard` is ordinary multi-file work; `complex` covers new architecture, unresolved concurrency,
|
|
@@ -111,7 +112,9 @@ recovery/provenance or distributed state. Mark `highRisk` for authorization, sec
|
|
|
111
112
|
paths, data-loss exposure or irreversible migrations. The coordinator records the concrete
|
|
112
113
|
rationale; classification is a human/agent judgment, not an automatic risk detector. Unknown
|
|
113
114
|
complexity is not routine. Review/audit role floors override a falsely mechanical phase. No
|
|
114
|
-
automatic xhigh/max/ultra, and no escalation merely because a review failed or a tool timed out.
|
|
115
|
+
automatic high/xhigh/max/ultra, and no escalation merely because a review failed or a tool timed out.
|
|
116
|
+
The policy never selects `gpt-5.6-sol` or `gpt-6-astra`. A caller cannot bypass that ceiling by
|
|
117
|
+
including either model or `high` effort in the destination catalog.
|
|
115
118
|
|
|
116
119
|
The policy chooses only a listed supported pair. If neither preferred nor fallback pair is
|
|
117
120
|
available, stop selection rather than silently inheriting the coordinator or lowering the review
|
|
@@ -121,8 +124,9 @@ https://developers.openai.com/api/docs/guides/latest-model
|
|
|
121
124
|
|
|
122
125
|
For a phase change in an existing bound chat, call `model-select` with its same `threadId` and
|
|
123
126
|
fresh `modelRequest`; copy the returned `followUpArgs` into `send_message_to_thread` with the
|
|
124
|
-
closed follow-up prompt. For example, planning uses
|
|
125
|
-
then mechanical lifecycle work Mini/low. Do not create another Task just to
|
|
127
|
+
closed follow-up prompt. For example, planning uses Terra/low, a complex implementation uses
|
|
128
|
+
Terra/medium, then mechanical lifecycle work uses Mini/low. Do not create another Task just to
|
|
129
|
+
switch model.
|
|
126
130
|
Keep the previous selection unless the phase/risk/scope changes materially. The journal records
|
|
127
131
|
requested settings; tool acceptance/runtime readback, when available, is required to claim the
|
|
128
132
|
actual model used. A model change never changes role, scope, credentials or approval authority.
|
|
@@ -134,12 +138,37 @@ Choose local only for an explicit user request to execute in the saved checkout.
|
|
|
134
138
|
child checkout, not an absolute path copied from the parent's prompt, is the write destination.
|
|
135
139
|
`dispatch-observe` records it and refuses silent movement of a bound child.
|
|
136
140
|
|
|
137
|
-
|
|
141
|
+
For `task` and `coordinator` product/repository writes, before the first write and after any
|
|
142
|
+
branch/cwd change, use read-only `dispatch-context-check`
|
|
138
143
|
with a fresh App observation, `writeRoot`, and `expectedBranch` from the current Core Task.
|
|
139
144
|
Require `matched=true`, then refresh Core next and writer authority. Mismatch means reconcile the
|
|
140
145
|
same Worker context; it never permits another create, an indirect write or an automatic handoff.
|
|
141
146
|
A matched context does not authorize external operations. See packaged `docs/change-model.md`.
|
|
142
147
|
|
|
148
|
+
The explicit `step-review`, `final-review`, `corrective-audit`, and `plan-audit` roles instead
|
|
149
|
+
receive a read-only review boundary. They verify the canonical repository and immutable commit,
|
|
150
|
+
packet/seal or audit-request bindings, including before returning their result. A detached or
|
|
151
|
+
differently branched App checkout does not require Task-branch reconciliation for reading that
|
|
152
|
+
evidence. Reviewers must not modify product files, Git history, Workflow state, or invoke lifecycle
|
|
153
|
+
mutations. A requested result artifact may be saved only outside all repository checkouts and under
|
|
154
|
+
actual filesystem permissions. The prompt does not grant access. Model phase and prompt prose do
|
|
155
|
+
not confer this role; unknown registry types remain rejected. Existing writer context checks and
|
|
156
|
+
Core authority guards are unchanged.
|
|
157
|
+
|
|
158
|
+
“Read-only” Workflow diagnostics mean no product or Core transitions, not necessarily zero
|
|
159
|
+
filesystem writes. For example, `next` can invoke `prepareReviewerRuntimePreflight`, which creates
|
|
160
|
+
an external runtime-cache directory and writes/removes `.write-probe`. In a normal review, inspect
|
|
161
|
+
actual permissions before invoking diagnostics that use this cache; cache access grants no product
|
|
162
|
+
write authority.
|
|
163
|
+
|
|
164
|
+
An explicit user instruction prohibiting all writes takes precedence. For that review, reuse
|
|
165
|
+
current, unchanged bound receipts and the prior successful handshake from the same session;
|
|
166
|
+
inspect immutable files directly and avoid runtime-preflight APIs or other diagnostics with write
|
|
167
|
+
side effects. Do not rerun `next` solely to obtain a fresh receipt under a zero-write instruction.
|
|
168
|
+
If the available bindings cannot establish the required current evidence without writing, report
|
|
169
|
+
the precise unverified boundary instead of claiming a write-free verification. Saving a report is
|
|
170
|
+
also a write and requires explicit permission when all writes are prohibited.
|
|
171
|
+
|
|
143
172
|
### Existing legacy bindings
|
|
144
173
|
|
|
145
174
|
`dispatch-context-check` also accepts an already bound legacy entry with no dispatch marker.
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
# Codebase-memory routing
|
|
2
|
+
|
|
3
|
+
Knowledge Map and `codebase-memory-mcp` answer different questions. Knowledge Map records approved
|
|
4
|
+
project knowledge sources and authority. The MCP graph indexes code structure for discovery,
|
|
5
|
+
call/dependency tracing, and impact analysis. An approved Knowledge Map entry does not prove that
|
|
6
|
+
an MCP project exists or is current.
|
|
7
|
+
|
|
8
|
+
## Select by exact source root
|
|
9
|
+
|
|
10
|
+
Obtain a fresh Core `graph status` request before choosing an MCP project. Match the request's
|
|
11
|
+
absolute `sourceRoot` against `list_projects[].root_path` after path normalization. Names, basename
|
|
12
|
+
similarity, an older repository generation, and a Knowledge Map path are not valid matches. Zero
|
|
13
|
+
matches requires `index_repository` for that exact source root. More than one exact match is an
|
|
14
|
+
integrity blocker until the duplicate is resolved. Call `index_status` on the selected project and
|
|
15
|
+
refresh it when Core reports the binding missing/stale or its indexed HEAD/package manifest differs.
|
|
16
|
+
|
|
17
|
+
This gateway governs workflow work only. It must not create, refresh, bind, or require the active
|
|
18
|
+
product repository's graph. Product-code discovery remains under that repository's existing policy.
|
|
19
|
+
|
|
20
|
+
Use this intent table:
|
|
21
|
+
|
|
22
|
+
| Work being investigated | Active repository | Core graph kind | Expected source root |
|
|
23
|
+
| --- | --- | --- | --- |
|
|
24
|
+
| Installed workflow behavior blocking a product | product repository | `workflow` | exact installed `node_modules/codex-workflow-v2` package root returned by Core |
|
|
25
|
+
| Workflow source implementation or release | `codex-workflow-v2` checkout/worktree | source checkout graph | that exact workflow source Git root |
|
|
26
|
+
|
|
27
|
+
Never select Signal's product graph to explain package internals. When the requested work concerns
|
|
28
|
+
product code, leave workflow graph routing and follow the product repository's own instructions.
|
|
29
|
+
|
|
30
|
+
For workflow implementation/support, request `full` indexing so published TypeScript sources,
|
|
31
|
+
plugin scripts, roles, references, and schemas are present. The npm package ships `src` specifically
|
|
32
|
+
for this stable graph. Index an installed package only when its exact package root and version have
|
|
33
|
+
no ready MCP project. Reuse that ready project for every later chat on the same immutable package
|
|
34
|
+
version; do not refresh it per chat or per gateway read. A workflow source checkout is refreshed
|
|
35
|
+
only when its Git HEAD changes. Bind installed-package evidence through Core before relying on it as
|
|
36
|
+
current workflow evidence. Do not create or use a second workflow-cache source copy.
|
|
37
|
+
|
|
38
|
+
## Discovery policy
|
|
39
|
+
|
|
40
|
+
Use `get_architecture`, `search_graph`, `trace_path`, `query_graph`, and `get_code_snippet` for code
|
|
41
|
+
discovery. Search the graph first and fetch only the selected symbols. Do not repeatedly scan or
|
|
42
|
+
read whole source trees after an exact ready graph is available.
|
|
43
|
+
|
|
44
|
+
Direct filesystem search is a recorded fallback, allowed only when:
|
|
45
|
+
|
|
46
|
+
- MCP is unavailable after its normal retry boundary;
|
|
47
|
+
- the exact source root cannot be indexed;
|
|
48
|
+
- Core reports a stale/mismatched graph and refresh cannot complete; or
|
|
49
|
+
- the target is a newly created, generated, ignored, or exact non-code artifact absent from the
|
|
50
|
+
graph.
|
|
51
|
+
|
|
52
|
+
Record the failed MCP operation, selected source root, and fallback reason. A convenience preference
|
|
53
|
+
or an overly broad graph result is not a fallback reason: narrow the graph query first. Git status,
|
|
54
|
+
exact package resolution, and reading a specifically named authority artifact remain filesystem
|
|
55
|
+
operations rather than code discovery.
|
|
@@ -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.`);
|
|
@@ -15,6 +15,13 @@ repository.
|
|
|
15
15
|
Never use a global workflow package, a mutable npm range, `latest`, V1 overlay
|
|
16
16
|
files, or MCP ADR storage as a fallback.
|
|
17
17
|
|
|
18
|
+
Read this skill once per chat/package revision; do not reopen it merely to recover details already
|
|
19
|
+
captured in the current task context. For code discovery, first read
|
|
20
|
+
`../../references/codebase-memory-routing.md` and follow its exact-source-root gate. Knowledge Map
|
|
21
|
+
approval is not an MCP index. Use `codebase-memory-mcp` before filesystem code search, select the
|
|
22
|
+
graph from fresh Core `graph status`, by exact `sourceRoot`, and record the documented fallback
|
|
23
|
+
reason whenever direct code search is unavoidable.
|
|
24
|
+
|
|
18
25
|
## Resolve The Active Package
|
|
19
26
|
|
|
20
27
|
1. Resolve the active Git root with `git rev-parse --show-toplevel`.
|
|
@@ -496,8 +503,8 @@ Task details, other Task Plans, unrelated repository analysis, reasoning traces,
|
|
|
496
503
|
credentials. The new Task chat may read repository files and its own Workflow Task/Brief/Plan; it
|
|
497
504
|
must not rely on the parent conversation as evidence or authority.
|
|
498
505
|
|
|
499
|
-
Every automatically created Coordinator, Task, Step Review, Final Review, Corrective Audit,
|
|
500
|
-
|
|
506
|
+
Every automatically created Coordinator, Task, Step Review, Final Review, Corrective Audit, Plan
|
|
507
|
+
Audit, and Workflow Blocker chat must use the project registry/title builder at
|
|
501
508
|
`../../scripts/chat-registry.mjs`. Before `create_thread`, call `allocate` with exact `projectId`,
|
|
502
509
|
chat type, Milestone/Task/Step membership ordinals, semantic title, authoritative entity ID, and
|
|
503
510
|
review attempt. Use returned `requestedTitle` verbatim. Never derive its prefix from
|
|
@@ -529,6 +536,7 @@ The builder owns these compact title families; callers must not hand-compose var
|
|
|
529
536
|
#NNN · M<NN>/T<NN> · Final Review A<N> · <Task title> · <TASK-ID>
|
|
530
537
|
#NNN · M<NN>/T<NN>/S<NN> · Corrective A<N> · <Step title> · <TASK-ID>
|
|
531
538
|
#NNN · M<NN>/T<NN> · Plan Audit A<N> · <Task title> · <TASK-ID>
|
|
539
|
+
<exact next beta patch version> # Workflow Blocker
|
|
532
540
|
```
|
|
533
541
|
|
|
534
542
|
When the Milestone ID is known, allocate and bind the coordinator chat before dispatch. During
|
|
@@ -618,20 +626,62 @@ transcripts. No chat may wait indefinitely for a child after ending its own turn
|
|
|
618
626
|
cross-restart background orchestration requires a separate app wakeup/automation facility and is
|
|
619
627
|
not implied by this skill.
|
|
620
628
|
|
|
629
|
+
|
|
630
|
+
## Workflow Blocker Incident Route
|
|
631
|
+
|
|
632
|
+
Core only describes this route. It does not create a chat, authorize repository changes, run a
|
|
633
|
+
release, publish a package, update a downstream project, or message another chat. The originating
|
|
634
|
+
Coordinator owns incident initiation and verifies that the new chat received its closed instructions.
|
|
635
|
+
The patch chat in `codex-workflow-v2` owns diagnosis, implementation, verification, publication,
|
|
636
|
+
and the callback to the Coordinator.
|
|
637
|
+
|
|
638
|
+
Treat `next.workflowBlockerRoute.state=gateway-confirmation-required` as a candidate incident, not
|
|
639
|
+
as an executable Core transition. Refresh `status` and `next` sequentially without mutation and
|
|
640
|
+
continue this route only when the same `blockerId` remains, no executable Core action, repair
|
|
641
|
+
transition, or Human gate exists, and the responsible product chat is not progressing the blocked
|
|
642
|
+
action. If an ordinary route appears, use it and do not create a patch chat.
|
|
643
|
+
|
|
644
|
+
For a confirmed incident, the Coordinator must:
|
|
645
|
+
|
|
646
|
+
1. Resolve the exact `codex-workflow-v2` App project with `list_projects`; never hardcode an App
|
|
647
|
+
project ID or create the patch chat in the product project.
|
|
648
|
+
2. Build the closed incident packet from the descriptor's `requiredPacketFields`, fresh status and
|
|
649
|
+
next hashes, bounded repository state, and the expected product continuation. Exclude bearer
|
|
650
|
+
credentials, confirmation codes, transcripts, and reasoning traces.
|
|
651
|
+
3. Allocate `type=workflow-blocker` with `entityId=<blockerId>` and
|
|
652
|
+
`semanticTitle=<dispatch.title>`. This type has no Milestone/Task membership and its sole title
|
|
653
|
+
candidate is the exact beta version. Run the normal `dispatch-begin -> create_thread ->
|
|
654
|
+
dispatch-result -> dispatch-observe -> readback -> bind` sequence. Use the policy-selected
|
|
655
|
+
explicit model and effort; never inherit the Coordinator settings.
|
|
656
|
+
4. Confirm once with `read_thread` that the created patch chat received the exact closed incident
|
|
657
|
+
packet and has started it. Do not poll, wait on, or supervise this chat. The patch chat must run
|
|
658
|
+
every remaining step autonomously and use `send_message_to_thread` to deliver the closed callback
|
|
659
|
+
to the originating Coordinator after the exact patch is published.
|
|
660
|
+
5. When that callback arrives, verify the published artifact, follow the advertised downstream update route in the product
|
|
661
|
+
repository, rerun fresh `status -> next`, and continue the existing responsible product chat
|
|
662
|
+
with only that route and changed bindings. Do not replace the Coord or product chat solely
|
|
663
|
+
because a workflow incident occurred.
|
|
664
|
+
|
|
665
|
+
The incident descriptor grants no Core mutation or publication authority. A callback claim does
|
|
666
|
+
not replace package readback or fresh product navigation.
|
|
667
|
+
|
|
621
668
|
## Product Or Workflow Graph Refresh
|
|
622
669
|
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
670
|
+
Follow `../../references/codebase-memory-routing.md`. In particular, select only the MCP project
|
|
671
|
+
whose normalized root exactly equals the fresh Core request's `sourceRoot`; never choose by name,
|
|
672
|
+
repository generation, or Knowledge Map membership.
|
|
673
|
+
|
|
674
|
+
1. Run `graph refresh-request --kind product|workflow --mode moderate|full` for the intended code.
|
|
675
|
+
2. Use `codebase-memory-mcp` to list projects and exact-match the request source root.
|
|
676
|
+
3. Check `index_status`; call `index_repository` with the request source root,
|
|
677
|
+
requested mode, and `persistence: false` when missing or stale.
|
|
678
|
+
4. Build evidence exactly as specified in `../../references/protocol.md`.
|
|
679
|
+
5. Pipe `{ "request": ..., "evidence": ... }` to `graph bind --stdin`, passing
|
|
630
680
|
the current binding revision when one exists.
|
|
631
681
|
|
|
632
|
-
When MCP is unavailable
|
|
633
|
-
|
|
634
|
-
|
|
682
|
+
When MCP is unavailable after its normal retry boundary, run
|
|
683
|
+
`graph fallback --kind ... --reason ...`. Only then use direct filesystem code discovery, while Git,
|
|
684
|
+
exact package resolution, named authority artifacts, and configured tests retain their normal tools.
|
|
635
685
|
|
|
636
686
|
## Role Use
|
|
637
687
|
|
|
@@ -792,6 +842,22 @@ returns `safe=true` with a clean checkout, no running Step, and no active writer
|
|
|
792
842
|
|
|
793
843
|
## Explain an implementation change before escalating
|
|
794
844
|
|
|
845
|
+
For registry `step-review`, `final-review`, `corrective-audit`, and `plan-audit` roles, inspect
|
|
846
|
+
only the canonical repository and immutable commit/packet/seal or audit-request evidence. Verify
|
|
847
|
+
those bindings before reading and returning the result. A detached or different App branch does
|
|
848
|
+
not require Task-branch reconciliation for read-only review. Do not change product files, Git
|
|
849
|
+
history or Workflow state, or invoke lifecycle mutations. Save an explicitly requested report only
|
|
850
|
+
outside repository checkouts under actual filesystem permissions; the dispatch prompt grants no
|
|
851
|
+
access. This review boundary does not apply to a Worker merely using a review-phase model.
|
|
852
|
+
|
|
853
|
+
Read-only Workflow diagnostics are not necessarily write-free: `next` can prepare an external
|
|
854
|
+
reviewer runtime cache and write/remove `.write-probe`. Check actual cache permissions for normal
|
|
855
|
+
review diagnostics. When the user explicitly prohibits every write, reuse current bound receipts
|
|
856
|
+
and the prior successful same-session handshake, read immutable evidence directly, and avoid
|
|
857
|
+
runtime-preflight APIs. Do not rerun `next` or save an artifact under that prohibition; report any
|
|
858
|
+
unverified current binding. The user's zero-write instruction controls. See
|
|
859
|
+
`../../references/chat-dispatch.md` for the distinction.
|
|
860
|
+
|
|
795
861
|
Before a product write by a tracked Worker, run the packaged registry `dispatch-context-check`
|
|
796
862
|
using fresh App readback, the actual write root and the branch from the current Task. Resolve
|
|
797
863
|
checkout mismatch without duplicate dispatch or silent canonical-checkout writes. A matching
|