core/generate
Shay f008550d79
feat(adr-0182): anchor-skip + intra-clause accumulation — distractor 0016 refuses, twin 0017 solves (confuser wrong 1→0) (#481)
* feat(adr-0182): anchor-skip + intra-clause accumulation — distractor 0016 refuses, twin 0017 solves (confuser wrong 1->0)

The last confuser wrong. 0016 ("A train travels 60 miles per hour for 2 hours. Tom
has 8 tickets and buys 4 more tickets. How many tickets?") committed the blunt
product 60x2x8x4=3840 because it was the unique complete reading: the train sentence
is an all-foreign anchor-position block (2 quantities, can't seed an anchor) and the
Tom sentence packs state+change in ONE sentence ("has 8 ... and buys 4 more"), which
the sentence-level reader couldn't decompose -> accumulation_candidates was empty ->
no rival reading -> product committed.

The microscope confirmed intra-clause state+change is a REAL GSM8K pattern (train-0010
"Yun had 20 paperclips initially, but then lost 12"; practice-0121 "Sam has 30 apples
and gives 10 to Anna") -- so this is genuine comprehension, not a 0016-only patch.

Mechanism (added to accumulation_candidates ONLY -> feeds only the pool; train_sample
serving + practice use compose_accumulation, unchanged -> 3/47/0 byte-identical by
construction):
- _sub_clauses: sentence clauses further split on coordinating conjunctions
  (and / then / and then). LOCAL to the ungated candidate generator -- the global
  segmenter (GB-1/GB-2/serving) is untouched.
- _build_accumulation_anchor_skip: anchor = first single-quantity sub-clause (leading
  non-anchorable all-foreign blocks are skipped); chain the conjunction-mate change
  ("buys 4 more" -> +4). Referent guard + polarity-cue requirement still gate it
  (a no-cue sub-clause -> refuse), so GB-2 same-unit lists ("6 apples and 4 apples")
  produce no spurious candidate.

Result (sealed lane):
- confuser wrong 1 -> 0. distractor-quantity 0 wrong / 2 refused: 0016 refuses
  (product 3840 [complete] vs additive 12 [exempt] disagree). BONUS: the clean twin
  0017 ("Tom has 8 tickets and buys 4 more tickets", no distractor) now *solves* 12
  -- genuine comprehension of a real positive, the comprehension-vs-surface-match
  discrimination the corpus exists to measure. genuine positives 7 -> 8 solved.
- the only non-clean verdict left is 1 spurious (0010 multi-referent "altogether" --
  a separate H1 graduation question, not this lever).
- train_sample 3/47/0 and practice 3/47/0 byte-identical; 243 derivation/pool tests
  + 40 architectural invariants green.

Tests:
- test_adr_0182_pool.py TestAnchorSkipIntraClause: intra-clause twin resolves to 12;
  the 0016 anchor-skip candidate classifies `exempt`; 0016 refuses via disagreement;
  no spurious extra candidate without a conjunction.
- test_adr_0163_f2_confusers.py: baseline wrong 1->0, positives_solved 7->8; renamed
  test_distractor_quantity_refuses asserts BOTH 0014 and 0016; new
  test_intra_clause_twin_0017_solves.

Stacked on #480 (prior-state guard); merge #480 first. Confuser arc wrong 7->5->2->1->0.

* test(adr-0182): close anchor-skip refuse-branch coverage gap (lookback finding)

The four-PR lookback review (EX-6/pooling/prior-state/anchor-skip) found the
anchor-skip refuse branches in _build_accumulation_anchor_skip untested: the
referent guard (new named actor -> refuse) and the polarity-cue requirement were
asserted but not proven (no test would fail if removed). Per the schema-obligation
discipline, add NON-VACUOUS failing-under-violation tests:

- test_anchor_skip_referent_guard_discriminates_actor: identical structure, change
  sub-clause subject is a pronoun ('he', same referent -> 12 IS produced) vs a new
  name ('Sara' -> guard suppresses it). Removing _same_referent makes the new-actor
  case also produce 12 -> the second assertion fails. (Non-vacuous: the positive
  control proves the path is reachable, so the negative isn't trivially-empty.)
- test_anchor_skip_requires_a_polarity_cue: 'gets 4 more' (cue -> 12) vs 'owns 4'
  (no cue -> not guessed). Removing the polarity gate makes the no-cue case produce
  a reading -> fails.
- test_anchor_skip_refuses_without_single_quantity_anchor: no single-quantity
  sub-clause -> () (does not force a multi-quantity clause to anchor).

No code change; behavior unchanged. Confuser wrong stays 0; 281 derivation tests +
40 invariants green.
2026-05-29 15:05:31 -07:00
..
binding_graph feat(binding-graph): Phase 4 question-target binding (ADR-0135) (#179) 2026-05-23 11:24:49 -07:00
comprehension feat(adr-0174-phase5a): retire inert GSM8K scoring-path reader 2026-05-28 13:38:44 -07:00
cue_precision feat(adr-0177-cp2a): cue-precision ledger training + measurement (+ unit hygiene) (#461) 2026-05-29 10:21:58 -07:00
derivation feat(adr-0182): anchor-skip + intra-clause accumulation — distractor 0016 refuses, twin 0017 solves (confuser wrong 1→0) (#481) 2026-05-29 15:05:31 -07:00
__init__.py chore(generate): delete unreachable agenerate (#90) 2026-05-20 19:59:28 -07:00
admissibility.py feat(adr-0026): Phase 3 — ranked admissibility with margin 2026-05-17 15:03:03 -07:00
articulation.py
articulation_legality.py feat(realizer): C1.5 — articulation legality at the realizer boundary 2026-05-20 11:11:28 -07:00
attention.py
bridge_trace.py Phase 1 — bridge trace instrumentation (observation-only) 2026-05-18 18:04:57 -07:00
dialogue.py
discourse_planner.py feat(discourse): Phase 2 — reflective rendering pronominalizes focus subject 2026-05-21 10:16:12 -07:00
exhaustion.py fix(W-011/W-012): propagate recognition refusal + catch InnerLoopExhaustion (#258) 2026-05-24 20:46:46 -07:00
graph_constraint.py fix(adr-0046): make forward-graph-constraint branch mergeable 2026-05-18 05:57:46 -07:00
graph_planner.py perf(graph): PropositionGraph.topo_order — Kahn's O(N+E) instead of O(N×E) (#92) 2026-05-20 20:37:21 -07:00
grounding_accessors.py feat(grounding): structured GroundedFact accessors for discourse planner 2026-05-19 11:19:59 -07:00
intent.py fix(intent): route 'Actually X R Y' premises to CORRECTION (inference_closure) (#117) 2026-05-22 12:33:56 -07:00
intent_bridge.py Phase 2 — proposition-slot grounding for articulate_with_intent 2026-05-18 18:18:31 -07:00
intent_ratifier.py feat(recognition): ADR-0144 — EpistemicGraph carrier + pipeline integration (#227) 2026-05-24 13:39:01 -07:00
math_candidate_graph.py feat(adr-0174-phase5a): retire inert GSM8K scoring-path reader 2026-05-28 13:38:44 -07:00
math_candidate_parser.py feat(RAT-1): close ratify→runtime gap + first live composition admission 2026-05-27 20:09:47 -07:00
math_parser.py chore(audit): substrate cleanup — dead spike, gitignore, deprecation, reader diagnosis 2026-05-28 07:00:33 -07:00
math_problem_graph.py fix(math-graph): refuse contradictory initial possessions (wrong=0 hazard) 2026-05-28 09:51:14 -07:00
math_realizer.py feat(realizer): ADR-0123 comparison-phrasing surface (closes substrate) 2026-05-23 02:03:49 -07:00
math_roundtrip.py feat(adr-0179-ex2): bare-decimal grounding in the shared round-trip primitive 2026-05-28 17:43:12 -07:00
math_solver.py feat(parser): ADR-0123 comparison-phrasing substrate (substrate-only; lift deferred) 2026-05-23 01:56:28 -07:00
math_symbolic_equivalence.py feat(ADR-0131.1.B): harden symbolic equivalence lane with generated corpus + exact algebra (#169) 2026-05-23 10:47:57 -07:00
math_symbolic_normalizer.py feat(ADR-0131.1.B): harden symbolic equivalence lane with generated corpus + exact algebra (#169) 2026-05-23 10:47:57 -07:00
math_verifier.py feat(parser): ADR-0123 comparison-phrasing substrate (substrate-only; lift deferred) 2026-05-23 01:56:28 -07:00
morphology.py
ood_surface_generator.py fix(quarantine): drain all 60 quarantined tests — QUARANTINE=∅ (#267) 2026-05-25 11:22:12 -07:00
operators.py
perturbation_suite.py feat: add ADR-0125 perturbation suite 2026-05-22 17:12:33 -07:00
proposition.py
realizer.py [codex] Implement energy-modulated vault surface (#269) 2026-05-25 11:33:32 -07:00
realizer_guard.py feat(coherence): ADR-0075 — realizer slot-type guard (C1) 2026-05-19 22:35:09 -07:00
recognizer_anchor_inject.py feat(wave-a): first non-DCS injector — multiplicative_aggregation w/ value extraction 2026-05-27 20:50:04 -07:00
recognizer_match.py feat(adr-0174-phase3b): compound-clause held hypotheses 2026-05-28 11:49:57 -07:00
recognizer_registry.py feat(ADR-0163.D): wire ratified RecognizerSpecs into math_candidate_graph admissibility surface (#302) 2026-05-26 13:11:47 -07:00
result.py
rotor_admissibility.py feat(adr-0025): Phase 4 — rotor / frame admissibility at the seam 2026-05-17 15:16:32 -07:00
salience.py
semantic_templates.py
stream.py chore(generate): make stop-tokens caller-overridable via RuntimeConfig (#87) 2026-05-20 19:59:33 -07:00
surface.py feat(surface): ADR-0031 — score-decomposition surface (per-axis hedges) 2026-05-17 20:16:22 -07:00
templates.py feat(realizer): C1.5 — articulation legality at the realizer boundary 2026-05-20 11:11:28 -07:00