codex-workflow-v2 2.0.0-beta.12 → 2.0.0-beta.12.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (62) hide show
  1. package/README.md +65 -5
  2. package/dist/src/alpha6/downstream-proof.d.ts +68 -0
  3. package/dist/src/alpha6/downstream-proof.js +604 -0
  4. package/dist/src/alpha6/downstream-proof.js.map +1 -0
  5. package/dist/src/alpha6/milestone.d.ts +6 -2
  6. package/dist/src/alpha6/milestone.js +164 -10
  7. package/dist/src/alpha6/milestone.js.map +1 -1
  8. package/dist/src/alpha6/plan-risk.js +2 -2
  9. package/dist/src/alpha6/plan-risk.js.map +1 -1
  10. package/dist/src/alpha6/remediation.d.ts +8 -3
  11. package/dist/src/alpha6/remediation.js +374 -9
  12. package/dist/src/alpha6/remediation.js.map +1 -1
  13. package/dist/src/alpha6/review.d.ts +6 -0
  14. package/dist/src/alpha6/review.js +12 -0
  15. package/dist/src/alpha6/review.js.map +1 -1
  16. package/dist/src/alpha7/corrective-recovery.d.ts +8 -1
  17. package/dist/src/alpha7/corrective-recovery.js +406 -26
  18. package/dist/src/alpha7/corrective-recovery.js.map +1 -1
  19. package/dist/src/cli.js +135 -5
  20. package/dist/src/cli.js.map +1 -1
  21. package/dist/src/contracts.d.ts +154 -3
  22. package/dist/src/dependency-provenance.d.ts +9 -2
  23. package/dist/src/dependency-provenance.js +70 -8
  24. package/dist/src/dependency-provenance.js.map +1 -1
  25. package/dist/src/git.d.ts +1 -1
  26. package/dist/src/git.js +6 -2
  27. package/dist/src/git.js.map +1 -1
  28. package/dist/src/historical-step-provenance.d.ts +20 -0
  29. package/dist/src/historical-step-provenance.js +111 -0
  30. package/dist/src/historical-step-provenance.js.map +1 -0
  31. package/dist/src/state/corrective-replan-executor.js +5 -0
  32. package/dist/src/state/corrective-replan-executor.js.map +1 -1
  33. package/dist/src/version.d.ts +1 -1
  34. package/dist/src/version.js +1 -1
  35. package/dist/src/version.js.map +1 -1
  36. package/dist/src/workflow.d.ts +40 -2
  37. package/dist/src/workflow.js +1440 -65
  38. package/dist/src/workflow.js.map +1 -1
  39. package/docs/autonomy-guardrails.md +91 -1
  40. package/docs/decisions.md +14 -0
  41. package/docs/delegated-approval.md +6 -1
  42. package/docs/development-flow.md +60 -5
  43. package/docs/pdf/codex-workflow-v2-architecture-ru.pdf +0 -0
  44. package/docs/pdf/codex-workflow-v2-chat-only-guide-ru.pdf +0 -0
  45. package/docs/pdf/codex-workflow-v2-technical-reference-ru.pdf +0 -0
  46. package/docs/pdf/sources/codex-workflow-v2-architecture-ru.md +97 -7
  47. package/docs/pdf/sources/codex-workflow-v2-chat-only-guide-ru.md +68 -9
  48. package/docs/pdf/sources/codex-workflow-v2-technical-reference-ru.md +150 -33
  49. package/docs/release.md +51 -8
  50. package/docs/updating-existing-project.md +155 -2
  51. package/docs/validation-report.md +101 -94
  52. package/package.json +7 -2
  53. package/plugins/codex-workflow-gateway/.codex-plugin/plugin.json +1 -1
  54. package/plugins/codex-workflow-gateway/references/protocol.md +69 -1
  55. package/plugins/codex-workflow-gateway/skills/codex-workflow-gateway/SKILL.md +156 -1
  56. package/schemas/authorization-event.schema.json +8 -1
  57. package/schemas/downstream-proof-invalidation-event.schema.json +71 -0
  58. package/schemas/downstream-proof-replan-recovery-event.schema.json +61 -0
  59. package/schemas/milestone-scope-change-event.schema.json +25 -1
  60. package/schemas/stop-escalate-override-event.schema.json +45 -0
  61. package/schemas/task.schema.json +104 -0
  62. package/scripts/generate-pdf-docs.py +13 -2
@@ -1,10 +1,10 @@
1
1
  ---
2
- title: Codex Workflow V2: технический справочник beta.12
2
+ title: Codex Workflow V2: технический справочник beta.12.10
3
3
  subtitle: Protocol 2, state schema 2, transactions, credentials, dependency authority, review и recovery
4
4
  part: Часть 3 из 3 | Technical reference
5
5
  document_version: 2.0
6
- date: 27 августа 2026
7
- subject: Технический контракт Codex Workflow V2 beta.12
6
+ date: 31 августа 2026
7
+ subject: Технический контракт Codex Workflow V2 beta.12.10
8
8
  ---
9
9
 
10
10
  # 1. Runtime contract
@@ -13,9 +13,9 @@ Workflow V2 предоставляет локальные revisioned transitions
13
13
  и `value` либо структурированную ошибку с `code`, `message` и `details`. Chat, PDF и gateway не создают
14
14
  authority сами: mutating permission определяется runtime state и свежим `next`.
15
15
 
16
- | Параметр beta.12 | Значение |
16
+ | Параметр beta.12.10 | Значение |
17
17
  |---|---|
18
- | npm package | `codex-workflow-v2@2.0.0-beta.12` |
18
+ | npm package | `codex-workflow-v2@2.0.0-beta.12.10` |
19
19
  | protocolVersion | 2 |
20
20
  | stateSchemaVersion | 2 |
21
21
  | lifecycle epoch | 2 |
@@ -37,16 +37,16 @@ Gateway выполняет:
37
37
  5. вызов только package-local `dist/src/cli.js --repo <root>`;
38
38
  6. `gateway handshake` до lifecycle действий.
39
39
 
40
- Ключевые beta.12 capabilities:
40
+ Ключевые beta.12.10 capabilities:
41
41
 
42
42
  | Группа | Capabilities |
43
43
  |---|---|
44
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 |
45
+ | Milestone | lifecycle, initial assembly navigation, autonomy, audited remediation topology, progress, dependency DAG, initial Plan transaction |
46
46
  | Task planning | Plan Risk Audit, proof obligations, mechanical feasibility |
47
- | C1 | handoff sidecar, handoff bundle, derived Worker actor, credential replacement |
47
+ | C1 | handoff sidecar/bundle, derived Worker actor, credential replacement, Human-gate lease release |
48
48
  | Reviews | strict reviewer, Step strict review, continuable remediation, evidence-bound fix/replan routing |
49
- | Recovery | dependency provenance, plan integrity, remediation mode, corrective yield/replan journals |
49
+ | Recovery | Task-local dependency provenance, historical Step provenance, plan integrity, downstream-proof predecessor invalidation, remediation mode, legacy stop override, append-only stop-rebind chain, corrective yield/replan journals |
50
50
  | Replacement | `structural-task-replacement-disabled-v1` |
51
51
 
52
52
  Handshake incompatibility прекращает работу. Запуск global package, `latest`, mutable range или соседней
@@ -65,7 +65,7 @@ $CODEX_HOME/workflow-state/v2/projects/<project-id>/
65
65
  tasks/<TASK-ID>/
66
66
  brief.md, plan.md, result.md, evidence.json, state.json
67
67
  .versions/
68
- authorization/review/remediation/corrective/handoff sidecars
68
+ authorization/review/remediation/corrective/stop-override/handoff sidecars
69
69
  milestones/<MS-ID>/
70
70
  plan.json, result.md, evidence.json, state.json
71
71
  .versions/ и scope/autonomy sidecars
@@ -235,7 +235,8 @@ Claim сверяет stored binding с current Milestone authority до lock acq
235
235
  3. Exact target actor вызывает `task claim` с one-time token.
236
236
  4. Claim выдаёт first-field `writerLeaseReceipt`.
237
237
  5. `task run` принимает token по `next.writerTokenContract`, heartbeats lease и возвращает refreshed receipt.
238
- 6. Terminal handback/release уничтожает active bearer material.
238
+ 6. `task result-set` consumes active token и освобождает lease до Human final-acceptance gate.
239
+ 7. После acceptance `writer-credential-replace` создаёт merge lease; terminal transitions освобождают его.
239
240
 
240
241
  Credential нельзя логировать, сохранять в chat packet или включать в evidence. `handoff-show` возвращает
241
242
  только safe persisted binding. Recovery использует отдельные advertised replacement actions.
@@ -249,7 +250,7 @@ Credential нельзя логировать, сохранять в chat packet
249
250
  | Worker return | Изменения uncommitted и только в allowedWrites |
250
251
  | Step complete | History, scope, checks, review gate, exact writer token |
251
252
  | Commit | Один Core-owned commit с Task/Step metadata |
252
- | Submit | Clean tree, Steps completed/skipped, recorded commits and evidence |
253
+ | Submit/Result | Exact evidence/review; Result освобождает lease до Human gate |
253
254
  | Merge | Fresh review/acceptance, base conditions, accepted HEAD |
254
255
 
255
256
  Local start повторно сравнивает authorized base внутри Git branch creation, закрывая TOCTOU между
@@ -291,7 +292,9 @@ Guarded Step имеет проверяемый, но не ограниченны
291
292
  | Finding `route=replan` с exact Plan conflict | `task plan-set`; меняются только implementation Steps |
292
293
  | `route=replan` без exact conflict | Невалидный review result, state не меняется |
293
294
  | Explicit `split-required` | Structural replacement stop |
294
- | Explicit `stop-escalate` | Terminal user attention |
295
+ | Exact beta.11 attempt-four `stop-escalate` | Append-only Human-confirmed compatibility override |
296
+ | Pre-execution `stop-escalate` + exact `auditedRemediation` route | Один additive upstream Task без нового Human gate |
297
+ | Любой другой explicit `stop-escalate` | Terminal user attention |
295
298
 
296
299
  Attempt count является диагностикой, а не lifecycle authority. Explicit corrective-decision journal
297
300
  сохраняется для намеренного stop/split и совместимого historical recovery, но не требуется после второй
@@ -315,6 +318,123 @@ fresh `next` через corrective yield и обычный Human-confirmed repla
315
318
  P01-A предотвращает поддерживаемые contradictions до fresh authorization. beta.11 path остаётся для
316
319
  pre-P01 authorizations и late/unsupported exact recovery cases.
317
320
 
321
+ # 13.1. beta.12.7 compatibility transitions
322
+
323
+ `update dependency-provenance-recover` больше не требует полного равенства Task manifest/lock с base.
324
+ Base остаётся version authority, а parent/HEAD candidate сравниваются без единственных Workflow
325
+ dependency entries. Поэтому recorded Task-local scripts сохраняются; payload drift того же candidate
326
+ commit по-прежнему блокируется.
327
+
328
+ `update downstream-proof-dependency-preflight/recover` — отдельная beta.12.6 совместимость для
329
+ active proof, который делает обычный clean update недостижимым. После exact dependency-only commits
330
+ на active base и Task branch preflight проверяет recorded history на `HEAD^`, candidate на `HEAD`,
331
+ aligned runtime/declared/locked/installed/current/base versions, отсутствие leases/transactions,
332
+ единственный active Step, transitive predecessor ownership и SHA-256 dirty product bytes. Recovery
333
+ добавляет только candidate в `systemCommits` и сохраняет binding в
334
+ `dependencyProvenanceRecoveries.activeDownstreamProof`; product work и Step state не меняются.
335
+ Fresh `next` затем приоритетно рекламирует `task downstream-proof-recover` до Knowledge refresh.
336
+
337
+ `update downstream-proof-replan-update-preflight` — read-only source gate для одного exact
338
+ beta.12.6 stranded shape после predecessor invalidation и ошибочного Knowledge rebind старого Plan.
339
+ Он требует точные source version surfaces, Task revision/status/rebind, preserved HEAD, dirty paths/hash
340
+ и отсутствие lease/transactions. После dependency-only transport
341
+ `update downstream-proof-replan-dependency-preflight/recover` валидирует parent на `HEAD^`, candidate
342
+ на `HEAD` и записывает `dependencyProvenanceRecoveries.downstreamProofReplan` без изменения product
343
+ bytes. `task downstream-proof-replan-recover` атомарно добавляет
344
+ `downstream-proof-replan-recoveries.jsonl`, supersede-ит execution authorization и возвращает Task в
345
+ `needs_fix`. Stale Knowledge refresh разрешён после repair, но не может заменить обязательный
346
+ `task plan-set`. Dirty carryover принимается `task run` только если один replacement Step владеет всем
347
+ set, а HEAD, paths и SHA-256 совпадают с recovery event.
348
+
349
+ `task stop-override-prepare/apply` обслуживает только exact beta.11 attempt-four policy stop. Prepare
350
+ не пишет state и создаёт binding по Task revision, Step, attempt-3 continue, attempt-4 stop, трём
351
+ remediation events, Plan, HEAD, package, human actor и reason. Apply в отдельном user turn добавляет
352
+ `stop-escalate-overrides.jsonl`. Original corrective decision остаётся неизменным. Split, stale binding,
353
+ lease/transaction, дубликат с другим binding и tampering fail closed.
354
+
355
+ После apply несколько delegated `task context-refresh` могут сделать source Plan историческим.
356
+ `task run` доступен, только если Core доказывает contiguous source-to-current chain: adjacent Plans
357
+ различаются лишь Knowledge binding, rebinds совпадают с artifacts, audits являются mechanical
358
+ rebounds, а current approval/authorization сохраняют одну delegated authority и chronology.
359
+
360
+ HEAD может отличаться от override только через зарегистрированные single-parent
361
+ `dependencyProvenanceRecoveries` в `systemCommits`, каждый с exact `package.json`/`package-lock.json`
362
+ diff. Semantic drift, иной commit или разрыв chain fail closed. Projection содержит
363
+ `stopOverrideContextRebind.state=validated`; lost lease восстанавливает только advertised
364
+ `task writer-credential-replace`.
365
+
366
+ Если recovery записан после последнего rebound audit, evidence-bound revision равен
367
+ `audit.taskRevision + 1 + postAuditVerifiedRecoveries.length`. В зачёт входят только ordered records
368
+ из уже проверенной override-to-authorization Git chain. Формула должна точно равняться current Task
369
+ revision; unrelated write, duplicate, неверный parent или product commit блокируют continuation.
370
+
371
+ # 13.2. Downstream-proof predecessor recovery
372
+
373
+ Если active Step изменяет только собственный proof artifact, обычный `task step-complete` сохраняется.
374
+ Если dirty set дополнительно содержит файлы completed transitive predecessor, Core проверяет branch,
375
+ зарегистрированную Git history, dependency closure и ownership каждого такого файла. При точном совпадении
376
+ fresh `next` рекламирует lease-bound `task downstream-proof-recover` вместо заведомо невозможного commit.
377
+
378
+ Одна project transaction сохраняет worktree и HEAD, append-only записывает
379
+ `downstream-proof-invalidations.jsonl`, переносит invalidated completion commits в `invalidatedStepCommits`, очищает
380
+ их Step evidence, блокирует proof Step, supersede execution authorization, yield C1 и удаляет lease.
381
+ Следующий action — обычный `task plan-set` той же Task. Replacement Plan обязан заново охватить unfinished
382
+ remainder и пройти fresh Plan Risk Audit и execution authorization. Unrelated/non-predecessor file,
383
+ strict-review evidence, unregistered commit, branch mismatch или damaged sidecar возвращают `doctor`.
384
+
385
+ # 13.3. beta.12.9 historical Step provenance
386
+
387
+ Corrective replan теперь сохраняет evidence commits Steps, исключённых replacement Plan, в
388
+ `invalidatedStepCommits`. Это предотвращает новый unregistered-history blocker без переноса завершённого
389
+ Step в новый Plan.
390
+
391
+ Для уже существующего stranded state fresh `next` допускает только один из двух bounded routes:
392
+
393
+ - `task historical-step-provenance-preflight/recover`, если beta.12.9 dependency HEAD уже зарегистрирован;
394
+ - `update historical-step-dependency-preflight/recover`, если dependency-only beta.12.9 commit ещё
395
+ является единственным unregistered HEAD.
396
+
397
+ Core требует один active Step, dirty paths только в его `allowedWrites`, отсутствие leases/transactions,
398
+ ровно один omitted product commit, полный hash-valid strict Step Review с `passed`, verified reviewer
399
+ attestation и прежний hash-bound `final_acceptance` того же Plan. Update-route дополнительно связывает
400
+ exact `HEAD^`/`HEAD`, package/version surfaces и SHA-256 dirty worktree. Recovery не переписывает Git,
401
+ не меняет product bytes и не возвращает старый Step в Plan; он записывает historical authority и, для
402
+ update-route, dependency provenance в одной Task revision. Fresh `status -> next` после transition
403
+ должен вернуть обычный credential/`task step-complete` flow текущего Step.
404
+
405
+ # 13.4. beta.12.10 audited remediation topology
406
+
407
+ `milestone remediation-materialize` применим только к required Task в
408
+ `awaiting_execution_authorization`, если ни один Step не начат и последний audit текущей
409
+ Task revision/Brief/Plan имеет decision `stop-escalate`. Нужны active Milestone на clean base,
410
+ coherent idle observation boundary, current Milestone execution authorization и ready Discovery.
411
+
412
+ Input не содержит Milestone Plan или actor:
413
+
414
+ ```json
415
+ {
416
+ "discoveryId": "DISC-...",
417
+ "expectedDiscoveryRevision": 1,
418
+ "title": "Restore upstream capability",
419
+ "predecessorTaskIds": ["TASK-..."]
420
+ }
421
+ ```
422
+
423
+ `predecessorTaskIds` обязан точно совпасть с direct predecessor frontier blocked Task; каждый такой
424
+ Task required и merged. Одна Project transaction пишет consumed Discovery, Brief/state нового Task,
425
+ новый `plan.json`, `scope-change-events.jsonl` и Milestone state. Event mode
426
+ `audited-remediation` связывает blocked Task/revision, Brief/Plan hashes, audit ID/hash, remediation
427
+ Task и predecessor IDs. Milestone semantic fields и прежние memberships неизменны; добавляются
428
+ только один required Task и одна dependency edge blocked -> remediation. Повтор audit запрещён.
429
+
430
+ Current Milestone execution authorization superseded и заменён `corrective-derived`, evidenceHash
431
+ связывает source Plan/authorization mode, audit hash и remediation evidence. Repository `next`
432
+ приоритизирует remediation Task. Для current required Tasks оно выдаёт
433
+ `correctiveDerivedApproval` для `task authorize`/`task accept`; actor фиксирован как
434
+ `agent:milestone-remediation:<MS-ID>`, human approval и delegation grant не нужны. Plan Risk Audit,
435
+ mechanical feasibility, C1, Step checks/commits/reviews и final Milestone acceptance не меняются.
436
+ После merge remediation Task исходная Task получает `task plan-set` и проходит fresh audit/authority.
437
+
318
438
  # 14. P04-A structural replacement boundary
