Turbocharge Claude Code, Cursor, Codex, Gemini & every coding agent: faster, cheaper, with contextual understanding specific to your codebase.
TypeScript ai-agentsanthropicclaude-codeclicode-graphcodexcontext-engineeringcursordeveloper-toolsgeminiknowledge-graphllmmcpmcp-serveropen-sourceopenaitree-sitter
update graft
anirudhkumar-nanonetsd9aca0e43956
diff --git a/graft/.graph/wiring.json b/graft/.graph/wiring.jsonindex e77e4160..75b7c471 100644--- a/graft/.graph/wiring.json+++ b/graft/.graph/wiring.json@@ -1,8 +1,8 @@{"meta": {"version": 1,- "nodeCount": 319,- "edgeCount": 730,+ "nodeCount": 325,+ "edgeCount": 752,"languages": ["typescript"]@@ -1194,13 +1194,13 @@"name": "ask.ts","kind": "file","path": "src/ask/ask.ts",- "span": "L1-L277",+ "span": "L1-L332","signature": null,"exported": true,"origin": "ast",- "body_hash": "62415cb36e835e8a5e9329a770489a726028284b8f40497beba6a721ecf05e21",+ "body_hash": "5dad6519214e9b58feb86b46e2f498338819643ec44dc69a8f70614aad2eb986","summary_state": "ready",- "summary": "This file implements a query routing tool that processes natural language queries to return relevant context from a codebase.",+ "summary": "This file implements a query tool that routes natural language queries to relevant code symbols and returns structured context information.","crux": null},{@@ -1208,16 +1208,16 @@"name": "ask","kind": "function","path": "src/ask/ask.ts",- "span": "L242-L252",+ "span": "L290-L305","signature": "function ask(dir: string, query: string, opts: AskOptions = {}): AskResult","exported": true,"origin": "ast",- "body_hash": "c025c4d20293ee7c251599d4bb566b5083a1d259963706f24d33c3c8074f5719",+ "body_hash": "1124c362b9a0ab463a7c14fe451fcb3ae476344dee54b361904ad0e536aba0f5","summary_state": "ready",- "summary": "Handles a query by loading the appropriate corpus and executing either structural or lexical search.",+ "summary": "Processes a query against a code graph, returning structured results based on the query type and context.","crux": {- "code": " const s = structural(query, corpus.graph, limit);\n if (s) return s;\n }",- "span": "L248-L250"+ "code": " const s = structural(query, corpus.graph, limit);\n result = s ?? lexical(query, corpus, limit);",+ "span": "L298-L299"}},{@@ -1225,13 +1225,13 @@"name": "AskHit","kind": "interface","path": "src/ask/ask.ts",- "span": "L23-L32",+ "span": "L23-L36","signature": "interface AskHit","exported": true,"origin": "ast",- "body_hash": "990a0462418d06bfb0c6debc05ef1267d263ca5eb436928e441444da89a62227",+ "body_hash": "51baa90dc28b443f824809190b7bb95bd028db20b68aea518ca865769dae424c","summary_state": "ready",- "summary": "Represents a hit in the query results, encapsulating details about a concept or symbol found in the codebase.",+ "summary": "Represents a hit in the query results, encapsulating details about a code symbol and its context.","crux": null},{@@ -1239,13 +1239,13 @@"name": "AskOptions","kind": "interface","path": "src/ask/ask.ts",- "span": "L236-L239",+ "span": "L244-L250","signature": "interface AskOptions","exported": true,"origin": "ast",- "body_hash": "36b587f0f7a73149b5024a13a7ac4ff596fc101ce5de200ea50bbc0159f517b3",+ "body_hash": "64043b27c35ab15223fb25bafbead807a203177b4871d9ca0833012a5ddc3f59","summary_state": "ready",- "summary": "Defines options for the ask function, allowing customization of the query context and result limits.",+ "summary": "Defines options for customizing the behavior of the ask function, such as context directory and result limits.","crux": null},{@@ -1253,7 +1253,7 @@"name": "AskResult","kind": "interface","path": "src/ask/ask.ts",- "span": "L34-L41",+ "span": "L42-L49","signature": "interface AskResult","exported": true,"origin": "ast",@@ -1267,7 +1267,7 @@"name": "Corpus","kind": "interface","path": "src/ask/ask.ts",- "span": "L75-L78",+ "span": "L83-L86","signature": "interface Corpus","exported": false,"origin": "ast",@@ -1281,7 +1281,7 @@"name": "counts","kind": "function","path": "src/ask/ask.ts",- "span": "L59-L63",+ "span": "L67-L71","signature": "function counts(tokens: string[]): Map<string, number>","exported": false,"origin": "ast",@@ -1298,7 +1298,7 @@"name": "findSubject","kind": "function","path": "src/ask/ask.ts",- "span": "L125-L143",+ "span": "L133-L151","signature": "function findSubject(query: string, graph: GraphV1): NodeV1[]","exported": false,"origin": "ast",@@ -1315,7 +1315,7 @@"name": "firstProse","kind": "function","path": "src/ask/ask.ts",- "span": "L66-L73",+ "span": "L74-L81","signature": "function firstProse(body: string): string","exported": false,"origin": "ast",@@ -1332,16 +1332,33 @@"name": "formatAsk","kind": "function","path": "src/ask/ask.ts",- "span": "L255-L276",+ "span": "L308-L331","signature": "function formatAsk(r: AskResult): string","exported": true,"origin": "ast",- "body_hash": "655f23a018eff9da0eee605dfea6bca21949cda37f6d5a5265a2f83cdb84ab69",+ "body_hash": "8af467346c9f58e5f3fdc408b8eea980c3879d954cae8a32bbc62a19eb2cf4cc","summary_state": "ready",- "summary": "Formats the results of an AskResult into a markdown string for easy presentation.",+ "summary": "Formats the results of a query into a markdown context pack for easy readability and presentation.","crux": {- "code": "export function formatAsk(r: AskResult): string {\n const head = `graft ask — \"${r.query}\" (${r.mode}${r.note ? `: ${r.note}` : \"\"})`;\n if (r.hits.length === 0) {\n return `${head}\\n\\n${r.note ?? \"no matches.\"}`;\n }\n const lines = [head, \"\"];\n if (r.mode === \"structural\") {\n for (const h of r.hits) {\n const tail = h.snippet ? ` — ${h.snippet}` : \"\";\n lines.push(`- ${h.title} ${h.pointer} (${h.relation})${tail}`);\n }\n } else {",- "span": "L255-L266"+ "code": "export function formatAsk(r: AskResult): string {\n const head = `graft ask — \"${r.query}\" (${r.mode}${r.note ? `: ${r.note}` : \"\"})`;\n if (r.hits.length === 0) {\n return `${head}\\n\\n${r.note ?? \"no matches.\"}`;\n }\n const lines = [head, \"\"];\n if (r.mode === \"structural\") {\n for (const h of r.hits) {\n const tail = h.snippet ? ` — ${h.snippet}` : \"\";\n lines.push(`- ${h.title} ${h.pointer} (${h.relation})${tail}`);\n if (h.code) lines.push(\"\", \"```\", h.code, \"```\", \"\");\n }",+ "span": "L308-L319"+ }+ },+ {+ "id": "src/ask/ask.ts#inlineSource",+ "name": "inlineSource",+ "kind": "function",+ "path": "src/ask/ask.ts",+ "span": "L280-L287",+ "signature": "function inlineSource(root: string, hits: AskHit[]): void",+ "exported": false,+ "origin": "ast",+ "body_hash": "1956881d9722274712b026fa4baf87b7c571977d49e2176dad9b93d849f946b5",+ "summary_state": "ready",+ "summary": "Attaches inlined source code to query hits, enhancing the context provided to the user.",+ "crux": {+ "code": "function inlineSource(root: string, hits: AskHit[]): void {\n for (const h of hits) {\n const s = parseSpan(h.pointer);\n if (!s) continue;\n const code = sliceSpan(root, s.path, s.from, s.to);\n if (code) h.code = code;\n }",+ "span": "L280-L286"}},{@@ -1349,7 +1366,7 @@"name": "lexical","kind": "function","path": "src/ask/ask.ts",- "span": "L190-L234",+ "span": "L198-L242","signature": "function lexical(query: string, corpus: Corpus, limit: number): AskResult","exported": false,"origin": "ast",@@ -1366,7 +1383,7 @@"name": "loadCorpus","kind": "function","path": "src/ask/ask.ts",- "span": "L80-L105",+ "span": "L88-L113","signature": "function loadCorpus(outDir: string): Corpus","exported": false,"origin": "ast",@@ -1378,12 +1395,29 @@"span": "L93-L101"}},+ {+ "id": "src/ask/ask.ts#parseSpan",+ "name": "parseSpan",+ "kind": "function",+ "path": "src/ask/ask.ts",+ "span": "L254-L258",+ "signature": "function parseSpan(pointer: string): { path: string; from: number; to: number } | null",+ "exported": false,+ "origin": "ast",+ "body_hash": "167f32f4458f586e27867a3de42b75c75366f38d922fd9ea0b5a2380788ed0b0",+ "summary_state": "ready",+ "summary": "Parses a string pointer into its file path and line range components, facilitating source code navigation.",+ "crux": {+ "code": " const m = pointer.match(/^(.*):L(\\d+)-L(\\d+)$/);\n if (!m) return null;\n return { path: m[1], from: Number(m[2]), to: Number(m[3]) };",+ "span": "L255-L257"+ }+ },{"id": "src/ask/ask.ts#score","name": "score","kind": "function","path": "src/ask/ask.ts",- "span": "L108-L115",+ "span": "L116-L123","signature": "function score(query: Map<string, number>, doc: Map<string, number>): number","exported": false,"origin": "ast",@@ -1395,12 +1429,29 @@"span": "L108-L114"}},+ {+ "id": "src/ask/ask.ts#sliceSpan",+ "name": "sliceSpan",+ "kind": "function",+ "path": "src/ask/ask.ts",+ "span": "L262-L277",+ "signature": "function sliceSpan(root: string, path: string, from: number, to: number): string | null",+ "exported": false,+ "origin": "ast",+ "body_hash": "44149097e46f09ef24a44f0b307a1346234527fc47d98b2d52988d26c8d6328d",+ "summary_state": "ready",+ "summary": "Reads a specified range of lines from a source file, allowing for inlined code snippets in query results.",+ "crux": {+ "code": "function sliceSpan(root: string, path: string, from: number, to: number): string | null {\n try {\n const lines = readFileSync(join(root, path), \"utf8\").split(\"\\n\");\n const start = Math.max(1, from);\n const end = Math.min(lines.length, to);\n const slice = lines.slice(start - 1, end);\n if (slice.length > MAX_SPAN_LINES) {\n const head = slice.slice(0, MAX_SPAN_LINES);\n head.push(`… (+${slice.length - MAX_SPAN_LINES} more lines; open ${path}:L${start}-L${end})`);\n return head.join(\"\\n\");\n }\n return slice.join(\"\\n\");",+ "span": "L262-L273"+ }+ },{"id": "src/ask/ask.ts#structural","name": "structural","kind": "function","path": "src/ask/ask.ts",- "span": "L145-L186",+ "span": "L153-L194","signature": "function structural(query: string, graph: GraphV1, limit: number): AskResult | null","exported": false,"origin": "ast",@@ -1417,7 +1468,7 @@"name": "tokenize","kind": "function","path": "src/ask/ask.ts",- "span": "L50-L56",+ "span": "L58-L64","signature": "function tokenize(text: string): string[]","exported": false,"origin": "ast",@@ -1434,21 +1485,24 @@"name": "cli.ts","kind": "file","path": "src/cli.ts",- "span": "L1-L166",+ "span": "L1-L187","signature": null,"exported": true,"origin": "ast",- "body_hash": "294b01aae943b958a291aa17387fe05439ca3b5ffe1a4ed97a4a2c378dcd7947",+ "body_hash": "ba1d90ee4c0f7b5000fa4239461c19d54fdedcad12b8592589312f163e1357dc","summary_state": "ready",- "summary": "This file implements the `graft` CLI tool for building and maintaining a context graph from code, ensuring synchronization and providing querying capabilities.",- "crux": null+ "summary": "This file implements the `graft` CLI tool for building and maintaining a context graph from code, ensuring it stays in sync with the repository.",+ "crux": {+ "code": "program\n .name(\"graft\")\n .description(\"Build a repo's context graph as linked markdown, and keep it in sync with the code.\")",+ "span": "L22-L24"+ }},{"id": "src/cli.ts#engineFrom","name": "engineFrom","kind": "function","path": "src/cli.ts",- "span": "L26-L29",+ "span": "L27-L30","signature": "function engineFrom(): Graft","exported": false,"origin": "ast",@@ -1465,7 +1519,7 @@"name": "fmt","kind": "function","path": "src/cli.ts",- "span": "L42-L46",+ "span": "L49-L53","signature": "fmt = (o: Record<string, number>)","exported": false,"origin": "ast",@@ -2190,16 +2244,16 @@"name": "engine.ts","kind": "file","path": "src/engine.ts",- "span": "L1-L126",+ "span": "L1-L129","signature": null,"exported": true,"origin": "ast",- "body_hash": "26307935c472954b6511e7352cf6c0f11ce53dd151ac2407e5fcadc0b9b7c01b",+ "body_hash": "e237ef6555d8bd2001eccfc32e314ef3881cef1c79d537ee701515a357f87d16","summary_state": "ready",- "summary": "This file implements the Context Graph Engine, which builds and checks a code context graph from a repository without a database.",+ "summary": "The Context Graph Engine builds and checks a code context graph from a repository without a database.","crux": {- "code": "/**\n * The Context Graph Engine.\n *\n * Two operations, no database:\n * - {@link Graft.init} build `.context/` from a code repo.\n * - {@link Graft.check} report whether `.context/` is still in\n * sync with the code (for CI).\n *\n * The graph is a folder of linked markdown files committed to the repo; git is\n * the sync. This class wires the OpenRouter LLM providers into the build/check\n * pipelines; an API key is required for any LLM-backed operation.\n */",- "span": "L1-L12"+ "code": " * - {@link Graft.init} build `.context/` from a code repo.\n * - {@link Graft.check} report whether `.context/` is still in\n * sync with the code (for CI).\n *\n * The graph is a folder of linked markdown files committed to the repo; git is\n * the sync. This class wires the OpenRouter LLM providers into the build/check\n * pipelines; an API key is required for any LLM-backed operation.",+ "span": "L5-L11"}},{@@ -2221,33 +2275,30 @@"name": "Graft","kind": "class","path": "src/engine.ts",- "span": "L43-L125",+ "span": "L45-L128","signature": "class Graft","exported": true,"origin": "ast",- "body_hash": "64bc71b4d06ee6365c1848cd45b4375af6d26d2b7dd45d2ba81bb406813d271c",+ "body_hash": "fb35e77789763532926013366fd1fc5027bd02cac2356512d8a5813f6b409009","summary_state": "ready",- "summary": "The Graft class manages the context graph operations, including building and checking the graph against the codebase.",- "crux": {- "code": "export class Graft {\n private cfg: ResolvedConfig;\n\n constructor(config: EngineConfig = {}) {\n this.cfg = resolveConfig(config);\n }\n\n /** Build the `.context/` graph from the repo at `dir`. */\n async init(dir: string, opts: InitOptions = {}): Promise<BuildResult> {\n return buildContext(dir, {\n contextDir: this.cfg.contextDir,\n extensions: opts.extensions,",- "span": "L43-L54"- }+ "summary": "Encapsulates methods for building and checking a context graph from a code repository.",+ "crux": null},{"id": "src/engine.ts#Graft.ask","name": "ask","kind": "method","path": "src/engine.ts",- "span": "L90-L92",- "signature": "ask(dir: string, query: string, opts: { limit?: number } = {}): AskResult",+ "span": "L93-L95",+ "signature": "ask(dir: string, query: string, opts: { limit?: number; source?: boolean } = {}): AskResult","exported": true,"origin": "ast",- "body_hash": "a41f3683c1fcac67f48b6cc443e76bceba15b279b302ce847774a81fb0612285",+ "body_hash": "d076ef89fe91fba4be041009db20e1ff2c709af57fb09103720cb2384f5693c7","summary_state": "ready",- "summary": "Processes a query against the committed graph, returning results based on structural and lexical rankings.",+ "summary": "Processes a query against the committed graph to return relevant information based on structural and lexical ranking.","crux": {- "code": " ask(dir: string, query: string, opts: { limit?: number } = {}): AskResult {\n return ask(dir, query, { contextDir: this.cfg.contextDir, limit: opts.limit });\n }",- "span": "L90-L92"+ "code": " ask(dir: string, query: string, opts: { limit?: number; source?: boolean } = {}): AskResult {",+ "span": "L93-L93"}},{@@ -2255,7 +2306,7 @@"name": "check","kind": "method","path": "src/engine.ts",- "span": "L63-L65",+ "span": "L65-L67","signature": "check(dir: string, opts: CheckRunOptions = {}): CheckResult","exported": true,"origin": "ast",@@ -2272,7 +2323,7 @@"name": "checkGraph","kind": "method","path": "src/engine.ts",- "span": "L68-L70",+ "span": "L70-L72","signature": "checkGraph(dir: string): GraphCheckResult","exported": true,"origin": "ast",@@ -2289,7 +2340,7 @@"name": "constructor","kind": "method","path": "src/engine.ts",- "span": "L46-L48",+ "span": "L48-L50","signature": "constructor(config: EngineConfig = {})","exported": true,"origin": "ast",@@ -2306,7 +2357,7 @@"name": "cruxSummarizer","kind": "method","path": "src/engine.ts",- "span": "L111-L113",+ "span": "L114-L116","signature": "private cruxSummarizer(): CruxSummarizer","exported": true,"origin": "ast",@@ -2323,16 +2374,16 @@"name": "graph","kind": "method","path": "src/engine.ts",- "span": "L77-L83",+ "span": "L79-L86","signature": "graph(dir: string, opts: GraphRunOptions = {}): Promise<GraphBuildResult>","exported": true,"origin": "ast",- "body_hash": "227e5765f18483fe86dcc7c78c3955f141d0630c869b5111f2283366c8162a06",+ "body_hash": "cec39cf7bba0c124990ab186d6aae7ae2dcf5f17bfc56ecbef85f1fcc394050e","summary_state": "ready",- "summary": "Builds a per-symbol code graph in JSON format, optionally including a meaning layer based on the provided options.",+ "summary": "Builds a per-symbol code graph from the repository, optionally using a meaning layer with LLM.","crux": {- "code": " graph(dir: string, opts: GraphRunOptions = {}): Promise<GraphBuildResult> {\n return buildGraph(dir, {\n contextDir: this.cfg.contextDir,\n summarizer: opts.llm ? this.cruxSummarizer() : undefined,\n onProgress: opts.onProgress,\n });\n }",- "span": "L77-L83"+ "code": " graph(dir: string, opts: GraphRunOptions = {}): Promise<GraphBuildResult> {\n return buildGraph(dir, {\n contextDir: this.cfg.contextDir,\n summarizer: opts.llm ? this.cruxSummarizer() : undefined,\n concurrency: opts.concurrency,\n onProgress: opts.onProgress,\n });",+ "span": "L79-L85"}},{@@ -2340,7 +2391,7 @@"name": "init","kind": "method","path": "src/engine.ts",- "span": "L51-L60",+ "span": "L53-L62","signature": "async init(dir: string, opts: InitOptions = {}): Promise<BuildResult>","exported": true,"origin": "ast",@@ -2357,7 +2408,7 @@"name": "modelLabel","kind": "method","path": "src/engine.ts",- "span": "L121-L124",+ "span": "L124-L127","signature": "private modelLabel(): string","exported": true,"origin": "ast",@@ -2374,7 +2425,7 @@"name": "requireKey","kind": "method","path": "src/engine.ts",- "span": "L95-L103",+ "span": "L98-L106","signature": "private requireKey(): string","exported": true,"origin": "ast",@@ -2391,7 +2442,7 @@"name": "summarizer","kind": "method","path": "src/engine.ts",- "span": "L115-L118",+ "span": "L118-L121","signature": "private summarizer(): Summarizer","exported": true,"origin": "ast",@@ -2408,7 +2459,7 @@"name": "synthesizer","kind": "method","path": "src/engine.ts",- "span": "L105-L108",+ "span": "L108-L111","signature": "private synthesizer(): Synthesizer","exported": true,"origin": "ast",@@ -2425,13 +2476,13 @@"name": "GraphRunOptions","kind": "interface","path": "src/engine.ts",- "span": "L37-L41",+ "span": "L37-L43","signature": "interface GraphRunOptions","exported": true,"origin": "ast",- "body_hash": "39ff67f6cc34aa0019b25dcee492776cfbb3872146ec3920492b97331fca894b",+ "body_hash": "424eba22dc93e6a1f2b948f40d738ef8dd9b0bf4d06d7a3d562c2c6d77443d73","summary_state": "ready",- "summary": "Holds options for running the graph build, including whether to use a Tier-2 LLM meaning pass.",+ "summary": "Defines options for running the graph building process, including LLM usage and concurrency settings.","crux": null},{@@ -2453,16 +2504,16 @@"name": "build.ts","kind": "file","path": "src/graph/build.ts",- "span": "L1-L144",+ "span": "L1-L147","signature": null,"exported": true,"origin": "ast",- "body_hash": "8b05c94896ca63d9c66bf5b3340db53cb8600d536a36880a3012599edf1b3a44",+ "body_hash": "b18f5fc18dffd77771f39722eb19963c1188fd298cbb5cfd5d71ef8dc45658c6","summary_state": "ready",- "summary": "This file defines the logic to build a graph representation of a code repository, facilitating analysis and visualization of its structure.",+ "summary": "This file defines the logic to build a graph representation from source code files in a repository.","crux": {- "code": " const edges = resolveEdges(nodes, rawEdges);\n\n // graph.json is its own Tier-2 cache: fold in the prior meaning layer so an\n // unchanged body is never re-summarized (and a Tier-1-only run never wipes it).\n const prior = readGraph(wiringPath(outDir));\n const priorById = new Map((prior?.nodes ?? []).map((n) => [n.id, n]));\n const meaning = await enrichGraph(nodes, priorById, sources, {\n summarizer: opts.summarizer,\n onProgress: ({ index, total, node }) =>\n opts.onProgress?.({ phase: \"enrich\", index, total, file: node }),\n });\n errors.push(...meaning.errors);",- "span": "L91-L102"+ "code": "export async function buildGraph(\n dir: string,\n opts: GraphBuildOptions = {},\n): Promise<GraphBuildResult> {\n const root = resolve(dir);\n const outDir = contextDirFor(root, opts.contextDir);\n const files = listSourceFiles(root, outDir);\n\n const nodes: NodeV1[] = [];\n const rawEdges: RawEdge[] = [];\n const sources = new Map<string, string>();\n const langs = new Set<Language>();",+ "span": "L57-L68"}},{@@ -2470,16 +2521,16 @@"name": "buildGraph","kind": "function","path": "src/graph/build.ts",- "span": "L55-L143",+ "span": "L57-L146","signature": "async function buildGraph( dir: string, opts: GraphBuildOptions = {}, ): Promise<GraphBuildResult>","exported": true,"origin": "ast",- "body_hash": "694834a4a621098b82506032a8e46930190050190c3c0231bf264f8404529465",+ "body_hash": "aa7152b35e0503aee7e9e7fdb56a5354e737f7b2c41313487906817be90776a2","summary_state": "ready",- "summary": "This function orchestrates the process of building a graph from source files, including parsing, enriching, and writing the graph data.",+ "summary": "This function orchestrates the process of reading source files, extracting nodes and edges, and writing the resulting graph to a file.","crux": {- "code": " const edges = resolveEdges(nodes, rawEdges);\n\n // graph.json is its own Tier-2 cache: fold in the prior meaning layer so an\n // unchanged body is never re-summarized (and a Tier-1-only run never wipes it).\n const prior = readGraph(wiringPath(outDir));\n const priorById = new Map((prior?.nodes ?? []).map((n) => [n.id, n]));\n const meaning = await enrichGraph(nodes, priorById, sources, {\n summarizer: opts.summarizer,\n onProgress: ({ index, total, node }) =>\n opts.onProgress?.({ phase: \"enrich\", index, total, file: node }),\n });\n errors.push(...meaning.errors);",- "span": "L91-L102"+ "code": " const edges = resolveEdges(nodes, rawEdges);\n\n // graph.json is its own Tier-2 cache: fold in the prior meaning layer so an\n // unchanged body is never re-summarized (and a Tier-1-only run never wipes it).\n const prior = readGraph(wiringPath(outDir));\n const priorById = new Map((prior?.nodes ?? []).map((n) => [n.id, n]));\n const meaning = await enrichGraph(nodes, priorById, sources, {\n summarizer: opts.summarizer,\n concurrency: opts.concurrency,\n onProgress: ({ index, total, node }) =>\n opts.onProgress?.({ phase: \"enrich\", index, total, file: node }),\n });",+ "span": "L93-L104"}},{@@ -2487,13 +2538,13 @@"name": "GraphBuildOptions","kind": "interface","path": "src/graph/build.ts",- "span": "L22-L33",+ "span": "L22-L35","signature": "interface GraphBuildOptions","exported": true,"origin": "ast",- "body_hash": "71abfa189c81e3297978ab399e0918f9504d8fffe5730d8f604a6df9640bdd4f",+ "body_hash": "09dc36c486449d7e17f9fe9ddb0fbed6ba20104b28ff1ab6f38a1de344975ea8","summary_state": "ready",- "summary": "This interface specifies options for customizing the graph build process, including output directory and summarization behavior.",+ "summary": "This interface specifies options for customizing the graph build process, including output directory and summarization settings.","crux": null},{@@ -2501,7 +2552,7 @@"name": "GraphBuildResult","kind": "interface","path": "src/graph/build.ts",- "span": "L35-L48",+ "span": "L37-L50","signature": "interface GraphBuildResult","exported": true,"origin": "ast",@@ -2515,7 +2566,7 @@"name": "listSourceFiles","kind": "function","path": "src/graph/build.ts",- "span": "L51-L53",+ "span": "L53-L55","signature": "function listSourceFiles(root: string, outDir: string): string[]","exported": true,"origin": "ast",@@ -2532,13 +2583,13 @@"name": "cards.ts","kind": "file","path": "src/graph/cards.ts",- "span": "L1-L284",+ "span": "L1-L282","signature": null,"exported": true,"origin": "ast",- "body_hash": "aef80e6f26a00e406385cd1faeb03d3b4e35a3cc7f1e0c50f7d94ad8a380f913",+ "body_hash": "c45f4bd1be271a9c5ff01c04bae2a2d4fd761eb85bd8d4a302738e6744e636b1","summary_state": "ready",- "summary": "This module generates markdown cards that summarize source files and their symbols for easier navigation and understanding of the codebase.",+ "summary": "This module generates markdown cards that summarize source files and their symbols, facilitating easier navigation and understanding of the codebase.","crux": null},{@@ -2608,7 +2659,7 @@"name": "CoverRef","kind": "interface","path": "src/graph/cards.ts",- "span": "L227-L232",+ "span": "L225-L230","signature": "interface CoverRef","exported": true,"origin": "ast",@@ -2758,7 +2809,7 @@"name": "writeCovers","kind": "function","path": "src/graph/cards.ts",- "span": "L247-L283",+ "span": "L245-L281","signature": "function writeCovers(graph: GraphV1, outDir: string): number","exported": true,"origin": "ast",@@ -2775,16 +2826,16 @@"name": "writeIndex","kind": "function","path": "src/graph/cards.ts",- "span": "L189-L224",+ "span": "L189-L222","signature": "function writeIndex(outDir: string, files: CardFileInfo[]): void","exported": true,"origin": "ast",- "body_hash": "ad4dcc7f053176ce9dd9173fa98751133ff049abb0138e0b59fbef8995f49cf3",+ "body_hash": "e2e95c9595a5386036af4f9beeda3897fe1b22e53fcb5d79d2c07fa3276481c1","summary_state": "ready",- "summary": "Creates an index markdown file that lists all concept nodes and per-file cards for easy navigation.",+ "summary": "This function creates an index markdown file that lists concept nodes and per-file cards, providing a quick reference for navigating the repository.","crux": {- "code": " const lines: string[] = [\n \"# graft — repo map\",\n \"\",\n \"Small markdown nodes summarising this repo. `grep` any term, symbol, or\",\n 'filename here, or run `graft ask \"<task>\"`. Each node carries prose plus exact',\n \"`file:line`; open a source file only to edit the named span.\",\n \"\",\n ];\n\n const concepts = readNodes(outDir).sort((a, b) => a.slug.localeCompare(b.slug));\n if (concepts.length) {\n lines.push(\"## Concepts\", \"\");",- "span": "L190-L201"+ "code": " \"# graft — repo map\",\n \"\",\n \"Small markdown nodes summarising this repo. `grep` any term, symbol, or\",\n 'filename here, or run `graft ask \"<task>\"`. Each node carries prose plus exact',\n \"`file:line`; open a source file only to edit the named span.\",\n \"\",\n ];\n\n const concepts = readNodes(outDir).sort((a, b) => a.slug.localeCompare(b.slug));\n if (concepts.length) {\n lines.push(\"## Concepts\", \"\");\n for (const c of concepts) {",+ "span": "L191-L202"}},{@@ -2796,9 +2847,9 @@"signature": null,"exported": true,"origin": "ast",- "body_hash": "f0b73053e31d03ec1280d465d614c97044541691675f2b3d09e10bcab5078b58",+ "body_hash": "5358023fe498fb2878e3aa9b6756272c39926dda865c6495d8f33d13c5ceb376","summary_state": "ready",- "summary": "This file contains logic to verify if the committed graph is in sync with the current codebase, ensuring that any discrepancies are reported for CI purposes.",+ "summary": "Ensures that the committed graph.json accurately reflects the current state of the codebase, identifying any discrepancies.","crux": {"code": " const committed = readGraph(wiringPath(outDir));\n if (!committed) {\n result.missing = true;\n return result;\n }\n\n // Freshly extract Tier-1 nodes from the code on disk (same file set as build).\n const current = new Map<string, string>(); // id → body_hash\n for (const file of listSourceFiles(root, outDir)) {\n const lang = languageOf(file)!;\n let source: string;\n try {","span": "L57-L68"@@ -2830,9 +2881,9 @@"signature": "function formatGraphCheckReport(r: GraphCheckResult): string","exported": true,"origin": "ast",- "body_hash": "aadc77c803de8c04dac0f5c9bbb53d15c91944adfbc5a35dcebfc9983d105fd0",+ "body_hash": "a2489371664b6c2729925dffd9852c85aecbd21a019f72549435ce51a4113b86","summary_state": "ready",- "summary": "This function generates a human-readable report summarizing the results of the graph check, indicating any discrepancies found.",+ "summary": "Generates a human-readable report summarizing the results of the graph check, indicating any issues found.","crux": {"code": " const lines: string[] = [\"graph check: STALE\", \"\"];\n const structural = r.added.length + r.removed.length + r.changed.length;\n if (r.changed.length) {\n lines.push(`changed (${r.changed.length}):`);\n for (const id of r.changed) lines.push(` ~ ${id}`);\n }\n if (r.added.length) {\n lines.push(`added (${r.added.length}):`);\n for (const id of r.added) lines.push(` + ${id}`);\n }\n if (r.removed.length) {\n lines.push(`removed (${r.removed.length}):`);","span": "L113-L124"@@ -2871,16 +2922,16 @@"name": "enrich.ts","kind": "file","path": "src/graph/enrich.ts",- "span": "L1-L187",+ "span": "L1-L213","signature": null,"exported": true,"origin": "ast",- "body_hash": "7b8238702835246bfc446ae017157e627c7609fde83b090619de71d013edf8e6",+ "body_hash": "c15a0aef99e54d4c24ac748a9b33373512f1511b1f5bcd830f9d2e407ff47917","summary_state": "ready","summary": "This file implements a mechanism to enrich graph nodes with summaries and cruxes based on their state and prior computations.","crux": {"code": " // Which nodes actually need an LLM call this run (after cache carry-over).\n const dirty: NodeV1[] = [];\n\n for (const node of nodes) {\n const was = prior.get(node.id);\n if (was?.summary_state === \"ready\" && was.body_hash === node.body_hash) {\n node.summary = was.summary;\n node.crux = was.crux;\n node.summary_state = \"ready\";\n stats.cached++;\n continue;\n }",- "span": "L51-L62"+ "span": "L56-L67"}},{@@ -2888,7 +2939,7 @@"name": "buildCrux","kind": "function","path": "src/graph/enrich.ts",- "span": "L162-L177",+ "span": "L188-L203","signature": "function buildCrux(r: NodeCrux, node: NodeV1, source: string, lineCount: number): Crux | null","exported": false,"origin": "ast",@@ -2905,7 +2956,7 @@"name": "collectFileCrux","kind": "function","path": "src/graph/enrich.ts",- "span": "L135-L155",+ "span": "L161-L181","signature": "async function collectFileCrux( summarizer: CruxSummarizer, path: string, source: string, refs: NodeRef[], ): Promise<{ results: Map<string, NodeCrux>; error?: string }>","exported": false,"origin": "ast",@@ -2922,16 +2973,16 @@"name": "enrichGraph","kind": "function","path": "src/graph/enrich.ts",- "span": "L43-L128",+ "span": "L48-L136","signature": "async function enrichGraph( nodes: NodeV1[], prior: Map<string, NodeV1>, sources: Map<string, string>, opts: EnrichOptions = {}, ): Promise<EnrichStats>","exported": true,"origin": "ast",- "body_hash": "67bf09b50cd3f75e72e7c8ce7b7f20847e380dcc731531d00d17e8866945336b",+ "body_hash": "f740a8a6957661bd4bedddbe0cbb0c5541e30a3b303cbd01830cf761644e0801","summary_state": "ready",- "summary": "Enriches a set of graph nodes by determining which need new summaries and processing them accordingly.",+ "summary": "This function processes graph nodes to update their summaries and cruxes based on their state and prior data, potentially invoking an LLM for new computations.","crux": {"code": " // Which nodes actually need an LLM call this run (after cache carry-over).\n const dirty: NodeV1[] = [];\n\n for (const node of nodes) {\n const was = prior.get(node.id);\n if (was?.summary_state === \"ready\" && was.body_hash === node.body_hash) {\n node.summary = was.summary;\n node.crux = was.crux;\n node.summary_state = \"ready\";\n stats.cached++;\n continue;\n }",- "span": "L51-L62"+ "span": "L56-L67"}},{@@ -2939,13 +2990,13 @@"name": "EnrichOptions","kind": "interface","path": "src/graph/enrich.ts",- "span": "L28-L33",+ "span": "L31-L38","signature": "interface EnrichOptions","exported": true,"origin": "ast",- "body_hash": "5b1a8379d9c8f934883d81912390338ba9917af35f05b8eb378f405e114adddb",+ "body_hash": "a721d24d1e8ad1777bd74f54cdc1f4edcc55d3576b065557a0b10b3fe4b4a183","summary_state": "ready",- "summary": "Defines options for enriching graph nodes, including the ability to compute new summaries and report progress.",+ "summary": "This interface defines options for enriching graph nodes, including whether to compute new summaries and the level of concurrency for processing.","crux": null},{@@ -2953,7 +3004,7 @@"name": "EnrichStats","kind": "interface","path": "src/graph/enrich.ts",- "span": "L35-L41",+ "span": "L40-L46","signature": "interface EnrichStats","exported": true,"origin": "ast",@@ -2962,12 +3013,26 @@"summary": "Tracks the statistics of the enrichment process, including counts of cached, computed, stale, and pending nodes.","crux": null},+ {+ "id": "src/graph/enrich.ts#mapWithConcurrency",+ "name": "mapWithConcurrency",+ "kind": "function",+ "path": "src/graph/enrich.ts",+ "span": "L139-L154",+ "signature": "async function mapWithConcurrency<T, R>( items: T[], limit: number, fn: (item: T, index: number) => Promise<R>, ): Promise<R[]>",+ "exported": false,+ "origin": "ast",+ "body_hash": "a4c9438ba7cb397b91c5ab695f081e20db5678db9eea0be35a086fda1d9714e5",+ "summary_state": "ready",+ "summary": "This function executes a provided asynchronous function over a list of items with a specified limit on concurrent executions, preserving the order of results.",+ "crux": null+ },{"id": "src/graph/enrich.ts#spanLines","name": "spanLines","kind": "function","path": "src/graph/enrich.ts",- "span": "L180-L186",+ "span": "L206-L212","signature": "function spanLines(span: string, fileLines: number): [number, number]","exported": false,"origin": "ast",@@ -3914,6 +3979,40 @@"summary": "Defines the configuration options required to start the visualization server.","crux": null},+ {+ "id": "test/ask.test.ts",+ "name": "ask.test.ts",+ "kind": "file",+ "path": "test/ask.test.ts",+ "span": "L1-L55",+ "signature": null,+ "exported": true,+ "origin": "ast",+ "body_hash": "b2d9beeea01fd6faab6225ea3b3a735d5dd808e8358ffe37bb82a2a5f5da3dce",+ "summary_state": "ready",+ "summary": "This file contains tests for the `graft ask` functionality, ensuring that the source option correctly inlines code from disk when requested.",+ "crux": {+ "code": "test(\"ask without source returns pointers but no inlined code\", async () => {\n const dir = makeFixture();\n try {\n await buildGraph(dir); // $0, structure-only — cards + wiring.json\n const r = ask(dir, \"addNumbers\");\n const hit = r.hits.find((h) => h.title.startsWith(\"addNumbers\"));\n assert.ok(hit, \"should locate the addNumbers symbol\");\n assert.match(hit.pointer, /^math\\.ts:L\\d+-L\\d+$/);\n assert.equal(hit.code, undefined, \"no source inlined without the option\");\n } finally {\n rmSync(dir, { recursive: true, force: true });\n }",+ "span": "L26-L37"+ }+ },+ {+ "id": "test/ask.test.ts#makeFixture",+ "name": "makeFixture",+ "kind": "function",+ "path": "test/ask.test.ts",+ "span": "L15-L24",+ "signature": "function makeFixture(): string",+ "exported": false,+ "origin": "ast",+ "body_hash": "2782fc6b3f2efa27b0c0195482a4b138e1ec02bd16da279313966e96a6d807e8",+ "summary_state": "ready",+ "summary": "Creates a temporary directory with a sample TypeScript file for testing purposes.",+ "crux": {+ "code": " const dir = mkdtempSync(join(tmpdir(), \"graft-ask-\"));\n writeFileSync(\n join(dir, \"math.ts\"),\n `export function addNumbers(a: number, b: number): number {\\n` +\n ` return a + b;\\n` +\n `}\\n`,\n );\n return dir;",+ "span": "L16-L23"+ }+ },{"id": "test/context.test.ts","name": "context.test.ts",@@ -6108,6 +6207,12 @@"relation": "contains","confidence": "extracted"},+ {+ "source": "src/ask/ask.ts",+ "target": "src/ask/ask.ts#inlineSource",+ "relation": "contains",+ "confidence": "extracted"+ },{"source": "src/ask/ask.ts","target": "src/ask/ask.ts#lexical",@@ -6120,12 +6225,24 @@"relation": "contains","confidence": "extracted"},+ {+ "source": "src/ask/ask.ts",+ "target": "src/ask/ask.ts#parseSpan",+ "relation": "contains",+ "confidence": "extracted"+ },{"source": "src/ask/ask.ts","target": "src/ask/ask.ts#score","relation": "contains","confidence": "extracted"},+ {+ "source": "src/ask/ask.ts",+ "target": "src/ask/ask.ts#sliceSpan",+ "relation": "contains",+ "confidence": "extracted"+ },{"source": "src/ask/ask.ts","target": "src/ask/ask.ts#structural",@@ -6174,6 +6291,12 @@"relation": "imports","confidence": "extracted"},+ {+ "source": "src/ask/ask.ts#ask",+ "target": "src/ask/ask.ts#inlineSource",+ "relation": "calls",+ "confidence": "extracted"+ },{"source": "src/ask/ask.ts#ask","target": "src/ask/ask.ts#lexical",@@ -6198,6 +6321,18 @@"relation": "calls","confidence": "inferred"},+ {+ "source": "src/ask/ask.ts#inlineSource",+ "target": "src/ask/ask.ts#parseSpan",+ "relation": "calls",+ "confidence": "extracted"+ },+ {+ "source": "src/ask/ask.ts#inlineSource",+ "target": "src/ask/ask.ts#sliceSpan",+ "relation": "calls",+ "confidence": "extracted"+ },{"source": "src/ask/ask.ts#lexical","target": "src/ask/ask.ts#counts",@@ -6240,6 +6375,12 @@"relation": "calls","confidence": "extracted"},+ {+ "source": "src/cli.ts",+ "target": "src/ai/providers.ts#resolveConfig",+ "relation": "calls",+ "confidence": "inferred"+ },{"source": "src/cli.ts","target": "src/ask/ask.ts#formatAsk",@@ -6342,6 +6483,12 @@"relation": "imports","confidence": "extracted"},+ {+ "source": "src/cli.ts",+ "target": "src/ai/providers.ts",+ "relation": "imports",+ "confidence": "extracted"+ },{"source": "src/cli.ts","target": "src/context/check.ts",@@ -7626,6 +7773,12 @@"relation": "contains","confidence": "extracted"},+ {+ "source": "src/graph/enrich.ts",+ "target": "src/graph/enrich.ts#mapWithConcurrency",+ "relation": "contains",+ "confidence": "extracted"+ },{"source": "src/graph/enrich.ts","target": "src/graph/enrich.ts#spanLines",@@ -7668,6 +7821,12 @@"relation": "calls","confidence": "extracted"},+ {+ "source": "src/graph/enrich.ts#enrichGraph",+ "target": "src/graph/enrich.ts#mapWithConcurrency",+ "relation": "calls",+ "confidence": "extracted"+ },{"source": "src/graph/enrich.ts#enrichGraph","target": "src/graph/enrich.ts#spanLines",@@ -8244,6 +8403,78 @@"relation": "calls","confidence": "extracted"},+ {+ "source": "test/ask.test.ts",+ "target": "src/ask/ask.ts#ask",+ "relation": "calls",+ "confidence": "inferred"+ },+ {+ "source": "test/ask.test.ts",+ "target": "src/ask/ask.ts#formatAsk",+ "relation": "calls",+ "confidence": "inferred"+ },+ {+ "source": "test/ask.test.ts",+ "target": "src/graph/build.ts#buildGraph",+ "relation": "calls",+ "confidence": "inferred"+ },+ {+ "source": "test/ask.test.ts",+ "target": "test/ask.test.ts#makeFixture",+ "relation": "calls",+ "confidence": "extracted"+ },+ {+ "source": "test/ask.test.ts",+ "target": "test/ask.test.ts#makeFixture",+ "relation": "contains",+ "confidence": "extracted"+ },+ {+ "source": "test/ask.test.ts",+ "target": "node:assert/strict",+ "relation": "imports",+ "confidence": "extracted"+ },+ {+ "source": "test/ask.test.ts",+ "target": "node:fs",+ "relation": "imports",+ "confidence": "extracted"+ },+ {+ "source": "test/ask.test.ts",+ "target": "node:os",+ "relation": "imports",+ "confidence": "extracted"+ },+ {+ "source": "test/ask.test.ts",+ "target": "node:path",+ "relation": "imports",+ "confidence": "extracted"+ },+ {+ "source": "test/ask.test.ts",+ "target": "node:test",+ "relation": "imports",+ "confidence": "extracted"+ },+ {+ "source": "test/ask.test.ts",+ "target": "src/ask/ask.ts",+ "relation": "imports",+ "confidence": "extracted"+ },+ {+ "source": "test/ask.test.ts",+ "target": "src/graph/build.ts",+ "relation": "imports",+ "confidence": "extracted"+ },{"source": "test/context.test.ts","target": "src/context/build.ts#buildContext",diff --git a/graft/INDEX.md b/graft/INDEX.mdindex e56b0883..4f02a79a 100644--- a/graft/INDEX.md+++ b/graft/INDEX.md@@ -6,63 +6,20 @@ filename here, or run `graft ask "<task>"`. Each node carries prose plus exact## Concepts-- [ai-model-evaluation](ai-model-evaluation.md) — AI Model Evaluation · bench/judge.ts-- [benchmarking-framework](benchmarking-framework.md) — Benchmarking Framework · bench/agent.ts, bench/judge.ts, bench/report.ts, bench/run.ts, bench/selfcheck.ts, bench/tasks.ts+- [ai-model-integration](ai-model-integration.md) — AI Model Integration · bench/llm.ts+- [benchmarking-framework](benchmarking-framework.md) — Benchmarking Framework · bench/agent.ts, bench/judge.ts, bench/llm.ts, bench/report.ts, bench/run.ts, bench/selfcheck.ts, bench/tasks.ts- [benchmarking-results-reporting](benchmarking-results-reporting.md) — Benchmarking Results Reporting · bench/report.ts-- [caching-mechanism](caching-mechanism.md) — Caching Mechanism · bench/agent.ts, bench/report.ts, src/context/build.ts, src/graph/enrich.ts+- [caching-mechanism](caching-mechanism.md) — Caching Mechanism · bench/agent.ts, bench/report.ts, src/context/build.ts- [code-summarization-and-synthesis](code-summarization-and-synthesis.md) — Code Summarization and Synthesis · src/ai/crux.ts, src/ai/summarize.ts, src/ai/synthesize.ts- [configuration-management](configuration-management.md) — Configuration Management · src/ai/providers.ts-- [context-graph-management](context-graph-management.md) — Context Graph Management · src/context/build.ts, src/context/check.ts, src/context/node-file.ts, src/graph/build.ts, src/graph/check.ts, src/graph/enrich.ts, src/graph/extract.ts, src/graph/resolve.ts, src/graph/types.ts, src/graph/write.ts-- [error-handling-and-robustness](error-handling-and-robustness.md) — Error Handling and Robustness · bench/run.ts, bench/selfcheck.ts, src/engine.ts-- [graph-visualization](graph-visualization.md) — Graph Visualization · viewer/data.ts, viewer/detail.ts, viewer/graph.ts, viewer/main.ts, viewer/tree.ts-- [markdown-context-graph](markdown-context-graph.md) — Markdown Context Graph · src/graph/write.ts, src/index.ts-- [openrouter-integration](openrouter-integration.md) — OpenRouter Integration · bench/llm.ts+- [error-handling-and-reporting](error-handling-and-reporting.md) — Error Handling and Reporting · bench/run.ts, src/graph/build.ts, src/graph/check.ts+- [graph-construction](graph-construction.md) — Graph Construction · src/context/build.ts, src/context/check.ts, src/graph/build.ts, src/graph/check.ts+- [graph-management](graph-management.md) — Graph Management · src/graph/write.ts- [self-check-mechanism](self-check-mechanism.md) — Self-Check Mechanism · bench/selfcheck.ts- [task-management](task-management.md) — Task Management · bench/tasks.ts+- [visualization-layer](visualization-layer.md) — Visualization Layer · viewer/data.ts, viewer/detail.ts, viewer/graph.ts, viewer/main.ts, viewer/tree.ts## Files-Per-file wiring cards mirror the source tree. `grep` a symbol or `find` a-filename to land on its card.--- [bench/agent.md](bench/agent.md) — 9 symbols-- [bench/judge.md](bench/judge.md) — 4 symbols-- [bench/llm.md](bench/llm.md) — 1 symbol-- [bench/report.md](bench/report.md) — 8 symbols-- [bench/run.md](bench/run.md) — 6 symbols-- [bench/selfcheck.md](bench/selfcheck.md) — 2 symbols-- [bench/tasks.md](bench/tasks.md) — 3 symbols-- [scripts/build-viewer.md](scripts/build-viewer.md) — 0 symbols-- [src/ai/crux.md](src/ai/crux.md) — 11 symbols-- [src/ai/providers.md](src/ai/providers.md) — 3 symbols-- [src/ai/summarize.md](src/ai/summarize.md) — 5 symbols-- [src/ai/synthesize.md](src/ai/synthesize.md) — 9 symbols-- [src/ask/ask.md](src/ask/ask.md) — 14 symbols-- [src/cli.md](src/cli.md) — 2 symbols-- [src/context/build.md](src/context/build.md) — 16 symbols-- [src/context/check.md](src/context/check.md) — 5 symbols-- [src/context/node-file.md](src/context/node-file.md) — 18 symbols-- [src/engine.md](src/engine.md) — 15 symbols-- [src/graph/build.md](src/graph/build.md) — 4 symbols-- [src/graph/cards.md](src/graph/cards.md) — 15 symbols-- [src/graph/check.md](src/graph/check.md) — 4 symbols-- [src/graph/enrich.md](src/graph/enrich.md) — 6 symbols-- [src/graph/extract.md](src/graph/extract.md) — 15 symbols-- [src/graph/resolve.md](src/graph/resolve.md) — 5 symbols-- [src/graph/types.md](src/graph/types.md) — 8 symbols-- [src/graph/write.md](src/graph/write.md) — 4 symbols-- [src/index.md](src/index.md) — 0 symbols-- [src/ingest/fs.md](src/ingest/fs.md) — 1 symbol-- [src/util/id.md](src/util/id.md) — 3 symbols-- [src/viz/assemble.md](src/viz/assemble.md) — 6 symbols-- [src/viz/serve.md](src/viz/serve.md) — 7 symbols-- [test/context.test.md](test/context.test.md) — 2 symbols-- [test/covers.test.md](test/covers.test.md) — 1 symbol-- [test/helpers.md](test/helpers.md) — 6 symbols-- [test/viz-assemble.test.md](test/viz-assemble.test.md) — 1 symbol-- [test/viz-serve.test.md](test/viz-serve.test.md) — 1 symbol-- [viewer/data.md](viewer/data.md) — 12 symbols-- [viewer/detail.md](viewer/detail.md) — 4 symbols-- [viewer/graph.md](viewer/graph.md) — 23 symbols-- [viewer/main.md](viewer/main.md) — 14 symbols-- [viewer/tree.md](viewer/tree.md) — 5 symbols+42 per-file wiring cards mirror the source tree under `graft/` (40 carry extracted symbols). They are deliberately not enumerated here —+`grep` a symbol or `find`/`ls` a filename under `graft/` to land on the card for that file.diff --git a/graft/ai-model-evaluation.md b/graft/ai-model-evaluation.mddeleted file mode 100644index 3d6d5f18..00000000--- a/graft/ai-model-evaluation.md+++ /dev/null@@ -1,43 +0,0 @@-----name: AI Model Evaluation-slug: ai-model-evaluation-type: system-sources:- - path: bench/judge.ts- hash: 94c222341b066e4f3134b3d9d3f30f31b9ffe7b92967086b07c58f297d349936-sources_digest: bfba2049dadf6f189e964206041bfbb54d9515eabe1bf3cc28ea06450fa65de7-links:- - to: benchmarking-framework- relation: part_of- description: >-- It is a critical part of the benchmarking framework that assesses the- correctness of AI outputs.-generator:- version: 1-covers:- - symbol: Verdict- kind: interface- at: 'bench/judge.ts:L18-L24'- - symbol: JudgeInput- kind: interface- at: 'bench/judge.ts:L26-L32'- - symbol: extractJson- kind: function- at: 'bench/judge.ts:L35-L49'- - symbol: judge- kind: function- at: 'bench/judge.ts:L51-L87'-----<!-- context:generated:start -->-## Summary--This component encompasses the evaluation of AI-generated answers against reference answers, utilizing a two-layer scoring mechanism to ensure robust correctness assessments. It integrates with the OpenRouter service for model interactions.--## Related--- part of [[benchmarking-framework]] — It is a critical part of the benchmarking framework that assesses the correctness of AI outputs.-<!-- context:generated:end -->--## Notes--_Anything written below the generated block is preserved when the graph is regenerated._diff --git a/graft/ai-model-integration.md b/graft/ai-model-integration.mdnew file mode 100644index 00000000..28eac34d--- /dev/null+++ b/graft/ai-model-integration.md@@ -0,0 +1,32 @@+---+name: AI Model Integration+slug: ai-model-integration+type: system+sources:+ - path: bench/llm.ts+ hash: 6c0d2a02ac6aa86de94f779355020700a4d9016e2f4b431bf75560e1d3c51229+sources_digest: 1bdc59307386b5187ea92242900b2c3b286de3f9f45a08a7dfcf1c2d11801b27+links:+ - to: benchmarking-framework+ relation: part_of+ description: Forms a core part of the benchmarking framework.+generator:+ version: 1+covers:+ - symbol: makeClient+ kind: function+ at: 'bench/llm.ts:L14-L18'+---+<!-- context:generated:start -->+## Summary++This component manages the integration of AI models, specifically through the OpenRouter service, allowing for flexible model configurations and interactions. It provides the necessary client setup for benchmarking tasks.++## Related++- part of [[benchmarking-framework]] — Forms a core part of the benchmarking framework.+<!-- context:generated:end -->++## Notes++_Anything written below the generated block is preserved when the graph is regenerated._diff --git a/graft/bench/judge.md b/graft/bench/judge.mdindex d2a8d4a4..a97e1b89 100644--- a/graft/bench/judge.md+++ b/graft/bench/judge.md@@ -1,4 +1,4 @@-# bench/judge.ts · [[ai-model-evaluation]] [[benchmarking-framework]]+# bench/judge.ts · [[benchmarking-framework]]This file implements a correctness scoring system that evaluates AI-generated answers against a reference answer using keyword checks and an LLM judge.diff --git a/graft/bench/llm.md b/graft/bench/llm.mdindex 01798b8f..c6c3c398 100644--- a/graft/bench/llm.md+++ b/graft/bench/llm.md@@ -1,4 +1,4 @@-# bench/llm.ts · [[openrouter-integration]]+# bench/llm.ts · [[ai-model-integration]] [[benchmarking-framework]]This file configures and provides access to the OpenRouter API for benchmarking LLMs without needing separate API keys.diff --git a/graft/bench/run.md b/graft/bench/run.mdindex 1d339914..5e5af8e7 100644--- a/graft/bench/run.md+++ b/graft/bench/run.md@@ -1,4 +1,4 @@-# bench/run.ts · [[benchmarking-framework]] [[error-handling-and-robustness]]+# bench/run.ts · [[benchmarking-framework]] [[error-handling-and-reporting]]This file orchestrates the benchmarking process for various corpora and tasks, managing the execution and reporting of results.diff --git a/graft/bench/selfcheck.md b/graft/bench/selfcheck.mdindex 94e33b15..40e126a0 100644--- a/graft/bench/selfcheck.md+++ b/graft/bench/selfcheck.md@@ -1,4 +1,4 @@-# bench/selfcheck.ts · [[benchmarking-framework]] [[error-handling-and-robustness]] [[self-check-mechanism]]+# bench/selfcheck.ts · [[benchmarking-framework]] [[self-check-mechanism]]This file performs an offline verification of the harness plumbing to ensure control flow works correctly without needing an API key.diff --git a/graft/benchmarking-framework.md b/graft/benchmarking-framework.mdindex 82b0b0e3..d9595852 100644--- a/graft/benchmarking-framework.md+++ b/graft/benchmarking-framework.md@@ -7,6 +7,8 @@ sources:hash: e10d64f913c9517cef84cce58ea042d71bed3e94182c791245170eca54060e31- path: bench/judge.tshash: 94c222341b066e4f3134b3d9d3f30f31b9ffe7b92967086b07c58f297d349936+ - path: bench/llm.ts+ hash: 6c0d2a02ac6aa86de94f779355020700a4d9016e2f4b431bf75560e1d3c51229- path: bench/report.tshash: 775be8c40a8e4172521bba8f6a1f026fa23c4d24b9b5225da3ed5b745077a5b0- path: bench/run.ts@@ -15,18 +17,17 @@ sources:hash: 0eaf577938e20fa27d9cd0157bc8843fdc37165d85696789334b8605138f4bb4- path: bench/tasks.tshash: d21168797f40d193a914aca0c438409d29d300441bc0a6a518c93869240b3b69-sources_digest: cc0c5db726f28fff7640e4c1d4705d7cd4eb54660db1b399622bd8f580ffe58d+sources_digest: afaac16d744b84811efe1b826c2bab23737665e1e62fe39b1267f20f5451b4d0links:+ - to: ai-model-integration+ relation: uses+ description: Utilizes the OpenRouter service for model interactions.- to: benchmarking-results-reportingrelation: produces- description: >-- It generates detailed reports summarizing the performance metrics of the- evaluated models.- - to: openrouter-integration+ description: Generates reports summarizing benchmarking results.+ - to: task-managementrelation: depends_on- description: >-- The benchmarking framework relies on the OpenRouter service for model- interactions.+ description: Relies on defined tasks and corpora for benchmarking.generator:version: 1covers:@@ -69,6 +70,9 @@ covers:- symbol: judgekind: functionat: 'bench/judge.ts:L51-L87'+ - symbol: makeClient+ kind: function+ at: 'bench/llm.ts:L14-L18'- symbol: Rowkind: interfaceat: 'bench/report.ts:L6-L26'@@ -130,12 +134,13 @@ covers:<!-- context:generated:start -->## Summary-This component orchestrates the benchmarking process for evaluating AI models, including agents and judges, through various tasks and configurations. It integrates multiple files to manage agent execution, correctness scoring, and result reporting, ensuring a comprehensive evaluation of model performance.+This component orchestrates the benchmarking process, evaluating AI models through agents and judges, and reporting results. It integrates various modules for running benchmarks, scoring correctness, and managing configurations.## Related-- produces [[benchmarking-results-reporting]] — It generates detailed reports summarizing the performance metrics of the evaluated models.-- depends on [[openrouter-integration]] — The benchmarking framework relies on the OpenRouter service for model interactions.+- uses [[ai-model-integration]] — Utilizes the OpenRouter service for model interactions.+- produces [[benchmarking-results-reporting]] — Generates reports summarizing benchmarking results.+- depends on [[task-management]] — Relies on defined tasks and corpora for benchmarking.<!-- context:generated:end -->## Notesdiff --git a/graft/benchmarking-results-reporting.md b/graft/benchmarking-results-reporting.mdindex 901248ee..93879687 100644--- a/graft/benchmarking-results-reporting.md+++ b/graft/benchmarking-results-reporting.md@@ -9,9 +9,7 @@ sources_digest: f7b46f3036503f43413cb48d25fa6ce54585514fb19e9b4e923c0c5628ce8aedlinks:- to: benchmarking-frameworkrelation: part_of- description: >-- It is responsible for reporting the outcomes of the benchmarking- framework's evaluations.+ description: Integrates with the benchmarking framework to report results.generator:version: 1covers:@@ -43,11 +41,11 @@ covers:<!-- context:generated:start -->## Summary-This component aggregates and formats the results of benchmarking trials, providing insights into model performance across different configurations. It emphasizes clarity in reporting and includes cost calculations for agent runs.+This component aggregates and formats the results of benchmarking trials, providing insights into performance metrics and cost evaluations. It emphasizes clarity in reporting and economic implications.## Related-- part of [[benchmarking-framework]] — It is responsible for reporting the outcomes of the benchmarking framework's evaluations.+- part of [[benchmarking-framework]] — Integrates with the benchmarking framework to report results.<!-- context:generated:end -->## Notesdiff --git a/graft/caching-mechanism.md b/graft/caching-mechanism.mdindex 929fd8ff..7173a16e 100644--- a/graft/caching-mechanism.md+++ b/graft/caching-mechanism.md@@ -9,13 +9,11 @@ sources:hash: 775be8c40a8e4172521bba8f6a1f026fa23c4d24b9b5225da3ed5b745077a5b0- path: src/context/build.tshash: 8c614e5dc6b1ef2d6949016ce7480099f95f021ea6b0882f2919397f97a68ce7- - path: src/graph/enrich.ts- hash: 7b8238702835246bfc446ae017157e627c7609fde83b090619de71d013edf8e6-sources_digest: bb866199bd2f821c5a9b3a9d3fbeff70c9b09d3f6f3b52200219b1a0b89e0fdd+sources_digest: 0393dee6bf242715500eeac001ca94cd9c7ff05d644d8e36d58e9c7fd2e0eab9links:- to: benchmarking-frameworkrelation: validates- description: It ensures that the benchmarking results are accurate and efficient.+ description: Ensures that caching is effectively utilized in benchmarking.generator:version: 1covers:@@ -118,33 +116,15 @@ covers:- symbol: mapWithConcurrencykind: functionat: 'src/context/build.ts:L334-L349'- - symbol: EnrichOptions- kind: interface- at: 'src/graph/enrich.ts:L28-L33'- - symbol: EnrichStats- kind: interface- at: 'src/graph/enrich.ts:L35-L41'- - symbol: enrichGraph- kind: function- at: 'src/graph/enrich.ts:L43-L128'- - symbol: collectFileCrux- kind: function- at: 'src/graph/enrich.ts:L135-L155'- - symbol: buildCrux- kind: function- at: 'src/graph/enrich.ts:L162-L177'- - symbol: spanLines- kind: function- at: 'src/graph/enrich.ts:L180-L186'---<!-- context:generated:start -->## Summary-This concept involves the use of caching to optimize performance and reduce costs associated with repeated prompts in the benchmarking process. It ensures that redundant processing is avoided and that results are efficiently managed.+This concept involves the use of caching to optimize performance and reduce costs associated with repeated prompts in the benchmarking process.## Related-- validates [[benchmarking-framework]] — It ensures that the benchmarking results are accurate and efficient.+- validates [[benchmarking-framework]] — Ensures that caching is effectively utilized in benchmarking.<!-- context:generated:end -->## Notesdiff --git a/graft/code-summarization-and-synthesis.md b/graft/code-summarization-and-synthesis.mdindex 003eaaf5..d517ad0d 100644--- a/graft/code-summarization-and-synthesis.md+++ b/graft/code-summarization-and-synthesis.md@@ -11,11 +11,9 @@ sources:hash: 982ab91da10ae51fdba64466cbb614db14a51f2e100bb12a72178961d8dd97d7sources_digest: 1916d34902c4bd664703e6c5da273beb26c2be5f55e971b3cc3f590f65cde3c7links:- - to: context-graph-management+ - to: graph-constructionrelation: produces- description: >-- It generates structured nodes that represent the architecture of the- codebase.+ description: Generates structured nodes for the architecture graph.generator:version: 1covers:@@ -98,11 +96,11 @@ covers:<!-- context:generated:start -->## Summary-This component focuses on summarizing code definitions and synthesizing a structured representation of the codebase architecture. It utilizes AI models to generate concise summaries and structured nodes for the context graph.+This component focuses on summarizing code definitions and synthesizing a structured architecture graph from file summaries, enhancing the understanding of the codebase's architecture.## Related-- produces [[context-graph-management]] — It generates structured nodes that represent the architecture of the codebase.+- produces [[graph-construction]] — Generates structured nodes for the architecture graph.<!-- context:generated:end -->## Notesdiff --git a/graft/configuration-management.md b/graft/configuration-management.mdindex 857fd0a6..734a5b35 100644--- a/graft/configuration-management.md+++ b/graft/configuration-management.md@@ -7,9 +7,9 @@ sources:hash: c0d1294d6fa49f6d06ff9bb137b34ea897f94a67810a839cd5705a1fa5995483sources_digest: a131fc0c197424e0b9a6a1da0c7e97f8aaa37eb06f6720480e7959923c918071links:- - to: ai-model-evaluation+ - to: ai-model-integrationrelation: configures- description: It configures the settings for the AI evaluation process.+ description: Allows users to specify configurations for AI model interactions.generator:version: 1covers:@@ -26,11 +26,11 @@ covers:<!-- context:generated:start -->## Summary-This concept encompasses the management of user-facing configurations for the AI engine, allowing customization of settings such as context directories and API credentials. It ensures that all necessary parameters are set for the engine to function correctly.+This concept encompasses the management of user-facing configurations for the AI engine, allowing for customization of settings and components without code changes.## Related-- configures [[ai-model-evaluation]] — It configures the settings for the AI evaluation process.+- configures [[ai-model-integration]] — Allows users to specify configurations for AI model interactions.<!-- context:generated:end -->## Notesdiff --git a/graft/context-graph-management.md b/graft/context-graph-management.mddeleted file mode 100644index 9c0e98d1..00000000--- a/graft/context-graph-management.md+++ /dev/null@@ -1,308 +0,0 @@-----name: Context Graph Management-slug: context-graph-management-type: system-sources:- - path: src/context/build.ts- hash: 8c614e5dc6b1ef2d6949016ce7480099f95f021ea6b0882f2919397f97a68ce7- - path: src/context/check.ts- hash: 2444e1f4dfd78208a9b54942364ee1811d064459857c6d6cee178426e278d481- - path: src/context/node-file.ts- hash: 9e958d74597b4d6d31fa5391882ddab8faab4076d7d33f93de861ab6c2e0b93a- - path: src/graph/build.ts- hash: 8b05c94896ca63d9c66bf5b3340db53cb8600d536a36880a3012599edf1b3a44- - path: src/graph/check.ts- hash: f0b73053e31d03ec1280d465d614c97044541691675f2b3d09e10bcab5078b58- - path: src/graph/enrich.ts- hash: 7b8238702835246bfc446ae017157e627c7609fde83b090619de71d013edf8e6- - path: src/graph/extract.ts- hash: 58cd002d5ee7dfb750cb85293a795148ffbec31e68e2a9b693e0794543a7f727- - path: src/graph/resolve.ts- hash: dad41f73d773c45f5237b85e10a36ae45331cd5959df578816ee8ab47622cffe- - path: src/graph/types.ts- hash: 757b84c059d13cda49e0f29518b31a5473f0d6e243b2ab1f374a7f7ff02492e4- - path: src/graph/write.ts- hash: 55dd6ea840135ade4db7f49042234bee0db07a9c8c959ab57767deb8bebc6345-sources_digest: 55e6a39238b64c950511c3f7ca87ed1629d82b42231ba60ef5e8e90098ec441c-links:- - to: code-summarization-and-synthesis- relation: depends_on- description: >-- It relies on the summarization and synthesis components to generate- structured nodes.- - to: graph-visualization- relation: produces- description: It outputs a structured graph representation for visualization.-generator:- version: 1-covers:- - symbol: BuildProgress- kind: interface- at: 'src/context/build.ts:L47-L52'- - symbol: BuildOptions- kind: interface- at: 'src/context/build.ts:L54-L64'- - symbol: BuildResult- kind: interface- at: 'src/context/build.ts:L66-L75'- - symbol: BuildCache- kind: interface- at: 'src/context/build.ts:L78-L81'- - symbol: FileWork- kind: interface- at: 'src/context/build.ts:L83-L87'- - symbol: NodeDraft- kind: interface- at: 'src/context/build.ts:L90-L97'- - symbol: buildContext- kind: function- at: 'src/context/build.ts:L99-L266'- - symbol: batchBySize- kind: function- at: 'src/context/build.ts:L269-L285'- - symbol: batchKey- kind: function- at: 'src/context/build.ts:L288-L295'- - symbol: registerName- kind: function- at: 'src/context/build.ts:L297-L300'- - symbol: resolveSlug- kind: function- at: 'src/context/build.ts:L302-L304'- - symbol: errMsg- kind: function- at: 'src/context/build.ts:L306-L308'- - symbol: cachePath- kind: function- at: 'src/context/build.ts:L310-L312'- - symbol: loadCache- kind: function- at: 'src/context/build.ts:L314-L325'- - symbol: saveCache- kind: function- at: 'src/context/build.ts:L327-L331'- - symbol: mapWithConcurrency- kind: function- at: 'src/context/build.ts:L334-L349'- - symbol: CheckResult- kind: interface- at: 'src/context/check.ts:L22-L30'- - symbol: CheckOptions- kind: interface- at: 'src/context/check.ts:L32-L35'- - symbol: checkContext- kind: function- at: 'src/context/check.ts:L37-L107'- - symbol: formatCheckReport- kind: function- at: 'src/context/check.ts:L110-L135'- - symbol: short- kind: function- at: 'src/context/check.ts:L137-L139'- - symbol: SourceRef- kind: interface- at: 'src/context/node-file.ts:L30-L33'- - symbol: NodeLink- kind: interface- at: 'src/context/node-file.ts:L36-L40'- - symbol: ContextNode- kind: interface- at: 'src/context/node-file.ts:L43-L58'- - symbol: Manifest- kind: interface- at: 'src/context/node-file.ts:L61-L71'- - symbol: slugify- kind: function- at: 'src/context/node-file.ts:L81-L86'- - symbol: digestSources- kind: function- at: 'src/context/node-file.ts:L89-L95'- - symbol: contextDirFor- kind: function- at: 'src/context/node-file.ts:L100-L103'- - symbol: renderGenerated- kind: function- at: 'src/context/node-file.ts:L106-L118'- - symbol: defaultHuman- kind: function- at: 'src/context/node-file.ts:L121-L123'- - symbol: renderNodeFile- kind: function- at: 'src/context/node-file.ts:L126-L141'- - symbol: preserveHuman- kind: function- at: 'src/context/node-file.ts:L148-L152'- - symbol: writeNode- kind: function- at: 'src/context/node-file.ts:L158-L169'- - symbol: ParsedNode- kind: interface- at: 'src/context/node-file.ts:L172-L179'- - symbol: readNodes- kind: function- at: 'src/context/node-file.ts:L182-L198'- - symbol: existingNodeSlugs- kind: function- at: 'src/context/node-file.ts:L201-L208'- - symbol: deleteNode- kind: function- at: 'src/context/node-file.ts:L211-L214'- - symbol: writeManifest- kind: function- at: 'src/context/node-file.ts:L216-L219'- - symbol: readManifest- kind: function- at: 'src/context/node-file.ts:L221-L229'- - symbol: GraphBuildOptions- kind: interface- at: 'src/graph/build.ts:L22-L33'- - symbol: GraphBuildResult- kind: interface- at: 'src/graph/build.ts:L35-L48'- - symbol: listSourceFiles- kind: function- at: 'src/graph/build.ts:L51-L53'- - symbol: buildGraph- kind: function- at: 'src/graph/build.ts:L55-L143'- - symbol: GraphCheckResult- kind: interface- at: 'src/graph/check.ts:L27-L37'- - symbol: GraphCheckOptions- kind: interface- at: 'src/graph/check.ts:L39-L41'- - symbol: checkGraph- kind: function- at: 'src/graph/check.ts:L43-L101'- - symbol: formatGraphCheckReport- kind: function- at: 'src/graph/check.ts:L104-L135'- - symbol: EnrichOptions- kind: interface- at: 'src/graph/enrich.ts:L28-L33'- - symbol: EnrichStats- kind: interface- at: 'src/graph/enrich.ts:L35-L41'- - symbol: enrichGraph- kind: function- at: 'src/graph/enrich.ts:L43-L128'- - symbol: collectFileCrux- kind: function- at: 'src/graph/enrich.ts:L135-L155'- - symbol: buildCrux- kind: function- at: 'src/graph/enrich.ts:L162-L177'- - symbol: spanLines- kind: function- at: 'src/graph/enrich.ts:L180-L186'- - symbol: Language- kind: type- at: 'src/graph/extract.ts:L16-L16'- - symbol: languageOf- kind: function- at: 'src/graph/extract.ts:L19-L25'- - symbol: RawEdge- kind: interface- at: 'src/graph/extract.ts:L31-L39'- - symbol: ExtractResult- kind: interface- at: 'src/graph/extract.ts:L41-L44'- - symbol: WalkCtx- kind: interface- at: 'src/graph/extract.ts:L76-L84'- - symbol: DefDescriptor- kind: interface- at: 'src/graph/extract.ts:L87-L92'- - symbol: extractFile- kind: function- at: 'src/graph/extract.ts:L94-L127'- - symbol: walk- kind: function- at: 'src/graph/extract.ts:L129-L181'- - symbol: describe- kind: function- at: 'src/graph/extract.ts:L184-L213'- - symbol: heritageEdges- kind: function- at: 'src/graph/extract.ts:L215-L242'- - symbol: calleeName- kind: function- at: 'src/graph/extract.ts:L244-L260'- - symbol: isImport- kind: function- at: 'src/graph/extract.ts:L262-L264'- - symbol: importSpecifier- kind: function- at: 'src/graph/extract.ts:L266-L277'- - symbol: clean- kind: function- at: 'src/graph/extract.ts:L280-L287'- - symbol: tsExported- kind: function- at: 'src/graph/extract.ts:L290-L297'- - symbol: resolveEdges- kind: function- at: 'src/graph/resolve.ts:L20-L58'- - symbol: add- kind: function- at: 'src/graph/resolve.ts:L34-L39'- - symbol: push- kind: function- at: 'src/graph/resolve.ts:L60-L64'- - symbol: resolveName- kind: function- at: 'src/graph/resolve.ts:L70-L82'- - symbol: resolveImport- kind: function- at: 'src/graph/resolve.ts:L88-L100'- - symbol: Kind- kind: type- at: 'src/graph/types.ts:L15-L22'- - symbol: Confidence- kind: type- at: 'src/graph/types.ts:L25-L25'- - symbol: SummaryState- kind: type- at: 'src/graph/types.ts:L28-L28'- - symbol: Crux- kind: interface- at: 'src/graph/types.ts:L32-L35'- - symbol: NodeV1- kind: interface- at: 'src/graph/types.ts:L37-L55'- - symbol: Relation- kind: type- at: 'src/graph/types.ts:L57-L63'- - symbol: EdgeV1- kind: interface- at: 'src/graph/types.ts:L65-L70'- - symbol: GraphV1- kind: interface- at: 'src/graph/types.ts:L72-L81'- - symbol: wiringPath- kind: function- at: 'src/graph/write.ts:L20-L22'- - symbol: readGraph- kind: function- at: 'src/graph/write.ts:L28-L34'- - symbol: writeGraph- kind: function- at: 'src/graph/write.ts:L36-L46'- - symbol: edgeOrder- kind: function- at: 'src/graph/write.ts:L48-L54'-----<!-- context:generated:start -->-## Summary--This component manages the construction and verification of a context graph from the code repository, ensuring synchronization with the source code. It includes functionalities for building, checking, and writing the graph data.--## Related--- depends on [[code-summarization-and-synthesis]] — It relies on the summarization and synthesis components to generate structured nodes.-- produces [[graph-visualization]] — It outputs a structured graph representation for visualization.-<!-- context:generated:end -->--## Notes--_Anything written below the generated block is preserved when the graph is regenerated._diff --git a/graft/error-handling-and-reporting.md b/graft/error-handling-and-reporting.mdnew file mode 100644index 00000000..886dc9d7--- /dev/null+++ b/graft/error-handling-and-reporting.md@@ -0,0 +1,75 @@+---+name: Error Handling and Reporting+slug: error-handling-and-reporting+type: concept+sources:+ - path: bench/run.ts+ hash: a0d2859628588f45ae31862f5f801d6219802449c23bbbdba9aa51b7b9febf47+ - path: src/graph/build.ts+ hash: b18f5fc18dffd77771f39722eb19963c1188fd298cbb5cfd5d71ef8dc45658c6+ - path: src/graph/check.ts+ hash: 5358023fe498fb2878e3aa9b6756272c39926dda865c6495d8f33d13c5ceb376+sources_digest: 1386bf6efb7992fa69cd12a578fcd62b16f5332693ce2d7020e4050ba354f2f7+links:+ - to: graph-construction+ relation: validates+ description: Ensures that errors in graph construction are reported effectively.+generator:+ version: 1+covers:+ - symbol: Args+ kind: interface+ at: 'bench/run.ts:L29-L35'+ - symbol: parseArgs+ kind: function+ at: 'bench/run.ts:L37-L52'+ - symbol: pool+ kind: function+ at: 'bench/run.ts:L55-L66'+ - symbol: worker+ kind: function+ at: 'bench/run.ts:L58-L63'+ - symbol: makeDocsWorkdir+ kind: function+ at: 'bench/run.ts:L69-L82'+ - symbol: main+ kind: function+ at: 'bench/run.ts:L84-L201'+ - symbol: GraphBuildOptions+ kind: interface+ at: 'src/graph/build.ts:L22-L35'+ - symbol: GraphBuildResult+ kind: interface+ at: 'src/graph/build.ts:L37-L50'+ - symbol: listSourceFiles+ kind: function+ at: 'src/graph/build.ts:L53-L55'+ - symbol: buildGraph+ kind: function+ at: 'src/graph/build.ts:L57-L146'+ - symbol: GraphCheckResult+ kind: interface+ at: 'src/graph/check.ts:L27-L37'+ - symbol: GraphCheckOptions+ kind: interface+ at: 'src/graph/check.ts:L39-L41'+ - symbol: checkGraph+ kind: function+ at: 'src/graph/check.ts:L43-L101'+ - symbol: formatGraphCheckReport+ kind: function+ at: 'src/graph/check.ts:L104-L135'+---+<!-- context:generated:start -->+## Summary++This concept focuses on the strategies employed to handle errors gracefully during benchmarking and graph construction, ensuring robust performance and user feedback.++## Related++- validates [[graph-construction]] — Ensures that errors in graph construction are reported effectively.+<!-- context:generated:end -->++## Notes++_Anything written below the generated block is preserved when the graph is regenerated._diff --git a/graft/error-handling-and-robustness.md b/graft/error-handling-and-robustness.mddeleted file mode 100644index 9dbfa6d1..00000000--- a/graft/error-handling-and-robustness.md+++ /dev/null@@ -1,102 +0,0 @@-----name: Error Handling and Robustness-slug: error-handling-and-robustness-type: concept-sources:- - path: bench/run.ts- hash: a0d2859628588f45ae31862f5f801d6219802449c23bbbdba9aa51b7b9febf47- - path: bench/selfcheck.ts- hash: 0eaf577938e20fa27d9cd0157bc8843fdc37165d85696789334b8605138f4bb4- - path: src/engine.ts- hash: 26307935c472954b6511e7352cf6c0f11ce53dd151ac2407e5fcadc0b9b7c01b-sources_digest: f316b70320a3b6166ab65b4721c724c3b21b9e78cb80e77e2e94c67e3355f8aa-links:- - to: benchmarking-framework- relation: validates- description: It ensures that the benchmarking framework can handle errors gracefully.-generator:- version: 1-covers:- - symbol: Args- kind: interface- at: 'bench/run.ts:L29-L35'- - symbol: parseArgs- kind: function- at: 'bench/run.ts:L37-L52'- - symbol: pool- kind: function- at: 'bench/run.ts:L55-L66'- - symbol: worker- kind: function- at: 'bench/run.ts:L58-L63'- - symbol: makeDocsWorkdir- kind: function- at: 'bench/run.ts:L69-L82'- - symbol: main- kind: function- at: 'bench/run.ts:L84-L201'- - symbol: makeStubClient- kind: function- at: 'bench/selfcheck.ts:L19-L48'- - symbol: main- kind: function- at: 'bench/selfcheck.ts:L50-L114'- - symbol: InitOptions- kind: interface- at: 'src/engine.ts:L26-L31'- - symbol: CheckRunOptions- kind: interface- at: 'src/engine.ts:L33-L35'- - symbol: GraphRunOptions- kind: interface- at: 'src/engine.ts:L37-L41'- - symbol: Graft- kind: class- at: 'src/engine.ts:L43-L125'- - symbol: constructor- kind: method- at: 'src/engine.ts:L46-L48'- - symbol: init- kind: method- at: 'src/engine.ts:L51-L60'- - symbol: check- kind: method- at: 'src/engine.ts:L63-L65'- - symbol: checkGraph- kind: method- at: 'src/engine.ts:L68-L70'- - symbol: graph- kind: method- at: 'src/engine.ts:L77-L83'- - symbol: ask- kind: method- at: 'src/engine.ts:L90-L92'- - symbol: requireKey- kind: method- at: 'src/engine.ts:L95-L103'- - symbol: synthesizer- kind: method- at: 'src/engine.ts:L105-L108'- - symbol: cruxSummarizer- kind: method- at: 'src/engine.ts:L111-L113'- - symbol: summarizer- kind: method- at: 'src/engine.ts:L115-L118'- - symbol: modelLabel- kind: method- at: 'src/engine.ts:L121-L124'-----<!-- context:generated:start -->-## Summary--This concept emphasizes the importance of error handling and robustness in the benchmarking framework, ensuring that failures in one part do not halt the entire process and that comprehensive testing is possible without external dependencies.--## Related--- validates [[benchmarking-framework]] — It ensures that the benchmarking framework can handle errors gracefully.-<!-- context:generated:end -->--## Notes--_Anything written below the generated block is preserved when the graph is regenerated._diff --git a/graft/graph-construction.md b/graft/graph-construction.mdnew file mode 100644index 00000000..fb41e7b5--- /dev/null+++ b/graft/graph-construction.md@@ -0,0 +1,126 @@+---+name: Graph Construction+slug: graph-construction+type: system+sources:+ - path: src/context/build.ts+ hash: 8c614e5dc6b1ef2d6949016ce7480099f95f021ea6b0882f2919397f97a68ce7+ - path: src/context/check.ts+ hash: 2444e1f4dfd78208a9b54942364ee1811d064459857c6d6cee178426e278d481+ - path: src/graph/build.ts+ hash: b18f5fc18dffd77771f39722eb19963c1188fd298cbb5cfd5d71ef8dc45658c6+ - path: src/graph/check.ts+ hash: 5358023fe498fb2878e3aa9b6756272c39926dda865c6495d8f33d13c5ceb376+sources_digest: 542278c320dfc3ba4690fe870e4222ebb3eb9fa87d9c1cd94780003d54e72141+links:+ - to: code-summarization-and-synthesis+ relation: depends_on+ description: Relies on summarization and synthesis for node creation.+ - to: graph-management+ relation: part_of+ description: Forms a core part of the graph management system.+generator:+ version: 1+covers:+ - symbol: BuildProgress+ kind: interface+ at: 'src/context/build.ts:L47-L52'+ - symbol: BuildOptions+ kind: interface+ at: 'src/context/build.ts:L54-L64'+ - symbol: BuildResult+ kind: interface+ at: 'src/context/build.ts:L66-L75'+ - symbol: BuildCache+ kind: interface+ at: 'src/context/build.ts:L78-L81'+ - symbol: FileWork+ kind: interface+ at: 'src/context/build.ts:L83-L87'+ - symbol: NodeDraft+ kind: interface+ at: 'src/context/build.ts:L90-L97'+ - symbol: buildContext+ kind: function+ at: 'src/context/build.ts:L99-L266'+ - symbol: batchBySize+ kind: function+ at: 'src/context/build.ts:L269-L285'+ - symbol: batchKey+ kind: function+ at: 'src/context/build.ts:L288-L295'+ - symbol: registerName+ kind: function+ at: 'src/context/build.ts:L297-L300'+ - symbol: resolveSlug+ kind: function+ at: 'src/context/build.ts:L302-L304'+ - symbol: errMsg+ kind: function+ at: 'src/context/build.ts:L306-L308'+ - symbol: cachePath+ kind: function+ at: 'src/context/build.ts:L310-L312'+ - symbol: loadCache+ kind: function+ at: 'src/context/build.ts:L314-L325'+ - symbol: saveCache+ kind: function+ at: 'src/context/build.ts:L327-L331'+ - symbol: mapWithConcurrency+ kind: function+ at: 'src/context/build.ts:L334-L349'+ - symbol: CheckResult+ kind: interface+ at: 'src/context/check.ts:L22-L30'+ - symbol: CheckOptions+ kind: interface+ at: 'src/context/check.ts:L32-L35'+ - symbol: checkContext+ kind: function+ at: 'src/context/check.ts:L37-L107'+ - symbol: formatCheckReport+ kind: function+ at: 'src/context/check.ts:L110-L135'+ - symbol: short+ kind: function+ at: 'src/context/check.ts:L137-L139'+ - symbol: GraphBuildOptions+ kind: interface+ at: 'src/graph/build.ts:L22-L35'+ - symbol: GraphBuildResult+ kind: interface+ at: 'src/graph/build.ts:L37-L50'+ - symbol: listSourceFiles+ kind: function+ at: 'src/graph/build.ts:L53-L55'+ - symbol: buildGraph+ kind: function+ at: 'src/graph/build.ts:L57-L146'+ - symbol: GraphCheckResult+ kind: interface+ at: 'src/graph/check.ts:L27-L37'+ - symbol: GraphCheckOptions+ kind: interface+ at: 'src/graph/check.ts:L39-L41'+ - symbol: checkGraph+ kind: function+ at: 'src/graph/check.ts:L43-L101'+ - symbol: formatGraphCheckReport+ kind: function+ at: 'src/graph/check.ts:L104-L135'+---+<!-- context:generated:start -->+## Summary++This component constructs a context graph from the code repository, managing the relationships between code elements and ensuring synchronization with the source code.++## Related++- depends on [[code-summarization-and-synthesis]] — Relies on summarization and synthesis for node creation.+- part of [[graph-management]] — Forms a core part of the graph management system.+<!-- context:generated:end -->++## Notes++_Anything written below the generated block is preserved when the graph is regenerated._diff --git a/graft/graph-management.md b/graft/graph-management.mdnew file mode 100644index 00000000..bdc9f92e--- /dev/null+++ b/graft/graph-management.md@@ -0,0 +1,41 @@+---+name: Graph Management+slug: graph-management+type: system+sources:+ - path: src/graph/write.ts+ hash: 55dd6ea840135ade4db7f49042234bee0db07a9c8c959ab57767deb8bebc6345+sources_digest: fa6cd161fd547a03ecad2649fbb2b6094b5a6a64b10dcc1bdd6244e5157d4d48+links:+ - to: graph-construction+ relation: part_of+ description: Supports the construction of the context graph.+generator:+ version: 1+covers:+ - symbol: wiringPath+ kind: function+ at: 'src/graph/write.ts:L20-L22'+ - symbol: readGraph+ kind: function+ at: 'src/graph/write.ts:L28-L34'+ - symbol: writeGraph+ kind: function+ at: 'src/graph/write.ts:L36-L46'+ - symbol: edgeOrder+ kind: function+ at: 'src/graph/write.ts:L48-L54'+---+<!-- context:generated:start -->+## Summary++This component manages the on-disk representation of the context graph, handling serialization, reading, and writing of graph data while ensuring data integrity and versioning.++## Related++- part of [[graph-construction]] — Supports the construction of the context graph.+<!-- context:generated:end -->++## Notes++_Anything written below the generated block is preserved when the graph is regenerated._diff --git a/graft/manifest.json b/graft/manifest.jsonindex 840a009a..124d7a4f 100644--- a/graft/manifest.json+++ b/graft/manifest.json@@ -1,7 +1,7 @@{"version": 1,"model": "openrouter:openai/gpt-4o-mini",- "repoDigest": "3b2a2ca79a7b49123c81fa6f4dc1bf949e12042e28aa491bca058d8ca300b913",+ "repoDigest": "f7db46e361715e61d60229d1747926ce09ebe17ebf62a16ab251ebe72f7bc843","files": [{"path": "bench/agent.ts",@@ -57,11 +57,11 @@},{"path": "src/ask/ask.ts",- "hash": "62415cb36e835e8a5e9329a770489a726028284b8f40497beba6a721ecf05e21"+ "hash": "5dad6519214e9b58feb86b46e2f498338819643ec44dc69a8f70614aad2eb986"},{"path": "src/cli.ts",- "hash": "294b01aae943b958a291aa17387fe05439ca3b5ffe1a4ed97a4a2c378dcd7947"+ "hash": "ba1d90ee4c0f7b5000fa4239461c19d54fdedcad12b8592589312f163e1357dc"},{"path": "src/context/build.ts",@@ -77,23 +77,23 @@},{"path": "src/engine.ts",- "hash": "26307935c472954b6511e7352cf6c0f11ce53dd151ac2407e5fcadc0b9b7c01b"+ "hash": "e237ef6555d8bd2001eccfc32e314ef3881cef1c79d537ee701515a357f87d16"},{"path": "src/graph/build.ts",- "hash": "8b05c94896ca63d9c66bf5b3340db53cb8600d536a36880a3012599edf1b3a44"+ "hash": "b18f5fc18dffd77771f39722eb19963c1188fd298cbb5cfd5d71ef8dc45658c6"},{"path": "src/graph/cards.ts",- "hash": "aef80e6f26a00e406385cd1faeb03d3b4e35a3cc7f1e0c50f7d94ad8a380f913"+ "hash": "c45f4bd1be271a9c5ff01c04bae2a2d4fd761eb85bd8d4a302738e6744e636b1"},{"path": "src/graph/check.ts",- "hash": "f0b73053e31d03ec1280d465d614c97044541691675f2b3d09e10bcab5078b58"+ "hash": "5358023fe498fb2878e3aa9b6756272c39926dda865c6495d8f33d13c5ceb376"},{"path": "src/graph/enrich.ts",- "hash": "7b8238702835246bfc446ae017157e627c7609fde83b090619de71d013edf8e6"+ "hash": "c15a0aef99e54d4c24ac748a9b33373512f1511b1f5bcd830f9d2e407ff47917"},{"path": "src/graph/extract.ts",@@ -131,6 +131,10 @@"path": "src/viz/serve.ts","hash": "14283762f454c01fc95cfbe9c2b41ef063fc17c4c3e5d120b5dc7f66f541fc1c"},+ {+ "path": "test/ask.test.ts",+ "hash": "b2d9beeea01fd6faab6225ea3b3a735d5dd808e8358ffe37bb82a2a5f5da3dce"+ },{"path": "test/context.test.ts","hash": "7c1242872b127117c7cc50404895d7ffcf286a51b611cd23c4ffabd5db8d43f3"@@ -174,13 +178,13 @@],"nodes": [{- "slug": "ai-model-evaluation",- "name": "AI Model Evaluation",+ "slug": "ai-model-integration",+ "name": "AI Model Integration","type": "system","sources": [- "bench/judge.ts"+ "bench/llm.ts"],- "sourcesDigest": "bfba2049dadf6f189e964206041bfbb54d9515eabe1bf3cc28ea06450fa65de7"+ "sourcesDigest": "1bdc59307386b5187ea92242900b2c3b286de3f9f45a08a7dfcf1c2d11801b27"},{"slug": "benchmarking-framework",@@ -189,12 +193,13 @@"sources": ["bench/agent.ts","bench/judge.ts",+ "bench/llm.ts","bench/report.ts","bench/run.ts","bench/selfcheck.ts","bench/tasks.ts"],- "sourcesDigest": "cc0c5db726f28fff7640e4c1d4705d7cd4eb54660db1b399622bd8f580ffe58d"+ "sourcesDigest": "afaac16d744b84811efe1b826c2bab23737665e1e62fe39b1267f20f5451b4d0"},{"slug": "benchmarking-results-reporting",@@ -212,10 +217,9 @@"sources": ["bench/agent.ts","bench/report.ts",- "src/context/build.ts",- "src/graph/enrich.ts"+ "src/context/build.ts"],- "sourcesDigest": "bb866199bd2f821c5a9b3a9d3fbeff70c9b09d3f6f3b52200219b1a0b89e0fdd"+ "sourcesDigest": "0393dee6bf242715500eeac001ca94cd9c7ff05d644d8e36d58e9c7fd2e0eab9"},{"slug": "code-summarization-and-synthesis",@@ -238,65 +242,36 @@"sourcesDigest": "a131fc0c197424e0b9a6a1da0c7e97f8aaa37eb06f6720480e7959923c918071"},{- "slug": "context-graph-management",- "name": "Context Graph Management",- "type": "system",- "sources": [- "src/context/build.ts",- "src/context/check.ts",- "src/context/node-file.ts",- "src/graph/build.ts",- "src/graph/check.ts",- "src/graph/enrich.ts",- "src/graph/extract.ts",- "src/graph/resolve.ts",- "src/graph/types.ts",- "src/graph/write.ts"- ],- "sourcesDigest": "55e6a39238b64c950511c3f7ca87ed1629d82b42231ba60ef5e8e90098ec441c"- },- {- "slug": "error-handling-and-robustness",- "name": "Error Handling and Robustness",+ "slug": "error-handling-and-reporting",+ "name": "Error Handling and Reporting","type": "concept","sources": ["bench/run.ts",- "bench/selfcheck.ts",- "src/engine.ts"+ "src/graph/build.ts",+ "src/graph/check.ts"],- "sourcesDigest": "f316b70320a3b6166ab65b4721c724c3b21b9e78cb80e77e2e94c67e3355f8aa"+ "sourcesDigest": "1386bf6efb7992fa69cd12a578fcd62b16f5332693ce2d7020e4050ba354f2f7"},{- "slug": "graph-visualization",- "name": "Graph Visualization",+ "slug": "graph-construction",+ "name": "Graph Construction","type": "system","sources": [- "viewer/data.ts",- "viewer/detail.ts",- "viewer/graph.ts",- "viewer/main.ts",- "viewer/tree.ts"- ],- "sourcesDigest": "fd0623540e7f7eed9942e3db2bc219f9a08b3814ac219dfb2b9a74f8c1aea966"- },- {- "slug": "markdown-context-graph",- "name": "Markdown Context Graph",- "type": "concept",- "sources": [- "src/graph/write.ts",- "src/index.ts"+ "src/context/build.ts",+ "src/context/check.ts",+ "src/graph/build.ts",+ "src/graph/check.ts"],- "sourcesDigest": "7883f522ca32a5ffcf1b690631a79925bbb7af24c682d2b389611674a5720a65"+ "sourcesDigest": "542278c320dfc3ba4690fe870e4222ebb3eb9fa87d9c1cd94780003d54e72141"},{- "slug": "openrouter-integration",- "name": "OpenRouter Integration",+ "slug": "graph-management",+ "name": "Graph Management","type": "system","sources": [- "bench/llm.ts"+ "src/graph/write.ts"],- "sourcesDigest": "1bdc59307386b5187ea92242900b2c3b286de3f9f45a08a7dfcf1c2d11801b27"+ "sourcesDigest": "fa6cd161fd547a03ecad2649fbb2b6094b5a6a64b10dcc1bdd6244e5157d4d48"},{"slug": "self-check-mechanism",@@ -315,6 +290,19 @@"bench/tasks.ts"],"sourcesDigest": "2940a72050e0bee89a860d904a1ebf289505f797cd93c71d86c2e776227e3fb4"+ },+ {+ "slug": "visualization-layer",+ "name": "Visualization Layer",+ "type": "system",+ "sources": [+ "viewer/data.ts",+ "viewer/detail.ts",+ "viewer/graph.ts",+ "viewer/main.ts",+ "viewer/tree.ts"+ ],+ "sourcesDigest": "fd0623540e7f7eed9942e3db2bc219f9a08b3814ac219dfb2b9a74f8c1aea966"}]}diff --git a/graft/markdown-context-graph.md b/graft/markdown-context-graph.mddeleted file mode 100644index fb525fc3..00000000--- a/graft/markdown-context-graph.md+++ /dev/null@@ -1,43 +0,0 @@-----name: Markdown Context Graph-slug: markdown-context-graph-type: concept-sources:- - path: src/graph/write.ts- hash: 55dd6ea840135ade4db7f49042234bee0db07a9c8c959ab57767deb8bebc6345- - path: src/index.ts- hash: e56e74612514fd45665b27e3c47b4a685b503a533b38e1674d256344511107fc-sources_digest: 7883f522ca32a5ffcf1b690631a79925bbb7af24c682d2b389611674a5720a65-links:- - to: context-graph-management- relation: part_of- description: It is a key output of the context graph management process.-generator:- version: 1-covers:- - symbol: wiringPath- kind: function- at: 'src/graph/write.ts:L20-L22'- - symbol: readGraph- kind: function- at: 'src/graph/write.ts:L28-L34'- - symbol: writeGraph- kind: function- at: 'src/graph/write.ts:L36-L46'- - symbol: edgeOrder- kind: function- at: 'src/graph/write.ts:L48-L54'-----<!-- context:generated:start -->-## Summary--This concept refers to the use of markdown files to represent the context graph of a codebase, facilitating easy sharing and maintainability across different environments. It emphasizes the importance of version control and human-readable formats.--## Related--- part of [[context-graph-management]] — It is a key output of the context graph management process.-<!-- context:generated:end -->--## Notes--_Anything written below the generated block is preserved when the graph is regenerated._diff --git a/graft/openrouter-integration.md b/graft/openrouter-integration.mddeleted file mode 100644index b8ba0094..00000000--- a/graft/openrouter-integration.md+++ /dev/null@@ -1,34 +0,0 @@-----name: OpenRouter Integration-slug: openrouter-integration-type: system-sources:- - path: bench/llm.ts- hash: 6c0d2a02ac6aa86de94f779355020700a4d9016e2f4b431bf75560e1d3c51229-sources_digest: 1bdc59307386b5187ea92242900b2c3b286de3f9f45a08a7dfcf1c2d11801b27-links:- - to: benchmarking-framework- relation: part_of- description: >-- It is a foundational component that supports the benchmarking framework's- operations.-generator:- version: 1-covers:- - symbol: makeClient- kind: function- at: 'bench/llm.ts:L14-L18'-----<!-- context:generated:start -->-## Summary--This component serves as the integration layer for interacting with the OpenRouter service, allowing the benchmarking framework to utilize various AI models without requiring separate API keys. It manages client creation and configuration for model interactions.--## Related--- part of [[benchmarking-framework]] — It is a foundational component that supports the benchmarking framework's operations.-<!-- context:generated:end -->--## Notes--_Anything written below the generated block is preserved when the graph is regenerated._diff --git a/graft/self-check-mechanism.md b/graft/self-check-mechanism.mdindex 55578cda..119250e9 100644--- a/graft/self-check-mechanism.md+++ b/graft/self-check-mechanism.md@@ -9,7 +9,7 @@ sources_digest: bfb889927e966de42eecbab5b0186d21e7c5fc8fbde68f2a8a68c657bb120a9alinks:- to: benchmarking-frameworkrelation: part_of- description: It supports the benchmarking framework by providing a testing mechanism.+ description: Supports the benchmarking framework by providing a testing environment.generator:version: 1covers:@@ -23,11 +23,11 @@ covers:<!-- context:generated:start -->## Summary-This component allows for offline verification of the benchmarking harness, enabling developers to test control flow without needing an API key. It simulates responses from AI services for comprehensive testing.+This component allows for offline verification of the benchmarking harness, enabling developers to test control flow without needing external API keys. It simulates responses for comprehensive testing.## Related-- part of [[benchmarking-framework]] — It supports the benchmarking framework by providing a testing mechanism.+- part of [[benchmarking-framework]] — Supports the benchmarking framework by providing a testing environment.<!-- context:generated:end -->## Notesdiff --git a/graft/src/ask/ask.md b/graft/src/ask/ask.mdindex b2330181..8e6f7efd 100644--- a/graft/src/ask/ask.md+++ b/graft/src/ask/ask.md@@ -1,18 +1,21 @@# src/ask/ask.ts-This file implements a query routing tool that processes natural language queries to return relevant context from a codebase.+This file implements a query tool that routes natural language queries to relevant code symbols and returns structured context information.-- AskHit · interface · L23-L32 — Represents a hit in the query results, encapsulating details about a concept or symbol found in the codebase.-- AskResult · interface · L34-L41 — Encapsulates the result of a query, including the query string, mode of operation, and the hits found.-- tokenize · function · L50-L56 — Transforms a string of text into an array of lowercased subword tokens, filtering out common stop words.-- counts · function · L59-L63 — Creates a frequency count map of tokens, allowing for analysis of term occurrences in a document.-- firstProse · function · L66-L73 — Extracts the first meaningful prose line from a body of text, ignoring headings and blank lines.-- Corpus · interface · L75-L78 — Defines the structure for a corpus containing concepts and a graph, used for processing queries.-- loadCorpus · function · L80-L105 — Loads a corpus from a specified directory, extracting concepts and building a graph for query processing.-- score · function · L108-L115 — Calculates a score for a document's token counts against a query, facilitating relevance ranking.-- findSubject · function · L125-L143 — Identifies the most relevant symbols in the graph that match the query, prioritizing exact name matches.-- structural · function · L145-L186 — Processes a structural query to find and return relevant callers or callees from the graph based on the query.-- lexical · function · L190-L234 — Ranks concepts and symbols based on lexical matching with the query, returning the most relevant results.-- AskOptions · interface · L236-L239 — Defines options for the ask function, allowing customization of the query context and result limits.-- ask · function · L242-L252 — Handles a query by loading the appropriate corpus and executing either structural or lexical search.-- formatAsk · function · L255-L276 — Formats the results of an AskResult into a markdown string for easy presentation.+- AskHit · interface · L23-L36 — Represents a hit in the query results, encapsulating details about a code symbol and its context.+- AskResult · interface · L42-L49 — Encapsulates the result of a query, including the query string, mode of operation, and the hits found.+- tokenize · function · L58-L64 — Transforms a string of text into an array of lowercased subword tokens, filtering out common stop words.+- counts · function · L67-L71 — Creates a frequency count map of tokens, allowing for analysis of term occurrences in a document.+- firstProse · function · L74-L81 — Extracts the first meaningful prose line from a body of text, ignoring headings and blank lines.+- Corpus · interface · L83-L86 — Defines the structure for a corpus containing concepts and a graph, used for processing queries.+- loadCorpus · function · L88-L113 — Loads a corpus from a specified directory, extracting concepts and building a graph for query processing.+- score · function · L116-L123 — Calculates a score for a document's token counts against a query, facilitating relevance ranking.+- findSubject · function · L133-L151 — Identifies the most relevant symbols in the graph that match the query, prioritizing exact name matches.+- structural · function · L153-L194 — Processes a structural query to find and return relevant callers or callees from the graph based on the query.+- lexical · function · L198-L242 — Ranks concepts and symbols based on lexical matching with the query, returning the most relevant results.+- AskOptions · interface · L244-L250 — Defines options for customizing the behavior of the ask function, such as context directory and result limits.+- parseSpan · function · L254-L258 — Parses a string pointer into its file path and line range components, facilitating source code navigation.+- sliceSpan · function · L262-L277 — Reads a specified range of lines from a source file, allowing for inlined code snippets in query results.+- inlineSource · function · L280-L287 — Attaches inlined source code to query hits, enhancing the context provided to the user.+- ask · function · L290-L305 — Processes a query against a code graph, returning structured results based on the query type and context.+- formatAsk · function · L308-L331 — Formats the results of a query into a markdown context pack for easy readability and presentation.diff --git a/graft/src/cli.md b/graft/src/cli.mdindex c9001d64..9363d110 100644--- a/graft/src/cli.md+++ b/graft/src/cli.md@@ -1,6 +1,6 @@# src/cli.ts-This file implements the `graft` CLI tool for building and maintaining a context graph from code, ensuring synchronization and providing querying capabilities.+This file implements the `graft` CLI tool for building and maintaining a context graph from code, ensuring it stays in sync with the repository.-- engineFrom · function · L26-L29 — Creates an instance of the Graft engine configured with the specified context directory.-- fmt · function · L42-L46 — Formats a record of counts into a human-readable string for console output.+- engineFrom · function · L27-L30 — Creates an instance of the Graft engine configured with the specified context directory.+- fmt · function · L49-L53 — Formats a record of counts into a human-readable string for console output.diff --git a/graft/src/context/build.md b/graft/src/context/build.mdindex a34fea07..a7408c6a 100644--- a/graft/src/context/build.md+++ b/graft/src/context/build.md@@ -1,4 +1,4 @@-# src/context/build.ts · [[caching-mechanism]] [[context-graph-management]]+# src/context/build.ts · [[caching-mechanism]] [[graph-construction]]This file builds a context graph from a code repository by summarizing source files and synthesizing nodes.diff --git a/graft/src/context/check.md b/graft/src/context/check.mdindex 3b250d25..16080632 100644--- a/graft/src/context/check.md+++ b/graft/src/context/check.md@@ -1,4 +1,4 @@-# src/context/check.ts · [[context-graph-management]]+# src/context/check.ts · [[graph-construction]]This file provides functionality to verify if the committed context graph is synchronized with the current codebase, ensuring consistency in CI environments.diff --git a/graft/src/context/node-file.md b/graft/src/context/node-file.mdindex 08f4b388..5d868ffb 100644--- a/graft/src/context/node-file.md+++ b/graft/src/context/node-file.md@@ -1,4 +1,4 @@-# src/context/node-file.ts · [[context-graph-management]]+# src/context/node-file.tsThis file defines the structure and operations for managing a context graph represented as markdown files.diff --git a/graft/src/engine.md b/graft/src/engine.mdindex 918de1f6..dfb74203 100644--- a/graft/src/engine.md+++ b/graft/src/engine.md@@ -1,19 +1,19 @@-# src/engine.ts · [[error-handling-and-robustness]]+# src/engine.ts-This file implements the Context Graph Engine, which builds and checks a code context graph from a repository without a database.+The Context Graph Engine builds and checks a code context graph from a repository without a database.- InitOptions · interface · L26-L31 — Defines options for initializing the context graph build, including code extensions and a progress callback.- CheckRunOptions · interface · L33-L35 — Specifies options for checking the context graph, allowing for code extensions to be included.-- GraphRunOptions · interface · L37-L41 — Holds options for running the graph build, including whether to use a Tier-2 LLM meaning pass.-- Graft · class · L43-L125 — The Graft class manages the context graph operations, including building and checking the graph against the codebase.-- constructor · method · L46-L48 — Initializes the Graft class with a configuration, resolving the necessary settings for the context graph.-- init · method · L51-L60 — Builds the context graph from the specified directory, utilizing various options and configurations.-- check · method · L63-L65 — Checks if the committed context graph is in sync with the code in the specified directory.-- checkGraph · method · L68-L70 — Verifies if the committed graph.json file is in sync with the code, focusing on the Tier-1 differences.-- graph · method · L77-L83 — Builds a per-symbol code graph in JSON format, optionally including a meaning layer based on the provided options.-- ask · method · L90-L92 — Processes a query against the committed graph, returning results based on structural and lexical rankings.-- requireKey · method · L95-L103 — Ensures that a valid OpenRouter API key is available, throwing an error if it is not set.-- synthesizer · method · L105-L108 — Retrieves the synthesizer instance, creating one if it is not already configured.-- cruxSummarizer · method · L111-L113 — Creates a crux summarizer for the code graph's Tier-2 pass, ensuring it is properly configured.-- summarizer · method · L115-L118 — Obtains the summarizer instance, initializing it if no custom summarizer is provided.-- modelLabel · method · L121-L124 — Determines the human-readable label for the active model used in the context graph.+- GraphRunOptions · interface · L37-L43 — Defines options for running the graph building process, including LLM usage and concurrency settings.+- Graft · class · L45-L128 — Encapsulates methods for building and checking a context graph from a code repository.+- constructor · method · L48-L50 — Initializes the Graft class with a configuration, resolving the necessary settings for the context graph.+- init · method · L53-L62 — Builds the context graph from the specified directory, utilizing various options and configurations.+- check · method · L65-L67 — Checks if the committed context graph is in sync with the code in the specified directory.+- checkGraph · method · L70-L72 — Verifies if the committed graph.json file is in sync with the code, focusing on the Tier-1 differences.+- graph · method · L79-L86 — Builds a per-symbol code graph from the repository, optionally using a meaning layer with LLM.+- ask · method · L93-L95 — Processes a query against the committed graph to return relevant information based on structural and lexical ranking.+- requireKey · method · L98-L106 — Ensures that a valid OpenRouter API key is available, throwing an error if it is not set.+- synthesizer · method · L108-L111 — Retrieves the synthesizer instance, creating one if it is not already configured.+- cruxSummarizer · method · L114-L116 — Creates a crux summarizer for the code graph's Tier-2 pass, ensuring it is properly configured.+- summarizer · method · L118-L121 — Obtains the summarizer instance, initializing it if no custom summarizer is provided.+- modelLabel · method · L124-L127 — Determines the human-readable label for the active model used in the context graph.diff --git a/graft/src/graph/build.md b/graft/src/graph/build.mdindex 3c3df9b0..b3b3043c 100644--- a/graft/src/graph/build.md+++ b/graft/src/graph/build.md@@ -1,8 +1,8 @@-# src/graph/build.ts · [[context-graph-management]]+# src/graph/build.ts · [[error-handling-and-reporting]] [[graph-construction]]-This file defines the logic to build a graph representation of a code repository, facilitating analysis and visualization of its structure.+This file defines the logic to build a graph representation from source code files in a repository.-- GraphBuildOptions · interface · L22-L33 — This interface specifies options for customizing the graph build process, including output directory and summarization behavior.-- GraphBuildResult · interface · L35-L48 — This interface outlines the structure of the result returned from the graph build process, detailing the generated graph's metadata and statistics.-- listSourceFiles · function · L51-L53 — This function retrieves a list of source files from a given directory, excluding the output directory and unsupported languages.-- buildGraph · function · L55-L143 — This function orchestrates the process of building a graph from source files, including parsing, enriching, and writing the graph data.+- GraphBuildOptions · interface · L22-L35 — This interface specifies options for customizing the graph build process, including output directory and summarization settings.+- GraphBuildResult · interface · L37-L50 — This interface outlines the structure of the result returned from the graph build process, detailing the generated graph's metadata and statistics.+- listSourceFiles · function · L53-L55 — This function retrieves a list of source files from a given directory, excluding the output directory and unsupported languages.+- buildGraph · function · L57-L146 — This function orchestrates the process of reading source files, extracting nodes and edges, and writing the resulting graph to a file.diff --git a/graft/src/graph/cards.md b/graft/src/graph/cards.mdindex d7273ae4..61ae8104 100644--- a/graft/src/graph/cards.md+++ b/graft/src/graph/cards.md@@ -1,6 +1,6 @@# src/graph/cards.ts-This module generates markdown cards that summarize source files and their symbols for easier navigation and understanding of the codebase.+This module generates markdown cards that summarize source files and their symbols, facilitating easier navigation and understanding of the codebase.- CardFileInfo · interface · L26-L32 — Holds information about a card's path, the source file it mirrors, and the number of symbols it contains.- CardStats · interface · L34-L38 — Tracks the statistics of card generation, including how many cards were written and pruned.@@ -14,6 +14,6 @@ This module generates markdown cards that summarize source files and their symbo- pruneEmptyDirs · function · L124-L144 — Removes empty directories from the output directory, ensuring a clean structure after card generation.- visit · function · L125-L142 — Visits directories to determine if they are empty after processing their contents.- writeCards · function · L150-L183 — Writes markdown cards for each source file, reflecting the source tree and pruning any outdated cards.-- writeIndex · function · L189-L224 — Creates an index markdown file that lists all concept nodes and per-file cards for easy navigation.-- CoverRef · interface · L227-L232 — Represents a symbol covered by a concept node, including its name, kind, and location.-- writeCovers · function · L247-L283 — Backfills concept nodes with a list of symbols they cover, enhancing their metadata for better navigation.+- writeIndex · function · L189-L222 — This function creates an index markdown file that lists concept nodes and per-file cards, providing a quick reference for navigating the repository.+- CoverRef · interface · L225-L230 — Represents a symbol covered by a concept node, including its name, kind, and location.+- writeCovers · function · L245-L281 — Backfills concept nodes with a list of symbols they cover, enhancing their metadata for better navigation.diff --git a/graft/src/graph/check.md b/graft/src/graph/check.mdindex 79f9448d..b131b5e3 100644--- a/graft/src/graph/check.md+++ b/graft/src/graph/check.md@@ -1,8 +1,8 @@-# src/graph/check.ts · [[context-graph-management]]+# src/graph/check.ts · [[error-handling-and-reporting]] [[graph-construction]]-This file contains logic to verify if the committed graph is in sync with the current codebase, ensuring that any discrepancies are reported for CI purposes.+Ensures that the committed graph.json accurately reflects the current state of the codebase, identifying any discrepancies.- GraphCheckResult · interface · L27-L37 — This interface defines the structure of the result returned by the graph check, detailing the state of the graph in relation to the code.- GraphCheckOptions · interface · L39-L41 — This interface provides optional parameters for configuring the context directory when performing a graph check.- checkGraph · function · L43-L101 — This function checks if the current code's graph representation matches the committed graph, identifying any added, removed, or changed nodes.-- formatGraphCheckReport · function · L104-L135 — This function generates a human-readable report summarizing the results of the graph check, indicating any discrepancies found.+- formatGraphCheckReport · function · L104-L135 — Generates a human-readable report summarizing the results of the graph check, indicating any issues found.diff --git a/graft/src/graph/enrich.md b/graft/src/graph/enrich.mdindex 5188f203..d32afc02 100644--- a/graft/src/graph/enrich.md+++ b/graft/src/graph/enrich.md@@ -1,10 +1,11 @@-# src/graph/enrich.ts · [[caching-mechanism]] [[context-graph-management]]+# src/graph/enrich.tsThis file implements a mechanism to enrich graph nodes with summaries and cruxes based on their state and prior computations.-- EnrichOptions · interface · L28-L33 — Defines options for enriching graph nodes, including the ability to compute new summaries and report progress.-- EnrichStats · interface · L35-L41 — Tracks the statistics of the enrichment process, including counts of cached, computed, stale, and pending nodes.-- enrichGraph · function · L43-L128 — Enriches a set of graph nodes by determining which need new summaries and processing them accordingly.-- collectFileCrux · function · L135-L155 — Collects crux information for nodes in a file, handling potential errors and ensuring partial results are returned.-- buildCrux · function · L162-L177 — Extracts and formats the crux text from a source file based on the model's provided line range.-- spanLines · function · L180-L186 — Parses a line span string into a clamped range of line numbers, ensuring valid boundaries.+- EnrichOptions · interface · L31-L38 — This interface defines options for enriching graph nodes, including whether to compute new summaries and the level of concurrency for processing.+- EnrichStats · interface · L40-L46 — Tracks the statistics of the enrichment process, including counts of cached, computed, stale, and pending nodes.+- enrichGraph · function · L48-L136 — This function processes graph nodes to update their summaries and cruxes based on their state and prior data, potentially invoking an LLM for new computations.+- mapWithConcurrency · function · L139-L154 — This function executes a provided asynchronous function over a list of items with a specified limit on concurrent executions, preserving the order of results.+- collectFileCrux · function · L161-L181 — Collects crux information for nodes in a file, handling potential errors and ensuring partial results are returned.+- buildCrux · function · L188-L203 — Extracts and formats the crux text from a source file based on the model's provided line range.+- spanLines · function · L206-L212 — Parses a line span string into a clamped range of line numbers, ensuring valid boundaries.diff --git a/graft/src/graph/extract.md b/graft/src/graph/extract.mdindex 71cd59a2..8c6be021 100644--- a/graft/src/graph/extract.md+++ b/graft/src/graph/extract.md@@ -1,4 +1,4 @@-# src/graph/extract.ts · [[context-graph-management]]+# src/graph/extract.tsThis module extracts structured data from source files into a normalized format for further processing.diff --git a/graft/src/graph/resolve.md b/graft/src/graph/resolve.mdindex 15534a20..1a8dbe8d 100644--- a/graft/src/graph/resolve.md+++ b/graft/src/graph/resolve.md@@ -1,4 +1,4 @@-# src/graph/resolve.ts · [[context-graph-management]]+# src/graph/resolve.tsThis file resolves raw edge intents into concrete edges by matching names against a node index, ensuring accurate relationships between nodes.diff --git a/graft/src/graph/types.md b/graft/src/graph/types.mdindex b10ddf2a..aafe8465 100644--- a/graft/src/graph/types.md+++ b/graft/src/graph/types.md@@ -1,4 +1,4 @@-# src/graph/types.ts · [[context-graph-management]]+# src/graph/types.tsDefines the schema for a code graph, outlining nodes and edges for code structure representation.diff --git a/graft/src/graph/write.md b/graft/src/graph/write.mdindex e3c51316..f56afb9a 100644--- a/graft/src/graph/write.md+++ b/graft/src/graph/write.md@@ -1,4 +1,4 @@-# src/graph/write.ts · [[context-graph-management]] [[markdown-context-graph]]+# src/graph/write.ts · [[graph-management]]This file contains functions for managing the serialization and deserialization of a wiring graph used in a context directory.diff --git a/graft/src/index.md b/graft/src/index.mdindex 97f9eff5..51280b70 100644--- a/graft/src/index.md+++ b/graft/src/index.md@@ -1,4 +1,4 @@-# src/index.ts · [[markdown-context-graph]]+# src/index.tsThis file serves as the public API for the Graft library, facilitating the management and synchronization of linked markdown files in a repository.diff --git a/graft/task-management.md b/graft/task-management.mdindex 4ca74013..24ee078b 100644--- a/graft/task-management.md+++ b/graft/task-management.md@@ -9,7 +9,7 @@ sources_digest: 2940a72050e0bee89a860d904a1ebf289505f797cd93c71d86c2e776227e3fb4links:- to: benchmarking-frameworkrelation: part_of- description: It provides the tasks that the benchmarking framework evaluates.+ description: Provides the necessary tasks for the benchmarking framework.generator:version: 1covers:@@ -26,11 +26,11 @@ covers:<!-- context:generated:start -->## Summary-This component defines the benchmark tasks and corpora used for evaluation, ensuring that each task has a verifiable answer based on actual source code. It emphasizes fair assessments of code comprehension across various tasks.+This component defines and manages the benchmark tasks and corpora, ensuring that each task has verifiable answers based on actual source code. It emphasizes fair assessments of code comprehension.## Related-- part of [[benchmarking-framework]] — It provides the tasks that the benchmarking framework evaluates.+- part of [[benchmarking-framework]] — Provides the necessary tasks for the benchmarking framework.<!-- context:generated:end -->## Notesdiff --git a/graft/test/ask.test.md b/graft/test/ask.test.mdnew file mode 100644index 00000000..74762825--- /dev/null+++ b/graft/test/ask.test.md@@ -0,0 +1,5 @@+# test/ask.test.ts++This file contains tests for the `graft ask` functionality, ensuring that the source option correctly inlines code from disk when requested.++- makeFixture · function · L15-L24 — Creates a temporary directory with a sample TypeScript file for testing purposes.diff --git a/graft/viewer/data.md b/graft/viewer/data.mdindex 2484009f..44225b43 100644--- a/graft/viewer/data.md+++ b/graft/viewer/data.md@@ -1,4 +1,4 @@-# viewer/data.ts · [[graph-visualization]]+# viewer/data.ts · [[visualization-layer]]This file defines data structures and functions for managing and visualizing graph data from a server.diff --git a/graft/viewer/detail.md b/graft/viewer/detail.mdindex 9dfda324..530c912f 100644--- a/graft/viewer/detail.md+++ b/graft/viewer/detail.md@@ -1,4 +1,4 @@-# viewer/detail.ts · [[graph-visualization]]+# viewer/detail.ts · [[visualization-layer]]This file provides the logic to render a detailed view of a selected node in a graph, including its properties and relationships.diff --git a/graft/viewer/graph.md b/graft/viewer/graph.mdindex b0389713..7404d975 100644--- a/graft/viewer/graph.md+++ b/graft/viewer/graph.md@@ -1,4 +1,4 @@-# viewer/graph.ts · [[graph-visualization]]+# viewer/graph.ts · [[visualization-layer]]This file implements a force-directed graph visualization using D3.js, allowing interactive exploration of nodes and edges.diff --git a/graft/viewer/main.md b/graft/viewer/main.mdindex ea54f3d2..f19e51c1 100644--- a/graft/viewer/main.md+++ b/graft/viewer/main.md@@ -1,4 +1,4 @@-# viewer/main.ts · [[graph-visualization]]+# viewer/main.ts · [[visualization-layer]]This file serves as the entry point for the graft visualization viewer, managing the user interface and interactions for displaying graphs.diff --git a/graft/viewer/tree.md b/graft/viewer/tree.mdindex 434211f4..ea95d540 100644--- a/graft/viewer/tree.md+++ b/graft/viewer/tree.md@@ -1,4 +1,4 @@-# viewer/tree.ts · [[graph-visualization]]+# viewer/tree.ts · [[visualization-layer]]Generates a collapsible tree view of a code graph's hierarchy, allowing users to navigate through files, classes, and methods.diff --git a/graft/graph-visualization.md b/graft/visualization-layer.mdsimilarity index 89%rename from graft/graph-visualization.mdrename to graft/visualization-layer.mdindex 84bd9a6e..573614e6 100644--- a/graft/graph-visualization.md+++ b/graft/visualization-layer.md@@ -1,6 +1,6 @@----name: Graph Visualization-slug: graph-visualization+name: Visualization Layer+slug: visualization-layertype: systemsources:- path: viewer/data.ts@@ -15,11 +15,9 @@ sources:hash: d66e0157f4c2a1525c16505306eb3aabce82565c3d0e56199ea5b7a860290b01sources_digest: fd0623540e7f7eed9942e3db2bc219f9a08b3814ac219dfb2b9a74f8c1aea966links:- - to: context-graph-management+ - to: graph-managementrelation: depends_on- description: >-- It relies on the context graph management component to provide the- necessary data for visualization.+ description: Utilizes the graph data for rendering visualizations.generator:version: 1covers:@@ -201,11 +199,11 @@ covers:<!-- context:generated:start -->## Summary-This component provides the visualization layer for the context graph, rendering nodes and edges in an interactive format. It includes functionalities for user interaction and dynamic updates based on graph data.+This component provides the visualization tools for the context graph, enabling users to interact with and explore the graph structure through a web interface.## Related-- depends on [[context-graph-management]] — It relies on the context graph management component to provide the necessary data for visualization.+- depends on [[graph-management]] — Utilizes the graph data for rendering visualizations.<!-- context:generated:end -->## Notes