fix(policy): reconcile session-owned action memory with game observations

This commit is contained in:
0xrsydn 2026-09-22 12:45:46 +07:00
commit bf41945ef9
9 changed files with 405 additions and 362 deletions

View file

@ -2,7 +2,7 @@
## Code map
- `facts.py`: pure game-state parsing and arithmetic.
- `brain.py`: decision policy; returns one `Decision` per observation.
- `brain.py`: decision policy and session-owned `PolicyContext`; proposes one action per observation.
- `run.py`: observedecideact loop, captures, and session attribution.
- `sts2.py`: local game HTTP client. `jev.py`: TypeSafe model client and gates.
- `migrate.py`: dataset migration and integrity checks.
@ -25,6 +25,7 @@ Prefer integration/end-to-end checks; keep only essential regression tests and u
## Invariants
- Execute one game action, then read a fresh observation. Card indices can change after each action.
- Keep policy memory session-owned. Proposals do not record execution; reconcile accepted requests with fresh observations.
- Compute arithmetic and legality in code, not in Jev. Confidence does not prove correctness.
- Keep deterministic fallbacks usable with `client=None`. Test model paths with stubs.
- Preserve session/step attribution. Run outcomes are not per-decision correctness labels.