codex-workflow-v2 2.0.0-alpha.3 → 2.0.0-alpha.6
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 +104 -7
- 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 +39 -0
- package/dist/src/alpha6/handoff.js +975 -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 +49 -0
- package/dist/src/alpha6/milestone.js +1049 -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 +847 -0
- package/dist/src/alpha6/plan-risk.js.map +1 -0
- package/dist/src/alpha6/remediation.d.ts +20 -0
- package/dist/src/alpha6/remediation.js +748 -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/cli.js +110 -23
- package/dist/src/cli.js.map +1 -1
- package/dist/src/contracts.d.ts +319 -1
- package/dist/src/delegation.d.ts +8 -0
- package/dist/src/delegation.js +155 -0
- package/dist/src/delegation.js.map +1 -0
- package/dist/src/git.js +2 -1
- package/dist/src/git.js.map +1 -1
- package/dist/src/index.d.ts +3 -0
- package/dist/src/index.js +1 -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 +43 -1
- package/dist/src/state/store.js +140 -1
- package/dist/src/state/store.js.map +1 -1
- package/dist/src/ulid.d.ts +1 -1
- package/dist/src/ulid.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 +91 -13
- package/dist/src/workflow.js +1459 -76
- package/dist/src/workflow.js.map +1 -1
- package/docs/autonomy-guardrails.md +143 -0
- package/docs/decisions.md +30 -0
- package/docs/delegated-approval.md +189 -0
- package/docs/development-flow.md +53 -2
- package/docs/pdf/codex-workflow-v2-architecture-ru.pdf +426 -410
- package/docs/pdf/codex-workflow-v2-chat-only-guide-ru.pdf +778 -612
- package/docs/pdf/codex-workflow-v2-technical-reference-ru.pdf +526 -452
- package/docs/project-memory.md +7 -0
- package/docs/release.md +7 -0
- package/docs/updating-existing-project.md +141 -4
- package/docs/validation-report.md +47 -24
- package/package.json +1 -1
- package/plugins/codex-workflow-gateway/references/protocol.md +162 -5
- package/plugins/codex-workflow-gateway/skills/codex-workflow-gateway/SKILL.md +38 -3
- package/references/git-policy.md +5 -2
- package/references/state-machine.md +48 -0
- package/references/validation-and-review.md +28 -1
- package/roles/delivery-coordinator.md +11 -0
- package/roles/independent-reviewer.md +3 -0
- package/roles/technical-planner.md +7 -0
- package/roles/worker.md +4 -0
- package/schemas/adoption-posture-event.schema.json +129 -0
- package/schemas/authorization-event.schema.json +55 -0
- package/schemas/corrective-decision-event.schema.json +55 -0
- package/schemas/corrective-plan-audit.schema.json +20 -0
- package/schemas/delegation-grant.schema.json +69 -0
- package/schemas/milestone-scope-change-event.schema.json +68 -0
- package/schemas/milestone-transaction-journal.schema.json +95 -0
- package/schemas/plan-risk-audit-event.schema.json +90 -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
|
@@ -1,18 +1,45 @@
|
|
|
1
1
|
# Validation and Review
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
The Worker leaves Step changes uncommitted. `task step-complete` runs the configured checks,
|
|
4
|
+
creates the atomic Step commit, and records its evidence. Manual Worker commits are rejected
|
|
5
|
+
as unrecorded history. Submission produces
|
|
4
6
|
evidence for the exact task-branch head. Independent review is read-only and produces a
|
|
5
7
|
version-bound result. Any later commit or change to Brief, Plan, or evidence makes that
|
|
6
8
|
review stale. The user grants final acceptance only after a passing fresh review and a
|
|
7
9
|
human-readable Result.
|
|
8
10
|
|
|
11
|
+
High-risk evidence is failure-oriented. Migration acceptance includes a populated forward
|
|
12
|
+
upgrade, concurrent state includes deterministic races, restart/replay claims include crash
|
|
13
|
+
windows, and provider integrations include failure injection plus hidden-default checks.
|
|
14
|
+
Happy-path green tests do not replace this evidence.
|
|
15
|
+
|
|
16
|
+
After two failed independent reviews, another corrective Plan requires a distinct Auditor.
|
|
17
|
+
The Auditor covers every latest finding and records `continue-fix`, `replan-required`,
|
|
18
|
+
`split-required`, or `stop-escalate`. Only `continue-fix` may be passed to `task plan-set`
|
|
19
|
+
through `--corrective-audit-file`; the other decisions stop implementation.
|
|
20
|
+
|
|
9
21
|
The strict path is `task review-launch`. It starts an ephemeral Codex process with user
|
|
10
22
|
configuration and rules ignored, a read-only sandbox, structured output, and an attempted
|
|
11
23
|
write probe. The core seals repository HEAD, status, and content before/after the process.
|
|
12
24
|
Any process error, malformed output, successful write, or changed seal records an
|
|
13
25
|
`unverified` review and blocks Result creation and final acceptance.
|
|
14
26
|
|
|
27
|
+
Alpha.6 adds a Step-level strict path for high-risk work. If the current Plan Risk Audit marks
|
|
28
|
+
the completed Step for strict review, `next` routes to `task step-review` instead of
|
|
29
|
+
advancing ordinary execution. The workflow validates:
|
|
30
|
+
|
|
31
|
+
- the exact completion commit
|
|
32
|
+
- the current Plan hash
|
|
33
|
+
- the Step definition hash
|
|
34
|
+
- the review sidecar chain in `step-review-events.jsonl`
|
|
35
|
+
- the reviewer attestation chain in `reviewer-attestations.jsonl`
|
|
36
|
+
|
|
37
|
+
Any stale, malformed, unverified, or wrong-commit evidence fails closed and keeps the Step out
|
|
38
|
+
of canonical `completed` status.
|
|
39
|
+
|
|
15
40
|
Milestone validation similarly binds Result and evidence to the clean base HEAD. Its final
|
|
16
41
|
acceptance is a separate turn: `next` emits a confirmation code bound to the current
|
|
17
42
|
revision, Plan, Result, evidence, and HEAD; the coordinator shows it and stops. A later user
|
|
18
43
|
response must explicitly approve that exact code before the CLI transition is invoked.
|
|
44
|
+
With a matching delegated option, the exact delegate may use the current code in the same
|
|
45
|
+
turn, but the authorization event must keep the delegate actor and principal/grant evidence.
|
|
@@ -14,4 +14,15 @@ Own state transitions, dispatch envelopes, evidence collection, and recovery gui
|
|
|
14
14
|
- Accept a Milestone only after a later user message explicitly approves that exact
|
|
15
15
|
confirmation code. Do not infer approval from a request to validate, finish, or continue.
|
|
16
16
|
- Dispatch one Worker at a time for a concrete Step.
|
|
17
|
+
- A Milestone coordinator creates one dedicated user-visible Codex Task chat for each required
|
|
18
|
+
Task. The Milestone chat owns ordering, exact delegated approvals, merge observation,
|
|
19
|
+
validation, and final acceptance; it does not accumulate implementation for every Task.
|
|
20
|
+
- Before authorizing a high-risk Plan, require the Technical Planner's migration/concurrency/
|
|
21
|
+
restart/crash/provider risk review and failure-specific checks.
|
|
22
|
+
- After a second failed independent Task review, require a separate corrective Plan Auditor
|
|
23
|
+
and pass its evidence through `--corrective-audit-file`. Continue only for
|
|
24
|
+
`decision=continue-fix`; replan/split/stop decisions return to the coordinator or user.
|
|
25
|
+
- Use `task context-refresh` only when `next.contextRefresh` offers the exact delegated,
|
|
26
|
+
content-only option. Classification, authority, source-set, gap, or conflict changes still
|
|
27
|
+
require the ordinary visible Knowledge Map flow.
|
|
17
28
|
- 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,12 @@ 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
|
+
- Split a Task when one acceptance slice would otherwise combine persistence migration,
|
|
14
|
+
recovery orchestration, and executable composition. Do not use arbitrary line/file limits;
|
|
15
|
+
split on independently verifiable failure boundaries.
|
|
9
16
|
- Do not edit production files or silently expand the Brief.
|
|
10
17
|
- 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/authorization-event.schema.json",
|
|
4
|
+
"title": "Codex Workflow V2 Authorization Event",
|
|
5
|
+
"type": "object",
|
|
6
|
+
"additionalProperties": false,
|
|
7
|
+
"required": [
|
|
8
|
+
"kind", "decision", "actor", "recordedAt", "briefHash", "planHash", "resultHash",
|
|
9
|
+
"evidenceHash", "headCommit", "reason"
|
|
10
|
+
],
|
|
11
|
+
"properties": {
|
|
12
|
+
"kind": { "enum": ["execution", "final_acceptance", "exception"] },
|
|
13
|
+
"decision": { "enum": ["approved", "rejected", "waived", "superseded"] },
|
|
14
|
+
"actor": { "type": "string", "minLength": 1 },
|
|
15
|
+
"recordedAt": { "type": "string", "format": "date-time" },
|
|
16
|
+
"briefHash": { "$ref": "#/$defs/nullableHash" },
|
|
17
|
+
"planHash": { "$ref": "#/$defs/nullableHash" },
|
|
18
|
+
"resultHash": { "$ref": "#/$defs/nullableHash" },
|
|
19
|
+
"evidenceHash": { "$ref": "#/$defs/nullableHash" },
|
|
20
|
+
"headCommit": { "$ref": "#/$defs/nullableHash" },
|
|
21
|
+
"reason": { "type": "string" },
|
|
22
|
+
"authorizationMode": { "enum": ["human", "delegated"] },
|
|
23
|
+
"delegation": { "$ref": "#/$defs/delegation" }
|
|
24
|
+
},
|
|
25
|
+
"allOf": [
|
|
26
|
+
{
|
|
27
|
+
"if": {
|
|
28
|
+
"properties": { "authorizationMode": { "const": "delegated" } },
|
|
29
|
+
"required": ["authorizationMode"]
|
|
30
|
+
},
|
|
31
|
+
"then": { "required": ["delegation"] }
|
|
32
|
+
}
|
|
33
|
+
],
|
|
34
|
+
"$defs": {
|
|
35
|
+
"nullableHash": { "type": ["string", "null"], "pattern": "^[a-f0-9]{40,64}$" },
|
|
36
|
+
"delegation": {
|
|
37
|
+
"type": "object",
|
|
38
|
+
"additionalProperties": false,
|
|
39
|
+
"required": ["grantId", "policyHash", "principal", "delegate", "transition"],
|
|
40
|
+
"properties": {
|
|
41
|
+
"grantId": { "type": "string", "pattern": "^DGR-[0-9A-HJKMNP-TV-Z]{26}$" },
|
|
42
|
+
"policyHash": { "type": "string", "pattern": "^[a-f0-9]{64}$" },
|
|
43
|
+
"principal": { "type": "string", "minLength": 1 },
|
|
44
|
+
"delegate": { "type": "string", "minLength": 1 },
|
|
45
|
+
"transition": {
|
|
46
|
+
"enum": [
|
|
47
|
+
"project_memory.approve",
|
|
48
|
+
"task.execution_authorize", "task.final_accept",
|
|
49
|
+
"milestone.execution_authorize", "milestone.final_accept"
|
|
50
|
+
]
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
}
|
|
@@ -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,69 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://codex-workflow.local/schemas/delegation-grant.schema.json",
|
|
4
|
+
"title": "Codex Workflow V2 Delegation Grant",
|
|
5
|
+
"type": "object",
|
|
6
|
+
"additionalProperties": false,
|
|
7
|
+
"required": [
|
|
8
|
+
"schemaVersion", "revision", "id", "projectId", "createdAt", "updatedAt", "kind",
|
|
9
|
+
"status", "principal", "delegate", "scope", "transitions", "expiresAt", "policyHash",
|
|
10
|
+
"revokedAt", "revokedBy", "revokeReason"
|
|
11
|
+
],
|
|
12
|
+
"properties": {
|
|
13
|
+
"schemaVersion": { "const": 2 },
|
|
14
|
+
"revision": { "type": "integer", "minimum": 1 },
|
|
15
|
+
"id": { "type": "string", "pattern": "^DGR-[0-9A-HJKMNP-TV-Z]{26}$" },
|
|
16
|
+
"projectId": { "type": "string", "pattern": "^[a-f0-9]{24}$" },
|
|
17
|
+
"createdAt": { "type": "string", "format": "date-time" },
|
|
18
|
+
"updatedAt": { "type": "string", "format": "date-time" },
|
|
19
|
+
"kind": { "const": "delegation-grant" },
|
|
20
|
+
"status": { "enum": ["active", "revoked"] },
|
|
21
|
+
"principal": { "type": "string", "minLength": 1 },
|
|
22
|
+
"delegate": { "type": "string", "minLength": 1 },
|
|
23
|
+
"scope": {
|
|
24
|
+
"oneOf": [
|
|
25
|
+
{
|
|
26
|
+
"type": "object",
|
|
27
|
+
"additionalProperties": false,
|
|
28
|
+
"required": ["kind"],
|
|
29
|
+
"properties": { "kind": { "const": "project" } }
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
"type": "object",
|
|
33
|
+
"additionalProperties": false,
|
|
34
|
+
"required": ["kind", "id"],
|
|
35
|
+
"properties": {
|
|
36
|
+
"kind": { "const": "milestone" },
|
|
37
|
+
"id": { "type": "string", "pattern": "^MS-[0-9A-HJKMNP-TV-Z]{26}$" }
|
|
38
|
+
}
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
"type": "object",
|
|
42
|
+
"additionalProperties": false,
|
|
43
|
+
"required": ["kind", "id"],
|
|
44
|
+
"properties": {
|
|
45
|
+
"kind": { "const": "task" },
|
|
46
|
+
"id": { "type": "string", "pattern": "^TASK-[0-9A-HJKMNP-TV-Z]{26}$" }
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
]
|
|
50
|
+
},
|
|
51
|
+
"transitions": {
|
|
52
|
+
"type": "array",
|
|
53
|
+
"minItems": 1,
|
|
54
|
+
"uniqueItems": true,
|
|
55
|
+
"items": {
|
|
56
|
+
"enum": [
|
|
57
|
+
"project_memory.approve",
|
|
58
|
+
"task.execution_authorize", "task.final_accept",
|
|
59
|
+
"milestone.execution_authorize", "milestone.final_accept"
|
|
60
|
+
]
|
|
61
|
+
}
|
|
62
|
+
},
|
|
63
|
+
"expiresAt": { "type": "string", "format": "date-time" },
|
|
64
|
+
"policyHash": { "type": "string", "pattern": "^[a-f0-9]{64}$" },
|
|
65
|
+
"revokedAt": { "type": ["string", "null"], "format": "date-time" },
|
|
66
|
+
"revokedBy": { "type": ["string", "null"] },
|
|
67
|
+
"revokeReason": { "type": ["string", "null"] }
|
|
68
|
+
}
|
|
69
|
+
}
|
|
@@ -0,0 +1,68 @@
|
|
|
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.6 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
|
+
"previousEventHash": { "$ref": "#/$defs/nullableHash64" },
|
|
36
|
+
"recordedAt": { "type": "string", "format": "date-time" },
|
|
37
|
+
"eventHash": { "$ref": "#/$defs/hash64" }
|
|
38
|
+
},
|
|
39
|
+
"$defs": {
|
|
40
|
+
"milestoneId": { "type": "string", "pattern": "^MS-[0-9A-HJKMNP-TV-Z]{26}$" },
|
|
41
|
+
"taskId": { "type": "string", "pattern": "^TASK-[0-9A-HJKMNP-TV-Z]{26}$" },
|
|
42
|
+
"hash64": { "type": "string", "pattern": "^[a-f0-9]{64}$" },
|
|
43
|
+
"nullableHash64": { "type": ["string", "null"], "pattern": "^[a-f0-9]{64}$" },
|
|
44
|
+
"membership": {
|
|
45
|
+
"type": "object",
|
|
46
|
+
"additionalProperties": false,
|
|
47
|
+
"required": ["taskId", "disposition", "reason"],
|
|
48
|
+
"properties": {
|
|
49
|
+
"taskId": { "$ref": "#/$defs/taskId" },
|
|
50
|
+
"disposition": { "enum": ["required", "waived", "cancelled"] },
|
|
51
|
+
"reason": { "type": "string" }
|
|
52
|
+
}
|
|
53
|
+
},
|
|
54
|
+
"scopeSnapshot": {
|
|
55
|
+
"type": "object",
|
|
56
|
+
"additionalProperties": false,
|
|
57
|
+
"required": ["outcome", "successSignal", "acceptance", "checks", "taskIds", "memberships"],
|
|
58
|
+
"properties": {
|
|
59
|
+
"outcome": { "type": "string" },
|
|
60
|
+
"successSignal": { "type": "string" },
|
|
61
|
+
"acceptance": { "type": "array", "items": { "type": "string", "minLength": 1 } },
|
|
62
|
+
"checks": { "type": "array", "items": { "type": "string", "minLength": 1 } },
|
|
63
|
+
"taskIds": { "type": "array", "uniqueItems": true, "items": { "$ref": "#/$defs/taskId" } },
|
|
64
|
+
"memberships": { "type": "array", "items": { "$ref": "#/$defs/membership" } }
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
}
|
|
@@ -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
|
+
}
|