{"record":{"id":"b3ed063c95f701f2","repo":"coleam00/Archon","slug":"cannot-generate-dry-run-stub-for-node-node-id-b3ed06","errorCode":null,"errorMessage":"Cannot generate dry-run stub for node '${node.id}': output_format could not be compiled (${compileError})","messagePattern":"Cannot generate dry-run stub for node '(.+?)': output_format could not be compiled \\((.+?)\\)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/workflows/src/dry-run.ts","lineNumber":185,"sourceCode":"    );\n  }\n\n  const value = schemaPlaceholder(node.output_format);\n  if (isLoopNode(node) && node.loop.until_field !== undefined) {\n    if (!isRecord(value)) {\n      throw new Error(\n        `Cannot generate dry-run stub for node '${node.id}': loop.until_field requires an object-typed output_format`\n      );\n    }\n    value[node.loop.until_field] = true;\n  }\n\n  let compileError: string | undefined;\n  const validation = validateStructuredOutput(value, node.output_format, message => {\n    compileError = message;\n  });\n  if (compileError !== undefined) {\n    throw new Error(\n      `Cannot generate dry-run stub for node '${node.id}': output_format could not be compiled (${compileError})`\n    );\n  }\n  if (!validation.valid) {\n    throw new Error(\n      `Cannot generate schema-valid dry-run stub for node '${node.id}': ${validation.errors.join('; ')}`\n    );\n  }\n  if (!isStubValue(value)) {\n    throw new Error(\n      `Cannot generate dry-run stub for node '${node.id}': output_format produced a placeholder of an unsupported type`\n    );\n  }\n  return value;\n}\n\nfunction stubSatisfiesNode(node: DagNode, stub: DryRunStubValue): boolean {\n  if (node.output_format !== undefined) {","sourceCodeStart":167,"sourceCodeEnd":203,"githubUrl":"https://github.com/coleam00/Archon/blob/0773b9745896ef0612e709c80845a0f7db315b19/packages/workflows/src/dry-run.ts#L167-L203","documentation":"Thrown by generatedStubFor in packages/workflows/src/dry-run.ts when compiling a node's `output_format` JSON schema into a placeholder value fails during dry-run stub generation. The schema compiler (validateStructuredOutput) reports a compile error via the callback, and the function converts it into this error naming the node. The dry run cannot fabricate an output for the node, so it aborts rather than run with an unrepresentable stub.","triggerScenarios":"Calling the dry-run flow (scaffold/stubs/placeholder/hydrated paths) on a DAG node whose `output_format` contains an un-compilable schema — e.g. malformed JSON Schema keywords, unsupported type combinations, or a syntactically invalid schema definition.","commonSituations":"Hand-authoring `output_format` YAML with typos (e.g. `type: str` instead of `type: string`), mixing incompatible keywords like `items` on a non-array type, or schemas copied from other tools that use unsupported draft keywords.","solutions":["Read the embedded compileError in parentheses for the exact schema fault (node id is named in the message).","Fix the node's `output_format` to be a valid JSON Schema: correct `type` values, matching keyword/type pairs.","Validate the schema with a JSON Schema linter or validator before running the dry run.","If the node needs no structured output, remove `output_format` so no stub compilation is attempted."],"exampleFix":"// before\noutput_format:\n  type: str\n  properties:\n    ok: { type: boolean }\n// after\noutput_format:\n  type: object\n  properties:\n    ok: { type: boolean }","handlingStrategy":"validation","validationCode":"import Ajv from \"ajv\";\nfunction isCompilableSchema(outputFormat: unknown): boolean {\n  try { new Ajv().compile(outputFormat as object); return true; } catch { return false; }\n}\n// run per node before dry run\nconst bad = nodes.filter(n => n.output_format && !isCompilableSchema(n.output_format));","typeGuard":"function isJsonObject(v: unknown): v is Record<string, unknown> {\n  return typeof v === \"object\" && v !== null && !Array.isArray(v);\n}","tryCatchPattern":"try {\n  const stubs = await generateStubs(dag);\n} catch (err) {\n  if (err instanceof Error && err.message.includes(\"output_format could not be compiled\")) {\n    console.error(\"Fix output_format schema; see message:\", err.message);\n  } else throw err;\n}","preventionTips":["Validate every output_format against a JSON Schema meta-schema in CI.","Use only standard JSON Schema type names and keyword/type pairs.","Add a unit test that compiles all bundled workflow output_formats.","Run the dry-run scaffold on schema changes before shipping."],"tags":["dry-run","json-schema","workflow","config"],"backgroundTag":"invalid-json-schema","analyzedSha":"0773b9745896ef0612e709c80845a0f7db315b19","analyzedAt":"2026-09-01T02:28:07.064Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T05:18:18.240Z"}