Files
nt8-sdk/docs/00-governance/2026-08-19-run-book.md
mo 34c3767fbf [GOV]: cleanup prompted task state
- 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
2026-08-26 00:59:35 -04:00

17 KiB

NT8-SDK — Today's Run Book

Date: 2026-08-19 Prepared by: Claude (Senior PM role, v7.0 review follow-through) Scope: Execute the six staged TASK_*.md prompts and four proposed decisions from the 2026-08-18 v7.0 review, in a sequence that gets zero-risk items done first and gates every exit-logic or risk-parameter change behind an explicit Mo decision. Governing constraint carried into today: nothing in this run book authorizes Claude to touch src/. Every "run" step below is Kilocode's job, triggered by you handing it the named prompt file after you've made the paired decision.

Source documents this run book operationalizes: SPRINT_BOARD.md (blockers section), docs/00-governance/active_work.md (staged section), docs/00-governance/decisions.md (DEC-20260818-18 through -21), and the six TASK_*.md prompts at repo root.


0. Before you touch anything

  1. git status --short — working tree should show only the governance/doc files from the 2026-08-18/19 review as modified. If src/ shows changes you didn't make, stop and find out why before Kilocode runs anything.
  2. Confirm no live position is open. GAP-054 and GAP-055 both touch behavior that matters mid-trade; don't start either while a position is live.
  3. Confirm which account Kilocode's test/sim runs will use — per gate discipline this should NOT be the frozen live account used for gate evidence.

STATUS 2026-08-19: 🛑 HALTED HERE. The operator ran this checklist and correctly stopped on all three items. Findings (full detail in docs/00-governance/current_status.md § 2026-08-19):

  1. src/ showed two modified files. Investigated and identified as known DASH-002 work-in-progress (trailing-drawdown monitor + state telemetry, both already-accepted decisions) sitting uncommitted — not unauthorized, but must be reconciled (recommend: commit DASH-002 as its own commit) before GAP-054 lands on top of it, so each fix's diff stays isolated and reviewable.
  2. Position status: today's last session log (ended 09:13:39 ET) shows zero entries/exits, consistent with flat — but that's a static file from an already-ended session, not a live query, and does not substitute for checking the actual NT8 Account/Positions tab now that NinjaTrader is confirmed running.
  3. Account: today's session log labels the configured account "gate account SimSimple ORB" in its own warning line. This is the opposite of confirmed-non-gate — needs explicit operator resolution before any SIM/test activity touches NT8, to avoid contaminating gate-run cleanliness the way Gate Run #2 was contaminated (HIST-45).

Nothing past this point in the run book proceeds until items 1-3 above are explicitly resolved by the operator. Plays 2-4 (GAP-048, GAP-047 Part 1) are the exception — zero risk, no account interaction, no src/ conflict with DASH-002 — and remain clear to run.

UPDATE 2026-08-19, later same day — 2 of 3 cleared. Operator confirmed: position flat, NinjaTrader closed, and the account question is moot for now — SimSimple ORB isn't gate evidence; a distinctly gate3-named account will be stood up for the real Gate Run #3. Items 2 and 3 are resolved. Item 1 (uncommitted DASH-002 diff in src/) is still open — NinjaTrader being closed makes this a safe window to commit it, but that's an explicit go/no-go for the operator, not something to do by default. Play 5 (GAP-054) should still hold until this is answered, so the fix lands as an isolated, reviewable diff rather than on top of DASH-002's 881-line uncommitted change.


1. Decision gate — CLEARED 2026-08-19

All five decisions were made today. decisions.md has been updated to accepted for each, and a new entry DEC-20260819-01 was added to sequence the MNQ cutover as a separate follow-on step.

