← Gautam Parab

STRAP: A Structured Task and Recovery Agent Protocol for Reliable AI Agent Harnesses

When a coding agent fails, the usual fix is a longer prompt. STRAP starts from a different diagnosis: the missing piece is not more instruction but a contract, memory, verification, and recovery routing around the model. It ships as four independent, model-agnostic skills — plain markdown, no framework, no service, nothing to install — each targeting one specific failure: task-contract stops an agent from scope-creeping past a vague request by requiring a bounded, checkable spec before any action; state-compiler compiles the transcript into durable facts, decisions, progress, and lessons so nothing is lost once context scrolls past it; adversarial-verifier checks a completion claim against the contract and is rewarded for finding a reason to reject it; failure-router classifies an error into one of seven classes and dispatches the matching fix instead of retrying the identical action.

The accompanying 25-page paper ties each design choice to a published result (ReAct, Toolformer, Reflexion, Self-Refine, MemGPT, SWE-bench, and others) and reports every empirical claim as measured, including the ones that came out lower than expected. The Failure Router’s classifier scores 88.0% on a labeled, self-authored corpus, 71.4% on real command output blind-labeled by an agent, and 45.0% (Wilson 95% CI [25.8%, 65.8%]) on an independently sourced GitHub Actions corpus — the same classifier, all three numbers reported as measured, with the gap widening rather than closing as the corpus gets more independent. A second, independently authored implementation reproduces schema-level interoperability against the same corpus (81.2% agreement). A pre-registered live-agent pilot (N=94/arm design, run at a small logged scope) surfaced a genuine, previously unknown bootstrap deadlock in the project’s own enforcement hook — fixed and regression-tested live during the run — and a follow-up investigation traced an intermittent skip in Claude Code’s own hook dispatch, a platform gap rather than a defect in this project’s code. The confirmatory studies at full scale remain unrun, and the paper says so.

Skills, paper, and reproducible experiments on GitHub