[PR #2430] [MERGED] test(reference): scope cleanup faults to the owned source file #5221

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

📋 Pull Request Information

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

Base: main ← Head: test/2428-reference-cleanup-scope


📝 Commits (2)

  • 1e10129 test(reference): scope cleanup faults to the owned source file
  • 43d9b86 chore: incorporate latest main for CI test verification

📊 Changes

1 file changed (+25 additions, -3 deletions)

View changed files

📝 tests/boundary/filesystem/referenceSourceCleanupOwnership.test.ts (+25 -3)

📄 Description

Reference cleanup tests fail when their temporary source directory belongs to an enclosing Git repository: the broad fs.open mock counts legitimate metadata probes as source opens and injects the source close failure into .git/HEAD. Latest main CI passes in its clean environment, while the same source fails locally with openCalls: 8 instead of 1.

Scope counters and close-failure injection to the exact owned source file. Retain both an ordinary-directory control and a deterministic enclosing-Git fixture. Existing partial-byte, resource-identity, blocked-new-work and 1/2/3 retry assertions remain; native descriptor observations additionally prove the retained source handle stays live until cleanup succeeds. Production Git discovery and resource ownership are unchanged.

Closes #2428.

Validation:

  • Untouched latest main: independently reproduced 1 failure / 3 passes without coverage.
  • Clean task-owned TMPDIR: original 4 cases pass. Add enclosing Git metadata with the old injector: only the new variant fails, retaining an unintended .git/HEAD owner (1 failed / 4 passed).
  • Corrected file: 5 passes in the original ambient-Git environment, two clean-temp repeats, and a focused V8 coverage run.
  • Controlled premature-native-close mutant: both variants fail the live-descriptor oracle; restored afterward.
  • Six adjacent source/Git/metadata/cleanup boundary files: 37 passed.
  • npm run check:ci, test discovery (1,003 files exactly once), and npm run docs:check passed.
  • Integrated latest main 4f4f6cd7b on final head 43d9b86741913b6747697b2662f557247d4ecc9e; the PR diff remains one test file. Post-integration cleanup/EVM checks passed 17 cases; the current Python command passed 15 cases (9 LLDB + 6 context-receipt tests).
  • Post-integration static/doc checks passed; discovery finds all 1,004 files exactly once. Final-head CI run https://github.com/morluto/rea/actions/runs/38331193288 passed all 16 selected jobs; 18 unselected lanes skipped. Full coverage report: 1,004 files / 10,319 cases, 10,227 passed / 92 skipped / zero failures; line coverage 89.59%. Both cleanup variants and the independently observed MCP inventory timeout case pass in that complete report.

Review: traced source traversal and VCS reads from ReferenceSourceImport through their independent file owners. The production nearest-enclosing-repository behavior is intentional. The test injector now owns one precise fault instead of poisoning unrelated metadata handles; no related product refactor is needed.


🔄 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/2430 **Author:** [@N0zoM1z0](https://github.com/N0zoM1z0) **Created:** 10/13/2026 **Status:** ✅ Merged **Merged:** 10/13/2026 **Merged by:** [@N0zoM1z0](https://github.com/N0zoM1z0) **Base:** `main` ← **Head:** `test/2428-reference-cleanup-scope` --- ### 📝 Commits (2) - [`1e10129`](https://github.com/morluto/rea/commit/1e1012954f32ecc560d5204674c29ddae61cce59) test(reference): scope cleanup faults to the owned source file - [`43d9b86`](https://github.com/morluto/rea/commit/43d9b86741913b6747697b2662f557247d4ecc9e) chore: incorporate latest main for CI test verification ### 📊 Changes **1 file changed** (+25 additions, -3 deletions) <details> <summary>View changed files</summary> 📝 `tests/boundary/filesystem/referenceSourceCleanupOwnership.test.ts` (+25 -3) </details> ### 📄 Description Reference cleanup tests fail when their temporary source directory belongs to an enclosing Git repository: the broad `fs.open` mock counts legitimate metadata probes as source opens and injects the source close failure into `.git/HEAD`. Latest main CI passes in its clean environment, while the same source fails locally with `openCalls: 8` instead of `1`. Scope counters and close-failure injection to the exact owned source file. Retain both an ordinary-directory control and a deterministic enclosing-Git fixture. Existing partial-byte, resource-identity, blocked-new-work and 1/2/3 retry assertions remain; native descriptor observations additionally prove the retained source handle stays live until cleanup succeeds. Production Git discovery and resource ownership are unchanged. Closes #2428. Validation: - Untouched latest main: independently reproduced 1 failure / 3 passes without coverage. - Clean task-owned TMPDIR: original 4 cases pass. Add enclosing Git metadata with the old injector: only the new variant fails, retaining an unintended `.git/HEAD` owner (1 failed / 4 passed). - Corrected file: 5 passes in the original ambient-Git environment, two clean-temp repeats, and a focused V8 coverage run. - Controlled premature-native-close mutant: both variants fail the live-descriptor oracle; restored afterward. - Six adjacent source/Git/metadata/cleanup boundary files: 37 passed. - `npm run check:ci`, test discovery (1,003 files exactly once), and `npm run docs:check` passed. - Integrated latest main `4f4f6cd7b` on final head `43d9b86741913b6747697b2662f557247d4ecc9e`; the PR diff remains one test file. Post-integration cleanup/EVM checks passed 17 cases; the current Python command passed 15 cases (9 LLDB + 6 context-receipt tests). - Post-integration static/doc checks passed; discovery finds all 1,004 files exactly once. Final-head CI run https://github.com/morluto/rea/actions/runs/38331193288 passed all 16 selected jobs; 18 unselected lanes skipped. Full coverage report: 1,004 files / 10,319 cases, 10,227 passed / 92 skipped / zero failures; line coverage 89.59%. Both cleanup variants and the independently observed MCP inventory timeout case pass in that complete report. Review: traced source traversal and VCS reads from `ReferenceSourceImport` through their independent file owners. The production nearest-enclosing-repository behavior is intentional. The test injector now owns one precise fault instead of poisoning unrelated metadata handles; no related product refactor is needed. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-31 01:04:56 +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#5221
No description provided.