Decision Ask Your call (2026-08-19) Stakes
DEC-20260818-18 Stop applying auto-breakeven to the runner leg (Option 0) Accepted. Parameter-scoping sub-question (flag vs. unconditional skip) resolved by default to unconditional skip, no new flag — flag if you want it different. High — changes live exit behavior
DEC-20260818-19a Resolve MaxTradeRisk/MaxStopTicks collision Accepted — (c) move to MNQ. High — changes risk envelope
DEC-20260818-19b Is MaxTradeRisk per-contract or per-position? Accepted — per-position (total). Requires the Tier 1 check to move to after sizing; now written into TASK_GAP045_GAP046_RISK_GUARDS_PROMPT.md Part 3. Medium
DEC-20260818-20 Approve the split reject-reason taxonomy vocabulary Accepted, as proposed. Zero
DEC-20260818-21 Approve MaxDailyTrades restart-persistence design Accepted, as proposed. Low-medium
DEC-20260819-01 (new) Sequencing: land all code fixes on NQ first, cut over to MNQ as a separate later step with a fresh Gate 3 freeze Accepted — this is my recommendation, written up as its own decision entry so the MNQ switch doesn't get conflated with defect-fix validation. Flag if you'd rather cut over sooner. Medium — affects order, not outcome

All six TASK_*.md prompts are now unblocked. Nothing is waiting on you to clear Section 2 anymore — every Play below can run today.


2. Play by play

Play 1 — Decide. DONE 2026-08-19. All five decisions recorded in decisions.md.

Play 2 — Kick off the two zero-risk tracks in parallel.

  • Hand TASK_GAP048_REJECT_TAXONOMY_PROMPT.md to Kilocode.
  • Hand TASK_GAP047_WEIGHT_RESCORE_PROMPT.md to Kilocode. Both can run at the same time; neither touches runtime behavior.

Play 3 — Review GAP-048 output. IMPLEMENTED 2026-08-23, live/dashboard spot-check pending. Independently verified 2026-08-23. The overloaded KillSwitch, GradeFilter, and TrailingDrawdownBreach labels now split into the DEC-20260818-20 vocabulary while preserving line format and guard behavior. Read the full diff directly: every split maps exactly to the task's suggested vocabulary (PortfolioRisk, MaxTradeRisk, CircuitBreaker, LongTradesDisabled, ShortTradesDisabled, SizeBelowMinContracts, RegimeVeto, TrailingDrawdownNotConfigured), the real KillSwitch path (~721) and the genuine GradeFilter grade-threshold rejection (SimpleORBStrategy ~677) were correctly left untouched, and no REJECT:/REJECT SUMMARY: literal format string changed. Two of the three new tests call real production code and are sound. The third (RejectLineFormat_DiffersOnlyByReasonToken) is tautological — it compares two hand-written literal strings rather than exercising any production code — logged as GAP-058 (decisions.md DEC-20260823-02) and since fixed and committed (f45adca, verified: the replacement test now drives RecordSignalRejection twice and compares real output). Remaining operator validation: after manual NT8 compile, run one live/SIM diagnostic session and confirm REJECT SUMMARY shows distinct reasons and dashboard rejection panels render them.

Play 4 — Review GAP-047 output and apply runtime weights. DONE 2026-08-23. Part 1: Kilocode built tools/rescore/rescore_weights.py, scanned 182 session logs, reproduced the required worked example exactly (equal=0.640, designed=0.727), and reported the STATE telemetry population (923 samples, direction-degraded per GAP-049) separately from the real signal population (81 samples), per the task's caveat. Independently re-derived the headline numbers from the raw distribution tables in GAP-047_weight_rescore_output.md rather than trusting the summary — they check out, including that the signal population's "25 cross into A" figure is a gross count net of a small number of downgrades (consistent with the report's own note that some real signals score worse under designed weights). Part 2: DEC-20260823-01 was accepted, and TASK_GAP047_PART2_WEIGHT_RUNTIME_PROMPT.md applied the five designed baseline weights in ConfluenceScorer.cs with no normalization, calculator, threshold, or adapter/NinjaScript changes. Automated proof now covers default total weight 5.85, the worked example at 0.727 / Grade B, and UpdateFactorWeights() override behavior. A fresh gate freeze is required before gate evidence after this scoring-policy change.

Play 5 — Runner trail fix (DEC-18 accepted). DONE 2026-08-21, source-verified. Committed 2026-08-23 as its own isolated commit (28c30bc), exactly as recommended in Section 0. Kilocode implemented Option 0: removed the OnBarUpdate() SetStopLoss call on the runner signal, added no new SetTrailStop call, removed the stale Diag_Breakeven draw, cited NT8's own API docs on the mutual-exclusivity behavior. Independently re-read the changed code directly (not just the report) — confirmed. Build/tests/deploy all passed, hash matches. Two low-priority follow-ups logged in the process (GAP-056: breakeven params now fully inert, not scaler-scoped as previously assumed; GAP-057: no test seam for NT8 managed-order call assertions) — see decisions.md DEC-20260821-01. The DASH-002 reconciliation from Section 0 is also resolved — committed as d84949c ahead of the GAP-054 commit, working tree is clean.

Play 6 — Validate GAP-054 before any live exposure. STILL PENDING — this is the next actual step. NinjaTrader needs to be reopened for a manual NinjaScript compile, then a SIM trade run reaching +25 ticks or more, confirming no BREAKEVEN runner stop -> line appears and the runner's exit is materially better than entry + 1 tick (a trail stop in the execution grid, not a fixed stop), and that the scaler leg's target behavior is unchanged. Only after this passes is GAP-054 done and RUNNER-001 unblocked.

Play 7 — Risk guards, all three parts (DEC-19a/19b accepted). IMPLEMENTED 2026-08-23, manual NQ SIM validation pending. Independently verified 2026-08-23. TASK_GAP045_GAP046_RISK_GUARDS_PROMPT.md now fails startup for incoherent risk-envelope pairs, confirms MNQ is already $0.50 in both hardcoded tick-value tables, and moves the live NT8 per-position MaxTradeRisk check to after sizing so StopTicks * TickValue * Qty <= MaxTradeRisk is enforced. Read the full BasicRiskManager.cs/NT8StrategyBase.cs diffs directly: the four RiskEnvelopeValidator.ValidateStartupConfiguration assertions match Part 1 exactly (notably MaxTradeRisk <= DailyLossLimit, the corrected per-position formula, not the old MaxTradeRisk * MaxContracts), the old pre-sizing risk block was removed rather than duplicated, and the new order flow is size-then-validate as required. No errors found. Build/tests/deploy passed with backup 20260823_144817. Remaining validation: manual NT8 compile, NQ SIM guard checks, and high-ATR signal behavior. The MNQ cutover is still Play 11 and was not started.

Play 8 — MaxDailyTrades persistence (DEC-21 accepted). IMPLEMENTED 2026-08-23, manual SIM restart validation pending. Independently verified 2026-08-23. TASK_GAP055_MAXDAILYTRADES_PERSIST_PROMPT.md now persists {trading_date, daily_trade_count, account, strategy_name, symbol} to daily_trade_count_<AccountName>_<StrategyName>.json, rehydrates same-date count, resets and overwrites on a new trading date, and skips file I/O when Account == null. Read the full diff across all three touched source files (SimpleORBStrategy.cs, NT8StrategyBase.cs, SimpleORBNT8.cs): the daily_trade_count_* parameter keys are wired consistently end-to-end — SimpleORBNT8.cs seeds them into StrategyConfig, NT8StrategyBase.cs passes them again at State.Realtime and on every realtime CustomData build (gated on Account != null), and SimpleORBStrategy.cs consumes them for persistence/rehydration. Trading-date derivation correctly reuses existing Session.SessionStart infrastructure rather than reinventing an 18:00 ET calculation. Automated tests cover same-date restore, new-date reset, corrupt file, backtest no-I/O, and the 2026-08-16 19:12 / 2026-08-17 11:04 same-CME-date scenario — the key Persistence_SundayEveningAndMondayMorning_ResolveToSameCmeTradingDate test read in full and confirmed legitimate (two real strategy instances simulating an actual restart). No errors found. Remaining validation: manual NT8 compile plus SIM restart test confirming the next same-day signal rejects with REJECT: reason=MaxDailyTrades.

Play 9 — GAP-049 telemetry direction fix. IMPLEMENTED 2026-08-23, live/SIM STATE_DETAIL spot-check pending. Independently verified 2026-08-23. SimpleORBNT8.BuildStateTelemetryIntent() now builds a clone of DailyBarContext (confirmed it's a struct in FactorCalculators.cs — the daily = source copy is safe for this use because only scalar fields are reassigned on the clone, never the shared array fields), sets clone-only TradeDirection/BreakoutBarVolume/TodayOpen/AvgIntradayBarVolume from the telemetry intent's own side and the pre-existing stable session_open_price/avg_volume context fields (not fabricated — both already used by the real trade path in SimpleORBStrategy.cs), and attaches orb_range_ticks metadata. The shared _strategyConfig.Parameters["daily_bars"] object is never mutated, satisfying DEC-20260818-06. Read the full diff directly — confirmed. The P1-E gap-magnitude finding checks out on its own evidence: the same session log reported the "-523.25" gap as different values throughout one RTH session (roughly -389.75 to -555.75 per the decisions.md entry), which by itself proves it was reading a drifting current-bar value rather than a fixed overnight open, independent of the cited external NQ close/open figures. New tests: OrbConfluenceFactorTests.cs's GapDirection_LargeDownGapForSell_ScoresOneAndAligns executes the real GapDirectionAlignmentCalculator against the exact cited 30096/30077 values and confirms Score=1.0, "aligns with trade" — legitimate. SimpleORBNT8DefaultsTests.cs's two new tests are source-text assertions (grep the compiled method body for expected lines), not execution tests — this matches the file's pre-existing pattern for this NinjaScript-derived adapter class, which can't be instantiated outside NT8 to test by execution; not a new GAP-058-style tautology, just a weaker coverage tier used because a real execution seam doesn't exist here. No errors found. Remaining validation: manual NT8 compile, then one live/SIM session confirming STATE_DETAIL for a sell setup with a down gap reports aligned, and OrbRangeVsAtr no longer reads "no daily bar context available" when warm-up is satisfied.

Play 10 — Close out today's six items. For every item completed today: flip its decisions.md Status to implemented as appropriate, update SPRINT_BOARD.md and active_work.md to move it out of the blockers section, and commit the governance-doc changes. Leave anything not completed today explicitly marked with what's left and why.

Play 11 — MNQ cutover (DEC-20260819-01), only after Plays 5-8 all pass validation. This is a separate, later step — not part of today's six tasks. Once GAP-054, GAP-045/046, and GAP-055 have landed and validated on NQ: stage a new TASK_MNQ_CUTOVER_PROMPT.md (not yet written), reconfigure the strategy instance to trade MNQ, retune MaxTradeRisk/MaxStopTicks/MaxContracts for MNQ's $0.50/tick economics rather than carrying over NQ-era values unexamined, then run preflight.ps1 --freeze and record a new DEC-GATE3-CONFIG before collecting any gate-run evidence on MNQ. Don't compress this into the same session as the code fixes — if something breaks, you want to know whether it was a defect fix or the instrument switch.


3. Stop conditions — halt and escalate rather than push through

  • Any existing test fails after a Kilocode change.
  • Kilocode touches a file outside the task's explicit DO list.
  • Anything in Play 5-6 (GAP-054) is tested against the live frozen account before sim/replay validation passes.
  • Play 11 (MNQ cutover) starts before Plays 5-8 have all validated on NQ.
  • Kilocode changes the traded instrument as a side effect of Play 7 — that's explicitly out of scope for TASK_GAP045_GAP046_RISK_GUARDS_PROMPT.md.

4. End-of-day checklist

  • Section 1 decisions recorded — all accepted 2026-08-19
  • GAP-048 taxonomy: implemented, tested, SPRINT_BOARD updated; manual NT8/dashboard spot-check pending
  • GAP-047 Part 1/2: study delivered, DEC-20260823-01 accepted, runtime designed weights implemented and tested
  • GAP-054 runner trail: implemented, validated on sim/replay before any live gate run
  • GAP-055 persistence: implemented and automated restart/rollover-boundary tests passed; manual SIM restart validation pending
  • GAP-045/046 all three parts: implemented on NQ, including the post-sizing Tier 1 reorder and the MNQ tick-table check; manual NQ SIM validation pending
  • GAP-049 telemetry: implemented and tested; -523.25 anomaly root-caused (data-alignment defect, not a real gap) and fixed; manual NT8 compile + live/SIM STATE_DETAIL spot-check pending
  • git status --short re-checked: confirm exactly the files each TASK prompt's DO list authorized, nothing else
  • SPRINT_BOARD.md, active_work.md, decisions.md all reflect end-of-day state
  • MNQ cutover (Play 11) explicitly NOT started until the six items above are validated — confirm it's still pending, not skipped