[PR #5061] fix(update): refuse unverified Bun ancestor ownership #6763

Open
opened 2026-11-01 21:42:52 +00:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/morluto/rea/pull/5061
Author: @xeropresence
Created: 10/18/2026
Status: 🔄 Open

Base: main ← Head: fix/update-bun-ancestor-project


📝 Commits (10+)

  • dfaeb9a fix(update): update Bun global installs in an ancestor project
  • eac377a fix(update): leave ancestor projects that npm may own unidentified
  • 88c49a0 fix(update): refuse unknown Bun ancestor ownership
  • 7ec974a refactor(update): remove obsolete Bun lockfile probe
  • e354ecf fix(update): prefer verified npm ownership
  • e003fae fix(update): refuse unverified npm path ownership
  • 18634e4 fix(update): recognize the documented Linux npm prefix
  • 45bbd8b fix(update): refuse ambiguous Bun installer ownership
  • 45e0a65 fix(update): prefer confirmed package manager ownership
  • 3f66839 fix(update): refuse unverified custom prefix ownership

📊 Changes

5 files changed (+760 additions, -115 deletions)

View changed files

📝 docs/installation.md (+11 -7)
📝 src/application/Update.test.ts (+126 -22)
📝 src/application/Update.ts (+23 -3)
📝 src/application/UpdateRuntime.ts (+102 -56)
📝 tests/process-global/updateMaintenance.test.ts (+498 -27)

📄 Description

Summary

An ancestor Bun project or a path shaped like npm's global layout does not prove ownership of the running REA installation. Updating through either guess can modify a different package-manager project. The updater now proceeds only after exact configured Bun-global or npm-reported global-root ownership is established; otherwise it returns unknown-install-method with manual recovery guidance before package mutation.

The markerless Linux layout fallback and its Bun-lock probe were removed. A supported lockless Bun install can produce the same package, manifest and command-link facts as the old npm installer layout, so neither file shape nor absence of a lock proves npm ownership. Ambiguous older custom-prefix installs require explicit repair/reinstallation into a verified manager location. This change adds no installer receipt, global configuration changes or unrelated software installation.

Validation

On 4aee92d3, 34 process-global tests, check:fast and diff checks passed using Node 24.18.0/npm 11.16.0; the push gate passed and the live fork head was verified. Regressions preserve package version and prove no install command runs for markerless lockless/stale-lock layouts with unknown ownership. Exact npm ownership still works with a stale Bun lock or an unrelated looping .local path. Windows command-shim fixture support remains, but no Windows runtime or real package-manager update was performed locally. Hosted CI is separate.

Author readiness

Human owner: @xeropresence

  • I reviewed the final diff and relevant existing code, understand the change and its edge cases, and take responsibility for the complete PR, including AI-assisted work.
  • I checked the evidence above, confirmed it supports the current change, and recorded meaningful validation gaps.
  • I declare this PR ready for initial maintainer review.

Before merge

  • This PR addresses a concrete problem or an agreed enhancement.
  • Material scope and authority questions are resolved, and any required maintainer scope decision covers the final diff.
  • The PR has one focused outcome and the title follows type(scope): outcome.
  • Related issue is linked, or the reason for not linking one is stated above.
  • Tests cover changed observable behavior and meaningful failure paths.
  • Owning docs, contracts, and generated metadata are updated where needed.
  • User-visible CLI/MCP changes include representative output.
  • I checked the final diff for secrets, unrelated cleanup, and unsupported claims.

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/morluto/rea/pull/5061 **Author:** [@xeropresence](https://github.com/xeropresence) **Created:** 10/18/2026 **Status:** 🔄 Open **Base:** `main` ← **Head:** `fix/update-bun-ancestor-project` --- ### 📝 Commits (10+) - [`dfaeb9a`](https://github.com/morluto/rea/commit/dfaeb9ae196615082550bcc6eaefd6bca63dca81) fix(update): update Bun global installs in an ancestor project - [`eac377a`](https://github.com/morluto/rea/commit/eac377a12a6b838598ae005141d757de5d1605dc) fix(update): leave ancestor projects that npm may own unidentified - [`88c49a0`](https://github.com/morluto/rea/commit/88c49a021b7ec6045bc40b619c2cffd889f9c71b) fix(update): refuse unknown Bun ancestor ownership - [`7ec974a`](https://github.com/morluto/rea/commit/7ec974af8742f806d93be0cc3c16073f04fcf264) refactor(update): remove obsolete Bun lockfile probe - [`e354ecf`](https://github.com/morluto/rea/commit/e354ecfd5aeb30ea5309461a82a932564f97fde9) fix(update): prefer verified npm ownership - [`e003fae`](https://github.com/morluto/rea/commit/e003fae3c21c05084cd71bed32b1ecb17cdfc2ea) fix(update): refuse unverified npm path ownership - [`18634e4`](https://github.com/morluto/rea/commit/18634e4eec941423b830a47efe403c7eab228d75) fix(update): recognize the documented Linux npm prefix - [`45bbd8b`](https://github.com/morluto/rea/commit/45bbd8b77762bc6b14f3df490016f125f7495120) fix(update): refuse ambiguous Bun installer ownership - [`45e0a65`](https://github.com/morluto/rea/commit/45e0a6512b1e8f3d6f60286e7f2e67461379b5c2) fix(update): prefer confirmed package manager ownership - [`3f66839`](https://github.com/morluto/rea/commit/3f66839c882bbf1461c3a2839a9477d61141558c) fix(update): refuse unverified custom prefix ownership ### 📊 Changes **5 files changed** (+760 additions, -115 deletions) <details> <summary>View changed files</summary> 📝 `docs/installation.md` (+11 -7) 📝 `src/application/Update.test.ts` (+126 -22) 📝 `src/application/Update.ts` (+23 -3) 📝 `src/application/UpdateRuntime.ts` (+102 -56) 📝 `tests/process-global/updateMaintenance.test.ts` (+498 -27) </details> ### 📄 Description ## Summary An ancestor Bun project or a path shaped like npm's global layout does not prove ownership of the running REA installation. Updating through either guess can modify a different package-manager project. The updater now proceeds only after exact configured Bun-global or npm-reported global-root ownership is established; otherwise it returns `unknown-install-method` with manual recovery guidance before package mutation. The markerless Linux layout fallback and its Bun-lock probe were removed. A supported lockless Bun install can produce the same package, manifest and command-link facts as the old npm installer layout, so neither file shape nor absence of a lock proves npm ownership. Ambiguous older custom-prefix installs require explicit repair/reinstallation into a verified manager location. This change adds no installer receipt, global configuration changes or unrelated software installation. ## Validation On `4aee92d3`, 34 process-global tests, `check:fast` and diff checks passed using Node 24.18.0/npm 11.16.0; the push gate passed and the live fork head was verified. Regressions preserve package version and prove no install command runs for markerless lockless/stale-lock layouts with unknown ownership. Exact npm ownership still works with a stale Bun lock or an unrelated looping `.local` path. Windows command-shim fixture support remains, but no Windows runtime or real package-manager update was performed locally. Hosted CI is separate. ## Author readiness Human owner: @xeropresence - [x] I reviewed the final diff and relevant existing code, understand the change and its edge cases, and take responsibility for the complete PR, including AI-assisted work. - [x] I checked the evidence above, confirmed it supports the current change, and recorded meaningful validation gaps. - [x] I declare this PR ready for initial maintainer review. ## Before merge - [x] This PR addresses a concrete problem or an agreed enhancement. - [x] Material scope and authority questions are resolved, and any required maintainer scope decision covers the final diff. - [x] The PR has one focused outcome and the title follows `type(scope): outcome`. - [x] Related issue is linked, or the reason for not linking one is stated above. - [x] Tests cover changed observable behavior and meaningful failure paths. - [x] Owning docs, contracts, and generated metadata are updated where needed. - [x] User-visible CLI/MCP changes include representative output. - [x] I checked the final diff for secrets, unrelated cleanup, and unsupported claims. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
morluto/rea#6763
No description provided.