Verification

KHAELOR never claims completion because the model produced a confident sentence. It runs your checks itself — and repairs what fails, before you ever see the answer.

How the loop works#

  1. The model finishes a batch of edits (write/edit tool calls).
  2. The Tool Runtime launches the configured checks in parallel through the workspace seam (autofix checks like eslint --fix run last, serially).
  3. Each check lands as a durable verify.result event: name, command, real exit code, duration, and output truncated errors-first.
  4. Failing results are injected back into the conversation — the model repairs them before the turn can complete.
  5. The loop is bounded: after maxRepairLoops failing rounds (default 3) per user turn, checks stop re-running and the honest failure report stands.
the repair loop
 ├─ edit src/context/compaction.ts  +14 −3
  verify   typecheck  1.2s · tests  4.8s · lint 
   FAIL src/context/engine.test.ts — compaction preserves running processes
 KHAELOR is repairing the failure…
 ├─ edit src/context/compaction.ts  +6 −2
  verify   typecheck  · tests  5.3s · lint 
 ✓ verified 5.3s

Configuration#

// .khaelor/verify.json
{
  "typecheck": { "cmd": "npx tsc --noEmit", "timeout": 60 },
  "test":      { "cmd": "npx vitest run --changed", "timeout": 120 },
  "lint":      { "cmd": "npx eslint --fix", "timeout": 30, "autofix": true },
  "policy": "after-each-edit-batch",
  "maxRepairLoops": 3
}
FieldMeaning
<name>.cmdThe command; its exit code is the verdict. Run through your shell, in the project root.
<name>.timeoutSeconds before the check is killed (recorded as exit null, i.e. failed).
<name>.autofixThe check mutates files — run it after the parallel read-only checks.
policyafter-each-edit-batch (default) · before-final-answer (model-run, nudged) · off.
maxRepairLoopsFailing rounds per user turn before KHAELOR stops looping and reports.

Auto-detection#

Without a verify.json, KHAELOR detects conservatively:

FoundChecks
package.json scriptsnpm run typecheck / npm test / npm run lint when the scripts exist; npx tsc --noEmit when only tsconfig.json exists.
Cargo.tomlcargo check, cargo test.
pyproject.tomlpython3 -m pytest -x -q.

Honesty rules#

  • Passing checks stay out of the model's context (evidence only) — failures enter it verbatim.
  • Output is truncated errors-first: lines matching failure patterns are kept ahead of noise, with an explicit truncation marker.
  • /verify runs the whole suite on demand; the daemon refuses to escalate a goal run whose checks failed.