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.
The change:
Subquestion(BaseModel): text + depends_on: list[int] + answer_type: AnswerType (enum rendered into the prompt's JSON schema)
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.
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.
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.
**The change:**
- `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.
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.
onibot
merged commit f953778f0a into main2026-10-22 15:02:21 +02:00
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
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.
The change:
Subquestion(BaseModel): text +depends_on: list[int]+answer_type: AnswerType(enum rendered into the prompt's JSON schema)InitSignature/MissingSignature.subquestions:list[Subquestion]init_decomposekeeps the (subs, raw) machine contract: a schema-violating response raisesAdapterParseErrorafter dspy's own JSON re-ask; itslm_responsebecomes the degrade signal so the run-I law survives typing — the machine still routes the ORIGINAL question, never garbage_subs_from_typed)parse_subquestionskept as LEGACY for testsTests 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:
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.