Repository navigation
fix(native): share value trace node budgets across node roles - #2889
IvenKooLab wants to merge 2 commits into
Conversation
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
68f66e3 to
936cfda
Compare
936cfda to
d933d98
Compare
Preserve XML and Interface Builder identity at their parsing boundary, retain usable Objective-C slots with precise coverage, and keep native trace failures distinct from absence. Add caller-selected Interface Builder summaries backed by complete retained Evidence, and preserve comparison limitations. Reviewed fixes: #1969, #2088, #2108, #2513, #2639, #2684, #2731, #2759, #2875, #2888, #2889, #2970, #2971, #3002. Validation: relevant native/domain focused lane passed 142 tests; earlier Interface Builder/MCP checks passed 24 tests. Real native UI and Ghidra producer coverage was not repeated.
|
Current-main verification: upstream commit 55dd21a5e already includes this PR's shared node-admission budget, retained-parameter identity map, collision handling, and regression tests. Its commit message explicitly references #2889 (and #2888). The implementation is therefore already incorporated; please confirm the appropriate disposition of this still-open PR. The historical red Windows native build job failed after approximately 60 seconds with Local verification on that exact PR branch, using pinned Node 24.18.0/npm 11.16.0: 38 relevant native application tests and the full |
|
CI-fix track: the failing "Build bundled Windows x64 native controls" job is infra, not this PR: |
|
Thanks for verifying the tree-identical merge against 55dd21a — closing as superseded. Appreciate the CI triage on the Windows native-controls job too. |
|
Thanks @IvenKooLab for catching that parameter nodes could bypass the value-trace byte budget and still emit dependent edges. Main now accounts for both node roles under one budget and keeps omitted parameter facts from contributing relationships (main). |
Summary
Apply the existing 8 MiB node-payload budget to both operation and parameter nodes in
trace_native_values. Omitted parameters no longer contribute parameter-use or argument-binding edges.Problem and expected behavior
Only operation nodes contributed to byte accounting. A valid dossier with a 9 MiB parameter name could return more than 8 MiB of nodes with
truncated=false. Escaped JSON can also exceed the budget despite a shorter source string. The limit must cover the encoded payload of all node roles before allocating a complete oversized serialized node.The existing mixed operation/parameter ID membership check could additionally treat a retained operation named
parameter:0as a retained parameter, leaving a false dependency after the parameter was omitted.Change and scope
Use one node-admission owner for the shared count and byte limits. Reuse the existing bounded
jsonPartsencoder to count actual JSON escapes and UTF-8 bytes. Once admission fails, stop admitting later node roles/functions.Replace mixed-role membership with a retained-parameter ordinal-to-ID map. Preserve provider operation IDs, and choose parameter IDs against the complete operation-ID set so collision handling is stable across budgets and pagination. Noncolliding parameter IDs retain their existing spelling. Call bindings already consume retained node objects and their actual IDs.
Routine correction of existing static analysis and resource bounds; advance maintainer scope decision is not applicable. No separate issue: independently reproduced focused defects at the same node-admission/identity boundary.
Contract and boundary impact
Expected existing workflow effects: [x] read captured data; [x] dispatch existing provider analysis, which can launch an engine. No new effect is introduced.
Evidence and regression coverage
Executed application tests through simulated analysis ports cover:
Exploratory base reproduction retained 9,437,409 node bytes with
truncated=false; the affected owner is unchanged through PR base9407236. The existing collision test was corrected because it previously expected a parameter-use edge when only the colliding operation was retained.Representative shared output: the oversized-parameter cases retain the two fitting operation nodes, report
total_nodes=2,total_edges=0, andtruncated=true.Validation performed
Pinned Node 24.18.0/npm 11.16.0, locked dependencies:
npm run test:local -- src/application/native/NativeValueTrace.test.ts src/application/native/EnhancedNativeInvestigation.test.ts— 38 tests passed.npm run check:fast— passed during push.npm exec --no -- turbo run typecheck lint:built knip metadata:check --output-logs=errors-only— all five tasks, including the compile dependency, passed.npm run verify:architecture-guardsandnpm run verify:test-discovery— passed.oxfmt --check, commit lint hook, andgit diff --check— passed.npm run check— passed on the current PR branch (typecheck, lint, format, knip, metadata, compile dependency, and architecture guards).Cost comparison and tradeoff
A completed simulated task containing 1000 operations, 1000 parameters, and 1000 parameter-use edges returns byte-identical JSON before/after (result SHA-256 compared). It fits all budgets and retains all nodes. Separate Node/Vitest workers; first call and median of seven subsequent warm calls:
The additional bounded accounting costs about 5 ms in this mock, with roughly 22% warm elapsed and 20% warm CPU overhead. This is a resource-bound correctness fix with a measured cost, not a speedup. Timing excludes fixture setup, output serialization/token estimation, and process startup. Worker RSS includes initialization, prior calls, and later estimation allocations; it is not incremental trace memory. Peak process-family memory, whole-agent tokens/catalog/prompts, transport costs, and real provider costs are unmeasured. No real Ghidra/Hopper/IDA or end-to-end CLI/MCP workflow was executed.
Compatibility, safety, and release
No input-schema change, migration, package metadata change, or new target authority. Noncolliding IDs remain compatible; colliding generated parameter IDs now distinguish node roles. The 8 MiB limit continues to describe node payloads, with the existing final 32 MiB serialized-result bound separate. Real-provider proof remains unavailable.
Before merge