Skip to content

fix(javascript): reuse shared AST child traversal - #7967

Merged
morluto merged 2 commits into
morluto:mainfrom
WenyuChiou:codex/fix-electron-ast-guard-20261029
Nov 4, 2026
Merged

morluto merged 2 commits into
morluto:mainfrom
WenyuChiou:codex/fix-electron-ast-guard-20261029

Conversation

@WenyuChiou

@WenyuChiou WenyuChiou commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Restore the architecture guard by reusing the existing JavaScript AST child-expansion owner in Electron call-path completion analysis.

On base 70a8325c38f44649898b2343aea4c13588ff0352, npm run verify:architecture-guards failed because ElectronCallPathBlockPrefixes.possibleJumps directly used VISITOR_KEYS outside the designated traversal owner. It passed after this change. No existing issue or duplicate PR was found in a bounded search; the guard failure is the concrete reproduction.

Scope and behavior

  • Replace the local child expansion with childNodes; preserve the existing LIFO stack, per-visit budget, depth cutoff, label checks, and function/class exclusions.
  • Add characterization for a base-measured 35-visit threshold and interruption/retry, known versus unavailable parent maps, the depth boundary, and nested function/class exclusion. These tests pass on the base as well as the candidate; the failing architecture guard, not a claimed behavior regression, is the red test.
  • This is a routine internal traversal correction within existing boundaries. No new target execution, provider, CLI/MCP contract or release behavior is intended. The shared helper materializes a direct-child array; allocation cost is not claimed identical and was not benchmarked.

Validation and limitations

  • Merged upstream main d157560d402fbd1b54069ff59039dcde73e4a7e1 without conflicts; the PR diff remains the same two AST files. Upstream includes the formatting and Native fixture corrections that caused the previous hosted CI failure. Hosted CI completed successfully, including all eight test shards, Portable tests and the CI required gate; conditional lanes, including deep static, were skipped.
  • On the identical tree of merge head 792509bc231f4ea7776fb6a65b2b420cadc2f5e4, the two source test files plus the repaired Native fixture passed 206/206. Compiled public CLI and stdio MCP switch-selection and wrapped-call-path tests passed 25/25.
  • Architecture guards passed across 2,225 source files; full formatting passed across 6,339 files; typecheck and resolved module-boundary verification passed; git diff --check passed.
  • check:ci:fast did not pass: untyped oxlint was terminated by SIGKILL while running alongside typecheck. Typecheck passed separately, but oxlint also received SIGKILL when rerun alone. Full local npm run check and the full deterministic suite have not passed on this tree. Historical typed lint also received SIGKILL on an earlier snapshot; no current typed-lint result is claimed.
  • Node 24.22.1 and npm 11.16.0 were used. Locked dependencies were originally installed with npm 11.9.0 and lifecycle scripts disabled, and reused by symlink; this qualifies the local results. No live Electron target or real provider was used.
  • On the original base, architecture guards failed and the characterization tests passed, so the guard failure—not a claimed behavior regression—is the red test.

Author readiness

Human owner: @WenyuChiou

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

@greptile-apps

greptile-apps Bot commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 5/5

[Low impact] The reviewed changes appear safe to merge; no blocking issue was found.

Summary

Replaces duplicate child expansion in possibleJumps with the shared childNodes helper.

  • Electron call-path scans get AST children from the shared traversal helper.

Reviews (2) · Last reviewed commit: "Merge upstream main into AST traversal f..." · Reviewed by Greptile

Copy link
Copy Markdown
Contributor Author

CI context: Static checks failed in check:ci:fast because format:check reported docs/native-investigation.md and tests/boundary/providers/native/nativeProvider.test.ts. Neither file is changed by this PR.

For a baseline check, I fetched then-current main at 7ca216a2663376243702d117ce23059680f8ba1f (2026-10-29 01:51 UTC snapshot) into a separate clean worktree. The locked Oxfmt check of those two files also exited 1 and named both. The files, formatting config, package manifest and lockfile have the same Git blob IDs at this PR's base 70a8325c38f44649898b2343aea4c13588ff0352 and that main snapshot. The local check used the existing symlinked lockfile installation, originally installed with lifecycle scripts disabled; it is not a hosted main CI run.

Documentation completed successfully in this PR's run; other jobs remain queued or skipped. This observation does not claim the aggregate CI passed. I have not added unrelated formatting changes to this focused PR.

@WenyuChiou
WenyuChiou marked this pull request as ready for review October 29, 2026 05:23
@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ⚠️ Failed 2026-10-29T05:23:06.632843Z
We couldn’t complete this review. Comment @codex review to try again.
792509b Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

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

@morluto
morluto merged commit 6aeaa04 into morluto:main Nov 4, 2026
45 of 46 checks passed
morluto added a commit that referenced this pull request Nov 4, 2026
* fix(javascript): remove duplicate childNodes import

The squash of #7967 re-added the import already introduced in afc1813,
so typecheck failed with TS2300.

* test(gdb): expect the command-output cap limitation

The retained-record limitation now names the command-output setting.
The coverage assertion still required the previous fixed-cap sentence.

* test(cli): keep rejected mcp add values off Amp settings

mcp add now rejects a flag in the --command value position. The Amp
registration test still treated that invocation as a successful selection.

---------

Co-authored-by: Cursor Agent <[email protected]>
@morluto morluto added bug Something isn't working area: native Native analysis and decompilation, including Ghidra, IDA, and Hopper analysis behavior labels Nov 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: native Native analysis and decompilation, including Ghidra, IDA, and Hopper analysis behavior bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants