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.
Files changed (82) hide show
  1. package/README.md +114 -10
  2. package/dist/src/alpha6/adoption.d.ts +55 -0
  3. package/dist/src/alpha6/adoption.js +920 -0
  4. package/dist/src/alpha6/adoption.js.map +1 -0
  5. package/dist/src/alpha6/handoff.d.ts +40 -0
  6. package/dist/src/alpha6/handoff.js +981 -0
  7. package/dist/src/alpha6/handoff.js.map +1 -0
  8. package/dist/src/alpha6/journal.d.ts +30 -0
  9. package/dist/src/alpha6/journal.js +369 -0
  10. package/dist/src/alpha6/journal.js.map +1 -0
  11. package/dist/src/alpha6/milestone.d.ts +52 -0
  12. package/dist/src/alpha6/milestone.js +1103 -0
  13. package/dist/src/alpha6/milestone.js.map +1 -0
  14. package/dist/src/alpha6/plan-risk.d.ts +32 -0
  15. package/dist/src/alpha6/plan-risk.js +908 -0
  16. package/dist/src/alpha6/plan-risk.js.map +1 -0
  17. package/dist/src/alpha6/remediation.d.ts +21 -0
  18. package/dist/src/alpha6/remediation.js +754 -0
  19. package/dist/src/alpha6/remediation.js.map +1 -0
  20. package/dist/src/alpha6/review.d.ts +46 -0
  21. package/dist/src/alpha6/review.js +785 -0
  22. package/dist/src/alpha6/review.js.map +1 -0
  23. package/dist/src/alpha6/store-sidecars.d.ts +35 -0
  24. package/dist/src/alpha6/store-sidecars.js +281 -0
  25. package/dist/src/alpha6/store-sidecars.js.map +1 -0
  26. package/dist/src/alpha7/autonomy.d.ts +61 -0
  27. package/dist/src/alpha7/autonomy.js +256 -0
  28. package/dist/src/alpha7/autonomy.js.map +1 -0
  29. package/dist/src/cli.js +109 -19
  30. package/dist/src/cli.js.map +1 -1
  31. package/dist/src/contracts.d.ts +268 -0
  32. package/dist/src/git.js +2 -1
  33. package/dist/src/git.js.map +1 -1
  34. package/dist/src/index.d.ts +5 -0
  35. package/dist/src/index.js +3 -0
  36. package/dist/src/index.js.map +1 -1
  37. package/dist/src/reviewer.d.ts +6 -1
  38. package/dist/src/reviewer.js +145 -32
  39. package/dist/src/reviewer.js.map +1 -1
  40. package/dist/src/state/lock.d.ts +1 -0
  41. package/dist/src/state/lock.js +7 -1
  42. package/dist/src/state/lock.js.map +1 -1
  43. package/dist/src/state/store.d.ts +39 -1
  44. package/dist/src/state/store.js +127 -1
  45. package/dist/src/state/store.js.map +1 -1
  46. package/dist/src/version.d.ts +1 -1
  47. package/dist/src/version.js +1 -1
  48. package/dist/src/workflow.d.ts +113 -8
  49. package/dist/src/workflow.js +1635 -78
  50. package/dist/src/workflow.js.map +1 -1
  51. package/docs/autonomy-guardrails.md +164 -0
  52. package/docs/decisions.md +39 -0
  53. package/docs/delegated-approval.md +37 -5
  54. package/docs/development-flow.md +45 -1
  55. package/docs/pdf/codex-workflow-v2-architecture-ru.pdf +155 -136
  56. package/docs/pdf/codex-workflow-v2-chat-only-guide-ru.pdf +236 -223
  57. package/docs/pdf/codex-workflow-v2-technical-reference-ru.pdf +225 -206
  58. package/docs/project-memory.md +7 -0
  59. package/docs/release.md +9 -0
  60. package/docs/updating-existing-project.md +63 -5
  61. package/docs/validation-report.md +52 -34
  62. package/package.json +1 -1
  63. package/plugins/codex-workflow-gateway/references/protocol.md +182 -6
  64. package/plugins/codex-workflow-gateway/skills/codex-workflow-gateway/SKILL.md +35 -1
  65. package/references/git-policy.md +5 -2
  66. package/references/state-machine.md +43 -0
  67. package/references/validation-and-review.md +28 -1
  68. package/roles/delivery-coordinator.md +21 -1
  69. package/roles/independent-reviewer.md +3 -0
  70. package/roles/technical-planner.md +10 -0
  71. package/roles/worker.md +4 -0
  72. package/schemas/adoption-posture-event.schema.json +129 -0
  73. package/schemas/corrective-decision-event.schema.json +55 -0
  74. package/schemas/corrective-plan-audit.schema.json +20 -0
  75. package/schemas/milestone-autonomy-event.schema.json +45 -0
  76. package/schemas/milestone-scope-change-event.schema.json +70 -0
  77. package/schemas/milestone-transaction-journal.schema.json +95 -0
  78. package/schemas/plan-risk-audit-event.schema.json +107 -0
  79. package/schemas/remediation-event.schema.json +53 -0
  80. package/schemas/reviewer-attestation-event.schema.json +49 -0
  81. package/schemas/step-review-event.schema.json +74 -0
  82. package/schemas/task-handoff-event.schema.json +116 -0
