← All Labs Lab 25 / 28 spec-verify catches planted bugs
Lab 25 · Code & ship · Learned

spec-verify catches planted bugs

Run by our own coding agent against a small service with known planted violations, spec-verify marks exactly the violated rules fail and the rest pass.

Learned Needs: tool-calling Smoke: pnpm exec tsx examples/25-spec-verify-catches-planted-bugs/run.ts Run: MYCEL_URL=https://mycel.thefocus.ai pnpm exec tsx examples/25-spec-verify-catches-planted-bugs/run.ts --live --model mycel:deepseek/deepseek-v4.1-flash Source: examples/25-spec-verify-catches-planted-bugs

Built from PROMPT.md. What it taught us is in FINDINGS.md.

Split out of Lab 21, whose plan graded spec-verify against specs it had just written itself, so a gate that passed everything would have looked fine. Here the ground truth is planted: a small habitat service with a spec pack of, say, six rules, two of which the code deliberately breaks.

The checks:

CheckWhat it shows
run-is-validThe run directory under docs/runs/ passes check-specs.ts
catches-plantedBoth planted violations are fail
no-false-alarmsThe other four rules are pass

Run it

bash
pnpm exec tsx examples/25-spec-verify-catches-planted-bugs/run.ts            # offline smoke, ~5 s
MYCEL_URL=https://mycel.thefocus.ai pnpm exec tsx examples/25-spec-verify-catches-planted-bugs/run.ts \
  --live --model mycel:deepseek/deepseek-v4.1-flash                             # the real question, a few minutes
  • fixture/ is the repo the agent gets: server.mjs (no dependencies; health route, POST /a2a behind a bearer token, a Mounted mounted/ dir) and a six-rule pack in docs/specs/service/notes-service.md. server.mjs breaks two rules on purpose: /a2a also accepts a request with no Authorization header, and PUT /mounted/<file> writes.
  • planted.json names those two rules. It stays in the lab folder and never enters the agent's checkout.
  • run.ts copies the fixture and .agents/skills/spec-verify/ into a temp repo and runs umwelten's own pi-durable coding agent (InteractiveCodingSession from @umwelten/evaluation) on it, told to follow the skill. Then it reads the run directory the agent wrote under docs/runs/ and scores it against planted.json.
  • Offline, a scripted faux agent reads the skill, runs one real HTTP probe of the service and writes the run directory from what the probe saw. Its verdicts come from the service's behavior, so the smoke still tests the fixture. --live hands the same task to a Mycel model, which decides how to verify on its own.

Break it

Fix one planted bug: in fixture/server.mjs, change return header === \Bearer ${token}\ || header === ""; to return header === \Bearer ${token}\;. The smoke exits 1:

Visual Target Wireframe ASCII Layout
  FAIL  catches-planted: a2a-requires-token=pass, mounted-is-read-only=fail

Prompt

Coding-Agent Prompt · Ready to Paste
Build `examples/25-spec-verify-catches-planted-bugs/run.ts`. Fixture: a tiny DurableHabitat service (health route, A2A behind a bearer token, a Mounted read-only dir) with a `docs/specs/` pack of six rules, where the code breaks two on purpose (for example /a2a accepts no token, and `write` into the Mounted dir succeeds); list the planted rule slugs in a fixture file the agent never sees. Copy fixture and the spec-verify skill (`.agents/skills/spec-verify/`) into a mkdtemp repo. Run umwelten's pi-durable coding agent (the session machinery in `packages/evaluation/src/coding/`) with the skill's instructions. Then print one PASS/FAIL line per check and exit 1 on any failure: run-is-valid (the new docs/runs/ directory passes check-specs); catches-planted (both planted slugs are "fail" in verdicts.jsonl); no-false-alarms (the other four are "pass"). Offline, script a faux agent; `--live --model mycel:<id>` runs a Mycel model (D-28). Strict TypeScript, no `any`. README frontmatter (status built) and FINDINGS.md.
Works in Pi, Claude Code, Codex & Antigravity Offline mock first → --live opt-in

What we learned

The answer

Yes, in both live runs so far (one on verify-deploy, one on spec-verify). umwelten's own pi-durable coding agent (InteractiveCodingSession), told to follow the spec-verify skill, marked both planted rules fail and the other four pass, and wrote a run directory that passes check-specs. The answer key never entered its checkout.

