Skip to content

feat(apex): parse Apex with tree-sitter, add calls edges - #3122

Open
rsoesemann wants to merge 2 commits into
Graphify-Labs:v8from
rsoesemann:feat/apex-tree-sitter
Open

feat(apex): parse Apex with tree-sitter, add calls edges#3122
rsoesemann wants to merge 2 commits into
Graphify-Labs:v8from
rsoesemann:feat/apex-tree-sitter

fix(apex): fall back on a broken parse, and count REST verbs as entry…

ffa8699
Select commit
Loading
Failed to load commit list.
Graphify Labs / Graphify succeeded Aug 26, 2026 in 0s

Graphify — worth a look

Worth a look — the grounded gate found no coupling regressions or blocking issues, but 5 advisory finding(s) below merit a look before merge.

Details

Graphify reviewed this change.

Worth a look — the grounded gate found no coupling regressions or blocking issues, but 5 advisory finding(s) below merit a look before merge.


Graphify review — findings

Adds a tree-sitter path to the Apex extractor that drives the shared engine walk via an Apex LanguageConfig and falls back to the existing regex extractor when the apex grammar is missing or the file fails to parse (including when tree-sitter returns a tree containing ERROR nodes). Layers Apex-only extraction on top of the engine result in _add_apex_specificsextends/implements edges, the SObject a trigger fires on, SObjects behind SOQL FROM/SOSL RETURNING, DML statements, and entry-point annotations — reusing the engine's node-id scheme so both halves land on the same nodes. Filters out collection/primitive constructors and common built-in method names (e.g. add, send, serialize) from raw_calls so the cross-file resolver doesn't invent dependencies by binding bare method names to a single class that happens to declare them.

Worth a look

  • Builtin-method filter drops legitimate same-file resolved callsgraphify/extractors/apex.py · Escalate · high
    • agreed by 2 of 2 members but NOT verified (no proof, no reproducing execution) — consensus is not a verdict; needs human review
  • raw_calls builtin filter drops legitimate same-file calls to methods named add/getgraphify/extractors/apex.py · Escalate · high
    • agreed by 2 of 2 members but NOT verified (no proof, no reproducing execution) — consensus is not a verdict; needs human review
  • Unterminated test file prevents pytest collectiontests/test_apex_calls.py:331 · Escalate · high
    • agreed by 2 of 2 members but NOT verified (no proof, no reproducing execution) — consensus is not a verdict; needs human review
  • DML statements never produce edges in AST pathgraphify/extractors/apex.py · Escalate · medium
    • agreed by 2 of 2 members but NOT verified (no proof, no reproducing execution) — consensus is not a verdict; needs human review
  • language pack path bypasses TypeError guard for grammar load failuresgraphify/extractors/engine.py:2884 · Escalate · medium
    • agreed by 2 of 2 members but NOT verified (no proof, no reproducing execution) — consensus is not a verdict; needs human review
Analysis details — impact, health, verification

Impact & health

Graphify review

Impact — 1726 functions depend on the 272 functions this change touches.

Health — this change adds coupling hotspots:

  • new: extract() — 501 callers, 42 callees
  • new: _rebuild_code() — 98 callers, 50 callees
  • new: _extract_generic() — 20 callers, 24 callees
  • new: extract_xaml() — 19 callers, 17 callees
  • new: extract_js() — 83 callers, 3 callees
  • new: dispatch_command() — 2 callers, 122 callees
  • new: extract_objc() — 27 callers, 9 callees
  • new: extract_julia() — 17 callers, 7 callees
  • …and 25 more — each is listed as a finding

Verification — 1726 functions in the blast radius were not formally verified this run (proofs are advisory here).

Gate & verification

graphify gate

PASS — objectively clean (no health regressions, tests not run — proofs not run this pass (advisory)). Grounded, not self-assessed.

Advisory (not blocking):

  • verification_scope: 1076 function(s) in the blast radius were not formally verified this run