Skip to content

fix(review): exclude dataflow nodes from review diff + move detection in removed-referenced#76

Merged
smochan merged 2 commits into
mainfrom
fix/review-dataflow-noise
Jun 10, 2026
Merged

fix(review): exclude dataflow nodes from review diff + move detection in removed-referenced#76
smochan merged 2 commits into
mainfrom
fix/review-dataflow-noise

Conversation

@smochan

@smochan smochan commented Jun 10, 2026

Copy link
Copy Markdown
Owner

Summary

The wave-2 PRs (#73, #74) tripped the self-review gate (--fail-on high) with two false-positive classes introduced by the interaction between the new data-edges feature (#68) and the review rules:

  1. Dataflow node churn. VARIABLE/PARAMETER qualnames embed line numbers (pkg.fn.<var:x:42>), so any edit that shifts lines makes every local variable appear removed+added. PR feat(resolve): TS fresh-instance binding + decorator CALLS edges (R2 parity) #74's clean typescript.py refactor produced 12+ removed-referenced criticals on its own locals. The differ now excludes these node kinds and DATA_* edges from review diffs — they're dataflow plumbing, not reviewable API surface (same philosophy as the existing line-shift exclusion documented in diff_graphs).

  2. Moves flagged as removals. removed-referenced fired on esc/pyvisHref/mermaidThemeVars after PR refactor(web): split app.js into per-view modules + shared UI helpers #73 moved them from app.js to ui/helpers.js with every caller updated (verified: all callers alias CGUI.*). The rule now skips removed nodes whose terminal name reappears in the added set with the same kind. A control test asserts genuine deletions with surviving callers still fire critical.

Test plan

  • 2 differ regression tests (var/param exclusion, DATA_* edge exclusion)
  • 2 rules tests (moved symbol skipped, real removal still fires)
  • Full suite: 746 passed
  • ruff + mypy --strict clean on touched files
  • codegraph lint self-run: 0 findings

Unblocks #73, #74 (and keeps the gate honest for #75, which has a legit finding being addressed separately).

🤖 Generated with Claude Code

… removed-referenced

The wave-2 PRs tripped the self-review gate with two false-positive
classes:

1. VARIABLE/PARAMETER nodes (new in the data-edges work) embed line
   numbers in their qualnames, so any line shift makes every local
   appear removed+added. A clean typescript.py refactor produced 12+
   removed-referenced criticals on its own local variables. The differ
   now excludes these kinds and DATA_* edges from review diffs - they
   are dataflow plumbing, not reviewable API surface.

2. removed-referenced fired on symbols that moved modules (esc,
   pyvisHref, mermaidThemeVars: app.js -> ui/helpers.js) even though
   every caller was updated. The rule now skips removed nodes whose
   terminal name reappears in the added set with the same kind.
   Genuine deletions with surviving callers still fire (control test
   added).

Gate: 746 tests pass, ruff + mypy --strict clean, self-lint clean.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown

codegraph PR review

Diff vs main · severity ≤ high

codegraph review (target: main)

Diff: +53 / -24 / ~0 nodes, +157 / -55 edges

Findings (20)

severity rule kind qualname file:line score message
critical removed-referenced graph codegraph.review.differ._build_node_index.<var:key:76> codegraph/review/differ.py:76 50 Removed symbol still referenced by callers
critical removed-referenced graph codegraph.review.differ._build_node_index.<var:nid:75> codegraph/review/differ.py:75 50 Removed symbol still referenced by callers
critical removed-referenced graph codegraph.review.differ._build_node_index.<var:payload:83> codegraph/review/differ.py:83 50 Removed symbol still referenced by callers
critical removed-referenced graph codegraph.review.differ._edge_keys.<var:dst_qn:103> codegraph/review/differ.py:103 50 Removed symbol still referenced by callers
critical removed-referenced graph codegraph.review.differ._edge_keys.<var:keys:99> codegraph/review/differ.py:99 50 Removed symbol still referenced by callers
critical removed-referenced graph codegraph.review.differ._edge_keys.<var:kind:101> codegraph/review/differ.py:101 50 Removed symbol still referenced by callers
critical removed-referenced graph codegraph.review.differ._edge_keys.<var:src:100> codegraph/review/differ.py:100 50 Removed symbol still referenced by callers
critical removed-referenced graph codegraph.review.differ._edge_keys.<var:src_qn:102> codegraph/review/differ.py:102 50 Removed symbol still referenced by callers
critical removed-referenced graph codegraph.review.differ._node_key.<var:kind:57> codegraph/review/differ.py:57 50 Removed symbol still referenced by callers
critical removed-referenced graph codegraph.review.differ._node_key.<var:qualname:56> codegraph/review/differ.py:56 50 Removed symbol still referenced by callers
critical removed-referenced graph codegraph.review.differ.diff_graphs.<var:diff:124> codegraph/review/differ.py:124 50 Removed symbol still referenced by callers
critical removed-referenced graph codegraph.review.differ.diff_graphs.<var:key:129> codegraph/review/differ.py:129 50 Removed symbol still referenced by callers
critical removed-referenced graph codegraph.review.differ.diff_graphs.<var:key:173> codegraph/review/differ.py:173 50 Removed symbol still referenced by callers
critical removed-referenced graph codegraph.review.differ.diff_graphs.<var:new_edges:190> codegraph/review/differ.py:190 50 Removed symbol still referenced by callers
critical removed-referenced graph codegraph.review.differ.diff_graphs.<var:new_id_map:188> codegraph/review/differ.py:188 50 Removed symbol still referenced by callers
critical removed-referenced graph codegraph.review.differ.diff_graphs.<var:new_idx:127> codegraph/review/differ.py:127 50 Removed symbol still referenced by callers
critical removed-referenced graph codegraph.review.differ.diff_graphs.<var:old_edges:189> codegraph/review/differ.py:189 50 Removed symbol still referenced by callers
critical removed-referenced graph codegraph.review.differ.diff_graphs.<var:old_id_map:187> codegraph/review/differ.py:187 50 Removed symbol still referenced by callers
critical removed-referenced graph codegraph.review.differ.diff_graphs.<var:old_idx:126> codegraph/review/differ.py:126 50 Removed symbol still referenced by callers
critical removed-referenced graph codegraph.review.differ.diff_graphs.<var:src_qn:192> codegraph/review/differ.py:192 50 Removed symbol still referenced by callers

Triggered by codegraph CI · last run

The baseline build ran 'pip install -e .' inside the origin/main
worktree, silently replacing the PR-head editable install from the
previous step. Every subsequent step - the PR graph build, the diff,
and the rule evaluation - ran main's codegraph, so PR changes to the
differ/rules/parsers never took effect in their own review. This PR's
differ fix was itself flagged by the exact var-node noise it removes.

Both graphs are now built with the PR-head install, which also keeps
diffs apples-to-apples when a PR changes parser output.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown

codegraph PR review

Diff vs main · severity ≤ high

codegraph review (target: main)

Diff: +6 / -0 / ~0 nodes, +80 / -24 edges

Findings (0)

No findings.

Triggered by codegraph CI · last run

@smochan smochan merged commit d9a2c6c into main Jun 10, 2026
5 checks passed
@smochan smochan deleted the fix/review-dataflow-noise branch June 10, 2026 14:57
@github-actions github-actions Bot locked and limited conversation to collaborators Jun 10, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant