docs: record GAP-034/035/036 forensics and DEC-20260814/15 decisions

This commit is contained in:
2026-08-16 16:58:15 -04:00
parent d59be0e607
commit c4ad9696c0
12 changed files with 852 additions and 17 deletions

View File

@@ -52,6 +52,49 @@ Record concise error fingerprints and verified fixes.
- **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-14 [GAP-036] — Provenance field sourced from the wrong dictionary
- **Fingerprint:** `risk_mode` serializes as `"Unknown"` on every trade despite a real
resolved mode existing at signal time.
- **Root cause:** `GetRiskMode()` reads `_strategyConfig.Parameters["risk_mode"]`, but the
SDK writes risk mode to `candidate.Metadata["risk_mode"]`. Two different dictionaries.
The key is never present in `Parameters`, so the lookup silently falls through to the
`"Unknown"` default.
- **Fix:** Source from `intent.Metadata["risk_mode"]`, retaining `Parameters` as fallback.
- **Prevention:** A provenance field sourced from the wrong dictionary fails **silently as
a plausible default value**, not as an error. Any field that can legitimately hold a
sentinel (`"Unknown"`, `0.0`, `"None"`) must have a round-trip test asserting a real
value survives serialization. GAP-031 fixed four such fields and missed this one because
the prompt enumerated fields by name rather than auditing every consumer of the
`Parameters`/`Metadata` split.
## 2026-08-14 [GAP-034] — Rejection reasons invisible in session logs
- **Fingerprint:** Zero trades on days with clear breakouts; session log shows only
SESSION START and readiness lines, with no indication of why.
- **Root cause:** `FileLog` writes to `session_*.log`; `_logger.LogInformation` writes to
the NT8 Output window. Every signal-rejection reason (grade filter, `MaxDailyTrades`,
ORB range, RTH guard) routes through `_logger` only. If the Output window was not open,
the reason is permanently lost.
- **Diagnostic value of absence:** `ProcessStrategyIntent` **does** `FileLog` a `SIGNAL:`
line for every realtime intent. Absence of `SIGNAL:` therefore proves no intent was
produced and isolates the fault upstream of the execution pipeline. This is a usable
bisection point.
- **Fix:** Route all rejection reasons to `FileLog` alongside `_logger` (GAP-035).
- **Prevention:** Any decision that can silently suppress a trade must be durably logged
to disk. An ephemeral UI window is not an audit trail.
## 2026-08-14 — Backtest/live divergence from secondary-series warm-up
- **Fingerprint:** A day that traded live produces zero trades when backtested alone.
- **Root cause:** In Strategy Analyzer the secondary daily series loads only from the
backtest start date. `BuildDailyBarContext` returns `Count=0` below 2 daily bars, so
daily-dependent confluence factors score neutral and the composite falls under the
Grade A threshold. Separately, the regime gate requires 50 daily bars and never arms.
Neither path errors; the NR7 advisory deliberately does not block.
- **Fix (workflow, not code):** Start backtests **60+ trading days** before the target day.
Enable Tick Replay when using non-time-based bars, or bar construction will differ from
live regardless of warm-up.
- **Prevention:** A zero-trade backtest is not evidence of no signal. Verify warm-up
counts before interpreting any backtest result.
## 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.