{"record":{"id":"82200684d9c5f335","repo":"coleam00/Archon","slug":"invalid-run-config-at-docs-expected-an-object","errorCode":null,"errorMessage":"Invalid run config at 'docs': expected an object","messagePattern":"Invalid run config at 'docs': expected an object","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/core/src/config/run-config.ts","lineNumber":197,"sourceCode":"    const classification = keyClassifications[key as ConfigKey] as KeyClassification | undefined;\n    if (!classification) {\n      throw new Error(`Unknown run config key '${key}'.`);\n    }\n    if (classification.kind === 'unavailable') {\n      throw new Error(`Run config key '${key}' cannot apply: ${classification.reason}.`);\n    }\n  }\n\n  if (value.assistant !== undefined && value.defaultAssistant !== undefined) {\n    throw new Error(\n      \"Run config cannot set both 'assistant' and 'defaultAssistant'; use one spelling.\"\n    );\n  }\n\n  const docs = value.docs;\n  if (docs !== undefined) {\n    if (!isRecord(docs)) {\n      throw new Error(\"Invalid run config at 'docs': expected an object\");\n    }\n    const unknownDocsKey = Object.keys(docs).find(key => key !== 'path');\n    if (unknownDocsKey) {\n      throw new Error(`Unknown run config key 'docs.${unknownDocsKey}'.`);\n    }\n  }\n\n  const candidate = {\n    ...(value.assistant !== undefined || value.defaultAssistant !== undefined\n      ? { assistant: value.assistant ?? value.defaultAssistant }\n      : {}),\n    ...(value.assistants !== undefined ? { assistants: value.assistants } : {}),\n    ...(value.aliases !== undefined ? { aliases: value.aliases } : {}),\n    ...(value.tiers !== undefined ? { tiers: value.tiers } : {}),\n    ...(value.workflows !== undefined ? { workflows: value.workflows } : {}),\n    ...(isRecord(docs) && docs.path !== undefined ? { docsPath: docs.path } : {}),\n    ...(value.env !== undefined ? { envVars: value.env } : {}),\n  };","sourceCodeStart":179,"sourceCodeEnd":215,"githubUrl":"https://github.com/coleam00/Archon/blob/0773b9745896ef0612e709c80845a0f7db315b19/packages/core/src/config/run-config.ts#L179-L215","documentation":"If present, the 'docs' run config key must be an object (currently holding only 'path'). A non-object docs value is rejected fail-fast by parseWorkflowRunConfig().","triggerScenarios":"Passing docs as a string, array, number, or null, e.g. docs: ./docs instead of docs: { path: ./docs }.","commonSituations":"Shorthand assumptions where a string path is written directly; YAML merging that flattens docs to a scalar.","solutions":["Wrap the value as an object: docs: { path: <path> }","Quote paths so YAML does not collapse them","Remove docs entirely if not needed"],"exampleFix":"// before\ndocs: ./docs\n// after\ndocs:\n  path: ./docs","handlingStrategy":"type-guard","validationCode":"function assertDocsShape(doc) { if (doc.docs !== undefined && (typeof doc.docs !== 'object' || doc.docs === null || Array.isArray(doc.docs))) throw new Error('docs must be an object with a path key'); }","typeGuard":"function isValidDocs(v) { return v === undefined || (typeof v === 'object' && v !== null && !Array.isArray(v)); }","tryCatchPattern":"try { cfg = parseWorkflowRunConfig(doc, source); } catch (e) { if (String(e.message).includes(\"at 'docs'\")) console.error('Use docs: { path: ... }'); throw e; }","preventionTips":["Always write docs as a mapping: docs: { path: ... }","Quote path values in YAML so they stay strings","Validate docs shape in a pre-load schema check"],"tags":["config","validation","yaml"],"backgroundTag":"schema-validation-failed","analyzedSha":"0773b9745896ef0612e709c80845a0f7db315b19","analyzedAt":"2026-09-01T02:28:07.064Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T05:18:18.240Z"}