core/evals/public_demo
Shay 11c91581e8
fix(W-015): replace _slerp_toward with rotor-geodesic anchor pull (#255)
Closes W-015 wiring debt. Per Sonnet's investigation (PR #252,
verdict (c)): _slerp_toward interpolates on S^31 but the versor
manifold (Spin sub-group in Cl(4,1)) is a proper subset. Slerp's
geodesic doesn't stay on the manifold, producing systematic
off-manifold state that the post-hoc unitize_versor was repairing.

Fix replaces _slerp_toward with the proper rotor-geodesic path:
    R      = word_transition_rotor(field_state.F, anchor_field)
    R_step = rotor_power(R, _ANCHOR_PULL_ALPHA)
    pulled_F = versor_apply(R_step, field_state.F)

rotor_power stays on the manifold by construction (same principle
as generate/stream.py:220). versor_apply closes via algebra/
versor.py — an already-sanctioned site. The unsanctioned
unitize_versor call in _anchor_pull and the entire _slerp_toward
function are removed.

CLAUDE.md normalization-site discipline is now restored:
session/context.py:_anchor_pull no longer performs normalization.

Changes:
- session/context.py: import rotor_power + word_transition_rotor,
  remove _slerp_toward (34 lines), rewrite _anchor_pull to use
  rotor-geodesic (15 lines net change).
- tests/test_session_coherence.py: new test pins the manifold
  invariant — after anchor pull, versor_condition stays < 1e-6
  without any unitize call (32 lines).

Intentional lane re-pins (audit-trail per #229 discipline):
- demo_composition: 403be13b → 3a3d09f3 (anchor pull now produces
  correct on-manifold fields; demo output shifts as expected).
- public_demo: acd51d0c → 888ddd0d (same cause).

CLAIMS.md regenerated to reflect new pins (per #239 lesson).

Verification:
- tests/test_session_coherence.py: 3 passed
- core test --suite smoke: 67 passed
- scripts/verify_lane_shas.py: 7/7 match (post-re-pin)
- Manifold invariant test pinned: anchor pull preserves
  versor_condition < 1e-6 by construction (no repair).

Investigation source: PR #252 (Sonnet). 4,138-sample bimodal
distribution confirmed _slerp_toward as the sole drift source.
2026-05-24 20:05:25 -07:00
..
results fix(W-015): replace _slerp_toward with rotor-geodesic anchor pull (#255) 2026-05-24 20:05:25 -07:00
contract.md
runner.py fix(capability): correct discourse_planner flag catalog + commit-independent public_demo pin 2026-05-21 20:53:15 -07:00