Use Case 02 · Execution Verification & CI Gates
Stop Coding Agents from Hallucinating Facts and Faking "Done"
The engineering problem
Coding agents frequently cite stale test output after making "one quick cleanup edit," or answer questions about ports, flags, and frameworks that do not exist in the repository with confident, plausible-sounding numbers.
How Cairnmind enforces a better boundary
- Named check profiles declared in .cairnmind/checks.toml run locally without a shell and bind their passing exit code to the exact task definition and worktree code fingerprint.
- Any single-line edit in the worktree immediately marks earlier check runs stale. Marking a requires_test task done is refused until a fresh passing run matches the current code.
- For factual questions, ask requires verbatim quotes verified against live files plus deterministic subject checks, support checks, and product-names checks. On main, it refused 24 of 24 absent-feature questions.
- In CI and pre-push hooks, cairnmind pulse --strict (< 500 ms) catches drift and stale test gates, while cairnmind scan runs serverless checks without starting the local service.
Concrete workflow
1. Declare deterministic check profiles in Git
$ cairnmind check profiles my-app --json Validates argv, timeout, and output budgets from .cairnmind/checks.toml.
2. Run check bound to a task & current fingerprint
$ cairnmind check run my-app unit --task TASK_ID Stores local_runner evidence linked to the exact Git head and dirty file hashes. Editing code flips status to stale.
3. Gate CI or pre-push in under 500 ms
$ cairnmind pulse my-app --strict --json Exits 0 when healthy, 1 on drift/stale tasks under --strict, and 2 on broken snapshot/integrity state.
4. Audit answers with regression replay
$ cairnmind eval replay my-app Re-asks logged project questions after upgrades and flags lost citations or status regressions.
What is guaranteed
- A requires_test task cannot move to done on reported chat text alone. Fresh local_runner proof is enforced in the store.
- Checks are never executed by MCP tools or the memory service.
- Verbatim quotes shown in ask are always taken literally from the current source file on disk.
Known limits
- Passing tests verify that your declared check profile exited 0 on the current code. They cannot verify unstated acceptance criteria.
- Without local models configured, ask operates in deterministic-only full-text search mode and reports status: unavailable rather than synthesizing answers.