Skip to content

fix(T12102,T12105): idempotent + instrumented complete; configurable tool: spawn deadline - #1203

Merged
kryptobaseddev merged 2 commits into
mainfrom
task/T12102-complete-revalidation-and-tool-timeout
Aug 20, 2026
Merged

fix(T12102,T12105): idempotent + instrumented complete; configurable tool: spawn deadline#1203
kryptobaseddev merged 2 commits into
mainfrom
task/T12102-complete-revalidation-and-tool-timeout

Conversation

@kryptobaseddev

Copy link
Copy Markdown
Owner

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:

  1. Commit-atom re-validation cached keyed on (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 the E_EVIDENCE_STALE guarantee (tamper test included).
  2. Progress to stderr per atom (with (cached) markers); stdout JSON untouched.
  3. Flush/ordering verified — the write transaction commits before the slow tail already; profile included.
  4. Idempotent complete — re-completing a done task exits 0 with alreadyDone: true, short-circuiting before staleness/session pre-checks so post-timeout recovery is "run it again". verify's E_ALREADY_DONE evidence-immutability guard (ADR-051 §11.1) untouched.

Closes #1193 — the fixed ~300 s tool: spawn deadline is now CLEO_TOOL_TIMEOUT_<TOOL> (same convention as CLEO_TOOL_CONCURRENCY_<TOOL>), loud validation on bad values, documented in CLEO-INJECTION.md + ct-task-executor.

Verification (targeted only)

  • 240 passed across 11 task/evidence test files · 249 in validation/tests · 22 engine/lifecycle
  • tsc --noEmit clean · biome clean · injection-commands + cli-boundary gates PASS

Tasks: T12102, T12105

…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).
@kryptobaseddev
kryptobaseddev merged commit 8f48b11 into main Aug 20, 2026
128 of 130 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant