polyguard: a zero exit code isn't proof of tests for AI-written code
Emergency-Tutor-7 · reddit · 2026-11-23
The author released polyglot-code-guard 0.5.0, run as polyguard verify, targeting a specific failure mode: an agent runs a command, gets exit code 0, and reports 'tests pass' even when no test ran.
- It detects project type, finds the suite, runs the plan, and returns PASS only when positive test-execution evidence appears in the runner's own output: pytest's passed line, cargo test result blocks, Go test events in the JSON stream, JUnit/Surefire/TRX counters, Swift Testing or XCTest summaries, per-test CTest Passed records.
- Missing tests, a missing toolchain, bad config, a timeout, or no positive evidence each return FAIL; a project's own npm test script is never accepted as evidence.
- Plans cover 11 language identifiers (Python, Rust, Go, JS/TS, Java, C#, PHP, Ruby, Swift, C, C++); monorepos are discovered recursively, with Maven, Gradle, Cargo, npm workspaces or .sln delegated to the native workspace command once; timeouts kill the process tree.
- The author notes the limit: PASS means the built-in plan succeeded with real test-pass evidence, not that code is correct or covered, and untrusted repos belong in a disposable container since it executes build scripts.
More from coding & agent
- aibrush: open-source oil painting simulator where an LLM paints stroke by stroke, no diffusion — FotoRe_store · 2026-11-23
- One-sentence prompt: Fable 5.2 rebuilt a landing page in ~20 min with 91 passing tests — Specificx · 2026-11-23
- Claude Docs beats Google Docs in daily use as Anthropic ships an office suite in 10 weeks — rubenhassid · 2026-11-23
- Vibe-coding platforms vs raw Claude: an Israeli dev on lock-in, SDKs and trade-offs — aloncarmel · 2026-11-23
- Dev builds MCP server where an LLM judges goal completion to unlock blocked iPhone apps — publicfunc · 2026-11-23
- Dev builds 3D classroom-style visualization for multi-agent collaborative workspace — jasonkneen · 2026-11-23