{"record":{"id":"9cb3b08255fd8c70","repo":"coleam00/Archon","slug":"failed-to-capture-workflow-source-from-sourceroo","errorCode":null,"errorMessage":"Failed to capture workflow source from ${sourceRoot}: ${(error as Error).message}","messagePattern":"Failed to capture workflow source from (.+?): (.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/cli/src/commands/workflow.ts","lineNumber":1587,"sourceCode":"  // THAT checkout's `.archon`, not the parent checkout's bytes captured on entry — the\n  // branch may carry a different workflow YAML, and executing one against the other is\n  // exactly the mixed-vintage defect (#2660/#2747). Re-freeze the source and re-discover\n  // from the lane path once the lane resolves it.\n  const recaptureForLane = async (sourceRoot: string): Promise<void> => {\n    try {\n      const replacement = await prepareWorkflowSource(createWorkflowDeps(), {\n        sourceRoot,\n        ...(detachedPreCreatedRun ? { runId: detachedPreCreatedRun.id } : {}),\n      });\n      owner.hold(replacement);\n      originalStagedRoot = replacement.captureRoot;\n      const stale = preparedSource;\n      preparedSource = replacement;\n      if (stale) {\n        rmSync(stale.captureRoot, { recursive: true, force: true });\n      }\n    } catch (error) {\n      throw new Error(\n        `Failed to capture workflow source from ${sourceRoot}: ${(error as Error).message}`\n      );\n    }\n    const rediscovered = await discoverWorkflowsWithConfig(\n      sourceRoot,\n      loadConfig,\n      preparedSource.roots\n    );\n    workflowEntries = rediscovered.workflows;\n    errors = rediscovered.errors;\n    workflow = resolveWorkflowName(\n      workflowName,\n      workflowEntries.map(ws => ws.workflow)\n    );\n    workflowEntry = workflow ? workflowEntries.find(ws => ws.workflow === workflow) : undefined;\n    workflowSource = workflowEntry?.source;\n    if (!workflow) {\n      const availableWorkflows = workflowEntries.map(ws => `  - ${ws.workflow.name}`).join('\\n');","sourceCodeStart":1569,"sourceCodeEnd":1605,"githubUrl":"https://github.com/coleam00/Archon/blob/0773b9745896ef0612e709c80845a0f7db315b19/packages/cli/src/commands/workflow.ts#L1569-L1605","documentation":"Error \"Failed to capture workflow source from ${sourceRoot}: ${(error as Error).message}\" thrown in coleam00/Archon.","triggerScenarios":"Thrown at packages/cli/src/commands/workflow.ts:1587 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"0773b9745896ef0612e709c80845a0f7db315b19","analyzedAt":"2026-09-01T02:28:07.064Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T05:18:18.240Z"}