{"record":{"id":"2b1fa07d8a8b6c26","repo":"ruvnet/ruflo","slug":"authoritative-worker-policy-root-unavailable","errorCode":null,"errorMessage":"authoritative-worker-policy-root-unavailable","messagePattern":"authoritative-worker-policy-root-unavailable","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"v3/@claude-flow/cli/src/services/policy-runtime.ts","lineNumber":345,"sourceCode":"        throw new Error('not an object');\n      }\n      processEnvelope = parsed as CapabilityEnvelope;\n    } catch {\n      throw new Error('invalid-worker-capability-envelope');\n    }\n    // Linked git worktrees share one immutable common git directory. Derive\n    // the coordinator checkout from that directory so a worker cannot fall\n    // back to independent legacy policy state in its isolated worktree.\n    try {\n      const cwd = realpathSync(process.cwd());\n      const common = execFileSync(\n        'git',\n        ['-C', cwd, 'rev-parse', '--path-format=absolute', '--git-common-dir'],\n        { encoding: 'utf8', stdio: ['ignore', 'pipe', 'ignore'] },\n      ).trim();\n      projectRoot = dirname(realpathSync(common));\n    } catch {\n      throw new Error('authoritative-worker-policy-root-unavailable');\n    }\n  }\n  return evaluatePolicyRequest({\n    identity: {\n      id: process.env.CLAUDE_FLOW_PRINCIPAL_ID ?? 'legacy-cli',\n      type: process.env.CLAUDE_FLOW_PRINCIPAL_ID ? 'agent' : 'legacy',\n    },\n    action: {\n      type: attributes.actionType ?? 'mcp.tool.call',\n      resource: toolName,\n      tool: toolName,\n      server: typeof context.serverId === 'string' ? context.serverId : 'ruflo',\n      namespace: typeof input.namespace === 'string' ? input.namespace : undefined,\n      environment: typeof context.environment === 'string' ? context.environment : undefined,\n      costUsd: attributes.costUsd,\n      tokens: attributes.tokens,\n      concurrency: attributes.concurrency,\n      network: attributes.network === true,","sourceCodeStart":327,"sourceCodeEnd":363,"githubUrl":"https://github.com/ruvnet/ruflo/blob/fa13ee4ad60ac2090b1480656eb233521790d640/v3/@claude-flow/cli/src/services/policy-runtime.ts#L327-L363","documentation":"authorizeMcpTool throws when the git common directory cannot be resolved for the current worktree, so the authoritative (coordinator) policy root cannot be located and the request cannot be safely authorized.","triggerScenarios":"Thrown at v3/@claude-flow/cli/src/services/policy-runtime.ts:345 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Ensure the authoritative worker policy root is reachable/mounted","Initialize the policy root if it does not exist"],"exampleFix":"Start or restore the authoritative worker policy root service before dispatching workers.","handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"fa13ee4ad60ac2090b1480656eb233521790d640","analyzedAt":"2026-08-18T21:34:22.708Z","contentChangedAt":"2026-08-18T21:34:22.708Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}