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

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 (86) hide show
  1. package/README.md +6 -1
  2. package/dist/reviewer-runtime-build.json +44 -20
  3. package/dist/src/alpha6/failed-step-planning-recovery.d.ts +10 -0
  4. package/dist/src/alpha6/failed-step-planning-recovery.js +93 -0
  5. package/dist/src/alpha6/failed-step-planning-recovery.js.map +1 -0
  6. package/dist/src/alpha6/plan-risk.d.ts +4 -0
  7. package/dist/src/alpha6/plan-risk.js +50 -13
  8. package/dist/src/alpha6/plan-risk.js.map +1 -1
  9. package/dist/src/alpha6/preexecution-replan.d.ts +38 -0
  10. package/dist/src/alpha6/preexecution-replan.js +130 -0
  11. package/dist/src/alpha6/preexecution-replan.js.map +1 -0
  12. package/dist/src/alpha6/remediation.d.ts +4 -2
  13. package/dist/src/alpha6/remediation.js +155 -20
  14. package/dist/src/alpha6/remediation.js.map +1 -1
  15. package/dist/src/alpha6/root-cause-replan-carryover.d.ts +18 -0
  16. package/dist/src/alpha6/root-cause-replan-carryover.js +396 -0
  17. package/dist/src/alpha6/root-cause-replan-carryover.js.map +1 -0
  18. package/dist/src/alpha7/autonomy.d.ts +3 -0
  19. package/dist/src/alpha7/autonomy.js +89 -42
  20. package/dist/src/alpha7/autonomy.js.map +1 -1
  21. package/dist/src/change-explanation.d.ts +64 -0
  22. package/dist/src/change-explanation.js +150 -0
  23. package/dist/src/change-explanation.js.map +1 -0
  24. package/dist/src/cli-actions.d.ts +3 -2
  25. package/dist/src/cli-actions.js +6 -0
  26. package/dist/src/cli-actions.js.map +1 -1
  27. package/dist/src/cli.js +73 -1
  28. package/dist/src/cli.js.map +1 -1
  29. package/dist/src/contracts.d.ts +38 -0
  30. package/dist/src/dependency-provenance.d.ts +3 -2
  31. package/dist/src/dependency-provenance.js +33 -2
  32. package/dist/src/dependency-provenance.js.map +1 -1
  33. package/dist/src/domain/plan-semantics.d.ts +11 -0
  34. package/dist/src/domain/plan-semantics.js +49 -0
  35. package/dist/src/domain/plan-semantics.js.map +1 -0
  36. package/dist/src/gateway-handshake.js +2 -0
  37. package/dist/src/gateway-handshake.js.map +1 -1
  38. package/dist/src/lifecycle/corrective-replan.js +3 -3
  39. package/dist/src/lifecycle/corrective-replan.js.map +1 -1
  40. package/dist/src/observed-routes.js +1 -0
  41. package/dist/src/observed-routes.js.map +1 -1
  42. package/dist/src/pending-review-update.d.ts +49 -0
  43. package/dist/src/pending-review-update.js +132 -0
  44. package/dist/src/pending-review-update.js.map +1 -0
  45. package/dist/src/repository.js +16 -4
  46. package/dist/src/repository.js.map +1 -1
  47. package/dist/src/reviewer.js +4 -1
  48. package/dist/src/reviewer.js.map +1 -1
  49. package/dist/src/state/corrective-replan-executor.js +3 -1
  50. package/dist/src/state/corrective-replan-executor.js.map +1 -1
  51. package/dist/src/state/corrective-replan-public.js +5 -4
  52. package/dist/src/state/corrective-replan-public.js.map +1 -1
  53. package/dist/src/state/corrective-yield-executor.js +12 -3
  54. package/dist/src/state/corrective-yield-executor.js.map +1 -1
  55. package/dist/src/state/store.d.ts +1 -1
  56. package/dist/src/state/store.js +17 -3
  57. package/dist/src/state/store.js.map +1 -1
  58. package/dist/src/version.d.ts +1 -1
  59. package/dist/src/version.js +1 -1
  60. package/dist/src/version.js.map +1 -1
  61. package/dist/src/workflow.d.ts +84 -1
  62. package/dist/src/workflow.js +1616 -355
  63. package/dist/src/workflow.js.map +1 -1
  64. package/docs/beta13.2-signal-review-recovery.md +38 -0
  65. package/docs/change-model.md +118 -0
  66. package/docs/delegated-approval.md +26 -0
  67. package/docs/pdf/codex-workflow-v2-architecture-ru.pdf +0 -0
  68. package/docs/pdf/codex-workflow-v2-chat-only-guide-ru.pdf +0 -0
  69. package/docs/pdf/codex-workflow-v2-technical-reference-ru.pdf +0 -0
  70. package/docs/pdf/sources/codex-workflow-v2-architecture-ru.md +9 -1
  71. package/docs/pdf/sources/codex-workflow-v2-chat-only-guide-ru.md +9 -5
  72. package/docs/pdf/sources/codex-workflow-v2-technical-reference-ru.md +18 -3
  73. package/docs/pending-review-update.md +15 -0
  74. package/docs/release.md +267 -2
  75. package/docs/updating-existing-project.md +36 -6
  76. package/docs/validation-report.md +30 -9
  77. package/package.json +2 -1
  78. package/plugins/codex-workflow-gateway/references/chat-dispatch.md +204 -0
  79. package/plugins/codex-workflow-gateway/references/protocol.md +11 -0
  80. package/plugins/codex-workflow-gateway/scripts/chat-dispatch.mjs +298 -0
  81. package/plugins/codex-workflow-gateway/scripts/chat-model-policy.mjs +43 -0
  82. package/plugins/codex-workflow-gateway/scripts/chat-registry.mjs +55 -3
  83. package/plugins/codex-workflow-gateway/skills/codex-workflow-gateway/SKILL.md +218 -21
  84. package/schemas/plan-risk-audit-event.schema.json +1 -0
  85. package/schemas/preexecution-replan-event.schema.json +45 -0
  86. package/schemas/task.schema.json +55 -0
