Repository navigation
fix(analysis-view): unify inert inline Evidence admission - #3613
Merged
Merged
Conversation
Integrate the unmerged admission fix from #3065 on current main, remove both duplicate walkers, and preserve API-surface representation budgets. Reject proxies before reflection while ignoring inert array metadata. Exercise proxy variants through all three views and observe the actual array reflection boundary and bounded descriptor reads in capacity tests. Co-authored-by: Zhong-fan <[email protected]> Co-authored-by: Kaoru0822 <[email protected]> Co-authored-by: gensokyo-dev <[email protected]>
Co-authored-by: Kaoru0822 <[email protected]> Co-authored-by: gensokyo-dev <[email protected]>
|
Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits. |
Contributor
[Medium impact] The PR appears safe to merge, with the earlier error-location issue fixed and no new blocking findings. SummaryThe PR gives all three analysis views one shared check for borrowed inline
Diagram%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[Inline Evidence] --> B{Selected view}
B -->|Summary or capture| C[Shared data check]
B -->|API surface| D[Shared data check with memory reservations]
C --> E[Parse and authenticate Evidence]
D --> E
C -->|Rejected| F[Error with copied field path]
D -->|Rejected| F
E --> G[Project selected view]
Reviews (2) · Last reviewed commit: "fix(analysis-view): retain precise admis..." · Reviewed by Greptile |
Track the owning traversal path in one depth-bounded mutable stack and copy it only when constructing an input error. Preserve inline Evidence field paths without allocating a new path for each visited member. Strengthen existing regressions across summary, capture and API-surface: root/nested/hidden accessors, array indexes, prototypes and cycles. Co-authored-by: Kaoru0822 <[email protected]> Co-authored-by: gensokyo-dev <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.
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 main75104040dffa9aa827e16f8f22a68307e48ff58d; synchronized headd89a8b94a9a2e82724460c8b8dd61b2ac94be5a2retained the identical five changed files. Final head7329562d2e8bfcddb4a6eebd9f777c36db42d4c8also addresses review feedback about precise error locations. Final synchronizedcheck:fastand both compiled CLI/MCP analysis-view suites passed (27 tests).Object.getOwnPropertyNames, the actual reflection entry point, rather than the unrelatedReflect.ownKeys, and bounds descriptor reads.npm run checkpassed all six tasks and architecture guards; final test-strengthening also passed 48 tests andnpm run check:fast.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.
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.