diff --git a/SPRINT_BOARD.md b/SPRINT_BOARD.md index f89be36..6b5bd9d 100644 --- a/SPRINT_BOARD.md +++ b/SPRINT_BOARD.md @@ -11,7 +11,7 @@ | Provenance | ✅ | Gate 3 fix serializes grade, score, submitted runner mode, and ORB ticks from the accepted intent/submission data. | | Scenario coverage | 🟡 | 5/8 genuine assertions; 3 explicitly deferred for missing seams. | | Gate Run #2 | ❌ | Contaminated; provenance defects were identified after the run. | -| Gate Run #3 | ⏳ | Freeze capture succeeded: `docs/gate-runs/gate3/baseline.json` from `freeze_20260816_170304`; complete manual NinjaScript compile/re-arm and close GAP-034 before starting the clock. | +| Gate Run #3 | ⏳ | Working tree clean; freeze capture succeeded: `docs/gate-runs/gate3/baseline.json` from `freeze_20260816_170304`; `DEC-GATE3-CONFIG.md` regenerated and still `draft` pending GAP-034. Complete manual NinjaScript compile/re-arm before starting the clock. | > **Gate deployment rule:** Once RB-4.1 is recorded and Gate Run #2 begins, do not dual-deploy to the gate machine. Run GAP-025 and connection-seam work in branches only. diff --git a/TASK_GAP034_CROSSCHECK_PROMPT.md b/TASK_GAP034_CROSSCHECK_PROMPT.md new file mode 100644 index 0000000..b37a3a0 --- /dev/null +++ b/TASK_GAP034_CROSSCHECK_PROMPT.md @@ -0,0 +1,117 @@ +# TASK: GAP-034 — Pre-Cross-Check Prep, Then Operator Diagnostic Session +# Staged: 2026-08-16 (supersedes TASK_GAP035_GAP034_PROMPT.md — GAP-035 already deployed) +# Sprint: Weekend batch 2026-08-15 to 08-17 (strategy DISARMED) — HIGHEST PRIORITY +# ───────────────────────────────────────────────────────────────── + +## Critical framing — read this first + +The working tree is clean, the Gate 3 freeze baseline exists (`freeze_20260816_170304`), and +GAP-035 (rejection-reason `FileLog` routing) is already committed (`4242742`) and deployed via +`deploy-to-nt8.bat`. **Do not redo GAP-035** — the prior prompt assumed it was still open; it +isn't. What's left to close GAP-034 splits into two kinds of work, and only the first kind can +run from here: + +- **Kilocode-actionable now:** triage two current-day session logs already sitting in the log + directory, update governance docs to match reality, and hand the operator an exact, + unambiguous set of steps. +- **Requires a human at the physical NT8 machine:** opening NinjaTrader, the manual compile + check, arming the strategy, and running the live cross-check session. Kilocode cannot do + this — the last preflight run correctly failed with `0 NinjaTrader processes running` + because nothing can open the NT8 GUI from a script. Don't attempt to work around this; + produce the exact checklist and stop. + +## Part 1 — Kilocode-actionable + +1. **Triage the two current-day session logs.** The re-arm preflight run failed with "two + current-day session logs already exist" in the NT8 log directory. Run + `python tools/logtriage/logtriage.py` (or point it at the log directory directly) against + today's date and identify exactly what these two logs are — timestamps, account, whether + they show any SIGNAL/FILL activity or are empty/test artifacts. Do not assume; report what + you actually find. + - If they are pre-deploy test/dev artifacts (no real gate-relevant activity): move them + (don't delete — `git`-style archival, e.g. into a dated `archive/` subfolder under the + log directory or wherever the existing archival convention in this repo puts prior + sessions) so the operator's preflight run for Monday starts against a clean log + directory. State exactly what you moved and where. + - If either log shows real signal/fill activity or anything that looks like it belongs to + today's freeze/deploy work, do NOT archive it — flag it back instead. This could be + relevant evidence and archiving it silently would be exactly the kind of "record went + stale" mistake this project has already made once (Sec 5.11 of the master document). + +2. **Confirm the exact FileLog line format GAP-035 now emits.** Read the diff in `4242742` + for the rejection-reason `FileLog` calls in `NT8StrategyBase.cs` / `SimpleORBStrategy.cs`. + Write one paragraph into `current_status.md`'s GAP-034 section stating the exact line + prefix/format the operator should grep for during the cross-check session (e.g. what a + grade-rejection line vs. an ORB-not-established line vs. a `MaxDailyTrades` latch line + actually look like on disk now). The operator should not have to guess what a "rejection + reason" line looks like when comparing Output window text to the file. + +3. **Update governance to match reality:** + - `SPRINT_BOARD.md`: update the Gate Run #3 row — working tree clean, freeze baseline + captured (`freeze_20260816_170304`), `DEC-GATE3-CONFIG.md` regenerated and still `draft` + pending GAP-034. + - `active_work.md`: move GAP-035 from "Active" to "Deployed 2026-08-16, pending live + cross-check" — it is not fully closed until the operator's session confirms Output and + file agree (DEC-20260814-01's actual closure condition). Do not mark it fully done yet. + - Log the log-directory triage/archival action in `common_failures.md` or as a short + `decisions.md` entry only if it required a judgment call (e.g. you had to decide whether + a log looked like real activity vs. test noise) — routine archival of confirmed test + artifacts doesn't need its own decision entry. + +## Part 2 — Operator handoff (Mo, at the NT8 machine — write this out verbatim as the task's final output so it can be handed off directly) + +Produce this as a numbered checklist in your final report, filled in with any specifics from +Part 1 (e.g. the actual FileLog line format, confirmation the log directory is now clean): + +1. Open NinjaTrader 8 on the gate machine. +2. Let it recompile on startup (the deploy step deleted `NinjaTrader.Custom.dll`/`.pdb` to + force this) — confirm the NinjaScript compile output shows zero errors before proceeding. +3. Re-run preflight in non-freeze mode: + ```powershell + powershell -ExecutionPolicy Bypass -File .\tools\preflight\preflight.ps1 ` + -ExpectAccount "SimSimple ORB" ` + -ExpectInstrument "NQ SEP26" + ``` + All 6 checks must now pass — including the two that failed today (process count, now that + NT8 is open; current-day logs, now that Part 1 has cleared the directory). +4. Arm `SimSimple ORB` per the RB-4.1 parameters, with the NT8 Output window open and visible + for the entire session — this is the cross-check, not optional. +5. Let one full trading session run without interference. +6. After the session, compare what the Output window showed against the session's file log + using the line format confirmed in Part 1, Step 2. They must agree — that is the + cross-check DEC-20260814-01 requires. +7. Two outcomes: + - **A rejection reason is now visible on a would-be signal that didn't fire** — this is + very likely GAP-034's root cause. Note the exact reason string and which of the four + candidates in `current_status.md` it confirms or rules out. + - **The session traded normally / nothing to compare** — report that plainly; the + cross-check simply needs to run again on the next quiet day. Do not treat a normal + trading day as inconclusive-therefore-closed. +8. Report the outcome back so `current_status.md`/`decisions.md`/`active_work.md` can be + updated and RB-4.1 can proceed toward the actual Gate Run #3 start, or GAP-034 can be + narrowed further. + +## Explicit non-goals + +- Do not attempt to script around the missing NT8 process — there is no headless path to + opening NinjaTrader, compiling NinjaScript, or arming a live strategy. Produce the checklist + and stop; this is exactly the boundary between Kilocode's automation and the human + operator's role (Sec 23.3 of the master document). +- Do not mark GAP-034 or GAP-035 fully closed in governance docs until the operator's session + actually confirms the cross-check — a deployed fix with an unconfirmed cross-check is not + the same as a closed gap. + +## Validation + +- Report exactly what the two current-day logs were and what was done with them. +- `current_status.md` GAP-034 section states the exact FileLog rejection-reason format. +- `SPRINT_BOARD.md` and `active_work.md` reflect today's real state (freeze captured, GAP-035 + deployed-pending-crosscheck). +- The Part 2 operator checklist is included verbatim, filled in, ready to execute with no + further clarification needed. + +## Governance + +- No new `decisions.md` entry required unless the log triage forces a judgment call. +- `active_work.md`/`current_status.md` get a follow-up update once the operator reports the + cross-check outcome — that update is a separate, later step, not part of this task. diff --git a/TASK_GAP035_GAP034_PROMPT.md b/TASK_GAP035_GAP034_PROMPT.md index edb79e4..349b4eb 100644 --- a/TASK_GAP035_GAP034_PROMPT.md +++ b/TASK_GAP035_GAP034_PROMPT.md @@ -1,96 +1,7 @@ -# TASK: GAP-035 / GAP-034 — Finish Rejection-Reason File Logging, Then Close the -# Silent Zero-Trade Defect -# Staged: 2026-08-16 -# Sprint: Weekend batch 2026-08-15 to 08-17 (strategy DISARMED) — HIGHEST PRIORITY -# ───────────────────────────────────────────────────────────────── +# SUPERSEDED — see TASK_GAP034_CROSSCHECK_PROMPT.md -## Critical framing — read this first - -This is the true blocker in the chain: GAP-035 blocks GAP-034, GAP-034 blocks RB-4.1, RB-4.1 -blocks Gate Run #3. Three sessions (08-03, 08-04, 08-13) produced zero trades on days with -clear NQ breakouts and the root cause is still unidentified. `current_status.md` has the full -proven/ruled-out analysis and the four remaining candidates — read it before writing any -code. `docs/00-governance/decisions.md` entry DEC-20260814-01 is the formal decision record -for this pair of gaps; its required action is quoted in full below. Do not re-derive the -plan — execute it. - -This task depends on TASK_GATE3_CLEANUP_PROMPT.md landing first (or at least the runtime-diff -portion of it) since the current uncommitted `NT8StrategyBase.cs`/`SimpleORBNT8.cs` changes -may already contain partial GAP-035 work. Check `git log` and the working diff before -starting so you don't duplicate or conflict with what's already in flight. - -## GAP-035 — finish it first - -All four zero-trade candidates currently log via `_logger` only and never reach the session -file. That means a silent no-trade day cannot be diagnosed after the fact unless someone had -the NT8 Output window open live, which defeats the point of file-based provenance. - -Route every signal-rejection reason through `FileLog` alongside `_logger`, for all rejection -paths, not just the four current candidates — any future rejection path should get file -logging for free. Confirm: - -- Existing SIGNAL/SUBMIT/FILL/PNL_UPDATE/BREAKEVEN/RUNNER-closed/CONNECTION lines remain - byte-for-byte unaffected (this is a hard constraint carried over from DASH-002 — the - dashboard and `logtriage` both parse these lines and must not break). -- Rejection-reason lines are gated the same way as other diagnostic lines with respect to - `EnableVerboseLogging` — confirm which behavior is correct by checking how existing - SIGNAL-adjacent diagnostic lines behave today (verbose-gated vs always-on), don't assume. -- A no-trade day now "self-documents": the session file alone, with no Output window - involvement, should be enough to state a specific rejection reason for every evaluated bar - that didn't result in a signal. - -## GAP-034 — then close it - -Per DEC-20260814-01's required action, verbatim: - -> Redeploy during the disarmed window, then run one session with the Output window open as a -> cross-check that file and Output agree. - -Concretely: - -1. Deploy the GAP-035 build during the current disarmed window (2026-08-15 to 08-17 — confirm - you still have time before Monday market open; if not, coordinate re-arm timing with the - operator rather than deploying into a live/armed session). -2. Run one full session with the NT8 Output window open, watching live. -3. In parallel, let the new file logging run. -4. After the session, diff what the Output window showed against what the session file - recorded. They must agree — this is the cross-check, not a formality. If they disagree, - that disagreement is itself the next diagnostic lead; report it exactly, don't paper over - it. -5. With rejection reasons now on record, evaluate against `current_status.md`'s four - remaining candidates and rule in/out based on actual logged reasons from a real session, - not further hypothesis. -6. If the session produces a genuine breakout day with a rejection reason logged, that's - very likely the root cause. If it's another silent zero-trade day, the newly-logged - rejection reasons should say why for the first time — report the exact reason string(s). - -## Explicit non-goals - -- No behavior changes beyond routing existing rejection paths to `FileLog`. This is an - observability task, not a signal-logic change — do not "fix" a candidate cause speculatively - while adding logging; log first, diagnose from real data second. -- Do not touch `MaxDailyTrades`, `risk_mode`, or `ConfigHash` logic here — those are - GAP-032/036/038, tracked and worked separately. - -## Validation - -- Full test suite still passes (500+ expected, confirm exact count). -- Manual NinjaScript compile check passes. -- Existing log line formats unchanged — diff a pre- and post-change session log side by side - and confirm only new rejection-reason lines were added, nothing else changed. -- Deployed source hash matches repo (`preflight.ps1`'s hash check should pass once the freeze - from TASK_GATE3_CLEANUP_PROMPT.md is in place). -- The live-session Output-vs-file cross-check either agrees, or the disagreement is reported - explicitly as a new finding. - -## Governance - -- Update `active_work.md`: move GAP-035 to done, GAP-034 from "Blocked on GAP-035" to - whatever its real post-session state is (closed, or reduced to a smaller specific - candidate). -- If the cross-check session identifies the actual root cause, add a `decisions.md` entry - documenting it and update `current_status.md`'s "proven/ruled-out" table accordingly — - this directly unblocks RB-4.1 and Gate Run #3, so document it precisely enough that the - next reader doesn't have to re-derive the reasoning. -- If GAP-034 closes, flag this back immediately — RB-4.1 (Gate Run #3 configuration freeze) - can proceed as soon as TASK_GATE3_CLEANUP_PROMPT.md's clean freeze is also in place. +This file's original content (finish GAP-035, then diagnose GAP-034) is superseded as of +2026-08-16. GAP-035 was completed and deployed as part of the Gate 3 working-tree cleanup +(commit `4242742`, freeze `freeze_20260816_170304`). The remaining GAP-034 work — log +triage, governance updates, and the operator cross-check checklist — is staged in +`TASK_GAP034_CROSSCHECK_PROMPT.md`. Use that file, not this one. diff --git a/docs/00-governance/active_work.md b/docs/00-governance/active_work.md index 9e6c957..6448520 100644 --- a/docs/00-governance/active_work.md +++ b/docs/00-governance/active_work.md @@ -3,15 +3,17 @@ ## GAP-035 — Rejection-reason file logging (HIGHEST PRIORITY) **Owner:** Kilocode -**State:** Active. Blocks GAP-034, which blocks RB-4.1, which blocks Gate Run #3. +**State:** Deployed 2026-08-16; pending live Output-window-to-file cross-check. It is not fully closed until the operator session confirms Output and session file agree. All four zero-trade candidates log via `_logger` only and never reach the session file. Route every signal-rejection reason through `FileLog` alongside `_logger` so a no-trade day self-documents without requiring the NT8 Output window to have been open. +Pre-cross-check prep completed 2026-08-16: two no-activity current-day session logs were archived to `C:\Users\billy\Documents\NinjaTrader 8\log\nt8-sdk\ARCHIVE\20260816-pre-crosscheck-test-sessions\`, leaving the active log root clean for the operator's next preflight run. + ## GAP-034 — Silent zero-trade defect diagnosis **Owner:** Kilocode (instrumentation) + operator (capture) -**State:** Blocked on GAP-035. See `current_status.md` for the proven/ruled-out analysis. +**State:** Pending operator diagnostic session using deployed GAP-035 file logging. See `current_status.md` for the proven/ruled-out analysis. ## Weekend batch 2026-08-15 to 08-17 (strategy DISARMED) The strategy is off, so this is a disarmed window. Recompiles are permitted. diff --git a/docs/00-governance/current_status.md b/docs/00-governance/current_status.md index b9b384d..f9a8cb7 100644 --- a/docs/00-governance/current_status.md +++ b/docs/00-governance/current_status.md @@ -26,8 +26,9 @@ submission, broker rejection, runner/scaler leg logic, connection-loss latch 2026-08-07 and 2026-08-10 (DEC-20260810-02) between the zero-trade days. Any hypothesis requiring a persistent latch is therefore weakened. -**Remaining candidates** — all four log via `_logger` only (NT8 Output window), never to -file, which is why session logs cannot distinguish them: +**Remaining candidates** — before GAP-035, all four logged via `_logger` only (NT8 Output +window), never to file, which is why historical session logs cannot distinguish them. GAP-035 +is now deployed and should make the next quiet/no-trade session self-documenting: 1. **Grade filter rejection** (composite score below `MinTradeGrade=5` / Grade A) — RANKED FIRST. Score varies day to day, which fits an intermittent pattern exactly. A "clear breakout" visually is not the same as a Grade A confluence score. @@ -39,10 +40,19 @@ file, which is why session logs cannot distinguish them: 4. RTH window guard evaluating outside 09:30-10:00 — WEAKENED for the same reason; a timezone fault would be constant, not intermittent. -**Next step (per DEC-20260814-01):** finish GAP-035 (route all rejection reasons to -`FileLog`), redeploy during the current disarmed window, then run one session with the -Output window open as a cross-check that file and Output agree. Full instructions in -`TASK_GAP035_GAP034_PROMPT.md`. +**Next step (per DEC-20260814-01):** GAP-035 is committed and deployed; the operator must run +one session with the Output window open as a cross-check that file and Output agree. Full +operator instructions are in the GAP-034 handoff checklist. + +**GAP-035 line formats to grep during the cross-check:** new session-file rejection lines use +`REJECT: reason= detail= bar=`. Grade rejections look like +`REJECT: reason=GradeFilter detail=Score= Grade= MinTradeGrade= Factors==x;... bar=