core/chat
Shay c7e2b3b68f feat(adr-0244): Phase 2b — wire the operator-preservation gate into serve (flag-gated)
Wires the ADR-0244 §2.2 wave gate into the live turn loop behind a new
opt-in flag, byte-identical when off, plus a normalization fix found in
integration.

core/config.py: RuntimeConfig.identity_wave_gate (bool = False). OFF by
default — the leakage threshold is provisional (reuses alignment_threshold)
until calibrated to gamma_id in Phase 3, and flag-off is byte-identical to
the pre-ADR-0244 advisory path.

chat/runtime.py (main chat() path, two flag-gated touches):
  - at the identity check, pass wave_field=result.final_state.F when the
    flag is on (so hedging + telemetry both use the wave score); None when
    off -> legacy scalar-L2 path.
  - after the safety/ethics verdicts exist, intersect their violated
    boundaries with the manifold's committed boundary_ids (supplement via
    dataclasses.replace) and fold a fail-closed geometric IdentityGateRefusal
    into the typed refusal surface (TYPED_REFUSAL_PREFIX). refusal_emitted is
    derived once, after the block, preserving the (surface is not None) <=>
    emitted invariant.

chat/telemetry.py: serialize_turn_event emits the wave-gate keys
(identity_wave_mode / _leakage_norm / _min_self_alignment /
_boundary_violations) only when identity_score.wave_mode_active — so the
wire format is byte-identical when the gate is off.

core/physics/identity_manifold.py — NORMALIZATION FIX (found in
integration): the live versor carries boost (e5) components, and a boost is
a unit versor (R R~ = 1) that does NOT preserve the Euclidean coefficient
norm, so ‖R a_i R~‖ > 1 and the un-normalized leakage/self-alignment ran
past their ranges (measured leakage 5.16, self_align -4.75 on a real turn).
axis_response now normalizes each measure by the rotated-axis magnitude:
leakage is a fraction in [0,1], self_align a signed cosine in [-1,1]. For a
norm-preserving spatial rotor the rotated axis is unit and normalization is
a no-op (Phase 1 results unchanged). §4a updated to match; new boost test
pins bounded measures.

tests/test_adr_0244_identity_gate_runtime.py (new): flag OFF -> legacy
score + no wave telemetry (byte-identical wire); flag ON -> wave gate active
on the live versor + wave telemetry present + bounded measures; flag-off
determinism. Seeds a short sequence to reach main-path (identity-checked)
turns (a fresh empty-vault runtime routes ungrounded inputs to disclosure).

[Verification]: 74 targeted (manifold+gate+runtime+legacy identity+
telemetry) passed; in-worktree smoke 176 passed; fast lane
(-m 'not quarantine and not slow' -n auto) 11883 passed, 109 skipped —
flag-off byte-identity confirmed across the whole suite.
2026-07-17 17:06:22 -07:00
..
__init__.py
__main__.py
always_on.py feat(identity): split engine identity from build provenance (ADR-0220 PR C) (#774) 2026-06-15 11:38:04 -07:00
always_on_daemon.py feat(l10): always-on daemon/CLI — the process that runs the continuous-life heartbeat 2026-06-14 17:33:37 -07:00
anaphora.py feat(adr-0066): session-thread context + opt-in anaphora prefix (Phase 3.1 + 3.2) 2026-05-18 17:01:34 -07:00
articulation_telemetry.py feat(contemplation): Phase 5 — articulation-quality miner closes the loop 2026-05-21 10:55:39 -07:00
ask_runtime.py feat(ask): add runtime-facing ASK helper module 2026-06-10 03:34:02 -07:00
atom_equivalence.py feat(telemetry): ADR-0078 Phase 1 — composer/graph atom equivalence (observational) 2026-05-20 06:14:25 -07:00
cross_pack_grounding.py feat(register): R1–R4 register pack subsystem — deterministic surface variation 2026-05-19 16:52:36 -07:00
dispatch_trace.py chore(chat): dispatch trace for grounding-source dispatcher (ADR-0142 debt #2) (#233) 2026-05-24 15:22:02 -07:00
example_surface.py feat(register): R1–R4 register pack subsystem — deterministic surface variation 2026-05-19 16:52:36 -07:00
narrative_surface.py feat(register): R1–R4 register pack subsystem — deterministic surface variation 2026-05-19 16:52:36 -07:00
oov_surface.py feat(adr-0066): NARRATIVE + EXAMPLE intents with multi-clause composers (Phase 3.3 + 3.4) 2026-05-18 17:01:55 -07:00
pack_grounding.py Lane 4: Registry Consolidation (language_packs to packs) 2026-07-04 15:11:28 -07:00
pack_resolver.py feat: close 3-lang depth deck — same-turn roots, capability pins, public_demo budget 2026-07-08 19:15:34 -07:00
pack_surface_candidate.py feat(pack-grounding): selector-ready gloss wiring via PackSurfaceCandidate 2026-05-19 07:26:46 -07:00
partial_surface.py feat(adr-0065): OOV cliff → five-tier honesty gradient (Phase 2.1 + 2.2) 2026-05-18 16:41:45 -07:00
refusal.py chore: Refactor CLI and Governance Anchors (#926) 2026-07-03 12:34:56 -07:00
register_substantive.py feat(register): ADR-0077 — substantive register knobs + layering boundary (R6) 2026-05-19 23:39:11 -07:00
register_variation.py feat(register): R5 — operator-visible register telemetry + tour demo 2026-05-19 19:03:07 -07:00
runtime.py feat(adr-0244): Phase 2b — wire the operator-preservation gate into serve (flag-gated) 2026-07-17 17:06:22 -07:00
teaching_grounding.py feat(adr-0083): transitive (multi-hop) teaching-grounded surface (#63) 2026-05-20 14:11:40 -07:00
telemetry.py feat(adr-0244): Phase 2b — wire the operator-preservation gate into serve (flag-gated) 2026-07-17 17:06:22 -07:00
thread_context.py feat(adr-0066): session-thread context + opt-in anaphora prefix (Phase 3.1 + 3.2) 2026-05-18 17:01:34 -07:00
verdicts.py feat(adr-0039): audit completeness — TurnVerdicts bundle, stub TurnEvent, hedge_injected 2026-05-17 21:32:46 -07:00