[PR #6354] [MERGED] test(acceptance): run loader ownership once through stdio MCP #7301

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

📋 Pull Request Information

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

Base: main ← Head: cursor/demote-loader-ownership-matrix-340e


📝 Commits (1)

  • 7a80c01 test(acceptance): run loader ownership once through stdio MCP

📊 Changes

8 files changed (+188 additions, -133 deletions)

View changed files

📝 docs/testing.md (+13 -8)
➕ tests/acceptance/applications/javascriptLiteralLoaderOwnership.test.ts (+29 -0)
📝 tests/acceptance/applications/javascriptLiteralLoaderOwnership.ts (+73 -35)
➖ tests/acceptance/applications/javascriptLiteralLoaderOwnershipEarly.test.ts (+0 -29)
➖ tests/acceptance/applications/javascriptLiteralLoaderOwnershipLate.test.ts (+0 -18)
➖ tests/acceptance/applications/javascriptLiteralLoaderOwnershipMiddle.test.ts (+0 -18)
📝 tests/boundary/filesystem/ciTestSequencer.test.ts (+39 -9)
📝 tests/ciTestSequencer.ts (+34 -16)

📄 Description

Summary

The competing-loader ownership matrix was three shards of the same cases, each run through both the compiled CLI and stdio MCP. CLI and MCP both call analyzeJavaScriptApplication, and each loader is fixture text rather than a CLI argument, so the second surface was transport parity. Every loader still runs through the shared stdio MCP session. Three compiled CLI cases compare the full normalized result for the three renderer outcomes. The Early, Middle, and Late shards are one file.

No linked issue. This continues an authorized ownership and consolidation cleanup. Human owner: @morluto.

Problem and expected behavior

javascriptLiteralLoaderOwnership{Early,Middle,Late}.test.ts split 69 loaders into three groups and ran each group on both surfaces (139 tests, including the partition check). The shards existed to spread wall time. They did not assert different lifecycle facts from one another.

docs/testing.md allows a stateless source-analysis matrix to share a file-owned stdio MCP connection and keep representative compiled CLI parity. Distinct source scenarios still have to run through the public workflow.

Change and scope

  • All 69 competing-loader sources stay in javascriptLiteralLoaderOwnership.test.ts and are observed through stdio MCP, including late versus early alias reassignment and every require-member form.
  • Compiled CLI parity deep-compares normalized_result for module.require (unresolved renderer), earlier reassigned module alias (resolves a/index.html), and single percent main (resolves b/index.html).
  • later reassigned module alias stays on MCP. It is still a competing late reassignment; its outcome shape matches other unresolved loaders, so it is not a separate transport case.
  • Windows mains, alias specifiers, createRequire base, absolute and file-URL imports, and inert local loaders stay on MCP with their existing edge and page assertions. Those facts are produced from fixture files by the shared analyzer.
  • seedLoaderOwnershipDurations charges javascriptLiteralLoaderOwnership.test.ts with the old dual-surface weight until that file is in CI history: 138/192 of a pre-split percent-path duration, or the sum of recorded Early/Middle/Late durations (a partial set is scaled as three equal shares). That overestimates the demoted file on the first schedule.
  • javascriptIndirectLoaderOwners.test.ts and javascriptLiteralPercentPaths.test.ts are unchanged and still run their own CLI and MCP cases.

Follow the contribution scope.
Unresolved scope, authority, side effects, or required verification block integration. Not applicable: test and CI scheduling only, no production behavior change.

Contract and boundary impact

  • Semantic owner and earliest changed stage: test sequencer history for this matrix. No production stage changes.
  • Contribution scope fit and linked maintainer decision: not applicable. Existing acceptance coverage, no new provider or target authority.
  • CLI and MCP/tool-catalog contract: none. No command, tool, or schema change.
  • Provider, bridge, target-format, or platform compatibility: none.
  • Evidence, artifact, provenance, or reconstruction contract: none.
  • Target selection, authority, upstream behavior, and cleanup details (if applicable): not applicable.
  • Generated metadata (docs/public/product-catalog.json), package, or installation impact (CI generates and validates ignored catalogs and skills/; edit authored instructions in .agents/skills/reverse-engineer-anything/ and never commit build outputs): none. docs/testing.md describes the consolidated history rule.

Expected effects (check known effects; use documentation-only on its own).
Unchecked items do not establish absence; leave uncertainties visible.

  • Read existing files or captured data.
  • Launch or attach to a process.
  • Inject instrumentation or run scripts/code.
  • Change process memory, registers, files, or configuration.
  • Contact network services.
  • Recover protected code or work around protections.
  • Documentation or usability only; no target interaction.
  • Not sure yet; investigation or maintainer guidance needed.

Evidence and regression coverage

Inventory of what the matrix asserts, and what elsewhere does not replace it:

  • Each of the 69 sources is a distinct page-ownership scenario. Inert loaders resolve a/index.html. single percent main resolves b/index.html. The rest leave the electron renderer unresolved. Windows mains also require an unavailable loads edge. Absolute imports require an unresolved /shared/window.cjs import. Package aliases require an unresolved #entry or #window/window import. createRequire base and the unchecked require-member forms require a null-specifier require edge.

  • Early versus late lifecycle stays: earlier reassigned module alias is inert; later reassigned module alias stays competing.

  • Domain require-member tests classify callees. They do not establish which application page the public analysis owns. javascriptIndirectLoaderOwners.test.ts uses different sources and still runs both surfaces. It does not cover this fixture family.

  • Tests added or updated: javascriptLiteralLoaderOwnership.test.ts replaces the three shards. Sequencer unit tests cover pre-split history, a full retired-shard sum, a partial shard scaled by three, and a published consolidated duration.

  • Base reproduction or other evidence: executed on this host before the commit. Baseline revision 5bda0a7dc3720db9c29b5b85f62473fb3133feee, Node v24.18.0, warm Turbo cache, fresh CLI/MCP processes, Vitest maxWorkers 2.

  • User-visible CLI/MCP output (if applicable): not applicable.

  • Remaining proof gaps: the historical ~105s figure was not remeasured. docs/testing.md says the 2026-10-21 timing artifact predates compiled-CLI session reuse. Peak RSS is summed VmRSS at 0.5s and can double-count shared pages. The lower peak includes running one file instead of two concurrent shard files.

Measured family, same command shape (npm run test:focused):

Run Tests Vitest duration File time npm wall user + system Peak summed VmRSS
Dual matrix, run 1 139 30.67s 44.643s 32.198s 43.122s not measured
Dual matrix, run 2 139 29.01s 43.013s sampler wall ~30s not measured 4,143,224 KB
Demoted, run 1 73 21.82s 20.018s 22.561s not measured 2,607,740 KB
Demoted, run 2 73 21.95s 20.217s 22.565s not measured 2,606,824 KB
Demoted, run 3 73 22.29s 20.549s 22.881s 20.708s not measured

Comparable bash time samples: npm wall 32.198s to 22.881s, and user+system CPU 43.122s to 20.708s. File time fell from about 43–45s across three files to about 20–21s in one file.

For evidence-bearing changes:

  • Observed, derived, and inferred claims remain distinguishable.
  • Artifact identity, source provenance, and failed attempts remain preserved.
  • Unsupported, incomplete, unavailable, or uncertain outcomes remain visible.

Validation performed

  • npm run test:focused -- tests/acceptance/applications/javascriptLiteralLoaderOwnershipEarly.test.ts tests/acceptance/applications/javascriptLiteralLoaderOwnershipMiddle.test.ts tests/acceptance/applications/javascriptLiteralLoaderOwnershipLate.test.ts on 5bda0a7d — 139 passed. Vitest 30.67s and 29.01s.
  • npm run test:focused -- tests/acceptance/applications/javascriptLiteralLoaderOwnership.test.ts — 73 passed on three runs. Vitest 21.82s, 21.95s, and 22.29s. CLI parity names module.require, earlier reassigned module alias, and single percent main.
  • npm run test:focused -- tests/boundary/filesystem/ciTestSequencer.test.ts — 9 passed, 581ms.
  • npm run check:fast — typecheck and lint succeeded, Turbo 4.54s, cache misses.

The first PR readiness run failed with a GitHub API 500 while listing pull requests for 7a80c012, after the author declaration had already evaluated as filled. This note retriggers that check. The Author readiness declaration is unchanged.

Compatibility, safety, and release

  • Breaking changes or migration steps: none. CI history that still names the retired shards is mapped onto the consolidated file. A published duration for javascriptLiteralLoaderOwnership.test.ts is left as recorded.
  • Real Hopper/Ghidra, browser, or OS coverage: not applicable. No provider lane.
  • Package or release metadata impact: none.
  • Security, privacy, process, or containment review: not applicable. Test-only.

Author readiness

Human owner: @morluto

  • 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

  • This PR addresses a concrete problem or an agreed enhancement.
  • Material scope and authority questions are resolved, and any required maintainer scope decision covers the final diff.
  • The PR has one focused outcome and the title follows type(scope): outcome.
  • Related issue is linked, or the reason for not linking one is stated above.
  • Tests cover changed observable behavior and meaningful failure paths.
  • Owning docs, contracts, and generated metadata are updated where needed.
  • User-visible CLI/MCP changes include representative output.
  • I checked the final diff for secrets, unrelated cleanup, and unsupported claims.
Open in Web Open in Cursor 

🔄 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/6354 **Author:** [@morluto](https://github.com/morluto) **Created:** 10/22/2026 **Status:** ✅ Merged **Merged:** 10/22/2026 **Merged by:** [@morluto](https://github.com/morluto) **Base:** `main` ← **Head:** `cursor/demote-loader-ownership-matrix-340e` --- ### 📝 Commits (1) - [`7a80c01`](https://github.com/morluto/rea/commit/7a80c012324c53995ee6cf46ee085a723e1344bc) test(acceptance): run loader ownership once through stdio MCP ### 📊 Changes **8 files changed** (+188 additions, -133 deletions) <details> <summary>View changed files</summary> 📝 `docs/testing.md` (+13 -8) ➕ `tests/acceptance/applications/javascriptLiteralLoaderOwnership.test.ts` (+29 -0) 📝 `tests/acceptance/applications/javascriptLiteralLoaderOwnership.ts` (+73 -35) ➖ `tests/acceptance/applications/javascriptLiteralLoaderOwnershipEarly.test.ts` (+0 -29) ➖ `tests/acceptance/applications/javascriptLiteralLoaderOwnershipLate.test.ts` (+0 -18) ➖ `tests/acceptance/applications/javascriptLiteralLoaderOwnershipMiddle.test.ts` (+0 -18) 📝 `tests/boundary/filesystem/ciTestSequencer.test.ts` (+39 -9) 📝 `tests/ciTestSequencer.ts` (+34 -16) </details> ### 📄 Description <!-- CURSOR_AGENT_PR_BODY_BEGIN --> ## Summary The competing-loader ownership matrix was three shards of the same cases, each run through both the compiled CLI and stdio MCP. CLI and MCP both call `analyzeJavaScriptApplication`, and each loader is fixture text rather than a CLI argument, so the second surface was transport parity. Every loader still runs through the shared stdio MCP session. Three compiled CLI cases compare the full normalized result for the three renderer outcomes. The Early, Middle, and Late shards are one file. No linked issue. This continues an authorized ownership and consolidation cleanup. Human owner: @morluto. ## Problem and expected behavior `javascriptLiteralLoaderOwnership{Early,Middle,Late}.test.ts` split 69 loaders into three groups and ran each group on both surfaces (139 tests, including the partition check). The shards existed to spread wall time. They did not assert different lifecycle facts from one another. `docs/testing.md` allows a stateless source-analysis matrix to share a file-owned stdio MCP connection and keep representative compiled CLI parity. Distinct source scenarios still have to run through the public workflow. ## Change and scope - All 69 competing-loader sources stay in `javascriptLiteralLoaderOwnership.test.ts` and are observed through stdio MCP, including late versus early alias reassignment and every require-member form. - Compiled CLI parity deep-compares `normalized_result` for `module.require` (unresolved renderer), `earlier reassigned module alias` (resolves `a/index.html`), and `single percent main` (resolves `b/index.html`). - `later reassigned module alias` stays on MCP. It is still a competing late reassignment; its outcome shape matches other unresolved loaders, so it is not a separate transport case. - Windows mains, alias specifiers, `createRequire` base, absolute and file-URL imports, and inert local loaders stay on MCP with their existing edge and page assertions. Those facts are produced from fixture files by the shared analyzer. - `seedLoaderOwnershipDurations` charges `javascriptLiteralLoaderOwnership.test.ts` with the old dual-surface weight until that file is in CI history: 138/192 of a pre-split percent-path duration, or the sum of recorded Early/Middle/Late durations (a partial set is scaled as three equal shares). That overestimates the demoted file on the first schedule. - `javascriptIndirectLoaderOwners.test.ts` and `javascriptLiteralPercentPaths.test.ts` are unchanged and still run their own CLI and MCP cases. Follow the [contribution scope](https://github.com/morluto/rea/blob/main/CONTRIBUTING.md#contribution-scope). Unresolved scope, authority, side effects, or required verification block integration. Not applicable: test and CI scheduling only, no production behavior change. ## Contract and boundary impact - Semantic owner and earliest changed stage: test sequencer history for this matrix. No production stage changes. - Contribution scope fit and linked maintainer decision: not applicable. Existing acceptance coverage, no new provider or target authority. - CLI and MCP/tool-catalog contract: none. No command, tool, or schema change. - Provider, bridge, target-format, or platform compatibility: none. - Evidence, artifact, provenance, or reconstruction contract: none. - Target selection, authority, upstream behavior, and cleanup details (if applicable): not applicable. - Generated metadata (`docs/public/product-catalog.json`), package, or installation impact (CI generates and validates ignored catalogs and `skills/`; edit authored instructions in `.agents/skills/reverse-engineer-anything/` and never commit build outputs): none. `docs/testing.md` describes the consolidated history rule. Expected effects (check known effects; use documentation-only on its own). Unchecked items do not establish absence; leave uncertainties visible. - [ ] Read existing files or captured data. - [ ] Launch or attach to a process. - [ ] Inject instrumentation or run scripts/code. - [ ] Change process memory, registers, files, or configuration. - [ ] Contact network services. - [ ] Recover protected code or work around protections. - [ ] Documentation or usability only; no target interaction. - [ ] Not sure yet; investigation or maintainer guidance needed. ## Evidence and regression coverage Inventory of what the matrix asserts, and what elsewhere does not replace it: - Each of the 69 sources is a distinct page-ownership scenario. Inert loaders resolve `a/index.html`. `single percent main` resolves `b/index.html`. The rest leave the electron renderer unresolved. Windows mains also require an unavailable `loads` edge. Absolute imports require an unresolved `/shared/window.cjs` import. Package aliases require an unresolved `#entry` or `#window/window` import. `createRequire` base and the unchecked require-member forms require a null-specifier `require` edge. - Early versus late lifecycle stays: `earlier reassigned module alias` is inert; `later reassigned module alias` stays competing. - Domain require-member tests classify callees. They do not establish which application page the public analysis owns. `javascriptIndirectLoaderOwners.test.ts` uses different sources and still runs both surfaces. It does not cover this fixture family. - Tests added or updated: `javascriptLiteralLoaderOwnership.test.ts` replaces the three shards. Sequencer unit tests cover pre-split history, a full retired-shard sum, a partial shard scaled by three, and a published consolidated duration. - Base reproduction or other evidence: executed on this host before the commit. Baseline revision `5bda0a7dc3720db9c29b5b85f62473fb3133feee`, Node v24.18.0, warm Turbo cache, fresh CLI/MCP processes, Vitest `maxWorkers` 2. - User-visible CLI/MCP output (if applicable): not applicable. - Remaining proof gaps: the historical ~105s figure was not remeasured. `docs/testing.md` says the 2026-10-21 timing artifact predates compiled-CLI session reuse. Peak RSS is summed `VmRSS` at 0.5s and can double-count shared pages. The lower peak includes running one file instead of two concurrent shard files. Measured family, same command shape (`npm run test:focused`): | Run | Tests | Vitest duration | File time | npm wall | user + system | Peak summed VmRSS | | --- | --- | --- | --- | --- | --- | --- | | Dual matrix, run 1 | 139 | 30.67s | 44.643s | 32.198s | 43.122s | not measured | | Dual matrix, run 2 | 139 | 29.01s | 43.013s | sampler wall ~30s | not measured | 4,143,224 KB | | Demoted, run 1 | 73 | 21.82s | 20.018s | 22.561s | not measured | 2,607,740 KB | | Demoted, run 2 | 73 | 21.95s | 20.217s | 22.565s | not measured | 2,606,824 KB | | Demoted, run 3 | 73 | 22.29s | 20.549s | 22.881s | 20.708s | not measured | Comparable bash `time` samples: npm wall 32.198s to 22.881s, and user+system CPU 43.122s to 20.708s. File time fell from about 43–45s across three files to about 20–21s in one file. For evidence-bearing changes: - [x] Observed, derived, and inferred claims remain distinguishable. - [x] Artifact identity, source provenance, and failed attempts remain preserved. - [x] Unsupported, incomplete, unavailable, or uncertain outcomes remain visible. ## Validation performed - `npm run test:focused -- tests/acceptance/applications/javascriptLiteralLoaderOwnershipEarly.test.ts tests/acceptance/applications/javascriptLiteralLoaderOwnershipMiddle.test.ts tests/acceptance/applications/javascriptLiteralLoaderOwnershipLate.test.ts` on `5bda0a7d` — 139 passed. Vitest 30.67s and 29.01s. - `npm run test:focused -- tests/acceptance/applications/javascriptLiteralLoaderOwnership.test.ts` — 73 passed on three runs. Vitest 21.82s, 21.95s, and 22.29s. CLI parity names `module.require`, `earlier reassigned module alias`, and `single percent main`. - `npm run test:focused -- tests/boundary/filesystem/ciTestSequencer.test.ts` — 9 passed, 581ms. - `npm run check:fast` — typecheck and lint succeeded, Turbo 4.54s, cache misses. The first PR readiness run failed with a GitHub API 500 while listing pull requests for `7a80c012`, after the author declaration had already evaluated as filled. This note retriggers that check. The Author readiness declaration is unchanged. ## Compatibility, safety, and release - Breaking changes or migration steps: none. CI history that still names the retired shards is mapped onto the consolidated file. A published duration for `javascriptLiteralLoaderOwnership.test.ts` is left as recorded. - Real Hopper/Ghidra, browser, or OS coverage: not applicable. No provider lane. - Package or release metadata impact: none. - Security, privacy, process, or containment review: not applicable. Test-only. ## Author readiness Human owner: @morluto - [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 - [ ] This PR addresses a concrete problem or an agreed enhancement. - [ ] Material scope and authority questions are resolved, and any required maintainer scope decision covers the final diff. - [ ] The PR has one focused outcome and the title follows `type(scope): outcome`. - [ ] Related issue is linked, or the reason for not linking one is stated above. - [ ] Tests cover changed observable behavior and meaningful failure paths. - [ ] Owning docs, contracts, and generated metadata are updated where needed. - [ ] User-visible CLI/MCP changes include representative output. - [ ] I checked the final diff for secrets, unrelated cleanup, and unsupported claims. <!-- CURSOR_AGENT_PR_BODY_END --> <div><a href="https://cursor.com/agents/bc-f159a3ea-08a4-5a25-9f64-7b45dd27340e?cursor_ref=pr_footer&cursor_cta=open_in_web"><picture><source media="(prefers-color-scheme: dark)" srcset="https://cursor.com/assets/images/open-in-web-dark.png"><source media="(prefers-color-scheme: light)" srcset="https://cursor.com/assets/images/open-in-web-light.png"><img alt="Open in Web" width="114" height="28" src="https://cursor.com/assets/images/open-in-web-dark.png"></picture></a>&nbsp;<a href="https://cursor.com/background-agent?bcId=bc-f159a3ea-08a4-5a25-9f64-7b45dd27340e&cursor_ref=pr_footer&cursor_cta=open_in_cursor"><picture><source media="(prefers-color-scheme: dark)" srcset="https://cursor.com/assets/images/open-in-cursor-dark.png"><source media="(prefers-color-scheme: light)" srcset="https://cursor.com/assets/images/open-in-cursor-light.png"><img alt="Open in Cursor" width="131" height="28" src="https://cursor.com/assets/images/open-in-cursor-dark.png"></picture></a>&nbsp;</div> --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-01 21:46:53 +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#7301
No description provided.