core/tests
Shay bf7f7895fe feat(adr-0061): PROCEDURE intent routes to pack-grounded surface
Pre-ADR-0061 every "How do I X?" question fell through to the
universal disclosure even when X was a pack-resident lemma.  The
teaching corpus carries CAUSE/VERIFICATION chains only — procedural
knowledge is fundamentally different in kind from propositional
claims and deserves its own ratification path (deliberately out of
scope; a future parallel `procedure_chains_v1.jsonl` schema is
discussed in the ADR's non-goals).

ADR-0061 adds the honest cold-start fallback: ground the topic in
pack semantic_domains and note explicitly that ratified step-by-step
guidance does not exist yet.

Surface format:
  "procedure-grounded ({pack_id}): {lemma} ({d1}; {d2}).
   Step-by-step guidance for {lemma} is not yet ratified
   in this session."

Selector — **last** pack-resident lemma in the verb-phrase subject:
  "define a concept" → concept    (object beats verb)
  "verify a claim"   → verify     (verb wins when object is OOV)
  "correct an error" → correct
  "learn this"       → learn
  "do stuff"         → None       (falls through to universal disclosure)

Stopwords: only `be` and `have` (dialogue fillers).  Procedure verbs
are deliberately NOT stopworded so the verb-as-fallback rule fires
when the object is OOV — keeps surface coverage.

Trust-boundary invariants:
  - Every visible non-template token is lemma / pack-domain / template.
  - Deterministic: same subject_text → same bytes.
  - Returns None for fully-unknown utterances → universal disclosure
    fires.  Never fabricates surface from nothing (ADR-0053 contract).
  - "not yet ratified" trust-label preserved.

Cognition lane lift:
  public  : intent 100% / surface 100% / term 91.7% / versor 100%      (unchanged)
  holdout : intent 100% / surface 94.7%→100.0% / term 79.2%→83.3% / versor 100%

Two cases fixed:
  - procedure_define_010 ("How do I define a concept?") — surface +
    term `concept` now captured.
  - procedure_verify_034 ("How do I verify a claim?") — surface only
    (case has no expected_terms; the verb fallback grounds it).

Combined effect: holdout `surface_groundedness` closes to 100%; 4 of
5 architectural holdout misses now resolved (this ADR + ADR-0060 +
the supersede from epistemology v1).  Remaining 2 are UNKNOWN-intent
cases (unknown_spirit_041, unknown_word_018) — out of scope; deserve
their own ADR with distinct selector semantics.

- chat/pack_grounding.py — `_extract_procedure_topic_lemma` helper +
  `pack_grounded_procedure_surface` composer.
- chat/runtime.py — import + dispatch branch for `IntentTag.PROCEDURE`.
- tests/test_procedure_surface.py — 15 tests pin: extraction
  (last-wins / verb-by-elimination / be+have skipped / None on empty /
  strips punctuation / case-insensitive); surface (contains lemma /
  contains domains / pack_id / "not yet ratified" label / None for
  no-pack-lemma / deterministic); end-to-end through ChatRuntime.

Lanes (regression): smoke 67 / cognition 121 / teaching 17 /
procedure 15 — all green.

The non-negotiable field invariant (versor_condition < 1e-6) is
unaffected: this ADR changes surface composition only.
2026-05-18 14:22:19 -07:00
..
formation feat(formation/templates): four new course templates + shared helpers 2026-05-17 18:59:15 -07:00
__init__.py
test_achat.py
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
test_anti_regression_demo.py feat(adr-0057): anti-regression demo — three-gate defense against learning harm 2026-05-18 10:52:23 -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
test_audit_tour.py feat(adr-0042): audit-tour demo — pack-layer story in four scenes 2026-05-17 22:06:45 -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
test_cli.py fix(tests): align suite with persona-neutral strict-closure contract 2026-05-16 05:37:12 -07:00
test_cli_demo.py docs(cli): self-explanatory demos — preambles + per-directory READMEs 2026-05-17 16:39:50 -07:00
test_cli_pack_validate_security.py
test_cli_test_suites.py
test_cognitive_eval_harness.py
test_cognitive_turn_pipeline.py
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_contemplation.py feat(adr-0056): Phase C1 — contemplation loop landed 2026-05-18 10:06:18 -07:00
test_contemplation_wiring.py feat(adr-0056): wire contemplation into live turn path (opt-in) 2026-05-18 10:13:44 -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_correction_telemetry.py feat(adr-0059): correction-pass telemetry emission — backward perturbation auditable 2026-05-18 13:47:48 -07:00
test_correction_topic_lemma.py feat(adr-0060): correction acknowledgement carries corrected-topic lemma 2026-05-18 14:14:27 -07:00
test_determinism_proofs.py
test_deterministic_hash.py
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
test_discovery_candidates.py feat(adr-0055): Phase B — DiscoveryCandidate emission from turn loop 2026-05-18 08:26:04 -07:00
test_energy.py
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_ethics_check.py feat(adr-0034): EthicsCheck — structural surface parallel to SafetyCheck 2026-05-17 20:46:34 -07:00
test_ethics_packs.py feat(adr-0033): ethics packs — third pack-layer sibling to identity + safety 2026-05-17 20:41:04 -07:00
test_ethics_refusal_opt_in.py feat(adr-0037,adr-0038): per-predicate ethics refusal + hedge injection 2026-05-17 21:23:28 -07:00
test_eval_holdout_split.py feat(adr-0054): vault recall indexing/batching + holdout split wired 2026-05-18 07:58:57 -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_graph_constraint_null_lift.py docs(adr-0058): forward_graph_constraint engaged-but-inert; null-lift pinned 2026-05-18 13:36:37 -07:00
test_forward_graph_constraint_wiring.py feat(adr-0047): wire forward graph constraint into the chat hot path 2026-05-18 06:18:10 -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_constraint.py fix(adr-0046): make forward-graph-constraint branch mergeable 2026-05-18 05:57:46 -07:00
test_graph_diffusion.py
test_hedge_injection.py feat(adr-0039): audit completeness — TurnVerdicts bundle, stub TurnEvent, hedge_injected 2026-05-17 21:32:46 -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_identity_packs.py feat(cli): core chat --list-identity-packs + companion-file filter 2026-05-17 19:47:13 -07:00
test_identity_score_decomposition.py feat(surface): ADR-0031 — score-decomposition surface (per-axis hedges) 2026-05-17 20:16:22 -07:00
test_identity_surface_divergence.py feat(identity-packs): ADR-0028 — pack-driven hedge & claim-strength shaping 2026-05-17 19:42:54 -07:00
test_identity_surface_divergence_depth.py feat(surface): ADR-0030 — depth-language hedge wiring 2026-05-17 20:05:45 -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
test_intent_ratifier.py feat(adr-0022): Forward Semantic Control — Accepted 2026-05-17 12:10:20 -07:00
test_intent_subject_extraction.py feat(adr-0049): head-noun subject extraction in intent classifier 2026-05-18 06:51:46 -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_load_safety.py feat(adr-0051): trust-boundary hardening pass 2026-05-18 07:09:55 -07:00
test_language_pack_runtime.py
test_learning_loop_demo.py feat(adr-0055-0057): learning-loop demo — cold turn to grounded surface, end-to-end 2026-05-18 10:57:41 -07:00
test_long_context_comparison.py feat(adr-0044, adr-0045): domain ethics pack + long-context comparison 2026-05-17 22:31:47 -07:00
test_manifold.py
test_manifold_state.py
test_margin_admissibility.py feat(adr-0026): Phase 3 — ranked admissibility with margin 2026-05-17 15:03:03 -07:00
test_medical_clinical_ethics_pack.py feat(adr-0044, adr-0045): domain ethics pack + long-context comparison 2026-05-17 22:31:47 -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_mutation_proposal_type.py feat(adr-0051): trust-boundary hardening pass 2026-05-18 07:09:55 -07:00
test_null_cone.py
test_oov_grounding_cache.py
test_operator_calibration_replay.py
test_pack_grounded_comparison.py feat(adr-0050): pack-grounded COMPARISON surface 2026-05-18 06:59:53 -07:00
test_pack_grounded_correction.py feat(adr-0053): cognition lane closure — corpus expansion + CORRECTION acknowledgement 2026-05-18 07:43:39 -07:00
test_pack_grounding.py feat(adr-0048): pack-grounded surface for cold-start DEFINITION/RECALL 2026-05-18 06:36:10 -07:00
test_pack_measurements_phase2.py feat(adr-0043): Phase-2 pack measurements — claims → numbers 2026-05-17 22:19:24 -07:00
test_phase5_corpus.py feat(adr-0024): Phase 5 — stratified mechanism-isolation across 5 failure-mode families 2026-05-17 15:51:59 -07:00
test_phase6_demo.py feat(adr-0024): Phase 6 — comparative demo, three head-to-head conditions 2026-05-17 16:02:37 -07:00
test_pipeline.py
test_pipeline_teaching_integration.py
test_probe_repl.py
test_procedure_surface.py feat(adr-0061): PROCEDURE intent routes to pack-grounded surface 2026-05-18 14:22:19 -07:00
test_proof_properties.py
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
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
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_safe_display.py feat(adr-0051): trust-boundary hardening pass 2026-05-18 07:09:55 -07:00
test_safety_check.py feat(safety): ADR-0032 — SafetyCheck structural surface 2026-05-17 20:25:22 -07:00
test_safety_pack.py feat(safety): ADR-0029 — always-loaded, never-replaceable safety pack 2026-05-17 19:56:29 -07:00
test_safety_refusal.py feat(adr-0036): safety-only typed refusal policy 2026-05-17 21:10:52 -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-0048): pack-grounded surface for cold-start DEFINITION/RECALL 2026-05-18 06:36:10 -07:00
test_sensorium_mount.py
test_session_coherence.py
test_supersede.py feat(adr-0057): operator supersede CLI — retire active chain by appended replacement 2026-05-18 10:35:49 -07:00
test_supersession_history.py feat(adr-0057): operator supersession history view — closes the supersede loop 2026-05-18 10:40:38 -07:00
test_surface.py
test_teaching_audit.py feat(adr-0055): Phase A — teaching corpus audit, supersession, typed provenance 2026-05-18 08:15:23 -07:00
test_teaching_grounding.py feat(adr-0052): teaching-grounded CAUSE/VERIFICATION surface 2026-05-18 07:13:43 -07:00
test_teaching_loop_bench.py feat(adr-0055-0057): teaching-loop determinism benchmark — replayable learning 2026-05-18 11:03:48 -07:00
test_teaching_proposals.py feat(adr-0057): Phase C2 — TeachingChainProposal + replay gate + review CLI 2026-05-18 10:23:14 -07:00
test_telemetry_fanout_and_summary.py feat(adr-0041): core chat --show-verdicts + FanOutSink 2026-05-17 21:47:47 -07:00
test_telemetry_sink.py feat(adr-0040): structured-logging sink for turn-event audit 2026-05-17 21:39:58 -07:00
test_transition_rotor.py
test_turn_loop_verdicts.py feat(adr-0035): turn-loop auto-invocation — surfacing only 2026-05-17 20:57:33 -07:00
test_turn_verdicts_bundle.py feat(adr-0039): audit completeness — TurnVerdicts bundle, stub TurnEvent, hedge_injected 2026-05-17 21:32:46 -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
test_vault_recall_indexing_batch.py feat(adr-0054): vault recall indexing/batching + holdout split wired 2026-05-18 07:58:57 -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
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