Files
floop/code/tests
onibot c7bd010f47 floop: typed INIT+MISSING via dspy structured output (Subquestion)
The typed-output migration starts with the machine's decomposition step:
the pipe contract ('text | deps | answer_type' lines) is gone — dspy
renders the Subquestion schema natively.

- Subquestion(BaseModel): text + depends_on: list[int] +
  answer_type: AnswerType (enum rendered into the prompt's JSON schema)
- InitSignature/MissingSignature.subquestions: list[Subquestion]
- init_decompose keeps the (subs, raw) machine contract: a
  schema-violating response raises AdapterParseError after dspy's own
  JSON re-ask; its lm_response becomes the degrade signal so the
  run-I law survives typing — the machine still routes the ORIGINAL
  question, never garbage
- bare-number texts still dropped (now in _subs_from_typed)
- parse_subquestions kept as LEGACY for tests

Tests rewritten for the REAL adapter path (RawEngine + cache=False):
DummyLM bypasses the adapter; and dspy's disk cache (~/.dspy_cache)
cross-contaminates scripted tests sharing a fake model name — both
pitfalls found while migrating.

VERIFIED:
- suite 12/12 green (robust_init rewritten: 6/6 — E2E typed parse,
  bare-number drop, garbage degrade, machine degrade, atomic case,
  raw-response prompt log)
- live E2E (ollama-cloud glm-5.3-flash): INIT renders the enum schema,
  glm returns depends_on ints + valid enums, machine dicts clean,
  full run answers Rajoy with citations. NOTE: dspy's disk cache made
  the second run's INIT a 0.2s cache hit — runs share the cache.
2026-10-22 15:02:12 +02:00
..