- SPRINT_BOARD.md: stage GAP-025/GAP-030 and correct GAP-062 deploy status - TASK_GAP025_RUNNER_ORDER_LIFECYCLE_LOGGING_PROMPT.md: add runner lifecycle logging prompt - TASK_GAP030_ORB_HYDRATION_VERIFY_PROMPT.md: add ORB hydration verify prompt - TASK_GAP051/052/059/060 prompts: record commit-only deploy instruction - TASK_GAP054_RUNNER_TRAIL_PROMPT.md: clarify SIM/replay validation path - docs/00-governance/2026-08-19-run-book.md: reconcile implemented/verified task states - docs/00-governance/active_work.md: update blocker status and validation requirements - docs/00-governance/decisions.md: record prompted follow-ups and resolved GAP-062 deploy status Build: clean | Tests: 569 passing | Deploy: GAP-062 deployed backup 20260826_005308
154 lines
8.2 KiB
Markdown
154 lines
8.2 KiB
Markdown
# TASK: GAP-060 — REJECT SUMMARY snapshot mechanism goes dark for hours at a time, including the entire RTH trading day
|
|
# Staged: 2026-08-24, found live during Sim101 SIM session review
|
|
# Sprint: Stage 1 — logging/observability only, zero trading-behaviour risk
|
|
# Owner: Kilocode
|
|
# Deploy: COMMIT ONLY — do NOT run deploy-to-nt8.bat or copy build output to
|
|
# the live NT8 install as part of this task. The Sim101 SIM session
|
|
# is currently running and under live investigation; a redeploy
|
|
# would restart it and break session continuity. Verify-build and
|
|
# commit as usual; leave the deploy step for the operator to run
|
|
# manually once ready.
|
|
# ─────────────────────────────────────────────────────────────────
|
|
|
|
## THE DEFECT
|
|
|
|
`session_20260823_230519.log` (a single continuous SIM session spanning
|
|
2026-08-23 23:05 ET through at least 2026-08-24 20:20 ET) shows a total
|
|
`REJECT SUMMARY` blackout from `23:55:01` (Aug 23 night) to `16:00:00`
|
|
(Aug 24 afternoon) — roughly 16 hours, covering the entire 09:30-10:00 ET
|
|
ORB window and the entire RTH trading day:
|
|
|
|
138:[23:55:01.574] REJECT SUMMARY: reason=RthGuard count=9
|
|
(... nothing for ~16 hours ...)
|
|
720:[16:00:00.056] REJECT SUMMARY: reason=RthGuard count=124
|
|
|
|
Mo (the operator) watched several Grade-A `STATE:` telemetry prints scroll
|
|
by between 09:30-10:00 ET and reasonably asked why nothing traded — the
|
|
file log currently cannot answer that question for any bar in that entire
|
|
16-hour span, even though evaluation was clearly ongoing (`STATE:` lines
|
|
keep printing with changing scores/grades throughout).
|
|
|
|
## ROOT CAUSE (traced to source, `NT8StrategyBase.cs`)
|
|
|
|
Three compounding issues in `MaybeWriteRejectSummarySnapshot`/
|
|
`LogRejectRateLimited` (~1444-1496):
|
|
|
|
1. **Blanket time-of-day gate, not ORB-window-aware:**
|
|
`if (barTime.TimeOfDay < new TimeSpan(10, 0, 0)) return;`
|
|
This is clearly intended to avoid noisy snapshot spam while the 09:30-10:00
|
|
ORB range is still forming, but as written it suppresses ANY snapshot
|
|
write for ANY bar between midnight and 10:00 AM — including hours of
|
|
unrelated overnight ETH activity that have nothing to do with the ORB
|
|
window.
|
|
|
|
2. **`_orbRejectSummarySnapshotWritten` is a session-lifetime flag, not a
|
|
per-trading-day flag.** It is only ever reset in `ResetRejectTracking()`,
|
|
which is only called once, from `WriteSessionHeader()`, which itself only
|
|
runs once per strategy enable (`State.DataLoaded`). On a multi-day
|
|
continuous SIM/live run (as tonight's was), this flag gets set `true` the
|
|
*first* time any post-10:00-AM-time-of-day reject fires for the entire
|
|
run — here that happened to be `23:10:00` on the very first night, since
|
|
`23:10 >= 10:00` is also true in a bare `TimeSpan.TimeOfDay` comparison.
|
|
After that one-time trigger, the "due after ORB window" path can never
|
|
fire again for the rest of the multi-day session — confirmed by the log:
|
|
the very first `REJECT SUMMARY` at `23:10:00` sets it, and it stays
|
|
`true` from then on.
|
|
|
|
3. **The snapshot is only ever written as a side effect of some other
|
|
reject occurring** — `LogRejectRateLimited` is the sole caller of
|
|
`MaybeWriteRejectSummarySnapshot`; there is no independent timer. If the
|
|
strategy goes a stretch of the trading day without any *tracked* reject
|
|
firing (or if a tracked reject fires but does not itself get logged for
|
|
some other reason — see OPEN QUESTION below), the 15-minute interval
|
|
target (`REJECT_SUMMARY_SNAPSHOT_INTERVAL_MINUTES = 15`) is never
|
|
actually checked, because nothing calls into the function to check it.
|
|
|
|
Net effect, confirmed directly in tonight's log: zero `REJECT SUMMARY` and
|
|
zero individual `REJECT:` lines for the entire 09:30-16:00 ET trading day,
|
|
despite `STATE:` telemetry clearly showing ongoing evaluation the whole
|
|
time (Grade cycling B→C→D→F as the day progressed). The reject counters
|
|
may be accumulating correctly in memory — there is currently no way to
|
|
tell from the file log.
|
|
|
|
## OPEN QUESTION — flag, do not silently resolve
|
|
|
|
The one snapshot we do have from the trading day (`16:00:00`) shows
|
|
`RthGuard count=124` and `WarmupIncomplete count=1` — but **no
|
|
`OrbRangeNotEstablished` entry at all**, despite `SimpleORBStrategy.OnBar()`
|
|
(`~419-432` and `~600`) recording that exact reason both while the ORB
|
|
window is still building (09:30-10:00) and whenever no breakout has yet
|
|
confirmed (which per Mo's report was true all day — "never broke out").
|
|
|
|
Two possibilities, and the task should determine which (do not guess):
|
|
|
|
(a) The count is genuinely zero because `_rejectCounts` doesn't carry
|
|
over correctly across the visibility blackout described above (i.e.
|
|
another symptom of the same defect — the accumulation itself is fine,
|
|
only the reporting is broken), or
|
|
|
|
(b) `RecordSignalRejection(context, "OrbRangeNotEstablished", ...)` /
|
|
`LogSignalRejectionFromContext(context)` is not actually being reached
|
|
for some other reason during RTH bars, which would be a second, distinct
|
|
defect beyond snapshot visibility.
|
|
|
|
Add a temporary diagnostic (or a focused test that drives `OnBar` across a
|
|
simulated 09:30-16:00 RTH day with no breakout, then asserts
|
|
`_rejectCounts["OrbRangeNotEstablished"]` is non-zero) to settle this
|
|
before closing the task. Report which one it was in your writeback.
|
|
|
|
## THE CHANGE
|
|
|
|
1. Make ORB-window-aware snapshot suppression **date-aware**, not just
|
|
time-of-day: only suppress while `barTime` falls within *today's*
|
|
09:30-10:00 window (or whatever the actual configured ORB window is),
|
|
not the entire midnight-10:00 span.
|
|
2. Make `_orbRejectSummarySnapshotWritten` (or its replacement) reset **per
|
|
trading day**, the same way `SimpleORBStrategy` already tracks
|
|
`_currentSessionDate` for its own daily reset — reuse that pattern/timing
|
|
if practical, so the "due after ORB window" trigger can fire once per
|
|
day, every day, on a long-running session.
|
|
3. Add an independent, timer-driven flush path so a full trading day cannot
|
|
go dark even if no reject happens to occur at the right moment to trigger
|
|
one — e.g. check-and-flush from the regular `OnBarUpdate` heartbeat
|
|
(every processed RTH bar, or every N minutes) rather than solely as a
|
|
side effect of `LogRejectRateLimited`. Keep the existing 15-minute
|
|
interval as the cadence target.
|
|
4. Resolve the OPEN QUESTION above and report the answer.
|
|
|
|
## DO NOT
|
|
|
|
- Do not change `RecordSignalRejection`'s reason strings or any actual
|
|
order-flow/risk/sizing logic — this task is about getting existing reject
|
|
data to the file log reliably, not changing what gets rejected or why.
|
|
- Do not remove the existing rate-limiting behavior for the one-time detail
|
|
line per reason (`_rejectDetailsLogged`) — that part is working as
|
|
intended and is not in scope.
|
|
- Do not change `REJECT_SUMMARY_SNAPSHOT_INTERVAL_MINUTES` (15) unless you
|
|
find a concrete reason to, and if so, say why in your writeback.
|
|
|
|
## TESTS (required)
|
|
|
|
1. A test simulating bars from before midnight through past the next day's
|
|
10:00 AM ORB close, asserting a `REJECT SUMMARY` snapshot is written at
|
|
(or shortly after) 10:00 AM on the new day even though one already fired
|
|
the prior evening — this is the exact regression that would have caught
|
|
tonight's blackout.
|
|
2. A test simulating a full RTH day with periodic rejects (or none) and
|
|
confirming a snapshot is written at least once per ~15 minutes via the
|
|
new timer-driven path, not solely reject-triggered.
|
|
3. Whatever test resolves the OPEN QUESTION above.
|
|
|
|
## VALIDATION (operator)
|
|
|
|
After the next SIM session spanning a full trading day, confirm
|
|
`REJECT SUMMARY` lines appear at a reasonable cadence throughout 09:30-16:00
|
|
ET (not just at session start and session end), and that `SPRINT_BOARD.md`'s
|
|
next live-session check explicitly looks for this.
|
|
|
|
## GOVERNANCE
|
|
|
|
Track as [GAP-060] in SPRINT_BOARD.md. Update `docs/00-governance/decisions.md`
|
|
DEC-20260823-08 status to `implemented` with an implementation note stating
|
|
which of the OPEN QUESTION possibilities (a) or (b) was confirmed, and how.
|
|
Reference: this task, DEC-20260823-08, `session_20260823_230519.log`.
|