machine: robust INIT parsing + raw-response log (run I) #6

Merged
onibot merged 1 commits from feature/robust-init into main 2026-10-21 12:09:02 +02:00
Owner

Run I fixes — INIT answered "Who was the President before Pedro Sanchez?" with bare "1
2" because qwen wrote its own line numbers as an extra pipe field (1 | Who was... | none | OPEN), the parser took "1" as the text, and ROUTE classified "Q1: 1" as numeric. Four calls burned on garbage before luck produced the answer.

  1. Parser: shifts the numbered form (≥4 fields, bare number first) and drops bare-number texts — a routable question is text, never "1". Enumerator prefixes ("1.") stripped from the text field. Well-formed lines unchanged (regression-tested).

  2. INIT degrade: init_decompose → (subs, raw). Model wrote something but nothing parsed → route the original question as one OPEN subquestion. Empty raw keeps the old law: atomic question, stop and synthesize.

  3. Raw-response log (the ask behind the ask): prompts/NN-stage.txt now carries the exact LM response after the prompt. Run I's OUTPUT INIT: 1 2 couldn't show what qwen actually wrote — now it's in the file, and the next malformed answer is debuggable in seconds.

Suite 59/59 (7 new in tests/robust_init.py). Smoke: the exact run-I transcript replayed through the real machine — Q1/Q2 parse as real subquestions, answer Mariano Rajoy.

**Run I fixes** — INIT answered "Who was the President before Pedro Sanchez?" with bare "1 2" because qwen wrote its own line numbers as an extra pipe field (`1 | Who was... | none | OPEN`), the parser took "1" as the text, and ROUTE classified "Q1: 1" as numeric. Four calls burned on garbage before luck produced the answer. 1. **Parser**: shifts the numbered form (≥4 fields, bare number first) and drops bare-number texts — a routable question is text, never "1". Enumerator prefixes ("1.") stripped from the text field. Well-formed lines unchanged (regression-tested). 2. **INIT degrade**: `init_decompose` → `(subs, raw)`. Model wrote something but nothing parsed → route the **original question** as one OPEN subquestion. Empty raw keeps the old law: atomic question, stop and synthesize. 3. **Raw-response log** (the ask behind the ask): `prompts/NN-stage.txt` now carries the exact LM response **after** the prompt. Run I's `OUTPUT INIT: 1 2` couldn't show what qwen actually wrote — now it's in the file, and the next malformed answer is debuggable in seconds. Suite **59/59** (7 new in `tests/robust_init.py`). Smoke: the exact run-I transcript replayed through the real machine — Q1/Q2 parse as real subquestions, answer Mariano Rajoy.
onibot added 1 commit 2026-10-21 12:08:58 +02:00
Run I ('Who was the President before Pedro Sanchez?'): the INIT LM wrote
its own line numbers as an extra first pipe field ('1 | Who was... |
none | OPEN'), the naive parse took '1' as the subquestion text, ROUTE
classified Q1='1' as numeric, and the machine burned four calls on
garbage before luck produced the answer. Two of the fixes close the same
observability gap that hid the root cause for a day.

1. PARSER (parse_subquestions): shifts the numbered form (>=4 fields
   with a bare number first) and drops any text that is a bare number —
   a routable question is text, never '1'. Enumerator prefixes ('1.')
   inside the text field are stripped. Well-formed lines parse exactly
   as before (regression-tested).

2. INIT DEGRADE (machine): init_decompose now returns (subs, raw).
   Non-empty raw that parses to nothing = model garbage — degrade to
   the ORIGINAL question as one OPEN subquestion (routable, logged,
   budget-safe). Empty raw keeps the old law: the question is atomic,
   stop and synthesize — never fabricate a subquestion.

3. RAW RESPONSE LOG (the ask behind the ask): prompts/NN-stage.txt now
   carries the exact LM response after the prompt. Run I's parsed
   'OUTPUT INIT: 1\n2' could not show what the model actually wrote —
   the raw text is in the file from now on; the log stays line-based.

Tests: tests/robust_init.py — the numbered form, bare-number drop,
enumerator strip, happy-path regression, the degrade, the atomic stop,
raw-response capture. Suite 59/59. Smoke: the exact run-I transcript
replayed through the real machine (DummyLM) parses to Q1/Q2 real
subquestions and answers Mariano Rajoy.
onibot merged commit 4506b4067a into main 2026-10-21 12:09:02 +02:00
Sign in to join this conversation.
No Reviewers
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: onibot/floop#6