ADR-003: LLM rationale fallback¶
Status: Accepted Source: prd.md §19
Context¶
The LLM call that produces the recommendation rationale (rationale_text) may fail or exceed the latency budget mid-demo. A blank rationale tile is unacceptable — the executive sees a rationale field on every recommendation and an empty value reads as broken software.
Decision¶
If rationale_text is empty after a 2s timeout, generate from a deterministic template:
The template draws on the deterministic scorer (ADR-002 / PRD §10.x), which always has reason codes available because they're computed before the LLM call.
Consequences¶
- The rationale tile is always populated. Sub-2s latency from the templated path keeps the demo flow tight.
- The templated string is visibly less polished than a real LLM rationale — acceptable degradation for a demo failure path.
- This ADR is not the same shape as ADR-008's widget Clarifier discipline. The decision-rationale path uses a deterministic templated fallback as a feature; the widget Clarifier in
livemode raises an explicit error rather than silently producing a mock spec. The two paths have different UX requirements.
Cross-references¶
- ADR-002 — the LLM provider this fallback hangs off.
- ADR-008 — different fallback discipline for the widget Clarifier.
- Implementation: backend/app/decisions.py.