core/teaching
Shay 36f3dbfc4e fix(D): address Sourcery review findings on PR #410
Three review fixes:

1. Security: validate lane/split/version against ^[a-z0-9_]+$ before
   building the runner module name. The runner_args list is passed to
   subprocess.run without shell=True (no shell injection possible),
   but defense-in-depth blocks arbitrary token characters from
   reaching Python's -m module loader. Bad input now errors at the
   CLI boundary with a clear message.

2. Bug-risk: _classify_refusal docstring referenced a
   no_admissible_candidate bucket that the implementation never
   emitted. Aligned docstring with actual buckets
   (no_admissible_question / no_admissible_statement). Also made all
   matching consistently case-insensitive (was mixed — some checks
   used raw reason, one used .lower()).

3. Bug-risk: fetch_committed_baseline wrote to
   .git/coverage_baseline_tmp.json. Replaced with tempfile.mkstemp in
   the system temp dir — avoids (a) failures in non-git worktrees
   where .git is a file pointer, (b) concurrent-access collisions
   between simultaneous operators.

Tests (+3 new):
- test_classify_refusal_is_case_insensitive
- test_classify_docstring_matches_implementation_buckets
- test_fetch_committed_baseline_uses_system_temp

All 16 coverage tests green. Verified the validation:
  core teaching coverage --lane 'evil; rm -rf /'
  → ERROR: lane='evil; rm -rf /' must match ^[a-z0-9_]+$
2026-05-27 21:20:01 -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 feat(wave-a): first non-DCS injector — multiplicative_aggregation w/ value extraction 2026-05-27 20:50:04 -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
__init__.py chore(teaching): MetricSet dataclass (ADR-0142 debt #3) (#231) 2026-05-24 15:15:02 -07:00
audit.py
contemplation.py fix(ADR-0167): route contemplation and proposal replay by candidate domain (#363) 2026-05-27 09:43:16 -07:00
correction.py
coverage.py fix(D): address Sourcery review findings on PR #410 2026-05-27 21:20:01 -07:00
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
epistemic.py
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
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(RAT-1): close ratify→runtime gap + first live composition admission 2026-05-27 20:09:47 -07:00
math_contemplation.py feat(brief-B): enrich composition_reclassification payload to be directly ratifiable 2026-05-27 20:46:10 -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(RAT-1): close ratify→runtime gap + first live composition admission 2026-05-27 20:09:47 -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
proposals.py fix(ADR-0167): route contemplation and proposal replay by candidate domain (#363) 2026-05-27 09:43:16 -07:00
provenance.py
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
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
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