Harness Intelligence Wiki
SpecsCLIBun Global Upgrade Symlink Detection

Implementation Notes: Bun Global Upgrade Symlink Detection

Implementation Notes: Bun Global Upgrade Symlink Detection

Summary

Made CLI self-update install-manager detection symlink-aware so Bun global installs can upgrade themselves even when the invoked dp path is only the bin symlink.

Changes

  • apps/cli/src/core/self-update.ts ignores non-path argv entries and resolves the entrypoint with realpathSync.
  • Bun detection now recognizes install/global/node_modules/@punks/cli before generic npm node_modules detection.
  • apps/cli/src/core/self-update.test.ts covers a temporary Bun-style bin/dp symlink.
  • CHANGELOG.md, apps/cli/package.json, and bun.lock move the next executable release to 2.2.3.
  • docs/README.md and docs/runbooks/dp-cli-scaffolding.md document the symlink-aware upgrade behavior.

Validation Evidence

  • RED: isolated @punks/cli@2.2.1 Bun-global repro returned manager-not-detected.
  • RED: worker regression failed before the fix with expected bun, received null.
  • GREEN: npm --prefix apps/cli test
  • GREEN: npm --prefix apps/cli run check-types
  • GREEN: npm --prefix apps/cli run check
  • GREEN: publish-shaped temp Bun global install of local 2.2.3 returned packageManager: "bun" for dp upgrade --force --json

Manual Review Checklist

CheckResultEvidence
Bun symlink detection coveredPassFocused regression creates the bin/dp symlink.
Local dist manager guessing preservedPassExisting local dist test remains green.
Generic npm detection preservedPassExisting global path tests remain green.
Release metadata ready for publishPass@punks/cli version and changelog are 2.2.3.
Backlog mirrorNoneNo backlog issue was provided for this debt.

On this page