PkgSteward
Audience: End UserLast verified against repo: 2026-11-28

Safety Model (Preview → Confirm)

Every destructive or mutating action in PkgSteward requires a verified preview before any change touches your disk.

Four layers of protection against accidental data loss

Developer cleanup tools often fail in two ways: they delete files without showing what is inside, or they treat source code and reinstallable caches the same way. PkgSteward enforces four architectural safeguards across the API service and Web UI:
  • 1. 4-Step Preview → Review → Confirm → Delete: The API refuses to execute any file deletion, global package update/removal, packageManager pin, or server setting mutation without a valid preview token generated moments earlier.
  • 2. Recycle Bin vs Permanent Delete separation: Reinstallable dependency folders (node_modules) and build caches delete permanently to free disk space immediately. Project roots and source files always route to the Windows Recycle Bin, and abort if the Recycle Bin is unavailable.
  • 3. Global Binary Guard: Before updating or removing a global npm, pnpm, or Yarn Classic package, PkgSteward previews affected executable commands, blocks self-removal of @pnpm/exe, and verifies shared global projects after execution.
  • 4. Console Recovery Hold: If a native Windows CMD or PowerShell command session is interrupted or crashes, PkgSteward places the runner in a Recovery Hold state until you review the interrupted session.
Preview → ConfirmA 4-step safety check that shows you exactly what will change before any file is deleted or any global package is modified.The API generates a time-limited preview token listing target paths, risk tiers, and disposition (Recycle Bin vs permanent delete) that must be confirmed before execution.
Hardlink-Accurate Sizing (Unique Apparent Bytes)Counting shared pnpm package files only once per scan instead of multiplying them across every project folder.Tracks NTFS file identifiers (device + inode/file index) during traversal so hardlinked files from the global pnpm content-addressable store are deduplicated.
Inert ScriptsDisplaying the scripts section of package.json as plain text so opening a project never executes untrusted code.PkgSteward parses package.json without invoking lifecycle hooks (preinstall/postinstall) on read; scripts only run when you explicitly launch them in the Console Runner.
Binary Guard (Bin Protection)Checking which terminal commands (binaries) a global package owns before updating or removing it so you do not break your shell.Diffs global bin shims before mutation, blocks self-destructive changes to @pnpm/exe, and verifies shared global manifests on pnpm 10 and Yarn Classic.
Last verified against repo: 2026-11-28 (apps/api/README.md)View source doc on GitHub(opens in new tab)