core/teaching
Shay 72fac59029
feat(ADR-0161.3): submission-time invariants — duplicate + dependent_on_pending auto-reject (#313)
Adds two pre-gate checks to propose_from_candidate that fire after the
Step 2 capacity check and before the replay gate.  No log entry is
written on either refusal — the append-only invariant holds.

Check order at function entry (ADR-0161 §3):
  1. Capacity (Step 2)          → RefusedAtCapacity
  2. Duplicate                  → RefusedAsDuplicate
  3. Dependent_on_pending       → RefusedAsDependent
  4. Replay gate                → auto-reject on regression

New frozen dataclasses:

  @dataclass(frozen=True, slots=True)
  class RefusedAsDuplicate:
      proposal_id: str
      existing_state: str        # covers all states: pending/accepted/rejected/withdrawn
      reason: str = "duplicate"

  @dataclass(frozen=True, slots=True)
  class RefusedAsDependent:
      candidate_id: str
      dependent_on: tuple[str, ...]       # pending proposal_ids that block
      overlapping_lemmas: tuple[str, ...] # normalised lemmas that triggered
      reason: str = "dependent_on_pending"

Lemma-overlap rule: case-insensitive exact-match on strip().lower().
Conservative — over-reject rather than admit-with-hidden-dependency.
False positives are recoverable (re-emit after blocker is ratified);
false negatives silently couple ratification choices.

CLI surfaces both outcomes in cmd_teaching_propose and
cmd_teaching_propose_from_exemplars (exit code 1).

Step 2 backpressure tests updated: made pre-populated candidates use
unique objects to avoid triggering the new dependency check, and
updated idempotency assertions to reflect the new RefusedAsDuplicate
return for re-submitted content.

Co-references: ADR-0161 §3, Step 1 PR #296, Step 2 PR #311,
ADR-0057, ADR-0151.
2026-05-26 16:46:25 -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
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 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
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(W-008): L10 Shape B hybrid engine-state persistence (#271) 2026-05-25 11:45:54 -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
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
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 feat(ADR-0161.3): submission-time invariants — duplicate + dependent_on_pending auto-reject (#313) 2026-05-26 16:46:25 -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 feat(adr-0057): operator supersede CLI — retire active chain by appended replacement 2026-05-18 10:35:49 -07:00