{"record":{"id":"bd17f75251fe3c15","repo":"coleam00/Archon","slug":"invalid-dry-run-stub-file-path-issues","errorCode":null,"errorMessage":"Invalid dry-run stub file '${path}': ${issues}","messagePattern":"Invalid dry-run stub file '(.+?)': (.+?)","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/workflows/src/dry-run.ts","lineNumber":414,"sourceCode":"  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';\n  if (isLoopGroupNode(node)) return 'loop_group';\n  if (isGateNode(node)) return 'approval';\n  if (isWaitNode(node)) return 'wait';\n  if (isHaltNode(node)) return 'cancel';\n  if (isWorkflowNode(node)) return 'workflow';\n  if (isComposeFanOutNode(node)) return 'compose_fan_out';\n  return 'prompt';\n}\n","sourceCodeStart":396,"sourceCodeEnd":432,"githubUrl":"https://github.com/coleam00/Archon/blob/0773b9745896ef0612e709c80845a0f7db315b19/packages/workflows/src/dry-run.ts#L396-L432","documentation":"Thrown by loadDryRunStubs when dryRunStubsSchema.safeParse rejects the parsed YAML. The file is a mapping and passes the reserved-key check, but values violate the stub schema; all zod issues are joined as `<path>: <message>` for a single-shot diagnosis.","triggerScenarios":"Loading a stub file whose per-node output values have the wrong shape — e.g. a node id mapped to a scalar where an object is required, wrong-typed fields inside the output, or a `<root>` issue when the top-level shape itself is wrong.","commonSituations":"Hand-writing stub values that don't match the node's declared output shape, renaming output fields after editing a workflow, or older stub files predating a stub-schema change.","solutions":["Read each `path: message` issue and correct the offending stub value's type/shape.","Regenerate the stub scaffold so values match the current node output_format shapes.","Check whether the workflow's output_format changed since the stub was written and update the stub accordingly."],"exampleFix":"# before (score must be number)\nsummarize:\n  score: \"high\"\n# after\nsummarize:\n  score: 0.9","handlingStrategy":"validation","validationCode":"function stubValueMatchesOutputFormat(node: { id: string; output_format?: object }, stubs: Record<string, unknown>): string[] {\n  const issues: string[] = [];\n  for (const [id, value] of Object.entries(stubs)) {\n    const schema = nodes.find(n => n.id === id)?.output_format;\n    if (schema && typeof value !== \"object\") issues.push(`${id}: expected object output`);\n  }\n  return issues;\n}","typeGuard":"function isRecord(v: unknown): v is Record<string, unknown> {\n  return typeof v === \"object\" && v !== null && !Array.isArray(v);\n}","tryCatchPattern":"try {\n  const stubs = await loadDryRunStubs(path);\n} catch (err) {\n  if (err instanceof Error && err.message.startsWith(\"Invalid dry-run stub file\") && err.message.includes(\":\")) {\n    for (const issue of err.message.split(\"Invalid dry-run stub file\")[1].split(\"; \")) {\n      console.error(`stub issue: ${issue.trim()}`);\n    }\n  } else throw err;\n}","preventionTips":["Regenerate stubs via scaffold after changing any node's output_format.","Validate stub values against the node schemas in CI before dry runs.","Keep stub values mirroring real node output shapes (types and field names).","Read the joined `path: message` issues carefully — they pinpoint each offending field."],"tags":["dry-run","stub","zod","schema-validation"],"backgroundTag":"schema-validation-failed","analyzedSha":"0773b9745896ef0612e709c80845a0f7db315b19","analyzedAt":"2026-09-01T02:28:07.064Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T05:18:18.240Z"}