fix(snapshot): honor ACP-local sidecar sources

This commit is contained in:
creatixchu
2026-08-25 14:02:12 +08:00
parent bcdbd85d15
commit 4309dab24b
2 changed files with 8 additions and 1 deletions
+8
View File
@@ -42,12 +42,18 @@ const controllerCases: readonly {
},
] as const
function localScenarioSource(source: string | undefined): string | undefined {
return source?.includes('/') === false ? source : undefined
}
const scenarios: Scenario[] = controllerCases.map((controller) => {
const manifestPath = join(corpusDir, controller.name, 'snapshot.yml')
const manifest = parseSnapshotManifest(readFileSync(manifestPath, 'utf8'), manifestPath)
if (manifest.recording === undefined || manifest.header === undefined) {
throw new Error(`${controller.name}: ACP snapshot manifest lacks recording or header metadata`)
}
const systemPromptSource = localScenarioSource(manifest.header.systemPromptSource)
const toolSchemasSource = localScenarioSource(manifest.header.toolSchemasSource)
return {
...controller,
recorded: manifest.recording === 'live',
@@ -55,6 +61,8 @@ const scenarios: Scenario[] = controllerCases.map((controller) => {
...(manifest.header.pin === true ? { pinsHeader: true } : {}),
...(manifest.header.changes === undefined ? {} : { expectedHeaderChanges: manifest.header.changes }),
headerClass: manifest.header.class,
...(systemPromptSource === undefined ? {} : { systemPromptSource }),
...(toolSchemasSource === undefined ? {} : { toolSchemasSource }),
...(manifest.platform === 'posix' ? { posixOnly: true } : {}),
...(manifest.platform === 'pwsh' ? { pwshOnly: true } : {}),
...(controller.configPath === undefined ? {} : { configPath: controller.configPath }),
@@ -1 +0,0 @@
../escalation-approved/tool-schemas.expected.json