{"record":{"id":"0790cfea9129960f","repo":"earendil-works/pi","slug":"invalid-trust-store-path-value-for-json-stri","errorCode":null,"errorMessage":"Invalid trust store ${path}: value for ${JSON.stringify(key)} must be true, false, or null","messagePattern":"Invalid trust store (.+?): value for (.+?) must be true, false, or null","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/coding-agent/src/core/trust-manager.ts","lineNumber":118,"sourceCode":"\t\treturn {};\n\t}\n\n\tlet parsed: unknown;\n\ttry {\n\t\tparsed = JSON.parse(stripBom(readFileSync(path, \"utf-8\")));\n\t} catch (error) {\n\t\tconst message = error instanceof Error ? error.message : String(error);\n\t\tthrow new Error(`Failed to read trust store ${path}: ${message}`);\n\t}\n\n\tif (typeof parsed !== \"object\" || parsed === null || Array.isArray(parsed)) {\n\t\tthrow new Error(`Invalid trust store ${path}: expected an object`);\n\t}\n\n\tconst data: TrustFile = {};\n\tfor (const [key, value] of Object.entries(parsed)) {\n\t\tif (value !== true && value !== false && value !== null) {\n\t\t\tthrow new Error(`Invalid trust store ${path}: value for ${JSON.stringify(key)} must be true, false, or null`);\n\t\t}\n\t\tdata[key] = value;\n\t}\n\treturn data;\n}\n\nfunction writeTrustFile(path: string, data: TrustFile): void {\n\tconst sorted: TrustFile = {};\n\tfor (const key of Object.keys(data).sort()) {\n\t\tconst value = data[key];\n\t\tif (value === true || value === false || value === null) {\n\t\t\tsorted[key] = value;\n\t\t}\n\t}\n\tmkdirSync(dirname(path), { recursive: true });\n\twriteFileSync(path, `${JSON.stringify(sorted, null, 2)}\\n`, \"utf-8\");\n}\n","sourceCodeStart":100,"sourceCodeEnd":136,"githubUrl":"https://github.com/earendil-works/pi/blob/4af9d21d3b4d664e4a29fcabfec85171077248e3/packages/coding-agent/src/core/trust-manager.ts#L100-L136","documentation":"Value validation in readTrustFile: within the trust-store object, the entry for the named key is not one of the allowed literals true, false, or null. Any other JSON value (string, number, nested object) is rejected for that project-path key.","triggerScenarios":"Thrown at packages/coding-agent/src/core/trust-manager.ts:118 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Set each trust entry to true (trusted), false (distrusted), or null (ask again)","Remove invalid entries so defaults apply"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"4af9d21d3b4d664e4a29fcabfec85171077248e3","analyzedAt":"2026-08-24T13:07:14.692Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}