Skip to content

feat(graph): implement two-pass symbol resolution for PropertyGraph - #20

Merged
ManSio merged 8 commits into
mainfrom
feat/two-pass-symbol-resolver
Sep 2, 2026
Merged

ManSio merged 8 commits into
mainfrom
feat/two-pass-symbol-resolver

Conversation

@ManSio

@ManSio ManSio commented Aug 29, 2026

Copy link
Copy Markdown
Owner
  • Transition graph building from single-pass to Extract -> Resolve model.
  • Enrich placeholder nodes with call metadata (caller_node_id, line_number, raw_symbol_name).
  • Add GraphSymbolResolver to resolve placeholders via imports, unique global names, and stdlib.
  • Integrate resolver pass in GraphRAG, Indexer, and SymbolIndexAdapter.
  • Add test_graph_resolver.py covering all resolution strategies and cleanup.

- Transition graph building from single-pass to Extract -> Resolve model.
- Enrich placeholder nodes with call metadata (caller_node_id, line_number, raw_symbol_name).
- Add GraphSymbolResolver to resolve placeholders via imports, unique global names, and stdlib.
- Integrate resolver pass in GraphRAG, Indexer, and SymbolIndexAdapter.
- Add test_graph_resolver.py covering all resolution strategies and cleanup.
@coderabbitai

coderabbitai Bot commented Aug 29, 2026

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Team

Run ID: 9c392c15-ce33-47d9-8d87-97fb62e2dad2


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

MSCodeBase Agent added 7 commits August 29, 2026 12:27
- Sync AGENT_DIARY.md with symbol resolution implementation.
- Rotate KNOWN_ISSUES.md to archive 2026-07.
- Add check_known_issues script and update pre-commit hooks installer.
- Add NodeLabel.DEPENDENCY to graph core.
_find_nodes_flexible now also queries the bare last-dot component when the
symbol is qualified (Class.method), because CALLS edges from unqualified
parser output live on bare nodes. Prior behavior under-estimated blast
radius for any object-method call (impact_analysis returned 0 callers).
Funnel-shared fix covers both impact and topology paths.

Also fix stale health docstring (timeout=30s -> actual 15s).
Write path (issue #21): modification_guard and the one-target
write_tools ops (move/replace/insert_before/insert_after) now REFUSE
a symbol that resolves to >1 definition instead of silently picking
defs[0]'s file - a write could hit the wrong module. Ambiguity returns
the full candidate list (file:line) so the caller can pass an explicit
file_path matching exactly one.

Verify-on-read (issue #22): symbol anchors are now fail-closed. The
graph/index carries no freshness mark in this build, so "not found"
cannot prove absence: _symbol_resolver returns only True (referent on
disk -> VERIFIED) or None (unknown/absent -> INCONCLUSIVE), never False;
_classify maps any non-True symbol check to INCONCLUSIVE, never REFUTED.
Honest REFUTED becomes reachable only after the freshness layer (build
HEAD + clean tree) lands separately.

Fixes #21
Fixes #22
Verify-On-Read REFUTES a symbol only when the index it was checked against
provably reflects the current codebase:

- record `build_head` in graph meta on a successful full index (index_project);
- read-time: `_symbol_resolver` returns False (REFUTED) only when that recorded
  build_head equals the live HEAD on a clean tree; legacy index / HEAD mismatch
  / non-git / dirty tree / resolver failure -> None (INCONCLUSIVE), never REFUTED;
- drop the fail-closed symbol branch in `_classify` — freshness is now the
  resolver's job, the classifier trusts it again;
- pure gating helpers `evaluate_freshness` + `resolve_head_dirty` in
  verify_on_read.py, plus PropertyGraph meta (set_meta/get_meta) and
  SymbolIndexAdapter.build_head().

Opens honest REFUTED for absent symbols from a fresh index while keeping the
stale-index guarantee fail-closed (issue #22). 1602 tests green, ruff clean.

Fixes #21
Fixes #22
@ManSio
ManSio merged commit 4726ff7 into main Sep 2, 2026
12 of 13 checks passed
@ManSio
ManSio deleted the feat/two-pass-symbol-resolver branch September 2, 2026 21:11
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