#!/usr/bin/env python3
# edge_app/letter_logits.py
from typing import List, Sequence, Any

LETTERS: Sequence[str] = ("A", "B", "C", "D")

def get_letter_logits(engine: Any, messages) -> List[float]:
    """
    Returns raw logits [A,B,C,D] for the NEXT token given `messages`.
    Requires engine to expose `logits_for_choices(messages, choices)`.
    """
    if hasattr(engine, "logits_for_choices"):
        return list(engine.logits_for_choices(messages, LETTERS))
    # If you reach here, wire your engine (see flowtorch_engine.py patch below).
    raise RuntimeError(
        "FlowTorch engine does not expose logits_for_choices(). "
        "Implement engine.logits_for_choices(messages, choices=('A','B','C','D')) "
        "so bias steering can add φ₀ bias to logits."
    )
