[PR #7207] [MERGED] fix(setup): report Kuna cache aliases consistently #7717

Closed
opened 2026-11-03 13:39:51 +00:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/morluto/rea/pull/7207
Author: @rudycelekli
Created: 10/26/2026
Status: ✅ Merged
Merged: 10/27/2026
Merged by: @gensokyo-dev

Base: main ← Head: fix-setup-kuna-cache-spelling


📝 Commits (8)

  • 73745a8 fix(setup): purge a respelling of the owned Kuna cache
  • 91e16c8 fix(setup): preserve cache identity across symlink parent traversal
  • 66ef8a2 Merge remote-tracking branch 'origin/main' into remediate/7207-20261027
  • 9b1846e test(setup): verify Kuna purge reporting through the CLI
  • 51bf7a9 fix(setup): report equivalent Kuna cache paths consistently
  • 5914bde test(setup): simplify the remaining Darwin cache cases
  • f1fdc54 fix(setup): plan cache selection before deleting the working directory
  • dca60b0 test(filesystem): require absolute path resolution without ambient cwd

📊 Changes

7 files changed (+318 additions, -19 deletions)

View changed files

📝 docs/installation.md (+3 -0)
📝 src/application/Uninstall.ts (+23 -9)
📝 src/config/kunaCacheDirectory.ts (+30 -2)
📝 src/filesystem/callerPath.ts (+8 -6)
➕ tests/acceptance/setup/kunaCachePurgeCli.test.ts (+82 -0)
📝 tests/boundary/filesystem/callerPath.test.ts (+17 -1)
📝 tests/boundary/filesystem/managedDataPurge.test.ts (+155 -1)

📄 Description

Summary

With REA_KUNA_CACHE_DIR=/.../rea/kuna/., purge reported both kuna: removed and kuna-custom-cache: retained even though the cache was gone. Lexically equivalent default-cache spellings now share the default namespace's actual removed/skipped/retained result.

The configuration owner reuses absoluteCallerPath rather than reparsing paths; POSIX parent traversal and literal backslashes keep their identity. Uninstall consumes a named default-cache fact and plans selections before deleting managed directories. The shared POSIX parser reads ambient cwd only when needed. Removal ownership checks and result/removal ordering stay intact; docs explain the scope. No exact open issue is linked; this was reported directly as a PR.

Validation

Started from refreshed main c9df40f8104eb0c7dfb57dc831b4c28c3ab77b8b, after #7206; original fork head 66ef8a251136217dcab64052922862c60185528d is preserved in history.

  • Original boundary regressions on unchanged production: 4 failed / 5 passed. New public CLI cases on unchanged production: 1 failed / 1 passed. Final focused suites: 26 passed (12 purge boundaries, 2 real CLI cases, 6 caller-path contracts, 6 filesystem traversal consumers).

  • Review finding reproduced with actual removal of cwd in isolated native processes: 2 failed on the previous PR head. Fixing the parser alone exposed 2 relative-selector failures / 2 absolute-selector passes; planning selections before removal resolves all four. Direct CLI invocations already cached cwd and did not reproduce this exception; the regression intentionally resets Node's cache before the actual workflow. Caller evidence remains byte-identical. A stale Darwin-only table branch caught by static checking was also removed.

  • Final serial check:fast passed: 39.834 s elapsed / 58.088 s CPU / 3620.52 MiB sampled process-family RSS, two CPUs. docs:check passed, including 9 conformance tests.

  • Actual Linux rea uninstall --purge-data --format json under isolated HOME/XDG/config/cwd: 8 calls before and after cover trailing separator, dot, repeated separator, repeated purge, arbitrary custom directory, real symlink/parent traversal, literal backslash and an unowned final cache symlink. Post-call existence/content checks establish removal and retention, including read-only cache content. Parent/custom/sibling data survive, final namespace links are retained, repeat purge is skipped. Gemini system paths are redirected into the fixture home; no real user configuration/cache was touched. The final source passed the same eight-call harness again (28.861 s elapsed / 31.738 s CPU / 269.33 MiB family RSS). Full replies total 60083 → 58898 bytes by removing redundant alias rows; byte savings alone do not establish token savings.

  • Before/after single-call custom-directory controls on the same two CPUs: cold Node compile cache disabled 3.845 → 3.885 s elapsed / 4.157 → 4.200 s CPU / 263.95 → 260.65 MiB; warm after per-lane compile-cache warmup 3.497 → 3.490 s / 3.685 → 3.839 s CPU / 271.43 → 274.80 MiB. Each returns 7484 bytes with equivalent status and preserved real data. Pinned Node confirms the owned compile cache enabled. Single ordered samples, uncontrolled filesystem cache/host load: no causal performance improvement claim.

Native Kuna engine execution and native macOS behavior were not verified. Darwin policy is exercised on Linux. Model-token usage is unmeasured; complete structured removal results remain accessible. The implementation adds bounded path-string comparison without additional filesystem traversal, payload copies or cached live state. Resource figures sample process-family RSS every 100 ms, so shared pages can be counted twice and short peaks can be missed.

Hosted CI and review

Tested head: dca60b00ba4350e7eafe9f885bcf0a0df5638c35. CI run 40463100944 completed against exact main 0676ad254c206871e0f4b120ba300cbbf9383b62: 20 successful / 7 failed / 7 cancelled / 9 skipped jobs.

Static checks, package build, docs, browser, APK, Web runtime, native-package baselines on Linux x64/arm64 and Darwin arm64, and SQLite Node 24/26 passed. Failures were assessed against unchanged main:

  • Source: 17 failed / 20,714 passed / 15 skipped. Exact main control reproduces all 17 names and error-header categories (17 failed / 49 passed).
  • Shard 2: 8 failed / 1,774 passed / 29 skipped. Exact main control reproduces all eight failures in process completion, Grok timeout preservation and ZCode fallback configuration.
  • Node 22.23.4 SQLite: 2 failed / 123 passed / 82 skipped. The same two failures reproduce on exact main using an isolated Node 22.23.4 executable from the SHA-256-verified official archive. Its native SQLite limits API is unavailable; those existing cases lack the runtime guard.
  • Windows: 15 failed / 831 passed / 56 skipped. Fourteen failures reproduce in Linux exact-main controls (8 loader, 5 client-config, 1 Java). The Windows-only Kimi case was not run on a native Windows baseline; its fixture and producer code are unchanged.
  • macOS artifact lane: 2 failed / 366 passed / 5 skipped, both process lifecycle cases. The shared completion/cleanup failure reproduces on Linux exact main; the Darwin-only CLI expectation was not rerun on native macOS. Its fixture, ProcessCli and ownership implementation are unchanged. This is not a native-platform baseline reproduction claim.
  • Portable/required jobs aggregate the preceding failures. Seven fail-fast matrix cancellations are unverified coverage, not passes. No failure unique to the scoped change was found; native baseline gaps above remain explicit.

Final Greptile review is complete (4/5, head dca60b00): the actionable purge cwd finding is fixed and covered. Two new P2 comments concern unchanged main Evidence-count reconstruction and export-test root cleanup. Producer/consumer files were checked byte-for-byte at starting main, PR head and CI base; replies explain that scope, with threads resolved as outside this patch, not as fixed. PR base metadata was refreshed to main without changing head, removing unrelated historical diff and showing the actual seven changed files. Repository Codex review quota is exhausted; unavailable review is not a pass.

Human declarations remain unchecked. The requester explicitly authorized ready status and administrative bypass of unrelated-main CI/readiness failures; merge uses that authorization without claiming human review.

Author readiness

Human owner: @rudycelekli

  • 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.

🔄 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/7207 **Author:** [@rudycelekli](https://github.com/rudycelekli) **Created:** 10/26/2026 **Status:** ✅ Merged **Merged:** 10/27/2026 **Merged by:** [@gensokyo-dev](https://github.com/gensokyo-dev) **Base:** `main` ← **Head:** `fix-setup-kuna-cache-spelling` --- ### 📝 Commits (8) - [`73745a8`](https://github.com/morluto/rea/commit/73745a86f63730d97d6cf43413f112df53b78420) fix(setup): purge a respelling of the owned Kuna cache - [`91e16c8`](https://github.com/morluto/rea/commit/91e16c8d60dd1378dfeb60a0a86d6f15e52153c7) fix(setup): preserve cache identity across symlink parent traversal - [`66ef8a2`](https://github.com/morluto/rea/commit/66ef8a251136217dcab64052922862c60185528d) Merge remote-tracking branch 'origin/main' into remediate/7207-20261027 - [`9b1846e`](https://github.com/morluto/rea/commit/9b1846ea465ad32d81d7508126d4753bc286d39e) test(setup): verify Kuna purge reporting through the CLI - [`51bf7a9`](https://github.com/morluto/rea/commit/51bf7a90f434f33ff6269346542dfe4038d535e4) fix(setup): report equivalent Kuna cache paths consistently - [`5914bde`](https://github.com/morluto/rea/commit/5914bde6c99cc41e37f3c7c9e1726761bf666000) test(setup): simplify the remaining Darwin cache cases - [`f1fdc54`](https://github.com/morluto/rea/commit/f1fdc5413c6436ade60f4c13a4fb1b03305a97e3) fix(setup): plan cache selection before deleting the working directory - [`dca60b0`](https://github.com/morluto/rea/commit/dca60b00ba4350e7eafe9f885bcf0a0df5638c35) test(filesystem): require absolute path resolution without ambient cwd ### 📊 Changes **7 files changed** (+318 additions, -19 deletions) <details> <summary>View changed files</summary> 📝 `docs/installation.md` (+3 -0) 📝 `src/application/Uninstall.ts` (+23 -9) 📝 `src/config/kunaCacheDirectory.ts` (+30 -2) 📝 `src/filesystem/callerPath.ts` (+8 -6) ➕ `tests/acceptance/setup/kunaCachePurgeCli.test.ts` (+82 -0) 📝 `tests/boundary/filesystem/callerPath.test.ts` (+17 -1) 📝 `tests/boundary/filesystem/managedDataPurge.test.ts` (+155 -1) </details> ### 📄 Description ## Summary With `REA_KUNA_CACHE_DIR=/.../rea/kuna/.`, purge reported both `kuna: removed` and `kuna-custom-cache: retained` even though the cache was gone. Lexically equivalent default-cache spellings now share the default namespace's actual removed/skipped/retained result. The configuration owner reuses `absoluteCallerPath` rather than reparsing paths; POSIX parent traversal and literal backslashes keep their identity. Uninstall consumes a named default-cache fact and plans selections before deleting managed directories. The shared POSIX parser reads ambient cwd only when needed. Removal ownership checks and result/removal ordering stay intact; docs explain the scope. No exact open issue is linked; this was reported directly as a PR. ## Validation Started from refreshed main `c9df40f8104eb0c7dfb57dc831b4c28c3ab77b8b`, after #7206; original fork head `66ef8a251136217dcab64052922862c60185528d` is preserved in history. - Original boundary regressions on unchanged production: **4 failed / 5 passed**. New public CLI cases on unchanged production: **1 failed / 1 passed**. Final focused suites: **26 passed** (12 purge boundaries, 2 real CLI cases, 6 caller-path contracts, 6 filesystem traversal consumers). - Review finding reproduced with actual removal of cwd in isolated native processes: **2 failed** on the previous PR head. Fixing the parser alone exposed **2 relative-selector failures / 2 absolute-selector passes**; planning selections before removal resolves all four. Direct CLI invocations already cached cwd and did not reproduce this exception; the regression intentionally resets Node's cache before the actual workflow. Caller evidence remains byte-identical. A stale Darwin-only table branch caught by static checking was also removed. - Final serial `check:fast` passed: **39.834 s elapsed / 58.088 s CPU / 3620.52 MiB** sampled process-family RSS, two CPUs. `docs:check` passed, including 9 conformance tests. - Actual Linux `rea uninstall --purge-data --format json` under isolated HOME/XDG/config/cwd: **8 calls before and after** cover trailing separator, dot, repeated separator, repeated purge, arbitrary custom directory, real symlink/parent traversal, literal backslash and an unowned final cache symlink. Post-call existence/content checks establish removal and retention, including read-only cache content. Parent/custom/sibling data survive, final namespace links are retained, repeat purge is skipped. Gemini system paths are redirected into the fixture home; no real user configuration/cache was touched. The final source passed the same eight-call harness again (28.861 s elapsed / 31.738 s CPU / 269.33 MiB family RSS). Full replies total 60083 → 58898 bytes by removing redundant alias rows; byte savings alone do not establish token savings. - Before/after single-call custom-directory controls on the same two CPUs: cold Node compile cache disabled **3.845 → 3.885 s elapsed / 4.157 → 4.200 s CPU / 263.95 → 260.65 MiB**; warm after per-lane compile-cache warmup **3.497 → 3.490 s / 3.685 → 3.839 s CPU / 271.43 → 274.80 MiB**. Each returns 7484 bytes with equivalent status and preserved real data. Pinned Node confirms the owned compile cache enabled. Single ordered samples, uncontrolled filesystem cache/host load: no causal performance improvement claim. Native Kuna engine execution and native macOS behavior were not verified. Darwin policy is exercised on Linux. Model-token usage is unmeasured; complete structured removal results remain accessible. The implementation adds bounded path-string comparison without additional filesystem traversal, payload copies or cached live state. Resource figures sample process-family RSS every 100 ms, so shared pages can be counted twice and short peaks can be missed. ## Hosted CI and review Tested head: `dca60b00ba4350e7eafe9f885bcf0a0df5638c35`. CI run [40463100944](https://github.com/morluto/rea/actions/runs/40463100944) completed against exact main `0676ad254c206871e0f4b120ba300cbbf9383b62`: **20 successful / 7 failed / 7 cancelled / 9 skipped jobs**. Static checks, package build, docs, browser, APK, Web runtime, native-package baselines on Linux x64/arm64 and Darwin arm64, and SQLite Node 24/26 passed. Failures were assessed against unchanged main: - Source: **17 failed / 20,714 passed / 15 skipped**. Exact main control reproduces all 17 names and error-header categories (17 failed / 49 passed). - Shard 2: **8 failed / 1,774 passed / 29 skipped**. Exact main control reproduces all eight failures in process completion, Grok timeout preservation and ZCode fallback configuration. - Node 22.23.4 SQLite: **2 failed / 123 passed / 82 skipped**. The same two failures reproduce on exact main using an isolated Node 22.23.4 executable from the SHA-256-verified official archive. Its native SQLite limits API is unavailable; those existing cases lack the runtime guard. - Windows: **15 failed / 831 passed / 56 skipped**. Fourteen failures reproduce in Linux exact-main controls (8 loader, 5 client-config, 1 Java). The Windows-only Kimi case was not run on a native Windows baseline; its fixture and producer code are unchanged. - macOS artifact lane: **2 failed / 366 passed / 5 skipped**, both process lifecycle cases. The shared completion/cleanup failure reproduces on Linux exact main; the Darwin-only CLI expectation was not rerun on native macOS. Its fixture, ProcessCli and ownership implementation are unchanged. This is not a native-platform baseline reproduction claim. - Portable/required jobs aggregate the preceding failures. Seven fail-fast matrix cancellations are unverified coverage, not passes. No failure unique to the scoped change was found; native baseline gaps above remain explicit. Final Greptile review is complete (**4/5**, head `dca60b00`): the actionable purge cwd finding is fixed and covered. Two new P2 comments concern unchanged main Evidence-count reconstruction and export-test root cleanup. Producer/consumer files were checked byte-for-byte at starting main, PR head and CI base; replies explain that scope, with threads resolved as outside this patch, not as fixed. PR base metadata was refreshed to `main` without changing head, removing unrelated historical diff and showing the actual seven changed files. Repository Codex review quota is exhausted; unavailable review is not a pass. Human declarations remain unchecked. The requester explicitly authorized ready status and administrative bypass of unrelated-main CI/readiness failures; merge uses that authorization without claiming human review. ## Author readiness Human owner: @rudycelekli - [ ] 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. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-03 13:39:51 +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#7717
No description provided.