Skip to content

fix: classify move, and stop kwonly params suppressing TOO_MANY - #2109

Merged
vitali87 merged 3 commits into
pr-split/split-pr1549-source/pr-6from
fix/2074-move-guard-and-arity
Sep 21, 2026
Merged

vitali87 merged 3 commits into
pr-split/split-pr1549-source/pr-6from
fix/2074-move-guard-and-arity

Conversation

@vitali87

Copy link
Copy Markdown
Owner

Two unrelated failures on #2074.

1. move read as an unguarded reader

these tools read the graph but never refuse on a partial one: ['move'].

_NOT_GRAPH_READERS is deliberately fail-closed: a tool counts as a reader
until classified. The MOVE enum member lands on this layer ahead of its MCP
handler, so nothing dispatches it and it reads nothing yet.

Classified as a non-reader beside RENAME and CHANGE_SIGNATURE, per
e5e9f1c1: these are graph-driven edits that run their own re-ingest
behind the incomplete-run marker and hold the result to the postcondition
contract, so refusing up front on a partial graph would block the operation
that repairs it.

The comment records what must happen next: when the handler lands it routes
through _graph_query and must move to _READS_THE_GRAPH, or the
dispatcher's if tool in _READS_THE_GRAPH silently skips its refusal.

2. Keyword-only params suppressed a real TOO_MANY verdict

test_extra_positional_to_a_keyword_only_callee_is_too_many is red here for
the same reason as on the 1550 stack. The suppressor counted kwonlyargs,
but keyword-only parameters absorb no surplus positional:

>>> def helper(a, *, b=1): pass
>>> helper(1, 2, b=3)
TypeError: helper() takes 1 positional argument but 2 positional arguments
           (and 1 keyword-only argument) were given

#2107 carries the full reasoning. The oracle on this branch restated the
buggy expression as well, so it is replaced with one that decides by
calling the function with one surplus positional.

Verification

283 passed, 2 skipped across test_mcp_project_scoping.py,
test_structural_delta.py and test_variadic_header_detection.py.

Two failures on #2074, unrelated to each other.

`test_every_graph_reader_is_guarded` named `move`. The enum member lands
on this layer ahead of its MCP handler, so nothing dispatches it and it
reads nothing yet. Classified as a non-reader beside RENAME and
CHANGE_SIGNATURE, which e5e9f1c settled: these are graph-driven EDITS
that run their own re-ingest behind the incomplete-run marker, so
refusing up front on a partial graph would block the operation that
repairs it. When the handler lands it routes through `_graph_query` and
must move to `_READS_THE_GRAPH`, or the dispatcher skips its refusal.

`test_extra_positional_to_a_keyword_only_callee_is_too_many`: the
too-many-positionals suppressor counted `kwonlyargs`. Keyword-only
parameters absorb no surplus positional -- CPython raises TypeError --
so a real verdict was dropped. Same fix as #2107, which carries the full
reasoning; the oracle here restated the buggy expression too, so it is
replaced with one that decides by calling the function.
@vitali87

Copy link
Copy Markdown
Owner Author

@greptileai review

@coderabbitai

coderabbitai Bot commented Sep 21, 2026 •

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

🗂️ Base branches to auto review (2)
  • ^feat/.*
  • ^fix/.*

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository: vitali87/code-graph-rag/.coderabbit.yaml

Review profile: CHILL

Plan: Advanced

Run ID: 078946bb-323c-473d-b02c-1831cfa66cea

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

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.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟢 Approval recommended

No blocking issues remain; only minor documentation and dead-code cleanup nits were identified.

Review effort: Lite
Findings: 2 Low severity

Open (2)
What changed in this PR

Fixes MOVE tool classification and prevents keyword-only parameters from suppressing TOO_MANY arity findings.

Changes:

  • Classifies MOVE as a non-graph reader.
  • Restricts variadic detection to *args.
  • Adds runtime-backed regression tests.
File Changes
codebase_rag/​tests/​test_variadic_header_detection.py Adds runtime oracle and keyword-only regression tests.
codebase_rag/​structural_delta.py Corrects variadic header detection.
codebase_rag/​mcp/​tools.py Classifies MOVE as a non-reader.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread codebase_rag/structural_delta.py Resolved
Comment thread codebase_rag/structural_delta.py Resolved
@greptile-apps

greptile-apps Bot commented Sep 21, 2026

Copy link
Copy Markdown
Contributor

RetriggerConfidence Score: 5/5

Safe to merge: the changed classifications behave correctly and focused regression coverage passes.

What we checked:

  • Executed the focused validation script pr-b3afaf7a-focused-validation.py from the project root to compare the baseline and PR results. T-Rex
  • Ran the focused regression suite and observed that the PR head produced H1=PASS and H2=PASS while the baseline showed failures. T-Rex
  • Authored the harness artifact trex-artifacts/pr-b3afaf7a-focused-validation.py to capture the validation workflow. T-Rex

Summary

This change completes the MOVE tool classification and restores surplus-positional argument detection for functions that only declare keyword-only parameters. Focused regression coverage passed with 283 tests passing and 2 skips.

Reviews (1) · Last reviewed commit: "fix: classify move, and stop kwonly para..."

Co-authored-by: vitali87 <22404335+vitali87@users.noreply.github.com>
Co-authored-by: vitali87 <22404335+vitali87@users.noreply.github.com>
@vitali87
vitali87 merged commit 36a2b10 into pr-split/split-pr1549-source/pr-6 Sep 21, 2026
1 of 2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants