codex-workflow-v2 2.0.0-beta.1 → 2.0.0-beta.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +94 -12
- package/dist/src/alpha6/adoption.js +13 -3
- package/dist/src/alpha6/adoption.js.map +1 -1
- package/dist/src/alpha6/handoff.d.ts +26 -2
- package/dist/src/alpha6/handoff.js +277 -29
- package/dist/src/alpha6/handoff.js.map +1 -1
- package/dist/src/alpha6/mechanical-feasibility.d.ts +7 -0
- package/dist/src/alpha6/mechanical-feasibility.js +303 -0
- package/dist/src/alpha6/mechanical-feasibility.js.map +1 -0
- package/dist/src/alpha6/milestone.d.ts +37 -2
- package/dist/src/alpha6/milestone.js +472 -33
- package/dist/src/alpha6/milestone.js.map +1 -1
- package/dist/src/alpha6/plan-integrity.d.ts +14 -0
- package/dist/src/alpha6/plan-integrity.js +127 -0
- package/dist/src/alpha6/plan-integrity.js.map +1 -0
- package/dist/src/alpha6/plan-risk.d.ts +1 -0
- package/dist/src/alpha6/plan-risk.js +15 -7
- package/dist/src/alpha6/plan-risk.js.map +1 -1
- package/dist/src/alpha6/remediation.d.ts +2 -1
- package/dist/src/alpha6/remediation.js +186 -9
- package/dist/src/alpha6/remediation.js.map +1 -1
- package/dist/src/alpha6/review.d.ts +3 -0
- package/dist/src/alpha6/review.js +24 -0
- package/dist/src/alpha6/review.js.map +1 -1
- package/dist/src/cli.js +486 -46
- package/dist/src/cli.js.map +1 -1
- package/dist/src/contracts.d.ts +238 -6
- package/dist/src/contracts.js +1 -1
- package/dist/src/credential-output.d.ts +10 -0
- package/dist/src/credential-output.js +73 -0
- package/dist/src/credential-output.js.map +1 -0
- package/dist/src/dependency-provenance.d.ts +19 -0
- package/dist/src/dependency-provenance.js +185 -0
- package/dist/src/dependency-provenance.js.map +1 -0
- package/dist/src/errors.d.ts +1 -1
- package/dist/src/errors.js.map +1 -1
- package/dist/src/git.d.ts +1 -1
- package/dist/src/git.js +13 -5
- package/dist/src/git.js.map +1 -1
- package/dist/src/index.d.ts +2 -1
- package/dist/src/index.js +2 -1
- package/dist/src/index.js.map +1 -1
- package/dist/src/lifecycle/canonical-hash.d.ts +6 -0
- package/dist/src/lifecycle/canonical-hash.js +24 -0
- package/dist/src/lifecycle/canonical-hash.js.map +1 -0
- package/dist/src/lifecycle/catalog.d.ts +26 -0
- package/dist/src/lifecycle/catalog.js +208 -0
- package/dist/src/lifecycle/catalog.js.map +1 -0
- package/dist/src/lifecycle/compiler-inspection.d.ts +48 -0
- package/dist/src/lifecycle/compiler-inspection.js +29 -0
- package/dist/src/lifecycle/compiler-inspection.js.map +1 -0
- package/dist/src/lifecycle/core-static-readiness.d.ts +6 -0
- package/dist/src/lifecycle/core-static-readiness.js +130 -0
- package/dist/src/lifecycle/core-static-readiness.js.map +1 -0
- package/dist/src/lifecycle/corrective-replan-authority.d.ts +53 -0
- package/dist/src/lifecycle/corrective-replan-authority.js +139 -0
- package/dist/src/lifecycle/corrective-replan-authority.js.map +1 -0
- package/dist/src/lifecycle/corrective-replan-binding-manifest.d.ts +21 -0
- package/dist/src/lifecycle/corrective-replan-binding-manifest.js +35 -0
- package/dist/src/lifecycle/corrective-replan-binding-manifest.js.map +1 -0
- package/dist/src/lifecycle/corrective-replan-credential-core.d.ts +86 -0
- package/dist/src/lifecycle/corrective-replan-credential-core.js +563 -0
- package/dist/src/lifecycle/corrective-replan-credential-core.js.map +1 -0
- package/dist/src/lifecycle/corrective-replan-credential-schema.d.ts +17 -0
- package/dist/src/lifecycle/corrective-replan-credential-schema.js +44 -0
- package/dist/src/lifecycle/corrective-replan-credential-schema.js.map +1 -0
- package/dist/src/lifecycle/corrective-replan-credentials.d.ts +47 -0
- package/dist/src/lifecycle/corrective-replan-credentials.js +103 -0
- package/dist/src/lifecycle/corrective-replan-credentials.js.map +1 -0
- package/dist/src/lifecycle/corrective-replan.d.ts +64 -0
- package/dist/src/lifecycle/corrective-replan.js +553 -0
- package/dist/src/lifecycle/corrective-replan.js.map +1 -0
- package/dist/src/lifecycle/evaluator.d.ts +2 -0
- package/dist/src/lifecycle/evaluator.js +35 -0
- package/dist/src/lifecycle/evaluator.js.map +1 -0
- package/dist/src/lifecycle/fingerprint.d.ts +31 -0
- package/dist/src/lifecycle/fingerprint.js +388 -0
- package/dist/src/lifecycle/fingerprint.js.map +1 -0
- package/dist/src/lifecycle/immutable.d.ts +1 -0
- package/dist/src/lifecycle/immutable.js +10 -0
- package/dist/src/lifecycle/immutable.js.map +1 -0
- package/dist/src/lifecycle/implementation-table.d.ts +29 -0
- package/dist/src/lifecycle/implementation-table.js +87 -0
- package/dist/src/lifecycle/implementation-table.js.map +1 -0
- package/dist/src/lifecycle/index.d.ts +4 -0
- package/dist/src/lifecycle/index.js +5 -0
- package/dist/src/lifecycle/index.js.map +1 -0
- package/dist/src/lifecycle/schema-artifact.d.ts +12 -0
- package/dist/src/lifecycle/schema-artifact.js +214 -0
- package/dist/src/lifecycle/schema-artifact.js.map +1 -0
- package/dist/src/lifecycle/semantic-registry.d.ts +6 -0
- package/dist/src/lifecycle/semantic-registry.js +489 -0
- package/dist/src/lifecycle/semantic-registry.js.map +1 -0
- package/dist/src/lifecycle/types.d.ts +718 -0
- package/dist/src/lifecycle/types.js +4 -0
- package/dist/src/lifecycle/types.js.map +1 -0
- package/dist/src/observation.d.ts +20 -0
- package/dist/src/observation.js +171 -0
- package/dist/src/observation.js.map +1 -0
- package/dist/src/reviewer.d.ts +43 -1
- package/dist/src/reviewer.js +203 -50
- package/dist/src/reviewer.js.map +1 -1
- package/dist/src/state/corrective-replan-executor.d.ts +64 -0
- package/dist/src/state/corrective-replan-executor.js +608 -0
- package/dist/src/state/corrective-replan-executor.js.map +1 -0
- package/dist/src/state/corrective-replan-public-schema.d.ts +3 -0
- package/dist/src/state/corrective-replan-public-schema.js +43 -0
- package/dist/src/state/corrective-replan-public-schema.js.map +1 -0
- package/dist/src/state/corrective-replan-public.d.ts +95 -0
- package/dist/src/state/corrective-replan-public.js +665 -0
- package/dist/src/state/corrective-replan-public.js.map +1 -0
- package/dist/src/state/corrective-replan-transaction.d.ts +160 -0
- package/dist/src/state/corrective-replan-transaction.js +730 -0
- package/dist/src/state/corrective-replan-transaction.js.map +1 -0
- package/dist/src/state/corrective-yield-executor.d.ts +31 -0
- package/dist/src/state/corrective-yield-executor.js +236 -0
- package/dist/src/state/corrective-yield-executor.js.map +1 -0
- package/dist/src/state/corrective-yield-transaction.d.ts +97 -0
- package/dist/src/state/corrective-yield-transaction.js +591 -0
- package/dist/src/state/corrective-yield-transaction.js.map +1 -0
- package/dist/src/state/lock.d.ts +76 -3
- package/dist/src/state/lock.js +611 -30
- package/dist/src/state/lock.js.map +1 -1
- package/dist/src/state/store.d.ts +3 -0
- package/dist/src/state/store.js +65 -12
- package/dist/src/state/store.js.map +1 -1
- package/dist/src/transition-core.d.ts +67 -0
- package/dist/src/transition-core.js +318 -0
- package/dist/src/transition-core.js.map +1 -0
- package/dist/src/version.d.ts +1 -1
- package/dist/src/version.js +1 -1
- package/dist/src/version.js.map +1 -1
- package/dist/src/workflow.d.ts +88 -24
- package/dist/src/workflow.js +1647 -270
- package/dist/src/workflow.js.map +1 -1
- package/docs/autonomy-guardrails.md +61 -1
- package/docs/beta11-plan-integrity-recovery-brief.md +38 -0
- package/docs/beta2-initial-assembly-navigation-brief.md +616 -0
- package/docs/delegated-approval.md +26 -1
- package/docs/development-flow.md +63 -8
- package/docs/lifecycle/state-machine-stabilization.md +641 -0
- package/docs/pdf/README.md +24 -0
- package/docs/pdf/codex-workflow-v2-architecture-ru.pdf +0 -0
- package/docs/pdf/codex-workflow-v2-chat-only-guide-ru.pdf +0 -0
- package/docs/pdf/codex-workflow-v2-technical-reference-ru.pdf +0 -0
- package/docs/pdf/requirements.txt +1 -0
- package/docs/pdf/sources/codex-workflow-v2-architecture-ru.md +234 -0
- package/docs/pdf/sources/codex-workflow-v2-chat-only-guide-ru.md +334 -0
- package/docs/pdf/sources/codex-workflow-v2-technical-reference-ru.md +413 -0
- package/docs/problem-briefs/01-pre-implementation-integrity.md +478 -0
- package/docs/problem-briefs/02-minimal-step-integrity.md +411 -0
- package/docs/problem-briefs/03-minimal-agent-context-integrity.md +358 -0
- package/docs/problem-briefs/04-task-dependency-and-structural-replacement-integrity.md +566 -0
- package/docs/problem-briefs/BRIEF-TEMPLATE.md +56 -0
- package/docs/problem-briefs/README.md +120 -0
- package/docs/problem-briefs/evidence/p01-mechanical-feasibility-corpus.md +90 -0
- package/docs/problem-briefs/evidence/signal-v4-pre-m3-replay.md +246 -0
- package/docs/release.md +30 -6
- package/docs/split-required-recovery.md +19 -25
- package/docs/stable-release-defect-register.md +465 -3
- package/docs/updating-existing-project.md +59 -4
- package/docs/validation-report.md +124 -56
- package/package.json +9 -1
- package/plugins/codex-workflow-gateway/.codex-plugin/plugin.json +10 -3
- package/plugins/codex-workflow-gateway/references/protocol.md +92 -4
- package/plugins/codex-workflow-gateway/scripts/chat-registry.mjs +376 -0
- package/plugins/codex-workflow-gateway/skills/codex-workflow-gateway/SKILL.md +263 -4
- package/references/state-machine.md +13 -6
- package/roles/delivery-coordinator.md +39 -0
- package/schemas/adoption-posture-event.schema.json +1 -1
- package/schemas/authorization-event.schema.json +64 -1
- package/schemas/context-envelope.schema.json +1 -1
- package/schemas/corrective-decision-event.schema.json +48 -3
- package/schemas/corrective-replan-credentials.private.schema.json +98 -0
- package/schemas/corrective-replan-execution-event.private.schema.json +53 -0
- package/schemas/corrective-replan-public.schema.json +142 -0
- package/schemas/corrective-replan-task-transaction.private.schema.json +151 -0
- package/schemas/corrective-yield-task-transaction.private.schema.json +98 -0
- package/schemas/milestone-scope-change-event.schema.json +6 -1
- package/schemas/milestone.schema.json +6 -1
- package/schemas/remediation-event.schema.json +11 -1
- package/schemas/task-handoff-event.schema.json +19 -3
- package/schemas/task.schema.json +24 -1
- package/schemas/transition-definition.schema.json +2609 -0
- package/schemas/transition-payloads.schema.json +140 -0
- package/scripts/generate-pdf-docs.py +512 -0
- package/scripts/run-pdf-docs.mjs +62 -0
|
@@ -0,0 +1,413 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Codex Workflow V2: технический справочник beta.11
|
|
3
|
+
subtitle: Protocol 2, state schema 2, transactions, credentials, dependency authority, review и recovery
|
|
4
|
+
part: Часть 3 из 3 | Technical reference
|
|
5
|
+
document_version: 2.0
|
|
6
|
+
date: 24 августа 2026
|
|
7
|
+
subject: Технический контракт Codex Workflow V2 beta.11
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
# 1. Runtime contract
|
|
11
|
+
|
|
12
|
+
Workflow V2 предоставляет локальные revisioned transitions. Публичный CLI возвращает JSON с `ok=true`
|
|
13
|
+
и `value` либо структурированную ошибку с `code`, `message` и `details`. Chat, PDF и gateway не создают
|
|
14
|
+
authority сами: mutating permission определяется runtime state и свежим `next`.
|
|
15
|
+
|
|
16
|
+
| Параметр beta.11 | Значение |
|
|
17
|
+
|---|---|
|
|
18
|
+
| npm package | `codex-workflow-v2@2.0.0-beta.11` |
|
|
19
|
+
| protocolVersion | 2 |
|
|
20
|
+
| stateSchemaVersion | 2 |
|
|
21
|
+
| lifecycle epoch | 2 |
|
|
22
|
+
| transition definition format | 4 |
|
|
23
|
+
| execution topology | Один пользователь, одна машина, local/external workspace contract |
|
|
24
|
+
|
|
25
|
+
Schema 2 не означает, что все optional legacy fields дают execution authority. Например отсутствие
|
|
26
|
+
Milestone dependency arrays разрешено decoder только для чтения historical state и блокирует новое
|
|
27
|
+
execution до explicit Plan amendment.
|
|
28
|
+
|
|
29
|
+
# 2. Package resolution и handshake
|
|
30
|
+
|
|
31
|
+
Gateway выполняет:
|
|
32
|
+
|
|
33
|
+
1. `git rev-parse --show-toplevel`;
|
|
34
|
+
2. чтение exact `codex-workflow-v2` version из `devDependencies`;
|
|
35
|
+
3. resolution `node_modules/codex-workflow-v2/package.json`;
|
|
36
|
+
4. equality check declared/installed versions;
|
|
37
|
+
5. вызов только package-local `dist/src/cli.js --repo <root>`;
|
|
38
|
+
6. `gateway handshake` до lifecycle действий.
|
|
39
|
+
|
|
40
|
+
Ключевые beta.11 capabilities:
|
|
41
|
+
|
|
42
|
+
| Группа | Capabilities |
|
|
43
|
+
|---|---|
|
|
44
|
+
| Knowledge и graph | `project-memory-v1`, `graph-binding-v1`, `task-context-refresh-v1` |
|
|
45
|
+
| Milestone | lifecycle, initial assembly navigation, autonomy, progress, dependency DAG, initial Plan transaction |
|
|
46
|
+
| Task planning | Plan Risk Audit, proof obligations, mechanical feasibility |
|
|
47
|
+
| C1 | handoff sidecar, handoff bundle, derived Worker actor, credential replacement |
|
|
48
|
+
| Reviews | strict reviewer, Step strict review, corrective audit and hard stop |
|
|
49
|
+
| Recovery | dependency provenance, plan integrity, remediation mode, corrective yield/replan journals |
|
|
50
|
+
| Replacement | `structural-task-replacement-disabled-v1` |
|
|
51
|
+
|
|
52
|
+
Handshake incompatibility прекращает работу. Запуск global package, `latest`, mutable range или соседней
|
|
53
|
+
source checkout запрещён.
|
|
54
|
+
|
|
55
|
+
# 3. State, artifacts и sidecars
|
|
56
|
+
|
|
57
|
+
Project identity выводится из Git common directory. Сущности содержат `schemaVersion`, `revision`, ID,
|
|
58
|
+
projectId и timestamps. Mutations используют compare-and-swap по `expectedRevision`.
|
|
59
|
+
|
|
60
|
+
```text
|
|
61
|
+
$CODEX_HOME/workflow-state/v2/projects/<project-id>/
|
|
62
|
+
project.json
|
|
63
|
+
knowledge-map.json
|
|
64
|
+
discoveries/<DISC-ID>/state.json
|
|
65
|
+
tasks/<TASK-ID>/
|
|
66
|
+
brief.md, plan.md, result.md, evidence.json, state.json
|
|
67
|
+
.versions/
|
|
68
|
+
authorization/review/remediation/corrective/handoff sidecars
|
|
69
|
+
milestones/<MS-ID>/
|
|
70
|
+
plan.json, result.md, evidence.json, state.json
|
|
71
|
+
.versions/ и scope/autonomy sidecars
|
|
72
|
+
delegations/<DGR-ID>/state.json
|
|
73
|
+
locks/<TASK-ID>.json
|
|
74
|
+
graph-bindings/
|
|
75
|
+
composite transaction journals
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
Artifacts публикуются через staged version, CAS state write, active publication и hash readback.
|
|
79
|
+
Composite mutations добавляют journal с exact targets, before/after hashes и recovery posture.
|
|
80
|
+
|
|
81
|
+
Local state никогда не копируется в product repository и не редактируется вручную.
|
|
82
|
+
|
|
83
|
+
# 4. Project Knowledge Map
|
|
84
|
+
|
|
85
|
+
Map хранит metadata долговременных repository files: normalized path, category, scope, authority,
|
|
86
|
+
contentHash, gaps, conflicts и approval. Содержимое документов остаётся в Git.
|
|
87
|
+
|
|
88
|
+
| Transition | Mutation |
|
|
89
|
+
|---|---|
|
|
90
|
+
| `project-memory scan` | Нет, read-only filesystem classification |
|
|
91
|
+
| `show/status` | Нет, current projection |
|
|
92
|
+
| `reconcile` | Новая map revision из current files |
|
|
93
|
+
| `approve` | mapHash и human/delegated approval evidence |
|
|
94
|
+
| `task knowledge-rebind` | Только Plan map binding, supersede authorization |
|
|
95
|
+
| `task context-refresh` | Atomic reconcile/approve/rebind/reauthorize при exact eligibility |
|
|
96
|
+
|
|
97
|
+
Top-level `next.action=task context-refresh` является exact composite route. Standalone reconcile перед
|
|
98
|
+
ним запрещён. Milestone Autonomy Contract может покрывать content-only drift и exact Plan-bounded
|
|
99
|
+
supporting-source addition, но не standalone Project Memory approval.
|
|
100
|
+
|
|
101
|
+
PDF-файлы в `docs/pdf` являются human-facing binary artifacts. Reviewable Markdown sources находятся в
|
|
102
|
+
`docs/pdf/sources`; runtime Project Knowledge authority остаётся в обычных project files и scanner rules.
|
|
103
|
+
|
|
104
|
+
# 5. Discovery и materialization
|
|
105
|
+
|
|
106
|
+
Discovery фиксирует kind, goal/outcome, success signal, scope, out-of-scope, acceptance, constraints,
|
|
107
|
+
unknowns и readiness. Blocking unknown запрещает materialization.
|
|
108
|
+
|
|
109
|
+
Milestone materialization создаёт initial planning posture. Пока Plan отсутствует, `next` возвращает
|
|
110
|
+
`milestone initial-assembly` и exact linked Task assembly commands. Coordinator materializes intended
|
|
111
|
+
linked Tasks, затем публикует один complete Plan. Reverse membership integrity запрещает закрыть Plan с
|
|
112
|
+
unclassified live linked Task.
|
|
113
|
+
|
|
114
|
+
# 6. Milestone Plan и dependency DAG
|
|
115
|
+
|
|
116
|
+
```text
|
|
117
|
+
MilestonePlanInput
|
|
118
|
+
outcome
|
|
119
|
+
successSignal
|
|
120
|
+
acceptance[]
|
|
121
|
+
checks[]
|
|
122
|
+
memberships[]
|
|
123
|
+
taskId
|
|
124
|
+
disposition
|
|
125
|
+
reason
|
|
126
|
+
dependsOnTaskIds[]
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
Normalization trim-ит строки и сортирует каждый dependency array по exact Task ID. Duplicate edges
|
|
130
|
+
отклоняются до normalization и hashing. Graph validation запрещает:
|
|
131
|
+
|
|
132
|
+
- missing dependency array на новом Plan;
|
|
133
|
+
- dangling, external и missing Task targets;
|
|
134
|
+
- duplicate membership и duplicate edge;
|
|
135
|
+
- self edge и cycle;
|
|
136
|
+
- required consumer с waived/cancelled provider;
|
|
137
|
+
- dependency inference из ordinal, title, filename или chat order.
|
|
138
|
+
|
|
139
|
+
Initial `milestone plan-set` атомарно связывает state.json и plan.json. Scope change использует
|
|
140
|
+
journaled transaction для membership state, plan artifact, revision/hash и authorization supersession.
|
|
141
|
+
|
|
142
|
+
## 6.1. Runnable predicate
|
|
143
|
+
|
|
144
|
+
```text
|
|
145
|
+
runnable =
|
|
146
|
+
milestone.status == active
|
|
147
|
+
AND membership.disposition == required
|
|
148
|
+
AND every dependsOnTaskId is a required member with Task status merged
|
|
149
|
+
```
|
|
150
|
+
|
|
151
|
+
Predicate вызывается из repository `next`, scoped `next --task`, progress projection, handoff preparation,
|
|
152
|
+
claim до lock acquisition и Task start. Scheduler выбирает из полного runnable set и не изменяет graph.
|
|
153
|
+
|
|
154
|
+
Legacy nonterminal Milestone без arrays имеет `dependencyState=legacy-unknown` и не может handoff, claim
|
|
155
|
+
или start unstarted required Tasks до explicit Plan amendment.
|
|
156
|
+
|
|
157
|
+
# 7. Milestone autonomy и delegated approval
|
|
158
|
+
|
|
159
|
+
Generic delegation allow-list закрыт:
|
|
160
|
+
|
|
161
|
+
```text
|
|
162
|
+
project_memory.approve
|
|
163
|
+
task.execution_authorize
|
|
164
|
+
task.final_accept
|
|
165
|
+
milestone.execution_authorize
|
|
166
|
+
milestone.final_accept
|
|
167
|
+
```
|
|
168
|
+
|
|
169
|
+
Issuance: `delegation prepare` возвращает exact policyHash и DGA-code; только отдельный later human turn
|
|
170
|
+
разрешает `delegation grant`. Event сохраняет principal и delegate раздельно.
|
|
171
|
+
|
|
172
|
+
Milestone autonomy используется после complete initial Plan:
|
|
173
|
+
|
|
174
|
+
```text
|
|
175
|
+
milestone autonomy-prepare
|
|
176
|
+
-> human confirms exact MAC-code in later turn
|
|
177
|
+
-> milestone autonomy-grant
|
|
178
|
+
-> bounded approvals/context refresh/membership-only evolve
|
|
179
|
+
```
|
|
180
|
+
|
|
181
|
+
Contract связывает principal, delegate, Milestone, expiry, semantic scope hash и policy hash. Outcome,
|
|
182
|
+
success signal, acceptance, checks, Discovery и base branch неизменны. `autonomy-evolve` допускает только
|
|
183
|
+
membership changes и supersedes execution authorization.
|
|
184
|
+
|
|
185
|
+
Grant никогда не является C1 writer credential и не наследуется handoff, claim, run, step-complete,
|
|
186
|
+
reviews, sync-base или merge.
|
|
187
|
+
|
|
188
|
+
# 8. Task Plan authority и P01-A
|
|
189
|
+
|
|
190
|
+
Task Plan обязан копировать exact requirement/acceptance identifiers из `next.taskPlanContract`. Step
|
|
191
|
+
содержит objective, requirements, dependencies, expectedOutputs, allowedWrites, forbiddenScope и checks.
|
|
192
|
+
Plan binding включает Brief/Plan hashes и approved Knowledge Map revision/hash.
|
|
193
|
+
|
|
194
|
+
Plan Risk Audit до execution фиксирует guarded Step categories и proof obligations. Fresh execution
|
|
195
|
+
authorization запускает три versioned analyzers:
|
|
196
|
+
|
|
197
|
+
| Analyzer | Поддерживаемая точная проверка |
|
|
198
|
+
|---|---|
|
|
199
|
+
| `wf2.root-npm-script@1` | Exact `npm run <script>` в root package.json либо responsible manifest writer |
|
|
200
|
+
| `wf2.exact-output-path@1` | Exact `path:<repository-relative POSIX path>` существует или writable |
|
|
201
|
+
| `wf2.exact-predecessor-path@1` | Exact transitive predecessor declares и may write consumer path |
|
|
202
|
+
|
|
203
|
+
Findings имеют `pass`, `blocked` или `unverified`. Любой blocked finding запрещает authorization без
|
|
204
|
+
event write. Clear evidence записывается внутрь AuthorizationEvent вместе с analyzer set/input hashes,
|
|
205
|
+
Brief/Plan hashes, evaluated HEAD, source branch/kind и evidence hash.
|
|
206
|
+
|
|
207
|
+
Freshness повторно проверяется перед claim/start/run и recovery. Pre-start evidence связывается с exact
|
|
208
|
+
base branch HEAD; corrective evidence связывается с current Task workspace и baseCommit. Git ancestry,
|
|
209
|
+
branch, analyzer inputs и evidence hash должны оставаться current.
|
|
210
|
+
|
|
211
|
+
Legacy approved AuthorizationEvent без mechanical payload остаётся readable для compatibility, но не
|
|
212
|
+
создаёт новую P01 evidence claim.
|
|
213
|
+
|
|
214
|
+
# 9. C1 handoff и writer lease
|
|
215
|
+
|
|
216
|
+
## 9.1. Dependency binding
|
|
217
|
+
|
|
218
|
+
Milestone-linked handoff event включает:
|
|
219
|
+
|
|
220
|
+
```text
|
|
221
|
+
dependencyBinding
|
|
222
|
+
milestoneRevision
|
|
223
|
+
membershipRevision
|
|
224
|
+
milestonePlanHash
|
|
225
|
+
```
|
|
226
|
+
|
|
227
|
+
Standalone Task использует null. Handoff preparation проверяет runnable predicate и current authorization.
|
|
228
|
+
Claim сверяет stored binding с current Milestone authority до lock acquisition. Dependency-blocked claim
|
|
229
|
+
не получает и не сохраняет lease.
|
|
230
|
+
|
|
231
|
+
## 9.2. Credential sequence
|
|
232
|
+
|
|
233
|
+
1. `task handoff-prepare` возвращает first-field `credentialHandoff` и safe bundle.
|
|
234
|
+
2. Plaintext claim token существует только в response и working memory; state хранит hash.
|
|
235
|
+
3. Exact target actor вызывает `task claim` с one-time token.
|
|
236
|
+
4. Claim выдаёт first-field `writerLeaseReceipt`.
|
|
237
|
+
5. `task run` принимает token по `next.writerTokenContract`, heartbeats lease и возвращает refreshed receipt.
|
|
238
|
+
6. Terminal handback/release уничтожает active bearer material.
|
|
239
|
+
|
|
240
|
+
Credential нельзя логировать, сохранять в chat packet или включать в evidence. `handoff-show` возвращает
|
|
241
|
+
только safe persisted binding. Recovery использует отдельные advertised replacement actions.
|
|
242
|
+
|
|
243
|
+
# 10. Git и Step evidence
|
|
244
|
+
|
|
245
|
+
| Boundary | Проверки Core |
|
|
246
|
+
|---|---|
|
|
247
|
+
| Task start | Clean checkout, fresh base/auth/dependency binding, correct workspace policy |
|
|
248
|
+
| Step run | Planned/failed eligible Step, dependencies, branch, C1 actor, lease |
|
|
249
|
+
| Worker return | Изменения uncommitted и только в allowedWrites |
|
|
250
|
+
| Step complete | History, scope, checks, review gate, exact writer token |
|
|
251
|
+
| Commit | Один Core-owned commit с Task/Step metadata |
|
|
252
|
+
| Submit | Clean tree, Steps completed/skipped, recorded commits and evidence |
|
|
253
|
+
| Merge | Fresh review/acceptance, base conditions, accepted HEAD |
|
|
254
|
+
|
|
255
|
+
Local start повторно сравнивает authorized base внутри Git branch creation, закрывая TOCTOU между
|
|
256
|
+
freshness check и mutation. External workspace обязан быть non-base branch от exact recorded commit.
|
|
257
|
+
|
|
258
|
+
# 11. Task state и review
|
|
259
|
+
|
|
260
|
+
Основной путь:
|
|
261
|
+
|
|
262
|
+
```text
|
|
263
|
+
planning -> awaiting_execution_authorization -> ready
|
|
264
|
+
-> C1 claimed -> in_progress -> validating
|
|
265
|
+
-> awaiting_final_acceptance -> merging -> merged
|
|
266
|
+
```
|
|
267
|
+
|
|
268
|
+
Return states включают `needs_fix` и `blocked`. `cancelled` terminal. Rebind/replan supersedes old
|
|
269
|
+
authorization; sync-base invalidates review/Result/acceptance bindings.
|
|
270
|
+
|
|
271
|
+
В Codex App recommended strict mode external-sealed:
|
|
272
|
+
|
|
273
|
+
- `task step-review-packet` -> separate Step Reviewer -> `task step-review-record`;
|
|
274
|
+
- `task review-packet` -> separate Final Reviewer -> `task review-sealed-record`;
|
|
275
|
+
- packetHash и repositorySealHash обязаны совпасть до записи;
|
|
276
|
+
- Reviewer thread ID и lifecycle actor фиксируются, bearer token не передаётся Reviewer;
|
|
277
|
+
- seal drift уничтожает result и требует fresh packet.
|
|
278
|
+
|
|
279
|
+
`review-launch` сохраняется в public CLI для совместимых environments, но не применяется как nested
|
|
280
|
+
local reviewer внутри Codex App sandbox.
|
|
281
|
+
|
|
282
|
+
# 12. Remediation и corrective decisions
|
|
283
|
+
|
|
284
|
+
Guarded Step имеет bounded remediation circuit:
|
|
285
|
+
|
|
286
|
+
| Boundary | Разрешение |
|
|
287
|
+
|---|---|
|
|
288
|
+
| Первый failed review/check cycle | Ordinary scoped retry |
|
|
289
|
+
| Два failed review cycles | Independent Corrective Auditor |
|
|
290
|
+
| `continue-fix` | Один corrective attempt |
|
|
291
|
+
| Corrective attempt failed | Hard stop, fourth run запрещён |
|
|
292
|
+
| `replan-required` | Corrective yield и Human-confirmed journaled replan |
|
|
293
|
+
| `split-required` | Structural replacement stop |
|
|
294
|
+
| `stop-escalate` | Terminal user attention |
|
|
295
|
+
|
|
296
|
+
Corrective replan разделён на prepare, Human confirmation, execute и recover. Candidate/receipt связывают
|
|
297
|
+
Task revision, Plan/Brief/evidence, corrective decision, writer posture и repository state. Execution
|
|
298
|
+
transaction supersedes old authority и публикует replacement Plan атомарно.
|
|
299
|
+
|
|
300
|
+
# 13. beta.11 Plan-integrity recovery
|
|
301
|
+
|
|
302
|
+
`task plan-integrity-recover` применим только после одного first ordinary `checks-failed` remediation:
|
|
303
|
+
|
|
304
|
+
- check соответствует bounded root npm-script grammar;
|
|
305
|
+
- script отсутствует;
|
|
306
|
+
- package.json вне current Step allowedWrites;
|
|
307
|
+
- dirty files полностью внутри Step scope;
|
|
308
|
+
- current Task/Plan/remediation/Step/manifest/HEAD bindings точны.
|
|
309
|
+
|
|
310
|
+
Recovery записывает schema-valid `replan-required` decision с synthetic ordinal 2 и canonical conflict
|
|
311
|
+
hash. Он не запускает checks повторно, не меняет worktree, Plan или allowedWrites. Затем C1 owner следует
|
|
312
|
+
fresh `next` через corrective yield и обычный Human-confirmed replan.
|
|
313
|
+
|
|
314
|
+
P01-A предотвращает поддерживаемые contradictions до fresh authorization. beta.11 path остаётся для
|
|
315
|
+
pre-P01 authorizations и late/unsupported exact recovery cases.
|
|
316
|
+
|
|
317
|
+
# 14. P04-A structural replacement boundary
|
|
318
|
+
|
|
319
|
+
Command shape `task replacement-materialize` retained только для compatibility diagnostics. Любая попытка
|
|
320
|
+
возвращает `TRANSITION_BLOCKED`, diagnostic `STRUCTURAL_REPLACEMENT_REQUIRED` и incident dependency edges
|
|
321
|
+
до Task/Discovery/Milestone/Knowledge/lock writes.
|
|
322
|
+
|
|
323
|
+
`next` при terminal split возвращает:
|
|
324
|
+
|
|
325
|
+
```text
|
|
326
|
+
action: doctor
|
|
327
|
+
blockedAction: task replacement-materialize
|
|
328
|
+
replacementGate.structuralReplacementAvailable: false
|
|
329
|
+
replacementGate.transaction: disabled
|
|
330
|
+
```
|
|
331
|
+
|
|
332
|
+
Нельзя rebind, refresh, replan, authorize, resume, cancel historical Task, consume replacement Discovery
|
|
333
|
+
или manually rewire graph. P04-B/P05 должен определить arbitrary cardinality, scope redistribution,
|
|
334
|
+
dependency rewiring, completed-work adoption и crash-safe transaction.
|
|
335
|
+
|
|
336
|
+
# 15. Milestone progress и Codex task supervision
|
|
337
|
+
|
|
338
|
+
`milestone progress` является read-only projection: ordinals, membership disposition/reason, dependency
|
|
339
|
+
state, predecessors/statuses, runnable/block reason, replacement links и Step statuses.
|
|
340
|
+
|
|
341
|
+
Coordinator создаёт отдельный standalone Codex task just-in-time. TaskContextPacket не содержит parent
|
|
342
|
+
transcript или secrets. Project registry выдаёт monotonic #NNN и exact title; readback/fallback обязательны.
|
|
343
|
+
|
|
344
|
+
Coordinator ждёт one routed Task, читает closed CoordinatorReport, затем выполняет repository
|
|
345
|
+
`status -> next` и новый progress projection. Recoverable non-human continuation возвращается в тот же
|
|
346
|
+
Task chat. Следующий Task dispatch разрешён только после terminal merged confirmation.
|
|
347
|
+
|
|
348
|
+
# 16. codebase-memory graph
|
|
349
|
+
|
|
350
|
+
`codebase-memory-mcp` используется только после `graph refresh-request`. Gateway сверяет project/root,
|
|
351
|
+
index status и request fingerprint, получает derived evidence и вызывает `graph bind` с current revision.
|
|
352
|
+
|
|
353
|
+
Graph является навигационным индексом, не Project Knowledge authority. При provider unavailable Core
|
|
354
|
+
записывает explicit `graph fallback`; агент продолжает Git search, прямое чтение файлов и tests, если
|
|
355
|
+
другой independent gate не блокирует работу.
|
|
356
|
+
|
|
357
|
+
# 17. Error codes и recovery discipline
|
|
358
|
+
|
|
359
|
+
| Code | Значение | Реакция |
|
|
360
|
+
|---|---|---|
|
|
361
|
+
| `INVALID_ARGUMENT` | Closed input contract нарушен | Исправить exact syntax/field, не менять semantics |
|
|
362
|
+
| `NOT_FOUND` | Entity/artifact/lock отсутствует | Проверить project и ID через fresh observations |
|
|
363
|
+
| `STATE_CONFLICT` | expected revision устарела | Новый status/show/next, без blind retry |
|
|
364
|
+
| `STATE_CORRUPT` | Schema/hash/chain несовместимы | Stop и owning recovery/diagnostics |
|
|
365
|
+
| `LOCKED` | Active writer lease существует | Не создавать второго writer |
|
|
366
|
+
| `LOCK_TOKEN_INVALID` | Bearer не владеет lease | Credential recovery для exact owner |
|
|
367
|
+
| `TRANSITION_BLOCKED` | Lifecycle/authority gate не выполнен | Следовать action/details из fresh next |
|
|
368
|
+
| `GIT_PRECONDITION_FAILED` | Branch/base/clean/history mismatch | Штатная Git recovery/sync route |
|
|
369
|
+
| `COMMAND_FAILED` | Git/check/provider process failed | Сохранить evidence и устранить concrete cause |
|
|
370
|
+
|
|
371
|
+
После каждой successful mutation обязателен sequential `status`, затем fresh `next`. Failed status/next
|
|
372
|
+
не разрешает direct mutation. Syntax help read-only и не заменяет navigation authority.
|
|
373
|
+
|
|
374
|
+
# 18. Public command surface beta.11
|
|
375
|
+
|
|
376
|
+
| Область | Actions |
|
|
377
|
+
|---|---|
|
|
378
|
+
| System | `doctor`, `status`, `next`, `gateway handshake`, `locks` |
|
|
379
|
+
| Update | `preflight`, `rescue-preflight`, `dependency-provenance-preflight/recover` |
|
|
380
|
+
| Project memory | `scan`, `show`, `status`, `approve`, `reconcile` |
|
|
381
|
+
| Delegation | `prepare`, `grant`, `list`, `show`, `revoke` |
|
|
382
|
+
| Graph | `prepare`, `status`, `refresh-request`, `bind`, `fallback` |
|
|
383
|
+
| Discovery | `start`, `update`, `show`, `materialize` |
|
|
384
|
+
| Milestone | `recover`, `show`, `progress`, `plan-set`, scope-change, autonomy, `authorize`, `validate`, `accept`, `cancel` |
|
|
385
|
+
| Task planning | `show`, `plan-set`, `knowledge-rebind`, `context-refresh`, `authorize`, `plan-risk-audit` |
|
|
386
|
+
| Task execution | `start`, `run`, `step-complete`, `submit`, `result-set`, `accept`, `sync-base`, `merge`, `merge-confirm` |
|
|
387
|
+
| C1 | `handoff[-prepare/-replace/-show]`, `claim`, `writer-credential-replace`, `handback[-create]` |
|
|
388
|
+
| Review | review/step-review packet, launch, sealed record и record actions |
|
|
389
|
+
| Corrective | decision/recovery, plan-integrity, remediation-mode, yield и corrective-replan actions |
|
|
390
|
+
| Replacement | `replacement-materialize` retained, но всегда disabled в P04-A |
|
|
391
|
+
|
|
392
|
+
Exact options берутся из fresh `next`; command help используется только когда
|
|
393
|
+
`exactOptionContractAvailable=false` или syntax действительно неизвестен.
|
|
394
|
+
|
|
395
|
+
# 19. Release и package update gates
|
|
396
|
+
|
|
397
|
+
Перед package update project-local `update preflight` должен вернуть `safe=true`: clean checkout, нет
|
|
398
|
+
running Step и active/stale writer lease. External runner допустим только в документированной rescue
|
|
399
|
+
compatibility форме.
|
|
400
|
+
|
|
401
|
+
Перед beta.11 tag release repository выполняет:
|
|
402
|
+
|
|
403
|
+
1. `npm ci`;
|
|
404
|
+
2. `npm run validate`;
|
|
405
|
+
3. `npm run pack:check`;
|
|
406
|
+
4. `npm run smoke:downstream`;
|
|
407
|
+
5. `npm run plugin:check` и official plugin/skill validators;
|
|
408
|
+
6. `npm run docs:pdf:check`;
|
|
409
|
+
7. `npm run release:check` с exact release tag binding;
|
|
410
|
+
8. validation append-only real-agent lifecycle log.
|
|
411
|
+
|
|
412
|
+
PDF source и binaries должны совпасть детерминированно. Tag имеет форму `v<package-version>`.
|
|
413
|
+
Publication не выполняется локальными validation commands.
|