core/tests
Shay 542e13d2f3 feat(adr-0025): Phase 4 — rotor / frame admissibility at the seam
Promote ADR-0025 from Draft (design note) to Accepted with the
architectural home decision reversed: rotor admissibility lives at
the same generation/propagation seam as ADR-0024's destination
check — in a sibling-but-separate module
`generate/rotor_admissibility.py` — NOT in `algebra/versor.py` or
`field/propagate.py`.

Algebra rejected because admissibility is a pack-semantic test, not
a closure invariant; placing it there couples algebra to pack state
and creates structural temptation toward grade-projection repair
(CLAUDE.md §Normalization Rules forbids). field/propagate rejected
as a forbidden normalization site even when framed as precondition
guard. The clean answer is generation-side, in its own file:
endpoint admissibility (token-side, blade) and rotor admissibility
(rotor-side, frame) compose at the same seam while remaining
conceptually separable.

New module generate/rotor_admissibility.py:
  RotorVerdict — admit/reject + score + region_label + reason
  check_rotor_admissibility(region, *, field_current, rotor)
    -> RotorVerdict
  Pure semantic check:
    F'    = versor_apply(V, F_current)
    score = cga_inner(F', region.frame_versor)
    admit iff score > 0   (basic positivity in frame half-space)
  No state mutation, no closure enforcement (algebra's job).
  region.frame_versor is None → trivial admit (back-compat).

RefusalReason extended:
  INNER_LOOP_EXHAUSTION — destination-side (ADR-0024 / ADR-0026)
  ROTOR_REJECTION       — rotor-side (this ADR)
The two reasons let the trace name the axis that ran out without a
parallel exception type. InnerLoopExhaustion(ValueError) hierarchy
unchanged; back-compat preserved.

Wiring in generate/stream.py:
  threshold mode  per-candidate rotor check after destination admit;
                  reject → log rotor score, retry next candidate;
                  exhaustion routes reason to ROTOR_REJECTION iff
                  any rotor rejection occurred in the step
  margin mode     rotor check on the top-ranked admissible candidate;
                  reject → immediate InnerLoopExhaustion(
                  reason=ROTOR_REJECTION) carrying the destination
                  ranking + the rejected rotor's score

Phase 4 keeps positivity (score > 0), not margin, on the rotor side.
No cross-case calibration evidence to inform a rotor-margin constant
yet; promoting to ranked-with-margin awaits Phase 5 diversified-
families evidence. Destination-side margin (ADR-0026) is unchanged.

Teaching boundary closed at Stance A — strictly hygiene-only.
Rotor rejections are deterministic geometric outcomes, not reviewed
teaching examples. CLAUDE.md §Teaching Safety forbids parallel
correction paths; entangling rotor rejection with reviewed teaching
would create one. Confirmed in ADR-0025 §"Teaching boundary".

Acceptance evidence (tests/test_rotor_admissibility.py, 11 passing):
  No-frame back-compat — frame_versor=None tokens identical to
    Phase 3 baseline
  Admit when aligned — frame_versor=seed direction admits
    seed→destination rotor
  Refuse with named axis — orthogonal frame raises
    InnerLoopExhaustion(reason=ROTOR_REJECTION); threshold mode
    also routes reason correctly
  versor_condition < 1e-6 preserved on admitted rotors
  Deterministic replay — 5 reruns identical for both admitted and
    refused turns

Suite results:
  full: 1048 passed, 2 skipped (+11 new rotor tests)

docs/runtime_contracts.md updated with "Rotor admissibility contract"
subsection documenting the seam, the algorithm, and the refusal
taxonomy.

Architectural invariants preserved:
  no new code in algebra/versor.py, field/propagate.py, vault/store.py
  no approximate recall, no cosine similarity, no HNSW/ANN
  no hot-path repair; check is pure typed-verdict
  InnerLoopExhaustion(ValueError) hierarchy unchanged
2026-05-17 15:16:32 -07:00
..
formation feat(epistemic): truth-seeking schema audit — 3 leaks closed, 4 new lanes, 3 new invariants 2026-05-17 07:27:41 -07:00
__init__.py
test_achat.py test(chat): achat() and arespond() smoke tests — surface, fields, OOV grace, structural determinism 2026-05-14 14:31:49 -07:00
test_admissibility_trace.py feat(adr-0023): Forward Semantic Control proof evidence — Accepted 2026-05-17 12:55:19 -07:00
test_alignment_graph.py Fix test suite errors across core physics and generation 2026-05-14 13:02:32 -07:00
test_architectural_invariants.py feat(epistemic): Leak C read-side audit — INV-24 callsite registry, Leak C fully closed 2026-05-17 09:48:39 -07:00
test_articulation.py fix(tests): align suite with persona-neutral strict-closure contract 2026-05-16 05:37:12 -07:00
test_articulation_realizer_v2.py Add articulation realizer v2 2026-05-14 20:14:50 -07:00
test_benchmarks_profiler.py feat(benchmarks): discourse_paragraph lane + pipeline profiler + word-selection tracer 2026-05-16 21:53:46 -07:00
test_cga_inner_rust_parity.py feat(adr-0020): parity gates for cga_inner, geometric_product, versor_condition, versor_apply 2026-05-16 20:37:58 -07:00
test_chat_runtime.py Bridge chat OOV grounding 2026-05-13 20:47:28 -07:00
test_cli.py fix(tests): align suite with persona-neutral strict-closure contract 2026-05-16 05:37:12 -07:00
test_cli_pack_validate_security.py Harden pack validator trust boundary 2026-05-15 11:50:15 -07:00
test_cli_test_suites.py Speed up validation lanes and pack loading 2026-05-15 08:26:11 -07:00
test_cognitive_eval_harness.py Add cognitive eval harness and calibration replay (#30) 2026-05-15 07:41:36 -07:00
test_cognitive_turn_pipeline.py Wire intent graph into cognitive pipeline 2026-05-14 20:05:00 -07:00
test_compiler.py
test_compose_relations.py feat(compositionality): compose_relations operator lifts lane 68.8% → 100% 2026-05-16 22:44:06 -07:00
test_core_ingest.py
test_core_semantic_seed_pack.py feat(packs): en_core_cognition_v1 v1.2.0 - rhetoric/metaphor/narrative 2026-05-16 15:15:14 -07:00
test_determinism_proofs.py
test_deterministic_hash.py feat: manifold field topology, graph diffusion operator, vertical pulse 2026-05-15 16:02:48 -07:00
test_dialogue.py fix(tests): align suite with persona-neutral strict-closure contract 2026-05-16 05:37:12 -07:00
test_dialogue_fluency_regression.py fix: harden session field invariants and eliminate hot-path inefficiencies 2026-05-15 21:37:49 -07:00
test_energy.py Tighten hot-path backend consistency 2026-05-15 08:14:38 -07:00
test_engine_loop_proof.py
test_epistemic_invariants.py feat(adr-0021): epistemic_status surface wired across teaching + trace 2026-05-16 20:20:35 -07:00
test_explain.py feat(phase3): core/cognition/explain.py — close Gap 3 introspection 2026-05-16 15:09:48 -07:00
test_forward_semantic_control.py feat(adr-0022): Forward Semantic Control — Accepted 2026-05-17 12:10:20 -07:00
test_generate_stream.py fix(tests): align suite with persona-neutral strict-closure contract 2026-05-16 05:37:12 -07:00
test_geometric_product_rust_parity.py feat(adr-0020): parity gates for cga_inner, geometric_product, versor_condition, versor_apply 2026-05-16 20:37:58 -07:00
test_graph_diffusion.py feat: manifold field topology, graph diffusion operator, vertical pulse 2026-05-15 16:02:48 -07:00
test_holonomy.py
test_holonomy_resonance.py
test_identity_gate.py fix(identity): close v3 paraphrase gap with two-layer override defense 2026-05-16 14:05:55 -07:00
test_inference_operators.py feat(phase3): multi_relation_walk closes Phase 3 v1 to 10/10 splits 2026-05-16 15:24:44 -07:00
test_inner_loop_admissibility.py feat(adr-0024): Phases 2-5 — corpus eval, v2 adversarial, threshold characterization, ADR-0025 design note 2026-05-17 14:07:50 -07:00
test_inner_loop_phase2.py feat(adr-0024): Phases 2-5 — corpus eval, v2 adversarial, threshold characterization, ADR-0025 design note 2026-05-17 14:07:50 -07:00
test_inner_loop_phase3.py feat(adr-0024): Phases 2-5 — corpus eval, v2 adversarial, threshold characterization, ADR-0025 design note 2026-05-17 14:07:50 -07:00
test_inner_loop_phase4.py feat(adr-0024): Phase 1 addendum — retire v1/dev fixture rot 2026-05-17 14:43:34 -07:00
test_intent_proposition_graph.py feat: add intent-proposition graph comprehension layer 2026-05-14 19:52:57 -07:00
test_intent_ratifier.py feat(adr-0022): Forward Semantic Control — Accepted 2026-05-17 12:10:20 -07:00
test_language_pack_cache.py feat(adr-0024): Phase 1 — wire inner-loop admissibility + determinism proof 2026-05-17 13:38:55 -07:00
test_language_pack_runtime.py
test_manifold.py
test_manifold_state.py feat: manifold field topology, graph diffusion operator, vertical pulse 2026-05-15 16:02:48 -07:00
test_margin_admissibility.py feat(adr-0026): Phase 3 — ranked admissibility with margin 2026-05-17 15:03:03 -07:00
test_morphology_irregular.py fix(gaps): close G1+G2+G3 + identity vocab + pipeline safety-stub honour 2026-05-16 21:21:06 -07:00
test_morphology_registry.py
test_motor.py
test_null_cone.py
test_oov_grounding_cache.py Cache OOV morphology grounding structures 2026-05-15 11:53:46 -07:00
test_operator_calibration_replay.py Add cognitive eval harness and calibration replay (#30) 2026-05-15 07:41:36 -07:00
test_pipeline.py
test_pipeline_teaching_integration.py feat: wire teaching loop into cognitive pipeline 2026-05-14 20:46:50 -07:00
test_probe_repl.py
test_proof_properties.py feat: Full Proof — surface realizer join, Rust diffusion parity, benchmark harness 2026-05-15 17:39:14 -07:00
test_proposition.py
test_provenance.py feat(evals): provenance lane v1 — replay determinism + source back-pointers 2026-05-16 11:45:00 -07:00
test_pulse_integration.py feat: Full Proof — surface realizer join, Rust diffusion parity, benchmark harness 2026-05-15 17:39:14 -07:00
test_realizer_quantifier_agreement.py fix(gaps): close G1+G2+G3 + identity vocab + pipeline safety-stub honour 2026-05-16 21:21:06 -07:00
test_refusal_contract.py feat(adr-0024): Phase 2 — honest refusal with typed evidence 2026-05-17 14:49:08 -07:00
test_replay_vs_llm_benchmark.py feat(compositionality): compose_relations operator lifts lane 68.8% → 100% 2026-05-16 22:44:06 -07:00
test_reviewed_teaching_loop.py feat: add reviewed teaching loop for controlled correction learning 2026-05-14 20:32:28 -07:00
test_rotor_admissibility.py feat(adr-0025): Phase 4 — rotor / frame admissibility at the seam 2026-05-17 15:16:32 -07:00
test_rotor_power.py fix(drift): proper rotor-manifold scaling; restore respond contract 2026-05-16 11:44:45 -07:00
test_runtime_config.py fix(tests): align suite with persona-neutral strict-closure contract 2026-05-16 05:37:12 -07:00
test_rust_backend.py feat(algebra): null-preserving versor_apply path + un-skip 2 invariant tests 2026-05-16 21:40:37 -07:00
test_salience.py fix(tests): align suite with persona-neutral strict-closure contract 2026-05-16 05:37:12 -07:00
test_segmenter.py
test_semantic_realizer_integration.py feat(adr-0023): Forward Semantic Control proof evidence — Accepted 2026-05-17 12:55:19 -07:00
test_sensorium_mount.py
test_session_coherence.py fix(session): CGA-only hemisphere consistency, remove forbidden Euclidean metric 2026-05-15 21:51:16 -07:00
test_surface.py test(surface): full unit test suite for SentenceAssembler — roles, guard, elaboration, languages, determinism 2026-05-14 14:29:46 -07:00
test_transition_rotor.py fix(algebra): enforce transition rotor invariants 2026-05-15 21:13:14 -07:00
test_unknown_token_ingest.py
test_vault_config.py fix(tests): align suite with persona-neutral strict-closure contract 2026-05-16 05:37:12 -07:00
test_vault_recall.py Activate and verify Rust backend 2026-05-13 22:23:48 -07:00
test_vault_recall_rust_parity.py feat(rust-parity): vault_recall first surface — bit-identity gate passes 2026-05-16 17:14:22 -07:00
test_vault_recall_vectorised.py feat(phase4): long-context-cost lane + ADR-0019 Stage 1 vault recall vectorisation 2026-05-16 16:39:30 -07:00
test_vault_store.py feat: vault recall index, Rust versor parity, cognitive pack expansion 2026-05-15 15:34:39 -07:00
test_versor_apply_rust_parity.py perf(rust): versor_apply f64 parity port — 29x over Python, bit-identical 2026-05-16 20:43:01 -07:00
test_versor_closure.py feat(algebra): null-preserving versor_apply path + un-skip 2 invariant tests 2026-05-16 21:40:37 -07:00
test_versor_condition_rust_parity.py feat(adr-0020): parity gates for cga_inner, geometric_product, versor_condition, versor_apply 2026-05-16 20:37:58 -07:00
test_vocab_manifold_invariants.py Fail closed on invalid versor construction 2026-05-14 10:55:11 -07:00