{"record":{"id":"57bc2ddfddcc9f1a","repo":"coleam00/Archon","slug":"invalid-dry-run-stub-file-path-contains-the","errorCode":null,"errorMessage":"Invalid dry-run stub file '${path}': contains the fixture key '${reservedHit}' — this is a fixture file; run it with 'workflow test'","messagePattern":"Invalid dry-run stub file '(.+?)': contains the fixture key '(.+?)' — this is a fixture file; run it with 'workflow test'","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/workflows/src/dry-run.ts","lineNumber":405,"sourceCode":"  }\n\n  let parsed: unknown;\n  try {\n    parsed = Bun.YAML.parse(await file.text());\n  } catch (error) {\n    throw new Error(`Failed to parse dry-run stub file '${path}': ${(error as Error).message}`);\n  }\n\n  if (parsed === null || typeof parsed !== 'object' || Array.isArray(parsed)) {\n    throw new Error(\n      `Invalid dry-run stub file '${path}': expected one YAML mapping of node ids to outputs`\n    );\n  }\n  const reservedHit = Object.keys(parsed as Record<string, unknown>).find(key =>\n    RESERVED_FIXTURE_KEYS.has(key)\n  );\n  if (reservedHit !== undefined) {\n    throw new Error(\n      `Invalid dry-run stub file '${path}': contains the fixture key '${reservedHit}' — this is a fixture file; run it with 'workflow test'`\n    );\n  }\n  const result = dryRunStubsSchema.safeParse(parsed);\n  if (!result.success) {\n    const issues = result.error.issues\n      .map(issue => `${issue.path.join('.') || '<root>'}: ${issue.message}`)\n      .join('; ');\n    throw new Error(`Invalid dry-run stub file '${path}': ${issues}`);\n  }\n  return result.data;\n}\n\nfunction nodeType(node: DagNode): z.infer<typeof dryRunNodeTypeSchema> {\n  // `include:` is no longer a DagNode member (#2486) — it never reaches this function.\n  if (isAgentNode(node) && node.source.kind === 'command') return 'command';\n  if (isExecNode(node)) return node.runtime === 'sh' ? 'bash' : 'script';\n  if (isLoopNode(node)) return 'loop';","sourceCodeStart":387,"sourceCodeEnd":423,"githubUrl":"https://github.com/coleam00/Archon/blob/0773b9745896ef0612e709c80845a0f7db315b19/packages/workflows/src/dry-run.ts#L387-L423","documentation":"Thrown by loadDryRunStubs when the stub mapping contains a key in RESERVED_FIXTURE_KEYS — the file is a test fixture, not a stub file. The engine refuses to interpret fixture-shaped files as stubs and points the user to `workflow test`, the command that understands fixture keys.","triggerScenarios":"Loading a stub file that contains fixture-reserved top-level keys (e.g. keys like `fixtures` / `inputs` used by the fixture format) — typically by passing a fixture file where a stub file is expected.","commonSituations":"Mixing up the fixture file produced for `workflow test` with the dry-run stub file, or hand-editing a stub and accidentally adding a reserved fixture key.","solutions":["Run the file through `workflow test` instead — it is a fixture file, as the message says.","Remove the reserved fixture key from the YAML if it was added by mistake.","Use separate paths for fixtures and stubs to avoid passing the wrong file."],"exampleFix":"# before (fixture key in stub file)\nfixtures:\n  summarize: { text: hi }\n# after\nsummarize:\n  text: hi","handlingStrategy":"validation","validationCode":"const RESERVED_FIXTURE_KEYS = new Set([\"fixtures\", \"inputs\"]); // mirror engine's set\nfunction stubFileHasNoFixtureKeys(keys: string[]): string | undefined {\n  return keys.find(k => RESERVED_FIXTURE_KEYS.has(k));\n}","typeGuard":"function isPlainStubMapping(v: Record<string, unknown>): boolean {\n  return !Object.keys(v).some(k => RESERVED_FIXTURE_KEYS.has(k));\n}","tryCatchPattern":"try {\n  const stubs = await loadDryRunStubs(path);\n} catch (err) {\n  if (err instanceof Error && err.message.includes(\"this is a fixture file\")) {\n    console.error(\"Wrong file type: run fixtures with 'workflow test', not as dry-run stubs.\");\n  } else throw err;\n}","preventionTips":["Store fixtures and stubs in distinct directories (e.g. fixtures/ vs stubs/).","Name fixture files with a recognizable suffix so they aren't passed as stubs.","Never add fixture-reserved keys to stub files by hand.","Double-check CLI flags: `workflow test --fixture` vs dry-run `--stubs`."],"tags":["dry-run","stub","fixture","validation"],"backgroundTag":"fixture-file-misuse","analyzedSha":"0773b9745896ef0612e709c80845a0f7db315b19","analyzedAt":"2026-09-01T02:28:07.064Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T05:18:18.240Z"}