MCPcopy Create free account
hub / github.com/colbymchenry/codegraph / materializeFixture

Function materializeFixture

scripts/agent-eval/probe-allocation.mjs:115–126  ·  view source on GitHub ↗

Copy a fixture tree to a fresh temp dir and index it — hermetic per run.

({ CodeGraph }, fixturePath)

Source from the content-addressed store, hash-verified

113
114/** Copy a fixture tree to a fresh temp dir and index it — hermetic per run. */
115async function materializeFixture({ CodeGraph }, fixturePath) {
116 const src = resolve(REPO_ROOT, fixturePath);
117 if (!existsSync(src)) throw new Error(`fixture tree not found: ${src}`);
118 const dir = mkdtempSync(join(tmpdir(), 'cg-alloc-'));
119 cpSync(src, dir, { recursive: true });
120 // A stray index inside the checked-in tree would be copied in and reused.
121 rmSync(join(dir, '.codegraph'), { recursive: true, force: true });
122 const cg = CodeGraph.initSync(dir);
123 await cg.indexAll();
124 cg.close?.();
125 return dir;
126}
127
128/** Evaluate one fixture's assertions against its report. Returns check rows. */
129function evaluate(fixture, report, text) {

Callers 1

mainFunction · 0.85

Calls 4

initSyncMethod · 0.80
closeMethod · 0.65
resolveFunction · 0.50
indexAllMethod · 0.45

Tested by

no test coverage detected