Skip to content

Retire legacy run_llm_assessment fallback path #10

Description

@simaba

Problem

src/phases/__init__.py::run_llm_assessment() is a legacy public helper that:

  • describes itself as the primary entry point even though the supported path is now src.engine.run_assessment()run_assessment_with_provenance();
  • hard-codes the Anthropic client and claude-sonnet-4-6;
  • silently returns _deterministic_fallback(...) when the API key is absent or any exception occurs;
  • bypasses the provenance-aware fallback result and certainty-softening logic in src/assessment_service.py.

This means callers that import the legacy helper can receive fallback output without the llm / deterministic_fallback provenance contract and with stronger raw fallback wording than the supported service path.

Preferred fix

Replace the implementation with a deprecated compatibility wrapper:

def run_llm_assessment(project: ProjectInput, mode: str, audience: str) -> AssessmentResult:
    """Deprecated compatibility wrapper for provenance-aware assessment generation."""
    from src.assessment_service import run_assessment_with_provenance

    return run_assessment_with_provenance(project, mode, audience)

The local import avoids the circular import created by assessment_service importing low-level helpers from src.phases.

Alternatively, remove the helper after confirming there are no external compatibility requirements.

Acceptance criteria

  • legacy helper no longer owns provider/model selection;
  • no silent fallback outside assessment_service;
  • supported and compatibility paths return the same provenance-aware result contract;
  • tests cover missing API key and provider exception behavior;
  • documentation continues to identify src.engine.run_assessment() as the supported application entry point.

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