MCPcopy Create free account
hub / github.com/Noumena-Network/code / probeProjectMemoryFiles

Function probeProjectMemoryFiles

src/utils/claudemdRepoBoundary.test.ts:14–38  ·  view source on GitHub ↗
(originalCwd: string)

Source from the content-addressed store, hash-verified

12}
13
14function probeProjectMemoryFiles(originalCwd: string): ProjectMemoryProbeEntry[] {
15 const script = [
16 'process.env.NCODE_BUILD_MODE = "noumena";',
17 `const { setOriginalCwd } = await import(${JSON.stringify('./src/bootstrap/state.js')});`,
18 `const { getMemoryFiles } = await import(${JSON.stringify('./src/utils/claudemd.js')});`,
19 `setOriginalCwd(${JSON.stringify(originalCwd)});`,
20 'const files = await getMemoryFiles();',
21 'const projectFiles = files.filter(file => file.type === "Project").map(file => ({ path: file.path, content: file.content }));',
22 'console.log(JSON.stringify(projectFiles));',
23 ].join('\n')
24
25 const result = Bun.spawnSync({
26 cmd: [BUN_BIN, '-e', script],
27 cwd: CODE_ROOT,
28 stdout: 'pipe',
29 stderr: 'pipe',
30 env: {
31 ...process.env,
32 NODE_ENV: 'test',
33 },
34 })
35
36 expect(result.exitCode).toBe(0)
37 return JSON.parse(result.stdout.toString()) as ProjectMemoryProbeEntry[]
38}
39
40describe('claudemd project memory repo boundary', () => {
41 it('stops loading project instructions at the repo root', () => {

Callers 1

Calls 1

toStringMethod · 0.65

Tested by

no test coverage detected