319
439
 
320
440
  Command shape `task replacement-materialize` retained только для compatibility diagnostics. Любая попытка
@@ -369,25 +489,30 @@ Graph является навигационным индексом, не Project
369
489
  | `GIT_PRECONDITION_FAILED` | Branch/base/clean/history mismatch | Штатная Git recovery/sync route |
370
490
  | `COMMAND_FAILED` | Git/check/provider process failed | Сохранить evidence и устранить concrete cause |
371
491
 
492
+ Docker socket/CLI `EPERM`, `operation not permitted` или `permission denied` внутри sandbox классифицируется
493
+ как execution-boundary access, не как `COMMAND_FAILED` daemon. Exact read-only probe или Plan check один раз
494
+ повторяется с escalation и не расходует remediation/infra retry. Restart Docker Desktop или image mutation
495
+ без отдельного разрешения запрещены; daemon failure подтверждает только escalated invocation.
496
+
372
497
  После каждой successful mutation обязателен sequential `status`, затем fresh `next`. Failed status/next
373
498
  не разрешает direct mutation. Syntax help read-only и не заменяет navigation authority.
374
499
 
375
- # 18. Public command surface beta.12
500
+ # 18. Public command surface beta.12.10
376
501
 
377
502
  | Область | Actions |
378
503
  |---|---|
379
504
  | System | `doctor`, `status`, `next`, `gateway handshake`, `locks` |
380
- | Update | `preflight`, `rescue-preflight`, `dependency-provenance-preflight/recover` |
505
+ | Update | `preflight`, `rescue-preflight`, dependency provenance, historical-Step dependency bridge, downstream-proof dependency bridge, downstream-proof replan update/dependency bridge |
381
506
  | Project memory | `scan`, `show`, `status`, `approve`, `reconcile` |
382
507
  | Delegation | `prepare`, `grant`, `list`, `show`, `revoke` |
383
508
  | Graph | `prepare`, `status`, `refresh-request`, `bind`, `fallback` |
384
509
  | Discovery | `start`, `update`, `show`, `materialize` |
385
- | Milestone | `recover`, `show`, `progress`, `plan-set`, scope-change, autonomy, `authorize`, `validate`, `accept`, `cancel` |
510
+ | Milestone | `recover`, `show`, `progress`, `plan-set`, `remediation-materialize`, scope-change, autonomy, `authorize`, `validate`, `accept`, `cancel` |
386
511
  | Task planning | `show`, `plan-set`, `knowledge-rebind`, `context-refresh`, `authorize`, `plan-risk-audit` |
387
512
  | Task execution | `start`, `run`, `step-complete`, `submit`, `result-set`, `accept`, `sync-base`, `merge`, `merge-confirm` |
388
513
  | C1 | `handoff[-prepare/-replace/-show]`, `claim`, `writer-credential-replace`, `handback[-create]` |
389
514
  | Review | review/step-review packet, launch, sealed record и record actions |
