codex-workflow-v2 2.0.0-alpha.7.2 → 2.0.0-alpha.7.2.1

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.
@@ -0,0 +1,86 @@
1
+ # Codex Workflow V2 2.0.0-alpha.7.2.1 — remediation recovery brief
2
+
3
+ ## Source and scope
4
+
5
+ Source release: `v2.0.0-alpha.7.2` at
6
+ `1d5b09f0116ea241b9b5f71c0fa3320ac4318891`.
7
+
8
+ This is a narrow lifecycle patch. It does not change product scope, Milestone
9
+ semantics, the three-attempt guarded-review limit, or historical events in
10
+ place. `signal_v4` is read-only evidence and must be replayed only from a copy
11
+ of its workflow state.
12
+
13
+ ## Reproduced defects
14
+
15
+ ### D1 — recovered third attempt is recorded as ordinary
16
+
17
+ After two ordinary failures, an authorized `continue-fix`, a Knowledge-only
18
+ Plan rebind, and alpha.7.2 corrective recovery, `task run` correctly permits
19
+ attempt ordinal 3. If that run later fails checks or strict review, the failure
20
+ writer loses the recovery binding and appends remediation ordinal 3 with
21
+ `mode=ordinary`. The same Core then rejects its own event as `STATE_CORRUPT`.
22
+
23
+ Exact production evidence:
24
+
25
+ - Task `TASK-01M00W190K3V3HM68Q3QVSH1AY`;
26
+ - Step `STEP-002-FORMALIZATION-CONTRACTS`;
27
+ - corrective decision `CRD-01M011B4MM5R1FZG2DSDRHVXJ4`;
28
+ - recovery `CDR-01M01ST9ENGH4F3W5TRJ9EC53C`;
29
+ - malformed remediation `RME-01M01TBQ4P5KR24J51WTMT79DY`;
30
+ - ordinal `3`, stored mode `ordinary`, required effective mode `corrective`.
31
+
32
+ ### D2 — `next` advertises an impossible context refresh
33
+
34
+ With an active Step and Knowledge drift from its uncommitted allowed writes,
35
+ `next` may advertise delegated `task context-refresh`, while the transition
36
+ correctly rejects any refresh during `Step=in_progress`. The truthful action is
37
+ the active Step action (`task step-complete`, then strict review). Knowledge
38
+ refresh follows only after the Step becomes terminal.
39
+
40
+ ## Required behavior
41
+
42
+ 1. Every guarded failure writer (`checks-failed`, `review-failed`, and
43
+ `review-unverified`, including retry/idempotence paths) must preserve the
44
+ exact validated corrective-recovery binding and record ordinal 3 as
45
+ `corrective`.
46
+ 2. Alpha.7.2 legacy state with exactly the D1 shape must have one explicit,
47
+ append-only recovery transition. The original remediation event and its
48
+ hash chain remain byte-for-byte unchanged.
49
+ 3. The recovery event binds the exact Task, Step, Task revision, malformed
50
+ remediation ID/hash, corrective decision ID/hash, corrective recovery
51
+ ID/hash, ordinal, Plan hash, actor, and mode correction
52
+ `ordinary -> corrective`.
53
+ 4. Recovery validation and authority checks occur before the first write.
54
+ Failure is non-mutating; identical retry is idempotent; conflicting or
55
+ duplicate recovery fails closed.
56
+ 5. After recovery, `next` must expose the existing guarded hard stop with only
57
+ `split-required` and `stop-escalate`. A fourth remediation run remains
58
+ prohibited.
59
+ 6. Any other ordinal, mode, decision, Plan, event-chain, review evidence,
60
+ recovery evidence, actor/token, Task/Step status, or duplicate shape is not
61
+ recoverable.
62
+ 7. While a Step is active, `next` must return its executable Step action and
63
+ must not advertise `task context-refresh` or standalone Project Knowledge
64
+ work that the exact transition ordering rejects.
65
+
66
+ ## Deterministic evidence
67
+
68
+ - Future path: two failures → recovered continue-fix → run → failed checks and
69
+ failed/unverified strict-review variants → ordinal 3 is corrective. Failed
70
+ checks/review reach hard stop; unverified isolation permits only strict-review
71
+ retry for the same completion commit and never another run.
72
+ - Legacy path: copy exact malformed alpha.7.2 state → `next` advertises the
73
+ explicit recovery → recovery append → identical retry is idempotent →
74
+ original files unchanged except the new recovery sidecar → `next` advertises
75
+ hard stop, never `task run`.
76
+ - Negative cases cover mismatched IDs/hashes/revision/actor/token, missing or
77
+ ambiguous recovery, broken event chains, non-ordinal-3 events, and repeated
78
+ conflicting recovery.
79
+ - Navigation parity: active Step plus eligible Knowledge drift returns
80
+ `task step-complete`; after completion it returns strict review before any
81
+ context refresh.
82
+
83
+ ## Release boundary
84
+
85
+ Stop after full deterministic validation, exact disposable `signal_v4` replay,
86
+ and self-review. Do not tag, push, publish, or mutate `signal_v4`.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "codex-workflow-v2",
3
- "version": "2.0.0-alpha.7.2",
3
+ "version": "2.0.0-alpha.7.2.1",
4
4
  "description": "Requirements-first Codex development workflow with local state and explicit Git ownership.",
5
5
  "repository": {
6
6
  "type": "git",
@@ -0,0 +1,42 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://codex-workflow.local/schemas/remediation-mode-recovery-event.schema.json",
4
+ "title": "Codex Workflow V2 Remediation Mode Recovery Event",
5
+ "type": "object",
6
+ "additionalProperties": false,
7
+ "required": [
8
+ "eventId", "taskId", "stepId", "taskRevision", "remediationEventId",
9
+ "remediationEventHash", "correctiveDecisionEventId", "correctiveDecisionEventHash",
10
+ "correctiveDecisionRecoveryEventId", "correctiveDecisionRecoveryEventHash",
11
+ "attemptOrdinal", "planHash", "actor", "c1ClaimEventHash",
12
+ "writerLeaseTokenHash", "fromMode", "toMode", "reason",
13
+ "previousEventHash", "recordedAt", "eventHash"
14
+ ],
15
+ "properties": {
16
+ "eventId": { "type": "string", "pattern": "^RMR-[0-9A-HJKMNP-TV-Z]{26}$" },
17
+ "taskId": { "type": "string", "pattern": "^TASK-[0-9A-HJKMNP-TV-Z]{26}$" },
18
+ "stepId": { "type": "string", "pattern": "^STEP-[0-9]{3}(?:-[A-Z0-9-]+)?$" },
19
+ "taskRevision": { "type": "integer", "minimum": 1 },
20
+ "remediationEventId": { "type": "string", "pattern": "^RME-[0-9A-HJKMNP-TV-Z]{26}$" },
21
+ "remediationEventHash": { "$ref": "#/$defs/hash64" },
22
+ "correctiveDecisionEventId": { "type": "string", "pattern": "^CRD-[0-9A-HJKMNP-TV-Z]{26}$" },
23
+ "correctiveDecisionEventHash": { "$ref": "#/$defs/hash64" },
24
+ "correctiveDecisionRecoveryEventId": { "type": "string", "pattern": "^CDR-[0-9A-HJKMNP-TV-Z]{26}$" },
25
+ "correctiveDecisionRecoveryEventHash": { "$ref": "#/$defs/hash64" },
26
+ "attemptOrdinal": { "const": 3 },
27
+ "planHash": { "$ref": "#/$defs/hash64" },
28
+ "actor": { "type": "string", "minLength": 1 },
29
+ "c1ClaimEventHash": { "$ref": "#/$defs/nullableHash64" },
30
+ "writerLeaseTokenHash": { "$ref": "#/$defs/nullableHash64" },
31
+ "fromMode": { "const": "ordinary" },
32
+ "toMode": { "const": "corrective" },
33
+ "reason": { "const": "alpha7.2-recovered-continue-fix-mode-omission" },
34
+ "previousEventHash": { "$ref": "#/$defs/nullableHash64" },
35
+ "recordedAt": { "type": "string", "format": "date-time" },
36
+ "eventHash": { "$ref": "#/$defs/hash64" }
37
+ },
38
+ "$defs": {
39
+ "hash64": { "type": "string", "pattern": "^[a-f0-9]{64}$" },
40
+ "nullableHash64": { "type": ["string", "null"], "pattern": "^[a-f0-9]{64}$" }
41
+ }
42
+ }