Open-source build plan · deep dive

Proof-of-Work
how we'll actually build it

The catch-the-cheating gate for AI-written code. This file explains, in plain terms, exactly how it works — what runs, in what order, why it's trustworthy, and how we ship it step by step.

Open-core Ships as: CLI + git hook + GitHub Action + MCP Edge: facts, not opinions Window: move fast
The one-liner

What we're building

A tool that runs the moment an AI agent says "done." It re-checks the work against facts — did the tests really pass, were any tests deleted or faked, does the change actually match the task — and returns a plain pass / fail + reasons. Every run is signed and logged, so you can prove the code was checked.

The roast told us to change one thing, and it changes everything about how we build it:

❌ What we're NOT building

An AI that grades another AI, which the suspect agent politely calls on itself. That's the weak, easy-to-copy part — and the big labs give it away free.

✅ What we ARE building

A cheat-catcher built on hard facts, run as a gate you control (a git hook / CI step), that the agent can't skip. Plus a signed record of every check.

The core idea

Lean on facts first, opinions last

The whole design follows one rule: trust the checks that have a right answer (a test runs or it doesn't; a file changed or it didn't) far more than checks that are a matter of opinion (an AI reading a diff). We climb this ladder top-down and only fall back to the weak rung when we must.

FACT · strong
Did the real tests pass?Run the actual test suite in a clean place. Green or red — no opinion involved. This is the backbone.
FACT · strong
Was the test suite tampered with?Compare against git: tests deleted, skipped, weakened, or a fake "exit success" added. Pure code inspection, no AI. This is our unique edge.
FACT · medium
Did hidden tests pass?Run extra tests the agent never saw, so it can't teach to the test. Strong signal, but needs the tests to exist (see how below).
OPINION · weak, optional
Does the change match the task?An AI judge reads the diff vs the task and flags what looks missing. Useful as a hint — never the only thing that decides pass/fail.
💡 In one line: the product's trust comes from the top two rungs. The AI judge is a helpful extra, not the foundation. That's the exact inversion the roast demanded — and the reason the labs can't easily copy us.
Architecture

The five parts

Small pieces, each doing one job. Green = free & open-source (the wedge that spreads). Purple = the paid, hosted parts (the moat).

🚪1 · The GateFREE

Where it plugs in: a git pre-commit hook, a GitHub Action, or an MCP tool. The human wires it once, so the agent can't route around it. This alone kills the "fox guards the henhouse" problem.

🧪2 · The Test RunnerFREE

Runs the project's tests in a clean, isolated process and reads the true result — not the agent's word for it. Records pass/fail, counts, and coverage.

🔍3 · The Cheat DetectorFREE

The star. Diffs the change against git and parses the code (AST) to spot tampering — deleted tests, sys.exit(0), empty asserts, new skips, mocked-away logic. Zero AI, fully deterministic.

🤖4 · The AI JudgeFREE (optional)

Only if turned on: an LLM compares the diff to the task and lists what may be missing. Advisory only. Bring-your-own-key so it costs us nothing.

📜5 · The Attestation Log

An append-only, hash-chained record of every check: what ran, what passed, what cheating was caught, signed and time-stamped. This is what a team/manager pays for — proof, across repos, that can't be edited after the fact.

What happens on one run

Step by step, when the agent says "done"

Agent finishes
+ triggers gate
2 · run real tests 3 · scan diff
for cheating
4 · AI judge
(optional)
verdict:
pass ✓
…or fail ✗ — "3 tests deleted, coverage dropped 12%" agent must fix & retry 📜 result signed & logged
The agent cannot mark itself done — the gate decides, and every outcome (pass or caught-cheating) is written to the log. That log is the thing you sell upward.
The two hard parts, honestly

How the tricky bits actually work

🔍 Cheat detection (deterministic)

The roast said this is the one truly defensible piece. It's just careful code inspection — no AI, so it's fast, free, and always gives the same answer. The concrete checks:

Deleted / removed testsgit shows test functions that vanished.
Fake passsys.exit(0), os._exit(0), pytest.skip in the run path.
Empty / weakened assertsassert True, removed assertions, assertTrue(1).
New skips / xfail@skip or @xfail added to make red go green.
Coverage droptests still "pass" but cover much less code.
Mocked-away logicthe thing under test replaced by a mock that always returns OK.

🧪 Hidden tests — the honest answer

The roast's sharpest hit: "if the tests are on the agent's machine, the agent can read them." True. So we ship two modes and are upfront about each:

LOCAL
Trusted local mode (free)Hidden tests run in a separate process the agent's session doesn't control. Stops casual cheating, not a determined attacker. Honest about that.
HOSTED
Secret bank mode (paid)The diff is sent to our runner; the hidden tests live server-side and never touch the agent's machine. This is genuinely un-cheatable — and it's the paid moat.

Even without hidden tests, the top two ladder rungs (real tests + tamper scan) already catch most real-world cheating. Hidden tests are the upgrade, not the base.

How you actually use it

Four front doors, one engine

Same core, exposed four ways so it drops into any workflow with no friction — this is also the distribution: each front door is a place people discover it.

As a CLI (the free hero)
# run it by hand or in any script
pow check # checks the current diff

✓ tests: 142 passed
✓ no tampering found
⚠ AI judge: endpoint has no error test
VERDICT: PASS (1 warning)
As a git pre-commit hook
# .pre-commit-config.yaml
- repo: proof-of-work
  hooks:
    - id: pow-gate

# now every commit is checked
# cheating = commit blocked
As a GitHub Action (CI gate)
- uses: proof-of-work/gate@v1
  with:
    mode: hosted # secret tests
    fail-on: tamper

# blocks the PR if the agent cheated
As an MCP tool (agents call it)
verify(task, changeset) → {
  passed: false,
  tampered: true,
  unmet: ["delete-user path"],
  attestation: "pow:9f2c…"
}
Tech stack, kept lean: Python (best AST + test tooling) for the engine, its built-in ast module + git for the detector, a subprocess/container for isolation, SQLite for the local log, the official MCP SDK, and bring-your-own-key for the optional judge. No new heavy dependencies.
The business shape

Open-core: free front door, paid engine room

Give away the part that spreads; charge for the part that proves. Same model LangChain used (free library, paid cloud).

🟢 Free & open-source (the wedge)

  • The cheat detector + real-test runner
  • CLI, git hook, and basic GitHub Action
  • The MCP tool, model-agnostic
  • Local attestation log (this machine)
  • Bring-your-own-key AI judge

→ Job: get installed everywhere, earn trust, collect stars.

How we ship it

Build order — smallest useful thing first

First · 48 hrs
Prove the catch (do this before anything else)

Build ONLY the deterministic cheat detector as a script. Run it on ~20 real agent-made PRs (yours + public). Measure how many cheats it catches. Post the number on r/ClaudeAI / HN. This tells you the whole idea is real — for two days of work.

Week 1
Free hero

Wrap the detector + real-test runner into a clean CLI and a pre-commit hook. Zero AI. One-command install.

Week 2
Go deep on cheat detection

Add the harder checks (weakened asserts, mocked-away logic, coverage drop). Depth here = the moat nobody else has.

Week 3
Launch + distribute

Open-source repo, MCP tool, GitHub Action. List on mcp.so, Glama, Smithery, PulseMCP, awesome-mcp-servers. Show HN + Reddit post with the catch-rate proof.

Week 4
Attestation log

Sign & hash-chain every run locally. This is the seed of the paid product.

Month 2
Turn on money

Hosted secret-test bank + team dashboard + compliance export. Sell to the eng manager, not the IC.

Straight talk

The risks — and how this design answers each

The risk (from the roast)How the build answers it
Fox guards the henhouse — the agent chooses whether to call itThe gate is wired by the human as a hook/CI step. The agent can't opt out or reinterpret the result.
"Hidden tests" aren't hidden on the agent's machineTwo honest modes: local (stops casual cheating) and hosted secret bank (truly un-cheatable, and it's the paid tier).
The labs bundle self-verification for freeWe don't sell generic self-verify. We own deterministic cheat detection + a cross-vendor audit trail — the part a lab won't build against its own agent.
AI-judging-a-diff is flaky and you can't trust itCorrect — so it's optional and advisory only, never the thing that decides pass/fail. The verdict rests on facts.
Agent has no wallet; the IC won't payFree for the IC forever. The paid product is a manager's compliance dashboard — a different, paying buyer.
The idea is in the air; someone else ships firstThat's the real risk. Answer = the 48-hour test this week, then a fast public launch. Speed is the strategy.
Bottom line: the reshaped design turns every roast objection into a design decision. Build the free deterministic cheat-catcher first, prove the catch-rate in 48 hours, launch fast, then add the paid audit trail. That's the plan.