Skip to content

refactor(yolo-tracker): BasePlugin architecture backward compatibility design #62

@rogermt

Description

@rogermt

Problem

Migration to BasePlugin architecture removed the legacy analyze() method from Plugin class.

Current tests expect analyze(image_bytes, options)" → AnalysisResult but BasePlugin only exposes:

  • run_tool(tool_name, args) for MCP tool dispatch
  • Tool methods: player_detection(), ball_detection(), etc.

Current Workaround

Added temporary analyze() wrapper that:

  1. Converts raw bytes → base64
  2. Calls detection functions with base64
  3. Returns AnalysisResult dict

See: plugins/forgesyte-yolo-tracker/src/forgesyte_yolo_tracker/plugin.py line 300

Design Decision Needed

Option A: Keep analyze() permanently

  • Maintain backward compatibility
  • Tests pass as-is
  • Two parallel interfaces (legacy + MCP)

Option B: Migrate tests to use run_tool()

  • Clean separation: tests test MCP contracts
  • Remove legacy interface
  • Better alignment with ForgeSyte server integration

Option C: Custom test adapter

  • Tests have separate fixture that calls run_tool()
  • Plugin stays clean (MCP only)
  • Test infrastructure handles conversion

Impact

  • 11 failing tests in test_plugin.py and test_plugin_all_detections.py
  • All infrastructure tests use analyze()
  • GPU tests require actual model execution (slow)

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