codex-workflow-v2 2.0.0-alpha.7 → 2.0.0-alpha.7.2
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 +1 -1
- package/dist/src/alpha6/plan-risk.d.ts +1 -0
- package/dist/src/alpha6/plan-risk.js +2 -2
- package/dist/src/alpha6/plan-risk.js.map +1 -1
- package/dist/src/alpha6/remediation.d.ts +4 -1
- package/dist/src/alpha6/remediation.js +84 -19
- package/dist/src/alpha6/remediation.js.map +1 -1
- package/dist/src/alpha7/corrective-recovery.d.ts +26 -0
- package/dist/src/alpha7/corrective-recovery.js +593 -0
- package/dist/src/alpha7/corrective-recovery.js.map +1 -0
- package/dist/src/cli.js +4 -0
- package/dist/src/cli.js.map +1 -1
- package/dist/src/contracts.d.ts +27 -1
- package/dist/src/version.d.ts +1 -1
- package/dist/src/version.js +1 -1
- package/dist/src/version.js.map +1 -1
- package/dist/src/workflow.d.ts +2 -0
- package/dist/src/workflow.js +302 -56
- package/dist/src/workflow.js.map +1 -1
- package/docs/alpha7.1-implementation-brief.md +268 -0
- package/docs/alpha7.2-corrective-context-refresh-brief.md +484 -0
- package/docs/autonomy-guardrails.md +29 -14
- package/package.json +1 -1
- package/plugins/codex-workflow-gateway/references/protocol.md +13 -4
- package/plugins/codex-workflow-gateway/skills/codex-workflow-gateway/SKILL.md +16 -4
- package/references/state-machine.md +17 -6
- package/schemas/corrective-decision-recovery-event.schema.json +71 -0
|
@@ -37,11 +37,16 @@ bindings, supersedes execution authorization, and returns the Task to
|
|
|
37
37
|
`awaiting_execution_authorization`. It cannot run while a Step is `in_progress` or while the
|
|
38
38
|
Task is `blocked`; unrelated blocks must be resolved through their owning transition.
|
|
39
39
|
|
|
40
|
-
For guarded remediation, two ordinary remediation attempts are allowed.
|
|
40
|
+
For guarded remediation, two ordinary remediation attempts are allowed. Corrective posture is
|
|
41
|
+
derived from the guarded Step, current Plan Risk Audit, remediation history, and
|
|
42
|
+
corrective-decision history rather than from `Task.status` alone, so the same gate survives
|
|
43
|
+
content-only Knowledge refresh, Task Knowledge rebind, and later reauthorization. A third
|
|
41
44
|
ordinary retry is blocked until a current corrective decision exists for the same Step and
|
|
42
|
-
Plan binding. `continue-fix` allows
|
|
43
|
-
`split-required
|
|
44
|
-
|
|
45
|
+
Plan binding. `continue-fix` allows exactly the third corrective attempt; `replan-required`
|
|
46
|
+
requires an actual new Plan posture before execution; `split-required` and `stop-escalate`
|
|
47
|
+
stop ordinary execution. A failed third corrective attempt is a hard stop: `next` must
|
|
48
|
+
report the stop without throwing, no fourth run is allowed, and no new `continue-fix` or
|
|
49
|
+
`replan-required` decision is accepted.
|
|
45
50
|
|
|
46
51
|
Milestone authorization is bound to its Plan and membership revision. Plan amendments
|
|
47
52
|
supersede authorization. Milestone validation and acceptance are bound to the current base
|
|
@@ -62,8 +67,14 @@ After that boundary, semantic updates use human-only `milestone scope-change-pre
|
|
|
62
67
|
`milestone scope-change-apply`. A human-confirmed, expiring Milestone Autonomy Contract may
|
|
63
68
|
use `milestone autonomy-evolve` only for membership changes while outcome, success signal,
|
|
64
69
|
acceptance, checks, discovery, and base branch remain fixed. It may also approve Project Memory
|
|
65
|
-
only within an atomic
|
|
66
|
-
|
|
70
|
+
only within an atomic context refresh for a Task in that Milestone; standalone map approval
|
|
71
|
+
remains forbidden. In addition to content-only drift, that composite transition may accept a new
|
|
72
|
+
supporting source only when its exact normalized path and scanner category were declared by the
|
|
73
|
+
current execution-authorized Task Plan under `knowledgeImpact: create`. The Task must belong to
|
|
74
|
+
the grant's Milestone. Every added source must match the Plan, and removals, canonical additions,
|
|
75
|
+
wildcard or directory targets, existing source category/scope/authority changes, gaps, and
|
|
76
|
+
conflicts fail closed before any state write. `next` exposes the composite option only when the
|
|
77
|
+
full predicate passes and otherwise reports concrete unsafe differences. Both update paths journal
|
|
67
78
|
`state.json`, `plan.json`, and `scope-change-events.jsonl` together. Membership integrity is validated
|
|
68
79
|
before scheduling, Task start, Milestone validation, scope change, and repository `next`.
|
|
69
80
|
The same guard scans in reverse and blocks every live Task whose `milestoneId` is absent from
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://codex-workflow.local/schemas/corrective-decision-recovery-event.schema.json",
|
|
4
|
+
"title": "Codex Workflow V2 Alpha.7.2 Corrective Decision Recovery Event",
|
|
5
|
+
"type": "object",
|
|
6
|
+
"additionalProperties": false,
|
|
7
|
+
"required": [
|
|
8
|
+
"eventId",
|
|
9
|
+
"taskId",
|
|
10
|
+
"stepId",
|
|
11
|
+
"triggeringAttemptCount",
|
|
12
|
+
"correctiveDecisionEventId",
|
|
13
|
+
"correctiveDecisionEventHash",
|
|
14
|
+
"decisionPlanHash",
|
|
15
|
+
"reboundPlanHash",
|
|
16
|
+
"semanticPlanHash",
|
|
17
|
+
"fromKnowledgeMapRevision",
|
|
18
|
+
"fromKnowledgeMapHash",
|
|
19
|
+
"toKnowledgeMapRevision",
|
|
20
|
+
"toKnowledgeMapHash",
|
|
21
|
+
"rebindRecordedAt",
|
|
22
|
+
"sourcePlanRiskAuditEventId",
|
|
23
|
+
"sourcePlanRiskAuditEventHash",
|
|
24
|
+
"reboundPlanRiskAuditEventId",
|
|
25
|
+
"reboundPlanRiskAuditEventHash",
|
|
26
|
+
"knowledgeMapApprovalFingerprint",
|
|
27
|
+
"taskAuthorizationFingerprint",
|
|
28
|
+
"delegationGrantFingerprint",
|
|
29
|
+
"c1EvidenceFingerprint",
|
|
30
|
+
"evidenceFingerprint",
|
|
31
|
+
"actor",
|
|
32
|
+
"previousEventHash",
|
|
33
|
+
"recordedAt",
|
|
34
|
+
"eventHash"
|
|
35
|
+
],
|
|
36
|
+
"properties": {
|
|
37
|
+
"eventId": { "type": "string", "pattern": "^CDR-[0-9A-HJKMNP-TV-Z]{26}$" },
|
|
38
|
+
"taskId": { "$ref": "#/$defs/taskId" },
|
|
39
|
+
"stepId": { "$ref": "#/$defs/stepId" },
|
|
40
|
+
"triggeringAttemptCount": { "const": 3 },
|
|
41
|
+
"correctiveDecisionEventId": { "type": "string", "pattern": "^CRD-[0-9A-HJKMNP-TV-Z]{26}$" },
|
|
42
|
+
"correctiveDecisionEventHash": { "$ref": "#/$defs/hash64" },
|
|
43
|
+
"decisionPlanHash": { "$ref": "#/$defs/hash64" },
|
|
44
|
+
"reboundPlanHash": { "$ref": "#/$defs/hash64" },
|
|
45
|
+
"semanticPlanHash": { "$ref": "#/$defs/hash64" },
|
|
46
|
+
"fromKnowledgeMapRevision": { "type": "integer", "minimum": 1 },
|
|
47
|
+
"fromKnowledgeMapHash": { "$ref": "#/$defs/hash64" },
|
|
48
|
+
"toKnowledgeMapRevision": { "type": "integer", "minimum": 1 },
|
|
49
|
+
"toKnowledgeMapHash": { "$ref": "#/$defs/hash64" },
|
|
50
|
+
"rebindRecordedAt": { "type": "string", "format": "date-time" },
|
|
51
|
+
"sourcePlanRiskAuditEventId": { "type": "string", "pattern": "^PRA-[0-9A-HJKMNP-TV-Z]{26}$" },
|
|
52
|
+
"sourcePlanRiskAuditEventHash": { "$ref": "#/$defs/hash64" },
|
|
53
|
+
"reboundPlanRiskAuditEventId": { "type": "string", "pattern": "^PRA-[0-9A-HJKMNP-TV-Z]{26}$" },
|
|
54
|
+
"reboundPlanRiskAuditEventHash": { "$ref": "#/$defs/hash64" },
|
|
55
|
+
"knowledgeMapApprovalFingerprint": { "$ref": "#/$defs/hash64" },
|
|
56
|
+
"taskAuthorizationFingerprint": { "$ref": "#/$defs/hash64" },
|
|
57
|
+
"delegationGrantFingerprint": { "$ref": "#/$defs/hash64" },
|
|
58
|
+
"c1EvidenceFingerprint": { "$ref": "#/$defs/hash64" },
|
|
59
|
+
"evidenceFingerprint": { "$ref": "#/$defs/hash64" },
|
|
60
|
+
"actor": { "type": "string", "minLength": 1 },
|
|
61
|
+
"previousEventHash": { "$ref": "#/$defs/nullableHash64" },
|
|
62
|
+
"recordedAt": { "type": "string", "format": "date-time" },
|
|
63
|
+
"eventHash": { "$ref": "#/$defs/hash64" }
|
|
64
|
+
},
|
|
65
|
+
"$defs": {
|
|
66
|
+
"taskId": { "type": "string", "pattern": "^TASK-[0-9A-HJKMNP-TV-Z]{26}$" },
|
|
67
|
+
"stepId": { "type": "string", "pattern": "^STEP-[0-9]{3}(?:-[A-Z0-9-]+)?$" },
|
|
68
|
+
"hash64": { "type": "string", "pattern": "^[a-f0-9]{64}$" },
|
|
69
|
+
"nullableHash64": { "type": ["string", "null"], "pattern": "^[a-f0-9]{64}$" }
|
|
70
|
+
}
|
|
71
|
+
}
|