From 4c0fa307853bcc00a84dceb77bf761abcbee6540 Mon Sep 17 00:00:00 2001 From: Shay Date: Wed, 3 Jun 2026 01:01:50 -0700 Subject: [PATCH] fix(ADR-0136.S.3): expose both consumed tokens to completeness guard MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit _init_mutation_candidates collapses the initial (n_raw) and mutation (m_raw) source tokens into one derived initial value but only surfaced n_raw via matched_value_token. The ADR-0191 completeness guard (uncovered_quantities) then saw m_raw as unconsumed and over-refused sound compound initial-mutation readings ('had 20 ... lost 8' -> 12). Expose both via consumed_value_tokens, matching the documented aggregating-initial contract (_candidate_consumed_tokens) and sibling composers. Restores S3 lane to 24/24 wrong=0; serving metric unchanged (6/0/44 before and after — verified by stash compare). --- generate/math_candidate_parser.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/generate/math_candidate_parser.py b/generate/math_candidate_parser.py index c46cf4a3..e67f78b2 100644 --- a/generate/math_candidate_parser.py +++ b/generate/math_candidate_parser.py @@ -1911,6 +1911,12 @@ def _init_mutation_candidates(sentence: str) -> list[CandidateInitial]: matched_value_token=n_raw, matched_unit_token=unit_raw, matched_entity_token=m.group("entity"), + # ADR-0136.S.3 collapses BOTH source tokens (initial n_raw and + # mutation m_raw) into one derived initial value. Expose both so + # the ADR-0191 completeness guard (uncovered_quantities) sees the + # mutation quantity as consumed; otherwise it false-positives on + # m_raw and over-refuses a sound reading. See _candidate_consumed_tokens. + consumed_value_tokens=(n_raw, m_raw), ) ] except Exception: