{"record":{"id":"6df4dfe2e274c41c","repo":"coleam00/Archon","slug":"cannot-generate-dry-run-scaffold-nodes-sharing-st","errorCode":null,"errorMessage":"Cannot generate dry-run scaffold: nodes sharing stub key '${id}' require incompatible values","messagePattern":"Cannot generate dry-run scaffold: nodes sharing stub key '(.+?)' require incompatible values","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/workflows/src/dry-run.ts","lineNumber":254,"sourceCode":"          existing.candidates.push(generated);\n          existing.consumers.push(node);\n        }\n      }\n      if (isLoopGroupNode(node)) visit(node.loop_group.nodes as DagNode[]);\n    }\n  };\n  // \"Already-expanded\" per this function's own docblock — dry-run always simulates a\n  // fully-expanded WorkflowDefinition, so `workflow.nodes` never actually holds an\n  // `IncludeDirective` here even though the type admits one for the general\n  // pre-expansion case (#2486).\n  visit(workflow.nodes as DagNode[]);\n  return Object.fromEntries(\n    [...stubs].map(([id, entry]) => {\n      const value = entry.candidates.find(candidate =>\n        entry.consumers.every(consumer => stubSatisfiesNode(consumer, candidate))\n      );\n      if (value === undefined) {\n        throw new Error(\n          `Cannot generate dry-run scaffold: nodes sharing stub key '${id}' require incompatible values`\n        );\n      }\n      return [id, value];\n    })\n  );\n}\n\n/** Write a scaffold without ever overwriting an existing fixture. */\nexport async function writeDryRunStubScaffold(\n  workflow: WorkflowDefinition,\n  path: string\n): Promise<DryRunStubs> {\n  const stubs = createDryRunStubScaffold(workflow);\n  await mkdir(dirname(path), { recursive: true });\n  let handle;\n  try {\n    handle = await open(path, 'wx');","sourceCodeStart":236,"sourceCodeEnd":272,"githubUrl":"https://github.com/coleam00/Archon/blob/0773b9745896ef0612e709c80845a0f7db315b19/packages/workflows/src/dry-run.ts#L236-L272","documentation":"Thrown by createDryRunStubScaffold when multiple nodes share a stub key (node id) but their `output_format` schemas are mutually incompatible: no single candidate value satisfies every consumer node. Since one stub value must be shared across the key, the scaffold cannot be built.","triggerScenarios":"Running scaffold/stubs generation on a workflow where two or more nodes have the same id (duplicate node ids) but different `output_format` schemas, so no generated candidate passes stubSatisfiesNode for all consumers.","commonSituations":"Copy-pasting a node and forgetting to change its id, refactoring that merged node ids, or templated workflows that emit duplicate ids with diverging output schemas.","solutions":["Give each node a unique id — duplicate ids are the usual root cause.","If sharing is intentional, align the `output_format` schemas of the colliding nodes to a common shape.","Write a manual stub file whose value satisfies all consumers instead of relying on the scaffold."],"exampleFix":"// before (two nodes both id: summarize)\n- id: summarize\n  output_format: { type: object, properties: { text: { type: string } } }\n- id: summarize\n  output_format: { type: object, properties: { score: { type: number } } }\n// after\n- id: summarize-text\n  output_format: { type: object, properties: { text: { type: string } } }\n- id: summarize-score\n  output_format: { type: object, properties: { score: { type: number } } }","handlingStrategy":"validation","validationCode":"function assertUniqueNodeIds(nodes: { id: string }[]): void {\n  const seen = new Set<string>();\n  for (const n of nodes) {\n    if (seen.has(n.id)) throw new Error(`Duplicate node id: ${n.id}`);\n    seen.add(n.id);\n  }\n}","typeGuard":"function hasDuplicateIds(ids: string[]): boolean {\n  return new Set(ids).size !== ids.length;\n}","tryCatchPattern":"try {\n  const scaffold = await createDryRunStubScaffold(dag);\n} catch (err) {\n  if (err instanceof Error && err.message.includes(\"require incompatible values\")) {\n    console.error(\"Duplicate node id with divergent output_format; fix ids or align schemas:\", err.message);\n  } else throw err;\n}","preventionTips":["Enforce unique node ids with a lint/validation step on the workflow YAML.","Avoid copy-pasting nodes without renaming their ids.","Keep shared stub keys on identical output_format schemas.","Use manual stub files when intentional id sharing is unavoidable."],"tags":["dry-run","workflow","duplicate-ids","stub"],"backgroundTag":"incompatible-stub-values","analyzedSha":"0773b9745896ef0612e709c80845a0f7db315b19","analyzedAt":"2026-09-01T02:28:07.064Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T05:18:18.240Z"}