floop: typed ROUTE attendant (closed enum) via dspy structured output #12

Merged
onibot merged 1 commits from feature/typed-route into main 2026-10-22 15:03:55 +02:00
1 Commits
Author SHA1 Message Date
onibot c3d1b5d6d3 floop: typed ROUTE attendant (closed enum) via dspy structured output
ROUTE migrates to the typed-output law: the attendant is a closed enum
rendered into the prompt's JSON schema — an invalid pick is impossible
by contract (AdapterParseError after dspy's own re-ask).

- Attendant(str, Enum): knowledge logic analytic numeric floop user
  (str mixin keeps the machine's == and `in EXPERT_ENGINES` intact)
- The per-field desc now carries the routing guidance (what each
  attendant is FOR) — replacing the 'one of: ...' list in the old
  string contract
- The machine's invalid-attendant branch stays as a contract guard
- New tests/typed_route.py: enum parses through the real adapter path
  (RawEngine + cache=False), out-of-set attendant raises, str
  compatibility holds

VERIFIED: suite 13/13 green; wire test with real glm-5.3-flash routes
all three probes correctly (knowledge / numeric / knowledge).
2026-10-22 15:03:48 +02:00