390
- | Corrective | decision/recovery, plan-integrity, remediation-mode, yield и corrective-replan actions |
515
+ | Corrective | decision/recovery, plan-integrity, historical-step-provenance preflight/recover, downstream-proof-recover/replan-recover, remediation-mode, stop-override prepare/apply, yield и corrective-replan actions |
391
516
  | Replacement | `replacement-materialize` retained, но всегда disabled в P04-A |
392
517
 
393
518
  Exact options берутся из fresh `next`; command help используется только когда
@@ -396,19 +521,11 @@ Exact options берутся из fresh `next`; command help используе
396
521
  # 19. Release и package update gates
397
522
 
398
523
  Перед package update project-local `update preflight` должен вернуть `safe=true`: clean checkout, нет
399
- running Step и active/stale writer lease. External runner допустим только в документированной rescue
400
- compatibility форме.
401
-
402
- Перед beta.12 tag release repository выполняет:
403
-
404
- 1. `npm ci`;
405
- 2. `npm run validate`;
406
- 3. `npm run pack:check`;
407
- 4. `npm run smoke:downstream`;
408
- 5. `npm run plugin:check` и official plugin/skill validators;
409
- 6. `npm run docs:pdf:check`;
410
- 7. `npm run release:check` с exact release tag binding;
411
- 8. validation append-only real-agent lifecycle log.
412
-
413
- PDF source и binaries должны совпасть детерминированно. Tag имеет форму `v<package-version>`.
414
- Publication не выполняется локальными validation commands.
524
+ running Step и active/stale writer lease. Исключения — документированный alpha.7 rescue, beta.12.6
525
+ active-downstream-proof bridge, beta.12.7 exact stranded-replan bridge и beta.12.9 historical-Step
526
+ dependency bridge; все они fail-closed и не дают общего разрешения dirty update.
527
+
528
+ Перед beta.12.10 tag обязательны `npm ci`, `npm run validate`, `npm run test:signal-remediation-e2e`, `npm run pack:check`,
529
+ `npm run smoke:downstream`, `npm run plugin:check`, official plugin/skill validators,
530
+ `npm run docs:pdf:check`, `npm run release:check` с exact tag binding и validation
531
+ append-only real-agent lifecycle log.
package/docs/release.md CHANGED
@@ -10,13 +10,14 @@ Before tagging a release:
10
10
 
11
11
  1. `npm ci`
12
12
  2. `npm run validate`
13
- 3. `npm run pack:check`
14
- 4. `npm run smoke:downstream`
15
- 5. `npm run plugin:check`
16
- 6. `npm run docs:pdf:check`
17
- 7. `npm run release:check`
18
- 8. validate `plugins/codex-workflow-gateway` with the Codex plugin validator
19
- 9. validate the append-only real-agent log with
13
+ 3. `npm run test:signal-remediation-e2e`
14
+ 4. `npm run pack:check`
15
+ 5. `npm run smoke:downstream`
16
+ 6. `npm run plugin:check`
17
+ 7. `npm run docs:pdf:check`
18
+ 8. `npm run release:check`
19
+ 9. validate `plugins/codex-workflow-gateway` with the Codex plugin validator
20
+ 10. validate the append-only real-agent log with
20
21
  `node scripts/validate-lifecycle-transcript.mjs --file <lifecycle-log.jsonl>`
21
22
 
22
23
  The downstream smoke packs the actual tarball, installs it into an empty temporary project,
@@ -27,7 +28,7 @@ The PDF check deterministically regenerates all three Russian documents from
27
28
  `docs/pdf/sources`, binds the visible package version to the root manifest, and fails when any
28
29
  tracked PDF is stale. Source and binary PDFs are one release unit.
29
30
 
30
- For beta.12, the release gate also relies on `npm run release:check` to fail if:
31
+ For beta.12.10, the release gate also relies on `npm run release:check` to fail if:
31
32
 
32
33
  - canonical entity schema 2 shapes drift;
33
34
  - protocol 2 is not the active public contract, or intact protocol-1 adoption evidence stops being readable through the bounded compatibility window;
@@ -42,16 +43,58 @@ For beta.12, the release gate also relies on `npm run release:check` to fail if:
42
43
  explicit recovery, or dual-readback capabilities are absent from the packaged surface.
43
44
  - scoped Task navigation, credential replacement recovery, or sealed external Task/Step review
44
45
  commands are absent from the packaged surface.
46
+ - `task result-set` can enter the unbounded Human final-acceptance gate without consuming a live
47
+ writer credential and releasing its lease, or claimed Task E2E cannot reacquire a fresh merge credential.
45
48
  - bounded dependency-provenance recovery, retained passed-review provenance, the exact Signal T04
46
49
  revision-26 fixture, or pending/corrupt-review rejection regressions are absent.
50
+ - dependency recovery again requires Task-local manifest/lock fields to equal the Milestone base,
51
+ or a candidate commit can alter any non-Workflow dependency payload.
52
+ - corrective replan drops completed Step evidence from accepted Task history, or an already-stranded
53
+ Task can register arbitrary/unreviewed history instead of one exact passed and previously accepted
54
+ Step commit.
55
+ - beta.12.9 cannot install through an exact dependency-only base/Task transport while preserving the
56
+ active Step worktree, or that compatibility route fails to bind the dependency HEAD, historical
57
+ commit, current Plan/Step, dirty paths/content hash, and absence of leases/transactions.
47
58
  - the read-only Milestone progress projection, replacement regression, project-monotonic chat
48
59
  registry, title fallback/readback, or long-Cyrillic multi-attempt E2E evidence is absent.
49
60
  - bounded first-failure Plan-integrity recovery, exact failed-remediation/manifest/worktree
50
61
  bindings, or the no-synthetic-second-failure regression is absent.
