codex-workflow-v2 2.0.0-beta.12.11 → 2.0.0-beta.12.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 (46) hide show
  1. package/README.md +7 -4
  2. package/dist/src/alpha6/mechanical-feasibility.js +28 -12
  3. package/dist/src/alpha6/mechanical-feasibility.js.map +1 -1
  4. package/dist/src/alpha6/npm-check-contract.d.ts +11 -0
  5. package/dist/src/alpha6/npm-check-contract.js +36 -0
  6. package/dist/src/alpha6/npm-check-contract.js.map +1 -0
  7. package/dist/src/alpha6/plan-integrity.js +82 -26
  8. package/dist/src/alpha6/plan-integrity.js.map +1 -1
  9. package/dist/src/alpha6/remediation.js +88 -40
  10. package/dist/src/alpha6/remediation.js.map +1 -1
  11. package/dist/src/cli.js +25 -0
  12. package/dist/src/cli.js.map +1 -1
  13. package/dist/src/contracts.d.ts +37 -3
  14. package/dist/src/dependency-provenance.d.ts +3 -3
  15. package/dist/src/dependency-provenance.js +21 -6
  16. package/dist/src/dependency-provenance.js.map +1 -1
  17. package/dist/src/lifecycle/corrective-replan-binding-manifest.js +2 -0
  18. package/dist/src/lifecycle/corrective-replan-binding-manifest.js.map +1 -1
  19. package/dist/src/lifecycle/corrective-replan.js +1 -1
  20. package/dist/src/lifecycle/corrective-replan.js.map +1 -1
  21. package/dist/src/lifecycle/semantic-registry.js +1 -1
  22. package/dist/src/state/corrective-replan-executor.js +7 -5
  23. package/dist/src/state/corrective-replan-executor.js.map +1 -1
  24. package/dist/src/state/corrective-replan-public.js +30 -6
  25. package/dist/src/state/corrective-replan-public.js.map +1 -1
  26. package/dist/src/state/corrective-yield-transaction.js +11 -2
  27. package/dist/src/state/corrective-yield-transaction.js.map +1 -1
  28. package/dist/src/version.d.ts +1 -1
  29. package/dist/src/version.js +1 -1
  30. package/dist/src/workflow.d.ts +4 -0
  31. package/dist/src/workflow.js +258 -12
  32. package/dist/src/workflow.js.map +1 -1
  33. package/docs/pdf/codex-workflow-v2-architecture-ru.pdf +0 -0
  34. package/docs/pdf/codex-workflow-v2-chat-only-guide-ru.pdf +0 -0
  35. package/docs/pdf/codex-workflow-v2-technical-reference-ru.pdf +0 -0
  36. package/docs/pdf/sources/codex-workflow-v2-architecture-ru.md +22 -5
  37. package/docs/pdf/sources/codex-workflow-v2-chat-only-guide-ru.md +22 -7
  38. package/docs/pdf/sources/codex-workflow-v2-technical-reference-ru.md +52 -10
  39. package/docs/release.md +3 -2
  40. package/docs/updating-existing-project.md +25 -0
  41. package/docs/validation-report.md +115 -94
  42. package/package.json +1 -1
  43. package/schemas/corrective-decision-event.schema.json +57 -10
  44. package/schemas/corrective-replan-credentials.private.schema.json +4 -2
  45. package/schemas/task.schema.json +23 -0
  46. package/schemas/transition-definition.schema.json +8 -0
@@ -50,11 +50,16 @@
50
50
  "then": {
51
51
  "required": ["recoveryBasis", "planIntegrityEvidence"],
52
52
  "properties": { "decision": { "const": "replan-required" } }
53
- },
54
- "else": {
55
- "not": { "anyOf": [{ "required": ["recoveryBasis"] }, { "required": ["planIntegrityEvidence"] }] }
56
53
  }
57
54
  },
55
+ {
56
+ "if": { "required": ["recoveryBasis"] },
57
+ "then": {
58
+ "required": ["planIntegrityEvidence"],
59
+ "properties": { "decision": { "const": "replan-required" } }
60
+ },
61
+ "else": { "not": { "required": ["planIntegrityEvidence"] } }
62
+ },
58
63
  {
59
64
  "anyOf": [
60
65
  { "properties": { "coveredFindingIds": { "minItems": 1 } } },
@@ -74,13 +79,14 @@
74
79
  "items": { "type": "string", "minLength": 1 }
75
80
  },
76
81
  "planIntegrityEvidence": {
77
- "type": "object",
78
- "additionalProperties": false,
79
- "required": [
80
- "kind", "taskRevision", "remediationEventId", "remediationEventHash",
81
- "manifestPath", "manifestHash", "gitHead", "stepDefinitionHash",
82
- "missingScripts", "checkCommands", "changedFiles", "conflictHash"
83
- ],
82
+ "oneOf": [
83
+ { "$ref": "#/$defs/planIntegrityEvidenceV1" },
84
+ { "$ref": "#/$defs/planIntegrityEvidenceV2" }
85
+ ]
86
+ },
87
+ "planIntegrityEvidenceV1": {
88
+ "type": "object", "additionalProperties": false,
89
+ "required": ["kind", "taskRevision", "remediationEventId", "remediationEventHash", "manifestPath", "manifestHash", "gitHead", "stepDefinitionHash", "missingScripts", "checkCommands", "changedFiles", "conflictHash"],
84
90
  "properties": {
85
91
  "kind": { "const": "missing-npm-script-outside-allowed-writes" },
86
92
  "taskRevision": { "type": "integer", "minimum": 1 },
@@ -95,6 +101,47 @@
95
101
  "changedFiles": { "$ref": "#/$defs/stringList" },
96
102
  "conflictHash": { "$ref": "#/$defs/hash64" }
97
103
  }
104
+ },
105
+ "planIntegrityEvidenceV2": {
106
+ "type": "object", "additionalProperties": false,
107
+ "required": ["kind", "taskRevision", "remediationEvents", "manifestPath", "manifestHash", "gitHead", "stepDefinitionHash", "conflicts", "changedFiles", "conflictHash"],
108
+ "properties": {
109
+ "kind": { "const": "non-executable-npm-check-outside-allowed-writes" },
110
+ "taskRevision": { "type": "integer", "minimum": 1 },
111
+ "remediationEvents": {
112
+ "type": "array", "minItems": 1,
113
+ "items": {
114
+ "type": "object", "additionalProperties": false,
115
+ "required": ["eventId", "eventHash", "attemptOrdinal"],
116
+ "properties": {
117
+ "eventId": { "type": "string", "minLength": 1 },
118
+ "eventHash": { "$ref": "#/$defs/hash64" },
119
+ "attemptOrdinal": { "type": "integer", "minimum": 1 }
120
+ }
121
+ }
122
+ },
123
+ "manifestPath": { "const": "package.json" },
124
+ "manifestHash": { "$ref": "#/$defs/nullableHash64" },
125
+ "gitHead": { "$ref": "#/$defs/gitOid" },
126
+ "stepDefinitionHash": { "$ref": "#/$defs/hash64" },
127
+ "conflicts": {
128
+ "type": "array", "minItems": 1,
129
+ "items": {
130
+ "type": "object", "additionalProperties": false,
131
+ "required": ["reasonCode", "script", "command", "scriptCommand", "runnerPath", "runnerHash"],
132
+ "properties": {
133
+ "reasonCode": { "enum": ["MISSING_NPM_SCRIPT", "REQUIRED_SELECTOR_MISSING"] },
134
+ "script": { "type": "string", "minLength": 1 },
135
+ "command": { "type": "string", "minLength": 1 },
136
+ "scriptCommand": { "type": ["string", "null"] },
137
+ "runnerPath": { "type": ["string", "null"] },
138
+ "runnerHash": { "$ref": "#/$defs/nullableHash64" }
139
+ }
140
+ }
141
+ },
142
+ "changedFiles": { "$ref": "#/$defs/stringList" },
143
+ "conflictHash": { "$ref": "#/$defs/hash64" }
144
+ }
98
145
  }
99
146
  }
100
147
  }
@@ -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" },
@@ -177,6 +177,29 @@
177
177
  "retainedCommitSha": { "type": "string", "pattern": "^[a-f0-9]{40}$" }
178
178
  },
179
179
  "additionalProperties": false
180
+ },
181
+ "planIntegrity": {
182
+ "type": "object",
183
+ "required": ["stepId", "planHash", "conflictHash", "dirtyFiles", "dirtyWorktreeHash", "remediationEventIds"],
184
+ "properties": {
185
+ "stepId": { "type": "string", "pattern": "^STEP-[A-Z0-9][A-Z0-9-]{2,63}$" },
186
+ "planHash": { "type": "string", "pattern": "^[a-f0-9]{64}$" },
187
+ "conflictHash": { "type": "string", "pattern": "^[a-f0-9]{64}$" },
188
+ "dirtyFiles": {
189
+ "type": "array",
190
+ "minItems": 1,
191
+ "uniqueItems": true,
192
+ "items": { "type": "string", "minLength": 1 }
193
+ },
194
+ "dirtyWorktreeHash": { "type": "string", "pattern": "^[a-f0-9]{64}$" },
195
+ "remediationEventIds": {
196
+ "type": "array",
197
+ "minItems": 1,
198
+ "uniqueItems": true,
199
+ "items": { "type": "string", "minLength": 1 }
200
+ }
201
+ },
202
+ "additionalProperties": false
180
203
  }
181
204
  },
182
205
  "additionalProperties": false
@@ -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",