133 lines
9.0 KiB
Markdown
133 lines
9.0 KiB
Markdown
# TASK: GAP-064-FOLLOWUP-2 — trace why a whole RTH day produced zero REJECT/SIGNAL lines
|
|
# Staged: 2026-09-08 — narrower follow-up to GAP-064; the first-pass FileLog visibility fix
|
|
# and its regression test are confirmed good (recommend committing them now), but the
|
|
# core question — why did 2026-09-04's entire RTH day produce zero REJECT:/SIGNAL:
|
|
# lines despite 75 apparently-live STATE: evaluations — is still unanswered.
|
|
# Sprint: Stage 2 — diagnostic-first; do not change order-evaluation or logging behavior beyond
|
|
# what is needed to answer this question
|
|
# 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. Commit the already-verified GAP-64 FileLog fix and its regression
|
|
# test now if not already committed (no commit exists as of this writing).
|
|
# ──────────────────────────────────────────────────────────
|
|
|
|
## WHY THIS TASK EXISTS
|
|
|
|
Your prior report ("the safe GAP-64 observability slice") was independently verified line-by-line
|
|
against the actual diff, source, and session log (see `DEC-20260908-01` in `decisions.md`). Three
|
|
things you reported check out exactly as claimed:
|
|
|
|
1. The `FileLog` line added to `NT8StrategyBase.OnBarUpdate()`'s catch block — genuine, correctly
|
|
placed, matches the original task.
|
|
2. The new regression test (`NT8StrategyBaseOnBarUpdateVisibilityTests.cs`) — legitimate,
|
|
non-tautological, in the established GAP-057 source-text pattern.
|
|
3. "Today maps to a CME holiday" and "the 2026-09-03 trade belongs to the older
|
|
`20260831_082650` session" — both independently re-confirmed: 2026-09-07 is genuinely Labor
|
|
Day 2026 (first Monday of September, per `CmeHolidayCalendar.cs`'s own rule), and the trade's
|
|
`session_id` in `trades_Simple_ORB_NT8_20260903.jsonl` genuinely matches
|
|
`provenance_Simple_ORB_NT8_20260831_082650.json`, not the session under investigation.
|
|
|
|
None of that, however, answers GAP-064's actual question. Your "Findings" section states that
|
|
`SimpleORBStrategy.OnBar()`'s source paths all call `RecordSignalRejection` before `return null`,
|
|
and that `MaybeWriteStateTelemetry()` doesn't clear the real rejection context — both statements
|
|
about what the *source appears to do*, not about what actually happened at runtime on 2026-09-04.
|
|
|
|
## THE PRECISE, NOW-BOUNDED SYMPTOM
|
|
|
|
Independent verification pinned the anomaly to an exact, reproducible window in
|
|
`session_20260903_143151.log` (which — new finding — actually runs through
|
|
`SESSION END 2026-09-07 20:36:36 ET`, five days, not just through 09-04 as originally framed):
|
|
|
|
- `REJECT SUMMARY: reason=RthGuard count=197` at **2026-09-04 10:00:00.109 ET** (ORB window
|
|
close — the last non-RTH-guarded reject before RTH begins evaluating real setups).
|
|
- The next `RthGuard` increment (`count=200`) does not appear until **16:15:00.239 ET** the same
|
|
day (RTH close, when RthGuard-eligible non-RTH bars resume) — a gap that is itself expected,
|
|
since RthGuard only rejects non-RTH bars and this window IS RTH.
|
|
- **Inside that exact 301-line window** (line 12774 to line 13075 of the log): **75 `STATE:`
|
|
telemetry lines** (matching the expected ~5-minute cadence for 6h15m almost exactly — real,
|
|
moving `DirectionSource=PendingBreakout`/`OpeningRangeMidpoint` evaluations with changing
|
|
scores) and **zero `REJECT:` or `SIGNAL:` lines of any kind.**
|
|
|
|
This is not one bar with a swallowed exception. It is total silence across 75 consecutive,
|
|
apparently-live evaluations spanning an entire RTH trading day. That weighs against "an
|
|
exception was occasionally thrown and silently caught" (which would plausibly be intermittent,
|
|
not 75/75) and toward one of:
|
|
|
|
(b) `SimpleORBStrategy.OnBar()` is genuinely returning `null` on every one of these 75 bars
|
|
through some path that does NOT call `RecordSignalRejection` first — meaning your source
|
|
audit either missed a path, or the path taken differs from what a static read suggests
|
|
(e.g. an early-return guard, a different branch than expected given the day's actual price
|
|
action, or state left over from the prior session/day affecting which branch is taken), or
|
|
(c) `RecordSignalRejection` genuinely is being called and does set
|
|
`context.CustomData["signal_reject_reason"]`, but that key is not surviving to reach
|
|
`LogSignalRejectionFromContext(context)` — e.g. `context` is not the same object reference
|
|
by the time `LogSignalRejectionFromContext` runs, or something between the `OnBar()` call
|
|
and that logging call replaces or clears `context.CustomData`.
|
|
|
|
**This task is diagnostic-first: do not assume which of (b) or (c) it is, and do not assume a
|
|
static source read that "should" cover every path is proof that it does at runtime.**
|
|
|
|
## READ-FIRST
|
|
|
|
1. `session_20260903_143151.log` lines 12774-13075 (2026-09-04, 10:00:00 ET through 16:15:00 ET)
|
|
— the exact window this task investigates. Confirm the same boundary and line count
|
|
independently before proceeding (`grep -n "\[10:00:00\.109\] REJECT SUMMARY"` and
|
|
`grep -n "\[16:15:00\.239\] REJECT SUMMARY: reason=RthGuard"` should reproduce lines
|
|
12774/13075). Read a representative sample of the `STATE:`/`STATE_DETAIL:`/`STATE_CONTEXT:`
|
|
triplets in this window in full, not just the `STATE:` summary line — note the exact
|
|
`DirectionSource` and score progression bar to bar.
|
|
2. `src/NT8.Adapters/Strategies/NT8StrategyBase.cs` `OnBarUpdate()`'s real-evaluation block —
|
|
re-read with fresh eyes specifically for: is `context` the exact same object instance passed
|
|
into `_sdkStrategy.OnBar(barData, context)` that is later passed into
|
|
`LogSignalRejectionFromContext(context)`? Is there any reassignment, cloning, or replacement
|
|
of `context` (or of `context.CustomData` specifically) anywhere between those two calls,
|
|
including inside `MaybeWriteStateTelemetry(barData, context)` if it takes `context` by
|
|
reference and could touch the same dictionary instance rather than building an isolated copy?
|
|
3. `src/NT8.Strategies/Examples/SimpleORBStrategy.cs` `OnBar()` — re-trace the exact branch a
|
|
`PendingBreakout`-direction, no-confirmed-breakout bar takes on 2026-09-04's actual price
|
|
action (use the real `OrbHigh`/`OrbLow`/price levels visible in `STATE_CONTEXT` for that day,
|
|
not a generic case). Confirm which specific line actually executes `return null` (or falls
|
|
through to one) for bars in this window, not merely that "a" `RecordSignalRejection` call
|
|
exists somewhere reachable in the method.
|
|
4. Confirm whether `_sdkStrategy.OnBar(barData, context)` is even reached at all on these bars —
|
|
e.g. instrument with a temporary, clearly-marked diagnostic (removed before commit, or gated
|
|
so it cannot land in the final diff) if source reading alone cannot settle it, per the
|
|
original GAP-064 task's allowance for this.
|
|
|
|
## THE INVESTIGATION
|
|
|
|
1. Determine definitively whether `SimpleORBStrategy.OnBar()` is called on each of the 75 bars in
|
|
the bounded window, and if so, which exact `return` statement is hit each time.
|
|
2. If a `RecordSignalRejection` call IS reached but no `REJECT:` line results, trace
|
|
`context.CustomData["signal_reject_reason"]` from the point it's set through to
|
|
`LogSignalRejectionFromContext(context)` and identify exactly where it stops surviving, if it
|
|
does.
|
|
3. If `OnBar()` is not being reached at all (contradicting the prior report's finding), determine
|
|
what precedes it in `OnBarUpdate()` that could short-circuit before reaching `_sdkStrategy.OnBar`
|
|
without throwing an exception the new `FileLog` line would have caught.
|
|
4. State a definitive root cause, not a list of ruled-out hypotheses. If genuinely unable to
|
|
reach one from source and log evidence alone, say so explicitly and propose the smallest
|
|
additional diagnostic (temporary logging, a targeted unit test reproducing 2026-09-04's actual
|
|
ORB/price conditions) that would.
|
|
5. Once a root cause is confirmed, propose (do not implement without operator sign-off) a fix.
|
|
|
|
## DO NOT
|
|
|
|
- Do not change order-evaluation, sizing, or risk logic based on a hypothesis alone.
|
|
- Do not deploy anything as part of this task.
|
|
- Do not treat "the source appears to cover every path" as equivalent to "verified at runtime" —
|
|
that gap is exactly what this follow-up exists to close.
|
|
|
|
## VALIDATION (operator, after root cause is confirmed and a fix, if any, is proposed)
|
|
|
|
Confirm a subsequent live/SIM session produces `REJECT:`/`REJECT SUMMARY:` lines for
|
|
`OrbRangeNotEstablished` at a normal cadence on a quiet no-breakout RTH day, matching the pattern
|
|
documented in `DEC-20260825-04`/`DEC-20260823-08`.
|
|
|
|
## GOVERNANCE
|
|
|
|
Track as **GAP-064-FOLLOWUP-2** in `SPRINT_BOARD.md`, directly under the existing GAP-064 entry
|
|
(not a new top-level item — this is the same investigation, narrowed). Reference `DEC-20260904-01`
|
|
(original finding) and `DEC-20260908-01` (this follow-up's origin) in the commit and in
|
|
`decisions.md`.
|