You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit c7ea859
Browse filesBrowse the repository at this point in the historyBrowse files
Retire proven exited claims before integration admission (#2406)
Written-by: Codex
Fixes#2375 on `delivery/ai-centric-development-service`.
Add configure-authorized `attempt.reconcile-exit` over existing pool
serialization and Effects. Verify exact Session/worker/allocation exit
and unresolved responsibility, commit retirement and fence the old
generation before a fresh integration snapshot. Preserve drafts,
input/PR semantics, stop cancellation and Agent choice; expose specific
checkpoint blockers to Chief.
Includes long-term memory, dated decision, architecture, operations,
complete API inventory/OpenAPI, generated patches and red/green
regressions. Tests cover failed/no-op persistence inside the pool,
repeat requests, native/SDK/Chief proof, mismatched allocations, pending
results/writes, cancellation and generation races.
Validation: full root verify4,941/0 at4239a9a9; final head
`7c487e01d9acd9e11b3dcbd5767692369437376e` changes only the strengthened
regression and its generated mirror, five selected regressions/coverage
pass. Nine API/docs tests pass. Exact-head CI running. Production source
unchanged from full verify. New retirement paths have measured line
coverage, not 100% branch coverage; optional runtime/error branches are
not exhaustive. Actual DSH eight runtime cases passed; actual Docker
SDK-to-retirement/live recovery remain unclaimed.
Pairing correctness/security/conventions: no unresolved blockers. No
deployment/live configuration/credentials changed. Owner-authorized
delivery basic CI scope; no independent Verifier PASS claimed.
Add explicit, durable retirement of exit-proven execution claims before fresh integration admission, preserving drafts and rejecting stale or unresolved execution.
if(claim?.status==='active'&&!(ownChiefRun&&claim.chiefRunId===ownChiefRun&&claim.botId===`${attempt.projectId}:chief`)||Object.values(state.projectExecutions??{}).some(row=>chief(row)&&row.status==='running'&&row.id!==ownChiefRun)||Object.values(state.projectResourceLeases??{}).some(row=>(row.attemptId===attempt.id||chief(state.projectExecutions?.[row.attemptId]))&&row.status!=='released')||Object.values(state.projectHarnessWorkers??{}).some(row=>currentWorker(row)&&!confirmedWorkerExit(state,row))||Object.values(state.bots??{}).some(row=>row.ephemeral&&row.attemptId===attempt.id))throwreject('Integration input is waiting for confirmed execution exit')
if(claim?.status==='active'&&claim!==retiringClaim&&!(ownChiefRun&&claim.chiefRunId===ownChiefRun&&claim.botId===`${attempt.projectId}:chief`))blockers.push({kind: 'claim-active',claimId: claim.id,action: 'attempt.reconcile-exit after result and exit reconciliation'})
if(!['running','interrupted','failed'].includes(attempt.status)||attempt.cancelRequested||['accepted','cancelled'].includes(task.status))throwreject('Exit retirement cannot revive a cancelled or completed Attempt')
if(claim.attemptId!==attempt.id||claim.taskId!==task.id||claim.projectId!==task.projectId||task.deliveryAttemptId!==attempt.id)throwreject('Execution retirement requires the exact current Task/Attempt claim')
if(!run||run.projectId!==task.projectId||run.status==='running'||!awaitrt.projectChiefControl.exitConfirmed(run))throwreject('Chief retirement is waiting for confirmed execution exit')
if(!record||record.id!==claim.workerId||record.projectId!==task.projectId||record.taskId!==task.id||record.attemptId!==attempt.id||![attempt.roleSessions?.[record.role], ...(attempt.roleSessionHistory??[])].some(session=>session?.id===record.sessionKey&&session.poolClaimId===claim.id&&session.generation===claim.generation)||!executionExitConfirmed(rt,record.id))throwreject('Claim retirement is waiting for matching confirmed execution exit')
495
+
if(worker&&(!lease||lease.status!=='released'||lease.projectId!==record.projectId||lease.attemptId!==record.attemptId||lease.role!==record.role||lease.resourceId!==record.resourceId||lease.generation!==record.generation||lease.worker?.handle!==record.id||worker.releaseProof?.workerId!==record.id&&worker.releaseProof?.kind!=='systemd-prior-invocation-exited'||lease.releaseProof?.kind!==record.releaseProof?.kind||lease.releaseProof?.generation!==record.releaseProof?.generation||lease.releaseProof?.at!==record.releaseProof?.at))throwreject('Claim retirement exit proof does not match its allocation')
496
+
if(worker?.resultHash&&!claim.decision||claim.inputCorrection?.status==='pending')throwreject('Reconcile the pending worker result or input correction before retiring its responsibility')
0 commit comments