[PR #4824] [MERGED] fix(ci): handle cache eviction and composed cleanup assertions #6426

Closed
opened 2026-10-31 01:14:23 +00:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/morluto/rea/pull/4824
Author: @N0zoM1z0
Created: 10/17/2026
Status: ✅ Merged
Merged: 10/17/2026
Merged by: @N0zoM1z0

Base: main ← Head: fix/ci-portable-cache-stage-20261017


📝 Commits (5)

  • 23f9d2d fix(ci): handle eviction when staging portable build cache
  • 658589c docs(readme): fix French heading spacing
  • 1919f94 test(ci): verify observed cache coverage during eviction
  • 875bb89 chore(ci): sync current main before regression verification
  • ee314f6 test(electron): assert composed launch cleanup diagnostics

📊 Changes

7 files changed (+508 additions, -67 deletions)

View changed files

📝 .github/workflows/ci.yml (+2 -2)
📝 docs/readme/README_fr.md (+1 -0)
📝 docs/testing.md (+8 -3)
📝 scripts/ci/portable-build-cache.mjs (+84 -22)
📝 tests/boundary/filesystem/ciPortableBuildCache.test.ts (+344 -13)
📝 tests/boundary/filesystem/ciRequiredLanes.test.ts (+1 -1)
📝 tests/boundary/process/electronLaunchRejections.test.ts (+68 -26)

📄 Description

Summary

Restore main CI across three independently reproduced blockers: cache entries can disappear after successful builds, the Electron launch regression reads obsolete raw error fields, and the French README needs a formatter-required blank line.

Problem and expected behavior

  • Main's cache failure: all six build tasks succeed, then snapshot fails with ENOENT. Turbo may evict cache hits during a build or an additional dry run. Successful builds do not reserve cache files; consumers must rebuild misses. This corrects the assumption introduced in #4744.
  • Electron failure, same-head retry: the regression also fails on clean main 63c65a224. After #4805, analysisErrorWithCleanupFailure preserves primary and cleanup diagnostics in a composed error. Raw .reason/.cause.reason are obsolete test oracles. The scheduling hypothesis was rejected by the clean-main reproduction.
  • Include the exact one-line formatting fix from #4822, preserving ShuaixinHuang's authored commit. No additional issue was opened for these directly reproduced CI prerequisites.

Change and scope

  • Retain only validated task IDs/hashes before building and snapshot that plan without restarting Turbo. Invalid input clears stale plans.
  • Publish whole reusable cache entries plus a per-task availability index. Explicit missing-task records support normal consumer rebuilds, including complete eviction. Other I/O errors, malformed data, non-files and symlinks remain hard failures with cleanup.
  • Make the Electron fixture consume the shared projectAnalysisError representation; remove parallel raw-error arrays. Preserve orphan/listener counts and verify both original failure provenance and every incomplete cleanup resource. Product cleanup logic is unchanged.
  • Update the owning testing guide and French spacing. Cross-run keys, restore prefix, 7-day/500 MB policy, required build outputs, prepack and downstream verification are unchanged.

Semantic owners: CI task-plan/cache handoff and the existing domain error projection. Product CLI/MCP, Evidence, provider authority and installation contracts are unchanged. Ordinary CI/test repairs; additional maintainer scope approval is not applicable.

Validation performed

Linux, pinned Node 24.18.0/npm 11.16.0, integrated with main 3fa972af7:

  • Nine focused cache/scope/CLI/Electron test files: 311/311 passed.
  • Untouched clean-main Electron regression: one selected original assertion fails; 50 related tests pass after the test-only repair.
  • Real YAML/pinned Turbo tests cover pressure, partial/full eviction, byte-identical consumer output, warm reuse and rebuild exit 47; copy-time disappearance, EACCES, symlinks and cleanup remain covered.
  • Full REA workflow on the original pinned baseline plus this fix: six-task pressure build, 18 payload files plus availability metadata; fresh restoration has 6/6 hits and all 1,693 runtime/skill/catalog files match SHA-256 digests.
  • Final npm run check:ci, npm run check, npm run docs:check, actionlint, git diff --check, and pre-push checks passed.

An earlier combined local run hit an unchanged CLI case's 30-second deadline on busy cores; the unchanged file passed on two idle physical cores. The final integrated 311-test run passed without timeout changes. Local work used two CPUs, sampled peak family RSS at most 5.01 GiB, and no memory guard stopped work. No speedup claim. Local adapter fixtures do not establish real Electron GUI, Hopper/Ghidra, or non-Linux runtime behavior; hosted verification is tracked separately.

Author readiness

Human owner: @N0zoM1z0

These declarations record the human owner's explicit standing task instruction: “後續審閱,承擔,聲明 都同意!不用問我了”. No separate new human-review event is asserted.

  • 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

  • Concrete CI recovery outcome; scope and authority are resolved.
  • Regression and negative coverage retain required builds and actual failures.
  • Owning documentation is current; no generated outputs or unrelated product changes.

🔄 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/4824 **Author:** [@N0zoM1z0](https://github.com/N0zoM1z0) **Created:** 10/17/2026 **Status:** ✅ Merged **Merged:** 10/17/2026 **Merged by:** [@N0zoM1z0](https://github.com/N0zoM1z0) **Base:** `main` ← **Head:** `fix/ci-portable-cache-stage-20261017` --- ### 📝 Commits (5) - [`23f9d2d`](https://github.com/morluto/rea/commit/23f9d2d5916d1e2c6afdf2feeb21043419fe406d) fix(ci): handle eviction when staging portable build cache - [`658589c`](https://github.com/morluto/rea/commit/658589ca87ec1dafd83fde00c5565d158eab2146) docs(readme): fix French heading spacing - [`1919f94`](https://github.com/morluto/rea/commit/1919f94c61c4c79c594b0bd8dc4b20afac7d5abc) test(ci): verify observed cache coverage during eviction - [`875bb89`](https://github.com/morluto/rea/commit/875bb8942bb5259915d26e3971f8ce1555f5ea31) chore(ci): sync current main before regression verification - [`ee314f6`](https://github.com/morluto/rea/commit/ee314f6c4f7170138d91f90daf07ddbf2ac9976f) test(electron): assert composed launch cleanup diagnostics ### 📊 Changes **7 files changed** (+508 additions, -67 deletions) <details> <summary>View changed files</summary> 📝 `.github/workflows/ci.yml` (+2 -2) 📝 `docs/readme/README_fr.md` (+1 -0) 📝 `docs/testing.md` (+8 -3) 📝 `scripts/ci/portable-build-cache.mjs` (+84 -22) 📝 `tests/boundary/filesystem/ciPortableBuildCache.test.ts` (+344 -13) 📝 `tests/boundary/filesystem/ciRequiredLanes.test.ts` (+1 -1) 📝 `tests/boundary/process/electronLaunchRejections.test.ts` (+68 -26) </details> ### 📄 Description ## Summary Restore main CI across three independently reproduced blockers: cache entries can disappear after successful builds, the Electron launch regression reads obsolete raw error fields, and the French README needs a formatter-required blank line. ## Problem and expected behavior - [Main's cache failure](https://github.com/morluto/rea/actions/runs/39043753517/job/117428329724): all six build tasks succeed, then snapshot fails with `ENOENT`. Turbo may evict cache hits during a build or an additional dry run. Successful builds do not reserve cache files; consumers must rebuild misses. This corrects the assumption introduced in #4744. - [Electron failure](https://github.com/morluto/rea/actions/runs/39048382173/job/117442123540), [same-head retry](https://github.com/morluto/rea/actions/runs/39048382173/job/117445042842): the regression also fails on clean main `63c65a224`. After #4805, `analysisErrorWithCleanupFailure` preserves primary and cleanup diagnostics in a composed error. Raw `.reason`/`.cause.reason` are obsolete test oracles. The scheduling hypothesis was rejected by the clean-main reproduction. - Include the exact one-line formatting fix from #4822, preserving ShuaixinHuang's authored commit. No additional issue was opened for these directly reproduced CI prerequisites. ## Change and scope - Retain only validated task IDs/hashes before building and snapshot that plan without restarting Turbo. Invalid input clears stale plans. - Publish whole reusable cache entries plus a per-task availability index. Explicit missing-task records support normal consumer rebuilds, including complete eviction. Other I/O errors, malformed data, non-files and symlinks remain hard failures with cleanup. - Make the Electron fixture consume the shared `projectAnalysisError` representation; remove parallel raw-error arrays. Preserve orphan/listener counts and verify both original failure provenance and every incomplete cleanup resource. Product cleanup logic is unchanged. - Update the owning testing guide and French spacing. Cross-run keys, restore prefix, 7-day/500 MB policy, required build outputs, prepack and downstream verification are unchanged. Semantic owners: CI task-plan/cache handoff and the existing domain error projection. Product CLI/MCP, Evidence, provider authority and installation contracts are unchanged. Ordinary CI/test repairs; additional maintainer scope approval is not applicable. ## Validation performed Linux, pinned Node 24.18.0/npm 11.16.0, integrated with main `3fa972af7`: - Nine focused cache/scope/CLI/Electron test files: **311/311 passed**. - Untouched clean-main Electron regression: one selected original assertion fails; 50 related tests pass after the test-only repair. - Real YAML/pinned Turbo tests cover pressure, partial/full eviction, byte-identical consumer output, warm reuse and rebuild exit 47; copy-time disappearance, EACCES, symlinks and cleanup remain covered. - Full REA workflow on the original pinned baseline plus this fix: six-task pressure build, 18 payload files plus availability metadata; fresh restoration has 6/6 hits and all 1,693 runtime/skill/catalog files match SHA-256 digests. - Final `npm run check:ci`, `npm run check`, `npm run docs:check`, actionlint, `git diff --check`, and pre-push checks passed. An earlier combined local run hit an unchanged CLI case's 30-second deadline on busy cores; the unchanged file passed on two idle physical cores. The final integrated 311-test run passed without timeout changes. Local work used two CPUs, sampled peak family RSS at most 5.01 GiB, and no memory guard stopped work. No speedup claim. Local adapter fixtures do not establish real Electron GUI, Hopper/Ghidra, or non-Linux runtime behavior; hosted verification is tracked separately. ## Author readiness Human owner: @N0zoM1z0 These declarations record the human owner's explicit standing task instruction: “後續審閱,承擔,聲明 都同意!不用問我了”. No separate new human-review event is asserted. - [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] Concrete CI recovery outcome; scope and authority are resolved. - [x] Regression and negative coverage retain required builds and actual failures. - [x] Owning documentation is current; no generated outputs or unrelated product changes. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-31 01:14:23 +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#6426
No description provided.