core/core/physics
Shay 5e6a16d473
feat(W-020a): TurnEvent.trace_hash back-stamp (ADR-0153) (#277)
TurnEvent had no trace_hash field, so teaching/discovery._trace_hash
always returned "" via getattr default. Every persisted DiscoveryCandidate
had source_turn_trace="" — provenance gap observed in a real 103-turn
session.

- Add trace_hash: str = "" to TurnEvent
- runtime.finalize_turn_trace_hash back-stamps last TurnEvent and
  unstamped tail of _pending_candidates, then re-persists
- CognitiveTurnPipeline.process calls finalize_turn_trace_hash after
  compute_trace_hash, before constructing CognitiveTurnResult

Invariants: empty hash is a no-op; back-walk halts at first already-
stamped candidate (no overwrite of prior turns); trace_hash bytes are
unchanged for any given turn.

Validated: tests/test_adr_0153_trace_hash_backstamp.py (6 tests),
core test --suite cognition/smoke/runtime/teaching all green.

Out of scope: OOV candidate trace_hash (same root cause, line-streamed
sink requires different fix); telemetry-sink trace_hash exposure.
2026-05-25 18:42:35 -07:00
..
__init__.py Implement core physics and pack validation 2026-05-14 12:35:19 -07:00
articulation.py Implement core physics and pack validation 2026-05-14 12:35:19 -07:00
attention.py Implement core physics and pack validation 2026-05-14 12:35:19 -07:00
binding.py Implement core physics and pack validation 2026-05-14 12:35:19 -07:00
digest.py Implement core physics and pack validation 2026-05-14 12:35:19 -07:00
drive.py Implement core physics and pack validation 2026-05-14 12:35:19 -07:00
energy.py Tighten hot-path backend consistency 2026-05-15 08:14:38 -07:00
exertion.py
identity.py feat(W-020a): TurnEvent.trace_hash back-stamp (ADR-0153) (#277) 2026-05-25 18:42:35 -07:00
inhibition.py Implement core physics and pack validation 2026-05-14 12:35:19 -07:00
learning.py Implement core physics and pack validation 2026-05-14 12:35:19 -07:00
reasoning.py Fix main chat test regressions 2026-05-14 15:48:45 -07:00
salience.py perf(salience): vectorize curvature pairwise loop — 57× faster, 42% e2e (#96) 2026-05-20 21:29:42 -07:00
valence.py Implement core physics and pack validation 2026-05-14 12:35:19 -07:00