Skip to content

fix: restore JavaScript analysis and current regression checks - #3080

Merged
N0zoM1z0 merged 17 commits into
mainfrom
fix/main-red-ida-javascript-tests
Oct 14, 2026
Merged

N0zoM1z0 merged 17 commits into
mainfrom
fix/main-red-ida-javascript-tests

Conversation

@kaoru0822-kitauji

@kaoru0822-kitauji kaoru0822-kitauji commented Oct 14, 2026 •

Copy link
Copy Markdown
Collaborator

REA could lose valid configuration reads, incorrectly preserve an intrinsic worker URL after an ambient alias write, and reject valid analysis data at producer/consumer boundaries. This change restores those facts and brings the regression checks into agreement with the current contracts.

The production fixes keep alias initializer reads at their own source position, distinguish passing primitive env/argv values from replacing or exposing their containers, admit existing candidate endpoint metadata through the worker schema, decode Chrome DOMSnapshot empty-value indexes through one shared owner, and retain earlier Ghidra LaunchSupport diagnostics when a later helper fails. Regression assertions continue to check artifact identity, source-map provenance, malformed input, cancellation, and cleanup; they use declared facts rather than filesystem order, inherited terminal color, or outdated schema assumptions. The remaining MCP caveat regression checks the exact deduplicated envelope and graph-result lists separately, including actual complete graph edges; it preserves the output contract introduced on main.

Validation:

  • The original five source failures were independently reproduced on main f3534749e.
  • Sixteen affected source/CLI/MCP/provider files: 307 passed, one explicit platform skip. Four subsequent fixture/test files: 22 passed, including a CI-colored environment.
  • npm run check and npm run docs:check: passed. The final caveat follow-up passes another 22 workflow/MCP tests and npm run check:fast.
  • Real Chromium retains the previously missing form destinations. Production service-worker CLI/cancellation/restoration verification passes when isolated on both main and this branch, with owned-browser cleanup confirmed. The full local browser verifier reached a later service-worker error-page marker timeout whose cause remains unclassified; that original failure is retained. The current-head GitHub real-browser and JavaScript-recovery lanes pass.
  • Four public CLI analyses of npm [email protected], with its archive integrity independently checked, retain the same artifact identity and workload statistics. Selected summary/provenance output is 581 o200k tokens each. Main cold/warm: 6.24/5.89 seconds, 7.41/7.00 CPU seconds, 448/445 MiB sampled process-family RSS. Fixed cold/warm: 6.03/5.66 seconds, 7.32/7.00 CPU seconds, 449/450 MiB. These individual runs use isolated Node compile caches; no speedup or whole-agent token improvement is claimed.

Verification used Linux, Node 24.18.0/npm 11.16.0, two CPUs, and an 8-GiB process-family RSS stop threshold. Source selection and output filtering use existing caller controls; no new default result expansion or live-state cache is introduced. Native IDA/Ghidra engine execution and complete local suite completion are not claimed. Required current-head CI remains the merge gate.

…reads

Main fails five source tests after 04672f2 and d4bd65c.

- Ambient write resolution used the caller's write site for every alias
  read it reached, so `alias = alias.globalThis` resolved its own self-read
  only to the reassignment and lost the original `globalThis` identity. Reads
  reached through an initializer now select initializers at their own
  position; the written target keeps the caller's write site.
- Process escape tracking recorded `Number(process.env.PORT)` and
  `Number(process.argv[2])` as escapes of the read slot, which dropped the
  configuration read inside functions. Node stores env values and argv
  entries as strings, so passing one exposes no mutable object; replacing an
  entry still records its own write or receiver escape.
- The dynamic isolated-world test now expects the direct observation that the
  proven Webpack bootstrap resolution produces.
- The native IDA admission test now matches d4bd65c: attached profiles
  report the bound document and still refuse address resolution.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@kaoru0822-kitauji kaoru0822-kitauji added the bug Something isn't working label Oct 14, 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.

@greptile-apps

greptile-apps Bot commented Oct 14, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerConfidence Score: 5/5

[Medium impact] The PR appears safe to merge once required current-head CI passes.

Summary

Restores JavaScript configuration reads, worker metadata, Chrome snapshot values, and Ghidra diagnostics. Updates regression checks to match current contracts.

  • Alias writes now affect worker URLs at the right source position.
  • Passing env values no longer hides later configuration reads.
  • Browser capture keeps DOM nodes with empty values.
  • JavaScript worker results can include candidate endpoint labels.
  • Ghidra launch reports keep warnings from earlier helpers.
  • Regression checks now follow the current analysis contracts.

Reviews (9) · Last reviewed commit: "test(mcp): assert workflow caveats at th..." · Reviewed by Greptile

kaoru0822-kitauji and others added 2 commits October 14, 2026 02:01
- Cover configuration reads after passing env/argv values to a call, and
  keep reads unknown after replacing an argv entry directly, through an alias,
  or after a container escape.
- b58adaf added `resolution_status` to source-map edges. Expect it, and pair
  each alias edge with the script that declared it instead of relying on
  content-derived edge ID order.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@kaoru0822-kitauji

Copy link
Copy Markdown
Collaborator Author

Update: I merged current main (7077152), which still fails the same 5 source tests. Shard 1 also exposed 3 boundary failures that main has too:

  • javascriptSourceMapLocations.test.ts (2 tests) — fixed in 828ccc3. b58adaf added resolution_status to source-map edges, which also changes their content-derived edge IDs and therefore their order. The tests now expect the field and pair each edge with the script that declared it (evidence.location.source).
  • enhancedTools.callPathsAndBatches.test.ts › "keeps generic provider caveats visible…" — not changed, needs a maintainer decision. 80de314 copies upstream limitations into the workflow Evidence envelope (createWorkflowEvidence({ upstreamLimitations })). get_call_graph still also puts them in normalized_result.limitations, so the caveat now appears twice, and the test asserts it appears once. Fixing this means picking one owner for upstream caveats (envelope or tool result), which changes advertised output. I didn't want to loosen the assertion or change the schema without your call.

Locally: vitest run src passes (450 files, 6654 tests) and check:fast is clean. The two source-map boundary tests pass; the caveat test still fails as described.

kaoru0822-kitauji and others added 2 commits October 14, 2026 02:13
e572c38 replaced the localized guide URLs in the translated readmes with
repository-relative guide links, so the drift fixture no longer contained
`https://rea.tools/zh-CN/guides/native/`. Exercise the same missing-target,
wrong-locale, and query drift on a localized showcase link the readme still
carries, and add drift for the new relative guide link.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@kaoru0822-kitauji

Copy link
Copy Markdown
Collaborator Author

Update: merged main (b3c5672). Shard 1 surfaced two more failures that main also has:

  • productCatalog.test.ts › translated readme links: fixed in aff46f5. e572c38 swapped the localized rea.tools/zh-CN/guides/… links for relative guide links, so the drift fixture's anchor was gone. The same missing, wrong-locale and query drift now targets a showcase link that's still there, plus drift for the new relative link.
  • javascriptCancellationCli.test.ts › SIGINT during hash_javascript_application_evidence ({signal: SIGINT} instead of exit 130): passes 4/4 locally and doesn't touch this change. It looks like a timing flake on a loaded runner; I didn't change it.

…tput

b58adaf emits `interpretation: "candidate"` on static endpoint findings,
but the worker's strict endpoint schema still rejected the key, so
`analyze_javascript_application` failed output validation for any source
with a candidate endpoint. Admit the field as an exact optional literal.

Update application acceptance and boundary expectations to current main:
endpoint identity keys tag literal values (88afcc7), source-map
observations and edges carry `resolution_status` (b58adaf), and a proven
Webpack bootstrap reports bundled contextBridge exposures as direct syntax.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@kaoru0822-kitauji

Copy link
Copy Markdown
Collaborator Author

Update: the last CI run on this branch showed main is broken much more widely (21 failures in Portable tests). I confirmed each one fails on plain b3c5672ce as well.

Fixed in 0fdac09:

  • Real bug: b58adaf adds interpretation: "candidate" to endpoint findings, but the worker's strict endpoint schema rejected it. Any source with a candidate endpoint failed analyze_javascript_application output validation (Unrecognized key: "interpretation"). The field is now z.literal("candidate").exactOptional().
  • Stale expectations: in the application acceptance and empty-literal boundary tests: tagged endpoint identity keys (88afcc7), resolution_status on source-map observations and edges (b58adaf), and direct-syntax for bundled contextBridge exposures.

Still failing on main and not addressed yet (next ticks): cdpSvgXlinkHref (browser), directoryArtifactReaderOwnership (Linux only; passes on macOS), ghidraJavaLaunch diagnostics, hopperClient.startupFailures cancellation, developmentTests exact selection, and the duplicated provider caveat (needs your decision, see above). Also failing on main but macOS-only: runtime.test.ts › database-kind initial target, likely the d4bd65c saved-Hopper-database refusal.

kaoru0822-kitauji and others added 7 commits October 14, 2026 02:37
…fails

d4bd65c moved a failed LaunchSupport helper's output into the nested
`command_outcome`, but the cause projection also returned early for those
failures and dropped `launch_support`. A `-vmargs` failure therefore lost the
warning that the successful `-envvars` helper had already reported. Keep the
retained helper outputs and skip only the launcher outcome that the nested
cause now owns.

Update the Ghidra launch and Hopper startup boundary expectations to current
main: failed helpers report through `cause.command_outcome`, and bridge startup
results carry the launched `processId` (599a8ee), asserted against the
exact retried process.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Chrome's DOMSnapshot interns empty or null strings as index -1. bffdd91
began rejecting every negative string index, so real Chrome snapshots lost
each element node (whose nodeValue is -1) and any node with an empty
attribute value, and the headless Chrome SVG xlink:href lanes found no
anchors. Simulated snapshots interned "" as a table entry and missed it.

Parse snapshot strings at one owner: names still require a table entry,
while node values, attribute values, and baseURL accept -1 as "". The SVG
ancestry projection shares the same parser instead of its own copy.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
29a2d13 classifies an over-budget expanded SAZ archive as invalid input
with an out_of_range `capture_path` issue that names the expanded-byte
maximum. Assert that projection through the CLI instead of the previous
execution failure.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…acement

DirectoryArtifactReader yields a directory's entries in `opendir()` order and
reads queued child directories only after that directory is exhausted. The
root-replacement test assumed APFS order (`sub` before `sample.txt`), so it
failed on Linux ext4. Require both root entries in either order before the
descent into the replaced root is rejected.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The exact-selection tests from 4d4631a match the child Vitest summary as
plain text. In the CI lane the child inherited color, so ANSI styling split
"Test Files  2 passed" and both tests failed there while passing locally;
`FORCE_COLOR=1` reproduces it. Run the child with `NO_COLOR=1`.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@kaoru0822-kitauji

Copy link
Copy Markdown
Collaborator Author

Status: on the last full CI run, the only failures left are below. The headless Chrome SVG lanes now pass, which confirms the DOMSnapshot -1 fix (1b75c0d).

Pushed just now:

  • directoryArtifactReaderOwnership (bb1fbf6): the reader yields entries in opendir() order, ext4 on Linux and APFS on macOS. The test now accepts either root-entry order and still requires the rejection on descent into the replaced root.
  • developmentTests exact selection (181f0f9): the child Vitest summary was ANSI-styled in CI (FORCE_COLOR=1 reproduces this locally). The child now runs with NO_COLOR=1.

The one remaining failure is the duplicated provider caveat in enhancedTools.callPathsAndBatches (80de314). It needs your call on whether the Evidence envelope or the tool result owns upstream caveats.

@N0zoM1z0

Copy link
Copy Markdown
Collaborator

The remaining shard-4 failure was independently reproduced on clean main and is an outdated whole-JSON occurrence count. Main intentionally retains upstream limitations in the composed Evidence envelope (80de314), while the existing graph result also exposes its aggregate limitations. Removing either output field would change a declared contract.

The follow-up therefore asserts the exact envelope list and exact graph-result list separately, plus the actual edges and complete relationship coverage. Repeated provider responses still have to deduplicate to one caveat at each location. There is no product-code, schema, timeout, or retry change. The workflow Evidence and MCP boundary tests pass (22 tests), and the final fast static checks pass. This addresses the main regression within this PR’s existing regression-check scope.

@N0zoM1z0
N0zoM1z0 merged commit 7ad75bd into main Oct 14, 2026
32 of 33 checks passed
@N0zoM1z0
N0zoM1z0 deleted the fix/main-red-ida-javascript-tests branch October 14, 2026 04:17
@morluto morluto added the area: tests Test suite and verification label Nov 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: tests Test suite and verification bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants