OHDSI / OHDSI/StudyAgent

Resolve global Ruff findings after phenotype workflow sprint

Open
#82 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
12
Forks
7
Avg merge
2m
Merged PRs (30d)
12

Description

Current state

ruff check acp_agent core mcp_server scripts tests reports 13 findings. Targeted Ruff checks for the phenotype workflow and companion R-client compatibility cleanup pass; this issue tracks the remaining repository-wide debt.

StudyAgent findings (inspect before removal)

acp_agent/study_agent_acp/agent.py contains earlier definitions that Ruff reports as redefined by later implementations:

  • __init__ at lines 76 and 511
  • list_tools at lines 504 and 1421
  • call_tool at lines 507 and 1434
  • unused local name at line 1336

The earlier methods appear to be obsolete stubs or shadowed implementations. Remove or reconcile them only after checking the class layout and ACP behavior; do not mechanically refactor the orchestration class. Run focused ACP routing, server, and phenotype tests afterward.

Other low-risk findings

  • unused local name in acp_agent/study_agent_acp/phenotype_recommendation_utils.py
  • unused allowed_set in core/study_agent_core/tools.py
  • unused imports in tests/test_acp_cohort_methods_route.py and tests/test_mcp_phenotype_summary.py
  • mid-file imports in tests/test_cohort_methods_spec_validation.py

Suggested completion checks

  1. Run focused tests for every affected behavior, particularly ACP server/routing and phenotype recommendation tests when editing StudyAgent.
  2. Run ruff check acp_agent core mcp_server scripts tests.
  3. Run git diff --check.
  4. Run the normal Python gate, uv run --extra dev doit test_all; separately report any unrelated existing failures rather than masking them.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by running ruff check acp_agent core mcp_server scripts tests and inspect the duplicate definitions in acp_agent/study_agent_acp/agent.py before changing them. Review the other listed files and run the focused ACP, phenotype, and affected tests. Done means the findings are resolved, the focused tests pass, git diff --check is clean, and uv run --extra dev doit test_all has been run with unrelated failures reported.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
testing-qa, tooling
Issue type
Refactor
Difficulty
4/5
Estimated time
3-5 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.