GAP-032: enforce session daily trade limit

- retain accepted-trade count after position-flat events
- reject same-session entries with explicit MaxDailyTrades logging
- verify next-session re-entry and update Gate 3 governance

Build: clean | Tests: 500 passing | Dual-deployed: yes
This commit is contained in:
2026-08-03 08:54:54 -04:00
parent 5844b2ce0b
commit e68b138fc6
9 changed files with 132 additions and 20 deletions

View File

@@ -51,3 +51,8 @@ Record concise error fingerprints and verified fixes.
- **Root cause:** The JSONL writer read confluence values from static strategy configuration and recomputed runner mode with quantity `1`, while the session logger used accepted intent metadata and the actual resolved submission mode.
- **Fix:** Serialize from the accepted `StrategyIntent.Metadata` and pass the submission's `resolvedMode` into the provenance writer.
- **Prevention:** Logging artifacts for a submitted trade must consume the same immutable decision/submission objects used by the human-readable session log.
## 2026-08-03 [GAP-032] — Position-flat event bypassed MaxDailyTrades
- **Root cause:** Position closure cleared `_tradeTaken`, while the daily-limit guard required both `_tradeTaken` and a count at the limit.
- **Fix:** Make `_dailyTradeCount >= MaxDailyTrades` authoritative and reset the count only in session rollover handling.
- **Prevention:** Daily eligibility counters must be scoped to trading date, never position lifecycle.