codex-workflow-v2 2.0.0-beta.12.9 → 2.0.0-beta.13

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 (116) hide show
  1. package/README.md +58 -16
  2. package/dist/reviewer-runtime-build.json +1092 -0
  3. package/dist/src/alpha6/check-support-anchor.d.ts +24 -0
  4. package/dist/src/alpha6/check-support-anchor.js +102 -0
  5. package/dist/src/alpha6/check-support-anchor.js.map +1 -0
  6. package/dist/src/alpha6/component-owner.d.ts +28 -0
  7. package/dist/src/alpha6/component-owner.js +95 -0
  8. package/dist/src/alpha6/component-owner.js.map +1 -0
  9. package/dist/src/alpha6/downstream-proof.js +4 -2
  10. package/dist/src/alpha6/downstream-proof.js.map +1 -1
  11. package/dist/src/alpha6/mechanical-feasibility.js +42 -12
  12. package/dist/src/alpha6/mechanical-feasibility.js.map +1 -1
  13. package/dist/src/alpha6/milestone.d.ts +6 -2
  14. package/dist/src/alpha6/milestone.js +164 -10
  15. package/dist/src/alpha6/milestone.js.map +1 -1
  16. package/dist/src/alpha6/npm-check-contract.d.ts +11 -0
  17. package/dist/src/alpha6/npm-check-contract.js +36 -0
  18. package/dist/src/alpha6/npm-check-contract.js.map +1 -0
  19. package/dist/src/alpha6/plan-integrity.js +157 -27
  20. package/dist/src/alpha6/plan-integrity.js.map +1 -1
  21. package/dist/src/alpha6/plan-risk.js +3 -1
  22. package/dist/src/alpha6/plan-risk.js.map +1 -1
  23. package/dist/src/alpha6/remediation-cause.d.ts +13 -0
  24. package/dist/src/alpha6/remediation-cause.js +77 -0
  25. package/dist/src/alpha6/remediation-cause.js.map +1 -0
  26. package/dist/src/alpha6/remediation.d.ts +15 -4
  27. package/dist/src/alpha6/remediation.js +430 -67
  28. package/dist/src/alpha6/remediation.js.map +1 -1
  29. package/dist/src/alpha6/review.js +34 -4
  30. package/dist/src/alpha6/review.js.map +1 -1
  31. package/dist/src/artifacts.js +6 -0
  32. package/dist/src/artifacts.js.map +1 -1
  33. package/dist/src/cli-actions.d.ts +25 -0
  34. package/dist/src/cli-actions.js +109 -0
  35. package/dist/src/cli-actions.js.map +1 -0
  36. package/dist/src/cli.js +216 -258
  37. package/dist/src/cli.js.map +1 -1
  38. package/dist/src/contracts.d.ts +166 -5
  39. package/dist/src/credential-transport.d.ts +38 -0
  40. package/dist/src/credential-transport.js +156 -0
  41. package/dist/src/credential-transport.js.map +1 -0
  42. package/dist/src/dependency-provenance.d.ts +23 -2
  43. package/dist/src/dependency-provenance.js +221 -34
  44. package/dist/src/dependency-provenance.js.map +1 -1
  45. package/dist/src/domain/completed-step-carryover.d.ts +13 -0
  46. package/dist/src/domain/completed-step-carryover.js +71 -0
  47. package/dist/src/domain/completed-step-carryover.js.map +1 -0
  48. package/dist/src/domain/validation.d.ts +9 -1
  49. package/dist/src/domain/validation.js +86 -0
  50. package/dist/src/domain/validation.js.map +1 -1
  51. package/dist/src/gateway-handshake.d.ts +11 -0
  52. package/dist/src/gateway-handshake.js +92 -0
  53. package/dist/src/gateway-handshake.js.map +1 -0
  54. package/dist/src/index.d.ts +2 -0
  55. package/dist/src/index.js +2 -0
  56. package/dist/src/index.js.map +1 -1
  57. package/dist/src/lifecycle/corrective-replan-binding-manifest.d.ts +5 -0
  58. package/dist/src/lifecycle/corrective-replan-binding-manifest.js +9 -0
  59. package/dist/src/lifecycle/corrective-replan-binding-manifest.js.map +1 -1
  60. package/dist/src/lifecycle/corrective-replan.js +1 -1
  61. package/dist/src/lifecycle/corrective-replan.js.map +1 -1
  62. package/dist/src/lifecycle/semantic-registry.js +1 -1
  63. package/dist/src/observation.js +1 -2
  64. package/dist/src/observation.js.map +1 -1
  65. package/dist/src/observed-routes.d.ts +114 -0
  66. package/dist/src/observed-routes.js +545 -0
  67. package/dist/src/observed-routes.js.map +1 -0
  68. package/dist/src/operational-contract.d.ts +26 -0
  69. package/dist/src/operational-contract.js +94 -0
  70. package/dist/src/operational-contract.js.map +1 -0
  71. package/dist/src/reviewer.d.ts +218 -8
  72. package/dist/src/reviewer.js +927 -25
  73. package/dist/src/reviewer.js.map +1 -1
  74. package/dist/src/state/corrective-replan-executor.js +18 -15
  75. package/dist/src/state/corrective-replan-executor.js.map +1 -1
  76. package/dist/src/state/corrective-replan-public.js +35 -10
  77. package/dist/src/state/corrective-replan-public.js.map +1 -1
  78. package/dist/src/state/corrective-replan-transaction.js +12 -4
  79. package/dist/src/state/corrective-replan-transaction.js.map +1 -1
  80. package/dist/src/state/corrective-yield-transaction.js +11 -2
  81. package/dist/src/state/corrective-yield-transaction.js.map +1 -1
  82. package/dist/src/state/lock.d.ts +1 -0
  83. package/dist/src/state/lock.js +24 -0
  84. package/dist/src/state/lock.js.map +1 -1
  85. package/dist/src/version.d.ts +1 -1
  86. package/dist/src/version.js +1 -1
  87. package/dist/src/version.js.map +1 -1
  88. package/dist/src/workflow.d.ts +65 -4
  89. package/dist/src/workflow.js +1704 -155
  90. package/dist/src/workflow.js.map +1 -1
  91. package/docs/autonomy-guardrails.md +41 -14
  92. package/docs/delegated-approval.md +6 -1
  93. package/docs/development-flow.md +42 -12
  94. package/docs/pdf/codex-workflow-v2-architecture-ru.pdf +0 -0
  95. package/docs/pdf/codex-workflow-v2-chat-only-guide-ru.pdf +0 -0
  96. package/docs/pdf/codex-workflow-v2-technical-reference-ru.pdf +0 -0
  97. package/docs/pdf/sources/codex-workflow-v2-architecture-ru.md +181 -22
  98. package/docs/pdf/sources/codex-workflow-v2-chat-only-guide-ru.md +148 -26
  99. package/docs/pdf/sources/codex-workflow-v2-technical-reference-ru.md +326 -52
  100. package/docs/problem-briefs/01-pre-implementation-integrity.md +11 -7
  101. package/docs/problem-briefs/04-task-dependency-and-structural-replacement-integrity.md +13 -6
  102. package/docs/problem-briefs/README.md +11 -11
  103. package/docs/release.md +83 -9
  104. package/docs/updating-existing-project.md +205 -0
  105. package/docs/validation-report.md +156 -99
  106. package/package.json +12 -3
  107. package/plugins/codex-workflow-gateway/skills/codex-workflow-gateway/SKILL.md +42 -1
  108. package/schemas/authorization-event.schema.json +10 -3
  109. package/schemas/corrective-decision-event.schema.json +164 -9
  110. package/schemas/corrective-replan-credentials.private.schema.json +4 -2
  111. package/schemas/milestone-scope-change-event.schema.json +25 -1
  112. package/schemas/remediation-event.schema.json +17 -1
  113. package/schemas/review-result.schema.json +1 -0
  114. package/schemas/step-review-event.schema.json +15 -0
  115. package/schemas/task.schema.json +61 -1
  116. package/schemas/transition-definition.schema.json +8 -0
@@ -12,14 +12,16 @@
12
12
  },
13
13
  "bindingValues": {
14
14
  "type": "object", "additionalProperties": false,
15
- "required": ["transitionId", "runtimeFingerprint", "catalogHash", "lifecycleEpoch", "taskId", "revision", "currentPlanHash", "briefHash", "knowledgeRevision", "knowledgeHash", "gitHead", "guardedStepId", "correctiveDecisionEventId", "correctiveDecisionHash", "attemptCount", "remediationTailHash", "candidatePlanHash", "candidateStepSetHash", "planAuthorIdentityHash", "planValidationHash", "planValidatorIdentityHash", "riskAuditHash", "riskAuditorIdentityHash", "actorIdentityHash", "actorRole", "humanPrincipalIdentityHash", "capabilityId", "capabilityVersion"],
15
+ "required": ["transitionId", "runtimeFingerprint", "catalogHash", "lifecycleEpoch", "taskId", "revision", "currentPlanHash", "briefHash", "knowledgeRevision", "knowledgeHash", "targetKnowledgeRevision", "targetKnowledgeHash", "gitHead", "guardedStepId", "correctiveDecisionEventId", "correctiveDecisionHash", "attemptCount", "remediationTailHash", "candidatePlanHash", "candidateStepSetHash", "planAuthorIdentityHash", "planValidationHash", "planValidatorIdentityHash", "riskAuditHash", "riskAuditorIdentityHash", "actorIdentityHash", "actorRole", "humanPrincipalIdentityHash", "capabilityId", "capabilityVersion"],
16
16
  "properties": {
17
17
  "transitionId": { "const": "task.plan.corrective-replan" },
18
18
  "runtimeFingerprint": { "$ref": "#/$defs/hash" }, "catalogHash": { "$ref": "#/$defs/hash" },
19
19
  "lifecycleEpoch": { "const": 2 }, "taskId": { "$ref": "#/$defs/id" },
20
20
  "revision": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 }, "currentPlanHash": { "$ref": "#/$defs/hash" },
21
21
  "briefHash": { "$ref": "#/$defs/hash" }, "knowledgeRevision": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 },
22
- "knowledgeHash": { "$ref": "#/$defs/hash" }, "gitHead": { "type": "string", "pattern": "^(?:[a-f0-9]{40}|[a-f0-9]{64})$" },
22
+ "knowledgeHash": { "$ref": "#/$defs/hash" },
23
+ "targetKnowledgeRevision": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 },
24
+ "targetKnowledgeHash": { "$ref": "#/$defs/hash" }, "gitHead": { "type": "string", "pattern": "^(?:[a-f0-9]{40}|[a-f0-9]{64})$" },
23
25
  "guardedStepId": { "$ref": "#/$defs/id" }, "correctiveDecisionEventId": { "$ref": "#/$defs/id" },
24
26
  "correctiveDecisionHash": { "$ref": "#/$defs/hash" }, "attemptCount": { "type": "integer", "minimum": 2, "maximum": 9007199254740991 },
25
27
  "remediationTailHash": { "$ref": "#/$defs/hash" }, "candidatePlanHash": { "$ref": "#/$defs/hash" },
@@ -32,8 +32,9 @@
32
32
  "after": { "$ref": "#/$defs/scopeSnapshot" },
33
33
  "actor": { "type": "string", "minLength": 1 },
34
34
  "confirmationCodeBindingHash": { "$ref": "#/$defs/hash64" },
35
- "authorizationMode": { "enum": ["human", "milestone-autonomy"] },
35
+ "authorizationMode": { "enum": ["human", "milestone-autonomy", "audited-remediation"] },
36
36
  "autonomyContractEventHash": { "$ref": "#/$defs/nullableHash64" },
37
+ "remediationEvidence": { "$ref": "#/$defs/remediationEvidence" },
37
38
  "previousEventHash": { "$ref": "#/$defs/nullableHash64" },
38
39
  "recordedAt": { "type": "string", "format": "date-time" },
39
40
  "eventHash": { "$ref": "#/$defs/hash64" }
@@ -43,6 +44,29 @@
43
44
  "taskId": { "type": "string", "pattern": "^TASK-[0-9A-HJKMNP-TV-Z]{26}$" },
44
45
  "hash64": { "type": "string", "pattern": "^[a-f0-9]{64}$" },
45
46
  "nullableHash64": { "type": ["string", "null"], "pattern": "^[a-f0-9]{64}$" },
47
+ "remediationEvidence": {
48
+ "type": "object",
49
+ "additionalProperties": false,
50
+ "required": [
51
+ "blockedTaskId", "blockedTaskRevision", "blockedBriefHash", "blockedPlanHash",
52
+ "planRiskAuditEventId", "planRiskAuditEventHash", "remediationTaskId", "predecessorTaskIds"
53
+ ],
54
+ "properties": {
55
+ "blockedTaskId": { "$ref": "#/$defs/taskId" },
56
+ "blockedTaskRevision": { "type": "integer", "minimum": 1 },
57
+ "blockedBriefHash": { "$ref": "#/$defs/hash64" },
58
+ "blockedPlanHash": { "$ref": "#/$defs/hash64" },
59
+ "planRiskAuditEventId": { "type": "string", "minLength": 1 },
60
+ "planRiskAuditEventHash": { "$ref": "#/$defs/hash64" },
61
+ "remediationTaskId": { "$ref": "#/$defs/taskId" },
62
+ "predecessorTaskIds": {
63
+ "type": "array",
64
+ "minItems": 1,
65
+ "uniqueItems": true,
66
+ "items": { "$ref": "#/$defs/taskId" }
67
+ }
68
+ }
69
+ },
46
70
  "membership": {
47
71
  "type": "object",
48
72
  "additionalProperties": false,
@@ -31,11 +31,27 @@
31
31
  "completionCommit": { "$ref": "#/$defs/gitHash" },
32
32
  "checksHash": { "$ref": "#/$defs/hash64" },
33
33
  "reviewEventHash": { "$ref": "#/$defs/nullableHash64" },
34
- "reviewerAttestationHash": { "$ref": "#/$defs/nullableHash64" }
34
+ "reviewerAttestationHash": { "$ref": "#/$defs/nullableHash64" },
35
+ "executionTaskRevision": { "type": "integer", "minimum": 1 },
36
+ "dirtyWorktreeHash": { "$ref": "#/$defs/hash64" }
35
37
  }
36
38
  },
37
39
  "attemptOrdinal": { "type": "integer", "minimum": 1 },
38
40
  "mode": { "enum": ["ordinary", "corrective"] },
41
+ "causeBindings": {
42
+ "type": "array",
43
+ "items": {
44
+ "type": "object",
45
+ "additionalProperties": false,
46
+ "required": ["authority", "causeId", "causeFingerprint", "planConflict"],
47
+ "properties": {
48
+ "authority": { "enum": ["mechanical", "external-reviewer"] },
49
+ "causeId": { "type": "string", "minLength": 1 },
50
+ "causeFingerprint": { "$ref": "#/$defs/hash64" },
51
+ "planConflict": { "type": "boolean" }
52
+ }
53
+ }
54
+ },
39
55
  "previousEventHash": { "$ref": "#/$defs/nullableHash64" },
40
56
  "recordedAt": { "type": "string", "format": "date-time" },
41
57
  "eventHash": { "$ref": "#/$defs/hash64" }
@@ -23,6 +23,7 @@
23
23
  "summary": { "type": "string", "minLength": 1 },
24
24
  "evidence": { "type": "string", "minLength": 1 },
25
25
  "requiredAction": { "type": "string", "minLength": 1 },
26
+ "causeId": { "type": "string", "pattern": "^[A-Za-z0-9][A-Za-z0-9._:-]{2,127}$" },
26
27
  "route": { "enum": ["fix", "replan"] },
27
28
  "planConflict": {
28
29
  "anyOf": [
@@ -49,6 +49,21 @@
49
49
  }
50
50
  }
51
51
  },
52
+ "remediationCauses": {
53
+ "type": "array",
54
+ "items": {
55
+ "type": "object",
56
+ "additionalProperties": false,
57
+ "required": ["findingId", "causeId", "causeFingerprint", "route", "planConflict"],
58
+ "properties": {
59
+ "findingId": { "type": "string", "minLength": 1 },
60
+ "causeId": { "type": "string", "pattern": "^[A-Za-z0-9][A-Za-z0-9._:-]{2,127}$" },
61
+ "causeFingerprint": { "$ref": "#/$defs/hash64" },
62
+ "route": { "enum": ["fix", "replan"] },
63
+ "planConflict": { "type": "boolean" }
64
+ }
65
+ }
66
+ },
52
67
  "previousEventHash": { "$ref": "#/$defs/nullableHash64" },
53
68
  "recordedAt": { "type": "string", "format": "date-time" },
54
69
  "eventHash": { "$ref": "#/$defs/hash64" }
@@ -34,6 +34,21 @@
34
34
  "knowledgeMapRevision": { "type": ["integer", "null"], "minimum": 1 },
35
35
  "knowledgeMapHash": { "type": ["string", "null"], "pattern": "^[a-f0-9]{64}$" },
36
36
  "graphUse": { "enum": ["code-aware", "not-applicable", null] },
37
+ "productionEdges": {
38
+ "type": "array",
39
+ "uniqueItems": true,
40
+ "items": {
41
+ "type": "object",
42
+ "required": ["ownerStepId", "consumerStepId", "checkRef"],
43
+ "properties": {
44
+ "ownerStepId": { "type": "string", "pattern": "^STEP-[0-9]{3}(?:-[A-Z0-9-]+)?$" },
45
+ "consumerStepId": { "type": "string", "pattern": "^STEP-[0-9]{3}(?:-[A-Z0-9-]+)?$" },
46
+ "checkRef": { "type": "string", "minLength": 1 }
47
+ },
48
+ "additionalProperties": false
49
+ }
50
+ },
51
+ "requiresProductionEdges": { "type": "boolean" },
37
52
  "steps": { "type": "array" },
38
53
  "authorizations": { "type": "array" },
39
54
  "knowledgeRebinds": {
@@ -177,10 +192,55 @@
177
192
  "retainedCommitSha": { "type": "string", "pattern": "^[a-f0-9]{40}$" }
178
193
  },
179
194
  "additionalProperties": false
195
+ },
196
+ "planIntegrity": {
197
+ "type": "object",
198
+ "required": ["stepId", "planHash", "conflictHash", "dirtyFiles", "dirtyWorktreeHash", "remediationEventIds"],
199
+ "properties": {
200
+ "stepId": { "type": "string", "pattern": "^STEP-[A-Z0-9][A-Z0-9-]{2,63}$" },
201
+ "planHash": { "type": "string", "pattern": "^[a-f0-9]{64}$" },
202
+ "conflictHash": { "type": "string", "pattern": "^[a-f0-9]{64}$" },
203
+ "dirtyFiles": {
204
+ "type": "array",
205
+ "minItems": 1,
206
+ "uniqueItems": true,
207
+ "items": { "type": "string", "minLength": 1 }
208
+ },
209
+ "dirtyWorktreeHash": { "type": "string", "pattern": "^[a-f0-9]{64}$" },
210
+ "remediationEventIds": {
211
+ "type": "array",
212
+ "minItems": 1,
213
+ "uniqueItems": true,
214
+ "items": { "type": "string", "minLength": 1 }
215
+ }
216
+ },
217
+ "additionalProperties": false
180
218
  }
181
219
  },
182
220
  "additionalProperties": false
183
221
  }
184
222
  }
185
- }
223
+ },
224
+ "allOf": [
225
+ {
226
+ "if": {
227
+ "properties": { "productionEdges": { "minItems": 1 } },
228
+ "required": ["productionEdges"]
229
+ },
230
+ "then": {
231
+ "required": ["requiresProductionEdges"],
232
+ "properties": { "requiresProductionEdges": { "const": true } }
233
+ }
234
+ },
235
+ {
236
+ "if": {
237
+ "properties": { "requiresProductionEdges": { "const": true } },
238
+ "required": ["requiresProductionEdges"]
239
+ },
240
+ "then": {
241
+ "required": ["productionEdges"],
242
+ "properties": { "productionEdges": { "minItems": 1 } }
243
+ }
244
+ }
245
+ ]
186
246
  }
@@ -436,6 +436,8 @@
436
436
  "projection.corrective-replan.candidate@1:field.plan-validator-identity-hash",
437
437
  "projection.corrective-replan.candidate@1:field.risk-audit-hash",
438
438
  "projection.corrective-replan.candidate@1:field.risk-auditor-identity-hash",
439
+ "projection.corrective-replan.candidate@1:field.target-knowledge-hash",
440
+ "projection.corrective-replan.candidate@1:field.target-knowledge-revision",
439
441
  "projection.corrective-replan.execution-receipt@1:field.actor-identity-hash",
440
442
  "projection.corrective-replan.execution-receipt@1:field.actor-role",
441
443
  "projection.corrective-replan.execution-receipt@1:field.attempt-count",
@@ -461,6 +463,8 @@
461
463
  "projection.corrective-replan.execution-receipt@1:field.risk-audit-hash",
462
464
  "projection.corrective-replan.execution-receipt@1:field.risk-auditor-identity-hash",
463
465
  "projection.corrective-replan.execution-receipt@1:field.runtime-fingerprint",
466
+ "projection.corrective-replan.execution-receipt@1:field.target-knowledge-hash",
467
+ "projection.corrective-replan.execution-receipt@1:field.target-knowledge-revision",
464
468
  "projection.corrective-replan.execution-receipt@1:field.task-id",
465
469
  "projection.corrective-replan.execution-receipt@1:field.task-revision",
466
470
  "projection.corrective-replan.execution-receipt@1:field.transition-id",
@@ -535,6 +539,8 @@
535
539
  "projection.input.execution-receipt@1:field.risk-audit-hash",
536
540
  "projection.input.execution-receipt@1:field.risk-auditor-identity-hash",
537
541
  "projection.input.execution-receipt@1:field.runtime-fingerprint",
542
+ "projection.input.execution-receipt@1:field.target-knowledge-hash",
543
+ "projection.input.execution-receipt@1:field.target-knowledge-revision",
538
544
  "projection.input.execution-receipt@1:field.task-id",
539
545
  "projection.input.execution-receipt@1:field.task-revision",
540
546
  "projection.input.execution-receipt@1:field.transition-id",
@@ -620,6 +626,8 @@
620
626
  "field.runtime-fingerprint",
621
627
  "field.step-id",
622
628
  "field.step-status",
629
+ "field.target-knowledge-hash",
630
+ "field.target-knowledge-revision",
623
631
  "field.task-id",
624
632
  "field.task-plan-hash",
625
633
  "field.task-revision",