[PR #3613] [MERGED] fix(analysis-view): unify inert inline Evidence admission #5855

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

📋 Pull Request Information

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

Base: main ← Head: fix/inline-evidence-admission-followup-3065


📝 Commits (10+)

  • 4272af6 fix(analysis-view): reject inline accessors before parsing
  • b4bb702 fix(analysis-view): reject executable array members
  • a58ccd8 fix(analysis-view): bound array admission and reject executable data
  • e987630 chore: merge upstream main and preserve shared inline admission
  • b7f1c81 fix(browser): decode empty DOM snapshot string indexes
  • 7c1e29c fix(javascript): preserve scalar reads and candidate endpoint transport
  • e2f0ab6 fix(ghidra): retain completed helper diagnostics on launch failure
  • 61c15fe test: align regression assertions with current output contracts
  • ee521d6 chore: integrate CI regression fixes into analysis-view PR
  • d4731b0 chore: merge current upstream release guidance

📊 Changes

5 files changed (+408 additions, -169 deletions)

View changed files

📝 src/application/analysisView/AnalysisViewService.test.ts (+258 -18)
📝 src/application/analysisView/AnalysisViewService.ts (+7 -65)
📝 src/domain/analysisView/WebNetworkApiSurfaceAccumulator.test.ts (+38 -1)
📝 src/domain/analysisView/WebNetworkApiSurfaceAccumulator.ts (+7 -85)
➕ src/domain/analysisView/analysisViewDataAdmission.ts (+98 -0)

📄 Description

Summary

Inline analysis views could execute a Proxy reflection trap before returning a typed error, and could reject harmless array metadata that JSON cloning omits. This follow-up integrates the shared admission fix from closed, unmerged #3065 on current main and strengthens its regression oracles. Related: #2589.

Original work by @Zhong-fan is preserved in Git ancestry and credited with a GitHub anonymous co-author trailer. The author-closed original PR remains closed.

Change and scope

One admission owner checks borrowed inline Evidence before authentication/schema parsing. Summary, capture and API-surface reuse it; their duplicate traversals are removed. It rejects Proxies/functions before reflection and array traversal overrides before iteration/cloning. A single depth-bounded mutable path stack preserves exact error locations and is copied only on rejection. Arrays are inspected incrementally through descriptors; ignored named/symbol metadata stays inert. Ordinary inputs are neither frozen nor mutated.

API-surface keeps its existing representation reservations live through parsing and grouping. Summary/capture use structural admission. No tool/schema, provider, installation, process authority or release contract changes. This is an ordinary validation correction within existing contribution scope; an additional capability decision is not applicable.

  • 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.

The browser/network activity described below belongs to the validation driver; it is not added REA authority.

Executed evidence

Linux, Node 24.18.0 / npm 11.16.0. Base: e79e014f23cf5b5d59aa5e5681897dbcad73b44e; integration head: 94b006cdbd7220aa9c72d3f92e2426e59d5c1941. Before publication, synchronized current main 75104040dffa9aa827e16f8f22a68307e48ff58d; synchronized head d89a8b94a9a2e82724460c8b8dd61b2ac94be5a2 retained the identical five changed files. Final head 7329562d2e8bfcddb4a6eebd9f777c36db42d4c8 also addresses review feedback about precise error locations. Final synchronized check:fast and both compiled CLI/MCP analysis-view suites passed (27 tests).

  • Unchanged main: exact original regression suites produced 2 failures / 46 passes. A throwing Proxy trap executed and escaped the application boundary. An authenticated array with 10,000 ignored named getters was wrongly rejected.
  • Fixed: 48 source tests passed, including getter/cycle/alias/prototype/hook checks, valid-Evidence authentication, retained parent links and live representation budgets. Proxy variants now run through all three views. The capacity oracle observes Object.getOwnPropertyNames, the actual reflection entry point, rather than the unrelated Reflect.ownKeys, and bounds descriptor reads.
  • Compiled public boundaries: 71 passed / 1 skipped across CLI analysis views, SDK analysis views, historical network capture, browser comparison and SAZ decoding. npm run check passed all six tasks and architecture guards; final test-strengthening also passed 48 tests and npm run check:fast.
  • Actual Chromium 153.0.8010.12 HAR: recorded four real requests from an owned local HTTP app, including a redirect and JSON API calls. Eleven compiled CLI / real stdio SDK calls passed. Summary, one-record capture and one-group API-surface projections agreed across inline and same-session retained inputs and CLI/MCP. Output schemas validated with Ajv2020; pagination remained incomplete when more records/groups existed. Parent Evidence IDs and original HAR bytes were preserved. Browser and SDK closed normally.

HAR SHA-256: 1348786c7c575b06b1c6594b4ffd8f3142c3b4b89b33fdef79ceee43af04d888.

Representative CLI output: summary 3,785 bytes; one-record capture 4,760 bytes; one-group API surface 4,198 bytes. Each links the same authenticated parent; pages report remaining coverage.

Review follow-up: precise root/nested/hidden/indexed/prototype/cycle locations are now asserted across all three views. Those strengthened assertions produced 6 failures / 28 passes on the previous PR head; the final source suites passed all 48 tests. Final check:fast, 27 compiled CLI/MCP tests, service/capacity probes and all eleven public calls against the unchanged original HAR passed. This repeat reused the genuine recording; it did not launch another browser.

Performance and limitations

The shared depth-first admission avoids per-array key lists and per-node path copies. It re-examines aliases where the schema would clone them, preserving capacity accounting. No cache is added to caller-mutable input; selected output and retained-evidence reuse are unchanged. Agent tokens were not measured.

Equivalent service-level tasks used immutable main service/accumulator sources and the same built dependency owners. Real HAR normalized outputs were identical (1,967 / 2,672 / 2,104 JSON bytes). First plus three warm calls were recorded; normal warm small-input timings varied around 1.4–10.6 ms; first calls around 4.6–19.7 ms. Explicit synthetic amplification of the real parent's raw array to 100,000 null members kept the summary identical: main 108.05 / 102.28 / 136.65 / 89.03 ms; fixed 49.68 / 51.04 / 46.85 / 44.52 ms. These single-process small samples are observations, not a statistical speedup guarantee.

A separate synthetic million-element array under a 4,096-byte accumulator budget stopped after 14 descriptors and zero array-key enumerations (0.96 ms). This verifies incremental rejection rather than acceptance of a million-element capture.

The initial actual-browser/public workflow took 14.24 s, sampled peak family RSS 1,124 MiB, user/system CPU 14.18/2.89 s. SDK subsequent calls took 8–18 ms; first summary initialization took 1.624 s. Fresh CLI calls took 1.65–2.16 s. Final unchanged-HAR public repeat took 14.35 s / 1,128 MiB; SDK subsequent calls were 8–15 ms and initial summary 1.472 s; fresh CLI calls 1.57–2.99 s, with identical output sizes. Tests/static checks ran serially on two CPUs with an 8 GiB guard; highest observed peak was 4,472 MiB, with no guard stop or OOM.

Executable objects cannot cross JSON CLI/MCP transports; their zero-trap guarantee is tested at the local production boundary. This is input admission, not arbitrary JavaScript containment or a whole-input hard heap limit. Ordinary-object key enumeration remains; summary/capture do not gain an API-surface byte budget. Own verification covers Linux; no new Windows/macOS or live Hopper/Ghidra/IDA acceptance claim.

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

Author readiness

Human owner: @N0zoM1z0

Recorded from the owner's explicit standing declarations for the remaining approved bug-fix batch. Technical review and the executed evidence above were performed by the agent; responsibility remains with the named human.

  • 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/3613 **Author:** [@N0zoM1z0](https://github.com/N0zoM1z0) **Created:** 10/14/2026 **Status:** ✅ Merged **Merged:** 10/14/2026 **Merged by:** [@N0zoM1z0](https://github.com/N0zoM1z0) **Base:** `main` ← **Head:** `fix/inline-evidence-admission-followup-3065` --- ### 📝 Commits (10+) - [`4272af6`](https://github.com/morluto/rea/commit/4272af60d8723123ccdd0aaea60a2e70b12b8a93) fix(analysis-view): reject inline accessors before parsing - [`b4bb702`](https://github.com/morluto/rea/commit/b4bb702cc00c66907e14582f1109bc9ee2eefa5c) fix(analysis-view): reject executable array members - [`a58ccd8`](https://github.com/morluto/rea/commit/a58ccd869ad48150b427754355c9642355390287) fix(analysis-view): bound array admission and reject executable data - [`e987630`](https://github.com/morluto/rea/commit/e98763004a3c06735da0105858f293430415c950) chore: merge upstream main and preserve shared inline admission - [`b7f1c81`](https://github.com/morluto/rea/commit/b7f1c81bfe7101f30e9dd23668ea9ffab1d094ab) fix(browser): decode empty DOM snapshot string indexes - [`7c1e29c`](https://github.com/morluto/rea/commit/7c1e29c5c8de5704ef3e8a75042f58abbfe2c37e) fix(javascript): preserve scalar reads and candidate endpoint transport - [`e2f0ab6`](https://github.com/morluto/rea/commit/e2f0ab669b19a081d406767abc213b6ee09b074d) fix(ghidra): retain completed helper diagnostics on launch failure - [`61c15fe`](https://github.com/morluto/rea/commit/61c15fe38b91f709fd74ba074c12b9c9a25a30c2) test: align regression assertions with current output contracts - [`ee521d6`](https://github.com/morluto/rea/commit/ee521d62a9be06186fde89008d0b26c4f21df999) chore: integrate CI regression fixes into analysis-view PR - [`d4731b0`](https://github.com/morluto/rea/commit/d4731b016cec7b37a8d071f16f653727c47c9ac4) chore: merge current upstream release guidance ### 📊 Changes **5 files changed** (+408 additions, -169 deletions) <details> <summary>View changed files</summary> 📝 `src/application/analysisView/AnalysisViewService.test.ts` (+258 -18) 📝 `src/application/analysisView/AnalysisViewService.ts` (+7 -65) 📝 `src/domain/analysisView/WebNetworkApiSurfaceAccumulator.test.ts` (+38 -1) 📝 `src/domain/analysisView/WebNetworkApiSurfaceAccumulator.ts` (+7 -85) ➕ `src/domain/analysisView/analysisViewDataAdmission.ts` (+98 -0) </details> ### 📄 Description ## Summary Inline analysis views could execute a Proxy reflection trap before returning a typed error, and could reject harmless array metadata that JSON cloning omits. This follow-up integrates the shared admission fix from closed, unmerged #3065 on current main and strengthens its regression oracles. Related: #2589. Original work by @Zhong-fan is preserved in Git ancestry and credited with a GitHub anonymous co-author trailer. The author-closed original PR remains closed. ## Change and scope One admission owner checks borrowed inline Evidence before authentication/schema parsing. Summary, capture and API-surface reuse it; their duplicate traversals are removed. It rejects Proxies/functions before reflection and array traversal overrides before iteration/cloning. A single depth-bounded mutable path stack preserves exact error locations and is copied only on rejection. Arrays are inspected incrementally through descriptors; ignored named/symbol metadata stays inert. Ordinary inputs are neither frozen nor mutated. API-surface keeps its existing representation reservations live through parsing and grouping. Summary/capture use structural admission. No tool/schema, provider, installation, process authority or release contract changes. This is an ordinary validation correction within existing contribution scope; an additional capability decision is not applicable. - [x] 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. The browser/network activity described below belongs to the validation driver; it is not added REA authority. ## Executed evidence Linux, Node 24.18.0 / npm 11.16.0. Base: `e79e014f23cf5b5d59aa5e5681897dbcad73b44e`; integration head: `94b006cdbd7220aa9c72d3f92e2426e59d5c1941`. Before publication, synchronized current main `75104040dffa9aa827e16f8f22a68307e48ff58d`; synchronized head `d89a8b94a9a2e82724460c8b8dd61b2ac94be5a2` retained the identical five changed files. Final head `7329562d2e8bfcddb4a6eebd9f777c36db42d4c8` also addresses review feedback about precise error locations. Final synchronized `check:fast` and both compiled CLI/MCP analysis-view suites passed (27 tests). - **Unchanged main:** exact original regression suites produced 2 failures / 46 passes. A throwing Proxy trap executed and escaped the application boundary. An authenticated array with 10,000 ignored named getters was wrongly rejected. - **Fixed:** 48 source tests passed, including getter/cycle/alias/prototype/hook checks, valid-Evidence authentication, retained parent links and live representation budgets. Proxy variants now run through all three views. The capacity oracle observes `Object.getOwnPropertyNames`, the actual reflection entry point, rather than the unrelated `Reflect.ownKeys`, and bounds descriptor reads. - **Compiled public boundaries:** 71 passed / 1 skipped across CLI analysis views, SDK analysis views, historical network capture, browser comparison and SAZ decoding. `npm run check` passed all six tasks and architecture guards; final test-strengthening also passed 48 tests and `npm run check:fast`. - **Actual Chromium 153.0.8010.12 HAR:** recorded four real requests from an owned local HTTP app, including a redirect and JSON API calls. Eleven compiled CLI / real stdio SDK calls passed. Summary, one-record capture and one-group API-surface projections agreed across inline and same-session retained inputs and CLI/MCP. Output schemas validated with Ajv2020; pagination remained incomplete when more records/groups existed. Parent Evidence IDs and original HAR bytes were preserved. Browser and SDK closed normally. HAR SHA-256: `1348786c7c575b06b1c6594b4ffd8f3142c3b4b89b33fdef79ceee43af04d888`. Representative CLI output: summary 3,785 bytes; one-record capture 4,760 bytes; one-group API surface 4,198 bytes. Each links the same authenticated parent; pages report remaining coverage. **Review follow-up:** precise root/nested/hidden/indexed/prototype/cycle locations are now asserted across all three views. Those strengthened assertions produced 6 failures / 28 passes on the previous PR head; the final source suites passed all 48 tests. Final `check:fast`, 27 compiled CLI/MCP tests, service/capacity probes and all eleven public calls against the unchanged original HAR passed. This repeat reused the genuine recording; it did not launch another browser. ## Performance and limitations The shared depth-first admission avoids per-array key lists and per-node path copies. It re-examines aliases where the schema would clone them, preserving capacity accounting. No cache is added to caller-mutable input; selected output and retained-evidence reuse are unchanged. Agent tokens were not measured. Equivalent service-level tasks used immutable main service/accumulator sources and the same built dependency owners. Real HAR normalized outputs were identical (1,967 / 2,672 / 2,104 JSON bytes). First plus three warm calls were recorded; normal warm small-input timings varied around 1.4–10.6 ms; first calls around 4.6–19.7 ms. Explicit synthetic amplification of the real parent's raw array to 100,000 null members kept the summary identical: main 108.05 / 102.28 / 136.65 / 89.03 ms; fixed 49.68 / 51.04 / 46.85 / 44.52 ms. These single-process small samples are observations, not a statistical speedup guarantee. A separate synthetic million-element array under a 4,096-byte accumulator budget stopped after 14 descriptors and zero array-key enumerations (0.96 ms). This verifies incremental rejection rather than acceptance of a million-element capture. The initial actual-browser/public workflow took 14.24 s, sampled peak family RSS 1,124 MiB, user/system CPU 14.18/2.89 s. SDK subsequent calls took 8–18 ms; first summary initialization took 1.624 s. Fresh CLI calls took 1.65–2.16 s. Final unchanged-HAR public repeat took 14.35 s / 1,128 MiB; SDK subsequent calls were 8–15 ms and initial summary 1.472 s; fresh CLI calls 1.57–2.99 s, with identical output sizes. Tests/static checks ran serially on two CPUs with an 8 GiB guard; highest observed peak was 4,472 MiB, with no guard stop or OOM. Executable objects cannot cross JSON CLI/MCP transports; their zero-trap guarantee is tested at the local production boundary. This is input admission, not arbitrary JavaScript containment or a whole-input hard heap limit. Ordinary-object key enumeration remains; summary/capture do not gain an API-surface byte budget. Own verification covers Linux; no new Windows/macOS or live Hopper/Ghidra/IDA acceptance claim. - [x] Observed, derived and inferred claims remain distinguishable. - [x] Artifact identity, provenance and failed attempts remain preserved. - [x] Unsupported, incomplete, unavailable or uncertain outcomes remain visible. ## Author readiness Human owner: @N0zoM1z0 Recorded from the owner's explicit standing declarations for the remaining approved bug-fix batch. Technical review and the executed evidence above were performed by the agent; responsibility remains with the named human. - [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:09: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#5855
No description provided.