Extend the comprehension reader from question-only scope to whole- problem scope. Phase 1 (Brief 8 / #326) implemented question_frame; this brief implements initial_state_frame, operation_frame, and descriptive_frame, plus finalize() projection into a strict ADR-0115 MathProblemGraph. Architecturally correct under ADR-0164.3; not yet productive on GSM8K train_sample. Below-floor measurement documented; specific bottlenecks tabled for Phase 2.1 follow-up. What landed - Frame-opener dispatch in lifecycle.py for the three new statement frames, plus rule handlers (_rule_op_*, _rule_preframe_*, _rule_descriptive_*). - finalize(state) -> MathProblemGraph | ReaderRefusal: pure projection with closure checks (entity registry non-empty, unknown target bound, every op/initial references a known entity, Decimal precision projects losslessly). - _classify extended to 3-tuple (category, surface, decimal_value) with possessive strip retry. Brief 8.2's sentence-initial lookup-first + gender-skip preserved AND extended to mid-sentence (gender is enrichment everywhere, never admission). - Whole-problem coexistence dispatch in math_candidate_graph.py (config.comprehension_reader_questions=True): reader attempts the whole problem; on any ReaderRefusal falls through to existing regex parser. All-or-nothing per the brief. - Lexicon expansion (carried into renamed proper_noun_gender_* files): +2 accumulation_verb (adopt, invest), +2 currency_unit_noun (dollar, cent), +6 capacity_verb (fill, lift, play, work, finish, drive), +5 female names (allison, brooke, jan, marion, sidney), +14 male names (bart, fernando, georgie, jake, jed, jeremie, jose, orlando, rex, rudolph, steve, troy, xavier, yun), +numerous count_unit_noun, drain_token, time_unit_noun. - ADR-0164.4-phase2-statement-frame-reader.md — the architectural rationale and acceptance contract. Measurement (reader_phase2_delta.json): flag-OFF: correct=3 refused=47 wrong=0 flag-ON: correct=3 refused=47 wrong=0 delta: 0/0/0 Below the brief's floor of correct >= 4. Architecture is sound — the reader admits cases as graphs when the structure resolves, refuses cleanly otherwise, preserves wrong=0 across both flag states. Bottleneck table (from per-case attribution): count refusal_class dominant cause ----- ---------------------- ------------------------------------ 18 incomplete_operation multi-quantity ops; no-quantity op 11 unknown_word "hundred", "presently", "one-hour", non-math verbs (compound numerics, lexicon gaps) 6 unexpected_category fraction / percentage literals; multi-subject sentences 6 unresolved_pronoun "them", "their", "his" with no compatible entity 5 unattached_quantity quantity never bound to a unit 1 no_question_target question parsed but slot never set Closing the gate to mixed-bounded [4, 24] is Phase 2.1 scope: extend composition rules for multi-quantity ops, add fraction/percentage primitives (per ADR-0164.1 amendment), expand lexicon for the remaining unknown_word cases, extend pronoun resolution. Invariants preserved - wrong = 0 in both flag states ✓ - flag-OFF byte-identical to today ✓ - determinism (50/50 identical runs) ✓ - Capability axes G1-G5, S1 unchanged ✓ - Reader tests: 19 (Phase 2) + 18 (Phase 1, post-update) + 53 (pack) + 76 (lexicon + primitives) = 166 specific to this change; all pass - core test --suite smoke -q: 67 passed Rebase note This PR was authored against an older base; rebased onto current main to incorporate #333 (Brief 8.2 universal proper_noun_token primitive) and #334 (ADR-0166 measurement discipline). The rebase required: - Lexicon files renamed proper_noun_entity_* -> proper_noun_gender_* (with the Phase 2 additions merged into the gender_* files) - Compiled lexicon.jsonl unchanged from #333's 207-entry state (Phase 2's per-category additions are runtime-visible via the source loader, not via the compiled file) - _classify reconciled with Brief 8.2's sentence-initial dispatch + Phase 2's 3-tuple decimal-value return - All dispatch tables and category checks updated to reference proper_noun_token (singular) instead of proper_noun_entity_{f,m} - Three Phase 1 test expectations updated to reflect Phase 2 behavior (proper noun at position 0 now opens statement pre-frame instead of refusing; pronoun resolution applies per ADR-0164.2) Per ADR-0166's three-question test, this PR is honest measurement: capability exists, at least one case admits, lane distinguishes presence from absence — which the bottleneck table demonstrates. Refs ADR-0164.3 §Phasing Phase 2, ADR-0164.1 amendment (Brief 8.2), ADR-0166 §"Mixed (notable but not blocking)" — except here, below floor. |
||
|---|---|---|
| .. | ||
| adversarial | ||
| baselines | ||
| dev | ||
| holdouts/v1 | ||
| public/v1 | ||
| scoring | ||
| train_sample | ||
| contract.md | ||
| README.md | ||
| runner.py | ||
| verify.py | ||
gsm8k_math — Curated Eval Split for the GSM8K Evaluation Lane
Status: ADR-0119.2. 200 cases authored.
Schema source of truth: generate/math_problem_graph.py (typed dataclasses).
Format: JSONL — one case per line.
Why this set is not drawn from GSM8K
The GSM8K eval lane (ADR-0119) treats the actual GSM8K corpus as a sealed holdout test set. To preserve that integrity, we author this dataset independently in the same style as GSM8K (grade-school word problems with integer answers and 1-8 reasoning steps) but using our own vocabulary and grammar, ensuring zero overlap with the sealed holdout.
The dataset measures the solver pipeline (parser → solver → verifier → realizer). A correctly-parsed and solved problem is one whose parser output matches the ground-truth graph byte-for-byte and solves to the expected answer and unit.
Case schema
Each line is one JSON object:
{
"id": "gma-NNN",
"problem": "<the natural-language word problem>",
"expected_answer": <integer>,
"expected_unit": "<unit string>",
"ground_truth_graph": {
"entities": ["<entity_1>", "<entity_2>", ...],
"initial_state": [
{"entity": "<entity>", "quantity": {"unit": "<unit>", "value": <number>}},
...
],
"operations": [
{"actor": "<entity>", "kind": "<add|subtract|transfer|multiply|divide>",
"operand": {"unit": "<unit>", "value": <number>},
"target": "<entity>" /* required when kind=transfer; omitted otherwise */},
...
],
"unknown": {"entity": "<entity>" | null, "unit": "<unit>"}
},
"patterns": ["<pattern_tag_1>", "<pattern_tag_2>", ...],
"notes": "<authoring rationale>"
}
Field rules
id—gma-NNNwhere:gma-001...gma-050are for thedevsplit.gma-101...gma-250are for thepublicsplit.
problem— one or more complete English sentences ending in a question. Use Title-Cased proper names for entities ("Sam", "Anna's Toy Box"). Be consistent: the same entity always spelled the same way inproblemandground_truth_graph.entities.expected_answer— the integer answer to the question.expected_unit— the unit string the answer is in. Must matchground_truth_graph.unknown.unitbyte-for-byte.ground_truth_graph.entities— tuple in order of first introduction in the problem text. Not alphabetical. No duplicates.ground_truth_graph.initial_state— every entity that starts the problem with a known quantity. Empty list is legal if no initial possessions are asserted (rare).ground_truth_graph.operations— in source-text order. Empty list is legal (e.g. multi-entity sum questions with no mutations).ground_truth_graph.unknown.entity— set to the entity the question asks about, ornullif the question asks for a total across all entities ("How many ... in total?"; "How many do they have altogether?").patterns— tag list naming the constructions used. See Pattern registry below.notes— author-supplied one-sentence rationale. Read by future reviewers when the parser fails this case.
Canonicalization rules
- Units — lowercase, plural form ("apples", "candies", "dollars", "hours"). Use "dollars" for "$" quantities; the parser is expected to rewrite the "$" surface to the canonical unit.
- Entities — preserve capitalization as written. Do not lowercase.
- Numbers — integers when the text shows integers.
- Operation kinds — exactly one of
add,subtract,transfer,multiply,divide. Choose the one closest to the verb in the text:- "buys / gets / receives / earns / finds / adds" →
add - "eats / loses / sells / spends / drops / uses / removes" →
subtract - "gives / sends / hands / passes / mails / transfers" →
transfer(and settarget) - "doubles / triples / Nx as many" →
multiply - "splits evenly into N / N% of / shares equally with N people" →
divide
- "buys / gets / receives / earns / finds / adds" →
Scope limits (ADR-0119.2)
The parser and solver handle the following patterns and no others. Cases violating these constraints are out of scope:
- NO Time-modal / conditional phrasing ("If Sam had 5 apples, ...") — out of scope. Use direct declarative phrasing only.
- NO Rate/per-unit pricing requiring inference ("Each apple costs $2. Sam buys 4. How much does he spend?") — out of scope. A simpler variant ("Sam spends $8 on apples. How much does he have left?") IS in scope.
- NO Multi-clause / compound-question problems ("How many does Sam have, and how many does Tom have?") — out of scope. One unknown per case.
- NO Implicit-entity / generic plural ("There are 5 boys. Each has 2 apples.") — out of scope. Use named entities.
- NO Comparative phrasing without explicit numbers ("Sam has twice as many as Tom") — out of scope. Use numeric multipliers only ("Sam has 2 times 3 apples").
- NO metaphor or mixed units within one entity — out of scope. Keep units consistent.
- NO numeric magnitude beyond integer scope — out of scope. Only use integers.
Pattern registry
When tagging a case under patterns, draw from this list.
| Pattern tag | Construction | Example |
|---|---|---|
initial_has |
" has ." | "Sam has 5 apples." |
initial_there_are |
"There are ." (no entity; rare) | "There are 12 candies on the table." |
operation_buy_more |
" buys more." | "He buys 3 more." |
operation_get_more |
" gets more ." | "She gets 4 more pencils." |
operation_find_adds |
" finds ." | "Sam finds 2 apples on the path." |
operation_eat_loses |
" eats ." | "Tom eats 4 candies." |
operation_lose_loses |
" loses ." | "Anna loses 3 marbles." |
operation_sell_loses |
" sells ." | "Lisa sells 2 books." |
operation_donate_loses |
" donates ." | "Lisa donates 3 books." |
operation_use_loses |
" uses ." | "He uses 2 sheets of paper." |
operation_give_transfer |
" gives to ." | "Anna gives 3 marbles to Ben." |
operation_send_transfer |
" sends to ." | "Tom sends 4 letters to Sara." |
operation_double |
" doubles ..." | "Sam doubles his savings." |
operation_triple |
" triples ..." | "Sam triples his stickers." |
operation_split_divide |
"splits/shares evenly" | "They split 12 candies evenly." |
question_how_many_entity |
"How many does have?" | "How many apples does Sam have?" |
question_how_many_left |
"How many ... left?" | "How many candies does Tom have left?" |
question_how_many_total |
"How many ... in total?" / "altogether" | "How many stickers do they have in total?" |
question_how_many_now |
"How many ... now?" | "How many marbles does Anna have now?" |