core/generate/derivation
Shay d5c79e87f4
docs(adr-0179-ex3): record second deferral trap — postmodifier adjectives (#460)
Track C of docs/handoff/PARALLEL-WORK-PLAN-2026-05-29.md asked for a tight
EX-3 multi-word-unit redo satisfying (a) "12 jumping jacks." -> "jumping
jacks", (b) "6 apples and 4 apples." -> two apples, (c) all GB-1/2/3 tests
green. The cleanest tight rule that satisfies all three —

    (?<![\w.])(\d+(?:\.\d+)?)\s+([a-z]+\s+[a-z]+)(?=\s*[.?!,]|\s*$)

— was implemented and passed the four pinned test files. Full-suite
verification then surfaced a second trap the audit at
docs/handoff/AUDIT-ADR-0179-EX-RECONCILE.md did not anticipate:

  postmodifier-adjective tails. "25 years old?" fires the tight rule and
  produces unit "years old" rather than "years", regressing
  test_adr_0176_ms1_question_target.py::TestQuestionQuantities::
  test_extracts_quantity_stated_in_question and the "X years old" pattern
  in tests/test_adr_0176_ms2_chain.py. The pattern is endemic in GSM8K
  (cases 0006 and 0033 both use "X years old"); closing it would need a
  second closed lexeme set ({old, tall, long, wide, deep, away, ago, ...})
  which the brief judged too open-ended to enumerate responsibly.

Per the brief's escape hatch ("If no rule satisfies all of (a)-(c) without
a grammar template, write a note and ship no code — a refusal is fine")
this commit:

* updates extract.py's module docstring to name BOTH known traps
  (connective-crossing AND postmodifier-adjective tails);
* adds tests/test_adr_0179_extract.py::TestEX3StillDeferred with two pins
  asserting the postmodifier-adjective shape stays at unit "years" alone,
  so no future redo silently re-introduces the regression;
* ships NO extractor code change — the regex remains exactly as on main.

Scope/safety:
* Files touched are within Track C's allowed set (extract.py + its test).
* Zero functional change: extract_quantities byte-identical to main.
* Serving lane untouched (chat/ does not import this module).
* Safe alongside GB-3b on compose.py / clauses.py.
2026-05-29 10:01:00 -07:00
..
__init__.py feat(adr-0178-gb2): sequential composition — same-unit list-sum-then-scale 2026-05-28 17:29:53 -07:00
clauses.py feat(adr-0178-gb1): clause segmentation + clause-local sub-derivation 2026-05-28 17:19:50 -07:00
comparatives.py feat(adr-0176-ms2): multi-step chain model — text + comparative operands 2026-05-28 16:35:41 -07:00
compose.py feat(adr-0178-gb3a): clause-scoped referent guard — refuse cross-clause aggregation (#456) 2026-05-29 09:15:52 -07:00
extract.py docs(adr-0179-ex3): record second deferral trap — postmodifier adjectives (#460) 2026-05-29 10:01:00 -07:00
model.py feat(adr-0176-ms2): multi-step chain model — text + comparative operands 2026-05-28 16:35:41 -07:00
multistep.py feat(adr-0176-ms3): target-guided bounded multi-step search 2026-05-28 16:51:43 -07:00
search.py
target.py feat(adr-0176-ms1): question-targeting 2026-05-28 16:21:40 -07:00
verify.py feat(adr-0176-ms2): multi-step chain model — text + comparative operands 2026-05-28 16:35:41 -07:00