Every technical decision, finalized and current for July 2026 — the stack, the self-improving loop that gets sharper every run, and the tamper-proof logging that records every finding. Choices are decided, not options.
One choice per layer, each verified against current (July 2026) versions. Bottom line: Python engine + tree-sitter (+ stdlib ast) + Docker-local / microVM-hosted + pytest·coverage.py / Vitest·v8 + git subprocess + official mcp SDK + uv/PyPI + SQLite.
| Layer | Decision | Why | Watch out |
|---|---|---|---|
| Engine language | Python 3.12+ | Native access to pytest/coverage internals, most mature MCP SDK, first-class tree-sitter, fastest solo dev loop. | No single binary — solved by uv/pipx below. |
| Code parsing (detector) | tree-sitter-language-pack + stdlib ast | One uniform parser across Python + JS/TS (306 grammars, actively maintained); stdlib ast for deep Python-only checks. | It's a syntax tree, not semantic — tamper checks are strong heuristics, not proofs. Pin versions (API churn). |
| Isolation (run tests) | Docker (local) · microVM (hosted) | A container is fine for your own local code; hosted mode running others' code needs a real guest kernel (E2B/Firecracker or microsandbox). | This is the one true architectural fork → hide behind a Sandbox interface. Reject WASM (can't run real test deps). |
| Tests + coverage | pytest + coverage.py 7.15 · Vitest 3 + v8 | Machine-readable JSON output for both; Vitest v8 now matches Istanbul accuracy at 3–5× speed. | Also detect existing Jest projects. Coverage-drop needs a stored baseline — parse JSON, never scrape text. |
| Git diff access | shell out to git plumbing | Every repo already has git; output matches exactly, no build dependency. | Use -z NUL separators, disable color/pager, stick to plumbing commands for stable output. |
| MCP server | official mcp SDK 1.28.1 (FastMCP) | Current stable, production-recommended; expose one tool with @mcp.tool(). | A v2 rename lands ~late-July 2026 — wall all MCP code behind one thin module so migration is a one-file change. |
| Packaging / install | uv + PyPI (uvx proof-of-work) | 10–100× faster than pipx, zero-install runs; PyPI publish keeps pipx users working too. | Skip single-binary until users demand offline. Ship a pre-commit hook + a composite GitHub Action. |
| Local storage | SQLite (stdlib), WAL mode | Zero-dependency single file, perfect for append-only run logs + coverage baselines. | Hook + CI can write at once → enable WAL and a busy_timeout to avoid locks. |
Facts get signed; opinions stay advisory. This split is what makes the whole record reproducible and un-poisonable — the AI never decides the verdict.
@skip/xfail added vs baseline.sys.exit(0), patched test runner, coverage disabled, function-under-test mocked away.assert True, removed assertions. Syntactic only; a helper, not a proof.The feature, when it comes, follows a published blueprint (Self-Harness, 2026): mine failures → propose a fix → gate it hard → only then promote. Golden rule: the loop can only ever ADD detection power — coverage never silently shrinks.
Verdict, which rules fired, a confirmed-clean run, a human override, or a cheat caught later (a bug that slipped past a "clean" verdict). Each signal is tagged by trust level and written to the tamper-proof log.
A batch job clusters confirmed cheats that no existing rule catches, and the LLM drafts a new Semgrep rule from those real examples. The AI only drafts — it has zero authority to ship it.
The candidate is tested against two frozen, signed corpora before it can ship. Roast fix: dropped the vacuous "0% regression" clause — added Semgrep rules can't un-catch a positive, so that check never rejects anything. The real gate is FP-based:
The rule gets an id + semver + provenance hash, a signed git commit, and shadow-runs for N runs before it changes a real verdict. Rollback = git revert. Roast fix: "add-only" needs rule GC or FPs and runtime grow forever — so a new rule that subsumes an old one retires it automatically, but only when the frozen corpus confirms zero coverage is lost. Any change that would actually reduce coverage still needs a human two-key.
The harness tracks precision + FP rate on the frozen corpora and coverage of known cheat classes per iteration. Roast fix: you cannot measure true "catch-rate" solo — the cheats you miss are unlabeled by definition. So don't claim recall on unknowns; claim "grows the net over known patterns, keeps FPs bounded." Ground truth must be human/synthetic-anchored, never LLM-labeled, or the judge leaks into the signed verdict.
Every run emits the same envelope — an in-toto attestation in a DSSE wrapper (the 2026 standard shared by Sigstore, SLSA, cosign). Because local and hosted records are byte-identical, upgrading tiers is a config change, not a rewrite.
What v1 must do (functional) and how it must behave (non-functional). These are the acceptance bar.
pass / fail + reasons the agent (or CI) can branch on.uvx proof-of-work, no account, works offline for the local tier.Sandbox interface.interfaces/ layer is thin — it just calls core/. The mcp_server.py is the single file walled off from the coming MCP v2 rename.| Risk | How the design handles it |
|---|---|
| Correctness can't be fully verified (the "verification horizon") | Never sign "this is correct." Only sign "these specific checks passed/failed." The detector is a strong filter, not an oracle. |
| AST checks are heuristic — a determined agent can evade them | Defense in depth: the authoritative signal is re-running tests + comparing coverage; the AST patterns are the extra net, not the whole net. |
| Local log is re-forgeable with disk + key access | Periodically anchor the signed head externally (gist / CI / Rekor). Tier 2 removes the local key entirely (keyless). |
| False-positive fatigue → humans disable the tool | The Wilson-bounded FP gate plus "loop can only add power" keep noise down; a bad rule can never ship silently. |
| Poisoning the learning signal | Frozen signed regression corpus + asymmetric authority (add-only) + label provenance tiers. Poisoning training can't beat an immutable test. |
| MCP SDK v2 breaking change (~late Jul 2026) | All MCP code behind interfaces/mcp_server.py — the migration is a one-file edit. |
I put this finalized architecture through the /roast council. It caught real logic bugs, not just opinions — the corrections above (marked in gold) come straight from it.
sys.exit/skip checks + mutation testingScope. Built as written, you spend a month on corpus/eval/transparency-log plumbing and never ship the thing people wanted. And detection is an arms race vs adaptive agents — scope the claim to lazy, non-adversarial agents (today's real failure mode).
The moat isn't the detector — it's the corpus of how agents cheat + attestation as a standard. But the local-only spec forfeits it: to get the network effect the loop must become an opt-in federated corpus (users share caught cheats, everyone's net grows). That's the real 10x, later.
sys.exit/skip grep + one mutmut pass. Run it on ~20 real agent PRs. Publish the catch count. Don't write a line of the loop or the crypto until that number proves people care.
Verdict by the Judge over 5 independent council agents. Scores: Contrarian 3 · Builder 3 · Logician 5 · Researcher 8 · Expansionist 8. Not a KILL (the core is genuinely wanted and the stack is validated); not a GO (as specified it's a scope trap that won't ship solo).