codex-workflow-v2 2.0.0-beta.12.11 → 2.0.0-beta.12.12

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 (35) hide show
  1. package/README.md +5 -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.js +1 -1
  18. package/dist/src/lifecycle/corrective-replan.js.map +1 -1
  19. package/dist/src/version.d.ts +1 -1
  20. package/dist/src/version.js +1 -1
  21. package/dist/src/workflow.d.ts +3 -0
  22. package/dist/src/workflow.js +222 -12
  23. package/dist/src/workflow.js.map +1 -1
  24. package/docs/pdf/codex-workflow-v2-architecture-ru.pdf +0 -0
  25. package/docs/pdf/codex-workflow-v2-chat-only-guide-ru.pdf +0 -0
  26. package/docs/pdf/codex-workflow-v2-technical-reference-ru.pdf +0 -0
  27. package/docs/pdf/sources/codex-workflow-v2-architecture-ru.md +14 -5
  28. package/docs/pdf/sources/codex-workflow-v2-chat-only-guide-ru.md +17 -7
  29. package/docs/pdf/sources/codex-workflow-v2-technical-reference-ru.md +34 -10
  30. package/docs/release.md +3 -2
  31. package/docs/updating-existing-project.md +25 -0
  32. package/docs/validation-report.md +117 -96
  33. package/package.json +1 -1
  34. package/schemas/corrective-decision-event.schema.json +57 -10
  35. package/schemas/task.schema.json +23 -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
  }
@@ -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