@@ -0,0 +1,396 @@
1
+ import { normalizePlanKnowledgeBinding, readVerifiedPlanArtifact } from '../domain/plan-semantics.js';
2
+ import { pathAllowed } from '../domain/validation.js';
3
+ import { hashCanonical } from '../lifecycle/fingerprint.js';
4
+ import { changedFiles, currentBranch, gitIsAncestor, headCommit } from '../repository.js';
5
+ import { validateTaskHistory } from '../git.js';
6
+ import { assertMechanicalFeasibilityFresh } from './mechanical-feasibility.js';
7
+ import { hashDirtyWorktree } from './downstream-proof.js';
8
+ import { hashCompletedSteps, hashExecutionAuthorization } from './preexecution-replan.js';
9
+ import { readCurrentPlanRiskAudit, readPlanRiskAuditEvents } from './plan-risk.js';
10
+ import { deriveRollingCauseDecision, readRemediationEvents } from './remediation.js';
11
+ import { readTaskC1Posture, readTaskHandoffEvents } from './handoff.js';
12
+ import { sha256Hex } from './store-sidecars.js';
13
+ export function matchesTerminalCorrectiveYield(event, terminal, taskId) {
14
+ const executionTaskRevision = terminal.failureEvidence.executionTaskRevision;
15
+ if (executionTaskRevision === undefined)
16
+ return false;
17
+ return event.eventType === 'yield'
18
+ && event.taskId === taskId
19
+ && event.taskRevision === executionTaskRevision + 1
20
+ && event.eventId === `HOF-${sha256Hex([
21
+ 'checks-failed-root-cause-replan-pause-v1',
22
+ taskId,
23
+ String(executionTaskRevision),
24
+ terminal.eventHash,
25
+ event.actor,
26
+ ].join('\0'))}`;
27
+ }
28
+ /**
29
+ * Proves that dirty bytes from the terminal repeated-cause failure survived one semantic
30
+ * corrective Plan replacement and are already inside the replacement Step's declared scope.
31
+ * This proof never grants or appends an allowedWrite.
32
+ */
33
+ export function assessRootCauseReplanDirtyCarryover(store, repositoryRoot, task, stepId, options = {}) {
34
+ const historyHead = options.historyHead ?? options.binding?.sourceHeadCommit ?? headCommit(repositoryRoot);
35
+ const step = task.steps.find((candidate) => candidate.id === stepId) ?? null;
36
+ const allStepEvents = readRemediationEvents(store, task)
37
+ .filter((event) => event.stepId === stepId && event.failureKind === 'checks-failed');
38
+ const applicable = Boolean(step && task.planHash && allStepEvents.length >= 2);
39
+ if (!applicable || !step || !task.planHash) {
40
+ return { applicable, eligible: false, compatibility: null, blockers: [] };
41
+ }
42
+ const blockers = [];
43
+ const dirtyFiles = changedFiles(repositoryRoot).sort();
44
+ if (task.status !== 'ready')
45
+ blockers.push('The replacement Task must be execution-authorized and ready.');
46
+ if (step.status !== 'planned' || step.evidence !== null) {
47
+ blockers.push(`The replacement Step ${stepId} must be planned with no execution evidence.`);
48
+ }
49
+ if (task.steps.some((candidate) => candidate.status === 'in_progress'))
50
+ blockers.push('No Step may be in progress.');
51
+ if (task.workspaceOwner !== 'local')
52
+ blockers.push('Corrective carryover requires the recorded local Task workspace.');
53
+ if (!task.taskBranch || currentBranch(repositoryRoot) !== task.taskBranch) {
54
+ blockers.push('Current branch must equal the recorded Task branch.');
55
+ }
56
+ if (dirtyFiles.length === 0)
57
+ blockers.push('Corrective carryover requires retained dirty product bytes.');
58
+ const outsideAllowed = dirtyFiles.filter((file) => !pathAllowed(file, step.allowedWrites));
59
+ const forbidden = dirtyFiles.filter((file) => pathAllowed(file, step.forbiddenScope));
60
+ if (outsideAllowed.length > 0)
61
+ blockers.push(`Dirty files fall outside ${stepId} allowedWrites: ${outsideAllowed.join(', ')}`);
62
+ if (forbidden.length > 0)
63
+ blockers.push(`Dirty files intersect ${stepId} forbiddenScope: ${forbidden.join(', ')}`);
64
+ const incompleteDependencies = step.dependencies.filter((dependency) => !['completed', 'skipped'].includes(task.steps.find((candidate) => candidate.id === dependency)?.status ?? 'blocked'));
65
+ if (incompleteDependencies.length > 0)
66
+ blockers.push(`Replacement Step dependencies are incomplete: ${incompleteDependencies.join(', ')}`);
67
+ const audits = readPlanRiskAuditEvents(store, task);
68
+ const eventPlan = (event) => {
69
+ const revision = event.failureEvidence.executionTaskRevision;
70
+ if (revision === undefined)
71
+ return null;
72
+ const planHash = [...audits].reverse().find((audit) => audit.taskRevision <= revision)?.planHash ?? null;
73
+ if (!planHash || !task.planHash)
74
+ return null;
75
+ try {
76
+ return {
77
+ planHash,
78
+ semanticHash: normalizePlanKnowledgeBinding(readVerifiedPlanArtifact(store.taskRoot(task.projectId, task.id), planHash, task.planHash), `remediation ${event.eventId}`).semanticHash,
79
+ };
80
+ }
81
+ catch {
82
+ return null;
83
+ }
84
+ };
85
+ const terminal = allStepEvents.at(-1);
86
+ const terminalPlan = eventPlan(terminal);
87
+ const sourcePlanHash = terminalPlan?.planHash ?? null;
88
+ if (!sourcePlanHash || sourcePlanHash === task.planHash) {
89
+ blockers.push('The terminal repeated-cause event must resolve to one replaced source Plan.');
90
+ }
91
+ let cycleStart = allStepEvents.length - 1;
92
+ while (cycleStart > 0
93
+ && eventPlan(allStepEvents[cycleStart - 1])?.semanticHash === terminalPlan?.semanticHash)
94
+ cycleStart -= 1;
95
+ const sourceCycle = allStepEvents.slice(cycleStart);
96
+ const priorEvents = allStepEvents.slice(0, cycleStart);
97
+ if (!terminalPlan || sourceCycle.some((event) => eventPlan(event)?.semanticHash !== terminalPlan.semanticHash)) {
98
+ blockers.push('The source remediation cycle has ambiguous Plan bindings.');
99
+ }
100
+ if (deriveRollingCauseDecision(sourceCycle, priorEvents) !== 'root-cause-replan') {
101
+ blockers.push('The source cycle does not end in a repeated authoritative mechanical cause.');
102
+ }
103
+ const priorFingerprints = new Set([...priorEvents, ...sourceCycle.slice(0, -1)]
104
+ .flatMap((event) => event.causeBindings?.filter((cause) => cause.authority === 'mechanical')
105
+ .map((cause) => cause.causeFingerprint) ?? []));
106
+ const repeated = [...new Set(terminal.causeBindings
107
+ ?.filter((cause) => cause.authority === 'mechanical' && !cause.planConflict && priorFingerprints.has(cause.causeFingerprint))
108
+ .map((cause) => cause.causeFingerprint) ?? [])];
109
+ if (repeated.length !== 1)
110
+ blockers.push('The terminal failure must identify exactly one repeated mechanical cause.');
111
+ if (terminal.failureEvidence.executionTaskRevision === undefined) {
112
+ blockers.push('The terminal failure is missing its execution Task revision.');
113
+ }
114
+ if (!terminal.failureEvidence.dirtyWorktreeHash)
115
+ blockers.push('The terminal failure is missing its dirty-worktree hash.');
116
+ if (terminal.failureEvidence.completionCommit !== historyHead) {
117
+ blockers.push('Repository HEAD changed after the terminal repeated-cause failure.');
118
+ }
119
+ try {
120
+ if ((task.invalidatedStepCommits ?? []).length > 0) {
121
+ throw new Error('Legacy carryover cannot time-classify invalidated completed-Step commits.');
122
+ }
123
+ const sourceHistoryTask = {
124
+ ...task,
125
+ systemCommits: task.systemCommits.filter((commit) => gitIsAncestor(repositoryRoot, commit, historyHead)),
126
+ dependencyProvenanceRecoveries: (task.dependencyProvenanceRecoveries ?? []).filter((record) => gitIsAncestor(repositoryRoot, record.commitSha, historyHead)),
127
+ };
128
+ validateTaskHistory(repositoryRoot, sourceHistoryTask, historyHead);
129
+ }
130
+ catch (error) {
131
+ blockers.push(`Completed Step authority is not exactly retained at the source boundary: ${error instanceof Error ? error.message : String(error)}`);
132
+ }
133
+ let dirtyWorktreeHash = null;
134
+ try {
135
+ dirtyWorktreeHash = hashDirtyWorktree(repositoryRoot, dirtyFiles);
136
+ if (dirtyWorktreeHash !== terminal.failureEvidence.dirtyWorktreeHash) {
137
+ blockers.push('Dirty paths or bytes changed after the terminal repeated-cause failure.');
138
+ }
139
+ }
140
+ catch (error) {
141
+ blockers.push(error instanceof Error ? error.message : String(error));
142
+ }
143
+ const replacementAuthorityPlanHash = options.binding?.replacementPlanHash ?? task.planHash;
144
+ let sourcePlanSemanticHash = null;
145
+ let replacementPlanSemanticHash = null;
146
+ try {
147
+ if (!sourcePlanHash)
148
+ throw new Error('Source Plan hash is unavailable.');
149
+ sourcePlanSemanticHash = normalizePlanKnowledgeBinding(readVerifiedPlanArtifact(store.taskRoot(task.projectId, task.id), sourcePlanHash, task.planHash), 'root-cause source').semanticHash;
150
+ replacementPlanSemanticHash = normalizePlanKnowledgeBinding(readVerifiedPlanArtifact(store.taskRoot(task.projectId, task.id), replacementAuthorityPlanHash, task.planHash), 'root-cause replacement').semanticHash;
151
+ if (sourcePlanSemanticHash === replacementPlanSemanticHash) {
152
+ blockers.push('Corrective carryover requires a semantic replacement Plan.');
153
+ }
154
+ const currentSemanticHash = normalizePlanKnowledgeBinding(readVerifiedPlanArtifact(store.taskRoot(task.projectId, task.id), task.planHash, task.planHash), 'current corrective Plan').semanticHash;
155
+ if (currentSemanticHash !== replacementPlanSemanticHash) {
156
+ blockers.push('The current Plan is not a knowledge-only descendant of the corrective replacement Plan.');
157
+ }
158
+ }
159
+ catch (error) {
160
+ blockers.push(error instanceof Error ? error.message : String(error));
161
+ }
162
+ let currentAudit = null;
163
+ let replacementSourceAudit = null;
164
+ try {
165
+ currentAudit = readCurrentPlanRiskAudit(store, task);
166
+ const sourceAudit = options.binding
167
+ ? audits.find((audit) => audit.eventId === options.binding.replacementPlanRiskAuditEventId
168
+ && audit.eventHash === options.binding.replacementPlanRiskAuditEventHash
169
+ && audit.planHash === options.binding.replacementPlanHash) ?? null
170
+ : currentAudit?.audit ?? null;
171
+ replacementSourceAudit = sourceAudit;
172
+ if (!currentAudit || currentAudit.audit.planHash !== task.planHash
173
+ || !currentAudit.reviewRequiredStepIds.includes(stepId)
174
+ || !sourceAudit
175
+ || sourceAudit.taskRevision <= (terminal.failureEvidence.executionTaskRevision ?? Number.MAX_SAFE_INTEGER)) {
176
+ blockers.push('A fresh replacement Plan Risk Audit must guard the exact corrective Step.');
177
+ }
178
+ if (sourceAudit && currentAudit
179
+ && JSON.stringify(sourceAudit.stepClassifications) !== JSON.stringify(currentAudit.audit.stepClassifications)) {
180
+ blockers.push('Context refresh changed the replacement Plan Risk Audit classifications or proof bindings.');
181
+ }
182
+ if (sourceAudit && currentAudit) {
183
+ assertContiguousKnowledgeRebindChain(store.taskRoot(task.projectId, task.id), task, replacementAuthorityPlanHash, task.planHash, audits, sourceAudit, currentAudit.audit);
184
+ }
185
+ }
186
+ catch (error) {
187
+ blockers.push(error instanceof Error ? error.message : String(error));
188
+ }
189
+ const authorization = [...task.authorizations].reverse().find((event) => event.kind === 'execution' && event.decision === 'approved') ?? null;
190
+ const sourceAuthorization = options.binding
191
+ ? task.authorizations.find((event) => hashExecutionAuthorization(event.kind === 'execution' && event.decision === 'superseded'
192
+ ? { ...event, decision: 'approved' }
193
+ : event) === options.binding.executionAuthorizationHash
194
+ && event.planHash === options.binding.replacementPlanHash
195
+ && event.headCommit === options.binding.executionAuthorizationHead) ?? null
196
+ : authorization;
197
+ if (!authorization) {
198
+ blockers.push('The replacement Plan requires a current execution authorization.');
199
+ }
200
+ else {
201
+ validateAuthorization(store, repositoryRoot, task, authorization, options.binding ? headCommit(repositoryRoot) : historyHead, blockers);
202
+ }
203
+ if (!sourceAuthorization)
204
+ blockers.push('The original corrective execution authorization is missing from immutable Task history.');
205
+ if (task.steps.some((candidate) => candidate.status === 'completed' && !candidate.evidence)) {
206
+ blockers.push('Every retained completed Step must preserve its execution evidence.');
207
+ }
208
+ const c1Posture = readTaskC1Posture(store, task);
209
+ const handoffEvents = readTaskHandoffEvents(store, task);
210
+ const sourceTaskRevision = options.binding?.sourceTaskRevision ?? task.revision;
211
+ const latestClaim = [...handoffEvents].reverse().find((event) => event.eventType === 'claim') ?? null;
212
+ const replacementAuditTime = replacementSourceAudit ? Date.parse(replacementSourceAudit.recordedAt) : null;
213
+ const claimTime = latestClaim ? Date.parse(latestClaim.recordedAt) : null;
214
+ const claimEvent = latestClaim
215
+ && latestClaim.taskRevision === sourceTaskRevision
216
+ && latestClaim.planHash === replacementAuthorityPlanHash
217
+ && latestClaim.briefHash === task.briefHash
218
+ && (!replacementSourceAudit || (claimTime !== null && Number.isFinite(claimTime)
219
+ && replacementAuditTime !== null && Number.isFinite(replacementAuditTime)
220
+ && claimTime >= replacementAuditTime
221
+ && latestClaim.taskRevision > replacementSourceAudit.taskRevision))
222
+ ? latestClaim
223
+ : null;
224
+ const matchingCorrectiveYields = handoffEvents.filter((event) => matchesTerminalCorrectiveYield(event, terminal, task.id));
225
+ const correctiveYield = matchingCorrectiveYields.length === 1
226
+ && matchingCorrectiveYields[0].planHash !== null
227
+ && eventPlan(terminal)?.semanticHash === normalizePlanKnowledgeBinding(readVerifiedPlanArtifact(store.taskRoot(task.projectId, task.id), matchingCorrectiveYields[0].planHash, task.planHash), `corrective yield ${matchingCorrectiveYields[0].eventId}`).semanticHash
228
+ && Number.isFinite(Date.parse(matchingCorrectiveYields[0].recordedAt))
229
+ && Number.isFinite(Date.parse(terminal.recordedAt))
230
+ && Date.parse(matchingCorrectiveYields[0].recordedAt) >= Date.parse(terminal.recordedAt)
231
+ && (!replacementSourceAudit || (replacementAuditTime !== null && Number.isFinite(replacementAuditTime)
232
+ && Date.parse(matchingCorrectiveYields[0].recordedAt) <= replacementAuditTime
233
+ && matchingCorrectiveYields[0].taskRevision < replacementSourceAudit.taskRevision))
234
+ ? matchingCorrectiveYields[0]
235
+ : null;
236
+ if (c1Posture.state !== 'claimed' || !claimEvent || claimEvent.actor !== c1Posture.claimant) {
237
+ blockers.push('Corrective carryover requires the retained claimed C1 actor and its immutable claim event.');
238
+ }
239
+ if (!correctiveYield)
240
+ blockers.push('The terminal repeated cause is missing its completed corrective-yield boundary.');
241
+ if (correctiveYield && claimEvent
242
+ && (claimEvent.actor !== correctiveYield.actor
243
+ || c1Posture.state !== 'claimed'
244
+ || c1Posture.claimant !== correctiveYield.actor)) {
245
+ blockers.push('Corrective carryover must return to the same Worker that completed the terminal corrective yield.');
246
+ }
247
+ if (blockers.length > 0 || !sourcePlanHash || !sourcePlanSemanticHash || !replacementPlanSemanticHash
248
+ || !dirtyWorktreeHash || !currentAudit || !authorization || !sourceAuthorization
249
+ || terminal.failureEvidence.executionTaskRevision === undefined || repeated.length !== 1
250
+ || c1Posture.state !== 'claimed' || !claimEvent || !correctiveYield) {
251
+ return { applicable: true, eligible: false, compatibility: null, blockers: [...new Set(blockers)] };
252
+ }
253
+ const base = {
254
+ kind: 'root-cause-corrective-replan-dirty-carryover',
255
+ taskId: task.id,
256
+ sourceTaskRevision,
257
+ stepId,
258
+ sourcePlanHash,
259
+ sourcePlanSemanticHash,
260
+ replacementPlanHash: replacementAuthorityPlanHash,
261
+ replacementPlanSemanticHash,
262
+ sourceHeadCommit: terminal.failureEvidence.completionCommit,
263
+ remediationEvents: sourceCycle.map((event) => ({
264
+ eventId: event.eventId,
265
+ eventHash: event.eventHash,
266
+ attemptOrdinal: event.attemptOrdinal,
267
+ })),
268
+ terminalRemediationEventId: terminal.eventId,
269
+ terminalRemediationEventHash: terminal.eventHash,
270
+ terminalExecutionTaskRevision: terminal.failureEvidence.executionTaskRevision,
271
+ repeatedCauseFingerprint: repeated[0],
272
+ correctiveYieldEventId: correctiveYield.eventId,
273
+ correctiveYieldEventHash: correctiveYield.eventHash,
274
+ dirtyFiles,
275
+ dirtyWorktreeHash,
276
+ replacementPlanRiskAuditEventId: options.binding?.replacementPlanRiskAuditEventId ?? currentAudit.audit.eventId,
277
+ replacementPlanRiskAuditEventHash: options.binding?.replacementPlanRiskAuditEventHash ?? currentAudit.audit.eventHash,
278
+ executionAuthorizationHash: options.binding?.executionAuthorizationHash ?? hashExecutionAuthorization(sourceAuthorization),
279
+ executionAuthorizationHead: options.binding?.executionAuthorizationHead ?? sourceAuthorization.headCommit,
280
+ completedStepsHash: hashCompletedSteps(task),
281
+ c1ClaimEventId: claimEvent.eventId,
282
+ c1ClaimEventHash: claimEvent.eventHash,
283
+ claimant: c1Posture.claimant,
284
+ };
285
+ const compatibility = { ...base, compatibilityHash: hashCanonical({
286
+ domain: 'codex-workflow/root-cause-corrective-replan-dirty-carryover/v1',
287
+ ...base,
288
+ }) };
289
+ if (options.binding && JSON.stringify(compatibility) !== JSON.stringify(options.binding)) {
290
+ return {
291
+ applicable: true,
292
+ eligible: false,
293
+ compatibility: null,
294
+ blockers: ['Recorded corrective carryover binding no longer matches the immutable Task, Plan, audit, authorization, C1, or dirty-byte evidence.'],
295
+ };
296
+ }
297
+ return {
298
+ applicable: true,
299
+ eligible: true,
300
+ compatibility,
301
+ blockers: [],
302
+ };
303
+ }
304
+ function assertContiguousKnowledgeRebindChain(taskRoot, task, sourcePlanHash, currentPlanHash, audits, sourceAudit, currentAudit) {
305
+ if (sourcePlanHash === currentPlanHash) {
306
+ if (sourceAudit.eventHash !== currentAudit.eventHash) {
307
+ throw new Error('Corrective source Plan has ambiguous current Plan Risk Audit authority.');
308
+ }
309
+ return;
310
+ }
311
+ for (let index = 0; index < task.knowledgeRebinds.length; index += 1) {
312
+ const timestamp = Date.parse(task.knowledgeRebinds[index].recordedAt);
313
+ if (!Number.isFinite(timestamp)
314
+ || (index > 0 && timestamp <= Date.parse(task.knowledgeRebinds[index - 1].recordedAt))) {
315
+ throw new Error('Task knowledge-rebind timestamps are not finite and strictly increasing.');
316
+ }
317
+ }
318
+ let expected = sourcePlanHash;
319
+ const seen = new Set();
320
+ const start = task.knowledgeRebinds.findIndex((record) => record.previousPlanHash === sourcePlanHash);
321
+ if (start < 0)
322
+ throw new Error('Corrective Plan has no append-only Knowledge rebind chain.');
323
+ const chain = task.knowledgeRebinds.slice(start);
324
+ for (const record of chain) {
325
+ if (record.previousPlanHash !== expected) {
326
+ throw new Error('Corrective Plan knowledge-rebind provenance forks or skips a Plan hash.');
327
+ }
328
+ if (seen.has(record.reboundPlanHash) || record.reboundPlanHash === record.previousPlanHash) {
329
+ throw new Error('Corrective Plan knowledge-rebind chain is cyclic.');
330
+ }
331
+ seen.add(record.reboundPlanHash);
332
+ const before = readVerifiedPlanArtifact(taskRoot, record.previousPlanHash, currentPlanHash);
333
+ const after = readVerifiedPlanArtifact(taskRoot, record.reboundPlanHash, currentPlanHash);
334
+ if (normalizePlanKnowledgeBinding(before, 'corrective rebind source').normalized
335
+ !== normalizePlanKnowledgeBinding(after, 'corrective rebind target').normalized) {
336
+ throw new Error('Corrective Plan rebind changed semantics beyond the Knowledge Map binding.');
337
+ }
338
+ expected = record.reboundPlanHash;
339
+ }
340
+ if (expected !== currentPlanHash) {
341
+ throw new Error('Corrective Plan knowledge-rebind provenance is not contiguous to the current Plan.');
342
+ }
343
+ const planHashes = [sourcePlanHash, ...chain.map((record) => record.reboundPlanHash)];
344
+ const auditChain = planHashes.map((planHash) => audits.filter((audit) => audit.planHash === planHash));
345
+ if (auditChain.some((matches) => matches.length !== 1)
346
+ || auditChain[0][0].eventHash !== sourceAudit.eventHash
347
+ || auditChain.at(-1)[0].eventHash !== currentAudit.eventHash) {
348
+ throw new Error('Corrective Plan Risk Audit rebound chain is missing or ambiguous.');
349
+ }
350
+ const sourceAuditIndex = audits.indexOf(auditChain[0][0]);
351
+ if (sourceAuditIndex < 0
352
+ || sourceAuditIndex + auditChain.length !== audits.length
353
+ || auditChain.some((matches, index) => audits[sourceAuditIndex + index] !== matches[0])) {
354
+ throw new Error('Corrective Plan Risk Audit rebound evidence is not the contiguous current audit suffix.');
355
+ }
356
+ chain.forEach((record, index) => {
357
+ const before = auditChain[index][0];
358
+ const after = auditChain[index + 1][0];
359
+ const expectedSummary = `${before.summary} Rebound automatically after content-only Task context refresh.`;
360
+ if (before.knowledgeMapRevision !== record.fromKnowledgeMapRevision
361
+ || before.knowledgeMapHash !== record.fromKnowledgeMapHash
362
+ || after.knowledgeMapRevision !== record.toKnowledgeMapRevision
363
+ || after.knowledgeMapHash !== record.toKnowledgeMapHash
364
+ || after.previousEventHash !== before.eventHash
365
+ || after.taskId !== before.taskId
366
+ || after.briefHash !== before.briefHash
367
+ || after.briefHash !== task.briefHash
368
+ || before.planner !== after.planner
369
+ || before.auditor !== after.auditor
370
+ || before.decision !== after.decision
371
+ || before.splitRationale !== after.splitRationale
372
+ || after.summary !== expectedSummary
373
+ || before.structuralProductionEdgeAuthority !== after.structuralProductionEdgeAuthority
374
+ || JSON.stringify(before.stepClassifications) !== JSON.stringify(after.stepClassifications)) {
375
+ throw new Error('Corrective Plan Risk Audit rebound does not match a knowledge-only Plan hop.');
376
+ }
377
+ });
378
+ }
379
+ function validateAuthorization(store, repositoryRoot, task, authorization, expectedHead, blockers) {
380
+ try {
381
+ const root = store.taskRoot(task.projectId, task.id);
382
+ const briefHash = store.hashArtifact(root, 'brief.md');
383
+ const planHash = store.hashArtifact(root, 'plan.md');
384
+ if (task.briefHash !== briefHash || task.planHash !== planHash
385
+ || authorization.briefHash !== briefHash || authorization.planHash !== planHash
386
+ || !authorization.mechanicalFeasibility || authorization.headCommit !== expectedHead) {
387
+ blockers.push('Execution authorization does not bind the current Brief, Plan, and HEAD.');
388
+ return;
389
+ }
390
+ assertMechanicalFeasibilityFresh(repositoryRoot, task, authorization.mechanicalFeasibility, briefHash, planHash);
391
+ }
392
+ catch (error) {
393
+ blockers.push(error instanceof Error ? error.message : String(error));
394
+ }
395
+ }
396
+ //# sourceMappingURL=root-cause-replan-carryover.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"root-cause-replan-carryover.js","sourceRoot":"","sources":["../../../src/alpha6/root-cause-replan-carryover.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,6BAA6B,EAAE,wBAAwB,EAAE,MAAM,6BAA6B,CAAC;AACtG,OAAO,EAAE,WAAW,EAAE,MAAM,yBA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2
  import type { FileStateStore } from '../state/store.js';
3
3
  export interface MilestoneAutonomyEvent extends SidecarEventRecord {
4
4
  eventType: 'issued';
5
+ confirmationCodeBindingHash?: string;
6
+ issuedMilestoneStatus?: MilestoneState['status'];
5
7
  projectId: string;
6
8
  milestoneId: string;
7
9
  milestoneRevision: number;
@@ -33,6 +35,7 @@ export interface ActiveMilestoneAutonomy {
33
35
  }
34
36
  export declare function milestoneSemanticScopeHash(milestone: Pick<MilestoneState, 'id' | 'discoveryId' | 'baseBranch' | 'outcome' | 'successSignal' | 'acceptance' | 'checks'>): string;
35
37
  export declare function prepareMilestoneAutonomyContract(options: {
38
+ store: FileStateStore;
36
39
  projectId: string;
37
40
  milestone: MilestoneState;
38
41
  principal: string;