Skip to content

test(reference): scope cleanup faults to the owned source file - #2430

Merged
N0zoM1z0 merged 2 commits into
mainfrom
test/2428-reference-cleanup-scope
Oct 13, 2026
Merged

N0zoM1z0 merged 2 commits into
mainfrom
test/2428-reference-cleanup-scope

Conversation

@N0zoM1z0

@N0zoM1z0 N0zoM1z0 commented Oct 13, 2026 •

Copy link
Copy Markdown
Collaborator

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.

Keep Git metadata reads independent of source-file close failure injection.
Cover an enclosing repository and verify the retained real handle stays live
until the same cleanup owner successfully closes it.

Assisted-by: Kogasa (gensokyo-skills:kogasa-surprise-testing)
@N0zoM1z0 N0zoM1z0 self-assigned this Oct 13, 2026
@chatgpt-codex-connector

Copy link
Copy Markdown

Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits.
Repo admins can enable using credits for code reviews in their settings.

@N0zoM1z0
N0zoM1z0 merged commit eeba618 into main Oct 13, 2026
34 checks passed
@N0zoM1z0
N0zoM1z0 deleted the test/2428-reference-cleanup-scope branch October 13, 2026 01:24
@morluto morluto added area: tests Test suite and verification area: native Native analysis and decompilation, including Ghidra, IDA, and Hopper analysis behavior labels Oct 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: native Native analysis and decompilation, including Ghidra, IDA, and Hopper analysis behavior area: tests Test suite and verification

Projects

None yet

Development

Successfully merging this pull request may close these issues.

test(reference): isolate source cleanup fault injection from Git metadata reads

2 participants