Skip to content

Bug: Detailed anatomy prompt templates in prompts/anatomy/*.txt are never loaded #43

Description

@Liohtml

Summary

The repository ships rich, structured anatomy prompt templates at src/medcheck/prompts/anatomy/{knee,shoulder,spine}.txt, but build_prompt() in vision_analysis.py only uses the short hardcoded _ANATOMY_HINTS dict and never reads those files. The detailed templates are effectively dead code, and the Vision-LLM receives only a one-line hint instead of the systematic checklist authored for each region.

Location

  • src/medcheck/pipeline/vision_analysis.py_ANATOMY_HINTS dict and build_prompt()
  • src/medcheck/prompts/anatomy/*.txt — detailed templates that are never read

Impact

Suggested Fix

  1. Add a loader that reads prompts/anatomy/<region>.txt when present and uses its content as the anatomy-specific instruction block.
  2. Fall back to the existing _ANATOMY_HINTS dict, then to a generic instruction, when no template file exists (keeps hip/ankle/wrist/brain working).
  3. Add an abdomen hint so the README's advertised regions are all covered.
  4. Cache loaded templates to avoid re-reading on every call.

Category

Bug / Enhancement

Severity

Medium

Effort Estimate

~1 h

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions