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.
Problem
src/phases/__init__.py::run_llm_assessment()is a legacy public helper that:src.engine.run_assessment()→run_assessment_with_provenance();claude-sonnet-4-6;_deterministic_fallback(...)when the API key is absent or any exception occurs;src/assessment_service.py.This means callers that import the legacy helper can receive fallback output without the
llm/deterministic_fallbackprovenance contract and with stronger raw fallback wording than the supported service path.Preferred fix
Replace the implementation with a deprecated compatibility wrapper:
The local import avoids the circular import created by
assessment_serviceimporting low-level helpers fromsrc.phases.Alternatively, remove the helper after confirming there are no external compatibility requirements.
Acceptance criteria
assessment_service;src.engine.run_assessment()as the supported application entry point.