Skip to content

Remove dead _validate_topic function - #294

Merged
isolomatov-gd merged 1 commit into
griddynamics:mainfrom
lukiod:remove-dead-validate-topic
Aug 18, 2026
Merged

Remove dead _validate_topic function#294
isolomatov-gd merged 1 commit into
griddynamics:mainfrom
lukiod:remove-dead-validate-topic

Conversation

@lukiod

@lukiod lukiod commented Aug 15, 2026

Copy link
Copy Markdown
Contributor

Fixes #256.

`_validate_topic` (`src/rosetta-mcp-server/rosetta_mcp/server.py:545`)
has zero call sites in `src/`. Both places that could use it
(`get_context_instructions`, `query_instructions`) hardcode
`topic=None` with an inline comment explaining topic filtering was
intentionally disabled to reduce noise. Leaving the validator in place
implies topic filtering is still active, which is misleading -- removed
per the issue's own preferred option (YAGNI) and the automated triage
comment's recommendation.

Verified: grepped for every reference to `_validate_topic` before and
after -- only the definition existed, confirming this is genuinely dead
code, not something with a hidden caller. Full test suite: 334/334
passing, no regressions.

Zero call sites in src/ -- both places that could use it
(get_context_instructions, query_instructions) hardcode topic=None
with a comment explaining topic filtering was intentionally disabled
to reduce noise. Leaving the validator in place implies topic
filtering is still active, which is misleading.

Fixes griddynamics#256
@lukiod
lukiod requested a review from omaiesh as a code owner August 15, 2026 18:31
@isolomatov-gd
isolomatov-gd marked this pull request as draft August 18, 2026 17:32
@isolomatov-gd
isolomatov-gd marked this pull request as ready for review August 18, 2026 17:32
@github-actions github-actions Bot added the good first issue Good for newcomers label Aug 18, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Rosetta Triage Review

Summary: Removes the dead _validate_topic function from rosetta_mcp/server.py — it had zero call sites since topic filtering was already hardcoded to None at both call sites. Fixes #256.

Findings:

  • Verified via grep across src/ and tests/: no remaining references to _validate_topic after removal.
  • Change is minimal (7 deletions, 0 additions), scoped to exactly the dead function, matches the linked issue's preferred fix.
  • PR description documents verification steps (grep before/after, full test suite 334/334 passing) and CI checks are green.

Caveats:

  • No dedicated test previously covered _validate_topic directly (consistent with it being unreachable), so removal doesn't reduce test coverage.

Automated triage by Rosetta agent

@isolomatov-gd
isolomatov-gd merged commit 12ffd6c into griddynamics:main Aug 18, 2026
6 of 7 checks passed
@isolomatov-gd

Copy link
Copy Markdown
Contributor

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

good first issue Good for newcomers

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[ROSETTA] _validate_topic in rosetta-mcp server is dead code

2 participants