core/teaching
Shay 44c0aa2896
feat(ADR-0169/CC-2+CC-3): CompositionClaim ratification handler + decomposer heuristic tightening (#393)
PR-β of the CompositionClaim wave (CC-2 + CC-3 bundled per the brief
pack — CC-3's heuristic depends on CC-2's new change_kind Literal value).
Mirrors the F1 / ADR-0168 FrameClaim template 1:1 with composition-specific
substitutions.

CC-2 — handler implementation
  - teaching/math_composition_proposal.py — MathCompositionClaimProposal
    adapter per ADR-0169.1 §"Data shape". Frozen dataclass, deterministic
    proposal_id / claim_signature, source="math_audit" pin at the
    proposal layer (rejects "corpus" laundering).
  - teaching/math_composition_ratification.py — apply_composition_claim()
    handler. SAFE_COMPOSITION_CATEGORIES = {multiplicative,
    additive, subtractive}_composition per ADR-0169 §"Initial safe
    category scope". New WrongCompositionCategory exception per
    ADR-0169.1 §"Trip-wires" #8. Writes only to
    language_packs/data/en_core_math_v1/compositions/{category}.jsonl;
    no solver / parser / decomposer / runtime mutation.
  - workbench/readers.py — _HANDLER_DISPATCH now routes
    composition_reclassification → CompositionClaim; suggested_cli
    branch added for both read_math_proposal and ratify_math_proposal.
  - teaching/math_contemplation_proposal.py — ChangeKind Literal +
    _VALID_CHANGE_KINDS frozenset extended with
    composition_reclassification.
  - language_packs/data/en_core_math_v1/compositions/.gitkeep —
    reviewed-pack scaffold.
  - tests/test_math_composition_ratification.py — 22 tests including
    case 0050 hazard pin, cross-process replay equivalence, queue-order
    independence, partition, no-corpus-laundering, dispatch wire,
    Literal acceptance, JSONL round-trip.
  - tests/test_adr_0172_w1_shape_proposal.py — parametrize round-trip
    over all 5 change_kinds.
  - core/cli.py — teaching suite tuple includes new test file.

CC-3 — decomposer heuristic tightening
  - teaching/math_contemplation.py::_CHANGE_KIND_BY_PAIR:
    + (incomplete_operation, quantity_extraction)         → composition_reclassification
    + (incomplete_operation, multi_quantity_composition)  → composition_reclassification
    - (unexpected_category, multi_subject_sentence)       demoted to injector_sub_shape
      (was frame_reclassification; FrameClaim SAFE_FRAME_CATEGORIES doesn't
       cover this — needs ReferenceClaim/CompositionClaim)
    - (unexpected_category, descriptive_frame_question)   demoted to injector_sub_shape
      (was frame_reclassification; needs SlotClaim, not FrameClaim)
    Updated hypothesis-step justification text to reflect new dispatch
    table.
  - tests/test_adr_0172_w2_decomposer.py — distribution assertion
    tightened from "≥3 matcher, ≥2 frame" to exact counts:
    3 matcher / 2 composition / 3 injector / 0 frame. New
    per-pair tests for the four CC-3 dispatch changes.

Verification on real audit_brief_11.json (20 of 47 highest-leverage
refusals now routable):

  2  composition_reclassification   (12 quantity_extraction + 8 multi_quantity_composition)
  3  injector_sub_shape             (2 multi_subject + 2 descriptive_frame + 4 unattached_quantity)
  3  matcher_extension              (9 pre_frame_filler + 4 fraction_percentage + 4 pronoun)
  0  frame_reclassification         (the two prior misroutes are gone)

Workbench POST /math-proposals/{id}/ratify on either composition
proposal now returns 200/routed with a real apply_composition_claim()
command instead of 501.

Suites green:
  - core test --suite teaching -q  → 71 passed
  - core test --suite runtime -q   → 20 passed

Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-27 15:15:11 -07:00
..
admissibility_exemplars feat(ADR-0163.B.2): four new exemplar corpora — discrete_count_statement, multiplicative_aggregation, currency_amount, plus temporal_aggregation v2 widening (#306) 2026-05-26 14:36:59 -07:00
cognition_chains chore(ratify): accept four Phase C round-2 recognizers (round 2) (#309) 2026-05-26 16:03:01 -07:00
cross_pack_chains feat(adr-0067): cross-pack teaching chains — Plan Phase 4 closed 2026-05-18 17:22:43 -07:00
domain_chains Add chain-first capability ledger and domain seeds (#97) 2026-05-20 21:33:24 -07:00
math_corpora feat(ADR-0131.2.B): B2 teaching-corpus enrichment — load-bearing gate (#177) 2026-05-23 11:29:48 -07:00
math_proposals feat(ADR-0172/W3): core eval math-contemplation CLI lane (#384) 2026-05-27 12:58:31 -07:00
proposals chore(ratify): accept four Phase C round-2 recognizers (round 2) (#309) 2026-05-26 16:03:01 -07:00
relations_chains content(en_core_relations_v1): +14 kinship/social lemmas + +14 chains, cognition eval byte-identical, ratify-idempotent (#211) 2026-05-23 22:47:53 -07:00
relations_chains_v2 feat(packs): en_core_relations_v2 — pronouns + role-fillers (Phase 2.4) 2026-05-18 16:42:02 -07:00
__init__.py chore(teaching): MetricSet dataclass (ADR-0142 debt #3) (#231) 2026-05-24 15:15:02 -07:00
audit.py feat(adr-0057): operator supersession history view — closes the supersede loop 2026-05-18 10:40:38 -07:00
contemplation.py fix(ADR-0167): route contemplation and proposal replay by candidate domain (#363) 2026-05-27 09:43:16 -07:00
correction.py
cross_pack_supersede.py feat(phase5+bench): cross-pack supersede + articulation benchmark suite 2026-05-18 17:44:59 -07:00
discovery.py feat(ADR-0167/W2-C): domain discriminator + cross-domain audit (#351) 2026-05-27 06:44:29 -07:00
discovery_sink.py feat(adr-0055): Phase B — DiscoveryCandidate emission from turn loop 2026-05-18 08:26:04 -07:00
epistemic.py feat(adr-0021): epistemic_status surface wired across teaching + trace 2026-05-16 20:20:35 -07:00
exemplar_ingest.py feat(ADR-0163.C.2): extend exemplar ingest + synthesis + matchers for round-2 categories (#307) 2026-05-26 15:08:41 -07:00
from_curriculum.py feat(teaching): ADR-0104 — curriculum-sourced teaching proposals (#107) 2026-05-22 10:05:14 -07:00
from_miner.py feat(teaching): implement ADR-0095 — Miner-Sourced Teaching Proposals 2026-05-21 18:18:51 -07:00
gaps.py feat(teaching): discovery gaps aggregator + auto-promotion queue (Phase 1.1+1.2) 2026-05-18 16:04:39 -07:00
math_claim_signature.py feat(ADR-0167/W2-B): lexical claim signature + dedup (#353) 2026-05-27 06:56:36 -07:00
math_composition_proposal.py feat(ADR-0169/CC-2+CC-3): CompositionClaim ratification handler + decomposer heuristic tightening (#393) 2026-05-27 15:15:11 -07:00
math_composition_ratification.py feat(ADR-0169/CC-2+CC-3): CompositionClaim ratification handler + decomposer heuristic tightening (#393) 2026-05-27 15:15:11 -07:00
math_contemplation.py feat(ADR-0169/CC-2+CC-3): CompositionClaim ratification handler + decomposer heuristic tightening (#393) 2026-05-27 15:15:11 -07:00
math_contemplation_proposal.py feat(ADR-0169/CC-2+CC-3): CompositionClaim ratification handler + decomposer heuristic tightening (#393) 2026-05-27 15:15:11 -07:00
math_evidence.py feat(ADR-0167/W1-A): MathReaderRefusalEvidence schema + canonical-bytes (#350) 2026-05-27 06:30:21 -07:00
math_frame_proposal.py feat(ADR-0168/F1): FrameClaim ratification handler (Tier 1.5) (#389) 2026-05-27 14:10:43 -07:00
math_frame_ratification.py feat(ADR-0168/F1): FrameClaim ratification handler (Tier 1.5) (#389) 2026-05-27 14:10:43 -07:00
math_inference_proposal.py feat(ADR-0172/W5): MathReaderInferenceProposal schema (Tier 2) (#388) 2026-05-27 14:01:50 -07:00
math_lexical_ratification.py feat(ADR-0167/W2-D): lexical ratification handler (#354) 2026-05-27 06:57:37 -07:00
math_reasoning_trace.py feat(teaching/W0): ReasoningTrace substrate for ADR-0172 Tier 1 (#379) 2026-05-27 12:21:59 -07:00
metric_set.py chore(teaching): MetricSet dataclass (ADR-0142 debt #3) (#231) 2026-05-24 15:15:02 -07:00
migrate_proposals_source_field.py feat(teaching): implement ADR-0094 — Proposal Source Provenance 2026-05-21 18:11:09 -07:00
oov_gaps.py feat(teaching): OOV signal flywheel — sink, aggregator, auto-promotion (Phase 2.3) 2026-05-18 16:42:26 -07:00
oov_promotion.py feat(teaching): OOV signal flywheel — sink, aggregator, auto-promotion (Phase 2.3) 2026-05-18 16:42:26 -07:00
oov_sink.py feat(teaching): OOV signal flywheel — sink, aggregator, auto-promotion (Phase 2.3) 2026-05-18 16:42:26 -07:00
promotion.py feat(teaching): discovery gaps aggregator + auto-promotion queue (Phase 1.1+1.2) 2026-05-18 16:04:39 -07:00
proposals.py fix(ADR-0167): route contemplation and proposal replay by candidate domain (#363) 2026-05-27 09:43:16 -07:00
provenance.py feat(adr-0055): Phase A — teaching corpus audit, supersession, typed provenance 2026-05-18 08:15:23 -07:00
queue.py feat(ADR-0161.2): HITL queue backpressure — pending-count cap + queue_full reports (#311) 2026-05-26 16:16:08 -07:00
recognizer_synthesis.py feat(ADR-0163.C.2): extend exemplar ingest + synthesis + matchers for round-2 categories (#307) 2026-05-26 15:08:41 -07:00
relation_parse.py feat(phase3): transitive_walk + path_recall operator bundle (ADR-0018) 2026-05-16 15:04:43 -07:00
replay.py feat(ADR-0163.C): contemplation ingests admissibility exemplars and emits DerivedRecognizer proposals through the HITL corridor (#301) 2026-05-26 12:26:56 -07:00
review.py fix(gaps): close G1+G2+G3 + identity vocab + pipeline safety-stub honour 2026-05-16 21:21:06 -07:00
source.py feat(ADR-0163.C): contemplation ingests admissibility exemplars and emits DerivedRecognizer proposals through the HITL corridor (#301) 2026-05-26 12:26:56 -07:00
store.py feat(teaching): implement ADR-0094 — Proposal Source Provenance 2026-05-21 18:11:09 -07:00
supersede.py feat(adr-0057): operator supersede CLI — retire active chain by appended replacement 2026-05-18 10:35:49 -07:00