Skip to content

Turbocharge Claude Code, Cursor, Codex, Gemini & every coding agent: faster, cheaper, with contextual understanding specific to your codebase.

chore: regenerate own graph + .claude from 0.7.0 templates

Shrish Dwivedia9e4f6874cd5
diff --git a/.claude/.proven-config-version b/.claude/.proven-config-version
new file mode 100644
index 00000000..dbdc100c
--- /dev/null
+++ b/.claude/.proven-config-version
@@ -0,0 +1 @@
+sha256:6141a8ea990c5063b77e090ae8f37f9c539d8aa8f58dcceb30f3a82f97e57319
\ No newline at end of file
diff --git a/.claude/proven-config.json b/.claude/proven-config.json
new file mode 100644
index 00000000..d4ada327
--- /dev/null
+++ b/.claude/proven-config.json
@@ -0,0 +1,42 @@
+{
+ "adoptedAt": 1784676035775,
+ "championId": "sha256:6141a8ea990c5063b77e090ae8f37f9c539d8aa8f58dcceb30f3a82f97e57319",
+ "manifest": {
+ "schema": "ruflo.proven-config/v1",
+ "policy": {
+ "ref": "sha256:6141a8ea990c5063b77e090ae8f37f9c539d8aa8f58dcceb30f3a82f97e57319",
+ "value": {
+ "alpha": 0.3,
+ "subjectWeight": 1,
+ "mmrLambda": 0.5,
+ "bodyWeight": 1.5,
+ "typePenaltyFactor": 0.5
+ }
+ },
+ "layer": "framework/node-cli",
+ "compatibility": {
+ "ruflo": ">=3.24.0"
+ },
+ "benchmark": {
+ "corpus": "ADR-081-labelled-v1",
+ "corpusHash": "sha256:2f700b5c363e20a3bd88ce2bc9b87bbbbaa61732c6177894c6ec37890f888982"
+ },
+ "receipt": {
+ "heldOutDelta": 0.07381404928570845,
+ "redblue": "PASS",
+ "drift": 0,
+ "canary": {
+ "rollbackRate": 0,
+ "latencyP95": 244.612458000076,
+ "costPerTask": 0
+ },
+ "receiptCoverage": 1
+ },
+ "platform": [
+ "linux",
+ "macOS",
+ "windows"
+ ]
+ },
+ "previous": ""
+}
\ No newline at end of file
diff --git a/graft/.graph/wiring.json b/graft/.graph/wiring.json
index c9029fbe..6b3d616c 100644
--- a/graft/.graph/wiring.json
+++ b/graft/.graph/wiring.json
@@ -1,8 +1,8 @@
{
"meta": {
"version": 1,
- "nodeCount": 798,
- "edgeCount": 2063,
+ "nodeCount": 849,
+ "edgeCount": 2295,
"languages": [
"typescript"
],
@@ -2105,12 +2105,12 @@
"name": "ask.ts",
"kind": "file",
"path": "src/ask/ask.ts",
- "span": "L1-L939",
+ "span": "L1-L988",
"signature": null,
"exported": true,
"origin": "ast",
- "body_hash": "9b4a22ecd84021a10900b5cc6e266f8b52c261385337ec0cf8006ecae8b3d6c0",
- "chars": 44203,
+ "body_hash": "fdd99ac315e941001c25ac1fd7e704aac9e028ec0476fd96533a271a0fafde55",
+ "chars": 46983,
"summary_state": "stale",
"summary": "This module provides a mechanism to process natural language queries and return structured results from a codebase, enhancing the ability to find relevant code snippets and their relationships.",
"crux": {
@@ -2123,7 +2123,7 @@
"name": "ask",
"kind": "function",
"path": "src/ask/ask.ts",
- "span": "L726-L771",
+ "span": "L775-L820",
"signature": "function ask(dir: string, query: string, opts: AskOptions = {}): AskResult",
"exported": true,
"origin": "ast",
@@ -2154,7 +2154,7 @@
"name": "AskOptions",
"kind": "interface",
"path": "src/ask/ask.ts",
- "span": "L629-L651",
+ "span": "L678-L700",
"signature": "interface AskOptions",
"exported": true,
"origin": "ast",
@@ -2171,11 +2171,11 @@
"name": "AskResult",
"kind": "interface",
"path": "src/ask/ask.ts",
- "span": "L52-L74",
+ "span": "L52-L82",
"signature": "interface AskResult",
"exported": true,
"origin": "ast",
- "body_hash": "fd79deb57128e1f4a35d9b927145648ed13bb28e2d0111b52f3375b6a29ede13",
+ "body_hash": "612e3a2a9dd6b430e14dd6e525aca53bf96a1217e827747ca5163d973b94d9e6",
"summary_state": "stale",
"summary": "Represents the result of an 'ask' query, encapsulating the query details and the hits found.",
"crux": {
@@ -2188,7 +2188,7 @@
"name": "askSavingsFooter",
"kind": "function",
"path": "src/ask/ask.ts",
- "span": "L907-L919",
+ "span": "L956-L968",
"signature": "function askSavingsFooter(r: AskResult, body: string): string",
"exported": false,
"origin": "ast",
@@ -2202,7 +2202,7 @@
"name": "baselineFor",
"kind": "function",
"path": "src/ask/ask.ts",
- "span": "L720-L723",
+ "span": "L769-L772",
"signature": "function baselineFor(hits: AskHit[], graph: GraphV1 | null): AskResult[\"saved\"] | undefined",
"exported": false,
"origin": "ast",
@@ -2219,7 +2219,7 @@
"name": "bm25",
"kind": "function",
"path": "src/ask/ask.ts",
- "span": "L178-L194",
+ "span": "L186-L202",
"signature": "function bm25( query: Map<string, number>, doc: Map<string, number>, idf: Map<string, number>, dl: number, avgdl: number, ): number",
"exported": false,
"origin": "ast",
@@ -2236,7 +2236,7 @@
"name": "computeIdf",
"kind": "function",
"path": "src/ask/ask.ts",
- "span": "L152-L157",
+ "span": "L160-L165",
"signature": "function computeIdf(docBags: Array<Set<string>>): Map<string, number>",
"exported": false,
"origin": "ast",
@@ -2253,7 +2253,7 @@
"name": "computeIdfFromIndex",
"kind": "function",
"path": "src/ask/ask.ts",
- "span": "L166-L171",
+ "span": "L174-L179",
"signature": "function computeIdfFromIndex(index: AskIndex, conceptBags: Array<Set<string>>): Map<string, number>",
"exported": false,
"origin": "ast",
@@ -2270,7 +2270,7 @@
"name": "Corpus",
"kind": "interface",
"path": "src/ask/ask.ts",
- "span": "L86-L93",
+ "span": "L94-L101",
"signature": "interface Corpus",
"exported": false,
"origin": "ast",
@@ -2287,7 +2287,7 @@
"name": "escalationNudge",
"kind": "function",
"path": "src/ask/ask.ts",
- "span": "L895-L902",
+ "span": "L944-L951",
"signature": "function escalationNudge(r: AskResult): string",
"exported": false,
"origin": "ast",
@@ -2301,7 +2301,7 @@
"name": "fallthroughNoteFor",
"kind": "function",
"path": "src/ask/ask.ts",
- "span": "L245-L250",
+ "span": "L253-L258",
"signature": "function fallthroughNoteFor(subject: string): string",
"exported": false,
"origin": "ast",
@@ -2318,7 +2318,7 @@
"name": "findSubjectNodes",
"kind": "function",
"path": "src/ask/ask.ts",
- "span": "L227-L235",
+ "span": "L235-L243",
"signature": "function findSubjectNodes(query: string, graph: GraphV1, inPrefix?: string): { nodes: NodeV1[]; tried: string }",
"exported": false,
"origin": "ast",
@@ -2335,7 +2335,7 @@
"name": "firstProse",
"kind": "function",
"path": "src/ask/ask.ts",
- "span": "L77-L84",
+ "span": "L85-L92",
"signature": "function firstProse(body: string): string",
"exported": false,
"origin": "ast",
@@ -2352,7 +2352,7 @@
"name": "formatAsk",
"kind": "function",
"path": "src/ask/ask.ts",
- "span": "L846-L888",
+ "span": "L895-L937",
"signature": "function formatAsk(r: AskResult): string",
"exported": true,
"origin": "ast",
@@ -2369,7 +2369,7 @@
"name": "formatSkeleton",
"kind": "function",
"path": "src/ask/ask.ts",
- "span": "L828-L838",
+ "span": "L877-L887",
"signature": "function formatSkeleton(r: SkeletonResult): string",
"exported": true,
"origin": "ast",
@@ -2386,7 +2386,7 @@
"name": "hasTerm",
"kind": "function",
"path": "src/ask/ask.ts",
- "span": "L320-L322",
+ "span": "L328-L330",
"signature": "function hasTerm(f: Map<string, number>, t: string): boolean",
"exported": false,
"origin": "ast",
@@ -2403,7 +2403,7 @@
"name": "hitFiles",
"kind": "function",
"path": "src/ask/ask.ts",
- "span": "L706-L715",
+ "span": "L755-L764",
"signature": "function hitFiles(hits: AskHit[]): Set<string>",
"exported": false,
"origin": "ast",
@@ -2420,7 +2420,7 @@
"name": "idfFromDf",
"kind": "function",
"path": "src/ask/ask.ts",
- "span": "L146-L150",
+ "span": "L154-L158",
"signature": "function idfFromDf(df: Map<string, number>, n: number): Map<string, number>",
"exported": false,
"origin": "ast",
@@ -2437,7 +2437,7 @@
"name": "inlineSource",
"kind": "function",
"path": "src/ask/ask.ts",
- "span": "L685-L702",
+ "span": "L734-L751",
"signature": "function inlineSource(root: string, hits: AskHit[], graph: GraphV1 | null, full: boolean): void",
"exported": false,
"origin": "ast",
@@ -2454,11 +2454,11 @@
"name": "lexical",
"kind": "function",
"path": "src/ask/ask.ts",
- "span": "L347-L627",
+ "span": "L375-L676",
"signature": "function lexical(query: string, corpus: Corpus, limit: number, graphRank: boolean, inPrefix?: string): AskResult",
"exported": false,
"origin": "ast",
- "body_hash": "bc0d80bd39fefdc2afbe20a539235b3167cde7a91f191c830d5582322e68c769",
+ "body_hash": "c1e86f5f126d651dac8a2135fac1b3d041da77403ddad5c273768696fa0e4d9b",
"summary_state": "stale",
"summary": "Handles lexical queries by scoring documents based on term matches and relevance, returning structured results.",
"crux": {
@@ -2471,7 +2471,7 @@
"name": "bodyLen",
"kind": "function",
"path": "src/ask/ask.ts",
- "span": "L463-L467",
+ "span": "L495-L499",
"signature": "bodyLen = (m: Map<string, number>)",
"exported": false,
"origin": "ast",
@@ -2488,7 +2488,7 @@
"name": "loadCorpus",
"kind": "function",
"path": "src/ask/ask.ts",
- "span": "L95-L120",
+ "span": "L103-L128",
"signature": "function loadCorpus(outDir: string): Corpus",
"exported": false,
"origin": "ast",
@@ -2505,7 +2505,7 @@
"name": "matchedIdfShare",
"kind": "function",
"path": "src/ask/ask.ts",
- "span": "L331-L345",
+ "span": "L359-L373",
"signature": "function matchedIdfShare( q: Map<string, number>, fields: Array<Map<string, number>>, idf: Map<string, number>, dfltIdf: number, ): number",
"exported": false,
"origin": "ast",
@@ -2522,7 +2522,7 @@
"name": "parseSpan",
"kind": "function",
"path": "src/ask/ask.ts",
- "span": "L655-L659",
+ "span": "L704-L708",
"signature": "function parseSpan(pointer: string): { path: string; from: number; to: number } | null",
"exported": false,
"origin": "ast",
@@ -2539,7 +2539,7 @@
"name": "scopeFooterLines",
"kind": "function",
"path": "src/ask/ask.ts",
- "span": "L926-L938",
+ "span": "L975-L987",
"signature": "function scopeFooterLines(r: AskResult): string[]",
"exported": false,
"origin": "ast",
@@ -2553,7 +2553,7 @@
"name": "score",
"kind": "function",
"path": "src/ask/ask.ts",
- "span": "L129-L140",
+ "span": "L137-L148",
"signature": "function score( query: Map<string, number>, doc: Map<string, number>, idf: Map<string, number>, ): number",
"exported": false,
"origin": "ast",
@@ -2570,7 +2570,7 @@
"name": "skeleton",
"kind": "function",
"path": "src/ask/ask.ts",
- "span": "L795-L825",
+ "span": "L844-L874",
"signature": "function skeleton(dir: string, file: string, opts: { contextDir?: string } = {}): SkeletonResult",
"exported": true,
"origin": "ast",
@@ -2587,7 +2587,7 @@
"name": "startLine",
"kind": "function",
"path": "src/ask/ask.ts",
- "span": "L812-L812",
+ "span": "L861-L861",
"signature": "startLine = (span: string)",
"exported": true,
"origin": "ast",
@@ -2604,7 +2604,7 @@
"name": "SkeletonEntry",
"kind": "interface",
"path": "src/ask/ask.ts",
- "span": "L775-L782",
+ "span": "L824-L831",
"signature": "interface SkeletonEntry",
"exported": true,
"origin": "ast",
@@ -2621,7 +2621,7 @@
"name": "SkeletonResult",
"kind": "interface",
"path": "src/ask/ask.ts",
- "span": "L784-L790",
+ "span": "L833-L839",
"signature": "interface SkeletonResult",
"exported": true,
"origin": "ast",
@@ -2638,7 +2638,7 @@
"name": "sliceSpan",
"kind": "function",
"path": "src/ask/ask.ts",
- "span": "L663-L678",
+ "span": "L712-L727",
"signature": "function sliceSpan(root: string, path: string, from: number, to: number): string | null",
"exported": false,
"origin": "ast",
@@ -2650,12 +2650,26 @@
"span": "L262-L273"
}
},
+ {
+ "id": "src/ask/ask.ts#strongShare",
+ "name": "strongShare",
+ "kind": "function",
+ "path": "src/ask/ask.ts",
+ "span": "L348-L357",
+ "signature": "function strongShare( q: Map<string, number>, node: NodeV1, doc: { name: Map<string, number> }, idf: Map<string, number>, dfltIdf: number, ): number",
+ "exported": true,
+ "origin": "ast",
+ "body_hash": "59a36584cd040d31423a472b5af9efeeb52e9f6b855f85bbc2ecd0d80df9dfd5",
+ "summary_state": "pending",
+ "summary": null,
+ "crux": null
+ },
{
"id": "src/ask/ask.ts#structural",
"name": "structural",
"kind": "function",
"path": "src/ask/ask.ts",
- "span": "L252-L301",
+ "span": "L260-L309",
"signature": "function structural(query: string, graph: GraphV1, limit: number, inPrefix?: string): StructuralOutcome",
"exported": false,
"origin": "ast",
@@ -2672,7 +2686,7 @@
"name": "StructuralOutcome",
"kind": "type",
"path": "src/ask/ask.ts",
- "span": "L243-L243",
+ "span": "L251-L251",
"signature": "type StructuralOutcome = { result: AskResult } | { fallthroughNote: string } | null;",
"exported": false,
"origin": "ast",
@@ -2689,7 +2703,7 @@
"name": "subjectWords",
"kind": "function",
"path": "src/ask/ask.ts",
- "span": "L206-L208",
+ "span": "L214-L216",
"signature": "function subjectWords(query: string): string[]",
"exported": false,
"origin": "ast",
@@ -2706,7 +2720,7 @@
"name": "toTokens",
"kind": "function",
"path": "src/ask/ask.ts",
- "span": "L841-L843",
+ "span": "L890-L892",
"signature": "function toTokens(chars: number): number",
"exported": false,
"origin": "ast",
@@ -2723,12 +2737,12 @@
"name": "fuse.ts",
"kind": "file",
"path": "src/ask/fuse.ts",
- "span": "L1-L224",
+ "span": "L1-L261",
"signature": null,
"exported": true,
"origin": "ast",
- "body_hash": "0b65313aa01758bbef3d80657e806c2427bbecf3d41b1d794f40372e1197a18c",
- "chars": 9481,
+ "body_hash": "a54362abffea36e5df8d2b5e9f667897b735fe78f78d718688347dbac659e9a3",
+ "chars": 11960,
"summary_state": "pending",
"summary": null,
"crux": null
@@ -2738,7 +2752,7 @@
"name": "byScore",
"kind": "function",
"path": "src/ask/fuse.ts",
- "span": "L52-L54",
+ "span": "L83-L85",
"signature": "function byScore(a: ScopedDoc, b: ScopedDoc): number",
"exported": false,
"origin": "ast",
@@ -2752,7 +2766,7 @@
"name": "fuseScopes",
"kind": "function",
"path": "src/ask/fuse.ts",
- "span": "L67-L130",
+ "span": "L98-L161",
"signature": "function fuseScopes(docs: ScopedDoc[]): FusionResult",
"exported": true,
"origin": "ast",
@@ -2766,7 +2780,7 @@
"name": "FusionResult",
"kind": "interface",
"path": "src/ask/fuse.ts",
- "span": "L30-L40",
+ "span": "L36-L46",
"signature": "interface FusionResult",
"exported": true,
"origin": "ast",
@@ -2780,11 +2794,11 @@
"name": "rankScopesAndFuse",
"kind": "function",
"path": "src/ask/fuse.ts",
- "span": "L164-L223",
+ "span": "L204-L260",
"signature": "function rankScopesAndFuse( scopes: string[], ops: ScopeRankOps, graphWeight: number, rescueFloor: number, ): FusionResult",
"exported": true,
"origin": "ast",
- "body_hash": "84a89a0ba27ec0a5e74d63aa5840586fc941020843bec3f7ad7631baa04a06bd",
+ "body_hash": "d27502c18ca4fab6a0ecc495b986f5e532d28d85514ddf7973eb79a8c2b26e9f",
"summary_state": "pending",
"summary": null,
"crux": null
@@ -2794,7 +2808,7 @@
"name": "ScopedDoc",
"kind": "interface",
"path": "src/ask/fuse.ts",
- "span": "L24-L28",
+ "span": "L30-L34",
"signature": "interface ScopedDoc",
"exported": true,
"origin": "ast",
@@ -2808,11 +2822,11 @@
"name": "ScopeRankOps",
"kind": "interface",
"path": "src/ask/fuse.ts",
- "span": "L136-L143",
+ "span": "L167-L182",
"signature": "interface ScopeRankOps",
"exported": true,
"origin": "ast",
- "body_hash": "9238611c91e80fbdf72f0c01ee4b28169ee3ba45d8c3a7ee19afac94c1325126",
+ "body_hash": "55d47ff440296617d0b300129d3675ccbf5474426107924144262c23673018be",
"summary_state": "pending",
"summary": null,
"crux": null
@@ -3060,8 +3074,8 @@
"signature": null,
"exported": true,
"origin": "ast",
- "body_hash": "332bb3a33ff816cd4db1b8db53d5f735eacedd98caddfa26c09be81bc2e62144",
- "chars": 8623,
+ "body_hash": "8e07a4b410189f0932c6b92dc4916939fcb8109f32c15b676e93862f4a10303f",
+ "chars": 8612,
"summary_state": "stale",
"summary": "This file contains functions and types for formatting and rendering status information related to a graph-based system.",
"crux": null
@@ -3123,7 +3137,7 @@
"signature": "function formatOrientation(indexMd: string, budgetBytes = 1500): string",
"exported": true,
"origin": "ast",
- "body_hash": "675c636789b2140b470d83e2665878a0813525aa34efd8935e352318c5b12649",
+ "body_hash": "b24bba7a613a5fe7b6cd3cfbb87a49bfde19f0fd618a8a716b8d61976da2d480",
"summary_state": "stale",
"summary": "Creates a formatted string representing the orientation of the repository map, limited to a specified byte budget.",
"crux": {
@@ -3303,13 +3317,13 @@
"name": "hooks.ts",
"kind": "file",
"path": "src/claude/hooks.ts",
- "span": "L1-L114",
+ "span": "L1-L167",
"signature": null,
"exported": true,
"origin": "ast",
- "body_hash": "efe4393aec6f4ab0854042b1300e8e1af899d820e6819fd0ad2d2374d321ffee",
- "chars": 5118,
- "summary_state": "ready",
+ "body_hash": "50f06a7c6c0273e9a18ee6bb7c8d028098a1fa98ab12733d4dd2d94878f418ec",
+ "chars": 7870,
+ "summary_state": "stale",
"summary": "Handles various events related to the Graft system, including session management and user prompts.",
"crux": {
"code": "export async function main(event: string): Promise<void> {\n const input = readStdin();\n const dir = projectDir(input);\n\n if (event === 'session-start') {\n try {\n const idx = readFileSync(join(dir, 'graft', 'INDEX.md'), 'utf8');\n emit('SessionStart', formatOrientation(idx));\n } catch { /* no INDEX.md — skip */ }\n return;\n }\n",
@@ -3321,7 +3335,7 @@
"name": "checkStaleCount",
"kind": "function",
"path": "src/claude/hooks.ts",
- "span": "L42-L46",
+ "span": "L48-L52",
"signature": "function checkStaleCount(dir: string): number",
"exported": false,
"origin": "ast",
@@ -3338,7 +3352,7 @@
"name": "emit",
"kind": "function",
"path": "src/claude/hooks.ts",
- "span": "L47-L49",
+ "span": "L53-L55",
"signature": "function emit(eventName: string, additionalContext: string): void",
"exported": false,
"origin": "ast",
@@ -3355,12 +3369,12 @@
"name": "graftJson",
"kind": "function",
"path": "src/claude/hooks.ts",
- "span": "L28-L41",
+ "span": "L29-L47",
"signature": "function graftJson(dir: string, args: string[]): any | null",
"exported": false,
"origin": "ast",
- "body_hash": "baa979b59d9ba8afbfe243a41e387c5833b409120746db26dc3ad30ff9eb9bd6",
- "summary_state": "ready",
+ "body_hash": "0f44fc5ecba2d5f8893679c6d91659f02339c731d4ef65f8b29cee72dbdf034f",
+ "summary_state": "stale",
"summary": "Executes a command to retrieve JSON output from the graft CLI, handling errors gracefully.",
"crux": {
"code": " const out = execFileSync(process.execPath, [graftCliPath(), ...args],\n { cwd: dir, encoding: 'utf8', timeout: 8000, stdio: ['ignore', 'pipe', 'ignore'] });\n return JSON.parse(out);\n } catch (e: any) {\n // `graft check` exits non-zero when the graph is stale (by design) but still\n // prints valid JSON to stdout; recover it from the thrown error before giving up.\n if (e && typeof e.stdout === 'string' && e.stdout.trim()) {\n try { return JSON.parse(e.stdout); } catch { /* not JSON — fall through */ }\n }\n return null;\n }",
@@ -3372,7 +3386,7 @@
"name": "handlePostEdit",
"kind": "function",
"path": "src/claude/hooks.ts",
- "span": "L51-L57",
+ "span": "L57-L63",
"signature": "async function handlePostEdit(input: any, dir: string): Promise<void>",
"exported": false,
"origin": "ast",
@@ -3389,7 +3403,7 @@
"name": "handleStop",
"kind": "function",
"path": "src/claude/hooks.ts",
- "span": "L59-L73",
+ "span": "L107-L121",
"signature": "function handleStop(dir: string): void",
"exported": false,
"origin": "ast",
@@ -3401,17 +3415,31 @@
"span": "L68-L72"
}
},
+ {
+ "id": "src/claude/hooks.ts#lastFileScopeHint",
+ "name": "lastFileScopeHint",
+ "kind": "function",
+ "path": "src/claude/hooks.ts",
+ "span": "L80-L105",
+ "signature": "function lastFileScopeHint(dir: string, lastFile: string | null | undefined): string | null",
+ "exported": true,
+ "origin": "ast",
+ "body_hash": "6677b6aef1edad81e718c13b76983e6f5ec7664878f04382a55691000590dc04",
+ "summary_state": "pending",
+ "summary": null,
+ "crux": null
+ },
{
"id": "src/claude/hooks.ts#main",
"name": "main",
"kind": "function",
"path": "src/claude/hooks.ts",
- "span": "L75-L113",
+ "span": "L123-L166",
"signature": "async function main(event: string): Promise<void>",
"exported": true,
"origin": "ast",
- "body_hash": "901ece3648f4b605795b2ce8281dddfa50fa719fa435ee878522505fea74991c",
- "summary_state": "ready",
+ "body_hash": "35b36c608f337b1afd4a2633a08fb658e19c4a15cd62f36874c0b24d4e166d60",
+ "summary_state": "stale",
"summary": "Main entry point for handling various events and orchestrating the application logic.",
"crux": {
"code": " if (event === 'session-start') {\n try {\n const idx = readFileSync(join(dir, 'graft', 'INDEX.md'), 'utf8');\n emit('SessionStart', formatOrientation(idx));\n } catch { /* no INDEX.md — skip */ }\n return;\n }\n\n if (event === 'post-edit') { await handlePostEdit(input, dir); return; }\n\n if (event === 'stop') { handleStop(dir); return; }\n",
@@ -3423,7 +3451,7 @@
"name": "projectDir",
"kind": "function",
"path": "src/claude/hooks.ts",
- "span": "L21-L23",
+ "span": "L22-L24",
"signature": "function projectDir(input: any): string",
"exported": false,
"origin": "ast",
@@ -3440,7 +3468,7 @@
"name": "readStdin",
"kind": "function",
"path": "src/claude/hooks.ts",
- "span": "L14-L18",
+ "span": "L15-L19",
"signature": "function readStdin(): any",
"exported": false,
"origin": "ast",
@@ -3457,7 +3485,7 @@
"name": "safeReadFd0",
"kind": "function",
"path": "src/claude/hooks.ts",
- "span": "L19-L19",
+ "span": "L20-L20",
"signature": "function safeReadFd0(): string",
"exported": false,
"origin": "ast",
@@ -3471,7 +3499,7 @@
"name": "underGraft",
"kind": "function",
"path": "src/claude/hooks.ts",
- "span": "L24-L27",
+ "span": "L25-L28",
"signature": "function underGraft(dir: string, file: string): boolean",
"exported": true,
"origin": "ast",
@@ -3769,12 +3797,12 @@
"name": "skill-template.ts",
"kind": "file",
"path": "src/claude/skill-template.ts",
- "span": "L1-L89",
+ "span": "L1-L93",
"signature": null,
"exported": true,
"origin": "ast",
- "body_hash": "7fab95031aad5a0e84d156d9d12915d4bb7a9206dada3b165961f690a8a64959",
- "chars": 4886,
+ "body_hash": "d5ee0ef3211ef27c0ba34fd6709befe4d25aa4d61920be8f72094f784817d431",
+ "chars": 5176,
"summary_state": "stale",
"summary": "Provides a structured template for the graft Claude Code skill, enabling efficient onboarding and understanding of the codebase.",
"crux": {
@@ -3787,11 +3815,11 @@
"name": "skillTemplate",
"kind": "function",
"path": "src/claude/skill-template.ts",
- "span": "L6-L88",
+ "span": "L6-L92",
"signature": "function skillTemplate(): string",
"exported": true,
"origin": "ast",
- "body_hash": "8fa3af192bbb3c84e067e76616f505171a08423428fab288be889b2c17999534",
+ "body_hash": "f95b4bb7d0b4bb9bae81edea626412e887e096d0d0c54b28cc0d99f05f4ad9cf",
"summary_state": "stale",
"summary": "Generates a markdown string that serves as a comprehensive guide for using the graft tool effectively within a code repository.",
"crux": {
@@ -4577,12 +4605,12 @@
"name": "cli.ts",
"kind": "file",
"path": "src/cli.ts",
- "span": "L1-L468",
+ "span": "L1-L500",
"signature": null,
"exported": true,
"origin": "ast",
- "body_hash": "85850a973f72f1744c74d4d147bf86f676dd5d17972a877ef12eb16951ccff00",
- "chars": 20013,
+ "body_hash": "ac147b7c437f7c1a530c7d7f7ebb6262c9bce7252b5acbe41b4fc528411d9f59",
+ "chars": 20773,
"summary_state": "stale",
"summary": "Defines the command-line interface for the graft tool, enabling various operations on the codebase's context graph.",
"crux": {
@@ -4595,7 +4623,7 @@
"name": "cliConfig",
"kind": "function",
"path": "src/cli.ts",
- "span": "L58-L67",
+ "span": "L55-L64",
"signature": "function cliConfig(): EngineConfig",
"exported": false,
"origin": "ast",
@@ -4612,12 +4640,12 @@
"name": "engineFrom",
"kind": "function",
"path": "src/cli.ts",
- "span": "L69-L71",
- "signature": "function engineFrom(): Graft",
+ "span": "L66-L66",
+ "signature": "engineFrom = (): Graft",
"exported": false,
"origin": "ast",
- "body_hash": "a8702efa2bdf4b53435b4de19b54bb861c1158e976334c561913e1e149df740e",
- "summary_state": "ready",
+ "body_hash": "257943edfa1daab9dbd9ab558b255d37be13bdee052d5a8c9f8bc274d4114a63",
+ "summary_state": "stale",
"summary": "Creates an instance of the Graft engine using the current CLI configuration, enabling graph operations.",
"crux": {
"code": "function engineFrom(): Graft {\n return new Graft(cliConfig());\n}",
@@ -4629,7 +4657,7 @@
"name": "fmt",
"kind": "function",
"path": "src/cli.ts",
- "span": "L107-L111",
+ "span": "L101-L105",
"signature": "fmt = (o: Record<string, number>)",
"exported": false,
"origin": "ast",
@@ -4646,7 +4674,7 @@
"name": "GlobalOpts",
"kind": "interface",
"path": "src/cli.ts",
- "span": "L49-L55",
+ "span": "L46-L52",
"signature": "interface GlobalOpts",
"exported": false,
"origin": "ast",
@@ -7149,12 +7177,12 @@
"name": "map.ts",
"kind": "file",
"path": "src/graph/map.ts",
- "span": "L1-L230",
+ "span": "L1-L331",
"signature": null,
"exported": true,
"origin": "ast",
- "body_hash": "c93bf89e679f77c233199627c448e960659722a95ab91f0f1938ebb318201c9a",
- "chars": 8433,
+ "body_hash": "663da62a0d0be1c167f0eddf0f281e4e8082f05da279e2ad3055eece2e31ef4b",
+ "chars": 13078,
"summary_state": "stale",
"summary": "Builds a structured representation of a repository's file and symbol organization based on their relationships, facilitating easier navigation and understanding of the codebase.",
"crux": {
@@ -7167,7 +7195,7 @@
"name": "basenameOf",
"kind": "function",
"path": "src/graph/map.ts",
- "span": "L189-L192",
+ "span": "L273-L276",
"signature": "function basenameOf(path: string): string",
"exported": false,
"origin": "ast",
@@ -7184,11 +7212,11 @@
"name": "buildRepoMap",
"kind": "function",
"path": "src/graph/map.ts",
- "span": "L116-L185",
+ "span": "L219-L269",
"signature": "function buildRepoMap(graph: GraphV1, opts: BuildRepoMapOptions = {}): RepoMap",
"exported": true,
"origin": "ast",
- "body_hash": "91692bf83bf7d1ae520baa1ba803c76f9d8d5c06ef684824445da7a25d2800b3",
+ "body_hash": "c8f1d96ad188205e586437f2fef50e730b1dec47a96cea27413028a7e7953b38",
"summary_state": "stale",
"summary": "Constructs the repository map from a given graph, organizing files and symbols into a structured format for easy access.",
"crux": {
@@ -7196,29 +7224,12 @@
"span": "L112-L123"
}
},
- {
- "id": "src/graph/map.ts#buildRepoMap.depthFor",
- "name": "depthFor",
- "kind": "function",
- "path": "src/graph/map.ts",
- "span": "L141-L141",
- "signature": "depthFor = (path: string): number",
- "exported": true,
- "origin": "ast",
- "body_hash": "61bba230120b002d39f95d53c1a4a157c255dd033dba747ac2bcee979f62f947",
- "summary_state": "ready",
- "summary": "Determines the depth for a given path, influencing how files are grouped in the repository map based on the split segment.",
- "crux": {
- "code": " const depthFor = (path: string): number => (splitSegment !== null && dirKey(path, 1) === splitSegment ? 2 : 1);",
- "span": "L137-L137"
- }
- },
{
"id": "src/graph/map.ts#BuildRepoMapOptions",
"name": "BuildRepoMapOptions",
"kind": "interface",
"path": "src/graph/map.ts",
- "span": "L55-L62",
+ "span": "L77-L84",
"signature": "interface BuildRepoMapOptions",
"exported": true,
"origin": "ast",
@@ -7230,12 +7241,68 @@
"span": "L51-L58"
}
},
+ {
+ "id": "src/graph/map.ts#computeDirEntries",
+ "name": "computeDirEntries",
+ "kind": "function",
+ "path": "src/graph/map.ts",
+ "span": "L144-L206",
+ "signature": "function computeDirEntries( nodes: NodeV1[], inDegree: Map<string, number>, maxDirs: number, hubsPerDir: number, stripPrefix: string, ): { dirs: DirEntry[]; dropped: number }",
+ "exported": false,
+ "origin": "ast",
+ "body_hash": "628ff92b44a21ceecbf4096bf5e22dd1fc73b6c7c6fe84915ccee6645fd76905",
+ "summary_state": "pending",
+ "summary": null,
+ "crux": null
+ },
+ {
+ "id": "src/graph/map.ts#computeDirEntries.depthFor",
+ "name": "depthFor",
+ "kind": "function",
+ "path": "src/graph/map.ts",
+ "span": "L175-L175",
+ "signature": "depthFor = (rp: string): number",
+ "exported": false,
+ "origin": "ast",
+ "body_hash": "fa8a0202ba4f055fc9faf17f63e03c4c664e188cde40e5a4b9d99073e69bf3c0",
+ "summary_state": "pending",
+ "summary": null,
+ "crux": null
+ },
+ {
+ "id": "src/graph/map.ts#computeDirEntries.fullPath",
+ "name": "fullPath",
+ "kind": "function",
+ "path": "src/graph/map.ts",
+ "span": "L191-L192",
+ "signature": "fullPath = (relKey: string): string",
+ "exported": false,
+ "origin": "ast",
+ "body_hash": "8a0ef0fac8fc38c066c8f07811812c74fe336f4f056ec1deac35cc2f8a7d4ee1",
+ "summary_state": "pending",
+ "summary": null,
+ "crux": null
+ },
+ {
+ "id": "src/graph/map.ts#computeDirEntries.relPath",
+ "name": "relPath",
+ "kind": "function",
+ "path": "src/graph/map.ts",
+ "span": "L154-L155",
+ "signature": "relPath = (path: string): string",
+ "exported": false,
+ "origin": "ast",
+ "body_hash": "e328c1f8cf98bcacb217917ad520408d106a6f55cc22ee8da7e284b120597e7e",
+ "summary_state": "pending",
+ "summary": null,
+ "crux": null
+ },
{
"id": "src/graph/map.ts#computeInDegree",
"name": "computeInDegree",
"kind": "function",
"path": "src/graph/map.ts",
- "span": "L82-L89",
+ "span": "L104-L111",
"signature": "function computeInDegree(graph: GraphV1): Map<string, number>",
"exported": false,
"origin": "ast",
@@ -7252,7 +7319,7 @@
"name": "DirEntry",
"kind": "interface",
"path": "src/graph/map.ts",
- "span": "L34-L40",
+ "span": "L35-L41",
"signature": "interface DirEntry",
"exported": true,
"origin": "ast",
@@ -7269,7 +7336,7 @@
"name": "dirKey",
"kind": "function",
"path": "src/graph/map.ts",
- "span": "L74-L77",
+ "span": "L96-L99",
"signature": "function dirKey(path: string, depth: number): string",
"exported": false,
"origin": "ast",
@@ -7281,12 +7348,26 @@
"span": "L70-L73"
}
},
+ {
+ "id": "src/graph/map.ts#droppedNote",
+ "name": "droppedNote",
+ "kind": "function",
+ "path": "src/graph/map.ts",
+ "span": "L294-L297",
+ "signature": "function droppedNote(dropped: number): string | null",
+ "exported": false,
+ "origin": "ast",
+ "body_hash": "be3ed5e5a2d742afb7bb6d4c59a9186617c0338d82c9fd2f34d1fa45e2996694",
+ "summary_state": "pending",
+ "summary": null,
+ "crux": null
+ },
{
"id": "src/graph/map.ts#formatDirHub",
"name": "formatDirHub",
"kind": "function",
"path": "src/graph/map.ts",
- "span": "L194-L196",
+ "span": "L278-L280",
"signature": "function formatDirHub(h: Hub): string",
"exported": false,
"origin": "ast",
@@ -7303,7 +7384,7 @@
"name": "formatDirLine",
"kind": "function",
"path": "src/graph/map.ts",
- "span": "L198-L203",
+ "span": "L282-L287",
"signature": "function formatDirLine(d: DirEntry): string",
"exported": false,
"origin": "ast",
@@ -7320,7 +7401,7 @@
"name": "formatHotspot",
"kind": "function",
"path": "src/graph/map.ts",
- "span": "L205-L207",
+ "span": "L289-L291",
"signature": "function formatHotspot(h: Hub): string",
"exported": false,
"origin": "ast",
@@ -7337,11 +7418,11 @@
"name": "formatRepoMap",
"kind": "function",
"path": "src/graph/map.ts",
- "span": "L215-L229",
+ "span": "L305-L330",
"signature": "function formatRepoMap(map: RepoMap): string",
"exported": true,
"origin": "ast",
- "body_hash": "4185b84957995879f7e9af4efe0a295ca215b8e0c725f0a25ee4fb80bfcff8ea",
+ "body_hash": "31f3c7d36c8a1836355a5d7bf267ed4cad5bd0178e1d4961521b19bce1e0323e",
"summary_state": "stale",
"summary": "Renders the repository map as a human-readable string, summarizing its contents and structure for easy understanding.",
"crux": {
@@ -7354,7 +7435,7 @@
"name": "Hub",
"kind": "interface",
"path": "src/graph/map.ts",
- "span": "L26-L32",
+ "span": "L27-L33",
"signature": "interface Hub",
"exported": true,
"origin": "ast",
@@ -7371,11 +7452,11 @@
"name": "RepoMap",
"kind": "interface",
"path": "src/graph/map.ts",
- "span": "L42-L53",
+ "span": "L55-L75",
"signature": "interface RepoMap",
"exported": true,
"origin": "ast",
- "body_hash": "605e2c9030866aa7c7a6fe59bab94f571f024b59defb53b5aa238f6babddfea2",
+ "body_hash": "9f2d4fd1588f4915e91af0089849682d51c3b7567c2361b532bc98d735b05850",
"summary_state": "stale",
"summary": "Encapsulates the entire repository map structure, providing a comprehensive overview of files, symbols, and their relationships.",
"crux": {
@@ -7383,12 +7464,26 @@
"span": "L41-L49"
}
},
+ {
+ "id": "src/graph/map.ts#ScopeGroup",
+ "name": "ScopeGroup",
+ "kind": "interface",
+ "path": "src/graph/map.ts",
+ "span": "L46-L53",
+ "signature": "interface ScopeGroup",
+ "exported": true,
+ "origin": "ast",
+ "body_hash": "31a321d3eb0409fc1fa81bfe0c321b1554bb39b5f4872f4c998d6961c9d37b35",
+ "summary_state": "pending",
+ "summary": null,
+ "crux": null
+ },
{
"id": "src/graph/map.ts#sortedLanguages",
"name": "sortedLanguages",
"kind": "function",
"path": "src/graph/map.ts",
- "span": "L102-L109",
+ "span": "L124-L131",
"signature": "function sortedLanguages(paths: string[]): string[]",
"exported": false,
"origin": "ast",
@@ -7405,7 +7500,7 @@
"name": "topHubs",
"kind": "function",
"path": "src/graph/map.ts",
- "span": "L94-L100",
+ "span": "L116-L122",
"signature": "function topHubs(nodes: NodeV1[], inDegree: Map<string, number>, cap: number): Hub[]",
"exported": false,
"origin": "ast",
@@ -8431,11512 +8526,12960 @@
}
},
{
- "id": "src/graph/write.ts",
- "name": "write.ts",
+ "id": "src/graph/workspace-cli.ts",
+ "name": "workspace-cli.ts",
"kind": "file",
- "path": "src/graph/write.ts",
- "span": "L1-L70",
+ "path": "src/graph/workspace-cli.ts",
+ "span": "L1-L116",
"signature": null,
"exported": true,
"origin": "ast",
- "body_hash": "a8f0d1b3efed9ca1ac3c22175c46c7a737b91bf632930ebb4437ebf52326ed69",
- "chars": 2665,
- "summary_state": "ready",
- "summary": "This file manages the serialization and deserialization of a wiring graph, ensuring efficient storage and retrieval of graph data for further processing.",
- "crux": {
- "code": "export function writeGraph(graph: GraphV1, outDir: string): string {\n const sorted: GraphV1 = {\n ...graph,\n nodes: [...graph.nodes].sort((a, b) => a.id.localeCompare(b.id)).map(stripBodyText),\n edges: [...graph.edges].sort(edgeOrder),\n };\n const path = wiringPath(outDir);\n mkdirSync(dirname(path), { recursive: true });\n writeFileSync(path, JSON.stringify(sorted, null, 2) + \"\\n\");\n return path;\n}",
- "span": "L36-L46"
- }
+ "body_hash": "b114890c823d767b08af64b76534441b9498d9bf3c9a61c3b004475f8734982b",
+ "chars": 4170,
+ "summary_state": "pending",
+ "summary": null,
+ "crux": null
},
{
- "id": "src/graph/write.ts#edgeOrder",
- "name": "edgeOrder",
+ "id": "src/graph/workspace-cli.ts#runWorkspaceAsk",
+ "name": "runWorkspaceAsk",
"kind": "function",
- "path": "src/graph/write.ts",
- "span": "L63-L69",
- "signature": "function edgeOrder(a: EdgeV1, b: EdgeV1): number",
- "exported": false,
+ "path": "src/graph/workspace-cli.ts",
+ "span": "L59-L68",
+ "signature": "function runWorkspaceAsk( root: string, override: string | undefined, query: string, opts: { limit?: number; source?: boolean; full?: boolean; in?: string; json?: boolean }, ): void",
+ "exported": true,
"origin": "ast",
- "body_hash": "1c2665c44f094c37f510a0ca5befc63bf67ae59c52d77dfdcbe15611d2e5abbe",
- "summary_state": "ready",
- "summary": "Defines the sorting order for edges in the wiring graph based on source, relation, and target.",
- "crux": {
- "code": " a.source.localeCompare(b.source) ||\n a.relation.localeCompare(b.relation) ||\n a.target.localeCompare(b.target)",
- "span": "L50-L52"
- }
+ "body_hash": "592fa7cdceb730c2985a4e09ab41a7e226209aa33f3b436c38eae257efb9e2c9",
+ "summary_state": "pending",
+ "summary": null,
+ "crux": null
},
{
- "id": "src/graph/write.ts#readGraph",
- "name": "readGraph",
+ "id": "src/graph/workspace-cli.ts#runWorkspaceBuild",
+ "name": "runWorkspaceBuild",
"kind": "function",
- "path": "src/graph/write.ts",
- "span": "L28-L34",
- "signature": "function readGraph(path: string): GraphV1 | null",
+ "path": "src/graph/workspace-cli.ts",
+ "span": "L37-L57",
+ "signature": "async function runWorkspaceBuild(root: string, opts: WorkspaceBuildOptions): Promise<void>",
"exported": true,
"origin": "ast",
- "body_hash": "a68ca7cd48652a99a350b76c387a19462cc984c42bbc9b00a30e629af5fda52e",
- "summary_state": "ready",
- "summary": "Reads and parses an existing wiring graph from a file, returning null if the file is absent or unparseable.",
- "crux": {
- "code": " return JSON.parse(readFileSync(path, \"utf8\")) as GraphV1;\n } catch {\n return null;",
- "span": "L30-L32"
- }
+ "body_hash": "5678bc06f3b0eafddfcb6ccf50d3e1938ed0e6d0c5e537fe927571343736e25f",
+ "summary_state": "pending",
+ "summary": null,
+ "crux": null
},
{
- "id": "src/graph/write.ts#stripBodyText",
- "name": "stripBodyText",
+ "id": "src/graph/workspace-cli.ts#runWorkspaceBuild.buildChild",
+ "name": "buildChild",
"kind": "function",
- "path": "src/graph/write.ts",
- "span": "L57-L61",
- "signature": "function stripBodyText(node: NodeV1): NodeV1",
- "exported": false,
+ "path": "src/graph/workspace-cli.ts",
+ "span": "L38-L44",
+ "signature": "buildChild = async (childDir: string, childName: string): Promise<void>",
+ "exported": true,
"origin": "ast",
- "body_hash": "066abd2d7e9f13c6df67c4ba9100acdba5518e271bbc326536475e8610ae24cf",
- "summary_state": "ready",
- "summary": "Removes the body_text property from a node to reduce the size of the serialized graph, avoiding duplication of data already stored elsewhere.",
- "crux": {
- "code": "function stripBodyText(node: NodeV1): NodeV1 {\n if (node.body_text === undefined) return node;\n const { body_text: _body_text, ...rest } = node;\n return rest as NodeV1;\n}",
- "span": "L57-L61"
- }
+ "body_hash": "95429a624b74f8415b633c802f1e642815319c2c35718ff05fc445cab112be1e",
+ "summary_state": "pending",
+ "summary": null,
+ "crux": null
},
{
- "id": "src/graph/write.ts#wiringPath",
- "name": "wiringPath",
+ "id": "src/graph/workspace-cli.ts#runWorkspaceCallers",
+ "name": "runWorkspaceCallers",
"kind": "function",
- "path": "src/graph/write.ts",
- "span": "L20-L22",
- "signature": "function wiringPath(outDir: string): string",
+ "path": "src/graph/workspace-cli.ts",
+ "span": "L103-L115",
+ "signature": "function runWorkspaceCallers( root: string, override: string | undefined, symbol: string, opts: { direction?: Direction; depth?: number; in?: string }, ): void",
"exported": true,
"origin": "ast",
- "body_hash": "4a454f03e0aa7289fbc47e6493079ab7f8b353b6133b4362158857eda98bb544",
- "summary_state": "ready",
- "summary": "Generates the absolute path for the wiring graph file in a specified output directory.",
- "crux": {
- "code": " return join(outDir, GRAPH_DIR, GRAPH_FILE);",
- "span": "L21-L21"
- }
+ "body_hash": "051bf3398a6a6c073d29e09d7bbef96786dcc846f2b0290ff9bf8f00ad708917",
+ "summary_state": "pending",
+ "summary": null,
+ "crux": null
},
{
- "id": "src/graph/write.ts#writeGraph",
- "name": "writeGraph",
+ "id": "src/graph/workspace-cli.ts#runWorkspaceCheck",
+ "name": "runWorkspaceCheck",
"kind": "function",
- "path": "src/graph/write.ts",
- "span": "L36-L46",
- "signature": "function writeGraph(graph: GraphV1, outDir: string): string",
+ "path": "src/graph/workspace-cli.ts",
+ "span": "L97-L101",
+ "signature": "function runWorkspaceCheck(root: string, override?: string): void",
"exported": true,
"origin": "ast",
- "body_hash": "13647ca6eab5d041c45b3ef6efb6b851a3991c63742c94c88f4d05ecfc944354",
- "summary_state": "ready",
- "summary": "Writes a serialized and sorted representation of the graph to a JSON file, optimizing for size by stripping unnecessary data.",
- "crux": {
- "code": "export function writeGraph(graph: GraphV1, outDir: string): string {\n const sorted: GraphV1 = {\n ...graph,\n nodes: [...graph.nodes].sort((a, b) => a.id.localeCompare(b.id)).map(stripBodyText),\n edges: [...graph.edges].sort(edgeOrder),\n };\n const path = wiringPath(outDir);\n mkdirSync(dirname(path), { recursive: true });\n writeFileSync(path, JSON.stringify(sorted, null, 2) + \"\\n\");\n return path;\n}",
- "span": "L36-L46"
- }
+ "body_hash": "a18a698fe304fcf9aecc781de87d83450721c22d16f6f7f44e53c45a1dfcf1aa",
+ "summary_state": "pending",
+ "summary": null,
+ "crux": null
},
{
- "id": "src/hosts/codex-hooks.ts",
- "name": "codex-hooks.ts",
- "kind": "file",
- "path": "src/hosts/codex-hooks.ts",
- "span": "L1-L75",
- "signature": null,
+ "id": "src/graph/workspace-cli.ts#runWorkspaceGrep",
+ "name": "runWorkspaceGrep",
+ "kind": "function",
+ "path": "src/graph/workspace-cli.ts",
+ "span": "L70-L87",
+ "signature": "function runWorkspaceGrep( root: string, override: string | undefined, pattern: string, opts: { ignoreCase?: boolean; fixed?: boolean; json?: boolean }, ): void",
"exported": true,
"origin": "ast",
- "body_hash": "0b9ba9ba677876d1adf4ce8d05aa534cddfbdeb7060ed11a92111a41a76d1512",
- "chars": 3168,
- "summary_state": "ready",
- "summary": "Facilitates the installation and management of user-level hooks for CLI agents, ensuring that hooks are correctly written and updated in the hooks.json configuration file after file edits.",
- "crux": {
- "code": "export function installCodexHooks(home: string): HookWrite[] {\n const base = join(home, '.codex');\n if (!dirExists(base)) return [];\n\n const shimPath = join(base, 'hooks', 'graft', 'graft-hooks.cjs');\n const shimWrite = writeOwned('codex-hook-shim', shimPath, hooksShim(claudeDistDir()), 0o755);\n\n const cfgPath = join(base, 'hooks.json');\n let root: Record<string, any> = {};\n const existed = existsSync(cfgPath);\n if (existed) {\n try { root = JSON.parse(readFileSync(cfgPath, 'utf8')); } catch {",
- "span": "L37-L48"
- }
+ "body_hash": "bd14b5d2169943e0f2d2f019f153010fb6609d1049d4f80ef790658ae3ca1612",
+ "summary_state": "pending",
+ "summary": null,
+ "crux": null
},
{
- "id": "src/hosts/codex-hooks.ts#dirExists",
- "name": "dirExists",
+ "id": "src/graph/workspace-cli.ts#runWorkspaceMap",
+ "name": "runWorkspaceMap",
"kind": "function",
- "path": "src/hosts/codex-hooks.ts",
- "span": "L17-L19",
- "signature": "function dirExists(p: string): boolean",
- "exported": false,
+ "path": "src/graph/workspace-cli.ts",
+ "span": "L89-L95",
+ "signature": "function runWorkspaceMap( root: string, override: string | undefined, opts: { maxDirs?: number }, ): void",
+ "exported": true,
"origin": "ast",
- "body_hash": "3cb56ff33de328b88ab53b8b869149394e3f46919184cc3d9c7bebed9fb4dcc7",
- "summary_state": "ready",
- "summary": "Checks if a given directory path exists, returning a boolean value to indicate its existence.",
- "crux": {
- "code": " try { return statSync(p).isDirectory(); } catch { return false; }\n}",
- "span": "L18-L19"
- }
+ "body_hash": "e25e10b17a54f652f6e995b485677a1298e990074055d6fa8697d81fc037d343",
+ "summary_state": "pending",
+ "summary": null,
+ "crux": null
},
{
- "id": "src/hosts/codex-hooks.ts#HookWrite",
- "name": "HookWrite",
+ "id": "src/graph/workspace-cli.ts#WorkspaceBuildOptions",
+ "name": "WorkspaceBuildOptions",
"kind": "interface",
- "path": "src/hosts/codex-hooks.ts",
- "span": "L11-L15",
- "signature": "interface HookWrite",
+ "path": "src/graph/workspace-cli.ts",
+ "span": "L24-L32",
+ "signature": "interface WorkspaceBuildOptions",
"exported": true,
"origin": "ast",
- "body_hash": "87f37fccd34dabd662b284ad06e364c60173827b1eef5170714b232943a22693",
- "summary_state": "ready",
- "summary": "Defines the structure for hook write operations, encapsulating the ID, path, and action taken during the write process.",
+ "body_hash": "9d07849eb635ed6bdc370c2a701b966fd2b71b5a5e37076b134623fc9c74a062",
+ "summary_state": "pending",
+ "summary": null,
"crux": null
},
{
- "id": "src/hosts/codex-hooks.ts#installCodexHooks",
- "name": "installCodexHooks",
- "kind": "function",
- "path": "src/hosts/codex-hooks.ts",
- "span": "L37-L74",
- "signature": "function installCodexHooks(home: string): HookWrite[]",
+ "id": "src/graph/workspace.ts",
+ "name": "workspace.ts",
+ "kind": "file",
+ "path": "src/graph/workspace.ts",
+ "span": "L1-L473",
+ "signature": null,
"exported": true,
"origin": "ast",
- "body_hash": "ed7ea45d024b73cc41550f0b5f3edcebc2555fbc1db0aba5437ded0b2c869d52",
- "summary_state": "ready",
- "summary": "Installs codex hooks by writing a shim and updating the hooks configuration based on the provided home directory.",
- "crux": {
- "code": " const shimPath = join(base, 'hooks', 'graft', 'graft-hooks.cjs');\n const shimWrite = writeOwned('codex-hook-shim', shimPath, hooksShim(claudeDistDir()), 0o755);\n\n const cfgPath = join(base, 'hooks.json');\n let root: Record<string, any> = {};\n const existed = existsSync(cfgPath);\n if (existed) {\n try { root = JSON.parse(readFileSync(cfgPath, 'utf8')); } catch {\n return [shimWrite, { id: 'codex-hooks', path: cfgPath, action: 'skipped-unparseable' }];\n }\n }\n if (typeof root !== 'object' || root === null || Array.isArray(root)) {",
- "span": "L41-L52"
- }
+ "body_hash": "d15077d0e2844137b447a6e2771fac249351c259d8aad393a281ccb302fb8054",
+ "chars": 20560,
+ "summary_state": "pending",
+ "summary": null,
+ "crux": null
},
{
- "id": "src/hosts/codex-hooks.ts#isGraftEntry",
- "name": "isGraftEntry",
- "kind": "function",
- "path": "src/hosts/codex-hooks.ts",
- "span": "L33-L35",
- "signature": "function isGraftEntry(entry: unknown): boolean",
+ "id": "src/graph/workspace.ts#ChildRun",
+ "name": "ChildRun",
+ "kind": "interface",
+ "path": "src/graph/workspace.ts",
+ "span": "L177-L186",
+ "signature": "interface ChildRun",
"exported": false,
"origin": "ast",
- "body_hash": "628b0f417080f2b63d9928d37116e818fc0d2c50c5d1319fdf1cb4ec7ef6e9f3",
- "summary_state": "ready",
- "summary": "Determines if a given entry is a graft entry by checking for a specific string in its JSON representation.",
- "crux": {
- "code": " return JSON.stringify(entry).includes('graft-hooks.cjs');\n}",
- "span": "L34-L35"
- }
+ "body_hash": "49aaad3d8807fe07a7f88d8b4cb9fc8bda0e6437284dd682cfaddfe65aab419a",
+ "summary_state": "pending",
+ "summary": null,
+ "crux": null
},
{
- "id": "src/hosts/codex-hooks.ts#writeOwned",
- "name": "writeOwned",
+ "id": "src/graph/workspace.ts#clearParentGraft",
+ "name": "clearParentGraft",
"kind": "function",
- "path": "src/hosts/codex-hooks.ts",
- "span": "L21-L31",
- "signature": "function writeOwned(id: string, path: string, content: string, mode?: number): HookWrite",
- "exported": false,
+ "path": "src/graph/workspace.ts",
+ "span": "L111-L113",
+ "signature": "function clearParentGraft(root: string, override?: string): void",
+ "exported": true,
"origin": "ast",
- "body_hash": "0e2c5fcb677016e7114466756f114b05de75fd91cca3829607c528461e02edb1",
- "summary_state": "ready",
- "summary": "Handles the creation or updating of a file with specific content and permissions, returning the action taken.",
- "crux": {
- "code": " const existed = existsSync(path);\n if (existed && readFileSync(path, 'utf8') === content) {\n if (mode !== undefined && (statSync(path).mode & 0o777) !== mode) chmodSync(path, mode);\n return { id, path, action: 'unchanged' };\n }\n mkdirSync(dirname(path), { recursive: true });\n writeFileSync(path, content);\n if (mode !== undefined) chmodSync(path, mode);\n return { id, path, action: existed ? 'updated' : 'created' };",
- "span": "L22-L30"
- }
+ "body_hash": "bb27946f81b69d8ea8f3c163aaca0b15d3c7dd20138d16c4b6903575e2fe6992",
+ "summary_state": "pending",
+ "summary": null,
+ "crux": null
},
{
- "id": "src/hosts/init.ts",
- "name": "init.ts",
- "kind": "file",
- "path": "src/hosts/init.ts",
- "span": "L1-L73",
- "signature": null,
+ "id": "src/graph/workspace.ts#coverageNote",
+ "name": "coverageNote",
+ "kind": "function",
+ "path": "src/graph/workspace.ts",
+ "span": "L148-L152",
+ "signature": "function coverageNote(g: WorkspaceGraphs): string",
"exported": true,
"origin": "ast",
- "body_hash": "cd3ef307f207a48b82fa81ea55e34fdc97b8663612ad639a3256336d5531afa0",
- "chars": 2627,
- "summary_state": "ready",
- "summary": "Initializes host configurations by writing instruction files based on selected hosts, ensuring that the correct files are created or updated as needed.",
- "crux": {
- "code": "export function runHostsInit(\n repo: string,\n opts: { agents?: string[]; all?: boolean; home?: string; mcp?: boolean; hooks?: boolean } = {},\n): HostsInitResult {\n const home = opts.home ?? homedir();\n const probe = probeFor(home, repo);\n\n let selected: HostTarget[];\n let unknown: string[] = [];\n if (opts.agents !== undefined) {\n const byId = new Map(HOSTS.map((h) => [h.id, h]));\n selected = opts.agents.flatMap((id) => byId.get(id) ?? []);",
- "span": "L37-L48"
- }
+ "body_hash": "52f80ec25210adc44938aef49b5e1dc008dfce002ae9b3d5b18b78b612716880",
+ "summary_state": "pending",
+ "summary": null,
+ "crux": null
},
{
- "id": "src/hosts/init.ts#HostsInitResult",
- "name": "HostsInitResult",
+ "id": "src/graph/workspace.ts#federateAsk",
+ "name": "federateAsk",
+ "kind": "function",
+ "path": "src/graph/workspace.ts",
+ "span": "L207-L306",
+ "signature": "function federateAsk( root: string, override: string | undefined, query: string, opts: FederateAskOptions = {}, ): AskResult",
+ "exported": true,
+ "origin": "ast",
+ "body_hash": "99457ed331a29ea9e4568b61ca67e83de53072c7f7217212c7acf5daf369b454",
+ "summary_state": "pending",
+ "summary": null,
+ "crux": null
+ },
+ {
+ "id": "src/graph/workspace.ts#FederateAskOptions",
+ "name": "FederateAskOptions",
"kind": "interface",
- "path": "src/hosts/init.ts",
- "span": "L14-L20",
- "signature": "interface HostsInitResult",
+ "path": "src/graph/workspace.ts",
+ "span": "L167-L175",
+ "signature": "interface FederateAskOptions",
"exported": true,
"origin": "ast",
- "body_hash": "c643482048fe39520f2fc0aaee0c8761e9f13ed7f7bf5fcfc8ef404cd2f0e98f",
- "summary_state": "ready",
- "summary": "Defines the structure of the result returned by the host initialization process, capturing written, skipped, and unknown hosts along with MCP and hooks data.",
+ "body_hash": "6d1ccfe40dfe46d2e2fc4c7d0485c8c872c8008d276311c8297d9304d9f48628",
+ "summary_state": "pending",
+ "summary": null,
"crux": null
},
{
- "id": "src/hosts/init.ts#probeFor",
- "name": "probeFor",
+ "id": "src/graph/workspace.ts#federateCallers",
+ "name": "federateCallers",
"kind": "function",
- "path": "src/hosts/init.ts",
- "span": "L22-L27",
- "signature": "function probeFor(home: string, repo: string): DetectProbe",
- "exported": false,
+ "path": "src/graph/workspace.ts",
+ "span": "L407-L443",
+ "signature": "function federateCallers( root: string, override: string | undefined, symbol: string, opts: { direction?: Direction; depth?: number; in?: string } = {}, ): { text: string; found: boolean }",
+ "exported": true,
"origin": "ast",
- "body_hash": "7653739002fda057d1517f18bfe77dfb0dcf78ab6cb9716ceb7624601eec1f7f",
- "summary_state": "ready",
- "summary": "Creates a probe object to check for the existence of directories in a specified repository, facilitating host detection.",
- "crux": {
- "code": " home, repo,\n dirExists: (p) => { try { return statSync(p).isDirectory(); } catch { return false; } },\n };",
- "span": "L24-L26"
- }
+ "body_hash": "6e93e06ac3efd73a1bb538066e826234d20d15cbb237949b613cd8ed559936a0",
+ "summary_state": "pending",
+ "summary": null,
+ "crux": null
},
{
- "id": "src/hosts/init.ts#runHostsInit",
- "name": "runHostsInit",
+ "id": "src/graph/workspace.ts#federateCheck",
+ "name": "federateCheck",
"kind": "function",
- "path": "src/hosts/init.ts",
- "span": "L37-L72",
- "signature": "function runHostsInit( repo: string, opts: { agents?: string[]; all?: boolean; home?: string; mcp?: boolean; hooks?: boolean } = {}, ): HostsInitResult",
+ "path": "src/graph/workspace.ts",
+ "span": "L378-L403",
+ "signature": "function federateCheck( root: string, override?: string, ): { text: string; ok: boolean }",
"exported": true,
"origin": "ast",
- "body_hash": "8b9a15d05dcd9a43c414b8c27e34f565538950d578ed452568d9c61f08bb9dbd",
- "summary_state": "ready",
- "summary": "Initializes hosts by selecting them based on provided options and writing their instruction files, while also handling MCP configurations and hooks.",
- "crux": {
- "code": " const path = join(repo, host.relPath);\n const action =\n host.kind === 'owned'\n ? writeOwned(path, host.content())\n : upsertSection(path, host.content()).action;\n written.push({ id: host.id, path, action });\n }\n const skipped = HOSTS.filter((h) => !selected.includes(h)).map((h) => h.id);\n const mcp = opts.mcp === false ? [] : registerMcpConfigs(repo, selected.map((h) => h.id), { home });\n const hooks =\n opts.hooks === false || !selected.some((h) => h.id === 'agents')\n ? []",
- "span": "L58-L69"
- }
+ "body_hash": "d3366015f7761bbcf8a7ae05b32b775e1b950fc7065978dcb4b81c35081b89be",
+ "summary_state": "pending",
+ "summary": null,
+ "crux": null
},
{
- "id": "src/hosts/init.ts#writeOwned",
- "name": "writeOwned",
+ "id": "src/graph/workspace.ts#federateGrep",
+ "name": "federateGrep",
"kind": "function",
- "path": "src/hosts/init.ts",
- "span": "L29-L35",
- "signature": "function writeOwned(path: string, content: string): string",
- "exported": false,
+ "path": "src/graph/workspace.ts",
+ "span": "L311-L351",
+ "signature": "function federateGrep( root: string, override: string | undefined, pattern: string, opts: { ignoreCase?: boolean; fixed?: boolean } = {}, ): { result: GrepResult; coverage: string }",
+ "exported": true,
"origin": "ast",
- "body_hash": "f25633ece4c0cfb7a956003dd26ad8e1b095e7955d13d796c24ac389d75a4f09",
- "summary_state": "ready",
- "summary": "Writes content to a specified path, creating or replacing the file as necessary, and returns the action taken.",
- "crux": {
- "code": " if (existsSync(path) && readFileSync(path, 'utf8') === content) return 'unchanged';\n mkdirSync(dirname(path), { recursive: true });\n const existed = existsSync(path);\n writeFileSync(path, content);\n return existed ? 'replaced' : 'created';",
- "span": "L30-L34"
- }
+ "body_hash": "ba60a8d390debaab2a2f154a6a8548121ed68e676ba8777feefe35419997cd8b",
+ "summary_state": "pending",
+ "summary": null,
+ "crux": null
},
{
- "id": "src/hosts/instructions.ts",
- "name": "instructions.ts",
- "kind": "file",
- "path": "src/hosts/instructions.ts",
- "span": "L1-L66",
- "signature": null,
+ "id": "src/graph/workspace.ts#federateMap",
+ "name": "federateMap",
+ "kind": "function",
+ "path": "src/graph/workspace.ts",
+ "span": "L355-L374",
+ "signature": "function federateMap( root: string, override: string | undefined, opts: { maxDirs?: number } = {}, ): string",
"exported": true,
"origin": "ast",
- "body_hash": "17afda3d983ab46e0329ed7e4e781e361265578ee99fcf9ab8cd4228b8b5f3c5",
- "chars": 2647,
- "summary_state": "stale",
- "summary": "This file provides Graft instructions for navigating and utilizing the context graph effectively.",
+ "body_hash": "e047e94f1604db5cec20ef415f95ec04a5a8c44482264d78e24f62420a227bd5",
+ "summary_state": "pending",
+ "summary": null,
"crux": null
},
{
- "id": "src/hosts/instructions.ts#cursorRule",
- "name": "cursorRule",
+ "id": "src/graph/workspace.ts#hasMegaGraph",
+ "name": "hasMegaGraph",
"kind": "function",
- "path": "src/hosts/instructions.ts",
- "span": "L45-L52",
- "signature": "function cursorRule(): string",
+ "path": "src/graph/workspace.ts",
+ "span": "L92-L94",
+ "signature": "function hasMegaGraph(root: string, override?: string): boolean",
"exported": true,
"origin": "ast",
- "body_hash": "697397dc5e04836b10f9f9b6c4dfb5df6d95c5f89317ce9a77bb838a7e71e929",
- "summary_state": "ready",
- "summary": "Defines a rule to always apply the Graft context graph before exploring source code.",
- "crux": {
- "code": "export function cursorRule(): string {\n return `---\ndescription: Use the Graft context graph in graft/ before exploring source\nalwaysApply: true\n---\n${instructionBody()}",
- "span": "L44-L49"
- }
+ "body_hash": "c50ff73e08252dcd9dad4aff8edb4fb9c6dfcded76332f8fb28e0ec1cdebebb1",
+ "summary_state": "pending",
+ "summary": null,
+ "crux": null
},
{
- "id": "src/hosts/instructions.ts#instructionBody",
- "name": "instructionBody",
+ "id": "src/graph/workspace.ts#isWorkspaceBuildRoot",
+ "name": "isWorkspaceBuildRoot",
"kind": "function",
- "path": "src/hosts/instructions.ts",
- "span": "L6-L43",
- "signature": "function instructionBody(): string",
+ "path": "src/graph/workspace.ts",
+ "span": "L84-L88",
+ "signature": "function isWorkspaceBuildRoot(root: string, override?: string): boolean",
"exported": true,
"origin": "ast",
- "body_hash": "dc7ccce561fcd4c23d60739f2538908fbf5ff0fcb4205bfbdae4ea61ee7c5f80",
- "summary_state": "stale",
- "summary": "Generates the main instructional content for using the Graft context graph.",
- "crux": {
- "code": "export function instructionBody(): string {\n return `## Graft — repo context graph\n\nThis repo is indexed in \\`graft/\\`: small linked markdown nodes that explain each\nsystem and carry exact file:line spans, kept in sync with the code through git.\n\nFor ANY task here — understanding how something works, finding where code lives,\nor scoping a change — get context from the graph before grepping or opening\nsource files. Re-ask freely (it's cheap) and reuse literal identifiers you\nalready have (symbol, error string, file name) as the query. New to this repo?\nRun \\`graft map\\` first — a token-budgeted orientation (dir clusters, hubs,\nhotspots), no LLM, no key.",
- "span": "L6-L17"
- }
+ "body_hash": "6b938713206ba439e30a10400533a9c242fb1447044cd3ecadef05b4dc3b2509",
+ "summary_state": "pending",
+ "summary": null,
+ "crux": null
},
{
- "id": "src/hosts/instructions.ts#kiroSteering",
- "name": "kiroSteering",
- "kind": "function",
- "path": "src/hosts/instructions.ts",
- "span": "L54-L60",
- "signature": "function kiroSteering(): string",
+ "id": "src/graph/workspace.ts#LoadedChild",
+ "name": "LoadedChild",
+ "kind": "interface",
+ "path": "src/graph/workspace.ts",
+ "span": "L115-L118",
+ "signature": "interface LoadedChild",
"exported": true,
"origin": "ast",
- "body_hash": "a3fea9a2ad9ee6488338f60825284e55bc5cd09cee354e9554efb2d90e2be20f",
- "summary_state": "ready",
- "summary": "Specifies a rule for always including the Graft context graph in the workflow.",
- "crux": {
- "code": "export function kiroSteering(): string {\n return `---\ninclusion: always\n---\n${instructionBody()}",
- "span": "L53-L57"
- }
+ "body_hash": "57af051725a42c92f83b5688788c8cdb8e54be71ef9e17c198c9e1f2ae7fa66b",
+ "summary_state": "pending",
+ "summary": null,
+ "crux": null
},
{
- "id": "src/hosts/instructions.ts#windsurfRule",
- "name": "windsurfRule",
+ "id": "src/graph/workspace.ts#loadWorkspaceGraphs",
+ "name": "loadWorkspaceGraphs",
"kind": "function",
- "path": "src/hosts/instructions.ts",
- "span": "L62-L65",
- "signature": "function windsurfRule(): string",
+ "path": "src/graph/workspace.ts",
+ "span": "L132-L143",
+ "signature": "function loadWorkspaceGraphs(root: string, override?: string): WorkspaceGraphs",
"exported": true,
"origin": "ast",
- "body_hash": "a30d7b9ed58bdcfc402576d4a79e3643691145a92c521402e594243533cb4aed",
- "summary_state": "ready",
- "summary": "Provides a rule that incorporates the Graft context graph into its logic.",
- "crux": {
- "code": "export function windsurfRule(): string {\n return `${instructionBody()}",
- "span": "L61-L62"
- }
+ "body_hash": "ab814e286ef7eff17061679139c02d01e026fd1939b205196ab9f68521ec5dac",
+ "summary_state": "pending",
+ "summary": null,
+ "crux": null
},
{
- "id": "src/hosts/mcp-config.ts",
- "name": "mcp-config.ts",
- "kind": "file",
- "path": "src/hosts/mcp-config.ts",
- "span": "L1-L88",
- "signature": null,
+ "id": "src/graph/workspace.ts#migrationNote",
+ "name": "migrationNote",
+ "kind": "function",
+ "path": "src/graph/workspace.ts",
+ "span": "L98-L105",
+ "signature": "function migrationNote(children: string[]): string",
"exported": true,
"origin": "ast",
- "body_hash": "a449aa6fea8dc1b842e565d9c60fb61e46343effe69c1064a758c31d30cd5329",
- "chars": 3352,
- "summary_state": "stale",
- "summary": "Facilitates the registration and configuration of multiple MCP servers in specified host configurations, ensuring proper JSON and TOML formatting.",
- "crux": {
- "code": "export function registerMcpConfigs(\n repo: string,\n ids: string[],\n opts: { home?: string } = {},\n): McpWrite[] {\n const home = opts.home ?? homedir();\n const out: McpWrite[] = [];\n for (const id of ids) {\n switch (id) {\n case 'cursor':\n out.push(mergeJsonKey(id, join(repo, '.cursor', 'mcp.json'), 'mcpServers', SERVER_ENTRY));\n break;",
- "span": "L56-L67"
- }
+ "body_hash": "c38151c635b45ddbbc4d7ffc9e6ff9d456cebdf6cb256fb44b293b724469ccd5",
+ "summary_state": "pending",
+ "summary": null,
+ "crux": null
},
{
- "id": "src/hosts/mcp-config.ts#dirExists",
- "name": "dirExists",
+ "id": "src/graph/workspace.ts#prefixPointer",
+ "name": "prefixPointer",
"kind": "function",
- "path": "src/hosts/mcp-config.ts",
- "span": "L19-L21",
- "signature": "function dirExists(p: string): boolean",
+ "path": "src/graph/workspace.ts",
+ "span": "L156-L165",
+ "signature": "function prefixPointer(child: string, pointer: string): string",
"exported": false,
"origin": "ast",
- "body_hash": "3cb56ff33de328b88ab53b8b869149394e3f46919184cc3d9c7bebed9fb4dcc7",
- "summary_state": "ready",
- "summary": "Checks if a given directory path exists, returning a boolean value.",
- "crux": {
- "code": "function dirExists(p: string): boolean {\n try { return statSync(p).isDirectory(); } catch { return false; }\n}",
- "span": "L19-L21"
- }
+ "body_hash": "c24b3d3709332b3eff6ef53d7beaba32d2b326da963acea0f6f776571c08db6f",
+ "summary_state": "pending",
+ "summary": null,
+ "crux": null
},
{
- "id": "src/hosts/mcp-config.ts#McpWrite",
- "name": "McpWrite",
- "kind": "interface",
- "path": "src/hosts/mcp-config.ts",
- "span": "L10-L14",
- "signature": "interface McpWrite",
+ "id": "src/graph/workspace.ts#readWorkspace",
+ "name": "readWorkspace",
+ "kind": "function",
+ "path": "src/graph/workspace.ts",
+ "span": "L59-L68",
+ "signature": "function readWorkspace(root: string, override?: string): WorkspaceV1 | null",
"exported": true,
"origin": "ast",
- "body_hash": "9c185f100ff537beef3b464e5c8969c84b257c9897a30596b210f5534c8173c7",
- "summary_state": "ready",
- "summary": "Defines the structure for writing MCP configuration results, indicating the operation performed on the configuration file.",
- "crux": {
- "code": "export interface McpWrite {\n id: string;\n path: string;\n action: 'created' | 'updated' | 'unchanged' | 'skipped-unparseable';\n}",
- "span": "L10-L14"
- }
+ "body_hash": "78512a46e95680674c28f70a745bfef8d99104f4c857fbac30c5792d1e2eb54c",
+ "summary_state": "pending",
+ "summary": null,
+ "crux": null
},
{
- "id": "src/hosts/mcp-config.ts#mergeJsonKey",
- "name": "mergeJsonKey",
- "kind": "function",
- "path": "src/hosts/mcp-config.ts",
- "span": "L23-L43",
- "signature": "function mergeJsonKey(id: string, path: string, topKey: string, entry: object): McpWrite",
- "exported": true,
- "origin": "ast",
- "body_hash": "e399dc21ae5ece8ec15889555e73360fb028691ac71f96255de36ae942b6707d",
- "summary_state": "ready",
- "summary": "Merges a JSON entry into a specified key of a JSON file, creating or updating the file as necessary.",
- "crux": {
- "code": "function mergeJsonKey(id: string, path: string, topKey: string, entry: object): McpWrite {\n let root: Record<string, any> = {};\n const existed = existsSync(path);\n if (existed) {\n try {\n root = JSON.parse(readFileSync(path, 'utf8'));\n } catch {\n return { id, path, action: 'skipped-unparseable' };\n }\n }\n const bucket = (root[topKey] ??= {});\n if (typeof bucket !== 'object' || bucket === null || Array.isArray(bucket)) {",
- "span": "L23-L34"
- }
- },
- {
- "id": "src/hosts/mcp-config.ts#registerMcpConfigs",
- "name": "registerMcpConfigs",
+ "id": "src/graph/workspace.ts#splitWorkspace",
+ "name": "splitWorkspace",
"kind": "function",
- "path": "src/hosts/mcp-config.ts",
- "span": "L56-L87",
- "signature": "function registerMcpConfigs( repo: string, ids: string[], opts: { home?: string } = {}, ): McpWrite[]",
+ "path": "src/graph/workspace.ts",
+ "span": "L457-L470",
+ "signature": "async function splitWorkspace( root: string, override: string | undefined, buildChild: (childDir: string, childName: string) => Promise<void>, onStart?: (info: { children: string[]; migrated: boolean }) => void, ): Promise<{ children: string[]; migrated: boolean }>",
"exported": true,
"origin": "ast",
- "body_hash": "13f7e325e26de9e426d475d1ff63fe06af411ca36b4d3c0fca7b2c2eb11fb45f",
- "summary_state": "ready",
- "summary": "Registers MCP configurations for multiple IDs, handling different file types and structures based on the ID.",
- "crux": {
- "code": "export function registerMcpConfigs(\n repo: string,\n ids: string[],\n opts: { home?: string } = {},\n): McpWrite[] {\n const home = opts.home ?? homedir();\n const out: McpWrite[] = [];\n for (const id of ids) {\n switch (id) {\n case 'cursor':\n out.push(mergeJsonKey(id, join(repo, '.cursor', 'mcp.json'), 'mcpServers', SERVER_ENTRY));\n break;",
- "span": "L56-L67"
- }
- },
- {
- "id": "src/hosts/mcp-config.ts#upsertCodexToml",
- "name": "upsertCodexToml",
- "kind": "function",
- "path": "src/hosts/mcp-config.ts",
- "span": "L45-L54",
- "signature": "function upsertCodexToml(id: string, path: string): McpWrite",
- "exported": false,
- "origin": "ast",
- "body_hash": "2dd6f4be2733f7bbd211b3ba2c6a8ceda215a135a9606a33fb7b1654ab320f9a",
- "summary_state": "ready",
- "summary": "Inserts or updates a section in a TOML configuration file for the codex, ensuring the section exists.",
- "crux": {
- "code": "function upsertCodexToml(id: string, path: string): McpWrite {\n const existed = existsSync(path);\n const text = existed ? readFileSync(path, 'utf8') : '';\n if (/^\\[mcp_servers\\.graft\\]$/m.test(text)) return { id, path, action: 'unchanged' };\n const section = `[mcp_servers.graft]\\ncommand = \"npx\"\\nargs = [\"-y\", \"@nanonets/graft\", \"mcp\"]\\n`;\n const sep = text.length === 0 ? '' : text.endsWith('\\n') ? '\\n' : '\\n\\n';\n mkdirSync(dirname(path), { recursive: true });\n writeFileSync(path, `${text}${sep}${section}`);\n return { id, path, action: existed ? 'updated' : 'created' };\n}",
- "span": "L45-L54"
- }
+ "body_hash": "007290df69b1efa3b7253cb55990676e696fdfc3b1cee88dc69a189755651a65",
+ "summary_state": "pending",
+ "summary": null,
+ "crux": null
},
{
- "id": "src/hosts/registry.ts",
- "name": "registry.ts",
- "kind": "file",
- "path": "src/hosts/registry.ts",
- "span": "L1-L89",
- "signature": null,
+ "id": "src/graph/workspace.ts#WorkspaceGraphs",
+ "name": "WorkspaceGraphs",
+ "kind": "interface",
+ "path": "src/graph/workspace.ts",
+ "span": "L120-L126",
+ "signature": "interface WorkspaceGraphs",
"exported": true,
"origin": "ast",
- "body_hash": "0a8a2b82f0e4e1010943eb69d2eee7d9c4549f884967d5af1b8317c38ef99c18",
- "chars": 2496,
+ "body_hash": "db2280242057b9a48c2d83510b2ccd0a55c065e4e3b5f6f493d5c1487654fe96",
"summary_state": "pending",
"summary": null,
"crux": null
},
{
- "id": "src/hosts/registry.ts#detectHosts",
- "name": "detectHosts",
+ "id": "src/graph/workspace.ts#workspacePath",
+ "name": "workspacePath",
"kind": "function",
- "path": "src/hosts/registry.ts",
- "span": "L86-L88",
- "signature": "function detectHosts(probe: DetectProbe): HostTarget[]",
+ "path": "src/graph/workspace.ts",
+ "span": "L53-L55",
+ "signature": "function workspacePath(root: string, override?: string): string",
"exported": true,
"origin": "ast",
- "body_hash": "3e698dbf2457932d7a8713477813adac3b143152cafeb164aef5daf4fce398e5",
- "summary_state": "ready",
- "summary": "Filters and returns host targets that are detected based on the provided probing information.",
- "crux": {
- "code": "export function detectHosts(probe: DetectProbe): HostTarget[] {\n return HOSTS.filter((h) => h.detect(probe));\n}",
- "span": "L86-L88"
- }
+ "body_hash": "c09f27e2379ad5fd35bd5f8566c4c1cbc05db431daa9fab6327515ffc2dca4b1",
+ "summary_state": "pending",
+ "summary": null,
+ "crux": null
},
{
- "id": "src/hosts/registry.ts#DetectProbe",
- "name": "DetectProbe",
+ "id": "src/graph/workspace.ts#WorkspaceV1",
+ "name": "WorkspaceV1",
"kind": "interface",
- "path": "src/hosts/registry.ts",
- "span": "L12-L16",
- "signature": "interface DetectProbe",
+ "path": "src/graph/workspace.ts",
+ "span": "L44-L48",
+ "signature": "interface WorkspaceV1",
"exported": true,
"origin": "ast",
- "body_hash": "b9f830f4861e96bdce7f7bf638175022642738bd7155f68167eb50a879f7a525",
- "summary_state": "ready",
- "summary": "Defines the structure for probing the existence of directories related to AI coding hosts.",
+ "body_hash": "89ff7a6fb5777575c9b525a0ca000b2835ed428e98e8ff02c0a5ff520c4c9cce",
+ "summary_state": "pending",
+ "summary": null,
"crux": null
},
{
- "id": "src/hosts/registry.ts#hostIds",
- "name": "hostIds",
+ "id": "src/graph/workspace.ts#writeWorkspace",
+ "name": "writeWorkspace",
"kind": "function",
- "path": "src/hosts/registry.ts",
- "span": "L82-L84",
- "signature": "function hostIds(): string[]",
- "exported": true,
- "origin": "ast",
- "body_hash": "4f4ec61bb5cdc94d5a40965c4bd6757b2e888811bb63fba7368f5f606d055ada",
- "summary_state": "ready",
- "summary": "Retrieves a list of identifiers for all defined host targets.",
- "crux": {
- "code": "export function hostIds(): string[] {\n return HOSTS.map((h) => h.id);\n}",
- "span": "L82-L84"
- }
- },
- {
- "id": "src/hosts/registry.ts#HostTarget",
- "name": "HostTarget",
- "kind": "interface",
- "path": "src/hosts/registry.ts",
- "span": "L18-L26",
- "signature": "interface HostTarget",
+ "path": "src/graph/workspace.ts",
+ "span": "L71-L78",
+ "signature": "function writeWorkspace(root: string, ws: WorkspaceV1, override?: string): string",
"exported": true,
"origin": "ast",
- "body_hash": "061c7862838ab4494e485220f52fea2202e0db5be2d2ff0e34d8e5fba4bb4b14",
- "summary_state": "ready",
- "summary": "Represents a target host with its identification, type, and detection logic for AI coding environments.",
+ "body_hash": "d9ddfb271875484ab5a85c86d62d8ad8867ef77eb45b5104fae9e1df2e7555e3",
+ "summary_state": "pending",
+ "summary": null,
"crux": null
},
{
- "id": "src/hosts/sections.ts",
- "name": "sections.ts",
+ "id": "src/graph/write.ts",
+ "name": "write.ts",
"kind": "file",
- "path": "src/hosts/sections.ts",
- "span": "L1-L68",
+ "path": "src/graph/write.ts",
+ "span": "L1-L70",
"signature": null,
"exported": true,
"origin": "ast",
- "body_hash": "f172618889d5a02683032df8c69dd85b71c00c72a8b76958305ade22d6cda714",
- "chars": 2879,
+ "body_hash": "a8f0d1b3efed9ca1ac3c22175c46c7a737b91bf632930ebb4437ebf52326ed69",
+ "chars": 2665,
"summary_state": "ready",
- "summary": "This file provides functionality to manage sections of text within files, specifically for inserting and updating content between defined markers.",
+ "summary": "This file manages the serialization and deserialization of a wiring graph, ensuring efficient storage and retrieval of graph data for further processing.",
"crux": {
- "code": "export function upsertSection(filePath: string, body: string): { action: UpsertAction } {\n if (!existsSync(filePath)) {\n const block = fencedBlock(body);\n mkdirSync(dirname(filePath), { recursive: true });\n writeFileSync(filePath, `${block}\\n`);\n return { action: 'created' };\n }\n const text = readFileSync(filePath, 'utf8');\n const eol = detectEol(text);\n // Split on either eol so lines never carry an embedded '\\r' — that keeps\n // the marker/content comparison clean and lets us rejoin deliberately with\n // the detected eol instead of relying on '\\r' characters riding along",
- "span": "L36-L47"
+ "code": "export function writeGraph(graph: GraphV1, outDir: string): string {\n const sorted: GraphV1 = {\n ...graph,\n nodes: [...graph.nodes].sort((a, b) => a.id.localeCompare(b.id)).map(stripBodyText),\n edges: [...graph.edges].sort(edgeOrder),\n };\n const path = wiringPath(outDir);\n mkdirSync(dirname(path), { recursive: true });\n writeFileSync(path, JSON.stringify(sorted, null, 2) + \"\\n\");\n return path;\n}",
+ "span": "L36-L46"
}
},
{
- "id": "src/hosts/sections.ts#detectEol",
- "name": "detectEol",
+ "id": "src/graph/write.ts#edgeOrder",
+ "name": "edgeOrder",
"kind": "function",
- "path": "src/hosts/sections.ts",
- "span": "L24-L26",
- "signature": "function detectEol(text: string): LineEnding",
+ "path": "src/graph/write.ts",
+ "span": "L63-L69",
+ "signature": "function edgeOrder(a: EdgeV1, b: EdgeV1): number",
"exported": false,
"origin": "ast",
- "body_hash": "902fbd2b08830cb32450b0a84ba8f76f1fd34d4fe8345b28fadba29a682c4b43",
+ "body_hash": "1c2665c44f094c37f510a0ca5befc63bf67ae59c52d77dfdcbe15611d2e5abbe",
"summary_state": "ready",
- "summary": "Determines the dominant line ending used in a given text, facilitating consistent handling of line breaks.",
+ "summary": "Defines the sorting order for edges in the wiring graph based on source, relation, and target.",
"crux": {
- "code": "function detectEol(text: string): LineEnding {\n return text.includes('\\r\\n') ? '\\r\\n' : '\\n';\n}",
- "span": "L24-L26"
+ "code": " a.source.localeCompare(b.source) ||\n a.relation.localeCompare(b.relation) ||\n a.target.localeCompare(b.target)",
+ "span": "L50-L52"
}
},
{
- "id": "src/hosts/sections.ts#fencedBlock",
- "name": "fencedBlock",
+ "id": "src/graph/write.ts#readGraph",
+ "name": "readGraph",
"kind": "function",
- "path": "src/hosts/sections.ts",
- "span": "L15-L21",
- "signature": "function fencedBlock(body: string, eol: LineEnding = '\\n'): string",
+ "path": "src/graph/write.ts",
+ "span": "L28-L34",
+ "signature": "function readGraph(path: string): GraphV1 | null",
"exported": true,
"origin": "ast",
- "body_hash": "cfc11a2e95b5d0866b455dfff3cd2e1f98f13e3dc5dad5fe47b8f624cb93b6bd",
+ "body_hash": "a68ca7cd48652a99a350b76c387a19462cc984c42bbc9b00a30e629af5fda52e",
"summary_state": "ready",
- "summary": "Creates a formatted block of text enclosed by specific markers, ensuring proper line endings and normalization of input.",
+ "summary": "Reads and parses an existing wiring graph from a file, returning null if the file is absent or unparseable.",
"crux": {
- "code": " const normalizedBody = body.replace(/\\r/g, '');\n const block = `${START}\\n${normalizedBody.replace(/\\s+$/, '')}\\n${END}`;\n return eol === '\\n' ? block : block.replace(/\\n/g, '\\r\\n');",
- "span": "L18-L20"
+ "code": " return JSON.parse(readFileSync(path, \"utf8\")) as GraphV1;\n } catch {\n return null;",
+ "span": "L30-L32"
}
},
{
- "id": "src/hosts/sections.ts#LineEnding",
- "name": "LineEnding",
- "kind": "type",
- "path": "src/hosts/sections.ts",
- "span": "L13-L13",
- "signature": "type LineEnding = '\\n' | '\\r\\n';",
- "exported": false,
- "origin": "ast",
- "body_hash": "e49b9a5218efdfb100f47552da255afff2e24a84ab10c02564adb1e72892a229",
- "summary_state": "ready",
- "summary": "Specifies the types of line endings that can be used in the text, ensuring compatibility with different operating systems.",
- "crux": null
- },
- {
- "id": "src/hosts/sections.ts#markerLineIndex",
- "name": "markerLineIndex",
+ "id": "src/graph/write.ts#stripBodyText",
+ "name": "stripBodyText",
"kind": "function",
- "path": "src/hosts/sections.ts",
- "span": "L29-L34",
- "signature": "function markerLineIndex(lines: string[], marker: string, from = 0): number",
+ "path": "src/graph/write.ts",
+ "span": "L57-L61",
+ "signature": "function stripBodyText(node: NodeV1): NodeV1",
"exported": false,
"origin": "ast",
- "body_hash": "b090a3b83b05f46da8f10b2c37a8f0a5c1522280f786fe4263f161294e0ffbd3",
+ "body_hash": "066abd2d7e9f13c6df67c4ba9100acdba5518e271bbc326536475e8610ae24cf",
"summary_state": "ready",
- "summary": "Finds the index of a specified marker in an array of lines, helping to locate the start and end of sections within the text.",
+ "summary": "Removes the body_text property from a node to reduce the size of the serialized graph, avoiding duplication of data already stored elsewhere.",
"crux": {
- "code": " for (let i = from; i < lines.length; i++) {\n if (lines[i].trim() === marker) return i;\n }\n return -1;",
- "span": "L30-L33"
+ "code": "function stripBodyText(node: NodeV1): NodeV1 {\n if (node.body_text === undefined) return node;\n const { body_text: _body_text, ...rest } = node;\n return rest as NodeV1;\n}",
+ "span": "L57-L61"
}
},
{
- "id": "src/hosts/sections.ts#UpsertAction",
- "name": "UpsertAction",
- "kind": "type",
- "path": "src/hosts/sections.ts",
- "span": "L11-L11",
- "signature": "type UpsertAction = 'created' | 'appended' | 'replaced' | 'unchanged';",
+ "id": "src/graph/write.ts#wiringPath",
+ "name": "wiringPath",
+ "kind": "function",
+ "path": "src/graph/write.ts",
+ "span": "L20-L22",
+ "signature": "function wiringPath(outDir: string): string",
"exported": true,
"origin": "ast",
- "body_hash": "53d24b330d60564589d8a07882c099e9fc964a43b0523536ea03cc430551452f",
+ "body_hash": "4a454f03e0aa7289fbc47e6493079ab7f8b353b6133b4362158857eda98bb544",
"summary_state": "ready",
- "summary": "Defines the possible outcomes of an upsert operation on a section, indicating whether it was created, appended, replaced, or unchanged.",
- "crux": null
+ "summary": "Generates the absolute path for the wiring graph file in a specified output directory.",
+ "crux": {
+ "code": " return join(outDir, GRAPH_DIR, GRAPH_FILE);",
+ "span": "L21-L21"
+ }
},
{
- "id": "src/hosts/sections.ts#upsertSection",
- "name": "upsertSection",
+ "id": "src/graph/write.ts#writeGraph",
+ "name": "writeGraph",
"kind": "function",
- "path": "src/hosts/sections.ts",
- "span": "L36-L67",
- "signature": "function upsertSection(filePath: string, body: string): { action: UpsertAction }",
+ "path": "src/graph/write.ts",
+ "span": "L36-L46",
+ "signature": "function writeGraph(graph: GraphV1, outDir: string): string",
"exported": true,
"origin": "ast",
- "body_hash": "552b5cf28b36f1e019f183739f266aa59b8af6bbf691056507639ce5633c2dd0",
+ "body_hash": "13647ca6eab5d041c45b3ef6efb6b851a3991c63742c94c88f4d05ecfc944354",
"summary_state": "ready",
- "summary": "Handles the logic for inserting or updating a section of text in a file, managing file creation, content comparison, and writing operations.",
+ "summary": "Writes a serialized and sorted representation of the graph to a JSON file, optimizing for size by stripping unnecessary data.",
"crux": {
- "code": "export function upsertSection(filePath: string, body: string): { action: UpsertAction } {\n if (!existsSync(filePath)) {\n const block = fencedBlock(body);\n mkdirSync(dirname(filePath), { recursive: true });\n writeFileSync(filePath, `${block}\\n`);\n return { action: 'created' };\n }\n const text = readFileSync(filePath, 'utf8');\n const eol = detectEol(text);\n // Split on either eol so lines never carry an embedded '\\r' — that keeps\n // the marker/content comparison clean and lets us rejoin deliberately with\n // the detected eol instead of relying on '\\r' characters riding along",
- "span": "L36-L47"
+ "code": "export function writeGraph(graph: GraphV1, outDir: string): string {\n const sorted: GraphV1 = {\n ...graph,\n nodes: [...graph.nodes].sort((a, b) => a.id.localeCompare(b.id)).map(stripBodyText),\n edges: [...graph.edges].sort(edgeOrder),\n };\n const path = wiringPath(outDir);\n mkdirSync(dirname(path), { recursive: true });\n writeFileSync(path, JSON.stringify(sorted, null, 2) + \"\\n\");\n return path;\n}",
+ "span": "L36-L46"
}
},
{
- "id": "src/index.ts",
- "name": "index.ts",
+ "id": "src/hosts/codex-hooks.ts",
+ "name": "codex-hooks.ts",
"kind": "file",
- "path": "src/index.ts",
- "span": "L1-L45",
+ "path": "src/hosts/codex-hooks.ts",
+ "span": "L1-L75",
"signature": null,
"exported": true,
"origin": "ast",
- "body_hash": "f66577d7952e061dd28f782e39f572fe9421a52758e9151f2620739894dd006d",
- "chars": 2061,
+ "body_hash": "0b9ba9ba677876d1adf4ce8d05aa534cddfbdeb7060ed11a92111a41a76d1512",
+ "chars": 3168,
"summary_state": "ready",
- "summary": "This module serves as the public API for the Graft library, facilitating the building and checking of a graph of linked markdown files.",
+ "summary": "Facilitates the installation and management of user-level hooks for CLI agents, ensuring that hooks are correctly written and updated in the hooks.json configuration file after file edits.",
"crux": {
- "code": " * await engine.init(\".\"); // writes .context/*.md + manifest.json\n *\n * const result = engine.check(\".\"); // { ok: boolean, ...drift }\n * if (!result.ok) process.exitCode = 1;",
- "span": "L12-L15"
+ "code": "export function installCodexHooks(home: string): HookWrite[] {\n const base = join(home, '.codex');\n if (!dirExists(base)) return [];\n\n const shimPath = join(base, 'hooks', 'graft', 'graft-hooks.cjs');\n const shimWrite = writeOwned('codex-hook-shim', shimPath, hooksShim(claudeDistDir()), 0o755);\n\n const cfgPath = join(base, 'hooks.json');\n let root: Record<string, any> = {};\n const existed = existsSync(cfgPath);\n if (existed) {\n try { root = JSON.parse(readFileSync(cfgPath, 'utf8')); } catch {",
+ "span": "L37-L48"
}
},
{
- "id": "src/ingest/fs.ts",
- "name": "fs.ts",
- "kind": "file",
- "path": "src/ingest/fs.ts",
- "span": "L1-L46",
- "signature": null,
- "exported": true,
- "origin": "ast",
- "body_hash": "a8339532da34b44d35eb9ad16e7106adb1262d73d9895b1bd94574337fb2019f",
- "chars": 1218,
- "summary_state": "ready",
- "summary": "This file provides utilities for walking through a filesystem to identify source files while excluding certain directories and large files.",
- "crux": null
- },
- {
- "id": "src/ingest/fs.ts#walkDir",
- "name": "walkDir",
+ "id": "src/hosts/codex-hooks.ts#dirExists",
+ "name": "dirExists",
"kind": "function",
- "path": "src/ingest/fs.ts",
- "span": "L27-L45",
- "signature": "function walkDir(dir: string): string[]",
- "exported": true,
+ "path": "src/hosts/codex-hooks.ts",
+ "span": "L17-L19",
+ "signature": "function dirExists(p: string): boolean",
+ "exported": false,
"origin": "ast",
- "body_hash": "001f6c9f648af0620ed90c55a132464ab87da3ad74b6711df716e9f9493333c4",
+ "body_hash": "3cb56ff33de328b88ab53b8b869149394e3f46919184cc3d9c7bebed9fb4dcc7",
"summary_state": "ready",
- "summary": "The walkDir function recursively collects paths of files in a directory while skipping specified directories and files larger than 1 MB.",
+ "summary": "Checks if a given directory path exists, returning a boolean value to indicate its existence.",
"crux": {
- "code": " if (entry.name.startsWith(\".\")) continue;\n const full = join(dir, entry.name);\n if (entry.isDirectory()) {\n if (SKIP_DIRS.has(entry.name)) continue;\n out.push(...walkDir(full));\n } else if (entry.isFile()) {\n try {\n if (statSync(full).size > MAX_FILE_BYTES) continue;\n } catch {\n continue;\n }\n out.push(full);",
- "span": "L30-L41"
+ "code": " try { return statSync(p).isDirectory(); } catch { return false; }\n}",
+ "span": "L18-L19"
}
},
{
- "id": "src/mcp/server.ts",
- "name": "server.ts",
- "kind": "file",
- "path": "src/mcp/server.ts",
- "span": "L1-L67",
- "signature": null,
+ "id": "src/hosts/codex-hooks.ts#HookWrite",
+ "name": "HookWrite",
+ "kind": "interface",
+ "path": "src/hosts/codex-hooks.ts",
+ "span": "L11-L15",
+ "signature": "interface HookWrite",
"exported": true,
"origin": "ast",
- "body_hash": "0bdeba850ab62132a01b683cd2db7ee36a7509a67ebd58e73887a22a611ce100",
- "chars": 2258,
+ "body_hash": "87f37fccd34dabd662b284ad06e364c60173827b1eef5170714b232943a22693",
"summary_state": "ready",
- "summary": "Defines a minimal JSON-RPC 2.0 server for handling protocol messages and tool calls.",
- "crux": {
- "code": "export function startMcpServer(root: string, dirOverride?: string): void {\n const rl = createInterface({ input: process.stdin, crlfDelay: Infinity });\n rl.on('line', (line) => {\n const text = line.trim();\n if (!text) return;\n let msg: { id?: unknown; method?: string; params?: Record<string, any> };\n try {\n msg = JSON.parse(text);\n } catch {\n replyError(null, -32700, 'parse error');\n return;\n }",
- "span": "L20-L31"
- }
+ "summary": "Defines the structure for hook write operations, encapsulating the ID, path, and action taken during the write process.",
+ "crux": null
},
{
- "id": "src/mcp/server.ts#reply",
- "name": "reply",
+ "id": "src/hosts/codex-hooks.ts#installCodexHooks",
+ "name": "installCodexHooks",
"kind": "function",
- "path": "src/mcp/server.ts",
- "span": "L12-L14",
- "signature": "function reply(id: unknown, result: object): void",
- "exported": false,
+ "path": "src/hosts/codex-hooks.ts",
+ "span": "L37-L74",
+ "signature": "function installCodexHooks(home: string): HookWrite[]",
+ "exported": true,
"origin": "ast",
- "body_hash": "ebf863d2db4e0898846deff35e6a0d581dae06f6e402592309f8c6742a3abe59",
+ "body_hash": "ed7ea45d024b73cc41550f0b5f3edcebc2555fbc1db0aba5437ded0b2c869d52",
"summary_state": "ready",
- "summary": "Constructs and sends a successful JSON-RPC response message.",
+ "summary": "Installs codex hooks by writing a shim and updating the hooks configuration based on the provided home directory.",
"crux": {
- "code": "function reply(id: unknown, result: object): void {\n send({ jsonrpc: '2.0', id, result });\n}",
- "span": "L12-L14"
+ "code": " const shimPath = join(base, 'hooks', 'graft', 'graft-hooks.cjs');\n const shimWrite = writeOwned('codex-hook-shim', shimPath, hooksShim(claudeDistDir()), 0o755);\n\n const cfgPath = join(base, 'hooks.json');\n let root: Record<string, any> = {};\n const existed = existsSync(cfgPath);\n if (existed) {\n try { root = JSON.parse(readFileSync(cfgPath, 'utf8')); } catch {\n return [shimWrite, { id: 'codex-hooks', path: cfgPath, action: 'skipped-unparseable' }];\n }\n }\n if (typeof root !== 'object' || root === null || Array.isArray(root)) {",
+ "span": "L41-L52"
}
},
{
- "id": "src/mcp/server.ts#replyError",
- "name": "replyError",
+ "id": "src/hosts/codex-hooks.ts#isGraftEntry",
+ "name": "isGraftEntry",
"kind": "function",
- "path": "src/mcp/server.ts",
- "span": "L16-L18",
- "signature": "function replyError(id: unknown, code: number, message: string): void",
+ "path": "src/hosts/codex-hooks.ts",
+ "span": "L33-L35",
+ "signature": "function isGraftEntry(entry: unknown): boolean",
"exported": false,
"origin": "ast",
- "body_hash": "540611464bba68e3e678870e748cde38aa6790c52ca10dfda8f891dcf0d59717",
+ "body_hash": "628b0f417080f2b63d9928d37116e818fc0d2c50c5d1319fdf1cb4ec7ef6e9f3",
"summary_state": "ready",
- "summary": "Constructs and sends a JSON-RPC error response message.",
+ "summary": "Determines if a given entry is a graft entry by checking for a specific string in its JSON representation.",
"crux": {
- "code": "function replyError(id: unknown, code: number, message: string): void {\n send({ jsonrpc: '2.0', id, error: { code, message } });\n}",
- "span": "L16-L18"
+ "code": " return JSON.stringify(entry).includes('graft-hooks.cjs');\n}",
+ "span": "L34-L35"
}
},
{
- "id": "src/mcp/server.ts#send",
- "name": "send",
+ "id": "src/hosts/codex-hooks.ts#writeOwned",
+ "name": "writeOwned",
"kind": "function",
- "path": "src/mcp/server.ts",
- "span": "L8-L10",
- "signature": "function send(msg: object): void",
+ "path": "src/hosts/codex-hooks.ts",
+ "span": "L21-L31",
+ "signature": "function writeOwned(id: string, path: string, content: string, mode?: number): HookWrite",
"exported": false,
"origin": "ast",
- "body_hash": "7446435a2fc268ad8d76124c2e66f957d5de51730babfc38d8cb4dff5fc80c58",
+ "body_hash": "0e2c5fcb677016e7114466756f114b05de75fd91cca3829607c528461e02edb1",
"summary_state": "ready",
- "summary": "Sends a JSON-RPC message to the standard output stream.",
+ "summary": "Handles the creation or updating of a file with specific content and permissions, returning the action taken.",
"crux": {
- "code": "function send(msg: object): void {\n process.stdout.write(`${JSON.stringify(msg)}\\n`);\n}",
- "span": "L8-L10"
+ "code": " const existed = existsSync(path);\n if (existed && readFileSync(path, 'utf8') === content) {\n if (mode !== undefined && (statSync(path).mode & 0o777) !== mode) chmodSync(path, mode);\n return { id, path, action: 'unchanged' };\n }\n mkdirSync(dirname(path), { recursive: true });\n writeFileSync(path, content);\n if (mode !== undefined) chmodSync(path, mode);\n return { id, path, action: existed ? 'updated' : 'created' };",
+ "span": "L22-L30"
}
},
{
- "id": "src/mcp/server.ts#startMcpServer",
- "name": "startMcpServer",
- "kind": "function",
- "path": "src/mcp/server.ts",
- "span": "L20-L66",
- "signature": "function startMcpServer(root: string, dirOverride?: string): void",
+ "id": "src/hosts/init.ts",
+ "name": "init.ts",
+ "kind": "file",
+ "path": "src/hosts/init.ts",
+ "span": "L1-L73",
+ "signature": null,
"exported": true,
"origin": "ast",
- "body_hash": "bbf674f912399a59d133f52a0d975069c215acfb0cc62b5f6ffc3d15ef92acbd",
+ "body_hash": "cd3ef307f207a48b82fa81ea55e34fdc97b8663612ad639a3256336d5531afa0",
+ "chars": 2627,
"summary_state": "ready",
- "summary": "Initializes the server to listen for incoming JSON-RPC messages and handle them appropriately.",
+ "summary": "Initializes host configurations by writing instruction files based on selected hosts, ensuring that the correct files are created or updated as needed.",
"crux": {
- "code": "export function startMcpServer(root: string, dirOverride?: string): void {\n const rl = createInterface({ input: process.stdin, crlfDelay: Infinity });\n rl.on('line', (line) => {\n const text = line.trim();\n if (!text) return;\n let msg: { id?: unknown; method?: string; params?: Record<string, any> };\n try {\n msg = JSON.parse(text);\n } catch {\n replyError(null, -32700, 'parse error');\n return;\n }",
- "span": "L20-L31"
+ "code": "export function runHostsInit(\n repo: string,\n opts: { agents?: string[]; all?: boolean; home?: string; mcp?: boolean; hooks?: boolean } = {},\n): HostsInitResult {\n const home = opts.home ?? homedir();\n const probe = probeFor(home, repo);\n\n let selected: HostTarget[];\n let unknown: string[] = [];\n if (opts.agents !== undefined) {\n const byId = new Map(HOSTS.map((h) => [h.id, h]));\n selected = opts.agents.flatMap((id) => byId.get(id) ?? []);",
+ "span": "L37-L48"
}
},
{
- "id": "src/mcp/tools.ts",
- "name": "tools.ts",
- "kind": "file",
- "path": "src/mcp/tools.ts",
- "span": "L1-L221",
- "signature": null,
+ "id": "src/hosts/init.ts#HostsInitResult",
+ "name": "HostsInitResult",
+ "kind": "interface",
+ "path": "src/hosts/init.ts",
+ "span": "L14-L20",
+ "signature": "interface HostsInitResult",
"exported": true,
"origin": "ast",
- "body_hash": "c481205e1888764a7f6bba2bd2f8180aad34a26b76b770fa9eb98922095f8f37",
- "chars": 10020,
- "summary_state": "pending",
- "summary": null,
+ "body_hash": "c643482048fe39520f2fc0aaee0c8761e9f13ed7f7bf5fcfc8ef404cd2f0e98f",
+ "summary_state": "ready",
+ "summary": "Defines the structure of the result returned by the host initialization process, capturing written, skipped, and unknown hosts along with MCP and hooks data.",
"crux": null
},
{
- "id": "src/mcp/tools.ts#callTool",
- "name": "callTool",
- "kind": "function",
- "path": "src/mcp/tools.ts",
- "span": "L138-L220",
- "signature": "function callTool( root: string, name: string, args: Record<string, unknown>, dirOverride?: string, ): { text: string; isError: boolean }",
- "exported": true,
- "origin": "ast",
- "body_hash": "2b07af42cf0890c11f542f61ab35d633d359cd356837ac762eacef33eaebd660",
- "summary_state": "stale",
- "summary": "Handles the invocation of various tools based on user input, managing errors and returning formatted results for different graph operations.",
- "crux": {
- "code": "export function callTool(\n root: string,\n name: string,\n args: Record<string, unknown>,\n dirOverride?: string,\n): { text: string; isError: boolean } {\n try {\n switch (name) {\n case 'graft_ask': {\n const query = String(args.query ?? '');\n if (!query) return { text: 'graft_ask requires a query', isError: true };\n const limit = typeof args.limit === 'number' ? args.limit : 5;",
- "span": "L149-L160"
- }
- },
- {
- "id": "src/mcp/tools.ts#renderMatches",
- "name": "renderMatches",
+ "id": "src/hosts/init.ts#probeFor",
+ "name": "probeFor",
"kind": "function",
- "path": "src/mcp/tools.ts",
- "span": "L121-L136",
- "signature": "function renderMatches( direction: Direction, showDepth: boolean, matches: NodeV1[], hitsFor: (n: NodeV1) => EdgeHit[], ): string",
+ "path": "src/hosts/init.ts",
+ "span": "L22-L27",
+ "signature": "function probeFor(home: string, repo: string): DetectProbe",
"exported": false,
"origin": "ast",
- "body_hash": "7059bf338ce7e9e88b1ab4bfc452b62fb489c56239322352f8c07b2b2bb42ebc",
- "summary_state": "stale",
- "summary": "Formats and renders the results of graph traversal matches, providing a structured output for users to understand symbol relationships.",
+ "body_hash": "7653739002fda057d1517f18bfe77dfb0dcf78ab6cb9716ceb7624601eec1f7f",
+ "summary_state": "ready",
+ "summary": "Creates a probe object to check for the existence of directories in a specified repository, facilitating host detection.",
"crux": {
- "code": "function renderMatches(kind: TraverseKind, matches: NodeV1[], hitsFor: (n: NodeV1) => EdgeHit[]): string {\n return matches\n .map((m) => {\n const hits = hitsFor(m);\n const lines = [headerOf(m)];\n if (hits.length === 0) lines.push(looseNoteFor(kind, m.name));\n else for (const h of hits) lines.push(hitLine(kind, h));\n return lines.join('\\n');\n })\n .join('\\n\\n');\n}",
- "span": "L137-L147"
+ "code": " home, repo,\n dirExists: (p) => { try { return statSync(p).isDirectory(); } catch { return false; } },\n };",
+ "span": "L24-L26"
}
},
{
- "id": "src/mcp/tools.ts#ToolDef",
- "name": "ToolDef",
- "kind": "interface",
- "path": "src/mcp/tools.ts",
- "span": "L19-L23",
- "signature": "interface ToolDef",
+ "id": "src/hosts/init.ts#runHostsInit",
+ "name": "runHostsInit",
+ "kind": "function",
+ "path": "src/hosts/init.ts",
+ "span": "L37-L72",
+ "signature": "function runHostsInit( repo: string, opts: { agents?: string[]; all?: boolean; home?: string; mcp?: boolean; hooks?: boolean } = {}, ): HostsInitResult",
"exported": true,
"origin": "ast",
- "body_hash": "66213a2ab8c0b58ddbf6e632f4ac26e643f00ff02eef696f9b321c2236b45365",
+ "body_hash": "8b9a15d05dcd9a43c414b8c27e34f565538950d578ed452568d9c61f08bb9dbd",
"summary_state": "ready",
- "summary": "Defines the structure for tool definitions used in the MCP tools, ensuring consistent input schema and metadata for each tool.",
+ "summary": "Initializes hosts by selecting them based on provided options and writing their instruction files, while also handling MCP configurations and hooks.",
"crux": {
- "code": "export interface ToolDef {\n name: string;\n description: string;\n inputSchema: object;\n}",
- "span": "L18-L22"
+ "code": " const path = join(repo, host.relPath);\n const action =\n host.kind === 'owned'\n ? writeOwned(path, host.content())\n : upsertSection(path, host.content()).action;\n written.push({ id: host.id, path, action });\n }\n const skipped = HOSTS.filter((h) => !selected.includes(h)).map((h) => h.id);\n const mcp = opts.mcp === false ? [] : registerMcpConfigs(repo, selected.map((h) => h.id), { home });\n const hooks =\n opts.hooks === false || !selected.some((h) => h.id === 'agents')\n ? []",
+ "span": "L58-L69"
}
},
{
- "id": "src/mcp/tools.ts#unknownSymbolText",
- "name": "unknownSymbolText",
+ "id": "src/hosts/init.ts#writeOwned",
+ "name": "writeOwned",
"kind": "function",
- "path": "src/mcp/tools.ts",
- "span": "L27-L29",
- "signature": "function unknownSymbolText(query: string): string",
+ "path": "src/hosts/init.ts",
+ "span": "L29-L35",
+ "signature": "function writeOwned(path: string, content: string): string",
"exported": false,
"origin": "ast",
- "body_hash": "ea43b6a930c9fe3d67aa2e40b6d1d7dc2ebdb0e55a23c1f42047c0089bc2917e",
+ "body_hash": "f25633ece4c0cfb7a956003dd26ad8e1b095e7955d13d796c24ac389d75a4f09",
"summary_state": "ready",
- "summary": "Generates an error message for an unknown symbol query, guiding users to check their input or build the graph.",
+ "summary": "Writes content to a specified path, creating or replacing the file as necessary, and returns the action taken.",
"crux": {
- "code": "function unknownSymbolText(query: string): string {\n return `no symbol \"${query}\" in the graph — check spelling or run \\`graft build\\``;\n}",
- "span": "L29-L31"
+ "code": " if (existsSync(path) && readFileSync(path, 'utf8') === content) return 'unchanged';\n mkdirSync(dirname(path), { recursive: true });\n const existed = existsSync(path);\n writeFileSync(path, content);\n return existed ? 'replaced' : 'created';",
+ "span": "L30-L34"
}
},
{
- "id": "src/search/grep-cli.ts",
- "name": "grep-cli.ts",
+ "id": "src/hosts/instructions.ts",
+ "name": "instructions.ts",
"kind": "file",
- "path": "src/search/grep-cli.ts",
- "span": "L1-L116",
+ "path": "src/hosts/instructions.ts",
+ "span": "L1-L69",
"signature": null,
"exported": true,
"origin": "ast",
- "body_hash": "64dc983c11be49dc755c21f1eb6420adb1ef016077d5e3cc3fe7d5ad82baee78",
- "chars": 4921,
+ "body_hash": "b23c5baa1a99cc31c37f126df518c725d1d6c815020ec89cafe7b88b9842acb0",
+ "chars": 2874,
"summary_state": "stale",
- "summary": "This file provides the command-line interface for the grep functionality, formatting results for user-friendly output.",
- "crux": {
- "code": "export function formatGrepResult(result: GrepResult): string {\n const blocks = [formatGrepHeader(result), \"\", ...result.groups.map((g) => formatGroup(g) + \"\\n\")];\n let out = blocks.join(\"\\n\").replace(/\\n+$/, \"\\n\");\n const note = truncationNote(result);\n if (note) out += note + \"\\n\";\n return out;\n}",
- "span": "L53-L59"
- }
+ "summary": "This file provides Graft instructions for navigating and utilizing the context graph effectively.",
+ "crux": null
},
{
- "id": "src/search/grep-cli.ts#formatGrepHeader",
- "name": "formatGrepHeader",
+ "id": "src/hosts/instructions.ts#cursorRule",
+ "name": "cursorRule",
"kind": "function",
- "path": "src/search/grep-cli.ts",
- "span": "L37-L40",
- "signature": "function formatGrepHeader(result: GrepResult): string",
+ "path": "src/hosts/instructions.ts",
+ "span": "L48-L55",
+ "signature": "function cursorRule(): string",
"exported": true,
"origin": "ast",
- "body_hash": "eb6324d18b820f95e0423005738f3a8ec5da095849e5934e82ca512c75f1e4f4",
+ "body_hash": "697397dc5e04836b10f9f9b6c4dfb5df6d95c5f89317ce9a77bb838a7e71e929",
"summary_state": "ready",
- "summary": "Creates a header for the grep results, summarizing the total hits and files searched.",
+ "summary": "Defines a rule to always apply the Graft context graph before exploring source code.",
"crux": {
- "code": "export function formatGrepHeader(result: GrepResult): string {\n const filesHit = new Set(result.groups.map((g) => g.path)).size;\n return `\"${result.pattern}\" — ${result.totalHits} hits in ${result.groups.length} symbols across ${filesHit} files (searched ${result.filesSearched} indexed files)`;\n}",
- "span": "L36-L39"
+ "code": "export function cursorRule(): string {\n return `---\ndescription: Use the Graft context graph in graft/ before exploring source\nalwaysApply: true\n---\n${instructionBody()}",
+ "span": "L44-L49"
}
},
{
- "id": "src/search/grep-cli.ts#formatGrepResult",
- "name": "formatGrepResult",
+ "id": "src/hosts/instructions.ts#instructionBody",
+ "name": "instructionBody",
"kind": "function",
- "path": "src/search/grep-cli.ts",
- "span": "L54-L62",
- "signature": "function formatGrepResult(result: GrepResult): string",
+ "path": "src/hosts/instructions.ts",
+ "span": "L6-L46",
+ "signature": "function instructionBody(): string",
"exported": true,
"origin": "ast",
- "body_hash": "f8a8198261b13ec5667805d4024024a19adf344fb6a4af500e19bf884e7c6b44",
+ "body_hash": "1cdbe5890911cefd6a73c00da582ed94105b4da0facb3a45de53d5d5e79e2afd",
"summary_state": "stale",
- "summary": "Compiles the full human-readable report of grep results, including headers and formatted groups.",
+ "summary": "Generates the main instructional content for using the Graft context graph.",
"crux": {
- "code": "export function formatGrepResult(result: GrepResult): string {\n const blocks = [formatGrepHeader(result), \"\", ...result.groups.map((g) => formatGroup(g) + \"\\n\")];\n let out = blocks.join(\"\\n\").replace(/\\n+$/, \"\\n\");\n const note = truncationNote(result);\n if (note) out += note + \"\\n\";\n return out;\n}",
- "span": "L53-L59"
+ "code": "export function instructionBody(): string {\n return `## Graft — repo context graph\n\nThis repo is indexed in \\`graft/\\`: small linked markdown nodes that explain each\nsystem and carry exact file:line spans, kept in sync with the code through git.\n\nFor ANY task here — understanding how something works, finding where code lives,\nor scoping a change — get context from the graph before grepping or opening\nsource files. Re-ask freely (it's cheap) and reuse literal identifiers you\nalready have (symbol, error string, file name) as the query. New to this repo?\nRun \\`graft map\\` first — a token-budgeted orientation (dir clusters, hubs,\nhotspots), no LLM, no key.",
+ "span": "L6-L17"
}
},
{
- "id": "src/search/grep-cli.ts#formatGroup",
- "name": "formatGroup",
+ "id": "src/hosts/instructions.ts#kiroSteering",
+ "name": "kiroSteering",
"kind": "function",
- "path": "src/search/grep-cli.ts",
- "span": "L30-L34",
- "signature": "function formatGroup(g: GrepGroup): string",
- "exported": false,
+ "path": "src/hosts/instructions.ts",
+ "span": "L57-L63",
+ "signature": "function kiroSteering(): string",
+ "exported": true,
"origin": "ast",
- "body_hash": "c6901df49ecdcf11c258a32a5e8acf90c887eee405673b9877f0d241ddd7d24d",
+ "body_hash": "a3fea9a2ad9ee6488338f60825284e55bc5cd09cee354e9554efb2d90e2be20f",
"summary_state": "ready",
- "summary": "Formats a group of grep results into a human-readable string, including hit lines.",
+ "summary": "Specifies a rule for always including the Graft context graph in the workflow.",
"crux": {
- "code": "function formatGroup(g: GrepGroup): string {\n const lines = [groupHeader(g)];\n for (const h of g.hits) lines.push(` L${h.line}: ${h.text}`);\n return lines.join(\"\\n\");\n}",
- "span": "L29-L33"
+ "code": "export function kiroSteering(): string {\n return `---\ninclusion: always\n---\n${instructionBody()}",
+ "span": "L53-L57"
}
},
{
- "id": "src/search/grep-cli.ts#GrepCliOptions",
- "name": "GrepCliOptions",
- "kind": "interface",
- "path": "src/search/grep-cli.ts",
- "span": "L16-L23",
- "signature": "interface GrepCliOptions",
- "exported": true,
- "origin": "ast",
- "body_hash": "45fbe9e85b94fe0054f047d74a5888cadb3c80836e3f9be8fe9e3074f3efdc5a",
- "summary_state": "ready",
- "summary": "Defines options for the grep command-line interface, allowing customization of search behavior.",
- "crux": null
- },
- {
- "id": "src/search/grep-cli.ts#groupHeader",
- "name": "groupHeader",
+ "id": "src/hosts/instructions.ts#windsurfRule",
+ "name": "windsurfRule",
"kind": "function",
- "path": "src/search/grep-cli.ts",
- "span": "L25-L28",
- "signature": "function groupHeader(g: GrepGroup): string",
- "exported": false,
+ "path": "src/hosts/instructions.ts",
+ "span": "L65-L68",
+ "signature": "function windsurfRule(): string",
+ "exported": true,
"origin": "ast",
- "body_hash": "49c6bc64382bd6a38a856a25d53b4f14ce0cb771fe4e9a34acfb07a6a2a85d46",
+ "body_hash": "a30d7b9ed58bdcfc402576d4a79e3643691145a92c521402e594243533cb4aed",
"summary_state": "ready",
- "summary": "Generates a header string for a group of grep results, summarizing the group's metadata.",
+ "summary": "Provides a rule that incorporates the Graft context graph into its logic.",
"crux": {
- "code": "function groupHeader(g: GrepGroup): string {\n if (g.symbol) return `${g.symbol.name} · ${g.symbol.kind} · ${g.symbol.path}:${g.symbol.span} · ${g.inDegree} in-edges`;\n return `${g.path} (module level) · ${g.inDegree} in-edges`;\n}",
- "span": "L24-L27"
+ "code": "export function windsurfRule(): string {\n return `${instructionBody()}",
+ "span": "L61-L62"
}
},
{
- "id": "src/search/grep-cli.ts#runGrepCommand",
- "name": "runGrepCommand",
- "kind": "function",
- "path": "src/search/grep-cli.ts",
- "span": "L86-L115",
- "signature": "function runGrepCommand(pattern: string, dir: string, opts: GrepCliOptions): void",
+ "id": "src/hosts/mcp-config.ts",
+ "name": "mcp-config.ts",
+ "kind": "file",
+ "path": "src/hosts/mcp-config.ts",
+ "span": "L1-L88",
+ "signature": null,
"exported": true,
"origin": "ast",
- "body_hash": "3161968bd9ae55839fa14ad57a480382b2251ce81b5efd31822247079b3759bc",
- "summary_state": "ready",
- "summary": "Executes the grep command, handling graph resolution, pattern searching, and output formatting.",
+ "body_hash": "a449aa6fea8dc1b842e565d9c60fb61e46343effe69c1064a758c31d30cd5329",
+ "chars": 3352,
+ "summary_state": "stale",
+ "summary": "Facilitates the registration and configuration of multiple MCP servers in specified host configurations, ensuring proper JSON and TOML formatting.",
"crux": {
- "code": "export function runGrepCommand(pattern: string, dir: string, opts: GrepCliOptions): void {\n const root = resolve(dir);\n const contextDir = contextDirFor(root, opts.globalDir);\n const graph = loadGraphCached(contextDir);\n if (!graph) {\n console.error(\"✗ no graph — run graft build first\");\n process.exit(1);\n }\n\n let result: GrepResult;\n try {\n result = grepGraph(graph, root, pattern, { ignoreCase: opts.ignoreCase, fixed: opts.fixed, in: opts.in });",
- "span": "L83-L94"
+ "code": "export function registerMcpConfigs(\n repo: string,\n ids: string[],\n opts: { home?: string } = {},\n): McpWrite[] {\n const home = opts.home ?? homedir();\n const out: McpWrite[] = [];\n for (const id of ids) {\n switch (id) {\n case 'cursor':\n out.push(mergeJsonKey(id, join(repo, '.cursor', 'mcp.json'), 'mcpServers', SERVER_ENTRY));\n break;",
+ "span": "L56-L67"
}
},
{
- "id": "src/search/grep-cli.ts#truncationNote",
- "name": "truncationNote",
+ "id": "src/hosts/mcp-config.ts#dirExists",
+ "name": "dirExists",
"kind": "function",
- "path": "src/search/grep-cli.ts",
- "span": "L43-L50",
- "signature": "function truncationNote(result: GrepResult): string | null",
+ "path": "src/hosts/mcp-config.ts",
+ "span": "L19-L21",
+ "signature": "function dirExists(p: string): boolean",
"exported": false,
"origin": "ast",
- "body_hash": "9cbadb17b0273dea383d0ef0676d8477d369fc7a2231c5b379039c3a96b46517",
+ "body_hash": "3cb56ff33de328b88ab53b8b869149394e3f46919184cc3d9c7bebed9fb4dcc7",
"summary_state": "ready",
- "summary": "Generates a note about any truncation in the grep results, indicating unreadable files or additional hits beyond the cap.",
+ "summary": "Checks if a given directory path exists, returning a boolean value.",
"crux": {
- "code": "function truncationNote(result: GrepResult): string | null {\n const { files, hits } = result.truncated;\n if (files === 0 && hits === 0) return null;\n const parts: string[] = [];\n if (hits > 0) parts.push(`${hits} more hit${hits === 1 ? \"\" : \"s\"} beyond the cap`);\n if (files > 0) parts.push(`${files} indexed file${files === 1 ? \"\" : \"s\"} unreadable`);\n return `(truncated: ${parts.join(\", \")} — narrow with --in or refine the pattern)`;\n}",
- "span": "L42-L49"
+ "code": "function dirExists(p: string): boolean {\n try { return statSync(p).isDirectory(); } catch { return false; }\n}",
+ "span": "L19-L21"
}
},
{
- "id": "src/search/grep-cli.ts#zeroHitNote",
- "name": "zeroHitNote",
- "kind": "function",
- "path": "src/search/grep-cli.ts",
- "span": "L72-L77",
- "signature": "function zeroHitNote(result: GrepResult): string",
+ "id": "src/hosts/mcp-config.ts#McpWrite",
+ "name": "McpWrite",
+ "kind": "interface",
+ "path": "src/hosts/mcp-config.ts",
+ "span": "L10-L14",
+ "signature": "interface McpWrite",
"exported": true,
"origin": "ast",
- "body_hash": "358cfca22f9a047a4df8b6e452ca54936ac672908468fba2a3dddd7017505cce",
+ "body_hash": "9c185f100ff537beef3b464e5c8969c84b257c9897a30596b210f5534c8173c7",
"summary_state": "ready",
- "summary": "Provides a detailed message for zero-hit results, explaining the absence of matches and potential issues.",
- "crux": {
- "code": "export function zeroHitNote(result: GrepResult): string {\n const base = `no hits for \"${result.pattern}\" in ${result.filesSearched} indexed files — unindexed files (docs, configs, new files) aren't searched; try grep -rn \"${result.pattern}\" for those`;\n const { files } = result.truncated;\n if (files === 0) return base;\n return `${base} — note: ${files} indexed file${files === 1 ? \"\" : \"s\"} could not be read (stale graph? run graft build)`;\n}",
- "span": "L69-L74"
- }
- },
- {
- "id": "src/search/grep.ts",
- "name": "grep.ts",
- "kind": "file",
- "path": "src/search/grep.ts",
- "span": "L1-L201",
- "signature": null,
- "exported": true,
- "origin": "ast",
- "body_hash": "f3405967f0d2e4aba158b720188369dbe913c6c12955aa1511cabed498fddaf9",
- "chars": 6816,
- "summary_state": "stale",
- "summary": "This file implements a regex search over indexed files in a graph, grouping results by their enclosing symbols and ranking them by their importance based on incoming edges.",
+ "summary": "Defines the structure for writing MCP configuration results, indicating the operation performed on the configuration file.",
"crux": {
- "code": " * `graft grep` core: regex search over the graph's indexed files, with hits\n * grouped by their innermost enclosing symbol and ranked by incoming-edge\n * count (coupling) — a grep that answers \"which of these hits matters\",\n * because plain `grep -rn` gives no way to tell a hit inside a\n * heavily-depended-on function from one inside dead code.",
- "span": "L2-L6"
+ "code": "export interface McpWrite {\n id: string;\n path: string;\n action: 'created' | 'updated' | 'unchanged' | 'skipped-unparseable';\n}",
+ "span": "L10-L14"
}
},
{
- "id": "src/search/grep.ts#computeInDegree",
- "name": "computeInDegree",
+ "id": "src/hosts/mcp-config.ts#mergeJsonKey",
+ "name": "mergeJsonKey",
"kind": "function",
- "path": "src/search/grep.ts",
- "span": "L123-L130",
- "signature": "function computeInDegree(graph: GraphV1): Map<string, number>",
- "exported": false,
+ "path": "src/hosts/mcp-config.ts",
+ "span": "L23-L43",
+ "signature": "function mergeJsonKey(id: string, path: string, topKey: string, entry: object): McpWrite",
+ "exported": true,
"origin": "ast",
- "body_hash": "614d2e67e179ee5a934d6c1b03134ca1e1c394d3036a1754bd41dd7ee8dcc1b7",
+ "body_hash": "e399dc21ae5ece8ec15889555e73360fb028691ac71f96255de36ae942b6707d",
"summary_state": "ready",
- "summary": "Calculates the incoming edge count for each symbol in the graph, which is used to rank grep hits by importance.",
+ "summary": "Merges a JSON entry into a specified key of a JSON file, creating or updating the file as necessary.",
"crux": {
- "code": "function computeInDegree(graph: GraphV1): Map<string, number> {\n const deg = new Map<string, number>();\n for (const e of graph.edges) {\n if (!WALK_RELATIONS.has(e.relation)) continue;\n deg.set(e.target, (deg.get(e.target) ?? 0) + 1);\n }\n return deg;\n}",
- "span": "L119-L126"
+ "code": "function mergeJsonKey(id: string, path: string, topKey: string, entry: object): McpWrite {\n let root: Record<string, any> = {};\n const existed = existsSync(path);\n if (existed) {\n try {\n root = JSON.parse(readFileSync(path, 'utf8'));\n } catch {\n return { id, path, action: 'skipped-unparseable' };\n }\n }\n const bucket = (root[topKey] ??= {});\n if (typeof bucket !== 'object' || bucket === null || Array.isArray(bucket)) {",
+ "span": "L23-L34"
}
},
{
- "id": "src/search/grep.ts#enclosingSymbol",
- "name": "enclosingSymbol",
+ "id": "src/hosts/mcp-config.ts#registerMcpConfigs",
+ "name": "registerMcpConfigs",
"kind": "function",
- "path": "src/search/grep.ts",
- "span": "L112-L119",
- "signature": "function enclosingSymbol(symbols: SymbolSpan[], line: number): NodeV1 | null",
- "exported": false,
+ "path": "src/hosts/mcp-config.ts",
+ "span": "L56-L87",
+ "signature": "function registerMcpConfigs( repo: string, ids: string[], opts: { home?: string } = {}, ): McpWrite[]",
+ "exported": true,
"origin": "ast",
- "body_hash": "980763724d7cfb9637d1a82b38f90ee4c1659a6ad4e06eb8b42ce19d6df771b0",
+ "body_hash": "13f7e325e26de9e426d475d1ff63fe06af411ca36b4d3c0fca7b2c2eb11fb45f",
"summary_state": "ready",
- "summary": "Finds the innermost symbol that contains a specified line number, returning the corresponding node from the graph.",
+ "summary": "Registers MCP configurations for multiple IDs, handling different file types and structures based on the ID.",
"crux": {
- "code": "function enclosingSymbol(symbols: SymbolSpan[], line: number): NodeV1 | null {\n let found: NodeV1 | null = null;\n for (const s of symbols) {\n if (s.start > line) break;\n if (line <= s.end) found = s.node;\n }\n return found;\n}",
- "span": "L108-L115"
+ "code": "export function registerMcpConfigs(\n repo: string,\n ids: string[],\n opts: { home?: string } = {},\n): McpWrite[] {\n const home = opts.home ?? homedir();\n const out: McpWrite[] = [];\n for (const id of ids) {\n switch (id) {\n case 'cursor':\n out.push(mergeJsonKey(id, join(repo, '.cursor', 'mcp.json'), 'mcpServers', SERVER_ENTRY));\n break;",
+ "span": "L56-L67"
}
},
{
- "id": "src/search/grep.ts#escapeRegExp",
- "name": "escapeRegExp",
+ "id": "src/hosts/mcp-config.ts#upsertCodexToml",
+ "name": "upsertCodexToml",
"kind": "function",
- "path": "src/search/grep.ts",
- "span": "L79-L81",
- "signature": "function escapeRegExp(s: string): string",
+ "path": "src/hosts/mcp-config.ts",
+ "span": "L45-L54",
+ "signature": "function upsertCodexToml(id: string, path: string): McpWrite",
"exported": false,
"origin": "ast",
- "body_hash": "4c6310d2cd2f62c68b872392c4843cb011bea7ced8f1ff4db8c010c952f60ba7",
+ "body_hash": "2dd6f4be2733f7bbd211b3ba2c6a8ceda215a135a9606a33fb7b1654ab320f9a",
"summary_state": "ready",
- "summary": "Escapes special characters in a string to create a safe regex pattern for searching.",
+ "summary": "Inserts or updates a section in a TOML configuration file for the codex, ensuring the section exists.",
"crux": {
- "code": "function escapeRegExp(s: string): string {\n return s.replace(/[.*+?^${}()|[\\]\\\\]/g, \"\\\\$&\");\n}",
- "span": "L75-L77"
+ "code": "function upsertCodexToml(id: string, path: string): McpWrite {\n const existed = existsSync(path);\n const text = existed ? readFileSync(path, 'utf8') : '';\n if (/^\\[mcp_servers\\.graft\\]$/m.test(text)) return { id, path, action: 'unchanged' };\n const section = `[mcp_servers.graft]\\ncommand = \"npx\"\\nargs = [\"-y\", \"@nanonets/graft\", \"mcp\"]\\n`;\n const sep = text.length === 0 ? '' : text.endsWith('\\n') ? '\\n' : '\\n\\n';\n mkdirSync(dirname(path), { recursive: true });\n writeFileSync(path, `${text}${sep}${section}`);\n return { id, path, action: existed ? 'updated' : 'created' };\n}",
+ "span": "L45-L54"
}
},
{
- "id": "src/search/grep.ts#grepGraph",
- "name": "grepGraph",
- "kind": "function",
- "path": "src/search/grep.ts",
- "span": "L137-L200",
- "signature": "function grepGraph(graph: GraphV1, repoRoot: string, pattern: string, opts: GrepOptions = {}): GrepResult",
+ "id": "src/hosts/registry.ts",
+ "name": "registry.ts",
+ "kind": "file",
+ "path": "src/hosts/registry.ts",
+ "span": "L1-L89",
+ "signature": null,
"exported": true,
"origin": "ast",
- "body_hash": "468a117edd348b57d625a7e44c9b15ad2e67c220296b40961aa6903eefacef76",
- "summary_state": "stale",
- "summary": "Performs the grep search on the graph, collecting and returning results based on the specified pattern and options.",
- "crux": {
- "code": "export function grepGraph(graph: GraphV1, repoRoot: string, pattern: string, opts: GrepOptions = {}): GrepResult {\n const maxHits = opts.maxHits ?? DEFAULT_MAX_HITS;\n const source = opts.fixed ? escapeRegExp(pattern) : pattern;\n const regex = new RegExp(source, opts.ignoreCase ? \"i\" : \"\");\n\n const inDegree = computeInDegree(graph);\n const fileNodes = graph.nodes.filter((n) => n.kind === \"file\" && (!opts.in || n.path.includes(opts.in)));\n\n const groups = new Map<string, GrepGroup>();\n let collected = 0;\n let truncatedHits = 0;\n let truncatedFiles = 0;",
- "span": "L133-L144"
- }
+ "body_hash": "0a8a2b82f0e4e1010943eb69d2eee7d9c4549f884967d5af1b8317c38ef99c18",
+ "chars": 2496,
+ "summary_state": "pending",
+ "summary": null,
+ "crux": null
},
{
- "id": "src/search/grep.ts#GrepGroup",
- "name": "GrepGroup",
- "kind": "interface",
- "path": "src/search/grep.ts",
- "span": "L34-L43",
- "signature": "interface GrepGroup",
+ "id": "src/hosts/registry.ts#detectHosts",
+ "name": "detectHosts",
+ "kind": "function",
+ "path": "src/hosts/registry.ts",
+ "span": "L86-L88",
+ "signature": "function detectHosts(probe: DetectProbe): HostTarget[]",
"exported": true,
"origin": "ast",
- "body_hash": "f6498adee93c3a0c7386dd6fd4ffb9ad0e73c2ce5fc6e13c041cdc1c495bdf1d",
+ "body_hash": "3e698dbf2457932d7a8713477813adac3b143152cafeb164aef5daf4fce398e5",
"summary_state": "ready",
- "summary": "Groups grep hits by their enclosing symbol, providing context such as the symbol's in-degree and the path of the file.",
+ "summary": "Filters and returns host targets that are detected based on the provided probing information.",
"crux": {
- "code": " /** null → file-level: the hit lies outside every indexed symbol's span\n * (module-level code — imports, top-level statements, module constants). */\n symbol: GrepSymbolRef | null;\n path: string;\n /** Incoming WALK_RELATIONS edges targeting the symbol — always 0 for\n * file-level groups (there's no single symbol id to count edges against). */\n inDegree: number;\n hits: GrepHit[];\n}",
- "span": "L34-L42"
+ "code": "export function detectHosts(probe: DetectProbe): HostTarget[] {\n return HOSTS.filter((h) => h.detect(probe));\n}",
+ "span": "L86-L88"
}
},
{
- "id": "src/search/grep.ts#GrepHit",
- "name": "GrepHit",
+ "id": "src/hosts/registry.ts#DetectProbe",
+ "name": "DetectProbe",
"kind": "interface",
- "path": "src/search/grep.ts",
- "span": "L18-L22",
- "signature": "interface GrepHit",
+ "path": "src/hosts/registry.ts",
+ "span": "L12-L16",
+ "signature": "interface DetectProbe",
"exported": true,
"origin": "ast",
- "body_hash": "5a03009952d496614e173831d994debd5b88d66861aa8b4ebb0617e5fb792a5f",
+ "body_hash": "b9f830f4861e96bdce7f7bf638175022642738bd7155f68167eb50a879f7a525",
"summary_state": "ready",
- "summary": "Represents a single hit found during the grep search, including the line number and trimmed text of the line.",
- "crux": {
- "code": " line: number;\n /** Trimmed line text, capped at 160 chars. */\n text: string;",
- "span": "L18-L20"
- }
+ "summary": "Defines the structure for probing the existence of directories related to AI coding hosts.",
+ "crux": null
},
{
- "id": "src/search/grep.ts#GrepOptions",
- "name": "GrepOptions",
- "kind": "interface",
- "path": "src/search/grep.ts",
- "span": "L64-L73",
- "signature": "interface GrepOptions",
+ "id": "src/hosts/registry.ts#hostIds",
+ "name": "hostIds",
+ "kind": "function",
+ "path": "src/hosts/registry.ts",
+ "span": "L82-L84",
+ "signature": "function hostIds(): string[]",
"exported": true,
"origin": "ast",
- "body_hash": "0d3f66c959733069e27d33cb53e110dd9f6606d3e77b71362b3c95e9c5a86646",
+ "body_hash": "4f4ec61bb5cdc94d5a40965c4bd6757b2e888811bb63fba7368f5f606d055ada",
"summary_state": "ready",
- "summary": "Holds options for configuring the grep search, such as case sensitivity and maximum hits to collect.",
+ "summary": "Retrieves a list of identifiers for all defined host targets.",
"crux": {
- "code": "export interface GrepOptions {\n ignoreCase?: boolean;\n /** Treat `pattern` as a literal string (regex-escaped), not a regex. */\n fixed?: boolean;\n /** Narrow to file nodes whose path contains this substring. */\n in?: string;\n /** Stop collecting hits after this many; the rest are tallied into\n * `truncated.hits`. Default 300. */\n maxHits?: number;\n}",
- "span": "L60-L69"
+ "code": "export function hostIds(): string[] {\n return HOSTS.map((h) => h.id);\n}",
+ "span": "L82-L84"
}
},
{
- "id": "src/search/grep.ts#GrepResult",
- "name": "GrepResult",
+ "id": "src/hosts/registry.ts#HostTarget",
+ "name": "HostTarget",
"kind": "interface",
- "path": "src/search/grep.ts",
- "span": "L45-L62",
- "signature": "interface GrepResult",
+ "path": "src/hosts/registry.ts",
+ "span": "L18-L26",
+ "signature": "interface HostTarget",
"exported": true,
"origin": "ast",
- "body_hash": "3c2826b6ccea2928580aa2a73561f99a6a0aae6b12bf84274c90a1b2fb8a72ab",
- "summary_state": "stale",
- "summary": "Encapsulates the results of a grep operation, including the pattern searched, total hits, and grouped results.",
- "crux": {
- "code": "export interface GrepResult {\n pattern: string;\n /** Indexed file nodes considered (after the `in` filter), whether or not\n * each was actually readable — matches the CLI's \"searched N indexed\n * files\" wording. */\n filesSearched: number;\n /** Hits actually collected (<= maxHits). */\n totalHits: number;\n /** Sorted: inDegree desc, then path asc. */\n groups: GrepGroup[];\n /** Dropped counts — never silent. `files`: indexed file nodes that\n * couldn't be read from disk. `hits`: matches found beyond `maxHits`,",
- "span": "L44-L55"
- }
+ "body_hash": "061c7862838ab4494e485220f52fea2202e0db5be2d2ff0e34d8e5fba4bb4b14",
+ "summary_state": "ready",
+ "summary": "Represents a target host with its identification, type, and detection logic for AI coding environments.",
+ "crux": null
},
{
- "id": "src/search/grep.ts#GrepSymbolRef",
- "name": "GrepSymbolRef",
- "kind": "interface",
- "path": "src/search/grep.ts",
- "span": "L24-L32",
- "signature": "interface GrepSymbolRef",
+ "id": "src/hosts/sections.ts",
+ "name": "sections.ts",
+ "kind": "file",
+ "path": "src/hosts/sections.ts",
+ "span": "L1-L68",
+ "signature": null,
"exported": true,
"origin": "ast",
- "body_hash": "021dcfb0dffc4d64379a0dd13b7f8ba1c31d66ed199cd35a08b0d877fa39e0e4",
+ "body_hash": "f172618889d5a02683032df8c69dd85b71c00c72a8b76958305ade22d6cda714",
+ "chars": 2879,
"summary_state": "ready",
- "summary": "Defines a reference to a symbol in the graph, including its qualified name and span, to facilitate grouping grep hits by their enclosing symbols.",
+ "summary": "This file provides functionality to manage sections of text within files, specifically for inserting and updating content between defined markers.",
"crux": {
- "code": " id: string;\n /** Qualified scope-joined name (e.g. `FastAPI.include_router`), not just\n * the bare symbol name — the id's segment after the file-path `#`. */\n name: string;\n kind: string;\n path: string;\n span: string;",
- "span": "L24-L30"
+ "code": "export function upsertSection(filePath: string, body: string): { action: UpsertAction } {\n if (!existsSync(filePath)) {\n const block = fencedBlock(body);\n mkdirSync(dirname(filePath), { recursive: true });\n writeFileSync(filePath, `${block}\\n`);\n return { action: 'created' };\n }\n const text = readFileSync(filePath, 'utf8');\n const eol = detectEol(text);\n // Split on either eol so lines never carry an embedded '\\r' — that keeps\n // the marker/content comparison clean and lets us rejoin deliberately with\n // the detected eol instead of relying on '\\r' characters riding along",
+ "span": "L36-L47"
}
},
{
- "id": "src/search/grep.ts#spanBounds",
- "name": "spanBounds",
+ "id": "src/hosts/sections.ts#detectEol",
+ "name": "detectEol",
"kind": "function",
- "path": "src/search/grep.ts",
- "span": "L83-L87",
- "signature": "function spanBounds(span: string): { start: number; end: number } | null",
+ "path": "src/hosts/sections.ts",
+ "span": "L24-L26",
+ "signature": "function detectEol(text: string): LineEnding",
"exported": false,
"origin": "ast",
- "body_hash": "07501d016c2decb33d98ef556db8322d35e7753945a15803d9579b03bd80d5a1",
+ "body_hash": "902fbd2b08830cb32450b0a84ba8f76f1fd34d4fe8345b28fadba29a682c4b43",
"summary_state": "ready",
- "summary": "Extracts the start and end line numbers from a span string, returning null if the format is invalid.",
+ "summary": "Determines the dominant line ending used in a given text, facilitating consistent handling of line breaks.",
"crux": {
- "code": "function spanBounds(span: string): { start: number; end: number } | null {\n const m = SPAN_RE.exec(span);\n if (!m) return null;\n return { start: Number(m[1]), end: Number(m[2]) };\n}",
- "span": "L79-L83"
+ "code": "function detectEol(text: string): LineEnding {\n return text.includes('\\r\\n') ? '\\r\\n' : '\\n';\n}",
+ "span": "L24-L26"
}
},
{
- "id": "src/search/grep.ts#symbolsOf",
- "name": "symbolsOf",
+ "id": "src/hosts/sections.ts#fencedBlock",
+ "name": "fencedBlock",
"kind": "function",
- "path": "src/search/grep.ts",
- "span": "L97-L106",
- "signature": "function symbolsOf(graph: GraphV1, path: string): SymbolSpan[]",
- "exported": false,
+ "path": "src/hosts/sections.ts",
+ "span": "L15-L21",
+ "signature": "function fencedBlock(body: string, eol: LineEnding = '\\n'): string",
+ "exported": true,
"origin": "ast",
- "body_hash": "26481c2032801b2e8e12980416a4d10b1a1bddb66c0d6d4bfa97cb918c94f0c4",
+ "body_hash": "cfc11a2e95b5d0866b455dfff3cd2e1f98f13e3dc5dad5fe47b8f624cb93b6bd",
"summary_state": "ready",
- "summary": "Retrieves and sorts the symbols of a given file in the graph, based on their span start lines.",
+ "summary": "Creates a formatted block of text enclosed by specific markers, ensuring proper line endings and normalization of input.",
"crux": {
- "code": "function symbolsOf(graph: GraphV1, path: string): SymbolSpan[] {\n const out: SymbolSpan[] = [];\n for (const n of graph.nodes) {\n if (n.kind === \"file\" || n.path !== path) continue;\n const b = spanBounds(n.span);\n if (b) out.push({ node: n, start: b.start, end: b.end });\n }\n out.sort((a, b) => a.start - b.start);\n return out;\n}",
- "span": "L93-L102"
+ "code": " const normalizedBody = body.replace(/\\r/g, '');\n const block = `${START}\\n${normalizedBody.replace(/\\s+$/, '')}\\n${END}`;\n return eol === '\\n' ? block : block.replace(/\\n/g, '\\r\\n');",
+ "span": "L18-L20"
}
},
{
- "id": "src/search/grep.ts#SymbolSpan",
- "name": "SymbolSpan",
- "kind": "interface",
- "path": "src/search/grep.ts",
- "span": "L89-L93",
- "signature": "interface SymbolSpan",
+ "id": "src/hosts/sections.ts#LineEnding",
+ "name": "LineEnding",
+ "kind": "type",
+ "path": "src/hosts/sections.ts",
+ "span": "L13-L13",
+ "signature": "type LineEnding = '\\n' | '\\r\\n';",
"exported": false,
"origin": "ast",
- "body_hash": "ed659214924ee7e720952748e5e217835cb3988e58c0a840f85800c1207cd6f3",
+ "body_hash": "e49b9a5218efdfb100f47552da255afff2e24a84ab10c02564adb1e72892a229",
"summary_state": "ready",
- "summary": "Represents a span of a symbol in the graph, including its start and end lines, to assist in finding enclosing symbols.",
- "crux": {
- "code": "interface SymbolSpan {\n node: NodeV1;\n start: number;\n end: number;\n}",
- "span": "L85-L89"
- }
+ "summary": "Specifies the types of line endings that can be used in the text, ensuring compatibility with different operating systems.",
+ "crux": null
},
{
- "id": "src/search/grep.ts#toSymbolRef",
- "name": "toSymbolRef",
+ "id": "src/hosts/sections.ts#markerLineIndex",
+ "name": "markerLineIndex",
"kind": "function",
- "path": "src/search/grep.ts",
- "span": "L132-L135",
- "signature": "function toSymbolRef(n: NodeV1): GrepSymbolRef",
+ "path": "src/hosts/sections.ts",
+ "span": "L29-L34",
+ "signature": "function markerLineIndex(lines: string[], marker: string, from = 0): number",
"exported": false,
"origin": "ast",
- "body_hash": "f527f108414f4112517e03e555c78d998f5d3cea3a6bf89b2f9b383bc73aa732",
+ "body_hash": "b090a3b83b05f46da8f10b2c37a8f0a5c1522280f786fe4263f161294e0ffbd3",
"summary_state": "ready",
- "summary": "Converts a node in the graph to a GrepSymbolRef, providing a structured representation of the symbol.",
+ "summary": "Finds the index of a specified marker in an array of lines, helping to locate the start and end of sections within the text.",
"crux": {
- "code": "function toSymbolRef(n: NodeV1): GrepSymbolRef {\n const hash = n.id.indexOf(\"#\");\n return { id: n.id, name: hash >= 0 ? n.id.slice(hash + 1) : n.name, kind: n.kind, path: n.path, span: n.span };\n}",
- "span": "L128-L131"
+ "code": " for (let i = from; i < lines.length; i++) {\n if (lines[i].trim() === marker) return i;\n }\n return -1;",
+ "span": "L30-L33"
}
},
{
- "id": "src/util/id.ts",
- "name": "id.ts",
- "kind": "file",
- "path": "src/util/id.ts",
- "span": "L1-L17",
- "signature": null,
+ "id": "src/hosts/sections.ts#UpsertAction",
+ "name": "UpsertAction",
+ "kind": "type",
+ "path": "src/hosts/sections.ts",
+ "span": "L11-L11",
+ "signature": "type UpsertAction = 'created' | 'appended' | 'replaced' | 'unchanged';",
"exported": true,
"origin": "ast",
- "body_hash": "5fabc8ddcc3abc907ce69f04ad2ebe51933262cf44aa2dfd40589f71f1926e8a",
- "chars": 626,
+ "body_hash": "53d24b330d60564589d8a07882c099e9fc964a43b0523536ea03cc430551452f",
"summary_state": "ready",
- "summary": "This file provides utility functions for generating unique identifiers, creating content hashes, and normalizing names for consistent matching.",
+ "summary": "Defines the possible outcomes of an upsert operation on a section, indicating whether it was created, appended, replaced, or unchanged.",
"crux": null
},
{
- "id": "src/util/id.ts#contentHash",
- "name": "contentHash",
+ "id": "src/hosts/sections.ts#upsertSection",
+ "name": "upsertSection",
"kind": "function",
- "path": "src/util/id.ts",
- "span": "L9-L11",
- "signature": "function contentHash(input: string): string",
+ "path": "src/hosts/sections.ts",
+ "span": "L36-L67",
+ "signature": "function upsertSection(filePath: string, body: string): { action: UpsertAction }",
"exported": true,
"origin": "ast",
- "body_hash": "d83ce720108cb9ea3b0c7b1e7034657603640647ca00283905fcd099ac3fe2ed",
+ "body_hash": "552b5cf28b36f1e019f183739f266aa59b8af6bbf691056507639ce5633c2dd0",
"summary_state": "ready",
- "summary": "This function creates a stable hash of the input content, which is essential for deduplication of documents.",
+ "summary": "Handles the logic for inserting or updating a section of text in a file, managing file creation, content comparison, and writing operations.",
"crux": {
- "code": " return createHash(\"sha256\").update(input).digest(\"hex\");",
- "span": "L10-L10"
+ "code": "export function upsertSection(filePath: string, body: string): { action: UpsertAction } {\n if (!existsSync(filePath)) {\n const block = fencedBlock(body);\n mkdirSync(dirname(filePath), { recursive: true });\n writeFileSync(filePath, `${block}\\n`);\n return { action: 'created' };\n }\n const text = readFileSync(filePath, 'utf8');\n const eol = detectEol(text);\n // Split on either eol so lines never carry an embedded '\\r' — that keeps\n // the marker/content comparison clean and lets us rejoin deliberately with\n // the detected eol instead of relying on '\\r' characters riding along",
+ "span": "L36-L47"
}
},
{
- "id": "src/util/id.ts#newId",
- "name": "newId",
- "kind": "function",
- "path": "src/util/id.ts",
- "span": "L4-L6",
- "signature": "function newId(prefix: string): string",
+ "id": "src/index.ts",
+ "name": "index.ts",
+ "kind": "file",
+ "path": "src/index.ts",
+ "span": "L1-L45",
+ "signature": null,
"exported": true,
"origin": "ast",
- "body_hash": "55062dee898e1edb76d65f7daf785b67e998a57a7dfd6f78c7eb17f39e3e1dc0",
+ "body_hash": "f66577d7952e061dd28f782e39f572fe9421a52758e9151f2620739894dd006d",
+ "chars": 2061,
"summary_state": "ready",
- "summary": "This function generates a unique identifier with a specified prefix, solving the need for easily identifiable and unique keys.",
+ "summary": "This module serves as the public API for the Graft library, facilitating the building and checking of a graph of linked markdown files.",
"crux": {
- "code": " return `${prefix}_${randomUUID().replace(/-/g, \"\").slice(0, 20)}`;",
- "span": "L5-L5"
+ "code": " * await engine.init(\".\"); // writes .context/*.md + manifest.json\n *\n * const result = engine.check(\".\"); // { ok: boolean, ...drift }\n * if (!result.ok) process.exitCode = 1;",
+ "span": "L12-L15"
}
},
{
- "id": "src/util/id.ts#normalizeName",
- "name": "normalizeName",
+ "id": "src/ingest/fs.ts",
+ "name": "fs.ts",
+ "kind": "file",
+ "path": "src/ingest/fs.ts",
+ "span": "L1-L46",
+ "signature": null,
+ "exported": true,
+ "origin": "ast",
+ "body_hash": "a8339532da34b44d35eb9ad16e7106adb1262d73d9895b1bd94574337fb2019f",
+ "chars": 1218,
+ "summary_state": "ready",
+ "summary": "This file provides utilities for walking through a filesystem to identify source files while excluding certain directories and large files.",
+ "crux": null
+ },
+ {
+ "id": "src/ingest/fs.ts#walkDir",
+ "name": "walkDir",
"kind": "function",
- "path": "src/util/id.ts",
- "span": "L14-L16",
- "signature": "function normalizeName(name: string): string",
+ "path": "src/ingest/fs.ts",
+ "span": "L27-L45",
+ "signature": "function walkDir(dir: string): string[]",
"exported": true,
"origin": "ast",
- "body_hash": "bac0e298462067a441b2b76566ed29c3787280585b956f84b81d7a766cd7211a",
+ "body_hash": "001f6c9f648af0620ed90c55a132464ab87da3ad74b6711df716e9f9493333c4",
"summary_state": "ready",
- "summary": "This function normalizes names for case- and whitespace-insensitive matching, ensuring consistency in name comparisons.",
+ "summary": "The walkDir function recursively collects paths of files in a directory while skipping specified directories and files larger than 1 MB.",
"crux": {
- "code": " return name.trim().toLowerCase().replace(/\\s+/g, \" \");",
- "span": "L15-L15"
+ "code": " if (entry.name.startsWith(\".\")) continue;\n const full = join(dir, entry.name);\n if (entry.isDirectory()) {\n if (SKIP_DIRS.has(entry.name)) continue;\n out.push(...walkDir(full));\n } else if (entry.isFile()) {\n try {\n if (statSync(full).size > MAX_FILE_BYTES) continue;\n } catch {\n continue;\n }\n out.push(full);",
+ "span": "L30-L41"
}
},
{
- "id": "src/viz/assemble.ts",
- "name": "assemble.ts",
+ "id": "src/mcp/server.ts",
+ "name": "server.ts",
"kind": "file",
- "path": "src/viz/assemble.ts",
- "span": "L1-L131",
+ "path": "src/mcp/server.ts",
+ "span": "L1-L67",
"signature": null,
"exported": true,
"origin": "ast",
- "body_hash": "58ad5caed087bd7b929f5b625501a607e79e0476f998636bec241e0296706ece",
- "chars": 4233,
+ "body_hash": "0bdeba850ab62132a01b683cd2db7ee36a7509a67ebd58e73887a22a611ce100",
+ "chars": 2258,
"summary_state": "ready",
- "summary": "Assembles a comprehensive graph document from markdown files in a context directory, ensuring that only valid nodes and edges are included.",
+ "summary": "Defines a minimal JSON-RPC 2.0 server for handling protocol messages and tool calls.",
"crux": {
- "code": "/** Read a context dir and assemble the render-ready graph document. */\nexport function assembleContextGraph(contextDir: string): VizGraph {\n const nodes: VizNode[] = [];\n const rawEdges: VizEdge[] = [];\n let skippedFiles = 0;\n\n if (existsSync(contextDir)) {\n for (const entry of readdirSync(contextDir).sort()) {\n if (!entry.endsWith(\".md\")) continue;\n let parsed: matter.GrayMatterFile<string>;\n try {\n parsed = matter(readFileSync(join(contextDir, entry), \"utf8\"));",
- "span": "L78-L89"
+ "code": "export function startMcpServer(root: string, dirOverride?: string): void {\n const rl = createInterface({ input: process.stdin, crlfDelay: Infinity });\n rl.on('line', (line) => {\n const text = line.trim();\n if (!text) return;\n let msg: { id?: unknown; method?: string; params?: Record<string, any> };\n try {\n msg = JSON.parse(text);\n } catch {\n replyError(null, -32700, 'parse error');\n return;\n }",
+ "span": "L20-L31"
}
},
{
- "id": "src/viz/assemble.ts#assembleContextGraph",
- "name": "assembleContextGraph",
- "kind": "function",
- "path": "src/viz/assemble.ts",
- "span": "L79-L130",
- "signature": "function assembleContextGraph(contextDir: string): VizGraph",
- "exported": true,
+ "id": "src/mcp/server.ts#reply",
+ "name": "reply",
+ "kind": "function",
+ "path": "src/mcp/server.ts",
+ "span": "L12-L14",
+ "signature": "function reply(id: unknown, result: object): void",
+ "exported": false,
"origin": "ast",
- "body_hash": "8529626bef8abf2e1a326d601cf5a6a4972e0a1b801d6b653ba8227a27b9dbbd",
+ "body_hash": "ebf863d2db4e0898846deff35e6a0d581dae06f6e402592309f8c6742a3abe59",
"summary_state": "ready",
- "summary": "Processes markdown files in a specified directory to create a structured visualization graph, handling errors gracefully.",
+ "summary": "Constructs and sends a successful JSON-RPC response message.",
"crux": {
- "code": " if (existsSync(contextDir)) {\n for (const entry of readdirSync(contextDir).sort()) {\n if (!entry.endsWith(\".md\")) continue;\n let parsed: matter.GrayMatterFile<string>;\n try {\n parsed = matter(readFileSync(join(contextDir, entry), \"utf8\"));\n } catch {\n skippedFiles++;\n continue;\n }\n const fm = parsed.data as Record<string, unknown>;\n const id = String(fm.slug ?? entry.replace(/\\.md$/, \"\"));",
- "span": "L84-L95"
+ "code": "function reply(id: unknown, result: object): void {\n send({ jsonrpc: '2.0', id, result });\n}",
+ "span": "L12-L14"
}
},
{
- "id": "src/viz/assemble.ts#extractSummary",
- "name": "extractSummary",
+ "id": "src/mcp/server.ts#replyError",
+ "name": "replyError",
"kind": "function",
- "path": "src/viz/assemble.ts",
- "span": "L65-L76",
- "signature": "function extractSummary(body: string): string",
+ "path": "src/mcp/server.ts",
+ "span": "L16-L18",
+ "signature": "function replyError(id: unknown, code: number, message: string): void",
"exported": false,
"origin": "ast",
- "body_hash": "1857e477bdb012672fa843cfca8d43eb543e7cfba2cc496692a65ebe8c0fa6c5",
+ "body_hash": "540611464bba68e3e678870e748cde38aa6790c52ca10dfda8f891dcf0d59717",
"summary_state": "ready",
- "summary": "Extracts and cleans the summary text from a markdown node's content, ensuring it adheres to length constraints.",
+ "summary": "Constructs and sends a JSON-RPC error response message.",
"crux": {
- "code": "function extractSummary(body: string): string {\n let text = body;\n const start = text.indexOf(GEN_START);\n const end = text.indexOf(GEN_END);\n if (start >= 0 && end > start) text = text.slice(start + GEN_START.length, end);\n // Keep only the Summary section if headings are present.\n const related = text.indexOf(\"## Related\");\n if (related >= 0) text = text.slice(0, related);\n text = text.replace(/^##\\s+Summary\\s*$/m, \"\");\n text = text.trim();\n return text.length > SUMMARY_MAX ? text.slice(0, SUMMARY_MAX).trimEnd() + \"…\" : text;",
- "span": "L65-L75"
+ "code": "function replyError(id: unknown, code: number, message: string): void {\n send({ jsonrpc: '2.0', id, error: { code, message } });\n}",
+ "span": "L16-L18"
}
},
{
- "id": "src/viz/assemble.ts#normalizeRelation",
- "name": "normalizeRelation",
+ "id": "src/mcp/server.ts#send",
+ "name": "send",
"kind": "function",
- "path": "src/viz/assemble.ts",
- "span": "L56-L58",
- "signature": "function normalizeRelation(rel: string): string",
- "exported": true,
+ "path": "src/mcp/server.ts",
+ "span": "L8-L10",
+ "signature": "function send(msg: object): void",
+ "exported": false,
"origin": "ast",
- "body_hash": "adfaae55d1d21718adbedaa294194517aa7abdddeb95433642fd358137e48909",
+ "body_hash": "7446435a2fc268ad8d76124c2e66f957d5de51730babfc38d8cb4dff5fc80c58",
"summary_state": "ready",
- "summary": "Maps legacy vague verbs to concrete verbs to maintain consistency in the graph's relationships.",
+ "summary": "Sends a JSON-RPC message to the standard output stream.",
"crux": {
- "code": "export function normalizeRelation(rel: string): string {\n return NORMALIZE_RELATION[rel] ?? rel;\n}",
- "span": "L56-L58"
+ "code": "function send(msg: object): void {\n process.stdout.write(`${JSON.stringify(msg)}\\n`);\n}",
+ "span": "L8-L10"
}
},
{
- "id": "src/viz/assemble.ts#VizEdge",
- "name": "VizEdge",
- "kind": "interface",
- "path": "src/viz/assemble.ts",
- "span": "L26-L31",
- "signature": "interface VizEdge",
+ "id": "src/mcp/server.ts#startMcpServer",
+ "name": "startMcpServer",
+ "kind": "function",
+ "path": "src/mcp/server.ts",
+ "span": "L20-L66",
+ "signature": "function startMcpServer(root: string, dirOverride?: string): void",
"exported": true,
"origin": "ast",
- "body_hash": "bef3aefe267d463b0d4cf617f379adadd4fffb539e9a0a5e240520be60a191cb",
+ "body_hash": "bbf674f912399a59d133f52a0d975069c215acfb0cc62b5f6ffc3d15ef92acbd",
"summary_state": "ready",
- "summary": "Defines the structure of an edge in the visualization graph, representing relationships between nodes.",
- "crux": null
+ "summary": "Initializes the server to listen for incoming JSON-RPC messages and handle them appropriately.",
+ "crux": {
+ "code": "export function startMcpServer(root: string, dirOverride?: string): void {\n const rl = createInterface({ input: process.stdin, crlfDelay: Infinity });\n rl.on('line', (line) => {\n const text = line.trim();\n if (!text) return;\n let msg: { id?: unknown; method?: string; params?: Record<string, any> };\n try {\n msg = JSON.parse(text);\n } catch {\n replyError(null, -32700, 'parse error');\n return;\n }",
+ "span": "L20-L31"
+ }
},
{
- "id": "src/viz/assemble.ts#VizGraph",
- "name": "VizGraph",
- "kind": "interface",
- "path": "src/viz/assemble.ts",
- "span": "L33-L42",
- "signature": "interface VizGraph",
+ "id": "src/mcp/tools.ts",
+ "name": "tools.ts",
+ "kind": "file",
+ "path": "src/mcp/tools.ts",
+ "span": "L1-L285",
+ "signature": null,
"exported": true,
"origin": "ast",
- "body_hash": "7edd9c49c11acc8e90963256a92ee2f27415c50446334924e2e260b715b56427",
- "summary_state": "ready",
- "summary": "Encapsulates the complete visualization graph, including metadata about nodes and edges.",
+ "body_hash": "8963bbe2ae9a8e8633c3c3469ef2e3efbbcf8790ab869c83ba60c1f59fd9d523",
+ "chars": 12817,
+ "summary_state": "pending",
+ "summary": null,
"crux": null
},
{
- "id": "src/viz/assemble.ts#VizNode",
- "name": "VizNode",
- "kind": "interface",
- "path": "src/viz/assemble.ts",
- "span": "L18-L24",
- "signature": "interface VizNode",
+ "id": "src/mcp/tools.ts#callTool",
+ "name": "callTool",
+ "kind": "function",
+ "path": "src/mcp/tools.ts",
+ "span": "L198-L284",
+ "signature": "function callTool( root: string, name: string, args: Record<string, unknown>, dirOverride?: string, ): { text: string; isError: boolean }",
"exported": true,
"origin": "ast",
- "body_hash": "ec19a79898c594e5afc405cab037fcc0c43144c5766af8a955dccda7df733ba6",
- "summary_state": "ready",
- "summary": "Defines the structure of a node in the visualization graph, encapsulating its identity and attributes.",
- "crux": null
+ "body_hash": "4b3d5bde8c61bc126761f0bea87a022e6671b52fb4b579138cd54aec020d7208",
+ "summary_state": "stale",
+ "summary": "Handles the invocation of various tools based on user input, managing errors and returning formatted results for different graph operations.",
+ "crux": {
+ "code": "export function callTool(\n root: string,\n name: string,\n args: Record<string, unknown>,\n dirOverride?: string,\n): { text: string; isError: boolean } {\n try {\n switch (name) {\n case 'graft_ask': {\n const query = String(args.query ?? '');\n if (!query) return { text: 'graft_ask requires a query', isError: true };\n const limit = typeof args.limit === 'number' ? args.limit : 5;",
+ "span": "L149-L160"
+ }
},
{
- "id": "src/viz/serve.ts",
- "name": "serve.ts",
- "kind": "file",
- "path": "src/viz/serve.ts",
- "span": "L1-L149",
- "signature": null,
- "exported": true,
+ "id": "src/mcp/tools.ts#callWorkspaceTool",
+ "name": "callWorkspaceTool",
+ "kind": "function",
+ "path": "src/mcp/tools.ts",
+ "span": "L150-L196",
+ "signature": "function callWorkspaceTool( root: string, dirOverride: string | undefined, name: string, args: Record<string, unknown>, ): { text: string; isError: boolean } | null",
+ "exported": false,
"origin": "ast",
- "body_hash": "14283762f454c01fc95cfbe9c2b41ef063fc17c4c3e5d120b5dc7f66f541fc1c",
- "chars": 4909,
- "summary_state": "ready",
- "summary": "This file implements a local server for serving a viewer and handling API requests related to context and code graphs.",
- "crux": {
- "code": " const server = createServer((req, res) => {\n const path = (req.url ?? \"/\").split(\"?\")[0];\n\n const asset = STATIC_FILES[path];\n if (asset) {\n const file = join(opts.viewerDir, asset.file);\n if (!existsSync(file)) {\n res.writeHead(404, { \"content-type\": \"text/plain\" });\n res.end(\"viewer bundle missing — run the package build\");\n return;\n }\n res.writeHead(200, { \"content-type\": asset.type });",
- "span": "L60-L71"
- }
+ "body_hash": "1bfb8d0365cb4ba9352ba67e63e57be51e0c7479da98915643d164a4d738a022",
+ "summary_state": "pending",
+ "summary": null,
+ "crux": null
},
{
- "id": "src/viz/serve.ts#listen",
- "name": "listen",
+ "id": "src/mcp/tools.ts#renderMatches",
+ "name": "renderMatches",
"kind": "function",
- "path": "src/viz/serve.ts",
- "span": "L43-L55",
- "signature": "function listen(server: Server, port: number): Promise<boolean>",
+ "path": "src/mcp/tools.ts",
+ "span": "L129-L144",
+ "signature": "function renderMatches( direction: Direction, showDepth: boolean, matches: NodeV1[], hitsFor: (n: NodeV1) => EdgeHit[], ): string",
"exported": false,
"origin": "ast",
- "body_hash": "b43a357dceb98a6eb6676409503021e6e38f13d7d442d44ba819dda0c0ea6246",
- "summary_state": "ready",
- "summary": "Attempts to bind the server to a specified port, handling errors if the port is in use.",
+ "body_hash": "7059bf338ce7e9e88b1ab4bfc452b62fb489c56239322352f8c07b2b2bb42ebc",
+ "summary_state": "stale",
+ "summary": "Formats and renders the results of graph traversal matches, providing a structured output for users to understand symbol relationships.",
"crux": {
- "code": " return new Promise((resolve, reject) => {\n const onError = (err: NodeJS.ErrnoException) => {\n if (err.code === \"EADDRINUSE\") resolve(false);\n else reject(err);\n };\n server.once(\"error\", onError);\n server.listen(port, \"127.0.0.1\", () => {\n server.removeListener(\"error\", onError);\n resolve(true);\n });",
- "span": "L44-L53"
+ "code": "function renderMatches(kind: TraverseKind, matches: NodeV1[], hitsFor: (n: NodeV1) => EdgeHit[]): string {\n return matches\n .map((m) => {\n const hits = hitsFor(m);\n const lines = [headerOf(m)];\n if (hits.length === 0) lines.push(looseNoteFor(kind, m.name));\n else for (const h of hits) lines.push(hitLine(kind, h));\n return lines.join('\\n');\n })\n .join('\\n\\n');\n}",
+ "span": "L137-L147"
}
},
{
- "id": "src/viz/serve.ts#listen.onError",
- "name": "onError",
- "kind": "function",
- "path": "src/viz/serve.ts",
- "span": "L45-L48",
- "signature": "onError = (err: NodeJS.ErrnoException)",
- "exported": false,
+ "id": "src/mcp/tools.ts#ToolDef",
+ "name": "ToolDef",
+ "kind": "interface",
+ "path": "src/mcp/tools.ts",
+ "span": "L27-L31",
+ "signature": "interface ToolDef",
+ "exported": true,
"origin": "ast",
- "body_hash": "6643919e3ea413fc58afe100fe65dc3beccadb7aa66bf5d3247e072c83d9d000",
+ "body_hash": "66213a2ab8c0b58ddbf6e632f4ac26e643f00ff02eef696f9b321c2236b45365",
"summary_state": "ready",
- "summary": "Handles errors that occur when trying to bind the server to a port.",
- "crux": null
+ "summary": "Defines the structure for tool definitions used in the MCP tools, ensuring consistent input schema and metadata for each tool.",
+ "crux": {
+ "code": "export interface ToolDef {\n name: string;\n description: string;\n inputSchema: object;\n}",
+ "span": "L18-L22"
+ }
},
{
- "id": "src/viz/serve.ts#sendJson",
- "name": "sendJson",
+ "id": "src/mcp/tools.ts#unknownSymbolText",
+ "name": "unknownSymbolText",
"kind": "function",
- "path": "src/viz/serve.ts",
- "span": "L38-L41",
- "signature": "function sendJson(res: ServerResponse, status: number, body: unknown): void",
+ "path": "src/mcp/tools.ts",
+ "span": "L35-L37",
+ "signature": "function unknownSymbolText(query: string): string",
"exported": false,
"origin": "ast",
- "body_hash": "a2b33c898c929db2715116f964722f5e438e61a58fdfa4607d21c4365df5da6a",
+ "body_hash": "ea43b6a930c9fe3d67aa2e40b6d1d7dc2ebdb0e55a23c1f42047c0089bc2917e",
"summary_state": "ready",
- "summary": "Sends a JSON response with the specified status and body to the client.",
+ "summary": "Generates an error message for an unknown symbol query, guiding users to check their input or build the graph.",
"crux": {
- "code": " res.writeHead(status, { \"content-type\": \"application/json; charset=utf-8\" });\n res.end(JSON.stringify(body));\n}",
- "span": "L39-L41"
+ "code": "function unknownSymbolText(query: string): string {\n return `no symbol \"${query}\" in the graph — check spelling or run \\`graft build\\``;\n}",
+ "span": "L29-L31"
}
},
{
- "id": "src/viz/serve.ts#startVizServer",
- "name": "startVizServer",
- "kind": "function",
- "path": "src/viz/serve.ts",
- "span": "L57-L148",
- "signature": "async function startVizServer(opts: VizServerOptions): Promise<VizServer>",
+ "id": "src/search/grep-cli.ts",
+ "name": "grep-cli.ts",
+ "kind": "file",
+ "path": "src/search/grep-cli.ts",
+ "span": "L1-L116",
+ "signature": null,
"exported": true,
"origin": "ast",
- "body_hash": "d652f8a8b5ea738a1ff68592d9644525dee438568c9158e5edffe536b1f1aa16",
- "summary_state": "ready",
- "summary": "Initializes and starts the visualization server, setting up routes and handling requests.",
+ "body_hash": "64dc983c11be49dc755c21f1eb6420adb1ef016077d5e3cc3fe7d5ad82baee78",
+ "chars": 4921,
+ "summary_state": "stale",
+ "summary": "This file provides the command-line interface for the grep functionality, formatting results for user-friendly output.",
"crux": {
- "code": " const server = createServer((req, res) => {\n const path = (req.url ?? \"/\").split(\"?\")[0];\n\n const asset = STATIC_FILES[path];\n if (asset) {\n const file = join(opts.viewerDir, asset.file);\n if (!existsSync(file)) {\n res.writeHead(404, { \"content-type\": \"text/plain\" });\n res.end(\"viewer bundle missing — run the package build\");\n return;\n }\n res.writeHead(200, { \"content-type\": asset.type });",
- "span": "L60-L71"
+ "code": "export function formatGrepResult(result: GrepResult): string {\n const blocks = [formatGrepHeader(result), \"\", ...result.groups.map((g) => formatGroup(g) + \"\\n\")];\n let out = blocks.join(\"\\n\").replace(/\\n+$/, \"\\n\");\n const note = truncationNote(result);\n if (note) out += note + \"\\n\";\n return out;\n}",
+ "span": "L53-L59"
}
},
{
- "id": "src/viz/serve.ts#startVizServer.close",
- "name": "close",
- "kind": "method",
- "path": "src/viz/serve.ts",
- "span": "L140-L146",
- "signature": "close(): Promise<void>",
+ "id": "src/search/grep-cli.ts#formatGrepHeader",
+ "name": "formatGrepHeader",
+ "kind": "function",
+ "path": "src/search/grep-cli.ts",
+ "span": "L37-L40",
+ "signature": "function formatGrepHeader(result: GrepResult): string",
"exported": true,
"origin": "ast",
- "body_hash": "69dc0089d8f1d6e843c8add8fabf2e120fd1045505f9c15632ba93bdc58c01d4",
+ "body_hash": "eb6324d18b820f95e0423005738f3a8ec5da095849e5934e82ca512c75f1e4f4",
"summary_state": "ready",
- "summary": "Closes the visualization server and cleans up resources.",
+ "summary": "Creates a header for the grep results, summarizing the total hits and files searched.",
"crux": {
- "code": " close(): Promise<void> {\n clearTimeout(debounce);\n watcher?.close();\n for (const client of sseClients) client.end();\n sseClients.clear();\n return new Promise((resolve, reject) => server.close((err) => (err ? reject(err) : resolve())));\n },",
- "span": "L140-L146"
+ "code": "export function formatGrepHeader(result: GrepResult): string {\n const filesHit = new Set(result.groups.map((g) => g.path)).size;\n return `\"${result.pattern}\" — ${result.totalHits} hits in ${result.groups.length} symbols across ${filesHit} files (searched ${result.filesSearched} indexed files)`;\n}",
+ "span": "L36-L39"
}
},
{
- "id": "src/viz/serve.ts#VizServer",
- "name": "VizServer",
- "kind": "interface",
- "path": "src/viz/serve.ts",
- "span": "L23-L26",
- "signature": "interface VizServer",
+ "id": "src/search/grep-cli.ts#formatGrepResult",
+ "name": "formatGrepResult",
+ "kind": "function",
+ "path": "src/search/grep-cli.ts",
+ "span": "L54-L62",
+ "signature": "function formatGrepResult(result: GrepResult): string",
"exported": true,
"origin": "ast",
- "body_hash": "9c56587daccba8982a5f5da3a0ea5f185becea8c4f4927331b15117f5d456214",
- "summary_state": "ready",
- "summary": "Represents the visualization server with its URL and a method to close it.",
- "crux": null
- },
+ "body_hash": "f8a8198261b13ec5667805d4024024a19adf344fb6a4af500e19bf884e7c6b44",
+ "summary_state": "stale",
+ "summary": "Compiles the full human-readable report of grep results, including headers and formatted groups.",
+ "crux": {
+ "code": "export function formatGrepResult(result: GrepResult): string {\n const blocks = [formatGrepHeader(result), \"\", ...result.groups.map((g) => formatGroup(g) + \"\\n\")];\n let out = blocks.join(\"\\n\").replace(/\\n+$/, \"\\n\");\n const note = truncationNote(result);\n if (note) out += note + \"\\n\";\n return out;\n}",
+ "span": "L53-L59"
+ }
+ },
{
- "id": "src/viz/serve.ts#VizServerOptions",
- "name": "VizServerOptions",
- "kind": "interface",
- "path": "src/viz/serve.ts",
- "span": "L16-L21",
- "signature": "interface VizServerOptions",
- "exported": true,
+ "id": "src/search/grep-cli.ts#formatGroup",
+ "name": "formatGroup",
+ "kind": "function",
+ "path": "src/search/grep-cli.ts",
+ "span": "L30-L34",
+ "signature": "function formatGroup(g: GrepGroup): string",
+ "exported": false,
"origin": "ast",
- "body_hash": "0b439484269a73c19df0d658113fbdc889c2214d1081e08d92bc86ae99e0c795",
+ "body_hash": "c6901df49ecdcf11c258a32a5e8acf90c887eee405673b9877f0d241ddd7d24d",
"summary_state": "ready",
- "summary": "Defines the configuration options required to start the visualization server.",
- "crux": null
+ "summary": "Formats a group of grep results into a human-readable string, including hit lines.",
+ "crux": {
+ "code": "function formatGroup(g: GrepGroup): string {\n const lines = [groupHeader(g)];\n for (const h of g.hits) lines.push(` L${h.line}: ${h.text}`);\n return lines.join(\"\\n\");\n}",
+ "span": "L29-L33"
+ }
},
{
- "id": "test/ask-fusion.test.ts",
- "name": "ask-fusion.test.ts",
- "kind": "file",
- "path": "test/ask-fusion.test.ts",
- "span": "L1-L187",
- "signature": null,
+ "id": "src/search/grep-cli.ts#GrepCliOptions",
+ "name": "GrepCliOptions",
+ "kind": "interface",
+ "path": "src/search/grep-cli.ts",
+ "span": "L16-L23",
+ "signature": "interface GrepCliOptions",
"exported": true,
"origin": "ast",
- "body_hash": "8a50eb2ee2a7080cec7c15cecaae2d88d544de3aa574d2964e4c7b1cd007e262",
- "chars": 7741,
- "summary_state": "pending",
- "summary": null,
- "crux": null
- },
- {
- "id": "test/ask-fusion.test.ts#makeOps",
- "name": "makeOps",
- "kind": "function",
- "path": "test/ask-fusion.test.ts",
- "span": "L120-L133",
- "signature": "function makeOps(bRaw: number): ScopeRankOps",
- "exported": false,
- "origin": "ast",
- "body_hash": "f3084c8993ffa26e4eae0137380efb9b1905f1a8b20eca904db995a40a51cc02",
- "summary_state": "pending",
- "summary": null,
+ "body_hash": "45fbe9e85b94fe0054f047d74a5888cadb3c80836e3f9be8fe9e3074f3efdc5a",
+ "summary_state": "ready",
+ "summary": "Defines options for the grep command-line interface, allowing customization of search behavior.",
"crux": null
},
{
- "id": "test/ask-fusion.test.ts#scopeDocs",
- "name": "scopeDocs",
+ "id": "src/search/grep-cli.ts#groupHeader",
+ "name": "groupHeader",
"kind": "function",
- "path": "test/ask-fusion.test.ts",
- "span": "L19-L21",
- "signature": "function scopeDocs(scope: string, scores: number[]): ScopedDoc[]",
+ "path": "src/search/grep-cli.ts",
+ "span": "L25-L28",
+ "signature": "function groupHeader(g: GrepGroup): string",
"exported": false,
"origin": "ast",
- "body_hash": "8d5a6b8359ac99c0090d6fe289ac6046438586342fae817aafd18bee03eb130d",
- "summary_state": "pending",
- "summary": null,
- "crux": null
- },
- {
- "id": "test/ask-index.test.ts",
- "name": "ask-index.test.ts",
- "kind": "file",
- "path": "test/ask-index.test.ts",
- "span": "L1-L378",
- "signature": null,
- "exported": true,
- "origin": "ast",
- "body_hash": "c9cd7c011ebd661f35488c59dcd34801079f2786d56e96833f4da7c45dfa37d7",
- "chars": 16112,
+ "body_hash": "49c6bc64382bd6a38a856a25d53b4f14ce0cb771fe4e9a34acfb07a6a2a85d46",
"summary_state": "ready",
- "summary": "This file contains tests to ensure the integrity and correctness of the `ask` sidecar functionality, verifying that it accurately reproduces live tokenization results and handles various edge cases without failure.",
- "crux": null
+ "summary": "Generates a header string for a group of grep results, summarizing the group's metadata.",
+ "crux": {
+ "code": "function groupHeader(g: GrepGroup): string {\n if (g.symbol) return `${g.symbol.name} · ${g.symbol.kind} · ${g.symbol.path}:${g.symbol.span} · ${g.inDegree} in-edges`;\n return `${g.path} (module level) · ${g.inDegree} in-edges`;\n}",
+ "span": "L24-L27"
+ }
},
{
- "id": "test/ask-index.test.ts#makeFixture",
- "name": "makeFixture",
+ "id": "src/search/grep-cli.ts#runGrepCommand",
+ "name": "runGrepCommand",
"kind": "function",
- "path": "test/ask-index.test.ts",
- "span": "L26-L50",
- "signature": "function makeFixture(): string",
- "exported": false,
+ "path": "src/search/grep-cli.ts",
+ "span": "L86-L115",
+ "signature": "function runGrepCommand(pattern: string, dir: string, opts: GrepCliOptions): void",
+ "exported": true,
"origin": "ast",
- "body_hash": "c90c21864f82921d79c49a3ab3b523d234323a0850a634de37d08abced8fd0f8",
+ "body_hash": "3161968bd9ae55839fa14ad57a480382b2251ce81b5efd31822247079b3759bc",
"summary_state": "ready",
- "summary": "Creates a temporary multi-file fixture with overlapping vocabulary to facilitate meaningful tests on tokenization and scoring.",
+ "summary": "Executes the grep command, handling graph resolution, pattern searching, and output formatting.",
"crux": {
- "code": "function makeFixture(): string {\n const dir = mkdtempSync(join(tmpdir(), \"graft-ask-index-\"));\n writeFileSync(\n join(dir, \"auth.ts\"),\n `/** Validate an incoming API request's auth token. */\\n` +\n `export function validateAuthToken(token: string): boolean {\\n` +\n ` return token.length > 0;\\n` +\n `}\\n\\n` +\n `export function authMiddleware(req: unknown): boolean {\\n` +\n ` return validateAuthToken(\"x\");\\n` +\n `}\\n`,\n );",
- "span": "L26-L37"
+ "code": "export function runGrepCommand(pattern: string, dir: string, opts: GrepCliOptions): void {\n const root = resolve(dir);\n const contextDir = contextDirFor(root, opts.globalDir);\n const graph = loadGraphCached(contextDir);\n if (!graph) {\n console.error(\"✗ no graph — run graft build first\");\n process.exit(1);\n }\n\n let result: GrepResult;\n try {\n result = grepGraph(graph, root, pattern, { ignoreCase: opts.ignoreCase, fixed: opts.fixed, in: opts.in });",
+ "span": "L83-L94"
}
},
{
- "id": "test/ask-index.test.ts#reinjectBodyText",
- "name": "reinjectBodyText",
+ "id": "src/search/grep-cli.ts#truncationNote",
+ "name": "truncationNote",
"kind": "function",
- "path": "test/ask-index.test.ts",
- "span": "L69-L85",
- "signature": "function reinjectBodyText(dir: string, outDir: string): void",
+ "path": "src/search/grep-cli.ts",
+ "span": "L43-L50",
+ "signature": "function truncationNote(result: GrepResult): string | null",
"exported": false,
"origin": "ast",
- "body_hash": "dd2e01921c74775b79f94544f814554415656ca604983fbcd14b10a0fea1a6b0",
+ "body_hash": "9cbadb17b0273dea383d0ef0676d8477d369fc7a2231c5b379039c3a96b46517",
"summary_state": "ready",
- "summary": "Reconstructs the body text for nodes in the wiring.json to ensure accurate tokenization results during tests.",
+ "summary": "Generates a note about any truncation in the grep results, indicating unreadable files or additional hits beyond the cap.",
"crux": {
- "code": " const wpath = wiringPath(outDir);\n const graph = JSON.parse(readFileSync(wpath, \"utf8\")) as GraphV1;\n const bodyById = new Map<string, string>();\n for (const entry of readdirSync(dir)) {\n const lang = languageOf(entry);\n if (!lang) continue;\n const source = readFileSync(join(dir, entry), \"utf8\");\n const { nodes } = extractFile(entry, source, lang);\n for (const n of nodes) if (n.body_text !== undefined) bodyById.set(n.id, n.body_text);\n }\n for (const n of graph.nodes as NodeV1[]) {\n const bt = bodyById.get(n.id);",
- "span": "L70-L81"
+ "code": "function truncationNote(result: GrepResult): string | null {\n const { files, hits } = result.truncated;\n if (files === 0 && hits === 0) return null;\n const parts: string[] = [];\n if (hits > 0) parts.push(`${hits} more hit${hits === 1 ? \"\" : \"s\"} beyond the cap`);\n if (files > 0) parts.push(`${files} indexed file${files === 1 ? \"\" : \"s\"} unreadable`);\n return `(truncated: ${parts.join(\", \")} — narrow with --in or refine the pattern)`;\n}",
+ "span": "L42-L49"
}
},
{
- "id": "test/ask-index.test.ts#sortPairs",
- "name": "sortPairs",
+ "id": "src/search/grep-cli.ts#zeroHitNote",
+ "name": "zeroHitNote",
"kind": "function",
- "path": "test/ask-index.test.ts",
- "span": "L106-L106",
- "signature": "sortPairs = (p: [string, number][])",
- "exported": false,
+ "path": "src/search/grep-cli.ts",
+ "span": "L72-L77",
+ "signature": "function zeroHitNote(result: GrepResult): string",
+ "exported": true,
"origin": "ast",
- "body_hash": "67de2733865dd8e5d635892fb085c3781a9a541c49ad2d112c8c150aaef655b6",
+ "body_hash": "358cfca22f9a047a4df8b6e452ca54936ac672908468fba2a3dddd7017505cce",
"summary_state": "ready",
- "summary": "Sorts an array of pairs by the first element, ensuring consistent ordering for comparison in tests.",
+ "summary": "Provides a detailed message for zero-hit results, explaining the absence of matches and potential issues.",
"crux": {
- "code": " const sortPairs = (p: [string, number][]) => [...p].sort((a, b) => a[0].localeCompare(b[0]));",
- "span": "L106-L106"
+ "code": "export function zeroHitNote(result: GrepResult): string {\n const base = `no hits for \"${result.pattern}\" in ${result.filesSearched} indexed files — unindexed files (docs, configs, new files) aren't searched; try grep -rn \"${result.pattern}\" for those`;\n const { files } = result.truncated;\n if (files === 0) return base;\n return `${base} — note: ${files} indexed file${files === 1 ? \"\" : \"s\"} could not be read (stale graph? run graft build)`;\n}",
+ "span": "L69-L74"
}
},
{
- "id": "test/ask.test.ts",
- "name": "ask.test.ts",
+ "id": "src/search/grep.ts",
+ "name": "grep.ts",
"kind": "file",
- "path": "test/ask.test.ts",
- "span": "L1-L651",
+ "path": "src/search/grep.ts",
+ "span": "L1-L201",
"signature": null,
"exported": true,
"origin": "ast",
- "body_hash": "8fb44f43e36a31cd9d0e517666c39bcd3db352be9b26743d67bb3a2ea3f31df9",
- "chars": 29002,
+ "body_hash": "f3405967f0d2e4aba158b720188369dbe913c6c12955aa1511cabed498fddaf9",
+ "chars": 6816,
"summary_state": "stale",
- "summary": "Contains tests for the `ask` functionality, validating its behavior with various options and scenarios.",
+ "summary": "This file implements a regex search over indexed files in a graph, grouping results by their enclosing symbols and ranking them by their importance based on incoming edges.",
"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": "L27-L38"
+ "code": " * `graft grep` core: regex search over the graph's indexed files, with hits\n * grouped by their innermost enclosing symbol and ranked by incoming-edge\n * count (coupling) — a grep that answers \"which of these hits matters\",\n * because plain `grep -rn` gives no way to tell a hit inside a\n * heavily-depended-on function from one inside dead code.",
+ "span": "L2-L6"
}
},
{
- "id": "test/ask.test.ts#duplicateNameFixture",
- "name": "duplicateNameFixture",
- "kind": "function",
- "path": "test/ask.test.ts",
- "span": "L555-L570",
- "signature": "function duplicateNameFixture(): string",
- "exported": false,
- "origin": "ast",
- "body_hash": "65d26c7671c925c41a2a09cad0036295c2ad65006b7f1a58c0c460bed2b31ddd",
- "summary_state": "pending",
- "summary": null,
- "crux": null
- },
- {
- "id": "test/ask.test.ts#idfShiftFixture",
- "name": "idfShiftFixture",
- "kind": "function",
- "path": "test/ask.test.ts",
- "span": "L370-L381",
- "signature": "function idfShiftFixture(): string",
- "exported": false,
- "origin": "ast",
- "body_hash": "8a01704e38cec0ac645d0230c648b406a620aabb1cb504882c8badcb533027e3",
- "summary_state": "pending",
- "summary": null,
- "crux": null
- },
- {
- "id": "test/ask.test.ts#makeFixture",
- "name": "makeFixture",
+ "id": "src/search/grep.ts#computeInDegree",
+ "name": "computeInDegree",
"kind": "function",
- "path": "test/ask.test.ts",
- "span": "L17-L26",
- "signature": "function makeFixture(): string",
+ "path": "src/search/grep.ts",
+ "span": "L123-L130",
+ "signature": "function computeInDegree(graph: GraphV1): Map<string, number>",
"exported": false,
"origin": "ast",
- "body_hash": "2782fc6b3f2efa27b0c0195482a4b138e1ec02bd16da279313966e96a6d807e8",
+ "body_hash": "614d2e67e179ee5a934d6c1b03134ca1e1c394d3036a1754bd41dd7ee8dcc1b7",
"summary_state": "ready",
- "summary": "Creates a temporary directory with a sample TypeScript file for testing purposes.",
+ "summary": "Calculates the incoming edge count for each symbol in the graph, which is used to rank grep hits by importance.",
"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"
+ "code": "function computeInDegree(graph: GraphV1): Map<string, number> {\n const deg = new Map<string, number>();\n for (const e of graph.edges) {\n if (!WALK_RELATIONS.has(e.relation)) continue;\n deg.set(e.target, (deg.get(e.target) ?? 0) + 1);\n }\n return deg;\n}",
+ "span": "L119-L126"
}
},
{
- "id": "test/ask.test.ts#multiScopeFixture",
- "name": "multiScopeFixture",
+ "id": "src/search/grep.ts#enclosingSymbol",
+ "name": "enclosingSymbol",
"kind": "function",
- "path": "test/ask.test.ts",
- "span": "L277-L310",
- "signature": "function multiScopeFixture(): string",
+ "path": "src/search/grep.ts",
+ "span": "L112-L119",
+ "signature": "function enclosingSymbol(symbols: SymbolSpan[], line: number): NodeV1 | null",
"exported": false,
"origin": "ast",
- "body_hash": "861ae2479922824311b7da16753f6517024cd4f5989bc02070ca3ec7d0270cf2",
- "summary_state": "pending",
- "summary": null,
- "crux": null
+ "body_hash": "980763724d7cfb9637d1a82b38f90ee4c1659a6ad4e06eb8b42ce19d6df771b0",
+ "summary_state": "ready",
+ "summary": "Finds the innermost symbol that contains a specified line number, returning the corresponding node from the graph.",
+ "crux": {
+ "code": "function enclosingSymbol(symbols: SymbolSpan[], line: number): NodeV1 | null {\n let found: NodeV1 | null = null;\n for (const s of symbols) {\n if (s.start > line) break;\n if (line <= s.end) found = s.node;\n }\n return found;\n}",
+ "span": "L108-L115"
+ }
},
{
- "id": "test/ask.test.ts#qualifiedFixture",
- "name": "qualifiedFixture",
+ "id": "src/search/grep.ts#escapeRegExp",
+ "name": "escapeRegExp",
"kind": "function",
- "path": "test/ask.test.ts",
- "span": "L190-L208",
- "signature": "function qualifiedFixture(): string",
+ "path": "src/search/grep.ts",
+ "span": "L79-L81",
+ "signature": "function escapeRegExp(s: string): string",
"exported": false,
"origin": "ast",
- "body_hash": "9d1086ae8f0a6226d68cdbf7006c21e891972897ebe7510d188f913958306ca2",
+ "body_hash": "4c6310d2cd2f62c68b872392c4843cb011bea7ced8f1ff4db8c010c952f60ba7",
"summary_state": "ready",
- "summary": "Sets up a temporary directory with a cache implementation to test structural resolution of function calls.",
+ "summary": "Escapes special characters in a string to create a safe regex pattern for searching.",
"crux": {
- "code": " `export function loadItem(key: string): string {\\n` +\n ` const c = new Cache();\\n` +\n ` return c.get(key);\\n` +",
- "span": "L198-L200"
+ "code": "function escapeRegExp(s: string): string {\n return s.replace(/[.*+?^${}()|[\\]\\\\]/g, \"\\\\$&\");\n}",
+ "span": "L75-L77"
}
},
{
- "id": "test/ask.test.ts#rankOf",
- "name": "rankOf",
+ "id": "src/search/grep.ts#grepGraph",
+ "name": "grepGraph",
"kind": "function",
- "path": "test/ask.test.ts",
- "span": "L388-L388",
- "signature": "rankOf = (r: ReturnType<typeof ask>[\"hits\"], title: string)",
- "exported": false,
- "origin": "ast",
- "body_hash": "c03a498c384ff31544d9daa078d91655c746bfcf8f10830ad1e4f0f720e14717",
- "summary_state": "pending",
- "summary": null,
- "crux": null
+ "path": "src/search/grep.ts",
+ "span": "L137-L200",
+ "signature": "function grepGraph(graph: GraphV1, repoRoot: string, pattern: string, opts: GrepOptions = {}): GrepResult",
+ "exported": true,
+ "origin": "ast",
+ "body_hash": "468a117edd348b57d625a7e44c9b15ad2e67c220296b40961aa6903eefacef76",
+ "summary_state": "stale",
+ "summary": "Performs the grep search on the graph, collecting and returning results based on the specified pattern and options.",
+ "crux": {
+ "code": "export function grepGraph(graph: GraphV1, repoRoot: string, pattern: string, opts: GrepOptions = {}): GrepResult {\n const maxHits = opts.maxHits ?? DEFAULT_MAX_HITS;\n const source = opts.fixed ? escapeRegExp(pattern) : pattern;\n const regex = new RegExp(source, opts.ignoreCase ? \"i\" : \"\");\n\n const inDegree = computeInDegree(graph);\n const fileNodes = graph.nodes.filter((n) => n.kind === \"file\" && (!opts.in || n.path.includes(opts.in)));\n\n const groups = new Map<string, GrepGroup>();\n let collected = 0;\n let truncatedHits = 0;\n let truncatedFiles = 0;",
+ "span": "L133-L144"
+ }
},
{
- "id": "test/ask.test.ts#siblingPrefixFixture",
- "name": "siblingPrefixFixture",
- "kind": "function",
- "path": "test/ask.test.ts",
- "span": "L336-L343",
- "signature": "function siblingPrefixFixture(): string",
- "exported": false,
+ "id": "src/search/grep.ts#GrepGroup",
+ "name": "GrepGroup",
+ "kind": "interface",
+ "path": "src/search/grep.ts",
+ "span": "L34-L43",
+ "signature": "interface GrepGroup",
+ "exported": true,
"origin": "ast",
- "body_hash": "c852d824057f313b5bb59d469c1e04b442dc6b8a3f15e5643e8edbb98c0504f1",
- "summary_state": "pending",
- "summary": null,
- "crux": null
+ "body_hash": "f6498adee93c3a0c7386dd6fd4ffb9ad0e73c2ce5fc6e13c041cdc1c495bdf1d",
+ "summary_state": "ready",
+ "summary": "Groups grep hits by their enclosing symbol, providing context such as the symbol's in-degree and the path of the file.",
+ "crux": {
+ "code": " /** null → file-level: the hit lies outside every indexed symbol's span\n * (module-level code — imports, top-level statements, module constants). */\n symbol: GrepSymbolRef | null;\n path: string;\n /** Incoming WALK_RELATIONS edges targeting the symbol — always 0 for\n * file-level groups (there's no single symbol id to count edges against). */\n inDegree: number;\n hits: GrepHit[];\n}",
+ "span": "L34-L42"
+ }
},
{
- "id": "test/ask.test.ts#stampCrux",
- "name": "stampCrux",
- "kind": "function",
- "path": "test/ask.test.ts",
- "span": "L44-L50",
- "signature": "function stampCrux(dir: string, code: string): void",
- "exported": false,
+ "id": "src/search/grep.ts#GrepHit",
+ "name": "GrepHit",
+ "kind": "interface",
+ "path": "src/search/grep.ts",
+ "span": "L18-L22",
+ "signature": "interface GrepHit",
+ "exported": true,
"origin": "ast",
- "body_hash": "88e65ff2cd0c7e96135c81d1072a15b210a7b2ddad022394ea8f59f6842dcbf4",
+ "body_hash": "5a03009952d496614e173831d994debd5b88d66861aa8b4ebb0617e5fb792a5f",
"summary_state": "ready",
- "summary": "Updates the wiring.json file to include a crux for the specified node, allowing for inlined source retrieval.",
+ "summary": "Represents a single hit found during the grep search, including the line number and trimmed text of the line.",
"crux": {
- "code": " n.crux = { code, span: \"L2-L2\" };",
- "span": "L47-L47"
+ "code": " line: number;\n /** Trimmed line text, capped at 160 chars. */\n text: string;",
+ "span": "L18-L20"
}
},
{
- "id": "test/claude-format.test.ts",
- "name": "claude-format.test.ts",
- "kind": "file",
- "path": "test/claude-format.test.ts",
- "span": "L1-L157",
- "signature": null,
+ "id": "src/search/grep.ts#GrepOptions",
+ "name": "GrepOptions",
+ "kind": "interface",
+ "path": "src/search/grep.ts",
+ "span": "L64-L73",
+ "signature": "interface GrepOptions",
"exported": true,
"origin": "ast",
- "body_hash": "1696c17377f2a228112d0a3d568cb04b3583d4f6b1c892dc731bd090cde62fc4",
- "chars": 7466,
- "summary_state": "stale",
- "summary": "This test suite verifies the functionality of various formatting and retrieval functions related to the status line and enriched segments in a codebase, ensuring correct rendering based on different states and inputs.",
+ "body_hash": "0d3f66c959733069e27d33cb53e110dd9f6606d3e77b71362b3c95e9c5a86646",
+ "summary_state": "ready",
+ "summary": "Holds options for configuring the grep search, such as case sensitivity and maximum hits to collect.",
"crux": {
- "code": "test('not-built state', () => {\n const lines = renderStatusline(null, null, { ctxPct: null });\n assert.match(strip(lines[0]), /not built/);\n});\n\ntest('enriched segment hidden when zero ready', () => {\n assert.equal(enrichedSegment({ ...emptyStats(), totalCount: 10, readyCount: 0 }), null);\n});\n\ntest('enriched segment shown when >=1 ready', () => {\n const seg = enrichedSegment({ ...emptyStats(), totalCount: 4, readyCount: 2 });\n assert.equal(strip(seg!), '50% enriched');",
- "span": "L8-L19"
+ "code": "export interface GrepOptions {\n ignoreCase?: boolean;\n /** Treat `pattern` as a literal string (regex-escaped), not a regex. */\n fixed?: boolean;\n /** Narrow to file nodes whose path contains this substring. */\n in?: string;\n /** Stop collecting hits after this many; the rest are tallied into\n * `truncated.hits`. Default 300. */\n maxHits?: number;\n}",
+ "span": "L60-L69"
}
},
{
- "id": "test/claude-format.test.ts#freshSession",
- "name": "freshSession",
- "kind": "function",
- "path": "test/claude-format.test.ts",
- "span": "L105-L105",
- "signature": "freshSession = ()",
- "exported": false,
+ "id": "src/search/grep.ts#GrepResult",
+ "name": "GrepResult",
+ "kind": "interface",
+ "path": "src/search/grep.ts",
+ "span": "L45-L62",
+ "signature": "interface GrepResult",
+ "exported": true,
"origin": "ast",
- "body_hash": "61509362f702d01df4dfd7777521ae04e30c0dbc1656070024e4712c763314ee",
- "summary_state": "ready",
- "summary": "Initializes a fresh session state for testing the relevant retrieval process.",
+ "body_hash": "3c2826b6ccea2928580aa2a73561f99a6a0aae6b12bf84274c90a1b2fb8a72ab",
+ "summary_state": "stale",
+ "summary": "Encapsulates the results of a grep operation, including the pattern searched, total hits, and grouped results.",
"crux": {
- "code": "const freshSession = () => ({ lastQuery: null, perAgentQuery: {}, graftReads: 0, sourceReads: 0, savedTokens: 0, injectedPointers: [] as string[] });",
- "span": "L105-L105"
+ "code": "export interface GrepResult {\n pattern: string;\n /** Indexed file nodes considered (after the `in` filter), whether or not\n * each was actually readable — matches the CLI's \"searched N indexed\n * files\" wording. */\n filesSearched: number;\n /** Hits actually collected (<= maxHits). */\n totalHits: number;\n /** Sorted: inDegree desc, then path asc. */\n groups: GrepGroup[];\n /** Dropped counts — never silent. `files`: indexed file nodes that\n * couldn't be read from disk. `hits`: matches found beyond `maxHits`,",
+ "span": "L44-L55"
}
},
{
- "id": "test/claude-format.test.ts#gateAsk",
- "name": "gateAsk",
- "kind": "function",
- "path": "test/claude-format.test.ts",
- "span": "L97-L104",
- "signature": "gateAsk = (over: Record<string, unknown> = {})",
- "exported": false,
+ "id": "src/search/grep.ts#GrepSymbolRef",
+ "name": "GrepSymbolRef",
+ "kind": "interface",
+ "path": "src/search/grep.ts",
+ "span": "L24-L32",
+ "signature": "interface GrepSymbolRef",
+ "exported": true,
"origin": "ast",
- "body_hash": "34d03c21985709ffe94de675b861d213c0d38d4794d221e1dd41f634f1837117",
+ "body_hash": "021dcfb0dffc4d64379a0dd13b7f8ba1c31d66ed199cd35a08b0d877fa39e0e4",
"summary_state": "ready",
- "summary": "Creates a structured query object for testing relevant retrieval functionality with customizable parameters.",
+ "summary": "Defines a reference to a symbol in the graph, including its qualified name and span, to facilitate grouping grep hits by their enclosing symbols.",
"crux": {
- "code": "const gateAsk = (over: Record<string, unknown> = {}) => ({\n query: 'pkce', mode: 'lexical', coverage: 1,\n hits: [\n { kind: 'symbol', title: 'verify', pointer: 'src/pkce.ts:L1-L4', snippet: 's', score: 1 },\n { kind: 'symbol', title: 'gen', pointer: 'src/pkce.ts:L6-L9', snippet: 's', score: 0.8 },\n ],\n ...over,\n}) as any;",
- "span": "L97-L104"
+ "code": " id: string;\n /** Qualified scope-joined name (e.g. `FastAPI.include_router`), not just\n * the bare symbol name — the id's segment after the file-path `#`. */\n name: string;\n kind: string;\n path: string;\n span: string;",
+ "span": "L24-L30"
}
},
{
- "id": "test/claude-format.test.ts#strip",
- "name": "strip",
+ "id": "src/search/grep.ts#spanBounds",
+ "name": "spanBounds",
"kind": "function",
- "path": "test/claude-format.test.ts",
- "span": "L6-L6",
- "signature": "strip = (s: string)",
+ "path": "src/search/grep.ts",
+ "span": "L83-L87",
+ "signature": "function spanBounds(span: string): { start: number; end: number } | null",
"exported": false,
"origin": "ast",
- "body_hash": "6381d72b2af2fa01d40d5fa8e463da782c5fe5655ad06caec8a3184ee6546edc",
+ "body_hash": "07501d016c2decb33d98ef556db8322d35e7753945a15803d9579b03bd80d5a1",
"summary_state": "ready",
- "summary": "Removes ANSI escape codes from a string to ensure clean output for assertions.",
+ "summary": "Extracts the start and end line numbers from a span string, returning null if the format is invalid.",
"crux": {
- "code": "const strip = (s: string) => s.replace(/\\x1b\\[[0-9;]*m/g, '');",
- "span": "L6-L6"
+ "code": "function spanBounds(span: string): { start: number; end: number } | null {\n const m = SPAN_RE.exec(span);\n if (!m) return null;\n return { start: Number(m[1]), end: Number(m[2]) };\n}",
+ "span": "L79-L83"
}
},
{
- "id": "test/claude-hooks.test.ts",
- "name": "claude-hooks.test.ts",
- "kind": "file",
- "path": "test/claude-hooks.test.ts",
- "span": "L1-L140",
- "signature": null,
- "exported": true,
+ "id": "src/search/grep.ts#symbolsOf",
+ "name": "symbolsOf",
+ "kind": "function",
+ "path": "src/search/grep.ts",
+ "span": "L97-L106",
+ "signature": "function symbolsOf(graph: GraphV1, path: string): SymbolSpan[]",
+ "exported": false,
"origin": "ast",
- "body_hash": "875c10776da455499b58ebe861b3cb0ae797f751e4e838812cd0b4f3c13587c2",
- "chars": 6930,
+ "body_hash": "26481c2032801b2e8e12980416a4d10b1a1bddb66c0d6d4bfa97cb918c94f0c4",
"summary_state": "ready",
- "summary": "This file contains tests for the functionality of the graft hooks in the Claude project, ensuring that edits are detected and state is managed correctly.",
+ "summary": "Retrieves and sorts the symbols of a given file in the graph, based on their span start lines.",
"crux": {
- "code": "test('underGraft detects edits inside graft/', () => {\n assert.equal(underGraft('/repo', '/repo/graft/x.md'), true);\n assert.equal(underGraft('/repo', '/repo/src/cli.ts'), false);\n});\n\ntest('post-edit marks dirty and records lastFile', async () => {\n const d = mkdtempSync(join(tmpdir(), 'graft-hooks-'));\n mkdirSync(join(d, 'graft', '.graph'), { recursive: true });\n writeFileSync(join(d, 'graft', '.graph', 'wiring.json'),\n JSON.stringify({ meta: { nodeCount: 0, edgeCount: 0, languages: [] }, nodes: [], edges: [] }));\n // graft check will fail (no dist/cli.js here) → staleCount falls back to 0, but dirty must still be set.\n process.env.CLAUDE_PROJECT_DIR = d;",
- "span": "L11-L22"
+ "code": "function symbolsOf(graph: GraphV1, path: string): SymbolSpan[] {\n const out: SymbolSpan[] = [];\n for (const n of graph.nodes) {\n if (n.kind === \"file\" || n.path !== path) continue;\n const b = spanBounds(n.span);\n if (b) out.push({ node: n, start: b.start, end: b.end });\n }\n out.sort((a, b) => a.start - b.start);\n return out;\n}",
+ "span": "L93-L102"
}
},
{
- "id": "test/claude-hooks.test.ts#fakeBuild",
- "name": "fakeBuild",
- "kind": "function",
- "path": "test/claude-hooks.test.ts",
- "span": "L84-L87",
- "signature": "fakeBuild = (dir: string)",
+ "id": "src/search/grep.ts#SymbolSpan",
+ "name": "SymbolSpan",
+ "kind": "interface",
+ "path": "src/search/grep.ts",
+ "span": "L89-L93",
+ "signature": "interface SymbolSpan",
"exported": false,
"origin": "ast",
- "body_hash": "0eb606c28f6d7ec57d7fe9a9824b87942c0682ddb75d37fd911508366e5ac9e5",
+ "body_hash": "ed659214924ee7e720952748e5e217835cb3988e58c0a840f85800c1207cd6f3",
"summary_state": "ready",
- "summary": "This function simulates a build process by writing a mock wiring.json file to the specified directory, allowing tests to verify behavior based on the build output.",
+ "summary": "Represents a span of a symbol in the graph, including its start and end lines, to assist in finding enclosing symbols.",
"crux": {
- "code": " const fakeBuild = (dir: string) => writeFileSync(join(dir, 'graft', '.graph', 'wiring.json'),\n JSON.stringify({ meta: { nodeCount: 2, edgeCount: 1, languages: ['typescript'] },\n nodes: [{ id: 'a', summary_state: 'ready' }, { id: 'b', summary_state: 'pending' }],\n edges: [{ from: 'a', to: 'b' }] }));",
- "span": "L84-L87"
+ "code": "interface SymbolSpan {\n node: NodeV1;\n start: number;\n end: number;\n}",
+ "span": "L85-L89"
}
},
{
- "id": "test/claude-hooks.test.ts#runWithStdin",
- "name": "runWithStdin",
+ "id": "src/search/grep.ts#toSymbolRef",
+ "name": "toSymbolRef",
"kind": "function",
- "path": "test/claude-hooks.test.ts",
- "span": "L38-L41",
- "signature": "async function runWithStdin(text: string, fn: () => Promise<void>): Promise<void>",
+ "path": "src/search/grep.ts",
+ "span": "L132-L135",
+ "signature": "function toSymbolRef(n: NodeV1): GrepSymbolRef",
"exported": false,
"origin": "ast",
- "body_hash": "6bf4b171a46fcfcceccaedd45a273ed78fac5a1b4ae47bbd881df4e54c33b912",
+ "body_hash": "f527f108414f4112517e03e555c78d998f5d3cea3a6bf89b2f9b383bc73aa732",
"summary_state": "ready",
- "summary": "This function sets up the environment to run a given asynchronous function with specified input from stdin, managing the environment variable for the duration of the execution.",
+ "summary": "Converts a node in the graph to a GrepSymbolRef, providing a structured representation of the symbol.",
"crux": {
- "code": " process.env.GRAFT_TEST_STDIN = text;\n try { await fn(); } finally { delete process.env.GRAFT_TEST_STDIN; }\n}",
- "span": "L39-L41"
+ "code": "function toSymbolRef(n: NodeV1): GrepSymbolRef {\n const hash = n.id.indexOf(\"#\");\n return { id: n.id, name: hash >= 0 ? n.id.slice(hash + 1) : n.name, kind: n.kind, path: n.path, span: n.span };\n}",
+ "span": "L128-L131"
}
},
{
- "id": "test/claude-init.test.ts",
- "name": "claude-init.test.ts",
+ "id": "src/util/id.ts",
+ "name": "id.ts",
"kind": "file",
- "path": "test/claude-init.test.ts",
- "span": "L1-L137",
+ "path": "src/util/id.ts",
+ "span": "L1-L17",
"signature": null,
"exported": true,
"origin": "ast",
- "body_hash": "b582cd79b2a1e4952ff83ac1b2e85f742756443c2896e08d96a75dc76e2971a5",
- "chars": 6213,
+ "body_hash": "5fabc8ddcc3abc907ce69f04ad2ebe51933262cf44aa2dfd40589f71f1926e8a",
+ "chars": 626,
"summary_state": "ready",
- "summary": "This file contains tests for the initialization logic of the graft system, ensuring that settings and skills are correctly scaffolded and managed during the initialization process.",
- "crux": {
- "code": "test('runInit scaffolds settings + both shims + the skill (build skipped)', () => {\n const d = fresh();\n const r = runInit(d, { build: false });\n assert.ok(existsSync(join(d, '.claude', 'settings.json')));\n assert.ok(existsSync(join(d, '.claude', 'helpers', 'graft-statusline.cjs')));\n assert.ok(existsSync(join(d, '.claude', 'helpers', 'graft-hooks.cjs')));\n const skillPath = join(d, '.claude', 'skills', 'graft', 'SKILL.md');\n assert.ok(existsSync(skillPath), 'writes the graft skill');\n assert.equal(r.skill, skillPath);\n assert.match(readFileSync(skillPath, 'utf8'), /name: graft/);\n assert.equal(r.built, false);\n const s = JSON.parse(readFileSync(join(d, '.claude', 'settings.json'), 'utf8'));",
- "span": "L19-L30"
- }
+ "summary": "This file provides utility functions for generating unique identifiers, creating content hashes, and normalizing names for consistent matching.",
+ "crux": null
},
{
- "id": "test/claude-init.test.ts#col",
- "name": "col",
+ "id": "src/util/id.ts#contentHash",
+ "name": "contentHash",
"kind": "function",
- "path": "test/claude-init.test.ts",
- "span": "L116-L116",
- "signature": "col = (text: string, marker: string)",
- "exported": false,
+ "path": "src/util/id.ts",
+ "span": "L9-L11",
+ "signature": "function contentHash(input: string): string",
+ "exported": true,
"origin": "ast",
- "body_hash": "0b37f9523b6cb61e19981676c6eea4c39d624029fbc06e88392bb90dec866d68",
+ "body_hash": "d83ce720108cb9ea3b0c7b1e7034657603640647ca00283905fcd099ac3fe2ed",
"summary_state": "ready",
- "summary": "Determines the column alignment for specific text markers in the output, ensuring consistent formatting in the display.",
+ "summary": "This function creates a stable hash of the input content, which is essential for deduplication of documents.",
"crux": {
- "code": " const col = (text: string, marker: string) => text.split('\\n').find((l) => l.includes(marker))!.indexOf('a new session');",
- "span": "L116-L116"
+ "code": " return createHash(\"sha256\").update(input).digest(\"hex\");",
+ "span": "L10-L10"
}
},
{
- "id": "test/claude-init.test.ts#fresh",
- "name": "fresh",
+ "id": "src/util/id.ts#newId",
+ "name": "newId",
"kind": "function",
- "path": "test/claude-init.test.ts",
- "span": "L10-L10",
- "signature": "function fresh(): string",
- "exported": false,
+ "path": "src/util/id.ts",
+ "span": "L4-L6",
+ "signature": "function newId(prefix: string): string",
+ "exported": true,
"origin": "ast",
- "body_hash": "e730884fcd6a9cadcca1e8a2f33564442c1ea4a2d1589c56af4b51b6de23d940",
+ "body_hash": "55062dee898e1edb76d65f7daf785b67e998a57a7dfd6f78c7eb17f39e3e1dc0",
"summary_state": "ready",
- "summary": "Creates a fresh temporary directory for testing purposes, ensuring isolation between test runs.",
+ "summary": "This function generates a unique identifier with a specified prefix, solving the need for easily identifiable and unique keys.",
"crux": {
- "code": "function fresh(): string { return mkdtempSync(join(tmpdir(), 'graft-init-')); }",
- "span": "L10-L10"
+ "code": " return `${prefix}_${randomUUID().replace(/-/g, \"\").slice(0, 20)}`;",
+ "span": "L5-L5"
}
},
{
- "id": "test/claude-init.test.ts#runPostinstall",
- "name": "runPostinstall",
+ "id": "src/util/id.ts#normalizeName",
+ "name": "normalizeName",
"kind": "function",
- "path": "test/claude-init.test.ts",
- "span": "L12-L17",
- "signature": "function runPostinstall(env: Record<string, string>): string",
- "exported": false,
+ "path": "src/util/id.ts",
+ "span": "L14-L16",
+ "signature": "function normalizeName(name: string): string",
+ "exported": true,
"origin": "ast",
- "body_hash": "a9ee9b51b2acd9ee930e28e5c0968dc94c648d848eac513230143d3acadae7e7",
+ "body_hash": "bac0e298462067a441b2b76566ed29c3787280585b956f84b81d7a766cd7211a",
"summary_state": "ready",
- "summary": "Executes the post-installation script, which sets up necessary configurations after the main initialization process.",
+ "summary": "This function normalizes names for case- and whitespace-insensitive matching, ensuring consistency in name comparisons.",
"crux": {
- "code": "function runPostinstall(env: Record<string, string>): string {\n try {\n return execFileSync(process.execPath, ['scripts/postinstall.mjs'],\n { encoding: 'utf8', env: { ...process.env, ...env } });\n } catch { return ''; }",
- "span": "L12-L16"
+ "code": " return name.trim().toLowerCase().replace(/\\s+/g, \" \");",
+ "span": "L15-L15"
}
},
{
- "id": "test/claude-paths.test.ts",
- "name": "claude-paths.test.ts",
+ "id": "src/viz/assemble.ts",
+ "name": "assemble.ts",
"kind": "file",
- "path": "test/claude-paths.test.ts",
- "span": "L1-L24",
+ "path": "src/viz/assemble.ts",
+ "span": "L1-L131",
"signature": null,
"exported": true,
"origin": "ast",
- "body_hash": "205740f8110e72e4cb24652c09f763fad5e056dc77776bcfa95a1953731ed2c8",
- "chars": 1063,
+ "body_hash": "58ad5caed087bd7b929f5b625501a607e79e0476f998636bec241e0296706ece",
+ "chars": 4233,
"summary_state": "ready",
- "summary": "This test file verifies that the paths for the graft CLI and Claude script are correctly resolved relative to the module structure, ensuring they are independent of the current working directory.",
+ "summary": "Assembles a comprehensive graph document from markdown files in a context directory, ensuring that only valid nodes and edges are included.",
"crux": {
- "code": "test('graftCliPath is module-relative (cwd-independent) and points at a sibling cli.js', () => {\n const a = graftCliPath();\n const orig = process.cwd();\n try { process.chdir('/'); assert.equal(graftCliPath(), a, 'must not depend on cwd / project dir'); }\n finally { process.chdir(orig); }\n assert.match(a, /[/\\\\]cli\\.js$/);\n // cli.js sits one level above the claude module dir → its parent dir is src (tsx) or dist (built)\n assert.match(basename(dirname(a)), /^(src|dist)$/);\n});\n\ntest('claudeScriptPath resolves a sibling script in the claude dir (cwd-independent)', () => {\n const a = claudeScriptPath('sync-run.js');",
- "span": "L6-L17"
+ "code": "/** Read a context dir and assemble the render-ready graph document. */\nexport function assembleContextGraph(contextDir: string): VizGraph {\n const nodes: VizNode[] = [];\n const rawEdges: VizEdge[] = [];\n let skippedFiles = 0;\n\n if (existsSync(contextDir)) {\n for (const entry of readdirSync(contextDir).sort()) {\n if (!entry.endsWith(\".md\")) continue;\n let parsed: matter.GrayMatterFile<string>;\n try {\n parsed = matter(readFileSync(join(contextDir, entry), \"utf8\"));",
+ "span": "L78-L89"
}
},
{
- "id": "test/claude-settings-merge.test.ts",
- "name": "claude-settings-merge.test.ts",
- "kind": "file",
- "path": "test/claude-settings-merge.test.ts",
- "span": "L1-L84",
- "signature": null,
+ "id": "src/viz/assemble.ts#assembleContextGraph",
+ "name": "assembleContextGraph",
+ "kind": "function",
+ "path": "src/viz/assemble.ts",
+ "span": "L79-L130",
+ "signature": "function assembleContextGraph(contextDir: string): VizGraph",
"exported": true,
"origin": "ast",
- "body_hash": "4c8b800f02d1b72050082bdbcdcda0878e5d9760563d2e1ca4a31cb06ffaaabb",
- "chars": 4109,
+ "body_hash": "8529626bef8abf2e1a326d601cf5a6a4972e0a1b801d6b653ba8227a27b9dbbd",
"summary_state": "ready",
- "summary": "This test suite verifies the behavior of merging Graft settings, ensuring that defaults are applied correctly, existing configurations are preserved, and no duplicates are introduced during re-initialization.",
+ "summary": "Processes markdown files in a specified directory to create a structured visualization graph, handling errors gracefully.",
"crux": {
- "code": "test('empty settings gets the full Graft blocks', () => {\n const { merged, warnings } = mergeGraftSettings({});\n assert.equal(merged.statusLine.command, SL);\n assert.equal(merged.subagentStatusLine.command, SL);\n assert.ok(Array.isArray(merged.hooks.PostToolUse));\n assert.equal(merged.hooks.PostToolUse[0].matcher, 'Write|Edit|MultiEdit');\n for (const e of ['PostToolUse', 'UserPromptSubmit', 'SessionStart', 'Stop']) {\n assert.ok(merged.hooks[e][0].hooks[0].command.includes('graft-hooks.cjs'), `${e} wired`);\n }\n assert.ok(merged.footerLinksRegexes.includes('graft/[\\\\w./-]+\\\\.md'));\n assert.deepEqual(warnings, []);\n});",
- "span": "L7-L18"
+ "code": " if (existsSync(contextDir)) {\n for (const entry of readdirSync(contextDir).sort()) {\n if (!entry.endsWith(\".md\")) continue;\n let parsed: matter.GrayMatterFile<string>;\n try {\n parsed = matter(readFileSync(join(contextDir, entry), \"utf8\"));\n } catch {\n skippedFiles++;\n continue;\n }\n const fm = parsed.data as Record<string, unknown>;\n const id = String(fm.slug ?? entry.replace(/\\.md$/, \"\"));",
+ "span": "L84-L95"
}
},
{
- "id": "test/claude-shim-template.test.ts",
- "name": "claude-shim-template.test.ts",
- "kind": "file",
- "path": "test/claude-shim-template.test.ts",
- "span": "L1-L34",
- "signature": null,
- "exported": true,
+ "id": "src/viz/assemble.ts#extractSummary",
+ "name": "extractSummary",
+ "kind": "function",
+ "path": "src/viz/assemble.ts",
+ "span": "L65-L76",
+ "signature": "function extractSummary(body: string): string",
+ "exported": false,
"origin": "ast",
- "body_hash": "f787f99fef2dc6a5ed366419fc470e8e4f825e0bc590cf3550d39e01995e7619",
- "chars": 1585,
+ "body_hash": "1857e477bdb012672fa843cfca8d43eb543e7cfba2cc496692a65ebe8c0fa6c5",
"summary_state": "ready",
- "summary": "This test file validates the behavior of the statusline and hooks shims to ensure they correctly parse and resolve module paths in a Node.js environment.",
+ "summary": "Extracts and cleans the summary text from a markdown node's content, ensuring it adheres to length constraints.",
"crux": {
- "code": " const body = src.replace(/^#!.*\\n/, ''); // strip shebang for vm\n assert.doesNotThrow(() => new vm.Script(body), 'valid JS');\n\n // 1. baked dir is present as the first candidate\n assert.match(src, new RegExp(`const BAKED = \"${BAKED}\"`));\n // 2. repo node_modules via require.resolve from the project dir\n assert.match(src, /require\\.resolve\\('@nanonets\\/graft\\/package\\.json', \\{ paths: \\[base\\] \\}\\)/);\n assert.match(src, /fromPkg\\(dir\\)/);\n // 3. legacy execPath/../lib guess retained\n assert.match(src, /path\\.join\\(path\\.dirname\\(process\\.execPath\\), '\\.\\.', 'lib'\\)/);\n // 4. npm root -g catch-all, queried on demand (no on-disk cache)\n assert.match(src, /execFileSync\\('npm', \\['root', '-g'\\]/);",
- "span": "L10-L21"
+ "code": "function extractSummary(body: string): string {\n let text = body;\n const start = text.indexOf(GEN_START);\n const end = text.indexOf(GEN_END);\n if (start >= 0 && end > start) text = text.slice(start + GEN_START.length, end);\n // Keep only the Summary section if headings are present.\n const related = text.indexOf(\"## Related\");\n if (related >= 0) text = text.slice(0, related);\n text = text.replace(/^##\\s+Summary\\s*$/m, \"\");\n text = text.trim();\n return text.length > SUMMARY_MAX ? text.slice(0, SUMMARY_MAX).trimEnd() + \"…\" : text;",
+ "span": "L65-L75"
}
},
{
- "id": "test/claude-skill-template.test.ts",
- "name": "claude-skill-template.test.ts",
- "kind": "file",
- "path": "test/claude-skill-template.test.ts",
- "span": "L1-L21",
- "signature": null,
+ "id": "src/viz/assemble.ts#normalizeRelation",
+ "name": "normalizeRelation",
+ "kind": "function",
+ "path": "src/viz/assemble.ts",
+ "span": "L56-L58",
+ "signature": "function normalizeRelation(rel: string): string",
"exported": true,
"origin": "ast",
- "body_hash": "50c33ebe05bb251de0fd754dc4b75fe915e7db642ffd53c99198d1624a6ed723",
- "chars": 1199,
- "summary_state": "stale",
- "summary": "This test ensures that the generated skill template adheres to the expected format and contains the necessary components for functionality.",
+ "body_hash": "adfaae55d1d21718adbedaa294194517aa7abdddeb95433642fd358137e48909",
+ "summary_state": "ready",
+ "summary": "Maps legacy vague verbs to concrete verbs to maintain consistency in the graph's relationships.",
"crux": {
- "code": " assert.ok(src.startsWith('---\\n'), 'starts with YAML frontmatter');\n assert.match(src, /^name: graft$/m, 'declares name: graft');\n assert.match(src, /^description:/m, 'has a description');\n const body = src.split(/\\n---\\n/)[1] ?? '';\n assert.ok(body.trim().length > 0, 'has a non-empty body');\n assert.match(body, /graft ask/, 'body tells the agent to use `graft ask`');\n assert.match(body, /every occurrence/i, 'body teaches the exhaustive-task grep rule');\n assert.match(body, /graft callers/, 'body teaches the callers command');\n assert.match(body, /graft callees/, 'body teaches the callees command');\n assert.match(body, /graft impact/, 'body teaches the impact command');\n assert.match(body, /truncated/i, 'body tells the agent to follow up on truncated spans');\n assert.match(body, /graft grep/, 'body routes sweeps to graft grep');",
- "span": "L7-L18"
+ "code": "export function normalizeRelation(rel: string): string {\n return NORMALIZE_RELATION[rel] ?? rel;\n}",
+ "span": "L56-L58"
}
},
{
- "id": "test/claude-state.test.ts",
- "name": "claude-state.test.ts",
- "kind": "file",
- "path": "test/claude-state.test.ts",
- "span": "L1-L51",
- "signature": null,
+ "id": "src/viz/assemble.ts#VizEdge",
+ "name": "VizEdge",
+ "kind": "interface",
+ "path": "src/viz/assemble.ts",
+ "span": "L26-L31",
+ "signature": "interface VizEdge",
"exported": true,
"origin": "ast",
- "body_hash": "78e6a81af7642ea788072457ea181bc626c7a8a898cfebb882ab42fed7e9dd2e",
- "chars": 1991,
+ "body_hash": "bef3aefe267d463b0d4cf617f379adadd4fffb539e9a0a5e240520be60a191cb",
"summary_state": "ready",
- "summary": "This test suite verifies the functionality of state management, including stats and session handling, as well as lock acquisition and release mechanisms.",
- "crux": {
- "code": "test('stats round-trip and patch merge', () => {\n const d = fresh();\n assert.equal(readStats(d), null);\n writeStats(d, { ...emptyStats(), nodeCount: 319, edgeCount: 730 });\n assert.equal(readStats(d)!.nodeCount, 319);\n const patched = patchStats(d, { dirty: true, staleCount: 4 });\n assert.equal(patched.dirty, true);\n assert.equal(patched.staleCount, 4);\n assert.equal(readStats(d)!.edgeCount, 730, 'patch preserves other fields');\n});\n\ntest('session defaults and round-trip', () => {",
- "span": "L13-L24"
- }
+ "summary": "Defines the structure of an edge in the visualization graph, representing relationships between nodes.",
+ "crux": null
},
{
- "id": "test/claude-state.test.ts#fresh",
- "name": "fresh",
- "kind": "function",
- "path": "test/claude-state.test.ts",
- "span": "L11-L11",
- "signature": "function fresh(): string",
- "exported": false,
+ "id": "src/viz/assemble.ts#VizGraph",
+ "name": "VizGraph",
+ "kind": "interface",
+ "path": "src/viz/assemble.ts",
+ "span": "L33-L42",
+ "signature": "interface VizGraph",
+ "exported": true,
"origin": "ast",
- "body_hash": "49e9f70f3b52532360521760ee5e0e5c907bdf3f55d1ed2c90bb3c3e48d93cda",
+ "body_hash": "7edd9c49c11acc8e90963256a92ee2f27415c50446334924e2e260b715b56427",
"summary_state": "ready",
- "summary": "Generates a unique temporary directory for testing purposes to ensure isolation between test cases.",
- "crux": {
- "code": "function fresh(): string { return mkdtempSync(join(tmpdir(), 'graft-state-')); }",
- "span": "L11-L11"
- }
+ "summary": "Encapsulates the complete visualization graph, including metadata about nodes and edges.",
+ "crux": null
},
{
- "id": "test/claude-stats.test.ts",
- "name": "claude-stats.test.ts",
- "kind": "file",
- "path": "test/claude-stats.test.ts",
- "span": "L1-L30",
- "signature": null,
+ "id": "src/viz/assemble.ts#VizNode",
+ "name": "VizNode",
+ "kind": "interface",
+ "path": "src/viz/assemble.ts",
+ "span": "L18-L24",
+ "signature": "interface VizNode",
"exported": true,
"origin": "ast",
- "body_hash": "f625d026d152a65017699e37e27534043dc0af0f43ba2d3ea778bac8ddab82c3",
- "chars": 983,
+ "body_hash": "ec19a79898c594e5afc405cab037fcc0c43144c5766af8a955dccda7df733ba6",
"summary_state": "ready",
- "summary": "This test file verifies the functionality of the computeStats function to ensure it accurately calculates node and edge counts, as well as the count of ready nodes from a given wiring structure.",
- "crux": {
- "code": "test('computeStats derives counts and readyCount', () => {\n const s = computeStats(wiring);\n assert.equal(s.nodeCount, 3);\n assert.equal(s.edgeCount, 2);\n assert.deepEqual(s.languages, ['typescript']);\n assert.equal(s.totalCount, 3);\n assert.equal(s.readyCount, 2);",
- "span": "L15-L21"
- }
+ "summary": "Defines the structure of a node in the visualization graph, encapsulating its identity and attributes.",
+ "crux": null
},
{
- "id": "test/claude-statusline.test.ts",
- "name": "claude-statusline.test.ts",
+ "id": "src/viz/serve.ts",
+ "name": "serve.ts",
"kind": "file",
- "path": "test/claude-statusline.test.ts",
- "span": "L1-L48",
+ "path": "src/viz/serve.ts",
+ "span": "L1-L149",
"signature": null,
"exported": true,
"origin": "ast",
- "body_hash": "07128b5b195af3a37c1e170a35c18378e36160d1a6f8e17be362bac315811cac",
- "chars": 2137,
+ "body_hash": "14283762f454c01fc95cfbe9c2b41ef063fc17c4c3e5d120b5dc7f66f541fc1c",
+ "chars": 4909,
"summary_state": "ready",
- "summary": "This file contains tests for the resolveStats function, ensuring it correctly retrieves and prioritizes cached statistics or falls back to graph data as needed.",
+ "summary": "This file implements a local server for serving a viewer and handling API requests related to context and code graphs.",
"crux": {
- "code": "test('resolveStats returns the hook-maintained cache when present and non-empty', () => {\n const d = repo();\n writeStats(d, { ...emptyStats(), nodeCount: 5, edgeCount: 9, dirty: true, staleCount: 2 });\n const s = resolveStats(d)!;\n assert.equal(s.nodeCount, 5);\n assert.equal(s.dirty, true, 'cache is the source of truth when present');\n});\n\ntest('resolveStats falls back to wiring.json when no cache (manual graft build / fresh checkout)', () => {\n const d = repo();\n writeWiring(d, {\n meta: { nodeCount: 42, edgeCount: 100, languages: ['typescript'] },",
- "span": "L15-L26"
+ "code": " const server = createServer((req, res) => {\n const path = (req.url ?? \"/\").split(\"?\")[0];\n\n const asset = STATIC_FILES[path];\n if (asset) {\n const file = join(opts.viewerDir, asset.file);\n if (!existsSync(file)) {\n res.writeHead(404, { \"content-type\": \"text/plain\" });\n res.end(\"viewer bundle missing — run the package build\");\n return;\n }\n res.writeHead(200, { \"content-type\": asset.type });",
+ "span": "L60-L71"
}
},
{
- "id": "test/claude-statusline.test.ts#repo",
- "name": "repo",
+ "id": "src/viz/serve.ts#listen",
+ "name": "listen",
"kind": "function",
- "path": "test/claude-statusline.test.ts",
- "span": "L9-L9",
- "signature": "function repo(): string",
+ "path": "src/viz/serve.ts",
+ "span": "L43-L55",
+ "signature": "function listen(server: Server, port: number): Promise<boolean>",
"exported": false,
"origin": "ast",
- "body_hash": "121eb027efad697b8021b3a994a7f977441a0a34c0e92fd9a1792851368850e5",
+ "body_hash": "b43a357dceb98a6eb6676409503021e6e38f13d7d442d44ba819dda0c0ea6246",
"summary_state": "ready",
- "summary": "Creates a temporary directory for testing purposes, ensuring a clean environment for each test run.",
+ "summary": "Attempts to bind the server to a specified port, handling errors if the port is in use.",
"crux": {
- "code": "function repo(): string { return mkdtempSync(join(tmpdir(), 'graft-sl-')); }",
- "span": "L9-L9"
+ "code": " return new Promise((resolve, reject) => {\n const onError = (err: NodeJS.ErrnoException) => {\n if (err.code === \"EADDRINUSE\") resolve(false);\n else reject(err);\n };\n server.once(\"error\", onError);\n server.listen(port, \"127.0.0.1\", () => {\n server.removeListener(\"error\", onError);\n resolve(true);\n });",
+ "span": "L44-L53"
}
},
{
- "id": "test/claude-statusline.test.ts#writeWiring",
- "name": "writeWiring",
+ "id": "src/viz/serve.ts#listen.onError",
+ "name": "onError",
"kind": "function",
- "path": "test/claude-statusline.test.ts",
- "span": "L10-L13",
- "signature": "function writeWiring(dir: string, obj: unknown): void",
+ "path": "src/viz/serve.ts",
+ "span": "L45-L48",
+ "signature": "onError = (err: NodeJS.ErrnoException)",
"exported": false,
"origin": "ast",
- "body_hash": "2e1f37e4395b142a5e04d343c3d72366ed3c3245acc13afc8eef46df21b1df21",
+ "body_hash": "6643919e3ea413fc58afe100fe65dc3beccadb7aa66bf5d3247e072c83d9d000",
"summary_state": "ready",
- "summary": "Writes a wiring.json file to a specified directory, setting up the necessary structure for graph data in tests.",
- "crux": {
- "code": "function writeWiring(dir: string, obj: unknown): void {\n mkdirSync(join(dir, 'graft', '.graph'), { recursive: true });\n writeFileSync(join(dir, 'graft', '.graph', 'wiring.json'), JSON.stringify(obj));",
- "span": "L10-L12"
- }
+ "summary": "Handles errors that occur when trying to bind the server to a port.",
+ "crux": null
},
{
- "id": "test/cli-meta.test.ts",
- "name": "cli-meta.test.ts",
- "kind": "file",
- "path": "test/cli-meta.test.ts",
- "span": "L1-L81",
- "signature": null,
- "exported": true,
+ "id": "src/viz/serve.ts#sendJson",
+ "name": "sendJson",
+ "kind": "function",
+ "path": "src/viz/serve.ts",
+ "span": "L38-L41",
+ "signature": "function sendJson(res: ServerResponse, status: number, body: unknown): void",
+ "exported": false,
"origin": "ast",
- "body_hash": "e7a05bf838e876a317276f94a26d92b0b1526e1ea7eabda4e68b804bdb0334e5",
- "chars": 3338,
+ "body_hash": "a2b33c898c929db2715116f964722f5e438e61a58fdfa4607d21c4365df5da6a",
"summary_state": "ready",
- "summary": "This file contains tests for formatting version and upgrade reports, resolving package.json paths, reading the current version, and detecting if a script is running via npx, ensuring correct behavior of the CLI meta functionalities.",
+ "summary": "Sends a JSON response with the specified status and body to the client.",
"crux": {
- "code": "test('formatVersionReport: up to date', () => {\n const out = formatVersionReport('0.4.4', { ok: true, version: '0.4.4' });\n assert.equal(out, 'graft 0.4.4\\nlatest on npm: 0.4.4 ✓ up to date');\n});\n\ntest('formatVersionReport: newer version available', () => {\n const out = formatVersionReport('0.4.4', { ok: true, version: '0.4.5' });\n assert.equal(out, 'graft 0.4.4\\nlatest on npm: 0.4.5 — run graft upgrade');\n});\n\ntest('formatVersionReport: offline / unreachable', () => {\n const out = formatVersionReport('0.4.4', { ok: false });",
- "span": "L16-L27"
+ "code": " res.writeHead(status, { \"content-type\": \"application/json; charset=utf-8\" });\n res.end(JSON.stringify(body));\n}",
+ "span": "L39-L41"
}
},
{
- "id": "test/context.test.ts",
- "name": "context.test.ts",
- "kind": "file",
- "path": "test/context.test.ts",
- "span": "L1-L213",
- "signature": null,
+ "id": "src/viz/serve.ts#startVizServer",
+ "name": "startVizServer",
+ "kind": "function",
+ "path": "src/viz/serve.ts",
+ "span": "L57-L148",
+ "signature": "async function startVizServer(opts: VizServerOptions): Promise<VizServer>",
"exported": true,
"origin": "ast",
- "body_hash": "126861c136d48ed6a148e50226c96ec2935c52cf83ef56fbd43392e0d271db1f",
- "chars": 7976,
+ "body_hash": "d652f8a8b5ea738a1ff68592d9644525dee438568c9158e5edffe536b1f1aa16",
"summary_state": "ready",
- "summary": "This file contains end-to-end tests for the markdown-graph pipeline, ensuring that the initialization and checking processes work correctly with various scenarios.",
+ "summary": "Initializes and starts the visualization server, setting up routes and handling requests.",
"crux": {
- "code": "test(\"init builds one markdown node per entity, with links and a manifest\", async () => {\n const dir = makeFixture();\n try {\n const r = await buildContext(dir, buildOpts());\n // Auth Service, Token Store, Billing.\n assert.equal(r.nodes, 3);\n assert.equal(r.links, 2);\n assert.equal(r.files, 2);\n\n const ctx = join(dir, \"graft\");\n assert.ok(existsSync(join(ctx, \"auth-service.md\")));\n assert.ok(existsSync(join(ctx, \"token-store.md\")));",
- "span": "L49-L60"
+ "code": " const server = createServer((req, res) => {\n const path = (req.url ?? \"/\").split(\"?\")[0];\n\n const asset = STATIC_FILES[path];\n if (asset) {\n const file = join(opts.viewerDir, asset.file);\n if (!existsSync(file)) {\n res.writeHead(404, { \"content-type\": \"text/plain\" });\n res.end(\"viewer bundle missing — run the package build\");\n return;\n }\n res.writeHead(200, { \"content-type\": asset.type });",
+ "span": "L60-L71"
}
},
{
- "id": "test/context.test.ts#buildOpts",
- "name": "buildOpts",
- "kind": "function",
- "path": "test/context.test.ts",
- "span": "L45-L47",
- "signature": "function buildOpts()",
- "exported": false,
+ "id": "src/viz/serve.ts#startVizServer.close",
+ "name": "close",
+ "kind": "method",
+ "path": "src/viz/serve.ts",
+ "span": "L140-L146",
+ "signature": "close(): Promise<void>",
+ "exported": true,
"origin": "ast",
- "body_hash": "20ec093d8fa9dadc46af8980d9440b6824597f4cdeb74529d4d62ee38d27e52d",
+ "body_hash": "69dc0089d8f1d6e843c8add8fabf2e120fd1045505f9c15632ba93bdc58c01d4",
"summary_state": "ready",
- "summary": "This function generates options for building the context, including a fake model and providers.",
+ "summary": "Closes the visualization server and cleans up resources.",
+ "crux": {
+ "code": " close(): Promise<void> {\n clearTimeout(debounce);\n watcher?.close();\n for (const client of sseClients) client.end();\n sseClients.clear();\n return new Promise((resolve, reject) => server.close((err) => (err ? reject(err) : resolve())));\n },",
+ "span": "L140-L146"
+ }
+ },
+ {
+ "id": "src/viz/serve.ts#VizServer",
+ "name": "VizServer",
+ "kind": "interface",
+ "path": "src/viz/serve.ts",
+ "span": "L23-L26",
+ "signature": "interface VizServer",
+ "exported": true,
+ "origin": "ast",
+ "body_hash": "9c56587daccba8982a5f5da3a0ea5f185becea8c4f4927331b15117f5d456214",
+ "summary_state": "ready",
+ "summary": "Represents the visualization server with its URL and a method to close it.",
"crux": null
},
{
- "id": "test/context.test.ts#makeFixture",
- "name": "makeFixture",
+ "id": "src/viz/serve.ts#VizServerOptions",
+ "name": "VizServerOptions",
+ "kind": "interface",
+ "path": "src/viz/serve.ts",
+ "span": "L16-L21",
+ "signature": "interface VizServerOptions",
+ "exported": true,
+ "origin": "ast",
+ "body_hash": "0b439484269a73c19df0d658113fbdc889c2214d1081e08d92bc86ae99e0c795",
+ "summary_state": "ready",
+ "summary": "Defines the configuration options required to start the visualization server.",
+ "crux": null
+ },
+ {
+ "id": "test/ask-fusion.test.ts",
+ "name": "ask-fusion.test.ts",
+ "kind": "file",
+ "path": "test/ask-fusion.test.ts",
+ "span": "L1-L205",
+ "signature": null,
+ "exported": true,
+ "origin": "ast",
+ "body_hash": "8b7bdc7a4f93f89f5d0ffacba11f469fb78c7f6014c4b1fa60881f099cc23724",
+ "chars": 9152,
+ "summary_state": "pending",
+ "summary": null,
+ "crux": null
+ },
+ {
+ "id": "test/ask-fusion.test.ts#makeOps",
+ "name": "makeOps",
"kind": "function",
- "path": "test/context.test.ts",
- "span": "L32-L43",
- "signature": "function makeFixture(): string",
+ "path": "test/ask-fusion.test.ts",
+ "span": "L132-L146",
+ "signature": "function makeOps(bStrength: { coverage: number; coverageStrong: number }): ScopeRankOps",
"exported": false,
"origin": "ast",
- "body_hash": "515198ac732683d4da4b920e53a0eb439ea8e0107afb22af65cc29c0e702192c",
- "summary_state": "ready",
- "summary": "This function creates a temporary directory with mock service files for testing the context building process.",
- "crux": {
- "code": " const dir = mkdtempSync(join(tmpdir(), \"ctxgraph-\"));\n writeFileSync(\n join(dir, \"auth.ts\"),\n `// [[Auth Service]] ==depends_on==> [[Token Store]]\\nexport const auth = 1;\\n`,\n );\n writeFileSync(\n join(dir, \"billing.ts\"),\n `// [[Billing]] ==uses==> [[Auth Service]]\\nexport const billing = 2;\\n`,\n );\n return dir;",
- "span": "L15-L24"
- }
+ "body_hash": "ab84135bc48243ccbf2d7dd8f433f7622673568b677071d5e5a758f376c0b50a",
+ "summary_state": "pending",
+ "summary": null,
+ "crux": null
},
{
- "id": "test/context.test.ts#runCli",
- "name": "runCli",
+ "id": "test/ask-fusion.test.ts#scopeDocs",
+ "name": "scopeDocs",
"kind": "function",
- "path": "test/context.test.ts",
- "span": "L19-L30",
- "signature": "function runCli(args: string[]): { stdout: string; stderr: string; status: number }",
+ "path": "test/ask-fusion.test.ts",
+ "span": "L21-L23",
+ "signature": "function scopeDocs(scope: string, scores: number[]): ScopedDoc[]",
"exported": false,
"origin": "ast",
- "body_hash": "f6727f675d8cb599692eabff8675faa168c515b6cfe5d91fbc1092f31371e31f",
- "summary_state": "ready",
- "summary": "This function executes a command-line interface (CLI) command and captures its output, allowing tests to verify the behavior of the CLI under different conditions.",
- "crux": {
- "code": " const stdout = execFileSync(process.execPath, [\"--import\", \"tsx\", \"src/cli.ts\", ...args], {\n encoding: \"utf8\",\n stdio: [\"ignore\", \"pipe\", \"pipe\"],\n });\n return { stdout, stderr: \"\", status: 0 };\n } catch (err) {\n const e = err as { stdout?: string; stderr?: string; status?: number };\n return { stdout: e.stdout ?? \"\", stderr: e.stderr ?? \"\", status: e.status ?? 1 };",
- "span": "L21-L28"
- }
+ "body_hash": "8d5a6b8359ac99c0090d6fe289ac6046438586342fae817aafd18bee03eb130d",
+ "summary_state": "pending",
+ "summary": null,
+ "crux": null
},
{
- "id": "test/covers.test.ts",
- "name": "covers.test.ts",
+ "id": "test/ask-index.test.ts",
+ "name": "ask-index.test.ts",
"kind": "file",
- "path": "test/covers.test.ts",
- "span": "L1-L77",
+ "path": "test/ask-index.test.ts",
+ "span": "L1-L378",
"signature": null,
"exported": true,
"origin": "ast",
- "body_hash": "f5a75f405be1a01ad43fc806588858df3a8988fee62ad4ec024440d3f5e0fc0c",
- "chars": 3059,
+ "body_hash": "c9cd7c011ebd661f35488c59dcd34801079f2786d56e96833f4da7c45dfa37d7",
+ "chars": 16112,
"summary_state": "ready",
- "summary": "This test suite verifies that the wiring build correctly populates the 'covers' field in concept nodes and maintains stability across builds.",
- "crux": {
- "code": "test(\"wiring build backfills covers: onto concept nodes\", async () => {\n const dir = makeFixture();\n try {\n await buildContext(dir, { model: \"fake\", ...fakeProviders() });\n await buildGraph(dir); // $0, no LLM — still writes cards + covers\n\n const fm = matter(readFileSync(join(dir, \"graft\", \"auth-service.md\"), \"utf8\")).data;\n assert.ok(Array.isArray(fm.covers), \"covers should be an array\");\n const login = fm.covers.find((c: { symbol: string }) => c.symbol === \"login\");\n assert.ok(login, \"covers should include the login function\");\n assert.equal(login.kind, \"function\");\n assert.match(login.at, /^auth\\.ts:L\\d+-L\\d+$/);",
- "span": "L26-L37"
- }
+ "summary": "This file contains tests to ensure the integrity and correctness of the `ask` sidecar functionality, verifying that it accurately reproduces live tokenization results and handles various edge cases without failure.",
+ "crux": null
},
{
- "id": "test/covers.test.ts#makeFixture",
+ "id": "test/ask-index.test.ts#makeFixture",
"name": "makeFixture",
"kind": "function",
- "path": "test/covers.test.ts",
- "span": "L16-L24",
+ "path": "test/ask-index.test.ts",
+ "span": "L26-L50",
"signature": "function makeFixture(): string",
"exported": false,
"origin": "ast",
- "body_hash": "c50f4905cfffe46da829a42a2bcab6838f96a17497009a9efe7a64a98729540f",
+ "body_hash": "c90c21864f82921d79c49a3ab3b523d234323a0850a634de37d08abced8fd0f8",
"summary_state": "ready",
- "summary": "Creates a temporary directory with a sample TypeScript file for testing the wiring build.",
+ "summary": "Creates a temporary multi-file fixture with overlapping vocabulary to facilitate meaningful tests on tokenization and scoring.",
"crux": {
- "code": " const dir = mkdtempSync(join(tmpdir(), \"graft-covers-\"));\n writeFileSync(\n join(dir, \"auth.ts\"),\n `// [[Auth Service]] ==depends_on==> [[Token Store]]\\n` +\n `export function login(user: string): boolean {\\n return user.length > 0;\\n}\\n`,\n );\n return dir;",
- "span": "L17-L23"
+ "code": "function makeFixture(): string {\n const dir = mkdtempSync(join(tmpdir(), \"graft-ask-index-\"));\n writeFileSync(\n join(dir, \"auth.ts\"),\n `/** Validate an incoming API request's auth token. */\\n` +\n `export function validateAuthToken(token: string): boolean {\\n` +\n ` return token.length > 0;\\n` +\n `}\\n\\n` +\n `export function authMiddleware(req: unknown): boolean {\\n` +\n ` return validateAuthToken(\"x\");\\n` +\n `}\\n`,\n );",
+ "span": "L26-L37"
}
},
{
- "id": "test/graph-bindings.test.ts",
- "name": "graph-bindings.test.ts",
- "kind": "file",
- "path": "test/graph-bindings.test.ts",
- "span": "L1-L82",
- "signature": null,
- "exported": true,
+ "id": "test/ask-index.test.ts#reinjectBodyText",
+ "name": "reinjectBodyText",
+ "kind": "function",
+ "path": "test/ask-index.test.ts",
+ "span": "L69-L85",
+ "signature": "function reinjectBodyText(dir: string, outDir: string): void",
+ "exported": false,
"origin": "ast",
- "body_hash": "b6892b1b6982547fc67d5b0e7812a536e47018ab3e38e4eda35a0f12f24ab8db",
- "chars": 4267,
+ "body_hash": "dd2e01921c74775b79f94544f814554415656ca604983fbcd14b10a0fea1a6b0",
"summary_state": "ready",
- "summary": "This file contains tests that validate the behavior of type bindings in different programming languages' code snippets.",
+ "summary": "Reconstructs the body text for nodes in the wiring.json to ensure accurate tokenization results during tests.",
"crux": {
- "code": "test(\"py: constructor assignment binds receiver type\", () => {\n const edges = callEdges(\"class A:\\n def m(self): pass\\napp = A()\\ndef f():\\n app.m()\\n\", \"python\");\n const call = edges.find((e) => e.name === \"m\" && e.viaMember);\n assert.equal(call?.recvType, \"A\");\n});\n\ntest(\"py: parameter annotation binds\", () => {\n const edges = callEdges(\"def f(app: FastAPI):\\n app.include_router()\\n\", \"python\");\n assert.equal(edges.find((e) => e.name === \"include_router\")?.recvType, \"FastAPI\");\n});\n\ntest(\"py: self binds to enclosing class; self.attr via __init__ assignment\", () => {",
- "span": "L9-L20"
+ "code": " const wpath = wiringPath(outDir);\n const graph = JSON.parse(readFileSync(wpath, \"utf8\")) as GraphV1;\n const bodyById = new Map<string, string>();\n for (const entry of readdirSync(dir)) {\n const lang = languageOf(entry);\n if (!lang) continue;\n const source = readFileSync(join(dir, entry), \"utf8\");\n const { nodes } = extractFile(entry, source, lang);\n for (const n of nodes) if (n.body_text !== undefined) bodyById.set(n.id, n.body_text);\n }\n for (const n of graph.nodes as NodeV1[]) {\n const bt = bodyById.get(n.id);",
+ "span": "L70-L81"
}
},
{
- "id": "test/graph-bindings.test.ts#callEdges",
- "name": "callEdges",
+ "id": "test/ask-index.test.ts#sortPairs",
+ "name": "sortPairs",
"kind": "function",
- "path": "test/graph-bindings.test.ts",
- "span": "L5-L7",
- "signature": "function callEdges(src: string, lang: \"python\" | \"typescript\" | \"go\", file = `x.${lang === \"python\" ? \"py\" : lang === \"go\" ? \"go\" : \"ts\"}`)",
+ "path": "test/ask-index.test.ts",
+ "span": "L106-L106",
+ "signature": "sortPairs = (p: [string, number][])",
"exported": false,
"origin": "ast",
- "body_hash": "835bab16fc5593e4c29ca25d3accec71d790d08f8d0127043711501b6ba94e2d",
+ "body_hash": "67de2733865dd8e5d635892fb085c3781a9a541c49ad2d112c8c150aaef655b6",
"summary_state": "ready",
- "summary": "This function extracts call edges from source code based on the specified programming language, filtering for 'calls' relations.",
+ "summary": "Sorts an array of pairs by the first element, ensuring consistent ordering for comparison in tests.",
"crux": {
- "code": " return extractFile(file, src, lang).rawEdges.filter((e) => e.relation === \"calls\");",
- "span": "L6-L6"
+ "code": " const sortPairs = (p: [string, number][]) => [...p].sort((a, b) => a[0].localeCompare(b[0]));",
+ "span": "L106-L106"
}
},
{
- "id": "test/graph-go.test.ts",
- "name": "graph-go.test.ts",
+ "id": "test/ask.test.ts",
+ "name": "ask.test.ts",
"kind": "file",
- "path": "test/graph-go.test.ts",
- "span": "L1-L168",
+ "path": "test/ask.test.ts",
+ "span": "L1-L732",
"signature": null,
"exported": true,
"origin": "ast",
- "body_hash": "bf11085a7edb03c00d52dca090af9c1ca4eb3cb34bb88904bbdd478171d3483d",
- "chars": 5664,
- "summary_state": "ready",
- "summary": "This file contains tests for verifying the extraction of Go code structures and their relationships in a code graph.",
+ "body_hash": "9893d94a042010c980dfa7b7d501f4fbcaf683688b7fe57a3a03f85dd956bc82",
+ "chars": 33273,
+ "summary_state": "stale",
+ "summary": "Contains tests for the `ask` functionality, validating its behavior with various options and scenarios.",
"crux": {
- "code": "test(\"Go extraction: funcs, methods, structs, interfaces, type aliases\", async () => {\n const dir = makeFixture();\n try {\n const result = await buildGraph(dir); // $0, Tier-1 only\n assert.ok(result.languages.includes(\"go\"), \"languages should include go\");\n\n const graph = readGraph(wiringPath(join(dir, \"graft\")));\n assert.ok(graph, \"wiring graph should be written\");\n\n // functions — exported by leading-uppercase\n const foo = nodeById(graph!, \"main.go#Foo\");\n assert.equal(foo?.kind, \"function\");",
- "span": "L66-L77"
+ "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": "L27-L38"
}
},
{
- "id": "test/graph-go.test.ts#makeFixture",
- "name": "makeFixture",
+ "id": "test/ask.test.ts#crossSeamMonorepoFixture",
+ "name": "crossSeamMonorepoFixture",
"kind": "function",
- "path": "test/graph-go.test.ts",
- "span": "L53-L60",
- "signature": "function makeFixture(): string",
+ "path": "test/ask.test.ts",
+ "span": "L346-L387",
+ "signature": "function crossSeamMonorepoFixture(): string",
"exported": false,
"origin": "ast",
- "body_hash": "76b9a9cf518c965694990ed9cbfa55da12a5eb1bdc5b662c6b0550fb038dbb04",
- "summary_state": "ready",
- "summary": "Creates a temporary Go module directory with necessary files for testing graph extraction.",
- "crux": {
- "code": " const dir = mkdtempSync(join(tmpdir(), \"graft-go-\"));\n writeFileSync(join(dir, \"go.mod\"), \"module mymod\\n\\ngo 1.21\\n\");\n writeFileSync(join(dir, \"main.go\"), MAIN_GO);\n mkdirSync(join(dir, \"pkg\", \"util\"), { recursive: true });\n writeFileSync(join(dir, \"pkg\", \"util\", \"util.go\"), UTIL_GO);\n return dir;\n}",
- "span": "L54-L60"
- }
+ "body_hash": "7be30ecd7e20efc11b1384a9ca617411a1bf6f4c833048cb31e78880bcb2808a",
+ "summary_state": "pending",
+ "summary": null,
+ "crux": null
},
{
- "id": "test/graph-go.test.ts#nodeById",
- "name": "nodeById",
+ "id": "test/ask.test.ts#duplicateNameFixture",
+ "name": "duplicateNameFixture",
"kind": "function",
- "path": "test/graph-go.test.ts",
- "span": "L62-L64",
- "signature": "function nodeById(graph: GraphV1, id: string): NodeV1 | undefined",
+ "path": "test/ask.test.ts",
+ "span": "L636-L651",
+ "signature": "function duplicateNameFixture(): string",
"exported": false,
"origin": "ast",
- "body_hash": "7d35f3037365876a2bedd0af5973ec5cc0b3871e3bce7f310993d907ae378c67",
- "summary_state": "ready",
- "summary": "Retrieves a node from the graph by its unique identifier, facilitating graph traversal and assertions in tests.",
+ "body_hash": "65d26c7671c925c41a2a09cad0036295c2ad65006b7f1a58c0c460bed2b31ddd",
+ "summary_state": "pending",
+ "summary": null,
"crux": null
},
{
- "id": "test/graph-load.test.ts",
- "name": "graph-load.test.ts",
- "kind": "file",
- "path": "test/graph-load.test.ts",
- "span": "L1-L153",
- "signature": null,
- "exported": true,
+ "id": "test/ask.test.ts#idfShiftFixture",
+ "name": "idfShiftFixture",
+ "kind": "function",
+ "path": "test/ask.test.ts",
+ "span": "L451-L462",
+ "signature": "function idfShiftFixture(): string",
+ "exported": false,
"origin": "ast",
- "body_hash": "1d283a2ff0318b7a3cd9be2b76ad3ef8a2eb4599934d37135448315c703c2c83",
- "chars": 5530,
- "summary_state": "stale",
- "summary": "This file contains tests for caching mechanisms in the graph loading functionality to improve performance by avoiding unnecessary re-parsing of files.",
- "crux": {
- "code": "test(\"loadGraphCached: two loads of an unchanged file return the same parsed object\", () => {\n const dir = fixtureDir();\n writeGraph({ version: 1, nodes: [node(\"a\")], edges: [] } as GraphV1, dir);\n __resetParseCounts();\n\n const g1 = loadGraphCached(dir);\n const g2 = loadGraphCached(dir);\n assert.ok(g1);\n assert.strictEqual(g1, g2, \"second load must reuse the cached object, not re-parse\");\n assert.equal(__parseCount.graph, 1);\n});\n",
- "span": "L52-L63"
- }
+ "body_hash": "8a01704e38cec0ac645d0230c648b406a620aabb1cb504882c8badcb533027e3",
+ "summary_state": "pending",
+ "summary": null,
+ "crux": null
},
{
- "id": "test/graph-load.test.ts#bump",
- "name": "bump",
+ "id": "test/ask.test.ts#makeFixture",
+ "name": "makeFixture",
"kind": "function",
- "path": "test/graph-load.test.ts",
- "span": "L46-L50",
- "signature": "function bump(path: string): void",
+ "path": "test/ask.test.ts",
+ "span": "L17-L26",
+ "signature": "function makeFixture(): string",
"exported": false,
"origin": "ast",
- "body_hash": "8779dc90b4ac3a22fe19faeeb81277a8a6b3cfa975a943ea81eaae7057c8ff91",
+ "body_hash": "2782fc6b3f2efa27b0c0195482a4b138e1ec02bd16da279313966e96a6d807e8",
"summary_state": "ready",
- "summary": "Updates the modification time of a file to ensure that caching mechanisms recognize changes, preventing stale data usage.",
+ "summary": "Creates a temporary directory with a sample TypeScript file for testing purposes.",
"crux": {
- "code": "function bump(path: string): void {\n const st = statSync(path);\n const future = new Date(st.mtimeMs + 1000);\n utimesSync(path, future, future);\n}",
- "span": "L46-L50"
+ "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/graph-load.test.ts#fixtureDir",
- "name": "fixtureDir",
+ "id": "test/ask.test.ts#multiScopeFixture",
+ "name": "multiScopeFixture",
"kind": "function",
- "path": "test/graph-load.test.ts",
- "span": "L40-L42",
- "signature": "function fixtureDir(): string",
+ "path": "test/ask.test.ts",
+ "span": "L277-L310",
+ "signature": "function multiScopeFixture(): string",
"exported": false,
"origin": "ast",
- "body_hash": "3f567c59fa24284eaa46cfde4904ae179e1dae786288df2256d80d65721c95c9",
+ "body_hash": "861ae2479922824311b7da16753f6517024cd4f5989bc02070ca3ec7d0270cf2",
+ "summary_state": "pending",
+ "summary": null,
+ "crux": null
+ },
+ {
+ "id": "test/ask.test.ts#qualifiedFixture",
+ "name": "qualifiedFixture",
+ "kind": "function",
+ "path": "test/ask.test.ts",
+ "span": "L190-L208",
+ "signature": "function qualifiedFixture(): string",
+ "exported": false,
+ "origin": "ast",
+ "body_hash": "9d1086ae8f0a6226d68cdbf7006c21e891972897ebe7510d188f913958306ca2",
"summary_state": "ready",
- "summary": "Generates a temporary directory for use in tests, ensuring isolation and preventing interference between test cases.",
+ "summary": "Sets up a temporary directory with a cache implementation to test structural resolution of function calls.",
"crux": {
- "code": "function fixtureDir(): string {\n return mkdtempSync(join(tmpdir(), \"graft-load-\"));\n}",
- "span": "L40-L42"
+ "code": " `export function loadItem(key: string): string {\\n` +\n ` const c = new Cache();\\n` +\n ` return c.get(key);\\n` +",
+ "span": "L198-L200"
}
},
{
- "id": "test/graph-load.test.ts#node",
- "name": "node",
+ "id": "test/ask.test.ts#rankOf",
+ "name": "rankOf",
"kind": "function",
- "path": "test/graph-load.test.ts",
- "span": "L23-L38",
- "signature": "function node(id: string): NodeV1",
+ "path": "test/ask.test.ts",
+ "span": "L469-L469",
+ "signature": "rankOf = (r: ReturnType<typeof ask>[\"hits\"], title: string)",
"exported": false,
"origin": "ast",
- "body_hash": "50c83e997e60e662392960d89cc6c5b421a65cfd8c166084e4c5f3c8ea9a9bd6",
+ "body_hash": "c03a498c384ff31544d9daa078d91655c746bfcf8f10830ad1e4f0f720e14717",
+ "summary_state": "pending",
+ "summary": null,
+ "crux": null
+ },
+ {
+ "id": "test/ask.test.ts#siblingPrefixFixture",
+ "name": "siblingPrefixFixture",
+ "kind": "function",
+ "path": "test/ask.test.ts",
+ "span": "L417-L424",
+ "signature": "function siblingPrefixFixture(): string",
+ "exported": false,
+ "origin": "ast",
+ "body_hash": "c852d824057f313b5bb59d469c1e04b442dc6b8a3f15e5643e8edbb98c0504f1",
+ "summary_state": "pending",
+ "summary": null,
+ "crux": null
+ },
+ {
+ "id": "test/ask.test.ts#stampCrux",
+ "name": "stampCrux",
+ "kind": "function",
+ "path": "test/ask.test.ts",
+ "span": "L44-L50",
+ "signature": "function stampCrux(dir: string, code: string): void",
+ "exported": false,
+ "origin": "ast",
+ "body_hash": "88e65ff2cd0c7e96135c81d1072a15b210a7b2ddad022394ea8f59f6842dcbf4",
"summary_state": "ready",
- "summary": "Creates a node representation for the graph with specified properties, facilitating the construction of graph structures in tests.",
+ "summary": "Updates the wiring.json file to include a crux for the specified node, allowing for inlined source retrieval.",
"crux": {
- "code": " return {\n id,\n name: id,\n kind: \"function\",\n path: `${id}.ts`,\n span: \"L1-L1\",\n signature: null,\n exported: true,\n origin: \"ast\",\n body_hash: id,\n summary_state: \"pending\",\n summary: null,",
- "span": "L24-L35"
+ "code": " n.crux = { code, span: \"L2-L2\" };",
+ "span": "L47-L47"
}
},
{
- "id": "test/graph-map.test.ts",
- "name": "graph-map.test.ts",
+ "id": "test/claude-format.test.ts",
+ "name": "claude-format.test.ts",
"kind": "file",
- "path": "test/graph-map.test.ts",
- "span": "L1-L308",
+ "path": "test/claude-format.test.ts",
+ "span": "L1-L161",
"signature": null,
"exported": true,
"origin": "ast",
- "body_hash": "97c06030735d5dbb15270b73a594e1de8fb3ffba5c6551b6303a5357b8da31be",
- "chars": 11746,
- "summary_state": "ready",
- "summary": "This file contains tests for the `buildRepoMap` and `formatRepoMap` functions, ensuring they correctly process and format repository data.",
+ "body_hash": "3e8f24e9e4e930bbd45cd7bc306bc465ddc872e838803b7bbd0c634247d246f3",
+ "chars": 7825,
+ "summary_state": "stale",
+ "summary": "This test suite verifies the functionality of various formatting and retrieval functions related to the status line and enriched segments in a codebase, ensuring correct rendering based on different states and inputs.",
"crux": {
- "code": "test(\"buildRepoMap: totals count files, symbols, edges, and languages across the whole graph\", () => {\n const nodes = [\n fileNode(\"src/a.ts\"),\n symNode(\"src/a.ts\", \"fnA\"),\n fileNode(\"docs/readme.py\"), // deliberately mixed languages\n symNode(\"docs/readme.py\", \"fnB\"),\n ];\n const edges = [edge(\"src/a.ts#fnA\", \"docs/readme.py#fnB\")];\n const map = buildRepoMap(graphOf(nodes, edges));\n\n assert.equal(map.totals.files, 2);\n assert.equal(map.totals.symbols, 2);",
- "span": "L65-L76"
+ "code": "test('not-built state', () => {\n const lines = renderStatusline(null, null, { ctxPct: null });\n assert.match(strip(lines[0]), /not built/);\n});\n\ntest('enriched segment hidden when zero ready', () => {\n assert.equal(enrichedSegment({ ...emptyStats(), totalCount: 10, readyCount: 0 }), null);\n});\n\ntest('enriched segment shown when >=1 ready', () => {\n const seg = enrichedSegment({ ...emptyStats(), totalCount: 4, readyCount: 2 });\n assert.equal(strip(seg!), '50% enriched');",
+ "span": "L8-L19"
}
},
{
- "id": "test/graph-map.test.ts#bigFixture",
- "name": "bigFixture",
+ "id": "test/claude-format.test.ts#freshSession",
+ "name": "freshSession",
"kind": "function",
- "path": "test/graph-map.test.ts",
- "span": "L240-L259",
- "signature": "function bigFixture(): GraphV1",
+ "path": "test/claude-format.test.ts",
+ "span": "L105-L105",
+ "signature": "freshSession = ()",
"exported": false,
"origin": "ast",
- "body_hash": "36aa3a253a2bbeb21b090b155800f0354efd0e279bcf199a768d0cd9b8f66aac",
+ "body_hash": "61509362f702d01df4dfd7777521ae04e30c0dbc1656070024e4712c763314ee",
"summary_state": "ready",
- "summary": "Creates a large fixture graph for testing, simulating a repository with multiple directories and symbols.",
+ "summary": "Initializes a fresh session state for testing the relevant retrieval process.",
"crux": {
- "code": "function bigFixture(): GraphV1 {\n const nodes: NodeV1[] = [];\n const edges: EdgeV1[] = [];\n const dirs = [\"alpha\", \"beta\", \"gamma\", \"delta\"];\n for (const dir of dirs) {\n for (let f = 0; f < 3; f++) {\n const path = `${dir}/file${f}.ts`;\n nodes.push(fileNode(path));\n for (let s = 0; s < 4; s++) {\n const name = `${dir}Sym${f}_${s}`;\n nodes.push(symNode(path, name));\n // Give the first symbol in each file a bunch of callers so it's a hub.",
- "span": "L240-L251"
+ "code": "const freshSession = () => ({ lastQuery: null, perAgentQuery: {}, graftReads: 0, sourceReads: 0, savedTokens: 0, injectedPointers: [] as string[] });",
+ "span": "L105-L105"
}
},
{
- "id": "test/graph-map.test.ts#edge",
- "name": "edge",
+ "id": "test/claude-format.test.ts#gateAsk",
+ "name": "gateAsk",
"kind": "function",
- "path": "test/graph-map.test.ts",
- "span": "L51-L53",
- "signature": "function edge(source: string, target: string, relation: Relation = \"calls\"): EdgeV1",
+ "path": "test/claude-format.test.ts",
+ "span": "L97-L104",
+ "signature": "gateAsk = (over: Record<string, unknown> = {})",
"exported": false,
"origin": "ast",
- "body_hash": "123ba52d4dfdf593b1dd056eb9c949165a0ba7fd06eaf374cf1bf1bd797baee8",
+ "body_hash": "34d03c21985709ffe94de675b861d213c0d38d4794d221e1dd41f634f1837117",
"summary_state": "ready",
- "summary": "Defines a connection between two nodes in the graph, representing relationships such as function calls.",
+ "summary": "Creates a structured query object for testing relevant retrieval functionality with customizable parameters.",
"crux": {
- "code": "function edge(source: string, target: string, relation: Relation = \"calls\"): EdgeV1 {\n return { source, target, relation, confidence: \"extracted\" };\n}",
- "span": "L51-L53"
+ "code": "const gateAsk = (over: Record<string, unknown> = {}) => ({\n query: 'pkce', mode: 'lexical', coverage: 1,\n hits: [\n { kind: 'symbol', title: 'verify', pointer: 'src/pkce.ts:L1-L4', snippet: 's', score: 1 },\n { kind: 'symbol', title: 'gen', pointer: 'src/pkce.ts:L6-L9', snippet: 's', score: 0.8 },\n ],\n ...over,\n}) as any;",
+ "span": "L97-L104"
}
},
{
- "id": "test/graph-map.test.ts#fileNode",
- "name": "fileNode",
+ "id": "test/claude-format.test.ts#strip",
+ "name": "strip",
"kind": "function",
- "path": "test/graph-map.test.ts",
- "span": "L16-L31",
- "signature": "function fileNode(path: string): NodeV1",
+ "path": "test/claude-format.test.ts",
+ "span": "L6-L6",
+ "signature": "strip = (s: string)",
"exported": false,
"origin": "ast",
- "body_hash": "cb831beea5577f48e8bd82886ecb0467eccc24e399316f742291c59d63d580de",
+ "body_hash": "6381d72b2af2fa01d40d5fa8e463da782c5fe5655ad06caec8a3184ee6546edc",
"summary_state": "ready",
- "summary": "Creates a file node representation for the graph, encapsulating file metadata for processing.",
+ "summary": "Removes ANSI escape codes from a string to ensure clean output for assertions.",
"crux": {
- "code": "function fileNode(path: string): NodeV1 {\n return {\n id: path,\n name: path.slice(path.lastIndexOf(\"/\") + 1),\n kind: \"file\",\n path,\n span: \"L1-L1\",\n signature: null,\n exported: true,\n origin: \"ast\",\n body_hash: `h${counter++}`,\n summary_state: \"pending\",",
- "span": "L16-L27"
+ "code": "const strip = (s: string) => s.replace(/\\x1b\\[[0-9;]*m/g, '');",
+ "span": "L6-L6"
}
},
{
- "id": "test/graph-map.test.ts#graphOf",
- "name": "graphOf",
- "kind": "function",
- "path": "test/graph-map.test.ts",
- "span": "L55-L61",
- "signature": "function graphOf(nodes: NodeV1[], edges: EdgeV1[]): GraphV1",
- "exported": false,
+ "id": "test/claude-hooks.test.ts",
+ "name": "claude-hooks.test.ts",
+ "kind": "file",
+ "path": "test/claude-hooks.test.ts",
+ "span": "L1-L364",
+ "signature": null,
+ "exported": true,
"origin": "ast",
- "body_hash": "11c79a80294cef88be10408d30c430dbdc2440d9b80b4611d426503f279261a8",
- "summary_state": "ready",
- "summary": "Constructs a graph structure from nodes and edges, serving as the foundational data for repository mapping.",
+ "body_hash": "faabd12d53807148c5d3462647fc6c12f1fe5de9390e837dd07b6411c603e1c6",
+ "chars": 16427,
+ "summary_state": "stale",
+ "summary": "This file contains tests for the functionality of the graft hooks in the Claude project, ensuring that edits are detected and state is managed correctly.",
"crux": {
- "code": "function graphOf(nodes: NodeV1[], edges: EdgeV1[]): GraphV1 {\n return {\n meta: { version: 1, nodeCount: nodes.length, edgeCount: edges.length, languages: [] },\n nodes,\n edges,\n };\n}",
- "span": "L55-L61"
+ "code": "test('underGraft detects edits inside graft/', () => {\n assert.equal(underGraft('/repo', '/repo/graft/x.md'), true);\n assert.equal(underGraft('/repo', '/repo/src/cli.ts'), false);\n});\n\ntest('post-edit marks dirty and records lastFile', async () => {\n const d = mkdtempSync(join(tmpdir(), 'graft-hooks-'));\n mkdirSync(join(d, 'graft', '.graph'), { recursive: true });\n writeFileSync(join(d, 'graft', '.graph', 'wiring.json'),\n JSON.stringify({ meta: { nodeCount: 0, edgeCount: 0, languages: [] }, nodes: [], edges: [] }));\n // graft check will fail (no dist/cli.js here) → staleCount falls back to 0, but dirty must still be set.\n process.env.CLAUDE_PROJECT_DIR = d;",
+ "span": "L11-L22"
}
},
{
- "id": "test/graph-map.test.ts#symNode",
- "name": "symNode",
+ "id": "test/claude-hooks.test.ts#fakeBuild",
+ "name": "fakeBuild",
"kind": "function",
- "path": "test/graph-map.test.ts",
- "span": "L33-L49",
- "signature": "function symNode(path: string, name: string, opts: { kind?: Kind; span?: string } = {}): NodeV1",
+ "path": "test/claude-hooks.test.ts",
+ "span": "L84-L87",
+ "signature": "fakeBuild = (dir: string)",
"exported": false,
"origin": "ast",
- "body_hash": "819353898b73f80877d6102fc06f582cec736379220bb864d8be47c3a5107314",
+ "body_hash": "0eb606c28f6d7ec57d7fe9a9824b87942c0682ddb75d37fd911508366e5ac9e5",
"summary_state": "ready",
- "summary": "Generates a symbol node representation for the graph, allowing for the inclusion of function or variable symbols with associated metadata.",
+ "summary": "This function simulates a build process by writing a mock wiring.json file to the specified directory, allowing tests to verify behavior based on the build output.",
"crux": {
- "code": "function symNode(path: string, name: string, opts: { kind?: Kind; span?: string } = {}): NodeV1 {\n const id = `${path}#${name}`;\n return {\n id,\n name,\n kind: opts.kind ?? \"function\",\n path,\n span: opts.span ?? \"L1-L10\",\n signature: `${name}()`,\n exported: true,\n origin: \"ast\",\n body_hash: `h${counter++}`,",
- "span": "L33-L44"
+ "code": " const fakeBuild = (dir: string) => writeFileSync(join(dir, 'graft', '.graph', 'wiring.json'),\n JSON.stringify({ meta: { nodeCount: 2, edgeCount: 1, languages: ['typescript'] },\n nodes: [{ id: 'a', summary_state: 'ready' }, { id: 'b', summary_state: 'pending' }],\n edges: [{ from: 'a', to: 'b' }] }));",
+ "span": "L84-L87"
}
},
{
- "id": "test/graph-resolve-typed.test.ts",
- "name": "graph-resolve-typed.test.ts",
- "kind": "file",
- "path": "test/graph-resolve-typed.test.ts",
- "span": "L1-L93",
- "signature": null,
- "exported": true,
+ "id": "test/claude-hooks.test.ts#runWithStdin",
+ "name": "runWithStdin",
+ "kind": "function",
+ "path": "test/claude-hooks.test.ts",
+ "span": "L38-L41",
+ "signature": "async function runWithStdin(text: string, fn: () => Promise<void>): Promise<void>",
+ "exported": false,
"origin": "ast",
- "body_hash": "0c3760525cc61ee97de448fa26b4a5b9a3bb07c03b4acfbdf3608541b189cf81",
- "chars": 4908,
+ "body_hash": "6bf4b171a46fcfcceccaedd45a273ed78fac5a1b4ae47bbd881df4e54c33b912",
"summary_state": "ready",
- "summary": "This test file verifies the resolution of method calls and inheritance in a graph of nodes representing code elements, ensuring correct behavior in various scenarios.",
+ "summary": "This function sets up the environment to run a given asynchronous function with specified input from stdin, managing the environment variable for the duration of the execution.",
"crux": {
- "code": "test(\"typed member call resolves despite global name ambiguity\", () => {\n const edges = resolveEdges(NODES, [\n { source: \"t.py#test_x\", relation: \"calls\", name: \"include_router\", viaMember: true, recvType: \"FastAPI\", file: \"t.py\" },\n ]);\n const call = edges.find((e) => e.relation === \"calls\");\n assert.equal(call?.target, \"app.py#FastAPI.include_router\");\n assert.equal(call?.confidence, \"inferred\");\n});\n\ntest(\"untyped ambiguous member call still drops (regression guard)\", () => {\n const edges = resolveEdges(NODES, [\n { source: \"t.py#test_x\", relation: \"calls\", name: \"include_router\", viaMember: true, file: \"t.py\" },",
- "span": "L18-L29"
+ "code": " process.env.GRAFT_TEST_STDIN = text;\n try { await fn(); } finally { delete process.env.GRAFT_TEST_STDIN; }\n}",
+ "span": "L39-L41"
}
},
{
- "id": "test/graph-resolve-typed.test.ts#n",
- "name": "n",
+ "id": "test/claude-hooks.test.ts#writeAskArgsStub",
+ "name": "writeAskArgsStub",
"kind": "function",
- "path": "test/graph-resolve-typed.test.ts",
- "span": "L6-L10",
- "signature": "function n(id: string, kind: NodeV1[\"kind\"]): NodeV1",
+ "path": "test/claude-hooks.test.ts",
+ "span": "L247-L258",
+ "signature": "function writeAskArgsStub(d: string): { stub: string; argsFile: string }",
"exported": false,
"origin": "ast",
- "body_hash": "25448bda72366b6bf9233cc1f03e63aa5ef4e1c2253c876b7c2223db09c163fc",
- "summary_state": "ready",
- "summary": "Creates a NodeV1 object representing a code element with its associated metadata, facilitating the construction of a node graph for resolution tests.",
- "crux": {
- "code": " const name = id.includes(\"#\") ? id.split(\"#\")[1].split(\".\").pop()! : id;\n return { id, name, kind, path: id.split(\"#\")[0], span: \"L1-L1\", signature: null,\n exported: true, origin: \"ast\", body_hash: \"h\", summary_state: \"pending\", summary: null, crux: null } as NodeV1;",
- "span": "L7-L9"
- }
+ "body_hash": "5e40a5c4aa63815a683dbfebebf6fb64cef131890e8c7095416e29ebd9fb3d2c",
+ "summary_state": "pending",
+ "summary": null,
+ "crux": null
},
{
- "id": "test/graph-scopes.test.ts",
- "name": "graph-scopes.test.ts",
- "kind": "file",
- "path": "test/graph-scopes.test.ts",
- "span": "L1-L203",
- "signature": null,
- "exported": true,
- "origin": "ast",
- "body_hash": "030dea9cb5a26fac262acf50101289a62655681d7dd487a3518e59a64db209d8",
- "chars": 8316,
- "summary_state": "pending",
- "summary": null,
- "crux": null
- },
- {
- "id": "test/graph-scopes.test.ts#fx",
- "name": "fx",
+ "id": "test/claude-hooks.test.ts#writeMultiScopeWiring",
+ "name": "writeMultiScopeWiring",
"kind": "function",
- "path": "test/graph-scopes.test.ts",
- "span": "L17-L24",
- "signature": "function fx(layout: Record<string, string>): string",
+ "path": "test/claude-hooks.test.ts",
+ "span": "L126-L145",
+ "signature": "function writeMultiScopeWiring(d: string): void",
"exported": false,
"origin": "ast",
- "body_hash": "8ab0bd0d4ecd0a2c1738c41a1260ab74a8f9407edaa90b444b43b8e8180058b1",
+ "body_hash": "d35f1648e45126f112b8e3a573b030a0c3a2155d3c0a654de19876c7bf4c1993",
"summary_state": "pending",
"summary": null,
"crux": null
},
{
- "id": "test/graph-scopes.test.ts#normalize",
- "name": "normalize",
- "kind": "function",
- "path": "test/graph-scopes.test.ts",
- "span": "L93-L94",
- "signature": "normalize = (prefixes: string[], siblingName: string): string[]",
- "exported": false,
+ "id": "test/claude-init.test.ts",
+ "name": "claude-init.test.ts",
+ "kind": "file",
+ "path": "test/claude-init.test.ts",
+ "span": "L1-L137",
+ "signature": null,
+ "exported": true,
"origin": "ast",
- "body_hash": "0da47baf7c1a7c14a23a56b743085bac4a9620dffbb4751e23ea705c176b3d5b",
- "summary_state": "pending",
- "summary": null,
- "crux": null
+ "body_hash": "b582cd79b2a1e4952ff83ac1b2e85f742756443c2896e08d96a75dc76e2971a5",
+ "chars": 6213,
+ "summary_state": "ready",
+ "summary": "This file contains tests for the initialization logic of the graft system, ensuring that settings and skills are correctly scaffolded and managed during the initialization process.",
+ "crux": {
+ "code": "test('runInit scaffolds settings + both shims + the skill (build skipped)', () => {\n const d = fresh();\n const r = runInit(d, { build: false });\n assert.ok(existsSync(join(d, '.claude', 'settings.json')));\n assert.ok(existsSync(join(d, '.claude', 'helpers', 'graft-statusline.cjs')));\n assert.ok(existsSync(join(d, '.claude', 'helpers', 'graft-hooks.cjs')));\n const skillPath = join(d, '.claude', 'skills', 'graft', 'SKILL.md');\n assert.ok(existsSync(skillPath), 'writes the graft skill');\n assert.equal(r.skill, skillPath);\n assert.match(readFileSync(skillPath, 'utf8'), /name: graft/);\n assert.equal(r.built, false);\n const s = JSON.parse(readFileSync(join(d, '.claude', 'settings.json'), 'utf8'));",
+ "span": "L19-L30"
+ }
},
{
- "id": "test/graph-scopes.test.ts#pyFns",
- "name": "pyFns",
+ "id": "test/claude-init.test.ts#col",
+ "name": "col",
"kind": "function",
- "path": "test/graph-scopes.test.ts",
- "span": "L159-L161",
- "signature": "function pyFns(n: number): string",
+ "path": "test/claude-init.test.ts",
+ "span": "L116-L116",
+ "signature": "col = (text: string, marker: string)",
"exported": false,
"origin": "ast",
- "body_hash": "66058beee96d43f3e99600dd019dfff7771d96c51cbefa76db334ba5a08dec6f",
- "summary_state": "pending",
- "summary": null,
- "crux": null
+ "body_hash": "0b37f9523b6cb61e19981676c6eea4c39d624029fbc06e88392bb90dec866d68",
+ "summary_state": "ready",
+ "summary": "Determines the column alignment for specific text markers in the output, ensuring consistent formatting in the display.",
+ "crux": {
+ "code": " const col = (text: string, marker: string) => text.split('\\n').find((l) => l.includes(marker))!.indexOf('a new session');",
+ "span": "L116-L116"
+ }
},
{
- "id": "test/graph-scopes.test.ts#run",
- "name": "run",
+ "id": "test/claude-init.test.ts#fresh",
+ "name": "fresh",
"kind": "function",
- "path": "test/graph-scopes.test.ts",
- "span": "L75-L89",
- "signature": "run = (siblingName: string): string[]",
+ "path": "test/claude-init.test.ts",
+ "span": "L10-L10",
+ "signature": "function fresh(): string",
"exported": false,
"origin": "ast",
- "body_hash": "1ad4b6cd5889ea9fd5db15c6aa691788477f3e18a1a38d2faaa36347ef1fab0b",
- "summary_state": "pending",
- "summary": null,
- "crux": null
+ "body_hash": "e730884fcd6a9cadcca1e8a2f33564442c1ea4a2d1589c56af4b51b6de23d940",
+ "summary_state": "ready",
+ "summary": "Creates a fresh temporary directory for testing purposes, ensuring isolation between test runs.",
+ "crux": {
+ "code": "function fresh(): string { return mkdtempSync(join(tmpdir(), 'graft-init-')); }",
+ "span": "L10-L10"
+ }
},
{
- "id": "test/graph-scopes.test.ts#tsFns",
- "name": "tsFns",
+ "id": "test/claude-init.test.ts#runPostinstall",
+ "name": "runPostinstall",
"kind": "function",
- "path": "test/graph-scopes.test.ts",
- "span": "L155-L157",
- "signature": "function tsFns(n: number): string",
+ "path": "test/claude-init.test.ts",
+ "span": "L12-L17",
+ "signature": "function runPostinstall(env: Record<string, string>): string",
"exported": false,
"origin": "ast",
- "body_hash": "3b0fd3e3016031d46b2c8e0c42d7571ad9c0abfe7656557ae90064211618503d",
- "summary_state": "pending",
- "summary": null,
- "crux": null
+ "body_hash": "a9ee9b51b2acd9ee930e28e5c0968dc94c648d848eac513230143d3acadae7e7",
+ "summary_state": "ready",
+ "summary": "Executes the post-installation script, which sets up necessary configurations after the main initialization process.",
+ "crux": {
+ "code": "function runPostinstall(env: Record<string, string>): string {\n try {\n return execFileSync(process.execPath, ['scripts/postinstall.mjs'],\n { encoding: 'utf8', env: { ...process.env, ...env } });\n } catch { return ''; }",
+ "span": "L12-L16"
+ }
},
{
- "id": "test/graph-traverse-cli.test.ts",
- "name": "graph-traverse-cli.test.ts",
+ "id": "test/claude-paths.test.ts",
+ "name": "claude-paths.test.ts",
"kind": "file",
- "path": "test/graph-traverse-cli.test.ts",
- "span": "L1-L143",
+ "path": "test/claude-paths.test.ts",
+ "span": "L1-L24",
"signature": null,
"exported": true,
"origin": "ast",
- "body_hash": "53390c4f5cb5d2135b2d423c9b7e191abdb4897ebc29909be741cef4f0f7d81f",
- "chars": 5928,
- "summary_state": "stale",
- "summary": "This file contains tests for the CLI commands related to graph traversal, ensuring correct functionality and output for various scenarios.",
+ "body_hash": "205740f8110e72e4cb24652c09f763fad5e056dc77776bcfa95a1953731ed2c8",
+ "chars": 1063,
+ "summary_state": "ready",
+ "summary": "This test file verifies that the paths for the graft CLI and Claude script are correctly resolved relative to the module structure, ensuring they are independent of the current working directory.",
"crux": {
- "code": "test('graft callers: happy path shows header and the caller hit', () => {\n const d = builtRepo();\n const r = runCli(['callers', 'add', d]);\n assert.equal(r.status, 0);\n assert.match(r.stdout, /add · function · src\\/math\\.ts:/);\n assert.match(r.stdout, /calls ← sub \\(src\\/math\\.ts:/);\n});\n\ntest('graft callers --json: shape matches {query, matches:[{symbol,hits}]}', () => {\n const d = builtRepo();\n const r = runCli(['callers', 'add', d, '--json']);\n assert.equal(r.status, 0);",
- "span": "L42-L53"
+ "code": "test('graftCliPath is module-relative (cwd-independent) and points at a sibling cli.js', () => {\n const a = graftCliPath();\n const orig = process.cwd();\n try { process.chdir('/'); assert.equal(graftCliPath(), a, 'must not depend on cwd / project dir'); }\n finally { process.chdir(orig); }\n assert.match(a, /[/\\\\]cli\\.js$/);\n // cli.js sits one level above the claude module dir → its parent dir is src (tsx) or dist (built)\n assert.match(basename(dirname(a)), /^(src|dist)$/);\n});\n\ntest('claudeScriptPath resolves a sibling script in the claude dir (cwd-independent)', () => {\n const a = claudeScriptPath('sync-run.js');",
+ "span": "L6-L17"
}
},
{
- "id": "test/graph-traverse-cli.test.ts#builtRepo",
- "name": "builtRepo",
- "kind": "function",
- "path": "test/graph-traverse-cli.test.ts",
- "span": "L17-L28",
- "signature": "function builtRepo(): string",
- "exported": false,
+ "id": "test/claude-settings-merge.test.ts",
+ "name": "claude-settings-merge.test.ts",
+ "kind": "file",
+ "path": "test/claude-settings-merge.test.ts",
+ "span": "L1-L84",
+ "signature": null,
+ "exported": true,
"origin": "ast",
- "body_hash": "8c3de9f35f0d7a39cf5bd38c0462e92cb65cb762d5285e6cd637ef423631ea43",
+ "body_hash": "4c8b800f02d1b72050082bdbcdcda0878e5d9760563d2e1ca4a31cb06ffaaabb",
+ "chars": 4109,
"summary_state": "ready",
- "summary": "Sets up a temporary repository with a sample math module for testing CLI commands.",
+ "summary": "This test suite verifies the behavior of merging Graft settings, ensuring that defaults are applied correctly, existing configurations are preserved, and no duplicates are introduced during re-initialization.",
"crux": {
- "code": " 'export function add(a: number, b: number): number {\\n return a + b;\\n}\\n' +\n 'export function sub(a: number, b: number): number {\\n return add(a, -b);\\n}\\n' +\n 'export function compute(a: number, b: number): number {\\n return sub(a, b);\\n}\\n',",
- "span": "L21-L23"
+ "code": "test('empty settings gets the full Graft blocks', () => {\n const { merged, warnings } = mergeGraftSettings({});\n assert.equal(merged.statusLine.command, SL);\n assert.equal(merged.subagentStatusLine.command, SL);\n assert.ok(Array.isArray(merged.hooks.PostToolUse));\n assert.equal(merged.hooks.PostToolUse[0].matcher, 'Write|Edit|MultiEdit');\n for (const e of ['PostToolUse', 'UserPromptSubmit', 'SessionStart', 'Stop']) {\n assert.ok(merged.hooks[e][0].hooks[0].command.includes('graft-hooks.cjs'), `${e} wired`);\n }\n assert.ok(merged.footerLinksRegexes.includes('graft/[\\\\w./-]+\\\\.md'));\n assert.deepEqual(warnings, []);\n});",
+ "span": "L7-L18"
}
},
{
- "id": "test/graph-traverse-cli.test.ts#runCli",
- "name": "runCli",
- "kind": "function",
- "path": "test/graph-traverse-cli.test.ts",
- "span": "L30-L41",
- "signature": "function runCli(args: string[]): { stdout: string; stderr: string; status: number }",
- "exported": false,
+ "id": "test/claude-shim-template.test.ts",
+ "name": "claude-shim-template.test.ts",
+ "kind": "file",
+ "path": "test/claude-shim-template.test.ts",
+ "span": "L1-L34",
+ "signature": null,
+ "exported": true,
"origin": "ast",
- "body_hash": "3aae0bf33b1d771d8677050168cec54ed0b21cf245a4c04c715f6a520b61a7b0",
+ "body_hash": "f787f99fef2dc6a5ed366419fc470e8e4f825e0bc590cf3550d39e01995e7619",
+ "chars": 1585,
"summary_state": "ready",
- "summary": "Executes the CLI command with given arguments and captures the output and status code.",
+ "summary": "This test file validates the behavior of the statusline and hooks shims to ensure they correctly parse and resolve module paths in a Node.js environment.",
"crux": {
- "code": " const stdout = execFileSync(process.execPath, ['--import', 'tsx', 'src/cli.ts', ...args], {\n encoding: 'utf8',\n stdio: ['ignore', 'pipe', 'pipe'],\n });\n return { stdout, stderr: '', status: 0 };\n } catch (err) {\n const e = err as { stdout?: string; stderr?: string; status?: number };\n return { stdout: e.stdout ?? '', stderr: e.stderr ?? '', status: e.status ?? 1 };",
- "span": "L31-L38"
+ "code": " const body = src.replace(/^#!.*\\n/, ''); // strip shebang for vm\n assert.doesNotThrow(() => new vm.Script(body), 'valid JS');\n\n // 1. baked dir is present as the first candidate\n assert.match(src, new RegExp(`const BAKED = \"${BAKED}\"`));\n // 2. repo node_modules via require.resolve from the project dir\n assert.match(src, /require\\.resolve\\('@nanonets\\/graft\\/package\\.json', \\{ paths: \\[base\\] \\}\\)/);\n assert.match(src, /fromPkg\\(dir\\)/);\n // 3. legacy execPath/../lib guess retained\n assert.match(src, /path\\.join\\(path\\.dirname\\(process\\.execPath\\), '\\.\\.', 'lib'\\)/);\n // 4. npm root -g catch-all, queried on demand (no on-disk cache)\n assert.match(src, /execFileSync\\('npm', \\['root', '-g'\\]/);",
+ "span": "L10-L21"
}
},
{
- "id": "test/graph-traverse.test.ts",
- "name": "graph-traverse.test.ts",
+ "id": "test/claude-skill-template.test.ts",
+ "name": "claude-skill-template.test.ts",
"kind": "file",
- "path": "test/graph-traverse.test.ts",
- "span": "L1-L277",
+ "path": "test/claude-skill-template.test.ts",
+ "span": "L1-L23",
"signature": null,
"exported": true,
"origin": "ast",
- "body_hash": "9683b55f739af4afbb3840cee333eed0b1869494b66fe9cddfae1153df246947",
- "chars": 10972,
- "summary_state": "ready",
- "summary": "Contains tests for graph traversal functionalities, ensuring correct symbol resolution and edge walking behavior.",
+ "body_hash": "4cd70d1c165527b023ade24e24ade06c91b7dd4c83120f1cc84cc200f2f98205",
+ "chars": 1380,
+ "summary_state": "stale",
+ "summary": "This test ensures that the generated skill template adheres to the expected format and contains the necessary components for functionality.",
"crux": {
- "code": "test(\"resolveSymbol: bare name match is case-insensitive\", () => {\n const g = baseGraph();\n const matches = resolveSymbol(g, \"RENDER\");\n assert.deepEqual(matches.map((n) => n.id), [\"src/widget.ts#Widget.render\"]);\n});\n\ntest(\"resolveSymbol: qualified Class.method resolves via id suffix\", () => {\n const g = baseGraph();\n const matches = resolveSymbol(g, \"Cache.get\");\n assert.deepEqual(matches.map((n) => n.id), [\"src/cache.ts#Cache.get\"]);\n});\n",
- "span": "L70-L81"
+ "code": " assert.ok(src.startsWith('---\\n'), 'starts with YAML frontmatter');\n assert.match(src, /^name: graft$/m, 'declares name: graft');\n assert.match(src, /^description:/m, 'has a description');\n const body = src.split(/\\n---\\n/)[1] ?? '';\n assert.ok(body.trim().length > 0, 'has a non-empty body');\n assert.match(body, /graft ask/, 'body tells the agent to use `graft ask`');\n assert.match(body, /every occurrence/i, 'body teaches the exhaustive-task grep rule');\n assert.match(body, /graft callers/, 'body teaches the callers command');\n assert.match(body, /graft callees/, 'body teaches the callees command');\n assert.match(body, /graft impact/, 'body teaches the impact command');\n assert.match(body, /truncated/i, 'body tells the agent to follow up on truncated spans');\n assert.match(body, /graft grep/, 'body routes sweeps to graft grep');",
+ "span": "L7-L18"
}
},
{
- "id": "test/graph-traverse.test.ts#baseGraph",
- "name": "baseGraph",
- "kind": "function",
- "path": "test/graph-traverse.test.ts",
- "span": "L57-L66",
- "signature": "function baseGraph(): GraphV1",
- "exported": false,
+ "id": "test/claude-state.test.ts",
+ "name": "claude-state.test.ts",
+ "kind": "file",
+ "path": "test/claude-state.test.ts",
+ "span": "L1-L51",
+ "signature": null,
+ "exported": true,
"origin": "ast",
- "body_hash": "6d809e9b571f2f9529bce4e42392b36e09b8bb9050633f2daaa90f202ff47bab",
+ "body_hash": "78e6a81af7642ea788072457ea181bc626c7a8a898cfebb882ab42fed7e9dd2e",
+ "chars": 1991,
"summary_state": "ready",
- "summary": "Creates a base graph fixture used for testing symbol resolution and edge walking.",
+ "summary": "This test suite verifies the functionality of state management, including stats and session handling, as well as lock acquisition and release mechanisms.",
"crux": {
- "code": "function baseGraph(): GraphV1 {\n return graphOf(\n [cacheGet, widgetRender, otherGet, hashFn, fileNode],\n [\n edge(\"src/cache.ts\", \"src/cache.ts#Cache.get\", \"contains\"),\n edge(\"src/cache.ts#Cache.get\", \"src/widget.ts#Widget.render\", \"calls\"),\n edge(\"src/cache.ts#Cache.get\", \"npm:lodash\", \"imports\"),\n ],\n );\n}",
- "span": "L57-L66"
+ "code": "test('stats round-trip and patch merge', () => {\n const d = fresh();\n assert.equal(readStats(d), null);\n writeStats(d, { ...emptyStats(), nodeCount: 319, edgeCount: 730 });\n assert.equal(readStats(d)!.nodeCount, 319);\n const patched = patchStats(d, { dirty: true, staleCount: 4 });\n assert.equal(patched.dirty, true);\n assert.equal(patched.staleCount, 4);\n assert.equal(readStats(d)!.edgeCount, 730, 'patch preserves other fields');\n});\n\ntest('session defaults and round-trip', () => {",
+ "span": "L13-L24"
}
},
{
- "id": "test/graph-traverse.test.ts#diamondGraph",
- "name": "diamondGraph",
+ "id": "test/claude-state.test.ts#fresh",
+ "name": "fresh",
"kind": "function",
- "path": "test/graph-traverse.test.ts",
- "span": "L167-L179",
- "signature": "function diamondGraph(): GraphV1",
+ "path": "test/claude-state.test.ts",
+ "span": "L11-L11",
+ "signature": "function fresh(): string",
"exported": false,
"origin": "ast",
- "body_hash": "5f778e8292d09729865a06efd50026df15ba7da5a5fb6980e3dd814036db0aca",
+ "body_hash": "49e9f70f3b52532360521760ee5e0e5c907bdf3f55d1ed2c90bb3c3e48d93cda",
"summary_state": "ready",
- "summary": "Constructs a diamond-shaped graph for testing the impact of nodes based on incoming edges.",
+ "summary": "Generates a unique temporary directory for testing purposes to ensure isolation between test cases.",
"crux": {
- "code": "function diamondGraph(): GraphV1 {\n const X = nodeStub({ id: \"X\", name: \"X\" });\n const A = nodeStub({ id: \"A\", name: \"A\" });\n const B = nodeStub({ id: \"B\", name: \"B\" });\n const C = nodeStub({ id: \"C\", name: \"C\" });\n return {\n node: X,\n graph: graphOf(\n [X, A, B, C],\n [edge(\"A\", \"X\", \"calls\"), edge(\"B\", \"X\", \"calls\"), edge(\"C\", \"A\", \"calls\"), edge(\"C\", \"B\", \"calls\")],\n ),\n } as unknown as { node: NodeV1; graph: GraphV1 };",
- "span": "L167-L178"
+ "code": "function fresh(): string { return mkdtempSync(join(tmpdir(), 'graft-state-')); }",
+ "span": "L11-L11"
}
},
{
- "id": "test/graph-traverse.test.ts#edge",
- "name": "edge",
- "kind": "function",
- "path": "test/graph-traverse.test.ts",
- "span": "L32-L34",
- "signature": "function edge(source: string, target: string, relation: Relation = \"calls\"): EdgeV1",
- "exported": false,
+ "id": "test/claude-stats.test.ts",
+ "name": "claude-stats.test.ts",
+ "kind": "file",
+ "path": "test/claude-stats.test.ts",
+ "span": "L1-L30",
+ "signature": null,
+ "exported": true,
"origin": "ast",
- "body_hash": "123ba52d4dfdf593b1dd056eb9c949165a0ba7fd06eaf374cf1bf1bd797baee8",
+ "body_hash": "f625d026d152a65017699e37e27534043dc0af0f43ba2d3ea778bac8ddab82c3",
+ "chars": 983,
"summary_state": "ready",
- "summary": "Constructs an edge between two nodes in the graph, defining their relationship type.",
+ "summary": "This test file verifies the functionality of the computeStats function to ensure it accurately calculates node and edge counts, as well as the count of ready nodes from a given wiring structure.",
"crux": {
- "code": "function edge(source: string, target: string, relation: Relation = \"calls\"): EdgeV1 {\n return { source, target, relation, confidence: \"extracted\" };\n}",
- "span": "L32-L34"
+ "code": "test('computeStats derives counts and readyCount', () => {\n const s = computeStats(wiring);\n assert.equal(s.nodeCount, 3);\n assert.equal(s.edgeCount, 2);\n assert.deepEqual(s.languages, ['typescript']);\n assert.equal(s.totalCount, 3);\n assert.equal(s.readyCount, 2);",
+ "span": "L15-L21"
}
},
{
- "id": "test/graph-traverse.test.ts#fileAndSymbolGraph",
- "name": "fileAndSymbolGraph",
- "kind": "function",
- "path": "test/graph-traverse.test.ts",
- "span": "L221-L231",
- "signature": "function fileAndSymbolGraph()",
- "exported": false,
+ "id": "test/claude-statusline.test.ts",
+ "name": "claude-statusline.test.ts",
+ "kind": "file",
+ "path": "test/claude-statusline.test.ts",
+ "span": "L1-L48",
+ "signature": null,
+ "exported": true,
"origin": "ast",
- "body_hash": "8d46dcd8a65e23d4490137683c72016c5380080da91bc2cdb643dec3df6a637b",
+ "body_hash": "07128b5b195af3a37c1e170a35c18378e36160d1a6f8e17be362bac315811cac",
+ "chars": 2137,
"summary_state": "ready",
- "summary": "Creates a graph that includes both file and symbol nodes to test their interactions in dependency resolution.",
+ "summary": "This file contains tests for the resolveStats function, ensuring it correctly retrieves and prioritizes cached statistics or falls back to graph data as needed.",
"crux": {
- "code": "function fileAndSymbolGraph() {\n const fileA = nodeStub({ id: \"src/a.ts\", name: \"a.ts\", kind: \"file\", path: \"src/a.ts\" });\n const helper = nodeStub({ id: \"src/a.ts#helper\", name: \"helper\", kind: \"function\", path: \"src/a.ts\" });\n const fileB = nodeStub({ id: \"src/b.ts\", name: \"b.ts\", kind: \"file\", path: \"src/b.ts\" });\n const useB = nodeStub({ id: \"src/b.ts#useB\", name: \"useB\", kind: \"function\", path: \"src/b.ts\" });\n const graph = graphOf(\n [fileA, helper, fileB, useB],\n [edge(\"src/b.ts\", \"src/a.ts\", \"imports\"), edge(\"src/b.ts#useB\", \"src/a.ts#helper\", \"calls\")],\n );\n return { fileA, helper, fileB, useB, graph };\n}",
- "span": "L221-L231"
+ "code": "test('resolveStats returns the hook-maintained cache when present and non-empty', () => {\n const d = repo();\n writeStats(d, { ...emptyStats(), nodeCount: 5, edgeCount: 9, dirty: true, staleCount: 2 });\n const s = resolveStats(d)!;\n assert.equal(s.nodeCount, 5);\n assert.equal(s.dirty, true, 'cache is the source of truth when present');\n});\n\ntest('resolveStats falls back to wiring.json when no cache (manual graft build / fresh checkout)', () => {\n const d = repo();\n writeWiring(d, {\n meta: { nodeCount: 42, edgeCount: 100, languages: ['typescript'] },",
+ "span": "L15-L26"
}
},
{
- "id": "test/graph-traverse.test.ts#graphOf",
- "name": "graphOf",
+ "id": "test/claude-statusline.test.ts#repo",
+ "name": "repo",
"kind": "function",
- "path": "test/graph-traverse.test.ts",
- "span": "L36-L42",
- "signature": "function graphOf(nodes: NodeV1[], edges: EdgeV1[]): GraphV1",
+ "path": "test/claude-statusline.test.ts",
+ "span": "L9-L9",
+ "signature": "function repo(): string",
"exported": false,
"origin": "ast",
- "body_hash": "3e1c1fd8cd1838095c47e9e0e80c0dac69a49091787a166d61858315c7ee4c63",
+ "body_hash": "121eb027efad697b8021b3a994a7f977441a0a34c0e92fd9a1792851368850e5",
"summary_state": "ready",
- "summary": "Generates a graph structure from an array of nodes and edges, encapsulating metadata about the graph.",
+ "summary": "Creates a temporary directory for testing purposes, ensuring a clean environment for each test run.",
"crux": {
- "code": "function graphOf(nodes: NodeV1[], edges: EdgeV1[]): GraphV1 {\n return {\n meta: { version: 1, nodeCount: nodes.length, edgeCount: edges.length, languages: [\"ts\"] },\n nodes,\n edges,\n };\n}",
- "span": "L36-L42"
+ "code": "function repo(): string { return mkdtempSync(join(tmpdir(), 'graft-sl-')); }",
+ "span": "L9-L9"
}
},
{
- "id": "test/graph-traverse.test.ts#nodeStub",
- "name": "nodeStub",
+ "id": "test/claude-statusline.test.ts#writeWiring",
+ "name": "writeWiring",
"kind": "function",
- "path": "test/graph-traverse.test.ts",
- "span": "L15-L30",
- "signature": "function nodeStub(partial: Partial<NodeV1> & { id: string }): NodeV1",
+ "path": "test/claude-statusline.test.ts",
+ "span": "L10-L13",
+ "signature": "function writeWiring(dir: string, obj: unknown): void",
"exported": false,
"origin": "ast",
- "body_hash": "7e4a8788936b6b4d198eb93113a428318b00f2276e01fd31d89f8c9cf3f81ccb",
+ "body_hash": "2e1f37e4395b142a5e04d343c3d72366ed3c3245acc13afc8eef46df21b1df21",
"summary_state": "ready",
- "summary": "Creates a stub node for testing purposes, encapsulating essential properties of a NodeV1 object.",
+ "summary": "Writes a wiring.json file to a specified directory, setting up the necessary structure for graph data in tests.",
"crux": {
- "code": "function nodeStub(partial: Partial<NodeV1> & { id: string }): NodeV1 {\n return {\n name: partial.id,\n kind: \"function\",\n path: partial.id.split(\"#\")[0],\n span: \"L1-L1\",\n signature: null,\n exported: true,\n origin: \"ast\",\n body_hash: partial.id,\n summary_state: \"pending\",\n summary: null,",
- "span": "L15-L26"
+ "code": "function writeWiring(dir: string, obj: unknown): void {\n mkdirSync(join(dir, 'graft', '.graph'), { recursive: true });\n writeFileSync(join(dir, 'graft', '.graph', 'wiring.json'), JSON.stringify(obj));",
+ "span": "L10-L12"
}
},
{
- "id": "test/graph-write.test.ts",
- "name": "graph-write.test.ts",
+ "id": "test/cli-meta.test.ts",
+ "name": "cli-meta.test.ts",
"kind": "file",
- "path": "test/graph-write.test.ts",
- "span": "L1-L128",
+ "path": "test/cli-meta.test.ts",
+ "span": "L1-L81",
"signature": null,
"exported": true,
"origin": "ast",
- "body_hash": "cbbf9c3591519993ec89298444d34732f08eb16f90ba1c1cd33bd39d5512f9ff",
- "chars": 4839,
- "summary_state": "ready",
- "summary": "This file contains tests to ensure that the `writeGraph` function correctly handles the serialization of graph nodes, specifically that the `body_text` field is omitted when unnecessary, while preserving other fields and the integrity of the original node object.",
- "crux": {
- "code": "test(\"writeGraph strips body_text from the serialized node but keeps every other field\", () => {\n const dir = mkdtempSync(join(tmpdir(), \"graft-write-\"));\n try {\n const node = makeNode({ body_text: \"some searchable definition body\" });\n const graph: GraphV1 = {\n meta: { version: 1, nodeCount: 1, edgeCount: 0, languages: [\"typescript\"] },\n nodes: [node],\n edges: [],\n };\n const path = writeGraph(graph, dir);\n\n const raw = JSON.parse(readFileSync(path, \"utf8\"));",
- "span": "L37-L48"
- }
- },
- {
- "id": "test/graph-write.test.ts#makeNode",
- "name": "makeNode",
- "kind": "function",
- "path": "test/graph-write.test.ts",
- "span": "L19-L35",
- "signature": "function makeNode(overrides: Partial<NodeV1> = {}): NodeV1",
- "exported": false,
- "origin": "ast",
- "body_hash": "41ebbf74745569c7f08bdc2d7a852617987e439975ac045b640252aa0684fc7e",
+ "body_hash": "e7a05bf838e876a317276f94a26d92b0b1526e1ea7eabda4e68b804bdb0334e5",
+ "chars": 3338,
"summary_state": "ready",
- "summary": "Creates a node object with default properties, allowing for optional overrides, to facilitate testing of graph serialization and deserialization.",
+ "summary": "This file contains tests for formatting version and upgrade reports, resolving package.json paths, reading the current version, and detecting if a script is running via npx, ensuring correct behavior of the CLI meta functionalities.",
"crux": {
- "code": " return {\n id: \"a.ts#f\",\n name: \"f\",\n kind: \"function\",\n path: \"a.ts\",\n span: \"L1-L3\",\n signature: \"f(): void\",\n exported: true,\n origin: \"ast\",\n body_hash: \"hash\",\n summary_state: \"pending\",\n summary: null,",
- "span": "L20-L31"
+ "code": "test('formatVersionReport: up to date', () => {\n const out = formatVersionReport('0.4.4', { ok: true, version: '0.4.4' });\n assert.equal(out, 'graft 0.4.4\\nlatest on npm: 0.4.4 ✓ up to date');\n});\n\ntest('formatVersionReport: newer version available', () => {\n const out = formatVersionReport('0.4.4', { ok: true, version: '0.4.5' });\n assert.equal(out, 'graft 0.4.4\\nlatest on npm: 0.4.5 — run graft upgrade');\n});\n\ntest('formatVersionReport: offline / unreachable', () => {\n const out = formatVersionReport('0.4.4', { ok: false });",
+ "span": "L16-L27"
}
},
{
- "id": "test/graphrank.test.ts",
- "name": "graphrank.test.ts",
+ "id": "test/context.test.ts",
+ "name": "context.test.ts",
"kind": "file",
- "path": "test/graphrank.test.ts",
- "span": "L1-L257",
+ "path": "test/context.test.ts",
+ "span": "L1-L213",
"signature": null,
"exported": true,
"origin": "ast",
- "body_hash": "e4e6155adc501b4d336cba4ad49192310678cf67f3547e2b362bfcb68f30a53e",
- "chars": 11404,
- "summary_state": "stale",
- "summary": "This file contains unit and integration tests for the personalizedPageRank function, ensuring it correctly ranks nodes based on their connectivity in a graph.",
+ "body_hash": "126861c136d48ed6a148e50226c96ec2935c52cf83ef56fbd43392e0d271db1f",
+ "chars": 7976,
+ "summary_state": "ready",
+ "summary": "This file contains end-to-end tests for the markdown-graph pipeline, ensuring that the initialization and checking processes work correctly with various scenarios.",
"crux": {
- "code": "test(\"PageRank: a seed wired to the cluster outranks an isolated seed\", () => {\n // hub calls a, b, c; lone is a disconnected seed with equal restart weight.\n const g = graphOf(\n [\"hub\", \"a\", \"b\", \"c\", \"lone\"],\n [edge(\"hub\", \"a\"), edge(\"hub\", \"b\"), edge(\"hub\", \"c\")],\n );\n const pr = personalizedPageRank(g, new Map([[\"hub\", 1], [\"lone\", 1]]));\n assert.ok((pr.get(\"hub\") ?? 0) > (pr.get(\"lone\") ?? 0), \"connected seed beats isolated seed\");\n assert.equal([...pr.values()].some((v) => v === 1), true, \"top node normalized to 1\");\n});\n\ntest(\"PageRank: neighbours of a seed accrue mass even with zero restart weight\", () => {",
- "span": "L50-L61"
+ "code": "test(\"init builds one markdown node per entity, with links and a manifest\", async () => {\n const dir = makeFixture();\n try {\n const r = await buildContext(dir, buildOpts());\n // Auth Service, Token Store, Billing.\n assert.equal(r.nodes, 3);\n assert.equal(r.links, 2);\n assert.equal(r.files, 2);\n\n const ctx = join(dir, \"graft\");\n assert.ok(existsSync(join(ctx, \"auth-service.md\")));\n assert.ok(existsSync(join(ctx, \"token-store.md\")));",
+ "span": "L49-L60"
}
},
{
- "id": "test/graphrank.test.ts#edge",
- "name": "edge",
+ "id": "test/context.test.ts#buildOpts",
+ "name": "buildOpts",
"kind": "function",
- "path": "test/graphrank.test.ts",
- "span": "L39-L41",
- "signature": "function edge(source: string, target: string, relation: Relation = \"calls\"): EdgeV1",
+ "path": "test/context.test.ts",
+ "span": "L45-L47",
+ "signature": "function buildOpts()",
"exported": false,
"origin": "ast",
- "body_hash": "123ba52d4dfdf593b1dd056eb9c949165a0ba7fd06eaf374cf1bf1bd797baee8",
+ "body_hash": "20ec093d8fa9dadc46af8980d9440b6824597f4cdeb74529d4d62ee38d27e52d",
"summary_state": "ready",
- "summary": "Defines an edge between two nodes in the graph, establishing a relationship.",
- "crux": {
- "code": "function edge(source: string, target: string, relation: Relation = \"calls\"): EdgeV1 {\n return { source, target, relation, confidence: \"extracted\" };\n}",
- "span": "L39-L41"
- }
+ "summary": "This function generates options for building the context, including a fake model and providers.",
+ "crux": null
},
{
- "id": "test/graphrank.test.ts#graphOf",
- "name": "graphOf",
+ "id": "test/context.test.ts#makeFixture",
+ "name": "makeFixture",
"kind": "function",
- "path": "test/graphrank.test.ts",
- "span": "L42-L48",
- "signature": "function graphOf(nodes: string[], edges: EdgeV1[]): GraphV1",
+ "path": "test/context.test.ts",
+ "span": "L32-L43",
+ "signature": "function makeFixture(): string",
"exported": false,
"origin": "ast",
- "body_hash": "bf3b5a40bcc1fa81ff40b720adeff034d332bbbb831f3e2f7528e2f667146ce1",
+ "body_hash": "515198ac732683d4da4b920e53a0eb439ea8e0107afb22af65cc29c0e702192c",
"summary_state": "ready",
- "summary": "Constructs a graph object from given nodes and edges, encapsulating their relationships.",
+ "summary": "This function creates a temporary directory with mock service files for testing the context building process.",
"crux": {
- "code": "function graphOf(nodes: string[], edges: EdgeV1[]): GraphV1 {\n return {\n meta: { version: 1, nodeCount: nodes.length, edgeCount: edges.length, languages: [\"ts\"] },\n nodes: nodes.map(node),\n edges,\n };\n}",
- "span": "L42-L48"
+ "code": " const dir = mkdtempSync(join(tmpdir(), \"ctxgraph-\"));\n writeFileSync(\n join(dir, \"auth.ts\"),\n `// [[Auth Service]] ==depends_on==> [[Token Store]]\\nexport const auth = 1;\\n`,\n );\n writeFileSync(\n join(dir, \"billing.ts\"),\n `// [[Billing]] ==uses==> [[Auth Service]]\\nexport const billing = 2;\\n`,\n );\n return dir;",
+ "span": "L15-L24"
}
},
{
- "id": "test/graphrank.test.ts#makeCollisionFixture",
- "name": "makeCollisionFixture",
+ "id": "test/context.test.ts#runCli",
+ "name": "runCli",
"kind": "function",
- "path": "test/graphrank.test.ts",
- "span": "L182-L192",
- "signature": "function makeCollisionFixture(): string",
+ "path": "test/context.test.ts",
+ "span": "L19-L30",
+ "signature": "function runCli(args: string[]): { stdout: string; stderr: string; status: number }",
"exported": false,
"origin": "ast",
- "body_hash": "2177edb69c1857665ec38d0fadebf5147cc7c3e71b39d026ee7f33e0c07865f8",
+ "body_hash": "f6727f675d8cb599692eabff8675faa168c515b6cfe5d91fbc1092f31371e31f",
"summary_state": "ready",
- "summary": "Sets up a temporary file structure to simulate a collision scenario for testing graph ranking.",
+ "summary": "This function executes a command-line interface (CLI) command and captures its output, allowing tests to verify the behavior of the CLI under different conditions.",
"crux": {
- "code": "function makeCollisionFixture(): string {\n const dir = mkdtempSync(join(tmpdir(), \"graft-graphrank-\"));\n writeFileSync(\n join(dir, \"connected.ts\"),\n `export function fooHandler() {\\n helperAlpha();\\n helperBeta();\\n}\\n` +\n `export function helperAlpha() { return 1; }\\n` +\n `export function helperBeta() { return 2; }\\n`,\n );\n writeFileSync(join(dir, \"isolated.ts\"), `export function fooWidget() { return 0; }\\n`);\n return dir;\n}",
- "span": "L128-L138"
+ "code": " const stdout = execFileSync(process.execPath, [\"--import\", \"tsx\", \"src/cli.ts\", ...args], {\n encoding: \"utf8\",\n stdio: [\"ignore\", \"pipe\", \"pipe\"],\n });\n return { stdout, stderr: \"\", status: 0 };\n } catch (err) {\n const e = err as { stdout?: string; stderr?: string; status?: number };\n return { stdout: e.stdout ?? \"\", stderr: e.stderr ?? \"\", status: e.status ?? 1 };",
+ "span": "L21-L28"
}
},
{
- "id": "test/graphrank.test.ts#node",
- "name": "node",
- "kind": "function",
- "path": "test/graphrank.test.ts",
- "span": "L23-L38",
- "signature": "function node(id: string): NodeV1",
- "exported": false,
+ "id": "test/covers.test.ts",
+ "name": "covers.test.ts",
+ "kind": "file",
+ "path": "test/covers.test.ts",
+ "span": "L1-L77",
+ "signature": null,
+ "exported": true,
"origin": "ast",
- "body_hash": "50c83e997e60e662392960d89cc6c5b421a65cfd8c166084e4c5f3c8ea9a9bd6",
+ "body_hash": "f5a75f405be1a01ad43fc806588858df3a8988fee62ad4ec024440d3f5e0fc0c",
+ "chars": 3059,
"summary_state": "ready",
- "summary": "Creates a node representation for the graph with specified properties.",
+ "summary": "This test suite verifies that the wiring build correctly populates the 'covers' field in concept nodes and maintains stability across builds.",
"crux": {
- "code": "function node(id: string): NodeV1 {\n return {\n id,\n name: id,\n kind: \"function\",\n path: `${id}.ts`,\n span: \"L1-L1\",\n signature: null,\n exported: true,\n origin: \"ast\",\n body_hash: id,\n summary_state: \"pending\",",
- "span": "L23-L34"
+ "code": "test(\"wiring build backfills covers: onto concept nodes\", async () => {\n const dir = makeFixture();\n try {\n await buildContext(dir, { model: \"fake\", ...fakeProviders() });\n await buildGraph(dir); // $0, no LLM — still writes cards + covers\n\n const fm = matter(readFileSync(join(dir, \"graft\", \"auth-service.md\"), \"utf8\")).data;\n assert.ok(Array.isArray(fm.covers), \"covers should be an array\");\n const login = fm.covers.find((c: { symbol: string }) => c.symbol === \"login\");\n assert.ok(login, \"covers should include the login function\");\n assert.equal(login.kind, \"function\");\n assert.match(login.at, /^auth\\.ts:L\\d+-L\\d+$/);",
+ "span": "L26-L37"
}
},
{
- "id": "test/graphrank.test.ts#rank",
- "name": "rank",
+ "id": "test/covers.test.ts#makeFixture",
+ "name": "makeFixture",
"kind": "function",
- "path": "test/graphrank.test.ts",
- "span": "L194-L195",
- "signature": "rank = (dir: string, gr: boolean)",
+ "path": "test/covers.test.ts",
+ "span": "L16-L24",
+ "signature": "function makeFixture(): string",
"exported": false,
"origin": "ast",
- "body_hash": "5bf6fb6a4dc37b257683b4ab9b24ff4838cf94cd3404123bb383861163c4bbec",
+ "body_hash": "c50f4905cfffe46da829a42a2bcab6838f96a17497009a9efe7a64a98729540f",
"summary_state": "ready",
- "summary": "Executes the ask function with specified parameters to retrieve ranked results based on graph connectivity.",
+ "summary": "Creates a temporary directory with a sample TypeScript file for testing the wiring build.",
"crux": {
- "code": "const rank = (dir: string, gr: boolean) =>\n ask(dir, \"foo\", { graphRank: gr }).hits.map((h) => h.title.split(\" ·\")[0]);",
- "span": "L140-L141"
+ "code": " const dir = mkdtempSync(join(tmpdir(), \"graft-covers-\"));\n writeFileSync(\n join(dir, \"auth.ts\"),\n `// [[Auth Service]] ==depends_on==> [[Token Store]]\\n` +\n `export function login(user: string): boolean {\\n return user.length > 0;\\n}\\n`,\n );\n return dir;",
+ "span": "L17-L23"
}
},
{
- "id": "test/helpers.ts",
- "name": "helpers.ts",
+ "id": "test/graph-bindings.test.ts",
+ "name": "graph-bindings.test.ts",
"kind": "file",
- "path": "test/helpers.ts",
- "span": "L1-L55",
+ "path": "test/graph-bindings.test.ts",
+ "span": "L1-L82",
"signature": null,
"exported": true,
"origin": "ast",
- "body_hash": "e45af1d38d7c6d4abc804fc74e9ae4c3373cf78769c17b16b185c3ee0e2c3228",
- "chars": 2012,
+ "body_hash": "b6892b1b6982547fc67d5b0e7812a536e47018ab3e38e4eda35a0f12f24ab8db",
+ "chars": 4267,
"summary_state": "ready",
- "summary": "This file provides test doubles for offline, deterministic testing of components without external dependencies.",
- "crux": null
+ "summary": "This file contains tests that validate the behavior of type bindings in different programming languages' code snippets.",
+ "crux": {
+ "code": "test(\"py: constructor assignment binds receiver type\", () => {\n const edges = callEdges(\"class A:\\n def m(self): pass\\napp = A()\\ndef f():\\n app.m()\\n\", \"python\");\n const call = edges.find((e) => e.name === \"m\" && e.viaMember);\n assert.equal(call?.recvType, \"A\");\n});\n\ntest(\"py: parameter annotation binds\", () => {\n const edges = callEdges(\"def f(app: FastAPI):\\n app.include_router()\\n\", \"python\");\n assert.equal(edges.find((e) => e.name === \"include_router\")?.recvType, \"FastAPI\");\n});\n\ntest(\"py: self binds to enclosing class; self.attr via __init__ assignment\", () => {",
+ "span": "L9-L20"
+ }
},
{
- "id": "test/helpers.ts#BracketSynthesizer",
- "name": "BracketSynthesizer",
- "kind": "class",
- "path": "test/helpers.ts",
- "span": "L21-L50",
- "signature": "class BracketSynthesizer implements Synthesizer",
- "exported": true,
+ "id": "test/graph-bindings.test.ts#callEdges",
+ "name": "callEdges",
+ "kind": "function",
+ "path": "test/graph-bindings.test.ts",
+ "span": "L5-L7",
+ "signature": "function callEdges(src: string, lang: \"python\" | \"typescript\" | \"go\", file = `x.${lang === \"python\" ? \"py\" : lang === \"go\" ? \"go\" : \"ts\"}`)",
+ "exported": false,
"origin": "ast",
- "body_hash": "6a30b1293990bb2dce95f1f1f77219dbcdc54eef7e6a01d0db03403f4d344bcc",
+ "body_hash": "835bab16fc5593e4c29ca25d3accec71d790d08f8d0127043711501b6ba94e2d",
"summary_state": "ready",
- "summary": "This class synthesizes a graph structure from simple markup, enabling tests to define the relationships between nodes explicitly.",
+ "summary": "This function extracts call edges from source code based on the specified programming language, filtering for 'calls' relations.",
"crux": {
- "code": " async synthesize(files: FileSummary[]): Promise<SynthNode[]> {\n const byName = new Map<string, { sources: Set<string>; links: Map<string, SynthLink> }>();\n const ensure = (name: string) => {\n let e = byName.get(name);\n if (!e) {\n e = { sources: new Set(), links: new Map() };\n byName.set(name, e);\n }\n return e;\n };\n for (const f of files) {\n for (const m of f.summary.matchAll(/\\[\\[([^\\]]+)\\]\\]/g)) {",
- "span": "L22-L33"
+ "code": " return extractFile(file, src, lang).rawEdges.filter((e) => e.relation === \"calls\");",
+ "span": "L6-L6"
}
},
{
- "id": "test/helpers.ts#BracketSynthesizer.synthesize",
- "name": "synthesize",
- "kind": "method",
- "path": "test/helpers.ts",
- "span": "L22-L49",
- "signature": "async synthesize(files: FileSummary[]): Promise<SynthNode[]>",
- "exported": true,
+ "id": "test/graph-go.test.ts",
+ "name": "graph-go.test.ts",
+ "kind": "file",
+ "path": "test/graph-go.test.ts",
+ "span": "L1-L168",
+ "signature": null,
+ "exported": true,
"origin": "ast",
- "body_hash": "b42a19064389576a02ba334fcab8bfb5d8d985a46f995be864095e770d47e26d",
+ "body_hash": "bf11085a7edb03c00d52dca090af9c1ca4eb3cb34bb88904bbdd478171d3483d",
+ "chars": 5664,
"summary_state": "ready",
- "summary": "This method processes file summaries to create a structured representation of nodes and their relationships based on markup.",
+ "summary": "This file contains tests for verifying the extraction of Go code structures and their relationships in a code graph.",
"crux": {
- "code": " for (const m of f.summary.matchAll(/\\[\\[([^\\]]+)\\]\\]\\s*==([a-z_]+)==>\\s*\\[\\[([^\\]]+)\\]\\]/g)) {\n const [, from, relation, to] = m;\n ensure(to.trim()).sources.add(f.path);\n ensure(from.trim()).links.set(`${to}|${relation}`, { to: to.trim(), relation });\n }",
- "span": "L36-L40"
+ "code": "test(\"Go extraction: funcs, methods, structs, interfaces, type aliases\", async () => {\n const dir = makeFixture();\n try {\n const result = await buildGraph(dir); // $0, Tier-1 only\n assert.ok(result.languages.includes(\"go\"), \"languages should include go\");\n\n const graph = readGraph(wiringPath(join(dir, \"graft\")));\n assert.ok(graph, \"wiring graph should be written\");\n\n // functions — exported by leading-uppercase\n const foo = nodeById(graph!, \"main.go#Foo\");\n assert.equal(foo?.kind, \"function\");",
+ "span": "L66-L77"
}
},
{
- "id": "test/helpers.ts#BracketSynthesizer.synthesize.ensure",
- "name": "ensure",
+ "id": "test/graph-go.test.ts#makeFixture",
+ "name": "makeFixture",
"kind": "function",
- "path": "test/helpers.ts",
- "span": "L24-L31",
- "signature": "ensure = (name: string)",
- "exported": true,
+ "path": "test/graph-go.test.ts",
+ "span": "L53-L60",
+ "signature": "function makeFixture(): string",
+ "exported": false,
"origin": "ast",
- "body_hash": "3b8cc65a6170766e70a5b038f9f27176e60114ce70e0e2dc1463f720ed384c4c",
+ "body_hash": "76b9a9cf518c965694990ed9cbfa55da12a5eb1bdc5b662c6b0550fb038dbb04",
"summary_state": "ready",
- "summary": "This function ensures that a node exists in the map, creating it if necessary, to maintain the graph structure.",
+ "summary": "Creates a temporary Go module directory with necessary files for testing graph extraction.",
"crux": {
- "code": " const ensure = (name: string) => {\n let e = byName.get(name);\n if (!e) {\n e = { sources: new Set(), links: new Map() };\n byName.set(name, e);\n }\n return e;\n };",
- "span": "L24-L31"
+ "code": " const dir = mkdtempSync(join(tmpdir(), \"graft-go-\"));\n writeFileSync(join(dir, \"go.mod\"), \"module mymod\\n\\ngo 1.21\\n\");\n writeFileSync(join(dir, \"main.go\"), MAIN_GO);\n mkdirSync(join(dir, \"pkg\", \"util\"), { recursive: true });\n writeFileSync(join(dir, \"pkg\", \"util\", \"util.go\"), UTIL_GO);\n return dir;\n}",
+ "span": "L54-L60"
}
},
{
- "id": "test/helpers.ts#fakeProviders",
- "name": "fakeProviders",
+ "id": "test/graph-go.test.ts#nodeById",
+ "name": "nodeById",
"kind": "function",
- "path": "test/helpers.ts",
- "span": "L52-L54",
- "signature": "function fakeProviders()",
- "exported": true,
+ "path": "test/graph-go.test.ts",
+ "span": "L62-L64",
+ "signature": "function nodeById(graph: GraphV1, id: string): NodeV1 | undefined",
+ "exported": false,
"origin": "ast",
- "body_hash": "0395bc21ba030a5d0e1fc9e5fdd0d8780c4309c87d899bedbc940f1bdcd2864f",
+ "body_hash": "7d35f3037365876a2bedd0af5973ec5cc0b3871e3bce7f310993d907ae378c67",
"summary_state": "ready",
- "summary": "This function creates and returns instances of the test doubles for summarization and synthesis.",
+ "summary": "Retrieves a node from the graph by its unique identifier, facilitating graph traversal and assertions in tests.",
"crux": null
},
{
- "id": "test/helpers.ts#PassthroughSummarizer",
- "name": "PassthroughSummarizer",
- "kind": "class",
- "path": "test/helpers.ts",
- "span": "L9-L13",
- "signature": "class PassthroughSummarizer implements Summarizer",
+ "id": "test/graph-load.test.ts",
+ "name": "graph-load.test.ts",
+ "kind": "file",
+ "path": "test/graph-load.test.ts",
+ "span": "L1-L153",
+ "signature": null,
"exported": true,
"origin": "ast",
- "body_hash": "43c71f9e449859d657d6cef17b80d2bb650734751530e8401c356fc963f7b012",
- "summary_state": "ready",
- "summary": "This class serves as a no-op summarizer that returns the input code unchanged for controlled testing.",
+ "body_hash": "1d283a2ff0318b7a3cd9be2b76ad3ef8a2eb4599934d37135448315c703c2c83",
+ "chars": 5530,
+ "summary_state": "stale",
+ "summary": "This file contains tests for caching mechanisms in the graph loading functionality to improve performance by avoiding unnecessary re-parsing of files.",
"crux": {
- "code": " async summarize(code: string): Promise<string> {\n return code;\n }",
- "span": "L10-L12"
+ "code": "test(\"loadGraphCached: two loads of an unchanged file return the same parsed object\", () => {\n const dir = fixtureDir();\n writeGraph({ version: 1, nodes: [node(\"a\")], edges: [] } as GraphV1, dir);\n __resetParseCounts();\n\n const g1 = loadGraphCached(dir);\n const g2 = loadGraphCached(dir);\n assert.ok(g1);\n assert.strictEqual(g1, g2, \"second load must reuse the cached object, not re-parse\");\n assert.equal(__parseCount.graph, 1);\n});\n",
+ "span": "L52-L63"
}
},
{
- "id": "test/helpers.ts#PassthroughSummarizer.summarize",
- "name": "summarize",
- "kind": "method",
- "path": "test/helpers.ts",
- "span": "L10-L12",
- "signature": "async summarize(code: string): Promise<string>",
- "exported": true,
+ "id": "test/graph-load.test.ts#bump",
+ "name": "bump",
+ "kind": "function",
+ "path": "test/graph-load.test.ts",
+ "span": "L46-L50",
+ "signature": "function bump(path: string): void",
+ "exported": false,
"origin": "ast",
- "body_hash": "8836e78c4875dee01aeae5cb976c217cd347554542e387996b7c190b1a73af18",
+ "body_hash": "8779dc90b4ac3a22fe19faeeb81277a8a6b3cfa975a943ea81eaae7057c8ff91",
"summary_state": "ready",
- "summary": "This method returns the input code as-is, allowing tests to control the output precisely.",
+ "summary": "Updates the modification time of a file to ensure that caching mechanisms recognize changes, preventing stale data usage.",
"crux": {
- "code": " async summarize(code: string): Promise<string> {\n return code;\n }",
- "span": "L10-L12"
+ "code": "function bump(path: string): void {\n const st = statSync(path);\n const future = new Date(st.mtimeMs + 1000);\n utimesSync(path, future, future);\n}",
+ "span": "L46-L50"
}
},
{
- "id": "test/hosts-codex-hooks.test.ts",
- "name": "hosts-codex-hooks.test.ts",
- "kind": "file",
- "path": "test/hosts-codex-hooks.test.ts",
- "span": "L1-L80",
- "signature": null,
- "exported": true,
+ "id": "test/graph-load.test.ts#fixtureDir",
+ "name": "fixtureDir",
+ "kind": "function",
+ "path": "test/graph-load.test.ts",
+ "span": "L40-L42",
+ "signature": "function fixtureDir(): string",
+ "exported": false,
"origin": "ast",
- "body_hash": "ed49a8a106eeb458ad2dd071071cefae17dd4d0eabd1b74006047feadef9a89a",
- "chars": 3738,
+ "body_hash": "3f567c59fa24284eaa46cfde4904ae179e1dae786288df2256d80d65721c95c9",
"summary_state": "ready",
- "summary": "This test suite verifies the behavior of the installCodexHooks function, ensuring it correctly manages hook installations and configurations in various scenarios.",
+ "summary": "Generates a temporary directory for use in tests, ensuring isolation and preventing interference between test cases.",
"crux": {
- "code": "test('no-op when the CLI home dir is absent', () => {\n assert.deepEqual(installCodexHooks(fresh()), []);\n});\n\ntest('writes shim + hooks.json entry, idempotent on re-run', () => {\n const home = fresh();\n mkdirSync(join(home, '.codex'), { recursive: true });\n const w = installCodexHooks(home);\n assert.equal(w.length, 2);\n const shim = join(home, '.codex', 'hooks', 'graft', 'graft-hooks.cjs');\n assert.ok(existsSync(shim));\n assert.ok(statSync(shim).mode & 0o111, 'shim is executable');",
- "span": "L10-L21"
+ "code": "function fixtureDir(): string {\n return mkdtempSync(join(tmpdir(), \"graft-load-\"));\n}",
+ "span": "L40-L42"
}
},
{
- "id": "test/hosts-codex-hooks.test.ts#fresh",
- "name": "fresh",
+ "id": "test/graph-load.test.ts#node",
+ "name": "node",
"kind": "function",
- "path": "test/hosts-codex-hooks.test.ts",
- "span": "L8-L8",
- "signature": "function fresh(): string",
+ "path": "test/graph-load.test.ts",
+ "span": "L23-L38",
+ "signature": "function node(id: string): NodeV1",
"exported": false,
"origin": "ast",
- "body_hash": "c75405ab5617c9e32684bf0530549edf2833d88ee5e6c955308b46c9f4e14c46",
+ "body_hash": "50c83e997e60e662392960d89cc6c5b421a65cfd8c166084e4c5f3c8ea9a9bd6",
"summary_state": "ready",
- "summary": "Generates a unique temporary directory for testing purposes.",
- "crux": null
+ "summary": "Creates a node representation for the graph with specified properties, facilitating the construction of graph structures in tests.",
+ "crux": {
+ "code": " return {\n id,\n name: id,\n kind: \"function\",\n path: `${id}.ts`,\n span: \"L1-L1\",\n signature: null,\n exported: true,\n origin: \"ast\",\n body_hash: id,\n summary_state: \"pending\",\n summary: null,",
+ "span": "L24-L35"
+ }
},
{
- "id": "test/hosts-init.test.ts",
- "name": "hosts-init.test.ts",
+ "id": "test/graph-map.test.ts",
+ "name": "graph-map.test.ts",
"kind": "file",
- "path": "test/hosts-init.test.ts",
- "span": "L1-L139",
+ "path": "test/graph-map.test.ts",
+ "span": "L1-L449",
"signature": null,
"exported": true,
"origin": "ast",
- "body_hash": "56f8988468cb716296b40c939bf58d079015d135fcb3f2c1481e64bce7f67324",
- "chars": 5922,
- "summary_state": "ready",
- "summary": "This test suite verifies the behavior of the runHostsInit function in various scenarios, ensuring it correctly handles host initialization, agent detection, and configuration management.",
+ "body_hash": "e1ad7fedef64ce3f62d0218a6b53bea3e3073777e6fc07d05a77f7a8d587371f",
+ "chars": 18768,
+ "summary_state": "stale",
+ "summary": "This file contains tests for the `buildRepoMap` and `formatRepoMap` functions, ensuring they correctly process and format repository data.",
"crux": {
- "code": "test('writes only detected hosts by default', () => {\n const home = fresh(); const repo = fresh();\n mkdirSync(join(home, '.cursor'));\n const r = runHostsInit(repo, { home });\n assert.deepEqual(r.written.map((w) => w.id), ['cursor']);\n const mdc = readFileSync(join(repo, '.cursor', 'rules', 'graft.mdc'), 'utf8');\n assert.match(mdc, /alwaysApply: true/);\n assert.ok(!existsSync(join(repo, 'AGENTS.md')));\n});\n\ntest('explicit agents list overrides detection and flags unknown ids', () => {\n const home = fresh(); const repo = fresh();",
- "span": "L11-L22"
+ "code": "test(\"buildRepoMap: totals count files, symbols, edges, and languages across the whole graph\", () => {\n const nodes = [\n fileNode(\"src/a.ts\"),\n symNode(\"src/a.ts\", \"fnA\"),\n fileNode(\"docs/readme.py\"), // deliberately mixed languages\n symNode(\"docs/readme.py\", \"fnB\"),\n ];\n const edges = [edge(\"src/a.ts#fnA\", \"docs/readme.py#fnB\")];\n const map = buildRepoMap(graphOf(nodes, edges));\n\n assert.equal(map.totals.files, 2);\n assert.equal(map.totals.symbols, 2);",
+ "span": "L65-L76"
}
},
{
- "id": "test/hosts-init.test.ts#fresh",
- "name": "fresh",
+ "id": "test/graph-map.test.ts#bigFixture",
+ "name": "bigFixture",
"kind": "function",
- "path": "test/hosts-init.test.ts",
- "span": "L9-L9",
- "signature": "function fresh(): string",
+ "path": "test/graph-map.test.ts",
+ "span": "L381-L400",
+ "signature": "function bigFixture(): GraphV1",
"exported": false,
"origin": "ast",
- "body_hash": "9da796af39ee7c44e2c780ded8bc297fc37f854834c5ecdab7819298b3df9cce",
- "summary_state": "ready",
- "summary": "Generates a unique temporary directory for testing purposes to avoid conflicts between test runs.",
- "crux": null
- },
- {
- "id": "test/hosts-instructions.test.ts",
- "name": "hosts-instructions.test.ts",
- "kind": "file",
- "path": "test/hosts-instructions.test.ts",
- "span": "L1-L34",
- "signature": null,
- "exported": true,
- "origin": "ast",
- "body_hash": "37ae3aae1157c1e1eb39ef5670b363d517aaf3028ca8fb56581193b81a83cad7",
- "chars": 1479,
+ "body_hash": "36aa3a253a2bbeb21b090b155800f0354efd0e279bcf199a768d0cd9b8f66aac",
"summary_state": "ready",
- "summary": "This test suite verifies the structure and content of various instruction bodies to ensure they meet specified formatting and inclusion criteria.",
+ "summary": "Creates a large fixture graph for testing, simulating a repository with multiple directories and symbols.",
"crux": {
- "code": "test('canonical body names the three essentials', () => {\n const b = instructionBody();\n assert.match(b, /^## Graft — repo context graph/m);\n assert.match(b, /graft ask \"/);\n assert.match(b, /graft\\/INDEX\\.md/);\n assert.match(b, /graft build/);\n assert.match(b, /every occurrence|enumerate with grep/i, 'teaches the exhaustive-task grep rule');\n assert.match(b, /callers/, 'teaches the callers/callees/impact commands');\n assert.match(b, /truncated/i, 'tells the agent to follow up on truncated spans');\n assert.match(b, /graft grep/, 'routes sweeps to graft grep');\n assert.match(b, /graft map/, 'tells the agent to orient with graft map before exploring');\n assert.ok(!/\\bhook|statusline\\b/i.test(b), 'no host-specific machinery in the shared body');",
- "span": "L5-L16"
+ "code": "function bigFixture(): GraphV1 {\n const nodes: NodeV1[] = [];\n const edges: EdgeV1[] = [];\n const dirs = [\"alpha\", \"beta\", \"gamma\", \"delta\"];\n for (const dir of dirs) {\n for (let f = 0; f < 3; f++) {\n const path = `${dir}/file${f}.ts`;\n nodes.push(fileNode(path));\n for (let s = 0; s < 4; s++) {\n const name = `${dir}Sym${f}_${s}`;\n nodes.push(symNode(path, name));\n // Give the first symbol in each file a bunch of callers so it's a hub.",
+ "span": "L240-L251"
}
},
{
- "id": "test/hosts-mcp-config.test.ts",
- "name": "hosts-mcp-config.test.ts",
- "kind": "file",
- "path": "test/hosts-mcp-config.test.ts",
- "span": "L1-L77",
- "signature": null,
- "exported": true,
+ "id": "test/graph-map.test.ts#edge",
+ "name": "edge",
+ "kind": "function",
+ "path": "test/graph-map.test.ts",
+ "span": "L51-L53",
+ "signature": "function edge(source: string, target: string, relation: Relation = \"calls\"): EdgeV1",
+ "exported": false,
"origin": "ast",
- "body_hash": "5b3ec5afd61079f051d8063f06701ddac608f48b706e72f9ee607e8da673fb06",
- "chars": 3982,
+ "body_hash": "123ba52d4dfdf593b1dd056eb9c949165a0ba7fd06eaf374cf1bf1bd797baee8",
"summary_state": "ready",
- "summary": "This test suite verifies the behavior of the registerMcpConfigs function in handling various configurations and edge cases.",
+ "summary": "Defines a connection between two nodes in the graph, representing relationships such as function calls.",
"crux": {
- "code": "test('cursor/gemini/kiro get repo-local JSON entries', () => {\n const repo = fresh(); const home = fresh();\n const w = registerMcpConfigs(repo, ['cursor', 'gemini', 'kiro'], { home });\n assert.deepEqual(w.map((x) => x.action), ['created', 'created', 'created']);\n const cursor = JSON.parse(readFileSync(join(repo, '.cursor', 'mcp.json'), 'utf8'));\n assert.deepEqual(cursor.mcpServers.graft, { command: 'npx', args: ['-y', '@nanonets/graft', 'mcp'] });\n assert.ok(existsSync(join(repo, '.gemini', 'settings.json')));\n assert.ok(existsSync(join(repo, '.kiro', 'settings', 'mcp.json')));\n});\n\ntest('existing config keys are preserved; re-run is unchanged', () => {\n const repo = fresh(); const home = fresh();",
- "span": "L10-L21"
+ "code": "function edge(source: string, target: string, relation: Relation = \"calls\"): EdgeV1 {\n return { source, target, relation, confidence: \"extracted\" };\n}",
+ "span": "L51-L53"
}
},
{
- "id": "test/hosts-mcp-config.test.ts#fresh",
- "name": "fresh",
+ "id": "test/graph-map.test.ts#fileNode",
+ "name": "fileNode",
"kind": "function",
- "path": "test/hosts-mcp-config.test.ts",
- "span": "L8-L8",
- "signature": "function fresh(): string",
+ "path": "test/graph-map.test.ts",
+ "span": "L16-L31",
+ "signature": "function fileNode(path: string): NodeV1",
"exported": false,
"origin": "ast",
- "body_hash": "5d57935fd93aed6bacff9481af82c74f353c4928d0c3cf15efbfa038c85dad5a",
+ "body_hash": "cb831beea5577f48e8bd82886ecb0467eccc24e399316f742291c59d63d580de",
"summary_state": "ready",
- "summary": "Generates a fresh temporary directory for testing purposes.",
- "crux": null
+ "summary": "Creates a file node representation for the graph, encapsulating file metadata for processing.",
+ "crux": {
+ "code": "function fileNode(path: string): NodeV1 {\n return {\n id: path,\n name: path.slice(path.lastIndexOf(\"/\") + 1),\n kind: \"file\",\n path,\n span: \"L1-L1\",\n signature: null,\n exported: true,\n origin: \"ast\",\n body_hash: `h${counter++}`,\n summary_state: \"pending\",",
+ "span": "L16-L27"
+ }
},
{
- "id": "test/hosts-registry.test.ts",
- "name": "hosts-registry.test.ts",
- "kind": "file",
- "path": "test/hosts-registry.test.ts",
- "span": "L1-L45",
- "signature": null,
- "exported": true,
+ "id": "test/graph-map.test.ts#graphOf",
+ "name": "graphOf",
+ "kind": "function",
+ "path": "test/graph-map.test.ts",
+ "span": "L55-L61",
+ "signature": "function graphOf(nodes: NodeV1[], edges: EdgeV1[]): GraphV1",
+ "exported": false,
"origin": "ast",
- "body_hash": "6490cbdc54b870d670adf28b5b469e07360a474073b08d692601ef1c4b7ea47e",
- "chars": 1632,
+ "body_hash": "11c79a80294cef88be10408d30c430dbdc2440d9b80b4611d426503f279261a8",
"summary_state": "ready",
- "summary": "This file contains tests for the hosts registry functionality, ensuring that the correct hosts are detected based on the presence of specific directories.",
+ "summary": "Constructs a graph structure from nodes and edges, serving as the foundational data for repository mapping.",
"crux": {
- "code": "test('registry exposes the six phase-1 hosts', () => {\n assert.deepEqual(hostIds().sort(), ['agents', 'copilot', 'cursor', 'gemini', 'kiro', 'windsurf']);\n for (const h of HOSTS) {\n assert.ok(h.relPath.length > 0);\n assert.ok(h.content().length > 0);\n }\n});\n\ntest('nothing detected on a bare machine and bare repo', () => {\n assert.deepEqual(detectHosts(probeFor(fresh(), fresh())), []);\n});\n",
- "span": "L17-L28"
+ "code": "function graphOf(nodes: NodeV1[], edges: EdgeV1[]): GraphV1 {\n return {\n meta: { version: 1, nodeCount: nodes.length, edgeCount: edges.length, languages: [] },\n nodes,\n edges,\n };\n}",
+ "span": "L55-L61"
}
},
{
- "id": "test/hosts-registry.test.ts#fresh",
- "name": "fresh",
+ "id": "test/graph-map.test.ts#graphOfWithScopes",
+ "name": "graphOfWithScopes",
"kind": "function",
- "path": "test/hosts-registry.test.ts",
- "span": "L15-L15",
- "signature": "function fresh(): string",
+ "path": "test/graph-map.test.ts",
+ "span": "L66-L70",
+ "signature": "function graphOfWithScopes(nodes: NodeV1[], edges: EdgeV1[], scopes: ScopeV1[]): GraphV1",
"exported": false,
"origin": "ast",
- "body_hash": "4b7e71149dfcf083709a98bd3f04eb92af9a722c7d567dcd4288be6119afc6ea",
- "summary_state": "ready",
- "summary": "Generates a temporary directory for testing purposes, ensuring a clean environment for each test case.",
+ "body_hash": "c57b4814de468dbada1d57653f382f823854b6ce72a311d8b51905362c5ac4ef",
+ "summary_state": "pending",
+ "summary": null,
"crux": null
},
{
- "id": "test/hosts-registry.test.ts#probeFor",
- "name": "probeFor",
+ "id": "test/graph-map.test.ts#symNode",
+ "name": "symNode",
"kind": "function",
- "path": "test/hosts-registry.test.ts",
- "span": "L9-L14",
- "signature": "function probeFor(home: string, repo: string): DetectProbe",
+ "path": "test/graph-map.test.ts",
+ "span": "L33-L49",
+ "signature": "function symNode(path: string, name: string, opts: { kind?: Kind; span?: string } = {}): NodeV1",
"exported": false,
"origin": "ast",
- "body_hash": "7653739002fda057d1517f18bfe77dfb0dcf78ab6cb9716ceb7624601eec1f7f",
+ "body_hash": "819353898b73f80877d6102fc06f582cec736379220bb864d8be47c3a5107314",
"summary_state": "ready",
- "summary": "Creates a probe object that checks for the existence of a directory, facilitating host detection based on the file system state.",
+ "summary": "Generates a symbol node representation for the graph, allowing for the inclusion of function or variable symbols with associated metadata.",
"crux": {
- "code": " dirExists: (p) => { try { return statSync(p).isDirectory(); } catch { return false; } },\n };",
- "span": "L12-L13"
+ "code": "function symNode(path: string, name: string, opts: { kind?: Kind; span?: string } = {}): NodeV1 {\n const id = `${path}#${name}`;\n return {\n id,\n name,\n kind: opts.kind ?? \"function\",\n path,\n span: opts.span ?? \"L1-L10\",\n signature: `${name}()`,\n exported: true,\n origin: \"ast\",\n body_hash: `h${counter++}`,",
+ "span": "L33-L44"
}
},
{
- "id": "test/hosts-sections.test.ts",
- "name": "hosts-sections.test.ts",
+ "id": "test/graph-map.test.ts#twoScopeFixture",
+ "name": "twoScopeFixture",
+ "kind": "function",
+ "path": "test/graph-map.test.ts",
+ "span": "L249-L264",
+ "signature": "function twoScopeFixture(): GraphV1",
+ "exported": false,
+ "origin": "ast",
+ "body_hash": "a3cf21a9cdddac213e8fd3e11309df1b5274b945890fd39a405a9d1d6c6c41eb",
+ "summary_state": "pending",
+ "summary": null,
+ "crux": null
+ },
+ {
+ "id": "test/graph-resolve-typed.test.ts",
+ "name": "graph-resolve-typed.test.ts",
"kind": "file",
- "path": "test/hosts-sections.test.ts",
- "span": "L1-L112",
+ "path": "test/graph-resolve-typed.test.ts",
+ "span": "L1-L93",
"signature": null,
"exported": true,
"origin": "ast",
- "body_hash": "a780abe63074737d40bcd556df06b7b541d2694df75c307daabd280f64f9dba4",
- "chars": 4777,
+ "body_hash": "0c3760525cc61ee97de448fa26b4a5b9a3bb07c03b4acfbdf3608541b189cf81",
+ "chars": 4908,
"summary_state": "ready",
- "summary": "This file contains tests for the upsertSection function, ensuring it correctly creates, appends, replaces, and reports on sections in markdown files.",
+ "summary": "This test file verifies the resolution of method calls and inheritance in a graph of nodes representing code elements, ensuring correct behavior in various scenarios.",
"crux": {
- "code": "test('creates the file with a fenced block when missing', () => {\n const f = join(fresh(), 'AGENTS.md');\n const r = upsertSection(f, '## Graft\\nuse graft ask');\n assert.equal(r.action, 'created');\n const text = readFileSync(f, 'utf8');\n assert.ok(text.includes('<!-- graft:start -->'));\n assert.ok(text.includes('use graft ask'));\n assert.ok(text.endsWith('\\n'));\n});\n\ntest('appends after existing content, separated by a blank line', () => {\n const f = join(fresh(), 'AGENTS.md');",
- "span": "L10-L21"
+ "code": "test(\"typed member call resolves despite global name ambiguity\", () => {\n const edges = resolveEdges(NODES, [\n { source: \"t.py#test_x\", relation: \"calls\", name: \"include_router\", viaMember: true, recvType: \"FastAPI\", file: \"t.py\" },\n ]);\n const call = edges.find((e) => e.relation === \"calls\");\n assert.equal(call?.target, \"app.py#FastAPI.include_router\");\n assert.equal(call?.confidence, \"inferred\");\n});\n\ntest(\"untyped ambiguous member call still drops (regression guard)\", () => {\n const edges = resolveEdges(NODES, [\n { source: \"t.py#test_x\", relation: \"calls\", name: \"include_router\", viaMember: true, file: \"t.py\" },",
+ "span": "L18-L29"
}
},
{
- "id": "test/hosts-sections.test.ts#fresh",
- "name": "fresh",
+ "id": "test/graph-resolve-typed.test.ts#n",
+ "name": "n",
"kind": "function",
- "path": "test/hosts-sections.test.ts",
- "span": "L8-L8",
- "signature": "function fresh(): string",
+ "path": "test/graph-resolve-typed.test.ts",
+ "span": "L6-L10",
+ "signature": "function n(id: string, kind: NodeV1[\"kind\"]): NodeV1",
"exported": false,
"origin": "ast",
- "body_hash": "5fbf8aed98c1fd26d88217061c491d534e161b32a06df5c80d376de4eb1171a3",
+ "body_hash": "25448bda72366b6bf9233cc1f03e63aa5ef4e1c2253c876b7c2223db09c163fc",
"summary_state": "ready",
- "summary": "Generates a fresh temporary directory for testing purposes.",
- "crux": null
+ "summary": "Creates a NodeV1 object representing a code element with its associated metadata, facilitating the construction of a node graph for resolution tests.",
+ "crux": {
+ "code": " const name = id.includes(\"#\") ? id.split(\"#\")[1].split(\".\").pop()! : id;\n return { id, name, kind, path: id.split(\"#\")[0], span: \"L1-L1\", signature: null,\n exported: true, origin: \"ast\", body_hash: \"h\", summary_state: \"pending\", summary: null, crux: null } as NodeV1;",
+ "span": "L7-L9"
+ }
},
{
- "id": "test/llm-adapters.test.ts",
- "name": "llm-adapters.test.ts",
+ "id": "test/graph-scopes.test.ts",
+ "name": "graph-scopes.test.ts",
"kind": "file",
- "path": "test/llm-adapters.test.ts",
- "span": "L1-L216",
+ "path": "test/graph-scopes.test.ts",
+ "span": "L1-L203",
"signature": null,
"exported": true,
"origin": "ast",
- "body_hash": "53081583f9a2ef8a7f925fcce6554201fb8a10184ac835f3879cb3f04700f346",
- "chars": 8829,
- "summary_state": "ready",
- "summary": "This file contains tests for network-free adapters that simulate interactions with OpenAI and Anthropic SDKs, ensuring correct request handling and response formatting.",
- "crux": {
- "code": "test(\"openai: plain text — system/user map to strings, usage is uncached-only\", async () => {\n const { client, box } = fakeOpenAI(openAiResp());\n const m = new OpenAIChatModel({ apiKey: \"x\", model: \"gpt-x\", client });\n const res = await m.create({\n messages: [\n { role: \"system\", content: \"sys\" },\n { role: \"user\", content: \"hi\" },\n ],\n temperature: 0,\n });\n assert.equal(box.params.model, \"gpt-x\");\n assert.equal(box.params.messages[0].content, \"sys\"); // plain string, no cache parts",
- "span": "L33-L44"
- }
+ "body_hash": "030dea9cb5a26fac262acf50101289a62655681d7dd487a3518e59a64db209d8",
+ "chars": 8316,
+ "summary_state": "pending",
+ "summary": null,
+ "crux": null
},
{
- "id": "test/llm-adapters.test.ts#anthropicResp",
- "name": "anthropicResp",
+ "id": "test/graph-scopes.test.ts#fx",
+ "name": "fx",
"kind": "function",
- "path": "test/llm-adapters.test.ts",
- "span": "L127-L134",
- "signature": "function anthropicResp(over: Partial<any> = {}): any",
+ "path": "test/graph-scopes.test.ts",
+ "span": "L17-L24",
+ "signature": "function fx(layout: Record<string, string>): string",
"exported": false,
"origin": "ast",
- "body_hash": "510e5ddfab3f4b864398e600e0a6a9e786c164cb2ca583e48fa5eb617305e366",
- "summary_state": "ready",
- "summary": "Generates a mock response structure for Anthropic API calls, aiding in the testing of response processing.",
- "crux": {
- "code": " content: [{ type: \"text\", text: \"hi there\" }],\n stop_reason: \"end_turn\",\n usage: { input_tokens: 70, output_tokens: 20, cache_read_input_tokens: 30, cache_creation_input_tokens: 5 },\n ...over,",
- "span": "L129-L132"
- }
+ "body_hash": "8ab0bd0d4ecd0a2c1738c41a1260ab74a8f9407edaa90b444b43b8e8180058b1",
+ "summary_state": "pending",
+ "summary": null,
+ "crux": null
},
{
- "id": "test/llm-adapters.test.ts#fakeAnthropic",
- "name": "fakeAnthropic",
+ "id": "test/graph-scopes.test.ts#normalize",
+ "name": "normalize",
"kind": "function",
- "path": "test/llm-adapters.test.ts",
- "span": "L119-L125",
- "signature": "function fakeAnthropic(resp: unknown)",
+ "path": "test/graph-scopes.test.ts",
+ "span": "L93-L94",
+ "signature": "normalize = (prefixes: string[], siblingName: string): string[]",
"exported": false,
"origin": "ast",
- "body_hash": "389c2181f2f3596989f46febc959ccdb5daf6c8faf71d739e0e6341c49faa323",
- "summary_state": "ready",
- "summary": "Creates a mock Anthropic client for testing purposes, enabling verification of the parameters it receives.",
- "crux": {
- "code": " messages: { create: async (params: any) => ((box.params = params), resp) },\n } as unknown as Anthropic;",
- "span": "L122-L123"
- }
+ "body_hash": "0da47baf7c1a7c14a23a56b743085bac4a9620dffbb4751e23ea705c176b3d5b",
+ "summary_state": "pending",
+ "summary": null,
+ "crux": null
},
{
- "id": "test/llm-adapters.test.ts#fakeOpenAI",
- "name": "fakeOpenAI",
+ "id": "test/graph-scopes.test.ts#pyFns",
+ "name": "pyFns",
"kind": "function",
- "path": "test/llm-adapters.test.ts",
- "span": "L17-L23",
- "signature": "function fakeOpenAI(resp: unknown)",
+ "path": "test/graph-scopes.test.ts",
+ "span": "L159-L161",
+ "signature": "function pyFns(n: number): string",
"exported": false,
"origin": "ast",
- "body_hash": "1df77ef154b74d8a146666026f8598c84891a3fad31a785932884d867b7348a8",
- "summary_state": "ready",
- "summary": "Creates a mock OpenAI client for testing purposes, allowing assertions on the parameters sent to it.",
- "crux": {
- "code": " chat: { completions: { create: async (params: any) => ((box.params = params), resp) } },\n } as unknown as OpenAI;",
- "span": "L20-L21"
- }
+ "body_hash": "66058beee96d43f3e99600dd019dfff7771d96c51cbefa76db334ba5a08dec6f",
+ "summary_state": "pending",
+ "summary": null,
+ "crux": null
},
{
- "id": "test/llm-adapters.test.ts#openAiResp",
- "name": "openAiResp",
+ "id": "test/graph-scopes.test.ts#run",
+ "name": "run",
"kind": "function",
- "path": "test/llm-adapters.test.ts",
- "span": "L25-L31",
- "signature": "function openAiResp(over: Partial<any> = {}): any",
+ "path": "test/graph-scopes.test.ts",
+ "span": "L75-L89",
+ "signature": "run = (siblingName: string): string[]",
"exported": false,
"origin": "ast",
- "body_hash": "97c63c00348e9d80c2ddccf50e21e28de7379123cdc570757b21857c67364268",
- "summary_state": "ready",
- "summary": "Generates a mock response structure for OpenAI API calls, facilitating the testing of response handling.",
- "crux": {
- "code": " choices: [{ message: { content: \"hello\", tool_calls: [] }, finish_reason: \"stop\" }],\n usage: { prompt_tokens: 100, completion_tokens: 20, prompt_tokens_details: { cached_tokens: 30 } },\n ...over,\n };",
- "span": "L27-L30"
- }
+ "body_hash": "1ad4b6cd5889ea9fd5db15c6aa691788477f3e18a1a38d2faaa36347ef1fab0b",
+ "summary_state": "pending",
+ "summary": null,
+ "crux": null
},
{
- "id": "test/llm-ops.test.ts",
- "name": "llm-ops.test.ts",
+ "id": "test/graph-scopes.test.ts#tsFns",
+ "name": "tsFns",
+ "kind": "function",
+ "path": "test/graph-scopes.test.ts",
+ "span": "L155-L157",
+ "signature": "function tsFns(n: number): string",
+ "exported": false,
+ "origin": "ast",
+ "body_hash": "3b0fd3e3016031d46b2c8e0c42d7571ad9c0abfe7656557ae90064211618503d",
+ "summary_state": "pending",
+ "summary": null,
+ "crux": null
+ },
+ {
+ "id": "test/graph-traverse-cli.test.ts",
+ "name": "graph-traverse-cli.test.ts",
"kind": "file",
- "path": "test/llm-ops.test.ts",
- "span": "L1-L82",
+ "path": "test/graph-traverse-cli.test.ts",
+ "span": "L1-L143",
"signature": null,
"exported": true,
"origin": "ast",
- "body_hash": "ef3ba575506602feeb3048a6bded8bd2a92e9a59054c569352e82d1a847b80af",
- "chars": 3303,
- "summary_state": "ready",
- "summary": "Tests the behavior of three engine operations (summarize, synthesize, crux) using a fake transport to ensure they build the correct requests and handle responses appropriately.",
+ "body_hash": "53390c4f5cb5d2135b2d423c9b7e191abdb4897ebc29909be741cef4f0f7d81f",
+ "chars": 5928,
+ "summary_state": "stale",
+ "summary": "This file contains tests for the CLI commands related to graph traversal, ensuring correct functionality and output for various scenarios.",
"crux": {
- "code": "test(\"ChatSummarizer sends plain text and returns trimmed content\", async () => {\n const m = new FakeChatModel({ text: \" a prose summary \" });\n const out = await new ChatSummarizer(m).summarize(\"code\", { path: \"a.ts\" });\n assert.equal(out, \"a prose summary\");\n assert.equal(m.last?.responseFormat, undefined); // plain text\n assert.equal(m.last?.messages[0].role, \"system\");\n});\n\ntest(\"ChatSynthesizer forces record_graph and cleans parsed args\", async () => {\n const m = new FakeChatModel({\n toolCalls: [\n {",
- "span": "L31-L42"
+ "code": "test('graft callers: happy path shows header and the caller hit', () => {\n const d = builtRepo();\n const r = runCli(['callers', 'add', d]);\n assert.equal(r.status, 0);\n assert.match(r.stdout, /add · function · src\\/math\\.ts:/);\n assert.match(r.stdout, /calls ← sub \\(src\\/math\\.ts:/);\n});\n\ntest('graft callers --json: shape matches {query, matches:[{symbol,hits}]}', () => {\n const d = builtRepo();\n const r = runCli(['callers', 'add', d, '--json']);\n assert.equal(r.status, 0);",
+ "span": "L42-L53"
}
},
{
- "id": "test/llm-ops.test.ts#FakeChatModel",
- "name": "FakeChatModel",
- "kind": "class",
- "path": "test/llm-ops.test.ts",
- "span": "L15-L29",
- "signature": "class FakeChatModel implements ChatModel",
+ "id": "test/graph-traverse-cli.test.ts#builtRepo",
+ "name": "builtRepo",
+ "kind": "function",
+ "path": "test/graph-traverse-cli.test.ts",
+ "span": "L17-L28",
+ "signature": "function builtRepo(): string",
"exported": false,
"origin": "ast",
- "body_hash": "eda253622c2c5165804dbff88e4833ec0cfd0f45f9326916108aae84f2932905",
+ "body_hash": "8c3de9f35f0d7a39cf5bd38c0462e92cb65cb762d5285e6cd637ef423631ea43",
"summary_state": "ready",
- "summary": "Simulates a chat model to test the behavior of chat operations without network dependency.",
+ "summary": "Sets up a temporary repository with a sample math module for testing CLI commands.",
"crux": {
- "code": " this.last = req;\n return {\n text: this.reply.text ?? \"\",\n toolCalls: this.reply.toolCalls ?? [],\n usage: { input: 0, output: 0, cacheRead: 0, cacheCreate: 0 },\n stopReason: \"stop\",\n assistant: { role: \"assistant\", content: this.reply.text ?? \"\" },\n };",
- "span": "L20-L27"
+ "code": " 'export function add(a: number, b: number): number {\\n return a + b;\\n}\\n' +\n 'export function sub(a: number, b: number): number {\\n return add(a, -b);\\n}\\n' +\n 'export function compute(a: number, b: number): number {\\n return sub(a, b);\\n}\\n',",
+ "span": "L21-L23"
}
},
{
- "id": "test/llm-ops.test.ts#FakeChatModel.constructor",
- "name": "constructor",
- "kind": "method",
- "path": "test/llm-ops.test.ts",
- "span": "L18-L18",
- "signature": "constructor(private reply: { text?: string; toolCalls?: ToolCall[] })",
+ "id": "test/graph-traverse-cli.test.ts#runCli",
+ "name": "runCli",
+ "kind": "function",
+ "path": "test/graph-traverse-cli.test.ts",
+ "span": "L30-L41",
+ "signature": "function runCli(args: string[]): { stdout: string; stderr: string; status: number }",
"exported": false,
"origin": "ast",
- "body_hash": "edce87b8798c8e867446b2b7970f4c97f1f8eba762255e690daea9453d10e630",
+ "body_hash": "3aae0bf33b1d771d8677050168cec54ed0b21cf245a4c04c715f6a520b61a7b0",
"summary_state": "ready",
- "summary": "Initializes the fake chat model with a predefined reply for testing purposes.",
- "crux": null
+ "summary": "Executes the CLI command with given arguments and captures the output and status code.",
+ "crux": {
+ "code": " const stdout = execFileSync(process.execPath, ['--import', 'tsx', 'src/cli.ts', ...args], {\n encoding: 'utf8',\n stdio: ['ignore', 'pipe', 'pipe'],\n });\n return { stdout, stderr: '', status: 0 };\n } catch (err) {\n const e = err as { stdout?: string; stderr?: string; status?: number };\n return { stdout: e.stdout ?? '', stderr: e.stderr ?? '', status: e.status ?? 1 };",
+ "span": "L31-L38"
+ }
},
{
- "id": "test/llm-ops.test.ts#FakeChatModel.create",
- "name": "create",
- "kind": "method",
- "path": "test/llm-ops.test.ts",
- "span": "L19-L28",
- "signature": "async create(req: ChatRequest): Promise<ChatResponse>",
- "exported": false,
+ "id": "test/graph-traverse.test.ts",
+ "name": "graph-traverse.test.ts",
+ "kind": "file",
+ "path": "test/graph-traverse.test.ts",
+ "span": "L1-L277",
+ "signature": null,
+ "exported": true,
"origin": "ast",
- "body_hash": "e90179ccabec3472e4184b3a1147383e87c3de3f42b8757304dbb33b36547488",
+ "body_hash": "9683b55f739af4afbb3840cee333eed0b1869494b66fe9cddfae1153df246947",
+ "chars": 10972,
"summary_state": "ready",
- "summary": "Processes a chat request and returns a simulated chat response based on predefined data.",
+ "summary": "Contains tests for graph traversal functionalities, ensuring correct symbol resolution and edge walking behavior.",
"crux": {
- "code": " this.last = req;\n return {\n text: this.reply.text ?? \"\",\n toolCalls: this.reply.toolCalls ?? [],\n usage: { input: 0, output: 0, cacheRead: 0, cacheCreate: 0 },\n stopReason: \"stop\",\n assistant: { role: \"assistant\", content: this.reply.text ?? \"\" },\n };",
- "span": "L20-L27"
+ "code": "test(\"resolveSymbol: bare name match is case-insensitive\", () => {\n const g = baseGraph();\n const matches = resolveSymbol(g, \"RENDER\");\n assert.deepEqual(matches.map((n) => n.id), [\"src/widget.ts#Widget.render\"]);\n});\n\ntest(\"resolveSymbol: qualified Class.method resolves via id suffix\", () => {\n const g = baseGraph();\n const matches = resolveSymbol(g, \"Cache.get\");\n assert.deepEqual(matches.map((n) => n.id), [\"src/cache.ts#Cache.get\"]);\n});\n",
+ "span": "L70-L81"
}
},
{
- "id": "test/mcp-server.test.ts",
- "name": "mcp-server.test.ts",
- "kind": "file",
- "path": "test/mcp-server.test.ts",
- "span": "L1-L66",
- "signature": null,
- "exported": true,
+ "id": "test/graph-traverse.test.ts#baseGraph",
+ "name": "baseGraph",
+ "kind": "function",
+ "path": "test/graph-traverse.test.ts",
+ "span": "L57-L66",
+ "signature": "function baseGraph(): GraphV1",
+ "exported": false,
"origin": "ast",
- "body_hash": "5eacb67182a2925edec5bd036ae556018ed3b2c266d65aaefa0d4d1ff0a3fee6",
- "chars": 2564,
- "summary_state": "stale",
- "summary": "This file contains tests for the RPC functionality of the MCP server, ensuring that various methods return expected results and handle errors correctly.",
+ "body_hash": "6d809e9b571f2f9529bce4e42392b36e09b8bb9050633f2daaa90f202ff47bab",
+ "summary_state": "ready",
+ "summary": "Creates a base graph fixture used for testing symbol resolution and edge walking.",
"crux": {
- "code": "test('initialize → tools/list → tools/call round-trip', async () => {\n const dir = mkdtempSync(join(tmpdir(), 'graft-mcpsrv-'));\n const rs = await rpc(\n [\n { jsonrpc: '2.0', id: 1, method: 'initialize', params: { protocolVersion: '2025-03-26', capabilities: {}, clientInfo: { name: 't', version: '0' } } },\n { jsonrpc: '2.0', method: 'notifications/initialized' },\n { jsonrpc: '2.0', id: 2, method: 'tools/list' },\n { jsonrpc: '2.0', id: 3, method: 'tools/call', params: { name: 'graft_blast_radius', arguments: { file: 'x.ts' } } },\n ],\n dir,\n 3,\n );",
- "span": "L30-L41"
+ "code": "function baseGraph(): GraphV1 {\n return graphOf(\n [cacheGet, widgetRender, otherGet, hashFn, fileNode],\n [\n edge(\"src/cache.ts\", \"src/cache.ts#Cache.get\", \"contains\"),\n edge(\"src/cache.ts#Cache.get\", \"src/widget.ts#Widget.render\", \"calls\"),\n edge(\"src/cache.ts#Cache.get\", \"npm:lodash\", \"imports\"),\n ],\n );\n}",
+ "span": "L57-L66"
}
},
{
- "id": "test/mcp-server.test.ts#rpc",
- "name": "rpc",
+ "id": "test/graph-traverse.test.ts#diamondGraph",
+ "name": "diamondGraph",
"kind": "function",
- "path": "test/mcp-server.test.ts",
- "span": "L9-L28",
- "signature": "async function rpc(messages: object[], dir: string, expected: number): Promise<any[]>",
+ "path": "test/graph-traverse.test.ts",
+ "span": "L167-L179",
+ "signature": "function diamondGraph(): GraphV1",
"exported": false,
"origin": "ast",
- "body_hash": "a83e1cfe6b7af8f6c87c6c9756d4ca8d61c0122c956f24b5b80a2249b2e950b1",
+ "body_hash": "5f778e8292d09729865a06efd50026df15ba7da5a5fb6980e3dd814036db0aca",
"summary_state": "ready",
- "summary": "The rpc function facilitates communication with the MCP server by sending messages and collecting responses, handling asynchronous interactions effectively.",
+ "summary": "Constructs a diamond-shaped graph for testing the impact of nodes based on incoming edges.",
"crux": {
- "code": " for (const m of messages) child.stdin.write(`${JSON.stringify(m)}\\n`);\n const deadline = Date.now() + 15000;\n while (responses.length < expected && Date.now() < deadline) await new Promise((r) => setTimeout(r, 50));\n child.kill();\n await once(child, 'exit').catch(() => {});\n return responses;",
- "span": "L22-L27"
+ "code": "function diamondGraph(): GraphV1 {\n const X = nodeStub({ id: \"X\", name: \"X\" });\n const A = nodeStub({ id: \"A\", name: \"A\" });\n const B = nodeStub({ id: \"B\", name: \"B\" });\n const C = nodeStub({ id: \"C\", name: \"C\" });\n return {\n node: X,\n graph: graphOf(\n [X, A, B, C],\n [edge(\"A\", \"X\", \"calls\"), edge(\"B\", \"X\", \"calls\"), edge(\"C\", \"A\", \"calls\"), edge(\"C\", \"B\", \"calls\")],\n ),\n } as unknown as { node: NodeV1; graph: GraphV1 };",
+ "span": "L167-L178"
}
},
{
- "id": "test/mcp-tools.test.ts",
- "name": "mcp-tools.test.ts",
- "kind": "file",
- "path": "test/mcp-tools.test.ts",
- "span": "L1-L301",
- "signature": null,
- "exported": true,
+ "id": "test/graph-traverse.test.ts#edge",
+ "name": "edge",
+ "kind": "function",
+ "path": "test/graph-traverse.test.ts",
+ "span": "L32-L34",
+ "signature": "function edge(source: string, target: string, relation: Relation = \"calls\"): EdgeV1",
+ "exported": false,
"origin": "ast",
- "body_hash": "2241812ee605797530ebbbd0e646833ba632460cd2ce3a0b80d44cd53f6ef844",
- "chars": 13284,
- "summary_state": "stale",
- "summary": "This test suite validates the functionality of various tools in the MCP codebase, ensuring they operate correctly on built repositories and handle errors appropriately.",
+ "body_hash": "123ba52d4dfdf593b1dd056eb9c949165a0ba7fd06eaf374cf1bf1bd797baee8",
+ "summary_state": "ready",
+ "summary": "Constructs an edge between two nodes in the graph, defining their relationship type.",
"crux": {
- "code": "test('TOOLS lists all eight tools with schemas', () => {\n assert.deepEqual(TOOLS.map((t) => t.name), [\n 'graft_ask',\n 'graft_skeleton',\n 'graft_check',\n 'graft_blast_radius',\n 'graft_callers',\n 'graft_callees',\n 'graft_grep',\n 'graft_map',\n ]);\n for (const t of TOOLS) {",
- "span": "L75-L86"
+ "code": "function edge(source: string, target: string, relation: Relation = \"calls\"): EdgeV1 {\n return { source, target, relation, confidence: \"extracted\" };\n}",
+ "span": "L32-L34"
}
},
{
- "id": "test/mcp-tools.test.ts#builtRepo",
- "name": "builtRepo",
+ "id": "test/graph-traverse.test.ts#fileAndSymbolGraph",
+ "name": "fileAndSymbolGraph",
"kind": "function",
- "path": "test/mcp-tools.test.ts",
- "span": "L9-L16",
- "signature": "function builtRepo(): string",
+ "path": "test/graph-traverse.test.ts",
+ "span": "L221-L231",
+ "signature": "function fileAndSymbolGraph()",
"exported": false,
"origin": "ast",
- "body_hash": "2e8d1ef9e31662a9e1a2e64630378d64979be157310df30d3e97900015426178",
+ "body_hash": "8d46dcd8a65e23d4490137683c72016c5380080da91bc2cdb643dec3df6a637b",
"summary_state": "ready",
- "summary": "Creates a temporary repository structure for testing the tools with a basic math implementation.",
+ "summary": "Creates a graph that includes both file and symbol nodes to test their interactions in dependency resolution.",
"crux": {
- "code": " const d = mkdtempSync(join(tmpdir(), 'graft-mcptools-'));\n mkdirSync(join(d, 'src'), { recursive: true });\n writeFileSync(join(d, 'src', 'math.ts'),\n 'export function add(a: number, b: number): number {\\n return a + b;\\n}\\nexport function sub(a: number, b: number): number {\\n return add(a, -b);\\n}\\n');\n execFileSync(process.execPath, ['--import', 'tsx', 'src/cli.ts', 'build', d], { stdio: 'pipe' });",
- "span": "L10-L14"
+ "code": "function fileAndSymbolGraph() {\n const fileA = nodeStub({ id: \"src/a.ts\", name: \"a.ts\", kind: \"file\", path: \"src/a.ts\" });\n const helper = nodeStub({ id: \"src/a.ts#helper\", name: \"helper\", kind: \"function\", path: \"src/a.ts\" });\n const fileB = nodeStub({ id: \"src/b.ts\", name: \"b.ts\", kind: \"file\", path: \"src/b.ts\" });\n const useB = nodeStub({ id: \"src/b.ts#useB\", name: \"useB\", kind: \"function\", path: \"src/b.ts\" });\n const graph = graphOf(\n [fileA, helper, fileB, useB],\n [edge(\"src/b.ts\", \"src/a.ts\", \"imports\"), edge(\"src/b.ts#useB\", \"src/a.ts#helper\", \"calls\")],\n );\n return { fileA, helper, fileB, useB, graph };\n}",
+ "span": "L221-L231"
}
},
{
- "id": "test/mcp-tools.test.ts#chainRepo",
- "name": "chainRepo",
+ "id": "test/graph-traverse.test.ts#graphOf",
+ "name": "graphOf",
"kind": "function",
- "path": "test/mcp-tools.test.ts",
- "span": "L22-L33",
- "signature": "function chainRepo(): string",
+ "path": "test/graph-traverse.test.ts",
+ "span": "L36-L42",
+ "signature": "function graphOf(nodes: NodeV1[], edges: EdgeV1[]): GraphV1",
"exported": false,
"origin": "ast",
- "body_hash": "15d62ff8440102dce21a2647a706a4307c540acecc930810e29307b72defe3b6",
+ "body_hash": "3e1c1fd8cd1838095c47e9e0e80c0dac69a49091787a166d61858315c7ee4c63",
"summary_state": "ready",
- "summary": "Sets up a repository with a three-deep function call structure to test depth-related functionality in tools.",
+ "summary": "Generates a graph structure from an array of nodes and edges, encapsulating metadata about the graph.",
"crux": {
- "code": " 'export function compute(a: number, b: number): number {\\n return sub(a, b);\\n}\\n',",
- "span": "L29-L29"
+ "code": "function graphOf(nodes: NodeV1[], edges: EdgeV1[]): GraphV1 {\n return {\n meta: { version: 1, nodeCount: nodes.length, edgeCount: edges.length, languages: [\"ts\"] },\n nodes,\n edges,\n };\n}",
+ "span": "L36-L42"
}
},
{
- "id": "test/mcp-tools.test.ts#customDirRepo",
- "name": "customDirRepo",
+ "id": "test/graph-traverse.test.ts#nodeStub",
+ "name": "nodeStub",
"kind": "function",
- "path": "test/mcp-tools.test.ts",
- "span": "L37-L45",
- "signature": "function customDirRepo(): { repo: string; graphDir: string }",
+ "path": "test/graph-traverse.test.ts",
+ "span": "L15-L30",
+ "signature": "function nodeStub(partial: Partial<NodeV1> & { id: string }): NodeV1",
"exported": false,
"origin": "ast",
- "body_hash": "def8983a39f4cc761bf0d89b5f58bb41eff230621ebb4894b7f9007c75af1227",
+ "body_hash": "7e4a8788936b6b4d198eb93113a428318b00f2276e01fd31d89f8c9cf3f81ccb",
"summary_state": "ready",
- "summary": "Establishes a repository in a custom directory to validate the handling of non-default graph locations.",
+ "summary": "Creates a stub node for testing purposes, encapsulating essential properties of a NodeV1 object.",
"crux": {
- "code": " execFileSync(process.execPath, ['--import', 'tsx', 'src/cli.ts', 'build', d, '--dir', graphDir], { stdio: 'pipe' });",
- "span": "L43-L43"
+ "code": "function nodeStub(partial: Partial<NodeV1> & { id: string }): NodeV1 {\n return {\n name: partial.id,\n kind: \"function\",\n path: partial.id.split(\"#\")[0],\n span: \"L1-L1\",\n signature: null,\n exported: true,\n origin: \"ast\",\n body_hash: partial.id,\n summary_state: \"pending\",\n summary: null,",
+ "span": "L15-L26"
}
},
{
- "id": "test/mcp-tools.test.ts#fileScopeRepo",
- "name": "fileScopeRepo",
- "kind": "function",
- "path": "test/mcp-tools.test.ts",
- "span": "L50-L60",
- "signature": "function fileScopeRepo(): string",
- "exported": false,
+ "id": "test/graph-write.test.ts",
+ "name": "graph-write.test.ts",
+ "kind": "file",
+ "path": "test/graph-write.test.ts",
+ "span": "L1-L128",
+ "signature": null,
+ "exported": true,
"origin": "ast",
- "body_hash": "c3e730fb2a68c37167f29ebcf6a14eab2650fde246b3b2fd611cf96b58c55cbd",
+ "body_hash": "cbbf9c3591519993ec89298444d34732f08eb16f90ba1c1cd33bd39d5512f9ff",
+ "chars": 4839,
"summary_state": "ready",
- "summary": "Creates a repository to test the interaction between file imports and function calls across files.",
+ "summary": "This file contains tests to ensure that the `writeGraph` function correctly handles the serialization of graph nodes, specifically that the `body_text` field is omitted when unnecessary, while preserving other fields and the integrity of the original node object.",
"crux": {
- "code": " writeFileSync(join(d, 'src', 'a.ts'), 'export function helper(): number {\\n return 42;\\n}\\n');\n writeFileSync(\n join(d, 'src', 'b.ts'),",
- "span": "L53-L55"
+ "code": "test(\"writeGraph strips body_text from the serialized node but keeps every other field\", () => {\n const dir = mkdtempSync(join(tmpdir(), \"graft-write-\"));\n try {\n const node = makeNode({ body_text: \"some searchable definition body\" });\n const graph: GraphV1 = {\n meta: { version: 1, nodeCount: 1, edgeCount: 0, languages: [\"typescript\"] },\n nodes: [node],\n edges: [],\n };\n const path = writeGraph(graph, dir);\n\n const raw = JSON.parse(readFileSync(path, \"utf8\"));",
+ "span": "L37-L48"
}
},
{
- "id": "test/mcp-tools.test.ts#multiDirRepo",
- "name": "multiDirRepo",
+ "id": "test/graph-write.test.ts#makeNode",
+ "name": "makeNode",
"kind": "function",
- "path": "test/mcp-tools.test.ts",
- "span": "L65-L73",
- "signature": "function multiDirRepo(): string",
+ "path": "test/graph-write.test.ts",
+ "span": "L19-L35",
+ "signature": "function makeNode(overrides: Partial<NodeV1> = {}): NodeV1",
"exported": false,
"origin": "ast",
- "body_hash": "1ba610952a7f039e9715046c0e81e62fb5a0fcb2bb3d62e5435321252679a0bf",
+ "body_hash": "41ebbf74745569c7f08bdc2d7a852617987e439975ac045b640252aa0684fc7e",
"summary_state": "ready",
- "summary": "Generates a repository with multiple directories to test the handling of directory limits in tool operations.",
+ "summary": "Creates a node object with default properties, allowing for optional overrides, to facilitate testing of graph serialization and deserialization.",
"crux": {
- "code": " writeFileSync(join(d, dir, 'x.ts'), `export function ${dir}Fn(): number {\\n return 1;\\n}\\n`);\n }",
- "span": "L69-L70"
+ "code": " return {\n id: \"a.ts#f\",\n name: \"f\",\n kind: \"function\",\n path: \"a.ts\",\n span: \"L1-L3\",\n signature: \"f(): void\",\n exported: true,\n origin: \"ast\",\n body_hash: \"hash\",\n summary_state: \"pending\",\n summary: null,",
+ "span": "L20-L31"
}
},
{
- "id": "test/search-grep.test.ts",
- "name": "search-grep.test.ts",
+ "id": "test/graphrank.test.ts",
+ "name": "graphrank.test.ts",
"kind": "file",
- "path": "test/search-grep.test.ts",
- "span": "L1-L244",
+ "path": "test/graphrank.test.ts",
+ "span": "L1-L257",
"signature": null,
"exported": true,
"origin": "ast",
- "body_hash": "a23b17c1a455374c4b4172834c51bb6c5e5ed5abbc891df16ee7cb4aeae9b5c0",
- "chars": 9704,
- "summary_state": "ready",
- "summary": "Contains core tests for the `graft grep` functionality, ensuring accurate symbol attribution and search results in a parsed graph.",
+ "body_hash": "e4e6155adc501b4d336cba4ad49192310678cf67f3547e2b362bfcb68f30a53e",
+ "chars": 11404,
+ "summary_state": "stale",
+ "summary": "This file contains unit and integration tests for the personalizedPageRank function, ensuring it correctly ranks nodes based on their connectivity in a graph.",
"crux": {
- "code": "test('WALK_RELATIONS (shared, src/graph/relations.ts): exactly the five dependency relations', () => {\n assert.deepEqual(\n [...WALK_RELATIONS].sort(),\n ['calls', 'extends', 'implements', 'imports', 'references'].sort(),\n );\n // Excluded on purpose: contains is structural (file->symbol), not dependency wiring.\n assert.equal(WALK_RELATIONS.has('contains' as never), false);\n});\n\ntest('grepGraph: groups are ordered by inDegree desc, then path asc', () => {\n const repo = needleRepo();\n const graph = loadBuiltGraph(repo);",
- "span": "L93-L104"
+ "code": "test(\"PageRank: a seed wired to the cluster outranks an isolated seed\", () => {\n // hub calls a, b, c; lone is a disconnected seed with equal restart weight.\n const g = graphOf(\n [\"hub\", \"a\", \"b\", \"c\", \"lone\"],\n [edge(\"hub\", \"a\"), edge(\"hub\", \"b\"), edge(\"hub\", \"c\")],\n );\n const pr = personalizedPageRank(g, new Map([[\"hub\", 1], [\"lone\", 1]]));\n assert.ok((pr.get(\"hub\") ?? 0) > (pr.get(\"lone\") ?? 0), \"connected seed beats isolated seed\");\n assert.equal([...pr.values()].some((v) => v === 1), true, \"top node normalized to 1\");\n});\n\ntest(\"PageRank: neighbours of a seed accrue mass even with zero restart weight\", () => {",
+ "span": "L50-L61"
}
},
{
- "id": "test/search-grep.test.ts#fileNode",
- "name": "fileNode",
+ "id": "test/graphrank.test.ts#edge",
+ "name": "edge",
"kind": "function",
- "path": "test/search-grep.test.ts",
- "span": "L24-L39",
- "signature": "function fileNode(path: string, lines: number): NodeV1",
+ "path": "test/graphrank.test.ts",
+ "span": "L39-L41",
+ "signature": "function edge(source: string, target: string, relation: Relation = \"calls\"): EdgeV1",
"exported": false,
"origin": "ast",
- "body_hash": "a97b45c7d03f4c753851a32b055aa77614f568140588edcbea2757291188a02e",
+ "body_hash": "123ba52d4dfdf593b1dd056eb9c949165a0ba7fd06eaf374cf1bf1bd797baee8",
"summary_state": "ready",
- "summary": "Creates a file node representation for a given path and number of lines, facilitating graph construction.",
+ "summary": "Defines an edge between two nodes in the graph, establishing a relationship.",
"crux": {
- "code": "function fileNode(path: string, lines: number): NodeV1 {\n return {\n id: path,\n name: path,\n kind: 'file',\n path,\n span: `L1-L${lines}`,\n signature: null,\n exported: true,\n origin: 'ast',\n body_hash: '',\n summary_state: 'pending',",
- "span": "L24-L35"
+ "code": "function edge(source: string, target: string, relation: Relation = \"calls\"): EdgeV1 {\n return { source, target, relation, confidence: \"extracted\" };\n}",
+ "span": "L39-L41"
}
},
{
- "id": "test/search-grep.test.ts#graphOf",
+ "id": "test/graphrank.test.ts#graphOf",
"name": "graphOf",
"kind": "function",
- "path": "test/search-grep.test.ts",
- "span": "L41-L43",
- "signature": "function graphOf(nodes: NodeV1[], edges: GraphV1['edges'] = []): GraphV1",
+ "path": "test/graphrank.test.ts",
+ "span": "L42-L48",
+ "signature": "function graphOf(nodes: string[], edges: EdgeV1[]): GraphV1",
"exported": false,
"origin": "ast",
- "body_hash": "14ab0ac438fbede56f702c479b6f7fc1bc8d146c4b36242dab7d25fbcb8cf5c6",
+ "body_hash": "bf3b5a40bcc1fa81ff40b720adeff034d332bbbb831f3e2f7528e2f667146ce1",
"summary_state": "ready",
- "summary": "Constructs a graph representation from nodes and edges, encapsulating metadata about the graph structure.",
+ "summary": "Constructs a graph object from given nodes and edges, encapsulating their relationships.",
"crux": {
- "code": "function graphOf(nodes: NodeV1[], edges: GraphV1['edges'] = []): GraphV1 {\n return { meta: { version: 1, nodeCount: nodes.length, edgeCount: edges.length, languages: [] }, nodes, edges };\n}",
- "span": "L41-L43"
+ "code": "function graphOf(nodes: string[], edges: EdgeV1[]): GraphV1 {\n return {\n meta: { version: 1, nodeCount: nodes.length, edgeCount: edges.length, languages: [\"ts\"] },\n nodes: nodes.map(node),\n edges,\n };\n}",
+ "span": "L42-L48"
}
},
{
- "id": "test/search-grep.test.ts#loadBuiltGraph",
- "name": "loadBuiltGraph",
+ "id": "test/graphrank.test.ts#makeCollisionFixture",
+ "name": "makeCollisionFixture",
"kind": "function",
- "path": "test/search-grep.test.ts",
- "span": "L87-L91",
- "signature": "function loadBuiltGraph(repo: string): GraphV1",
+ "path": "test/graphrank.test.ts",
+ "span": "L182-L192",
+ "signature": "function makeCollisionFixture(): string",
"exported": false,
"origin": "ast",
- "body_hash": "39d7dbe4e44d4a83bb1b4d13836e4b230a8c709a09e7ff116b77190a82eb16c1",
+ "body_hash": "2177edb69c1857665ec38d0fadebf5147cc7c3e71b39d026ee7f33e0c07865f8",
"summary_state": "ready",
- "summary": "Loads a built graph from a specified repository, ensuring the graph is correctly constructed for testing.",
+ "summary": "Sets up a temporary file structure to simulate a collision scenario for testing graph ranking.",
"crux": {
- "code": "function loadBuiltGraph(repo: string): GraphV1 {\n const g = readGraph(wiringPath(join(repo, 'graft')));\n assert.ok(g, 'expected a built graph.json');\n return g!;\n}",
- "span": "L87-L91"
+ "code": "function makeCollisionFixture(): string {\n const dir = mkdtempSync(join(tmpdir(), \"graft-graphrank-\"));\n writeFileSync(\n join(dir, \"connected.ts\"),\n `export function fooHandler() {\\n helperAlpha();\\n helperBeta();\\n}\\n` +\n `export function helperAlpha() { return 1; }\\n` +\n `export function helperBeta() { return 2; }\\n`,\n );\n writeFileSync(join(dir, \"isolated.ts\"), `export function fooWidget() { return 0; }\\n`);\n return dir;\n}",
+ "span": "L128-L138"
}
},
{
- "id": "test/search-grep.test.ts#needleRepo",
- "name": "needleRepo",
+ "id": "test/graphrank.test.ts#node",
+ "name": "node",
"kind": "function",
- "path": "test/search-grep.test.ts",
- "span": "L50-L85",
- "signature": "function needleRepo(): string",
+ "path": "test/graphrank.test.ts",
+ "span": "L23-L38",
+ "signature": "function node(id: string): NodeV1",
"exported": false,
"origin": "ast",
- "body_hash": "ddbfa733e3076db220939ab5efd2ec90a8250b54170f03bb9d23c28751467b01",
- "summary_state": "ready",
- "summary": "Sets up a temporary repository with TypeScript files to test the grep functionality, simulating real-world usage scenarios.",
- "crux": {
- "code": "function needleRepo(): string {\n const d = mkdtempSync(join(tmpdir(), 'graft-grep-'));\n mkdirSync(join(d, 'src'), { recursive: true });\n writeFileSync(\n join(d, 'src', 'a.ts'),\n [\n 'export function heavilyCalled(): void {',\n ' console.log(\"NEEDLE hit in heavilyCalled\");',\n '}',\n '',\n 'export function rarelyCalled(): void {',\n ' console.log(\"NEEDLE hit in rarelyCalled\");',",
- "span": "L50-L61"
- }
- },
- {
- "id": "test/viz-assemble.test.ts",
- "name": "viz-assemble.test.ts",
- "kind": "file",
- "path": "test/viz-assemble.test.ts",
- "span": "L1-L106",
- "signature": null,
- "exported": true,
- "origin": "ast",
- "body_hash": "89a2a9f11f459a8110f9d89b2de780dfd164504f3b4c7dc61953a6c83c5911cb",
- "chars": 3118,
+ "body_hash": "50c83e997e60e662392960d89cc6c5b421a65cfd8c166084e4c5f3c8ea9a9bd6",
"summary_state": "ready",
- "summary": "This file contains tests that validate the assembly of a context graph from markdown frontmatter, ensuring proper relation normalization and error handling for malformed files.",
+ "summary": "Creates a node representation for the graph with specified properties.",
"crux": {
- "code": "test(\"assembleContextGraph builds nodes and edges from frontmatter\", () => {\n const dir = makeContextDir();\n try {\n const g = assembleContextGraph(dir);\n\n assert.equal(g.nodes.length, 2);\n assert.deepEqual(g.nodes.map((n) => n.id).sort(), [\"alpha\", \"beta\"]);\n\n const alpha = g.nodes.find((n) => n.id === \"alpha\")!;\n assert.equal(alpha.name, \"Alpha\");\n assert.equal(alpha.type, \"system\");\n assert.deepEqual(alpha.sources, [\"src/a.ts\"]);",
- "span": "L62-L73"
+ "code": "function node(id: string): NodeV1 {\n return {\n id,\n name: id,\n kind: \"function\",\n path: `${id}.ts`,\n span: \"L1-L1\",\n signature: null,\n exported: true,\n origin: \"ast\",\n body_hash: id,\n summary_state: \"pending\",",
+ "span": "L23-L34"
}
},
{
- "id": "test/viz-assemble.test.ts#makeContextDir",
- "name": "makeContextDir",
+ "id": "test/graphrank.test.ts#rank",
+ "name": "rank",
"kind": "function",
- "path": "test/viz-assemble.test.ts",
- "span": "L12-L60",
- "signature": "function makeContextDir(): string",
+ "path": "test/graphrank.test.ts",
+ "span": "L194-L195",
+ "signature": "rank = (dir: string, gr: boolean)",
"exported": false,
"origin": "ast",
- "body_hash": "4fab7dd2dc5bc7c0b9d575f8396bdca67e8d2d5a9f337aa14ef7740dd87b2119",
+ "body_hash": "5bf6fb6a4dc37b257683b4ab9b24ff4838cf94cd3404123bb383861163c4bbec",
"summary_state": "ready",
- "summary": "This function creates a temporary directory with markdown files to simulate context data for testing the graph assembly.",
+ "summary": "Executes the ask function with specified parameters to retrieve ranked results based on graph connectivity.",
"crux": {
- "code": " const dir = mkdtempSync(join(tmpdir(), \"graftviz-\"));\n writeFileSync(\n join(dir, \"alpha.md\"),\n `---\nname: Alpha\nslug: alpha\ntype: system\nsources:\n - path: src/a.ts\n hash: abc123\nlinks:\n - to: beta",
- "span": "L13-L24"
+ "code": "const rank = (dir: string, gr: boolean) =>\n ask(dir, \"foo\", { graphRank: gr }).hits.map((h) => h.title.split(\" ·\")[0]);",
+ "span": "L140-L141"
}
},
{
- "id": "test/viz-serve.test.ts",
- "name": "viz-serve.test.ts",
+ "id": "test/helpers.ts",
+ "name": "helpers.ts",
"kind": "file",
- "path": "test/viz-serve.test.ts",
- "span": "L1-L101",
+ "path": "test/helpers.ts",
+ "span": "L1-L55",
"signature": null,
"exported": true,
"origin": "ast",
- "body_hash": "d22168054844e83bc5257271c4cc80a6e3eb1315e600c03b48fe6b54afd5c243",
- "chars": 4004,
+ "body_hash": "e45af1d38d7c6d4abc804fc74e9ae4c3373cf78769c17b16b185c3ee0e2c3228",
+ "chars": 2012,
"summary_state": "ready",
- "summary": "This file contains tests for the viz server, ensuring it serves the correct endpoints and handles various scenarios like port fallback and context directory changes.",
- "crux": {
- "code": "test(\"viz server serves viewer, context graph, and gates code graph\", async () => {\n const { contextDir, viewerDir, root } = makeDirs();\n const srv = await startVizServer({ contextDir, viewerDir, port: 4831, repoName: \"fixture\" });\n try {\n const html = await fetch(`${srv.url}/`).then((r) => r.text());\n assert.match(html, /stub/);\n\n const graph = await fetch(`${srv.url}/api/context-graph`).then((r) => r.json());\n assert.equal(graph.meta.nodeCount, 1);\n assert.equal(graph.meta.repoName, \"fixture\");\n assert.equal(graph.nodes[0].id, \"alpha\");\n",
- "span": "L29-L40"
- }
+ "summary": "This file provides test doubles for offline, deterministic testing of components without external dependencies.",
+ "crux": null
},
{
- "id": "test/viz-serve.test.ts#makeDirs",
- "name": "makeDirs",
- "kind": "function",
- "path": "test/viz-serve.test.ts",
- "span": "L13-L27",
- "signature": "function makeDirs(): { contextDir: string; viewerDir: string; root: string }",
- "exported": false,
+ "id": "test/helpers.ts#BracketSynthesizer",
+ "name": "BracketSynthesizer",
+ "kind": "class",
+ "path": "test/helpers.ts",
+ "span": "L21-L50",
+ "signature": "class BracketSynthesizer implements Synthesizer",
+ "exported": true,
"origin": "ast",
- "body_hash": "cff2ec95e868528eec2623a2907ab4c4e3e4a55224d0551b1fb8a63e8bbc124d",
+ "body_hash": "6a30b1293990bb2dce95f1f1f77219dbcdc54eef7e6a01d0db03403f4d344bcc",
"summary_state": "ready",
- "summary": "This function creates necessary directory structures and files for testing the viz server.",
+ "summary": "This class synthesizes a graph structure from simple markup, enabling tests to define the relationships between nodes explicitly.",
"crux": {
- "code": " const root = mkdtempSync(join(tmpdir(), \"graftviz-srv-\"));\n const contextDir = join(root, \".context\");\n const viewerDir = join(root, \"viewer\");\n mkdirSync(contextDir);\n mkdirSync(viewerDir);\n writeFileSync(join(viewerDir, \"index.html\"), \"<title>stub</title>\\n\");\n writeFileSync(join(viewerDir, \"app.js\"), \"// stub\\n\");\n writeFileSync(join(viewerDir, \"style.css\"), \"/* stub */\\n\");\n writeFileSync(\n join(contextDir, \"alpha.md\"),\n `---\\nname: Alpha\\nslug: alpha\\ntype: system\\nsources: []\\nlinks: []\\n---\\nbody\\n`,\n );",
- "span": "L14-L25"
+ "code": " async synthesize(files: FileSummary[]): Promise<SynthNode[]> {\n const byName = new Map<string, { sources: Set<string>; links: Map<string, SynthLink> }>();\n const ensure = (name: string) => {\n let e = byName.get(name);\n if (!e) {\n e = { sources: new Set(), links: new Map() };\n byName.set(name, e);\n }\n return e;\n };\n for (const f of files) {\n for (const m of f.summary.matchAll(/\\[\\[([^\\]]+)\\]\\]/g)) {",
+ "span": "L22-L33"
}
},
{
- "id": "viewer/data.ts",
- "name": "data.ts",
- "kind": "file",
- "path": "viewer/data.ts",
- "span": "L1-L122",
- "signature": null,
+ "id": "test/helpers.ts#BracketSynthesizer.synthesize",
+ "name": "synthesize",
+ "kind": "method",
+ "path": "test/helpers.ts",
+ "span": "L22-L49",
+ "signature": "async synthesize(files: FileSummary[]): Promise<SynthNode[]>",
"exported": true,
"origin": "ast",
- "body_hash": "e9c5c89ad933e06004cbeddc1b1d7b60a6057726a463c66f9673ba20a3c61afd",
- "chars": 4708,
+ "body_hash": "b42a19064389576a02ba334fcab8bfb5d8d985a46f995be864095e770d47e26d",
"summary_state": "ready",
- "summary": "This file defines data structures and functions for managing and visualizing graph data from a server.",
- "crux": null
+ "summary": "This method processes file summaries to create a structured representation of nodes and their relationships based on markup.",
+ "crux": {
+ "code": " for (const m of f.summary.matchAll(/\\[\\[([^\\]]+)\\]\\]\\s*==([a-z_]+)==>\\s*\\[\\[([^\\]]+)\\]\\]/g)) {\n const [, from, relation, to] = m;\n ensure(to.trim()).sources.add(f.path);\n ensure(from.trim()).links.set(`${to}|${relation}`, { to: to.trim(), relation });\n }",
+ "span": "L36-L40"
+ }
},
{
- "id": "viewer/data.ts#chipKey",
- "name": "chipKey",
+ "id": "test/helpers.ts#BracketSynthesizer.synthesize.ensure",
+ "name": "ensure",
"kind": "function",
- "path": "viewer/data.ts",
- "span": "L47-L51",
- "signature": "function chipKey(rel: string): string",
+ "path": "test/helpers.ts",
+ "span": "L24-L31",
+ "signature": "ensure = (name: string)",
"exported": true,
"origin": "ast",
- "body_hash": "85dd128b9f3bf028efaeac2428474b0d70ac47e8e94bcba80c111d59a6006df9",
+ "body_hash": "3b8cc65a6170766e70a5b038f9f27176e60114ce70e0e2dc1463f720ed384c4c",
"summary_state": "ready",
- "summary": "Generates a key for chip grouping based on the relation verb, simplifying the visualization of relationships.",
+ "summary": "This function ensures that a node exists in the map, creating it if necessary, to maintain the graph structure.",
"crux": {
- "code": " if (famOf(rel) === \"structure\") return \"part of\";\n if (rel === \"calls\" || rel === \"uses\" || rel === \"depends_on\" || rel === \"imports\") return \"uses\";\n return rel.replace(/_/g, \" \");",
- "span": "L48-L50"
+ "code": " const ensure = (name: string) => {\n let e = byName.get(name);\n if (!e) {\n e = { sources: new Set(), links: new Map() };\n byName.set(name, e);\n }\n return e;\n };",
+ "span": "L24-L31"
}
},
{
- "id": "viewer/data.ts#CodeGraphV1",
- "name": "CodeGraphV1",
- "kind": "interface",
- "path": "viewer/data.ts",
- "span": "L86-L93",
- "signature": "interface CodeGraphV1",
- "exported": false,
+ "id": "test/helpers.ts#fakeProviders",
+ "name": "fakeProviders",
+ "kind": "function",
+ "path": "test/helpers.ts",
+ "span": "L52-L54",
+ "signature": "function fakeProviders()",
+ "exported": true,
"origin": "ast",
- "body_hash": "e494a9a322973f3bc8af2017764ac546a8e9cb7b03cae5aeb730f48ad2521d90",
+ "body_hash": "0395bc21ba030a5d0e1fc9e5fdd0d8780c4309c87d899bedbc940f1bdcd2864f",
"summary_state": "ready",
- "summary": "Defines the structure of the code graph data received from the server, including nodes and edges.",
+ "summary": "This function creates and returns instances of the test doubles for summarization and synthesis.",
"crux": null
},
{
- "id": "viewer/data.ts#colorToken",
- "name": "colorToken",
- "kind": "function",
- "path": "viewer/data.ts",
- "span": "L72-L75",
- "signature": "function colorToken(tab: \"context\" | \"code\", type: string): string",
+ "id": "test/helpers.ts#PassthroughSummarizer",
+ "name": "PassthroughSummarizer",
+ "kind": "class",
+ "path": "test/helpers.ts",
+ "span": "L9-L13",
+ "signature": "class PassthroughSummarizer implements Summarizer",
"exported": true,
"origin": "ast",
- "body_hash": "dc48f14294140f474d97fdedf0bdbbbe487d5f0bcdeda6ae84f87251ab24b007",
+ "body_hash": "43c71f9e449859d657d6cef17b80d2bb650734751530e8401c356fc963f7b012",
"summary_state": "ready",
- "summary": "Maps a type to its corresponding CSS custom property for styling in the visualization.",
+ "summary": "This class serves as a no-op summarizer that returns the input code unchanged for controlled testing.",
"crux": {
- "code": " return m[type] ?? \"--edge\";",
- "span": "L74-L74"
+ "code": " async summarize(code: string): Promise<string> {\n return code;\n }",
+ "span": "L10-L12"
}
},
{
- "id": "viewer/data.ts#cvar",
- "name": "cvar",
- "kind": "function",
- "path": "viewer/data.ts",
- "span": "L77-L79",
- "signature": "function cvar(name: string): string",
+ "id": "test/helpers.ts#PassthroughSummarizer.summarize",
+ "name": "summarize",
+ "kind": "method",
+ "path": "test/helpers.ts",
+ "span": "L10-L12",
+ "signature": "async summarize(code: string): Promise<string>",
"exported": true,
"origin": "ast",
- "body_hash": "89e6f3b44e0dd358542573894691c925266e88da9160b79be00d043ae17245e8",
+ "body_hash": "8836e78c4875dee01aeae5cb976c217cd347554542e387996b7c190b1a73af18",
"summary_state": "ready",
- "summary": "Retrieves the value of a CSS custom property from the document's root element.",
- "crux": null
+ "summary": "This method returns the input code as-is, allowing tests to control the output precisely.",
+ "crux": {
+ "code": " async summarize(code: string): Promise<string> {\n return code;\n }",
+ "span": "L10-L12"
+ }
},
{
- "id": "viewer/data.ts#Family",
- "name": "Family",
- "kind": "type",
- "path": "viewer/data.ts",
- "span": "L29-L29",
- "signature": "type Family = \"structure\" | \"dependency\" | \"contract\" | \"association\";",
+ "id": "test/hosts-codex-hooks.test.ts",
+ "name": "hosts-codex-hooks.test.ts",
+ "kind": "file",
+ "path": "test/hosts-codex-hooks.test.ts",
+ "span": "L1-L80",
+ "signature": null,
"exported": true,
"origin": "ast",
- "body_hash": "324db0cd1c7f2eebbda194734b2a8db880eb835949f0325780ea5ae75308ef05",
+ "body_hash": "ed49a8a106eeb458ad2dd071071cefae17dd4d0eabd1b74006047feadef9a89a",
+ "chars": 3738,
"summary_state": "ready",
- "summary": "Categorizes relation verbs into families to enforce consistent semantics in graph relationships.",
- "crux": null
+ "summary": "This test suite verifies the behavior of the installCodexHooks function, ensuring it correctly manages hook installations and configurations in various scenarios.",
+ "crux": {
+ "code": "test('no-op when the CLI home dir is absent', () => {\n assert.deepEqual(installCodexHooks(fresh()), []);\n});\n\ntest('writes shim + hooks.json entry, idempotent on re-run', () => {\n const home = fresh();\n mkdirSync(join(home, '.codex'), { recursive: true });\n const w = installCodexHooks(home);\n assert.equal(w.length, 2);\n const shim = join(home, '.codex', 'hooks', 'graft', 'graft-hooks.cjs');\n assert.ok(existsSync(shim));\n assert.ok(statSync(shim).mode & 0o111, 'shim is executable');",
+ "span": "L10-L21"
+ }
},
{
- "id": "viewer/data.ts#famOf",
- "name": "famOf",
+ "id": "test/hosts-codex-hooks.test.ts#fresh",
+ "name": "fresh",
"kind": "function",
- "path": "viewer/data.ts",
- "span": "L39-L41",
- "signature": "function famOf(rel: string): Family",
- "exported": true,
+ "path": "test/hosts-codex-hooks.test.ts",
+ "span": "L8-L8",
+ "signature": "function fresh(): string",
+ "exported": false,
"origin": "ast",
- "body_hash": "faed31084ad49496d754f589593081a76a4cd98e714ff10a10c07d5cd476738d",
+ "body_hash": "c75405ab5617c9e32684bf0530549edf2833d88ee5e6c955308b46c9f4e14c46",
"summary_state": "ready",
- "summary": "Determines the family category of a given relation verb, defaulting to 'association' if unknown.",
- "crux": {
- "code": " return FAMILY[rel] ?? \"association\";",
- "span": "L40-L40"
- }
+ "summary": "Generates a unique temporary directory for testing purposes.",
+ "crux": null
},
{
- "id": "viewer/data.ts#loadCodeGraph",
- "name": "loadCodeGraph",
- "kind": "function",
- "path": "viewer/data.ts",
- "span": "L96-L113",
- "signature": "async function loadCodeGraph(): Promise<VizGraph | null>",
+ "id": "test/hosts-init.test.ts",
+ "name": "hosts-init.test.ts",
+ "kind": "file",
+ "path": "test/hosts-init.test.ts",
+ "span": "L1-L139",
+ "signature": null,
"exported": true,
"origin": "ast",
- "body_hash": "343a1a01362fa33345082eb6cd5a04cfc1b7a1411de7bc23422c5ac5ebb1fae1",
+ "body_hash": "56f8988468cb716296b40c939bf58d079015d135fcb3f2c1481e64bce7f67324",
+ "chars": 5922,
"summary_state": "ready",
- "summary": "Loads the code graph from the server, filtering out unresolved edges and returning a structured graph.",
+ "summary": "This test suite verifies the behavior of the runHostsInit function in various scenarios, ensuring it correctly handles host initialization, agent detection, and configuration management.",
"crux": {
- "code": " if (!res.ok) return null;\n const raw = (await res.json()) as CodeGraphV1;\n const nodes: VizNode[] = raw.nodes.map((n) => ({\n id: n.id,\n name: n.name,\n type: n.kind,\n summary: n.summary ?? n.signature ?? \"\",\n sources: [`${n.path} · ${n.span}`],\n }));\n const known = new Set(nodes.map((n) => n.id));\n // imports edges may point at unresolved module strings — drop those for rendering\n const edges: VizEdge[] = raw.edges",
- "span": "L98-L109"
+ "code": "test('writes only detected hosts by default', () => {\n const home = fresh(); const repo = fresh();\n mkdirSync(join(home, '.cursor'));\n const r = runHostsInit(repo, { home });\n assert.deepEqual(r.written.map((w) => w.id), ['cursor']);\n const mdc = readFileSync(join(repo, '.cursor', 'rules', 'graft.mdc'), 'utf8');\n assert.match(mdc, /alwaysApply: true/);\n assert.ok(!existsSync(join(repo, 'AGENTS.md')));\n});\n\ntest('explicit agents list overrides detection and flags unknown ids', () => {\n const home = fresh(); const repo = fresh();",
+ "span": "L11-L22"
}
},
{
- "id": "viewer/data.ts#loadContextGraph",
- "name": "loadContextGraph",
+ "id": "test/hosts-init.test.ts#fresh",
+ "name": "fresh",
"kind": "function",
- "path": "viewer/data.ts",
- "span": "L81-L84",
- "signature": "async function loadContextGraph(): Promise<VizGraph>",
- "exported": true,
+ "path": "test/hosts-init.test.ts",
+ "span": "L9-L9",
+ "signature": "function fresh(): string",
+ "exported": false,
"origin": "ast",
- "body_hash": "c65d9227bea8ceceffd49b4eb8475677aef8ca8820b966d9228a31875a6589e1",
+ "body_hash": "9da796af39ee7c44e2c780ded8bc297fc37f854834c5ecdab7819298b3df9cce",
"summary_state": "ready",
- "summary": "Fetches the context graph data from the server and returns it in a structured format.",
- "crux": {
- "code": " const res = await fetch(\"/api/context-graph\");\n return (await res.json()) as VizGraph;",
- "span": "L82-L83"
- }
+ "summary": "Generates a unique temporary directory for testing purposes to avoid conflicts between test runs.",
+ "crux": null
},
{
- "id": "viewer/data.ts#onServerChange",
- "name": "onServerChange",
- "kind": "function",
- "path": "viewer/data.ts",
- "span": "L116-L121",
- "signature": "function onServerChange(handler: () => void): void",
+ "id": "test/hosts-instructions.test.ts",
+ "name": "hosts-instructions.test.ts",
+ "kind": "file",
+ "path": "test/hosts-instructions.test.ts",
+ "span": "L1-L36",
+ "signature": null,
"exported": true,
"origin": "ast",
- "body_hash": "d864a1d7995232ad54351830e5963a2c6fc8c64cc5a941cf9cfea74d688514c9",
- "summary_state": "ready",
- "summary": "Subscribes to server events to trigger updates in the application when changes occur.",
+ "body_hash": "9fadc09e68320bbe16b97ee552411a4b1bcff04fbcd825201deb1103f7986528",
+ "chars": 1653,
+ "summary_state": "stale",
+ "summary": "This test suite verifies the structure and content of various instruction bodies to ensure they meet specified formatting and inclusion criteria.",
"crux": {
- "code": " if (ev.data === \"change\") handler();",
- "span": "L119-L119"
+ "code": "test('canonical body names the three essentials', () => {\n const b = instructionBody();\n assert.match(b, /^## Graft — repo context graph/m);\n assert.match(b, /graft ask \"/);\n assert.match(b, /graft\\/INDEX\\.md/);\n assert.match(b, /graft build/);\n assert.match(b, /every occurrence|enumerate with grep/i, 'teaches the exhaustive-task grep rule');\n assert.match(b, /callers/, 'teaches the callers/callees/impact commands');\n assert.match(b, /truncated/i, 'tells the agent to follow up on truncated spans');\n assert.match(b, /graft grep/, 'routes sweeps to graft grep');\n assert.match(b, /graft map/, 'tells the agent to orient with graft map before exploring');\n assert.ok(!/\\bhook|statusline\\b/i.test(b), 'no host-specific machinery in the shared body');",
+ "span": "L5-L16"
}
},
{
- "id": "viewer/data.ts#VizEdge",
- "name": "VizEdge",
- "kind": "interface",
- "path": "viewer/data.ts",
- "span": "L14-L20",
- "signature": "interface VizEdge",
- "exported": true,
- "origin": "ast",
- "body_hash": "13baa6c9acc4c78eec36835e02fd49df79e869f836880341a959be134ceaabb1",
- "summary_state": "ready",
- "summary": "Defines the relationship between two nodes in the visualization graph, including its type and description.",
- "crux": null
- },
- {
- "id": "viewer/data.ts#VizGraph",
- "name": "VizGraph",
- "kind": "interface",
- "path": "viewer/data.ts",
- "span": "L22-L26",
- "signature": "interface VizGraph",
+ "id": "test/hosts-mcp-config.test.ts",
+ "name": "hosts-mcp-config.test.ts",
+ "kind": "file",
+ "path": "test/hosts-mcp-config.test.ts",
+ "span": "L1-L77",
+ "signature": null,
"exported": true,
"origin": "ast",
- "body_hash": "6448a4bb9c71c7932dce92d9d8a452f99a0a100041bd30c5b6759c5784b0f098",
+ "body_hash": "5b3ec5afd61079f051d8063f06701ddac608f48b706e72f9ee607e8da673fb06",
+ "chars": 3982,
"summary_state": "ready",
- "summary": "Encapsulates the entire visualization graph structure, including its nodes and edges.",
- "crux": null
+ "summary": "This test suite verifies the behavior of the registerMcpConfigs function in handling various configurations and edge cases.",
+ "crux": {
+ "code": "test('cursor/gemini/kiro get repo-local JSON entries', () => {\n const repo = fresh(); const home = fresh();\n const w = registerMcpConfigs(repo, ['cursor', 'gemini', 'kiro'], { home });\n assert.deepEqual(w.map((x) => x.action), ['created', 'created', 'created']);\n const cursor = JSON.parse(readFileSync(join(repo, '.cursor', 'mcp.json'), 'utf8'));\n assert.deepEqual(cursor.mcpServers.graft, { command: 'npx', args: ['-y', '@nanonets/graft', 'mcp'] });\n assert.ok(existsSync(join(repo, '.gemini', 'settings.json')));\n assert.ok(existsSync(join(repo, '.kiro', 'settings', 'mcp.json')));\n});\n\ntest('existing config keys are preserved; re-run is unchanged', () => {\n const repo = fresh(); const home = fresh();",
+ "span": "L10-L21"
+ }
},
{
- "id": "viewer/data.ts#VizNode",
- "name": "VizNode",
- "kind": "interface",
- "path": "viewer/data.ts",
- "span": "L6-L12",
- "signature": "interface VizNode",
- "exported": true,
+ "id": "test/hosts-mcp-config.test.ts#fresh",
+ "name": "fresh",
+ "kind": "function",
+ "path": "test/hosts-mcp-config.test.ts",
+ "span": "L8-L8",
+ "signature": "function fresh(): string",
+ "exported": false,
"origin": "ast",
- "body_hash": "ec19a79898c594e5afc405cab037fcc0c43144c5766af8a955dccda7df733ba6",
+ "body_hash": "5d57935fd93aed6bacff9481af82c74f353c4928d0c3cf15efbfa038c85dad5a",
"summary_state": "ready",
- "summary": "Represents a node in the visualization graph, encapsulating its identity and metadata.",
+ "summary": "Generates a fresh temporary directory for testing purposes.",
"crux": null
},
{
- "id": "viewer/detail.ts",
- "name": "detail.ts",
+ "id": "test/hosts-registry.test.ts",
+ "name": "hosts-registry.test.ts",
"kind": "file",
- "path": "viewer/detail.ts",
- "span": "L1-L59",
+ "path": "test/hosts-registry.test.ts",
+ "span": "L1-L45",
"signature": null,
"exported": true,
"origin": "ast",
- "body_hash": "fe8df7c5561f2a8588cf4e1ecb367d19cb6b480fe4855f05e4f96137d8078884",
- "chars": 2421,
+ "body_hash": "6490cbdc54b870d670adf28b5b469e07360a474073b08d692601ef1c4b7ea47e",
+ "chars": 1632,
"summary_state": "ready",
- "summary": "This file provides the logic to render a detailed view of a selected node in a graph, including its properties and relationships.",
+ "summary": "This file contains tests for the hosts registry functionality, ensuring that the correct hosts are detected based on the presence of specific directories.",
"crux": {
- "code": " if (!id || !graph) {\n host.innerHTML = '<div class=\"empty\">Select a node to view details</div>';\n return;\n }\n const node = graph.nodes.find((n) => n.id === id);\n if (!node) {\n host.innerHTML = '<div class=\"empty\">Select a node to view details</div>';\n return;\n }\n const color = cvar(colorToken(tab, node.type));\n const name = (nid: string) => graph.nodes.find((n) => n.id === nid)?.name ?? nid;\n const out = graph.edges.filter((e) => e.source === id);",
- "span": "L19-L30"
+ "code": "test('registry exposes the six phase-1 hosts', () => {\n assert.deepEqual(hostIds().sort(), ['agents', 'copilot', 'cursor', 'gemini', 'kiro', 'windsurf']);\n for (const h of HOSTS) {\n assert.ok(h.relPath.length > 0);\n assert.ok(h.content().length > 0);\n }\n});\n\ntest('nothing detected on a bare machine and bare repo', () => {\n assert.deepEqual(detectHosts(probeFor(fresh(), fresh())), []);\n});\n",
+ "span": "L17-L28"
}
},
{
- "id": "viewer/detail.ts#esc",
- "name": "esc",
+ "id": "test/hosts-registry.test.ts#fresh",
+ "name": "fresh",
"kind": "function",
- "path": "viewer/detail.ts",
- "span": "L8-L10",
- "signature": "function esc(s: string): string",
+ "path": "test/hosts-registry.test.ts",
+ "span": "L15-L15",
+ "signature": "function fresh(): string",
"exported": false,
"origin": "ast",
- "body_hash": "9fb927f7f1c881ee1fe325c0dc8a25b8c5cdb2c101b08ae935a35bb428f5bbdb",
+ "body_hash": "4b7e71149dfcf083709a98bd3f04eb92af9a722c7d567dcd4288be6119afc6ea",
"summary_state": "ready",
- "summary": "This function sanitizes a string for safe HTML rendering by escaping special characters.",
- "crux": {
- "code": " return s.replace(/&/g, \"&amp;\").replace(/</g, \"&lt;\");\n}",
- "span": "L9-L10"
- }
+ "summary": "Generates a temporary directory for testing purposes, ensuring a clean environment for each test case.",
+ "crux": null
},
{
- "id": "viewer/detail.ts#renderDetail",
- "name": "renderDetail",
+ "id": "test/hosts-registry.test.ts#probeFor",
+ "name": "probeFor",
"kind": "function",
- "path": "viewer/detail.ts",
- "span": "L12-L58",
- "signature": "function renderDetail( host: HTMLElement, graph: VizGraph | null, tab: \"context\" | \"code\", id: string | null, onNavigate: (id: string) => void, ): void",
- "exported": true,
+ "path": "test/hosts-registry.test.ts",
+ "span": "L9-L14",
+ "signature": "function probeFor(home: string, repo: string): DetectProbe",
+ "exported": false,
"origin": "ast",
- "body_hash": "bbd0db0a7f39cbfbd9b0ca31f88118c9a2cd037d394ad47bff7203a6f399f5ca",
+ "body_hash": "7653739002fda057d1517f18bfe77dfb0dcf78ab6cb9716ceb7624601eec1f7f",
"summary_state": "ready",
- "summary": "This function renders the details of a selected node, including its type, name, summary, sources, and relationships.",
+ "summary": "Creates a probe object that checks for the existence of a directory, facilitating host detection based on the file system state.",
"crux": {
- "code": " const color = cvar(colorToken(tab, node.type));\n const name = (nid: string) => graph.nodes.find((n) => n.id === nid)?.name ?? nid;\n const out = graph.edges.filter((e) => e.source === id);\n const inn = graph.edges.filter((e) => e.target === id);\n\n let html = `<span class=\"d-type\"><span class=\"sw\" style=\"background:${color}\"></span>${esc(node.type)}</span>`;\n html += `<h3>${esc(node.name)}</h3>`;\n if (node.summary) html += `<p class=\"summary\">${esc(node.summary)}</p>`;\n if (node.sources.length) {\n html += `<div class=\"d-label\">Sources · ${node.sources.length}</div>`;\n for (const s of node.sources) html += `<div class=\"src mono\">${esc(s)}</div>`;\n }",
- "span": "L28-L39"
+ "code": " dirExists: (p) => { try { return statSync(p).isDirectory(); } catch { return false; } },\n };",
+ "span": "L12-L13"
}
},
{
- "id": "viewer/detail.ts#renderDetail.linkList",
- "name": "linkList",
- "kind": "function",
- "path": "viewer/detail.ts",
- "span": "L40-L50",
- "signature": "linkList = (edges: typeof out, dotColor: string, title: string, other: (e: (typeof out)[number]) => string)",
+ "id": "test/hosts-sections.test.ts",
+ "name": "hosts-sections.test.ts",
+ "kind": "file",
+ "path": "test/hosts-sections.test.ts",
+ "span": "L1-L112",
+ "signature": null,
"exported": true,
"origin": "ast",
- "body_hash": "f103fe554602f3315706280d7eba1016c647c77fa6af27e9a4ec0442d6cf1d89",
+ "body_hash": "a780abe63074737d40bcd556df06b7b541d2694df75c307daabd280f64f9dba4",
+ "chars": 4777,
"summary_state": "ready",
- "summary": "This function generates HTML for displaying a list of links related to a node, categorized by their relationship type.",
+ "summary": "This file contains tests for the upsertSection function, ensuring it correctly creates, appends, replaces, and reports on sections in markdown files.",
"crux": {
- "code": " if (!edges.length) return;\n html += `<div class=\"d-label\"><span class=\"dot\" style=\"background:${dotColor}\"></span>${title} · ${edges.length}</div>`;\n for (const e of edges) {\n html += `<button class=\"lnk\" data-go=\"${esc(other(e))}\">` +\n `<span class=\"rel\">${esc(e.relation.replace(/_/g, \" \"))}</span> ` +\n `<span class=\"to\">${esc(name(other(e)))}</span>` +\n (e.description ? `<div class=\"desc\">${esc(e.description)}</div>` : \"\") +\n `</button>`;\n }\n };",
- "span": "L41-L50"
+ "code": "test('creates the file with a fenced block when missing', () => {\n const f = join(fresh(), 'AGENTS.md');\n const r = upsertSection(f, '## Graft\\nuse graft ask');\n assert.equal(r.action, 'created');\n const text = readFileSync(f, 'utf8');\n assert.ok(text.includes('<!-- graft:start -->'));\n assert.ok(text.includes('use graft ask'));\n assert.ok(text.endsWith('\\n'));\n});\n\ntest('appends after existing content, separated by a blank line', () => {\n const f = join(fresh(), 'AGENTS.md');",
+ "span": "L10-L21"
}
},
{
- "id": "viewer/detail.ts#renderDetail.name",
- "name": "name",
+ "id": "test/hosts-sections.test.ts#fresh",
+ "name": "fresh",
"kind": "function",
- "path": "viewer/detail.ts",
- "span": "L29-L29",
- "signature": "name = (nid: string)",
- "exported": true,
+ "path": "test/hosts-sections.test.ts",
+ "span": "L8-L8",
+ "signature": "function fresh(): string",
+ "exported": false,
"origin": "ast",
- "body_hash": "617c48812e0f0520b45da770cf91aeea5330b7e690c6d93defd4da77edf11b8a",
+ "body_hash": "5fbf8aed98c1fd26d88217061c491d534e161b32a06df5c80d376de4eb1171a3",
"summary_state": "ready",
- "summary": "This function retrieves the name of a node by its ID, providing a fallback if not found.",
- "crux": {
- "code": " const name = (nid: string) => graph.nodes.find((n) => n.id === nid)?.name ?? nid;",
- "span": "L29-L29"
- }
+ "summary": "Generates a fresh temporary directory for testing purposes.",
+ "crux": null
},
{
- "id": "viewer/graph.ts",
- "name": "graph.ts",
+ "id": "test/llm-adapters.test.ts",
+ "name": "llm-adapters.test.ts",
"kind": "file",
- "path": "viewer/graph.ts",
- "span": "L1-L335",
+ "path": "test/llm-adapters.test.ts",
+ "span": "L1-L216",
"signature": null,
"exported": true,
"origin": "ast",
- "body_hash": "192a59b16da8327457de6723893fd9207dd9570a35cd664f96534a7b85e73e01",
- "chars": 14262,
+ "body_hash": "53081583f9a2ef8a7f925fcce6554201fb8a10184ac835f3879cb3f04700f346",
+ "chars": 8829,
"summary_state": "ready",
- "summary": "This file implements a force-directed graph visualization using D3.js, allowing interactive exploration of nodes and edges.",
+ "summary": "This file contains tests for network-free adapters that simulate interactions with OpenAI and Anthropic SDKs, ensuring correct request handling and response formatting.",
"crux": {
- "code": " setData(graph: VizGraph, tab: \"context\" | \"code\"): void {\n this.tab = tab;\n const prev = new Map(this.nodes.map((n) => [n.id, n]));\n const deg: Record<string, number> = {};\n for (const e of graph.edges) {\n deg[e.source] = (deg[e.source] ?? 0) + 1;\n deg[e.target] = (deg[e.target] ?? 0) + 1;\n }\n const W = this.svg.clientWidth || 800;\n const H = this.svg.clientHeight || 600;\n this.nodes = graph.nodes.map((n, i) => {\n const p = prev.get(n.id);",
- "span": "L94-L105"
+ "code": "test(\"openai: plain text — system/user map to strings, usage is uncached-only\", async () => {\n const { client, box } = fakeOpenAI(openAiResp());\n const m = new OpenAIChatModel({ apiKey: \"x\", model: \"gpt-x\", client });\n const res = await m.create({\n messages: [\n { role: \"system\", content: \"sys\" },\n { role: \"user\", content: \"hi\" },\n ],\n temperature: 0,\n });\n assert.equal(box.params.model, \"gpt-x\");\n assert.equal(box.params.messages[0].content, \"sys\"); // plain string, no cache parts",
+ "span": "L33-L44"
}
},
{
- "id": "viewer/graph.ts#el",
- "name": "el",
+ "id": "test/llm-adapters.test.ts#anthropicResp",
+ "name": "anthropicResp",
"kind": "function",
- "path": "viewer/graph.ts",
- "span": "L42-L46",
- "signature": "function el<K extends keyof SVGElementTagNameMap>(tag: K, attrs: Record<string, string | number>): SVGElementTagNameMap[K]",
+ "path": "test/llm-adapters.test.ts",
+ "span": "L127-L134",
+ "signature": "function anthropicResp(over: Partial<any> = {}): any",
"exported": false,
"origin": "ast",
- "body_hash": "de7f696c06af5d771e8e661f398d9d275ca2cc06d86f4e91458d671480e346b7",
+ "body_hash": "510e5ddfab3f4b864398e600e0a6a9e786c164cb2ca583e48fa5eb617305e366",
"summary_state": "ready",
- "summary": "Creates and returns an SVG element with specified attributes, facilitating dynamic SVG generation.",
- "crux": null
+ "summary": "Generates a mock response structure for Anthropic API calls, aiding in the testing of response processing.",
+ "crux": {
+ "code": " content: [{ type: \"text\", text: \"hi there\" }],\n stop_reason: \"end_turn\",\n usage: { input_tokens: 70, output_tokens: 20, cache_read_input_tokens: 30, cache_creation_input_tokens: 5 },\n ...over,",
+ "span": "L129-L132"
+ }
},
{
- "id": "viewer/graph.ts#GraphView",
- "name": "GraphView",
- "kind": "class",
- "path": "viewer/graph.ts",
- "span": "L48-L334",
- "signature": "class GraphView",
- "exported": true,
+ "id": "test/llm-adapters.test.ts#fakeAnthropic",
+ "name": "fakeAnthropic",
+ "kind": "function",
+ "path": "test/llm-adapters.test.ts",
+ "span": "L119-L125",
+ "signature": "function fakeAnthropic(resp: unknown)",
+ "exported": false,
"origin": "ast",
- "body_hash": "1405c1f292294538c45794740adf01c59c83d3fd7047b6efa8c04c90a4409310",
+ "body_hash": "389c2181f2f3596989f46febc959ccdb5daf6c8faf71d739e0e6341c49faa323",
"summary_state": "ready",
- "summary": "Manages the rendering and interaction of the graph view, including node and edge updates.",
+ "summary": "Creates a mock Anthropic client for testing purposes, enabling verification of the parameters it receives.",
"crux": {
- "code": " setData(graph: VizGraph, tab: \"context\" | \"code\"): void {\n this.tab = tab;\n const prev = new Map(this.nodes.map((n) => [n.id, n]));\n const deg: Record<string, number> = {};\n for (const e of graph.edges) {\n deg[e.source] = (deg[e.source] ?? 0) + 1;\n deg[e.target] = (deg[e.target] ?? 0) + 1;\n }\n const W = this.svg.clientWidth || 800;\n const H = this.svg.clientHeight || 600;\n this.nodes = graph.nodes.map((n, i) => {\n const p = prev.get(n.id);",
- "span": "L94-L105"
+ "code": " messages: { create: async (params: any) => ((box.params = params), resp) },\n } as unknown as Anthropic;",
+ "span": "L122-L123"
}
},
{
- "id": "viewer/graph.ts#GraphView.applyView",
- "name": "applyView",
- "kind": "method",
- "path": "viewer/graph.ts",
- "span": "L268-L270",
- "signature": "private applyView(): void",
- "exported": true,
+ "id": "test/llm-adapters.test.ts#fakeOpenAI",
+ "name": "fakeOpenAI",
+ "kind": "function",
+ "path": "test/llm-adapters.test.ts",
+ "span": "L17-L23",
+ "signature": "function fakeOpenAI(resp: unknown)",
+ "exported": false,
"origin": "ast",
- "body_hash": "2adb54996d6ef9272cd69144b4b6c4bb92236506a3f5bf2d589faffd5218554b",
+ "body_hash": "1df77ef154b74d8a146666026f8598c84891a3fad31a785932884d867b7348a8",
"summary_state": "ready",
- "summary": "Applies the current view transformation to the graph, adjusting the viewport accordingly.",
+ "summary": "Creates a mock OpenAI client for testing purposes, allowing assertions on the parameters sent to it.",
"crux": {
- "code": " private applyView(): void {\n this.viewport.setAttribute(\"transform\", `translate(${this.view.x},${this.view.y}) scale(${this.view.k})`);\n }",
- "span": "L268-L270"
+ "code": " chat: { completions: { create: async (params: any) => ((box.params = params), resp) } },\n } as unknown as OpenAI;",
+ "span": "L20-L21"
}
},
{
- "id": "viewer/graph.ts#GraphView.bindDrag",
- "name": "bindDrag",
- "kind": "method",
- "path": "viewer/graph.ts",
- "span": "L290-L309",
- "signature": "private bindDrag(group: SVGGElement, node: SimNode): void",
- "exported": true,
+ "id": "test/llm-adapters.test.ts#openAiResp",
+ "name": "openAiResp",
+ "kind": "function",
+ "path": "test/llm-adapters.test.ts",
+ "span": "L25-L31",
+ "signature": "function openAiResp(over: Partial<any> = {}): any",
+ "exported": false,
"origin": "ast",
- "body_hash": "00e851d11e1029516256411b627b60e78d781cdc62ada046a0eb93c55c2dd009",
+ "body_hash": "97c63c00348e9d80c2ddccf50e21e28de7379123cdc570757b21857c67364268",
"summary_state": "ready",
- "summary": "Enables dragging functionality for nodes, allowing users to reposition them interactively.",
+ "summary": "Generates a mock response structure for OpenAI API calls, facilitating the testing of response handling.",
"crux": {
- "code": " private bindDrag(group: SVGGElement, node: SimNode): void {\n group.addEventListener(\"pointerdown\", (ev) => {\n ev.stopPropagation();\n group.setPointerCapture(ev.pointerId);\n const move = (mv: PointerEvent) => {\n const rect = this.svg.getBoundingClientRect();\n node.fx = (mv.clientX - rect.left - this.view.x) / this.view.k;\n node.fy = (mv.clientY - rect.top - this.view.y) / this.view.k;\n this.sim?.alphaTarget(0.25).restart();\n };\n const up = () => {\n node.fx = null; node.fy = null;",
- "span": "L290-L301"
+ "code": " choices: [{ message: { content: \"hello\", tool_calls: [] }, finish_reason: \"stop\" }],\n usage: { prompt_tokens: 100, completion_tokens: 20, prompt_tokens_details: { cached_tokens: 30 } },\n ...over,\n };",
+ "span": "L27-L30"
}
},
{
- "id": "viewer/graph.ts#GraphView.bindDrag.move",
- "name": "move",
- "kind": "function",
- "path": "viewer/graph.ts",
- "span": "L294-L299",
- "signature": "move = (mv: PointerEvent)",
+ "id": "test/llm-ops.test.ts",
+ "name": "llm-ops.test.ts",
+ "kind": "file",
+ "path": "test/llm-ops.test.ts",
+ "span": "L1-L82",
+ "signature": null,
"exported": true,
"origin": "ast",
- "body_hash": "656f371efff6a0eed7868895a4044e4fdf1dc88840de21376c388ba03149fbd0",
+ "body_hash": "ef3ba575506602feeb3048a6bded8bd2a92e9a59054c569352e82d1a847b80af",
+ "chars": 3303,
"summary_state": "ready",
- "summary": "Handles the movement of a node during drag events, updating its fixed position.",
+ "summary": "Tests the behavior of three engine operations (summarize, synthesize, crux) using a fake transport to ensure they build the correct requests and handle responses appropriately.",
"crux": {
- "code": " const move = (mv: PointerEvent) => {\n const rect = this.svg.getBoundingClientRect();\n node.fx = (mv.clientX - rect.left - this.view.x) / this.view.k;\n node.fy = (mv.clientY - rect.top - this.view.y) / this.view.k;\n this.sim?.alphaTarget(0.25).restart();\n };",
- "span": "L294-L299"
+ "code": "test(\"ChatSummarizer sends plain text and returns trimmed content\", async () => {\n const m = new FakeChatModel({ text: \" a prose summary \" });\n const out = await new ChatSummarizer(m).summarize(\"code\", { path: \"a.ts\" });\n assert.equal(out, \"a prose summary\");\n assert.equal(m.last?.responseFormat, undefined); // plain text\n assert.equal(m.last?.messages[0].role, \"system\");\n});\n\ntest(\"ChatSynthesizer forces record_graph and cleans parsed args\", async () => {\n const m = new FakeChatModel({\n toolCalls: [\n {",
+ "span": "L31-L42"
}
},
{
- "id": "viewer/graph.ts#GraphView.bindDrag.up",
- "name": "up",
- "kind": "function",
- "path": "viewer/graph.ts",
- "span": "L300-L305",
- "signature": "up = ()",
- "exported": true,
+ "id": "test/llm-ops.test.ts#FakeChatModel",
+ "name": "FakeChatModel",
+ "kind": "class",
+ "path": "test/llm-ops.test.ts",
+ "span": "L15-L29",
+ "signature": "class FakeChatModel implements ChatModel",
+ "exported": false,
"origin": "ast",
- "body_hash": "a935b15e42eefdf45da528afe3172b559d3e9ee97fe4be67f682dedccaac64c2",
+ "body_hash": "eda253622c2c5165804dbff88e4833ec0cfd0f45f9326916108aae84f2932905",
"summary_state": "ready",
- "summary": "Finalizes the drag operation by releasing the node's fixed position.",
+ "summary": "Simulates a chat model to test the behavior of chat operations without network dependency.",
"crux": {
- "code": " const up = () => {\n node.fx = null; node.fy = null;\n this.sim?.alphaTarget(0);\n group.removeEventListener(\"pointermove\", move);\n group.removeEventListener(\"pointerup\", up);\n };",
- "span": "L300-L305"
+ "code": " this.last = req;\n return {\n text: this.reply.text ?? \"\",\n toolCalls: this.reply.toolCalls ?? [],\n usage: { input: 0, output: 0, cacheRead: 0, cacheCreate: 0 },\n stopReason: \"stop\",\n assistant: { role: \"assistant\", content: this.reply.text ?? \"\" },\n };",
+ "span": "L20-L27"
}
},
{
- "id": "viewer/graph.ts#GraphView.bindPanZoom",
- "name": "bindPanZoom",
+ "id": "test/llm-ops.test.ts#FakeChatModel.constructor",
+ "name": "constructor",
"kind": "method",
- "path": "viewer/graph.ts",
- "span": "L311-L333",
- "signature": "private bindPanZoom(): void",
- "exported": true,
+ "path": "test/llm-ops.test.ts",
+ "span": "L18-L18",
+ "signature": "constructor(private reply: { text?: string; toolCalls?: ToolCall[] })",
+ "exported": false,
"origin": "ast",
- "body_hash": "737e5f69bc32913d3b061a4a878b61245d242e217f451a81d72d21e1d28fae30",
+ "body_hash": "edce87b8798c8e867446b2b7970f4c97f1f8eba762255e690daea9453d10e630",
"summary_state": "ready",
- "summary": "Sets up event listeners for panning and zooming the graph view based on user interactions.",
- "crux": {
- "code": " private bindPanZoom(): void {\n let panStart: { x: number; y: number } | null = null;\n this.svg.addEventListener(\"pointerdown\", (ev) => {\n panStart = { x: ev.clientX - this.view.x, y: ev.clientY - this.view.y };\n });\n this.svg.addEventListener(\"pointermove\", (ev) => {\n if (!panStart) return;\n this.view.x = ev.clientX - panStart.x;\n this.view.y = ev.clientY - panStart.y;\n this.applyView();\n });\n window.addEventListener(\"pointerup\", () => { panStart = null; });",
- "span": "L311-L322"
- }
+ "summary": "Initializes the fake chat model with a predefined reply for testing purposes.",
+ "crux": null
},
{
- "id": "viewer/graph.ts#GraphView.buildChrome",
- "name": "buildChrome",
+ "id": "test/llm-ops.test.ts#FakeChatModel.create",
+ "name": "create",
"kind": "method",
- "path": "viewer/graph.ts",
- "span": "L71-L78",
- "signature": "private buildChrome(): void",
- "exported": true,
+ "path": "test/llm-ops.test.ts",
+ "span": "L19-L28",
+ "signature": "async create(req: ChatRequest): Promise<ChatResponse>",
+ "exported": false,
"origin": "ast",
- "body_hash": "592cef68d76f99ad8da470cc3c8b4eda64701c02b8740a21e659fdd5e5325def",
+ "body_hash": "e90179ccabec3472e4184b3a1147383e87c3de3f42b8757304dbb33b36547488",
"summary_state": "ready",
- "summary": "Sets up the initial SVG structure for the graph, including definitions and viewport.",
+ "summary": "Processes a chat request and returns a simulated chat response based on predefined data.",
"crux": {
- "code": " this.svg.textContent = \"\";\n this.defs = el(\"defs\", {});\n this.svg.appendChild(this.defs);\n this.viewport = el(\"g\", {});\n this.svg.appendChild(this.viewport);\n this.svg.addEventListener(\"click\", () => this.select(null));\n }",
- "span": "L72-L78"
+ "code": " this.last = req;\n return {\n text: this.reply.text ?? \"\",\n toolCalls: this.reply.toolCalls ?? [],\n usage: { input: 0, output: 0, cacheRead: 0, cacheCreate: 0 },\n stopReason: \"stop\",\n assistant: { role: \"assistant\", content: this.reply.text ?? \"\" },\n };",
+ "span": "L20-L27"
}
},
{
- "id": "viewer/graph.ts#GraphView.buildElements",
- "name": "buildElements",
- "kind": "method",
- "path": "viewer/graph.ts",
- "span": "L138-L164",
- "signature": "private buildElements(): void",
+ "id": "test/mcp-server.test.ts",
+ "name": "mcp-server.test.ts",
+ "kind": "file",
+ "path": "test/mcp-server.test.ts",
+ "span": "L1-L66",
+ "signature": null,
"exported": true,
"origin": "ast",
- "body_hash": "a608a77fab16447bd9ef9c465a192abc0cb7167807f7c1718d961d730d7f055d",
- "summary_state": "ready",
- "summary": "Constructs the SVG elements for nodes and edges based on the current dataset.",
+ "body_hash": "5eacb67182a2925edec5bd036ae556018ed3b2c266d65aaefa0d4d1ff0a3fee6",
+ "chars": 2564,
+ "summary_state": "stale",
+ "summary": "This file contains tests for the RPC functionality of the MCP server, ensuring that various methods return expected results and handle errors correctly.",
"crux": {
- "code": " private buildElements(): void {\n this.ensureMarkers();\n this.viewport.textContent = \"\";\n this.edgeEls = this.edges.map((edge) => {\n const path = el(\"path\", { fill: \"none\", \"stroke-linecap\": \"round\" });\n const title = el(\"title\", {});\n title.textContent = edge.relation.replace(/_/g, \" \") + (edge.description ? ` — ${edge.description}` : \"\");\n path.appendChild(title);\n const label = el(\"text\", { \"text-anchor\": \"middle\", \"font-size\": 9.5, \"font-weight\": 700, \"stroke-width\": 3, \"paint-order\": \"stroke\", display: \"none\" });\n label.textContent = edge.relation.replace(/_/g, \" \");\n this.viewport.appendChild(path);\n this.viewport.appendChild(label);",
- "span": "L138-L149"
+ "code": "test('initialize → tools/list → tools/call round-trip', async () => {\n const dir = mkdtempSync(join(tmpdir(), 'graft-mcpsrv-'));\n const rs = await rpc(\n [\n { jsonrpc: '2.0', id: 1, method: 'initialize', params: { protocolVersion: '2025-03-26', capabilities: {}, clientInfo: { name: 't', version: '0' } } },\n { jsonrpc: '2.0', method: 'notifications/initialized' },\n { jsonrpc: '2.0', id: 2, method: 'tools/list' },\n { jsonrpc: '2.0', id: 3, method: 'tools/call', params: { name: 'graft_blast_radius', arguments: { file: 'x.ts' } } },\n ],\n dir,\n 3,\n );",
+ "span": "L30-L41"
}
},
{
- "id": "viewer/graph.ts#GraphView.constructor",
- "name": "constructor",
- "kind": "method",
- "path": "viewer/graph.ts",
- "span": "L65-L69",
- "signature": "constructor(svg: SVGSVGElement)",
- "exported": true,
+ "id": "test/mcp-server.test.ts#rpc",
+ "name": "rpc",
+ "kind": "function",
+ "path": "test/mcp-server.test.ts",
+ "span": "L9-L28",
+ "signature": "async function rpc(messages: object[], dir: string, expected: number): Promise<any[]>",
+ "exported": false,
"origin": "ast",
- "body_hash": "27abb788d7de0ece37719a0a23d4fed7778c02dda10700bbfb4f110ea8c16984",
+ "body_hash": "a83e1cfe6b7af8f6c87c6c9756d4ca8d61c0122c956f24b5b80a2249b2e950b1",
"summary_state": "ready",
- "summary": "Initializes the GraphView instance and sets up the SVG environment for rendering.",
- "crux": null
+ "summary": "The rpc function facilitates communication with the MCP server by sending messages and collecting responses, handling asynchronous interactions effectively.",
+ "crux": {
+ "code": " for (const m of messages) child.stdin.write(`${JSON.stringify(m)}\\n`);\n const deadline = Date.now() + 15000;\n while (responses.length < expected && Date.now() < deadline) await new Promise((r) => setTimeout(r, 50));\n child.kill();\n await once(child, 'exit').catch(() => {});\n return responses;",
+ "span": "L22-L27"
+ }
},
{
- "id": "viewer/graph.ts#GraphView.ensureMarkers",
- "name": "ensureMarkers",
- "kind": "method",
- "path": "viewer/graph.ts",
- "span": "L80-L91",
- "signature": "private ensureMarkers(): void",
+ "id": "test/mcp-tools.test.ts",
+ "name": "mcp-tools.test.ts",
+ "kind": "file",
+ "path": "test/mcp-tools.test.ts",
+ "span": "L1-L301",
+ "signature": null,
"exported": true,
"origin": "ast",
- "body_hash": "9517cfdb2ccb4ce235405356f6ff9b2fb3fcd2f7d687689bde33cf5df9bd6906",
- "summary_state": "ready",
- "summary": "Ensures that the necessary SVG markers for edges are created and available for rendering.",
+ "body_hash": "2241812ee605797530ebbbd0e646833ba632460cd2ce3a0b80d44cd53f6ef844",
+ "chars": 13284,
+ "summary_state": "stale",
+ "summary": "This test suite validates the functionality of various tools in the MCP codebase, ensuring they operate correctly on built repositories and handle errors appropriately.",
"crux": {
- "code": " this.defs.textContent = \"\";\n const chevron = el(\"marker\", { id: \"arr\", viewBox: \"0 0 10 10\", refX: 8, refY: 5, markerWidth: 4.5, markerHeight: 4.5, orient: \"auto-start-reverse\" });\n chevron.appendChild(el(\"path\", { d: \"M2,1.5L8.5,5L2,8.5\", fill: \"none\", stroke: cvar(\"--edge\"), \"stroke-width\": 1.8, \"stroke-linecap\": \"round\", \"stroke-linejoin\": \"round\", opacity: 0.75 }));\n const hollow = el(\"marker\", { id: \"arrH\", viewBox: \"0 0 12 12\", refX: 10, refY: 6, markerWidth: 6.5, markerHeight: 6.5, orient: \"auto-start-reverse\" });\n hollow.appendChild(el(\"path\", { d: \"M1.5,1.5L10.5,6L1.5,10.5z\", fill: cvar(\"--canvas\"), stroke: cvar(\"--edge\"), \"stroke-width\": 1.4 }));\n const out = el(\"marker\", { id: \"arrOut\", viewBox: \"0 0 10 10\", refX: 8, refY: 5, markerWidth: 5, markerHeight: 5, orient: \"auto-start-reverse\" });\n out.appendChild(el(\"path\", { d: \"M1,1L9,5L1,9z\", fill: cvar(\"--fil\") }));\n const inn = el(\"marker\", { id: \"arrIn\", viewBox: \"0 0 10 10\", refX: 8, refY: 5, markerWidth: 5, markerHeight: 5, orient: \"auto-start-reverse\" });\n inn.appendChild(el(\"path\", { d: \"M1,1L9,5L1,9z\", fill: cvar(\"--accent\") }));\n for (const m of [chevron, hollow, out, inn]) this.defs.appendChild(m);",
- "span": "L81-L90"
+ "code": "test('TOOLS lists all eight tools with schemas', () => {\n assert.deepEqual(TOOLS.map((t) => t.name), [\n 'graft_ask',\n 'graft_skeleton',\n 'graft_check',\n 'graft_blast_radius',\n 'graft_callers',\n 'graft_callees',\n 'graft_grep',\n 'graft_map',\n ]);\n for (const t of TOOLS) {",
+ "span": "L75-L86"
}
},
{
- "id": "viewer/graph.ts#GraphView.firstMatch",
- "name": "firstMatch",
- "kind": "method",
- "path": "viewer/graph.ts",
- "span": "L263-L266",
- "signature": "firstMatch(): SimNode | undefined",
- "exported": true,
+ "id": "test/mcp-tools.test.ts#builtRepo",
+ "name": "builtRepo",
+ "kind": "function",
+ "path": "test/mcp-tools.test.ts",
+ "span": "L9-L16",
+ "signature": "function builtRepo(): string",
+ "exported": false,
"origin": "ast",
- "body_hash": "d43343323ad49732d473f46773ac41a0ee7472f6289d324eb369d739e8cb0352",
+ "body_hash": "2e8d1ef9e31662a9e1a2e64630378d64979be157310df30d3e97900015426178",
"summary_state": "ready",
- "summary": "Finds the first node that matches the current query, facilitating search functionality.",
+ "summary": "Creates a temporary repository structure for testing the tools with a basic math implementation.",
"crux": {
- "code": " firstMatch(): SimNode | undefined {\n const q = this.query.toLowerCase();\n return this.nodes.find((n) => !this.hiddenTypes[n.type] && n.name.toLowerCase().includes(q));\n }",
- "span": "L263-L266"
+ "code": " const d = mkdtempSync(join(tmpdir(), 'graft-mcptools-'));\n mkdirSync(join(d, 'src'), { recursive: true });\n writeFileSync(join(d, 'src', 'math.ts'),\n 'export function add(a: number, b: number): number {\\n return a + b;\\n}\\nexport function sub(a: number, b: number): number {\\n return add(a, -b);\\n}\\n');\n execFileSync(process.execPath, ['--import', 'tsx', 'src/cli.ts', 'build', d], { stdio: 'pipe' });",
+ "span": "L10-L14"
}
},
{
- "id": "viewer/graph.ts#GraphView.focus",
- "name": "focus",
- "kind": "method",
- "path": "viewer/graph.ts",
- "span": "L252-L261",
- "signature": "focus(id: string): void",
- "exported": true,
+ "id": "test/mcp-tools.test.ts#chainRepo",
+ "name": "chainRepo",
+ "kind": "function",
+ "path": "test/mcp-tools.test.ts",
+ "span": "L22-L33",
+ "signature": "function chainRepo(): string",
+ "exported": false,
"origin": "ast",
- "body_hash": "a64691876d1786ccdb2027028d00210b8cb56557c65c1afa81a886b506d7b459",
+ "body_hash": "15d62ff8440102dce21a2647a706a4307c540acecc930810e29307b72defe3b6",
"summary_state": "ready",
- "summary": "Centers the view on a specified node, enhancing its visibility and selection.",
+ "summary": "Sets up a repository with a three-deep function call structure to test depth-related functionality in tools.",
"crux": {
- "code": " focus(id: string): void {\n const node = this.nodes.find((n) => n.id === id);\n if (!node) return;\n const W = this.svg.clientWidth, H = this.svg.clientHeight;\n this.view.k = Math.max(this.view.k, 1.4);\n this.view.x = W / 2 - (node.x ?? 0) * this.view.k;\n this.view.y = H / 2 - (node.y ?? 0) * this.view.k;\n this.applyView();\n this.select(id);\n }",
- "span": "L252-L261"
+ "code": " 'export function compute(a: number, b: number): number {\\n return sub(a, b);\\n}\\n',",
+ "span": "L29-L29"
}
},
{
- "id": "viewer/graph.ts#GraphView.reheat",
- "name": "reheat",
- "kind": "method",
- "path": "viewer/graph.ts",
- "span": "L286-L288",
- "signature": "reheat(): void",
- "exported": true,
+ "id": "test/mcp-tools.test.ts#customDirRepo",
+ "name": "customDirRepo",
+ "kind": "function",
+ "path": "test/mcp-tools.test.ts",
+ "span": "L37-L45",
+ "signature": "function customDirRepo(): { repo: string; graphDir: string }",
+ "exported": false,
"origin": "ast",
- "body_hash": "ca57d7cb11e71985bcd27b937b4f6d0a62428a0ae84f5a297cb1147861032a59",
+ "body_hash": "def8983a39f4cc761bf0d89b5f58bb41eff230621ebb4894b7f9007c75af1227",
"summary_state": "ready",
- "summary": "Restarts the simulation with increased alpha, making the graph more dynamic.",
+ "summary": "Establishes a repository in a custom directory to validate the handling of non-default graph locations.",
"crux": {
- "code": " reheat(): void {\n this.sim?.alpha(0.6).restart();\n }",
- "span": "L286-L288"
+ "code": " execFileSync(process.execPath, ['--import', 'tsx', 'src/cli.ts', 'build', d, '--dir', graphDir], { stdio: 'pipe' });",
+ "span": "L43-L43"
}
},
{
- "id": "viewer/graph.ts#GraphView.resetView",
- "name": "resetView",
- "kind": "method",
- "path": "viewer/graph.ts",
- "span": "L281-L284",
- "signature": "resetView(): void",
- "exported": true,
+ "id": "test/mcp-tools.test.ts#fileScopeRepo",
+ "name": "fileScopeRepo",
+ "kind": "function",
+ "path": "test/mcp-tools.test.ts",
+ "span": "L50-L60",
+ "signature": "function fileScopeRepo(): string",
+ "exported": false,
"origin": "ast",
- "body_hash": "ae1f1ee82c804ff145b1f4aa9de70cad49a5287735aa9825f6accbe21591794c",
+ "body_hash": "c3e730fb2a68c37167f29ebcf6a14eab2650fde246b3b2fd611cf96b58c55cbd",
"summary_state": "ready",
- "summary": "Resets the graph view to its initial state, centering and scaling the view.",
+ "summary": "Creates a repository to test the interaction between file imports and function calls across files.",
"crux": {
- "code": " resetView(): void {\n this.view = { x: 0, y: 0, k: 1 };\n this.applyView();\n }",
- "span": "L281-L284"
+ "code": " writeFileSync(join(d, 'src', 'a.ts'), 'export function helper(): number {\\n return 42;\\n}\\n');\n writeFileSync(\n join(d, 'src', 'b.ts'),",
+ "span": "L53-L55"
}
},
{
- "id": "viewer/graph.ts#GraphView.restyle",
- "name": "restyle",
- "kind": "method",
- "path": "viewer/graph.ts",
- "span": "L185-L243",
- "signature": "restyle(): void",
- "exported": true,
+ "id": "test/mcp-tools.test.ts#multiDirRepo",
+ "name": "multiDirRepo",
+ "kind": "function",
+ "path": "test/mcp-tools.test.ts",
+ "span": "L65-L73",
+ "signature": "function multiDirRepo(): string",
+ "exported": false,
"origin": "ast",
- "body_hash": "a928dd40f55ad9a091ba969afdf370f2a265bf30fb94efdc6879fcc0fb01edda",
+ "body_hash": "1ba610952a7f039e9715046c0e81e62fb5a0fcb2bb3d62e5435321252679a0bf",
"summary_state": "ready",
- "summary": "Applies styles to nodes and edges based on their visibility and selection state.",
+ "summary": "Generates a repository with multiple directories to test the handling of directory limits in tool operations.",
"crux": {
- "code": " restyle(): void {\n this.ensureMarkers();\n const neighbors = new Set<string>();\n if (this.selected) {\n for (const e of this.edges) {\n if (e.source.id === this.selected) neighbors.add(e.target.id);\n if (e.target.id === this.selected) neighbors.add(e.source.id);\n }\n }\n const q = this.query.toLowerCase();\n const nodeShown = (n: SimNode) => !this.hiddenTypes[n.type];\n",
- "span": "L185-L196"
+ "code": " writeFileSync(join(d, dir, 'x.ts'), `export function ${dir}Fn(): number {\\n return 1;\\n}\\n`);\n }",
+ "span": "L69-L70"
}
},
{
- "id": "viewer/graph.ts#GraphView.restyle.nodeShown",
- "name": "nodeShown",
- "kind": "function",
- "path": "viewer/graph.ts",
- "span": "L195-L195",
- "signature": "nodeShown = (n: SimNode)",
+ "id": "test/regression-single-repo.test.ts",
+ "name": "regression-single-repo.test.ts",
+ "kind": "file",
+ "path": "test/regression-single-repo.test.ts",
+ "span": "L1-L135",
+ "signature": null,
"exported": true,
"origin": "ast",
- "body_hash": "a598aac16da1955aecc62f39590f30d0c7e780d99429b1657c1bbba7d157ddea",
- "summary_state": "ready",
- "summary": "Determines if a node should be displayed based on its type and visibility settings.",
+ "body_hash": "ae90cd4d99fa1372c2ba2457870bd77d08b4be2a3160112dfbc70edd80180aa7",
+ "chars": 6251,
+ "summary_state": "pending",
+ "summary": null,
"crux": null
},
{
- "id": "viewer/graph.ts#GraphView.select",
- "name": "select",
- "kind": "method",
- "path": "viewer/graph.ts",
- "span": "L245-L249",
- "signature": "select(id: string | null): void",
- "exported": true,
+ "id": "test/regression-single-repo.test.ts#assertScopeFreeText",
+ "name": "assertScopeFreeText",
+ "kind": "function",
+ "path": "test/regression-single-repo.test.ts",
+ "span": "L71-L77",
+ "signature": "function assertScopeFreeText(label: string, text: string)",
+ "exported": false,
"origin": "ast",
- "body_hash": "7ba52874ad2ddda2bc80c3442e011c9d2b464fb8851a3ba527d3dba8ac6061c2",
- "summary_state": "ready",
- "summary": "Selects a node in the graph and updates the visual representation accordingly.",
- "crux": {
- "code": " select(id: string | null): void {\n this.selected = id;\n this.restyle();\n this.onSelect(id);\n }",
- "span": "L245-L249"
- }
+ "body_hash": "eb7b6ad610aea83818cdbcb4b77efc92e0a00a667cd4249421e726ca9a6b106a",
+ "summary_state": "pending",
+ "summary": null,
+ "crux": null
},
{
- "id": "viewer/graph.ts#GraphView.setData",
- "name": "setData",
- "kind": "method",
- "path": "viewer/graph.ts",
- "span": "L94-L136",
- "signature": "setData(graph: VizGraph, tab: \"context\" | \"code\"): void",
+ "id": "test/regression-single-repo.test.ts#fx",
+ "name": "fx",
+ "kind": "function",
+ "path": "test/regression-single-repo.test.ts",
+ "span": "L27-L34",
+ "signature": "function fx(layout: Record<string, string>): string",
+ "exported": false,
+ "origin": "ast",
+ "body_hash": "03a58872524b4c478d0693b013a9a3f7abd7c43553e26586678471cec16ddda6",
+ "summary_state": "pending",
+ "summary": null,
+ "crux": null
+ },
+ {
+ "id": "test/search-grep.test.ts",
+ "name": "search-grep.test.ts",
+ "kind": "file",
+ "path": "test/search-grep.test.ts",
+ "span": "L1-L244",
+ "signature": null,
"exported": true,
"origin": "ast",
- "body_hash": "d8063d2226148959298ca10074e09f00b7530c0b6a87f023502c4bd1c02041a6",
+ "body_hash": "a23b17c1a455374c4b4172834c51bb6c5e5ed5abbc891df16ee7cb4aeae9b5c0",
+ "chars": 9704,
"summary_state": "ready",
- "summary": "Loads a new dataset into the graph, updating node positions and relationships accordingly.",
+ "summary": "Contains core tests for the `graft grep` functionality, ensuring accurate symbol attribution and search results in a parsed graph.",
"crux": {
- "code": " setData(graph: VizGraph, tab: \"context\" | \"code\"): void {\n this.tab = tab;\n const prev = new Map(this.nodes.map((n) => [n.id, n]));\n const deg: Record<string, number> = {};\n for (const e of graph.edges) {\n deg[e.source] = (deg[e.source] ?? 0) + 1;\n deg[e.target] = (deg[e.target] ?? 0) + 1;\n }\n const W = this.svg.clientWidth || 800;\n const H = this.svg.clientHeight || 600;\n this.nodes = graph.nodes.map((n, i) => {\n const p = prev.get(n.id);",
- "span": "L94-L105"
+ "code": "test('WALK_RELATIONS (shared, src/graph/relations.ts): exactly the five dependency relations', () => {\n assert.deepEqual(\n [...WALK_RELATIONS].sort(),\n ['calls', 'extends', 'implements', 'imports', 'references'].sort(),\n );\n // Excluded on purpose: contains is structural (file->symbol), not dependency wiring.\n assert.equal(WALK_RELATIONS.has('contains' as never), false);\n});\n\ntest('grepGraph: groups are ordered by inDegree desc, then path asc', () => {\n const repo = needleRepo();\n const graph = loadBuiltGraph(repo);",
+ "span": "L93-L104"
}
},
{
- "id": "viewer/graph.ts#GraphView.tick",
- "name": "tick",
- "kind": "method",
- "path": "viewer/graph.ts",
- "span": "L166-L182",
- "signature": "private tick(): void",
- "exported": true,
+ "id": "test/search-grep.test.ts#fileNode",
+ "name": "fileNode",
+ "kind": "function",
+ "path": "test/search-grep.test.ts",
+ "span": "L24-L39",
+ "signature": "function fileNode(path: string, lines: number): NodeV1",
+ "exported": false,
"origin": "ast",
- "body_hash": "0fbefdd43e29e9d5134e756074fe1fa190fa23cf6afaa72a52d27f098ac8e6bb",
+ "body_hash": "a97b45c7d03f4c753851a32b055aa77614f568140588edcbea2757291188a02e",
"summary_state": "ready",
- "summary": "Updates the positions of nodes and edges on each simulation tick, ensuring the graph remains interactive.",
+ "summary": "Creates a file node representation for a given path and number of lines, facilitating graph construction.",
"crux": {
- "code": " private tick(): void {\n for (const { path, label, edge } of this.edgeEls) {\n const a = edge.source, b = edge.target;\n const dx = (b.x ?? 0) - (a.x ?? 0), dy = (b.y ?? 0) - (a.y ?? 0);\n const d = Math.sqrt(dx * dx + dy * dy) || 1;\n const ux = dx / d, uy = dy / d;\n const sx = (a.x ?? 0) + ux * (a.r + 2), sy = (a.y ?? 0) + uy * (a.r + 2);\n const tx = (b.x ?? 0) - ux * (b.r + 6), ty = (b.y ?? 0) - uy * (b.r + 6);\n const mx = (sx + tx) / 2 - uy * 10, my = (sy + ty) / 2 + ux * 10;\n path.setAttribute(\"d\", `M${sx},${sy} Q${mx},${my} ${tx},${ty}`);\n label.setAttribute(\"x\", String((sx + tx) / 2 - uy * 14));\n label.setAttribute(\"y\", String((sy + ty) / 2 + ux * 14));",
- "span": "L166-L177"
+ "code": "function fileNode(path: string, lines: number): NodeV1 {\n return {\n id: path,\n name: path,\n kind: 'file',\n path,\n span: `L1-L${lines}`,\n signature: null,\n exported: true,\n origin: 'ast',\n body_hash: '',\n summary_state: 'pending',",
+ "span": "L24-L35"
}
},
{
- "id": "viewer/graph.ts#GraphView.zoomBy",
- "name": "zoomBy",
- "kind": "method",
- "path": "viewer/graph.ts",
- "span": "L272-L279",
- "signature": "zoomBy(factor: number): void",
- "exported": true,
+ "id": "test/search-grep.test.ts#graphOf",
+ "name": "graphOf",
+ "kind": "function",
+ "path": "test/search-grep.test.ts",
+ "span": "L41-L43",
+ "signature": "function graphOf(nodes: NodeV1[], edges: GraphV1['edges'] = []): GraphV1",
+ "exported": false,
"origin": "ast",
- "body_hash": "2dd28ba55cc461ab1f950d582e10b63c6862804f17d518ef346fe4e3f49af289",
+ "body_hash": "14ab0ac438fbede56f702c479b6f7fc1bc8d146c4b36242dab7d25fbcb8cf5c6",
"summary_state": "ready",
- "summary": "Adjusts the zoom level of the graph view based on user input, allowing for detailed exploration.",
+ "summary": "Constructs a graph representation from nodes and edges, encapsulating metadata about the graph structure.",
"crux": {
- "code": " zoomBy(factor: number): void {\n const W = this.svg.clientWidth / 2, H = this.svg.clientHeight / 2;\n const k = Math.max(0.35, Math.min(3, this.view.k * factor));\n this.view.x = W - (W - this.view.x) * (k / this.view.k);\n this.view.y = H - (H - this.view.y) * (k / this.view.k);\n this.view.k = k;\n this.applyView();\n }",
- "span": "L272-L279"
+ "code": "function graphOf(nodes: NodeV1[], edges: GraphV1['edges'] = []): GraphV1 {\n return { meta: { version: 1, nodeCount: nodes.length, edgeCount: edges.length, languages: [] }, nodes, edges };\n}",
+ "span": "L41-L43"
}
},
{
- "id": "viewer/graph.ts#SimEdge",
- "name": "SimEdge",
- "kind": "interface",
- "path": "viewer/graph.ts",
- "span": "L32-L38",
- "signature": "interface SimEdge",
+ "id": "test/search-grep.test.ts#loadBuiltGraph",
+ "name": "loadBuiltGraph",
+ "kind": "function",
+ "path": "test/search-grep.test.ts",
+ "span": "L87-L91",
+ "signature": "function loadBuiltGraph(repo: string): GraphV1",
"exported": false,
"origin": "ast",
- "body_hash": "06690141adf5c47ffc6dd6b55a3cf9f041a4750f0b512cf49d3596928485fca8",
+ "body_hash": "39d7dbe4e44d4a83bb1b4d13836e4b230a8c709a09e7ff116b77190a82eb16c1",
"summary_state": "ready",
- "summary": "Defines the structure of an edge in the simulation, representing the relationship between two nodes.",
- "crux": null
+ "summary": "Loads a built graph from a specified repository, ensuring the graph is correctly constructed for testing.",
+ "crux": {
+ "code": "function loadBuiltGraph(repo: string): GraphV1 {\n const g = readGraph(wiringPath(join(repo, 'graft')));\n assert.ok(g, 'expected a built graph.json');\n return g!;\n}",
+ "span": "L87-L91"
+ }
},
{
- "id": "viewer/graph.ts#SimNode",
- "name": "SimNode",
- "kind": "interface",
- "path": "viewer/graph.ts",
- "span": "L22-L30",
- "signature": "interface SimNode extends SimulationNodeDatum",
+ "id": "test/search-grep.test.ts#needleRepo",
+ "name": "needleRepo",
+ "kind": "function",
+ "path": "test/search-grep.test.ts",
+ "span": "L50-L85",
+ "signature": "function needleRepo(): string",
"exported": false,
"origin": "ast",
- "body_hash": "b000c5412e66a114ce7349ebddb8f536c040a6c6f158c641a8370ea049b6a69d",
+ "body_hash": "ddbfa733e3076db220939ab5efd2ec90a8250b54170f03bb9d23c28751467b01",
"summary_state": "ready",
- "summary": "Defines the structure of a node in the simulation, including its position and properties.",
- "crux": null
+ "summary": "Sets up a temporary repository with TypeScript files to test the grep functionality, simulating real-world usage scenarios.",
+ "crux": {
+ "code": "function needleRepo(): string {\n const d = mkdtempSync(join(tmpdir(), 'graft-grep-'));\n mkdirSync(join(d, 'src'), { recursive: true });\n writeFileSync(\n join(d, 'src', 'a.ts'),\n [\n 'export function heavilyCalled(): void {',\n ' console.log(\"NEEDLE hit in heavilyCalled\");',\n '}',\n '',\n 'export function rarelyCalled(): void {',\n ' console.log(\"NEEDLE hit in rarelyCalled\");',",
+ "span": "L50-L61"
+ }
},
{
- "id": "viewer/main.ts",
- "name": "main.ts",
+ "id": "test/viz-assemble.test.ts",
+ "name": "viz-assemble.test.ts",
"kind": "file",
- "path": "viewer/main.ts",
- "span": "L1-L233",
+ "path": "test/viz-assemble.test.ts",
+ "span": "L1-L106",
"signature": null,
"exported": true,
"origin": "ast",
- "body_hash": "ab45ce4dfe66aafbe779b71d49d6370b3fe64482307b994e857ce34d3f317325",
- "chars": 8654,
+ "body_hash": "89a2a9f11f459a8110f9d89b2de780dfd164504f3b4c7dc61953a6c83c5911cb",
+ "chars": 3118,
"summary_state": "ready",
- "summary": "This file serves as the entry point for the graft visualization viewer, managing the user interface and interactions for displaying graphs.",
+ "summary": "This file contains tests that validate the assembly of a context graph from markdown frontmatter, ensuring proper relation normalization and error handling for malformed files.",
"crux": {
- "code": "const view = new GraphView($(\"graphSvg\") as unknown as SVGSVGElement);",
- "span": "L21-L21"
+ "code": "test(\"assembleContextGraph builds nodes and edges from frontmatter\", () => {\n const dir = makeContextDir();\n try {\n const g = assembleContextGraph(dir);\n\n assert.equal(g.nodes.length, 2);\n assert.deepEqual(g.nodes.map((n) => n.id).sort(), [\"alpha\", \"beta\"]);\n\n const alpha = g.nodes.find((n) => n.id === \"alpha\")!;\n assert.equal(alpha.name, \"Alpha\");\n assert.equal(alpha.type, \"system\");\n assert.deepEqual(alpha.sources, [\"src/a.ts\"]);",
+ "span": "L62-L73"
}
},
{
- "id": "viewer/main.ts#$",
- "name": "$",
+ "id": "test/viz-assemble.test.ts#makeContextDir",
+ "name": "makeContextDir",
"kind": "function",
- "path": "viewer/main.ts",
- "span": "L12-L12",
- "signature": "$ = <T extends HTMLElement>(id: string): T",
+ "path": "test/viz-assemble.test.ts",
+ "span": "L12-L60",
+ "signature": "function makeContextDir(): string",
"exported": false,
"origin": "ast",
- "body_hash": "e46dd7aa9ed3186876ec11a8520b5af609af327108e045bce175d535aa9ed0e5",
+ "body_hash": "4fab7dd2dc5bc7c0b9d575f8396bdca67e8d2d5a9f337aa14ef7740dd87b2119",
"summary_state": "ready",
- "summary": "Provides a type-safe way to retrieve HTML elements by their ID, enhancing code readability and reducing errors.",
- "crux": null
+ "summary": "This function creates a temporary directory with markdown files to simulate context data for testing the graph assembly.",
+ "crux": {
+ "code": " const dir = mkdtempSync(join(tmpdir(), \"graftviz-\"));\n writeFileSync(\n join(dir, \"alpha.md\"),\n `---\nname: Alpha\nslug: alpha\ntype: system\nsources:\n - path: src/a.ts\n hash: abc123\nlinks:\n - to: beta",
+ "span": "L13-L24"
+ }
},
{
- "id": "viewer/main.ts#activeGraph",
- "name": "activeGraph",
- "kind": "function",
- "path": "viewer/main.ts",
- "span": "L23-L25",
- "signature": "function activeGraph(): VizGraph | null",
- "exported": false,
+ "id": "test/viz-serve.test.ts",
+ "name": "viz-serve.test.ts",
+ "kind": "file",
+ "path": "test/viz-serve.test.ts",
+ "span": "L1-L101",
+ "signature": null,
+ "exported": true,
"origin": "ast",
- "body_hash": "71591b2a66c0aa4d34f5b96cb2f1293248bdf02f55f6a73c2ee48258f6e2c445",
+ "body_hash": "d22168054844e83bc5257271c4cc80a6e3eb1315e600c03b48fe6b54afd5c243",
+ "chars": 4004,
"summary_state": "ready",
- "summary": "Determines which graph is currently active based on the selected tab, facilitating the correct data display.",
+ "summary": "This file contains tests for the viz server, ensuring it serves the correct endpoints and handles various scenarios like port fallback and context directory changes.",
"crux": {
- "code": " return state.tab === \"context\" ? state.context : state.code;",
- "span": "L24-L24"
+ "code": "test(\"viz server serves viewer, context graph, and gates code graph\", async () => {\n const { contextDir, viewerDir, root } = makeDirs();\n const srv = await startVizServer({ contextDir, viewerDir, port: 4831, repoName: \"fixture\" });\n try {\n const html = await fetch(`${srv.url}/`).then((r) => r.text());\n assert.match(html, /stub/);\n\n const graph = await fetch(`${srv.url}/api/context-graph`).then((r) => r.json());\n assert.equal(graph.meta.nodeCount, 1);\n assert.equal(graph.meta.repoName, \"fixture\");\n assert.equal(graph.nodes[0].id, \"alpha\");\n",
+ "span": "L29-L40"
}
},
{
- "id": "viewer/main.ts#glyphFor",
- "name": "glyphFor",
+ "id": "test/viz-serve.test.ts#makeDirs",
+ "name": "makeDirs",
"kind": "function",
- "path": "viewer/main.ts",
- "span": "L62-L71",
- "signature": "function glyphFor(key: string): string",
+ "path": "test/viz-serve.test.ts",
+ "span": "L13-L27",
+ "signature": "function makeDirs(): { contextDir: string; viewerDir: string; root: string }",
"exported": false,
"origin": "ast",
- "body_hash": "bd36f5f7c09e4d09ac342de7015c4cbda2ec86e36ab0c22716dd37b006444581",
+ "body_hash": "cff2ec95e868528eec2623a2907ab4c4e3e4a55224d0551b1fb8a63e8bbc124d",
"summary_state": "ready",
- "summary": "Maps edge types to their corresponding visual glyphs, enhancing the graphical representation of relationships.",
+ "summary": "This function creates necessary directory structures and files for testing the viz server.",
"crux": {
- "code": " const fam = key === \"part of\" ? \"structure\" : key === \"uses\" ? \"dependency\" : famOf(key.replace(/ /g, \"_\"));\n const glyphs: Record<string, string> = {\n structure: '<svg width=\"20\" height=\"8\" aria-hidden=\"true\"><line x1=\"1\" y1=\"4\" x2=\"19\" y2=\"4\" stroke=\"currentColor\" stroke-width=\"3\" opacity=\".5\"/></svg>',\n dependency: '<svg width=\"20\" height=\"8\" aria-hidden=\"true\"><line x1=\"1\" y1=\"4\" x2=\"14\" y2=\"4\" stroke=\"currentColor\" stroke-width=\"1.6\"/><path d=\"M14,1 L19,4 L14,7 z\" fill=\"currentColor\"/></svg>',\n contract: '<svg width=\"20\" height=\"8\" aria-hidden=\"true\"><line x1=\"1\" y1=\"4\" x2=\"13\" y2=\"4\" stroke=\"currentColor\" stroke-width=\"1.4\"/><path d=\"M13,1 L19,4 L13,7 z\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"1.2\"/></svg>',\n association: '<svg width=\"20\" height=\"8\" aria-hidden=\"true\"><line x1=\"1\" y1=\"4\" x2=\"19\" y2=\"4\" stroke=\"currentColor\" stroke-width=\"1.4\" stroke-dasharray=\"2 4\" opacity=\".7\"/></svg>',\n };\n return glyphs[fam];",
- "span": "L63-L70"
+ "code": " const root = mkdtempSync(join(tmpdir(), \"graftviz-srv-\"));\n const contextDir = join(root, \".context\");\n const viewerDir = join(root, \"viewer\");\n mkdirSync(contextDir);\n mkdirSync(viewerDir);\n writeFileSync(join(viewerDir, \"index.html\"), \"<title>stub</title>\\n\");\n writeFileSync(join(viewerDir, \"app.js\"), \"// stub\\n\");\n writeFileSync(join(viewerDir, \"style.css\"), \"/* stub */\\n\");\n writeFileSync(\n join(contextDir, \"alpha.md\"),\n `---\\nname: Alpha\\nslug: alpha\\ntype: system\\nsources: []\\nlinks: []\\n---\\nbody\\n`,\n );",
+ "span": "L14-L25"
}
},
{
- "id": "viewer/main.ts#graphTab",
- "name": "graphTab",
+ "id": "test/workspace.test.ts",
+ "name": "workspace.test.ts",
+ "kind": "file",
+ "path": "test/workspace.test.ts",
+ "span": "L1-L337",
+ "signature": null,
+ "exported": true,
+ "origin": "ast",
+ "body_hash": "272fbff178d36987fc11da71b069683d2eaf705ffc6048445e1dcc5ac1d73755",
+ "chars": 16503,
+ "summary_state": "pending",
+ "summary": null,
+ "crux": null
+ },
+ {
+ "id": "test/workspace.test.ts#buildWorkspace",
+ "name": "buildWorkspace",
"kind": "function",
- "path": "viewer/main.ts",
- "span": "L27-L29",
- "signature": "function graphTab(): \"context\" | \"code\"",
+ "path": "test/workspace.test.ts",
+ "span": "L40-L44",
+ "signature": "async function buildWorkspace(parent: string): Promise<{ children: string[]; migrated: boolean }>",
"exported": false,
"origin": "ast",
- "body_hash": "8bf89d024fe38470c469c719795eaf902c0e903157cf7ed24fe58a85db40cea4",
- "summary_state": "ready",
- "summary": "Identifies the current graph tab, ensuring the correct context is used for rendering and interactions.",
- "crux": {
- "code": " return state.tab === \"code\" || state.tab === \"outline\" ? \"code\" : \"context\";",
- "span": "L28-L28"
- }
+ "body_hash": "3b3b06ede3ce06f892e8593ffd60089525ac61b98ae966662a6d1d6b521a2856",
+ "summary_state": "pending",
+ "summary": null,
+ "crux": null
},
{
- "id": "viewer/main.ts#loadAll",
- "name": "loadAll",
+ "id": "test/workspace.test.ts#pad",
+ "name": "pad",
"kind": "function",
- "path": "viewer/main.ts",
- "span": "L216-L223",
- "signature": "async function loadAll(): Promise<void>",
+ "path": "test/workspace.test.ts",
+ "span": "L53-L57",
+ "signature": "function pad(n: number): string",
"exported": false,
"origin": "ast",
- "body_hash": "c896b70116fce23a9b9846a95ed257835d18d1368d091a56cec01674e36bc480",
- "summary_state": "ready",
- "summary": "Loads the context and code graphs asynchronously, ensuring the viewer is populated with the latest data.",
- "crux": {
- "code": " state.context = context;\n state.code = code;\n $(\"repoName\").textContent = context.meta.repoName ?? \"\";\n document.title = `graft viz — ${context.meta.repoName ?? \"\"}`;\n setTab(state.tab);",
- "span": "L218-L222"
- }
+ "body_hash": "392948aa7faabec2fab944448c20fea3717d6afe9fb5c92e6e222cfc2fad8c9e",
+ "summary_state": "pending",
+ "summary": null,
+ "crux": null
},
{
- "id": "viewer/main.ts#renderChips",
- "name": "renderChips",
+ "id": "test/workspace.test.ts#workspaceFx",
+ "name": "workspaceFx",
"kind": "function",
- "path": "viewer/main.ts",
- "span": "L32-L60",
- "signature": "function renderChips(): void",
+ "path": "test/workspace.test.ts",
+ "span": "L26-L37",
+ "signature": "function workspaceFx(children: Record<string, Record<string, string>>): string",
"exported": false,
"origin": "ast",
- "body_hash": "1ef41cd967e509d6342b72755564e0975cb6b87edfcc2911fe79404f906eddcb",
+ "body_hash": "3e4d4b90019b952ebac2f1a61ecc85c173205e30528a6eec49190f98dfb58235",
+ "summary_state": "pending",
+ "summary": null,
+ "crux": null
+ },
+ {
+ "id": "viewer/data.ts",
+ "name": "data.ts",
+ "kind": "file",
+ "path": "viewer/data.ts",
+ "span": "L1-L122",
+ "signature": null,
+ "exported": true,
+ "origin": "ast",
+ "body_hash": "e9c5c89ad933e06004cbeddc1b1d7b60a6057726a463c66f9673ba20a3c61afd",
+ "chars": 4708,
"summary_state": "ready",
- "summary": "Generates and displays interactive chips for graph edges, allowing users to filter and manage edge visibility.",
+ "summary": "This file defines data structures and functions for managing and visualizing graph data from a server.",
+ "crux": null
+ },
+ {
+ "id": "viewer/data.ts#chipKey",
+ "name": "chipKey",
+ "kind": "function",
+ "path": "viewer/data.ts",
+ "span": "L47-L51",
+ "signature": "function chipKey(rel: string): string",
+ "exported": true,
+ "origin": "ast",
+ "body_hash": "85dd128b9f3bf028efaeac2428474b0d70ac47e8e94bcba80c111d59a6006df9",
+ "summary_state": "ready",
+ "summary": "Generates a key for chip grouping based on the relation verb, simplifying the visualization of relationships.",
"crux": {
- "code": " const graph = activeGraph();\n if (!graph) return;\n const counts = new Map<string, number>();\n for (const e of graph.edges) {\n const key = chipKey(e.relation);\n counts.set(key, (counts.get(key) ?? 0) + 1);\n }\n const keys = [...counts.keys()].sort((a, b) => {\n const rank = (k: string) => (k === \"part of\" ? 0 : k === \"uses\" ? 1 : 2);\n return rank(a) - rank(b) || a.localeCompare(b);\n });\n for (const key of keys) {",
- "span": "L35-L46"
+ "code": " if (famOf(rel) === \"structure\") return \"part of\";\n if (rel === \"calls\" || rel === \"uses\" || rel === \"depends_on\" || rel === \"imports\") return \"uses\";\n return rel.replace(/_/g, \" \");",
+ "span": "L48-L50"
}
},
{
- "id": "viewer/main.ts#renderChips.rank",
- "name": "rank",
- "kind": "function",
- "path": "viewer/main.ts",
- "span": "L43-L43",
- "signature": "rank = (k: string)",
+ "id": "viewer/data.ts#CodeGraphV1",
+ "name": "CodeGraphV1",
+ "kind": "interface",
+ "path": "viewer/data.ts",
+ "span": "L86-L93",
+ "signature": "interface CodeGraphV1",
"exported": false,
"origin": "ast",
- "body_hash": "2b14b986fe4648076445602ac03c0f7c788760e8910fa9322617251aa60af5ce",
+ "body_hash": "e494a9a322973f3bc8af2017764ac546a8e9cb7b03cae5aeb730f48ad2521d90",
"summary_state": "ready",
- "summary": "Establishes a ranking system for edge types to ensure they are displayed in a meaningful order.",
+ "summary": "Defines the structure of the code graph data received from the server, including nodes and edges.",
+ "crux": null
+ },
+ {
+ "id": "viewer/data.ts#colorToken",
+ "name": "colorToken",
+ "kind": "function",
+ "path": "viewer/data.ts",
+ "span": "L72-L75",
+ "signature": "function colorToken(tab: \"context\" | \"code\", type: string): string",
+ "exported": true,
+ "origin": "ast",
+ "body_hash": "dc48f14294140f474d97fdedf0bdbbbe487d5f0bcdeda6ae84f87251ab24b007",
+ "summary_state": "ready",
+ "summary": "Maps a type to its corresponding CSS custom property for styling in the visualization.",
"crux": {
- "code": " const rank = (k: string) => (k === \"part of\" ? 0 : k === \"uses\" ? 1 : 2);",
- "span": "L43-L43"
+ "code": " return m[type] ?? \"--edge\";",
+ "span": "L74-L74"
}
},
{
- "id": "viewer/main.ts#renderLegend",
- "name": "renderLegend",
+ "id": "viewer/data.ts#cvar",
+ "name": "cvar",
"kind": "function",
- "path": "viewer/main.ts",
- "span": "L74-L94",
- "signature": "function renderLegend(): void",
- "exported": false,
+ "path": "viewer/data.ts",
+ "span": "L77-L79",
+ "signature": "function cvar(name: string): string",
+ "exported": true,
"origin": "ast",
- "body_hash": "ec1a1aba1d086d035890c60aadf98d7418c018c5488f106100102deaf0eafc01",
+ "body_hash": "89e6f3b44e0dd358542573894691c925266e88da9160b79be00d043ae17245e8",
"summary_state": "ready",
- "summary": "Creates a legend for node types in the graph, providing users with context about the displayed data.",
+ "summary": "Retrieves the value of a CSS custom property from the document's root element.",
+ "crux": null
+ },
+ {
+ "id": "viewer/data.ts#Family",
+ "name": "Family",
+ "kind": "type",
+ "path": "viewer/data.ts",
+ "span": "L29-L29",
+ "signature": "type Family = \"structure\" | \"dependency\" | \"contract\" | \"association\";",
+ "exported": true,
+ "origin": "ast",
+ "body_hash": "324db0cd1c7f2eebbda194734b2a8db880eb835949f0325780ea5ae75308ef05",
+ "summary_state": "ready",
+ "summary": "Categorizes relation verbs into families to enforce consistent semantics in graph relationships.",
+ "crux": null
+ },
+ {
+ "id": "viewer/data.ts#famOf",
+ "name": "famOf",
+ "kind": "function",
+ "path": "viewer/data.ts",
+ "span": "L39-L41",
+ "signature": "function famOf(rel: string): Family",
+ "exported": true,
+ "origin": "ast",
+ "body_hash": "faed31084ad49496d754f589593081a76a4cd98e714ff10a10c07d5cd476738d",
+ "summary_state": "ready",
+ "summary": "Determines the family category of a given relation verb, defaulting to 'association' if unknown.",
"crux": {
- "code": " const graph = activeGraph();\n if (!graph) return;\n const counts = new Map<string, number>();\n for (const n of graph.nodes) counts.set(n.type, (counts.get(n.type) ?? 0) + 1);\n for (const [type, count] of counts) {\n const chip = document.createElement(\"button\");\n chip.type = \"button\";\n chip.className = \"lchip\" + (view.hiddenTypes[type] ? \" off\" : \"\");\n chip.innerHTML = `<span class=\"sw\" style=\"background:${cvar(colorToken(graphTab(), type))}\"></span>${type} <span style=\"color:var(--muted);font-weight:500\">${count}</span>`;\n chip.addEventListener(\"click\", () => {\n view.hiddenTypes[type] = !view.hiddenTypes[type];\n renderLegend();",
- "span": "L77-L88"
+ "code": " return FAMILY[rel] ?? \"association\";",
+ "span": "L40-L40"
}
},
{
- "id": "viewer/main.ts#setTab",
- "name": "setTab",
+ "id": "viewer/data.ts#loadCodeGraph",
+ "name": "loadCodeGraph",
"kind": "function",
- "path": "viewer/main.ts",
- "span": "L129-L167",
- "signature": "function setTab(tab: Tab): void",
- "exported": false,
+ "path": "viewer/data.ts",
+ "span": "L96-L113",
+ "signature": "async function loadCodeGraph(): Promise<VizGraph | null>",
+ "exported": true,
"origin": "ast",
- "body_hash": "c269ec25c7011b7343bdcec22729b23b0c65a57255598ac5145a46397809b321",
+ "body_hash": "343a1a01362fa33345082eb6cd5a04cfc1b7a1411de7bc23422c5ac5ebb1fae1",
"summary_state": "ready",
- "summary": "Handles the logic for switching between different graph views, ensuring the UI reflects the current context accurately.",
+ "summary": "Loads the code graph from the server, filtering out unresolved edges and returning a structured graph.",
"crux": {
- "code": " state.tab = tab;\n document.querySelectorAll<HTMLButtonElement>(\".tab\").forEach((b) => {\n b.setAttribute(\"aria-selected\", b.dataset.tab === tab ? \"true\" : \"false\");\n });\n const isOutline = tab === \"outline\";\n $(\"canvasWrap\").hidden = isOutline;\n $(\"outlineView\").hidden = !isOutline;\n view.hiddenRels = {};\n view.hiddenTypes = {};\n view.selected = null;\n showDetail(null);\n",
- "span": "L130-L141"
+ "code": " if (!res.ok) return null;\n const raw = (await res.json()) as CodeGraphV1;\n const nodes: VizNode[] = raw.nodes.map((n) => ({\n id: n.id,\n name: n.name,\n type: n.kind,\n summary: n.summary ?? n.signature ?? \"\",\n sources: [`${n.path} · ${n.span}`],\n }));\n const known = new Set(nodes.map((n) => n.id));\n // imports edges may point at unresolved module strings — drop those for rendering\n const edges: VizEdge[] = raw.edges",
+ "span": "L98-L109"
}
},
{
- "id": "viewer/main.ts#showDetail",
- "name": "showDetail",
+ "id": "viewer/data.ts#loadContextGraph",
+ "name": "loadContextGraph",
"kind": "function",
- "path": "viewer/main.ts",
- "span": "L115-L124",
- "signature": "function showDetail(id: string | null): void",
- "exported": false,
+ "path": "viewer/data.ts",
+ "span": "L81-L84",
+ "signature": "async function loadContextGraph(): Promise<VizGraph>",
+ "exported": true,
"origin": "ast",
- "body_hash": "e2b6f6a27ee1e3bac515ec8140678caa7c6cff3baab943cf43f8fdbdd7ab2e62",
+ "body_hash": "c65d9227bea8ceceffd49b4eb8475677aef8ca8820b966d9228a31875a6589e1",
"summary_state": "ready",
- "summary": "Displays detailed information about a selected graph element, enhancing user interaction and understanding.",
+ "summary": "Fetches the context graph data from the server and returns it in a structured format.",
"crux": {
- "code": " view.focus(next);\n }\n });",
- "span": "L121-L123"
+ "code": " const res = await fetch(\"/api/context-graph\");\n return (await res.json()) as VizGraph;",
+ "span": "L82-L83"
}
},
{
- "id": "viewer/main.ts#showEmpty",
- "name": "showEmpty",
+ "id": "viewer/data.ts#onServerChange",
+ "name": "onServerChange",
"kind": "function",
- "path": "viewer/main.ts",
- "span": "L169-L173",
- "signature": "function showEmpty(html: string): void",
- "exported": false,
+ "path": "viewer/data.ts",
+ "span": "L116-L121",
+ "signature": "function onServerChange(handler: () => void): void",
+ "exported": true,
"origin": "ast",
- "body_hash": "981ef1b3d68cfcc89b2804a326c87ce023df618bfee612f158fa72291fe7a6d1",
+ "body_hash": "d864a1d7995232ad54351830e5963a2c6fc8c64cc5a941cf9cfea74d688514c9",
"summary_state": "ready",
- "summary": "Displays a message when no graph data is available, guiding users on how to generate the necessary data.",
+ "summary": "Subscribes to server events to trigger updates in the application when changes occur.",
"crux": {
- "code": " empty.innerHTML = html;\n empty.hidden = false;",
- "span": "L171-L172"
+ "code": " if (ev.data === \"change\") handler();",
+ "span": "L119-L119"
}
},
{
- "id": "viewer/main.ts#Tab",
- "name": "Tab",
- "kind": "type",
- "path": "viewer/main.ts",
- "span": "L10-L10",
- "signature": "type Tab = \"context\" | \"code\" | \"outline\";",
- "exported": false,
+ "id": "viewer/data.ts#VizEdge",
+ "name": "VizEdge",
+ "kind": "interface",
+ "path": "viewer/data.ts",
+ "span": "L14-L20",
+ "signature": "interface VizEdge",
+ "exported": true,
"origin": "ast",
- "body_hash": "4cd3b4afb6647f09ba09efccca7c53a333edbebe109fb1e24db04aa24df610de",
+ "body_hash": "13baa6c9acc4c78eec36835e02fd49df79e869f836880341a959be134ceaabb1",
"summary_state": "ready",
- "summary": "Defines the possible tab types for the viewer, ensuring that only valid tab selections are made.",
+ "summary": "Defines the relationship between two nodes in the visualization graph, including its type and description.",
+ "crux": null
+ },
+ {
+ "id": "viewer/data.ts#VizGraph",
+ "name": "VizGraph",
+ "kind": "interface",
+ "path": "viewer/data.ts",
+ "span": "L22-L26",
+ "signature": "interface VizGraph",
+ "exported": true,
+ "origin": "ast",
+ "body_hash": "6448a4bb9c71c7932dce92d9d8a452f99a0a100041bd30c5b6759c5784b0f098",
+ "summary_state": "ready",
+ "summary": "Encapsulates the entire visualization graph structure, including its nodes and edges.",
+ "crux": null
+ },
+ {
+ "id": "viewer/data.ts#VizNode",
+ "name": "VizNode",
+ "kind": "interface",
+ "path": "viewer/data.ts",
+ "span": "L6-L12",
+ "signature": "interface VizNode",
+ "exported": true,
+ "origin": "ast",
+ "body_hash": "ec19a79898c594e5afc405cab037fcc0c43144c5766af8a955dccda7df733ba6",
+ "summary_state": "ready",
+ "summary": "Represents a node in the visualization graph, encapsulating its identity and metadata.",
+ "crux": null
+ },
+ {
+ "id": "viewer/detail.ts",
+ "name": "detail.ts",
+ "kind": "file",
+ "path": "viewer/detail.ts",
+ "span": "L1-L59",
+ "signature": null,
+ "exported": true,
+ "origin": "ast",
+ "body_hash": "fe8df7c5561f2a8588cf4e1ecb367d19cb6b480fe4855f05e4f96137d8078884",
+ "chars": 2421,
+ "summary_state": "ready",
+ "summary": "This file provides the logic to render a detailed view of a selected node in a graph, including its properties and relationships.",
+ "crux": {
+ "code": " if (!id || !graph) {\n host.innerHTML = '<div class=\"empty\">Select a node to view details</div>';\n return;\n }\n const node = graph.nodes.find((n) => n.id === id);\n if (!node) {\n host.innerHTML = '<div class=\"empty\">Select a node to view details</div>';\n return;\n }\n const color = cvar(colorToken(tab, node.type));\n const name = (nid: string) => graph.nodes.find((n) => n.id === nid)?.name ?? nid;\n const out = graph.edges.filter((e) => e.source === id);",
+ "span": "L19-L30"
+ }
+ },
+ {
+ "id": "viewer/detail.ts#esc",
+ "name": "esc",
+ "kind": "function",
+ "path": "viewer/detail.ts",
+ "span": "L8-L10",
+ "signature": "function esc(s: string): string",
+ "exported": false,
+ "origin": "ast",
+ "body_hash": "9fb927f7f1c881ee1fe325c0dc8a25b8c5cdb2c101b08ae935a35bb428f5bbdb",
+ "summary_state": "ready",
+ "summary": "This function sanitizes a string for safe HTML rendering by escaping special characters.",
+ "crux": {
+ "code": " return s.replace(/&/g, \"&amp;\").replace(/</g, \"&lt;\");\n}",
+ "span": "L9-L10"
+ }
+ },
+ {
+ "id": "viewer/detail.ts#renderDetail",
+ "name": "renderDetail",
+ "kind": "function",
+ "path": "viewer/detail.ts",
+ "span": "L12-L58",
+ "signature": "function renderDetail( host: HTMLElement, graph: VizGraph | null, tab: \"context\" | \"code\", id: string | null, onNavigate: (id: string) => void, ): void",
+ "exported": true,
+ "origin": "ast",
+ "body_hash": "bbd0db0a7f39cbfbd9b0ca31f88118c9a2cd037d394ad47bff7203a6f399f5ca",
+ "summary_state": "ready",
+ "summary": "This function renders the details of a selected node, including its type, name, summary, sources, and relationships.",
+ "crux": {
+ "code": " const color = cvar(colorToken(tab, node.type));\n const name = (nid: string) => graph.nodes.find((n) => n.id === nid)?.name ?? nid;\n const out = graph.edges.filter((e) => e.source === id);\n const inn = graph.edges.filter((e) => e.target === id);\n\n let html = `<span class=\"d-type\"><span class=\"sw\" style=\"background:${color}\"></span>${esc(node.type)}</span>`;\n html += `<h3>${esc(node.name)}</h3>`;\n if (node.summary) html += `<p class=\"summary\">${esc(node.summary)}</p>`;\n if (node.sources.length) {\n html += `<div class=\"d-label\">Sources · ${node.sources.length}</div>`;\n for (const s of node.sources) html += `<div class=\"src mono\">${esc(s)}</div>`;\n }",
+ "span": "L28-L39"
+ }
+ },
+ {
+ "id": "viewer/detail.ts#renderDetail.linkList",
+ "name": "linkList",
+ "kind": "function",
+ "path": "viewer/detail.ts",
+ "span": "L40-L50",
+ "signature": "linkList = (edges: typeof out, dotColor: string, title: string, other: (e: (typeof out)[number]) => string)",
+ "exported": true,
+ "origin": "ast",
+ "body_hash": "f103fe554602f3315706280d7eba1016c647c77fa6af27e9a4ec0442d6cf1d89",
+ "summary_state": "ready",
+ "summary": "This function generates HTML for displaying a list of links related to a node, categorized by their relationship type.",
+ "crux": {
+ "code": " if (!edges.length) return;\n html += `<div class=\"d-label\"><span class=\"dot\" style=\"background:${dotColor}\"></span>${title} · ${edges.length}</div>`;\n for (const e of edges) {\n html += `<button class=\"lnk\" data-go=\"${esc(other(e))}\">` +\n `<span class=\"rel\">${esc(e.relation.replace(/_/g, \" \"))}</span> ` +\n `<span class=\"to\">${esc(name(other(e)))}</span>` +\n (e.description ? `<div class=\"desc\">${esc(e.description)}</div>` : \"\") +\n `</button>`;\n }\n };",
+ "span": "L41-L50"
+ }
+ },
+ {
+ "id": "viewer/detail.ts#renderDetail.name",
+ "name": "name",
+ "kind": "function",
+ "path": "viewer/detail.ts",
+ "span": "L29-L29",
+ "signature": "name = (nid: string)",
+ "exported": true,
+ "origin": "ast",
+ "body_hash": "617c48812e0f0520b45da770cf91aeea5330b7e690c6d93defd4da77edf11b8a",
+ "summary_state": "ready",
+ "summary": "This function retrieves the name of a node by its ID, providing a fallback if not found.",
+ "crux": {
+ "code": " const name = (nid: string) => graph.nodes.find((n) => n.id === nid)?.name ?? nid;",
+ "span": "L29-L29"
+ }
+ },
+ {
+ "id": "viewer/graph.ts",
+ "name": "graph.ts",
+ "kind": "file",
+ "path": "viewer/graph.ts",
+ "span": "L1-L335",
+ "signature": null,
+ "exported": true,
+ "origin": "ast",
+ "body_hash": "192a59b16da8327457de6723893fd9207dd9570a35cd664f96534a7b85e73e01",
+ "chars": 14262,
+ "summary_state": "ready",
+ "summary": "This file implements a force-directed graph visualization using D3.js, allowing interactive exploration of nodes and edges.",
+ "crux": {
+ "code": " setData(graph: VizGraph, tab: \"context\" | \"code\"): void {\n this.tab = tab;\n const prev = new Map(this.nodes.map((n) => [n.id, n]));\n const deg: Record<string, number> = {};\n for (const e of graph.edges) {\n deg[e.source] = (deg[e.source] ?? 0) + 1;\n deg[e.target] = (deg[e.target] ?? 0) + 1;\n }\n const W = this.svg.clientWidth || 800;\n const H = this.svg.clientHeight || 600;\n this.nodes = graph.nodes.map((n, i) => {\n const p = prev.get(n.id);",
+ "span": "L94-L105"
+ }
+ },
+ {
+ "id": "viewer/graph.ts#el",
+ "name": "el",
+ "kind": "function",
+ "path": "viewer/graph.ts",
+ "span": "L42-L46",
+ "signature": "function el<K extends keyof SVGElementTagNameMap>(tag: K, attrs: Record<string, string | number>): SVGElementTagNameMap[K]",
+ "exported": false,
+ "origin": "ast",
+ "body_hash": "de7f696c06af5d771e8e661f398d9d275ca2cc06d86f4e91458d671480e346b7",
+ "summary_state": "ready",
+ "summary": "Creates and returns an SVG element with specified attributes, facilitating dynamic SVG generation.",
"crux": null
},
{
- "id": "viewer/main.ts#updateCounts",
- "name": "updateCounts",
- "kind": "function",
- "path": "viewer/main.ts",
- "span": "L103-L112",
- "signature": "function updateCounts(): void",
- "exported": false,
- "origin": "ast",
- "body_hash": "170a2eec2d377c150839d170cd45a244584ecc9fdbd44ad194e8cac97fdfafb6",
- "summary_state": "ready",
- "summary": "Refreshes the displayed counts of nodes and edges based on the active graph, ensuring accurate information is presented.",
- "crux": {
- "code": " el.textContent = graph ? `${graph.meta.nodeCount} nodes · ${graph.meta.edgeCount} links` : \"\";",
- "span": "L110-L110"
- }
+ "id": "viewer/graph.ts#GraphView",
+ "name": "GraphView",
+ "kind": "class",
+ "path": "viewer/graph.ts",
+ "span": "L48-L334",
+ "signature": "class GraphView",
+ "exported": true,
+ "origin": "ast",
+ "body_hash": "1405c1f292294538c45794740adf01c59c83d3fd7047b6efa8c04c90a4409310",
+ "summary_state": "ready",
+ "summary": "Manages the rendering and interaction of the graph view, including node and edge updates.",
+ "crux": {
+ "code": " setData(graph: VizGraph, tab: \"context\" | \"code\"): void {\n this.tab = tab;\n const prev = new Map(this.nodes.map((n) => [n.id, n]));\n const deg: Record<string, number> = {};\n for (const e of graph.edges) {\n deg[e.source] = (deg[e.source] ?? 0) + 1;\n deg[e.target] = (deg[e.target] ?? 0) + 1;\n }\n const W = this.svg.clientWidth || 800;\n const H = this.svg.clientHeight || 600;\n this.nodes = graph.nodes.map((n, i) => {\n const p = prev.get(n.id);",
+ "span": "L94-L105"
+ }
+ },
+ {
+ "id": "viewer/graph.ts#GraphView.applyView",
+ "name": "applyView",
+ "kind": "method",
+ "path": "viewer/graph.ts",
+ "span": "L268-L270",
+ "signature": "private applyView(): void",
+ "exported": true,
+ "origin": "ast",
+ "body_hash": "2adb54996d6ef9272cd69144b4b6c4bb92236506a3f5bf2d589faffd5218554b",
+ "summary_state": "ready",
+ "summary": "Applies the current view transformation to the graph, adjusting the viewport accordingly.",
+ "crux": {
+ "code": " private applyView(): void {\n this.viewport.setAttribute(\"transform\", `translate(${this.view.x},${this.view.y}) scale(${this.view.k})`);\n }",
+ "span": "L268-L270"
+ }
+ },
+ {
+ "id": "viewer/graph.ts#GraphView.bindDrag",
+ "name": "bindDrag",
+ "kind": "method",
+ "path": "viewer/graph.ts",
+ "span": "L290-L309",
+ "signature": "private bindDrag(group: SVGGElement, node: SimNode): void",
+ "exported": true,
+ "origin": "ast",
+ "body_hash": "00e851d11e1029516256411b627b60e78d781cdc62ada046a0eb93c55c2dd009",
+ "summary_state": "ready",
+ "summary": "Enables dragging functionality for nodes, allowing users to reposition them interactively.",
+ "crux": {
+ "code": " private bindDrag(group: SVGGElement, node: SimNode): void {\n group.addEventListener(\"pointerdown\", (ev) => {\n ev.stopPropagation();\n group.setPointerCapture(ev.pointerId);\n const move = (mv: PointerEvent) => {\n const rect = this.svg.getBoundingClientRect();\n node.fx = (mv.clientX - rect.left - this.view.x) / this.view.k;\n node.fy = (mv.clientY - rect.top - this.view.y) / this.view.k;\n this.sim?.alphaTarget(0.25).restart();\n };\n const up = () => {\n node.fx = null; node.fy = null;",
+ "span": "L290-L301"
+ }
+ },
+ {
+ "id": "viewer/graph.ts#GraphView.bindDrag.move",
+ "name": "move",
+ "kind": "function",
+ "path": "viewer/graph.ts",
+ "span": "L294-L299",
+ "signature": "move = (mv: PointerEvent)",
+ "exported": true,
+ "origin": "ast",
+ "body_hash": "656f371efff6a0eed7868895a4044e4fdf1dc88840de21376c388ba03149fbd0",
+ "summary_state": "ready",
+ "summary": "Handles the movement of a node during drag events, updating its fixed position.",
+ "crux": {
+ "code": " const move = (mv: PointerEvent) => {\n const rect = this.svg.getBoundingClientRect();\n node.fx = (mv.clientX - rect.left - this.view.x) / this.view.k;\n node.fy = (mv.clientY - rect.top - this.view.y) / this.view.k;\n this.sim?.alphaTarget(0.25).restart();\n };",
+ "span": "L294-L299"
+ }
+ },
+ {
+ "id": "viewer/graph.ts#GraphView.bindDrag.up",
+ "name": "up",
+ "kind": "function",
+ "path": "viewer/graph.ts",
+ "span": "L300-L305",
+ "signature": "up = ()",
+ "exported": true,
+ "origin": "ast",
+ "body_hash": "a935b15e42eefdf45da528afe3172b559d3e9ee97fe4be67f682dedccaac64c2",
+ "summary_state": "ready",
+ "summary": "Finalizes the drag operation by releasing the node's fixed position.",
+ "crux": {
+ "code": " const up = () => {\n node.fx = null; node.fy = null;\n this.sim?.alphaTarget(0);\n group.removeEventListener(\"pointermove\", move);\n group.removeEventListener(\"pointerup\", up);\n };",
+ "span": "L300-L305"
+ }
+ },
+ {
+ "id": "viewer/graph.ts#GraphView.bindPanZoom",
+ "name": "bindPanZoom",
+ "kind": "method",
+ "path": "viewer/graph.ts",
+ "span": "L311-L333",
+ "signature": "private bindPanZoom(): void",
+ "exported": true,
+ "origin": "ast",
+ "body_hash": "737e5f69bc32913d3b061a4a878b61245d242e217f451a81d72d21e1d28fae30",
+ "summary_state": "ready",
+ "summary": "Sets up event listeners for panning and zooming the graph view based on user interactions.",
+ "crux": {
+ "code": " private bindPanZoom(): void {\n let panStart: { x: number; y: number } | null = null;\n this.svg.addEventListener(\"pointerdown\", (ev) => {\n panStart = { x: ev.clientX - this.view.x, y: ev.clientY - this.view.y };\n });\n this.svg.addEventListener(\"pointermove\", (ev) => {\n if (!panStart) return;\n this.view.x = ev.clientX - panStart.x;\n this.view.y = ev.clientY - panStart.y;\n this.applyView();\n });\n window.addEventListener(\"pointerup\", () => { panStart = null; });",
+ "span": "L311-L322"
+ }
+ },
+ {
+ "id": "viewer/graph.ts#GraphView.buildChrome",
+ "name": "buildChrome",
+ "kind": "method",
+ "path": "viewer/graph.ts",
+ "span": "L71-L78",
+ "signature": "private buildChrome(): void",
+ "exported": true,
+ "origin": "ast",
+ "body_hash": "592cef68d76f99ad8da470cc3c8b4eda64701c02b8740a21e659fdd5e5325def",
+ "summary_state": "ready",
+ "summary": "Sets up the initial SVG structure for the graph, including definitions and viewport.",
+ "crux": {
+ "code": " this.svg.textContent = \"\";\n this.defs = el(\"defs\", {});\n this.svg.appendChild(this.defs);\n this.viewport = el(\"g\", {});\n this.svg.appendChild(this.viewport);\n this.svg.addEventListener(\"click\", () => this.select(null));\n }",
+ "span": "L72-L78"
+ }
+ },
+ {
+ "id": "viewer/graph.ts#GraphView.buildElements",
+ "name": "buildElements",
+ "kind": "method",
+ "path": "viewer/graph.ts",
+ "span": "L138-L164",
+ "signature": "private buildElements(): void",
+ "exported": true,
+ "origin": "ast",
+ "body_hash": "a608a77fab16447bd9ef9c465a192abc0cb7167807f7c1718d961d730d7f055d",
+ "summary_state": "ready",
+ "summary": "Constructs the SVG elements for nodes and edges based on the current dataset.",
+ "crux": {
+ "code": " private buildElements(): void {\n this.ensureMarkers();\n this.viewport.textContent = \"\";\n this.edgeEls = this.edges.map((edge) => {\n const path = el(\"path\", { fill: \"none\", \"stroke-linecap\": \"round\" });\n const title = el(\"title\", {});\n title.textContent = edge.relation.replace(/_/g, \" \") + (edge.description ? ` — ${edge.description}` : \"\");\n path.appendChild(title);\n const label = el(\"text\", { \"text-anchor\": \"middle\", \"font-size\": 9.5, \"font-weight\": 700, \"stroke-width\": 3, \"paint-order\": \"stroke\", display: \"none\" });\n label.textContent = edge.relation.replace(/_/g, \" \");\n this.viewport.appendChild(path);\n this.viewport.appendChild(label);",
+ "span": "L138-L149"
+ }
+ },
+ {
+ "id": "viewer/graph.ts#GraphView.constructor",
+ "name": "constructor",
+ "kind": "method",
+ "path": "viewer/graph.ts",
+ "span": "L65-L69",
+ "signature": "constructor(svg: SVGSVGElement)",
+ "exported": true,
+ "origin": "ast",
+ "body_hash": "27abb788d7de0ece37719a0a23d4fed7778c02dda10700bbfb4f110ea8c16984",
+ "summary_state": "ready",
+ "summary": "Initializes the GraphView instance and sets up the SVG environment for rendering.",
+ "crux": null
+ },
+ {
+ "id": "viewer/graph.ts#GraphView.ensureMarkers",
+ "name": "ensureMarkers",
+ "kind": "method",
+ "path": "viewer/graph.ts",
+ "span": "L80-L91",
+ "signature": "private ensureMarkers(): void",
+ "exported": true,
+ "origin": "ast",
+ "body_hash": "9517cfdb2ccb4ce235405356f6ff9b2fb3fcd2f7d687689bde33cf5df9bd6906",
+ "summary_state": "ready",
+ "summary": "Ensures that the necessary SVG markers for edges are created and available for rendering.",
+ "crux": {
+ "code": " this.defs.textContent = \"\";\n const chevron = el(\"marker\", { id: \"arr\", viewBox: \"0 0 10 10\", refX: 8, refY: 5, markerWidth: 4.5, markerHeight: 4.5, orient: \"auto-start-reverse\" });\n chevron.appendChild(el(\"path\", { d: \"M2,1.5L8.5,5L2,8.5\", fill: \"none\", stroke: cvar(\"--edge\"), \"stroke-width\": 1.8, \"stroke-linecap\": \"round\", \"stroke-linejoin\": \"round\", opacity: 0.75 }));\n const hollow = el(\"marker\", { id: \"arrH\", viewBox: \"0 0 12 12\", refX: 10, refY: 6, markerWidth: 6.5, markerHeight: 6.5, orient: \"auto-start-reverse\" });\n hollow.appendChild(el(\"path\", { d: \"M1.5,1.5L10.5,6L1.5,10.5z\", fill: cvar(\"--canvas\"), stroke: cvar(\"--edge\"), \"stroke-width\": 1.4 }));\n const out = el(\"marker\", { id: \"arrOut\", viewBox: \"0 0 10 10\", refX: 8, refY: 5, markerWidth: 5, markerHeight: 5, orient: \"auto-start-reverse\" });\n out.appendChild(el(\"path\", { d: \"M1,1L9,5L1,9z\", fill: cvar(\"--fil\") }));\n const inn = el(\"marker\", { id: \"arrIn\", viewBox: \"0 0 10 10\", refX: 8, refY: 5, markerWidth: 5, markerHeight: 5, orient: \"auto-start-reverse\" });\n inn.appendChild(el(\"path\", { d: \"M1,1L9,5L1,9z\", fill: cvar(\"--accent\") }));\n for (const m of [chevron, hollow, out, inn]) this.defs.appendChild(m);",
+ "span": "L81-L90"
+ }
+ },
+ {
+ "id": "viewer/graph.ts#GraphView.firstMatch",
+ "name": "firstMatch",
+ "kind": "method",
+ "path": "viewer/graph.ts",
+ "span": "L263-L266",
+ "signature": "firstMatch(): SimNode | undefined",
+ "exported": true,
+ "origin": "ast",
+ "body_hash": "d43343323ad49732d473f46773ac41a0ee7472f6289d324eb369d739e8cb0352",
+ "summary_state": "ready",
+ "summary": "Finds the first node that matches the current query, facilitating search functionality.",
+ "crux": {
+ "code": " firstMatch(): SimNode | undefined {\n const q = this.query.toLowerCase();\n return this.nodes.find((n) => !this.hiddenTypes[n.type] && n.name.toLowerCase().includes(q));\n }",
+ "span": "L263-L266"
+ }
+ },
+ {
+ "id": "viewer/graph.ts#GraphView.focus",
+ "name": "focus",
+ "kind": "method",
+ "path": "viewer/graph.ts",
+ "span": "L252-L261",
+ "signature": "focus(id: string): void",
+ "exported": true,
+ "origin": "ast",
+ "body_hash": "a64691876d1786ccdb2027028d00210b8cb56557c65c1afa81a886b506d7b459",
+ "summary_state": "ready",
+ "summary": "Centers the view on a specified node, enhancing its visibility and selection.",
+ "crux": {
+ "code": " focus(id: string): void {\n const node = this.nodes.find((n) => n.id === id);\n if (!node) return;\n const W = this.svg.clientWidth, H = this.svg.clientHeight;\n this.view.k = Math.max(this.view.k, 1.4);\n this.view.x = W / 2 - (node.x ?? 0) * this.view.k;\n this.view.y = H / 2 - (node.y ?? 0) * this.view.k;\n this.applyView();\n this.select(id);\n }",
+ "span": "L252-L261"
+ }
+ },
+ {
+ "id": "viewer/graph.ts#GraphView.reheat",
+ "name": "reheat",
+ "kind": "method",
+ "path": "viewer/graph.ts",
+ "span": "L286-L288",
+ "signature": "reheat(): void",
+ "exported": true,
+ "origin": "ast",
+ "body_hash": "ca57d7cb11e71985bcd27b937b4f6d0a62428a0ae84f5a297cb1147861032a59",
+ "summary_state": "ready",
+ "summary": "Restarts the simulation with increased alpha, making the graph more dynamic.",
+ "crux": {
+ "code": " reheat(): void {\n this.sim?.alpha(0.6).restart();\n }",
+ "span": "L286-L288"
+ }
+ },
+ {
+ "id": "viewer/graph.ts#GraphView.resetView",
+ "name": "resetView",
+ "kind": "method",
+ "path": "viewer/graph.ts",
+ "span": "L281-L284",
+ "signature": "resetView(): void",
+ "exported": true,
+ "origin": "ast",
+ "body_hash": "ae1f1ee82c804ff145b1f4aa9de70cad49a5287735aa9825f6accbe21591794c",
+ "summary_state": "ready",
+ "summary": "Resets the graph view to its initial state, centering and scaling the view.",
+ "crux": {
+ "code": " resetView(): void {\n this.view = { x: 0, y: 0, k: 1 };\n this.applyView();\n }",
+ "span": "L281-L284"
+ }
+ },
+ {
+ "id": "viewer/graph.ts#GraphView.restyle",
+ "name": "restyle",
+ "kind": "method",
+ "path": "viewer/graph.ts",
+ "span": "L185-L243",
+ "signature": "restyle(): void",
+ "exported": true,
+ "origin": "ast",
+ "body_hash": "a928dd40f55ad9a091ba969afdf370f2a265bf30fb94efdc6879fcc0fb01edda",
+ "summary_state": "ready",
+ "summary": "Applies styles to nodes and edges based on their visibility and selection state.",
+ "crux": {
+ "code": " restyle(): void {\n this.ensureMarkers();\n const neighbors = new Set<string>();\n if (this.selected) {\n for (const e of this.edges) {\n if (e.source.id === this.selected) neighbors.add(e.target.id);\n if (e.target.id === this.selected) neighbors.add(e.source.id);\n }\n }\n const q = this.query.toLowerCase();\n const nodeShown = (n: SimNode) => !this.hiddenTypes[n.type];\n",
+ "span": "L185-L196"
+ }
+ },
+ {
+ "id": "viewer/graph.ts#GraphView.restyle.nodeShown",
+ "name": "nodeShown",
+ "kind": "function",
+ "path": "viewer/graph.ts",
+ "span": "L195-L195",
+ "signature": "nodeShown = (n: SimNode)",
+ "exported": true,
+ "origin": "ast",
+ "body_hash": "a598aac16da1955aecc62f39590f30d0c7e780d99429b1657c1bbba7d157ddea",
+ "summary_state": "ready",
+ "summary": "Determines if a node should be displayed based on its type and visibility settings.",
+ "crux": null
+ },
+ {
+ "id": "viewer/graph.ts#GraphView.select",
+ "name": "select",
+ "kind": "method",
+ "path": "viewer/graph.ts",
+ "span": "L245-L249",
+ "signature": "select(id: string | null): void",
+ "exported": true,
+ "origin": "ast",
+ "body_hash": "7ba52874ad2ddda2bc80c3442e011c9d2b464fb8851a3ba527d3dba8ac6061c2",
+ "summary_state": "ready",
+ "summary": "Selects a node in the graph and updates the visual representation accordingly.",
+ "crux": {
+ "code": " select(id: string | null): void {\n this.selected = id;\n this.restyle();\n this.onSelect(id);\n }",
+ "span": "L245-L249"
+ }
+ },
+ {
+ "id": "viewer/graph.ts#GraphView.setData",
+ "name": "setData",
+ "kind": "method",
+ "path": "viewer/graph.ts",
+ "span": "L94-L136",
+ "signature": "setData(graph: VizGraph, tab: \"context\" | \"code\"): void",
+ "exported": true,
+ "origin": "ast",
+ "body_hash": "d8063d2226148959298ca10074e09f00b7530c0b6a87f023502c4bd1c02041a6",
+ "summary_state": "ready",
+ "summary": "Loads a new dataset into the graph, updating node positions and relationships accordingly.",
+ "crux": {
+ "code": " setData(graph: VizGraph, tab: \"context\" | \"code\"): void {\n this.tab = tab;\n const prev = new Map(this.nodes.map((n) => [n.id, n]));\n const deg: Record<string, number> = {};\n for (const e of graph.edges) {\n deg[e.source] = (deg[e.source] ?? 0) + 1;\n deg[e.target] = (deg[e.target] ?? 0) + 1;\n }\n const W = this.svg.clientWidth || 800;\n const H = this.svg.clientHeight || 600;\n this.nodes = graph.nodes.map((n, i) => {\n const p = prev.get(n.id);",
+ "span": "L94-L105"
+ }
+ },
+ {
+ "id": "viewer/graph.ts#GraphView.tick",
+ "name": "tick",
+ "kind": "method",
+ "path": "viewer/graph.ts",
+ "span": "L166-L182",
+ "signature": "private tick(): void",
+ "exported": true,
+ "origin": "ast",
+ "body_hash": "0fbefdd43e29e9d5134e756074fe1fa190fa23cf6afaa72a52d27f098ac8e6bb",
+ "summary_state": "ready",
+ "summary": "Updates the positions of nodes and edges on each simulation tick, ensuring the graph remains interactive.",
+ "crux": {
+ "code": " private tick(): void {\n for (const { path, label, edge } of this.edgeEls) {\n const a = edge.source, b = edge.target;\n const dx = (b.x ?? 0) - (a.x ?? 0), dy = (b.y ?? 0) - (a.y ?? 0);\n const d = Math.sqrt(dx * dx + dy * dy) || 1;\n const ux = dx / d, uy = dy / d;\n const sx = (a.x ?? 0) + ux * (a.r + 2), sy = (a.y ?? 0) + uy * (a.r + 2);\n const tx = (b.x ?? 0) - ux * (b.r + 6), ty = (b.y ?? 0) - uy * (b.r + 6);\n const mx = (sx + tx) / 2 - uy * 10, my = (sy + ty) / 2 + ux * 10;\n path.setAttribute(\"d\", `M${sx},${sy} Q${mx},${my} ${tx},${ty}`);\n label.setAttribute(\"x\", String((sx + tx) / 2 - uy * 14));\n label.setAttribute(\"y\", String((sy + ty) / 2 + ux * 14));",
+ "span": "L166-L177"
+ }
+ },
+ {
+ "id": "viewer/graph.ts#GraphView.zoomBy",
+ "name": "zoomBy",
+ "kind": "method",
+ "path": "viewer/graph.ts",
+ "span": "L272-L279",
+ "signature": "zoomBy(factor: number): void",
+ "exported": true,
+ "origin": "ast",
+ "body_hash": "2dd28ba55cc461ab1f950d582e10b63c6862804f17d518ef346fe4e3f49af289",
+ "summary_state": "ready",
+ "summary": "Adjusts the zoom level of the graph view based on user input, allowing for detailed exploration.",
+ "crux": {
+ "code": " zoomBy(factor: number): void {\n const W = this.svg.clientWidth / 2, H = this.svg.clientHeight / 2;\n const k = Math.max(0.35, Math.min(3, this.view.k * factor));\n this.view.x = W - (W - this.view.x) * (k / this.view.k);\n this.view.y = H - (H - this.view.y) * (k / this.view.k);\n this.view.k = k;\n this.applyView();\n }",
+ "span": "L272-L279"
+ }
+ },
+ {
+ "id": "viewer/graph.ts#SimEdge",
+ "name": "SimEdge",
+ "kind": "interface",
+ "path": "viewer/graph.ts",
+ "span": "L32-L38",
+ "signature": "interface SimEdge",
+ "exported": false,
+ "origin": "ast",
+ "body_hash": "06690141adf5c47ffc6dd6b55a3cf9f041a4750f0b512cf49d3596928485fca8",
+ "summary_state": "ready",
+ "summary": "Defines the structure of an edge in the simulation, representing the relationship between two nodes.",
+ "crux": null
+ },
+ {
+ "id": "viewer/graph.ts#SimNode",
+ "name": "SimNode",
+ "kind": "interface",
+ "path": "viewer/graph.ts",
+ "span": "L22-L30",
+ "signature": "interface SimNode extends SimulationNodeDatum",
+ "exported": false,
+ "origin": "ast",
+ "body_hash": "b000c5412e66a114ce7349ebddb8f536c040a6c6f158c641a8370ea049b6a69d",
+ "summary_state": "ready",
+ "summary": "Defines the structure of a node in the simulation, including its position and properties.",
+ "crux": null
+ },
+ {
+ "id": "viewer/main.ts",
+ "name": "main.ts",
+ "kind": "file",
+ "path": "viewer/main.ts",
+ "span": "L1-L233",
+ "signature": null,
+ "exported": true,
+ "origin": "ast",
+ "body_hash": "ab45ce4dfe66aafbe779b71d49d6370b3fe64482307b994e857ce34d3f317325",
+ "chars": 8654,
+ "summary_state": "ready",
+ "summary": "This file serves as the entry point for the graft visualization viewer, managing the user interface and interactions for displaying graphs.",
+ "crux": {
+ "code": "const view = new GraphView($(\"graphSvg\") as unknown as SVGSVGElement);",
+ "span": "L21-L21"
+ }
+ },
+ {
+ "id": "viewer/main.ts#$",
+ "name": "$",
+ "kind": "function",
+ "path": "viewer/main.ts",
+ "span": "L12-L12",
+ "signature": "$ = <T extends HTMLElement>(id: string): T",
+ "exported": false,
+ "origin": "ast",
+ "body_hash": "e46dd7aa9ed3186876ec11a8520b5af609af327108e045bce175d535aa9ed0e5",
+ "summary_state": "ready",
+ "summary": "Provides a type-safe way to retrieve HTML elements by their ID, enhancing code readability and reducing errors.",
+ "crux": null
+ },
+ {
+ "id": "viewer/main.ts#activeGraph",
+ "name": "activeGraph",
+ "kind": "function",
+ "path": "viewer/main.ts",
+ "span": "L23-L25",
+ "signature": "function activeGraph(): VizGraph | null",
+ "exported": false,
+ "origin": "ast",
+ "body_hash": "71591b2a66c0aa4d34f5b96cb2f1293248bdf02f55f6a73c2ee48258f6e2c445",
+ "summary_state": "ready",
+ "summary": "Determines which graph is currently active based on the selected tab, facilitating the correct data display.",
+ "crux": {
+ "code": " return state.tab === \"context\" ? state.context : state.code;",
+ "span": "L24-L24"
+ }
+ },
+ {
+ "id": "viewer/main.ts#glyphFor",
+ "name": "glyphFor",
+ "kind": "function",
+ "path": "viewer/main.ts",
+ "span": "L62-L71",
+ "signature": "function glyphFor(key: string): string",
+ "exported": false,
+ "origin": "ast",
+ "body_hash": "bd36f5f7c09e4d09ac342de7015c4cbda2ec86e36ab0c22716dd37b006444581",
+ "summary_state": "ready",
+ "summary": "Maps edge types to their corresponding visual glyphs, enhancing the graphical representation of relationships.",
+ "crux": {
+ "code": " const fam = key === \"part of\" ? \"structure\" : key === \"uses\" ? \"dependency\" : famOf(key.replace(/ /g, \"_\"));\n const glyphs: Record<string, string> = {\n structure: '<svg width=\"20\" height=\"8\" aria-hidden=\"true\"><line x1=\"1\" y1=\"4\" x2=\"19\" y2=\"4\" stroke=\"currentColor\" stroke-width=\"3\" opacity=\".5\"/></svg>',\n dependency: '<svg width=\"20\" height=\"8\" aria-hidden=\"true\"><line x1=\"1\" y1=\"4\" x2=\"14\" y2=\"4\" stroke=\"currentColor\" stroke-width=\"1.6\"/><path d=\"M14,1 L19,4 L14,7 z\" fill=\"currentColor\"/></svg>',\n contract: '<svg width=\"20\" height=\"8\" aria-hidden=\"true\"><line x1=\"1\" y1=\"4\" x2=\"13\" y2=\"4\" stroke=\"currentColor\" stroke-width=\"1.4\"/><path d=\"M13,1 L19,4 L13,7 z\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"1.2\"/></svg>',\n association: '<svg width=\"20\" height=\"8\" aria-hidden=\"true\"><line x1=\"1\" y1=\"4\" x2=\"19\" y2=\"4\" stroke=\"currentColor\" stroke-width=\"1.4\" stroke-dasharray=\"2 4\" opacity=\".7\"/></svg>',\n };\n return glyphs[fam];",
+ "span": "L63-L70"
+ }
+ },
+ {
+ "id": "viewer/main.ts#graphTab",
+ "name": "graphTab",
+ "kind": "function",
+ "path": "viewer/main.ts",
+ "span": "L27-L29",
+ "signature": "function graphTab(): \"context\" | \"code\"",
+ "exported": false,
+ "origin": "ast",
+ "body_hash": "8bf89d024fe38470c469c719795eaf902c0e903157cf7ed24fe58a85db40cea4",
+ "summary_state": "ready",
+ "summary": "Identifies the current graph tab, ensuring the correct context is used for rendering and interactions.",
+ "crux": {
+ "code": " return state.tab === \"code\" || state.tab === \"outline\" ? \"code\" : \"context\";",
+ "span": "L28-L28"
+ }
+ },
+ {
+ "id": "viewer/main.ts#loadAll",
+ "name": "loadAll",
+ "kind": "function",
+ "path": "viewer/main.ts",
+ "span": "L216-L223",
+ "signature": "async function loadAll(): Promise<void>",
+ "exported": false,
+ "origin": "ast",
+ "body_hash": "c896b70116fce23a9b9846a95ed257835d18d1368d091a56cec01674e36bc480",
+ "summary_state": "ready",
+ "summary": "Loads the context and code graphs asynchronously, ensuring the viewer is populated with the latest data.",
+ "crux": {
+ "code": " state.context = context;\n state.code = code;\n $(\"repoName\").textContent = context.meta.repoName ?? \"\";\n document.title = `graft viz — ${context.meta.repoName ?? \"\"}`;\n setTab(state.tab);",
+ "span": "L218-L222"
+ }
+ },
+ {
+ "id": "viewer/main.ts#renderChips",
+ "name": "renderChips",
+ "kind": "function",
+ "path": "viewer/main.ts",
+ "span": "L32-L60",
+ "signature": "function renderChips(): void",
+ "exported": false,
+ "origin": "ast",
+ "body_hash": "1ef41cd967e509d6342b72755564e0975cb6b87edfcc2911fe79404f906eddcb",
+ "summary_state": "ready",
+ "summary": "Generates and displays interactive chips for graph edges, allowing users to filter and manage edge visibility.",
+ "crux": {
+ "code": " const graph = activeGraph();\n if (!graph) return;\n const counts = new Map<string, number>();\n for (const e of graph.edges) {\n const key = chipKey(e.relation);\n counts.set(key, (counts.get(key) ?? 0) + 1);\n }\n const keys = [...counts.keys()].sort((a, b) => {\n const rank = (k: string) => (k === \"part of\" ? 0 : k === \"uses\" ? 1 : 2);\n return rank(a) - rank(b) || a.localeCompare(b);\n });\n for (const key of keys) {",
+ "span": "L35-L46"
+ }
+ },
+ {
+ "id": "viewer/main.ts#renderChips.rank",
+ "name": "rank",
+ "kind": "function",
+ "path": "viewer/main.ts",
+ "span": "L43-L43",
+ "signature": "rank = (k: string)",
+ "exported": false,
+ "origin": "ast",
+ "body_hash": "2b14b986fe4648076445602ac03c0f7c788760e8910fa9322617251aa60af5ce",
+ "summary_state": "ready",
+ "summary": "Establishes a ranking system for edge types to ensure they are displayed in a meaningful order.",
+ "crux": {
+ "code": " const rank = (k: string) => (k === \"part of\" ? 0 : k === \"uses\" ? 1 : 2);",
+ "span": "L43-L43"
+ }
+ },
+ {
+ "id": "viewer/main.ts#renderLegend",
+ "name": "renderLegend",
+ "kind": "function",
+ "path": "viewer/main.ts",
+ "span": "L74-L94",
+ "signature": "function renderLegend(): void",
+ "exported": false,
+ "origin": "ast",
+ "body_hash": "ec1a1aba1d086d035890c60aadf98d7418c018c5488f106100102deaf0eafc01",
+ "summary_state": "ready",
+ "summary": "Creates a legend for node types in the graph, providing users with context about the displayed data.",
+ "crux": {
+ "code": " const graph = activeGraph();\n if (!graph) return;\n const counts = new Map<string, number>();\n for (const n of graph.nodes) counts.set(n.type, (counts.get(n.type) ?? 0) + 1);\n for (const [type, count] of counts) {\n const chip = document.createElement(\"button\");\n chip.type = \"button\";\n chip.className = \"lchip\" + (view.hiddenTypes[type] ? \" off\" : \"\");\n chip.innerHTML = `<span class=\"sw\" style=\"background:${cvar(colorToken(graphTab(), type))}\"></span>${type} <span style=\"color:var(--muted);font-weight:500\">${count}</span>`;\n chip.addEventListener(\"click\", () => {\n view.hiddenTypes[type] = !view.hiddenTypes[type];\n renderLegend();",
+ "span": "L77-L88"
+ }
+ },
+ {
+ "id": "viewer/main.ts#setTab",
+ "name": "setTab",
+ "kind": "function",
+ "path": "viewer/main.ts",
+ "span": "L129-L167",
+ "signature": "function setTab(tab: Tab): void",
+ "exported": false,
+ "origin": "ast",
+ "body_hash": "c269ec25c7011b7343bdcec22729b23b0c65a57255598ac5145a46397809b321",
+ "summary_state": "ready",
+ "summary": "Handles the logic for switching between different graph views, ensuring the UI reflects the current context accurately.",
+ "crux": {
+ "code": " state.tab = tab;\n document.querySelectorAll<HTMLButtonElement>(\".tab\").forEach((b) => {\n b.setAttribute(\"aria-selected\", b.dataset.tab === tab ? \"true\" : \"false\");\n });\n const isOutline = tab === \"outline\";\n $(\"canvasWrap\").hidden = isOutline;\n $(\"outlineView\").hidden = !isOutline;\n view.hiddenRels = {};\n view.hiddenTypes = {};\n view.selected = null;\n showDetail(null);\n",
+ "span": "L130-L141"
+ }
+ },
+ {
+ "id": "viewer/main.ts#showDetail",
+ "name": "showDetail",
+ "kind": "function",
+ "path": "viewer/main.ts",
+ "span": "L115-L124",
+ "signature": "function showDetail(id: string | null): void",
+ "exported": false,
+ "origin": "ast",
+ "body_hash": "e2b6f6a27ee1e3bac515ec8140678caa7c6cff3baab943cf43f8fdbdd7ab2e62",
+ "summary_state": "ready",
+ "summary": "Displays detailed information about a selected graph element, enhancing user interaction and understanding.",
+ "crux": {
+ "code": " view.focus(next);\n }\n });",
+ "span": "L121-L123"
+ }
+ },
+ {
+ "id": "viewer/main.ts#showEmpty",
+ "name": "showEmpty",
+ "kind": "function",
+ "path": "viewer/main.ts",
+ "span": "L169-L173",
+ "signature": "function showEmpty(html: string): void",
+ "exported": false,
+ "origin": "ast",
+ "body_hash": "981ef1b3d68cfcc89b2804a326c87ce023df618bfee612f158fa72291fe7a6d1",
+ "summary_state": "ready",
+ "summary": "Displays a message when no graph data is available, guiding users on how to generate the necessary data.",
+ "crux": {
+ "code": " empty.innerHTML = html;\n empty.hidden = false;",
+ "span": "L171-L172"
+ }
+ },
+ {
+ "id": "viewer/main.ts#Tab",
+ "name": "Tab",
+ "kind": "type",
+ "path": "viewer/main.ts",
+ "span": "L10-L10",
+ "signature": "type Tab = \"context\" | \"code\" | \"outline\";",
+ "exported": false,
+ "origin": "ast",
+ "body_hash": "4cd3b4afb6647f09ba09efccca7c53a333edbebe109fb1e24db04aa24df610de",
+ "summary_state": "ready",
+ "summary": "Defines the possible tab types for the viewer, ensuring that only valid tab selections are made.",
+ "crux": null
+ },
+ {
+ "id": "viewer/main.ts#updateCounts",
+ "name": "updateCounts",
+ "kind": "function",
+ "path": "viewer/main.ts",
+ "span": "L103-L112",
+ "signature": "function updateCounts(): void",
+ "exported": false,
+ "origin": "ast",
+ "body_hash": "170a2eec2d377c150839d170cd45a244584ecc9fdbd44ad194e8cac97fdfafb6",
+ "summary_state": "ready",
+ "summary": "Refreshes the displayed counts of nodes and edges based on the active graph, ensuring accurate information is presented.",
+ "crux": {
+ "code": " el.textContent = graph ? `${graph.meta.nodeCount} nodes · ${graph.meta.edgeCount} links` : \"\";",
+ "span": "L110-L110"
+ }
+ },
+ {
+ "id": "viewer/main.ts#updateShownCount",
+ "name": "updateShownCount",
+ "kind": "function",
+ "path": "viewer/main.ts",
+ "span": "L96-L101",
+ "signature": "function updateShownCount(): void",
+ "exported": false,
+ "origin": "ast",
+ "body_hash": "11ab0ffa5da9e8d010f80cb1f95962900b0649019b7876e2b5213b85605d75ee",
+ "summary_state": "ready",
+ "summary": "Updates the displayed count of visible nodes in the graph, helping users understand the current view's scope.",
+ "crux": {
+ "code": " const shown = graph.nodes.filter((n) => !view.hiddenTypes[n.type]).length;\n $(\"lcount\").textContent = `${shown} / ${graph.nodes.length} nodes shown`;",
+ "span": "L99-L100"
+ }
+ },
+ {
+ "id": "viewer/tree.ts",
+ "name": "tree.ts",
+ "kind": "file",
+ "path": "viewer/tree.ts",
+ "span": "L1-L67",
+ "signature": null,
+ "exported": true,
+ "origin": "ast",
+ "body_hash": "d66e0157f4c2a1525c16505306eb3aabce82565c3d0e56199ea5b7a860290b01",
+ "chars": 2750,
+ "summary_state": "ready",
+ "summary": "Generates a collapsible tree view of a code graph's hierarchy, allowing users to navigate through files, classes, and methods.",
+ "crux": {
+ "code": " host.innerHTML =\n '<div class=\"tree-tools\"><button data-tool=\"expand\">Expand all</button><button data-tool=\"collapse\">Collapse all</button></div>' +\n files.map(row).join(\"\");",
+ "span": "L44-L46"
+ }
+ },
+ {
+ "id": "viewer/tree.ts#esc",
+ "name": "esc",
+ "kind": "function",
+ "path": "viewer/tree.ts",
+ "span": "L7-L9",
+ "signature": "function esc(s: string): string",
+ "exported": false,
+ "origin": "ast",
+ "body_hash": "9fb927f7f1c881ee1fe325c0dc8a25b8c5cdb2c101b08ae935a35bb428f5bbdb",
+ "summary_state": "ready",
+ "summary": "Escapes special HTML characters in a string to prevent rendering issues in the tree view.",
+ "crux": {
+ "code": " return s.replace(/&/g, \"&amp;\").replace(/</g, \"&lt;\");\n}",
+ "span": "L8-L9"
+ }
+ },
+ {
+ "id": "viewer/tree.ts#renderOutline",
+ "name": "renderOutline",
+ "kind": "function",
+ "path": "viewer/tree.ts",
+ "span": "L11-L66",
+ "signature": "function renderOutline( host: HTMLElement, graph: VizGraph, selected: string | null, openState: Record<string, boolean>, onSelect: (id: string) => void, ): void",
+ "exported": true,
+ "origin": "ast",
+ "body_hash": "1448ed396d7ec6d8adc0e375aba7be5465c4e4db6d4184c6b5b01ac5a0788591",
+ "summary_state": "ready",
+ "summary": "Renders the outline view of the code graph, managing the display of files and their hierarchical relationships.",
+ "crux": {
+ "code": " const kids = (pid: string) =>\n graph.edges\n .filter((e) => e.relation === \"contains\" && e.source === pid)\n .map((e) => graph.nodes.find((n) => n.id === e.target))\n .filter((n): n is NonNullable<typeof n> => Boolean(n));",
+ "span": "L18-L22"
+ }
+ },
+ {
+ "id": "viewer/tree.ts#renderOutline.countDesc",
+ "name": "countDesc",
+ "kind": "function",
+ "path": "viewer/tree.ts",
+ "span": "L23-L26",
+ "signature": "countDesc = (pid: string): number",
+ "exported": true,
+ "origin": "ast",
+ "body_hash": "1054af458d2de230dfb45cea7a5a0141f2f4d12521ee04f0919e7defdea719dd",
+ "summary_state": "ready",
+ "summary": "Counts the total number of descendant nodes for a given parent node, including its children and their descendants.",
+ "crux": {
+ "code": " return k.length + k.reduce((sum, c) => sum + countDesc(c.id), 0);\n };",
+ "span": "L25-L26"
+ }
+ },
+ {
+ "id": "viewer/tree.ts#renderOutline.kids",
+ "name": "kids",
+ "kind": "function",
+ "path": "viewer/tree.ts",
+ "span": "L18-L22",
+ "signature": "kids = (pid: string)",
+ "exported": true,
+ "origin": "ast",
+ "body_hash": "67a4d31f225a0006966aa2a39bdf245c514475f777082275626585879ce9b867",
+ "summary_state": "ready",
+ "summary": "Retrieves the child nodes of a given parent node in the graph based on the 'contains' relationship.",
+ "crux": {
+ "code": " .filter((e) => e.relation === \"contains\" && e.source === pid)\n .map((e) => graph.nodes.find((n) => n.id === e.target))",
+ "span": "L20-L21"
+ }
+ },
+ {
+ "id": "viewer/tree.ts#renderOutline.row",
+ "name": "row",
+ "kind": "function",
+ "path": "viewer/tree.ts",
+ "span": "L29-L42",
+ "signature": "row = (node: (typeof files)[number]): string",
+ "exported": true,
+ "origin": "ast",
+ "body_hash": "a62af44af8ff57bd1307237e130956ce85cb42fc0c2fc4889907fd4e87e75ab2",
+ "summary_state": "ready",
+ "summary": "Constructs the HTML representation of a tree row for a given node, including its children and symbol count.",
+ "crux": {
+ "code": " const children = kids(node.id);\n const open = openState[node.id] !== false;\n let html = `<button class=\"tree-row${open ? \" open\" : \"\"}${selected === node.id ? \" sel\" : \"\"}\"` +\n ` data-id=\"${esc(node.id)}\" data-haskids=\"${children.length ? 1 : 0}\">` +\n `<span class=\"chev\">${children.length ? \"▶\" : \"\"}</span>` +\n `<span class=\"k\" style=\"background:${cvar(colorToken(\"code\", node.type))}\"></span>` +\n `<span class=\"t${node.type === \"file\" ? \" mono\" : \"\"}\">${esc(node.name)}</span>` +\n `<span class=\"badge\">${children.length ? countDesc(node.id) + \" sym\" : esc(node.type)}</span></button>`;\n if (children.length && open) {\n html += `<div class=\"tree-kids\">${children.map(row).join(\"\")}</div>`;\n }\n return html;",
+ "span": "L30-L41"
+ }
+ }
+ ],
+ "edges": [
+ {
+ "source": "bench/agent.ts",
+ "target": "bench/agent.ts#AgentResult",
+ "relation": "contains",
+ "confidence": "extracted"
+ },
+ {
+ "source": "bench/agent.ts",
+ "target": "bench/agent.ts#globToRegExp",
+ "relation": "contains",
+ "confidence": "extracted"
+ },
+ {
+ "source": "bench/agent.ts",
+ "target": "bench/agent.ts#listFiles",
+ "relation": "contains",
+ "confidence": "extracted"
+ },
+ {
+ "source": "bench/agent.ts",
+ "target": "bench/agent.ts#runAgent",
+ "relation": "contains",
+ "confidence": "extracted"
+ },
+ {
+ "source": "bench/agent.ts",
+ "target": "bench/agent.ts#RunAgentOptions",
+ "relation": "contains",
+ "confidence": "extracted"
+ },
+ {
+ "source": "bench/agent.ts",
+ "target": "bench/agent.ts#runTool",
+ "relation": "contains",
+ "confidence": "extracted"
+ },
+ {
+ "source": "bench/agent.ts",
+ "target": "bench/agent.ts#safePath",
+ "relation": "contains",
+ "confidence": "extracted"
+ },
+ {
+ "source": "bench/agent.ts",
+ "target": "bench/llm.ts",
+ "relation": "imports",
+ "confidence": "extracted"
+ },
+ {
+ "source": "bench/agent.ts",
+ "target": "node:fs",
+ "relation": "imports",
+ "confidence": "extracted"
+ },
+ {
+ "source": "bench/agent.ts",
+ "target": "node:path",
+ "relation": "imports",
+ "confidence": "extracted"
+ },
+ {
+ "source": "bench/agent.ts",
+ "target": "src/ai/llm/types.ts",
+ "relation": "imports",
+ "confidence": "extracted"
+ },
+ {
+ "source": "bench/agent.ts",
+ "target": "src/ask/ask.ts",
+ "relation": "imports",
+ "confidence": "extracted"
+ },
+ {
+ "source": "bench/agent.ts",
+ "target": "src/ingest/fs.ts",
+ "relation": "imports",
+ "confidence": "extracted"
+ },
+ {
+ "source": "bench/agent.ts#listFiles",
+ "target": "bench/agent.ts#listFiles.walk",
+ "relation": "calls",
+ "confidence": "extracted"
+ },
+ {
+ "source": "bench/agent.ts#listFiles",
+ "target": "bench/agent.ts#listFiles.walk",
+ "relation": "contains",
+ "confidence": "extracted"
+ },
+ {
+ "source": "bench/agent.ts#listFiles.walk",
+ "target": "bench/agent.ts#listFiles.walk",
+ "relation": "calls",
+ "confidence": "extracted"
+ },
+ {
+ "source": "bench/agent.ts#runAgent",
+ "target": "bench/agent.ts#runAgent.slideCacheBreakpoint",
+ "relation": "calls",
+ "confidence": "extracted"
+ },
+ {
+ "source": "bench/agent.ts#runAgent",
+ "target": "bench/agent.ts#runTool",
+ "relation": "calls",
+ "confidence": "extracted"
+ },
+ {
+ "source": "bench/agent.ts#runAgent",
+ "target": "bench/llm.ts#makeChatModel",
+ "relation": "calls",
+ "confidence": "inferred"
+ },
+ {
+ "source": "bench/agent.ts#runAgent",
+ "target": "bench/agent.ts#runAgent.slideCacheBreakpoint",
+ "relation": "contains",
+ "confidence": "extracted"
+ },
+ {
+ "source": "bench/agent.ts#runTool",
+ "target": "bench/agent.ts#globToRegExp",
+ "relation": "calls",
+ "confidence": "extracted"
+ },
+ {
+ "source": "bench/agent.ts#runTool",
+ "target": "bench/agent.ts#listFiles",
+ "relation": "calls",
+ "confidence": "extracted"
+ },
+ {
+ "source": "bench/agent.ts#runTool",
+ "target": "bench/agent.ts#safePath",
+ "relation": "calls",
+ "confidence": "extracted"
+ },
+ {
+ "source": "bench/agent.ts#runTool",
+ "target": "src/ask/ask.ts#ask",
+ "relation": "calls",
+ "confidence": "inferred"
+ },
+ {
+ "source": "bench/agent.ts#runTool",
+ "target": "src/ask/ask.ts#formatAsk",
+ "relation": "calls",
+ "confidence": "inferred"
+ },
+ {
+ "source": "bench/agent.ts#runTool",
+ "target": "src/ask/ask.ts#formatSkeleton",
+ "relation": "calls",
+ "confidence": "inferred"
+ },
+ {
+ "source": "bench/agent.ts#runTool",
+ "target": "src/ask/ask.ts#skeleton",
+ "relation": "calls",
+ "confidence": "inferred"
+ },
+ {
+ "source": "bench/judge.ts",
+ "target": "bench/judge.ts#extractJson",
+ "relation": "contains",
+ "confidence": "extracted"
+ },
+ {
+ "source": "bench/judge.ts",
+ "target": "bench/judge.ts#judge",
+ "relation": "contains",
+ "confidence": "extracted"
+ },
+ {
+ "source": "bench/judge.ts",
+ "target": "bench/judge.ts#JudgeInput",
+ "relation": "contains",
+ "confidence": "extracted"
+ },
+ {
+ "source": "bench/judge.ts",
+ "target": "bench/judge.ts#Verdict",
+ "relation": "contains",
+ "confidence": "extracted"
+ },
+ {
+ "source": "bench/judge.ts",
+ "target": "bench/llm.ts",
+ "relation": "imports",
+ "confidence": "extracted"
+ },
+ {
+ "source": "bench/judge.ts",
+ "target": "src/ai/llm/types.ts",
+ "relation": "imports",
+ "confidence": "extracted"
+ },
+ {
+ "source": "bench/judge.ts#judge",
+ "target": "bench/judge.ts#extractJson",
+ "relation": "calls",
+ "confidence": "extracted"
+ },
+ {
+ "source": "bench/judge.ts#judge",
+ "target": "bench/llm.ts#makeChatModel",
+ "relation": "calls",
+ "confidence": "inferred"
+ },
+ {
+ "source": "bench/llm.ts",
+ "target": "bench/llm.ts#makeChatModel",
+ "relation": "contains",
+ "confidence": "extracted"
+ },
+ {
+ "source": "bench/llm.ts",
+ "target": "src/ai/llm/factory.ts",
+ "relation": "imports",
+ "confidence": "extracted"
+ },
+ {
+ "source": "bench/llm.ts",
+ "target": "src/ai/llm/types.ts",
+ "relation": "imports",
+ "confidence": "extracted"
+ },
+ {
+ "source": "bench/llm.ts",
+ "target": "src/ai/providers.ts",
+ "relation": "imports",
+ "confidence": "extracted"
+ },
+ {
+ "source": "bench/llm.ts#makeChatModel",
+ "target": "src/ai/llm/factory.ts#createChatModel",
+ "relation": "calls",
+ "confidence": "inferred"
+ },
+ {
+ "source": "bench/llm.ts#makeChatModel",
+ "target": "src/ai/providers.ts#resolveConfig",
+ "relation": "calls",
+ "confidence": "inferred"
+ },
+ {
+ "source": "bench/report.ts",
+ "target": "bench/report.ts#aggregate",
+ "relation": "contains",
+ "confidence": "extracted"
+ },
+ {
+ "source": "bench/report.ts",
+ "target": "bench/report.ts#Arm",
+ "relation": "contains",
+ "confidence": "extracted"
+ },
+ {
+ "source": "bench/report.ts",
+ "target": "bench/report.ts#ArmAgg",
+ "relation": "contains",
+ "confidence": "extracted"
+ },
+ {
+ "source": "bench/report.ts",
+ "target": "bench/report.ts#buildMarkdown",
+ "relation": "contains",
+ "confidence": "extracted"
+ },
+ {
+ "source": "bench/report.ts",
+ "target": "bench/report.ts#costOf",
+ "relation": "contains",
+ "confidence": "extracted"
+ },
+ {
+ "source": "bench/report.ts",
+ "target": "bench/report.ts#fmt",
+ "relation": "contains",
+ "confidence": "extracted"
+ },
+ {
+ "source": "bench/report.ts",
+ "target": "bench/report.ts#mean",
+ "relation": "contains",
+ "confidence": "extracted"
+ },
+ {
+ "source": "bench/report.ts",
+ "target": "bench/report.ts#metricTable",
+ "relation": "contains",
+ "confidence": "extracted"
+ },
+ {
+ "source": "bench/report.ts",
+ "target": "bench/report.ts#pctDelta",
+ "relation": "contains",
+ "confidence": "extracted"
+ },
+ {
+ "source": "bench/report.ts",
+ "target": "bench/report.ts#Row",
+ "relation": "contains",
+ "confidence": "extracted"
+ },
+ {
+ "source": "bench/report.ts",
+ "target": "bench/report.ts#verdictFor",
+ "relation": "contains",
+ "confidence": "extracted"
+ },
+ {
+ "source": "bench/report.ts#aggregate",
+ "target": "bench/report.ts#costOf",
+ "relation": "calls",
+ "confidence": "extracted"
+ },
+ {
+ "source": "bench/report.ts#aggregate",
+ "target": "bench/report.ts#mean",
+ "relation": "calls",
+ "confidence": "extracted"
+ },
+ {
+ "source": "bench/report.ts#buildMarkdown",
+ "target": "bench/report.ts#aggregate",
+ "relation": "calls",
+ "confidence": "extracted"
+ },
+ {
+ "source": "bench/report.ts#buildMarkdown",
+ "target": "bench/report.ts#metricTable",
+ "relation": "calls",
+ "confidence": "extracted"
+ },
+ {
+ "source": "bench/report.ts#buildMarkdown",
+ "target": "bench/report.ts#verdictFor",
+ "relation": "calls",
+ "confidence": "extracted"
+ },
+ {
+ "source": "bench/report.ts#metricTable",
+ "target": "bench/report.ts#aggregate",
+ "relation": "calls",
+ "confidence": "extracted"
+ },
+ {
+ "source": "bench/report.ts#metricTable",
+ "target": "bench/report.ts#metricTable.cells",
+ "relation": "calls",
+ "confidence": "extracted"
+ },
+ {
+ "source": "bench/report.ts#metricTable",
+ "target": "bench/report.ts#metricTable.cells",
+ "relation": "contains",
+ "confidence": "extracted"
+ },
+ {
+ "source": "bench/report.ts#verdictFor",
+ "target": "bench/report.ts#pctDelta",
+ "relation": "calls",
+ "confidence": "extracted"
+ },
+ {
+ "source": "bench/run.ts",
+ "target": "bench/run.ts#main",
+ "relation": "calls",
+ "confidence": "extracted"
+ },
+ {
+ "source": "bench/run.ts",
+ "target": "bench/run.ts#Args",
+ "relation": "contains",
+ "confidence": "extracted"
+ },
+ {
+ "source": "bench/run.ts",
+ "target": "bench/run.ts#main",
+ "relation": "contains",
+ "confidence": "extracted"
+ },
+ {
+ "source": "bench/run.ts",
+ "target": "bench/run.ts#parseArgs",
+ "relation": "contains",
+ "confidence": "extracted"
+ },
+ {
+ "source": "bench/run.ts",
+ "target": "bench/run.ts#pool",
+ "relation": "contains",
+ "confidence": "extracted"
+ },
+ {
+ "source": "bench/run.ts",
+ "target": "bench/agent.ts",
+ "relation": "imports",
+ "confidence": "extracted"
+ },
+ {
+ "source": "bench/run.ts",
+ "target": "bench/judge.ts",
+ "relation": "imports",
+ "confidence": "extracted"
+ },
+ {
+ "source": "bench/run.ts",
+ "target": "bench/llm.ts",
+ "relation": "imports",
+ "confidence": "extracted"
+ },
+ {
+ "source": "bench/run.ts",
+ "target": "bench/report.ts",
+ "relation": "imports",
+ "confidence": "extracted"
+ },
+ {
+ "source": "bench/run.ts",
+ "target": "bench/tasks.ts",
+ "relation": "imports",
+ "confidence": "extracted"
+ },
+ {
+ "source": "bench/run.ts",
+ "target": "dotenv/config",
+ "relation": "imports",
+ "confidence": "extracted"
+ },
+ {
+ "source": "bench/run.ts",
+ "target": "node:fs",
+ "relation": "imports",
+ "confidence": "extracted"
+ },
+ {
+ "source": "bench/run.ts",
+ "target": "node:os",
+ "relation": "imports",
+ "confidence": "extracted"
+ },
+ {
+ "source": "bench/run.ts",
+ "target": "node:path",
+ "relation": "imports",
+ "confidence": "extracted"
+ },
+ {
+ "source": "bench/run.ts",
+ "target": "node:url",
+ "relation": "imports",
+ "confidence": "extracted"
+ },
+ {
+ "source": "bench/run.ts",
+ "target": "src/ai/providers.ts",
+ "relation": "imports",
+ "confidence": "extracted"
+ },
+ {
+ "source": "bench/run.ts",
+ "target": "src/ask/ask.ts",
+ "relation": "imports",
+ "confidence": "extracted"
+ },
+ {
+ "source": "bench/run.ts",
+ "target": "src/graph/build.ts",
+ "relation": "imports",
+ "confidence": "extracted"
+ },
+ {
+ "source": "bench/run.ts#main",
+ "target": "bench/judge.ts#judge",
+ "relation": "calls",
+ "confidence": "inferred"
+ },
+ {
+ "source": "bench/run.ts#main",
+ "target": "bench/llm.ts#makeChatModel",
+ "relation": "calls",
+ "confidence": "inferred"
},
{
- "id": "viewer/main.ts#updateShownCount",
- "name": "updateShownCount",
- "kind": "function",
- "path": "viewer/main.ts",
- "span": "L96-L101",
- "signature": "function updateShownCount(): void",
- "exported": false,
- "origin": "ast",
- "body_hash": "11ab0ffa5da9e8d010f80cb1f95962900b0649019b7876e2b5213b85605d75ee",
- "summary_state": "ready",
- "summary": "Updates the displayed count of visible nodes in the graph, helping users understand the current view's scope.",
- "crux": {
- "code": " const shown = graph.nodes.filter((n) => !view.hiddenTypes[n.type]).length;\n $(\"lcount\").textContent = `${shown} / ${graph.nodes.length} nodes shown`;",
- "span": "L99-L100"
- }
+ "source": "bench/run.ts#main",
+ "target": "bench/report.ts#buildMarkdown",
+ "relation": "calls",
+ "confidence": "inferred"
},
{
- "id": "viewer/tree.ts",
- "name": "tree.ts",
- "kind": "file",
- "path": "viewer/tree.ts",
- "span": "L1-L67",
- "signature": null,
- "exported": true,
- "origin": "ast",
- "body_hash": "d66e0157f4c2a1525c16505306eb3aabce82565c3d0e56199ea5b7a860290b01",
- "chars": 2750,
- "summary_state": "ready",
- "summary": "Generates a collapsible tree view of a code graph's hierarchy, allowing users to navigate through files, classes, and methods.",
- "crux": {
- "code": " host.innerHTML =\n '<div class=\"tree-tools\"><button data-tool=\"expand\">Expand all</button><button data-tool=\"collapse\">Collapse all</button></div>' +\n files.map(row).join(\"\");",
- "span": "L44-L46"
- }
+ "source": "bench/run.ts#main",
+ "target": "bench/run.ts#parseArgs",
+ "relation": "calls",
+ "confidence": "extracted"
},
{
- "id": "viewer/tree.ts#esc",
- "name": "esc",
- "kind": "function",
- "path": "viewer/tree.ts",
- "span": "L7-L9",
- "signature": "function esc(s: string): string",
- "exported": false,
- "origin": "ast",
- "body_hash": "9fb927f7f1c881ee1fe325c0dc8a25b8c5cdb2c101b08ae935a35bb428f5bbdb",
- "summary_state": "ready",
- "summary": "Escapes special HTML characters in a string to prevent rendering issues in the tree view.",
- "crux": {
- "code": " return s.replace(/&/g, \"&amp;\").replace(/</g, \"&lt;\");\n}",
- "span": "L8-L9"
- }
+ "source": "bench/run.ts#main",
+ "target": "bench/run.ts#pool",
+ "relation": "calls",
+ "confidence": "extracted"
},
{
- "id": "viewer/tree.ts#renderOutline",
- "name": "renderOutline",
- "kind": "function",
- "path": "viewer/tree.ts",
- "span": "L11-L66",
- "signature": "function renderOutline( host: HTMLElement, graph: VizGraph, selected: string | null, openState: Record<string, boolean>, onSelect: (id: string) => void, ): void",
- "exported": true,
- "origin": "ast",
- "body_hash": "1448ed396d7ec6d8adc0e375aba7be5465c4e4db6d4184c6b5b01ac5a0788591",
- "summary_state": "ready",
- "summary": "Renders the outline view of the code graph, managing the display of files and their hierarchical relationships.",
- "crux": {
- "code": " const kids = (pid: string) =>\n graph.edges\n .filter((e) => e.relation === \"contains\" && e.source === pid)\n .map((e) => graph.nodes.find((n) => n.id === e.target))\n .filter((n): n is NonNullable<typeof n> => Boolean(n));",
- "span": "L18-L22"
- }
+ "source": "bench/run.ts#main",
+ "target": "src/ai/providers.ts#resolveConfig",
+ "relation": "calls",
+ "confidence": "inferred"
},
{
- "id": "viewer/tree.ts#renderOutline.countDesc",
- "name": "countDesc",
- "kind": "function",
- "path": "viewer/tree.ts",
- "span": "L23-L26",
- "signature": "countDesc = (pid: string): number",
- "exported": true,
- "origin": "ast",
- "body_hash": "1054af458d2de230dfb45cea7a5a0141f2f4d12521ee04f0919e7defdea719dd",
- "summary_state": "ready",
- "summary": "Counts the total number of descendant nodes for a given parent node, including its children and their descendants.",
- "crux": {
- "code": " return k.length + k.reduce((sum, c) => sum + countDesc(c.id), 0);\n };",
- "span": "L25-L26"
- }
+ "source": "bench/run.ts#main",
+ "target": "src/ask/ask.ts#ask",
+ "relation": "calls",
+ "confidence": "inferred"
},
{
- "id": "viewer/tree.ts#renderOutline.kids",
- "name": "kids",
- "kind": "function",
- "path": "viewer/tree.ts",
- "span": "L18-L22",
- "signature": "kids = (pid: string)",
- "exported": true,
- "origin": "ast",
- "body_hash": "67a4d31f225a0006966aa2a39bdf245c514475f777082275626585879ce9b867",
- "summary_state": "ready",
- "summary": "Retrieves the child nodes of a given parent node in the graph based on the 'contains' relationship.",
- "crux": {
- "code": " .filter((e) => e.relation === \"contains\" && e.source === pid)\n .map((e) => graph.nodes.find((n) => n.id === e.target))",
- "span": "L20-L21"
- }
+ "source": "bench/run.ts#main",
+ "target": "src/ask/ask.ts#formatAsk",
+ "relation": "calls",
+ "confidence": "inferred"
},
{
- "id": "viewer/tree.ts#renderOutline.row",
- "name": "row",
- "kind": "function",
- "path": "viewer/tree.ts",
- "span": "L29-L42",
- "signature": "row = (node: (typeof files)[number]): string",
- "exported": true,
- "origin": "ast",
- "body_hash": "a62af44af8ff57bd1307237e130956ce85cb42fc0c2fc4889907fd4e87e75ab2",
- "summary_state": "ready",
- "summary": "Constructs the HTML representation of a tree row for a given node, including its children and symbol count.",
- "crux": {
- "code": " const children = kids(node.id);\n const open = openState[node.id] !== false;\n let html = `<button class=\"tree-row${open ? \" open\" : \"\"}${selected === node.id ? \" sel\" : \"\"}\"` +\n ` data-id=\"${esc(node.id)}\" data-haskids=\"${children.length ? 1 : 0}\">` +\n `<span class=\"chev\">${children.length ? \"▶\" : \"\"}</span>` +\n `<span class=\"k\" style=\"background:${cvar(colorToken(\"code\", node.type))}\"></span>` +\n `<span class=\"t${node.type === \"file\" ? \" mono\" : \"\"}\">${esc(node.name)}</span>` +\n `<span class=\"badge\">${children.length ? countDesc(node.id) + \" sym\" : esc(node.type)}</span></button>`;\n if (children.length && open) {\n html += `<div class=\"tree-kids\">${children.map(row).join(\"\")}</div>`;\n }\n return html;",
- "span": "L30-L41"
- }
- }
- ],
- "edges": [
+ "source": "bench/run.ts#main",
+ "target": "src/graph/build.ts#buildGraph",
+ "relation": "calls",
+ "confidence": "inferred"
+ },
{
- "source": "bench/agent.ts",
- "target": "bench/agent.ts#AgentResult",
+ "source": "bench/run.ts#pool",
+ "target": "bench/run.ts#pool.worker",
"relation": "contains",
"confidence": "extracted"
},
{
- "source": "bench/agent.ts",
- "target": "bench/agent.ts#globToRegExp",
- "relation": "contains",
+ "source": "bench/selfcheck.ts",
+ "target": "bench/selfcheck.ts#main",
+ "relation": "calls",
"confidence": "extracted"
},
{
- "source": "bench/agent.ts",
- "target": "bench/agent.ts#listFiles",
+ "source": "bench/selfcheck.ts",
+ "target": "bench/selfcheck.ts#main",
"relation": "contains",
"confidence": "extracted"
},
{
- "source": "bench/agent.ts",
- "target": "bench/agent.ts#runAgent",
+ "source": "bench/selfcheck.ts",
+ "target": "bench/selfcheck.ts#makeStubModel",
"relation": "contains",
"confidence": "extracted"
},
{
- "source": "bench/agent.ts",
- "target": "bench/agent.ts#RunAgentOptions",
- "relation": "contains",
+ "source": "bench/selfcheck.ts",
+ "target": "bench/agent.ts",
+ "relation": "imports",
"confidence": "extracted"
},
{
- "source": "bench/agent.ts",
- "target": "bench/agent.ts#runTool",
- "relation": "contains",
+ "source": "bench/selfcheck.ts",
+ "target": "bench/judge.ts",
+ "relation": "imports",
"confidence": "extracted"
},
{
- "source": "bench/agent.ts",
- "target": "bench/agent.ts#safePath",
- "relation": "contains",
+ "source": "bench/selfcheck.ts",
+ "target": "bench/report.ts",
+ "relation": "imports",
"confidence": "extracted"
},
{
- "source": "bench/agent.ts",
- "target": "bench/llm.ts",
+ "source": "bench/selfcheck.ts",
+ "target": "node:assert/strict",
"relation": "imports",
"confidence": "extracted"
},
{
- "source": "bench/agent.ts",
+ "source": "bench/selfcheck.ts",
"target": "node:fs",
"relation": "imports",
"confidence": "extracted"
},
{
- "source": "bench/agent.ts",
+ "source": "bench/selfcheck.ts",
+ "target": "node:os",
+ "relation": "imports",
+ "confidence": "extracted"
+ },
+ {
+ "source": "bench/selfcheck.ts",
"target": "node:path",
"relation": "imports",
"confidence": "extracted"
},
{
- "source": "bench/agent.ts",
+ "source": "bench/selfcheck.ts",
"target": "src/ai/llm/types.ts",
"relation": "imports",
"confidence": "extracted"
},
{
- "source": "bench/agent.ts",
- "target": "src/ask/ask.ts",
- "relation": "imports",
+ "source": "bench/selfcheck.ts#main",
+ "target": "bench/judge.ts#judge",
+ "relation": "calls",
+ "confidence": "inferred"
+ },
+ {
+ "source": "bench/selfcheck.ts#main",
+ "target": "bench/report.ts#buildMarkdown",
+ "relation": "calls",
+ "confidence": "inferred"
+ },
+ {
+ "source": "bench/selfcheck.ts#main",
+ "target": "bench/selfcheck.ts#makeStubModel",
+ "relation": "calls",
"confidence": "extracted"
},
{
- "source": "bench/agent.ts",
- "target": "src/ingest/fs.ts",
- "relation": "imports",
+ "source": "bench/selfcheck.ts#makeStubModel",
+ "target": "bench/selfcheck.ts#makeStubModel.create",
+ "relation": "contains",
"confidence": "extracted"
},
{
- "source": "bench/agent.ts#listFiles",
- "target": "bench/agent.ts#listFiles.walk",
+ "source": "bench/tasks.ts",
+ "target": "bench/tasks.ts#repoPath",
"relation": "calls",
"confidence": "extracted"
},
{
- "source": "bench/agent.ts#listFiles",
- "target": "bench/agent.ts#listFiles.walk",
+ "source": "bench/tasks.ts",
+ "target": "bench/tasks.ts#Corpus",
+ "relation": "contains",
+ "confidence": "extracted"
+ },
+ {
+ "source": "bench/tasks.ts",
+ "target": "bench/tasks.ts#repoPath",
+ "relation": "contains",
+ "confidence": "extracted"
+ },
+ {
+ "source": "bench/tasks.ts",
+ "target": "bench/tasks.ts#Task",
"relation": "contains",
"confidence": "extracted"
},
{
- "source": "bench/agent.ts#listFiles.walk",
- "target": "bench/agent.ts#listFiles.walk",
- "relation": "calls",
+ "source": "bench/tasks.ts",
+ "target": "node:path",
+ "relation": "imports",
"confidence": "extracted"
},
{
- "source": "bench/agent.ts#runAgent",
- "target": "bench/agent.ts#runAgent.slideCacheBreakpoint",
- "relation": "calls",
+ "source": "bench/tasks.ts",
+ "target": "node:url",
+ "relation": "imports",
"confidence": "extracted"
},
{
- "source": "bench/agent.ts#runAgent",
- "target": "bench/agent.ts#runTool",
+ "source": "bench/token-ab.ts",
+ "target": "bench/llm.ts#makeChatModel",
"relation": "calls",
- "confidence": "extracted"
+ "confidence": "inferred"
},
{
- "source": "bench/agent.ts#runAgent",
- "target": "bench/llm.ts#makeChatModel",
+ "source": "bench/token-ab.ts",
+ "target": "bench/token-ab.ts#main",
"relation": "calls",
- "confidence": "inferred"
+ "confidence": "extracted"
},
{
- "source": "bench/agent.ts#runAgent",
- "target": "bench/agent.ts#runAgent.slideCacheBreakpoint",
+ "source": "bench/token-ab.ts",
+ "target": "bench/token-ab.ts#cost",
"relation": "contains",
"confidence": "extracted"
},
{
- "source": "bench/agent.ts#runTool",
- "target": "bench/agent.ts#globToRegExp",
- "relation": "calls",
+ "source": "bench/token-ab.ts",
+ "target": "bench/token-ab.ts#graftPack",
+ "relation": "contains",
"confidence": "extracted"
},
{
- "source": "bench/agent.ts#runTool",
- "target": "bench/agent.ts#listFiles",
- "relation": "calls",
+ "source": "bench/token-ab.ts",
+ "target": "bench/token-ab.ts#main",
+ "relation": "contains",
"confidence": "extracted"
},
{
- "source": "bench/agent.ts#runTool",
- "target": "bench/agent.ts#safePath",
- "relation": "calls",
+ "source": "bench/token-ab.ts",
+ "target": "bench/token-ab.ts#Metrics",
+ "relation": "contains",
"confidence": "extracted"
},
{
- "source": "bench/agent.ts#runTool",
- "target": "src/ask/ask.ts#ask",
- "relation": "calls",
- "confidence": "inferred"
+ "source": "bench/token-ab.ts",
+ "target": "bench/token-ab.ts#row",
+ "relation": "contains",
+ "confidence": "extracted"
},
{
- "source": "bench/agent.ts#runTool",
- "target": "src/ask/ask.ts#formatAsk",
- "relation": "calls",
- "confidence": "inferred"
+ "source": "bench/token-ab.ts",
+ "target": "bench/token-ab.ts#runAgent",
+ "relation": "contains",
+ "confidence": "extracted"
},
{
- "source": "bench/agent.ts#runTool",
- "target": "src/ask/ask.ts#formatSkeleton",
- "relation": "calls",
- "confidence": "inferred"
+ "source": "bench/token-ab.ts",
+ "target": "bench/token-ab.ts#runRead",
+ "relation": "contains",
+ "confidence": "extracted"
},
{
- "source": "bench/agent.ts#runTool",
- "target": "src/ask/ask.ts#skeleton",
- "relation": "calls",
- "confidence": "inferred"
+ "source": "bench/token-ab.ts",
+ "target": "bench/token-ab.ts#runSearch",
+ "relation": "contains",
+ "confidence": "extracted"
},
{
- "source": "bench/judge.ts",
- "target": "bench/judge.ts#extractJson",
- "relation": "contains",
+ "source": "bench/token-ab.ts",
+ "target": "bench/llm.ts",
+ "relation": "imports",
"confidence": "extracted"
},
{
- "source": "bench/judge.ts",
- "target": "bench/judge.ts#judge",
- "relation": "contains",
+ "source": "bench/token-ab.ts",
+ "target": "dotenv/config",
+ "relation": "imports",
"confidence": "extracted"
},
{
- "source": "bench/judge.ts",
- "target": "bench/judge.ts#JudgeInput",
- "relation": "contains",
+ "source": "bench/token-ab.ts",
+ "target": "node:child_process",
+ "relation": "imports",
"confidence": "extracted"
},
{
- "source": "bench/judge.ts",
- "target": "bench/judge.ts#Verdict",
- "relation": "contains",
+ "source": "bench/token-ab.ts",
+ "target": "node:fs",
+ "relation": "imports",
"confidence": "extracted"
},
{
- "source": "bench/judge.ts",
- "target": "bench/llm.ts",
+ "source": "bench/token-ab.ts",
+ "target": "node:path",
"relation": "imports",
"confidence": "extracted"
},
{
- "source": "bench/judge.ts",
+ "source": "bench/token-ab.ts",
"target": "src/ai/llm/types.ts",
"relation": "imports",
"confidence": "extracted"
},
{
- "source": "bench/judge.ts#judge",
- "target": "bench/judge.ts#extractJson",
+ "source": "bench/token-ab.ts#main",
+ "target": "bench/token-ab.ts#cost",
"relation": "calls",
"confidence": "extracted"
},
{
- "source": "bench/judge.ts#judge",
- "target": "bench/llm.ts#makeChatModel",
+ "source": "bench/token-ab.ts#main",
+ "target": "bench/token-ab.ts#graftPack",
"relation": "calls",
- "confidence": "inferred"
+ "confidence": "extracted"
},
{
- "source": "bench/llm.ts",
- "target": "bench/llm.ts#makeChatModel",
- "relation": "contains",
+ "source": "bench/token-ab.ts#main",
+ "target": "bench/token-ab.ts#main.pct",
+ "relation": "calls",
"confidence": "extracted"
},
{
- "source": "bench/llm.ts",
- "target": "src/ai/llm/factory.ts",
- "relation": "imports",
+ "source": "bench/token-ab.ts#main",
+ "target": "bench/token-ab.ts#row",
+ "relation": "calls",
"confidence": "extracted"
},
{
- "source": "bench/llm.ts",
- "target": "src/ai/llm/types.ts",
- "relation": "imports",
+ "source": "bench/token-ab.ts#main",
+ "target": "bench/token-ab.ts#runAgent",
+ "relation": "calls",
"confidence": "extracted"
},
{
- "source": "bench/llm.ts",
- "target": "src/ai/providers.ts",
- "relation": "imports",
+ "source": "bench/token-ab.ts#main",
+ "target": "bench/token-ab.ts#main.pct",
+ "relation": "contains",
"confidence": "extracted"
},
{
- "source": "bench/llm.ts#makeChatModel",
- "target": "src/ai/llm/factory.ts#createChatModel",
+ "source": "bench/token-ab.ts#runAgent",
+ "target": "bench/token-ab.ts#runRead",
"relation": "calls",
- "confidence": "inferred"
+ "confidence": "extracted"
},
{
- "source": "bench/llm.ts#makeChatModel",
- "target": "src/ai/providers.ts#resolveConfig",
+ "source": "bench/token-ab.ts#runAgent",
+ "target": "bench/token-ab.ts#runSearch",
"relation": "calls",
- "confidence": "inferred"
+ "confidence": "extracted"
},
{
- "source": "bench/report.ts",
- "target": "bench/report.ts#aggregate",
- "relation": "contains",
+ "source": "scripts/build-viewer.mjs",
+ "target": "esbuild",
+ "relation": "imports",
"confidence": "extracted"
},
{
- "source": "bench/report.ts",
- "target": "bench/report.ts#Arm",
- "relation": "contains",
+ "source": "scripts/build-viewer.mjs",
+ "target": "node:fs",
+ "relation": "imports",
"confidence": "extracted"
},
{
- "source": "bench/report.ts",
- "target": "bench/report.ts#ArmAgg",
- "relation": "contains",
+ "source": "scripts/build-viewer.mjs",
+ "target": "node:path",
+ "relation": "imports",
"confidence": "extracted"
},
{
- "source": "bench/report.ts",
- "target": "bench/report.ts#buildMarkdown",
+ "source": "scripts/build-viewer.mjs",
+ "target": "node:url",
+ "relation": "imports",
+ "confidence": "extracted"
+ },
+ {
+ "source": "src/ai/crux.ts",
+ "target": "src/ai/crux.ts#ChatCruxSummarizer",
"relation": "contains",
"confidence": "extracted"
},
{
- "source": "bench/report.ts",
- "target": "bench/report.ts#costOf",
+ "source": "src/ai/crux.ts",
+ "target": "src/ai/crux.ts#CruxSummarizer",
"relation": "contains",
"confidence": "extracted"
},
{
- "source": "bench/report.ts",
- "target": "bench/report.ts#fmt",
+ "source": "src/ai/crux.ts",
+ "target": "src/ai/crux.ts#FileCruxInput",
"relation": "contains",
"confidence": "extracted"
},
{
- "source": "bench/report.ts",
- "target": "bench/report.ts#mean",
+ "source": "src/ai/crux.ts",
+ "target": "src/ai/crux.ts#NodeCrux",
"relation": "contains",
"confidence": "extracted"
},
{
- "source": "bench/report.ts",
- "target": "bench/report.ts#metricTable",
+ "source": "src/ai/crux.ts",
+ "target": "src/ai/crux.ts#NodeRef",
"relation": "contains",
"confidence": "extracted"
},
{
- "source": "bench/report.ts",
- "target": "bench/report.ts#pctDelta",
+ "source": "src/ai/crux.ts",
+ "target": "src/ai/crux.ts#numberLines",
"relation": "contains",
"confidence": "extracted"
},
{
- "source": "bench/report.ts",
- "target": "bench/report.ts#Row",
+ "source": "src/ai/crux.ts",
+ "target": "src/ai/crux.ts#parseResults",
"relation": "contains",
"confidence": "extracted"
},
{
- "source": "bench/report.ts",
- "target": "bench/report.ts#verdictFor",
+ "source": "src/ai/crux.ts",
+ "target": "src/ai/crux.ts#userContent",
"relation": "contains",
"confidence": "extracted"
},
{
- "source": "bench/report.ts#aggregate",
- "target": "bench/report.ts#costOf",
- "relation": "calls",
+ "source": "src/ai/crux.ts",
+ "target": "src/ai/llm/types.ts",
+ "relation": "imports",
"confidence": "extracted"
},
{
- "source": "bench/report.ts#aggregate",
- "target": "bench/report.ts#mean",
- "relation": "calls",
+ "source": "src/ai/crux.ts",
+ "target": "src/graph/types.ts",
+ "relation": "imports",
"confidence": "extracted"
},
{
- "source": "bench/report.ts#buildMarkdown",
- "target": "bench/report.ts#aggregate",
- "relation": "calls",
+ "source": "src/ai/crux.ts#ChatCruxSummarizer",
+ "target": "src/ai/crux.ts#ChatCruxSummarizer.constructor",
+ "relation": "contains",
"confidence": "extracted"
},
{
- "source": "bench/report.ts#buildMarkdown",
- "target": "bench/report.ts#metricTable",
- "relation": "calls",
+ "source": "src/ai/crux.ts#ChatCruxSummarizer",
+ "target": "src/ai/crux.ts#ChatCruxSummarizer.describeFile",
+ "relation": "contains",
"confidence": "extracted"
},
{
- "source": "bench/report.ts#buildMarkdown",
- "target": "bench/report.ts#verdictFor",
+ "source": "src/ai/crux.ts#ChatCruxSummarizer",
+ "target": "src/ai/crux.ts#CruxSummarizer",
+ "relation": "implements",
+ "confidence": "extracted"
+ },
+ {
+ "source": "src/ai/crux.ts#ChatCruxSummarizer.describeFile",
+ "target": "src/ai/crux.ts#parseResults",
"relation": "calls",
"confidence": "extracted"
},
{
- "source": "bench/report.ts#metricTable",
- "target": "bench/report.ts#aggregate",
+ "source": "src/ai/crux.ts#ChatCruxSummarizer.describeFile",
+ "target": "src/ai/crux.ts#userContent",
"relation": "calls",
"confidence": "extracted"
},
{
- "source": "bench/report.ts#metricTable",
- "target": "bench/report.ts#metricTable.cells",
+ "source": "src/ai/crux.ts#parseResults",
+ "target": "src/ai/crux.ts#parseResults.num",
"relation": "calls",
"confidence": "extracted"
},
{
- "source": "bench/report.ts#metricTable",
- "target": "bench/report.ts#metricTable.cells",
+ "source": "src/ai/crux.ts#parseResults",
+ "target": "src/ai/crux.ts#parseResults.num",
"relation": "contains",
"confidence": "extracted"
},
{
- "source": "bench/report.ts#verdictFor",
- "target": "bench/report.ts#pctDelta",
+ "source": "src/ai/crux.ts#userContent",
+ "target": "src/ai/crux.ts#numberLines",
"relation": "calls",
"confidence": "extracted"
},
{
- "source": "bench/run.ts",
- "target": "bench/run.ts#main",
- "relation": "calls",
+ "source": "src/ai/llm/anthropic.ts",
+ "target": "src/ai/llm/anthropic.ts#AnthropicChatModel",
+ "relation": "contains",
"confidence": "extracted"
},
{
- "source": "bench/run.ts",
- "target": "bench/run.ts#Args",
+ "source": "src/ai/llm/anthropic.ts",
+ "target": "src/ai/llm/anthropic.ts#AnthropicChatModelOptions",
"relation": "contains",
"confidence": "extracted"
},
{
- "source": "bench/run.ts",
- "target": "bench/run.ts#main",
+ "source": "src/ai/llm/anthropic.ts",
+ "target": "src/ai/llm/anthropic.ts#CacheControl",
"relation": "contains",
"confidence": "extracted"
},
{
- "source": "bench/run.ts",
- "target": "bench/run.ts#parseArgs",
+ "source": "src/ai/llm/anthropic.ts",
+ "target": "src/ai/llm/anthropic.ts#cc",
"relation": "contains",
"confidence": "extracted"
},
{
- "source": "bench/run.ts",
- "target": "bench/run.ts#pool",
+ "source": "src/ai/llm/anthropic.ts",
+ "target": "src/ai/llm/anthropic.ts#normalizeUsage",
"relation": "contains",
"confidence": "extracted"
},
{
- "source": "bench/run.ts",
- "target": "bench/agent.ts",
- "relation": "imports",
+ "source": "src/ai/llm/anthropic.ts",
+ "target": "src/ai/llm/anthropic.ts#toAnthropicTool",
+ "relation": "contains",
"confidence": "extracted"
},
{
- "source": "bench/run.ts",
- "target": "bench/judge.ts",
+ "source": "src/ai/llm/anthropic.ts",
+ "target": "@anthropic-ai/sdk",
"relation": "imports",
"confidence": "extracted"
},
{
- "source": "bench/run.ts",
- "target": "bench/llm.ts",
+ "source": "src/ai/llm/anthropic.ts",
+ "target": "src/ai/llm/types.ts",
"relation": "imports",
"confidence": "extracted"
},
{
- "source": "bench/run.ts",
- "target": "bench/report.ts",
- "relation": "imports",
+ "source": "src/ai/llm/anthropic.ts#AnthropicChatModel",
+ "target": "src/ai/llm/anthropic.ts#AnthropicChatModel.assistantParam",
+ "relation": "contains",
"confidence": "extracted"
},
{
- "source": "bench/run.ts",
- "target": "bench/tasks.ts",
- "relation": "imports",
+ "source": "src/ai/llm/anthropic.ts#AnthropicChatModel",
+ "target": "src/ai/llm/anthropic.ts#AnthropicChatModel.constructor",
+ "relation": "contains",
"confidence": "extracted"
},
{
- "source": "bench/run.ts",
- "target": "dotenv/config",
- "relation": "imports",
+ "source": "src/ai/llm/anthropic.ts#AnthropicChatModel",
+ "target": "src/ai/llm/anthropic.ts#AnthropicChatModel.create",
+ "relation": "contains",
"confidence": "extracted"
},
{
- "source": "bench/run.ts",
- "target": "node:fs",
- "relation": "imports",
+ "source": "src/ai/llm/anthropic.ts#AnthropicChatModel",
+ "target": "src/ai/llm/anthropic.ts#AnthropicChatModel.fromResponse",
+ "relation": "contains",
"confidence": "extracted"
},
{
- "source": "bench/run.ts",
- "target": "node:os",
- "relation": "imports",
- "confidence": "extracted"
+ "source": "src/ai/llm/anthropic.ts#AnthropicChatModel",
+ "target": "src/ai/llm/types.ts#ChatModel",
+ "relation": "implements",
+ "confidence": "inferred"
},
{
- "source": "bench/run.ts",
- "target": "node:path",
- "relation": "imports",
+ "source": "src/ai/llm/anthropic.ts#AnthropicChatModel.create",
+ "target": "src/ai/llm/anthropic.ts#AnthropicChatModel.assistantParam",
+ "relation": "calls",
"confidence": "extracted"
},
{
- "source": "bench/run.ts",
- "target": "node:url",
- "relation": "imports",
+ "source": "src/ai/llm/anthropic.ts#AnthropicChatModel.create",
+ "target": "src/ai/llm/anthropic.ts#AnthropicChatModel.create",
+ "relation": "calls",
"confidence": "extracted"
},
{
- "source": "bench/run.ts",
- "target": "src/ai/providers.ts",
- "relation": "imports",
+ "source": "src/ai/llm/anthropic.ts#AnthropicChatModel.create",
+ "target": "src/ai/llm/anthropic.ts#AnthropicChatModel.fromResponse",
+ "relation": "calls",
"confidence": "extracted"
},
{
- "source": "bench/run.ts",
- "target": "src/ask/ask.ts",
- "relation": "imports",
+ "source": "src/ai/llm/anthropic.ts#AnthropicChatModel.create",
+ "target": "src/ai/llm/anthropic.ts#cc",
+ "relation": "calls",
"confidence": "extracted"
},
{
- "source": "bench/run.ts",
- "target": "src/graph/build.ts",
- "relation": "imports",
+ "source": "src/ai/llm/anthropic.ts#AnthropicChatModel.fromResponse",
+ "target": "src/ai/llm/anthropic.ts#normalizeUsage",
+ "relation": "calls",
"confidence": "extracted"
},
{
- "source": "bench/run.ts#main",
- "target": "bench/judge.ts#judge",
- "relation": "calls",
- "confidence": "inferred"
+ "source": "src/ai/llm/factory.ts",
+ "target": "src/ai/llm/factory.ts#ChatModelConfig",
+ "relation": "contains",
+ "confidence": "extracted"
},
{
- "source": "bench/run.ts#main",
- "target": "bench/llm.ts#makeChatModel",
- "relation": "calls",
- "confidence": "inferred"
+ "source": "src/ai/llm/factory.ts",
+ "target": "src/ai/llm/factory.ts#createChatModel",
+ "relation": "contains",
+ "confidence": "extracted"
},
{
- "source": "bench/run.ts#main",
- "target": "bench/report.ts#buildMarkdown",
- "relation": "calls",
- "confidence": "inferred"
+ "source": "src/ai/llm/factory.ts",
+ "target": "src/ai/llm/factory.ts#ProviderKind",
+ "relation": "contains",
+ "confidence": "extracted"
},
{
- "source": "bench/run.ts#main",
- "target": "bench/run.ts#parseArgs",
- "relation": "calls",
+ "source": "src/ai/llm/factory.ts",
+ "target": "src/ai/llm/anthropic.ts",
+ "relation": "imports",
"confidence": "extracted"
},
{
- "source": "bench/run.ts#main",
- "target": "bench/run.ts#pool",
- "relation": "calls",
+ "source": "src/ai/llm/factory.ts",
+ "target": "src/ai/llm/openai.ts",
+ "relation": "imports",
"confidence": "extracted"
},
{
- "source": "bench/run.ts#main",
- "target": "src/ai/providers.ts#resolveConfig",
- "relation": "calls",
- "confidence": "inferred"
+ "source": "src/ai/llm/factory.ts",
+ "target": "src/ai/llm/types.ts",
+ "relation": "imports",
+ "confidence": "extracted"
},
{
- "source": "bench/run.ts#main",
- "target": "src/ask/ask.ts#ask",
- "relation": "calls",
- "confidence": "inferred"
+ "source": "src/ai/llm/openai.ts",
+ "target": "src/ai/llm/openai.ts#ChatMessage",
+ "relation": "contains",
+ "confidence": "extracted"
},
{
- "source": "bench/run.ts#main",
- "target": "src/ask/ask.ts#formatAsk",
- "relation": "calls",
- "confidence": "inferred"
+ "source": "src/ai/llm/openai.ts",
+ "target": "src/ai/llm/openai.ts#ChatParams",
+ "relation": "contains",
+ "confidence": "extracted"
},
{
- "source": "bench/run.ts#main",
- "target": "src/graph/build.ts#buildGraph",
- "relation": "calls",
- "confidence": "inferred"
+ "source": "src/ai/llm/openai.ts",
+ "target": "src/ai/llm/openai.ts#normalizeUsage",
+ "relation": "contains",
+ "confidence": "extracted"
},
{
- "source": "bench/run.ts#pool",
- "target": "bench/run.ts#pool.worker",
+ "source": "src/ai/llm/openai.ts",
+ "target": "src/ai/llm/openai.ts#OpenAIChatModel",
"relation": "contains",
"confidence": "extracted"
},
{
- "source": "bench/selfcheck.ts",
- "target": "bench/selfcheck.ts#main",
- "relation": "calls",
+ "source": "src/ai/llm/openai.ts",
+ "target": "src/ai/llm/openai.ts#OpenAIChatModelOptions",
+ "relation": "contains",
"confidence": "extracted"
},
{
- "source": "bench/selfcheck.ts",
- "target": "bench/selfcheck.ts#main",
+ "source": "src/ai/llm/openai.ts",
+ "target": "src/ai/llm/openai.ts#textPart",
"relation": "contains",
"confidence": "extracted"
},
{
- "source": "bench/selfcheck.ts",
- "target": "bench/selfcheck.ts#makeStubModel",
+ "source": "src/ai/llm/openai.ts",
+ "target": "src/ai/llm/openai.ts#toChatMessage",
"relation": "contains",
"confidence": "extracted"
},
{
- "source": "bench/selfcheck.ts",
- "target": "bench/agent.ts",
- "relation": "imports",
+ "source": "src/ai/llm/openai.ts",
+ "target": "src/ai/llm/openai.ts#toChatTool",
+ "relation": "contains",
"confidence": "extracted"
},
{
- "source": "bench/selfcheck.ts",
- "target": "bench/judge.ts",
+ "source": "src/ai/llm/openai.ts",
+ "target": "openai",
"relation": "imports",
"confidence": "extracted"
},
{
- "source": "bench/selfcheck.ts",
- "target": "bench/report.ts",
+ "source": "src/ai/llm/openai.ts",
+ "target": "src/ai/llm/types.ts",
"relation": "imports",
"confidence": "extracted"
},
{
- "source": "bench/selfcheck.ts",
- "target": "node:assert/strict",
- "relation": "imports",
+ "source": "src/ai/llm/openai.ts#OpenAIChatModel",
+ "target": "src/ai/llm/openai.ts#OpenAIChatModel.constructor",
+ "relation": "contains",
"confidence": "extracted"
},
{
- "source": "bench/selfcheck.ts",
- "target": "node:fs",
- "relation": "imports",
+ "source": "src/ai/llm/openai.ts#OpenAIChatModel",
+ "target": "src/ai/llm/openai.ts#OpenAIChatModel.create",
+ "relation": "contains",
"confidence": "extracted"
},
{
- "source": "bench/selfcheck.ts",
- "target": "node:os",
- "relation": "imports",
+ "source": "src/ai/llm/openai.ts#OpenAIChatModel",
+ "target": "src/ai/llm/openai.ts#OpenAIChatModel.fromResponse",
+ "relation": "contains",
"confidence": "extracted"
},
{
- "source": "bench/selfcheck.ts",
- "target": "node:path",
- "relation": "imports",
- "confidence": "extracted"
+ "source": "src/ai/llm/openai.ts#OpenAIChatModel",
+ "target": "src/ai/llm/types.ts#ChatModel",
+ "relation": "implements",
+ "confidence": "inferred"
},
{
- "source": "bench/selfcheck.ts",
- "target": "src/ai/llm/types.ts",
- "relation": "imports",
+ "source": "src/ai/llm/openai.ts#OpenAIChatModel.create",
+ "target": "src/ai/llm/openai.ts#OpenAIChatModel.create",
+ "relation": "calls",
"confidence": "extracted"
},
{
- "source": "bench/selfcheck.ts#main",
- "target": "bench/judge.ts#judge",
+ "source": "src/ai/llm/openai.ts#OpenAIChatModel.create",
+ "target": "src/ai/llm/openai.ts#OpenAIChatModel.fromResponse",
"relation": "calls",
- "confidence": "inferred"
+ "confidence": "extracted"
},
{
- "source": "bench/selfcheck.ts#main",
- "target": "bench/report.ts#buildMarkdown",
+ "source": "src/ai/llm/openai.ts#OpenAIChatModel.fromResponse",
+ "target": "src/ai/llm/openai.ts#normalizeUsage",
"relation": "calls",
- "confidence": "inferred"
+ "confidence": "extracted"
},
{
- "source": "bench/selfcheck.ts#main",
- "target": "bench/selfcheck.ts#makeStubModel",
+ "source": "src/ai/llm/openai.ts#OpenAIChatModel.fromResponse",
+ "target": "src/ai/llm/openai.ts#OpenAIChatModel.fromResponse.parse",
"relation": "calls",
"confidence": "extracted"
},
{
- "source": "bench/selfcheck.ts#makeStubModel",
- "target": "bench/selfcheck.ts#makeStubModel.create",
+ "source": "src/ai/llm/openai.ts#OpenAIChatModel.fromResponse",
+ "target": "src/ai/llm/openai.ts#OpenAIChatModel.fromResponse.parse",
"relation": "contains",
"confidence": "extracted"
},
{
- "source": "bench/tasks.ts",
- "target": "bench/tasks.ts#repoPath",
+ "source": "src/ai/llm/openai.ts#toChatMessage",
+ "target": "src/ai/llm/openai.ts#textPart",
"relation": "calls",
"confidence": "extracted"
},
{
- "source": "bench/tasks.ts",
- "target": "bench/tasks.ts#Corpus",
+ "source": "src/ai/llm/types.ts",
+ "target": "src/ai/llm/types.ts#ChatModel",
"relation": "contains",
"confidence": "extracted"
},
{
- "source": "bench/tasks.ts",
- "target": "bench/tasks.ts#repoPath",
+ "source": "src/ai/llm/types.ts",
+ "target": "src/ai/llm/types.ts#ChatRequest",
"relation": "contains",
"confidence": "extracted"
},
{
- "source": "bench/tasks.ts",
- "target": "bench/tasks.ts#Task",
+ "source": "src/ai/llm/types.ts",
+ "target": "src/ai/llm/types.ts#ChatResponse",
"relation": "contains",
"confidence": "extracted"
},
{
- "source": "bench/tasks.ts",
- "target": "node:path",
- "relation": "imports",
+ "source": "src/ai/llm/types.ts",
+ "target": "src/ai/llm/types.ts#Message",
+ "relation": "contains",
"confidence": "extracted"
},
{
- "source": "bench/tasks.ts",
- "target": "node:url",
- "relation": "imports",
+ "source": "src/ai/llm/types.ts",
+ "target": "src/ai/llm/types.ts#ResponseFormat",
+ "relation": "contains",
"confidence": "extracted"
},
{
- "source": "bench/token-ab.ts",
- "target": "bench/llm.ts#makeChatModel",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "bench/token-ab.ts",
- "target": "bench/token-ab.ts#main",
- "relation": "calls",
+ "source": "src/ai/llm/types.ts",
+ "target": "src/ai/llm/types.ts#ToolCall",
+ "relation": "contains",
"confidence": "extracted"
},
{
- "source": "bench/token-ab.ts",
- "target": "bench/token-ab.ts#cost",
+ "source": "src/ai/llm/types.ts",
+ "target": "src/ai/llm/types.ts#ToolSpec",
"relation": "contains",
"confidence": "extracted"
},
{
- "source": "bench/token-ab.ts",
- "target": "bench/token-ab.ts#graftPack",
+ "source": "src/ai/llm/types.ts",
+ "target": "src/ai/llm/types.ts#Usage",
"relation": "contains",
"confidence": "extracted"
},
{
- "source": "bench/token-ab.ts",
- "target": "bench/token-ab.ts#main",
+ "source": "src/ai/providers.ts",
+ "target": "src/ai/providers.ts#EngineConfig",
"relation": "contains",
"confidence": "extracted"
},
{
- "source": "bench/token-ab.ts",
- "target": "bench/token-ab.ts#Metrics",
+ "source": "src/ai/providers.ts",
+ "target": "src/ai/providers.ts#resolveConfig",
"relation": "contains",
"confidence": "extracted"
},
{
- "source": "bench/token-ab.ts",
- "target": "bench/token-ab.ts#row",
+ "source": "src/ai/providers.ts",
+ "target": "src/ai/providers.ts#ResolvedConfig",
"relation": "contains",
"confidence": "extracted"
},
{
- "source": "bench/token-ab.ts",
- "target": "bench/token-ab.ts#runAgent",
- "relation": "contains",
+ "source": "src/ai/providers.ts",
+ "target": "src/ai/crux.ts",
+ "relation": "imports",
"confidence": "extracted"
},
{
- "source": "bench/token-ab.ts",
- "target": "bench/token-ab.ts#runRead",
- "relation": "contains",
+ "source": "src/ai/providers.ts",
+ "target": "src/ai/llm/factory.ts",
+ "relation": "imports",
"confidence": "extracted"
},
{
- "source": "bench/token-ab.ts",
- "target": "bench/token-ab.ts#runSearch",
- "relation": "contains",
+ "source": "src/ai/providers.ts",
+ "target": "src/ai/llm/types.ts",
+ "relation": "imports",
"confidence": "extracted"
},
{
- "source": "bench/token-ab.ts",
- "target": "bench/llm.ts",
+ "source": "src/ai/providers.ts",
+ "target": "src/ai/summarize.ts",
"relation": "imports",
"confidence": "extracted"
},
{
- "source": "bench/token-ab.ts",
- "target": "dotenv/config",
+ "source": "src/ai/providers.ts",
+ "target": "src/ai/synthesize.ts",
"relation": "imports",
"confidence": "extracted"
},
{
- "source": "bench/token-ab.ts",
- "target": "node:child_process",
- "relation": "imports",
+ "source": "src/ai/summarize.ts",
+ "target": "src/ai/summarize.ts#ChatSummarizer",
+ "relation": "contains",
"confidence": "extracted"
},
{
- "source": "bench/token-ab.ts",
- "target": "node:fs",
- "relation": "imports",
+ "source": "src/ai/summarize.ts",
+ "target": "src/ai/summarize.ts#Summarizer",
+ "relation": "contains",
"confidence": "extracted"
},
{
- "source": "bench/token-ab.ts",
- "target": "node:path",
- "relation": "imports",
+ "source": "src/ai/summarize.ts",
+ "target": "src/ai/summarize.ts#userContent",
+ "relation": "contains",
"confidence": "extracted"
},
{
- "source": "bench/token-ab.ts",
+ "source": "src/ai/summarize.ts",
"target": "src/ai/llm/types.ts",
"relation": "imports",
"confidence": "extracted"
},
{
- "source": "bench/token-ab.ts#main",
- "target": "bench/token-ab.ts#cost",
- "relation": "calls",
+ "source": "src/ai/summarize.ts#ChatSummarizer",
+ "target": "src/ai/summarize.ts#ChatSummarizer.constructor",
+ "relation": "contains",
"confidence": "extracted"
},
{
- "source": "bench/token-ab.ts#main",
- "target": "bench/token-ab.ts#graftPack",
- "relation": "calls",
+ "source": "src/ai/summarize.ts#ChatSummarizer",
+ "target": "src/ai/summarize.ts#ChatSummarizer.summarize",
+ "relation": "contains",
"confidence": "extracted"
},
{
- "source": "bench/token-ab.ts#main",
- "target": "bench/token-ab.ts#main.pct",
- "relation": "calls",
+ "source": "src/ai/summarize.ts#ChatSummarizer",
+ "target": "src/ai/summarize.ts#Summarizer",
+ "relation": "implements",
"confidence": "extracted"
},
{
- "source": "bench/token-ab.ts#main",
- "target": "bench/token-ab.ts#row",
+ "source": "src/ai/summarize.ts#ChatSummarizer.summarize",
+ "target": "src/ai/summarize.ts#userContent",
"relation": "calls",
"confidence": "extracted"
},
{
- "source": "bench/token-ab.ts#main",
- "target": "bench/token-ab.ts#runAgent",
- "relation": "calls",
+ "source": "src/ai/synthesize.ts",
+ "target": "src/ai/synthesize.ts#ChatSynthesizer",
+ "relation": "contains",
"confidence": "extracted"
},
{
- "source": "bench/token-ab.ts#main",
- "target": "bench/token-ab.ts#main.pct",
+ "source": "src/ai/synthesize.ts",
+ "target": "src/ai/synthesize.ts#clean",
"relation": "contains",
"confidence": "extracted"
},
{
- "source": "bench/token-ab.ts#runAgent",
- "target": "bench/token-ab.ts#runRead",
- "relation": "calls",
+ "source": "src/ai/synthesize.ts",
+ "target": "src/ai/synthesize.ts#FileSummary",
+ "relation": "contains",
"confidence": "extracted"
},
{
- "source": "bench/token-ab.ts#runAgent",
- "target": "bench/token-ab.ts#runSearch",
- "relation": "calls",
+ "source": "src/ai/synthesize.ts",
+ "target": "src/ai/synthesize.ts#Synthesizer",
+ "relation": "contains",
"confidence": "extracted"
},
{
- "source": "scripts/build-viewer.mjs",
- "target": "esbuild",
- "relation": "imports",
+ "source": "src/ai/synthesize.ts",
+ "target": "src/ai/synthesize.ts#SynthLink",
+ "relation": "contains",
"confidence": "extracted"
},
{
- "source": "scripts/build-viewer.mjs",
- "target": "node:fs",
- "relation": "imports",
+ "source": "src/ai/synthesize.ts",
+ "target": "src/ai/synthesize.ts#SynthNode",
+ "relation": "contains",
"confidence": "extracted"
},
{
- "source": "scripts/build-viewer.mjs",
- "target": "node:path",
- "relation": "imports",
+ "source": "src/ai/synthesize.ts",
+ "target": "src/ai/synthesize.ts#userContent",
+ "relation": "contains",
"confidence": "extracted"
},
{
- "source": "scripts/build-viewer.mjs",
- "target": "node:url",
+ "source": "src/ai/synthesize.ts",
+ "target": "src/ai/llm/types.ts",
"relation": "imports",
"confidence": "extracted"
},
{
- "source": "src/ai/crux.ts",
- "target": "src/ai/crux.ts#ChatCruxSummarizer",
+ "source": "src/ai/synthesize.ts#ChatSynthesizer",
+ "target": "src/ai/synthesize.ts#ChatSynthesizer.constructor",
"relation": "contains",
"confidence": "extracted"
},
{
- "source": "src/ai/crux.ts",
- "target": "src/ai/crux.ts#CruxSummarizer",
+ "source": "src/ai/synthesize.ts#ChatSynthesizer",
+ "target": "src/ai/synthesize.ts#ChatSynthesizer.synthesize",
"relation": "contains",
"confidence": "extracted"
},
{
- "source": "src/ai/crux.ts",
- "target": "src/ai/crux.ts#FileCruxInput",
- "relation": "contains",
+ "source": "src/ai/synthesize.ts#ChatSynthesizer",
+ "target": "src/ai/synthesize.ts#Synthesizer",
+ "relation": "implements",
"confidence": "extracted"
},
{
- "source": "src/ai/crux.ts",
- "target": "src/ai/crux.ts#NodeCrux",
- "relation": "contains",
+ "source": "src/ai/synthesize.ts#ChatSynthesizer.synthesize",
+ "target": "src/ai/synthesize.ts#clean",
+ "relation": "calls",
"confidence": "extracted"
},
{
- "source": "src/ai/crux.ts",
- "target": "src/ai/crux.ts#NodeRef",
+ "source": "src/ai/synthesize.ts#ChatSynthesizer.synthesize",
+ "target": "src/ai/synthesize.ts#userContent",
+ "relation": "calls",
+ "confidence": "extracted"
+ },
+ {
+ "source": "src/ask/ask.ts",
+ "target": "src/ask/ask.ts#ask",
"relation": "contains",
"confidence": "extracted"
},
{
- "source": "src/ai/crux.ts",
- "target": "src/ai/crux.ts#numberLines",
+ "source": "src/ask/ask.ts",
+ "target": "src/ask/ask.ts#AskHit",
"relation": "contains",
"confidence": "extracted"
},
{
- "source": "src/ai/crux.ts",
- "target": "src/ai/crux.ts#parseResults",
+ "source": "src/ask/ask.ts",
+ "target": "src/ask/ask.ts#AskOptions",
"relation": "contains",
"confidence": "extracted"
},
{
- "source": "src/ai/crux.ts",
- "target": "src/ai/crux.ts#userContent",
+ "source": "src/ask/ask.ts",
+ "target": "src/ask/ask.ts#AskResult",
"relation": "contains",
"confidence": "extracted"
},
{
- "source": "src/ai/crux.ts",
- "target": "src/ai/llm/types.ts",
- "relation": "imports",
+ "source": "src/ask/ask.ts",
+ "target": "src/ask/ask.ts#askSavingsFooter",
+ "relation": "contains",
"confidence": "extracted"
},
{
- "source": "src/ai/crux.ts",
- "target": "src/graph/types.ts",
- "relation": "imports",
+ "source": "src/ask/ask.ts",
+ "target": "src/ask/ask.ts#baselineFor",
+ "relation": "contains",
"confidence": "extracted"
},
{
- "source": "src/ai/crux.ts#ChatCruxSummarizer",
- "target": "src/ai/crux.ts#ChatCruxSummarizer.constructor",
+ "source": "src/ask/ask.ts",
+ "target": "src/ask/ask.ts#bm25",
"relation": "contains",
"confidence": "extracted"
},
{
- "source": "src/ai/crux.ts#ChatCruxSummarizer",
- "target": "src/ai/crux.ts#ChatCruxSummarizer.describeFile",
+ "source": "src/ask/ask.ts",
+ "target": "src/ask/ask.ts#computeIdf",
"relation": "contains",
"confidence": "extracted"
},
{
- "source": "src/ai/crux.ts#ChatCruxSummarizer",
- "target": "src/ai/crux.ts#CruxSummarizer",
- "relation": "implements",
+ "source": "src/ask/ask.ts",
+ "target": "src/ask/ask.ts#computeIdfFromIndex",
+ "relation": "contains",
"confidence": "extracted"
},
{
- "source": "src/ai/crux.ts#ChatCruxSummarizer.describeFile",
- "target": "src/ai/crux.ts#parseResults",
- "relation": "calls",
+ "source": "src/ask/ask.ts",
+ "target": "src/ask/ask.ts#Corpus",
+ "relation": "contains",
"confidence": "extracted"
},
{
- "source": "src/ai/crux.ts#ChatCruxSummarizer.describeFile",
- "target": "src/ai/crux.ts#userContent",
- "relation": "calls",
+ "source": "src/ask/ask.ts",
+ "target": "src/ask/ask.ts#escalationNudge",
+ "relation": "contains",
"confidence": "extracted"
},
{
- "source": "src/ai/crux.ts#parseResults",
- "target": "src/ai/crux.ts#parseResults.num",
- "relation": "calls",
+ "source": "src/ask/ask.ts",
+ "target": "src/ask/ask.ts#fallthroughNoteFor",
+ "relation": "contains",
"confidence": "extracted"
},
{
- "source": "src/ai/crux.ts#parseResults",
- "target": "src/ai/crux.ts#parseResults.num",
+ "source": "src/ask/ask.ts",
+ "target": "src/ask/ask.ts#findSubjectNodes",
"relation": "contains",
"confidence": "extracted"
},
{
- "source": "src/ai/crux.ts#userContent",
- "target": "src/ai/crux.ts#numberLines",
- "relation": "calls",
+ "source": "src/ask/ask.ts",
+ "target": "src/ask/ask.ts#firstProse",
+ "relation": "contains",
"confidence": "extracted"
},
{
- "source": "src/ai/llm/anthropic.ts",
- "target": "src/ai/llm/anthropic.ts#AnthropicChatModel",
+ "source": "src/ask/ask.ts",
+ "target": "src/ask/ask.ts#formatAsk",
"relation": "contains",
"confidence": "extracted"
},
{
- "source": "src/ai/llm/anthropic.ts",
- "target": "src/ai/llm/anthropic.ts#AnthropicChatModelOptions",
+ "source": "src/ask/ask.ts",
+ "target": "src/ask/ask.ts#formatSkeleton",
"relation": "contains",
"confidence": "extracted"
},
{
- "source": "src/ai/llm/anthropic.ts",
- "target": "src/ai/llm/anthropic.ts#CacheControl",
+ "source": "src/ask/ask.ts",
+ "target": "src/ask/ask.ts#hasTerm",
"relation": "contains",
"confidence": "extracted"
},
{
- "source": "src/ai/llm/anthropic.ts",
- "target": "src/ai/llm/anthropic.ts#cc",
+ "source": "src/ask/ask.ts",
+ "target": "src/ask/ask.ts#hitFiles",
"relation": "contains",
"confidence": "extracted"
},
{
- "source": "src/ai/llm/anthropic.ts",
- "target": "src/ai/llm/anthropic.ts#normalizeUsage",
+ "source": "src/ask/ask.ts",
+ "target": "src/ask/ask.ts#idfFromDf",
"relation": "contains",
"confidence": "extracted"
},
{
- "source": "src/ai/llm/anthropic.ts",
- "target": "src/ai/llm/anthropic.ts#toAnthropicTool",
+ "source": "src/ask/ask.ts",
+ "target": "src/ask/ask.ts#inlineSource",
"relation": "contains",
"confidence": "extracted"
},
{
- "source": "src/ai/llm/anthropic.ts",
- "target": "@anthropic-ai/sdk",
- "relation": "imports",
+ "source": "src/ask/ask.ts",
+ "target": "src/ask/ask.ts#lexical",
+ "relation": "contains",
"confidence": "extracted"
},
{
- "source": "src/ai/llm/anthropic.ts",
- "target": "src/ai/llm/types.ts",
- "relation": "imports",
+ "source": "src/ask/ask.ts",
+ "target": "src/ask/ask.ts#loadCorpus",
+ "relation": "contains",
"confidence": "extracted"
},
{
- "source": "src/ai/llm/anthropic.ts#AnthropicChatModel",
- "target": "src/ai/llm/anthropic.ts#AnthropicChatModel.assistantParam",
+ "source": "src/ask/ask.ts",
+ "target": "src/ask/ask.ts#matchedIdfShare",
"relation": "contains",
"confidence": "extracted"
},
{
- "source": "src/ai/llm/anthropic.ts#AnthropicChatModel",
- "target": "src/ai/llm/anthropic.ts#AnthropicChatModel.constructor",
+ "source": "src/ask/ask.ts",
+ "target": "src/ask/ask.ts#parseSpan",
"relation": "contains",
"confidence": "extracted"
},
{
- "source": "src/ai/llm/anthropic.ts#AnthropicChatModel",
- "target": "src/ai/llm/anthropic.ts#AnthropicChatModel.create",
+ "source": "src/ask/ask.ts",
+ "target": "src/ask/ask.ts#scopeFooterLines",
"relation": "contains",
"confidence": "extracted"
},
{
- "source": "src/ai/llm/anthropic.ts#AnthropicChatModel",
- "target": "src/ai/llm/anthropic.ts#AnthropicChatModel.fromResponse",
+ "source": "src/ask/ask.ts",
+ "target": "src/ask/ask.ts#score",
"relation": "contains",
"confidence": "extracted"
},
{
- "source": "src/ai/llm/anthropic.ts#AnthropicChatModel",
- "target": "src/ai/llm/types.ts#ChatModel",
- "relation": "implements",
- "confidence": "inferred"
- },
- {
- "source": "src/ai/llm/anthropic.ts#AnthropicChatModel.create",
- "target": "src/ai/llm/anthropic.ts#AnthropicChatModel.assistantParam",
- "relation": "calls",
+ "source": "src/ask/ask.ts",
+ "target": "src/ask/ask.ts#skeleton",
+ "relation": "contains",
"confidence": "extracted"
},
{
- "source": "src/ai/llm/anthropic.ts#AnthropicChatModel.create",
- "target": "src/ai/llm/anthropic.ts#AnthropicChatModel.create",
- "relation": "calls",
+ "source": "src/ask/ask.ts",
+ "target": "src/ask/ask.ts#SkeletonEntry",
+ "relation": "contains",
"confidence": "extracted"
},
{
- "source": "src/ai/llm/anthropic.ts#AnthropicChatModel.create",
- "target": "src/ai/llm/anthropic.ts#AnthropicChatModel.fromResponse",
- "relation": "calls",
+ "source": "src/ask/ask.ts",
+ "target": "src/ask/ask.ts#SkeletonResult",
+ "relation": "contains",
"confidence": "extracted"
},
{
- "source": "src/ai/llm/anthropic.ts#AnthropicChatModel.create",
- "target": "src/ai/llm/anthropic.ts#cc",
- "relation": "calls",
+ "source": "src/ask/ask.ts",
+ "target": "src/ask/ask.ts#sliceSpan",
+ "relation": "contains",
"confidence": "extracted"
},
{
- "source": "src/ai/llm/anthropic.ts#AnthropicChatModel.fromResponse",
- "target": "src/ai/llm/anthropic.ts#normalizeUsage",
- "relation": "calls",
+ "source": "src/ask/ask.ts",
+ "target": "src/ask/ask.ts#strongShare",
+ "relation": "contains",
"confidence": "extracted"
},
{
- "source": "src/ai/llm/factory.ts",
- "target": "src/ai/llm/factory.ts#ChatModelConfig",
+ "source": "src/ask/ask.ts",
+ "target": "src/ask/ask.ts#structural",
"relation": "contains",
"confidence": "extracted"
},
{
- "source": "src/ai/llm/factory.ts",
- "target": "src/ai/llm/factory.ts#createChatModel",
+ "source": "src/ask/ask.ts",
+ "target": "src/ask/ask.ts#StructuralOutcome",
"relation": "contains",
"confidence": "extracted"
},
{
- "source": "src/ai/llm/factory.ts",
- "target": "src/ai/llm/factory.ts#ProviderKind",
+ "source": "src/ask/ask.ts",
+ "target": "src/ask/ask.ts#subjectWords",
"relation": "contains",
"confidence": "extracted"
},
{
- "source": "src/ai/llm/factory.ts",
- "target": "src/ai/llm/anthropic.ts",
- "relation": "imports",
+ "source": "src/ask/ask.ts",
+ "target": "src/ask/ask.ts#toTokens",
+ "relation": "contains",
"confidence": "extracted"
},
{
- "source": "src/ai/llm/factory.ts",
- "target": "src/ai/llm/openai.ts",
+ "source": "src/ask/ask.ts",
+ "target": "gray-matter",
"relation": "imports",
"confidence": "extracted"
},
{
- "source": "src/ai/llm/factory.ts",
- "target": "src/ai/llm/types.ts",
+ "source": "src/ask/ask.ts",
+ "target": "node:fs",
"relation": "imports",
"confidence": "extracted"
},
{
- "source": "src/ai/llm/openai.ts",
- "target": "src/ai/llm/openai.ts#ChatMessage",
- "relation": "contains",
+ "source": "src/ask/ask.ts",
+ "target": "node:path",
+ "relation": "imports",
"confidence": "extracted"
},
{
- "source": "src/ai/llm/openai.ts",
- "target": "src/ai/llm/openai.ts#ChatParams",
- "relation": "contains",
+ "source": "src/ask/ask.ts",
+ "target": "src/ask/fuse.ts",
+ "relation": "imports",
"confidence": "extracted"
},
{
- "source": "src/ai/llm/openai.ts",
- "target": "src/ai/llm/openai.ts#normalizeUsage",
- "relation": "contains",
+ "source": "src/ask/ask.ts",
+ "target": "src/ask/graphrank.ts",
+ "relation": "imports",
"confidence": "extracted"
},
{
- "source": "src/ai/llm/openai.ts",
- "target": "src/ai/llm/openai.ts#OpenAIChatModel",
- "relation": "contains",
+ "source": "src/ask/ask.ts",
+ "target": "src/ask/index-file.ts",
+ "relation": "imports",
"confidence": "extracted"
},
{
- "source": "src/ai/llm/openai.ts",
- "target": "src/ai/llm/openai.ts#OpenAIChatModelOptions",
- "relation": "contains",
+ "source": "src/ask/ask.ts",
+ "target": "src/context/node-file.ts",
+ "relation": "imports",
"confidence": "extracted"
},
{
- "source": "src/ai/llm/openai.ts",
- "target": "src/ai/llm/openai.ts#textPart",
- "relation": "contains",
+ "source": "src/ask/ask.ts",
+ "target": "src/context/savings.ts",
+ "relation": "imports",
"confidence": "extracted"
},
{
- "source": "src/ai/llm/openai.ts",
- "target": "src/ai/llm/openai.ts#toChatMessage",
- "relation": "contains",
+ "source": "src/ask/ask.ts",
+ "target": "src/graph/load.ts",
+ "relation": "imports",
"confidence": "extracted"
},
{
- "source": "src/ai/llm/openai.ts",
- "target": "src/ai/llm/openai.ts#toChatTool",
- "relation": "contains",
+ "source": "src/ask/ask.ts",
+ "target": "src/graph/scopes.ts",
+ "relation": "imports",
"confidence": "extracted"
},
{
- "source": "src/ai/llm/openai.ts",
- "target": "openai",
+ "source": "src/ask/ask.ts",
+ "target": "src/graph/traverse.ts",
"relation": "imports",
"confidence": "extracted"
},
{
- "source": "src/ai/llm/openai.ts",
- "target": "src/ai/llm/types.ts",
+ "source": "src/ask/ask.ts",
+ "target": "src/graph/types.ts",
"relation": "imports",
"confidence": "extracted"
},
{
- "source": "src/ai/llm/openai.ts#OpenAIChatModel",
- "target": "src/ai/llm/openai.ts#OpenAIChatModel.constructor",
- "relation": "contains",
+ "source": "src/ask/ask.ts#ask",
+ "target": "src/ask/ask.ts#baselineFor",
+ "relation": "calls",
"confidence": "extracted"
},
{
- "source": "src/ai/llm/openai.ts#OpenAIChatModel",
- "target": "src/ai/llm/openai.ts#OpenAIChatModel.create",
- "relation": "contains",
+ "source": "src/ask/ask.ts#ask",
+ "target": "src/ask/ask.ts#inlineSource",
+ "relation": "calls",
"confidence": "extracted"
},
{
- "source": "src/ai/llm/openai.ts#OpenAIChatModel",
- "target": "src/ai/llm/openai.ts#OpenAIChatModel.fromResponse",
- "relation": "contains",
+ "source": "src/ask/ask.ts#ask",
+ "target": "src/ask/ask.ts#lexical",
+ "relation": "calls",
"confidence": "extracted"
},
{
- "source": "src/ai/llm/openai.ts#OpenAIChatModel",
- "target": "src/ai/llm/types.ts#ChatModel",
- "relation": "implements",
- "confidence": "inferred"
- },
- {
- "source": "src/ai/llm/openai.ts#OpenAIChatModel.create",
- "target": "src/ai/llm/openai.ts#OpenAIChatModel.create",
+ "source": "src/ask/ask.ts#ask",
+ "target": "src/ask/ask.ts#loadCorpus",
"relation": "calls",
"confidence": "extracted"
},
{
- "source": "src/ai/llm/openai.ts#OpenAIChatModel.create",
- "target": "src/ai/llm/openai.ts#OpenAIChatModel.fromResponse",
+ "source": "src/ask/ask.ts#ask",
+ "target": "src/ask/ask.ts#structural",
"relation": "calls",
"confidence": "extracted"
},
{
- "source": "src/ai/llm/openai.ts#OpenAIChatModel.fromResponse",
- "target": "src/ai/llm/openai.ts#normalizeUsage",
+ "source": "src/ask/ask.ts#ask",
+ "target": "src/context/node-file.ts#contextDirFor",
"relation": "calls",
- "confidence": "extracted"
+ "confidence": "inferred"
},
{
- "source": "src/ai/llm/openai.ts#OpenAIChatModel.fromResponse",
- "target": "src/ai/llm/openai.ts#OpenAIChatModel.fromResponse.parse",
+ "source": "src/ask/ask.ts#ask",
+ "target": "src/graph/scopes.ts#pathUnderPrefix",
"relation": "calls",
- "confidence": "extracted"
+ "confidence": "inferred"
},
{
- "source": "src/ai/llm/openai.ts#OpenAIChatModel.fromResponse",
- "target": "src/ai/llm/openai.ts#OpenAIChatModel.fromResponse.parse",
- "relation": "contains",
- "confidence": "extracted"
+ "source": "src/ask/ask.ts#ask",
+ "target": "src/graph/scopes.ts#scopesHereClause",
+ "relation": "calls",
+ "confidence": "inferred"
},
{
- "source": "src/ai/llm/openai.ts#toChatMessage",
- "target": "src/ai/llm/openai.ts#textPart",
+ "source": "src/ask/ask.ts#ask",
+ "target": "src/graph/scopes.ts#scopesOfGraph",
"relation": "calls",
- "confidence": "extracted"
+ "confidence": "inferred"
},
{
- "source": "src/ai/llm/types.ts",
- "target": "src/ai/llm/types.ts#ChatModel",
- "relation": "contains",
+ "source": "src/ask/ask.ts#askSavingsFooter",
+ "target": "src/ask/ask.ts#toTokens",
+ "relation": "calls",
"confidence": "extracted"
},
{
- "source": "src/ai/llm/types.ts",
- "target": "src/ai/llm/types.ts#ChatRequest",
- "relation": "contains",
+ "source": "src/ask/ask.ts#baselineFor",
+ "target": "src/ask/ask.ts#hitFiles",
+ "relation": "calls",
"confidence": "extracted"
},
{
- "source": "src/ai/llm/types.ts",
- "target": "src/ai/llm/types.ts#ChatResponse",
- "relation": "contains",
- "confidence": "extracted"
+ "source": "src/ask/ask.ts#baselineFor",
+ "target": "src/context/savings.ts#savingsFor",
+ "relation": "calls",
+ "confidence": "inferred"
},
{
- "source": "src/ai/llm/types.ts",
- "target": "src/ai/llm/types.ts#Message",
- "relation": "contains",
+ "source": "src/ask/ask.ts#computeIdf",
+ "target": "src/ask/ask.ts#idfFromDf",
+ "relation": "calls",
"confidence": "extracted"
},
{
- "source": "src/ai/llm/types.ts",
- "target": "src/ai/llm/types.ts#ResponseFormat",
- "relation": "contains",
+ "source": "src/ask/ask.ts#computeIdfFromIndex",
+ "target": "src/ask/ask.ts#idfFromDf",
+ "relation": "calls",
"confidence": "extracted"
},
{
- "source": "src/ai/llm/types.ts",
- "target": "src/ai/llm/types.ts#ToolCall",
- "relation": "contains",
+ "source": "src/ask/ask.ts#findSubjectNodes",
+ "target": "src/ask/ask.ts#subjectWords",
+ "relation": "calls",
"confidence": "extracted"
},
{
- "source": "src/ai/llm/types.ts",
- "target": "src/ai/llm/types.ts#ToolSpec",
- "relation": "contains",
- "confidence": "extracted"
+ "source": "src/ask/ask.ts#findSubjectNodes",
+ "target": "src/graph/scopes.ts#pathUnderPrefix",
+ "relation": "calls",
+ "confidence": "inferred"
},
{
- "source": "src/ai/llm/types.ts",
- "target": "src/ai/llm/types.ts#Usage",
- "relation": "contains",
- "confidence": "extracted"
+ "source": "src/ask/ask.ts#findSubjectNodes",
+ "target": "src/graph/traverse.ts#resolveSymbol",
+ "relation": "calls",
+ "confidence": "inferred"
},
{
- "source": "src/ai/providers.ts",
- "target": "src/ai/providers.ts#EngineConfig",
- "relation": "contains",
+ "source": "src/ask/ask.ts#formatAsk",
+ "target": "src/ask/ask.ts#askSavingsFooter",
+ "relation": "calls",
"confidence": "extracted"
},
{
- "source": "src/ai/providers.ts",
- "target": "src/ai/providers.ts#resolveConfig",
- "relation": "contains",
+ "source": "src/ask/ask.ts#formatAsk",
+ "target": "src/ask/ask.ts#escalationNudge",
+ "relation": "calls",
"confidence": "extracted"
},
{
- "source": "src/ai/providers.ts",
- "target": "src/ai/providers.ts#ResolvedConfig",
- "relation": "contains",
+ "source": "src/ask/ask.ts#formatAsk",
+ "target": "src/ask/ask.ts#scopeFooterLines",
+ "relation": "calls",
"confidence": "extracted"
},
{
- "source": "src/ai/providers.ts",
- "target": "src/ai/crux.ts",
- "relation": "imports",
- "confidence": "extracted"
+ "source": "src/ask/ask.ts#formatSkeleton",
+ "target": "src/context/savings.ts#savingsFooter",
+ "relation": "calls",
+ "confidence": "inferred"
},
{
- "source": "src/ai/providers.ts",
- "target": "src/ai/llm/factory.ts",
- "relation": "imports",
+ "source": "src/ask/ask.ts#hitFiles",
+ "target": "src/ask/ask.ts#parseSpan",
+ "relation": "calls",
"confidence": "extracted"
},
{
- "source": "src/ai/providers.ts",
- "target": "src/ai/llm/types.ts",
- "relation": "imports",
+ "source": "src/ask/ask.ts#inlineSource",
+ "target": "src/ask/ask.ts#parseSpan",
+ "relation": "calls",
"confidence": "extracted"
},
{
- "source": "src/ai/providers.ts",
- "target": "src/ai/summarize.ts",
- "relation": "imports",
+ "source": "src/ask/ask.ts#inlineSource",
+ "target": "src/ask/ask.ts#sliceSpan",
+ "relation": "calls",
"confidence": "extracted"
},
{
- "source": "src/ai/providers.ts",
- "target": "src/ai/synthesize.ts",
- "relation": "imports",
+ "source": "src/ask/ask.ts#lexical",
+ "target": "src/ask/ask.ts#bm25",
+ "relation": "calls",
"confidence": "extracted"
},
{
- "source": "src/ai/summarize.ts",
- "target": "src/ai/summarize.ts#ChatSummarizer",
- "relation": "contains",
+ "source": "src/ask/ask.ts#lexical",
+ "target": "src/ask/ask.ts#computeIdf",
+ "relation": "calls",
"confidence": "extracted"
},
{
- "source": "src/ai/summarize.ts",
- "target": "src/ai/summarize.ts#Summarizer",
- "relation": "contains",
+ "source": "src/ask/ask.ts#lexical",
+ "target": "src/ask/ask.ts#computeIdfFromIndex",
+ "relation": "calls",
"confidence": "extracted"
},
{
- "source": "src/ai/summarize.ts",
- "target": "src/ai/summarize.ts#userContent",
- "relation": "contains",
+ "source": "src/ask/ask.ts#lexical",
+ "target": "src/ask/ask.ts#lexical.bodyLen",
+ "relation": "calls",
"confidence": "extracted"
},
{
- "source": "src/ai/summarize.ts",
- "target": "src/ai/llm/types.ts",
- "relation": "imports",
+ "source": "src/ask/ask.ts#lexical",
+ "target": "src/ask/ask.ts#matchedIdfShare",
+ "relation": "calls",
"confidence": "extracted"
},
{
- "source": "src/ai/summarize.ts#ChatSummarizer",
- "target": "src/ai/summarize.ts#ChatSummarizer.constructor",
- "relation": "contains",
+ "source": "src/ask/ask.ts#lexical",
+ "target": "src/ask/ask.ts#score",
+ "relation": "calls",
"confidence": "extracted"
},
{
- "source": "src/ai/summarize.ts#ChatSummarizer",
- "target": "src/ai/summarize.ts#ChatSummarizer.summarize",
- "relation": "contains",
+ "source": "src/ask/ask.ts#lexical",
+ "target": "src/ask/ask.ts#strongShare",
+ "relation": "calls",
"confidence": "extracted"
},
{
- "source": "src/ai/summarize.ts#ChatSummarizer",
- "target": "src/ai/summarize.ts#Summarizer",
- "relation": "implements",
- "confidence": "extracted"
+ "source": "src/ask/ask.ts#lexical",
+ "target": "src/ask/fuse.ts#rankScopesAndFuse",
+ "relation": "calls",
+ "confidence": "inferred"
},
{
- "source": "src/ai/summarize.ts#ChatSummarizer.summarize",
- "target": "src/ai/summarize.ts#userContent",
+ "source": "src/ask/ask.ts#lexical",
+ "target": "src/ask/graphrank.ts#personalizedPageRank",
"relation": "calls",
- "confidence": "extracted"
+ "confidence": "inferred"
},
{
- "source": "src/ai/synthesize.ts",
- "target": "src/ai/synthesize.ts#ChatSynthesizer",
- "relation": "contains",
- "confidence": "extracted"
+ "source": "src/ask/ask.ts#lexical",
+ "target": "src/ask/index-file.ts#counts",
+ "relation": "calls",
+ "confidence": "inferred"
},
{
- "source": "src/ai/synthesize.ts",
- "target": "src/ai/synthesize.ts#clean",
- "relation": "contains",
- "confidence": "extracted"
+ "source": "src/ask/ask.ts#lexical",
+ "target": "src/ask/index-file.ts#tokenize",
+ "relation": "calls",
+ "confidence": "inferred"
},
{
- "source": "src/ai/synthesize.ts",
- "target": "src/ai/synthesize.ts#FileSummary",
- "relation": "contains",
- "confidence": "extracted"
+ "source": "src/ask/ask.ts#lexical",
+ "target": "src/graph/scopes.ts#pathUnderPrefix",
+ "relation": "calls",
+ "confidence": "inferred"
},
{
- "source": "src/ai/synthesize.ts",
- "target": "src/ai/synthesize.ts#Synthesizer",
- "relation": "contains",
- "confidence": "extracted"
+ "source": "src/ask/ask.ts#lexical",
+ "target": "src/graph/scopes.ts#scopeOf",
+ "relation": "calls",
+ "confidence": "inferred"
},
{
- "source": "src/ai/synthesize.ts",
- "target": "src/ai/synthesize.ts#SynthLink",
- "relation": "contains",
- "confidence": "extracted"
+ "source": "src/ask/ask.ts#lexical",
+ "target": "src/graph/scopes.ts#scopesHereClause",
+ "relation": "calls",
+ "confidence": "inferred"
},
{
- "source": "src/ai/synthesize.ts",
- "target": "src/ai/synthesize.ts#SynthNode",
- "relation": "contains",
- "confidence": "extracted"
+ "source": "src/ask/ask.ts#lexical",
+ "target": "src/graph/scopes.ts#scopesOfGraph",
+ "relation": "calls",
+ "confidence": "inferred"
},
{
- "source": "src/ai/synthesize.ts",
- "target": "src/ai/synthesize.ts#userContent",
+ "source": "src/ask/ask.ts#lexical",
+ "target": "src/ask/ask.ts#lexical.bodyLen",
"relation": "contains",
"confidence": "extracted"
},
{
- "source": "src/ai/synthesize.ts",
- "target": "src/ai/llm/types.ts",
- "relation": "imports",
+ "source": "src/ask/ask.ts#loadCorpus",
+ "target": "src/ask/ask.ts#firstProse",
+ "relation": "calls",
"confidence": "extracted"
},
{
- "source": "src/ai/synthesize.ts#ChatSynthesizer",
- "target": "src/ai/synthesize.ts#ChatSynthesizer.constructor",
- "relation": "contains",
- "confidence": "extracted"
+ "source": "src/ask/ask.ts#loadCorpus",
+ "target": "src/graph/load.ts#loadAskIndexCached",
+ "relation": "calls",
+ "confidence": "inferred"
},
{
- "source": "src/ai/synthesize.ts#ChatSynthesizer",
- "target": "src/ai/synthesize.ts#ChatSynthesizer.synthesize",
- "relation": "contains",
- "confidence": "extracted"
+ "source": "src/ask/ask.ts#loadCorpus",
+ "target": "src/graph/load.ts#loadGraphCached",
+ "relation": "calls",
+ "confidence": "inferred"
},
{
- "source": "src/ai/synthesize.ts#ChatSynthesizer",
- "target": "src/ai/synthesize.ts#Synthesizer",
- "relation": "implements",
+ "source": "src/ask/ask.ts#matchedIdfShare",
+ "target": "src/ask/ask.ts#hasTerm",
+ "relation": "calls",
"confidence": "extracted"
},
{
- "source": "src/ai/synthesize.ts#ChatSynthesizer.synthesize",
- "target": "src/ai/synthesize.ts#clean",
+ "source": "src/ask/ask.ts#scopeFooterLines",
+ "target": "src/graph/scopes.ts#scopeLabel",
"relation": "calls",
- "confidence": "extracted"
+ "confidence": "inferred"
},
{
- "source": "src/ai/synthesize.ts#ChatSynthesizer.synthesize",
- "target": "src/ai/synthesize.ts#userContent",
+ "source": "src/ask/ask.ts#skeleton",
+ "target": "src/ask/ask.ts#skeleton.startLine",
"relation": "calls",
"confidence": "extracted"
},
{
- "source": "src/ask/ask.ts",
- "target": "src/ask/ask.ts#ask",
- "relation": "contains",
- "confidence": "extracted"
+ "source": "src/ask/ask.ts#skeleton",
+ "target": "src/context/node-file.ts#contextDirFor",
+ "relation": "calls",
+ "confidence": "inferred"
},
{
- "source": "src/ask/ask.ts",
- "target": "src/ask/ask.ts#AskHit",
- "relation": "contains",
- "confidence": "extracted"
+ "source": "src/ask/ask.ts#skeleton",
+ "target": "src/context/savings.ts#savingsFor",
+ "relation": "calls",
+ "confidence": "inferred"
},
{
- "source": "src/ask/ask.ts",
- "target": "src/ask/ask.ts#AskOptions",
- "relation": "contains",
- "confidence": "extracted"
+ "source": "src/ask/ask.ts#skeleton",
+ "target": "src/graph/load.ts#loadGraphCached",
+ "relation": "calls",
+ "confidence": "inferred"
},
{
- "source": "src/ask/ask.ts",
- "target": "src/ask/ask.ts#AskResult",
+ "source": "src/ask/ask.ts#skeleton",
+ "target": "src/ask/ask.ts#skeleton.startLine",
"relation": "contains",
"confidence": "extracted"
},
{
- "source": "src/ask/ask.ts",
- "target": "src/ask/ask.ts#askSavingsFooter",
- "relation": "contains",
+ "source": "src/ask/ask.ts#strongShare",
+ "target": "src/ask/ask.ts#matchedIdfShare",
+ "relation": "calls",
"confidence": "extracted"
},
{
- "source": "src/ask/ask.ts",
- "target": "src/ask/ask.ts#baselineFor",
- "relation": "contains",
+ "source": "src/ask/ask.ts#structural",
+ "target": "src/ask/ask.ts#fallthroughNoteFor",
+ "relation": "calls",
"confidence": "extracted"
},
{
- "source": "src/ask/ask.ts",
- "target": "src/ask/ask.ts#bm25",
- "relation": "contains",
+ "source": "src/ask/ask.ts#structural",
+ "target": "src/ask/ask.ts#findSubjectNodes",
+ "relation": "calls",
"confidence": "extracted"
},
{
- "source": "src/ask/ask.ts",
- "target": "src/ask/ask.ts#computeIdf",
+ "source": "src/ask/fuse.ts",
+ "target": "src/ask/fuse.ts#byScore",
"relation": "contains",
"confidence": "extracted"
},
{
- "source": "src/ask/ask.ts",
- "target": "src/ask/ask.ts#computeIdfFromIndex",
+ "source": "src/ask/fuse.ts",
+ "target": "src/ask/fuse.ts#fuseScopes",
"relation": "contains",
"confidence": "extracted"
},
{
- "source": "src/ask/ask.ts",
- "target": "src/ask/ask.ts#Corpus",
+ "source": "src/ask/fuse.ts",
+ "target": "src/ask/fuse.ts#FusionResult",
"relation": "contains",
"confidence": "extracted"
},
{
- "source": "src/ask/ask.ts",
- "target": "src/ask/ask.ts#escalationNudge",
+ "source": "src/ask/fuse.ts",
+ "target": "src/ask/fuse.ts#rankScopesAndFuse",
"relation": "contains",
"confidence": "extracted"
},
{
- "source": "src/ask/ask.ts",
- "target": "src/ask/ask.ts#fallthroughNoteFor",
+ "source": "src/ask/fuse.ts",
+ "target": "src/ask/fuse.ts#ScopedDoc",
"relation": "contains",
"confidence": "extracted"
},
{
- "source": "src/ask/ask.ts",
- "target": "src/ask/ask.ts#findSubjectNodes",
+ "source": "src/ask/fuse.ts",
+ "target": "src/ask/fuse.ts#ScopeRankOps",
"relation": "contains",
"confidence": "extracted"
},
{
- "source": "src/ask/ask.ts",
- "target": "src/ask/ask.ts#firstProse",
- "relation": "contains",
+ "source": "src/ask/fuse.ts#rankScopesAndFuse",
+ "target": "src/ask/fuse.ts#fuseScopes",
+ "relation": "calls",
"confidence": "extracted"
},
{
- "source": "src/ask/ask.ts",
- "target": "src/ask/ask.ts#formatAsk",
+ "source": "src/ask/graphrank.ts",
+ "target": "src/ask/graphrank.ts#PageRankOptions",
"relation": "contains",
"confidence": "extracted"
},
{
- "source": "src/ask/ask.ts",
- "target": "src/ask/ask.ts#formatSkeleton",
+ "source": "src/ask/graphrank.ts",
+ "target": "src/ask/graphrank.ts#personalizedPageRank",
"relation": "contains",
"confidence": "extracted"
},
{
- "source": "src/ask/ask.ts",
- "target": "src/ask/ask.ts#hasTerm",
- "relation": "contains",
+ "source": "src/ask/graphrank.ts",
+ "target": "src/graph/relations.ts",
+ "relation": "imports",
"confidence": "extracted"
},
{
- "source": "src/ask/ask.ts",
- "target": "src/ask/ask.ts#hitFiles",
- "relation": "contains",
+ "source": "src/ask/graphrank.ts",
+ "target": "src/graph/types.ts",
+ "relation": "imports",
"confidence": "extracted"
},
{
- "source": "src/ask/ask.ts",
- "target": "src/ask/ask.ts#idfFromDf",
- "relation": "contains",
+ "source": "src/ask/graphrank.ts#personalizedPageRank",
+ "target": "src/ask/graphrank.ts#personalizedPageRank.link",
+ "relation": "calls",
"confidence": "extracted"
},
{
- "source": "src/ask/ask.ts",
- "target": "src/ask/ask.ts#inlineSource",
+ "source": "src/ask/graphrank.ts#personalizedPageRank",
+ "target": "src/ask/graphrank.ts#personalizedPageRank.link",
"relation": "contains",
"confidence": "extracted"
},
{
- "source": "src/ask/ask.ts",
- "target": "src/ask/ask.ts#lexical",
+ "source": "src/ask/index-file.ts",
+ "target": "src/ask/index-file.ts#AskIndex",
"relation": "contains",
"confidence": "extracted"
},
{
- "source": "src/ask/ask.ts",
- "target": "src/ask/ask.ts#loadCorpus",
+ "source": "src/ask/index-file.ts",
+ "target": "src/ask/index-file.ts#AskIndexDoc",
"relation": "contains",
"confidence": "extracted"
},
{
- "source": "src/ask/ask.ts",
- "target": "src/ask/ask.ts#matchedIdfShare",
+ "source": "src/ask/index-file.ts",
+ "target": "src/ask/index-file.ts#askIndexPath",
"relation": "contains",
"confidence": "extracted"
},
{
- "source": "src/ask/ask.ts",
- "target": "src/ask/ask.ts#parseSpan",
+ "source": "src/ask/index-file.ts",
+ "target": "src/ask/index-file.ts#bagLen",
"relation": "contains",
"confidence": "extracted"
},
{
- "source": "src/ask/ask.ts",
- "target": "src/ask/ask.ts#scopeFooterLines",
+ "source": "src/ask/index-file.ts",
+ "target": "src/ask/index-file.ts#counts",
"relation": "contains",
"confidence": "extracted"
},
{
- "source": "src/ask/ask.ts",
- "target": "src/ask/ask.ts#score",
+ "source": "src/ask/index-file.ts",
+ "target": "src/ask/index-file.ts#pairs",
"relation": "contains",
"confidence": "extracted"
},
{
- "source": "src/ask/ask.ts",
- "target": "src/ask/ask.ts#skeleton",
+ "source": "src/ask/index-file.ts",
+ "target": "src/ask/index-file.ts#readAskIndex",
"relation": "contains",
"confidence": "extracted"
},
{
- "source": "src/ask/ask.ts",
- "target": "src/ask/ask.ts#SkeletonEntry",
+ "source": "src/ask/index-file.ts",
+ "target": "src/ask/index-file.ts#tokenize",
"relation": "contains",
"confidence": "extracted"
},
{
- "source": "src/ask/ask.ts",
- "target": "src/ask/ask.ts#SkeletonResult",
+ "source": "src/ask/index-file.ts",
+ "target": "src/ask/index-file.ts#writeAskIndex",
"relation": "contains",
"confidence": "extracted"
},
{
- "source": "src/ask/ask.ts",
- "target": "src/ask/ask.ts#sliceSpan",
- "relation": "contains",
+ "source": "src/ask/index-file.ts",
+ "target": "node:fs",
+ "relation": "imports",
"confidence": "extracted"
},
{
- "source": "src/ask/ask.ts",
- "target": "src/ask/ask.ts#structural",
- "relation": "contains",
+ "source": "src/ask/index-file.ts",
+ "target": "node:path",
+ "relation": "imports",
"confidence": "extracted"
},
{
- "source": "src/ask/ask.ts",
- "target": "src/ask/ask.ts#StructuralOutcome",
- "relation": "contains",
+ "source": "src/ask/index-file.ts",
+ "target": "src/context/node-file.ts",
+ "relation": "imports",
"confidence": "extracted"
},
{
- "source": "src/ask/ask.ts",
- "target": "src/ask/ask.ts#subjectWords",
- "relation": "contains",
+ "source": "src/ask/index-file.ts",
+ "target": "src/graph/types.ts",
+ "relation": "imports",
"confidence": "extracted"
},
{
- "source": "src/ask/ask.ts",
- "target": "src/ask/ask.ts#toTokens",
- "relation": "contains",
+ "source": "src/ask/index-file.ts#readAskIndex",
+ "target": "src/ask/index-file.ts#askIndexPath",
+ "relation": "calls",
"confidence": "extracted"
},
{
- "source": "src/ask/ask.ts",
- "target": "gray-matter",
- "relation": "imports",
+ "source": "src/ask/index-file.ts#writeAskIndex",
+ "target": "src/ask/index-file.ts#askIndexPath",
+ "relation": "calls",
"confidence": "extracted"
},
{
- "source": "src/ask/ask.ts",
- "target": "node:fs",
- "relation": "imports",
+ "source": "src/ask/index-file.ts#writeAskIndex",
+ "target": "src/ask/index-file.ts#bagLen",
+ "relation": "calls",
"confidence": "extracted"
},
{
- "source": "src/ask/ask.ts",
- "target": "node:path",
- "relation": "imports",
+ "source": "src/ask/index-file.ts#writeAskIndex",
+ "target": "src/ask/index-file.ts#counts",
+ "relation": "calls",
"confidence": "extracted"
},
{
- "source": "src/ask/ask.ts",
- "target": "src/ask/fuse.ts",
- "relation": "imports",
+ "source": "src/ask/index-file.ts#writeAskIndex",
+ "target": "src/ask/index-file.ts#pairs",
+ "relation": "calls",
"confidence": "extracted"
},
{
- "source": "src/ask/ask.ts",
- "target": "src/ask/graphrank.ts",
- "relation": "imports",
+ "source": "src/ask/index-file.ts#writeAskIndex",
+ "target": "src/ask/index-file.ts#tokenize",
+ "relation": "calls",
"confidence": "extracted"
},
{
- "source": "src/ask/ask.ts",
- "target": "src/ask/index-file.ts",
- "relation": "imports",
+ "source": "src/claude/format.ts",
+ "target": "src/claude/format.ts#AskJson",
+ "relation": "contains",
"confidence": "extracted"
},
{
- "source": "src/ask/ask.ts",
- "target": "src/context/node-file.ts",
- "relation": "imports",
+ "source": "src/claude/format.ts",
+ "target": "src/claude/format.ts#enrichedSegment",
+ "relation": "contains",
"confidence": "extracted"
},
{
- "source": "src/ask/ask.ts",
- "target": "src/context/savings.ts",
- "relation": "imports",
+ "source": "src/claude/format.ts",
+ "target": "src/claude/format.ts#formatBlastRadius",
+ "relation": "contains",
"confidence": "extracted"
},
{
- "source": "src/ask/ask.ts",
- "target": "src/graph/load.ts",
- "relation": "imports",
+ "source": "src/claude/format.ts",
+ "target": "src/claude/format.ts#formatOrientation",
+ "relation": "contains",
"confidence": "extracted"
},
{
- "source": "src/ask/ask.ts",
- "target": "src/graph/scopes.ts",
- "relation": "imports",
+ "source": "src/claude/format.ts",
+ "target": "src/claude/format.ts#formatRetrieval",
+ "relation": "contains",
"confidence": "extracted"
},
{
- "source": "src/ask/ask.ts",
- "target": "src/graph/traverse.ts",
- "relation": "imports",
+ "source": "src/claude/format.ts",
+ "target": "src/claude/format.ts#freshnessSegment",
+ "relation": "contains",
"confidence": "extracted"
},
{
- "source": "src/ask/ask.ts",
- "target": "src/graph/types.ts",
- "relation": "imports",
+ "source": "src/claude/format.ts",
+ "target": "src/claude/format.ts#incomingEdges",
+ "relation": "contains",
"confidence": "extracted"
},
{
- "source": "src/ask/ask.ts#ask",
- "target": "src/ask/ask.ts#baselineFor",
- "relation": "calls",
+ "source": "src/claude/format.ts",
+ "target": "src/claude/format.ts#nodeIdsInFile",
+ "relation": "contains",
"confidence": "extracted"
},
{
- "source": "src/ask/ask.ts#ask",
- "target": "src/ask/ask.ts#inlineSource",
- "relation": "calls",
+ "source": "src/claude/format.ts",
+ "target": "src/claude/format.ts#relevantRetrieval",
+ "relation": "contains",
"confidence": "extracted"
},
{
- "source": "src/ask/ask.ts#ask",
- "target": "src/ask/ask.ts#lexical",
- "relation": "calls",
+ "source": "src/claude/format.ts",
+ "target": "src/claude/format.ts#renderStatusline",
+ "relation": "contains",
"confidence": "extracted"
},
{
- "source": "src/ask/ask.ts#ask",
- "target": "src/ask/ask.ts#loadCorpus",
- "relation": "calls",
+ "source": "src/claude/format.ts",
+ "target": "src/claude/format.ts#renderSubagent",
+ "relation": "contains",
"confidence": "extracted"
},
{
- "source": "src/ask/ask.ts#ask",
- "target": "src/ask/ask.ts#structural",
- "relation": "calls",
+ "source": "src/claude/format.ts",
+ "target": "src/claude/format.ts#retrievalBody",
+ "relation": "contains",
"confidence": "extracted"
},
{
- "source": "src/ask/ask.ts#ask",
- "target": "src/context/node-file.ts#contextDirFor",
- "relation": "calls",
- "confidence": "inferred"
+ "source": "src/claude/format.ts",
+ "target": "src/claude/format.ts#retrievalTokensSaved",
+ "relation": "contains",
+ "confidence": "extracted"
},
{
- "source": "src/ask/ask.ts#ask",
- "target": "src/graph/scopes.ts#pathUnderPrefix",
- "relation": "calls",
- "confidence": "inferred"
+ "source": "src/claude/format.ts",
+ "target": "src/claude/format.ts#tokensOf",
+ "relation": "contains",
+ "confidence": "extracted"
},
{
- "source": "src/ask/ask.ts#ask",
- "target": "src/graph/scopes.ts#scopesHereClause",
- "relation": "calls",
- "confidence": "inferred"
+ "source": "src/claude/format.ts",
+ "target": "node:path",
+ "relation": "imports",
+ "confidence": "extracted"
},
{
- "source": "src/ask/ask.ts#ask",
- "target": "src/graph/scopes.ts#scopesOfGraph",
- "relation": "calls",
- "confidence": "inferred"
+ "source": "src/claude/format.ts",
+ "target": "src/claude/state.ts",
+ "relation": "imports",
+ "confidence": "extracted"
},
{
- "source": "src/ask/ask.ts#askSavingsFooter",
- "target": "src/ask/ask.ts#toTokens",
- "relation": "calls",
+ "source": "src/claude/format.ts",
+ "target": "src/graph/types.ts",
+ "relation": "imports",
"confidence": "extracted"
},
{
- "source": "src/ask/ask.ts#baselineFor",
- "target": "src/ask/ask.ts#hitFiles",
+ "source": "src/claude/format.ts#formatBlastRadius",
+ "target": "src/claude/format.ts#incomingEdges",
"relation": "calls",
"confidence": "extracted"
},
{
- "source": "src/ask/ask.ts#baselineFor",
- "target": "src/context/savings.ts#savingsFor",
+ "source": "src/claude/format.ts#formatRetrieval",
+ "target": "src/claude/format.ts#retrievalBody",
"relation": "calls",
- "confidence": "inferred"
+ "confidence": "extracted"
},
{
- "source": "src/ask/ask.ts#computeIdf",
- "target": "src/ask/ask.ts#idfFromDf",
+ "source": "src/claude/format.ts#formatRetrieval",
+ "target": "src/claude/format.ts#retrievalTokensSaved",
"relation": "calls",
"confidence": "extracted"
},
{
- "source": "src/ask/ask.ts#computeIdfFromIndex",
- "target": "src/ask/ask.ts#idfFromDf",
+ "source": "src/claude/format.ts#formatRetrieval",
+ "target": "src/claude/format.ts#tokensOf",
"relation": "calls",
"confidence": "extracted"
},
{
- "source": "src/ask/ask.ts#findSubjectNodes",
- "target": "src/ask/ask.ts#subjectWords",
+ "source": "src/claude/format.ts#incomingEdges",
+ "target": "src/claude/format.ts#nodeIdsInFile",
"relation": "calls",
"confidence": "extracted"
},
{
- "source": "src/ask/ask.ts#findSubjectNodes",
- "target": "src/graph/scopes.ts#pathUnderPrefix",
+ "source": "src/claude/format.ts#relevantRetrieval",
+ "target": "src/claude/format.ts#formatRetrieval",
"relation": "calls",
- "confidence": "inferred"
+ "confidence": "extracted"
},
{
- "source": "src/ask/ask.ts#findSubjectNodes",
- "target": "src/graph/traverse.ts#resolveSymbol",
+ "source": "src/claude/format.ts#renderStatusline",
+ "target": "src/claude/format.ts#enrichedSegment",
"relation": "calls",
- "confidence": "inferred"
+ "confidence": "extracted"
},
{
- "source": "src/ask/ask.ts#formatAsk",
- "target": "src/ask/ask.ts#askSavingsFooter",
+ "source": "src/claude/format.ts#renderStatusline",
+ "target": "src/claude/format.ts#freshnessSegment",
"relation": "calls",
"confidence": "extracted"
},
{
- "source": "src/ask/ask.ts#formatAsk",
- "target": "src/ask/ask.ts#escalationNudge",
+ "source": "src/claude/format.ts#retrievalTokensSaved",
+ "target": "src/claude/format.ts#retrievalBody",
"relation": "calls",
"confidence": "extracted"
},
{
- "source": "src/ask/ask.ts#formatAsk",
- "target": "src/ask/ask.ts#scopeFooterLines",
+ "source": "src/claude/format.ts#retrievalTokensSaved",
+ "target": "src/claude/format.ts#tokensOf",
"relation": "calls",
"confidence": "extracted"
},
{
- "source": "src/ask/ask.ts#formatSkeleton",
- "target": "src/context/savings.ts#savingsFooter",
- "relation": "calls",
- "confidence": "inferred"
+ "source": "src/claude/hooks.ts",
+ "target": "src/claude/hooks.ts#checkStaleCount",
+ "relation": "contains",
+ "confidence": "extracted"
},
{
- "source": "src/ask/ask.ts#hitFiles",
- "target": "src/ask/ask.ts#parseSpan",
- "relation": "calls",
+ "source": "src/claude/hooks.ts",
+ "target": "src/claude/hooks.ts#emit",
+ "relation": "contains",
"confidence": "extracted"
},
{
- "source": "src/ask/ask.ts#inlineSource",
- "target": "src/ask/ask.ts#parseSpan",
- "relation": "calls",
+ "source": "src/claude/hooks.ts",
+ "target": "src/claude/hooks.ts#graftJson",
+ "relation": "contains",
"confidence": "extracted"
},
{
- "source": "src/ask/ask.ts#inlineSource",
- "target": "src/ask/ask.ts#sliceSpan",
- "relation": "calls",
+ "source": "src/claude/hooks.ts",
+ "target": "src/claude/hooks.ts#handlePostEdit",
+ "relation": "contains",
"confidence": "extracted"
},
{
- "source": "src/ask/ask.ts#lexical",
- "target": "src/ask/ask.ts#bm25",
- "relation": "calls",
+ "source": "src/claude/hooks.ts",
+ "target": "src/claude/hooks.ts#handleStop",
+ "relation": "contains",
"confidence": "extracted"
},
{
- "source": "src/ask/ask.ts#lexical",
- "target": "src/ask/ask.ts#computeIdf",
- "relation": "calls",
+ "source": "src/claude/hooks.ts",
+ "target": "src/claude/hooks.ts#lastFileScopeHint",
+ "relation": "contains",
"confidence": "extracted"
},
{
- "source": "src/ask/ask.ts#lexical",
- "target": "src/ask/ask.ts#computeIdfFromIndex",
- "relation": "calls",
+ "source": "src/claude/hooks.ts",
+ "target": "src/claude/hooks.ts#main",
+ "relation": "contains",
"confidence": "extracted"
},
{
- "source": "src/ask/ask.ts#lexical",
- "target": "src/ask/ask.ts#lexical.bodyLen",
- "relation": "calls",
+ "source": "src/claude/hooks.ts",
+ "target": "src/claude/hooks.ts#projectDir",
+ "relation": "contains",
"confidence": "extracted"
},
{
- "source": "src/ask/ask.ts#lexical",
- "target": "src/ask/ask.ts#matchedIdfShare",
- "relation": "calls",
+ "source": "src/claude/hooks.ts",
+ "target": "src/claude/hooks.ts#readStdin",
+ "relation": "contains",
"confidence": "extracted"
},
{
- "source": "src/ask/ask.ts#lexical",
- "target": "src/ask/ask.ts#score",
- "relation": "calls",
+ "source": "src/claude/hooks.ts",
+ "target": "src/claude/hooks.ts#safeReadFd0",
+ "relation": "contains",
"confidence": "extracted"
},
{
- "source": "src/ask/ask.ts#lexical",
- "target": "src/ask/fuse.ts#rankScopesAndFuse",
- "relation": "calls",
- "confidence": "inferred"
+ "source": "src/claude/hooks.ts",
+ "target": "src/claude/hooks.ts#underGraft",
+ "relation": "contains",
+ "confidence": "extracted"
},
{
- "source": "src/ask/ask.ts#lexical",
- "target": "src/ask/graphrank.ts#personalizedPageRank",
- "relation": "calls",
- "confidence": "inferred"
+ "source": "src/claude/hooks.ts",
+ "target": "node:child_process",
+ "relation": "imports",
+ "confidence": "extracted"
},
{
- "source": "src/ask/ask.ts#lexical",
- "target": "src/ask/index-file.ts#counts",
- "relation": "calls",
- "confidence": "inferred"
+ "source": "src/claude/hooks.ts",
+ "target": "node:fs",
+ "relation": "imports",
+ "confidence": "extracted"
},
{
- "source": "src/ask/ask.ts#lexical",
- "target": "src/ask/index-file.ts#tokenize",
- "relation": "calls",
- "confidence": "inferred"
+ "source": "src/claude/hooks.ts",
+ "target": "node:path",
+ "relation": "imports",
+ "confidence": "extracted"
},
{
- "source": "src/ask/ask.ts#lexical",
- "target": "src/graph/scopes.ts#pathUnderPrefix",
- "relation": "calls",
- "confidence": "inferred"
+ "source": "src/claude/hooks.ts",
+ "target": "src/claude/format.ts",
+ "relation": "imports",
+ "confidence": "extracted"
},
{
- "source": "src/ask/ask.ts#lexical",
- "target": "src/graph/scopes.ts#scopeOf",
- "relation": "calls",
- "confidence": "inferred"
+ "source": "src/claude/hooks.ts",
+ "target": "src/claude/paths.ts",
+ "relation": "imports",
+ "confidence": "extracted"
},
{
- "source": "src/ask/ask.ts#lexical",
- "target": "src/graph/scopes.ts#scopesHereClause",
- "relation": "calls",
- "confidence": "inferred"
+ "source": "src/claude/hooks.ts",
+ "target": "src/claude/state.ts",
+ "relation": "imports",
+ "confidence": "extracted"
},
{
- "source": "src/ask/ask.ts#lexical",
- "target": "src/graph/scopes.ts#scopesOfGraph",
- "relation": "calls",
- "confidence": "inferred"
+ "source": "src/claude/hooks.ts",
+ "target": "src/claude/stats.ts",
+ "relation": "imports",
+ "confidence": "extracted"
},
{
- "source": "src/ask/ask.ts#lexical",
- "target": "src/ask/ask.ts#lexical.bodyLen",
- "relation": "contains",
+ "source": "src/claude/hooks.ts",
+ "target": "src/graph/scopes.ts",
+ "relation": "imports",
"confidence": "extracted"
},
{
- "source": "src/ask/ask.ts#loadCorpus",
- "target": "src/ask/ask.ts#firstProse",
+ "source": "src/claude/hooks.ts#checkStaleCount",
+ "target": "src/claude/hooks.ts#graftJson",
"relation": "calls",
"confidence": "extracted"
},
{
- "source": "src/ask/ask.ts#loadCorpus",
- "target": "src/graph/load.ts#loadAskIndexCached",
+ "source": "src/claude/hooks.ts#graftJson",
+ "target": "src/claude/paths.ts#graftCliPath",
"relation": "calls",
"confidence": "inferred"
},
{
- "source": "src/ask/ask.ts#loadCorpus",
- "target": "src/graph/load.ts#loadGraphCached",
+ "source": "src/claude/hooks.ts#handlePostEdit",
+ "target": "src/claude/format.ts#formatBlastRadius",
"relation": "calls",
"confidence": "inferred"
},
{
- "source": "src/ask/ask.ts#matchedIdfShare",
- "target": "src/ask/ask.ts#hasTerm",
+ "source": "src/claude/hooks.ts#handlePostEdit",
+ "target": "src/claude/hooks.ts#checkStaleCount",
"relation": "calls",
"confidence": "extracted"
},
{
- "source": "src/ask/ask.ts#scopeFooterLines",
- "target": "src/graph/scopes.ts#scopeLabel",
+ "source": "src/claude/hooks.ts#handlePostEdit",
+ "target": "src/claude/hooks.ts#emit",
"relation": "calls",
- "confidence": "inferred"
+ "confidence": "extracted"
},
{
- "source": "src/ask/ask.ts#skeleton",
- "target": "src/ask/ask.ts#skeleton.startLine",
+ "source": "src/claude/hooks.ts#handlePostEdit",
+ "target": "src/claude/hooks.ts#underGraft",
"relation": "calls",
"confidence": "extracted"
},
{
- "source": "src/ask/ask.ts#skeleton",
- "target": "src/context/node-file.ts#contextDirFor",
+ "source": "src/claude/hooks.ts#handlePostEdit",
+ "target": "src/claude/state.ts#patchStats",
"relation": "calls",
"confidence": "inferred"
},
{
- "source": "src/ask/ask.ts#skeleton",
- "target": "src/context/savings.ts#savingsFor",
+ "source": "src/claude/hooks.ts#handlePostEdit",
+ "target": "src/claude/stats.ts#readWiring",
"relation": "calls",
"confidence": "inferred"
},
{
- "source": "src/ask/ask.ts#skeleton",
- "target": "src/graph/load.ts#loadGraphCached",
+ "source": "src/claude/hooks.ts#handleStop",
+ "target": "src/claude/paths.ts#claudeScriptPath",
"relation": "calls",
"confidence": "inferred"
},
{
- "source": "src/ask/ask.ts#skeleton",
- "target": "src/ask/ask.ts#skeleton.startLine",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/ask/ask.ts#structural",
- "target": "src/ask/ask.ts#fallthroughNoteFor",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "src/ask/ask.ts#structural",
- "target": "src/ask/ask.ts#findSubjectNodes",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "src/ask/fuse.ts",
- "target": "src/ask/fuse.ts#byScore",
- "relation": "contains",
- "confidence": "extracted"
+ "source": "src/claude/hooks.ts#handleStop",
+ "target": "src/claude/state.ts#acquireLock",
+ "relation": "calls",
+ "confidence": "inferred"
},
{
- "source": "src/ask/fuse.ts",
- "target": "src/ask/fuse.ts#fuseScopes",
- "relation": "contains",
- "confidence": "extracted"
+ "source": "src/claude/hooks.ts#handleStop",
+ "target": "src/claude/state.ts#patchStats",
+ "relation": "calls",
+ "confidence": "inferred"
},
{
- "source": "src/ask/fuse.ts",
- "target": "src/ask/fuse.ts#FusionResult",
- "relation": "contains",
- "confidence": "extracted"
+ "source": "src/claude/hooks.ts#handleStop",
+ "target": "src/claude/state.ts#readStats",
+ "relation": "calls",
+ "confidence": "inferred"
},
{
- "source": "src/ask/fuse.ts",
- "target": "src/ask/fuse.ts#rankScopesAndFuse",
- "relation": "contains",
- "confidence": "extracted"
+ "source": "src/claude/hooks.ts#lastFileScopeHint",
+ "target": "src/claude/stats.ts#readWiring",
+ "relation": "calls",
+ "confidence": "inferred"
},
{
- "source": "src/ask/fuse.ts",
- "target": "src/ask/fuse.ts#ScopedDoc",
- "relation": "contains",
- "confidence": "extracted"
+ "source": "src/claude/hooks.ts#lastFileScopeHint",
+ "target": "src/graph/scopes.ts#scopeOf",
+ "relation": "calls",
+ "confidence": "inferred"
},
{
- "source": "src/ask/fuse.ts",
- "target": "src/ask/fuse.ts#ScopeRankOps",
- "relation": "contains",
- "confidence": "extracted"
+ "source": "src/claude/hooks.ts#lastFileScopeHint",
+ "target": "src/graph/scopes.ts#scopesOfGraph",
+ "relation": "calls",
+ "confidence": "inferred"
},
{
- "source": "src/ask/fuse.ts#rankScopesAndFuse",
- "target": "src/ask/fuse.ts#fuseScopes",
+ "source": "src/claude/hooks.ts#main",
+ "target": "src/claude/format.ts#formatOrientation",
"relation": "calls",
- "confidence": "extracted"
+ "confidence": "inferred"
},
{
- "source": "src/ask/graphrank.ts",
- "target": "src/ask/graphrank.ts#PageRankOptions",
- "relation": "contains",
- "confidence": "extracted"
+ "source": "src/claude/hooks.ts#main",
+ "target": "src/claude/format.ts#relevantRetrieval",
+ "relation": "calls",
+ "confidence": "inferred"
},
{
- "source": "src/ask/graphrank.ts",
- "target": "src/ask/graphrank.ts#personalizedPageRank",
- "relation": "contains",
+ "source": "src/claude/hooks.ts#main",
+ "target": "src/claude/hooks.ts#emit",
+ "relation": "calls",
"confidence": "extracted"
},
{
- "source": "src/ask/graphrank.ts",
- "target": "src/graph/relations.ts",
- "relation": "imports",
+ "source": "src/claude/hooks.ts#main",
+ "target": "src/claude/hooks.ts#graftJson",
+ "relation": "calls",
"confidence": "extracted"
},
{
- "source": "src/ask/graphrank.ts",
- "target": "src/graph/types.ts",
- "relation": "imports",
+ "source": "src/claude/hooks.ts#main",
+ "target": "src/claude/hooks.ts#handlePostEdit",
+ "relation": "calls",
"confidence": "extracted"
},
{
- "source": "src/ask/graphrank.ts#personalizedPageRank",
- "target": "src/ask/graphrank.ts#personalizedPageRank.link",
+ "source": "src/claude/hooks.ts#main",
+ "target": "src/claude/hooks.ts#handleStop",
"relation": "calls",
"confidence": "extracted"
},
{
- "source": "src/ask/graphrank.ts#personalizedPageRank",
- "target": "src/ask/graphrank.ts#personalizedPageRank.link",
- "relation": "contains",
+ "source": "src/claude/hooks.ts#main",
+ "target": "src/claude/hooks.ts#lastFileScopeHint",
+ "relation": "calls",
"confidence": "extracted"
},
{
- "source": "src/ask/index-file.ts",
- "target": "src/ask/index-file.ts#AskIndex",
- "relation": "contains",
+ "source": "src/claude/hooks.ts#main",
+ "target": "src/claude/hooks.ts#projectDir",
+ "relation": "calls",
"confidence": "extracted"
},
{
- "source": "src/ask/index-file.ts",
- "target": "src/ask/index-file.ts#AskIndexDoc",
- "relation": "contains",
+ "source": "src/claude/hooks.ts#main",
+ "target": "src/claude/hooks.ts#readStdin",
+ "relation": "calls",
"confidence": "extracted"
},
{
- "source": "src/ask/index-file.ts",
- "target": "src/ask/index-file.ts#askIndexPath",
- "relation": "contains",
- "confidence": "extracted"
+ "source": "src/claude/hooks.ts#main",
+ "target": "src/claude/state.ts#readSession",
+ "relation": "calls",
+ "confidence": "inferred"
},
{
- "source": "src/ask/index-file.ts",
- "target": "src/ask/index-file.ts#bagLen",
- "relation": "contains",
- "confidence": "extracted"
+ "source": "src/claude/hooks.ts#main",
+ "target": "src/claude/state.ts#readStats",
+ "relation": "calls",
+ "confidence": "inferred"
},
{
- "source": "src/ask/index-file.ts",
- "target": "src/ask/index-file.ts#counts",
- "relation": "contains",
- "confidence": "extracted"
+ "source": "src/claude/hooks.ts#main",
+ "target": "src/claude/state.ts#writeSession",
+ "relation": "calls",
+ "confidence": "inferred"
},
{
- "source": "src/ask/index-file.ts",
- "target": "src/ask/index-file.ts#pairs",
- "relation": "contains",
+ "source": "src/claude/hooks.ts#readStdin",
+ "target": "src/claude/hooks.ts#safeReadFd0",
+ "relation": "calls",
"confidence": "extracted"
},
{
- "source": "src/ask/index-file.ts",
- "target": "src/ask/index-file.ts#readAskIndex",
+ "source": "src/claude/init.ts",
+ "target": "src/claude/init.ts#InitResult",
"relation": "contains",
"confidence": "extracted"
},
{
- "source": "src/ask/index-file.ts",
- "target": "src/ask/index-file.ts#tokenize",
+ "source": "src/claude/init.ts",
+ "target": "src/claude/init.ts#runInit",
"relation": "contains",
"confidence": "extracted"
},
{
- "source": "src/ask/index-file.ts",
- "target": "src/ask/index-file.ts#writeAskIndex",
- "relation": "contains",
+ "source": "src/claude/init.ts",
+ "target": "node:child_process",
+ "relation": "imports",
"confidence": "extracted"
},
{
- "source": "src/ask/index-file.ts",
+ "source": "src/claude/init.ts",
"target": "node:fs",
"relation": "imports",
"confidence": "extracted"
},
{
- "source": "src/ask/index-file.ts",
+ "source": "src/claude/init.ts",
"target": "node:path",
"relation": "imports",
"confidence": "extracted"
},
{
- "source": "src/ask/index-file.ts",
- "target": "src/context/node-file.ts",
+ "source": "src/claude/init.ts",
+ "target": "src/claude/paths.ts",
"relation": "imports",
"confidence": "extracted"
},
{
- "source": "src/ask/index-file.ts",
- "target": "src/graph/types.ts",
+ "source": "src/claude/init.ts",
+ "target": "src/claude/settings-merge.ts",
"relation": "imports",
"confidence": "extracted"
},
{
- "source": "src/ask/index-file.ts#readAskIndex",
- "target": "src/ask/index-file.ts#askIndexPath",
- "relation": "calls",
+ "source": "src/claude/init.ts",
+ "target": "src/claude/shim-template.ts",
+ "relation": "imports",
"confidence": "extracted"
},
{
- "source": "src/ask/index-file.ts#writeAskIndex",
- "target": "src/ask/index-file.ts#askIndexPath",
- "relation": "calls",
+ "source": "src/claude/init.ts",
+ "target": "src/claude/skill-template.ts",
+ "relation": "imports",
"confidence": "extracted"
},
{
- "source": "src/ask/index-file.ts#writeAskIndex",
- "target": "src/ask/index-file.ts#bagLen",
- "relation": "calls",
+ "source": "src/claude/init.ts",
+ "target": "src/hosts/mcp-config.ts",
+ "relation": "imports",
"confidence": "extracted"
},
{
- "source": "src/ask/index-file.ts#writeAskIndex",
- "target": "src/ask/index-file.ts#counts",
+ "source": "src/claude/init.ts#runInit",
+ "target": "src/claude/paths.ts#claudeDistDir",
"relation": "calls",
- "confidence": "extracted"
+ "confidence": "inferred"
},
{
- "source": "src/ask/index-file.ts#writeAskIndex",
- "target": "src/ask/index-file.ts#pairs",
+ "source": "src/claude/init.ts#runInit",
+ "target": "src/claude/settings-merge.ts#mergeGraftSettings",
"relation": "calls",
- "confidence": "extracted"
+ "confidence": "inferred"
},
{
- "source": "src/ask/index-file.ts#writeAskIndex",
- "target": "src/ask/index-file.ts#tokenize",
+ "source": "src/claude/init.ts#runInit",
+ "target": "src/claude/shim-template.ts#hooksShim",
"relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "src/claude/format.ts",
- "target": "src/claude/format.ts#AskJson",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/claude/format.ts",
- "target": "src/claude/format.ts#enrichedSegment",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/claude/format.ts",
- "target": "src/claude/format.ts#formatBlastRadius",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/claude/format.ts",
- "target": "src/claude/format.ts#formatOrientation",
- "relation": "contains",
- "confidence": "extracted"
+ "confidence": "inferred"
},
{
- "source": "src/claude/format.ts",
- "target": "src/claude/format.ts#formatRetrieval",
- "relation": "contains",
- "confidence": "extracted"
+ "source": "src/claude/init.ts#runInit",
+ "target": "src/claude/shim-template.ts#statuslineShim",
+ "relation": "calls",
+ "confidence": "inferred"
},
{
- "source": "src/claude/format.ts",
- "target": "src/claude/format.ts#freshnessSegment",
- "relation": "contains",
- "confidence": "extracted"
+ "source": "src/claude/init.ts#runInit",
+ "target": "src/claude/skill-template.ts#skillTemplate",
+ "relation": "calls",
+ "confidence": "inferred"
},
{
- "source": "src/claude/format.ts",
- "target": "src/claude/format.ts#incomingEdges",
- "relation": "contains",
- "confidence": "extracted"
+ "source": "src/claude/init.ts#runInit",
+ "target": "src/hosts/mcp-config.ts#mergeJsonKey",
+ "relation": "calls",
+ "confidence": "inferred"
},
{
- "source": "src/claude/format.ts",
- "target": "src/claude/format.ts#nodeIdsInFile",
+ "source": "src/claude/paths.ts",
+ "target": "src/claude/paths.ts#claudeDistDir",
"relation": "contains",
"confidence": "extracted"
},
{
- "source": "src/claude/format.ts",
- "target": "src/claude/format.ts#relevantRetrieval",
+ "source": "src/claude/paths.ts",
+ "target": "src/claude/paths.ts#claudeScriptPath",
"relation": "contains",
"confidence": "extracted"
},
{
- "source": "src/claude/format.ts",
- "target": "src/claude/format.ts#renderStatusline",
+ "source": "src/claude/paths.ts",
+ "target": "src/claude/paths.ts#graftCliPath",
"relation": "contains",
"confidence": "extracted"
},
{
- "source": "src/claude/format.ts",
- "target": "src/claude/format.ts#renderSubagent",
- "relation": "contains",
+ "source": "src/claude/paths.ts",
+ "target": "node:path",
+ "relation": "imports",
"confidence": "extracted"
},
{
- "source": "src/claude/format.ts",
- "target": "src/claude/format.ts#retrievalBody",
- "relation": "contains",
+ "source": "src/claude/paths.ts",
+ "target": "node:url",
+ "relation": "imports",
"confidence": "extracted"
},
{
- "source": "src/claude/format.ts",
- "target": "src/claude/format.ts#retrievalTokensSaved",
+ "source": "src/claude/settings-merge.ts",
+ "target": "src/claude/settings-merge.ts#graftBlocks",
"relation": "contains",
"confidence": "extracted"
},
{
- "source": "src/claude/format.ts",
- "target": "src/claude/format.ts#tokensOf",
+ "source": "src/claude/settings-merge.ts",
+ "target": "src/claude/settings-merge.ts#hookCmd",
"relation": "contains",
"confidence": "extracted"
},
{
- "source": "src/claude/format.ts",
- "target": "node:path",
- "relation": "imports",
+ "source": "src/claude/settings-merge.ts",
+ "target": "src/claude/settings-merge.ts#isGraftHookEntry",
+ "relation": "contains",
"confidence": "extracted"
},
{
- "source": "src/claude/format.ts",
- "target": "src/claude/state.ts",
- "relation": "imports",
+ "source": "src/claude/settings-merge.ts",
+ "target": "src/claude/settings-merge.ts#Json",
+ "relation": "contains",
"confidence": "extracted"
},
{
- "source": "src/claude/format.ts",
- "target": "src/graph/types.ts",
- "relation": "imports",
+ "source": "src/claude/settings-merge.ts",
+ "target": "src/claude/settings-merge.ts#mergeGraftSettings",
+ "relation": "contains",
"confidence": "extracted"
},
{
- "source": "src/claude/format.ts#formatBlastRadius",
- "target": "src/claude/format.ts#incomingEdges",
+ "source": "src/claude/settings-merge.ts#graftBlocks",
+ "target": "src/claude/settings-merge.ts#hookCmd",
"relation": "calls",
"confidence": "extracted"
},
{
- "source": "src/claude/format.ts#formatRetrieval",
- "target": "src/claude/format.ts#retrievalBody",
+ "source": "src/claude/settings-merge.ts#mergeGraftSettings",
+ "target": "src/claude/settings-merge.ts#graftBlocks",
"relation": "calls",
"confidence": "extracted"
},
{
- "source": "src/claude/format.ts#formatRetrieval",
- "target": "src/claude/format.ts#retrievalTokensSaved",
+ "source": "src/claude/settings-merge.ts#mergeGraftSettings",
+ "target": "src/claude/settings-merge.ts#isGraftHookEntry",
"relation": "calls",
"confidence": "extracted"
},
{
- "source": "src/claude/format.ts#formatRetrieval",
- "target": "src/claude/format.ts#tokensOf",
- "relation": "calls",
+ "source": "src/claude/shim-template.ts",
+ "target": "src/claude/shim-template.ts#hooksShim",
+ "relation": "contains",
"confidence": "extracted"
},
{
- "source": "src/claude/format.ts#incomingEdges",
- "target": "src/claude/format.ts#nodeIdsInFile",
- "relation": "calls",
+ "source": "src/claude/shim-template.ts",
+ "target": "src/claude/shim-template.ts#shim",
+ "relation": "contains",
"confidence": "extracted"
},
{
- "source": "src/claude/format.ts#relevantRetrieval",
- "target": "src/claude/format.ts#formatRetrieval",
- "relation": "calls",
+ "source": "src/claude/shim-template.ts",
+ "target": "src/claude/shim-template.ts#statuslineShim",
+ "relation": "contains",
"confidence": "extracted"
},
{
- "source": "src/claude/format.ts#renderStatusline",
- "target": "src/claude/format.ts#enrichedSegment",
+ "source": "src/claude/shim-template.ts#hooksShim",
+ "target": "src/claude/shim-template.ts#shim",
"relation": "calls",
"confidence": "extracted"
},
{
- "source": "src/claude/format.ts#renderStatusline",
- "target": "src/claude/format.ts#freshnessSegment",
+ "source": "src/claude/shim-template.ts#statuslineShim",
+ "target": "src/claude/shim-template.ts#shim",
"relation": "calls",
"confidence": "extracted"
},
{
- "source": "src/claude/format.ts#retrievalTokensSaved",
- "target": "src/claude/format.ts#retrievalBody",
- "relation": "calls",
+ "source": "src/claude/skill-template.ts",
+ "target": "src/claude/skill-template.ts#skillTemplate",
+ "relation": "contains",
"confidence": "extracted"
},
{
- "source": "src/claude/format.ts#retrievalTokensSaved",
- "target": "src/claude/format.ts#tokensOf",
- "relation": "calls",
+ "source": "src/claude/state.ts",
+ "target": "src/claude/state.ts#acquireLock",
+ "relation": "contains",
"confidence": "extracted"
},
{
- "source": "src/claude/hooks.ts",
- "target": "src/claude/hooks.ts#checkStaleCount",
+ "source": "src/claude/state.ts",
+ "target": "src/claude/state.ts#cacheDir",
"relation": "contains",
"confidence": "extracted"
},
{
- "source": "src/claude/hooks.ts",
- "target": "src/claude/hooks.ts#emit",
+ "source": "src/claude/state.ts",
+ "target": "src/claude/state.ts#emptySession",
"relation": "contains",
"confidence": "extracted"
},
{
- "source": "src/claude/hooks.ts",
- "target": "src/claude/hooks.ts#graftJson",
+ "source": "src/claude/state.ts",
+ "target": "src/claude/state.ts#emptyStats",
"relation": "contains",
"confidence": "extracted"
},
{
- "source": "src/claude/hooks.ts",
- "target": "src/claude/hooks.ts#handlePostEdit",
+ "source": "src/claude/state.ts",
+ "target": "src/claude/state.ts#lockPath",
"relation": "contains",
"confidence": "extracted"
},
{
- "source": "src/claude/hooks.ts",
- "target": "src/claude/hooks.ts#handleStop",
+ "source": "src/claude/state.ts",
+ "target": "src/claude/state.ts#patchStats",
"relation": "contains",
"confidence": "extracted"
},
{
- "source": "src/claude/hooks.ts",
- "target": "src/claude/hooks.ts#main",
+ "source": "src/claude/state.ts",
+ "target": "src/claude/state.ts#readJson",
"relation": "contains",
"confidence": "extracted"
},
{
- "source": "src/claude/hooks.ts",
- "target": "src/claude/hooks.ts#projectDir",
+ "source": "src/claude/state.ts",
+ "target": "src/claude/state.ts#readSession",
"relation": "contains",
"confidence": "extracted"
},
{
- "source": "src/claude/hooks.ts",
- "target": "src/claude/hooks.ts#readStdin",
+ "source": "src/claude/state.ts",
+ "target": "src/claude/state.ts#readStats",
"relation": "contains",
"confidence": "extracted"
},
{
- "source": "src/claude/hooks.ts",
- "target": "src/claude/hooks.ts#safeReadFd0",
+ "source": "src/claude/state.ts",
+ "target": "src/claude/state.ts#releaseLock",
"relation": "contains",
"confidence": "extracted"
},
{
- "source": "src/claude/hooks.ts",
- "target": "src/claude/hooks.ts#underGraft",
+ "source": "src/claude/state.ts",
+ "target": "src/claude/state.ts#sessionPath",
"relation": "contains",
"confidence": "extracted"
},
{
- "source": "src/claude/hooks.ts",
- "target": "node:child_process",
- "relation": "imports",
+ "source": "src/claude/state.ts",
+ "target": "src/claude/state.ts#SessionState",
+ "relation": "contains",
"confidence": "extracted"
},
{
- "source": "src/claude/hooks.ts",
- "target": "node:fs",
- "relation": "imports",
+ "source": "src/claude/state.ts",
+ "target": "src/claude/state.ts#Stats",
+ "relation": "contains",
"confidence": "extracted"
},
{
- "source": "src/claude/hooks.ts",
- "target": "node:path",
- "relation": "imports",
+ "source": "src/claude/state.ts",
+ "target": "src/claude/state.ts#statsPath",
+ "relation": "contains",
"confidence": "extracted"
},
{
- "source": "src/claude/hooks.ts",
- "target": "src/claude/format.ts",
- "relation": "imports",
+ "source": "src/claude/state.ts",
+ "target": "src/claude/state.ts#writeJsonAtomic",
+ "relation": "contains",
"confidence": "extracted"
},
{
- "source": "src/claude/hooks.ts",
- "target": "src/claude/paths.ts",
- "relation": "imports",
+ "source": "src/claude/state.ts",
+ "target": "src/claude/state.ts#writeSession",
+ "relation": "contains",
"confidence": "extracted"
},
{
- "source": "src/claude/hooks.ts",
- "target": "src/claude/state.ts",
- "relation": "imports",
+ "source": "src/claude/state.ts",
+ "target": "src/claude/state.ts#writeStats",
+ "relation": "contains",
"confidence": "extracted"
},
{
- "source": "src/claude/hooks.ts",
- "target": "src/claude/stats.ts",
+ "source": "src/claude/state.ts",
+ "target": "node:fs",
"relation": "imports",
"confidence": "extracted"
},
{
- "source": "src/claude/hooks.ts#checkStaleCount",
- "target": "src/claude/hooks.ts#graftJson",
- "relation": "calls",
+ "source": "src/claude/state.ts",
+ "target": "node:path",
+ "relation": "imports",
"confidence": "extracted"
},
{
- "source": "src/claude/hooks.ts#graftJson",
- "target": "src/claude/paths.ts#graftCliPath",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "src/claude/hooks.ts#handlePostEdit",
- "target": "src/claude/format.ts#formatBlastRadius",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "src/claude/hooks.ts#handlePostEdit",
- "target": "src/claude/hooks.ts#checkStaleCount",
+ "source": "src/claude/state.ts#acquireLock",
+ "target": "src/claude/state.ts#cacheDir",
"relation": "calls",
"confidence": "extracted"
},
{
- "source": "src/claude/hooks.ts#handlePostEdit",
- "target": "src/claude/hooks.ts#emit",
+ "source": "src/claude/state.ts#acquireLock",
+ "target": "src/claude/state.ts#lockPath",
"relation": "calls",
"confidence": "extracted"
},
{
- "source": "src/claude/hooks.ts#handlePostEdit",
- "target": "src/claude/hooks.ts#underGraft",
+ "source": "src/claude/state.ts#lockPath",
+ "target": "src/claude/state.ts#cacheDir",
"relation": "calls",
"confidence": "extracted"
},
{
- "source": "src/claude/hooks.ts#handlePostEdit",
- "target": "src/claude/state.ts#patchStats",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "src/claude/hooks.ts#handlePostEdit",
- "target": "src/claude/stats.ts#readWiring",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "src/claude/hooks.ts#handleStop",
- "target": "src/claude/paths.ts#claudeScriptPath",
+ "source": "src/claude/state.ts#patchStats",
+ "target": "src/claude/state.ts#emptyStats",
"relation": "calls",
- "confidence": "inferred"
+ "confidence": "extracted"
},
{
- "source": "src/claude/hooks.ts#handleStop",
- "target": "src/claude/state.ts#acquireLock",
+ "source": "src/claude/state.ts#patchStats",
+ "target": "src/claude/state.ts#readStats",
"relation": "calls",
- "confidence": "inferred"
+ "confidence": "extracted"
},
{
- "source": "src/claude/hooks.ts#handleStop",
- "target": "src/claude/state.ts#patchStats",
+ "source": "src/claude/state.ts#patchStats",
+ "target": "src/claude/state.ts#writeStats",
"relation": "calls",
- "confidence": "inferred"
+ "confidence": "extracted"
},
{
- "source": "src/claude/hooks.ts#handleStop",
- "target": "src/claude/state.ts#readStats",
+ "source": "src/claude/state.ts#readSession",
+ "target": "src/claude/state.ts#emptySession",
"relation": "calls",
- "confidence": "inferred"
+ "confidence": "extracted"
},
{
- "source": "src/claude/hooks.ts#main",
- "target": "src/claude/format.ts#formatOrientation",
+ "source": "src/claude/state.ts#readSession",
+ "target": "src/claude/state.ts#readJson",
"relation": "calls",
- "confidence": "inferred"
+ "confidence": "extracted"
},
{
- "source": "src/claude/hooks.ts#main",
- "target": "src/claude/format.ts#relevantRetrieval",
+ "source": "src/claude/state.ts#readSession",
+ "target": "src/claude/state.ts#sessionPath",
"relation": "calls",
- "confidence": "inferred"
+ "confidence": "extracted"
},
{
- "source": "src/claude/hooks.ts#main",
- "target": "src/claude/hooks.ts#emit",
+ "source": "src/claude/state.ts#readStats",
+ "target": "src/claude/state.ts#readJson",
"relation": "calls",
"confidence": "extracted"
},
{
- "source": "src/claude/hooks.ts#main",
- "target": "src/claude/hooks.ts#graftJson",
+ "source": "src/claude/state.ts#readStats",
+ "target": "src/claude/state.ts#statsPath",
"relation": "calls",
"confidence": "extracted"
},
{
- "source": "src/claude/hooks.ts#main",
- "target": "src/claude/hooks.ts#handlePostEdit",
+ "source": "src/claude/state.ts#releaseLock",
+ "target": "src/claude/state.ts#lockPath",
"relation": "calls",
"confidence": "extracted"
},
{
- "source": "src/claude/hooks.ts#main",
- "target": "src/claude/hooks.ts#handleStop",
+ "source": "src/claude/state.ts#sessionPath",
+ "target": "src/claude/state.ts#cacheDir",
"relation": "calls",
"confidence": "extracted"
},
{
- "source": "src/claude/hooks.ts#main",
- "target": "src/claude/hooks.ts#projectDir",
+ "source": "src/claude/state.ts#statsPath",
+ "target": "src/claude/state.ts#cacheDir",
"relation": "calls",
"confidence": "extracted"
},
{
- "source": "src/claude/hooks.ts#main",
- "target": "src/claude/hooks.ts#readStdin",
+ "source": "src/claude/state.ts#writeSession",
+ "target": "src/claude/state.ts#sessionPath",
"relation": "calls",
"confidence": "extracted"
},
{
- "source": "src/claude/hooks.ts#main",
- "target": "src/claude/state.ts#readSession",
+ "source": "src/claude/state.ts#writeSession",
+ "target": "src/claude/state.ts#writeJsonAtomic",
"relation": "calls",
- "confidence": "inferred"
+ "confidence": "extracted"
},
{
- "source": "src/claude/hooks.ts#main",
- "target": "src/claude/state.ts#writeSession",
+ "source": "src/claude/state.ts#writeStats",
+ "target": "src/claude/state.ts#statsPath",
"relation": "calls",
- "confidence": "inferred"
+ "confidence": "extracted"
},
{
- "source": "src/claude/hooks.ts#readStdin",
- "target": "src/claude/hooks.ts#safeReadFd0",
+ "source": "src/claude/state.ts#writeStats",
+ "target": "src/claude/state.ts#writeJsonAtomic",
"relation": "calls",
"confidence": "extracted"
},
{
- "source": "src/claude/init.ts",
- "target": "src/claude/init.ts#InitResult",
+ "source": "src/claude/stats.ts",
+ "target": "src/claude/stats.ts#computeStats",
"relation": "contains",
"confidence": "extracted"
},
{
- "source": "src/claude/init.ts",
- "target": "src/claude/init.ts#runInit",
+ "source": "src/claude/stats.ts",
+ "target": "src/claude/stats.ts#readWiring",
"relation": "contains",
"confidence": "extracted"
},
{
- "source": "src/claude/init.ts",
- "target": "node:child_process",
+ "source": "src/claude/stats.ts",
+ "target": "node:fs",
"relation": "imports",
"confidence": "extracted"
},
{
- "source": "src/claude/init.ts",
- "target": "node:fs",
+ "source": "src/claude/stats.ts",
+ "target": "node:path",
"relation": "imports",
"confidence": "extracted"
},
{
- "source": "src/claude/init.ts",
- "target": "node:path",
+ "source": "src/claude/stats.ts",
+ "target": "src/claude/state.ts",
"relation": "imports",
"confidence": "extracted"
},
{
- "source": "src/claude/init.ts",
- "target": "src/claude/paths.ts",
+ "source": "src/claude/stats.ts",
+ "target": "src/graph/types.ts",
"relation": "imports",
"confidence": "extracted"
},
{
- "source": "src/claude/init.ts",
- "target": "src/claude/settings-merge.ts",
+ "source": "src/claude/statusline.ts",
+ "target": "src/claude/statusline.ts#main",
+ "relation": "contains",
+ "confidence": "extracted"
+ },
+ {
+ "source": "src/claude/statusline.ts",
+ "target": "src/claude/statusline.ts#resolveStats",
+ "relation": "contains",
+ "confidence": "extracted"
+ },
+ {
+ "source": "src/claude/statusline.ts",
+ "target": "node:fs",
"relation": "imports",
"confidence": "extracted"
},
{
- "source": "src/claude/init.ts",
- "target": "src/claude/shim-template.ts",
+ "source": "src/claude/statusline.ts",
+ "target": "src/claude/format.ts",
"relation": "imports",
"confidence": "extracted"
},
{
- "source": "src/claude/init.ts",
- "target": "src/claude/skill-template.ts",
+ "source": "src/claude/statusline.ts",
+ "target": "src/claude/state.ts",
"relation": "imports",
"confidence": "extracted"
},
{
- "source": "src/claude/init.ts",
- "target": "src/hosts/mcp-config.ts",
+ "source": "src/claude/statusline.ts",
+ "target": "src/claude/stats.ts",
"relation": "imports",
"confidence": "extracted"
},
{
- "source": "src/claude/init.ts#runInit",
- "target": "src/claude/paths.ts#claudeDistDir",
+ "source": "src/claude/statusline.ts#main",
+ "target": "src/claude/format.ts#renderStatusline",
"relation": "calls",
"confidence": "inferred"
},
{
- "source": "src/claude/init.ts#runInit",
- "target": "src/claude/settings-merge.ts#mergeGraftSettings",
+ "source": "src/claude/statusline.ts#main",
+ "target": "src/claude/format.ts#renderSubagent",
"relation": "calls",
"confidence": "inferred"
},
{
- "source": "src/claude/init.ts#runInit",
- "target": "src/claude/shim-template.ts#hooksShim",
+ "source": "src/claude/statusline.ts#main",
+ "target": "src/claude/state.ts#readSession",
"relation": "calls",
"confidence": "inferred"
},
{
- "source": "src/claude/init.ts#runInit",
- "target": "src/claude/shim-template.ts#statuslineShim",
+ "source": "src/claude/statusline.ts#main",
+ "target": "src/claude/statusline.ts#resolveStats",
"relation": "calls",
- "confidence": "inferred"
+ "confidence": "extracted"
},
{
- "source": "src/claude/init.ts#runInit",
- "target": "src/claude/skill-template.ts#skillTemplate",
+ "source": "src/claude/statusline.ts#resolveStats",
+ "target": "src/claude/state.ts#emptyStats",
"relation": "calls",
"confidence": "inferred"
},
{
- "source": "src/claude/init.ts#runInit",
- "target": "src/hosts/mcp-config.ts#mergeJsonKey",
+ "source": "src/claude/statusline.ts#resolveStats",
+ "target": "src/claude/state.ts#readStats",
"relation": "calls",
"confidence": "inferred"
},
{
- "source": "src/claude/paths.ts",
- "target": "src/claude/paths.ts#claudeDistDir",
- "relation": "contains",
- "confidence": "extracted"
+ "source": "src/claude/statusline.ts#resolveStats",
+ "target": "src/claude/stats.ts#computeStats",
+ "relation": "calls",
+ "confidence": "inferred"
},
{
- "source": "src/claude/paths.ts",
- "target": "src/claude/paths.ts#claudeScriptPath",
- "relation": "contains",
- "confidence": "extracted"
+ "source": "src/claude/statusline.ts#resolveStats",
+ "target": "src/claude/stats.ts#readWiring",
+ "relation": "calls",
+ "confidence": "inferred"
},
{
- "source": "src/claude/paths.ts",
- "target": "src/claude/paths.ts#graftCliPath",
- "relation": "contains",
+ "source": "src/claude/sync-run.ts",
+ "target": "src/claude/sync-run.ts#main",
+ "relation": "calls",
"confidence": "extracted"
},
{
- "source": "src/claude/paths.ts",
- "target": "node:path",
- "relation": "imports",
+ "source": "src/claude/sync-run.ts",
+ "target": "src/claude/sync-run.ts#main",
+ "relation": "contains",
"confidence": "extracted"
},
{
- "source": "src/claude/paths.ts",
- "target": "node:url",
- "relation": "imports",
+ "source": "src/claude/sync-run.ts",
+ "target": "src/claude/sync-run.ts#realBuild",
+ "relation": "contains",
"confidence": "extracted"
},
{
- "source": "src/claude/settings-merge.ts",
- "target": "src/claude/settings-merge.ts#graftBlocks",
+ "source": "src/claude/sync-run.ts",
+ "target": "src/claude/sync-run.ts#runSync",
"relation": "contains",
"confidence": "extracted"
},
{
- "source": "src/claude/settings-merge.ts",
- "target": "src/claude/settings-merge.ts#hookCmd",
- "relation": "contains",
+ "source": "src/claude/sync-run.ts",
+ "target": "node:child_process",
+ "relation": "imports",
"confidence": "extracted"
},
{
- "source": "src/claude/settings-merge.ts",
- "target": "src/claude/settings-merge.ts#isGraftHookEntry",
- "relation": "contains",
+ "source": "src/claude/sync-run.ts",
+ "target": "node:url",
+ "relation": "imports",
"confidence": "extracted"
},
{
- "source": "src/claude/settings-merge.ts",
- "target": "src/claude/settings-merge.ts#Json",
- "relation": "contains",
+ "source": "src/claude/sync-run.ts",
+ "target": "src/claude/paths.ts",
+ "relation": "imports",
"confidence": "extracted"
},
{
- "source": "src/claude/settings-merge.ts",
- "target": "src/claude/settings-merge.ts#mergeGraftSettings",
- "relation": "contains",
+ "source": "src/claude/sync-run.ts",
+ "target": "src/claude/state.ts",
+ "relation": "imports",
"confidence": "extracted"
},
{
- "source": "src/claude/settings-merge.ts#graftBlocks",
- "target": "src/claude/settings-merge.ts#hookCmd",
- "relation": "calls",
+ "source": "src/claude/sync-run.ts",
+ "target": "src/claude/stats.ts",
+ "relation": "imports",
"confidence": "extracted"
},
{
- "source": "src/claude/settings-merge.ts#mergeGraftSettings",
- "target": "src/claude/settings-merge.ts#graftBlocks",
+ "source": "src/claude/sync-run.ts#main",
+ "target": "src/claude/sync-run.ts#runSync",
"relation": "calls",
"confidence": "extracted"
},
{
- "source": "src/claude/settings-merge.ts#mergeGraftSettings",
- "target": "src/claude/settings-merge.ts#isGraftHookEntry",
+ "source": "src/claude/sync-run.ts#realBuild",
+ "target": "src/claude/paths.ts#graftCliPath",
"relation": "calls",
- "confidence": "extracted"
+ "confidence": "inferred"
},
{
- "source": "src/claude/shim-template.ts",
- "target": "src/claude/shim-template.ts#hooksShim",
- "relation": "contains",
- "confidence": "extracted"
+ "source": "src/claude/sync-run.ts#runSync",
+ "target": "src/claude/state.ts#patchStats",
+ "relation": "calls",
+ "confidence": "inferred"
},
{
- "source": "src/claude/shim-template.ts",
- "target": "src/claude/shim-template.ts#shim",
- "relation": "contains",
- "confidence": "extracted"
+ "source": "src/claude/sync-run.ts#runSync",
+ "target": "src/claude/state.ts#releaseLock",
+ "relation": "calls",
+ "confidence": "inferred"
},
{
- "source": "src/claude/shim-template.ts",
- "target": "src/claude/shim-template.ts#statuslineShim",
- "relation": "contains",
- "confidence": "extracted"
+ "source": "src/claude/sync-run.ts#runSync",
+ "target": "src/claude/stats.ts#computeStats",
+ "relation": "calls",
+ "confidence": "inferred"
},
{
- "source": "src/claude/shim-template.ts#hooksShim",
- "target": "src/claude/shim-template.ts#shim",
+ "source": "src/claude/sync-run.ts#runSync",
+ "target": "src/claude/stats.ts#readWiring",
"relation": "calls",
- "confidence": "extracted"
+ "confidence": "inferred"
},
{
- "source": "src/claude/shim-template.ts#statuslineShim",
- "target": "src/claude/shim-template.ts#shim",
- "relation": "calls",
+ "source": "src/cli-epilogue.ts",
+ "target": "src/cli-epilogue.ts#formatInitEpilogue",
+ "relation": "contains",
"confidence": "extracted"
},
{
- "source": "src/claude/skill-template.ts",
- "target": "src/claude/skill-template.ts#skillTemplate",
+ "source": "src/cli-epilogue.ts",
+ "target": "src/cli-epilogue.ts#indigo",
"relation": "contains",
"confidence": "extracted"
},
{
- "source": "src/claude/state.ts",
- "target": "src/claude/state.ts#acquireLock",
+ "source": "src/cli-epilogue.ts",
+ "target": "src/cli-epilogue.ts#InitEpilogueOptions",
"relation": "contains",
"confidence": "extracted"
},
{
- "source": "src/claude/state.ts",
- "target": "src/claude/state.ts#cacheDir",
+ "source": "src/cli-epilogue.ts",
+ "target": "src/cli-epilogue.ts#muted",
"relation": "contains",
"confidence": "extracted"
},
{
- "source": "src/claude/state.ts",
- "target": "src/claude/state.ts#emptySession",
+ "source": "src/cli-epilogue.ts",
+ "target": "src/cli-epilogue.ts#Step",
"relation": "contains",
"confidence": "extracted"
},
{
- "source": "src/claude/state.ts",
- "target": "src/claude/state.ts#emptyStats",
- "relation": "contains",
+ "source": "src/cli-epilogue.ts#formatInitEpilogue",
+ "target": "src/cli-epilogue.ts#indigo",
+ "relation": "calls",
"confidence": "extracted"
},
{
- "source": "src/claude/state.ts",
- "target": "src/claude/state.ts#lockPath",
- "relation": "contains",
+ "source": "src/cli-epilogue.ts#formatInitEpilogue",
+ "target": "src/cli-epilogue.ts#muted",
+ "relation": "calls",
"confidence": "extracted"
},
{
- "source": "src/claude/state.ts",
- "target": "src/claude/state.ts#patchStats",
+ "source": "src/cli-meta.ts",
+ "target": "src/cli-meta.ts#formatUpgradeReport",
"relation": "contains",
"confidence": "extracted"
},
{
- "source": "src/claude/state.ts",
- "target": "src/claude/state.ts#readJson",
+ "source": "src/cli-meta.ts",
+ "target": "src/cli-meta.ts#formatVersionReport",
"relation": "contains",
"confidence": "extracted"
},
{
- "source": "src/claude/state.ts",
- "target": "src/claude/state.ts#readSession",
+ "source": "src/cli-meta.ts",
+ "target": "src/cli-meta.ts#getNpmViewVersion",
"relation": "contains",
"confidence": "extracted"
},
{
- "source": "src/claude/state.ts",
- "target": "src/claude/state.ts#readStats",
+ "source": "src/cli-meta.ts",
+ "target": "src/cli-meta.ts#globalRoot",
"relation": "contains",
"confidence": "extracted"
},
{
- "source": "src/claude/state.ts",
- "target": "src/claude/state.ts#releaseLock",
+ "source": "src/cli-meta.ts",
+ "target": "src/cli-meta.ts#isRunningViaNpx",
"relation": "contains",
"confidence": "extracted"
},
{
- "source": "src/claude/state.ts",
- "target": "src/claude/state.ts#sessionPath",
+ "source": "src/cli-meta.ts",
+ "target": "src/cli-meta.ts#NpmViewResult",
"relation": "contains",
"confidence": "extracted"
},
{
- "source": "src/claude/state.ts",
- "target": "src/claude/state.ts#SessionState",
+ "source": "src/cli-meta.ts",
+ "target": "src/cli-meta.ts#readCurrentVersion",
"relation": "contains",
"confidence": "extracted"
},
{
- "source": "src/claude/state.ts",
- "target": "src/claude/state.ts#Stats",
+ "source": "src/cli-meta.ts",
+ "target": "src/cli-meta.ts#readGlobalInstalledVersion",
"relation": "contains",
"confidence": "extracted"
},
{
- "source": "src/claude/state.ts",
- "target": "src/claude/state.ts#statsPath",
+ "source": "src/cli-meta.ts",
+ "target": "src/cli-meta.ts#resolvePackageJsonPath",
"relation": "contains",
"confidence": "extracted"
},
{
- "source": "src/claude/state.ts",
- "target": "src/claude/state.ts#writeJsonAtomic",
+ "source": "src/cli-meta.ts",
+ "target": "src/cli-meta.ts#runUpgrade",
"relation": "contains",
"confidence": "extracted"
},
{
- "source": "src/claude/state.ts",
- "target": "src/claude/state.ts#writeSession",
+ "source": "src/cli-meta.ts",
+ "target": "src/cli-meta.ts#UpgradeResult",
"relation": "contains",
"confidence": "extracted"
},
{
- "source": "src/claude/state.ts",
- "target": "src/claude/state.ts#writeStats",
- "relation": "contains",
+ "source": "src/cli-meta.ts",
+ "target": "node:child_process",
+ "relation": "imports",
"confidence": "extracted"
},
{
- "source": "src/claude/state.ts",
+ "source": "src/cli-meta.ts",
"target": "node:fs",
"relation": "imports",
"confidence": "extracted"
},
{
- "source": "src/claude/state.ts",
+ "source": "src/cli-meta.ts",
"target": "node:path",
"relation": "imports",
"confidence": "extracted"
},
{
- "source": "src/claude/state.ts#acquireLock",
- "target": "src/claude/state.ts#cacheDir",
- "relation": "calls",
+ "source": "src/cli-meta.ts",
+ "target": "node:url",
+ "relation": "imports",
"confidence": "extracted"
},
{
- "source": "src/claude/state.ts#acquireLock",
- "target": "src/claude/state.ts#lockPath",
+ "source": "src/cli-meta.ts#readCurrentVersion",
+ "target": "src/cli-meta.ts#resolvePackageJsonPath",
"relation": "calls",
"confidence": "extracted"
},
{
- "source": "src/claude/state.ts#lockPath",
- "target": "src/claude/state.ts#cacheDir",
+ "source": "src/cli-meta.ts#readGlobalInstalledVersion",
+ "target": "src/cli-meta.ts#globalRoot",
"relation": "calls",
"confidence": "extracted"
},
{
- "source": "src/claude/state.ts#patchStats",
- "target": "src/claude/state.ts#emptyStats",
+ "source": "src/cli-meta.ts#runUpgrade",
+ "target": "src/cli-meta.ts#getNpmViewVersion",
"relation": "calls",
"confidence": "extracted"
},
{
- "source": "src/claude/state.ts#patchStats",
- "target": "src/claude/state.ts#readStats",
+ "source": "src/cli-meta.ts#runUpgrade",
+ "target": "src/cli-meta.ts#isRunningViaNpx",
"relation": "calls",
"confidence": "extracted"
},
{
- "source": "src/claude/state.ts#patchStats",
- "target": "src/claude/state.ts#writeStats",
+ "source": "src/cli-meta.ts#runUpgrade",
+ "target": "src/cli-meta.ts#readCurrentVersion",
"relation": "calls",
"confidence": "extracted"
},
{
- "source": "src/claude/state.ts#readSession",
- "target": "src/claude/state.ts#emptySession",
+ "source": "src/cli-meta.ts#runUpgrade",
+ "target": "src/cli-meta.ts#readGlobalInstalledVersion",
"relation": "calls",
"confidence": "extracted"
},
{
- "source": "src/claude/state.ts#readSession",
- "target": "src/claude/state.ts#readJson",
+ "source": "src/cli.ts",
+ "target": "src/ai/providers.ts#resolveConfig",
"relation": "calls",
- "confidence": "extracted"
+ "confidence": "inferred"
},
{
- "source": "src/claude/state.ts#readSession",
- "target": "src/claude/state.ts#sessionPath",
+ "source": "src/cli.ts",
+ "target": "src/ask/ask.ts#formatAsk",
"relation": "calls",
- "confidence": "extracted"
+ "confidence": "inferred"
},
{
- "source": "src/claude/state.ts#readStats",
- "target": "src/claude/state.ts#readJson",
+ "source": "src/cli.ts",
+ "target": "src/ask/ask.ts#formatSkeleton",
"relation": "calls",
- "confidence": "extracted"
+ "confidence": "inferred"
},
{
- "source": "src/claude/state.ts#readStats",
- "target": "src/claude/state.ts#statsPath",
+ "source": "src/cli.ts",
+ "target": "src/ask/ask.ts#skeleton",
"relation": "calls",
- "confidence": "extracted"
+ "confidence": "inferred"
},
{
- "source": "src/claude/state.ts#releaseLock",
- "target": "src/claude/state.ts#lockPath",
+ "source": "src/cli.ts",
+ "target": "src/claude/init.ts#runInit",
"relation": "calls",
- "confidence": "extracted"
+ "confidence": "inferred"
},
{
- "source": "src/claude/state.ts#sessionPath",
- "target": "src/claude/state.ts#cacheDir",
+ "source": "src/cli.ts",
+ "target": "src/cli-epilogue.ts#formatInitEpilogue",
"relation": "calls",
- "confidence": "extracted"
+ "confidence": "inferred"
},
{
- "source": "src/claude/state.ts#statsPath",
- "target": "src/claude/state.ts#cacheDir",
+ "source": "src/cli.ts",
+ "target": "src/cli-meta.ts#formatUpgradeReport",
"relation": "calls",
- "confidence": "extracted"
+ "confidence": "inferred"
},
{
- "source": "src/claude/state.ts#writeSession",
- "target": "src/claude/state.ts#sessionPath",
+ "source": "src/cli.ts",
+ "target": "src/cli-meta.ts#formatVersionReport",
"relation": "calls",
- "confidence": "extracted"
+ "confidence": "inferred"
},
{
- "source": "src/claude/state.ts#writeSession",
- "target": "src/claude/state.ts#writeJsonAtomic",
+ "source": "src/cli.ts",
+ "target": "src/cli-meta.ts#getNpmViewVersion",
"relation": "calls",
- "confidence": "extracted"
+ "confidence": "inferred"
},
{
- "source": "src/claude/state.ts#writeStats",
- "target": "src/claude/state.ts#statsPath",
+ "source": "src/cli.ts",
+ "target": "src/cli-meta.ts#readCurrentVersion",
"relation": "calls",
- "confidence": "extracted"
+ "confidence": "inferred"
},
{
- "source": "src/claude/state.ts#writeStats",
- "target": "src/claude/state.ts#writeJsonAtomic",
+ "source": "src/cli.ts",
+ "target": "src/cli-meta.ts#runUpgrade",
"relation": "calls",
- "confidence": "extracted"
+ "confidence": "inferred"
},
{
- "source": "src/claude/stats.ts",
- "target": "src/claude/stats.ts#computeStats",
- "relation": "contains",
+ "source": "src/cli.ts",
+ "target": "src/cli.ts#cliConfig",
+ "relation": "calls",
"confidence": "extracted"
},
{
- "source": "src/claude/stats.ts",
- "target": "src/claude/stats.ts#readWiring",
- "relation": "contains",
+ "source": "src/cli.ts",
+ "target": "src/cli.ts#engineFrom",
+ "relation": "calls",
"confidence": "extracted"
},
{
- "source": "src/claude/stats.ts",
- "target": "node:fs",
- "relation": "imports",
+ "source": "src/cli.ts",
+ "target": "src/cli.ts#fmt",
+ "relation": "calls",
"confidence": "extracted"
},
{
- "source": "src/claude/stats.ts",
- "target": "node:path",
- "relation": "imports",
- "confidence": "extracted"
+ "source": "src/cli.ts",
+ "target": "src/context/check.ts#formatCheckReport",
+ "relation": "calls",
+ "confidence": "inferred"
},
{
- "source": "src/claude/stats.ts",
- "target": "src/claude/state.ts",
- "relation": "imports",
- "confidence": "extracted"
+ "source": "src/cli.ts",
+ "target": "src/context/node-file.ts#contextDirFor",
+ "relation": "calls",
+ "confidence": "inferred"
},
{
- "source": "src/claude/stats.ts",
- "target": "src/graph/types.ts",
- "relation": "imports",
- "confidence": "extracted"
+ "source": "src/cli.ts",
+ "target": "src/engine.ts#Graft.ask",
+ "relation": "calls",
+ "confidence": "inferred"
},
{
- "source": "src/claude/statusline.ts",
- "target": "src/claude/statusline.ts#main",
- "relation": "contains",
- "confidence": "extracted"
+ "source": "src/cli.ts",
+ "target": "src/engine.ts#Graft.check",
+ "relation": "calls",
+ "confidence": "inferred"
},
{
- "source": "src/claude/statusline.ts",
- "target": "src/claude/statusline.ts#resolveStats",
- "relation": "contains",
- "confidence": "extracted"
+ "source": "src/cli.ts",
+ "target": "src/engine.ts#Graft.checkGraph",
+ "relation": "calls",
+ "confidence": "inferred"
},
{
- "source": "src/claude/statusline.ts",
- "target": "node:fs",
- "relation": "imports",
- "confidence": "extracted"
+ "source": "src/cli.ts",
+ "target": "src/engine.ts#Graft.graph",
+ "relation": "calls",
+ "confidence": "inferred"
},
{
- "source": "src/claude/statusline.ts",
- "target": "src/claude/format.ts",
- "relation": "imports",
- "confidence": "extracted"
+ "source": "src/cli.ts",
+ "target": "src/engine.ts#Graft.init",
+ "relation": "calls",
+ "confidence": "inferred"
},
{
- "source": "src/claude/statusline.ts",
- "target": "src/claude/state.ts",
- "relation": "imports",
- "confidence": "extracted"
+ "source": "src/cli.ts",
+ "target": "src/graph/check.ts#formatGraphCheckReport",
+ "relation": "calls",
+ "confidence": "inferred"
+ },
+ {
+ "source": "src/cli.ts",
+ "target": "src/graph/load.ts#loadGraphCached",
+ "relation": "calls",
+ "confidence": "inferred"
+ },
+ {
+ "source": "src/cli.ts",
+ "target": "src/graph/map.ts#buildRepoMap",
+ "relation": "calls",
+ "confidence": "inferred"
+ },
+ {
+ "source": "src/cli.ts",
+ "target": "src/graph/map.ts#formatRepoMap",
+ "relation": "calls",
+ "confidence": "inferred"
+ },
+ {
+ "source": "src/cli.ts",
+ "target": "src/graph/traverse-cli.ts#runCallersCommand",
+ "relation": "calls",
+ "confidence": "inferred"
+ },
+ {
+ "source": "src/cli.ts",
+ "target": "src/graph/workspace-cli.ts#runWorkspaceAsk",
+ "relation": "calls",
+ "confidence": "inferred"
+ },
+ {
+ "source": "src/cli.ts",
+ "target": "src/graph/workspace-cli.ts#runWorkspaceBuild",
+ "relation": "calls",
+ "confidence": "inferred"
+ },
+ {
+ "source": "src/cli.ts",
+ "target": "src/graph/workspace-cli.ts#runWorkspaceCallers",
+ "relation": "calls",
+ "confidence": "inferred"
},
{
- "source": "src/claude/statusline.ts",
- "target": "src/claude/stats.ts",
- "relation": "imports",
- "confidence": "extracted"
+ "source": "src/cli.ts",
+ "target": "src/graph/workspace-cli.ts#runWorkspaceCheck",
+ "relation": "calls",
+ "confidence": "inferred"
},
{
- "source": "src/claude/statusline.ts#main",
- "target": "src/claude/format.ts#renderStatusline",
+ "source": "src/cli.ts",
+ "target": "src/graph/workspace-cli.ts#runWorkspaceGrep",
"relation": "calls",
"confidence": "inferred"
},
{
- "source": "src/claude/statusline.ts#main",
- "target": "src/claude/format.ts#renderSubagent",
+ "source": "src/cli.ts",
+ "target": "src/graph/workspace-cli.ts#runWorkspaceMap",
"relation": "calls",
"confidence": "inferred"
},
{
- "source": "src/claude/statusline.ts#main",
- "target": "src/claude/state.ts#readSession",
+ "source": "src/cli.ts",
+ "target": "src/graph/workspace.ts#isWorkspaceBuildRoot",
"relation": "calls",
"confidence": "inferred"
},
{
- "source": "src/claude/statusline.ts#main",
- "target": "src/claude/statusline.ts#resolveStats",
+ "source": "src/cli.ts",
+ "target": "src/graph/workspace.ts#readWorkspace",
"relation": "calls",
- "confidence": "extracted"
+ "confidence": "inferred"
},
{
- "source": "src/claude/statusline.ts#resolveStats",
- "target": "src/claude/state.ts#emptyStats",
+ "source": "src/cli.ts",
+ "target": "src/hosts/init.ts#runHostsInit",
"relation": "calls",
"confidence": "inferred"
},
{
- "source": "src/claude/statusline.ts#resolveStats",
- "target": "src/claude/state.ts#readStats",
+ "source": "src/cli.ts",
+ "target": "src/hosts/registry.ts#hostIds",
"relation": "calls",
"confidence": "inferred"
},
{
- "source": "src/claude/statusline.ts#resolveStats",
- "target": "src/claude/stats.ts#computeStats",
+ "source": "src/cli.ts",
+ "target": "src/mcp/server.ts#startMcpServer",
"relation": "calls",
"confidence": "inferred"
},
{
- "source": "src/claude/statusline.ts#resolveStats",
- "target": "src/claude/stats.ts#readWiring",
+ "source": "src/cli.ts",
+ "target": "src/search/grep-cli.ts#runGrepCommand",
"relation": "calls",
"confidence": "inferred"
},
{
- "source": "src/claude/sync-run.ts",
- "target": "src/claude/sync-run.ts#main",
+ "source": "src/cli.ts",
+ "target": "src/viz/serve.ts#startVizServer",
"relation": "calls",
+ "confidence": "inferred"
+ },
+ {
+ "source": "src/cli.ts",
+ "target": "src/cli.ts#cliConfig",
+ "relation": "contains",
"confidence": "extracted"
},
{
- "source": "src/claude/sync-run.ts",
- "target": "src/claude/sync-run.ts#main",
+ "source": "src/cli.ts",
+ "target": "src/cli.ts#engineFrom",
"relation": "contains",
"confidence": "extracted"
},
{
- "source": "src/claude/sync-run.ts",
- "target": "src/claude/sync-run.ts#realBuild",
+ "source": "src/cli.ts",
+ "target": "src/cli.ts#fmt",
"relation": "contains",
"confidence": "extracted"
},
{
- "source": "src/claude/sync-run.ts",
- "target": "src/claude/sync-run.ts#runSync",
+ "source": "src/cli.ts",
+ "target": "src/cli.ts#GlobalOpts",
"relation": "contains",
"confidence": "extracted"
},
{
- "source": "src/claude/sync-run.ts",
- "target": "node:child_process",
+ "source": "src/cli.ts",
+ "target": "commander",
"relation": "imports",
"confidence": "extracted"
},
{
- "source": "src/claude/sync-run.ts",
+ "source": "src/cli.ts",
+ "target": "dotenv/config",
+ "relation": "imports",
+ "confidence": "extracted"
+ },
+ {
+ "source": "src/cli.ts",
+ "target": "node:path",
+ "relation": "imports",
+ "confidence": "extracted"
+ },
+ {
+ "source": "src/cli.ts",
"target": "node:url",
"relation": "imports",
"confidence": "extracted"
},
{
- "source": "src/claude/sync-run.ts",
- "target": "src/claude/paths.ts",
+ "source": "src/cli.ts",
+ "target": "src/ai/llm/factory.ts",
"relation": "imports",
"confidence": "extracted"
},
{
- "source": "src/claude/sync-run.ts",
- "target": "src/claude/state.ts",
+ "source": "src/cli.ts",
+ "target": "src/ai/providers.ts",
"relation": "imports",
"confidence": "extracted"
},
{
- "source": "src/claude/sync-run.ts",
- "target": "src/claude/stats.ts",
+ "source": "src/cli.ts",
+ "target": "src/claude/init.ts",
"relation": "imports",
"confidence": "extracted"
},
{
- "source": "src/claude/sync-run.ts#main",
- "target": "src/claude/sync-run.ts#runSync",
- "relation": "calls",
+ "source": "src/cli.ts",
+ "target": "src/cli-epilogue.ts",
+ "relation": "imports",
"confidence": "extracted"
},
{
- "source": "src/claude/sync-run.ts#realBuild",
- "target": "src/claude/paths.ts#graftCliPath",
- "relation": "calls",
- "confidence": "inferred"
+ "source": "src/cli.ts",
+ "target": "src/cli-meta.ts",
+ "relation": "imports",
+ "confidence": "extracted"
},
{
- "source": "src/claude/sync-run.ts#runSync",
- "target": "src/claude/state.ts#patchStats",
- "relation": "calls",
- "confidence": "inferred"
+ "source": "src/cli.ts",
+ "target": "src/context/check.ts",
+ "relation": "imports",
+ "confidence": "extracted"
},
{
- "source": "src/claude/sync-run.ts#runSync",
- "target": "src/claude/state.ts#releaseLock",
- "relation": "calls",
- "confidence": "inferred"
+ "source": "src/cli.ts",
+ "target": "src/context/node-file.ts",
+ "relation": "imports",
+ "confidence": "extracted"
},
{
- "source": "src/claude/sync-run.ts#runSync",
- "target": "src/claude/stats.ts#computeStats",
- "relation": "calls",
- "confidence": "inferred"
+ "source": "src/cli.ts",
+ "target": "src/engine.ts",
+ "relation": "imports",
+ "confidence": "extracted"
},
{
- "source": "src/claude/sync-run.ts#runSync",
- "target": "src/claude/stats.ts#readWiring",
+ "source": "src/cli.ts",
+ "target": "src/graph/check.ts",
+ "relation": "imports",
+ "confidence": "extracted"
+ },
+ {
+ "source": "src/cli.ts",
+ "target": "src/graph/load.ts",
+ "relation": "imports",
+ "confidence": "extracted"
+ },
+ {
+ "source": "src/cli.ts",
+ "target": "src/graph/workspace-cli.ts",
+ "relation": "imports",
+ "confidence": "extracted"
+ },
+ {
+ "source": "src/cli.ts",
+ "target": "src/graph/workspace.ts",
+ "relation": "imports",
+ "confidence": "extracted"
+ },
+ {
+ "source": "src/cli.ts",
+ "target": "src/hosts/init.ts",
+ "relation": "imports",
+ "confidence": "extracted"
+ },
+ {
+ "source": "src/cli.ts",
+ "target": "src/hosts/registry.ts",
+ "relation": "imports",
+ "confidence": "extracted"
+ },
+ {
+ "source": "src/cli.ts#engineFrom",
+ "target": "src/cli.ts#cliConfig",
"relation": "calls",
- "confidence": "inferred"
+ "confidence": "extracted"
},
{
- "source": "src/cli-epilogue.ts",
- "target": "src/cli-epilogue.ts#formatInitEpilogue",
+ "source": "src/context/build.ts",
+ "target": "src/context/build.ts#batchBySize",
"relation": "contains",
"confidence": "extracted"
},
{
- "source": "src/cli-epilogue.ts",
- "target": "src/cli-epilogue.ts#indigo",
+ "source": "src/context/build.ts",
+ "target": "src/context/build.ts#batchKey",
"relation": "contains",
"confidence": "extracted"
},
{
- "source": "src/cli-epilogue.ts",
- "target": "src/cli-epilogue.ts#InitEpilogueOptions",
+ "source": "src/context/build.ts",
+ "target": "src/context/build.ts#BuildCache",
"relation": "contains",
"confidence": "extracted"
},
{
- "source": "src/cli-epilogue.ts",
- "target": "src/cli-epilogue.ts#muted",
+ "source": "src/context/build.ts",
+ "target": "src/context/build.ts#buildContext",
"relation": "contains",
"confidence": "extracted"
},
{
- "source": "src/cli-epilogue.ts",
- "target": "src/cli-epilogue.ts#Step",
+ "source": "src/context/build.ts",
+ "target": "src/context/build.ts#BuildOptions",
"relation": "contains",
"confidence": "extracted"
},
{
- "source": "src/cli-epilogue.ts#formatInitEpilogue",
- "target": "src/cli-epilogue.ts#indigo",
- "relation": "calls",
+ "source": "src/context/build.ts",
+ "target": "src/context/build.ts#BuildProgress",
+ "relation": "contains",
"confidence": "extracted"
},
{
- "source": "src/cli-epilogue.ts#formatInitEpilogue",
- "target": "src/cli-epilogue.ts#muted",
- "relation": "calls",
+ "source": "src/context/build.ts",
+ "target": "src/context/build.ts#BuildResult",
+ "relation": "contains",
"confidence": "extracted"
},
{
- "source": "src/cli-meta.ts",
- "target": "src/cli-meta.ts#formatUpgradeReport",
+ "source": "src/context/build.ts",
+ "target": "src/context/build.ts#cachePath",
"relation": "contains",
"confidence": "extracted"
},
{
- "source": "src/cli-meta.ts",
- "target": "src/cli-meta.ts#formatVersionReport",
+ "source": "src/context/build.ts",
+ "target": "src/context/build.ts#errMsg",
"relation": "contains",
"confidence": "extracted"
},
{
- "source": "src/cli-meta.ts",
- "target": "src/cli-meta.ts#getNpmViewVersion",
+ "source": "src/context/build.ts",
+ "target": "src/context/build.ts#FileWork",
"relation": "contains",
"confidence": "extracted"
},
{
- "source": "src/cli-meta.ts",
- "target": "src/cli-meta.ts#globalRoot",
+ "source": "src/context/build.ts",
+ "target": "src/context/build.ts#loadCache",
"relation": "contains",
"confidence": "extracted"
},
{
- "source": "src/cli-meta.ts",
- "target": "src/cli-meta.ts#isRunningViaNpx",
+ "source": "src/context/build.ts",
+ "target": "src/context/build.ts#mapWithConcurrency",
"relation": "contains",
"confidence": "extracted"
},
{
- "source": "src/cli-meta.ts",
- "target": "src/cli-meta.ts#NpmViewResult",
+ "source": "src/context/build.ts",
+ "target": "src/context/build.ts#NodeDraft",
"relation": "contains",
"confidence": "extracted"
},
{
- "source": "src/cli-meta.ts",
- "target": "src/cli-meta.ts#readCurrentVersion",
+ "source": "src/context/build.ts",
+ "target": "src/context/build.ts#registerName",
"relation": "contains",
"confidence": "extracted"
},
{
- "source": "src/cli-meta.ts",
- "target": "src/cli-meta.ts#readGlobalInstalledVersion",
+ "source": "src/context/build.ts",
+ "target": "src/context/build.ts#resolveSlug",
"relation": "contains",
"confidence": "extracted"
},
{
- "source": "src/cli-meta.ts",
- "target": "src/cli-meta.ts#resolvePackageJsonPath",
+ "source": "src/context/build.ts",
+ "target": "src/context/build.ts#saveCache",
"relation": "contains",
"confidence": "extracted"
},
{
- "source": "src/cli-meta.ts",
- "target": "src/cli-meta.ts#runUpgrade",
- "relation": "contains",
+ "source": "src/context/build.ts",
+ "target": "node:fs",
+ "relation": "imports",
+ "confidence": "extracted"
+ },
+ {
+ "source": "src/context/build.ts",
+ "target": "node:path",
+ "relation": "imports",
+ "confidence": "extracted"
+ },
+ {
+ "source": "src/context/build.ts",
+ "target": "src/ai/summarize.ts",
+ "relation": "imports",
+ "confidence": "extracted"
+ },
+ {
+ "source": "src/context/build.ts",
+ "target": "src/ai/synthesize.ts",
+ "relation": "imports",
"confidence": "extracted"
},
{
- "source": "src/cli-meta.ts",
- "target": "src/cli-meta.ts#UpgradeResult",
- "relation": "contains",
+ "source": "src/context/build.ts",
+ "target": "src/context/node-file.ts",
+ "relation": "imports",
"confidence": "extracted"
},
{
- "source": "src/cli-meta.ts",
- "target": "node:child_process",
+ "source": "src/context/build.ts",
+ "target": "src/ingest/fs.ts",
"relation": "imports",
"confidence": "extracted"
},
{
- "source": "src/cli-meta.ts",
- "target": "node:fs",
+ "source": "src/context/build.ts",
+ "target": "src/util/id.ts",
"relation": "imports",
"confidence": "extracted"
},
{
- "source": "src/cli-meta.ts",
- "target": "node:path",
- "relation": "imports",
+ "source": "src/context/build.ts#batchKey",
+ "target": "src/util/id.ts#contentHash",
+ "relation": "calls",
+ "confidence": "inferred"
+ },
+ {
+ "source": "src/context/build.ts#buildContext",
+ "target": "src/context/build.ts#batchBySize",
+ "relation": "calls",
"confidence": "extracted"
},
{
- "source": "src/cli-meta.ts",
- "target": "node:url",
- "relation": "imports",
+ "source": "src/context/build.ts#buildContext",
+ "target": "src/context/build.ts#batchKey",
+ "relation": "calls",
"confidence": "extracted"
},
{
- "source": "src/cli-meta.ts#readCurrentVersion",
- "target": "src/cli-meta.ts#resolvePackageJsonPath",
+ "source": "src/context/build.ts#buildContext",
+ "target": "src/context/build.ts#errMsg",
"relation": "calls",
"confidence": "extracted"
},
{
- "source": "src/cli-meta.ts#readGlobalInstalledVersion",
- "target": "src/cli-meta.ts#globalRoot",
+ "source": "src/context/build.ts#buildContext",
+ "target": "src/context/build.ts#loadCache",
"relation": "calls",
"confidence": "extracted"
},
{
- "source": "src/cli-meta.ts#runUpgrade",
- "target": "src/cli-meta.ts#getNpmViewVersion",
+ "source": "src/context/build.ts#buildContext",
+ "target": "src/context/build.ts#mapWithConcurrency",
"relation": "calls",
"confidence": "extracted"
},
{
- "source": "src/cli-meta.ts#runUpgrade",
- "target": "src/cli-meta.ts#isRunningViaNpx",
+ "source": "src/context/build.ts#buildContext",
+ "target": "src/context/build.ts#registerName",
"relation": "calls",
"confidence": "extracted"
},
{
- "source": "src/cli-meta.ts#runUpgrade",
- "target": "src/cli-meta.ts#readCurrentVersion",
+ "source": "src/context/build.ts#buildContext",
+ "target": "src/context/build.ts#resolveSlug",
"relation": "calls",
"confidence": "extracted"
},
{
- "source": "src/cli-meta.ts#runUpgrade",
- "target": "src/cli-meta.ts#readGlobalInstalledVersion",
+ "source": "src/context/build.ts#buildContext",
+ "target": "src/context/build.ts#saveCache",
"relation": "calls",
"confidence": "extracted"
},
{
- "source": "src/cli.ts",
- "target": "src/ai/providers.ts#resolveConfig",
+ "source": "src/context/build.ts#buildContext",
+ "target": "src/context/node-file.ts#contextDirFor",
"relation": "calls",
"confidence": "inferred"
},
{
- "source": "src/cli.ts",
- "target": "src/ask/ask.ts#formatAsk",
+ "source": "src/context/build.ts#buildContext",
+ "target": "src/context/node-file.ts#deleteNode",
"relation": "calls",
"confidence": "inferred"
},
{
- "source": "src/cli.ts",
- "target": "src/ask/ask.ts#formatSkeleton",
+ "source": "src/context/build.ts#buildContext",
+ "target": "src/context/node-file.ts#digestSources",
"relation": "calls",
"confidence": "inferred"
},
{
- "source": "src/cli.ts",
- "target": "src/ask/ask.ts#skeleton",
+ "source": "src/context/build.ts#buildContext",
+ "target": "src/context/node-file.ts#existingNodeSlugs",
"relation": "calls",
"confidence": "inferred"
},
{
- "source": "src/cli.ts",
- "target": "src/claude/init.ts#runInit",
+ "source": "src/context/build.ts#buildContext",
+ "target": "src/context/node-file.ts#slugify",
"relation": "calls",
"confidence": "inferred"
},
{
- "source": "src/cli.ts",
- "target": "src/cli-epilogue.ts#formatInitEpilogue",
+ "source": "src/context/build.ts#buildContext",
+ "target": "src/context/node-file.ts#writeManifest",
"relation": "calls",
"confidence": "inferred"
},
{
- "source": "src/cli.ts",
- "target": "src/cli-meta.ts#formatUpgradeReport",
+ "source": "src/context/build.ts#buildContext",
+ "target": "src/context/node-file.ts#writeNode",
"relation": "calls",
"confidence": "inferred"
},
{
- "source": "src/cli.ts",
- "target": "src/cli-meta.ts#formatVersionReport",
+ "source": "src/context/build.ts#buildContext",
+ "target": "src/graph/bindings.ts#FileBindings.set",
"relation": "calls",
"confidence": "inferred"
},
{
- "source": "src/cli.ts",
- "target": "src/cli-meta.ts#getNpmViewVersion",
+ "source": "src/context/build.ts#buildContext",
+ "target": "src/ingest/fs.ts#walkDir",
"relation": "calls",
"confidence": "inferred"
},
{
- "source": "src/cli.ts",
- "target": "src/cli-meta.ts#readCurrentVersion",
+ "source": "src/context/build.ts#buildContext",
+ "target": "src/util/id.ts#contentHash",
"relation": "calls",
"confidence": "inferred"
},
{
- "source": "src/cli.ts",
- "target": "src/cli-meta.ts#runUpgrade",
+ "source": "src/context/build.ts#loadCache",
+ "target": "src/context/build.ts#cachePath",
+ "relation": "calls",
+ "confidence": "extracted"
+ },
+ {
+ "source": "src/context/build.ts#registerName",
+ "target": "src/graph/bindings.ts#FileBindings.set",
"relation": "calls",
"confidence": "inferred"
},
{
- "source": "src/cli.ts",
- "target": "src/cli.ts#cliConfig",
+ "source": "src/context/build.ts#saveCache",
+ "target": "src/context/build.ts#cachePath",
"relation": "calls",
"confidence": "extracted"
},
{
- "source": "src/cli.ts",
- "target": "src/cli.ts#engineFrom",
- "relation": "calls",
+ "source": "src/context/check.ts",
+ "target": "src/context/check.ts#checkContext",
+ "relation": "contains",
"confidence": "extracted"
},
{
- "source": "src/cli.ts",
- "target": "src/cli.ts#fmt",
- "relation": "calls",
+ "source": "src/context/check.ts",
+ "target": "src/context/check.ts#CheckOptions",
+ "relation": "contains",
"confidence": "extracted"
},
{
- "source": "src/cli.ts",
+ "source": "src/context/check.ts",
+ "target": "src/context/check.ts#CheckResult",
+ "relation": "contains",
+ "confidence": "extracted"
+ },
+ {
+ "source": "src/context/check.ts",
"target": "src/context/check.ts#formatCheckReport",
- "relation": "calls",
- "confidence": "inferred"
+ "relation": "contains",
+ "confidence": "extracted"
},
{
- "source": "src/cli.ts",
- "target": "src/context/node-file.ts#contextDirFor",
- "relation": "calls",
- "confidence": "inferred"
+ "source": "src/context/check.ts",
+ "target": "src/context/check.ts#short",
+ "relation": "contains",
+ "confidence": "extracted"
},
{
- "source": "src/cli.ts",
- "target": "src/engine.ts#Graft.ask",
- "relation": "calls",
- "confidence": "inferred"
+ "source": "src/context/check.ts",
+ "target": "node:fs",
+ "relation": "imports",
+ "confidence": "extracted"
},
{
- "source": "src/cli.ts",
- "target": "src/engine.ts#Graft.check",
- "relation": "calls",
- "confidence": "inferred"
+ "source": "src/context/check.ts",
+ "target": "node:path",
+ "relation": "imports",
+ "confidence": "extracted"
},
{
- "source": "src/cli.ts",
- "target": "src/engine.ts#Graft.checkGraph",
- "relation": "calls",
- "confidence": "inferred"
+ "source": "src/context/check.ts",
+ "target": "src/context/build.ts",
+ "relation": "imports",
+ "confidence": "extracted"
},
{
- "source": "src/cli.ts",
- "target": "src/engine.ts#Graft.graph",
- "relation": "calls",
- "confidence": "inferred"
+ "source": "src/context/check.ts",
+ "target": "src/context/node-file.ts",
+ "relation": "imports",
+ "confidence": "extracted"
},
{
- "source": "src/cli.ts",
- "target": "src/engine.ts#Graft.init",
- "relation": "calls",
- "confidence": "inferred"
+ "source": "src/context/check.ts",
+ "target": "src/ingest/fs.ts",
+ "relation": "imports",
+ "confidence": "extracted"
},
{
- "source": "src/cli.ts",
- "target": "src/graph/check.ts#formatGraphCheckReport",
- "relation": "calls",
- "confidence": "inferred"
+ "source": "src/context/check.ts",
+ "target": "src/util/id.ts",
+ "relation": "imports",
+ "confidence": "extracted"
},
{
- "source": "src/cli.ts",
- "target": "src/graph/load.ts#loadGraphCached",
+ "source": "src/context/check.ts#checkContext",
+ "target": "src/context/check.ts#short",
"relation": "calls",
- "confidence": "inferred"
+ "confidence": "extracted"
},
{
- "source": "src/cli.ts",
- "target": "src/graph/map.ts#buildRepoMap",
+ "source": "src/context/check.ts#checkContext",
+ "target": "src/context/node-file.ts#contextDirFor",
"relation": "calls",
"confidence": "inferred"
},
{
- "source": "src/cli.ts",
- "target": "src/graph/map.ts#formatRepoMap",
+ "source": "src/context/check.ts#checkContext",
+ "target": "src/context/node-file.ts#readManifest",
"relation": "calls",
"confidence": "inferred"
},
{
- "source": "src/cli.ts",
- "target": "src/graph/traverse-cli.ts#runCallersCommand",
+ "source": "src/context/check.ts#checkContext",
+ "target": "src/context/node-file.ts#readNodes",
"relation": "calls",
"confidence": "inferred"
},
{
- "source": "src/cli.ts",
- "target": "src/hosts/init.ts#runHostsInit",
+ "source": "src/context/check.ts#checkContext",
+ "target": "src/ingest/fs.ts#walkDir",
"relation": "calls",
"confidence": "inferred"
},
{
- "source": "src/cli.ts",
- "target": "src/hosts/registry.ts#hostIds",
+ "source": "src/context/check.ts#checkContext",
+ "target": "src/util/id.ts#contentHash",
"relation": "calls",
"confidence": "inferred"
},
{
- "source": "src/cli.ts",
- "target": "src/mcp/server.ts#startMcpServer",
- "relation": "calls",
- "confidence": "inferred"
+ "source": "src/context/node-file.ts",
+ "target": "src/context/node-file.ts#contextDirFor",
+ "relation": "contains",
+ "confidence": "extracted"
},
{
- "source": "src/cli.ts",
- "target": "src/search/grep-cli.ts#runGrepCommand",
- "relation": "calls",
- "confidence": "inferred"
+ "source": "src/context/node-file.ts",
+ "target": "src/context/node-file.ts#ContextNode",
+ "relation": "contains",
+ "confidence": "extracted"
},
{
- "source": "src/cli.ts",
- "target": "src/viz/serve.ts#startVizServer",
- "relation": "calls",
- "confidence": "inferred"
+ "source": "src/context/node-file.ts",
+ "target": "src/context/node-file.ts#defaultHuman",
+ "relation": "contains",
+ "confidence": "extracted"
+ },
+ {
+ "source": "src/context/node-file.ts",
+ "target": "src/context/node-file.ts#deleteNode",
+ "relation": "contains",
+ "confidence": "extracted"
+ },
+ {
+ "source": "src/context/node-file.ts",
+ "target": "src/context/node-file.ts#digestSources",
+ "relation": "contains",
+ "confidence": "extracted"
},
{
- "source": "src/cli.ts",
- "target": "src/cli.ts#cliConfig",
+ "source": "src/context/node-file.ts",
+ "target": "src/context/node-file.ts#existingNodeSlugs",
"relation": "contains",
"confidence": "extracted"
},
{
- "source": "src/cli.ts",
- "target": "src/cli.ts#engineFrom",
+ "source": "src/context/node-file.ts",
+ "target": "src/context/node-file.ts#Manifest",
"relation": "contains",
"confidence": "extracted"
},
{
- "source": "src/cli.ts",
- "target": "src/cli.ts#fmt",
+ "source": "src/context/node-file.ts",
+ "target": "src/context/node-file.ts#NodeLink",
"relation": "contains",
"confidence": "extracted"
},
{
- "source": "src/cli.ts",
- "target": "src/cli.ts#GlobalOpts",
+ "source": "src/context/node-file.ts",
+ "target": "src/context/node-file.ts#ParsedNode",
"relation": "contains",
"confidence": "extracted"
},
{
- "source": "src/cli.ts",
- "target": "commander",
- "relation": "imports",
+ "source": "src/context/node-file.ts",
+ "target": "src/context/node-file.ts#preserveHuman",
+ "relation": "contains",
"confidence": "extracted"
},
{
- "source": "src/cli.ts",
- "target": "dotenv/config",
- "relation": "imports",
+ "source": "src/context/node-file.ts",
+ "target": "src/context/node-file.ts#readManifest",
+ "relation": "contains",
"confidence": "extracted"
},
{
- "source": "src/cli.ts",
- "target": "node:path",
- "relation": "imports",
+ "source": "src/context/node-file.ts",
+ "target": "src/context/node-file.ts#readNodes",
+ "relation": "contains",
"confidence": "extracted"
},
{
- "source": "src/cli.ts",
- "target": "node:url",
- "relation": "imports",
+ "source": "src/context/node-file.ts",
+ "target": "src/context/node-file.ts#renderGenerated",
+ "relation": "contains",
"confidence": "extracted"
},
{
- "source": "src/cli.ts",
- "target": "src/ai/llm/factory.ts",
- "relation": "imports",
+ "source": "src/context/node-file.ts",
+ "target": "src/context/node-file.ts#renderNodeFile",
+ "relation": "contains",
"confidence": "extracted"
},
{
- "source": "src/cli.ts",
- "target": "src/ai/providers.ts",
- "relation": "imports",
+ "source": "src/context/node-file.ts",
+ "target": "src/context/node-file.ts#slugify",
+ "relation": "contains",
"confidence": "extracted"
},
{
- "source": "src/cli.ts",
- "target": "src/claude/init.ts",
- "relation": "imports",
+ "source": "src/context/node-file.ts",
+ "target": "src/context/node-file.ts#SourceRef",
+ "relation": "contains",
"confidence": "extracted"
},
{
- "source": "src/cli.ts",
- "target": "src/cli-epilogue.ts",
- "relation": "imports",
+ "source": "src/context/node-file.ts",
+ "target": "src/context/node-file.ts#writeManifest",
+ "relation": "contains",
"confidence": "extracted"
},
{
- "source": "src/cli.ts",
- "target": "src/cli-meta.ts",
- "relation": "imports",
+ "source": "src/context/node-file.ts",
+ "target": "src/context/node-file.ts#writeNode",
+ "relation": "contains",
"confidence": "extracted"
},
{
- "source": "src/cli.ts",
- "target": "src/context/check.ts",
+ "source": "src/context/node-file.ts",
+ "target": "gray-matter",
"relation": "imports",
"confidence": "extracted"
},
{
- "source": "src/cli.ts",
- "target": "src/context/node-file.ts",
+ "source": "src/context/node-file.ts",
+ "target": "node:fs",
"relation": "imports",
"confidence": "extracted"
},
{
- "source": "src/cli.ts",
- "target": "src/engine.ts",
+ "source": "src/context/node-file.ts",
+ "target": "node:path",
"relation": "imports",
"confidence": "extracted"
},
{
- "source": "src/cli.ts",
- "target": "src/graph/check.ts",
+ "source": "src/context/node-file.ts",
+ "target": "src/util/id.ts",
"relation": "imports",
"confidence": "extracted"
},
{
- "source": "src/cli.ts",
- "target": "src/graph/load.ts",
- "relation": "imports",
- "confidence": "extracted"
+ "source": "src/context/node-file.ts#digestSources",
+ "target": "src/util/id.ts#contentHash",
+ "relation": "calls",
+ "confidence": "inferred"
},
{
- "source": "src/cli.ts",
- "target": "src/hosts/init.ts",
- "relation": "imports",
+ "source": "src/context/node-file.ts#preserveHuman",
+ "target": "src/context/node-file.ts#defaultHuman",
+ "relation": "calls",
"confidence": "extracted"
},
{
- "source": "src/cli.ts",
- "target": "src/hosts/registry.ts",
- "relation": "imports",
+ "source": "src/context/node-file.ts#renderNodeFile",
+ "target": "src/context/node-file.ts#renderGenerated",
+ "relation": "calls",
"confidence": "extracted"
},
{
- "source": "src/cli.ts#engineFrom",
- "target": "src/cli.ts#cliConfig",
+ "source": "src/context/node-file.ts#slugify",
+ "target": "src/util/id.ts#normalizeName",
+ "relation": "calls",
+ "confidence": "inferred"
+ },
+ {
+ "source": "src/context/node-file.ts#writeNode",
+ "target": "src/context/node-file.ts#defaultHuman",
"relation": "calls",
"confidence": "extracted"
},
{
- "source": "src/context/build.ts",
- "target": "src/context/build.ts#batchBySize",
- "relation": "contains",
+ "source": "src/context/node-file.ts#writeNode",
+ "target": "src/context/node-file.ts#preserveHuman",
+ "relation": "calls",
"confidence": "extracted"
},
{
- "source": "src/context/build.ts",
- "target": "src/context/build.ts#batchKey",
- "relation": "contains",
+ "source": "src/context/node-file.ts#writeNode",
+ "target": "src/context/node-file.ts#renderNodeFile",
+ "relation": "calls",
"confidence": "extracted"
},
{
- "source": "src/context/build.ts",
- "target": "src/context/build.ts#BuildCache",
+ "source": "src/context/savings.ts",
+ "target": "src/context/savings.ts#fileSizes",
"relation": "contains",
"confidence": "extracted"
},
{
- "source": "src/context/build.ts",
- "target": "src/context/build.ts#buildContext",
+ "source": "src/context/savings.ts",
+ "target": "src/context/savings.ts#Savings",
"relation": "contains",
"confidence": "extracted"
},
{
- "source": "src/context/build.ts",
- "target": "src/context/build.ts#BuildOptions",
+ "source": "src/context/savings.ts",
+ "target": "src/context/savings.ts#savingsFooter",
"relation": "contains",
"confidence": "extracted"
},
{
- "source": "src/context/build.ts",
- "target": "src/context/build.ts#BuildProgress",
+ "source": "src/context/savings.ts",
+ "target": "src/context/savings.ts#savingsFor",
"relation": "contains",
"confidence": "extracted"
},
{
- "source": "src/context/build.ts",
- "target": "src/context/build.ts#BuildResult",
+ "source": "src/context/savings.ts",
+ "target": "src/context/savings.ts#toTokens",
"relation": "contains",
"confidence": "extracted"
},
{
- "source": "src/context/build.ts",
- "target": "src/context/build.ts#cachePath",
- "relation": "contains",
+ "source": "src/context/savings.ts",
+ "target": "src/graph/types.ts",
+ "relation": "imports",
"confidence": "extracted"
},
{
- "source": "src/context/build.ts",
- "target": "src/context/build.ts#errMsg",
- "relation": "contains",
+ "source": "src/context/savings.ts#savingsFooter",
+ "target": "src/context/savings.ts#toTokens",
+ "relation": "calls",
"confidence": "extracted"
},
{
- "source": "src/context/build.ts",
- "target": "src/context/build.ts#FileWork",
- "relation": "contains",
+ "source": "src/context/savings.ts#savingsFor",
+ "target": "src/context/savings.ts#fileSizes",
+ "relation": "calls",
"confidence": "extracted"
},
{
- "source": "src/context/build.ts",
- "target": "src/context/build.ts#loadCache",
+ "source": "src/engine.ts",
+ "target": "src/engine.ts#CheckRunOptions",
"relation": "contains",
"confidence": "extracted"
},
{
- "source": "src/context/build.ts",
- "target": "src/context/build.ts#mapWithConcurrency",
+ "source": "src/engine.ts",
+ "target": "src/engine.ts#Graft",
"relation": "contains",
"confidence": "extracted"
},
{
- "source": "src/context/build.ts",
- "target": "src/context/build.ts#NodeDraft",
+ "source": "src/engine.ts",
+ "target": "src/engine.ts#GraphRunOptions",
"relation": "contains",
"confidence": "extracted"
},
{
- "source": "src/context/build.ts",
- "target": "src/context/build.ts#registerName",
+ "source": "src/engine.ts",
+ "target": "src/engine.ts#InitOptions",
"relation": "contains",
"confidence": "extracted"
},
{
- "source": "src/context/build.ts",
- "target": "src/context/build.ts#resolveSlug",
- "relation": "contains",
+ "source": "src/engine.ts",
+ "target": "src/ai/crux.ts",
+ "relation": "imports",
"confidence": "extracted"
},
{
- "source": "src/context/build.ts",
- "target": "src/context/build.ts#saveCache",
- "relation": "contains",
+ "source": "src/engine.ts",
+ "target": "src/ai/llm/factory.ts",
+ "relation": "imports",
"confidence": "extracted"
},
{
- "source": "src/context/build.ts",
- "target": "node:fs",
+ "source": "src/engine.ts",
+ "target": "src/ai/llm/types.ts",
"relation": "imports",
"confidence": "extracted"
},
{
- "source": "src/context/build.ts",
- "target": "node:path",
+ "source": "src/engine.ts",
+ "target": "src/ai/providers.ts",
"relation": "imports",
"confidence": "extracted"
},
{
- "source": "src/context/build.ts",
+ "source": "src/engine.ts",
"target": "src/ai/summarize.ts",
"relation": "imports",
"confidence": "extracted"
},
{
- "source": "src/context/build.ts",
+ "source": "src/engine.ts",
"target": "src/ai/synthesize.ts",
"relation": "imports",
"confidence": "extracted"
},
{
- "source": "src/context/build.ts",
- "target": "src/context/node-file.ts",
+ "source": "src/engine.ts",
+ "target": "src/ask/ask.ts",
"relation": "imports",
"confidence": "extracted"
},
{
- "source": "src/context/build.ts",
- "target": "src/ingest/fs.ts",
+ "source": "src/engine.ts",
+ "target": "src/context/build.ts",
"relation": "imports",
"confidence": "extracted"
},
{
- "source": "src/context/build.ts",
- "target": "src/util/id.ts",
+ "source": "src/engine.ts",
+ "target": "src/context/check.ts",
"relation": "imports",
"confidence": "extracted"
},
{
- "source": "src/context/build.ts#batchKey",
- "target": "src/util/id.ts#contentHash",
- "relation": "calls",
- "confidence": "inferred"
+ "source": "src/engine.ts",
+ "target": "src/graph/build.ts",
+ "relation": "imports",
+ "confidence": "extracted"
},
{
- "source": "src/context/build.ts#buildContext",
- "target": "src/context/build.ts#batchBySize",
- "relation": "calls",
+ "source": "src/engine.ts",
+ "target": "src/graph/check.ts",
+ "relation": "imports",
+ "confidence": "extracted"
+ },
+ {
+ "source": "src/engine.ts#Graft",
+ "target": "src/engine.ts#Graft.ask",
+ "relation": "contains",
+ "confidence": "extracted"
+ },
+ {
+ "source": "src/engine.ts#Graft",
+ "target": "src/engine.ts#Graft.chatModel",
+ "relation": "contains",
+ "confidence": "extracted"
+ },
+ {
+ "source": "src/engine.ts#Graft",
+ "target": "src/engine.ts#Graft.check",
+ "relation": "contains",
+ "confidence": "extracted"
+ },
+ {
+ "source": "src/engine.ts#Graft",
+ "target": "src/engine.ts#Graft.checkGraph",
+ "relation": "contains",
"confidence": "extracted"
},
{
- "source": "src/context/build.ts#buildContext",
- "target": "src/context/build.ts#batchKey",
- "relation": "calls",
+ "source": "src/engine.ts#Graft",
+ "target": "src/engine.ts#Graft.constructor",
+ "relation": "contains",
"confidence": "extracted"
},
{
- "source": "src/context/build.ts#buildContext",
- "target": "src/context/build.ts#errMsg",
- "relation": "calls",
+ "source": "src/engine.ts#Graft",
+ "target": "src/engine.ts#Graft.cruxSummarizer",
+ "relation": "contains",
"confidence": "extracted"
},
{
- "source": "src/context/build.ts#buildContext",
- "target": "src/context/build.ts#loadCache",
- "relation": "calls",
+ "source": "src/engine.ts#Graft",
+ "target": "src/engine.ts#Graft.graph",
+ "relation": "contains",
"confidence": "extracted"
},
{
- "source": "src/context/build.ts#buildContext",
- "target": "src/context/build.ts#mapWithConcurrency",
- "relation": "calls",
+ "source": "src/engine.ts#Graft",
+ "target": "src/engine.ts#Graft.init",
+ "relation": "contains",
"confidence": "extracted"
},
{
- "source": "src/context/build.ts#buildContext",
- "target": "src/context/build.ts#registerName",
- "relation": "calls",
+ "source": "src/engine.ts#Graft",
+ "target": "src/engine.ts#Graft.modelLabel",
+ "relation": "contains",
"confidence": "extracted"
},
{
- "source": "src/context/build.ts#buildContext",
- "target": "src/context/build.ts#resolveSlug",
- "relation": "calls",
+ "source": "src/engine.ts#Graft",
+ "target": "src/engine.ts#Graft.summarizer",
+ "relation": "contains",
"confidence": "extracted"
},
{
- "source": "src/context/build.ts#buildContext",
- "target": "src/context/build.ts#saveCache",
- "relation": "calls",
+ "source": "src/engine.ts#Graft",
+ "target": "src/engine.ts#Graft.synthesizer",
+ "relation": "contains",
"confidence": "extracted"
},
{
- "source": "src/context/build.ts#buildContext",
- "target": "src/context/node-file.ts#contextDirFor",
+ "source": "src/engine.ts#Graft.ask",
+ "target": "src/ask/ask.ts#ask",
"relation": "calls",
"confidence": "inferred"
},
{
- "source": "src/context/build.ts#buildContext",
- "target": "src/context/node-file.ts#deleteNode",
+ "source": "src/engine.ts#Graft.chatModel",
+ "target": "src/ai/llm/factory.ts#createChatModel",
"relation": "calls",
"confidence": "inferred"
},
{
- "source": "src/context/build.ts#buildContext",
- "target": "src/context/node-file.ts#digestSources",
+ "source": "src/engine.ts#Graft.check",
+ "target": "src/context/check.ts#checkContext",
"relation": "calls",
"confidence": "inferred"
},
{
- "source": "src/context/build.ts#buildContext",
- "target": "src/context/node-file.ts#existingNodeSlugs",
+ "source": "src/engine.ts#Graft.checkGraph",
+ "target": "src/graph/check.ts#checkGraph",
"relation": "calls",
"confidence": "inferred"
},
{
- "source": "src/context/build.ts#buildContext",
- "target": "src/context/node-file.ts#slugify",
+ "source": "src/engine.ts#Graft.constructor",
+ "target": "src/ai/providers.ts#resolveConfig",
"relation": "calls",
"confidence": "inferred"
},
{
- "source": "src/context/build.ts#buildContext",
- "target": "src/context/node-file.ts#writeManifest",
+ "source": "src/engine.ts#Graft.cruxSummarizer",
+ "target": "src/engine.ts#Graft.chatModel",
"relation": "calls",
- "confidence": "inferred"
+ "confidence": "extracted"
},
{
- "source": "src/context/build.ts#buildContext",
- "target": "src/context/node-file.ts#writeNode",
+ "source": "src/engine.ts#Graft.graph",
+ "target": "src/engine.ts#Graft.cruxSummarizer",
"relation": "calls",
- "confidence": "inferred"
+ "confidence": "extracted"
},
{
- "source": "src/context/build.ts#buildContext",
- "target": "src/graph/bindings.ts#FileBindings.set",
+ "source": "src/engine.ts#Graft.graph",
+ "target": "src/graph/build.ts#buildGraph",
"relation": "calls",
"confidence": "inferred"
},
{
- "source": "src/context/build.ts#buildContext",
- "target": "src/ingest/fs.ts#walkDir",
+ "source": "src/engine.ts#Graft.init",
+ "target": "src/context/build.ts#buildContext",
"relation": "calls",
"confidence": "inferred"
},
{
- "source": "src/context/build.ts#buildContext",
- "target": "src/util/id.ts#contentHash",
+ "source": "src/engine.ts#Graft.init",
+ "target": "src/engine.ts#Graft.modelLabel",
"relation": "calls",
- "confidence": "inferred"
+ "confidence": "extracted"
},
{
- "source": "src/context/build.ts#loadCache",
- "target": "src/context/build.ts#cachePath",
+ "source": "src/engine.ts#Graft.init",
+ "target": "src/engine.ts#Graft.summarizer",
"relation": "calls",
"confidence": "extracted"
},
{
- "source": "src/context/build.ts#registerName",
- "target": "src/graph/bindings.ts#FileBindings.set",
+ "source": "src/engine.ts#Graft.init",
+ "target": "src/engine.ts#Graft.synthesizer",
"relation": "calls",
- "confidence": "inferred"
+ "confidence": "extracted"
},
{
- "source": "src/context/build.ts#saveCache",
- "target": "src/context/build.ts#cachePath",
+ "source": "src/engine.ts#Graft.summarizer",
+ "target": "src/engine.ts#Graft.chatModel",
"relation": "calls",
"confidence": "extracted"
},
{
- "source": "src/context/check.ts",
- "target": "src/context/check.ts#checkContext",
- "relation": "contains",
+ "source": "src/engine.ts#Graft.synthesizer",
+ "target": "src/engine.ts#Graft.chatModel",
+ "relation": "calls",
"confidence": "extracted"
},
{
- "source": "src/context/check.ts",
- "target": "src/context/check.ts#CheckOptions",
+ "source": "src/graph/bindings.ts",
+ "target": "src/graph/bindings.ts#callTypeName",
"relation": "contains",
"confidence": "extracted"
},
{
- "source": "src/context/check.ts",
- "target": "src/context/check.ts#CheckResult",
+ "source": "src/graph/bindings.ts",
+ "target": "src/graph/bindings.ts#collectAliases",
"relation": "contains",
"confidence": "extracted"
},
{
- "source": "src/context/check.ts",
- "target": "src/context/check.ts#formatCheckReport",
+ "source": "src/graph/bindings.ts",
+ "target": "src/graph/bindings.ts#collectBindings",
"relation": "contains",
"confidence": "extracted"
},
{
- "source": "src/context/check.ts",
- "target": "src/context/check.ts#short",
+ "source": "src/graph/bindings.ts",
+ "target": "src/graph/bindings.ts#defName",
"relation": "contains",
"confidence": "extracted"
},
{
- "source": "src/context/check.ts",
- "target": "node:fs",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "src/context/check.ts",
- "target": "node:path",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "src/context/check.ts",
- "target": "src/context/build.ts",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "src/context/check.ts",
- "target": "src/context/node-file.ts",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "src/context/check.ts",
- "target": "src/ingest/fs.ts",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "src/context/check.ts",
- "target": "src/util/id.ts",
- "relation": "imports",
- "confidence": "extracted"
- },
- {
- "source": "src/context/check.ts#checkContext",
- "target": "src/context/check.ts#short",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "src/context/check.ts#checkContext",
- "target": "src/context/node-file.ts#contextDirFor",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "src/context/check.ts#checkContext",
- "target": "src/context/node-file.ts#readManifest",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "src/context/check.ts#checkContext",
- "target": "src/context/node-file.ts#readNodes",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "src/context/check.ts#checkContext",
- "target": "src/ingest/fs.ts#walkDir",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "src/context/check.ts#checkContext",
- "target": "src/util/id.ts#contentHash",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "src/context/node-file.ts",
- "target": "src/context/node-file.ts#contextDirFor",
+ "source": "src/graph/bindings.ts",
+ "target": "src/graph/bindings.ts#FileBindings",
"relation": "contains",
"confidence": "extracted"
},
{
- "source": "src/context/node-file.ts",
- "target": "src/context/node-file.ts#ContextNode",
+ "source": "src/graph/bindings.ts",
+ "target": "src/graph/bindings.ts#goReceiverTypeOf",
"relation": "contains",
"confidence": "extracted"
},
{
- "source": "src/context/node-file.ts",
- "target": "src/context/node-file.ts#defaultHuman",
+ "source": "src/graph/bindings.ts",
+ "target": "src/graph/bindings.ts#goReceiverVarOf",
"relation": "contains",
"confidence": "extracted"
},
{
- "source": "src/context/node-file.ts",
- "target": "src/context/node-file.ts#deleteNode",
+ "source": "src/graph/bindings.ts",
+ "target": "src/graph/bindings.ts#handleGo",
"relation": "contains",
"confidence": "extracted"
},
{
- "source": "src/context/node-file.ts",
- "target": "src/context/node-file.ts#digestSources",
+ "source": "src/graph/bindings.ts",
+ "target": "src/graph/bindings.ts#handlePy",
"relation": "contains",
"confidence": "extracted"
},
{
- "source": "src/context/node-file.ts",
- "target": "src/context/node-file.ts#existingNodeSlugs",
+ "source": "src/graph/bindings.ts",
+ "target": "src/graph/bindings.ts#handleTs",
"relation": "contains",
"confidence": "extracted"
},
{
- "source": "src/context/node-file.ts",
- "target": "src/context/node-file.ts#Manifest",
+ "source": "src/graph/bindings.ts",
+ "target": "src/graph/bindings.ts#isClassNode",
"relation": "contains",
"confidence": "extracted"
},
{
- "source": "src/context/node-file.ts",
- "target": "src/context/node-file.ts#NodeLink",
+ "source": "src/graph/bindings.ts",
+ "target": "src/graph/bindings.ts#pyTypeName",
"relation": "contains",
"confidence": "extracted"
},
{
- "source": "src/context/node-file.ts",
- "target": "src/context/node-file.ts#ParsedNode",
+ "source": "src/graph/bindings.ts",
+ "target": "src/graph/bindings.ts#resolveAlias",
"relation": "contains",
"confidence": "extracted"
},
{
- "source": "src/context/node-file.ts",
- "target": "src/context/node-file.ts#preserveHuman",
+ "source": "src/graph/bindings.ts",
+ "target": "src/graph/bindings.ts#resolveRecvType",
"relation": "contains",
"confidence": "extracted"
},
{
- "source": "src/context/node-file.ts",
- "target": "src/context/node-file.ts#readManifest",
+ "source": "src/graph/bindings.ts",
+ "target": "src/graph/bindings.ts#tsAnnotationTypeName",
"relation": "contains",
"confidence": "extracted"
},
{
- "source": "src/context/node-file.ts",
- "target": "src/context/node-file.ts#readNodes",
+ "source": "src/graph/bindings.ts",
+ "target": "src/graph/bindings.ts#tsNewTypeName",
"relation": "contains",
"confidence": "extracted"
},
{
- "source": "src/context/node-file.ts",
- "target": "src/context/node-file.ts#renderGenerated",
+ "source": "src/graph/bindings.ts",
+ "target": "src/graph/bindings.ts#visit",
"relation": "contains",
"confidence": "extracted"
},
{
- "source": "src/context/node-file.ts",
- "target": "src/context/node-file.ts#renderNodeFile",
- "relation": "contains",
+ "source": "src/graph/bindings.ts",
+ "target": "src/graph/extract.ts",
+ "relation": "imports",
"confidence": "extracted"
},
{
- "source": "src/context/node-file.ts",
- "target": "src/context/node-file.ts#slugify",
- "relation": "contains",
+ "source": "src/graph/bindings.ts",
+ "target": "tree-sitter",
+ "relation": "imports",
"confidence": "extracted"
},
{
- "source": "src/context/node-file.ts",
- "target": "src/context/node-file.ts#SourceRef",
- "relation": "contains",
+ "source": "src/graph/bindings.ts#collectAliases",
+ "target": "src/graph/bindings.ts#collectAliases",
+ "relation": "calls",
"confidence": "extracted"
},
{
- "source": "src/context/node-file.ts",
- "target": "src/context/node-file.ts#writeManifest",
- "relation": "contains",
+ "source": "src/graph/bindings.ts#collectAliases",
+ "target": "src/graph/bindings.ts#FileBindings.set",
+ "relation": "calls",
"confidence": "extracted"
},
{
- "source": "src/context/node-file.ts",
- "target": "src/context/node-file.ts#writeNode",
- "relation": "contains",
+ "source": "src/graph/bindings.ts#collectBindings",
+ "target": "src/graph/bindings.ts#collectAliases",
+ "relation": "calls",
"confidence": "extracted"
},
{
- "source": "src/context/node-file.ts",
- "target": "gray-matter",
- "relation": "imports",
+ "source": "src/graph/bindings.ts#collectBindings",
+ "target": "src/graph/bindings.ts#visit",
+ "relation": "calls",
"confidence": "extracted"
},
{
- "source": "src/context/node-file.ts",
- "target": "node:fs",
- "relation": "imports",
+ "source": "src/graph/bindings.ts#defName",
+ "target": "src/graph/bindings.ts#goReceiverTypeOf",
+ "relation": "calls",
"confidence": "extracted"
},
{
- "source": "src/context/node-file.ts",
- "target": "node:path",
- "relation": "imports",
+ "source": "src/graph/bindings.ts#FileBindings",
+ "target": "src/graph/bindings.ts#FileBindings.lookup",
+ "relation": "contains",
"confidence": "extracted"
},
{
- "source": "src/context/node-file.ts",
- "target": "src/util/id.ts",
- "relation": "imports",
+ "source": "src/graph/bindings.ts#FileBindings",
+ "target": "src/graph/bindings.ts#FileBindings.set",
+ "relation": "contains",
"confidence": "extracted"
},
{
- "source": "src/context/node-file.ts#digestSources",
- "target": "src/util/id.ts#contentHash",
+ "source": "src/graph/bindings.ts#handleGo",
+ "target": "src/graph/bindings.ts#FileBindings.set",
"relation": "calls",
- "confidence": "inferred"
+ "confidence": "extracted"
},
{
- "source": "src/context/node-file.ts#preserveHuman",
- "target": "src/context/node-file.ts#defaultHuman",
+ "source": "src/graph/bindings.ts#handlePy",
+ "target": "src/graph/bindings.ts#callTypeName",
"relation": "calls",
"confidence": "extracted"
},
{
- "source": "src/context/node-file.ts#renderNodeFile",
- "target": "src/context/node-file.ts#renderGenerated",
+ "source": "src/graph/bindings.ts#handlePy",
+ "target": "src/graph/bindings.ts#FileBindings.set",
"relation": "calls",
"confidence": "extracted"
},
{
- "source": "src/context/node-file.ts#slugify",
- "target": "src/util/id.ts#normalizeName",
+ "source": "src/graph/bindings.ts#handlePy",
+ "target": "src/graph/bindings.ts#pyTypeName",
"relation": "calls",
- "confidence": "inferred"
+ "confidence": "extracted"
},
{
- "source": "src/context/node-file.ts#writeNode",
- "target": "src/context/node-file.ts#defaultHuman",
+ "source": "src/graph/bindings.ts#handleTs",
+ "target": "src/graph/bindings.ts#FileBindings.set",
"relation": "calls",
"confidence": "extracted"
},
{
- "source": "src/context/node-file.ts#writeNode",
- "target": "src/context/node-file.ts#preserveHuman",
+ "source": "src/graph/bindings.ts#handleTs",
+ "target": "src/graph/bindings.ts#tsAnnotationTypeName",
"relation": "calls",
"confidence": "extracted"
},
{
- "source": "src/context/node-file.ts#writeNode",
- "target": "src/context/node-file.ts#renderNodeFile",
+ "source": "src/graph/bindings.ts#handleTs",
+ "target": "src/graph/bindings.ts#tsNewTypeName",
"relation": "calls",
"confidence": "extracted"
},
{
- "source": "src/context/savings.ts",
- "target": "src/context/savings.ts#fileSizes",
- "relation": "contains",
+ "source": "src/graph/bindings.ts#pyTypeName",
+ "target": "src/graph/bindings.ts#resolveAlias",
+ "relation": "calls",
"confidence": "extracted"
},
{
- "source": "src/context/savings.ts",
- "target": "src/context/savings.ts#Savings",
- "relation": "contains",
+ "source": "src/graph/bindings.ts#resolveRecvType",
+ "target": "src/graph/bindings.ts#FileBindings.lookup",
+ "relation": "calls",
"confidence": "extracted"
},
{
- "source": "src/context/savings.ts",
- "target": "src/context/savings.ts#savingsFooter",
- "relation": "contains",
+ "source": "src/graph/bindings.ts#tsAnnotationTypeName",
+ "target": "src/graph/bindings.ts#resolveAlias",
+ "relation": "calls",
"confidence": "extracted"
},
{
- "source": "src/context/savings.ts",
- "target": "src/context/savings.ts#savingsFor",
- "relation": "contains",
+ "source": "src/graph/bindings.ts#visit",
+ "target": "src/graph/bindings.ts#defName",
+ "relation": "calls",
"confidence": "extracted"
},
{
- "source": "src/context/savings.ts",
- "target": "src/context/savings.ts#toTokens",
- "relation": "contains",
+ "source": "src/graph/bindings.ts#visit",
+ "target": "src/graph/bindings.ts#handleGo",
+ "relation": "calls",
"confidence": "extracted"
},
{
- "source": "src/context/savings.ts",
- "target": "src/graph/types.ts",
- "relation": "imports",
+ "source": "src/graph/bindings.ts#visit",
+ "target": "src/graph/bindings.ts#handlePy",
+ "relation": "calls",
"confidence": "extracted"
},
{
- "source": "src/context/savings.ts#savingsFooter",
- "target": "src/context/savings.ts#toTokens",
+ "source": "src/graph/bindings.ts#visit",
+ "target": "src/graph/bindings.ts#handleTs",
"relation": "calls",
"confidence": "extracted"
},
{
- "source": "src/context/savings.ts#savingsFor",
- "target": "src/context/savings.ts#fileSizes",
+ "source": "src/graph/bindings.ts#visit",
+ "target": "src/graph/bindings.ts#isClassNode",
"relation": "calls",
"confidence": "extracted"
},
{
- "source": "src/engine.ts",
- "target": "src/engine.ts#CheckRunOptions",
- "relation": "contains",
+ "source": "src/graph/bindings.ts#visit",
+ "target": "src/graph/bindings.ts#visit",
+ "relation": "calls",
"confidence": "extracted"
},
{
- "source": "src/engine.ts",
- "target": "src/engine.ts#Graft",
+ "source": "src/graph/build.ts",
+ "target": "src/graph/build.ts#applyMinSubstanceGuard",
"relation": "contains",
"confidence": "extracted"
},
{
- "source": "src/engine.ts",
- "target": "src/engine.ts#GraphRunOptions",
+ "source": "src/graph/build.ts",
+ "target": "src/graph/build.ts#buildGraph",
"relation": "contains",
"confidence": "extracted"
},
{
- "source": "src/engine.ts",
- "target": "src/engine.ts#InitOptions",
+ "source": "src/graph/build.ts",
+ "target": "src/graph/build.ts#GraphBuildOptions",
"relation": "contains",
"confidence": "extracted"
},
{
- "source": "src/engine.ts",
- "target": "src/ai/crux.ts",
- "relation": "imports",
+ "source": "src/graph/build.ts",
+ "target": "src/graph/build.ts#GraphBuildResult",
+ "relation": "contains",
"confidence": "extracted"
},
{
- "source": "src/engine.ts",
- "target": "src/ai/llm/factory.ts",
- "relation": "imports",
+ "source": "src/graph/build.ts",
+ "target": "src/graph/build.ts#listSourceFiles",
+ "relation": "contains",
"confidence": "extracted"
},
{
- "source": "src/engine.ts",
- "target": "src/ai/llm/types.ts",
- "relation": "imports",
+ "source": "src/graph/build.ts",
+ "target": "src/graph/build.ts#readGoModules",
+ "relation": "contains",
"confidence": "extracted"
},
{
- "source": "src/engine.ts",
- "target": "src/ai/providers.ts",
+ "source": "src/graph/build.ts",
+ "target": "node:fs",
"relation": "imports",
"confidence": "extracted"
},
{
- "source": "src/engine.ts",
- "target": "src/ai/summarize.ts",
+ "source": "src/graph/build.ts",
+ "target": "node:path",
"relation": "imports",
"confidence": "extracted"
},
{
- "source": "src/engine.ts",
- "target": "src/ai/synthesize.ts",
+ "source": "src/graph/build.ts",
+ "target": "src/ai/crux.ts",
"relation": "imports",
"confidence": "extracted"
},
{
- "source": "src/engine.ts",
- "target": "src/ask/ask.ts",
+ "source": "src/graph/build.ts",
+ "target": "src/ask/index-file.ts",
"relation": "imports",
"confidence": "extracted"
},
{
- "source": "src/engine.ts",
- "target": "src/context/build.ts",
+ "source": "src/graph/build.ts",
+ "target": "src/context/node-file.ts",
"relation": "imports",
"confidence": "extracted"
},
{
- "source": "src/engine.ts",
- "target": "src/context/check.ts",
+ "source": "src/graph/build.ts",
+ "target": "src/graph/cards.ts",
"relation": "imports",
"confidence": "extracted"
},
{
- "source": "src/engine.ts",
- "target": "src/graph/build.ts",
+ "source": "src/graph/build.ts",
+ "target": "src/graph/enrich.ts",
"relation": "imports",
"confidence": "extracted"
},
{
- "source": "src/engine.ts",
- "target": "src/graph/check.ts",
+ "source": "src/graph/build.ts",
+ "target": "src/graph/extract.ts",
"relation": "imports",
"confidence": "extracted"
},
{
- "source": "src/engine.ts#Graft",
- "target": "src/engine.ts#Graft.ask",
- "relation": "contains",
+ "source": "src/graph/build.ts",
+ "target": "src/graph/resolve.ts",
+ "relation": "imports",
"confidence": "extracted"
},
{
- "source": "src/engine.ts#Graft",
- "target": "src/engine.ts#Graft.chatModel",
- "relation": "contains",
+ "source": "src/graph/build.ts",
+ "target": "src/graph/scopes.ts",
+ "relation": "imports",
"confidence": "extracted"
},
{
- "source": "src/engine.ts#Graft",
- "target": "src/engine.ts#Graft.check",
- "relation": "contains",
+ "source": "src/graph/build.ts",
+ "target": "src/graph/types.ts",
+ "relation": "imports",
"confidence": "extracted"
},
{
- "source": "src/engine.ts#Graft",
- "target": "src/engine.ts#Graft.checkGraph",
- "relation": "contains",
+ "source": "src/graph/build.ts",
+ "target": "src/graph/write.ts",
+ "relation": "imports",
"confidence": "extracted"
},
{
- "source": "src/engine.ts#Graft",
- "target": "src/engine.ts#Graft.constructor",
- "relation": "contains",
+ "source": "src/graph/build.ts",
+ "target": "src/ingest/fs.ts",
+ "relation": "imports",
"confidence": "extracted"
},
{
- "source": "src/engine.ts#Graft",
- "target": "src/engine.ts#Graft.cruxSummarizer",
- "relation": "contains",
- "confidence": "extracted"
+ "source": "src/graph/build.ts#applyMinSubstanceGuard",
+ "target": "src/graph/scopes.ts#scopeOf",
+ "relation": "calls",
+ "confidence": "inferred"
},
{
- "source": "src/engine.ts#Graft",
- "target": "src/engine.ts#Graft.graph",
- "relation": "contains",
- "confidence": "extracted"
+ "source": "src/graph/build.ts#buildGraph",
+ "target": "src/ask/index-file.ts#writeAskIndex",
+ "relation": "calls",
+ "confidence": "inferred"
},
{
- "source": "src/engine.ts#Graft",
- "target": "src/engine.ts#Graft.init",
- "relation": "contains",
- "confidence": "extracted"
+ "source": "src/graph/build.ts#buildGraph",
+ "target": "src/context/node-file.ts#contextDirFor",
+ "relation": "calls",
+ "confidence": "inferred"
},
{
- "source": "src/engine.ts#Graft",
- "target": "src/engine.ts#Graft.modelLabel",
- "relation": "contains",
+ "source": "src/graph/build.ts#buildGraph",
+ "target": "src/graph/build.ts#applyMinSubstanceGuard",
+ "relation": "calls",
"confidence": "extracted"
},
{
- "source": "src/engine.ts#Graft",
- "target": "src/engine.ts#Graft.summarizer",
- "relation": "contains",
+ "source": "src/graph/build.ts#buildGraph",
+ "target": "src/graph/build.ts#listSourceFiles",
+ "relation": "calls",
"confidence": "extracted"
},
{
- "source": "src/engine.ts#Graft",
- "target": "src/engine.ts#Graft.synthesizer",
- "relation": "contains",
+ "source": "src/graph/build.ts#buildGraph",
+ "target": "src/graph/build.ts#readGoModules",
+ "relation": "calls",
"confidence": "extracted"
},
{
- "source": "src/engine.ts#Graft.ask",
- "target": "src/ask/ask.ts#ask",
+ "source": "src/graph/build.ts#buildGraph",
+ "target": "src/graph/cards.ts#writeCards",
"relation": "calls",
"confidence": "inferred"
},
{
- "source": "src/engine.ts#Graft.chatModel",
- "target": "src/ai/llm/factory.ts#createChatModel",
+ "source": "src/graph/build.ts#buildGraph",
+ "target": "src/graph/cards.ts#writeCovers",
"relation": "calls",
"confidence": "inferred"
},
{
- "source": "src/engine.ts#Graft.check",
- "target": "src/context/check.ts#checkContext",
+ "source": "src/graph/build.ts#buildGraph",
+ "target": "src/graph/cards.ts#writeIndex",
"relation": "calls",
"confidence": "inferred"
},
{
- "source": "src/engine.ts#Graft.checkGraph",
- "target": "src/graph/check.ts#checkGraph",
+ "source": "src/graph/build.ts#buildGraph",
+ "target": "src/graph/enrich.ts#enrichGraph",
"relation": "calls",
"confidence": "inferred"
},
{
- "source": "src/engine.ts#Graft.constructor",
- "target": "src/ai/providers.ts#resolveConfig",
+ "source": "src/graph/build.ts#buildGraph",
+ "target": "src/graph/extract.ts#extractFile",
"relation": "calls",
"confidence": "inferred"
},
{
- "source": "src/engine.ts#Graft.cruxSummarizer",
- "target": "src/engine.ts#Graft.chatModel",
+ "source": "src/graph/build.ts#buildGraph",
+ "target": "src/graph/extract.ts#languageOf",
"relation": "calls",
- "confidence": "extracted"
+ "confidence": "inferred"
},
{
- "source": "src/engine.ts#Graft.graph",
- "target": "src/engine.ts#Graft.cruxSummarizer",
+ "source": "src/graph/build.ts#buildGraph",
+ "target": "src/graph/resolve.ts#resolveEdges",
"relation": "calls",
- "confidence": "extracted"
+ "confidence": "inferred"
},
{
- "source": "src/engine.ts#Graft.graph",
- "target": "src/graph/build.ts#buildGraph",
+ "source": "src/graph/build.ts#buildGraph",
+ "target": "src/graph/scopes.ts#discoverScopes",
"relation": "calls",
"confidence": "inferred"
},
{
- "source": "src/engine.ts#Graft.init",
- "target": "src/context/build.ts#buildContext",
+ "source": "src/graph/build.ts#buildGraph",
+ "target": "src/graph/write.ts#readGraph",
"relation": "calls",
"confidence": "inferred"
},
{
- "source": "src/engine.ts#Graft.init",
- "target": "src/engine.ts#Graft.modelLabel",
+ "source": "src/graph/build.ts#buildGraph",
+ "target": "src/graph/write.ts#wiringPath",
"relation": "calls",
- "confidence": "extracted"
+ "confidence": "inferred"
},
{
- "source": "src/engine.ts#Graft.init",
- "target": "src/engine.ts#Graft.summarizer",
+ "source": "src/graph/build.ts#buildGraph",
+ "target": "src/graph/write.ts#writeGraph",
"relation": "calls",
- "confidence": "extracted"
+ "confidence": "inferred"
},
{
- "source": "src/engine.ts#Graft.init",
- "target": "src/engine.ts#Graft.synthesizer",
+ "source": "src/graph/build.ts#listSourceFiles",
+ "target": "src/graph/extract.ts#languageOf",
"relation": "calls",
- "confidence": "extracted"
+ "confidence": "inferred"
},
{
- "source": "src/engine.ts#Graft.summarizer",
- "target": "src/engine.ts#Graft.chatModel",
+ "source": "src/graph/build.ts#listSourceFiles",
+ "target": "src/ingest/fs.ts#walkDir",
"relation": "calls",
- "confidence": "extracted"
+ "confidence": "inferred"
},
{
- "source": "src/engine.ts#Graft.synthesizer",
- "target": "src/engine.ts#Graft.chatModel",
+ "source": "src/graph/build.ts#readGoModules",
+ "target": "src/ingest/fs.ts#walkDir",
"relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/bindings.ts",
- "target": "src/graph/bindings.ts#callTypeName",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/bindings.ts",
- "target": "src/graph/bindings.ts#collectAliases",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/bindings.ts",
- "target": "src/graph/bindings.ts#collectBindings",
- "relation": "contains",
- "confidence": "extracted"
+ "confidence": "inferred"
},
{
- "source": "src/graph/bindings.ts",
- "target": "src/graph/bindings.ts#defName",
+ "source": "src/graph/cards.ts",
+ "target": "src/graph/cards.ts#CardFileInfo",
"relation": "contains",
"confidence": "extracted"
},
{
- "source": "src/graph/bindings.ts",
- "target": "src/graph/bindings.ts#FileBindings",
+ "source": "src/graph/cards.ts",
+ "target": "src/graph/cards.ts#cardPathFor",
"relation": "contains",
"confidence": "extracted"
},
{
- "source": "src/graph/bindings.ts",
- "target": "src/graph/bindings.ts#goReceiverTypeOf",
+ "source": "src/graph/cards.ts",
+ "target": "src/graph/cards.ts#CardStats",
"relation": "contains",
"confidence": "extracted"
},
{
- "source": "src/graph/bindings.ts",
- "target": "src/graph/bindings.ts#goReceiverVarOf",
+ "source": "src/graph/cards.ts",
+ "target": "src/graph/cards.ts#conceptsByPath",
"relation": "contains",
"confidence": "extracted"
},
{
- "source": "src/graph/bindings.ts",
- "target": "src/graph/bindings.ts#handleGo",
+ "source": "src/graph/cards.ts",
+ "target": "src/graph/cards.ts#CoverRef",
"relation": "contains",
"confidence": "extracted"
},
{
- "source": "src/graph/bindings.ts",
- "target": "src/graph/bindings.ts#handlePy",
+ "source": "src/graph/cards.ts",
+ "target": "src/graph/cards.ts#listExistingCards",
"relation": "contains",
"confidence": "extracted"
},
{
- "source": "src/graph/bindings.ts",
- "target": "src/graph/bindings.ts#handleTs",
+ "source": "src/graph/cards.ts",
+ "target": "src/graph/cards.ts#oneLiner",
"relation": "contains",
"confidence": "extracted"
},
{
- "source": "src/graph/bindings.ts",
- "target": "src/graph/bindings.ts#isClassNode",
+ "source": "src/graph/cards.ts",
+ "target": "src/graph/cards.ts#pruneEmptyDirs",
"relation": "contains",
"confidence": "extracted"
},
{
- "source": "src/graph/bindings.ts",
- "target": "src/graph/bindings.ts#pyTypeName",
+ "source": "src/graph/cards.ts",
+ "target": "src/graph/cards.ts#renderCard",
"relation": "contains",
"confidence": "extracted"
},
{
- "source": "src/graph/bindings.ts",
- "target": "src/graph/bindings.ts#resolveAlias",
+ "source": "src/graph/cards.ts",
+ "target": "src/graph/cards.ts#spanStart",
"relation": "contains",
"confidence": "extracted"
},
{
- "source": "src/graph/bindings.ts",
- "target": "src/graph/bindings.ts#resolveRecvType",
+ "source": "src/graph/cards.ts",
+ "target": "src/graph/cards.ts#writeCards",
"relation": "contains",
"confidence": "extracted"
},
{
- "source": "src/graph/bindings.ts",
- "target": "src/graph/bindings.ts#tsAnnotationTypeName",
+ "source": "src/graph/cards.ts",
+ "target": "src/graph/cards.ts#writeCovers",
"relation": "contains",
"confidence": "extracted"
},
{
- "source": "src/graph/bindings.ts",
- "target": "src/graph/bindings.ts#tsNewTypeName",
+ "source": "src/graph/cards.ts",
+ "target": "src/graph/cards.ts#writeIndex",
"relation": "contains",
"confidence": "extracted"
},
{
- "source": "src/graph/bindings.ts",
- "target": "src/graph/bindings.ts#visit",
- "relation": "contains",
+ "source": "src/graph/cards.ts",
+ "target": "gray-matter",
+ "relation": "imports",
"confidence": "extracted"
},
{
- "source": "src/graph/bindings.ts",
- "target": "src/graph/extract.ts",
+ "source": "src/graph/cards.ts",
+ "target": "node:fs",
"relation": "imports",
"confidence": "extracted"
},
{
- "source": "src/graph/bindings.ts",
- "target": "tree-sitter",
+ "source": "src/graph/cards.ts",
+ "target": "node:path",
"relation": "imports",
"confidence": "extracted"
},
{
- "source": "src/graph/bindings.ts#collectAliases",
- "target": "src/graph/bindings.ts#collectAliases",
- "relation": "calls",
+ "source": "src/graph/cards.ts",
+ "target": "src/context/node-file.ts",
+ "relation": "imports",
"confidence": "extracted"
},
{
- "source": "src/graph/bindings.ts#collectAliases",
- "target": "src/graph/bindings.ts#FileBindings.set",
- "relation": "calls",
+ "source": "src/graph/cards.ts",
+ "target": "src/graph/types.ts",
+ "relation": "imports",
"confidence": "extracted"
},
{
- "source": "src/graph/bindings.ts#collectBindings",
- "target": "src/graph/bindings.ts#collectAliases",
- "relation": "calls",
+ "source": "src/graph/cards.ts",
+ "target": "src/graph/write.ts",
+ "relation": "imports",
"confidence": "extracted"
},
{
- "source": "src/graph/bindings.ts#collectBindings",
- "target": "src/graph/bindings.ts#visit",
+ "source": "src/graph/cards.ts#conceptsByPath",
+ "target": "src/context/node-file.ts#readNodes",
"relation": "calls",
- "confidence": "extracted"
+ "confidence": "inferred"
},
{
- "source": "src/graph/bindings.ts#defName",
- "target": "src/graph/bindings.ts#goReceiverTypeOf",
+ "source": "src/graph/cards.ts#listExistingCards",
+ "target": "src/graph/cards.ts#listExistingCards.walk",
"relation": "calls",
"confidence": "extracted"
},
{
- "source": "src/graph/bindings.ts#FileBindings",
- "target": "src/graph/bindings.ts#FileBindings.lookup",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/bindings.ts#FileBindings",
- "target": "src/graph/bindings.ts#FileBindings.set",
+ "source": "src/graph/cards.ts#listExistingCards",
+ "target": "src/graph/cards.ts#listExistingCards.walk",
"relation": "contains",
"confidence": "extracted"
},
{
- "source": "src/graph/bindings.ts#handleGo",
- "target": "src/graph/bindings.ts#FileBindings.set",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/bindings.ts#handlePy",
- "target": "src/graph/bindings.ts#callTypeName",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/bindings.ts#handlePy",
- "target": "src/graph/bindings.ts#FileBindings.set",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/bindings.ts#handlePy",
- "target": "src/graph/bindings.ts#pyTypeName",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/bindings.ts#handleTs",
- "target": "src/graph/bindings.ts#FileBindings.set",
- "relation": "calls",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/bindings.ts#handleTs",
- "target": "src/graph/bindings.ts#tsAnnotationTypeName",
+ "source": "src/graph/cards.ts#listExistingCards.walk",
+ "target": "src/graph/cards.ts#listExistingCards.walk",
"relation": "calls",
"confidence": "extracted"
},
{
- "source": "src/graph/bindings.ts#handleTs",
- "target": "src/graph/bindings.ts#tsNewTypeName",
+ "source": "src/graph/cards.ts#pruneEmptyDirs",
+ "target": "src/graph/cards.ts#pruneEmptyDirs.visit",
"relation": "calls",
"confidence": "extracted"
},
{
- "source": "src/graph/bindings.ts#pyTypeName",
- "target": "src/graph/bindings.ts#resolveAlias",
- "relation": "calls",
+ "source": "src/graph/cards.ts#pruneEmptyDirs",
+ "target": "src/graph/cards.ts#pruneEmptyDirs.visit",
+ "relation": "contains",
"confidence": "extracted"
},
{
- "source": "src/graph/bindings.ts#resolveRecvType",
- "target": "src/graph/bindings.ts#FileBindings.lookup",
+ "source": "src/graph/cards.ts#pruneEmptyDirs.visit",
+ "target": "src/graph/cards.ts#pruneEmptyDirs.visit",
"relation": "calls",
"confidence": "extracted"
},
{
- "source": "src/graph/bindings.ts#tsAnnotationTypeName",
- "target": "src/graph/bindings.ts#resolveAlias",
+ "source": "src/graph/cards.ts#renderCard",
+ "target": "src/graph/cards.ts#oneLiner",
"relation": "calls",
"confidence": "extracted"
},
{
- "source": "src/graph/bindings.ts#visit",
- "target": "src/graph/bindings.ts#defName",
+ "source": "src/graph/cards.ts#renderCard",
+ "target": "src/graph/cards.ts#spanStart",
"relation": "calls",
"confidence": "extracted"
},
{
- "source": "src/graph/bindings.ts#visit",
- "target": "src/graph/bindings.ts#handleGo",
+ "source": "src/graph/cards.ts#writeCards",
+ "target": "src/graph/cards.ts#cardPathFor",
"relation": "calls",
"confidence": "extracted"
},
{
- "source": "src/graph/bindings.ts#visit",
- "target": "src/graph/bindings.ts#handlePy",
+ "source": "src/graph/cards.ts#writeCards",
+ "target": "src/graph/cards.ts#conceptsByPath",
"relation": "calls",
"confidence": "extracted"
},
{
- "source": "src/graph/bindings.ts#visit",
- "target": "src/graph/bindings.ts#handleTs",
+ "source": "src/graph/cards.ts#writeCards",
+ "target": "src/graph/cards.ts#listExistingCards",
"relation": "calls",
"confidence": "extracted"
},
{
- "source": "src/graph/bindings.ts#visit",
- "target": "src/graph/bindings.ts#isClassNode",
+ "source": "src/graph/cards.ts#writeCards",
+ "target": "src/graph/cards.ts#pruneEmptyDirs",
"relation": "calls",
"confidence": "extracted"
},
{
- "source": "src/graph/bindings.ts#visit",
- "target": "src/graph/bindings.ts#visit",
+ "source": "src/graph/cards.ts#writeCards",
+ "target": "src/graph/cards.ts#renderCard",
"relation": "calls",
"confidence": "extracted"
},
{
- "source": "src/graph/build.ts",
- "target": "src/graph/build.ts#applyMinSubstanceGuard",
- "relation": "contains",
+ "source": "src/graph/cards.ts#writeCovers",
+ "target": "src/graph/cards.ts#spanStart",
+ "relation": "calls",
"confidence": "extracted"
},
{
- "source": "src/graph/build.ts",
- "target": "src/graph/build.ts#buildGraph",
- "relation": "contains",
- "confidence": "extracted"
+ "source": "src/graph/cards.ts#writeIndex",
+ "target": "src/context/node-file.ts#readNodes",
+ "relation": "calls",
+ "confidence": "inferred"
},
{
- "source": "src/graph/build.ts",
- "target": "src/graph/build.ts#GraphBuildOptions",
+ "source": "src/graph/check.ts",
+ "target": "src/graph/check.ts#checkGraph",
"relation": "contains",
"confidence": "extracted"
},
{
- "source": "src/graph/build.ts",
- "target": "src/graph/build.ts#GraphBuildResult",
+ "source": "src/graph/check.ts",
+ "target": "src/graph/check.ts#formatGraphCheckReport",
"relation": "contains",
"confidence": "extracted"
},
{
- "source": "src/graph/build.ts",
- "target": "src/graph/build.ts#listSourceFiles",
+ "source": "src/graph/check.ts",
+ "target": "src/graph/check.ts#GraphCheckOptions",
"relation": "contains",
"confidence": "extracted"
},
{
- "source": "src/graph/build.ts",
- "target": "src/graph/build.ts#readGoModules",
+ "source": "src/graph/check.ts",
+ "target": "src/graph/check.ts#GraphCheckResult",
"relation": "contains",
"confidence": "extracted"
},
{
- "source": "src/graph/build.ts",
+ "source": "src/graph/check.ts",
"target": "node:fs",
"relation": "imports",
"confidence": "extracted"
},
{
- "source": "src/graph/build.ts",
+ "source": "src/graph/check.ts",
"target": "node:path",
"relation": "imports",
"confidence": "extracted"
},
{
- "source": "src/graph/build.ts",
- "target": "src/ai/crux.ts",
+ "source": "src/graph/check.ts",
+ "target": "src/context/node-file.ts",
"relation": "imports",
"confidence": "extracted"
},
{
- "source": "src/graph/build.ts",
- "target": "src/ask/index-file.ts",
+ "source": "src/graph/check.ts",
+ "target": "src/graph/build.ts",
"relation": "imports",
"confidence": "extracted"
},
{
- "source": "src/graph/build.ts",
- "target": "src/context/node-file.ts",
+ "source": "src/graph/check.ts",
+ "target": "src/graph/extract.ts",
"relation": "imports",
"confidence": "extracted"
},
{
- "source": "src/graph/build.ts",
- "target": "src/graph/cards.ts",
+ "source": "src/graph/check.ts",
+ "target": "src/graph/write.ts",
"relation": "imports",
"confidence": "extracted"
},
{
- "source": "src/graph/build.ts",
- "target": "src/graph/enrich.ts",
- "relation": "imports",
- "confidence": "extracted"
+ "source": "src/graph/check.ts#checkGraph",
+ "target": "src/context/node-file.ts#contextDirFor",
+ "relation": "calls",
+ "confidence": "inferred"
},
{
- "source": "src/graph/build.ts",
- "target": "src/graph/extract.ts",
- "relation": "imports",
- "confidence": "extracted"
+ "source": "src/graph/check.ts#checkGraph",
+ "target": "src/graph/build.ts#listSourceFiles",
+ "relation": "calls",
+ "confidence": "inferred"
},
{
- "source": "src/graph/build.ts",
- "target": "src/graph/resolve.ts",
- "relation": "imports",
- "confidence": "extracted"
+ "source": "src/graph/check.ts#checkGraph",
+ "target": "src/graph/extract.ts#extractFile",
+ "relation": "calls",
+ "confidence": "inferred"
},
{
- "source": "src/graph/build.ts",
- "target": "src/graph/scopes.ts",
- "relation": "imports",
+ "source": "src/graph/check.ts#checkGraph",
+ "target": "src/graph/extract.ts#languageOf",
+ "relation": "calls",
+ "confidence": "inferred"
+ },
+ {
+ "source": "src/graph/check.ts#checkGraph",
+ "target": "src/graph/write.ts#readGraph",
+ "relation": "calls",
+ "confidence": "inferred"
+ },
+ {
+ "source": "src/graph/check.ts#checkGraph",
+ "target": "src/graph/write.ts#wiringPath",
+ "relation": "calls",
+ "confidence": "inferred"
+ },
+ {
+ "source": "src/graph/enrich.ts",
+ "target": "src/graph/enrich.ts#buildCrux",
+ "relation": "contains",
"confidence": "extracted"
},
{
- "source": "src/graph/build.ts",
- "target": "src/graph/types.ts",
- "relation": "imports",
+ "source": "src/graph/enrich.ts",
+ "target": "src/graph/enrich.ts#collectFileCrux",
+ "relation": "contains",
"confidence": "extracted"
},
{
- "source": "src/graph/build.ts",
- "target": "src/graph/write.ts",
- "relation": "imports",
+ "source": "src/graph/enrich.ts",
+ "target": "src/graph/enrich.ts#enrichGraph",
+ "relation": "contains",
"confidence": "extracted"
},
{
- "source": "src/graph/build.ts",
- "target": "src/ingest/fs.ts",
- "relation": "imports",
+ "source": "src/graph/enrich.ts",
+ "target": "src/graph/enrich.ts#EnrichOptions",
+ "relation": "contains",
"confidence": "extracted"
},
{
- "source": "src/graph/build.ts#applyMinSubstanceGuard",
- "target": "src/graph/scopes.ts#scopeOf",
- "relation": "calls",
- "confidence": "inferred"
+ "source": "src/graph/enrich.ts",
+ "target": "src/graph/enrich.ts#EnrichStats",
+ "relation": "contains",
+ "confidence": "extracted"
},
{
- "source": "src/graph/build.ts#buildGraph",
- "target": "src/ask/index-file.ts#writeAskIndex",
- "relation": "calls",
- "confidence": "inferred"
+ "source": "src/graph/enrich.ts",
+ "target": "src/graph/enrich.ts#mapWithConcurrency",
+ "relation": "contains",
+ "confidence": "extracted"
},
{
- "source": "src/graph/build.ts#buildGraph",
- "target": "src/context/node-file.ts#contextDirFor",
- "relation": "calls",
- "confidence": "inferred"
+ "source": "src/graph/enrich.ts",
+ "target": "src/graph/enrich.ts#spanLines",
+ "relation": "contains",
+ "confidence": "extracted"
},
{
- "source": "src/graph/build.ts#buildGraph",
- "target": "src/graph/build.ts#applyMinSubstanceGuard",
- "relation": "calls",
+ "source": "src/graph/enrich.ts",
+ "target": "src/ai/crux.ts",
+ "relation": "imports",
"confidence": "extracted"
},
{
- "source": "src/graph/build.ts#buildGraph",
- "target": "src/graph/build.ts#listSourceFiles",
- "relation": "calls",
+ "source": "src/graph/enrich.ts",
+ "target": "src/graph/types.ts",
+ "relation": "imports",
"confidence": "extracted"
},
{
- "source": "src/graph/build.ts#buildGraph",
- "target": "src/graph/build.ts#readGoModules",
+ "source": "src/graph/enrich.ts#buildCrux",
+ "target": "src/graph/enrich.ts#spanLines",
"relation": "calls",
"confidence": "extracted"
},
{
- "source": "src/graph/build.ts#buildGraph",
- "target": "src/graph/cards.ts#writeCards",
+ "source": "src/graph/enrich.ts#collectFileCrux",
+ "target": "src/ai/crux.ts#ChatCruxSummarizer.describeFile",
"relation": "calls",
"confidence": "inferred"
},
{
- "source": "src/graph/build.ts#buildGraph",
- "target": "src/graph/cards.ts#writeCovers",
+ "source": "src/graph/enrich.ts#enrichGraph",
+ "target": "src/graph/enrich.ts#buildCrux",
"relation": "calls",
- "confidence": "inferred"
+ "confidence": "extracted"
},
{
- "source": "src/graph/build.ts#buildGraph",
- "target": "src/graph/cards.ts#writeIndex",
+ "source": "src/graph/enrich.ts#enrichGraph",
+ "target": "src/graph/enrich.ts#collectFileCrux",
"relation": "calls",
- "confidence": "inferred"
+ "confidence": "extracted"
},
{
- "source": "src/graph/build.ts#buildGraph",
- "target": "src/graph/enrich.ts#enrichGraph",
+ "source": "src/graph/enrich.ts#enrichGraph",
+ "target": "src/graph/enrich.ts#mapWithConcurrency",
"relation": "calls",
- "confidence": "inferred"
+ "confidence": "extracted"
},
{
- "source": "src/graph/build.ts#buildGraph",
- "target": "src/graph/extract.ts#extractFile",
+ "source": "src/graph/enrich.ts#enrichGraph",
+ "target": "src/graph/enrich.ts#spanLines",
"relation": "calls",
- "confidence": "inferred"
+ "confidence": "extracted"
},
{
- "source": "src/graph/build.ts#buildGraph",
- "target": "src/graph/extract.ts#languageOf",
- "relation": "calls",
- "confidence": "inferred"
+ "source": "src/graph/extract.ts",
+ "target": "src/graph/extract.ts#calleeName",
+ "relation": "contains",
+ "confidence": "extracted"
},
{
- "source": "src/graph/build.ts#buildGraph",
- "target": "src/graph/resolve.ts#resolveEdges",
- "relation": "calls",
- "confidence": "inferred"
+ "source": "src/graph/extract.ts",
+ "target": "src/graph/extract.ts#clean",
+ "relation": "contains",
+ "confidence": "extracted"
},
{
- "source": "src/graph/build.ts#buildGraph",
- "target": "src/graph/scopes.ts#discoverScopes",
- "relation": "calls",
- "confidence": "inferred"
+ "source": "src/graph/extract.ts",
+ "target": "src/graph/extract.ts#DefDescriptor",
+ "relation": "contains",
+ "confidence": "extracted"
},
{
- "source": "src/graph/build.ts#buildGraph",
- "target": "src/graph/write.ts#readGraph",
- "relation": "calls",
- "confidence": "inferred"
+ "source": "src/graph/extract.ts",
+ "target": "src/graph/extract.ts#describe",
+ "relation": "contains",
+ "confidence": "extracted"
},
{
- "source": "src/graph/build.ts#buildGraph",
- "target": "src/graph/write.ts#wiringPath",
- "relation": "calls",
- "confidence": "inferred"
+ "source": "src/graph/extract.ts",
+ "target": "src/graph/extract.ts#describeGo",
+ "relation": "contains",
+ "confidence": "extracted"
},
{
- "source": "src/graph/build.ts#buildGraph",
- "target": "src/graph/write.ts#writeGraph",
- "relation": "calls",
- "confidence": "inferred"
+ "source": "src/graph/extract.ts",
+ "target": "src/graph/extract.ts#extractFile",
+ "relation": "contains",
+ "confidence": "extracted"
+ },
+ {
+ "source": "src/graph/extract.ts",
+ "target": "src/graph/extract.ts#ExtractResult",
+ "relation": "contains",
+ "confidence": "extracted"
},
{
- "source": "src/graph/build.ts#listSourceFiles",
- "target": "src/graph/extract.ts#languageOf",
- "relation": "calls",
- "confidence": "inferred"
+ "source": "src/graph/extract.ts",
+ "target": "src/graph/extract.ts#fileResidual",
+ "relation": "contains",
+ "confidence": "extracted"
},
{
- "source": "src/graph/build.ts#listSourceFiles",
- "target": "src/ingest/fs.ts#walkDir",
- "relation": "calls",
- "confidence": "inferred"
+ "source": "src/graph/extract.ts",
+ "target": "src/graph/extract.ts#goExported",
+ "relation": "contains",
+ "confidence": "extracted"
},
{
- "source": "src/graph/build.ts#readGoModules",
- "target": "src/ingest/fs.ts#walkDir",
- "relation": "calls",
- "confidence": "inferred"
+ "source": "src/graph/extract.ts",
+ "target": "src/graph/extract.ts#goReceiverType",
+ "relation": "contains",
+ "confidence": "extracted"
},
{
- "source": "src/graph/cards.ts",
- "target": "src/graph/cards.ts#CardFileInfo",
+ "source": "src/graph/extract.ts",
+ "target": "src/graph/extract.ts#heritageEdges",
"relation": "contains",
"confidence": "extracted"
},
{
- "source": "src/graph/cards.ts",
- "target": "src/graph/cards.ts#cardPathFor",
+ "source": "src/graph/extract.ts",
+ "target": "src/graph/extract.ts#importSpecifier",
"relation": "contains",
"confidence": "extracted"
},
{
- "source": "src/graph/cards.ts",
- "target": "src/graph/cards.ts#CardStats",
+ "source": "src/graph/extract.ts",
+ "target": "src/graph/extract.ts#isImport",
"relation": "contains",
"confidence": "extracted"
},
{
- "source": "src/graph/cards.ts",
- "target": "src/graph/cards.ts#conceptsByPath",
+ "source": "src/graph/extract.ts",
+ "target": "src/graph/extract.ts#Language",
"relation": "contains",
"confidence": "extracted"
},
{
- "source": "src/graph/cards.ts",
- "target": "src/graph/cards.ts#CoverRef",
+ "source": "src/graph/extract.ts",
+ "target": "src/graph/extract.ts#languageOf",
"relation": "contains",
"confidence": "extracted"
},
{
- "source": "src/graph/cards.ts",
- "target": "src/graph/cards.ts#listExistingCards",
+ "source": "src/graph/extract.ts",
+ "target": "src/graph/extract.ts#parseSource",
"relation": "contains",
"confidence": "extracted"
},
{
- "source": "src/graph/cards.ts",
- "target": "src/graph/cards.ts#oneLiner",
+ "source": "src/graph/extract.ts",
+ "target": "src/graph/extract.ts#pyReceiver",
"relation": "contains",
"confidence": "extracted"
},
{
- "source": "src/graph/cards.ts",
- "target": "src/graph/cards.ts#pruneEmptyDirs",
+ "source": "src/graph/extract.ts",
+ "target": "src/graph/extract.ts#RawEdge",
"relation": "contains",
"confidence": "extracted"
},
{
- "source": "src/graph/cards.ts",
- "target": "src/graph/cards.ts#renderCard",
+ "source": "src/graph/extract.ts",
+ "target": "src/graph/extract.ts#searchBody",
"relation": "contains",
"confidence": "extracted"
},
{
- "source": "src/graph/cards.ts",
- "target": "src/graph/cards.ts#spanStart",
+ "source": "src/graph/extract.ts",
+ "target": "src/graph/extract.ts#tsExported",
"relation": "contains",
"confidence": "extracted"
},
{
- "source": "src/graph/cards.ts",
- "target": "src/graph/cards.ts#writeCards",
+ "source": "src/graph/extract.ts",
+ "target": "src/graph/extract.ts#tsReceiver",
"relation": "contains",
"confidence": "extracted"
},
{
- "source": "src/graph/cards.ts",
- "target": "src/graph/cards.ts#writeCovers",
+ "source": "src/graph/extract.ts",
+ "target": "src/graph/extract.ts#walk",
"relation": "contains",
"confidence": "extracted"
},
{
- "source": "src/graph/cards.ts",
- "target": "src/graph/cards.ts#writeIndex",
+ "source": "src/graph/extract.ts",
+ "target": "src/graph/extract.ts#WalkCtx",
"relation": "contains",
"confidence": "extracted"
},
{
- "source": "src/graph/cards.ts",
- "target": "gray-matter",
+ "source": "src/graph/extract.ts",
+ "target": "node:path",
"relation": "imports",
"confidence": "extracted"
},
{
- "source": "src/graph/cards.ts",
- "target": "node:fs",
+ "source": "src/graph/extract.ts",
+ "target": "src/graph/bindings.ts",
"relation": "imports",
"confidence": "extracted"
},
{
- "source": "src/graph/cards.ts",
- "target": "node:path",
+ "source": "src/graph/extract.ts",
+ "target": "src/graph/types.ts",
"relation": "imports",
"confidence": "extracted"
},
{
- "source": "src/graph/cards.ts",
- "target": "src/context/node-file.ts",
+ "source": "src/graph/extract.ts",
+ "target": "src/util/id.ts",
"relation": "imports",
"confidence": "extracted"
},
{
- "source": "src/graph/cards.ts",
- "target": "src/graph/types.ts",
+ "source": "src/graph/extract.ts",
+ "target": "tree-sitter",
"relation": "imports",
"confidence": "extracted"
},
{
- "source": "src/graph/cards.ts",
- "target": "src/graph/write.ts",
+ "source": "src/graph/extract.ts",
+ "target": "tree-sitter-go",
"relation": "imports",
"confidence": "extracted"
},
{
- "source": "src/graph/cards.ts#conceptsByPath",
- "target": "src/context/node-file.ts#readNodes",
+ "source": "src/graph/extract.ts",
+ "target": "tree-sitter-python",
+ "relation": "imports",
+ "confidence": "extracted"
+ },
+ {
+ "source": "src/graph/extract.ts",
+ "target": "tree-sitter-typescript",
+ "relation": "imports",
+ "confidence": "extracted"
+ },
+ {
+ "source": "src/graph/extract.ts#calleeName",
+ "target": "src/graph/extract.ts#pyReceiver",
+ "relation": "calls",
+ "confidence": "extracted"
+ },
+ {
+ "source": "src/graph/extract.ts#calleeName",
+ "target": "src/graph/extract.ts#tsReceiver",
+ "relation": "calls",
+ "confidence": "extracted"
+ },
+ {
+ "source": "src/graph/extract.ts#describe",
+ "target": "src/graph/extract.ts#describeGo",
+ "relation": "calls",
+ "confidence": "extracted"
+ },
+ {
+ "source": "src/graph/extract.ts#describeGo",
+ "target": "src/graph/extract.ts#goReceiverType",
+ "relation": "calls",
+ "confidence": "extracted"
+ },
+ {
+ "source": "src/graph/extract.ts#extractFile",
+ "target": "src/graph/bindings.ts#collectBindings",
"relation": "calls",
"confidence": "inferred"
},
{
- "source": "src/graph/cards.ts#listExistingCards",
- "target": "src/graph/cards.ts#listExistingCards.walk",
+ "source": "src/graph/extract.ts#extractFile",
+ "target": "src/graph/extract.ts#fileResidual",
"relation": "calls",
"confidence": "extracted"
},
{
- "source": "src/graph/cards.ts#listExistingCards",
- "target": "src/graph/cards.ts#listExistingCards.walk",
- "relation": "contains",
+ "source": "src/graph/extract.ts#extractFile",
+ "target": "src/graph/extract.ts#parseSource",
+ "relation": "calls",
"confidence": "extracted"
},
{
- "source": "src/graph/cards.ts#listExistingCards.walk",
- "target": "src/graph/cards.ts#listExistingCards.walk",
+ "source": "src/graph/extract.ts#extractFile",
+ "target": "src/graph/extract.ts#walk",
"relation": "calls",
"confidence": "extracted"
},
{
- "source": "src/graph/cards.ts#pruneEmptyDirs",
- "target": "src/graph/cards.ts#pruneEmptyDirs.visit",
+ "source": "src/graph/extract.ts#extractFile",
+ "target": "src/util/id.ts#contentHash",
+ "relation": "calls",
+ "confidence": "inferred"
+ },
+ {
+ "source": "src/graph/extract.ts#fileResidual",
+ "target": "src/graph/extract.ts#searchBody",
"relation": "calls",
"confidence": "extracted"
},
{
- "source": "src/graph/cards.ts#pruneEmptyDirs",
- "target": "src/graph/cards.ts#pruneEmptyDirs.visit",
- "relation": "contains",
+ "source": "src/graph/extract.ts#walk",
+ "target": "src/graph/bindings.ts#goReceiverVarOf",
+ "relation": "calls",
+ "confidence": "inferred"
+ },
+ {
+ "source": "src/graph/extract.ts#walk",
+ "target": "src/graph/bindings.ts#resolveRecvType",
+ "relation": "calls",
+ "confidence": "inferred"
+ },
+ {
+ "source": "src/graph/extract.ts#walk",
+ "target": "src/graph/extract.ts#calleeName",
+ "relation": "calls",
"confidence": "extracted"
},
{
- "source": "src/graph/cards.ts#pruneEmptyDirs.visit",
- "target": "src/graph/cards.ts#pruneEmptyDirs.visit",
+ "source": "src/graph/extract.ts#walk",
+ "target": "src/graph/extract.ts#clean",
"relation": "calls",
"confidence": "extracted"
},
{
- "source": "src/graph/cards.ts#renderCard",
- "target": "src/graph/cards.ts#oneLiner",
+ "source": "src/graph/extract.ts#walk",
+ "target": "src/graph/extract.ts#describe",
"relation": "calls",
"confidence": "extracted"
},
{
- "source": "src/graph/cards.ts#renderCard",
- "target": "src/graph/cards.ts#spanStart",
+ "source": "src/graph/extract.ts#walk",
+ "target": "src/graph/extract.ts#goExported",
"relation": "calls",
"confidence": "extracted"
},
{
- "source": "src/graph/cards.ts#writeCards",
- "target": "src/graph/cards.ts#cardPathFor",
+ "source": "src/graph/extract.ts#walk",
+ "target": "src/graph/extract.ts#goReceiverType",
"relation": "calls",
"confidence": "extracted"
},
{
- "source": "src/graph/cards.ts#writeCards",
- "target": "src/graph/cards.ts#conceptsByPath",
+ "source": "src/graph/extract.ts#walk",
+ "target": "src/graph/extract.ts#heritageEdges",
"relation": "calls",
"confidence": "extracted"
},
{
- "source": "src/graph/cards.ts#writeCards",
- "target": "src/graph/cards.ts#listExistingCards",
+ "source": "src/graph/extract.ts#walk",
+ "target": "src/graph/extract.ts#importSpecifier",
"relation": "calls",
"confidence": "extracted"
},
{
- "source": "src/graph/cards.ts#writeCards",
- "target": "src/graph/cards.ts#pruneEmptyDirs",
+ "source": "src/graph/extract.ts#walk",
+ "target": "src/graph/extract.ts#isImport",
"relation": "calls",
"confidence": "extracted"
},
{
- "source": "src/graph/cards.ts#writeCards",
- "target": "src/graph/cards.ts#renderCard",
+ "source": "src/graph/extract.ts#walk",
+ "target": "src/graph/extract.ts#searchBody",
"relation": "calls",
"confidence": "extracted"
},
{
- "source": "src/graph/cards.ts#writeCovers",
- "target": "src/graph/cards.ts#spanStart",
+ "source": "src/graph/extract.ts#walk",
+ "target": "src/graph/extract.ts#tsExported",
"relation": "calls",
"confidence": "extracted"
},
{
- "source": "src/graph/cards.ts#writeIndex",
- "target": "src/context/node-file.ts#readNodes",
+ "source": "src/graph/extract.ts#walk",
+ "target": "src/graph/extract.ts#walk",
+ "relation": "calls",
+ "confidence": "extracted"
+ },
+ {
+ "source": "src/graph/extract.ts#walk",
+ "target": "src/util/id.ts#contentHash",
"relation": "calls",
"confidence": "inferred"
},
{
- "source": "src/graph/check.ts",
- "target": "src/graph/check.ts#checkGraph",
+ "source": "src/graph/load.ts",
+ "target": "src/graph/load.ts#__resetParseCounts",
"relation": "contains",
"confidence": "extracted"
},
{
- "source": "src/graph/check.ts",
- "target": "src/graph/check.ts#formatGraphCheckReport",
+ "source": "src/graph/load.ts",
+ "target": "src/graph/load.ts#CacheEntry",
"relation": "contains",
"confidence": "extracted"
},
{
- "source": "src/graph/check.ts",
- "target": "src/graph/check.ts#GraphCheckOptions",
+ "source": "src/graph/load.ts",
+ "target": "src/graph/load.ts#loadAskIndexCached",
"relation": "contains",
"confidence": "extracted"
},
{
- "source": "src/graph/check.ts",
- "target": "src/graph/check.ts#GraphCheckResult",
+ "source": "src/graph/load.ts",
+ "target": "src/graph/load.ts#loadCached",
"relation": "contains",
"confidence": "extracted"
},
{
- "source": "src/graph/check.ts",
- "target": "node:fs",
- "relation": "imports",
+ "source": "src/graph/load.ts",
+ "target": "src/graph/load.ts#loadGraphCached",
+ "relation": "contains",
"confidence": "extracted"
},
{
- "source": "src/graph/check.ts",
- "target": "node:path",
- "relation": "imports",
+ "source": "src/graph/load.ts",
+ "target": "src/graph/load.ts#statOf",
+ "relation": "contains",
"confidence": "extracted"
},
{
- "source": "src/graph/check.ts",
- "target": "src/context/node-file.ts",
+ "source": "src/graph/load.ts",
+ "target": "node:fs",
"relation": "imports",
"confidence": "extracted"
},
{
- "source": "src/graph/check.ts",
- "target": "src/graph/build.ts",
+ "source": "src/graph/load.ts",
+ "target": "src/ask/index-file.ts",
"relation": "imports",
"confidence": "extracted"
},
{
- "source": "src/graph/check.ts",
- "target": "src/graph/extract.ts",
+ "source": "src/graph/load.ts",
+ "target": "src/graph/types.ts",
"relation": "imports",
"confidence": "extracted"
},
{
- "source": "src/graph/check.ts",
+ "source": "src/graph/load.ts",
"target": "src/graph/write.ts",
"relation": "imports",
"confidence": "extracted"
},
{
- "source": "src/graph/check.ts#checkGraph",
- "target": "src/context/node-file.ts#contextDirFor",
+ "source": "src/graph/load.ts#loadAskIndexCached",
+ "target": "src/ask/index-file.ts#askIndexPath",
"relation": "calls",
"confidence": "inferred"
},
{
- "source": "src/graph/check.ts#checkGraph",
- "target": "src/graph/build.ts#listSourceFiles",
+ "source": "src/graph/load.ts#loadAskIndexCached",
+ "target": "src/ask/index-file.ts#readAskIndex",
"relation": "calls",
"confidence": "inferred"
},
{
- "source": "src/graph/check.ts#checkGraph",
- "target": "src/graph/extract.ts#extractFile",
+ "source": "src/graph/load.ts#loadAskIndexCached",
+ "target": "src/graph/load.ts#loadCached",
+ "relation": "calls",
+ "confidence": "extracted"
+ },
+ {
+ "source": "src/graph/load.ts#loadCached",
+ "target": "src/ai/llm/openai.ts#OpenAIChatModel.fromResponse.parse",
"relation": "calls",
"confidence": "inferred"
},
{
- "source": "src/graph/check.ts#checkGraph",
- "target": "src/graph/extract.ts#languageOf",
+ "source": "src/graph/load.ts#loadCached",
+ "target": "src/graph/bindings.ts#FileBindings.set",
"relation": "calls",
"confidence": "inferred"
},
{
- "source": "src/graph/check.ts#checkGraph",
+ "source": "src/graph/load.ts#loadCached",
+ "target": "src/graph/load.ts#statOf",
+ "relation": "calls",
+ "confidence": "extracted"
+ },
+ {
+ "source": "src/graph/load.ts#loadGraphCached",
+ "target": "src/graph/load.ts#loadCached",
+ "relation": "calls",
+ "confidence": "extracted"
+ },
+ {
+ "source": "src/graph/load.ts#loadGraphCached",
"target": "src/graph/write.ts#readGraph",
"relation": "calls",
"confidence": "inferred"
},
{
- "source": "src/graph/check.ts#checkGraph",
+ "source": "src/graph/load.ts#loadGraphCached",
"target": "src/graph/write.ts#wiringPath",
"relation": "calls",
"confidence": "inferred"
},
{
- "source": "src/graph/enrich.ts",
- "target": "src/graph/enrich.ts#buildCrux",
+ "source": "src/graph/map.ts",
+ "target": "src/graph/map.ts#basenameOf",
"relation": "contains",
"confidence": "extracted"
},
{
- "source": "src/graph/enrich.ts",
- "target": "src/graph/enrich.ts#collectFileCrux",
+ "source": "src/graph/map.ts",
+ "target": "src/graph/map.ts#buildRepoMap",
"relation": "contains",
"confidence": "extracted"
},
{
- "source": "src/graph/enrich.ts",
- "target": "src/graph/enrich.ts#enrichGraph",
+ "source": "src/graph/map.ts",
+ "target": "src/graph/map.ts#BuildRepoMapOptions",
"relation": "contains",
"confidence": "extracted"
},
{
- "source": "src/graph/enrich.ts",
- "target": "src/graph/enrich.ts#EnrichOptions",
+ "source": "src/graph/map.ts",
+ "target": "src/graph/map.ts#computeDirEntries",
"relation": "contains",
"confidence": "extracted"
},
{
- "source": "src/graph/enrich.ts",
- "target": "src/graph/enrich.ts#EnrichStats",
+ "source": "src/graph/map.ts",
+ "target": "src/graph/map.ts#computeInDegree",
"relation": "contains",
"confidence": "extracted"
},
{
- "source": "src/graph/enrich.ts",
- "target": "src/graph/enrich.ts#mapWithConcurrency",
+ "source": "src/graph/map.ts",
+ "target": "src/graph/map.ts#DirEntry",
"relation": "contains",
"confidence": "extracted"
},
{
- "source": "src/graph/enrich.ts",
- "target": "src/graph/enrich.ts#spanLines",
+ "source": "src/graph/map.ts",
+ "target": "src/graph/map.ts#dirKey",
"relation": "contains",
"confidence": "extracted"
},
{
- "source": "src/graph/enrich.ts",
- "target": "src/ai/crux.ts",
- "relation": "imports",
+ "source": "src/graph/map.ts",
+ "target": "src/graph/map.ts#droppedNote",
+ "relation": "contains",
"confidence": "extracted"
},
{
- "source": "src/graph/enrich.ts",
- "target": "src/graph/types.ts",
- "relation": "imports",
+ "source": "src/graph/map.ts",
+ "target": "src/graph/map.ts#formatDirHub",
+ "relation": "contains",
"confidence": "extracted"
},
{
- "source": "src/graph/enrich.ts#buildCrux",
- "target": "src/graph/enrich.ts#spanLines",
- "relation": "calls",
+ "source": "src/graph/map.ts",
+ "target": "src/graph/map.ts#formatDirLine",
+ "relation": "contains",
"confidence": "extracted"
},
{
- "source": "src/graph/enrich.ts#collectFileCrux",
- "target": "src/ai/crux.ts#ChatCruxSummarizer.describeFile",
- "relation": "calls",
- "confidence": "inferred"
- },
- {
- "source": "src/graph/enrich.ts#enrichGraph",
- "target": "src/graph/enrich.ts#buildCrux",
- "relation": "calls",
+ "source": "src/graph/map.ts",
+ "target": "src/graph/map.ts#formatHotspot",
+ "relation": "contains",
"confidence": "extracted"
},
{
- "source": "src/graph/enrich.ts#enrichGraph",
- "target": "src/graph/enrich.ts#collectFileCrux",
- "relation": "calls",
+ "source": "src/graph/map.ts",
+ "target": "src/graph/map.ts#formatRepoMap",
+ "relation": "contains",
"confidence": "extracted"
},
{
- "source": "src/graph/enrich.ts#enrichGraph",
- "target": "src/graph/enrich.ts#mapWithConcurrency",
- "relation": "calls",
+ "source": "src/graph/map.ts",
+ "target": "src/graph/map.ts#Hub",
+ "relation": "contains",
"confidence": "extracted"
},
{
- "source": "src/graph/enrich.ts#enrichGraph",
- "target": "src/graph/enrich.ts#spanLines",
- "relation": "calls",
+ "source": "src/graph/map.ts",
+ "target": "src/graph/map.ts#RepoMap",
+ "relation": "contains",
"confidence": "extracted"
},
{
- "source": "src/graph/extract.ts",
- "target": "src/graph/extract.ts#calleeName",
+ "source": "src/graph/map.ts",
+ "target": "src/graph/map.ts#ScopeGroup",
"relation": "contains",
"confidence": "extracted"
},
{
- "source": "src/graph/extract.ts",
- "target": "src/graph/extract.ts#clean",
+ "source": "src/graph/map.ts",
+ "target": "src/graph/map.ts#sortedLanguages",
"relation": "contains",
"confidence": "extracted"
},
{
- "source": "src/graph/extract.ts",
- "target": "src/graph/extract.ts#DefDescriptor",
+ "source": "src/graph/map.ts",
+ "target": "src/graph/map.ts#topHubs",
"relation": "contains",
"confidence": "extracted"
},
{
- "source": "src/graph/extract.ts",
- "target": "src/graph/extract.ts#describe",
- "relation": "contains",
+ "source": "src/graph/map.ts",
+ "target": "src/context/savings.ts",
+ "relation": "imports",
"confidence": "extracted"
},
{
- "source": "src/graph/extract.ts",
- "target": "src/graph/extract.ts#describeGo",
- "relation": "contains",
+ "source": "src/graph/map.ts",
+ "target": "src/graph/extract.ts",
+ "relation": "imports",
"confidence": "extracted"
},
{
- "source": "src/graph/extract.ts",
- "target": "src/graph/extract.ts#extractFile",
- "relation": "contains",
+ "source": "src/graph/map.ts",
+ "target": "src/graph/relations.ts",
+ "relation": "imports",
"confidence": "extracted"
},
{
- "source": "src/graph/extract.ts",
- "target": "src/graph/extract.ts#ExtractResult",
- "relation": "contains",
+ "source": "src/graph/map.ts",
+ "target": "src/graph/scopes.ts",
+ "relation": "imports",
"confidence": "extracted"
},
{
- "source": "src/graph/extract.ts",
- "target": "src/graph/extract.ts#fileResidual",
- "relation": "contains",
+ "source": "src/graph/map.ts",
+ "target": "src/graph/types.ts",
+ "relation": "imports",
"confidence": "extracted"
},
{
- "source": "src/graph/extract.ts",
- "target": "src/graph/extract.ts#goExported",
- "relation": "contains",
- "confidence": "extracted"
+ "source": "src/graph/map.ts#buildRepoMap",
+ "target": "src/context/savings.ts#savingsFor",
+ "relation": "calls",
+ "confidence": "inferred"
},
{
- "source": "src/graph/extract.ts",
- "target": "src/graph/extract.ts#goReceiverType",
- "relation": "contains",
+ "source": "src/graph/map.ts#buildRepoMap",
+ "target": "src/graph/map.ts#computeDirEntries",
+ "relation": "calls",
"confidence": "extracted"
},
{
- "source": "src/graph/extract.ts",
- "target": "src/graph/extract.ts#heritageEdges",
- "relation": "contains",
+ "source": "src/graph/map.ts#buildRepoMap",
+ "target": "src/graph/map.ts#computeInDegree",
+ "relation": "calls",
"confidence": "extracted"
},
{
- "source": "src/graph/extract.ts",
- "target": "src/graph/extract.ts#importSpecifier",
- "relation": "contains",
+ "source": "src/graph/map.ts#buildRepoMap",
+ "target": "src/graph/map.ts#sortedLanguages",
+ "relation": "calls",
"confidence": "extracted"
},
{
- "source": "src/graph/extract.ts",
- "target": "src/graph/extract.ts#isImport",
- "relation": "contains",
+ "source": "src/graph/map.ts#buildRepoMap",
+ "target": "src/graph/map.ts#topHubs",
+ "relation": "calls",
"confidence": "extracted"
},
{
- "source": "src/graph/extract.ts",
- "target": "src/graph/extract.ts#Language",
- "relation": "contains",
- "confidence": "extracted"
+ "source": "src/graph/map.ts#buildRepoMap",
+ "target": "src/graph/scopes.ts#scopeLabel",
+ "relation": "calls",
+ "confidence": "inferred"
},
{
- "source": "src/graph/extract.ts",
- "target": "src/graph/extract.ts#languageOf",
- "relation": "contains",
+ "source": "src/graph/map.ts#buildRepoMap",
+ "target": "src/graph/scopes.ts#scopeOf",
+ "relation": "calls",
+ "confidence": "inferred"
+ },
+ {
+ "source": "src/graph/map.ts#buildRepoMap",
+ "target": "src/graph/scopes.ts#scopesOfGraph",
+ "relation": "calls",
+ "confidence": "inferred"
+ },
+ {
+ "source": "src/graph/map.ts#computeDirEntries",
+ "target": "src/graph/map.ts#computeDirEntries.depthFor",
+ "relation": "calls",
"confidence": "extracted"
},
{
- "source": "src/graph/extract.ts",
- "target": "src/graph/extract.ts#parseSource",
- "relation": "contains",
+ "source": "src/graph/map.ts#computeDirEntries",
+ "target": "src/graph/map.ts#computeDirEntries.fullPath",
+ "relation": "calls",
"confidence": "extracted"
},
{
- "source": "src/graph/extract.ts",
- "target": "src/graph/extract.ts#pyReceiver",
- "relation": "contains",
+ "source": "src/graph/map.ts#computeDirEntries",
+ "target": "src/graph/map.ts#computeDirEntries.relPath",
+ "relation": "calls",
"confidence": "extracted"
},
{
- "source": "src/graph/extract.ts",
- "target": "src/graph/extract.ts#RawEdge",
- "relation": "contains",
+ "source": "src/graph/map.ts#computeDirEntries",
+ "target": "src/graph/map.ts#dirKey",
+ "relation": "calls",
"confidence": "extracted"
},
{
- "source": "src/graph/extract.ts",
- "target": "src/graph/extract.ts#searchBody",
- "relation": "contains",
+ "source": "src/graph/map.ts#computeDirEntries",
+ "target": "src/graph/map.ts#sortedLanguages",
+ "relation": "calls",
"confidence": "extracted"
},
{
- "source": "src/graph/extract.ts",
- "target": "src/graph/extract.ts#tsExported",
- "relation": "contains",
+ "source": "src/graph/map.ts#computeDirEntries",
+ "target": "src/graph/map.ts#topHubs",
+ "relation": "calls",
"confidence": "extracted"
},
{
- "source": "src/graph/extract.ts",
- "target": "src/graph/extract.ts#tsReceiver",
+ "source": "src/graph/map.ts#computeDirEntries",
+ "target": "src/graph/map.ts#computeDirEntries.depthFor",
"relation": "contains",
"confidence": "extracted"
},
{
- "source": "src/graph/extract.ts",
- "target": "src/graph/extract.ts#walk",
+ "source": "src/graph/map.ts#computeDirEntries",
+ "target": "src/graph/map.ts#computeDirEntries.fullPath",
"relation": "contains",
"confidence": "extracted"
},
{
- "source": "src/graph/extract.ts",
- "target": "src/graph/extract.ts#WalkCtx",
+ "source": "src/graph/map.ts#computeDirEntries",
+ "target": "src/graph/map.ts#computeDirEntries.relPath",
"relation": "contains",
"confidence": "extracted"
},
{
- "source": "src/graph/extract.ts",
- "target": "node:path",
- "relation": "imports",
+ "source": "src/graph/map.ts#computeDirEntries.depthFor",
+ "target": "src/graph/map.ts#dirKey",
+ "relation": "calls",
"confidence": "extracted"
},
{
- "source": "src/graph/extract.ts",
- "target": "src/graph/bindings.ts",
- "relation": "imports",
+ "source": "src/graph/map.ts#formatDirHub",
+ "target": "src/graph/map.ts#basenameOf",
+ "relation": "calls",
"confidence": "extracted"
},
{
- "source": "src/graph/extract.ts",
- "target": "src/graph/types.ts",
- "relation": "imports",
- "confidence": "extracted"
+ "source": "src/graph/map.ts#formatRepoMap",
+ "target": "src/context/savings.ts#savingsFooter",
+ "relation": "calls",
+ "confidence": "inferred"
},
{
- "source": "src/graph/extract.ts",
- "target": "src/util/id.ts",
- "relation": "imports",
+ "source": "src/graph/map.ts#formatRepoMap",
+ "target": "src/graph/map.ts#droppedNote",
+ "relation": "calls",
"confidence": "extracted"
},
{
- "source": "src/graph/extract.ts",
- "target": "tree-sitter",
- "relation": "imports",
+ "source": "src/graph/map.ts#formatRepoMap",
+ "target": "src/graph/map.ts#formatDirLine",
+ "relation": "calls",
"confidence": "extracted"
},
{
- "source": "src/graph/extract.ts",
- "target": "tree-sitter-go",
- "relation": "imports",
- "confidence": "extracted"
+ "source": "src/graph/map.ts#sortedLanguages",
+ "target": "src/graph/extract.ts#languageOf",
+ "relation": "calls",
+ "confidence": "inferred"
},
{
- "source": "src/graph/extract.ts",
- "target": "tree-sitter-python",
+ "source": "src/graph/relations.ts",
+ "target": "src/graph/types.ts",
"relation": "imports",
"confidence": "extracted"
},
{
- "source": "src/graph/extract.ts",
- "target": "tree-sitter-typescript",
- "relation": "imports",
+ "source": "src/graph/resolve.ts",
+ "target": "src/graph/resolve.ts#GoModule",
+ "relation": "contains",
"confidence": "extracted"
},
{
- "source": "src/graph/extract.ts#calleeName",
- "target": "src/graph/extract.ts#pyReceiver",
- "relation": "calls",
+ "source": "src/graph/resolve.ts",
+ "target": "src/graph/resolve.ts#push",
+ "relation": "contains",
"confidence": "extracted"
},
{
- "source": "src/graph/extract.ts#calleeName",
- "target": "src/graph/extract.ts#tsReceiver",
- "relation": "calls",
+ "source": "src/graph/resolve.ts",
+ "target": "src/graph/resolve.ts#resolveEdges",
+ "relation": "contains",
"confidence": "extracted"
},
{
- "source": "src/graph/extract.ts#describe",
- "target": "src/graph/extract.ts#describeGo",
- "relation": "calls",
+ "source": "src/graph/resolve.ts",
+ "target": "src/graph/resolve.ts#resolveGoImport",
+ "relation": "contains",
"confidence": "extracted"
},
{
- "source": "src/graph/extract.ts#describeGo",
- "target": "src/graph/extract.ts#goReceiverType",
- "relation": "calls",
+ "source": "src/graph/resolve.ts",
+ "target": "src/graph/resolve.ts#resolveImport",
+ "relation": "contains",
"confidence": "extracted"
},
{
- "source": "src/graph/extract.ts#extractFile",
- "target": "src/graph/bindings.ts#collectBindings",
- "relation": "calls",
- "confidence": "inferred"
+ "source": "src/graph/resolve.ts",
+ "target": "src/graph/resolve.ts#resolveName",
+ "relation": "contains",
+ "confidence": "extracted"
},
{
- "source": "src/graph/extract.ts#extractFile",
- "target": "src/graph/extract.ts#fileResidual",
- "relation": "calls",
+ "source": "src/graph/resolve.ts",
+ "target": "src/graph/resolve.ts#ResolveOptions",
+ "relation": "contains",
"confidence": "extracted"
},
{
- "source": "src/graph/extract.ts#extractFile",
- "target": "src/graph/extract.ts#parseSource",
- "relation": "calls",
+ "source": "src/graph/resolve.ts",
+ "target": "src/graph/resolve.ts#resolveTypedMember",
+ "relation": "contains",
"confidence": "extracted"
},
{
- "source": "src/graph/extract.ts#extractFile",
- "target": "src/graph/extract.ts#walk",
- "relation": "calls",
+ "source": "src/graph/resolve.ts",
+ "target": "node:path",
+ "relation": "imports",
"confidence": "extracted"
},
{
- "source": "src/graph/extract.ts#extractFile",
- "target": "src/util/id.ts#contentHash",
- "relation": "calls",
- "confidence": "inferred"
+ "source": "src/graph/resolve.ts",
+ "target": "src/graph/extract.ts",
+ "relation": "imports",
+ "confidence": "extracted"
},
{
- "source": "src/graph/extract.ts#fileResidual",
- "target": "src/graph/extract.ts#searchBody",
- "relation": "calls",
+ "source": "src/graph/resolve.ts",
+ "target": "src/graph/types.ts",
+ "relation": "imports",
"confidence": "extracted"
},
{
- "source": "src/graph/extract.ts#walk",
- "target": "src/graph/bindings.ts#goReceiverVarOf",
+ "source": "src/graph/resolve.ts#push",
+ "target": "src/graph/bindings.ts#FileBindings.set",
"relation": "calls",
"confidence": "inferred"
},
{
- "source": "src/graph/extract.ts#walk",
- "target": "src/graph/bindings.ts#resolveRecvType",
+ "source": "src/graph/resolve.ts#resolveEdges",
+ "target": "src/graph/resolve.ts#push",
"relation": "calls",
- "confidence": "inferred"
+ "confidence": "extracted"
},
{
- "source": "src/graph/extract.ts#walk",
- "target": "src/graph/extract.ts#calleeName",
+ "source": "src/graph/resolve.ts#resolveEdges",
+ "target": "src/graph/resolve.ts#resolveEdges.add",
"relation": "calls",
"confidence": "extracted"
},
{
- "source": "src/graph/extract.ts#walk",
- "target": "src/graph/extract.ts#clean",
+ "source": "src/graph/resolve.ts#resolveEdges",
+ "target": "src/graph/resolve.ts#resolveGoImport",
"relation": "calls",
"confidence": "extracted"
},
{
- "source": "src/graph/extract.ts#walk",
- "target": "src/graph/extract.ts#describe",
+ "source": "src/graph/resolve.ts#resolveEdges",
+ "target": "src/graph/resolve.ts#resolveImport",
"relation": "calls",
"confidence": "extracted"
},
{
- "source": "src/graph/extract.ts#walk",
- "target": "src/graph/extract.ts#goExported",
+ "source": "src/graph/resolve.ts#resolveEdges",
+ "target": "src/graph/resolve.ts#resolveName",
"relation": "calls",
"confidence": "extracted"
},
{
- "source": "src/graph/extract.ts#walk",
- "target": "src/graph/extract.ts#goReceiverType",
+ "source": "src/graph/resolve.ts#resolveEdges",
+ "target": "src/graph/resolve.ts#resolveTypedMember",
"relation": "calls",
"confidence": "extracted"
},
{
- "source": "src/graph/extract.ts#walk",
- "target": "src/graph/extract.ts#heritageEdges",
- "relation": "calls",
+ "source": "src/graph/resolve.ts#resolveEdges",
+ "target": "src/graph/resolve.ts#resolveEdges.add",
+ "relation": "contains",
"confidence": "extracted"
},
{
- "source": "src/graph/extract.ts#walk",
- "target": "src/graph/extract.ts#importSpecifier",
- "relation": "calls",
+ "source": "src/graph/scopes.ts",
+ "target": "src/graph/scopes.ts#Candidate",
+ "relation": "contains",
"confidence": "extracted"
},
{
- "source": "src/graph/extract.ts#walk",
- "target": "src/graph/extract.ts#isImport",
- "relation": "calls",
+ "source": "src/graph/scopes.ts",
+ "target": "src/graph/scopes.ts#collectDirs",
+ "relation": "contains",
"confidence": "extracted"
},
{
- "source": "src/graph/extract.ts#walk",
- "target": "src/graph/extract.ts#searchBody",
- "relation": "calls",
+ "source": "src/graph/scopes.ts",
+ "target": "src/graph/scopes.ts#discoverScopes",
+ "relation": "contains",
"confidence": "extracted"
},
{
- "source": "src/graph/extract.ts#walk",
- "target": "src/graph/extract.ts#tsExported",
- "relation": "calls",
+ "source": "src/graph/scopes.ts",
+ "target": "src/graph/scopes.ts#discoverWorkspaceChildren",
+ "relation": "contains",
"confidence": "extracted"
},
{
- "source": "src/graph/extract.ts#walk",
- "target": "src/graph/extract.ts#walk",
- "relation": "calls",
+ "source": "src/graph/scopes.ts",
+ "target": "src/graph/scopes.ts#parsePnpmPackagesList",
+ "relation": "contains",
"confidence": "extracted"
},
{
- "source": "src/graph/extract.ts#walk",
- "target": "src/util/id.ts#contentHash",
- "relation": "calls",
- "confidence": "inferred"
+ "source": "src/graph/scopes.ts",
+ "target": "src/graph/scopes.ts#pathUnderPrefix",
+ "relation": "contains",
+ "confidence": "extracted"
},
{
- "source": "src/graph/load.ts",
- "target": "src/graph/load.ts#__resetParseCounts",
+ "source": "src/graph/scopes.ts",
+ "target": "src/graph/scopes.ts#readWorkspaceGlobs",
"relation": "contains",
"confidence": "extracted"
},
{
- "source": "src/graph/load.ts",
- "target": "src/graph/load.ts#CacheEntry",
+ "source": "src/graph/scopes.ts",
+ "target": "src/graph/scopes.ts#resolveGlob",
"relation": "contains",
"confidence": "extracted"
},
{
- "source": "src/graph/load.ts",
- "target": "src/graph/load.ts#loadAskIndexCached",
+ "source": "src/graph/scopes.ts",
+ "target": "src/graph/scopes.ts#scopeLabel",
"relation": "contains",
"confidence": "extracted"
},
{
- "source": "src/graph/load.ts",
- "target": "src/graph/load.ts#loadCached",
+ "source": "src/graph/scopes.ts",
+ "target": "src/graph/scopes.ts#scopeOf",
"relation": "contains",
"confidence": "extracted"
},
{
- "source": "src/graph/load.ts",
- "target": "src/graph/load.ts#loadGraphCached",
+ "source": "src/graph/scopes.ts",
+ "target": "src/graph/scopes.ts#scopesHereClause",
"relation": "contains",
"confidence": "extracted"
},
{
- "source": "src/graph/load.ts",
- "target": "src/graph/load.ts#statOf",
+ "source": "src/graph/scopes.ts",
+ "target": "src/graph/scopes.ts#scopesOfGraph",
"relation": "contains",
"confidence": "extracted"
},
{
- "source": "src/graph/load.ts",
+ "source": "src/graph/scopes.ts",
"target": "node:fs",
"relation": "imports",
"confidence": "extracted"
},
{
- "source": "src/graph/load.ts",
- "target": "src/ask/index-file.ts",
+ "source": "src/graph/scopes.ts",
+ "target": "node:path",
"relation": "imports",
"confidence": "extracted"
},
{
- "source": "src/graph/load.ts",
+ "source": "src/graph/scopes.ts",
"target": "src/graph/types.ts",
"relation": "imports",
"confidence": "extracted"
},
{
- "source": "src/graph/load.ts",
- "target": "src/graph/write.ts",
+ "source": "src/graph/scopes.ts",
+ "target": "src/ingest/fs.ts",
"relation": "imports",
"confidence": "extracted"
},
{
- "source": "src/graph/load.ts#loadAskIndexCached",
- "target": "src/ask/index-file.ts#askIndexPath",
+ "source": "src/graph/scopes.ts#collectDirs",
+ "target": "src/graph/scopes.ts#collectDirs.walk",
"relation": "calls",
- "confidence": "inferred"
+ "confidence": "extracted"
},
{
- "source": "src/graph/load.ts#loadAskIndexCached",
- "target": "src/ask/index-file.ts#readAskIndex",
+ "source": "src/graph/scopes.ts#collectDirs",
+ "target": "src/graph/scopes.ts#collectDirs.walk",
+ "relation": "contains",
+ "confidence": "extracted"
+ },
+ {
+ "source": "src/graph/scopes.ts#collectDirs.walk",
+ "target": "src/graph/scopes.ts#collectDirs.walk",
"relation": "calls",
- "confidence": "inferred"
+ "confidence": "extracted"
},
{
- "source": "src/graph/load.ts#loadAskIndexCached",
- "target": "src/graph/load.ts#loadCached",
+ "source": "src/graph/scopes.ts#discoverScopes",
+ "target": "src/graph/scopes.ts#collectDirs",
"relation": "calls",
"confidence": "extracted"
},
{
- "source": "src/graph/load.ts#loadCached",
- "target": "src/ai/llm/openai.ts#OpenAIChatModel.fromResponse.parse",
+ "source": "src/graph/scopes.ts#discoverScopes",
+ "target": "src/graph/scopes.ts#discoverScopes.findNearestAncestorCandidate",
+ "relation": "calls",
+ "confidence": "extracted"
+ },
+ {
+ "source": "src/graph/scopes.ts#discoverScopes",
+ "target": "src/graph/scopes.ts#readWorkspaceGlobs",
+ "relation": "calls",
+ "confidence": "extracted"
+ },
+ {
+ "source": "src/graph/scopes.ts#discoverScopes",
+ "target": "src/graph/scopes.ts#resolveGlob",
"relation": "calls",
- "confidence": "inferred"
+ "confidence": "extracted"
},
{
- "source": "src/graph/load.ts#loadCached",
- "target": "src/graph/bindings.ts#FileBindings.set",
- "relation": "calls",
- "confidence": "inferred"
+ "source": "src/graph/scopes.ts#discoverScopes",
+ "target": "src/graph/scopes.ts#discoverScopes.findNearestAncestorCandidate",
+ "relation": "contains",
+ "confidence": "extracted"
},
{
- "source": "src/graph/load.ts#loadCached",
- "target": "src/graph/load.ts#statOf",
+ "source": "src/graph/scopes.ts#readWorkspaceGlobs",
+ "target": "src/graph/scopes.ts#parsePnpmPackagesList",
"relation": "calls",
"confidence": "extracted"
},
{
- "source": "src/graph/load.ts#loadGraphCached",
- "target": "src/graph/load.ts#loadCached",
+ "source": "src/graph/scopes.ts#resolveGlob",
+ "target": "src/graph/scopes.ts#resolveGlob.listDirs",
"relation": "calls",
"confidence": "extracted"
},
{
- "source": "src/graph/load.ts#loadGraphCached",
- "target": "src/graph/write.ts#readGraph",
- "relation": "calls",
- "confidence": "inferred"
+ "source": "src/graph/scopes.ts#resolveGlob",
+ "target": "src/graph/scopes.ts#resolveGlob.listDirs",
+ "relation": "contains",
+ "confidence": "extracted"
},
{
- "source": "src/graph/load.ts#loadGraphCached",
- "target": "src/graph/write.ts#wiringPath",
+ "source": "src/graph/scopes.ts#scopesHereClause",
+ "target": "src/graph/scopes.ts#scopeLabel",
"relation": "calls",
- "confidence": "inferred"
+ "confidence": "extracted"
},
{
- "source": "src/graph/map.ts",
- "target": "src/graph/map.ts#basenameOf",
+ "source": "src/graph/traverse-cli.ts",
+ "target": "src/graph/traverse-cli.ts#CallersCliOptions",
"relation": "contains",
"confidence": "extracted"
},
{
- "source": "src/graph/map.ts",
- "target": "src/graph/map.ts#buildRepoMap",
+ "source": "src/graph/traverse-cli.ts",
+ "target": "src/graph/traverse-cli.ts#callersSavings",
"relation": "contains",
"confidence": "extracted"
},
{
- "source": "src/graph/map.ts",
- "target": "src/graph/map.ts#BuildRepoMapOptions",
+ "source": "src/graph/traverse-cli.ts",
+ "target": "src/graph/traverse-cli.ts#headerOf",
"relation": "contains",
"confidence": "extracted"
},
{
- "source": "src/graph/map.ts",
- "target": "src/graph/map.ts#computeInDegree",
+ "source": "src/graph/traverse-cli.ts",
+ "target": "src/graph/traverse-cli.ts#hitJson",
"relation": "contains",
"confidence": "extracted"
},
{
- "source": "src/graph/map.ts",
- "target": "src/graph/map.ts#DirEntry",
+ "source": "src/graph/traverse-cli.ts",
+ "target": "src/graph/traverse-cli.ts#HitJson",
"relation": "contains",
"confidence": "extracted"
},
{
- "source": "src/graph/map.ts",
- "target": "src/graph/map.ts#dirKey",
+ "source": "src/graph/traverse-cli.ts",
+ "target": "src/graph/traverse-cli.ts#hitLine",
"relation": "contains",
"confidence": "extracted"
},
{
- "source": "src/graph/map.ts",
- "target": "src/graph/map.ts#formatDirHub",
+ "source": "src/graph/traverse-cli.ts",
+ "target": "src/graph/traverse-cli.ts#looseNoteFor",
"relation": "contains",
"confidence": "extracted"
},
{
- "source": "src/graph/map.ts",
- "target": "src/graph/map.ts#formatDirLine",
+ "source": "src/graph/traverse-cli.ts",
+ "target": "src/graph/traverse-cli.ts#MatchJson",
"relation": "contains",
"confidence": "extracted"
},
{
- "source": "src/graph/map.ts",
- "target": "src/graph/map.ts#formatHotspot",
+ "source": "src/graph/traverse-cli.ts",
+ "target": "src/graph/traverse-cli.ts#resolveDirection",
"relation": "contains",
"confidence": "extracted"
},
{
- "source": "src/graph/map.ts",
- "target": "src/graph/map.ts#formatRepoMap",
+ "source": "src/graph/traverse-cli.ts",
+ "target": "src/graph/traverse-cli.ts#runCallersCommand",
"relation": "contains",
"confidence": "extracted"
},
{
- "source": "src/graph/map.ts",
- "target": "src/graph/map.ts#Hub",
+ "source": "src/graph/traverse-cli.ts",
+ "target": "src/graph/traverse-cli.ts#symbolJson",
"relation": "contains",
"confidence": "extracted"
},
{
- "source": "src/graph/map.ts",
- "target": "src/graph/map.ts#RepoMap",
+ "source": "src/graph/traverse-cli.ts",
+ "target": "src/graph/traverse-cli.ts#SymbolJson",
"relation": "contains",
"confidence": "extracted"
},
{
- "source": "src/graph/map.ts",
- "target": "src/graph/map.ts#sortedLanguages",
- "relation": "contains",
+ "source": "src/graph/traverse-cli.ts",
+ "target": "node:path",
+ "relation": "imports",
"confidence": "extracted"
},
{
- "source": "src/graph/map.ts",
- "target": "src/graph/map.ts#topHubs",
- "relation": "contains",
+ "source": "src/graph/traverse-cli.ts",
+ "target": "src/context/node-file.ts",
+ "relation": "imports",
"confidence": "extracted"
},
{
- "source": "src/graph/map.ts",
+ "source": "src/graph/traverse-cli.ts",
"target": "src/context/savings.ts",
"relation": "imports",
"confidence": "extracted"
},
{
- "source": "src/graph/map.ts",
- "target": "src/graph/extract.ts",
+ "source": "src/graph/traverse-cli.ts",
+ "target": "src/graph/load.ts",
"relation": "imports",
"confidence": "extracted"
},
{
- "source": "src/graph/map.ts",
- "target": "src/graph/relations.ts",
+ "source": "src/graph/traverse-cli.ts",
+ "target": "src/graph/traverse.ts",
"relation": "imports",
"confidence": "extracted"
},
{
- "source": "src/graph/map.ts",
+ "source": "src/graph/traverse-cli.ts",
"target": "src/graph/types.ts",
"relation": "imports",
"confidence": "extracted"
},
{
- "source": "src/graph/map.ts#buildRepoMap",
+ "source": "src/graph/traverse-cli.ts#callersSavings",
"target": "src/context/savings.ts#savingsFor",
"relation": "calls",
"confidence": "inferred"
},
{
- "source": "src/graph/map.ts#buildRepoMap",
- "target": "src/graph/map.ts#buildRepoMap.depthFor",
+ "source": "src/graph/traverse-cli.ts#runCallersCommand",
+ "target": "src/context/node-file.ts#contextDirFor",
"relation": "calls",
- "confidence": "extracted"
+ "confidence": "inferred"
},
{
- "source": "src/graph/map.ts#buildRepoMap",
- "target": "src/graph/map.ts#computeInDegree",
+ "source": "src/graph/traverse-cli.ts#runCallersCommand",
+ "target": "src/context/savings.ts#savingsFooter",
"relation": "calls",
- "confidence": "extracted"
+ "confidence": "inferred"
},
{
- "source": "src/graph/map.ts#buildRepoMap",
- "target": "src/graph/map.ts#dirKey",
+ "source": "src/graph/traverse-cli.ts#runCallersCommand",
+ "target": "src/graph/load.ts#loadGraphCached",
+ "relation": "calls",
+ "confidence": "inferred"
+ },
+ {
+ "source": "src/graph/traverse-cli.ts#runCallersCommand",
+ "target": "src/graph/traverse-cli.ts#callersSavings",
"relation": "calls",
"confidence": "extracted"
},
{
- "source": "src/graph/map.ts#buildRepoMap",
- "target": "src/graph/map.ts#sortedLanguages",
+ "source": "src/graph/traverse-cli.ts#runCallersCommand",
+ "target": "src/graph/traverse-cli.ts#headerOf",
"relation": "calls",
"confidence": "extracted"
},
{
- "source": "src/graph/map.ts#buildRepoMap",
- "target": "src/graph/map.ts#topHubs",
+ "source": "src/graph/traverse-cli.ts#runCallersCommand",
+ "target": "src/graph/traverse-cli.ts#hitLine",
"relation": "calls",
"confidence": "extracted"
},
{
- "source": "src/graph/map.ts#buildRepoMap",
- "target": "src/graph/map.ts#buildRepoMap.depthFor",
- "relation": "contains",
+ "source": "src/graph/traverse-cli.ts#runCallersCommand",
+ "target": "src/graph/traverse-cli.ts#looseNoteFor",
+ "relation": "calls",
"confidence": "extracted"
},
{
- "source": "src/graph/map.ts#buildRepoMap.depthFor",
- "target": "src/graph/map.ts#dirKey",
+ "source": "src/graph/traverse-cli.ts#runCallersCommand",
+ "target": "src/graph/traverse-cli.ts#resolveDirection",
"relation": "calls",
"confidence": "extracted"
},
{
- "source": "src/graph/map.ts#formatDirHub",
- "target": "src/graph/map.ts#basenameOf",
+ "source": "src/graph/traverse-cli.ts#runCallersCommand",
+ "target": "src/graph/traverse-cli.ts#symbolJson",
"relation": "calls",
"confidence": "extracted"
},
{
- "source": "src/graph/map.ts#formatRepoMap",
- "target": "src/context/savings.ts#savingsFooter",
+ "source": "src/graph/traverse-cli.ts#runCallersCommand",
+ "target": "src/graph/traverse.ts#edgeWalk",
"relation": "calls",
"confidence": "inferred"
},
{
- "source": "src/graph/map.ts#formatRepoMap",
- "target": "src/graph/map.ts#formatDirLine",
+ "source": "src/graph/traverse-cli.ts#runCallersCommand",
+ "target": "src/graph/traverse.ts#resolveSymbol",
"relation": "calls",
+ "confidence": "inferred"
+ },
+ {
+ "source": "src/graph/traverse.ts",
+ "target": "src/graph/traverse.ts#calleesOf",
+ "relation": "contains",
"confidence": "extracted"
},
{
- "source": "src/graph/map.ts#sortedLanguages",
- "target": "src/graph/extract.ts#languageOf",
- "relation": "calls",
- "confidence": "inferred"
+ "source": "src/graph/traverse.ts",
+ "target": "src/graph/traverse.ts#callersOf",
+ "relation": "contains",
+ "confidence": "extracted"
},
{
- "source": "src/graph/relations.ts",
- "target": "src/graph/types.ts",
- "relation": "imports",
+ "source": "src/graph/traverse.ts",
+ "target": "src/graph/traverse.ts#Direction",
+ "relation": "contains",
"confidence": "extracted"
},
{
- "source": "src/graph/resolve.ts",
- "target": "src/graph/resolve.ts#GoModule",
+ "source": "src/graph/traverse.ts",
+ "target": "src/graph/traverse.ts#EdgeHit",
"relation": "contains",
"confidence": "extracted"
},
{
- "source": "src/graph/resolve.ts",
- "target": "src/graph/resolve.ts#push",
+ "source": "src/graph/traverse.ts",
+ "target": "src/graph/traverse.ts#edgeWalk",
"relation": "contains",
"confidence": "extracted"
},
{
- "source": "src/graph/resolve.ts",
- "target": "src/graph/resolve.ts#resolveEdges",
+ "source": "src/graph/traverse.ts",
+ "target": "src/graph/traverse.ts#impactOf",
"relation": "contains",
"confidence": "extracted"
},
{
- "source": "src/graph/resolve.ts",
- "target": "src/graph/resolve.ts#resolveGoImport",
+ "source": "src/graph/traverse.ts",
+ "target": "src/graph/traverse.ts#impactOfFile",
"relation": "contains",
"confidence": "extracted"
},
{
- "source": "src/graph/resolve.ts",
- "target": "src/graph/resolve.ts#resolveImport",
+ "source": "src/graph/traverse.ts",
+ "target": "src/graph/traverse.ts#impactOfMany",
"relation": "contains",
"confidence": "extracted"
},
{
- "source": "src/graph/resolve.ts",
- "target": "src/graph/resolve.ts#resolveName",
+ "source": "src/graph/traverse.ts",
+ "target": "src/graph/traverse.ts#resolveSymbol",
"relation": "contains",
"confidence": "extracted"
},
{
- "source": "src/graph/resolve.ts",
- "target": "src/graph/resolve.ts#ResolveOptions",
+ "source": "src/graph/traverse.ts",
+ "target": "src/graph/traverse.ts#ResolveSymbolOptions",
"relation": "contains",
"confidence": "extracted"
},
{
- "source": "src/graph/resolve.ts",
- "target": "src/graph/resolve.ts#resolveTypedMember",
+ "source": "src/graph/traverse.ts",
+ "target": "src/graph/traverse.ts#SymbolMatch",
"relation": "contains",
"confidence": "extracted"
},
{
- "source": "src/graph/resolve.ts",
- "target": "node:path",
- "relation": "imports",
+ "source": "src/graph/traverse.ts",
+ "target": "src/graph/traverse.ts#symbolMatches",
+ "relation": "contains",
"confidence": "extracted"
},
{
- "source": "src/graph/resolve.ts",
- "target": "src/graph/extract.ts",
+ "source": "src/graph/traverse.ts",
+ "target": "src/graph/traverse.ts#symbolsInFile",
+ "relation": "contains",
+ "confidence": "extracted"
+ },
+ {
+ "source": "src/graph/traverse.ts",
+ "target": "src/graph/relations.ts",
"relation": "imports",
"confidence": "extracted"
},
{
- "source": "src/graph/resolve.ts",
+ "source": "src/graph/traverse.ts",
"target": "src/graph/types.ts",
"relation": "imports",
"confidence": "extracted"
},
{
- "source": "src/graph/resolve.ts#push",
- "target": "src/graph/bindings.ts#FileBindings.set",
+ "source": "src/graph/traverse.ts#edgeWalk",
+ "target": "src/graph/traverse.ts#calleesOf",
+ "relation": "calls",
+ "confidence": "extracted"
+ },
+ {
+ "source": "src/graph/traverse.ts#edgeWalk",
+ "target": "src/graph/traverse.ts#callersOf",
+ "relation": "calls",
+ "confidence": "extracted"
+ },
+ {
+ "source": "src/graph/traverse.ts#edgeWalk",
+ "target": "src/graph/traverse.ts#impactOfFile",
+ "relation": "calls",
+ "confidence": "extracted"
+ },
+ {
+ "source": "src/graph/traverse.ts#edgeWalk",
+ "target": "src/graph/traverse.ts#impactOfMany",
+ "relation": "calls",
+ "confidence": "extracted"
+ },
+ {
+ "source": "src/graph/traverse.ts#impactOf",
+ "target": "src/graph/traverse.ts#impactOfMany",
+ "relation": "calls",
+ "confidence": "extracted"
+ },
+ {
+ "source": "src/graph/traverse.ts#impactOfFile",
+ "target": "src/graph/traverse.ts#impactOfMany",
"relation": "calls",
- "confidence": "inferred"
+ "confidence": "extracted"
},
{
- "source": "src/graph/resolve.ts#resolveEdges",
- "target": "src/graph/resolve.ts#push",
+ "source": "src/graph/traverse.ts#impactOfFile",
+ "target": "src/graph/traverse.ts#symbolsInFile",
"relation": "calls",
"confidence": "extracted"
},
{
- "source": "src/graph/resolve.ts#resolveEdges",
- "target": "src/graph/resolve.ts#resolveEdges.add",
+ "source": "src/graph/traverse.ts#resolveSymbol",
+ "target": "src/graph/traverse.ts#symbolMatches",
"relation": "calls",
"confidence": "extracted"
},
{
- "source": "src/graph/resolve.ts#resolveEdges",
- "target": "src/graph/resolve.ts#resolveGoImport",
- "relation": "calls",
+ "source": "src/graph/types.ts",
+ "target": "src/graph/types.ts#Confidence",
+ "relation": "contains",
"confidence": "extracted"
},
{
- "source": "src/graph/resolve.ts#resolveEdges",
- "target": "src/graph/resolve.ts#resolveImport",
- "relation": "calls",
+ "source": "src/graph/types.ts",
+ "target": "src/graph/types.ts#Crux",
+ "relation": "contains",
"confidence": "extracted"
},
{
- "source": "src/graph/resolve.ts#resolveEdges",
- "target": "src/graph/resolve.ts#resolveName",
- "relation": "calls",
+ "source": "src/graph/types.ts",
+ "target": "src/graph/types.ts#EdgeV1",
+ "relation": "contains",
"confidence": "extracted"
},
{
- "source": "src/graph/resolve.ts#resolveEdges",
- "target": "src/graph/resolve.ts#resolveTypedMember",
- "relation": "calls",
+ "source": "src/graph/types.ts",
+ "target": "src/graph/types.ts#GraphV1",
+ "relation": "contains",
"confidence": "extracted"
},
{
- "source": "src/graph/resolve.ts#resolveEdges",
- "target": "src/graph/resolve.ts#resolveEdges.add",
+ "source": "src/graph/types.ts",
+ "target": "src/graph/types.ts#Kind",
"relation": "contains",
"confidence": "extracted"
},
{
- "source": "src/graph/scopes.ts",
- "target": "src/graph/scopes.ts#Candidate",
+ "source": "src/graph/types.ts",
+ "target": "src/graph/types.ts#NodeV1",
"relation": "contains",
"confidence": "extracted"
},
{
- "source": "src/graph/scopes.ts",
- "target": "src/graph/scopes.ts#collectDirs",
+ "source": "src/graph/types.ts",
+ "target": "src/graph/types.ts#Relation",
"relation": "contains",
"confidence": "extracted"
},
{
- "source": "src/graph/scopes.ts",
- "target": "src/graph/scopes.ts#discoverScopes",
+ "source": "src/graph/types.ts",
+ "target": "src/graph/types.ts#ScopeV1",
"relation": "contains",
"confidence": "extracted"
},
{
- "source": "src/graph/scopes.ts",
- "target": "src/graph/scopes.ts#discoverWorkspaceChildren",
+ "source": "src/graph/types.ts",
+ "target": "src/graph/types.ts#SummaryState",
"relation": "contains",
"confidence": "extracted"
},
{
- "source": "src/graph/scopes.ts",
- "target": "src/graph/scopes.ts#parsePnpmPackagesList",
+ "source": "src/graph/workspace-cli.ts",
+ "target": "src/graph/workspace-cli.ts#runWorkspaceAsk",
"relation": "contains",
"confidence": "extracted"
},
{
- "source": "src/graph/scopes.ts",
- "target": "src/graph/scopes.ts#pathUnderPrefix",
+ "source": "src/graph/workspace-cli.ts",
+ "target": "src/graph/workspace-cli.ts#runWorkspaceBuild",
"relation": "contains",
"confidence": "extracted"
},
{
- "source": "src/graph/scopes.ts",
- "target": "src/graph/scopes.ts#readWorkspaceGlobs",
+ "source": "src/graph/workspace-cli.ts",
+ "target": "src/graph/workspace-cli.ts#runWorkspaceCallers",
"relation": "contains",
"confidence": "extracted"
},
{
- "source": "src/graph/scopes.ts",
- "target": "src/graph/scopes.ts#resolveGlob",
+ "source": "src/graph/workspace-cli.ts",
+ "target": "src/graph/workspace-cli.ts#runWorkspaceCheck",
"relation": "contains",
"confidence": "extracted"
},
{
- "source": "src/graph/scopes.ts",
- "target": "src/graph/scopes.ts#scopeLabel",
+ "source": "src/graph/workspace-cli.ts",
+ "target": "src/graph/workspace-cli.ts#runWorkspaceGrep",
"relation": "contains",
"confidence": "extracted"
},
{
- "source": "src/graph/scopes.ts",
- "target": "src/graph/scopes.ts#scopeOf",
+ "source": "src/graph/workspace-cli.ts",
+ "target": "src/graph/workspace-cli.ts#runWorkspaceMap",
"relation": "contains",
"confidence": "extracted"
},
{
- "source": "src/graph/scopes.ts",
- "target": "src/graph/scopes.ts#scopesHereClause",
+ "source": "src/graph/workspace-cli.ts",
+ "target": "src/graph/workspace-cli.ts#WorkspaceBuildOptions",
"relation": "contains",
"confidence": "extracted"
},
{
- "source": "src/graph/scopes.ts",
- "target": "src/graph/scopes.ts#scopesOfGraph",
- "relation": "contains",
+ "source": "src/graph/workspace-cli.ts",
+ "target": "src/ai/providers.ts",
+ "relation": "imports",
"confidence": "extracted"
},
{
- "source": "src/graph/scopes.ts",
- "target": "node:fs",
+ "source": "src/graph/workspace-cli.ts",
+ "target": "src/ask/ask.ts",
"relation": "imports",
"confidence": "extracted"
},
{
- "source": "src/graph/scopes.ts",
- "target": "node:path",
+ "source": "src/graph/workspace-cli.ts",
+ "target": "src/engine.ts",
"relation": "imports",
"confidence": "extracted"
},
{
- "source": "src/graph/scopes.ts",
- "target": "src/graph/types.ts",
+ "source": "src/graph/workspace-cli.ts",
+ "target": "src/graph/traverse.ts",
"relation": "imports",
"confidence": "extracted"
},
{
- "source": "src/graph/scopes.ts",
- "target": "src/ingest/fs.ts",
+ "source": "src/graph/workspace-cli.ts",
+ "target": "src/graph/workspace.ts",
"relation": "imports",
"confidence": "extracted"
},
{
- "source": "src/graph/scopes.ts#collectDirs",
- "target": "src/graph/scopes.ts#collectDirs.walk",
+ "source": "src/graph/workspace-cli.ts#runWorkspaceAsk",
+ "target": "src/ask/ask.ts#formatAsk",
"relation": "calls",
- "confidence": "extracted"
+ "confidence": "inferred"
},
{
- "source": "src/graph/scopes.ts#collectDirs",
- "target": "src/graph/scopes.ts#collectDirs.walk",
+ "source": "src/graph/workspace-cli.ts#runWorkspaceAsk",
+ "target": "src/graph/workspace.ts#federateAsk",
+ "relation": "calls",
+ "confidence": "inferred"
+ },
+ {
+ "source": "src/graph/workspace-cli.ts#runWorkspaceBuild",
+ "target": "src/graph/workspace.ts#migrationNote",
+ "relation": "calls",
+ "confidence": "inferred"
+ },
+ {
+ "source": "src/graph/workspace-cli.ts#runWorkspaceBuild",
+ "target": "src/graph/workspace.ts#splitWorkspace",
+ "relation": "calls",
+ "confidence": "inferred"
+ },
+ {
+ "source": "src/graph/workspace-cli.ts#runWorkspaceBuild",
+ "target": "src/graph/workspace-cli.ts#runWorkspaceBuild.buildChild",
"relation": "contains",
"confidence": "extracted"
},
{
- "source": "src/graph/scopes.ts#collectDirs.walk",
- "target": "src/graph/scopes.ts#collectDirs.walk",
+ "source": "src/graph/workspace-cli.ts#runWorkspaceBuild.buildChild",
+ "target": "src/engine.ts#Graft.graph",
"relation": "calls",
- "confidence": "extracted"
+ "confidence": "inferred"
},
{
- "source": "src/graph/scopes.ts#discoverScopes",
- "target": "src/graph/scopes.ts#collectDirs",
+ "source": "src/graph/workspace-cli.ts#runWorkspaceBuild.buildChild",
+ "target": "src/engine.ts#Graft.init",
"relation": "calls",
- "confidence": "extracted"
+ "confidence": "inferred"
},
{
- "source": "src/graph/scopes.ts#discoverScopes",
- "target": "src/graph/scopes.ts#discoverScopes.findNearestAncestorCandidate",
+ "source": "src/graph/workspace-cli.ts#runWorkspaceCallers",
+ "target": "src/graph/workspace.ts#federateCallers",
"relation": "calls",
- "confidence": "extracted"
+ "confidence": "inferred"
},
{
- "source": "src/graph/scopes.ts#discoverScopes",
- "target": "src/graph/scopes.ts#readWorkspaceGlobs",
+ "source": "src/graph/workspace-cli.ts#runWorkspaceCheck",
+ "target": "src/graph/workspace.ts#federateCheck",
"relation": "calls",
- "confidence": "extracted"
+ "confidence": "inferred"
},
{
- "source": "src/graph/scopes.ts#discoverScopes",
- "target": "src/graph/scopes.ts#resolveGlob",
+ "source": "src/graph/workspace-cli.ts#runWorkspaceGrep",
+ "target": "src/graph/workspace.ts#federateGrep",
+ "relation": "calls",
+ "confidence": "inferred"
+ },
+ {
+ "source": "src/graph/workspace-cli.ts#runWorkspaceGrep",
+ "target": "src/search/grep-cli.ts#formatGrepResult",
+ "relation": "calls",
+ "confidence": "inferred"
+ },
+ {
+ "source": "src/graph/workspace-cli.ts#runWorkspaceGrep",
+ "target": "src/search/grep-cli.ts#zeroHitNote",
+ "relation": "calls",
+ "confidence": "inferred"
+ },
+ {
+ "source": "src/graph/workspace-cli.ts#runWorkspaceMap",
+ "target": "src/graph/workspace.ts#federateMap",
"relation": "calls",
+ "confidence": "inferred"
+ },
+ {
+ "source": "src/graph/workspace.ts",
+ "target": "src/graph/workspace.ts#ChildRun",
+ "relation": "contains",
"confidence": "extracted"
},
{
- "source": "src/graph/scopes.ts#discoverScopes",
- "target": "src/graph/scopes.ts#discoverScopes.findNearestAncestorCandidate",
+ "source": "src/graph/workspace.ts",
+ "target": "src/graph/workspace.ts#clearParentGraft",
"relation": "contains",
"confidence": "extracted"
},
{
- "source": "src/graph/scopes.ts#readWorkspaceGlobs",
- "target": "src/graph/scopes.ts#parsePnpmPackagesList",
- "relation": "calls",
+ "source": "src/graph/workspace.ts",
+ "target": "src/graph/workspace.ts#coverageNote",
+ "relation": "contains",
"confidence": "extracted"
},
{
- "source": "src/graph/scopes.ts#resolveGlob",
- "target": "src/graph/scopes.ts#resolveGlob.listDirs",
- "relation": "calls",
+ "source": "src/graph/workspace.ts",
+ "target": "src/graph/workspace.ts#federateAsk",
+ "relation": "contains",
"confidence": "extracted"
},
{
- "source": "src/graph/scopes.ts#resolveGlob",
- "target": "src/graph/scopes.ts#resolveGlob.listDirs",
+ "source": "src/graph/workspace.ts",
+ "target": "src/graph/workspace.ts#FederateAskOptions",
"relation": "contains",
"confidence": "extracted"
},
{
- "source": "src/graph/scopes.ts#scopesHereClause",
- "target": "src/graph/scopes.ts#scopeLabel",
- "relation": "calls",
+ "source": "src/graph/workspace.ts",
+ "target": "src/graph/workspace.ts#federateCallers",
+ "relation": "contains",
"confidence": "extracted"
},
{
- "source": "src/graph/traverse-cli.ts",
- "target": "src/graph/traverse-cli.ts#CallersCliOptions",
+ "source": "src/graph/workspace.ts",
+ "target": "src/graph/workspace.ts#federateCheck",
"relation": "contains",
"confidence": "extracted"
},
{
- "source": "src/graph/traverse-cli.ts",
- "target": "src/graph/traverse-cli.ts#callersSavings",
+ "source": "src/graph/workspace.ts",
+ "target": "src/graph/workspace.ts#federateGrep",
"relation": "contains",
"confidence": "extracted"
},
{
- "source": "src/graph/traverse-cli.ts",
- "target": "src/graph/traverse-cli.ts#headerOf",
+ "source": "src/graph/workspace.ts",
+ "target": "src/graph/workspace.ts#federateMap",
"relation": "contains",
"confidence": "extracted"
},
{
- "source": "src/graph/traverse-cli.ts",
- "target": "src/graph/traverse-cli.ts#hitJson",
+ "source": "src/graph/workspace.ts",
+ "target": "src/graph/workspace.ts#hasMegaGraph",
"relation": "contains",
"confidence": "extracted"
},
{
- "source": "src/graph/traverse-cli.ts",
- "target": "src/graph/traverse-cli.ts#HitJson",
+ "source": "src/graph/workspace.ts",
+ "target": "src/graph/workspace.ts#isWorkspaceBuildRoot",
"relation": "contains",
"confidence": "extracted"
},
{
- "source": "src/graph/traverse-cli.ts",
- "target": "src/graph/traverse-cli.ts#hitLine",
+ "source": "src/graph/workspace.ts",
+ "target": "src/graph/workspace.ts#LoadedChild",
"relation": "contains",
"confidence": "extracted"
},
{
- "source": "src/graph/traverse-cli.ts",
- "target": "src/graph/traverse-cli.ts#looseNoteFor",
+ "source": "src/graph/workspace.ts",
+ "target": "src/graph/workspace.ts#loadWorkspaceGraphs",
"relation": "contains",
"confidence": "extracted"
},
{
- "source": "src/graph/traverse-cli.ts",
- "target": "src/graph/traverse-cli.ts#MatchJson",
+ "source": "src/graph/workspace.ts",
+ "target": "src/graph/workspace.ts#migrationNote",
"relation": "contains",
"confidence": "extracted"
},
{
- "source": "src/graph/traverse-cli.ts",
- "target": "src/graph/traverse-cli.ts#resolveDirection",
+ "source": "src/graph/workspace.ts",
+ "target": "src/graph/workspace.ts#prefixPointer",
"relation": "contains",
"confidence": "extracted"
},
{
- "source": "src/graph/traverse-cli.ts",
- "target": "src/graph/traverse-cli.ts#runCallersCommand",
+ "source": "src/graph/workspace.ts",
+ "target": "src/graph/workspace.ts#readWorkspace",
"relation": "contains",
"confidence": "extracted"
},
{
- "source": "src/graph/traverse-cli.ts",
- "target": "src/graph/traverse-cli.ts#symbolJson",
+ "source": "src/graph/workspace.ts",
+ "target": "src/graph/workspace.ts#splitWorkspace",
"relation": "contains",
"confidence": "extracted"
},
{
- "source": "src/graph/traverse-cli.ts",
- "target": "src/graph/traverse-cli.ts#SymbolJson",
+ "source": "src/graph/workspace.ts",
+ "target": "src/graph/workspace.ts#WorkspaceGraphs",
"relation": "contains",
"confidence": "extracted"
},
{
- "source": "src/graph/traverse-cli.ts",
+ "source": "src/graph/workspace.ts",
+ "target": "src/graph/workspace.ts#workspacePath",
+ "relation": "contains",
+ "confidence": "extracted"
+ },
+ {
+ "source": "src/graph/workspace.ts",
+ "target": "src/graph/workspace.ts#WorkspaceV1",
+ "relation": "contains",
+ "confidence": "extracted"
+ },
+ {
+ "source": "src/graph/workspace.ts",
+ "target": "src/graph/workspace.ts#writeWorkspace",
+ "relation": "contains",
+ "confidence": "extracted"
+ },
+ {
+ "source": "src/graph/workspace.ts",
+ "target": "node:fs",
+ "relation": "imports",
+ "confidence": "extracted"
+ },
+ {
+ "source": "src/graph/workspace.ts",
"target": "node:path",
"relation": "imports",
"confidence": "extracted"
},
{
- "source": "src/graph/traverse-cli.ts",
+ "source": "src/graph/workspace.ts",
+ "target": "src/ask/ask.ts",
+ "relation": "imports",
+ "confidence": "extracted"
+ },
+ {
+ "source": "src/graph/workspace.ts",
+ "target": "src/ask/fuse.ts",
+ "relation": "imports",
+ "confidence": "extracted"
+ },
+ {
+ "source": "src/graph/workspace.ts",
"target": "src/context/node-file.ts",
"relation": "imports",
"confidence": "extracted"
},
{
- "source": "src/graph/traverse-cli.ts",
+ "source": "src/graph/workspace.ts",
"target": "src/context/savings.ts",
"relation": "imports",
"confidence": "extracted"
},
{
- "source": "src/graph/traverse-cli.ts",
+ "source": "src/graph/workspace.ts",
+ "target": "src/graph/check.ts",
+ "relation": "imports",
+ "confidence": "extracted"
+ },
+ {
+ "source": "src/graph/workspace.ts",
"target": "src/graph/load.ts",
"relation": "imports",
"confidence": "extracted"
},
{
- "source": "src/graph/traverse-cli.ts",
+ "source": "src/graph/workspace.ts",
+ "target": "src/graph/map.ts",
+ "relation": "imports",
+ "confidence": "extracted"
+ },
+ {
+ "source": "src/graph/workspace.ts",
+ "target": "src/graph/scopes.ts",
+ "relation": "imports",
+ "confidence": "extracted"
+ },
+ {
+ "source": "src/graph/workspace.ts",
+ "target": "src/graph/traverse-cli.ts",
+ "relation": "imports",
+ "confidence": "extracted"
+ },
+ {
+ "source": "src/graph/workspace.ts",
"target": "src/graph/traverse.ts",
"relation": "imports",
"confidence": "extracted"
},
{
- "source": "src/graph/traverse-cli.ts",
+ "source": "src/graph/workspace.ts",
"target": "src/graph/types.ts",
"relation": "imports",
"confidence": "extracted"
},
{
- "source": "src/graph/traverse-cli.ts#callersSavings",
- "target": "src/context/savings.ts#savingsFor",
- "relation": "calls",
- "confidence": "inferred"
+ "source": "src/graph/workspace.ts",
+ "target": "src/graph/write.ts",
+ "relation": "imports",
+ "confidence": "extracted"
},
{
- "source": "src/graph/traverse-cli.ts#runCallersCommand",
+ "source": "src/graph/workspace.ts",
+ "target": "src/search/grep-cli.ts",
+ "relation": "imports",
+ "confidence": "extracted"
+ },
+ {
+ "source": "src/graph/workspace.ts",
+ "target": "src/search/grep.ts",
+ "relation": "imports",
+ "confidence": "extracted"
+ },
+ {
+ "source": "src/graph/workspace.ts#clearParentGraft",
"target": "src/context/node-file.ts#contextDirFor",
"relation": "calls",
"confidence": "inferred"
},
{
- "source": "src/graph/traverse-cli.ts#runCallersCommand",
- "target": "src/context/savings.ts#savingsFooter",
+ "source": "src/graph/workspace.ts#federateAsk",
+ "target": "src/ask/ask.ts#ask",
"relation": "calls",
"confidence": "inferred"
},
{
- "source": "src/graph/traverse-cli.ts#runCallersCommand",
- "target": "src/graph/load.ts#loadGraphCached",
+ "source": "src/graph/workspace.ts#federateAsk",
+ "target": "src/ask/fuse.ts#fuseScopes",
"relation": "calls",
"confidence": "inferred"
},
{
- "source": "src/graph/traverse-cli.ts#runCallersCommand",
- "target": "src/graph/traverse-cli.ts#callersSavings",
+ "source": "src/graph/workspace.ts#federateAsk",
+ "target": "src/graph/workspace.ts#coverageNote",
"relation": "calls",
"confidence": "extracted"
},
{
- "source": "src/graph/traverse-cli.ts#runCallersCommand",
- "target": "src/graph/traverse-cli.ts#headerOf",
+ "source": "src/graph/workspace.ts#federateAsk",
+ "target": "src/graph/workspace.ts#loadWorkspaceGraphs",
"relation": "calls",
"confidence": "extracted"
},
{
- "source": "src/graph/traverse-cli.ts#runCallersCommand",
- "target": "src/graph/traverse-cli.ts#hitLine",
+ "source": "src/graph/workspace.ts#federateAsk",
+ "target": "src/graph/workspace.ts#prefixPointer",
"relation": "calls",
"confidence": "extracted"
},
{
- "source": "src/graph/traverse-cli.ts#runCallersCommand",
- "target": "src/graph/traverse-cli.ts#looseNoteFor",
+ "source": "src/graph/workspace.ts#federateCallers",
+ "target": "src/context/savings.ts#savingsFooter",
"relation": "calls",
- "confidence": "extracted"
+ "confidence": "inferred"
},
{
- "source": "src/graph/traverse-cli.ts#runCallersCommand",
- "target": "src/graph/traverse-cli.ts#resolveDirection",
+ "source": "src/graph/workspace.ts#federateCallers",
+ "target": "src/graph/traverse-cli.ts#callersSavings",
"relation": "calls",
- "confidence": "extracted"
+ "confidence": "inferred"
},
{
- "source": "src/graph/traverse-cli.ts#runCallersCommand",
- "target": "src/graph/traverse-cli.ts#symbolJson",
+ "source": "src/graph/workspace.ts#federateCallers",
+ "target": "src/graph/traverse-cli.ts#headerOf",
"relation": "calls",
- "confidence": "extracted"
+ "confidence": "inferred"
},
{
- "source": "src/graph/traverse-cli.ts#runCallersCommand",
- "target": "src/graph/traverse.ts#edgeWalk",
+ "source": "src/graph/workspace.ts#federateCallers",
+ "target": "src/graph/traverse-cli.ts#hitLine",
"relation": "calls",
"confidence": "inferred"
},
{
- "source": "src/graph/traverse-cli.ts#runCallersCommand",
- "target": "src/graph/traverse.ts#resolveSymbol",
+ "source": "src/graph/workspace.ts#federateCallers",
+ "target": "src/graph/traverse-cli.ts#looseNoteFor",
"relation": "calls",
"confidence": "inferred"
},
{
- "source": "src/graph/traverse.ts",
- "target": "src/graph/traverse.ts#calleesOf",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/traverse.ts",
- "target": "src/graph/traverse.ts#callersOf",
- "relation": "contains",
- "confidence": "extracted"
- },
- {
- "source": "src/graph/traverse.ts",
- "target": "src/graph/traverse.ts#Direction",
- "relation": "contains",
- "confidence": "extracted"
+ "source": "src/graph/workspace.ts#federateCallers",
+ "target": "src/graph/traverse.ts#edgeWalk",
+ "relation": "calls",
+ "confidence": "inferred"
},
{
- "source": "src/graph/traverse.ts",
- "target": "src/graph/traverse.ts#EdgeHit",
- "relation": "contains",
- "confidence": "extracted"
+ "source": "src/graph/workspace.ts#federateCallers",
+ "target": "src/graph/traverse.ts#resolveSymbol",
+ "relation": "calls",
+ "confidence": "inferred"
},
{
- "source": "src/graph/traverse.ts",
- "target": "src/graph/traverse.ts#edgeWalk",
- "relation": "contains",
+ "source": "src/graph/workspace.ts#federateCallers",
+ "target": "src/graph/workspace.ts#coverageNote",
+ "relation": "calls",
"confidence": "extracted"
},
{
- "source": "src/graph/traverse.ts",
- "target": "src/graph/traverse.ts#impactOf",
- "relation": "contains",
+ "source": "src/graph/workspace.ts#federateCallers",
+ "target": "src/graph/workspace.ts#loadWorkspaceGraphs",
+ "relation": "calls",
"confidence": "extracted"
},
{
- "source": "src/graph/traverse.ts",
- "target": "src/graph/traverse.ts#impactOfFile",
- "relation": "contains",
- "confidence": "extracted"
+ "source": "src/graph/workspace.ts#federateCheck",
+ "target": "src/graph/check.ts#checkGraph",
+ "relation": "calls",
+ "confidence": "inferred"
},
{
- "source": "src/graph/traverse.ts",
- "target": "src/graph/traverse.ts#impactOfMany",
- "relation": "contains",
+ "source": "src/graph/workspace.ts#federateCheck",
+ "target": "src/graph/workspace.ts#coverageNote",
+ "relation": "calls",
"confidence": "extracted"
},
{
- "source": "src/graph/traverse.ts",
- "target": "src/graph/traverse.ts#resolveSymbol",
- "relation": "contains",
+ "source": "src/graph/workspace.ts#federateCheck",
+ "target": "src/graph/workspace.ts#loadWorkspaceGraphs",
+ "relation": "calls",
"confidence": "extracted"
},
{
- "source": "src/graph/traverse.ts",
- "target": "src/graph/traverse.ts#ResolveSymbolOptions",
- "relation": "contains",
+ "source": "src/graph/workspace.ts#federateGrep",
+ "target": "src/graph/workspace.ts#coverageNote",
+ "relation": "calls",
"confidence": "extracted"
},
{
- "source": "src/graph/traverse.ts",
- "target": "src/graph/traverse.ts#SymbolMatch",
- "relation": "contains",
+ "source": "src/graph/workspace.ts#federateGrep",
+ "target": "src/graph/workspace.ts#loadWorkspaceGraphs",
+ "relation": "calls",
"confidence": "extracted"
},
{
- "source": "src/graph/traverse.ts",
- "target": "src/graph/traverse.ts#symbolMatches",
- "relation": "contains",
- "confidence": "extracted"
+ "source": "src/graph/workspace.ts#federateGrep",
+ "target": "src/search/grep.ts#grepGraph",
+ "relation": "calls",
+ "confidence": "inferred"
},
{
- "source": "src/graph/traverse.ts",
- "target": "src/graph/traverse.ts#symbolsInFile",
- "relation": "contains",
- "confidence": "extracted"
+ "source": "src/graph/workspace.ts#federateMap",
+ "target": "src/graph/map.ts#buildRepoMap",
+ "relation": "calls",
+ "confidence": "inferred"
},
{
- "source": "src/graph/traverse.ts",
- "target": "src/graph/relations.ts",
- "relation": "imports",
- "confidence": "extracted"
+ "source": "src/graph/workspace.ts#federateMap",
+ "target": "src/graph/map.ts#formatRepoMap",
+ "relation": "calls",
+ "confidence": "inferred"
},
{
- "source": "src/graph/traverse.ts",
- "target": "src/graph/types.ts",
- "relation": "imports",
+ "source": "src/graph/workspace.ts#federateMap",
+ "target": "src/graph/workspace.ts#coverageNote",
+ "relation": "calls",
"confidence": "extracted"
},
{
- "source": "src/graph/traverse.ts#edgeWalk",
- "target": "src/graph/traverse.ts#calleesOf",
+ "source": "src/graph/workspace.ts#federateMap",
+ "target": "src/graph/workspace.ts#loadWorkspaceGraphs",
"relation": "calls",
"confidence": "extracted"
},
{
- "source": "src/graph/traverse.ts#edgeWalk",
- "target": "src/graph/traverse.ts#callersOf",
+ "source": "src/graph/workspace.ts#hasMegaGraph",
+ "target": "src/context/node-file.ts#contextDirFor",
"relation": "calls",
- "confidence": "extracted"
+ "confidence": "inferred"
},
{
- "source": "src/graph/traverse.ts#edgeWalk",
- "target": "src/graph/traverse.ts#impactOfFile",
+ "source": "src/graph/workspace.ts#hasMegaGraph",
+ "target": "src/graph/write.ts#wiringPath",
"relation": "calls",
- "confidence": "extracted"
+ "confidence": "inferred"
},
{
- "source": "src/graph/traverse.ts#edgeWalk",
- "target": "src/graph/traverse.ts#impactOfMany",
+ "source": "src/graph/workspace.ts#isWorkspaceBuildRoot",
+ "target": "src/graph/scopes.ts#discoverWorkspaceChildren",
"relation": "calls",
- "confidence": "extracted"
+ "confidence": "inferred"
},
{
- "source": "src/graph/traverse.ts#impactOf",
- "target": "src/graph/traverse.ts#impactOfMany",
+ "source": "src/graph/workspace.ts#isWorkspaceBuildRoot",
+ "target": "src/graph/workspace.ts#readWorkspace",
"relation": "calls",
"confidence": "extracted"
},
{
- "source": "src/graph/traverse.ts#impactOfFile",
- "target": "src/graph/traverse.ts#impactOfMany",
+ "source": "src/graph/workspace.ts#loadWorkspaceGraphs",
+ "target": "src/context/node-file.ts#contextDirFor",
"relation": "calls",
- "confidence": "extracted"
+ "confidence": "inferred"
},
{
- "source": "src/graph/traverse.ts#impactOfFile",
- "target": "src/graph/traverse.ts#symbolsInFile",
+ "source": "src/graph/workspace.ts#loadWorkspaceGraphs",
+ "target": "src/graph/load.ts#loadGraphCached",
"relation": "calls",
- "confidence": "extracted"
+ "confidence": "inferred"
},
{
- "source": "src/graph/traverse.ts#resolveSymbol",
- "target": "src/graph/traverse.ts#symbolMatches",
+ "source": "src/graph/workspace.ts#loadWorkspaceGraphs",
+ "target": "src/graph/scopes.ts#discoverWorkspaceChildren",
"relation": "calls",
- "confidence": "extracted"
+ "confidence": "inferred"
},
{
- "source": "src/graph/types.ts",
- "target": "src/graph/types.ts#Confidence",
- "relation": "contains",
+ "source": "src/graph/workspace.ts#loadWorkspaceGraphs",
+ "target": "src/graph/workspace.ts#readWorkspace",
+ "relation": "calls",
"confidence": "extracted"
},
{
- "source": "src/graph/types.ts",
- "target": "src/graph/types.ts#Crux",
- "relation": "contains",
+ "source": "src/graph/workspace.ts#readWorkspace",
+ "target": "src/graph/workspace.ts#workspacePath",
+ "relation": "calls",
"confidence": "extracted"
},
{
- "source": "src/graph/types.ts",
- "target": "src/graph/types.ts#EdgeV1",
- "relation": "contains",
- "confidence": "extracted"
+ "source": "src/graph/workspace.ts#splitWorkspace",
+ "target": "src/graph/scopes.ts#discoverWorkspaceChildren",
+ "relation": "calls",
+ "confidence": "inferred"
},
{
- "source": "src/graph/types.ts",
- "target": "src/graph/types.ts#GraphV1",
- "relation": "contains",
- "confidence": "extracted"
+ "source": "src/graph/workspace.ts#splitWorkspace",
+ "target": "src/graph/workspace-cli.ts#runWorkspaceBuild.buildChild",
+ "relation": "calls",
+ "confidence": "inferred"
},
{
- "source": "src/graph/types.ts",
- "target": "src/graph/types.ts#Kind",
- "relation": "contains",
+ "source": "src/graph/workspace.ts#splitWorkspace",
+ "target": "src/graph/workspace.ts#clearParentGraft",
+ "relation": "calls",
"confidence": "extracted"
},
{
- "source": "src/graph/types.ts",
- "target": "src/graph/types.ts#NodeV1",
- "relation": "contains",
+ "source": "src/graph/workspace.ts#splitWorkspace",
+ "target": "src/graph/workspace.ts#hasMegaGraph",
+ "relation": "calls",
"confidence": "extracted"
},
{
- "source": "src/graph/types.ts",
- "target": "src/graph/types.ts#Relation",
- "relation": "contains",
+ "source": "src/graph/workspace.ts#splitWorkspace",
+ "target": "src/graph/workspace.ts#writeWorkspace",
+ "relation": "calls",
"confidence": "extracted"
},
{
- "source": "src/graph/types.ts",
- "target": "src/graph/types.ts#ScopeV1",
- "relation": "contains",
- "confidence": "extracted"
+ "source": "src/graph/workspace.ts#workspacePath",
+ "target": "src/context/node-file.ts#contextDirFor",
+ "relation": "calls",
+ "confidence": "inferred"
},
{
- "source": "src/graph/types.ts",
- "target": "src/graph/types.ts#SummaryState",
- "relation": "contains",
- "confidence": "extracted"
+ "source": "src/graph/workspace.ts#writeWorkspace",
+ "target": "src/context/node-file.ts#contextDirFor",
+ "relation": "calls",
+ "confidence": "inferred"
},
{
"source": "src/graph/write.ts",
@@ -20484,6 +22027,12 @@
"relation": "contains",
"confidence": "extracted"
},
+ {
+ "source": "src/mcp/tools.ts",
+ "target": "src/mcp/tools.ts#callWorkspaceTool",
+ "relation": "contains",
+ "confidence": "extracted"
+ },
{
"source": "src/mcp/tools.ts",
"target": "src/mcp/tools.ts#renderMatches",
@@ -20568,6 +22117,12 @@
"relation": "imports",
"confidence": "extracted"
},
+ {
+ "source": "src/mcp/tools.ts",
+ "target": "src/graph/workspace.ts",
+ "relation": "imports",
+ "confidence": "extracted"
+ },
{
"source": "src/mcp/tools.ts",
"target": "src/search/grep-cli.ts",
@@ -20676,6 +22231,18 @@
"relation": "calls",
"confidence": "inferred"
},
+ {
+ "source": "src/mcp/tools.ts#callTool",
+ "target": "src/graph/workspace.ts#readWorkspace",
+ "relation": "calls",
+ "confidence": "inferred"
+ },
+ {
+ "source": "src/mcp/tools.ts#callTool",
+ "target": "src/mcp/tools.ts#callWorkspaceTool",
+ "relation": "calls",
+ "confidence": "extracted"
+ },
{
"source": "src/mcp/tools.ts#callTool",
"target": "src/mcp/tools.ts#renderMatches",
@@ -20683,26 +22250,74 @@
"confidence": "extracted"
},
{
- "source": "src/mcp/tools.ts#callTool",
- "target": "src/mcp/tools.ts#unknownSymbolText",
+ "source": "src/mcp/tools.ts#callTool",
+ "target": "src/mcp/tools.ts#unknownSymbolText",
+ "relation": "calls",
+ "confidence": "extracted"
+ },
+ {
+ "source": "src/mcp/tools.ts#callTool",
+ "target": "src/search/grep-cli.ts#formatGrepResult",
+ "relation": "calls",
+ "confidence": "inferred"
+ },
+ {
+ "source": "src/mcp/tools.ts#callTool",
+ "target": "src/search/grep-cli.ts#zeroHitNote",
+ "relation": "calls",
+ "confidence": "inferred"
+ },
+ {
+ "source": "src/mcp/tools.ts#callTool",
+ "target": "src/search/grep.ts#grepGraph",
+ "relation": "calls",
+ "confidence": "inferred"
+ },
+ {
+ "source": "src/mcp/tools.ts#callWorkspaceTool",
+ "target": "src/ask/ask.ts#formatAsk",
+ "relation": "calls",
+ "confidence": "inferred"
+ },
+ {
+ "source": "src/mcp/tools.ts#callWorkspaceTool",
+ "target": "src/graph/workspace.ts#federateAsk",
+ "relation": "calls",
+ "confidence": "inferred"
+ },
+ {
+ "source": "src/mcp/tools.ts#callWorkspaceTool",
+ "target": "src/graph/workspace.ts#federateCallers",
+ "relation": "calls",
+ "confidence": "inferred"
+ },
+ {
+ "source": "src/mcp/tools.ts#callWorkspaceTool",
+ "target": "src/graph/workspace.ts#federateCheck",
+ "relation": "calls",
+ "confidence": "inferred"
+ },
+ {
+ "source": "src/mcp/tools.ts#callWorkspaceTool",
+ "target": "src/graph/workspace.ts#federateGrep",
"relation": "calls",
- "confidence": "extracted"
+ "confidence": "inferred"
},
{
- "source": "src/mcp/tools.ts#callTool",
- "target": "src/search/grep-cli.ts#formatGrepResult",
+ "source": "src/mcp/tools.ts#callWorkspaceTool",
+ "target": "src/graph/workspace.ts#federateMap",
"relation": "calls",
"confidence": "inferred"
},
{
- "source": "src/mcp/tools.ts#callTool",
- "target": "src/search/grep-cli.ts#zeroHitNote",
+ "source": "src/mcp/tools.ts#callWorkspaceTool",
+ "target": "src/search/grep-cli.ts#formatGrepResult",
"relation": "calls",
"confidence": "inferred"
},
{
- "source": "src/mcp/tools.ts#callTool",
- "target": "src/search/grep.ts#grepGraph",
+ "source": "src/mcp/tools.ts#callWorkspaceTool",
+ "target": "src/search/grep-cli.ts#zeroHitNote",
"relation": "calls",
"confidence": "inferred"
},
@@ -21486,6 +23101,12 @@
"relation": "calls",
"confidence": "inferred"
},
+ {
+ "source": "test/ask.test.ts",
+ "target": "test/ask.test.ts#crossSeamMonorepoFixture",
+ "relation": "calls",
+ "confidence": "extracted"
+ },
{
"source": "test/ask.test.ts",
"target": "test/ask.test.ts#duplicateNameFixture",
@@ -21534,6 +23155,12 @@
"relation": "calls",
"confidence": "extracted"
},
+ {
+ "source": "test/ask.test.ts",
+ "target": "test/ask.test.ts#crossSeamMonorepoFixture",
+ "relation": "contains",
+ "confidence": "extracted"
+ },
{
"source": "test/ask.test.ts",
"target": "test/ask.test.ts#duplicateNameFixture",
@@ -21744,6 +23371,12 @@
"relation": "imports",
"confidence": "extracted"
},
+ {
+ "source": "test/claude-hooks.test.ts",
+ "target": "src/claude/hooks.ts#lastFileScopeHint",
+ "relation": "calls",
+ "confidence": "inferred"
+ },
{
"source": "test/claude-hooks.test.ts",
"target": "src/claude/hooks.ts#underGraft",
@@ -21786,6 +23419,18 @@
"relation": "calls",
"confidence": "extracted"
},
+ {
+ "source": "test/claude-hooks.test.ts",
+ "target": "test/claude-hooks.test.ts#writeAskArgsStub",
+ "relation": "calls",
+ "confidence": "extracted"
+ },
+ {
+ "source": "test/claude-hooks.test.ts",
+ "target": "test/claude-hooks.test.ts#writeMultiScopeWiring",
+ "relation": "calls",
+ "confidence": "extracted"
+ },
{
"source": "test/claude-hooks.test.ts",
"target": "test/claude-hooks.test.ts#fakeBuild",
@@ -21798,6 +23443,18 @@
"relation": "contains",
"confidence": "extracted"
},
+ {
+ "source": "test/claude-hooks.test.ts",
+ "target": "test/claude-hooks.test.ts#writeAskArgsStub",
+ "relation": "contains",
+ "confidence": "extracted"
+ },
+ {
+ "source": "test/claude-hooks.test.ts",
+ "target": "test/claude-hooks.test.ts#writeMultiScopeWiring",
+ "relation": "contains",
+ "confidence": "extracted"
+ },
{
"source": "test/claude-hooks.test.ts",
"target": "node:assert/strict",
@@ -22836,12 +24493,24 @@
"relation": "calls",
"confidence": "extracted"
},
+ {
+ "source": "test/graph-map.test.ts",
+ "target": "test/graph-map.test.ts#graphOfWithScopes",
+ "relation": "calls",
+ "confidence": "extracted"
+ },
{
"source": "test/graph-map.test.ts",
"target": "test/graph-map.test.ts#symNode",
"relation": "calls",
"confidence": "extracted"
},
+ {
+ "source": "test/graph-map.test.ts",
+ "target": "test/graph-map.test.ts#twoScopeFixture",
+ "relation": "calls",
+ "confidence": "extracted"
+ },
{
"source": "test/graph-map.test.ts",
"target": "test/graph-map.test.ts#bigFixture",
@@ -22866,12 +24535,24 @@
"relation": "contains",
"confidence": "extracted"
},
+ {
+ "source": "test/graph-map.test.ts",
+ "target": "test/graph-map.test.ts#graphOfWithScopes",
+ "relation": "contains",
+ "confidence": "extracted"
+ },
{
"source": "test/graph-map.test.ts",
"target": "test/graph-map.test.ts#symNode",
"relation": "contains",
"confidence": "extracted"
},
+ {
+ "source": "test/graph-map.test.ts",
+ "target": "test/graph-map.test.ts#twoScopeFixture",
+ "relation": "contains",
+ "confidence": "extracted"
+ },
{
"source": "test/graph-map.test.ts",
"target": "node:assert/strict",
@@ -22920,6 +24601,30 @@
"relation": "calls",
"confidence": "extracted"
},
+ {
+ "source": "test/graph-map.test.ts#graphOfWithScopes",
+ "target": "test/graph-map.test.ts#graphOf",
+ "relation": "calls",
+ "confidence": "extracted"
+ },
+ {
+ "source": "test/graph-map.test.ts#twoScopeFixture",
+ "target": "test/graph-map.test.ts#fileNode",
+ "relation": "calls",
+ "confidence": "extracted"
+ },
+ {
+ "source": "test/graph-map.test.ts#twoScopeFixture",
+ "target": "test/graph-map.test.ts#graphOfWithScopes",
+ "relation": "calls",
+ "confidence": "extracted"
+ },
+ {
+ "source": "test/graph-map.test.ts#twoScopeFixture",
+ "target": "test/graph-map.test.ts#symNode",
+ "relation": "calls",
+ "confidence": "extracted"
+ },
{
"source": "test/graph-resolve-typed.test.ts",
"target": "src/graph/resolve.ts#resolveEdges",
@@ -24223,128 +25928,320 @@
"confidence": "extracted"
},
{
- "source": "test/mcp-server.test.ts",
- "target": "node:os",
- "relation": "imports",
- "confidence": "extracted"
+ "source": "test/mcp-server.test.ts",
+ "target": "node:os",
+ "relation": "imports",
+ "confidence": "extracted"
+ },
+ {
+ "source": "test/mcp-server.test.ts",
+ "target": "node:path",
+ "relation": "imports",
+ "confidence": "extracted"
+ },
+ {
+ "source": "test/mcp-server.test.ts",
+ "target": "node:test",
+ "relation": "imports",
+ "confidence": "extracted"
+ },
+ {
+ "source": "test/mcp-tools.test.ts",
+ "target": "src/mcp/tools.ts#callTool",
+ "relation": "calls",
+ "confidence": "inferred"
+ },
+ {
+ "source": "test/mcp-tools.test.ts",
+ "target": "test/mcp-tools.test.ts#builtRepo",
+ "relation": "calls",
+ "confidence": "extracted"
+ },
+ {
+ "source": "test/mcp-tools.test.ts",
+ "target": "test/mcp-tools.test.ts#chainRepo",
+ "relation": "calls",
+ "confidence": "extracted"
+ },
+ {
+ "source": "test/mcp-tools.test.ts",
+ "target": "test/mcp-tools.test.ts#customDirRepo",
+ "relation": "calls",
+ "confidence": "extracted"
+ },
+ {
+ "source": "test/mcp-tools.test.ts",
+ "target": "test/mcp-tools.test.ts#fileScopeRepo",
+ "relation": "calls",
+ "confidence": "extracted"
+ },
+ {
+ "source": "test/mcp-tools.test.ts",
+ "target": "test/mcp-tools.test.ts#multiDirRepo",
+ "relation": "calls",
+ "confidence": "extracted"
+ },
+ {
+ "source": "test/mcp-tools.test.ts",
+ "target": "test/mcp-tools.test.ts#builtRepo",
+ "relation": "contains",
+ "confidence": "extracted"
+ },
+ {
+ "source": "test/mcp-tools.test.ts",
+ "target": "test/mcp-tools.test.ts#chainRepo",
+ "relation": "contains",
+ "confidence": "extracted"
+ },
+ {
+ "source": "test/mcp-tools.test.ts",
+ "target": "test/mcp-tools.test.ts#customDirRepo",
+ "relation": "contains",
+ "confidence": "extracted"
+ },
+ {
+ "source": "test/mcp-tools.test.ts",
+ "target": "test/mcp-tools.test.ts#fileScopeRepo",
+ "relation": "contains",
+ "confidence": "extracted"
+ },
+ {
+ "source": "test/mcp-tools.test.ts",
+ "target": "test/mcp-tools.test.ts#multiDirRepo",
+ "relation": "contains",
+ "confidence": "extracted"
+ },
+ {
+ "source": "test/mcp-tools.test.ts",
+ "target": "node:assert/strict",
+ "relation": "imports",
+ "confidence": "extracted"
+ },
+ {
+ "source": "test/mcp-tools.test.ts",
+ "target": "node:child_process",
+ "relation": "imports",
+ "confidence": "extracted"
+ },
+ {
+ "source": "test/mcp-tools.test.ts",
+ "target": "node:fs",
+ "relation": "imports",
+ "confidence": "extracted"
+ },
+ {
+ "source": "test/mcp-tools.test.ts",
+ "target": "node:os",
+ "relation": "imports",
+ "confidence": "extracted"
+ },
+ {
+ "source": "test/mcp-tools.test.ts",
+ "target": "node:path",
+ "relation": "imports",
+ "confidence": "extracted"
+ },
+ {
+ "source": "test/mcp-tools.test.ts",
+ "target": "node:test",
+ "relation": "imports",
+ "confidence": "extracted"
+ },
+ {
+ "source": "test/mcp-tools.test.ts",
+ "target": "src/mcp/tools.ts",
+ "relation": "imports",
+ "confidence": "extracted"
+ },
+ {
+ "source": "test/regression-single-repo.test.ts",
+ "target": "src/ask/ask.ts#ask",
+ "relation": "calls",
+ "confidence": "inferred"
+ },
+ {
+ "source": "test/regression-single-repo.test.ts",
+ "target": "src/ask/ask.ts#formatAsk",
+ "relation": "calls",
+ "confidence": "inferred"
+ },
+ {
+ "source": "test/regression-single-repo.test.ts",
+ "target": "src/context/node-file.ts#contextDirFor",
+ "relation": "calls",
+ "confidence": "inferred"
+ },
+ {
+ "source": "test/regression-single-repo.test.ts",
+ "target": "src/graph/build.ts#buildGraph",
+ "relation": "calls",
+ "confidence": "inferred"
+ },
+ {
+ "source": "test/regression-single-repo.test.ts",
+ "target": "src/graph/load.ts#loadGraphCached",
+ "relation": "calls",
+ "confidence": "inferred"
+ },
+ {
+ "source": "test/regression-single-repo.test.ts",
+ "target": "src/graph/map.ts#buildRepoMap",
+ "relation": "calls",
+ "confidence": "inferred"
+ },
+ {
+ "source": "test/regression-single-repo.test.ts",
+ "target": "src/graph/map.ts#formatRepoMap",
+ "relation": "calls",
+ "confidence": "inferred"
+ },
+ {
+ "source": "test/regression-single-repo.test.ts",
+ "target": "src/graph/scopes.ts#scopesOfGraph",
+ "relation": "calls",
+ "confidence": "inferred"
+ },
+ {
+ "source": "test/regression-single-repo.test.ts",
+ "target": "src/graph/traverse.ts#callersOf",
+ "relation": "calls",
+ "confidence": "inferred"
+ },
+ {
+ "source": "test/regression-single-repo.test.ts",
+ "target": "src/graph/traverse.ts#resolveSymbol",
+ "relation": "calls",
+ "confidence": "inferred"
},
{
- "source": "test/mcp-server.test.ts",
- "target": "node:path",
- "relation": "imports",
- "confidence": "extracted"
+ "source": "test/regression-single-repo.test.ts",
+ "target": "src/graph/write.ts#readGraph",
+ "relation": "calls",
+ "confidence": "inferred"
},
{
- "source": "test/mcp-server.test.ts",
- "target": "node:test",
- "relation": "imports",
- "confidence": "extracted"
+ "source": "test/regression-single-repo.test.ts",
+ "target": "src/graph/write.ts#wiringPath",
+ "relation": "calls",
+ "confidence": "inferred"
},
{
- "source": "test/mcp-tools.test.ts",
- "target": "src/mcp/tools.ts#callTool",
+ "source": "test/regression-single-repo.test.ts",
+ "target": "src/search/grep.ts#grepGraph",
"relation": "calls",
"confidence": "inferred"
},
{
- "source": "test/mcp-tools.test.ts",
- "target": "test/mcp-tools.test.ts#builtRepo",
+ "source": "test/regression-single-repo.test.ts",
+ "target": "test/regression-single-repo.test.ts#assertScopeFreeText",
"relation": "calls",
"confidence": "extracted"
},
{
- "source": "test/mcp-tools.test.ts",
- "target": "test/mcp-tools.test.ts#chainRepo",
+ "source": "test/regression-single-repo.test.ts",
+ "target": "test/regression-single-repo.test.ts#fx",
"relation": "calls",
"confidence": "extracted"
},
{
- "source": "test/mcp-tools.test.ts",
- "target": "test/mcp-tools.test.ts#customDirRepo",
- "relation": "calls",
+ "source": "test/regression-single-repo.test.ts",
+ "target": "test/regression-single-repo.test.ts#assertScopeFreeText",
+ "relation": "contains",
"confidence": "extracted"
},
{
- "source": "test/mcp-tools.test.ts",
- "target": "test/mcp-tools.test.ts#fileScopeRepo",
- "relation": "calls",
+ "source": "test/regression-single-repo.test.ts",
+ "target": "test/regression-single-repo.test.ts#fx",
+ "relation": "contains",
"confidence": "extracted"
},
{
- "source": "test/mcp-tools.test.ts",
- "target": "test/mcp-tools.test.ts#multiDirRepo",
- "relation": "calls",
+ "source": "test/regression-single-repo.test.ts",
+ "target": "node:assert/strict",
+ "relation": "imports",
"confidence": "extracted"
},
{
- "source": "test/mcp-tools.test.ts",
- "target": "test/mcp-tools.test.ts#builtRepo",
- "relation": "contains",
+ "source": "test/regression-single-repo.test.ts",
+ "target": "node:fs",
+ "relation": "imports",
"confidence": "extracted"
},
{
- "source": "test/mcp-tools.test.ts",
- "target": "test/mcp-tools.test.ts#chainRepo",
- "relation": "contains",
+ "source": "test/regression-single-repo.test.ts",
+ "target": "node:os",
+ "relation": "imports",
"confidence": "extracted"
},
{
- "source": "test/mcp-tools.test.ts",
- "target": "test/mcp-tools.test.ts#customDirRepo",
- "relation": "contains",
+ "source": "test/regression-single-repo.test.ts",
+ "target": "node:path",
+ "relation": "imports",
"confidence": "extracted"
},
{
- "source": "test/mcp-tools.test.ts",
- "target": "test/mcp-tools.test.ts#fileScopeRepo",
- "relation": "contains",
+ "source": "test/regression-single-repo.test.ts",
+ "target": "node:test",
+ "relation": "imports",
"confidence": "extracted"
},
{
- "source": "test/mcp-tools.test.ts",
- "target": "test/mcp-tools.test.ts#multiDirRepo",
- "relation": "contains",
+ "source": "test/regression-single-repo.test.ts",
+ "target": "src/ask/ask.ts",
+ "relation": "imports",
"confidence": "extracted"
},
{
- "source": "test/mcp-tools.test.ts",
- "target": "node:assert/strict",
+ "source": "test/regression-single-repo.test.ts",
+ "target": "src/context/node-file.ts",
"relation": "imports",
"confidence": "extracted"
},
{
- "source": "test/mcp-tools.test.ts",
- "target": "node:child_process",
+ "source": "test/regression-single-repo.test.ts",
+ "target": "src/graph/build.ts",
"relation": "imports",
"confidence": "extracted"
},
{
- "source": "test/mcp-tools.test.ts",
- "target": "node:fs",
+ "source": "test/regression-single-repo.test.ts",
+ "target": "src/graph/load.ts",
"relation": "imports",
"confidence": "extracted"
},
{
- "source": "test/mcp-tools.test.ts",
- "target": "node:os",
+ "source": "test/regression-single-repo.test.ts",
+ "target": "src/graph/map.ts",
"relation": "imports",
"confidence": "extracted"
},
{
- "source": "test/mcp-tools.test.ts",
- "target": "node:path",
+ "source": "test/regression-single-repo.test.ts",
+ "target": "src/graph/scopes.ts",
"relation": "imports",
"confidence": "extracted"
},
{
- "source": "test/mcp-tools.test.ts",
- "target": "node:test",
+ "source": "test/regression-single-repo.test.ts",
+ "target": "src/graph/traverse.ts",
"relation": "imports",
"confidence": "extracted"
},
{
- "source": "test/mcp-tools.test.ts",
- "target": "src/mcp/tools.ts",
+ "source": "test/regression-single-repo.test.ts",
+ "target": "src/graph/types.ts",
+ "relation": "imports",
+ "confidence": "extracted"
+ },
+ {
+ "source": "test/regression-single-repo.test.ts",
+ "target": "src/graph/write.ts",
+ "relation": "imports",
+ "confidence": "extracted"
+ },
+ {
+ "source": "test/regression-single-repo.test.ts",
+ "target": "src/search/grep.ts",
"relation": "imports",
"confidence": "extracted"
},
@@ -24612,6 +26509,216 @@
"relation": "imports",
"confidence": "extracted"
},
+ {
+ "source": "test/workspace.test.ts",
+ "target": "src/ask/ask.ts#ask",
+ "relation": "calls",
+ "confidence": "inferred"
+ },
+ {
+ "source": "test/workspace.test.ts",
+ "target": "src/ask/ask.ts#formatAsk",
+ "relation": "calls",
+ "confidence": "inferred"
+ },
+ {
+ "source": "test/workspace.test.ts",
+ "target": "src/context/node-file.ts#contextDirFor",
+ "relation": "calls",
+ "confidence": "inferred"
+ },
+ {
+ "source": "test/workspace.test.ts",
+ "target": "src/graph/build.ts#buildGraph",
+ "relation": "calls",
+ "confidence": "inferred"
+ },
+ {
+ "source": "test/workspace.test.ts",
+ "target": "src/graph/workspace.ts#coverageNote",
+ "relation": "calls",
+ "confidence": "inferred"
+ },
+ {
+ "source": "test/workspace.test.ts",
+ "target": "src/graph/workspace.ts#federateAsk",
+ "relation": "calls",
+ "confidence": "inferred"
+ },
+ {
+ "source": "test/workspace.test.ts",
+ "target": "src/graph/workspace.ts#federateCallers",
+ "relation": "calls",
+ "confidence": "inferred"
+ },
+ {
+ "source": "test/workspace.test.ts",
+ "target": "src/graph/workspace.ts#federateCheck",
+ "relation": "calls",
+ "confidence": "inferred"
+ },
+ {
+ "source": "test/workspace.test.ts",
+ "target": "src/graph/workspace.ts#federateGrep",
+ "relation": "calls",
+ "confidence": "inferred"
+ },
+ {
+ "source": "test/workspace.test.ts",
+ "target": "src/graph/workspace.ts#isWorkspaceBuildRoot",
+ "relation": "calls",
+ "confidence": "inferred"
+ },
+ {
+ "source": "test/workspace.test.ts",
+ "target": "src/graph/workspace.ts#loadWorkspaceGraphs",
+ "relation": "calls",
+ "confidence": "inferred"
+ },
+ {
+ "source": "test/workspace.test.ts",
+ "target": "src/graph/workspace.ts#migrationNote",
+ "relation": "calls",
+ "confidence": "inferred"
+ },
+ {
+ "source": "test/workspace.test.ts",
+ "target": "src/graph/workspace.ts#readWorkspace",
+ "relation": "calls",
+ "confidence": "inferred"
+ },
+ {
+ "source": "test/workspace.test.ts",
+ "target": "src/graph/workspace.ts#writeWorkspace",
+ "relation": "calls",
+ "confidence": "inferred"
+ },
+ {
+ "source": "test/workspace.test.ts",
+ "target": "src/graph/write.ts#wiringPath",
+ "relation": "calls",
+ "confidence": "inferred"
+ },
+ {
+ "source": "test/workspace.test.ts",
+ "target": "src/graph/write.ts#writeGraph",
+ "relation": "calls",
+ "confidence": "inferred"
+ },
+ {
+ "source": "test/workspace.test.ts",
+ "target": "test/workspace.test.ts#buildWorkspace",
+ "relation": "calls",
+ "confidence": "extracted"
+ },
+ {
+ "source": "test/workspace.test.ts",
+ "target": "test/workspace.test.ts#pad",
+ "relation": "calls",
+ "confidence": "extracted"
+ },
+ {
+ "source": "test/workspace.test.ts",
+ "target": "test/workspace.test.ts#workspaceFx",
+ "relation": "calls",
+ "confidence": "extracted"
+ },
+ {
+ "source": "test/workspace.test.ts",
+ "target": "test/workspace.test.ts#buildWorkspace",
+ "relation": "contains",
+ "confidence": "extracted"
+ },
+ {
+ "source": "test/workspace.test.ts",
+ "target": "test/workspace.test.ts#pad",
+ "relation": "contains",
+ "confidence": "extracted"
+ },
+ {
+ "source": "test/workspace.test.ts",
+ "target": "test/workspace.test.ts#workspaceFx",
+ "relation": "contains",
+ "confidence": "extracted"
+ },
+ {
+ "source": "test/workspace.test.ts",
+ "target": "node:assert/strict",
+ "relation": "imports",
+ "confidence": "extracted"
+ },
+ {
+ "source": "test/workspace.test.ts",
+ "target": "node:fs",
+ "relation": "imports",
+ "confidence": "extracted"
+ },
+ {
+ "source": "test/workspace.test.ts",
+ "target": "node:os",
+ "relation": "imports",
+ "confidence": "extracted"
+ },
+ {
+ "source": "test/workspace.test.ts",
+ "target": "node:path",
+ "relation": "imports",
+ "confidence": "extracted"
+ },
+ {
+ "source": "test/workspace.test.ts",
+ "target": "node:test",
+ "relation": "imports",
+ "confidence": "extracted"
+ },
+ {
+ "source": "test/workspace.test.ts",
+ "target": "src/ask/ask.ts",
+ "relation": "imports",
+ "confidence": "extracted"
+ },
+ {
+ "source": "test/workspace.test.ts",
+ "target": "src/context/node-file.ts",
+ "relation": "imports",
+ "confidence": "extracted"
+ },
+ {
+ "source": "test/workspace.test.ts",
+ "target": "src/graph/build.ts",
+ "relation": "imports",
+ "confidence": "extracted"
+ },
+ {
+ "source": "test/workspace.test.ts",
+ "target": "src/graph/types.ts",
+ "relation": "imports",
+ "confidence": "extracted"
+ },
+ {
+ "source": "test/workspace.test.ts",
+ "target": "src/graph/workspace.ts",
+ "relation": "imports",
+ "confidence": "extracted"
+ },
+ {
+ "source": "test/workspace.test.ts",
+ "target": "src/graph/write.ts",
+ "relation": "imports",
+ "confidence": "extracted"
+ },
+ {
+ "source": "test/workspace.test.ts#buildWorkspace",
+ "target": "src/graph/build.ts#buildGraph",
+ "relation": "calls",
+ "confidence": "inferred"
+ },
+ {
+ "source": "test/workspace.test.ts#buildWorkspace",
+ "target": "src/graph/workspace.ts#splitWorkspace",
+ "relation": "calls",
+ "confidence": "inferred"
+ },
{
"source": "viewer/data.ts",
"target": "viewer/data.ts#chipKey",
diff --git a/graft/INDEX.md b/graft/INDEX.md
index 661b8064..81b20a85 100644
--- a/graft/INDEX.md
+++ b/graft/INDEX.md
@@ -38,5 +38,5 @@ filename here, or run `graft ask "<task>"`. Each node carries prose plus exact
## Files
-116 per-file wiring cards mirror the source tree under `graft/` (105 carry extracted symbols). They are deliberately not enumerated here —
+120 per-file wiring cards mirror the source tree under `graft/` (109 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/host-management-and-configuration.md b/graft/host-management-and-configuration.md
index 1afaa27f..dc57c604 100644
--- a/graft/host-management-and-configuration.md
+++ b/graft/host-management-and-configuration.md
@@ -59,16 +59,16 @@ covers:
at: 'src/hosts/init.ts:L37-L72'
- symbol: instructionBody
kind: function
- at: 'src/hosts/instructions.ts:L6-L43'
+ at: 'src/hosts/instructions.ts:L6-L46'
- symbol: cursorRule
kind: function
- at: 'src/hosts/instructions.ts:L45-L52'
+ at: 'src/hosts/instructions.ts:L48-L55'
- symbol: kiroSteering
kind: function
- at: 'src/hosts/instructions.ts:L54-L60'
+ at: 'src/hosts/instructions.ts:L57-L63'
- symbol: windsurfRule
kind: function
- at: 'src/hosts/instructions.ts:L62-L65'
+ at: 'src/hosts/instructions.ts:L65-L68'
- symbol: McpWrite
kind: interface
at: 'src/hosts/mcp-config.ts:L10-L14'
diff --git a/graft/src/ask/ask.md b/graft/src/ask/ask.md
index 939bca54..d46d0eec 100644
--- a/graft/src/ask/ask.md
+++ b/graft/src/ask/ask.md
@@ -3,38 +3,39 @@
This module provides a mechanism to process natural language queries and return structured results from a codebase, enhancing the ability to find relevant code snippets and their relationships.
- AskHit · interface · L29-L46 — Represents a hit in the query results, encapsulating details about a code symbol and its context.
-- AskResult · interface · L52-L74 — Represents the result of an 'ask' query, encapsulating the query details and the hits found.
-- firstProse · function · L77-L84 — Extracts the first meaningful prose line from a body of text, ignoring headings and blank lines.
-- Corpus · interface · L86-L93 — Defines the structure for holding concepts and graph data used in processing queries.
-- loadCorpus · function · L95-L120 — Loads a corpus of concepts and graph data from a specified directory, enabling query processing.
-- score · function · L129-L140 — Calculates a score for a document based on its token counts relative to a query, enhancing relevance ranking.
-- idfFromDf · function · L146-L150 — Computes the inverse document frequency (IDF) from document frequency (DF) data, aiding in scoring relevance.
-- computeIdf · function · L152-L157 — Generates IDF values from document bags, which are used to weight query matches based on term rarity.
-- computeIdfFromIndex · function · L166-L171 — Calculates IDF values using precomputed index data, optimizing the scoring process for queries.
-- bm25 · function · L178-L194 — Implements the BM25 scoring algorithm to rank documents based on term frequency and document length.
-- subjectWords · function · L206-L208 — Tokenizes a query into words while preserving qualified names, facilitating accurate subject resolution.
-- findSubjectNodes · function · L227-L235 — Finds nodes in the graph that match the structural subject of a query, enhancing query resolution.
-- StructuralOutcome · type · L243-L243 — Defines the possible outcomes of a structural query, indicating whether a result was found, a fallthrough note is needed, or if there was no structural intent.
-- fallthroughNoteFor · function · L245-L250 — Generates a note for cases where a structural query falls back to lexical processing, providing user guidance.
-- structural · function · L252-L301 — Processes a structural query to find relationships in the graph, returning relevant results or fallthrough notes.
-- hasTerm · function · L320-L322 — Checks for the presence of a term in a document's token map, aiding in relevance scoring.
-- matchedIdfShare · function · L331-L345 — Calculates the share of query terms matched by a document, weighted by term rarity for relevance assessment.
-- lexical · function · L347-L627 — Handles lexical queries by scoring documents based on term matches and relevance, returning structured results.
-- bodyLen · function · L463-L467 — Calculates the length of the body of a lexical document to ensure it meets certain criteria for processing.
-- AskOptions · interface · L629-L651 — Defines the options available for configuring the ask function, allowing customization of its behavior.
-- parseSpan · function · L655-L659 — Parses a string pointer into its file path and line range components, facilitating source code navigation.
-- sliceSpan · function · L663-L678 — Reads a specified range of lines from a source file, allowing for inlined code snippets in query results.
-- inlineSource · function · L685-L702 — Inlines the source code for the hits found, providing context directly in the results without needing to open files.
-- hitFiles · function · L706-L715 — Extracts a set of unique file paths from the hits, indicating which files are relevant to the query results.
-- baselineFor · function · L720-L723 — Calculates the baseline file size and character count for the hits, providing a measure of the cost of reading the full files.
-- ask · function · L726-L771 — Handles the main logic for processing a query against a directory, returning structured results based on the query type.
-- SkeletonEntry · interface · L775-L782 — Defines the structure of a skeleton entry, which represents a piece of information extracted from a file.
-- SkeletonResult · interface · L784-L790 — Defines the structure of the result returned from the skeleton function, encapsulating the extracted information.
-- skeleton · function · L795-L825 — Extracts a skeleton representation of a file, providing a summary and context for its contents.
-- startLine · function · L812-L812 — Calculates the starting line number from a given span, aiding in the extraction of relevant code sections.
-- formatSkeleton · function · L828-L838 — Formats the skeleton result into a string representation for display or output purposes.
-- toTokens · function · L841-L843 — Converts a character count into a token count, facilitating the processing of text for queries.
-- formatAsk · function · L846-L888 — Formats the results of an ask query into a string for presentation, ensuring clarity and usability.
-- escalationNudge · function · L895-L902 — function escalationNudge(r: AskResult): string
-- askSavingsFooter · function · L907-L919 — function askSavingsFooter(r: AskResult, body: string): string
-- scopeFooterLines · function · L926-L938 — function scopeFooterLines(r: AskResult): string[]
+- AskResult · interface · L52-L82 — Represents the result of an 'ask' query, encapsulating the query details and the hits found.
+- firstProse · function · L85-L92 — Extracts the first meaningful prose line from a body of text, ignoring headings and blank lines.
+- Corpus · interface · L94-L101 — Defines the structure for holding concepts and graph data used in processing queries.
+- loadCorpus · function · L103-L128 — Loads a corpus of concepts and graph data from a specified directory, enabling query processing.
+- score · function · L137-L148 — Calculates a score for a document based on its token counts relative to a query, enhancing relevance ranking.
+- idfFromDf · function · L154-L158 — Computes the inverse document frequency (IDF) from document frequency (DF) data, aiding in scoring relevance.
+- computeIdf · function · L160-L165 — Generates IDF values from document bags, which are used to weight query matches based on term rarity.
+- computeIdfFromIndex · function · L174-L179 — Calculates IDF values using precomputed index data, optimizing the scoring process for queries.
+- bm25 · function · L186-L202 — Implements the BM25 scoring algorithm to rank documents based on term frequency and document length.
+- subjectWords · function · L214-L216 — Tokenizes a query into words while preserving qualified names, facilitating accurate subject resolution.
+- findSubjectNodes · function · L235-L243 — Finds nodes in the graph that match the structural subject of a query, enhancing query resolution.
+- StructuralOutcome · type · L251-L251 — Defines the possible outcomes of a structural query, indicating whether a result was found, a fallthrough note is needed, or if there was no structural intent.
+- fallthroughNoteFor · function · L253-L258 — Generates a note for cases where a structural query falls back to lexical processing, providing user guidance.
+- structural · function · L260-L309 — Processes a structural query to find relationships in the graph, returning relevant results or fallthrough notes.
+- hasTerm · function · L328-L330 — Checks for the presence of a term in a document's token map, aiding in relevance scoring.
+- strongShare · function · L348-L357 — function strongShare( q: Map<string, number>, node: NodeV1, doc: { name: Map<string, number> }, idf: Map<string, number>, dfltIdf: number, ): number
+- matchedIdfShare · function · L359-L373 — Calculates the share of query terms matched by a document, weighted by term rarity for relevance assessment.
+- lexical · function · L375-L676 — Handles lexical queries by scoring documents based on term matches and relevance, returning structured results.
+- bodyLen · function · L495-L499 — Calculates the length of the body of a lexical document to ensure it meets certain criteria for processing.
+- AskOptions · interface · L678-L700 — Defines the options available for configuring the ask function, allowing customization of its behavior.
+- parseSpan · function · L704-L708 — Parses a string pointer into its file path and line range components, facilitating source code navigation.
+- sliceSpan · function · L712-L727 — Reads a specified range of lines from a source file, allowing for inlined code snippets in query results.
+- inlineSource · function · L734-L751 — Inlines the source code for the hits found, providing context directly in the results without needing to open files.
+- hitFiles · function · L755-L764 — Extracts a set of unique file paths from the hits, indicating which files are relevant to the query results.
+- baselineFor · function · L769-L772 — Calculates the baseline file size and character count for the hits, providing a measure of the cost of reading the full files.
+- ask · function · L775-L820 — Handles the main logic for processing a query against a directory, returning structured results based on the query type.
+- SkeletonEntry · interface · L824-L831 — Defines the structure of a skeleton entry, which represents a piece of information extracted from a file.
+- SkeletonResult · interface · L833-L839 — Defines the structure of the result returned from the skeleton function, encapsulating the extracted information.
+- skeleton · function · L844-L874 — Extracts a skeleton representation of a file, providing a summary and context for its contents.
+- startLine · function · L861-L861 — Calculates the starting line number from a given span, aiding in the extraction of relevant code sections.
+- formatSkeleton · function · L877-L887 — Formats the skeleton result into a string representation for display or output purposes.
+- toTokens · function · L890-L892 — Converts a character count into a token count, facilitating the processing of text for queries.
+- formatAsk · function · L895-L937 — Formats the results of an ask query into a string for presentation, ensuring clarity and usability.
+- escalationNudge · function · L944-L951 — function escalationNudge(r: AskResult): string
+- askSavingsFooter · function · L956-L968 — function askSavingsFooter(r: AskResult, body: string): string
+- scopeFooterLines · function · L975-L987 — function scopeFooterLines(r: AskResult): string[]
diff --git a/graft/src/ask/fuse.md b/graft/src/ask/fuse.md
index 2d0dd174..f4f09cdb 100644
--- a/graft/src/ask/fuse.md
+++ b/graft/src/ask/fuse.md
@@ -1,8 +1,8 @@
# src/ask/fuse.ts
-- ScopedDoc · interface · L24-L28 — interface ScopedDoc
-- FusionResult · interface · L30-L40 — interface FusionResult
-- byScore · function · L52-L54 — function byScore(a: ScopedDoc, b: ScopedDoc): number
-- fuseScopes · function · L67-L130 — function fuseScopes(docs: ScopedDoc[]): FusionResult
-- ScopeRankOps · interface · L136-L143 — interface ScopeRankOps
-- rankScopesAndFuse · function · L164-L223 — function rankScopesAndFuse( scopes: string[], ops: ScopeRankOps, graphWeight: number, rescueFloor: number, ): FusionResult
+- ScopedDoc · interface · L30-L34 — interface ScopedDoc
+- FusionResult · interface · L36-L46 — interface FusionResult
+- byScore · function · L83-L85 — function byScore(a: ScopedDoc, b: ScopedDoc): number
+- fuseScopes · function · L98-L161 — function fuseScopes(docs: ScopedDoc[]): FusionResult
+- ScopeRankOps · interface · L167-L182 — interface ScopeRankOps
+- rankScopesAndFuse · function · L204-L260 — function rankScopesAndFuse( scopes: string[], ops: ScopeRankOps, graphWeight: number, rescueFloor: number, ): FusionResult
diff --git a/graft/src/claude/hooks.md b/graft/src/claude/hooks.md
index bacbdfd8..71c03db3 100644
--- a/graft/src/claude/hooks.md
+++ b/graft/src/claude/hooks.md
@@ -2,13 +2,14 @@
Handles various events related to the Graft system, including session management and user prompts.
-- readStdin · function · L14-L18 — Reads input from standard input, handling test seams and parsing JSON.
-- safeReadFd0 · function · L19-L19 — Safely reads from the standard input file descriptor, returning an empty string on failure.
-- projectDir · function · L21-L23 — Determines the project directory based on environment variables or input parameters.
-- underGraft · function · L24-L27 — Checks if a given file is part of the graft project structure.
-- graftJson · function · L28-L41 — Executes a command to retrieve JSON output from the graft CLI, handling errors gracefully.
-- checkStaleCount · function · L42-L46 — Counts the number of changes in the graft graph to determine if it is stale.
-- emit · function · L47-L49 — Outputs a JSON object to standard output for event tracking.
-- handlePostEdit · function · L51-L57 — Handles post-edit events by updating stats and emitting relevant information.
-- handleStop · function · L59-L73 — Handles the stop event by syncing state if necessary.
-- main · function · L75-L113 — Main entry point for handling various events and orchestrating the application logic.
+- readStdin · function · L15-L19 — Reads input from standard input, handling test seams and parsing JSON.
+- safeReadFd0 · function · L20-L20 — Safely reads from the standard input file descriptor, returning an empty string on failure.
+- projectDir · function · L22-L24 — Determines the project directory based on environment variables or input parameters.
+- underGraft · function · L25-L28 — Checks if a given file is part of the graft project structure.
+- graftJson · function · L29-L47 — Executes a command to retrieve JSON output from the graft CLI, handling errors gracefully.
+- checkStaleCount · function · L48-L52 — Counts the number of changes in the graft graph to determine if it is stale.
+- emit · function · L53-L55 — Outputs a JSON object to standard output for event tracking.
+- handlePostEdit · function · L57-L63 — Handles post-edit events by updating stats and emitting relevant information.
+- lastFileScopeHint · function · L80-L105 — function lastFileScopeHint(dir: string, lastFile: string | null | undefined): string | null
+- handleStop · function · L107-L121 — Handles the stop event by syncing state if necessary.
+- main · function · L123-L166 — Main entry point for handling various events and orchestrating the application logic.
diff --git a/graft/src/claude/skill-template.md b/graft/src/claude/skill-template.md
index 58d5f3c5..463c63d3 100644
--- a/graft/src/claude/skill-template.md
+++ b/graft/src/claude/skill-template.md
@@ -2,4 +2,4 @@
Provides a structured template for the graft Claude Code skill, enabling efficient onboarding and understanding of the codebase.
-- skillTemplate · function · L6-L88 — Generates a markdown string that serves as a comprehensive guide for using the graft tool effectively within a code repository.
+- skillTemplate · function · L6-L92 — Generates a markdown string that serves as a comprehensive guide for using the graft tool effectively within a code repository.
diff --git a/graft/src/cli.md b/graft/src/cli.md
index 639c76bb..a0f6fad1 100644
--- a/graft/src/cli.md
+++ b/graft/src/cli.md
@@ -2,7 +2,7 @@
Defines the command-line interface for the graft tool, enabling various operations on the codebase's context graph.
-- GlobalOpts · interface · L49-L55 — Holds the global options for the CLI, allowing configuration of the context graph generation and LLM provider settings.
-- cliConfig · function · L58-L67 — Constructs the configuration object for the engine based on CLI options, ensuring the correct parameters are used for graph generation.
-- engineFrom · function · L69-L71 — Creates an instance of the Graft engine using the current CLI configuration, enabling graph operations.
-- fmt · function · L107-L111 — Formats a record of counts into a human-readable string for console output.
+- GlobalOpts · interface · L46-L52 — Holds the global options for the CLI, allowing configuration of the context graph generation and LLM provider settings.
+- cliConfig · function · L55-L64 — Constructs the configuration object for the engine based on CLI options, ensuring the correct parameters are used for graph generation.
+- engineFrom · function · L66-L66 — Creates an instance of the Graft engine using the current CLI configuration, enabling graph operations.
+- fmt · function · L101-L105 — Formats a record of counts into a human-readable string for console output.
diff --git a/graft/src/graph/map.md b/graft/src/graph/map.md
index cf4997a0..e055d8ff 100644
--- a/graft/src/graph/map.md
+++ b/graft/src/graph/map.md
@@ -2,18 +2,23 @@
Builds a structured representation of a repository's file and symbol organization based on their relationships, facilitating easier navigation and understanding of the codebase.
-- Hub · interface · L26-L32 — Defines the structure of a hub in the repository map, capturing its essential attributes for identification and ranking.
-- DirEntry · interface · L34-L40 — Represents a directory entry in the repository map, summarizing its contents and associated hubs for better navigation.
-- RepoMap · interface · L42-L53 — Encapsulates the entire repository map structure, providing a comprehensive overview of files, symbols, and their relationships.
-- BuildRepoMapOptions · interface · L55-L62 — Specifies options for building the repository map, allowing customization of directory and hub limits.
-- dirKey · function · L74-L77 — Generates a directory key based on the specified depth, facilitating the grouping of files in the repository map.
-- computeInDegree · function · L82-L89 — Calculates the in-degree of nodes in the graph, determining the number of incoming edges for each target, which is crucial for identifying hubs.
-- topHubs · function · L94-L100 — Identifies the top hubs based on in-degree, ensuring that only significant nodes are included in the repository map.
-- sortedLanguages · function · L102-L109 — Sorts and deduplicates the programming languages used in the repository, enhancing the metadata of the repository map.
-- buildRepoMap · function · L116-L185 — Constructs the repository map from a given graph, organizing files and symbols into a structured format for easy access.
-- depthFor · function · L141-L141 — Determines the depth for a given path, influencing how files are grouped in the repository map based on the split segment.
-- basenameOf · function · L189-L192 — Extracts the base name from a file path, simplifying the representation of file names in the output.
-- formatDirHub · function · L194-L196 — Formats a hub's information for display, providing a user-friendly representation of its attributes.
-- formatDirLine · function · L198-L203 — Formats a directory entry for display, summarizing its contents and associated hubs in a readable format.
-- formatHotspot · function · L205-L207 — Formats a hotspot's information for display, detailing its attributes in a clear manner.
-- formatRepoMap · function · L215-L229 — Renders the repository map as a human-readable string, summarizing its contents and structure for easy understanding.
+- Hub · interface · L27-L33 — Defines the structure of a hub in the repository map, capturing its essential attributes for identification and ranking.
+- DirEntry · interface · L35-L41 — Represents a directory entry in the repository map, summarizing its contents and associated hubs for better navigation.
+- ScopeGroup · interface · L46-L53 — interface ScopeGroup
+- RepoMap · interface · L55-L75 — Encapsulates the entire repository map structure, providing a comprehensive overview of files, symbols, and their relationships.
+- BuildRepoMapOptions · interface · L77-L84 — Specifies options for building the repository map, allowing customization of directory and hub limits.
+- dirKey · function · L96-L99 — Generates a directory key based on the specified depth, facilitating the grouping of files in the repository map.
+- computeInDegree · function · L104-L111 — Calculates the in-degree of nodes in the graph, determining the number of incoming edges for each target, which is crucial for identifying hubs.
+- topHubs · function · L116-L122 — Identifies the top hubs based on in-degree, ensuring that only significant nodes are included in the repository map.
+- sortedLanguages · function · L124-L131 — Sorts and deduplicates the programming languages used in the repository, enhancing the metadata of the repository map.
+- computeDirEntries · function · L144-L206 — function computeDirEntries( nodes: NodeV1[], inDegree: Map<string, number>, maxDirs: number, hubsPerDir: number, stripPrefix: string, ): { dirs: DirEntry[]; dropped: number }
+- relPath · function · L154-L155 — relPath = (path: string): string
+- depthFor · function · L175-L175 — depthFor = (rp: string): number
+- fullPath · function · L191-L192 — fullPath = (relKey: string): string
+- buildRepoMap · function · L219-L269 — Constructs the repository map from a given graph, organizing files and symbols into a structured format for easy access.
+- basenameOf · function · L273-L276 — Extracts the base name from a file path, simplifying the representation of file names in the output.
+- formatDirHub · function · L278-L280 — Formats a hub's information for display, providing a user-friendly representation of its attributes.
+- formatDirLine · function · L282-L287 — Formats a directory entry for display, summarizing its contents and associated hubs in a readable format.
+- formatHotspot · function · L289-L291 — Formats a hotspot's information for display, detailing its attributes in a clear manner.
+- droppedNote · function · L294-L297 — function droppedNote(dropped: number): string | null
+- formatRepoMap · function · L305-L330 — Renders the repository map as a human-readable string, summarizing its contents and structure for easy understanding.
diff --git a/graft/src/graph/workspace-cli.md b/graft/src/graph/workspace-cli.md
new file mode 100644
index 00000000..6f7575cb
--- /dev/null
+++ b/graft/src/graph/workspace-cli.md
@@ -0,0 +1,10 @@
+# src/graph/workspace-cli.ts
+
+- WorkspaceBuildOptions · interface · L24-L32 — interface WorkspaceBuildOptions
+- runWorkspaceBuild · function · L37-L57 — async function runWorkspaceBuild(root: string, opts: WorkspaceBuildOptions): Promise<void>
+- buildChild · function · L38-L44 — buildChild = async (childDir: string, childName: string): Promise<void>
+- runWorkspaceAsk · function · L59-L68 — function runWorkspaceAsk( root: string, override: string | undefined, query: string, opts: { limit?: number; source?: boolean; full?: boolean; in?: string; json?: boolean }, ): void
+- runWorkspaceGrep · function · L70-L87 — function runWorkspaceGrep( root: string, override: string | undefined, pattern: string, opts: { ignoreCase?: boolean; fixed?: boolean; json?: boolean }, ): void
+- runWorkspaceMap · function · L89-L95 — function runWorkspaceMap( root: string, override: string | undefined, opts: { maxDirs?: number }, ): void
+- runWorkspaceCheck · function · L97-L101 — function runWorkspaceCheck(root: string, override?: string): void
+- runWorkspaceCallers · function · L103-L115 — function runWorkspaceCallers( root: string, override: string | undefined, symbol: string, opts: { direction?: Direction; depth?: number; in?: string }, ): void
diff --git a/graft/src/graph/workspace.md b/graft/src/graph/workspace.md
new file mode 100644
index 00000000..8d6a57cd
--- /dev/null
+++ b/graft/src/graph/workspace.md
@@ -0,0 +1,23 @@
+# src/graph/workspace.ts
+
+- WorkspaceV1 · interface · L44-L48 — interface WorkspaceV1
+- workspacePath · function · L53-L55 — function workspacePath(root: string, override?: string): string
+- readWorkspace · function · L59-L68 — function readWorkspace(root: string, override?: string): WorkspaceV1 | null
+- writeWorkspace · function · L71-L78 — function writeWorkspace(root: string, ws: WorkspaceV1, override?: string): string
+- isWorkspaceBuildRoot · function · L84-L88 — function isWorkspaceBuildRoot(root: string, override?: string): boolean
+- hasMegaGraph · function · L92-L94 — function hasMegaGraph(root: string, override?: string): boolean
+- migrationNote · function · L98-L105 — function migrationNote(children: string[]): string
+- clearParentGraft · function · L111-L113 — function clearParentGraft(root: string, override?: string): void
+- LoadedChild · interface · L115-L118 — interface LoadedChild
+- WorkspaceGraphs · interface · L120-L126 — interface WorkspaceGraphs
+- loadWorkspaceGraphs · function · L132-L143 — function loadWorkspaceGraphs(root: string, override?: string): WorkspaceGraphs
+- coverageNote · function · L148-L152 — function coverageNote(g: WorkspaceGraphs): string
+- prefixPointer · function · L156-L165 — function prefixPointer(child: string, pointer: string): string
+- FederateAskOptions · interface · L167-L175 — interface FederateAskOptions
+- ChildRun · interface · L177-L186 — interface ChildRun
+- federateAsk · function · L207-L306 — function federateAsk( root: string, override: string | undefined, query: string, opts: FederateAskOptions = {}, ): AskResult
+- federateGrep · function · L311-L351 — function federateGrep( root: string, override: string | undefined, pattern: string, opts: { ignoreCase?: boolean; fixed?: boolean } = {}, ): { result: GrepResult; coverage: string }
+- federateMap · function · L355-L374 — function federateMap( root: string, override: string | undefined, opts: { maxDirs?: number } = {}, ): string
+- federateCheck · function · L378-L403 — function federateCheck( root: string, override?: string, ): { text: string; ok: boolean }
+- federateCallers · function · L407-L443 — function federateCallers( root: string, override: string | undefined, symbol: string, opts: { direction?: Direction; depth?: number; in?: string } = {}, ): { text: string; found: boolean }
+- splitWorkspace · function · L457-L470 — async function splitWorkspace( root: string, override: string | undefined, buildChild: (childDir: string, childName: string) => Promise<void>, onStart?: (info: { children: string[]; migrated: boolean }) => void, ): Promise<{ children: string[]; migrated: boolean }>
diff --git a/graft/src/hosts/instructions.md b/graft/src/hosts/instructions.md
index 70e378fb..79998580 100644
--- a/graft/src/hosts/instructions.md
+++ b/graft/src/hosts/instructions.md
@@ -2,7 +2,7 @@
This file provides Graft instructions for navigating and utilizing the context graph effectively.
-- instructionBody · function · L6-L43 — Generates the main instructional content for using the Graft context graph.
-- cursorRule · function · L45-L52 — Defines a rule to always apply the Graft context graph before exploring source code.
-- kiroSteering · function · L54-L60 — Specifies a rule for always including the Graft context graph in the workflow.
-- windsurfRule · function · L62-L65 — Provides a rule that incorporates the Graft context graph into its logic.
+- instructionBody · function · L6-L46 — Generates the main instructional content for using the Graft context graph.
+- cursorRule · function · L48-L55 — Defines a rule to always apply the Graft context graph before exploring source code.
+- kiroSteering · function · L57-L63 — Specifies a rule for always including the Graft context graph in the workflow.
+- windsurfRule · function · L65-L68 — Provides a rule that incorporates the Graft context graph into its logic.
diff --git a/graft/src/mcp/tools.md b/graft/src/mcp/tools.md
index 12d34fb0..d4866f81 100644
--- a/graft/src/mcp/tools.md
+++ b/graft/src/mcp/tools.md
@@ -1,6 +1,7 @@
# src/mcp/tools.ts
-- ToolDef · interface · L19-L23 — Defines the structure for tool definitions used in the MCP tools, ensuring consistent input schema and metadata for each tool.
-- unknownSymbolText · function · L27-L29 — Generates an error message for an unknown symbol query, guiding users to check their input or build the graph.
-- renderMatches · function · L121-L136 — Formats and renders the results of graph traversal matches, providing a structured output for users to understand symbol relationships.
-- callTool · function · L138-L220 — Handles the invocation of various tools based on user input, managing errors and returning formatted results for different graph operations.
+- ToolDef · interface · L27-L31 — Defines the structure for tool definitions used in the MCP tools, ensuring consistent input schema and metadata for each tool.
+- unknownSymbolText · function · L35-L37 — Generates an error message for an unknown symbol query, guiding users to check their input or build the graph.
+- renderMatches · function · L129-L144 — Formats and renders the results of graph traversal matches, providing a structured output for users to understand symbol relationships.
+- callWorkspaceTool · function · L150-L196 — function callWorkspaceTool( root: string, dirOverride: string | undefined, name: string, args: Record<string, unknown>, ): { text: string; isError: boolean } | null
+- callTool · function · L198-L284 — Handles the invocation of various tools based on user input, managing errors and returning formatted results for different graph operations.
diff --git a/graft/test/ask-fusion.test.md b/graft/test/ask-fusion.test.md
index 2f26a68a..3d5fc158 100644
--- a/graft/test/ask-fusion.test.md
+++ b/graft/test/ask-fusion.test.md
@@ -1,4 +1,4 @@
# test/ask-fusion.test.ts
-- scopeDocs · function · L19-L21 — function scopeDocs(scope: string, scores: number[]): ScopedDoc[]
-- makeOps · function · L120-L133 — function makeOps(bRaw: number): ScopeRankOps
+- scopeDocs · function · L21-L23 — function scopeDocs(scope: string, scores: number[]): ScopedDoc[]
+- makeOps · function · L132-L146 — function makeOps(bStrength: { coverage: number; coverageStrong: number }): ScopeRankOps
diff --git a/graft/test/ask.test.md b/graft/test/ask.test.md
index af534a15..c23c6917 100644
--- a/graft/test/ask.test.md
+++ b/graft/test/ask.test.md
@@ -6,7 +6,8 @@ Contains tests for the `ask` functionality, validating its behavior with various
- stampCrux · function · L44-L50 — Updates the wiring.json file to include a crux for the specified node, allowing for inlined source retrieval.
- qualifiedFixture · function · L190-L208 — Sets up a temporary directory with a cache implementation to test structural resolution of function calls.
- multiScopeFixture · function · L277-L310 — function multiScopeFixture(): string
-- siblingPrefixFixture · function · L336-L343 — function siblingPrefixFixture(): string
-- idfShiftFixture · function · L370-L381 — function idfShiftFixture(): string
-- rankOf · function · L388-L388 — rankOf = (r: ReturnType<typeof ask>["hits"], title: string)
-- duplicateNameFixture · function · L555-L570 — function duplicateNameFixture(): string
+- crossSeamMonorepoFixture · function · L346-L387 — function crossSeamMonorepoFixture(): string
+- siblingPrefixFixture · function · L417-L424 — function siblingPrefixFixture(): string
+- idfShiftFixture · function · L451-L462 — function idfShiftFixture(): string
+- rankOf · function · L469-L469 — rankOf = (r: ReturnType<typeof ask>["hits"], title: string)
+- duplicateNameFixture · function · L636-L651 — function duplicateNameFixture(): string
diff --git a/graft/test/claude-hooks.test.md b/graft/test/claude-hooks.test.md
index 53f59fd2..6aef9638 100644
--- a/graft/test/claude-hooks.test.md
+++ b/graft/test/claude-hooks.test.md
@@ -4,3 +4,5 @@ This file contains tests for the functionality of the graft hooks in the Claude
- runWithStdin · function · L38-L41 — This function sets up the environment to run a given asynchronous function with specified input from stdin, managing the environment variable for the duration of the execution.
- fakeBuild · function · L84-L87 — This function simulates a build process by writing a mock wiring.json file to the specified directory, allowing tests to verify behavior based on the build output.
+- writeMultiScopeWiring · function · L126-L145 — function writeMultiScopeWiring(d: string): void
+- writeAskArgsStub · function · L247-L258 — function writeAskArgsStub(d: string): { stub: string; argsFile: string }
diff --git a/graft/test/graph-map.test.md b/graft/test/graph-map.test.md
index 1953513e..59b13db4 100644
--- a/graft/test/graph-map.test.md
+++ b/graft/test/graph-map.test.md
@@ -6,4 +6,6 @@ This file contains tests for the `buildRepoMap` and `formatRepoMap` functions, e
- symNode · function · L33-L49 — Generates a symbol node representation for the graph, allowing for the inclusion of function or variable symbols with associated metadata.
- edge · function · L51-L53 — Defines a connection between two nodes in the graph, representing relationships such as function calls.
- graphOf · function · L55-L61 — Constructs a graph structure from nodes and edges, serving as the foundational data for repository mapping.
-- bigFixture · function · L240-L259 — Creates a large fixture graph for testing, simulating a repository with multiple directories and symbols.
+- graphOfWithScopes · function · L66-L70 — function graphOfWithScopes(nodes: NodeV1[], edges: EdgeV1[], scopes: ScopeV1[]): GraphV1
+- twoScopeFixture · function · L249-L264 — function twoScopeFixture(): GraphV1
+- bigFixture · function · L381-L400 — Creates a large fixture graph for testing, simulating a repository with multiple directories and symbols.
diff --git a/graft/test/regression-single-repo.test.md b/graft/test/regression-single-repo.test.md
new file mode 100644
index 00000000..3f22ce2d
--- /dev/null
+++ b/graft/test/regression-single-repo.test.md
@@ -0,0 +1,4 @@
+# test/regression-single-repo.test.ts
+
+- fx · function · L27-L34 — function fx(layout: Record<string, string>): string
+- assertScopeFreeText · function · L71-L77 — function assertScopeFreeText(label: string, text: string)
diff --git a/graft/test/workspace.test.md b/graft/test/workspace.test.md
new file mode 100644
index 00000000..748a5dbc
--- /dev/null
+++ b/graft/test/workspace.test.md
@@ -0,0 +1,5 @@
+# test/workspace.test.ts
+
+- workspaceFx · function · L26-L37 — function workspaceFx(children: Record<string, Record<string, string>>): string
+- buildWorkspace · function · L40-L44 — async function buildWorkspace(parent: string): Promise<{ children: string[]; migrated: boolean }>
+- pad · function · L53-L57 — function pad(n: number): string
diff --git a/graft/testing-and-validation.md b/graft/testing-and-validation.md
index cdea8b75..110f6f3d 100644
--- a/graft/testing-and-validation.md
+++ b/graft/testing-and-validation.md
@@ -80,18 +80,21 @@ covers:
- symbol: multiScopeFixture
kind: function
at: 'test/ask.test.ts:L277-L310'
+ - symbol: crossSeamMonorepoFixture
+ kind: function
+ at: 'test/ask.test.ts:L346-L387'
- symbol: siblingPrefixFixture
kind: function
- at: 'test/ask.test.ts:L336-L343'
+ at: 'test/ask.test.ts:L417-L424'
- symbol: idfShiftFixture
kind: function
- at: 'test/ask.test.ts:L370-L381'
+ at: 'test/ask.test.ts:L451-L462'
- symbol: rankOf
kind: function
- at: 'test/ask.test.ts:L388-L388'
+ at: 'test/ask.test.ts:L469-L469'
- symbol: duplicateNameFixture
kind: function
- at: 'test/ask.test.ts:L555-L570'
+ at: 'test/ask.test.ts:L636-L651'
- symbol: strip
kind: function
at: 'test/claude-format.test.ts:L6-L6'
@@ -107,6 +110,12 @@ covers:
- symbol: fakeBuild
kind: function
at: 'test/claude-hooks.test.ts:L84-L87'
+ - symbol: writeMultiScopeWiring
+ kind: function
+ at: 'test/claude-hooks.test.ts:L126-L145'
+ - symbol: writeAskArgsStub
+ kind: function
+ at: 'test/claude-hooks.test.ts:L247-L258'
- symbol: fresh
kind: function
at: 'test/claude-init.test.ts:L10-L10'
@@ -167,9 +176,15 @@ covers:
- symbol: graphOf
kind: function
at: 'test/graph-map.test.ts:L55-L61'
+ - symbol: graphOfWithScopes
+ kind: function
+ at: 'test/graph-map.test.ts:L66-L70'
+ - symbol: twoScopeFixture
+ kind: function
+ at: 'test/graph-map.test.ts:L249-L264'
- symbol: bigFixture
kind: function
- at: 'test/graph-map.test.ts:L240-L259'
+ at: 'test/graph-map.test.ts:L381-L400'
- symbol: 'n'
kind: function
at: 'test/graph-resolve-typed.test.ts:L6-L10'