Live on DeepSeek V4.1 Flash through Mycel (2026-12-01): 23 turns, 30 tool calls, no files changed outside docs/runs/. It started the service on the given port, curled each rule, hashed mounted/handbook.md before and after a PUT, restored it with git checkout, and cited line numbers in server.mjs as code anchors. Its evidence for the planted bugs:

  • a2a-requires-token: "POST /a2a with NO Authorization header returned HTTP 200 with body {"answer":"You said: hi"}"
  • mounted-is-read-only: the sha256 changed after PUT /mounted/handbook.md.

Findings

  • The coding agent can run a skill as its task, not just fix code. InteractiveCodingSession takes any CodingTaskSpec, so a verification pass is a task whose prompt points at SKILL.md and whose hidden tests are empty. The lab grades the run directory it leaves behind, not the session's own score.
  • The fixture has to run without node_modules. The session's checkout is a filtered copy that skips node_modules, so a fixture built on DurableHabitat couldn't start there. The service is a dependency-free server.mjs with the same three surfaces (health, A2A behind a token, a Mounted dir).
  • The lab moved from verify-deploy to spec-verify (D-51). The first live pass used the old verify-deploy skill, whose last step asks a person to pick a fix for each failure; unattended, the prompt told the agent to put proposals in the verdict's proposal field. spec-verify drops that step and adds an optional diagnosis (s_bug for these planted bugs).
  • The offline agent must test the fixture, or the smoke proves nothing. A scripted agent that copied planted.json into verdicts would always pass. The faux agent runs a real HTTP probe instead, so fixing a planted bug turns its verdict to pass and the smoke fails (the break test).
  • The fixture needs a docs/standards/ directory and an INDEX link per pack. check-specs fails without them, even with no standards.
  • -dirty is a judgment call. The live agent named its run <time>_<sha> (tracked files clean) although docs/runs/ itself was untracked; the scripted probe appends -dirty. Both pass check-specs.

Not tested

  • More live runs, or other models. Two passes are not a rate.
  • Subtler bugs. Both planted bugs show up in a single curl. A violation that needs reading code or a crash drill would test the skill harder.
  • Inconclusive and waived verdicts. Every rule here can be observed, so neither came up.

Smoke run

Visual Target Wireframe ASCII Layout
agent: faux (scripted probe); service port 39951
  tool read
  tool bash
  tool bash
agent stopped: completed after 4 turns, 3 tool calls
files the agent changed outside docs/runs/: none

  PASS  run-is-valid: 1 run dir(s) 2026-12-01T22-59-28Z_55dbc47-dirty; specs:check PASS (0 standards, 1 specs, 6 effective rules, 0 decisions, 1 runs)
  PASS  catches-planted: a2a-requires-token=fail, mounted-is-read-only=fail
  PASS  no-false-alarms: health-ok=pass, a2a-answers-with-token=pass, mounted-readable=pass, unknown-route-404=pass

  3/3 passed

Live run on spec-verify

After the move to spec-verify (2026-12-02), DeepSeek V4.1 Flash through Mycel passed again: 20 turns, 26 tool calls, no files changed outside docs/runs/, and it set diagnosis: "s_bug" on both planted failures without being told to.

Visual Target Wireframe ASCII Layout
  PASS  run-is-valid: 1 run dir(s) 2026-12-02T00-43-26Z_fd3a584; specs:check PASS (0 standards, 0 oracles, 1 specs, 6 effective rules, 0 decisions, 1 runs)
  PASS  catches-planted: a2a-requires-token=fail, mounted-is-read-only=fail
  PASS  no-false-alarms: health-ok=pass, a2a-answers-with-token=pass, mounted-readable=pass, unknown-route-404=pass

First live run (verify-deploy)

Visual Target Wireframe ASCII Layout
agent: mycel:deepseek/deepseek-v4.1-flash; service port 33111
agent stopped: completed after 23 turns, 30 tool calls
files the agent changed outside docs/runs/: none

  PASS  run-is-valid: 1 run dir(s) 2026-12-01T23-00-39Z_f2221ff; specs:check PASS (0 standards, 1 specs, 6 effective rules, 0 decisions, 1 runs)
  PASS  catches-planted: a2a-requires-token=fail, mounted-is-read-only=fail
  PASS  no-false-alarms: health-ok=pass, a2a-answers-with-token=pass, mounted-readable=pass, unknown-route-404=pass

  3/3 passed