fix(T12102,T12105): idempotent + instrumented complete; configurable tool: spawn deadline - #1203
Merged
kryptobaseddev merged 2 commits intoAug 20, 2026
Conversation
…tool: spawn deadline gh#1196: profiling the complete path showed re-validation is ~60ms of a multi-second operation (bootstrap ~3s, hooks ~1s, worktree tail ~0.6s), and the reported hang is lock/contention-shaped. Regardless, complete re-ran immutable git facts and timed out agents on operations that had already committed. Commit-atom re-validation is now cached keyed on (commitSha, headSha) under .cleo/cache/evidence/ (successes only; files:/test-run: deliberately uncached — the sha256 re-read IS the E_EVIDENCE_STALE guarantee). Per-atom progress goes to stderr, and completing an already-done task exits 0 with alreadyDone: true so the post-timeout recovery is 'run it again'. verify's E_ALREADY_DONE guard (ADR-051 11.1) is untouched. gh#1193: the ~300s tool: spawn deadline is now CLEO_TOOL_TIMEOUT_<TOOL> (same convention as CLEO_TOOL_CONCURRENCY_<TOOL>), validated loudly on bad values, documented in CLEO-INJECTION.md and ct-task-executor. Closes #1196, closes #1193.
…106/T12107 complete.ts: keep the idempotent-complete short-circuit (T12102) AND the remedy-note requireActiveSession call (T12106). evidence.ts: keep both @task annotations and both declarations — the siblingCommitSha resolution (T12107) alongside the startedAt progress timer (T12102).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #1196 — profiled the complete path first: evidence re-validation is only ~60 ms of a 6–15 s complete (bootstrap ~3 s, PostToolUse hooks ~1 s, worktree tail ~0.6 s dominate), and the 5-minute zero-CPU repro is lock/contention-shaped (follow-up noted). Implemented the issue's four asks:
(commitSha, headSha)under.cleo/cache/evidence/— sound because every check is an immutable fact of the git DAG once both SHAs are fixed; only successes cached.files:/test-run:deliberately NOT cached — the sha256 re-read is theE_EVIDENCE_STALEguarantee (tamper test included).(cached)markers); stdout JSON untouched.alreadyDone: true, short-circuiting before staleness/session pre-checks so post-timeout recovery is "run it again".verify'sE_ALREADY_DONEevidence-immutability guard (ADR-051 §11.1) untouched.Closes #1193 — the fixed ~300 s
tool:spawn deadline is nowCLEO_TOOL_TIMEOUT_<TOOL>(same convention asCLEO_TOOL_CONCURRENCY_<TOOL>), loud validation on bad values, documented in CLEO-INJECTION.md + ct-task-executor.Verification (targeted only)
tsc --noEmitclean · biome clean · injection-commands + cli-boundary gates PASSTasks: T12102, T12105