[PR #5224] [MERGED] fix(ci): repair capture ownership and portable ABI validation #6822

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

📋 Pull Request Information

Original PR: https://github.com/morluto/rea/pull/5224
Author: @gensokyo-dev
Created: 10/19/2026
Status: ✅ Merged
Merged: 10/19/2026
Merged by: @gensokyo-dev

Base: main ← Head: fix/ci-baseline-5207


📝 Commits (10+)

  • 6529dc5 fix(tests): restore reliable snapshot and container CI checks
  • e4092bd chore: merge latest main for CI verification
  • 0e9039e fix(tests): isolate runtime faults and own CLI subprocesses
  • ff0b506 chore: integrate current main for cancellation verification
  • b5c9deb chore: merge current main before final capture checks
  • b0eb832 fix(process): retain executable handles through read cancellation
  • 9494e46 test(process): observe prelaunch cancellation at descriptor reads
  • 2ef87e6 fix(process): retain read failures alongside observed cancellation
  • af861dc Merge remote-tracking branch 'origin/main' into fix/ci-baseline-5207
  • 5f27222 fix(flutter): advertise portable Unicode ABI selectors

📊 Changes

17 files changed (+431 additions, -226 deletions)

View changed files

📝 docs/testing.md (+1 -1)
📝 src/domain/flutter/flutterBuildAnalysis.ts (+16 -10)
📝 src/process/capture/ProcessCaptureLifecycle.ts (+8 -5)
📝 src/process/capture/ProcessCaptureRead.ts (+10 -4)
📝 tests/boundary/filesystem/directAnalysisSnapshotReplay.test.ts (+1 -1)
📝 tests/boundary/filesystem/zipDetection.test.ts (+8 -24)
📝 tests/boundary/mcp/flutterMcp.test.ts (+11 -2)
📝 tests/boundary/process/processCaptureLifecycle.test.ts (+60 -12)
📝 tests/boundary/process/processCaptureProgress.test.ts (+18 -8)
📝 tests/boundary/process/processSnapshotHandleOwnership.test.ts (+3 -0)
📝 tests/boundary/process/selectedExecutableCleanup.test.ts (+135 -0)
📝 tests/process-global/filesystemSnapshotFallbackCancellation.test.ts (+25 -1)
📝 tests/process-global/filesystemSnapshotRaces.test.ts (+55 -65)
📝 tests/process-global/javascriptRuntimeObservationCli.test.ts (+46 -60)
📝 tests/process-global/processPrelaunchCancellation.test.ts (+11 -7)
📝 tests/process-global/processSnapshotCleanupMcp.test.ts (+8 -11)
📝 tests/process-global/updateMaintenance.test.ts (+15 -15)

📄 Description

Problem and change

Repair required CI blockers at their producing boundaries:

  • Cancelled executable sampling can invalidate a native Node FileHandle stream and leave its capture scope blocked. Reuse the existing borrowed descriptor reader; retain physical I/O failure, independently observed cancellation and exact failed-close ownership without discarding any of them.
  • Main 64abd4aef introduced an ABI selector pattern rejected by JavaScript v mode and clients without look-around support. Preserve literal Unicode labels through the shared CLI/MCP contract, advertise JSON Schema maxLength, and enforce the same code-point bound with a capped iterator before the portable slash check. No label-sized copy is allocated.
  • Correct stale snapshot/Evidence/ASAR assertions and native-close injection; move the two shared-worker module mocks to the existing isolated project; use owned CLI subprocess fixtures; synchronize cancellation and wall-clock tests with actual running progress. Existing deadlines, prerequisite skips, coverage thresholds and required lanes remain unchanged.

No new target authority or provider capability. Controlled Node children, disposable APK/file fixtures and loopback Inspector only; downloaded applications and external reverse-engineering providers were not executed.

Executed validation

  • Clean main 048d70755: five implicated files reproduce 10 failures, 43 passes, 2 existing skips; clean-main execution also reproduces shared-worker mock ordering.
  • Ownership regression rejects the old native-stream producer. Follow-up 2ef87e634: 65 pass, 4 existing skips across 8 files. All four injected pending-read/system-error/close combinations reject the older implementation; exact primary/cancellation facts, cleanup retry and immediate scope reuse pass after the fix. Lifecycle/ownership previously passed 29/29; replacing the monotonic clock with Date.now() fails the corrected oracle, and the real source was restored. Earlier broader CLI/MCP/snapshot/Inspector controls: 103 pass, 2 existing skips.
  • Integrated main through a0edd145d. The advertised-pattern test reproduces the new ABI regression before this fix. After it, 26/26 tests across 3 files pass: CLI selection, real MCP SDK transport, AJV 2020-12 schema/admission agreement, JavaScript plain/u/v patterns, Unicode limits and all four trailing line terminators. APKs are fixtures; grammar-only cases use an injected provider.
  • Final npm run check passes types, lint, formatting, module/unused-code and architecture guards. Documentation checks and 5 onboarding tests pass; 1,643 files discovered exactly once.
  • Compiled CLI/Node control before/after the capture repair exits 0 with identical executable SHA-256, scenario commitment and captured output. Elapsed 5.25/4.28 s, CPU 5.91/4.96 s, sampled process-family RSS 460.7/463.5 MiB. One fresh process each; OS cache/host interference uncontrolled and main advanced. No attributable speedup is claimed.
Completed local task Elapsed CPU Sampled family RSS
Capture follow-up, 8 files 6.52 s 7.73 s 516 MiB
ABI tests plus required artifact build 79.18 s 126.07 s 3,097 MiB
Final static checks 83.04 s 163.63 s 4,505 MiB
Final documentation/onboarding 11.63 s 14.76 s 761 MiB

Linux, Node 24.18.0/npm 11.16.0; two CPUs, 3 GiB V8 cap and 8 GiB sampled RSS guard. RSS uses 20 ms sampling, may double-count shared pages and miss short-lived/reparented children. Agent tokens and CI-wide cost are unmeasured. An earlier Windows update-help timeout predates this PR; the owned fixture repairs its lifetime, while that stall's cause remains unconfirmed. Later complete Windows lanes passed. Current-head CI/reviews must qualify this final diff.

Author readiness

Human owner: @gensokyo-dev

The owner explicitly authorized ready PRs and delegated the declarations, waiving a separate personal final-diff review. Codex reviewed the diff and executed the stated checks; independent human review was not observed.

  • 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/5224 **Author:** [@gensokyo-dev](https://github.com/gensokyo-dev) **Created:** 10/19/2026 **Status:** ✅ Merged **Merged:** 10/19/2026 **Merged by:** [@gensokyo-dev](https://github.com/gensokyo-dev) **Base:** `main` ← **Head:** `fix/ci-baseline-5207` --- ### 📝 Commits (10+) - [`6529dc5`](https://github.com/morluto/rea/commit/6529dc5c6fc9779b3c9eeb635db22c4613c28f3c) fix(tests): restore reliable snapshot and container CI checks - [`e4092bd`](https://github.com/morluto/rea/commit/e4092bd9b49f9936f8119438b04be66aedb84b9a) chore: merge latest main for CI verification - [`0e9039e`](https://github.com/morluto/rea/commit/0e9039ea06cf69146f42166cc20fd35c37d51f70) fix(tests): isolate runtime faults and own CLI subprocesses - [`ff0b506`](https://github.com/morluto/rea/commit/ff0b506a87d037b34ab553d5d8f9f6dc225047cf) chore: integrate current main for cancellation verification - [`b5c9deb`](https://github.com/morluto/rea/commit/b5c9deba3a8166e1f32598d34a7adcc2790998a8) chore: merge current main before final capture checks - [`b0eb832`](https://github.com/morluto/rea/commit/b0eb832d27f32c3c5c2fa6956d886dcd98a2b454) fix(process): retain executable handles through read cancellation - [`9494e46`](https://github.com/morluto/rea/commit/9494e46c97e15b571bcf6b10d282279127f7fc3f) test(process): observe prelaunch cancellation at descriptor reads - [`2ef87e6`](https://github.com/morluto/rea/commit/2ef87e6348e15d836f606c0a2f10dfa5ddc21d1f) fix(process): retain read failures alongside observed cancellation - [`af861dc`](https://github.com/morluto/rea/commit/af861dccb2dd372ae1d0ace2d14e0ad9c7d244bf) Merge remote-tracking branch 'origin/main' into fix/ci-baseline-5207 - [`5f27222`](https://github.com/morluto/rea/commit/5f27222016fa0b4458c7449709ca34666adbc906) fix(flutter): advertise portable Unicode ABI selectors ### 📊 Changes **17 files changed** (+431 additions, -226 deletions) <details> <summary>View changed files</summary> 📝 `docs/testing.md` (+1 -1) 📝 `src/domain/flutter/flutterBuildAnalysis.ts` (+16 -10) 📝 `src/process/capture/ProcessCaptureLifecycle.ts` (+8 -5) 📝 `src/process/capture/ProcessCaptureRead.ts` (+10 -4) 📝 `tests/boundary/filesystem/directAnalysisSnapshotReplay.test.ts` (+1 -1) 📝 `tests/boundary/filesystem/zipDetection.test.ts` (+8 -24) 📝 `tests/boundary/mcp/flutterMcp.test.ts` (+11 -2) 📝 `tests/boundary/process/processCaptureLifecycle.test.ts` (+60 -12) 📝 `tests/boundary/process/processCaptureProgress.test.ts` (+18 -8) 📝 `tests/boundary/process/processSnapshotHandleOwnership.test.ts` (+3 -0) 📝 `tests/boundary/process/selectedExecutableCleanup.test.ts` (+135 -0) 📝 `tests/process-global/filesystemSnapshotFallbackCancellation.test.ts` (+25 -1) 📝 `tests/process-global/filesystemSnapshotRaces.test.ts` (+55 -65) 📝 `tests/process-global/javascriptRuntimeObservationCli.test.ts` (+46 -60) 📝 `tests/process-global/processPrelaunchCancellation.test.ts` (+11 -7) 📝 `tests/process-global/processSnapshotCleanupMcp.test.ts` (+8 -11) 📝 `tests/process-global/updateMaintenance.test.ts` (+15 -15) </details> ### 📄 Description ## Problem and change Repair required CI blockers at their producing boundaries: - Cancelled executable sampling can invalidate a native Node `FileHandle` stream and leave its capture scope blocked. Reuse the existing borrowed descriptor reader; retain physical I/O failure, independently observed cancellation and exact failed-close ownership without discarding any of them. - Main `64abd4aef` introduced an ABI selector pattern rejected by JavaScript `v` mode and clients without look-around support. Preserve literal Unicode labels through the shared CLI/MCP contract, advertise JSON Schema `maxLength`, and enforce the same code-point bound with a capped iterator before the portable slash check. No label-sized copy is allocated. - Correct stale snapshot/Evidence/ASAR assertions and native-close injection; move the two shared-worker module mocks to the existing isolated project; use owned CLI subprocess fixtures; synchronize cancellation and wall-clock tests with actual running progress. Existing deadlines, prerequisite skips, coverage thresholds and required lanes remain unchanged. No new target authority or provider capability. Controlled Node children, disposable APK/file fixtures and loopback Inspector only; downloaded applications and external reverse-engineering providers were not executed. ## Executed validation - Clean main `048d70755`: five implicated files reproduce **10 failures, 43 passes, 2 existing skips**; clean-main execution also reproduces shared-worker mock ordering. - Ownership regression rejects the old native-stream producer. Follow-up `2ef87e634`: **65 pass, 4 existing skips across 8 files**. All four injected pending-read/system-error/close combinations reject the older implementation; exact primary/cancellation facts, cleanup retry and immediate scope reuse pass after the fix. Lifecycle/ownership previously passed **29/29**; replacing the monotonic clock with `Date.now()` fails the corrected oracle, and the real source was restored. Earlier broader CLI/MCP/snapshot/Inspector controls: **103 pass, 2 existing skips**. - Integrated main through `a0edd145d`. The advertised-pattern test reproduces the new ABI regression before this fix. After it, **26/26 tests across 3 files pass**: CLI selection, real MCP SDK transport, AJV 2020-12 schema/admission agreement, JavaScript plain/`u`/`v` patterns, Unicode limits and all four trailing line terminators. APKs are fixtures; grammar-only cases use an injected provider. - Final `npm run check` **passes** types, lint, formatting, module/unused-code and architecture guards. Documentation checks and **5 onboarding tests pass**; **1,643 files discovered exactly once**. - Compiled CLI/Node control before/after the capture repair exits 0 with identical executable SHA-256, scenario commitment and captured output. Elapsed **5.25/4.28 s**, CPU **5.91/4.96 s**, sampled process-family RSS **460.7/463.5 MiB**. One fresh process each; OS cache/host interference uncontrolled and main advanced. No attributable speedup is claimed. | Completed local task | Elapsed | CPU | Sampled family RSS | | --- | ---: | ---: | ---: | | Capture follow-up, 8 files | 6.52 s | 7.73 s | 516 MiB | | ABI tests plus required artifact build | 79.18 s | 126.07 s | 3,097 MiB | | Final static checks | 83.04 s | 163.63 s | 4,505 MiB | | Final documentation/onboarding | 11.63 s | 14.76 s | 761 MiB | Linux, Node 24.18.0/npm 11.16.0; two CPUs, 3 GiB V8 cap and 8 GiB sampled RSS guard. RSS uses 20 ms sampling, may double-count shared pages and miss short-lived/reparented children. Agent tokens and CI-wide cost are unmeasured. An earlier Windows update-help timeout predates this PR; the owned fixture repairs its lifetime, while that stall's cause remains unconfirmed. Later complete Windows lanes passed. Current-head CI/reviews must qualify this final diff. ## Author readiness Human owner: @gensokyo-dev The owner explicitly authorized ready PRs and delegated the declarations, waiving a separate personal final-diff review. Codex reviewed the diff and executed the stated checks; independent human review was not observed. - [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-11-01 21:43:16 +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#6822
No description provided.