Skip to content

Require indexed relationships for dispatch expansion - #907

Merged
zlareb1 merged 1 commit into
mainfrom
fix/code-callers-target-precision
Nov 18, 2026
Merged

zlareb1 merged 1 commit into
mainfrom
fix/code-callers-target-precision

Conversation

@zlareb1

@zlareb1 zlareb1 commented Nov 18, 2026

Copy link
Copy Markdown
Member

Changelog category (leave one):

  • Bug Fix (user-visible misbehavior in a release)

Changelog entry (one or two sentences a user of Loom can read without the diff; the release pull request collects these into the release notes):

code.callers and code.impact require indexed override or inheritance relationships when expanding a method to its base declarations. Unrelated methods with the same name and signature are excluded from that expansion.

Why

A matching method name and signature do not establish virtual dispatch. Adding an unrelated class as a base produces false callers and impact results, including when include_ambiguous=false. Missing relationships must remain an explicit limit of the graph answer.

Scope and risk

The shared dispatch resolver keeps exact override edges and the bounded inheritance walk. The name-only fallback and its unused store query are removed, together with the corresponding analyzer fixture and SQL shape. Results can contain fewer edges when inheritance is not indexed. Regression tests retain genuine override and inheritance paths and check lower-bound metadata.

Compatibility, rollout and rollback

  • Wire: no operations, fields or defaults change. dispatch_seeds no longer reports unsupported virtual_by_name guesses; generated reference comments describe the remaining relationship sources.
  • Operator steps: none. The change applies at query time and needs no backfill or reindex.
  • Rollback: revert the change; no stored rows or schema changes remain.

Tests

The regression failed before the source fix on four depth/ambiguity variants and the impact expansion. The final regression exercises the full callers handler and checks hop counts and missing-dispatch disclosure.

Focused local checks passed:

  • Graph, candidate and epistemic tests: 58 passed.
  • Final dispatch precision, compiler relationships and inheritance tests: 21 passed.
  • Offline analyzer inventory checks: 3 passed; regeneration removes only the deleted query shape.
  • Public-copy checks and links in both changed documentation pages: 8 passed.
  • Ruff lint and formatting on changed Python files, the function-length ratchet, the prose checker and git diff --check pass.

Core reproduction:

.venv/bin/python -m pytest tests/unit/test_code_dispatch_precision.py tests/unit/test_scip_relationship_edges.py tests/unit/test_code_impact_dispatch.py -q

Full local suites were deferred to CI.

AI assistance in the code (leave one; writing this description with AI is fine):

  • AI-generated (Codex wrote the diff): the request evidence, shared callers and impact paths, generated output and focused regression results were checked.

  • I can explain every line of this diff and how it interacts with the rest of Loom.

Checklist

  • make format-check, make lint, make typecheck and make test-unit pass; the integration suite passes if server behaviour changed.
  • Generated files are regenerated in this PR, not by hand. The affected operations reference and analyzer inventory are regenerated.
  • No migration changes.
  • No plugin changes.
  • No frontend changes.
  • Docs describe the system as it is and name operator steps and wire changes.
  • Repository text contains no internal deployment details.
  • Commits are signed off.

Same-name methods on unrelated classes cannot establish virtual dispatch. Keep exact override and inheritance paths, and expose missing relationships through the graph uncertainty metadata.

Signed-off-by: zlareb1 <[email protected]>
@zlareb1
zlareb1 merged commit 3883454 into main Nov 18, 2026
85 of 86 checks passed
@zlareb1 zlareb1 mentioned this pull request Nov 18, 2026
6 tasks done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant