codex-workflow-v2 2.0.0-alpha.4 → 2.0.0-alpha.7
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 +114 -10
- package/dist/src/alpha6/adoption.d.ts +55 -0
- package/dist/src/alpha6/adoption.js +920 -0
- package/dist/src/alpha6/adoption.js.map +1 -0
- package/dist/src/alpha6/handoff.d.ts +40 -0
- package/dist/src/alpha6/handoff.js +981 -0
- package/dist/src/alpha6/handoff.js.map +1 -0
- package/dist/src/alpha6/journal.d.ts +30 -0
- package/dist/src/alpha6/journal.js +369 -0
- package/dist/src/alpha6/journal.js.map +1 -0
- package/dist/src/alpha6/milestone.d.ts +52 -0
- package/dist/src/alpha6/milestone.js +1103 -0
- package/dist/src/alpha6/milestone.js.map +1 -0
- package/dist/src/alpha6/plan-risk.d.ts +32 -0
- package/dist/src/alpha6/plan-risk.js +908 -0
- package/dist/src/alpha6/plan-risk.js.map +1 -0
- package/dist/src/alpha6/remediation.d.ts +21 -0
- package/dist/src/alpha6/remediation.js +754 -0
- package/dist/src/alpha6/remediation.js.map +1 -0
- package/dist/src/alpha6/review.d.ts +46 -0
- package/dist/src/alpha6/review.js +785 -0
- package/dist/src/alpha6/review.js.map +1 -0
- package/dist/src/alpha6/store-sidecars.d.ts +35 -0
- package/dist/src/alpha6/store-sidecars.js +281 -0
- package/dist/src/alpha6/store-sidecars.js.map +1 -0
- package/dist/src/alpha7/autonomy.d.ts +61 -0
- package/dist/src/alpha7/autonomy.js +256 -0
- package/dist/src/alpha7/autonomy.js.map +1 -0
- package/dist/src/cli.js +109 -19
- package/dist/src/cli.js.map +1 -1
- package/dist/src/contracts.d.ts +268 -0
- package/dist/src/git.js +2 -1
- package/dist/src/git.js.map +1 -1
- package/dist/src/index.d.ts +5 -0
- package/dist/src/index.js +3 -0
- package/dist/src/index.js.map +1 -1
- package/dist/src/reviewer.d.ts +6 -1
- package/dist/src/reviewer.js +145 -32
- package/dist/src/reviewer.js.map +1 -1
- package/dist/src/state/lock.d.ts +1 -0
- package/dist/src/state/lock.js +7 -1
- package/dist/src/state/lock.js.map +1 -1
- package/dist/src/state/store.d.ts +39 -1
- package/dist/src/state/store.js +127 -1
- package/dist/src/state/store.js.map +1 -1
- package/dist/src/version.d.ts +1 -1
- package/dist/src/version.js +1 -1
- package/dist/src/workflow.d.ts +113 -8
- package/dist/src/workflow.js +1635 -78
- package/dist/src/workflow.js.map +1 -1
- package/docs/autonomy-guardrails.md +164 -0
- package/docs/decisions.md +39 -0
- package/docs/delegated-approval.md +37 -5
- package/docs/development-flow.md +45 -1
- package/docs/pdf/codex-workflow-v2-architecture-ru.pdf +155 -136
- package/docs/pdf/codex-workflow-v2-chat-only-guide-ru.pdf +236 -223
- package/docs/pdf/codex-workflow-v2-technical-reference-ru.pdf +225 -206
- package/docs/project-memory.md +7 -0
- package/docs/release.md +9 -0
- package/docs/updating-existing-project.md +63 -5
- package/docs/validation-report.md +52 -34
- package/package.json +1 -1
- package/plugins/codex-workflow-gateway/references/protocol.md +182 -6
- package/plugins/codex-workflow-gateway/skills/codex-workflow-gateway/SKILL.md +35 -1
- package/references/git-policy.md +5 -2
- package/references/state-machine.md +43 -0
- package/references/validation-and-review.md +28 -1
- package/roles/delivery-coordinator.md +21 -1
- package/roles/independent-reviewer.md +3 -0
- package/roles/technical-planner.md +10 -0
- package/roles/worker.md +4 -0
- package/schemas/adoption-posture-event.schema.json +129 -0
- package/schemas/corrective-decision-event.schema.json +55 -0
- package/schemas/corrective-plan-audit.schema.json +20 -0
- package/schemas/milestone-autonomy-event.schema.json +45 -0
- package/schemas/milestone-scope-change-event.schema.json +70 -0
- package/schemas/milestone-transaction-journal.schema.json +95 -0
- package/schemas/plan-risk-audit-event.schema.json +107 -0
- package/schemas/remediation-event.schema.json +53 -0
- package/schemas/reviewer-attestation-event.schema.json +49 -0
- package/schemas/step-review-event.schema.json +74 -0
- package/schemas/task-handoff-event.schema.json +116 -0
|
@@ -12,6 +12,26 @@ Own state transitions, dispatch envelopes, evidence collection, and recovery gui
|
|
|
12
12
|
request the user's explicit decision, and end the turn. Never call the acceptance command
|
|
13
13
|
in the same turn that produced or displayed the gate.
|
|
14
14
|
- Accept a Milestone only after a later user message explicitly approves that exact
|
|
15
|
-
confirmation code
|
|
15
|
+
confirmation code, or through the exact active Milestone Autonomy Contract option. Do not
|
|
16
|
+
infer approval from a request to validate, finish, or continue.
|
|
17
|
+
- During initial Milestone planning, materialize the complete linked Task set and record one
|
|
18
|
+
full membership Plan. When a Milestone Autonomy Contract is active, evolve only membership;
|
|
19
|
+
any outcome, success-signal, acceptance, check, discovery, or base-branch change returns to
|
|
20
|
+
the human scope-change gate.
|
|
21
|
+
- Use the Milestone contract for Project Memory approval only through the exact atomic
|
|
22
|
+
content-only Task context-refresh route; never use it for standalone map approval.
|
|
16
23
|
- Dispatch one Worker at a time for a concrete Step.
|
|
24
|
+
- A Milestone coordinator creates one dedicated user-visible Codex Task chat for each required
|
|
25
|
+
Task. The Milestone chat owns ordering, exact delegated approvals, merge observation,
|
|
26
|
+
validation, and final acceptance; it does not accumulate implementation for every Task.
|
|
27
|
+
- Before authorizing a high-risk Plan, require the Technical Planner's migration/concurrency/
|
|
28
|
+
restart/crash/provider risk review and failure-specific checks.
|
|
29
|
+
- After a second failed independent Task review, require a separate corrective Plan Auditor
|
|
30
|
+
and pass its evidence through `--corrective-audit-file`. Continue only for
|
|
31
|
+
`decision=continue-fix`; replan/split/stop decisions return to the coordinator or user.
|
|
32
|
+
- Use the exact derived Worker and corrective Auditor actors returned by `next`; do not pause
|
|
33
|
+
for the user to invent routing identifiers.
|
|
34
|
+
- Use `task context-refresh` only when `next.contextRefresh` offers the exact delegated,
|
|
35
|
+
content-only option. Classification, authority, source-set, gap, or conflict changes still
|
|
36
|
+
require the ordinary visible Knowledge Map flow.
|
|
17
37
|
- Do not make product-scope decisions or implement production changes.
|
|
@@ -7,4 +7,7 @@ Compare requirements, acceptance, Plan, task-branch diff, checks, and generated
|
|
|
7
7
|
- Operate read-only and do not fix findings.
|
|
8
8
|
- Mark the review `unverified` when read-only isolation or required evidence is unavailable.
|
|
9
9
|
- A failed review must contain actionable findings; a passed review contains none.
|
|
10
|
+
- For migrations, concurrency, restart/replay, crash recovery, and external providers, reject
|
|
11
|
+
green happy-path evidence that omits populated upgrades, deterministic races, restart/crash
|
|
12
|
+
windows, or provider failure/default behavior required by the approved Plan.
|
|
10
13
|
- Do not grant final acceptance on behalf of the user.
|
|
@@ -6,5 +6,15 @@ Translate an approved Brief into an execution-ready Plan.
|
|
|
6
6
|
- Declare `knowledgeImpact`, its reason, targets, and `graphUse`; do not hide missing knowledge as an implementation choice.
|
|
7
7
|
- Every requirement must be covered by at least one `STEP-*`.
|
|
8
8
|
- Each Step declares dependencies, outputs, allowed writes, forbidden scope, and checks.
|
|
9
|
+
- Perform a risk review before `plan-set`. A Plan that touches migrations, concurrent state,
|
|
10
|
+
restart/replay, crash recovery, or an external provider must include failure-specific checks
|
|
11
|
+
in the original Steps: populated forward upgrades, deterministic races, restart/crash
|
|
12
|
+
windows, and provider failure/default behavior as applicable.
|
|
13
|
+
- For every guarded failure mode, define one hostile counterexample, the expected safe result,
|
|
14
|
+
and the exact executable Step check that proves it. A happy-path check is not a proof
|
|
15
|
+
obligation for an adversarial or crash-window claim.
|
|
16
|
+
- Split a Task when one acceptance slice would otherwise combine persistence migration,
|
|
17
|
+
recovery orchestration, and executable composition. Do not use arbitrary line/file limits;
|
|
18
|
+
split on independently verifiable failure boundaries.
|
|
9
19
|
- Do not edit production files or silently expand the Brief.
|
|
10
20
|
- Return unresolved semantic choices to the user through the Delivery Coordinator.
|
package/roles/worker.md
CHANGED
|
@@ -7,4 +7,8 @@ Implement exactly one dispatched Step under its context envelope.
|
|
|
7
7
|
- Read only declared inputs and repository context needed for the Step.
|
|
8
8
|
- Write only `allowedWrites`; stop on required scope expansion.
|
|
9
9
|
- Run the declared checks and report limitations honestly.
|
|
10
|
+
- Leave all Step changes uncommitted. Do not run `git add`, `git commit`, `git amend`,
|
|
11
|
+
reset, rebase, or another Git-history mutation. The coordinator invokes
|
|
12
|
+
`task step-complete`; Workflow core then runs the configured checks, creates the atomic
|
|
13
|
+
Step commit, and records its evidence.
|
|
10
14
|
- Do not edit the Brief, Plan, acceptance, other Steps, workflow state, or Git history manually.
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://codex-workflow.local/schemas/adoption-posture-event.schema.json",
|
|
4
|
+
"title": "Codex Workflow V2 Alpha.6 Adoption Posture Event",
|
|
5
|
+
"type": "object",
|
|
6
|
+
"additionalProperties": false,
|
|
7
|
+
"required": [
|
|
8
|
+
"eventId",
|
|
9
|
+
"projectId",
|
|
10
|
+
"eventType",
|
|
11
|
+
"actor",
|
|
12
|
+
"packageVersion",
|
|
13
|
+
"protocolVersion",
|
|
14
|
+
"stateSchemaVersion",
|
|
15
|
+
"adoptionBoundaryAt",
|
|
16
|
+
"baselineDigestHash",
|
|
17
|
+
"sidecarBaselineHash",
|
|
18
|
+
"confirmationCodeBindingHash",
|
|
19
|
+
"repositoryIdentity",
|
|
20
|
+
"terminalMilestones",
|
|
21
|
+
"terminalTasks",
|
|
22
|
+
"activeTasks",
|
|
23
|
+
"previousEventHash",
|
|
24
|
+
"recordedAt",
|
|
25
|
+
"eventHash"
|
|
26
|
+
],
|
|
27
|
+
"properties": {
|
|
28
|
+
"eventId": { "type": "string", "minLength": 1 },
|
|
29
|
+
"projectId": { "type": "string", "pattern": "^[a-f0-9]{24}$" },
|
|
30
|
+
"eventType": { "enum": ["project-registration", "adoption-apply"] },
|
|
31
|
+
"actor": { "type": ["string", "null"], "minLength": 1 },
|
|
32
|
+
"packageVersion": { "type": "string", "minLength": 1 },
|
|
33
|
+
"protocolVersion": { "const": 1 },
|
|
34
|
+
"stateSchemaVersion": { "const": 2 },
|
|
35
|
+
"adoptionBoundaryAt": { "type": "string", "format": "date-time" },
|
|
36
|
+
"baselineDigestHash": { "$ref": "#/$defs/hash64" },
|
|
37
|
+
"sidecarBaselineHash": { "$ref": "#/$defs/hash64" },
|
|
38
|
+
"confirmationCodeBindingHash": { "$ref": "#/$defs/nullableHash64" },
|
|
39
|
+
"repositoryIdentity": {
|
|
40
|
+
"type": "object",
|
|
41
|
+
"additionalProperties": false,
|
|
42
|
+
"required": ["repositoryRoot", "gitCommonDir"],
|
|
43
|
+
"properties": {
|
|
44
|
+
"repositoryRoot": { "type": "string", "minLength": 1 },
|
|
45
|
+
"gitCommonDir": { "type": "string", "minLength": 1 }
|
|
46
|
+
}
|
|
47
|
+
},
|
|
48
|
+
"terminalMilestones": {
|
|
49
|
+
"type": "array",
|
|
50
|
+
"items": {
|
|
51
|
+
"type": "object",
|
|
52
|
+
"additionalProperties": false,
|
|
53
|
+
"required": ["milestoneId", "revision", "status"],
|
|
54
|
+
"properties": {
|
|
55
|
+
"milestoneId": { "$ref": "#/$defs/milestoneId" },
|
|
56
|
+
"revision": { "type": "integer", "minimum": 1 },
|
|
57
|
+
"status": { "enum": ["accepted", "cancelled"] }
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
},
|
|
61
|
+
"terminalTasks": {
|
|
62
|
+
"type": "array",
|
|
63
|
+
"items": {
|
|
64
|
+
"type": "object",
|
|
65
|
+
"additionalProperties": false,
|
|
66
|
+
"required": ["taskId", "revision", "status"],
|
|
67
|
+
"properties": {
|
|
68
|
+
"taskId": { "$ref": "#/$defs/taskId" },
|
|
69
|
+
"revision": { "type": "integer", "minimum": 1 },
|
|
70
|
+
"status": { "enum": ["merged", "cancelled"] }
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
},
|
|
74
|
+
"activeTasks": {
|
|
75
|
+
"type": "array",
|
|
76
|
+
"items": {
|
|
77
|
+
"type": "object",
|
|
78
|
+
"additionalProperties": false,
|
|
79
|
+
"required": ["taskId", "taskRevision", "status", "completedSteps", "remainingStepIds"],
|
|
80
|
+
"properties": {
|
|
81
|
+
"taskId": { "$ref": "#/$defs/taskId" },
|
|
82
|
+
"taskRevision": { "type": "integer", "minimum": 1 },
|
|
83
|
+
"status": {
|
|
84
|
+
"enum": [
|
|
85
|
+
"planning",
|
|
86
|
+
"awaiting_execution_authorization",
|
|
87
|
+
"ready",
|
|
88
|
+
"in_progress",
|
|
89
|
+
"validating",
|
|
90
|
+
"needs_fix",
|
|
91
|
+
"awaiting_final_acceptance",
|
|
92
|
+
"merging",
|
|
93
|
+
"ready_to_merge",
|
|
94
|
+
"blocked"
|
|
95
|
+
]
|
|
96
|
+
},
|
|
97
|
+
"completedSteps": {
|
|
98
|
+
"type": "array",
|
|
99
|
+
"items": {
|
|
100
|
+
"type": "object",
|
|
101
|
+
"additionalProperties": false,
|
|
102
|
+
"required": ["stepId", "status", "evidenceHash"],
|
|
103
|
+
"properties": {
|
|
104
|
+
"stepId": { "$ref": "#/$defs/stepId" },
|
|
105
|
+
"status": { "enum": ["completed", "skipped"] },
|
|
106
|
+
"evidenceHash": { "$ref": "#/$defs/nullableHash64" }
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
},
|
|
110
|
+
"remainingStepIds": {
|
|
111
|
+
"type": "array",
|
|
112
|
+
"uniqueItems": true,
|
|
113
|
+
"items": { "$ref": "#/$defs/stepId" }
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
},
|
|
118
|
+
"previousEventHash": { "$ref": "#/$defs/nullableHash64" },
|
|
119
|
+
"recordedAt": { "type": "string", "format": "date-time" },
|
|
120
|
+
"eventHash": { "$ref": "#/$defs/hash64" }
|
|
121
|
+
},
|
|
122
|
+
"$defs": {
|
|
123
|
+
"milestoneId": { "type": "string", "pattern": "^MS-[0-9A-HJKMNP-TV-Z]{26}$" },
|
|
124
|
+
"taskId": { "type": "string", "pattern": "^TASK-[0-9A-HJKMNP-TV-Z]{26}$" },
|
|
125
|
+
"stepId": { "type": "string", "pattern": "^STEP-[0-9]{3}(?:-[A-Z0-9-]+)?$" },
|
|
126
|
+
"hash64": { "type": "string", "pattern": "^[a-f0-9]{64}$" },
|
|
127
|
+
"nullableHash64": { "type": ["string", "null"], "pattern": "^[a-f0-9]{64}$" }
|
|
128
|
+
}
|
|
129
|
+
}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://codex-workflow.local/schemas/corrective-decision-event.schema.json",
|
|
4
|
+
"title": "Codex Workflow V2 Alpha.6 Corrective Decision Event",
|
|
5
|
+
"type": "object",
|
|
6
|
+
"additionalProperties": false,
|
|
7
|
+
"required": [
|
|
8
|
+
"eventId",
|
|
9
|
+
"taskId",
|
|
10
|
+
"stepId",
|
|
11
|
+
"triggeringAttemptCount",
|
|
12
|
+
"decision",
|
|
13
|
+
"auditor",
|
|
14
|
+
"coveredFindingIds",
|
|
15
|
+
"coveredEventIds",
|
|
16
|
+
"planHash",
|
|
17
|
+
"previousEventHash",
|
|
18
|
+
"recordedAt",
|
|
19
|
+
"eventHash"
|
|
20
|
+
],
|
|
21
|
+
"properties": {
|
|
22
|
+
"eventId": { "type": "string", "minLength": 1 },
|
|
23
|
+
"taskId": { "$ref": "#/$defs/taskId" },
|
|
24
|
+
"stepId": { "$ref": "#/$defs/stepId" },
|
|
25
|
+
"triggeringAttemptCount": { "type": "integer", "minimum": 3 },
|
|
26
|
+
"decision": {
|
|
27
|
+
"enum": ["continue-fix", "replan-required", "split-required", "stop-escalate"]
|
|
28
|
+
},
|
|
29
|
+
"auditor": { "type": "string", "minLength": 1 },
|
|
30
|
+
"coveredFindingIds": {
|
|
31
|
+
"type": "array",
|
|
32
|
+
"uniqueItems": true,
|
|
33
|
+
"items": { "type": "string", "minLength": 1 }
|
|
34
|
+
},
|
|
35
|
+
"coveredEventIds": {
|
|
36
|
+
"type": "array",
|
|
37
|
+
"uniqueItems": true,
|
|
38
|
+
"items": { "type": "string", "minLength": 1 }
|
|
39
|
+
},
|
|
40
|
+
"planHash": { "$ref": "#/$defs/hash64" },
|
|
41
|
+
"previousEventHash": { "$ref": "#/$defs/nullableHash64" },
|
|
42
|
+
"recordedAt": { "type": "string", "format": "date-time" },
|
|
43
|
+
"eventHash": { "$ref": "#/$defs/hash64" }
|
|
44
|
+
},
|
|
45
|
+
"anyOf": [
|
|
46
|
+
{ "properties": { "coveredFindingIds": { "minItems": 1 } } },
|
|
47
|
+
{ "properties": { "coveredEventIds": { "minItems": 1 } } }
|
|
48
|
+
],
|
|
49
|
+
"$defs": {
|
|
50
|
+
"taskId": { "type": "string", "pattern": "^TASK-[0-9A-HJKMNP-TV-Z]{26}$" },
|
|
51
|
+
"stepId": { "type": "string", "pattern": "^STEP-[0-9]{3}(?:-[A-Z0-9-]+)?$" },
|
|
52
|
+
"hash64": { "type": "string", "pattern": "^[a-f0-9]{64}$" },
|
|
53
|
+
"nullableHash64": { "type": ["string", "null"], "pattern": "^[a-f0-9]{64}$" }
|
|
54
|
+
}
|
|
55
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://codex-workflow.local/schemas/corrective-plan-audit.schema.json",
|
|
4
|
+
"type": "object",
|
|
5
|
+
"additionalProperties": false,
|
|
6
|
+
"required": ["auditor", "summary", "decision", "reviewedFindingIds"],
|
|
7
|
+
"properties": {
|
|
8
|
+
"auditor": { "type": "string", "minLength": 1 },
|
|
9
|
+
"summary": { "type": "string", "minLength": 1 },
|
|
10
|
+
"decision": {
|
|
11
|
+
"enum": ["continue-fix", "replan-required", "split-required", "stop-escalate"]
|
|
12
|
+
},
|
|
13
|
+
"reviewedFindingIds": {
|
|
14
|
+
"type": "array",
|
|
15
|
+
"minItems": 1,
|
|
16
|
+
"uniqueItems": true,
|
|
17
|
+
"items": { "type": "string", "minLength": 1 }
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://codex-workflow.local/schemas/milestone-autonomy-event.schema.json",
|
|
4
|
+
"title": "Codex Workflow V2 Alpha.7 Milestone Autonomy Event",
|
|
5
|
+
"type": "object",
|
|
6
|
+
"additionalProperties": false,
|
|
7
|
+
"required": [
|
|
8
|
+
"eventId",
|
|
9
|
+
"previousEventHash",
|
|
10
|
+
"recordedAt",
|
|
11
|
+
"eventHash",
|
|
12
|
+
"eventType",
|
|
13
|
+
"projectId",
|
|
14
|
+
"milestoneId",
|
|
15
|
+
"milestoneRevision",
|
|
16
|
+
"principal",
|
|
17
|
+
"delegate",
|
|
18
|
+
"issuedAt",
|
|
19
|
+
"expiresAt",
|
|
20
|
+
"semanticScopeHash",
|
|
21
|
+
"delegationGrantId",
|
|
22
|
+
"delegationPolicyHash"
|
|
23
|
+
],
|
|
24
|
+
"properties": {
|
|
25
|
+
"eventId": { "type": "string", "pattern": "^MAC-[0-9A-HJKMNP-TV-Z]{26}$" },
|
|
26
|
+
"previousEventHash": { "$ref": "#/$defs/nullableHash64" },
|
|
27
|
+
"recordedAt": { "type": "string", "format": "date-time" },
|
|
28
|
+
"eventHash": { "$ref": "#/$defs/hash64" },
|
|
29
|
+
"eventType": { "const": "issued" },
|
|
30
|
+
"projectId": { "type": "string", "minLength": 1 },
|
|
31
|
+
"milestoneId": { "type": "string", "pattern": "^MS-[0-9A-HJKMNP-TV-Z]{26}$" },
|
|
32
|
+
"milestoneRevision": { "type": "integer", "minimum": 1 },
|
|
33
|
+
"principal": { "type": "string", "minLength": 1 },
|
|
34
|
+
"delegate": { "type": "string", "pattern": "^agent:.+" },
|
|
35
|
+
"issuedAt": { "type": "string", "format": "date-time" },
|
|
36
|
+
"expiresAt": { "type": "string", "format": "date-time" },
|
|
37
|
+
"semanticScopeHash": { "$ref": "#/$defs/hash64" },
|
|
38
|
+
"delegationGrantId": { "type": "string", "pattern": "^DGR-[0-9A-HJKMNP-TV-Z]{26}$" },
|
|
39
|
+
"delegationPolicyHash": { "$ref": "#/$defs/hash64" }
|
|
40
|
+
},
|
|
41
|
+
"$defs": {
|
|
42
|
+
"hash64": { "type": "string", "pattern": "^[a-f0-9]{64}$" },
|
|
43
|
+
"nullableHash64": { "type": ["string", "null"], "pattern": "^[a-f0-9]{64}$" }
|
|
44
|
+
}
|
|
45
|
+
}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://codex-workflow.local/schemas/milestone-scope-change-event.schema.json",
|
|
4
|
+
"title": "Codex Workflow V2 Alpha.7 Milestone Scope Change Event",
|
|
5
|
+
"type": "object",
|
|
6
|
+
"additionalProperties": false,
|
|
7
|
+
"required": [
|
|
8
|
+
"eventId",
|
|
9
|
+
"milestoneId",
|
|
10
|
+
"previousMilestoneRevision",
|
|
11
|
+
"previousPlanHash",
|
|
12
|
+
"previousMembershipRevision",
|
|
13
|
+
"candidatePlanHash",
|
|
14
|
+
"candidateMembershipRevision",
|
|
15
|
+
"before",
|
|
16
|
+
"after",
|
|
17
|
+
"actor",
|
|
18
|
+
"confirmationCodeBindingHash",
|
|
19
|
+
"previousEventHash",
|
|
20
|
+
"recordedAt",
|
|
21
|
+
"eventHash"
|
|
22
|
+
],
|
|
23
|
+
"properties": {
|
|
24
|
+
"eventId": { "type": "string", "minLength": 1 },
|
|
25
|
+
"milestoneId": { "$ref": "#/$defs/milestoneId" },
|
|
26
|
+
"previousMilestoneRevision": { "type": "integer", "minimum": 1 },
|
|
27
|
+
"previousPlanHash": { "$ref": "#/$defs/nullableHash64" },
|
|
28
|
+
"previousMembershipRevision": { "type": "integer", "minimum": 0 },
|
|
29
|
+
"candidatePlanHash": { "$ref": "#/$defs/hash64" },
|
|
30
|
+
"candidateMembershipRevision": { "type": "integer", "minimum": 0 },
|
|
31
|
+
"before": { "$ref": "#/$defs/scopeSnapshot" },
|
|
32
|
+
"after": { "$ref": "#/$defs/scopeSnapshot" },
|
|
33
|
+
"actor": { "type": "string", "minLength": 1 },
|
|
34
|
+
"confirmationCodeBindingHash": { "$ref": "#/$defs/hash64" },
|
|
35
|
+
"authorizationMode": { "enum": ["human", "milestone-autonomy"] },
|
|
36
|
+
"autonomyContractEventHash": { "$ref": "#/$defs/nullableHash64" },
|
|
37
|
+
"previousEventHash": { "$ref": "#/$defs/nullableHash64" },
|
|
38
|
+
"recordedAt": { "type": "string", "format": "date-time" },
|
|
39
|
+
"eventHash": { "$ref": "#/$defs/hash64" }
|
|
40
|
+
},
|
|
41
|
+
"$defs": {
|
|
42
|
+
"milestoneId": { "type": "string", "pattern": "^MS-[0-9A-HJKMNP-TV-Z]{26}$" },
|
|
43
|
+
"taskId": { "type": "string", "pattern": "^TASK-[0-9A-HJKMNP-TV-Z]{26}$" },
|
|
44
|
+
"hash64": { "type": "string", "pattern": "^[a-f0-9]{64}$" },
|
|
45
|
+
"nullableHash64": { "type": ["string", "null"], "pattern": "^[a-f0-9]{64}$" },
|
|
46
|
+
"membership": {
|
|
47
|
+
"type": "object",
|
|
48
|
+
"additionalProperties": false,
|
|
49
|
+
"required": ["taskId", "disposition", "reason"],
|
|
50
|
+
"properties": {
|
|
51
|
+
"taskId": { "$ref": "#/$defs/taskId" },
|
|
52
|
+
"disposition": { "enum": ["required", "waived", "cancelled"] },
|
|
53
|
+
"reason": { "type": "string" }
|
|
54
|
+
}
|
|
55
|
+
},
|
|
56
|
+
"scopeSnapshot": {
|
|
57
|
+
"type": "object",
|
|
58
|
+
"additionalProperties": false,
|
|
59
|
+
"required": ["outcome", "successSignal", "acceptance", "checks", "taskIds", "memberships"],
|
|
60
|
+
"properties": {
|
|
61
|
+
"outcome": { "type": "string" },
|
|
62
|
+
"successSignal": { "type": "string" },
|
|
63
|
+
"acceptance": { "type": "array", "items": { "type": "string", "minLength": 1 } },
|
|
64
|
+
"checks": { "type": "array", "items": { "type": "string", "minLength": 1 } },
|
|
65
|
+
"taskIds": { "type": "array", "uniqueItems": true, "items": { "$ref": "#/$defs/taskId" } },
|
|
66
|
+
"memberships": { "type": "array", "items": { "$ref": "#/$defs/membership" } }
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
}
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://codex-workflow.local/schemas/milestone-transaction-journal.schema.json",
|
|
4
|
+
"title": "Codex Workflow V2 Alpha.6 Milestone Transaction Journal",
|
|
5
|
+
"type": "object",
|
|
6
|
+
"additionalProperties": false,
|
|
7
|
+
"required": [
|
|
8
|
+
"transactionId",
|
|
9
|
+
"milestoneId",
|
|
10
|
+
"expectedMilestoneRevision",
|
|
11
|
+
"actor",
|
|
12
|
+
"confirmationCodeBindingHash",
|
|
13
|
+
"phase",
|
|
14
|
+
"targetFiles",
|
|
15
|
+
"preparedAt",
|
|
16
|
+
"updatedAt"
|
|
17
|
+
],
|
|
18
|
+
"properties": {
|
|
19
|
+
"transactionId": { "type": "string", "minLength": 1 },
|
|
20
|
+
"milestoneId": { "$ref": "#/$defs/milestoneId" },
|
|
21
|
+
"expectedMilestoneRevision": { "type": "integer", "minimum": 1 },
|
|
22
|
+
"actor": { "type": "string", "minLength": 1 },
|
|
23
|
+
"confirmationCodeBindingHash": { "$ref": "#/$defs/hash64" },
|
|
24
|
+
"phase": { "enum": ["prepared", "applying", "applied", "rolled_back"] },
|
|
25
|
+
"targetFiles": {
|
|
26
|
+
"type": "array",
|
|
27
|
+
"minItems": 1,
|
|
28
|
+
"items": {
|
|
29
|
+
"type": "object",
|
|
30
|
+
"additionalProperties": false,
|
|
31
|
+
"required": ["path", "preimage", "staged"],
|
|
32
|
+
"properties": {
|
|
33
|
+
"path": { "type": "string", "minLength": 1 },
|
|
34
|
+
"preimage": { "$ref": "#/$defs/fileSnapshot" },
|
|
35
|
+
"staged": { "$ref": "#/$defs/fileSnapshot" }
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
},
|
|
39
|
+
"preparedAt": { "type": "string", "format": "date-time" },
|
|
40
|
+
"updatedAt": { "type": "string", "format": "date-time" }
|
|
41
|
+
},
|
|
42
|
+
"$defs": {
|
|
43
|
+
"milestoneId": { "type": "string", "pattern": "^MS-[0-9A-HJKMNP-TV-Z]{26}$" },
|
|
44
|
+
"hash64": { "type": "string", "pattern": "^[a-f0-9]{64}$" },
|
|
45
|
+
"fileSnapshot": {
|
|
46
|
+
"type": "object",
|
|
47
|
+
"additionalProperties": false,
|
|
48
|
+
"required": ["exists", "contentHash", "contentBase64", "contentPath"],
|
|
49
|
+
"properties": {
|
|
50
|
+
"exists": { "type": "boolean" },
|
|
51
|
+
"contentHash": { "type": ["string", "null"], "pattern": "^[a-f0-9]{64}$" },
|
|
52
|
+
"contentBase64": { "type": ["string", "null"], "minLength": 1 },
|
|
53
|
+
"contentPath": { "type": ["string", "null"], "minLength": 1 }
|
|
54
|
+
},
|
|
55
|
+
"allOf": [
|
|
56
|
+
{
|
|
57
|
+
"if": {
|
|
58
|
+
"properties": { "exists": { "const": true } },
|
|
59
|
+
"required": ["exists"]
|
|
60
|
+
},
|
|
61
|
+
"then": {
|
|
62
|
+
"properties": {
|
|
63
|
+
"contentHash": { "$ref": "#/$defs/hash64" }
|
|
64
|
+
},
|
|
65
|
+
"anyOf": [
|
|
66
|
+
{
|
|
67
|
+
"properties": {
|
|
68
|
+
"contentBase64": { "type": "string", "minLength": 1 }
|
|
69
|
+
}
|
|
70
|
+
},
|
|
71
|
+
{
|
|
72
|
+
"properties": {
|
|
73
|
+
"contentPath": { "type": "string", "minLength": 1 }
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
]
|
|
77
|
+
}
|
|
78
|
+
},
|
|
79
|
+
{
|
|
80
|
+
"if": {
|
|
81
|
+
"properties": { "exists": { "const": false } },
|
|
82
|
+
"required": ["exists"]
|
|
83
|
+
},
|
|
84
|
+
"then": {
|
|
85
|
+
"properties": {
|
|
86
|
+
"contentHash": { "const": null },
|
|
87
|
+
"contentBase64": { "const": null },
|
|
88
|
+
"contentPath": { "const": null }
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
]
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
}
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://codex-workflow.local/schemas/plan-risk-audit-event.schema.json",
|
|
4
|
+
"title": "Codex Workflow V2 Alpha.7 Plan Risk Audit Event",
|
|
5
|
+
"type": "object",
|
|
6
|
+
"additionalProperties": false,
|
|
7
|
+
"required": [
|
|
8
|
+
"eventId",
|
|
9
|
+
"taskId",
|
|
10
|
+
"taskRevision",
|
|
11
|
+
"briefHash",
|
|
12
|
+
"planHash",
|
|
13
|
+
"knowledgeMapRevision",
|
|
14
|
+
"knowledgeMapHash",
|
|
15
|
+
"planner",
|
|
16
|
+
"auditor",
|
|
17
|
+
"summary",
|
|
18
|
+
"decision",
|
|
19
|
+
"splitRationale",
|
|
20
|
+
"stepClassifications",
|
|
21
|
+
"previousEventHash",
|
|
22
|
+
"recordedAt",
|
|
23
|
+
"eventHash"
|
|
24
|
+
],
|
|
25
|
+
"properties": {
|
|
26
|
+
"eventId": { "type": "string", "minLength": 1 },
|
|
27
|
+
"taskId": { "$ref": "#/$defs/taskId" },
|
|
28
|
+
"taskRevision": { "type": "integer", "minimum": 1 },
|
|
29
|
+
"briefHash": { "$ref": "#/$defs/hash64" },
|
|
30
|
+
"planHash": { "$ref": "#/$defs/hash64" },
|
|
31
|
+
"knowledgeMapRevision": { "type": "integer", "minimum": 1 },
|
|
32
|
+
"knowledgeMapHash": { "$ref": "#/$defs/hash64" },
|
|
33
|
+
"planner": { "type": "string", "minLength": 1 },
|
|
34
|
+
"auditor": { "type": "string", "minLength": 1 },
|
|
35
|
+
"summary": { "type": "string", "minLength": 1 },
|
|
36
|
+
"decision": { "enum": ["approved", "approved-with-rationale", "split-required", "stop-escalate"] },
|
|
37
|
+
"splitRationale": { "type": ["string", "null"], "minLength": 1 },
|
|
38
|
+
"stepClassifications": {
|
|
39
|
+
"type": "array",
|
|
40
|
+
"minItems": 1,
|
|
41
|
+
"items": { "$ref": "#/$defs/stepClassification" }
|
|
42
|
+
},
|
|
43
|
+
"previousEventHash": { "$ref": "#/$defs/nullableHash64" },
|
|
44
|
+
"recordedAt": { "type": "string", "format": "date-time" },
|
|
45
|
+
"eventHash": { "$ref": "#/$defs/hash64" }
|
|
46
|
+
},
|
|
47
|
+
"$defs": {
|
|
48
|
+
"taskId": { "type": "string", "pattern": "^TASK-[0-9A-HJKMNP-TV-Z]{26}$" },
|
|
49
|
+
"stepId": { "type": "string", "pattern": "^STEP-[0-9]{3}(?:-[A-Z0-9-]+)?$" },
|
|
50
|
+
"hash64": { "type": "string", "pattern": "^[a-f0-9]{64}$" },
|
|
51
|
+
"nullableHash64": { "type": ["string", "null"], "pattern": "^[a-f0-9]{64}$" },
|
|
52
|
+
"guardedRiskCategory": {
|
|
53
|
+
"enum": ["migration", "concurrency", "restart-replay", "crash-window", "external-provider", "runtime-composition", "security-boundary", "auth-secrets", "irreversible-execution"]
|
|
54
|
+
},
|
|
55
|
+
"stepClassification": {
|
|
56
|
+
"type": "object",
|
|
57
|
+
"additionalProperties": false,
|
|
58
|
+
"required": ["stepId", "categories", "reviewRequired", "failureModes", "requiredEvidence"],
|
|
59
|
+
"properties": {
|
|
60
|
+
"stepId": { "$ref": "#/$defs/stepId" },
|
|
61
|
+
"categories": {
|
|
62
|
+
"type": "array",
|
|
63
|
+
"uniqueItems": true,
|
|
64
|
+
"items": { "$ref": "#/$defs/guardedRiskCategory" }
|
|
65
|
+
},
|
|
66
|
+
"reviewRequired": { "type": "boolean" },
|
|
67
|
+
"failureModes": { "type": "array", "uniqueItems": true, "items": { "type": "string", "minLength": 1 } },
|
|
68
|
+
"requiredEvidence": { "type": "array", "uniqueItems": true, "items": { "type": "string", "minLength": 1 } },
|
|
69
|
+
"proofObligations": {
|
|
70
|
+
"type": "array",
|
|
71
|
+
"items": { "$ref": "#/$defs/proofObligation" }
|
|
72
|
+
}
|
|
73
|
+
},
|
|
74
|
+
"oneOf": [
|
|
75
|
+
{
|
|
76
|
+
"properties": {
|
|
77
|
+
"categories": { "maxItems": 0 },
|
|
78
|
+
"reviewRequired": { "const": false },
|
|
79
|
+
"failureModes": { "maxItems": 0 },
|
|
80
|
+
"requiredEvidence": { "maxItems": 0 },
|
|
81
|
+
"proofObligations": { "maxItems": 0 }
|
|
82
|
+
}
|
|
83
|
+
},
|
|
84
|
+
{
|
|
85
|
+
"properties": {
|
|
86
|
+
"categories": { "minItems": 1 },
|
|
87
|
+
"reviewRequired": { "const": true },
|
|
88
|
+
"failureModes": { "minItems": 1 },
|
|
89
|
+
"requiredEvidence": { "minItems": 1 },
|
|
90
|
+
"proofObligations": { "minItems": 1 }
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
]
|
|
94
|
+
},
|
|
95
|
+
"proofObligation": {
|
|
96
|
+
"type": "object",
|
|
97
|
+
"additionalProperties": false,
|
|
98
|
+
"required": ["failureMode", "counterexample", "expectedResult", "evidence"],
|
|
99
|
+
"properties": {
|
|
100
|
+
"failureMode": { "type": "string", "minLength": 1 },
|
|
101
|
+
"counterexample": { "type": "string", "minLength": 1 },
|
|
102
|
+
"expectedResult": { "type": "string", "minLength": 1 },
|
|
103
|
+
"evidence": { "type": "string", "minLength": 1 }
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://codex-workflow.local/schemas/remediation-event.schema.json",
|
|
4
|
+
"title": "Codex Workflow V2 Alpha.6 Remediation Event",
|
|
5
|
+
"type": "object",
|
|
6
|
+
"additionalProperties": false,
|
|
7
|
+
"required": [
|
|
8
|
+
"eventId",
|
|
9
|
+
"taskId",
|
|
10
|
+
"stepId",
|
|
11
|
+
"guardedCategory",
|
|
12
|
+
"failureKind",
|
|
13
|
+
"failureEvidence",
|
|
14
|
+
"attemptOrdinal",
|
|
15
|
+
"mode",
|
|
16
|
+
"previousEventHash",
|
|
17
|
+
"recordedAt",
|
|
18
|
+
"eventHash"
|
|
19
|
+
],
|
|
20
|
+
"properties": {
|
|
21
|
+
"eventId": { "type": "string", "minLength": 1 },
|
|
22
|
+
"taskId": { "$ref": "#/$defs/taskId" },
|
|
23
|
+
"stepId": { "$ref": "#/$defs/stepId" },
|
|
24
|
+
"guardedCategory": { "$ref": "#/$defs/guardedRiskCategory" },
|
|
25
|
+
"failureKind": { "enum": ["checks-failed", "review-failed", "review-unverified"] },
|
|
26
|
+
"failureEvidence": {
|
|
27
|
+
"type": "object",
|
|
28
|
+
"additionalProperties": false,
|
|
29
|
+
"required": ["completionCommit", "checksHash", "reviewEventHash", "reviewerAttestationHash"],
|
|
30
|
+
"properties": {
|
|
31
|
+
"completionCommit": { "$ref": "#/$defs/gitHash" },
|
|
32
|
+
"checksHash": { "$ref": "#/$defs/hash64" },
|
|
33
|
+
"reviewEventHash": { "$ref": "#/$defs/nullableHash64" },
|
|
34
|
+
"reviewerAttestationHash": { "$ref": "#/$defs/nullableHash64" }
|
|
35
|
+
}
|
|
36
|
+
},
|
|
37
|
+
"attemptOrdinal": { "type": "integer", "minimum": 1 },
|
|
38
|
+
"mode": { "enum": ["ordinary", "corrective"] },
|
|
39
|
+
"previousEventHash": { "$ref": "#/$defs/nullableHash64" },
|
|
40
|
+
"recordedAt": { "type": "string", "format": "date-time" },
|
|
41
|
+
"eventHash": { "$ref": "#/$defs/hash64" }
|
|
42
|
+
},
|
|
43
|
+
"$defs": {
|
|
44
|
+
"taskId": { "type": "string", "pattern": "^TASK-[0-9A-HJKMNP-TV-Z]{26}$" },
|
|
45
|
+
"stepId": { "type": "string", "pattern": "^STEP-[0-9]{3}(?:-[A-Z0-9-]+)?$" },
|
|
46
|
+
"guardedRiskCategory": {
|
|
47
|
+
"enum": ["migration", "concurrency", "restart-replay", "crash-window", "external-provider"]
|
|
48
|
+
},
|
|
49
|
+
"hash64": { "type": "string", "pattern": "^[a-f0-9]{64}$" },
|
|
50
|
+
"nullableHash64": { "type": ["string", "null"], "pattern": "^[a-f0-9]{64}$" },
|
|
51
|
+
"gitHash": { "type": "string", "pattern": "^[a-f0-9]{40,64}$" }
|
|
52
|
+
}
|
|
53
|
+
}
|