core/session
Shay 07f49eb215 fix(drift): proper rotor-manifold scaling; restore respond contract
Three issues in the drift-fix landing (922bddc) addressed:

1. algebra/rotor.py: add rotor_power(R, alpha) — slerp on the rotor manifold
   via the rotor's exp/log decomposition. Handles both rotation planes
   (cos/sin) and boost planes (cosh/sinh); falls back to identity for
   non-simple bivectors or null cases.

2. generate/stream.py: the score-weighted vault recall previously did
   `weight*V + (1-weight)*np.eye(V.shape[0])`. Two bugs:
   - np.eye produced a 32x32 matrix for a 1D multivector, crashing
     versor_apply with a broadcasting error (2 cognition tests failing
     on main).
   - The linear blend produced multivectors with versor_condition up to
     2.2e-2, violating the non-negotiable 1e-6 invariant declared in
     CLAUDE.md. Now uses rotor_power(V, weight) which stays on the
     manifold by construction (versor_condition <= 1.1e-16).

3. session/context.py: respond() now re-binds result.final_state to
   self.state after finalize_turn's anchor pull, restoring the
   "respond returns the same object that was vaulted" contract
   (test_engine_loop_proof regression).

Verification:
- 41 new tests in tests/test_rotor_power.py covering closure preservation,
  alpha=0/1 boundaries, half-angle composition, and word-transition rotors.
- Empirical multi-turn versor_condition stays at machine epsilon with
  anchor pull, max 9.4e-7 without (under threshold either way after fix).
- Full suite: 609 passed, 4 skipped, 0 failed.
2026-05-16 11:44:45 -07:00
..
__init__.py feat(dialogue-fluency): wire multi-turn dialogue runtime 2026-05-15 21:05:59 -07:00
context.py fix(drift): proper rotor-manifold scaling; restore respond contract 2026-05-16 11:44:45 -07:00
correction.py feat(dialogue-fluency): wire multi-turn dialogue runtime 2026-05-15 21:05:59 -07:00
graph.py feat(dialogue-fluency): wire multi-turn dialogue runtime 2026-05-15 21:05:59 -07:00
referents.py feat(dialogue-fluency): wire multi-turn dialogue runtime 2026-05-15 21:05:59 -07:00