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#
- The model finishes a batch of edits (
write/edittool calls). - The Tool Runtime launches the configured checks in parallel through the
workspace seam (autofix checks like
eslint --fixrun last, serially). - Each check lands as a durable
verify.resultevent: name, command, real exit code, duration, and output truncated errors-first. - Failing results are injected back into the conversation — the model repairs them before the turn can complete.
- The loop is bounded: after
maxRepairLoopsfailing rounds (default 3) per user turn, checks stop re-running and the honest failure report stands.
├─ 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.3sConfiguration#
// .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
}
| Field | Meaning |
|---|---|
<name>.cmd | The command; its exit code is the verdict. Run through your shell, in the project root. |
<name>.timeout | Seconds before the check is killed (recorded as exit null, i.e. failed). |
<name>.autofix | The check mutates files — run it after the parallel read-only checks. |
policy | after-each-edit-batch (default) · before-final-answer (model-run, nudged) · off. |
maxRepairLoops | Failing rounds per user turn before KHAELOR stops looping and reports. |
Auto-detection#
Without a verify.json, KHAELOR detects conservatively:
| Found | Checks |
|---|---|
package.json scripts | npm run typecheck / npm test / npm run lint when the scripts exist; npx tsc --noEmit when only tsconfig.json exists. |
Cargo.toml | cargo check, cargo test. |
pyproject.toml | python3 -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.
/verifyruns the whole suite on demand; the daemon refuses to escalate a goal run whose checks failed.
Previous← Phase gates