{"record":{"id":"defda7c40bf90846","repo":"earendil-works/pi","slug":"project-is-not-trusted-refusing-to-access-project","errorCode":null,"errorMessage":"Project is not trusted; refusing to access project package storage","messagePattern":"Project is not trusted; refusing to access project package storage","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/coding-agent/src/core/package-manager.ts","lineNumber":1743,"sourceCode":"\t\t\t\tresult[index] = entry;\n\t\t\t}\n\t\t}\n\t\treturn result;\n\t}\n\n\tprivate parseNpmSpec(spec: string): { name: string; version?: string } {\n\t\tconst match = spec.match(/^(@?[^@]+(?:\\/[^@]+)?)(?:@(.+))?$/);\n\t\tif (!match) {\n\t\t\treturn { name: spec };\n\t\t}\n\t\tconst name = match[1] ?? spec;\n\t\tconst version = match[2];\n\t\treturn { name, version };\n\t}\n\n\tprivate assertProjectTrustedForScope(scope: SourceScope): void {\n\t\tif (scope === \"project\" && !this.settingsManager.isProjectTrusted()) {\n\t\t\tthrow new Error(\"Project is not trusted; refusing to access project package storage\");\n\t\t}\n\t}\n\n\tprivate getNpmCommand(): { command: string; args: string[] } {\n\t\tconst configuredCommand = this.settingsManager.getNpmCommand();\n\t\tif (!configuredCommand || configuredCommand.length === 0) {\n\t\t\treturn { command: \"npm\", args: [] };\n\t\t}\n\t\tconst [command, ...args] = configuredCommand;\n\t\tif (!command) {\n\t\t\tthrow new Error(\"Invalid npmCommand: first array entry must be a non-empty command\");\n\t\t}\n\t\treturn { command, args };\n\t}\n\n\tprivate getPackageManagerName(): string {\n\t\tconst npmCommand = this.getNpmCommand();\n\t\tconst commandParts = [npmCommand.command, ...npmCommand.args];","sourceCodeStart":1725,"sourceCodeEnd":1761,"githubUrl":"https://github.com/earendil-works/pi/blob/4af9d21d3b4d664e4a29fcabfec85171077248e3/packages/coding-agent/src/core/package-manager.ts#L1725-L1761","documentation":"Error \"Project is not trusted; refusing to access project package storage\" thrown in earendil-works/pi.","triggerScenarios":"Thrown at packages/coding-agent/src/core/package-manager.ts:1743 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":"4af9d21d3b4d664e4a29fcabfec85171077248e3","analyzedAt":"2026-08-24T13:07:14.692Z","schemaVersion":2},"datasetVersion":"2026-08-24T17:17:21.512Z"}