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/repograph.html5Description: Docs — The RepoGraph: symbols and refs tools, incremental indexing, file skeletons, and the token economics.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>Semantic index — KHAELOR docs</title>14<meta name="description" content="The RepoGraph: symbols and refs tools, incremental indexing, file skeletons, and the token economics.">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>The semantic index — RepoGraph</h1>75<p class="lead">KHAELOR understands your repository without stuffing it into context: an incremental76symbol index answers “where is it defined?” and “who uses it?” in milliseconds.</p>7778<h2 id="tools">Two tools replace most exploratory greps<a class="anchor" href="#tools">#</a></h2>79<div class="termwrap"><div class="termbar"><span class="dot r"></span><span class="dot y"></span><span class="dot g"></span><span class="title">symbols</span></div>80<pre class="term" data-no-copy><code> <span class="t-dim">├─</span> symbols <span class="t-teal">"class:*Controller"</span> <span class="t-dim">· 2 hits · 9ms</span>81 src/http/auth.ts:24 <span class="t-dim">[class]</span> export class AuthController {82 <span class="t-dim">Login/logout endpoints.</span>83 src/http/admin.ts:11 <span class="t-dim">[class]</span> export class AdminController {</code></pre></div><div class="termwrap"><div class="termbar"><span class="dot r"></span><span class="dot y"></span><span class="dot g"></span><span class="title">refs — blast radius before an edit</span></div>84<pre class="term" data-no-copy><code> <span class="t-dim">├─</span> refs <span class="t-teal">handleAuth · callers</span> <span class="t-dim">· 14 sites</span>85 src/http/auth.ts:31 await handleAuth(token)86 src/http/middleware.ts:88 if (!(await handleAuth(t))) return deny()87 src/cli/login.ts:52 const ok = await handleAuth(input)</code></code></pre></div>88<table>89 <tr><th>Tool</th><th>Input</th><th>Returns</th></tr>90 <tr><td><code>symbols</code></td><td class="wrap"><code>query</code> (wildcards: <code>*Controller</code>, shorthand <code>class:*</code>), <code>kind</code> (function · class · type · export · variable · method), <code>scope</code> (glob).</td><td class="wrap">file:line, kind, signature, doc comment.</td></tr>91 <tr><td><code>refs</code></td><td class="wrap"><code>symbol</code>, <code>direction</code> = callers · callees · importers.</td><td class="wrap">Usage sites with a line of context each.</td></tr>92</table>9394<h2 id="indexing">Indexing<a class="anchor" href="#indexing">#</a></h2>95<ul>96 <li><strong>Incremental by mtime</strong>: only changed files re-extract; queries lazily refresh97 (debounced ~5 s), so results are never stale for long and startup stays instant.</li>98 <li><strong>Warm-up in the background</strong> at engine assembly — the first tool call does not pay for it.</li>99 <li>Languages today: TypeScript/JavaScript and Python, via a dependency-free heuristic extractor.100 tree-sitter grammars are the documented upgrade path — the service interface will not change.</li>101 <li><code>node_modules</code>, <code>.git</code>, <code>dist</code>, <code>references</code> are always excluded.</li>102</ul>103104<h2 id="skeletons">Skeletons — the token economics<a class="anchor" href="#skeletons">#</a></h2>105<p>The index can render any file as a <em>skeleton</em>: its signatures and doc comments with line106anchors — typically 5–15% of the tokens of the full file:</p>107<pre><code>src/kernel/dispatch.ts — skeleton (9 symbols; re-read the file if you need bodies)108 18 | export interface DispatchOptions { // Kernel dispatch configuration.109 42 | export function dispatch(call: ToolCall): Result<Obs> // The single entrypoint.110 97 | function verifyGrant(cap: Capability): boolean</code></pre>111<p>Exploration that used to cost a 3,000-token file read costs a 200-token skeleton. The agent is112prompted to reach for <code>symbols</code>/<code>refs</code> before <code>grep</code>.</p>113114<h2 id="honest">What it will not pretend<a class="anchor" href="#honest">#</a></h2>115<p><code>callees</code> is a heuristic (identifiers called within the defining region, resolved116against known symbols) — good for orientation, not a type-checked call graph. When precision117matters, KHAELOR confirms with <code>read</code>. Dynamic dispatch and reflection are invisible to118any static index; the tools say so instead of guessing.</p>119120<div class="pager">121 <div class="next"><span class="label">Next</span><a href="/docs/memory.html">Project memory →</a></div>122</div>123124</article>125</div></main>126127<footer class="site-footer"><div class="inner">128 <span>KHAELOR — Simon-Pierre Boucher · <a href="mailto:contact@spboucher.ai">contact@spboucher.ai</a></span>129 <span>Anthropic-powered · terminal-native by design</span>130</div></footer>131132</body>133</html>134