// C2-14 adds an observed real library tool read before C2-06's scripted reply adapter. // The reply plan is fixture input, never evidence that a lookup or guard actually ran. import { appendFileSync, existsSync, readFileSync } from 'node:fs'; import { dirname, join } from 'node:path'; import { callTool } from '../../packages/harness/src/tools.mjs'; const root = dirname(process.env.MOSAIC_TURN_MARKER); const count = join(root, 'fixture-count'); const n = existsSync(count) ? Number(readFileSync(count, 'utf8')) : 0; const step = JSON.parse(readFileSync(join(root, 'fixture-steps.json'), 'utf8'))[n]; for (const args of step?.lookups ?? []) { const result = await callTool(process.env.MOSAIC_TOOL_SOCKET, 'library_get', args); appendFileSync(join(root, 'fixture-lookups.jsonl'), JSON.stringify(result) + '\n'); } await import('../../packages/harness/tests/fixtures/citation-adapter.mjs');