@@ -0,0 +1,49 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://codex-workflow.local/schemas/reviewer-attestation-event.schema.json",
4
+ "title": "Codex Workflow V2 Alpha.6 Reviewer Attestation Event",
5
+ "type": "object",
6
+ "additionalProperties": false,
7
+ "required": [
8
+ "eventId",
9
+ "taskId",
10
+ "stepId",
11
+ "reviewer",
12
+ "isolationResult",
13
+ "outputHash",
14
+ "reviewedCommit",
15
+ "reviewEventHash",
16
+ "planHash",
17
+ "evidenceHash",
18
+ "previousEventHash",
19
+ "recordedAt",
20
+ "eventHash"
21
+ ],
22
+ "properties": {
23
+ "eventId": { "type": "string", "minLength": 1 },
24
+ "taskId": { "$ref": "#/$defs/taskId" },
25
+ "stepId": {
26
+ "oneOf": [
27
+ { "$ref": "#/$defs/stepId" },
28
+ { "const": "TASK_FINAL" }
29
+ ]
30
+ },
31
+ "reviewer": { "type": "string", "minLength": 1 },
32
+ "isolationResult": { "enum": ["verified", "unverified"] },
33
+ "outputHash": { "$ref": "#/$defs/hash64" },
34
+ "reviewedCommit": { "$ref": "#/$defs/gitHash" },
35
+ "reviewEventHash": { "$ref": "#/$defs/hash64" },
36
+ "planHash": { "$ref": "#/$defs/hash64" },
37
+ "evidenceHash": { "$ref": "#/$defs/nullableHash64" },
38
+ "previousEventHash": { "$ref": "#/$defs/nullableHash64" },
39
+ "recordedAt": { "type": "string", "format": "date-time" },
40
+ "eventHash": { "$ref": "#/$defs/hash64" }
41
+ },
42
+ "$defs": {
43
+ "taskId": { "type": "string", "pattern": "^TASK-[0-9A-HJKMNP-TV-Z]{26}$" },
44
+ "stepId": { "type": "string", "pattern": "^STEP-[0-9]{3}(?:-[A-Z0-9-]+)?$" },
45
+ "hash64": { "type": "string", "pattern": "^[a-f0-9]{64}$" },
46
+ "nullableHash64": { "type": ["string", "null"], "pattern": "^[a-f0-9]{64}$" },
47
+ "gitHash": { "type": "string", "pattern": "^[a-f0-9]{40,64}$" }
48
+ }
49
+ }
@@ -0,0 +1,74 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://codex-workflow.local/schemas/step-review-event.schema.json",
4
+ "title": "Codex Workflow V2 Alpha.6 Step Review Event",
5
+ "type": "object",
6
+ "additionalProperties": false,
7
+ "required": [
8
+ "eventId",
9
+ "taskId",
10
+ "taskRevision",
11
+ "stepId",
12
+ "stepDefinitionHash",
13
+ "completionCommit",
14
+ "checksHash",
15
+ "planHash",
16
+ "evidenceHash",
17
+ "eventType",
18
+ "decision",
19
+ "reviewerAttestationHash",
20
+ "previousEventHash",
21
+ "recordedAt",
22
+ "eventHash"
23
+ ],
24
+ "properties": {
25
+ "eventId": { "type": "string", "minLength": 1 },
26
+ "taskId": { "$ref": "#/$defs/taskId" },
27
+ "taskRevision": { "type": "integer", "minimum": 1 },
28
+ "stepId": { "$ref": "#/$defs/stepId" },
29
+ "stepDefinitionHash": { "$ref": "#/$defs/hash64" },
30
+ "completionCommit": { "$ref": "#/$defs/gitHash" },
31
+ "checksHash": { "$ref": "#/$defs/hash64" },
32
+ "planHash": { "$ref": "#/$defs/hash64" },
33
+ "evidenceHash": { "$ref": "#/$defs/nullableHash64" },
34
+ "eventType": { "enum": ["pending", "review-recorded", "attestation-verified"] },
35
+ "decision": { "enum": ["pending", "passed", "failed", "unverified"] },
36
+ "reviewerAttestationHash": { "$ref": "#/$defs/nullableHash64" },
37
+ "previousEventHash": { "$ref": "#/$defs/nullableHash64" },
38
+ "recordedAt": { "type": "string", "format": "date-time" },
39
+ "eventHash": { "$ref": "#/$defs/hash64" }
40
+ },
41
+ "allOf": [
42
+ {
43
+ "if": {
44
+ "properties": { "eventType": { "const": "pending" } },
45
+ "required": ["eventType"]
46
+ },
47
+ "then": {
48
+ "properties": {
49
+ "decision": { "const": "pending" },
50
+ "reviewerAttestationHash": { "const": null }
51
+ }
52
+ }
53
+ },
54
+ {
55
+ "if": {
56
+ "properties": { "eventType": { "const": "attestation-verified" } },
57
+ "required": ["eventType"]
58
+ },
59
+ "then": {
60
+ "properties": {
61
+ "decision": { "enum": ["passed", "failed", "unverified"] },
62
+ "reviewerAttestationHash": { "$ref": "#/$defs/hash64" }
63
+ }
64
+ }
65
+ }
66
+ ],
67
+ "$defs": {
68
+ "taskId": { "type": "string", "pattern": "^TASK-[0-9A-HJKMNP-TV-Z]{26}$" },
69
+ "stepId": { "type": "string", "pattern": "^STEP-[0-9]{3}(?:-[A-Z0-9-]+)?$" },
70
+ "hash64": { "type": "string", "pattern": "^[a-f0-9]{64}$" },
71
+ "nullableHash64": { "type": ["string", "null"], "pattern": "^[a-f0-9]{64}$" },
72
+ "gitHash": { "type": "string", "pattern": "^[a-f0-9]{40,64}$" }
73
+ }
74
+ }
@@ -0,0 +1,116 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://codex-workflow.local/schemas/task-handoff-event.schema.json",
4
+ "title": "Codex Workflow V2 Alpha.6 Task Handoff Event",
5
+ "type": "object",
6
+ "additionalProperties": false,
7
+ "required": [
8
+ "eventId",
9
+ "handoffId",
10
+ "taskId",
11
+ "taskRevision",
12
+ "milestoneId",
13
+ "milestoneDisplayNumber",
14
+ "taskDisplayNumber",
15
+ "briefHash",
16
+ "planHash",
17
+ "knowledgeMapRevision",
18
+ "knowledgeMapHash",
19
+ "expectedNext",
20
+ "delegate",
21
+ "grantId",
22
+ "claimTokenHash",
23
+ "expiresAt",
24
+ "eventType",
25
+ "coordinationLevel",
26
+ "actor",
27
+ "targetActor",
28
+ "machineEvidence",
29
+ "writerLeaseTokenHash",
30
+ "reason",
31
+ "handback",
32
+ "previousEventHash",
33
+ "recordedAt",
34
+ "eventHash"
35
+ ],
36
+ "properties": {
37
+ "eventId": { "type": "string", "minLength": 1 },
38
+ "handoffId": { "type": "string", "pattern": "^THO-[0-9A-HJKMNP-TV-Z]{26}$" },
39
+ "taskId": { "$ref": "#/$defs/taskId" },
40
+ "taskRevision": { "type": "integer", "minimum": 1 },
41
+ "milestoneId": { "type": ["string", "null"], "pattern": "^MS-[0-9A-HJKMNP-TV-Z]{26}$" },
42
+ "milestoneDisplayNumber": { "type": ["integer", "null"], "minimum": 1 },
43
+ "taskDisplayNumber": { "type": ["integer", "null"], "minimum": 1 },
44
+ "briefHash": { "$ref": "#/$defs/hash64" },
45
+ "planHash": { "$ref": "#/$defs/nullableHash64" },
46
+ "knowledgeMapRevision": { "type": ["integer", "null"], "minimum": 1 },
47
+ "knowledgeMapHash": { "$ref": "#/$defs/nullableHash64" },
48
+ "expectedNext": { "type": "string", "minLength": 1 },
49
+ "delegate": { "type": "string", "minLength": 1 },
50
+ "grantId": { "type": ["string", "null"], "minLength": 1 },
51
+ "claimTokenHash": { "$ref": "#/$defs/hash64" },
52
+ "expiresAt": { "type": "string", "format": "date-time" },
53
+ "eventType": { "enum": ["handoff", "claim", "handback"] },
54
+ "coordinationLevel": { "const": "C1" },
55
+ "actor": { "type": "string", "minLength": 1 },
56
+ "targetActor": { "type": ["string", "null"], "minLength": 1 },
57
+ "machineEvidence": {
58
+ "type": "object",
59
+ "additionalProperties": false,
60
+ "required": ["hostname", "pid", "platform", "arch", "nodeVersion"],
61
+ "properties": {
62
+ "hostname": { "type": "string", "minLength": 1 },
63
+ "pid": { "type": "integer", "minimum": 1 },
64
+ "platform": { "type": "string", "minLength": 1 },
65
+ "arch": { "type": "string", "minLength": 1 },
66
+ "nodeVersion": { "type": "string", "minLength": 1 }
67
+ }
68
+ },
69
+ "writerLeaseTokenHash": { "$ref": "#/$defs/nullableHash64" },
70
+ "reason": { "type": "string", "minLength": 1 },
71
+ "handback": {
72
+ "oneOf": [
73
+ { "type": "null" },
74
+ { "$ref": "#/$defs/handback" }
75
+ ]
76
+ },
77
+ "previousEventHash": { "$ref": "#/$defs/nullableHash64" },
78
+ "recordedAt": { "type": "string", "format": "date-time" },
79
+ "eventHash": { "$ref": "#/$defs/hash64" }
80
+ },
81
+ "allOf": [
82
+ {
83
+ "if": {
84
+ "properties": { "eventType": { "const": "handoff" } },
85
+ "required": ["eventType"]
86
+ },
87
+ "then": {
88
+ "properties": {
89
+ "targetActor": { "type": "string", "minLength": 1 }
90
+ }
91
+ }
92
+ }
93
+ ],
94
+ "$defs": {
95
+ "taskId": { "type": "string", "pattern": "^TASK-[0-9A-HJKMNP-TV-Z]{26}$" },
96
+ "hash64": { "type": "string", "pattern": "^[a-f0-9]{64}$" },
97
+ "nullableHash64": { "type": ["string", "null"], "pattern": "^[a-f0-9]{64}$" }
98
+ ,"handback": {
99
+ "type": "object",
100
+ "additionalProperties": false,
101
+ "required": ["status", "mergedCommit", "planHash", "resultHash", "evidenceHash", "reviewAttestationHash", "knowledgeMapRevision", "knowledgeMapHash", "limitations", "recommendedNext"],
102
+ "properties": {
103
+ "status": { "enum": ["merged", "cancelled"] },
104
+ "mergedCommit": { "type": ["string", "null"], "pattern": "^[a-f0-9]{40,64}$" },
105
+ "planHash": { "$ref": "#/$defs/nullableHash64" },
106
+ "resultHash": { "$ref": "#/$defs/nullableHash64" },
107
+ "evidenceHash": { "$ref": "#/$defs/nullableHash64" },
108
+ "reviewAttestationHash": { "$ref": "#/$defs/nullableHash64" },
109
+ "knowledgeMapRevision": { "type": ["integer", "null"], "minimum": 1 },
110
+ "knowledgeMapHash": { "$ref": "#/$defs/nullableHash64" },
111
+ "limitations": { "type": "array", "items": { "type": "string" } },
112
+ "recommendedNext": { "type": "string", "minLength": 1 }
113
+ }
114
+ }
115
+ }
116
+ }