Skip to content

Enhancement: add bounded receiver traversal for eight language adapters#1130

Merged
DavidBakerEffendi merged 14 commits into
masterfrom
dave/1107-bounded-receiver-all-languages
Jul 24, 2026
Merged

Enhancement: add bounded receiver traversal for eight language adapters#1130
DavidBakerEffendi merged 14 commits into
masterfrom
dave/1107-bounded-receiver-all-languages

Conversation

@DavidBakerEffendi

Copy link
Copy Markdown
Collaborator

Extends query_code receiver traversal to C++, C#, Go, PHP, Python, Ruby, Rust, and Scala. Each adapter now feeds structured semantic facts and exact language resolvers into the shared receiver_targets, points_to, and member_targets contract while preserving provenance, explicit uncertainty, budgets, and cancellation.

Key Changes:

  • Add neutral receiver, allocation, alias, call-result, return, and heap facts for all eight adapters, plus structured receiver-site selection.
  • Reuse WorkspaceSemanticOracle and bounded exact definition/type resolvers instead of introducing per-language query engines or name-only fallbacks.
  • Harden cold materialization, persisted metadata, hierarchy and dispatch resolution, candidate/work accounting, cancellation, and incomplete-evidence handling.
  • Add cross-language acceptance and adversarial coverage for exact ownership, same-name negatives, composition, caps, cancellation, and language-specific dynamic boundaries; keep plain C explicitly unsupported.
  • Update the receiver capability matrix, schema descriptions, tutorials, and executable documentation.

Touch Points:

  • src/analyzer/{cpp,csharp,go,php,python,ruby,rust,scala}/
  • src/analyzer/usages/receiver_query.rs, receiver_sites.rs, get_definition/, and get_type/
  • src/analyzer/semantic/, src/analyzer/structural/, and src/analyzer/store/
  • tests/code_query_pipelines.rs and the receiver/semantic acceptance and hardening suites
  • docs/src/content/docs/
  • .agents/plans/issue-1107-bounded-receiver-language-rollout.md

Fixes #1107
Fixes #1108
Fixes #1109
Fixes #1110
Fixes #1111
Fixes #1112
Fixes #1113
Fixes #1114
Fixes #1115

Connect C# receiver_targets, points_to, and member_targets to normalized structural facts, neutral semantic oracles, and the existing exact type/member resolver.

Add generation-coherent receiver-site indexing, caller-local call-result identity, conversion-safe value flow, conservative dispatch coverage, and bounded provider lookups so open or truncated evidence can never become precise.

Harden cold persisted metadata, imports, hierarchy, attributes, cancellation, candidate caps, and work accounting before using this implementation as the reference seam for the remaining language adapters.
Emit structured self, parameter, local, allocation, call-result, and return value flow so receiver queries can reuse the neutral workspace oracle without a Rust-specific query engine.

Add cancellation- and budget-aware Rust type/member resolution over persisted bounded indexes, preserving open trait, capture, cast, deref, macro, and incomplete-crate boundaries instead of guessing by name.
Publish structured Go receiver, parameter, local, allocation, and return-flow facts so the neutral semantic oracle can prove bounded receiver identities without source-text fallbacks.

Add cancellation-aware exact type and definition resolution for selectors, pointer/value method sets, promoted members, and factory returns. Persist the declaration metadata needed by cold lookups, keep interface/generic/multi-result boundaries explicit, and filter path-derived candidates by exact hydrated FQN.
Preserve exhaustive points-to evidence for caller-side values that were already evaluated before an unresolved call. Ordinary call-site gaps now open only the call result and thrown value; adapters must attach CallEvaluation when callee, receiver, or argument evaluation is itself incomplete.

Add a focused oracle regression proving the same unresolved call leaves an argument exhaustive while keeping its produced result open. This shared correction prevents conservative dispatch gaps from erasing otherwise exact receiver identities.
Publish analyzer-neutral PHP value and heap facts for current receivers, locals, allocations, calls, arguments, and returns so receiver queries can consume the shared semantic contract.

Add budgeted exact PHP definition/type resolution and focused behavior coverage, preserving explicit uncertainty for dynamic features instead of widening through text search.
Publish neutral Python receiver, binding, allocation, call, argument, and return identities while placing descriptor and subscript uncertainty after operand evaluation so proven receiver values remain exhaustive.

Add exact budgeted Python definition/type resolution and a sound non-module declaration lookup seam that excludes path-synthetic modules without forcing false workspace-budget exhaustion.
Publish Ruby receiver, parameter, local, allocation, argument, and return facts through the neutral semantic model.

Add request-bounded AST and indexed-declaration resolution for current/class receivers, local aliases, allocations, exact owner-scoped members, and structurally proven same-file singleton factories while preserving open dynamic-dispatch boundaries.
Finish native receiver traversal for C++ and Scala, then integrate all eight language milestones through the shared semantic and exact-resolution seams.

Harden cold fact acquisition, resolver/provider lookahead, structured metadata admission, role-edge accounting, persisted failure handling, DAG identity work, and snapshot coherence so every path remains finite and cancellable.

Add cross-language exactness, uncertainty, cap, composition, hierarchy, hostile-input, and documentation coverage; preserve explicit non-precise outcomes at dynamic or incomplete language boundaries.
Filter normalized persisted FQN candidates with the same arity-preserving identity used by the live usage index, so an exact nongeneric miss cannot resolve to a generic type after the receiver rollout switches lookup onto the bounded provider.

Record the rebase reconciliation and post-rebase regression coverage in the rollout ExecPlan.
The all-targets, all-features Clippy gate exposed several implementation-shape warnings across the newly bounded language paths and shared semantic APIs. Resolve those warnings at their source so the combined rollout satisfies the same lint policy as CI without suppressing meaningful diagnostics.\n\nKeep necessary high-arity traversal signatures explicit, reduce unnecessary clones and nested control flow, and box the large call-location endpoint variant to keep the public enum compact.
Close bounded store/materialization and ICFG precision gaps found by aggregate tests.

Unify Python lexical and module binding inventory while preserving exact local factory resolution.

Make Go, Python, and Rust enumeration and owner recovery bounded, cancellable, and identity-stable.

Preserve normal Go LSP ambiguity behavior and deterministic bounded namespace accounting.

Model generic C# extension applicability structurally and invalidate stale serialized metadata.

Add regressions for ambiguity, cold persistence, oracle flow, scope visibility, hostile store metadata, and wide AST traversal.
Restrict the upstream template-parameter enclosing-scope fallback to declarations in the reference file.

This preserves same-file template parameters while preventing richer C++ indexing from bypassing include activation for a cross-file class declared after the reference's include boundary.

Record the final rebase interaction and focused 633-test definition validation in the rollout ExecPlan.
Mark the strict isolated Clippy and complete all-feature test suite green after the C++ upstream-interaction fix.

Record the source-identical final rebase to origin/master at 752e5c0 and leave only PR publication, CI, merge, closure verification, and artifact cleanup pending.
Express the bounded-work assertion in the direct form expected by the pinned CI lint set and elide an unnecessary receiver-site helper lifetime. This keeps strict warning-free cross-target Clippy coverage without suppressions or behavioral changes.

Record PR #1130 and the first CI correction in the rollout ExecPlan so publication status and validation evidence remain current.
@DavidBakerEffendi
DavidBakerEffendi merged commit e102717 into master Jul 24, 2026
22 checks passed
@DavidBakerEffendi
DavidBakerEffendi deleted the dave/1107-bounded-receiver-all-languages branch July 24, 2026 05:50
jbellis added a commit that referenced this pull request Jul 24, 2026
…1129)

Follow-up to 142843c: returning the enclosing-scope hit unconditionally
over-resolved qualified references whose owner is a real class missing
the named member (cpp_macro_decorated_out_of_line regression — the
class itself came back as the definition). The stand-in now only
applies when the scope hit is field-like (a template parameter), not a
real type; class scopes with no such member stay ordinary
no-definitions. All 633 get_definition + 71 selector tests green.

Also adds the regression test for #1130's hash-in-path selector split
(file landed with the selector fix).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment