Browse Source

fix(snapshot): honor ACP-local sidecar sources

creatixchu 1 month ago
parent
commit
4309dab24b

+ 8 - 0
snapshots/acp/acp.snapshot.ts

@@ -42,12 +42,18 @@ const controllerCases: readonly {
   },
   },
 ] as const
 ] as const
 
 
+function localScenarioSource(source: string | undefined): string | undefined {
+  return source?.includes('/') === false ? source : undefined
+}
+
 const scenarios: Scenario[] = controllerCases.map((controller) => {
 const scenarios: Scenario[] = controllerCases.map((controller) => {
   const manifestPath = join(corpusDir, controller.name, 'snapshot.yml')
   const manifestPath = join(corpusDir, controller.name, 'snapshot.yml')
   const manifest = parseSnapshotManifest(readFileSync(manifestPath, 'utf8'), manifestPath)
   const manifest = parseSnapshotManifest(readFileSync(manifestPath, 'utf8'), manifestPath)
   if (manifest.recording === undefined || manifest.header === undefined) {
   if (manifest.recording === undefined || manifest.header === undefined) {
     throw new Error(`${controller.name}: ACP snapshot manifest lacks recording or header metadata`)
     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 {
   return {
     ...controller,
     ...controller,
     recorded: manifest.recording === 'live',
     recorded: manifest.recording === 'live',
@@ -55,6 +61,8 @@ const scenarios: Scenario[] = controllerCases.map((controller) => {
     ...(manifest.header.pin === true ? { pinsHeader: true } : {}),
     ...(manifest.header.pin === true ? { pinsHeader: true } : {}),
     ...(manifest.header.changes === undefined ? {} : { expectedHeaderChanges: manifest.header.changes }),
     ...(manifest.header.changes === undefined ? {} : { expectedHeaderChanges: manifest.header.changes }),
     headerClass: manifest.header.class,
     headerClass: manifest.header.class,
+    ...(systemPromptSource === undefined ? {} : { systemPromptSource }),
+    ...(toolSchemasSource === undefined ? {} : { toolSchemasSource }),
     ...(manifest.platform === 'posix' ? { posixOnly: true } : {}),
     ...(manifest.platform === 'posix' ? { posixOnly: true } : {}),
     ...(manifest.platform === 'pwsh' ? { pwshOnly: true } : {}),
     ...(manifest.platform === 'pwsh' ? { pwshOnly: true } : {}),
     ...(controller.configPath === undefined ? {} : { configPath: controller.configPath }),
     ...(controller.configPath === undefined ? {} : { configPath: controller.configPath }),

+ 0 - 1
snapshots/acp/image-compaction/tool-schemas.expected.json

@@ -1 +0,0 @@
-../escalation-approved/tool-schemas.expected.json