[PR #6974] [MERGED] fix(hopper): keep installed apt dependencies at their versions during Linux setup #7485

Closed
opened 2026-11-01 21:48:11 +00:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/morluto/rea/pull/6974
Author: @Adolanium
Created: 10/24/2026
Status: ✅ Merged
Merged: 10/24/2026
Merged by: @morluto

Base: main ← Head: fix/linux-setup-no-dependency-upgrade


📝 Commits (5)

  • 07a908b fix(hopper): keep installed apt dependencies at their versions during Linux setup
  • 528c989 fix(hopper): narrow the apt upgrade claim and cover split transaction failures
  • 5874c9d chore(ci): refresh Linux Hopper fix with current main
  • dda4847 fix(evidence): preserve JSON ownership through metadata updates
  • 00da2d2 Merge remote-tracking branch 'upstream/main' into fix/linux-setup-no-dependency-upgrade

📊 Changes

4 files changed (+116 additions, -20 deletions)

View changed files

📝 docs/installation.md (+6 -0)
📝 src/application/LinuxHopper.test.ts (+26 -0)
📝 src/application/LinuxHopper.ts (+6 -1)
📝 src/application/LinuxHopperPackageRuntime.test.ts (+78 -19)

📄 Description

Summary

Fixes #6975.

On Debian and Ubuntu, rea setup installed Hopper with one apt-get install -y <hopper.deb> xvfb xauth python3 libx11-6 libxtst6 transaction. apt-get install upgrades every listed package that is already installed, so approving Hopper setup could also upgrade the system python3 and X11 libraries. Runtime dependencies are now requested with --no-upgrade in their own transaction, before the Hopper archive. This avoids explicitly naming already-installed dependencies as upgrade targets; apt can still upgrade packages when the Hopper archive or Python library repair requires a newer version.

Problem and expected behavior

AGENTS.md: "Installers must not install or upgrade unrelated software." Hopper's runtime dependencies are disclosed and installed when missing, but packages that are already present belong to the user's system and should keep their versions. With the combined transaction, apt treats each listed package as an upgrade target.

Expected: missing dependencies are installed without explicitly requesting upgrades of already-installed runtime dependencies. The Hopper package may change version; version requirements of Hopper or the Python library repair can still require dependency upgrades.

Change and scope

  • src/application/LinuxHopper.ts, linuxPackageManagerCommands for deb: two transactions, apt-get install -y --no-upgrade <dependencies> then apt-get install -y <archive>. The approval disclosure lists both, because it is built from the same commands. Cancellation between transactions is honored as before: the next command is not started.
  • src/application/LinuxHopperPackageRuntime.test.ts: the expected command counts are derived from linuxPackageManagerCommands("deb", …) instead of assuming one install transaction.
  • docs/installation.md states the rule.

Not included: Arch's pacman -S --needed still updates an outdated dependency, and pacman has no equivalent flag; avoiding that would need a separate installed-package query. dnf install does not upgrade installed packages, so the Fedora path is unchanged. Both limits are stated in the docs.

Follow the contribution scope.
Unresolved scope, authority, side effects, or required verification block
integration. Link the required maintainer scope decision for new providers or
capabilities involving target execution, injection, mutation, or protection
recovery; ordinary fixes within existing boundaries may state "not applicable".
Draft PRs may leave the scope decision pending and the readiness and merge checklists
unchecked. Maintainers can help resolve open questions.

Contribution scope: not applicable. This is a fix inside the existing approved Linux setup flow.

Contract and boundary impact

  • Semantic owner and earliest changed stage: linuxPackageManagerCommands, which builds both the executed commands and the approval disclosure.
  • Contribution scope fit and linked maintainer decision: not applicable.
  • CLI and MCP/tool-catalog contract: rea setup's plan on apt systems lists one more command.
  • Provider, bridge, target-format, or platform compatibility: Debian and Ubuntu; Fedora and Arch unchanged.
  • Evidence, artifact, provenance, or reconstruction contract: none.
  • Target selection, authority, upstream behavior, and cleanup details (if applicable): setup no longer explicitly names already-installed runtime dependencies as upgrade targets on apt systems; dependency resolution can still require upgrades.
  • Generated metadata (docs/public/product-catalog.json), package, or installation impact (CI generates and validates ignored catalogs and skills/; edit authored instructions in .agents/skills/reverse-engineer-anything/ and never commit build outputs): installation behavior as described; no package metadata change.

Expected effects (check known effects; use documentation-only on its own).
Unchecked items do not establish absence; leave uncertainties visible.

  • Read existing files or captured data.
  • Launch or attach to a process.
  • Inject instrumentation or run scripts/code.
  • Change process memory, registers, files, or configuration.
  • Contact network services.
  • Recover protected code or work around protections.
  • Documentation or usability only; no target interaction.
  • Not sure yet; investigation or maintainer guidance needed.

Evidence and regression coverage

  • Tests added or updated:
    • src/application/LinuxHopper.test.ts, "keeps installed apt dependencies at their versions while Hopper may upgrade (root: %s)": the exact deb commands, with and without pkexec.
    • src/application/LinuxHopperPackageRuntime.test.ts: the runtime, failure, cancellation and disclosure cases now take the deb transaction count from the command builder; their behavior assertions are unchanged.
  • Base reproduction or other evidence: with src/application/LinuxHopper.ts from upstream/main 3ce311757 and these tests, both new cases fail. The apt upgrade behavior itself is documented apt-get behavior (--no-upgrade: "do not upgrade packages; when used in conjunction with install, no-upgrade will prevent packages on the command line from being upgraded if they are already installed").
  • User-visible CLI/MCP output (if applicable): the Linux setup approval plan on apt systems.
  • Remaining proof gaps: no run against a real Debian or Ubuntu package database; the commands are verified as built.

For evidence-bearing changes:

  • Observed, derived, and inferred claims remain distinguishable.
  • Artifact identity, source provenance, and failed attempts remain preserved.
  • Unsupported, incomplete, unavailable, or uncertain outcomes remain visible.

Validation performed

Current head 00da2d2e6 merges main 03ed0c63d and resolves both Evidence conflicts using the implementation and regressions already merged in #7036. The PR diff is the original four Hopper/setup files. The complete file tree matches the locally tested resolution. No CI gate, assertion, timeout, or retry was weakened.

Executed on macOS arm64 with pinned Node 24.22.1/npm 11.16.0:

  • npm run test:focused -- src/domain/evidence.test.ts src/domain/immutableJson.test.ts src/domain/analysisErrorProjection.test.ts src/domain/analysisSnapshot.test.ts tests/process-global/managedBundleReadGuards.test.ts tests/boundary/filesystem/directAnalysisSnapshotReplay.test.ts tests/boundary/filesystem/evidenceBundleFiles.test.ts tests/boundary/cli/managedMemberSummaryCli.test.ts src/application/LinuxHopper.test.ts src/application/LinuxHopperPackageRuntime.test.ts: 289 passed, 2 Windows-only cases skipped. Covers Hopper transactions and cancellation, the unchanged low-headroom regression, Evidence rebinding/error projection, replay, and compiled managed-summary CLI checks.
  • npm run check: passed (typecheck, lint, module boundaries, architecture guards).
  • npm run docs:check: passed, including 9 README consistency tests.

Earlier source CI failed on release-history typing and a JavaScript lifetime worker exit; the latter was reproduced locally. Both were resolved by upstream fixes brought into the branch. The later low-headroom Evidence failure was also reproduced and repaired; that repair now lives on main through #7036. Static and source CI passed after the first refresh. Required CI is rerunning on the conflict-free current head.

Earlier author validation used Linux/WSL Ubuntu on Node 24.22.1. No real Hopper install or Debian/Ubuntu package transaction was performed for this refresh; Linux-specific package verification remains for Linux CI.

Compatibility, safety, and release

  • Breaking changes or migration steps: none.
  • Real Hopper/Ghidra, browser, or OS coverage: Linux unit and service tests only; no real Hopper install.
  • Package or release metadata impact: none.
  • Security, privacy, process, or containment review: setup changes fewer system packages than before.

Author readiness

Human owner: @Adolanium

  • 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/6974 **Author:** [@Adolanium](https://github.com/Adolanium) **Created:** 10/24/2026 **Status:** ✅ Merged **Merged:** 10/24/2026 **Merged by:** [@morluto](https://github.com/morluto) **Base:** `main` ← **Head:** `fix/linux-setup-no-dependency-upgrade` --- ### 📝 Commits (5) - [`07a908b`](https://github.com/morluto/rea/commit/07a908b7f7162def26b9db8d0113d7fe68d5b11f) fix(hopper): keep installed apt dependencies at their versions during Linux setup - [`528c989`](https://github.com/morluto/rea/commit/528c98992c2b9098aa36c1dd91fb43d06545d8ee) fix(hopper): narrow the apt upgrade claim and cover split transaction failures - [`5874c9d`](https://github.com/morluto/rea/commit/5874c9d1fdf8dc769f67d780931d6013511dc54c) chore(ci): refresh Linux Hopper fix with current main - [`dda4847`](https://github.com/morluto/rea/commit/dda48471f9a8d57125273a13583c654d4a3d36da) fix(evidence): preserve JSON ownership through metadata updates - [`00da2d2`](https://github.com/morluto/rea/commit/00da2d2e625bf76ab6d12c5c023ddcc75023c142) Merge remote-tracking branch 'upstream/main' into fix/linux-setup-no-dependency-upgrade ### 📊 Changes **4 files changed** (+116 additions, -20 deletions) <details> <summary>View changed files</summary> 📝 `docs/installation.md` (+6 -0) 📝 `src/application/LinuxHopper.test.ts` (+26 -0) 📝 `src/application/LinuxHopper.ts` (+6 -1) 📝 `src/application/LinuxHopperPackageRuntime.test.ts` (+78 -19) </details> ### 📄 Description ## Summary Fixes #6975. On Debian and Ubuntu, `rea setup` installed Hopper with one `apt-get install -y <hopper.deb> xvfb xauth python3 libx11-6 libxtst6` transaction. `apt-get install` upgrades every listed package that is already installed, so approving Hopper setup could also upgrade the system `python3` and X11 libraries. Runtime dependencies are now requested with `--no-upgrade` in their own transaction, before the Hopper archive. This avoids explicitly naming already-installed dependencies as upgrade targets; apt can still upgrade packages when the Hopper archive or Python library repair requires a newer version. ## Problem and expected behavior AGENTS.md: "Installers must not install or upgrade unrelated software." Hopper's runtime dependencies are disclosed and installed when missing, but packages that are already present belong to the user's system and should keep their versions. With the combined transaction, apt treats each listed package as an upgrade target. Expected: missing dependencies are installed without explicitly requesting upgrades of already-installed runtime dependencies. The Hopper package may change version; version requirements of Hopper or the Python library repair can still require dependency upgrades. ## Change and scope - `src/application/LinuxHopper.ts`, `linuxPackageManagerCommands` for `deb`: two transactions, `apt-get install -y --no-upgrade <dependencies>` then `apt-get install -y <archive>`. The approval disclosure lists both, because it is built from the same commands. Cancellation between transactions is honored as before: the next command is not started. - `src/application/LinuxHopperPackageRuntime.test.ts`: the expected command counts are derived from `linuxPackageManagerCommands("deb", …)` instead of assuming one install transaction. - `docs/installation.md` states the rule. Not included: Arch's `pacman -S --needed` still updates an outdated dependency, and pacman has no equivalent flag; avoiding that would need a separate installed-package query. `dnf install` does not upgrade installed packages, so the Fedora path is unchanged. Both limits are stated in the docs. Follow the [contribution scope](https://github.com/morluto/rea/blob/main/CONTRIBUTING.md#contribution-scope). Unresolved scope, authority, side effects, or required verification block integration. Link the required maintainer scope decision for new providers or capabilities involving target execution, injection, mutation, or protection recovery; ordinary fixes within existing boundaries may state "not applicable". Draft PRs may leave the scope decision pending and the readiness and merge checklists unchecked. Maintainers can help resolve open questions. Contribution scope: not applicable. This is a fix inside the existing approved Linux setup flow. ## Contract and boundary impact - Semantic owner and earliest changed stage: `linuxPackageManagerCommands`, which builds both the executed commands and the approval disclosure. - Contribution scope fit and linked maintainer decision: not applicable. - CLI and MCP/tool-catalog contract: `rea setup`'s plan on apt systems lists one more command. - Provider, bridge, target-format, or platform compatibility: Debian and Ubuntu; Fedora and Arch unchanged. - Evidence, artifact, provenance, or reconstruction contract: none. - Target selection, authority, upstream behavior, and cleanup details (if applicable): setup no longer explicitly names already-installed runtime dependencies as upgrade targets on apt systems; dependency resolution can still require upgrades. - Generated metadata (`docs/public/product-catalog.json`), package, or installation impact (CI generates and validates ignored catalogs and `skills/`; edit authored instructions in `.agents/skills/reverse-engineer-anything/` and never commit build outputs): installation behavior as described; no package metadata change. Expected effects (check known effects; use documentation-only on its own). Unchecked items do not establish absence; leave uncertainties visible. - [ ] Read existing files or captured data. - [x] Launch or attach to a process. - [ ] Inject instrumentation or run scripts/code. - [x] Change process memory, registers, files, or configuration. - [ ] Contact network services. - [ ] Recover protected code or work around protections. - [ ] Documentation or usability only; no target interaction. - [ ] Not sure yet; investigation or maintainer guidance needed. ## Evidence and regression coverage - Tests added or updated: - `src/application/LinuxHopper.test.ts`, "keeps installed apt dependencies at their versions while Hopper may upgrade (root: %s)": the exact deb commands, with and without `pkexec`. - `src/application/LinuxHopperPackageRuntime.test.ts`: the runtime, failure, cancellation and disclosure cases now take the deb transaction count from the command builder; their behavior assertions are unchanged. - Base reproduction or other evidence: with `src/application/LinuxHopper.ts` from upstream/main 3ce311757 and these tests, both new cases fail. The apt upgrade behavior itself is documented apt-get behavior (`--no-upgrade`: "do not upgrade packages; when used in conjunction with install, no-upgrade will prevent packages on the command line from being upgraded if they are already installed"). - User-visible CLI/MCP output (if applicable): the Linux setup approval plan on apt systems. - Remaining proof gaps: no run against a real Debian or Ubuntu package database; the commands are verified as built. For evidence-bearing changes: - [x] Observed, derived, and inferred claims remain distinguishable. - [x] Artifact identity, source provenance, and failed attempts remain preserved. - [x] Unsupported, incomplete, unavailable, or uncertain outcomes remain visible. ## Validation performed Current head `00da2d2e6` merges main `03ed0c63d` and resolves both Evidence conflicts using the implementation and regressions already merged in #7036. The PR diff is the original four Hopper/setup files. The complete file tree matches the locally tested resolution. No CI gate, assertion, timeout, or retry was weakened. Executed on macOS arm64 with pinned Node 24.22.1/npm 11.16.0: - `npm run test:focused -- src/domain/evidence.test.ts src/domain/immutableJson.test.ts src/domain/analysisErrorProjection.test.ts src/domain/analysisSnapshot.test.ts tests/process-global/managedBundleReadGuards.test.ts tests/boundary/filesystem/directAnalysisSnapshotReplay.test.ts tests/boundary/filesystem/evidenceBundleFiles.test.ts tests/boundary/cli/managedMemberSummaryCli.test.ts src/application/LinuxHopper.test.ts src/application/LinuxHopperPackageRuntime.test.ts`: 289 passed, 2 Windows-only cases skipped. Covers Hopper transactions and cancellation, the unchanged low-headroom regression, Evidence rebinding/error projection, replay, and compiled managed-summary CLI checks. - `npm run check`: passed (typecheck, lint, module boundaries, architecture guards). - `npm run docs:check`: passed, including 9 README consistency tests. Earlier source CI failed on release-history typing and a JavaScript lifetime worker exit; the latter was reproduced locally. Both were resolved by upstream fixes brought into the branch. The later low-headroom Evidence failure was also reproduced and repaired; that repair now lives on main through #7036. Static and source CI passed after the first refresh. Required CI is rerunning on the conflict-free current head. Earlier author validation used Linux/WSL Ubuntu on Node 24.22.1. No real Hopper install or Debian/Ubuntu package transaction was performed for this refresh; Linux-specific package verification remains for Linux CI. ## Compatibility, safety, and release - Breaking changes or migration steps: none. - Real Hopper/Ghidra, browser, or OS coverage: Linux unit and service tests only; no real Hopper install. - Package or release metadata impact: none. - Security, privacy, process, or containment review: setup changes fewer system packages than before. ## Author readiness <!-- The human owner completes these declarations before requesting review. The PR author is the owner by default. A different owner must explicitly accept ownership on this PR. AI agents must leave these declarations to a human to dictate to them or there could be catastrophic consequences for many users of REA. Draft PRs may leave them unchecked. These declarations record initial readiness when opening the PR for review; later pushes do not require a new human sign-off. Keep the description and validation evidence current as the work changes. See CONTRIBUTING.md#pull-request-ownership-and-readiness. --> Human owner: @Adolanium - [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 <!-- Draft PRs may leave pending items unchecked. Resolve material scope and authority questions before integration. --> - [ ] 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. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-01 21:48:11 +00:00
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#7485
No description provided.