[GH-ISSUE #6531] [Bug] uninstall --purge-data leaves REA's current Kuna and Hopper caches behind #3923

Closed
opened 2026-10-31 00:45:16 +00:00 by bsakaguchi · 1 comment
Owner

Originally created by @coygeek on GitHub (Oct 23, 2026).
Original GitHub issue: https://github.com/morluto/rea/issues/6531

Before submitting

  • I searched the open and closed issues for a related report.
  • I removed credentials, tokens, private paths, and sensitive target data.

Area

Setup, packaging, or upgrade

Observed behavior

Source-only finding; runtime not run. The public rea uninstall --purge-data workflow purges only ~/.rea/cache and ~/.rea/state. It never visits the current REA-owned Kuna cache or Linux Hopper release cache, so their files survive even when uninstall reports status: "complete".

With default paths, the omitted directories are ~/.cache/rea/kuna and ~/.cache/rea/hopper-releases on Linux, and ~/Library/Caches/rea/kuna on macOS. The Linux caches also follow an absolute XDG_CACHE_HOME, which uninstall likewise ignores.

Reproduction

Proposed reduced check, unexecuted:

  1. Use an isolated Linux home with no client configurations, no active REA sessions, and XDG_CACHE_HOME unset.
  2. Create representative retained-cache files under ~/.cache/rea/kuna/projects/fixture/manifest.json and ~/.cache/rea/hopper-releases/fixture/archive. These are reduced path fixtures, not valid provider artifacts.
  3. Run rea uninstall --purge-data --json.
  4. Check the two fixture files. Source predicts both remain, while the purge items only name ~/.rea/cache and ~/.rea/state as absent.

The production paths are reachable without synthetic fixtures: Kuna project export creates its cache directories, and approved Linux Hopper setup retains its verified package archive. No provider installation, CLI execution, or runtime frequency measurement was performed for this report.

Expected behavior

The documented purge option should account for the REA-owned caches current code creates. It should remove eligible inactive caches or explicitly report why a cache is retained, rather than silently omit their locations.

The installation guide says --purge-data additionally removes REA cache and state paths. This concerns REA's cache files; the separately installed Hopper application can remain.

Impact and scope

Source-derived scope: cleanup leaves project exports, Kuna's isolated spec cache, and downloaded Hopper archive evidence on disk. A completed uninstall therefore does not deliver the advertised cache purge. Both default Kuna host paths are omitted; Hopper's retained release cache is omitted on Linux.

NOT_ENOUGH_INFO: actual retained byte counts, affected-user frequency, and a public CLI runtime result were not measured. A manual workaround is to stop REA sessions and remove the documented REA cache directories; that workaround was not executed here. Custom cache ownership and active-session handling need explicit treatment in a fix.

REA version

rea-agents 6.7.0 source; inspected commit 28a33cae8f.

Runtime and platform

Linux x64 source inspection; no REA runtime execution. Node.js and provider versions: not applicable to the source-only proof. macOS path scope is source-derived, not platform-tested.

Target and artifact context

REA-owned provider caches; no target binary was opened.

Interface

Package or setup

Earliest failure stage

Cleanup, cancellation, or lifecycle

Relevant output or evidence

Source evidence, inspected once before drafting:

NOT_ENOUGH_INFO: no runtime output is supplied because the proposed check was not run.

Typed outcome or recovery expected

Restoration signal: after a successful inactive-cache purge, representative files in the current default Kuna and Linux Hopper cache locations are absent. Each resolved cache should have a removal, skip, retained, or failure item; a cache that cannot be purged should have a concrete recovery reason.

Analysis or suspected cause

Source-derived cause: uninstall still hardcodes the legacy ~/.rea/{cache,state} layout instead of consuming the cache locations owned by the current provider/setup code. Kuna and Hopper are variants of the same incomplete-purge result and are grouped here.

Additional context

Open and closed searches included uninstall cache, purge-data, uninstall hopper-releases, and purge Kuna in this repository. No equivalent report was found. Related #4394 requests persistent investigation notes and mentions the legacy purge paths as context; it does not report this omission. Closed #1816 concerns following a symlinked legacy root, a different behavior.

Triage assessment

  • Impact level: P2
  • Assessment status: provisional
  • Impact basis: Current source leaves REA-owned project exports and downloaded release archives after a requested cache purge while allowing a complete result. Disk usage and runtime reach were not measured.
  • Workaround status: unverified
  • Workaround basis: The documented cache locations can be targeted for manual cleanup after REA sessions stop, but that cleanup was not executed in this source-only audit.
Originally created by @coygeek on GitHub (Oct 23, 2026). Original GitHub issue: https://github.com/morluto/rea/issues/6531 ### Before submitting - [x] I searched the open and closed issues for a related report. - [x] I removed credentials, tokens, private paths, and sensitive target data. ### Area Setup, packaging, or upgrade ### Observed behavior Source-only finding; runtime not run. The public `rea uninstall --purge-data` workflow purges only `~/.rea/cache` and `~/.rea/state`. It never visits the current REA-owned Kuna cache or Linux Hopper release cache, so their files survive even when uninstall reports `status: "complete"`. With default paths, the omitted directories are `~/.cache/rea/kuna` and `~/.cache/rea/hopper-releases` on Linux, and `~/Library/Caches/rea/kuna` on macOS. The Linux caches also follow an absolute `XDG_CACHE_HOME`, which uninstall likewise ignores. ### Reproduction Proposed reduced check, unexecuted: 1. Use an isolated Linux home with no client configurations, no active REA sessions, and `XDG_CACHE_HOME` unset. 2. Create representative retained-cache files under `~/.cache/rea/kuna/projects/fixture/manifest.json` and `~/.cache/rea/hopper-releases/fixture/archive`. These are reduced path fixtures, not valid provider artifacts. 3. Run `rea uninstall --purge-data --json`. 4. Check the two fixture files. Source predicts both remain, while the purge items only name `~/.rea/cache` and `~/.rea/state` as absent. The production paths are reachable without synthetic fixtures: Kuna project export creates its cache directories, and approved Linux Hopper setup retains its verified package archive. No provider installation, CLI execution, or runtime frequency measurement was performed for this report. ### Expected behavior The documented purge option should account for the REA-owned caches current code creates. It should remove eligible inactive caches or explicitly report why a cache is retained, rather than silently omit their locations. The [installation guide](https://github.com/morluto/rea/blob/28a33cae8f8d4de8e11f7a266ff0d756432ab092/docs/installation.md#L387-L394) says `--purge-data` additionally removes REA cache and state paths. This concerns REA's cache files; the separately installed Hopper application can remain. ### Impact and scope Source-derived scope: cleanup leaves project exports, Kuna's isolated spec cache, and downloaded Hopper archive evidence on disk. A completed uninstall therefore does not deliver the advertised cache purge. Both default Kuna host paths are omitted; Hopper's retained release cache is omitted on Linux. NOT_ENOUGH_INFO: actual retained byte counts, affected-user frequency, and a public CLI runtime result were not measured. A manual workaround is to stop REA sessions and remove the documented REA cache directories; that workaround was not executed here. Custom cache ownership and active-session handling need explicit treatment in a fix. ### REA version rea-agents 6.7.0 source; inspected commit 28a33cae8f8d4de8e11f7a266ff0d756432ab092. ### Runtime and platform Linux x64 source inspection; no REA runtime execution. Node.js and provider versions: not applicable to the source-only proof. macOS path scope is source-derived, not platform-tested. ### Target and artifact context REA-owned provider caches; no target binary was opened. ### Interface Package or setup ### Earliest failure stage Cleanup, cancellation, or lifecycle ### Relevant output or evidence Source evidence, inspected once before drafting: - [Uninstall's production host](https://github.com/morluto/rea/blob/28a33cae8f8d4de8e11f7a266ff0d756432ab092/src/application/Uninstall.ts#L333-L341) passes only `join(home, ".rea")` into `purgeManagedData`. [That function](https://github.com/morluto/rea/blob/28a33cae8f8d4de8e11f7a266ff0d756432ab092/src/application/Uninstall.ts#L747-L777) enumerates only `cache` and `state`; it has no current provider-cache discovery. - [Kuna configuration](https://github.com/morluto/rea/blob/28a33cae8f8d4de8e11f7a266ff0d756432ab092/src/kuna/KunaConfiguration.ts#L90-L103) selects `Library/Caches/rea/kuna` on macOS or `$XDG_CACHE_HOME/rea/kuna` / `~/.cache/rea/kuna` on Linux. [KunaProvider](https://github.com/morluto/rea/blob/28a33cae8f8d4de8e11f7a266ff0d756432ab092/src/kuna/KunaProvider.ts#L327-L333) passes that path to `KunaProjectCache`, whose [production export path](https://github.com/morluto/rea/blob/28a33cae8f8d4de8e11f7a266ff0d756432ab092/src/kuna/KunaProjectCache.ts#L725-L741) creates `projects`, `staging`, `trash`, and `home` there. - [Hopper's cache resolver](https://github.com/morluto/rea/blob/28a33cae8f8d4de8e11f7a266ff0d756432ab092/src/application/LinuxHopperPublisher.ts#L98-L118) selects the separate `rea/hopper-releases` directory. [Approved setup](https://github.com/morluto/rea/blob/28a33cae8f8d4de8e11f7a266ff0d756432ab092/src/application/LinuxHopper.ts#L380-L384) calls `retainVerifiedArchive`; the [guide](https://github.com/morluto/rea/blob/28a33cae8f8d4de8e11f7a266ff0d756432ab092/docs/installation.md#L650-L655) documents the retained archive and metadata. - [Uninstall's completion projection](https://github.com/morluto/rea/blob/28a33cae8f8d4de8e11f7a266ff0d756432ab092/src/application/Uninstall.ts#L172-L176) reports complete when the items it collected contain no failure; the omitted caches create no item. NOT_ENOUGH_INFO: no runtime output is supplied because the proposed check was not run. ### Typed outcome or recovery expected Restoration signal: after a successful inactive-cache purge, representative files in the current default Kuna and Linux Hopper cache locations are absent. Each resolved cache should have a removal, skip, retained, or failure item; a cache that cannot be purged should have a concrete recovery reason. ### Analysis or suspected cause Source-derived cause: uninstall still hardcodes the legacy `~/.rea/{cache,state}` layout instead of consuming the cache locations owned by the current provider/setup code. Kuna and Hopper are variants of the same incomplete-purge result and are grouped here. ### Additional context Open and closed searches included `uninstall cache`, `purge-data`, `uninstall hopper-releases`, and `purge Kuna` in this repository. No equivalent report was found. Related #4394 requests persistent investigation notes and mentions the legacy purge paths as context; it does not report this omission. Closed #1816 concerns following a symlinked legacy root, a different behavior. ## Triage assessment - Impact level: P2 - Assessment status: provisional - Impact basis: Current source leaves REA-owned project exports and downloaded release archives after a requested cache purge while allowing a complete result. Disk usage and runtime reach were not measured. - Workaround status: unverified - Workaround basis: The documented cache locations can be targeted for manual cleanup after REA sessions stop, but that cleanup was not executed in this source-only audit.
Author
Owner

@coygeek commented on GitHub (Oct 24, 2026):

Checked the reported fix on main at d87e73f2db.

The production uninstall host now calls purgeSelectedData, which combines legacy cache/state with defaultKunaCacheDirectory on Darwin/Linux and linuxHopperReleaseCacheDirectory on Linux. These are the producers' resolvers and honor their XDG rules. Every selected namespace yields purge items.

Implementation: Uninstall.ts, Uninstall.ts.

The relevant regression checks in managedDataPurge.test.ts passed in the focused test run on this revision. This closure is based on the current source and those checks; provider fixtures do not establish a real-engine run. Closing as completed on main.

<!-- gh-comment-id:6380738746 --> @coygeek commented on GitHub (Oct 24, 2026): Checked the reported fix on `main` at d87e73f2db50be72d33a4b3c7199af35518b441c. The production uninstall host now calls purgeSelectedData, which combines legacy cache/state with defaultKunaCacheDirectory on Darwin/Linux and linuxHopperReleaseCacheDirectory on Linux. These are the producers' resolvers and honor their XDG rules. Every selected namespace yields purge items. Implementation: [Uninstall.ts](https://github.com/morluto/rea/blob/d87e73f2db50be72d33a4b3c7199af35518b441c/src/application/Uninstall.ts#L748), [Uninstall.ts](https://github.com/morluto/rea/blob/d87e73f2db50be72d33a4b3c7199af35518b441c/src/application/Uninstall.ts#L766). The relevant regression checks in [managedDataPurge.test.ts](https://github.com/morluto/rea/blob/d87e73f2db50be72d33a4b3c7199af35518b441c/tests/boundary/filesystem/managedDataPurge.test.ts) passed in the focused test run on this revision. This closure is based on the current source and those checks; provider fixtures do not establish a real-engine run. Closing as completed on main.
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#3923
No description provided.