[PR #4744] [MERGED] perf(ci): upload only current portable build cache entries #6384

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

📋 Pull Request Information

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

Base: main ← Head: perf/ci-current-build-cache-20261017


📝 Commits (1)

  • 17e9a75 perf(ci): upload only current portable build cache entries

📊 Changes

6 files changed (+313 additions, -16 deletions)

View changed files

📝 .github/actions/portable-build-cache/action.yml (+1 -13)
📝 .github/workflows/ci.yml (+6 -1)
📝 docs/testing.md (+5 -2)
➕ scripts/ci/portable-build-cache.mjs (+86 -0)
➕ tests/boundary/filesystem/ciPortableBuildCache.test.ts (+176 -0)
📝 tests/boundary/filesystem/ciRequiredLanes.test.ts (+39 -0)

📄 Description

Summary

Keep rea-build-cache limited to the completed test:prepare task closure instead of uploading every historical entry restored by the cross-run cache. A real cache inventory contained 343 entries/1,029 files (413.4 MiB); only six current tasks/18 files (6.14 MiB) were needed, a 98.5% byte reduction.

Approach and boundary

A shared parser owns eager Turbo task identity/hash validation for both the unchanged cross-run key algorithm and snapshot selection. Stage required archives/metadata and available manifests by copying files into an owned job-local directory. Reject malformed/ambiguous plans, missing required entries and non-files; remove prior/partial snapshots on failure. The producer uses Bash pipefail and uploads only after successful preparation/staging. The original cross-run cache remains intact; consumers retain their existing build/prepack/live checks and current-run artifact lineage.

This is internal CI preparation, with no CLI/MCP, Evidence, provider, installation, dependency or authority changes. A new maintainer scope decision is not applicable. It implements the measured cache finding from the CI efficiency audit following #4737; there is no separate product bug to close. It does not claim to fix #4713.

Executed validation

  • npm run test:focused -- the new cache boundary tests plus CI lanes/cache-policy/project-ownership/change-selection tests: 252 passed. After a controlled copy-all-cache fault was detected and removed, the directly affected tests passed 22/22 again.
  • Complete npm run check:ci, npm run check:fast, npm run docs:check, actionlint 1.7.12 and git diff --check: passed.
  • Actual Turbo 2.11.7 full/compact/full/compact restores with outputs removed each time: 6/6 cache hits and byte-identical 1,673 output files. A manifest-free archive/metadata cache also restored 6/6 with the same digest. Source cache contents stayed byte-identical across production staging. Source, Node-pin and lockfile changes invalidate hashes; an ignored note does not.
  • Restored compiled CLI/stdio MCP analysis: the selected matrix passed all four CLI + four MCP input scenarios. Full Linux npm run verify:package passed pack/install/update, CLI, 207 MCP tools, six prompts, Evidence and cleanup. These checks do not establish real external Hopper/Ghidra behavior.

Measurements use two pinned Linux cores, serial heavy jobs and a 3 GiB default Node heap. The actual added dry-plan/staging pipeline took 0.46 s wall / 0.64 s reaped CPU / 186 MiB sampled family RSS, with a warm local filesystem. Median full vs compact restoration was 0.620 vs 0.623 s wall, 0.642 vs 0.626 s CPU, and peak 305 vs 303 MiB family RSS: no local restoration speedup is claimed. Package verification took 226 s / 202 s CPU / 1.37 GiB; full static checks peaked at 4.91 GiB. CPU excludes unreaped descendants and sampled RSS can double-count shared pages. Artifact transfer latency, hosted CPU/memory, machine-cold behavior and agent token costs are unmeasured. Cache data combines a real hosted artifact at 70de702109 with completed current-base (9d5b931875) task entries. Current-head hosted Linux x64/arm64 and macOS arm64 package checks, Windows capability/package checks, real Apple artifact E2E, and all eight Linux real-system workflows passed in CI run 39021033414. The downloaded published artifact has exactly six task entries/18 root-level files (6,450,684 bytes; 6,217,555-byte ZIP). Linux JavaScript recovery and macOS package preparation both show 3/3 portable build cache hits. Greptile reviewed this exact head with no actionable findings; automatic Codex review was unavailable because repository credits were exhausted.

Author readiness

Human owner: @N0zoM1z0. The declarations below are transcribed under the owner's explicit standing instruction on 2026-10-17: “後續審閱,承擔,聲明 都同意!不用問我了”. This records that direction, rather than a separate agent assertion that a new human-review event occurred.

  • 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/4744 **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:** `perf/ci-current-build-cache-20261017` --- ### 📝 Commits (1) - [`17e9a75`](https://github.com/morluto/rea/commit/17e9a75beab9a63eb1001a1837945f882211ea15) perf(ci): upload only current portable build cache entries ### 📊 Changes **6 files changed** (+313 additions, -16 deletions) <details> <summary>View changed files</summary> 📝 `.github/actions/portable-build-cache/action.yml` (+1 -13) 📝 `.github/workflows/ci.yml` (+6 -1) 📝 `docs/testing.md` (+5 -2) ➕ `scripts/ci/portable-build-cache.mjs` (+86 -0) ➕ `tests/boundary/filesystem/ciPortableBuildCache.test.ts` (+176 -0) 📝 `tests/boundary/filesystem/ciRequiredLanes.test.ts` (+39 -0) </details> ### 📄 Description ## Summary Keep `rea-build-cache` limited to the completed `test:prepare` task closure instead of uploading every historical entry restored by the cross-run cache. A real cache inventory contained 343 entries/1,029 files (413.4 MiB); only six current tasks/18 files (6.14 MiB) were needed, a 98.5% byte reduction. ## Approach and boundary A shared parser owns eager Turbo task identity/hash validation for both the unchanged cross-run key algorithm and snapshot selection. Stage required archives/metadata and available manifests by copying files into an owned job-local directory. Reject malformed/ambiguous plans, missing required entries and non-files; remove prior/partial snapshots on failure. The producer uses Bash pipefail and uploads only after successful preparation/staging. The original cross-run cache remains intact; consumers retain their existing build/prepack/live checks and current-run artifact lineage. This is internal CI preparation, with no CLI/MCP, Evidence, provider, installation, dependency or authority changes. A new maintainer scope decision is not applicable. It implements the measured cache finding from the CI efficiency audit following #4737; there is no separate product bug to close. It does not claim to fix #4713. ## Executed validation - `npm run test:focused --` the new cache boundary tests plus CI lanes/cache-policy/project-ownership/change-selection tests: **252 passed**. After a controlled copy-all-cache fault was detected and removed, the directly affected tests passed **22/22** again. - Complete `npm run check:ci`, `npm run check:fast`, `npm run docs:check`, `actionlint` 1.7.12 and `git diff --check`: **passed**. - Actual Turbo 2.11.7 full/compact/full/compact restores with outputs removed each time: **6/6 cache hits** and byte-identical **1,673 output files**. A manifest-free archive/metadata cache also restored 6/6 with the same digest. Source cache contents stayed byte-identical across production staging. Source, Node-pin and lockfile changes invalidate hashes; an ignored note does not. - Restored compiled CLI/stdio MCP analysis: the selected matrix passed all **four CLI + four MCP input scenarios**. Full Linux `npm run verify:package` passed pack/install/update, CLI, **207 MCP tools**, six prompts, Evidence and cleanup. These checks do not establish real external Hopper/Ghidra behavior. Measurements use two pinned Linux cores, serial heavy jobs and a 3 GiB default Node heap. The actual added dry-plan/staging pipeline took **0.46 s wall / 0.64 s reaped CPU / 186 MiB sampled family RSS**, with a warm local filesystem. Median full vs compact restoration was **0.620 vs 0.623 s wall**, **0.642 vs 0.626 s CPU**, and peak **305 vs 303 MiB** family RSS: no local restoration speedup is claimed. Package verification took 226 s / 202 s CPU / 1.37 GiB; full static checks peaked at 4.91 GiB. CPU excludes unreaped descendants and sampled RSS can double-count shared pages. Artifact transfer latency, hosted CPU/memory, machine-cold behavior and agent token costs are unmeasured. Cache data combines a real hosted artifact at `70de702109` with completed current-base (`9d5b931875`) task entries. Current-head hosted Linux x64/arm64 and macOS arm64 package checks, Windows capability/package checks, real Apple artifact E2E, and all eight Linux real-system workflows **passed** in [CI run 39021033414](https://github.com/morluto/rea/actions/runs/39021033414). The downloaded [published artifact](https://github.com/morluto/rea/actions/runs/39021033414/artifacts/12097061036) has exactly six task entries/18 root-level files (6,450,684 bytes; 6,217,555-byte ZIP). Linux JavaScript recovery and macOS package preparation both show 3/3 portable build cache hits. Greptile reviewed this exact head with no actionable findings; automatic Codex review was unavailable because repository credits were exhausted. ## Author readiness Human owner: @N0zoM1z0. The declarations below are transcribed under the owner's explicit standing instruction on 2026-10-17: “後續審閱,承擔,聲明 都同意!不用問我了”. This records that direction, rather than a separate agent assertion that a new human-review event occurred. - [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. --- <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:03 +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#6384
No description provided.