MCPcopy Create free account
hub / github.com/EvoMap/evolver / runCollectInChild

Function runCollectInChild

test/evolveCollect.test.js:818–846  ·  view source on GitHub ↗
(repoRoot, env = {})

Source from the content-addressed store, hash-verified

816 }
817
818 function runCollectInChild(repoRoot, env = {}) {
819 const script = `
820 const collect = require(${JSON.stringify(path.resolve(__dirname, '..', 'src', 'evolve', 'pipeline', 'collect.js'))});
821 console.log(JSON.stringify({
822 mem: collect.readMemorySnippet(),
823 usr: collect.readUserSnippet(),
824 sess: collect.readRealSessionLog(),
825 }));
826 `;
827 const res = spawnSync(process.execPath, ['-e', script], {
828 env: {
829 ...process.env,
830 EVOLVER_REPO_ROOT: repoRoot,
831 EVOLVER_NO_PARENT_GIT: 'true',
832 EVOLVER_QUIET_PARENT_GIT: '1',
833 EVOLVER_SESSION_SOURCE: 'cursor',
834 EVOLVER_CURSOR_TRANSCRIPTS_DIR: path.join(repoRoot, '__nope__'),
835 OPENCLAW_WORKSPACE: repoRoot,
836 AGENT_SESSIONS_DIR: path.join(repoRoot, '__nope__'),
837 HOME: repoRoot,
838 ...env,
839 },
840 encoding: 'utf8',
841 });
842 if (res.status !== 0) {
843 throw new Error(`child failed: ${res.stderr || res.stdout}`);
844 }
845 return JSON.parse(res.stdout.trim().split('\n').pop());
846 }
847
848 it('Codex-like setup (AGENTS.md marker + memory_graph outcomes) emits 0 of the 3 advisory signals', () => {
849 const tmp = mkTmp();

Callers 1

Calls 1

parseMethod · 0.80

Tested by

no test coverage detected