spb/khaelor Public
KHAELOR — a terminal-native autonomous engineering agent powered by Anthropic.
TypeScript 82.9%
HTML 14.9%
CSS 1.1%
JavaScript 0.7%
1<!doctype html>2<!--3KHAELOR4File: website/public/docs/verification.html5Description: Docs — The native verify loop: configuration, auto-detection, the repair loop, policies, and honest failure reporting.6Author: Simon-Pierre Boucher7Contact: contact@spboucher.ai8-->9<html lang="en">10<head>11<meta charset="utf-8">12<meta name="viewport" content="width=device-width, initial-scale=1">13<title>Verification — KHAELOR docs</title>14<meta name="description" content="The native verify loop: configuration, auto-detection, the repair loop, policies, and honest failure reporting.">15<link rel="stylesheet" href="/styles.css">16<script>17(function(){try{var t=localStorage.getItem("khaelor-theme");if(!t&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: light)").matches)t="light";if(t==="light")document.documentElement.setAttribute("data-theme","light");}catch(e){}})();18</script>19<script defer src="/site.js"></script>20</head>21<body>2223<header class="site-header"><div class="inner">24 <a class="wordmark" href="/"><span class="glyph">❯</span><span class="g-ember">KHAELOR</span></a>25 <nav>26 <a href="/docs/getting-started.html">Docs</a>27 <a href="/#install">Install</a>28 <button id="theme-toggle" type="button" aria-label="Toggle color theme">light</button>29 </nav>30</div></header>3132<main class="page"><div class="docs-layout">3334<aside class="sidebar">35 <div class="group"><div class="group-title">Start</div>36 <a href="/docs/getting-started.html">Getting started</a>37 <a href="/docs/cookbook.html">Cookbook</a>38 </div>39 <div class="group"><div class="group-title">Using KHAELOR</div>40 <a href="/docs/usage.html">The TUI</a>41 <a href="/docs/commands.html">Commands & keyboard</a>42 <a href="/docs/tools.html">Tools</a>43 <a href="/docs/sessions.html">Sessions</a>44 </div>45 <div class="group"><div class="group-title">Autonomy</div>46 <a href="/docs/phases.html">Phase gates</a>47 <a href="/docs/verification.html">Verification</a>48 <a href="/docs/worktrees.html">Parallel worktrees</a>49 <a href="/docs/daemon.html">The daemon</a>50 </div>51 <div class="group"><div class="group-title">Intelligence</div>52 <a href="/docs/repograph.html">Semantic index</a>53 <a href="/docs/memory.html">Project memory</a>54 <a href="/docs/context.html">Context engine</a>55 <a href="/docs/fork-replay.html">Fork · replay · sdiff</a>56 </div>57 <div class="group"><div class="group-title">Control</div>58 <a href="/docs/permissions.html">Permissions</a>59 <a href="/docs/configuration.html">Configuration</a>60 <a href="/docs/cli.html">CLI reference</a>61 </div>62 <div class="group"><div class="group-title">Internals</div>63 <a href="/docs/architecture.html">Architecture</a>64 <a href="/docs/events.html">The event model</a>65 <a href="/docs/theming.html">Theming & terminal</a>66 </div>67 <div class="group"><div class="group-title">Help</div>68 <a href="/docs/faq.html">FAQ & troubleshooting</a>69 </div>70</aside>7172<article class="content">7374<h1>Verification</h1>75<p class="lead">KHAELOR never claims completion because the model produced a confident sentence.76It runs your checks itself — and repairs what fails, before you ever see the answer.</p>7778<h2 id="how">How the loop works<a class="anchor" href="#how">#</a></h2>79<ol>80 <li>The model finishes a batch of edits (<code>write</code>/<code>edit</code> tool calls).</li>81 <li>The Tool Runtime launches the configured checks <strong>in parallel</strong> through the82 workspace seam (autofix checks like <code>eslint --fix</code> run last, serially).</li>83 <li>Each check lands as a durable <code>verify.result</code> event: name, command, real exit84 code, duration, and output truncated <em>errors-first</em>.</li>85 <li>Failing results are injected back into the conversation — the model repairs them before86 the turn can complete.</li>87 <li>The loop is bounded: after <code>maxRepairLoops</code> failing rounds (default 3) per user88 turn, checks stop re-running and the honest failure report stands.</li>89</ol>90<div class="termwrap"><div class="termbar"><span class="dot r"></span><span class="dot y"></span><span class="dot g"></span><span class="title">the repair loop</span></div>91<pre class="term" data-no-copy><code> <span class="t-dim">├─</span> edit <span class="t-teal">src/context/compaction.ts</span> <span class="t-ok">+14</span> <span class="t-err">−3</span>92 <span class="t-glow">⟳</span> <span class="t-b">verify</span> typecheck <span class="t-ok">✓</span> <span class="t-dim">1.2s</span> · tests <span class="t-err">✗</span> <span class="t-dim">4.8s</span> · lint <span class="t-ok">✓</span>93 <span class="t-dim">FAIL src/context/engine.test.ts — compaction preserves running processes</span>94 <span class="t-dim">KHAELOR is repairing the failure…</span>95 <span class="t-dim">├─</span> edit <span class="t-teal">src/context/compaction.ts</span> <span class="t-ok">+6</span> <span class="t-err">−2</span>96 <span class="t-glow">⟳</span> <span class="t-b">verify</span> typecheck <span class="t-ok">✓</span> · tests <span class="t-ok">✓</span> <span class="t-dim">5.3s</span> · lint <span class="t-ok">✓</span>97 <span class="t-ok">✓ verified 5.3s</span></code></pre></div>9899<h2 id="config">Configuration<a class="anchor" href="#config">#</a></h2>100<pre><code>// .khaelor/verify.json101{102 "typecheck": { "cmd": "npx tsc --noEmit", "timeout": 60 },103 "test": { "cmd": "npx vitest run --changed", "timeout": 120 },104 "lint": { "cmd": "npx eslint --fix", "timeout": 30, "autofix": true },105 "policy": "after-each-edit-batch",106 "maxRepairLoops": 3107}</code></pre>108<table>109 <tr><th>Field</th><th>Meaning</th></tr>110 <tr><td><code><name>.cmd</code></td><td class="wrap">The command; its exit code is the verdict. Run through your shell, in the project root.</td></tr>111 <tr><td><code><name>.timeout</code></td><td class="wrap">Seconds before the check is killed (recorded as exit <code>null</code>, i.e. failed).</td></tr>112 <tr><td><code><name>.autofix</code></td><td class="wrap">The check mutates files — run it after the parallel read-only checks.</td></tr>113 <tr><td><code>policy</code></td><td class="wrap"><code>after-each-edit-batch</code> (default) · <code>before-final-answer</code> (model-run, nudged) · <code>off</code>.</td></tr>114 <tr><td><code>maxRepairLoops</code></td><td class="wrap">Failing rounds per user turn before KHAELOR stops looping and reports.</td></tr>115</table>116117<h2 id="detect">Auto-detection<a class="anchor" href="#detect">#</a></h2>118<p>Without a <code>verify.json</code>, KHAELOR detects conservatively:</p>119<table>120 <tr><th>Found</th><th>Checks</th></tr>121 <tr><td><code>package.json</code> scripts</td><td class="wrap"><code>npm run typecheck</code> / <code>npm test</code> / <code>npm run lint</code> when the scripts exist; <code>npx tsc --noEmit</code> when only <code>tsconfig.json</code> exists.</td></tr>122 <tr><td><code>Cargo.toml</code></td><td class="wrap"><code>cargo check</code>, <code>cargo test</code>.</td></tr>123 <tr><td><code>pyproject.toml</code></td><td class="wrap"><code>python3 -m pytest -x -q</code>.</td></tr>124</table>125126<h2 id="honesty">Honesty rules<a class="anchor" href="#honesty">#</a></h2>127<ul>128 <li>Passing checks stay out of the model's context (evidence only) — failures enter it verbatim.</li>129 <li>Output is truncated errors-first: lines matching failure patterns are kept ahead of noise,130 with an explicit truncation marker.</li>131 <li><code>/verify</code> runs the whole suite on demand; the daemon refuses to escalate a goal132 run whose checks failed.</li>133</ul>134135<div class="pager">136 <div><span class="label">Previous</span><a href="/docs/phases.html">← Phase gates</a></div>137 <div class="next"><span class="label">Next</span><a href="/docs/worktrees.html">Parallel worktrees →</a></div>138</div>139140</article>141</div></main>142143<footer class="site-footer"><div class="inner">144 <span>KHAELOR — Simon-Pierre Boucher · <a href="mailto:contact@spboucher.ai">contact@spboucher.ai</a></span>145 <span>Anthropic-powered · terminal-native by design</span>146</div></footer>147148</body>149</html>150