From 2da1a338395b804b39ad227b6aa08803420b747d Mon Sep 17 00:00:00 2001 From: Shay Date: Sat, 18 Jul 2026 21:44:34 -0700 Subject: [PATCH] fix(reader-arc): compound extractor refuses no-digit compare clauses (wrong=0 hazard) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The compound discrete-count extractor's all-or-nothing tail guard is digit- based, so a no-digit compare clause in a conjunctive list ('buys 4 lbs beans, 6 lbs milk, and twice the amount of carrots as beans') was silently DROPPED — injecting 4+6 and losing the carrots (a wrong=0 landmine, masked only by the case refusing elsewhere). The #78 substrate widens the compound extractor's verb reach, so harden it: refuse the whole compound on any ' the amount/number of' / 'twice/thrice/times/half the' / 'double/triple' surface. Verified: 0082 compound now refuses fail-closed; tune+measure wrong=0; PARSED unchanged (3/2); smoke 176 green. --- generate/recognizer_match.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/generate/recognizer_match.py b/generate/recognizer_match.py index 570106b5..1d506294 100644 --- a/generate/recognizer_match.py +++ b/generate/recognizer_match.py @@ -1129,6 +1129,14 @@ _COMPOUND_REFUSE_SUBSTRINGS: Final[tuple[str, ...]] = ( " half as ", " twice as ", " thrice ", "%", " percent", " half of ", " quarter of ", " third of ", + # ADR-0250 increment 1 — a compare clause using the " the + # amount/number of " surface carries NO digit, so the all-or-nothing + # tail-digit guard below cannot see it and would silently DROP it (e.g. + # "buys 4 lbs beans, 6 lbs milk, and twice the amount of carrots as beans" + # injected 4+6 and lost the carrots — a wrong=0 hazard). Refuse the whole + # compound when any such compare surface appears. + " twice the ", " thrice the ", " times the ", " half the ", + " the amount of ", " the number of ", " double ", " triple ", ) # Fraction literal pattern (matched against raw statement, not padded).