Closes 5 of 8 surface-form gaps Gemini identified in Task 5 on the
99 comparison-bearing sentences my ADR-0123 substrate currently refuses
in the sealed holdout. Pure regex / parser-state work — no graph,
solver, verifier, or pack changes; preserves wrong==0 discipline.
Expansions (in safety order)
- Group 8 (verb): comparison verbs widened from {has} to {has, have,
had, gets, get, got, takes, take, took, buys, buy, bought}.
"lost"/"won" excluded — they semantically invert direction.
- Group 3 (word-form numbers): _WORD_NUMBERS {one..twelve} accepted
wherever digit values are. _parse_compare_number helper centralizes
the dispatch.
- Group 4 (ellipsis / implicit unit): unit slot made optional in
multiplicative patterns (solver already infers unit from reference
state); added "twice|N times as much", "twice|N times the
number/amount of <unit>" variants.
- Group 1 (subjects / references): actor/reference slots widened from
bare proper noun to {proper noun, "the <noun>" collective,
pronoun}. Pronouns resolve via state.last_singular_subject; missing
prior subject raises ParseError (no silent emission with empty
actor). New _resolve_compare_entity helper canonicalizes "The boys"
/ "the boys" to the same entity string.
- Initial-possession + question patterns widened symmetrically so
"the X" subjects round-trip end-to-end:
- _INITIAL_HAS_RE accepts "the <noun>" subject + has/have +
digit-or-word value
- _Q_ENTITY_RE accepts "the <noun>" entity + do/does auxiliary
- _Q_TOTAL_RE now tried first (specificity-ordered) so "do they
have" doesn't get greedily matched as entity="they"
Deferred (per Gemini Task 5c recommendation)
- Group 2 (age): needs new "years_old" attribute model
- Group 5 (nested): needs compound y = mx + c solver operation
- Group 7 (currency): low volume (2 cases), defer
- Group 6 (compound multi-clause "and" split): scoped out of this
PR to keep the wrong==0 risk profile tight; safer to land after
Gemini Task 6 confirms current expansion doesn't introduce
misparses on the sealed set
Test coverage
- 507 existing math + ADR-0122 + ADR-0123 tests pass (no regressions)
- 16 ad-hoc smoke cases pass (3 baseline + 3 Group 8 + 3 Group 3 +
3 Group 4 + 3 Group 1 + 2 refusal guards + 1 rate cross-check)
- smoke suite 67/67, algebra suite 82/82 green
Expected sealed lift
- Gemini Task 5 catalog projected ~65/90 strict-comparison-only
cases unblocked by the 5 included groups (71/99 comparison-bearing
sentences). Empirical sealed measurement pending Gemini Task 6;
PR will be updated with the actual correct/wrong/refused bucket
counts once measured.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>