62
+ - downstream proof cannot invalidate only completed transitive-predecessor authority while
63
+ preserving worktree/HEAD, yielding C1, and returning the same Task to fresh planning; or unrelated
64
+ dirty files and damaged invalidation evidence do not fail closed.
65
+ - an eligible active downstream proof cannot transport one exact dependency-only update across
66
+ aligned base/Task commits while preserving product bytes; or unknown history, unrelated dirty
67
+ scope, content drift within an observation, leases, transactions, and wider candidates do not
68
+ fail closed before provenance registration and ordinary downstream recovery.
69
+ - the exact beta.12.6 post-invalidation Knowledge-rebind shape cannot pass a read-only source gate,
70
+ transport beta.12.7 through dependency-only commits, register provenance, restore `needs_fix`,
71
+ survive required Knowledge refresh, and reach a fresh replacement Plan;
72
+ - preserved dirty bytes can execute without one Step owning the complete bound set, or HEAD/path/hash
73
+ drift is accepted; or the Signal-shaped E2E stops before checks, Core commit, strict Step review,
74
+ and fresh navigation to Task submission.
75
+ - bundled gateway guidance treats Docker socket `EPERM` as daemon failure, consumes a remediation
76
+ attempt before one exact escalated probe, or recommends restarting Docker Desktop without separate
77
+ authority.
51
78
  - the P04-A Milestone dependency/initial-Plan transaction capabilities or the P01-A mechanical
52
79
  feasibility capability is absent from the packaged handshake.
53
80
  - continuable guarded remediation or evidence-bound `fix`/`replan` review routing is absent, or a
54
81
  third/later failed review is again converted into an attempt-count stop.
82
+ - audited remediation can change Milestone outcome/success signal/acceptance/checks, omit or add
83
+ arbitrary predecessor authority, reuse one blocking audit, run with dirty/owned state, or stop
84
+ before the new Task merges and the original Task completes a subsequent Step.
85
+ - `corrective-derived` Task authorization/final acceptance can exist without the current exact
86
+ Milestone execution authorization and audited-remediation event, or final Milestone acceptance is
87
+ derived automatically.
88
+ - the append-only, Human-confirmed beta.11 attempt-four stop override, its exact three-event/
89
+ continue/stop binding, split rejection, stale-confirmation rejection, or tamper detection is
90
+ absent from the package.
91
+ - an already-applied beta.11 stop override cannot survive a contiguous append-only chain of later
92
+ context-only Plan rebinds with exact mechanical audits, delegation, and chronology;
93
+ - Git HEAD may advance between the override and current execution authorization through anything
94
+ except an exact chain of registered dependency-provenance commits that each change only
95
+ `package.json` and `package-lock.json`; or the route weakens the generic stale-decision recovery gate.
96
+ - a dependency-provenance recovery recorded after the final mechanical audit cannot explain its
97
+ exact single Task revision, or an unrelated revision/damaged provenance is accepted as authority.
55
98
 
56
99
  The separate lifecycle transcript validator fails if the real-agent log contains a mutation that
57
100
  bypasses failed `status`/`next`, an unadvertised or failed mutation, an unresolved syntax-only
@@ -22,6 +22,24 @@ state schema. Совпадение `stateSchemaVersion` до и после об
22
22
  нужна. Для alpha.6 при `stateSchemaVersion: 2` применяется не migration, а sidecar-only
23
23
  adoption posture.
24
24
 
25
+ ### beta.12.10: audited remediation вместо ручной смены Milestone scope
26
+
27
+ После безопасного обновления существующий active Milestone может продолжить работу без пересоздания,
28
+ если current `next` показывает pre-execution `stop-escalate` и объект `auditedRemediation`. Это не
29
+ update compatibility bridge и не разрешение вручную менять state. Сначала выполните обычный
30
+ `update preflight`; установите exact beta.12.10 только при `safe=true`, clean checkout, отсутствии
31
+ running Step и leases, затем снова выполните repository-local handshake, `status` и `next`.
32
+
33
+ Далее следуйте только свежему route: remediation Discovery -> ready ->
34
+ `milestone remediation-materialize`. Передайте exact Milestone/Task revisions и JSON с Discovery,
35
+ title и `predecessorTaskIds`, которые полностью совпадают с
36
+ `next.auditedRemediation.requiredPredecessorTaskIds`. Переход не принимает confirmation code,
37
+ actor, grant или новый Milestone Plan. После atomic materialization новый required Task должен стать
38
+ repository priority и пройти обычную реализацию/review/merge. Его Task approval transitions используют
39
+ только exact `correctiveDerivedApproval.actor` из fresh `next`. После merge исходная Task обязана
40
+ вернуться к `task plan-set`, fresh Risk Audit и следующему Step. Если fresh `next` не рекламирует этот
41
+ контракт, не вызывайте команды напрямую и не редактируйте Milestone state.
42
+
25
43
  ### Исключение для lifecycle-дедлока alpha.6
26
44
 
27
45
  Обычный `update preflight` намеренно блокирует обновление при `in_progress` Step. Если alpha.6
@@ -52,10 +70,145 @@ commit остался в Git между `baseCommit` и новым dependency-on
52
70
  него обязательны последовательные `status` и `next`; выполняйте возвращённый Knowledge reconcile
53
71
  или `task context-refresh`, если manifest/lock сделали Knowledge Map stale.
54
72
 
73
+ В beta.12.1 preflight сравнивает parent и candidate после удаления только записей зависимости
74
+ `codex-workflow-v2`. Поэтому ранее закоммиченные Task-local scripts и другие product-owned поля
75
+ `package.json`/lockfile могут отличаться от Milestone base и сохраняются. Это не ослабляет сам
76
+ candidate: его HEAD обязан менять ровно `package.json` и `package-lock.json`, только точную Workflow
77
+ dependency; любое другое поле, добавленное тем же candidate commit, неизвестный commit, stale base,
78
+ dirty checkout, lease или transaction по-прежнему блокируют recovery.
79
+
80
+ ### Исключение beta.12.9 для Step commit, потерянного corrective Plan
81
+
82
+ Если активный corrective Step сохраняет допустимый dirty worktree, а `task step-complete` обнаруживает
83
+ ровно один старый product commit, beta.12.9 не требует переписывать Git. Пакет поддерживает два
84
+ строго ограниченных входа в один и тот же recovery:
85
+
86
+ - если beta.12.9 уже зарегистрирована, свежий `next` рекламирует
87
+ `task historical-step-provenance-recover`;
88
+ - если для установки beta.12.9 на Milestone base и Task branch уже созданы ровно dependency-only
89
+ commits, свежий `next` рекламирует `update historical-step-dependency-recover`. Этот переход
90
+ атомарно регистрирует новый dependency HEAD и сохраняет authority старого Step commit.
91
+
92
+ В обоих случаях Core сам доказывает для старого SHA полную hash-valid strict Step Review цепочку с
93
+ решением `passed`, verified reviewer isolation и совпадающий прежний `final_acceptance`. Update-route
94
+ дополнительно требует exact target version на declared/locked/installed/current-branch/base surfaces,
95
+ dependency commit только из `package.json` и `package-lock.json`, а также неизменный hash активного
96
+ dirty worktree относительно read-only assessment.
97
+
98
+ Сначала выполните read-only `task historical-step-provenance-preflight --id <TASK-ID>`. Продолжайте
99
+ только при `eligible=true`, точных Task revision, Plan/Brief/HEAD и commit SHA, отсутствии leases,
100
+ transactions и Core operations, а также dirty paths строго внутри `allowedWrites` единственного
101
+ активного Step. Recover принимает exact SHA, actor и содержательную reason, добавляет SHA в
102
+ `invalidatedStepCommits` и записывает источник прежнего acceptance. Product bytes, HEAD и текущий
103
+ Plan не меняются; старый Step не возвращается в Plan. После recovery обязательны последовательные
104
+ `status` и `next`, затем обычный credential route и `task step-complete` текущего Step.
105
+
106
+ Несколько unknown commits, pending/failed review, несовпадающий Plan прежнего acceptance,
107
+ повреждённый sidecar, посторонний dirty path или lease являются hard stop. Запрещено заменять этот
108
+ переход rebase/reset/amend, ручным `systemCommits` или переносом старого Step в текущий Plan.
109
+
110
+ ### Исключение beta.12.6 для активного downstream proof
111
+
112
+ Обычный `update preflight` по-прежнему правильно запрещает обновление при running Step и dirty
113
+ checkout. Но если dirty set уже является подтверждаемым конфликтом между активным proof Step и
114
+ completed transitive predecessor, ожидание чистой границы создаёт цикл: штатный recovery существует
115
+ только в новой версии, а установить её до recovery нельзя. beta.12.6 разрешает только этот exact
116
+ bootstrap и не ослабляет общий preflight.
117
+
118
+ Сначала убедитесь, что нет active/stale writer lease, pending/corrupt transaction и Core operation.
119
+ Не stash/reset/commit product files и не завершайте Step вручную. В отдельном временном worktree
120
+ обновите active Milestone base до точной beta.12.6 и создайте commit только с `package.json` и
121
+ `package-lock.json`. Затем в текущей Task branch установите ту же точную версию и создайте второй
122
+ commit только из этих двух файлов, оставив существующий product dirty set неизменным. Не merge и
123
+ не переносите product commits между ветками.
124
+
125
+ Fresh project-local beta.12.6 `next` обязан вернуть
126
+ `update downstream-proof-dependency-recover`. Выполните read-only
127
+ `update downstream-proof-dependency-preflight --id <TASK-ID>` и продолжайте только при
128
+ `eligible=true`, пустом `blockers`, ожидаемых `HEAD`/`HEAD^`, exact Task revision и непустом
129
+ `activeDownstreamProof`. Binding включает current Plan, единственный active Step, все dirty paths,
130
+ SHA-256 их содержимого и completed predecessor Steps, чья authority будет инвалидирована позже.
131
+ После advertised recover повторите `status -> next`: ожидается `task downstream-proof-recover`,
132
+ который имеет приоритет над Knowledge refresh, вызванным manifest/lock commit. Только после него
133
+ выполняются новый Plan, Risk Audit, authorization и возвращённые `next` Knowledge actions.
134
+
135
+ Read-only preflight является наблюдением, а не confirmation token: recover заново вычисляет и
136
+ записывает binding текущего dirty content. Поэтому изменение допустимого product content до
137
+ recover создаёт другой hash, который нужно сверить в ответе. После recover этот hash остаётся
138
+ аудит-доказательством сохранённых bridge bytes; downstream-proof заново проверяет текущие paths,
139
+ ownership и history, а новый Plan и review оценивают текущий content. Путь fail-closed при unrelated dirty path,
140
+ неизвестном commit до candidate, candidate шире двух dependency-файлов, stale Milestone base,
141
+ version divergence, branch/Plan/Step mismatch, lease или transaction. В этом случае не правьте
142
+ `systemCommits` или внешний state вручную.
143
+
144
+ ### Исключение beta.12.7 для stranded downstream replan
145
+
146
+ Это исключение применимо только если beta.12.6 уже записала downstream-proof invalidation, а затем
147
+ Project Knowledge approval ошибочно rebound-нул отвергнутый Plan и вернул Task в
148
+ `awaiting_execution_authorization`. До изменения dependency запустите beta.12.7 source/runtime
149
+ read-only `update downstream-proof-replan-update-preflight --id <TASK-ID>`. Требуются
150
+ `eligible=true`, source version `2.0.0-beta.12.6`, exact Task revision/branch/base/HEAD, неизменные
151
+ dirty paths/content hash и пустые blockers.
152
+
153
+ Затем тем же двухкоммитным способом обновите active base и Task branch только в `package.json` и
154
+ `package-lock.json`, установите exact beta.12.7 и следуйте fresh `next`. Допустимая цепочка:
155
+ `update downstream-proof-replan-dependency-preflight` ->
156
+ `update downstream-proof-replan-dependency-recover` ->
157
+ `task downstream-proof-replan-recover`. После repair manifest change обычно делает Project Knowledge
158
+ stale: выполните рекламируемые reconcile/approve, но не `task knowledge-rebind` старого Plan. Fresh
159
+ `next` обязан вернуть `task plan-set`.
160
+
161
+ Новый Plan должен заново классифицировать весь unfinished remainder. Сохранённые dirty bytes не
162
+ становятся completed evidence и не коммитятся административным recovery. Они могут быть приняты
163
+ только одним planned Step, `allowedWrites` которого точно покрывает весь dirty set. Перед `task run`
164
+ fresh `next` обязан показать `downstreamProofCarryover.state=validated`; после run обязательны checks,
165
+ Core-owned Step commit и strict review, если Step guarded. Изменение content/path/HEAD, дополнительная
166
+ Task revision, audit/authorization старого Plan, lease или transaction блокируют исключение.
167
+
168
+ ### Исключение beta.12.1 для beta.11 attempt-four stop
169
+
170
+ Если beta.11 записал `stop-escalate` перед четвёртой попыткой только после последовательности
171
+ `ordinary`, `ordinary`, `corrective`, и перед третьей попыткой уже существовал exact
172
+ `continue-fix`, fresh `next` может вернуть `task stop-override-prepare`. Не создавайте новый
173
+ Milestone и не редактируйте sidecar вручную. Сначала выполните только read-only prepare с exact
174
+ Task revision, Step, human actor и содержательной причиной. Проверьте, что ответ связывает тот же
175
+ stop decision, Plan hash, Git HEAD, все три remediation events и policy
176
+ `beta11-attempt4-stop-compatibility-v1`, затем остановитесь перед Human gate.
177
+
178
+ В отдельном пользовательском сообщении разрешите apply с теми же параметрами и возвращённым
179
+ `SOO-*` кодом. `task stop-override-apply` добавляет одну запись в
180
+ `stop-escalate-overrides.jsonl`, сохраняя исходный `stop-escalate`; после него выполните
181
+ последовательные `status` и `next`. Обычно ожидаемый route — `task run` того же Step с последующим
182
+ новым strict review. Beta.12.4 покрывает и последовательность package self-update/context-refresh
183
+ циклов после override. Перед `task run` выполняйте только свежие advertised
184
+ `update dependency-provenance-recover` и delegated `task context-refresh`; циклов может быть
185
+ несколько. Workflow продолжит attempt 4 лишь когда докажет contiguous source-to-current chain:
186
+ каждый Plan отличается только canonical Knowledge Map binding, каждый rebind совпадает с Plan
187
+ artifacts, каждый Plan Risk Audit является mechanical rebound, а current approval/authorization
188
+ сохраняют одну delegated authority. HEAD может продвинуться только через зарегистрированные
189
+ single-parent dependency-provenance commits, каждый с exact `package.json`/`package-lock.json` diff.
190
+ Новая stop-override recovery-запись не создаётся — используется существующая append-only evidence.
191
+ Если advertised navigation сначала завершила последний `task context-refresh`, а затем разрешила
192
+ `update dependency-provenance-recover`, административный recovery может объяснить ровно один
193
+ post-audit Task revision. Core принимает его только как часть уже проверенной dependency-only Git
194
+ chain; арифметика audit revision + refresh boundary + exact post-audit recoveries должна точно
195
+ равняться current Task revision. Любой необъяснённый revision остаётся blocker.
196
+ Если C1 остаётся claimed, но writer lease после Human boundary отсутствует, `next` вместе с
197
+ `task run` рекламирует `task writer-credential-replace`; сначала восстановите credential exact
198
+ claimant-актора, затем запускайте Step.
199
+
200
+ Этот путь не работает для `split-required`, другого attempt ordinal, семантически изменённого
201
+ Plan, отсутствующего attempt-3 continue, разорванной rebind/audit chain, незарегистрированного или
202
+ product HEAD commit, повреждённой chronology, active/stale lease на Human prepare/apply boundary
203
+ или незавершённой Task transaction.
204
+ Delegated approval для самого stop override отсутствует; delegation относится только к обычному
205
+ context refresh после уже подтверждённого Human override.
206
+
55
207
  ## 1. Подготовьте отдельный чат обновления
56
208
 
57
- Не обновляйте пакет во время выполняющегося Worker Step. Дождитесь завершения текущего ответа
58
- Codex и откройте в нужном проекте отдельный чат `Workflow update`.
209
+ Не обновляйте пакет во время выполняющегося Worker Step, кроме exact beta.12.6 downstream-proof
210
+ исключения выше. В обычном случае дождитесь завершения текущего ответа Codex и откройте в нужном
211
+ проекте отдельный чат `Workflow update`.
59
212
 
60
213
  Передайте агенту этот промпт, заменив `<НОВАЯ_ВЕРСИЯ>` точной опубликованной версией:
61
214