Skip to content

feat(package-manager): add project package trust store#1

Closed
aliou wants to merge 6 commits into
mainfrom
feat/package-trust-store
Closed

feat(package-manager): add project package trust store#1
aliou wants to merge 6 commits into
mainfrom
feat/package-trust-store

Conversation

@aliou

@aliou aliou commented Jun 4, 2026

Copy link
Copy Markdown
Owner

All implementation sessions: https://assets.aliou.me/share/traces/2026-06-04-pi-trust/index.html


Summary by GPT-5.5:

Summary

Adds project-scoped trust for remote package sources before project packages are installed or loaded.

Changed files include:

  • packages/coding-agent/src/core/trust-store.ts: defines trust abstractions and filesystem-backed trust storage for agentDir/trust.json.
  • packages/coding-agent/src/core/package-manager.ts: filters project-scoped npm: and git: packages by trust, reports skipped untrusted packages, and auto-trusts explicit project-local installs.
  • packages/coding-agent/src/core/resource-loader.ts: forwards skipped-package warnings during startup resource loading.
  • packages/coding-agent/src/cli/trust-selector.ts and packages/coding-agent/src/modes/interactive/components/trust-selector.ts: adds pi trust candidate selection UI.
  • packages/coding-agent/src/package-manager-cli.ts, packages/coding-agent/src/cli/args.ts, packages/coding-agent/src/main.ts: wires the trust command into the CLI.
  • packages/coding-agent/src/core/sdk.ts and packages/coding-agent/src/core/agent-session-services.ts: exposes trustStore through session service creation.
  • packages/coding-agent/test/trust-store.test.ts and package manager tests: covers trust persistence and trust filtering behavior.

Behavior

  • Nothing is trusted by default.
  • Only project-scoped npm: and git: package sources are checked.
  • Untrusted project packages are skipped before install/load.
  • Startup continues and emits one consolidated warning for skipped packages.
  • pi trust lets users trust or untrust current project package candidates.
  • pi install -l auto-trusts the installed project package as explicit user intent.
  • Trust is scoped to the current cwd and requires both exact source and immutable resolved identity to match.

Validation

  • npm run check passed via pre-commit.

aliou added 6 commits June 4, 2026 19:45
…nager

Add optional trustStore dependency to DefaultResourceLoaderOptions and
PackageManagerOptions. Both DefaultResourceLoader and DefaultPackageManager
get a required private trustStore field typed as TrustStore, with fallback
to FilesystemTrustStore(cwd, agentDir) when not provided.

DefaultResourceLoader passes its trustStore to DefaultPackageManager so
resource loading and package trust checks use the same cwd-scoped state.

CLI and SDK paths rely on the fallback and need no changes.
Allow SDK callers to provide a custom TrustStore. Passed to
DefaultResourceLoader when no custom resourceLoader is supplied.
Custom resourceLoaders retain their own trust behavior.
@aliou aliou closed this Jun 5, 2026
@aliou aliou deleted the feat/package-trust-store branch June 5, 2026 12:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant