**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.
| **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-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.** Confirm the four overloaded KillSwitch paths and four overloaded GradeFilter paths now log distinguishable reasons, that existing log-line formats are unchanged (only the reason string), and that the existing test suite still passes. Mark SPRINT_BOARD entry done.
**Play 4 — Review GAP-047 output.** This is a study, not a change — read the re-scoring report (equal-weight vs. designed-weight composite against historical STATE:/SIGNAL_DETAIL: lines). Confirm it reports the pre/post GAP-049 telemetry populations separately, per the task's caveat. Do NOT apply any weight change from this yet; it's an input to a future decision, not an approved fix.
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. **Not committed yet** — sits on top of the still-unreconciled DASH-002 diff from Section 0; recommend two separate commits (DASH-002 first, GAP-054 second) when the operator is ready to commit.
**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).**
Hand `TASK_GAP045_GAP046_RISK_GUARDS_PROMPT.md` to Kilocode in full — Part 3 is now written as directly actionable: implement the Tier 1 check reordering (post-sizing, `Qty`-aware) and confirm MNQ is present and correctly valued in both `GetTickValue` tables (GAP-052) as prep for the later cutover. **Do this on the current NQ configuration — do not switch the traded instrument as part of this task.** That's Play 11.
Hand `TASK_GAP055_MAXDAILYTRADES_PERSIST_PROMPT.md` to Kilocode. Validate with a manual restart test spanning a simulated 18:00 ET rollover boundary — confirm the count persists across a restart within the same trading day and resets across the boundary.
**Play 9 — GAP-049 telemetry direction fix.**
No decision gate — this is dashboard/telemetry accuracy only. Hand `TASK_GAP049_TELEMETRY_DIRECTION_PROMPT.md` to Kilocode any time today. Validate by re-checking the implausible -523.25 point gap value the task flags; confirm it resolves to a sane number after the fix.
**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
- [x] Section 1 decisions recorded — all accepted 2026-08-19
Full detail: `docs/NT8_SDK_Master_Document_v7.0_Complete.docx`.
| Order | Item | Prompt | Owner | Blocking |
|---|---|---|---|---|
| 1 | **GAP-046** — set `AccountStartingBalance` or disable `EnableTrailingDrawdown` | operator action, no code | Operator | Every entry, from 14:30 ET daily |
| 2 | **GAP-045/046 guards** — resolved: MNQ (cutover staged separately) + per-position semantics | `TASK_GAP045_GAP046_RISK_GUARDS_PROMPT.md` (Part 3 now actionable) | Kilocode, on current NQ config | All high-ATR days |
**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.
**State:** Deployed 2026-08-17 (deploy-to-nt8.bat, backup `20260817_180455`); DEC-20260817-01/02 provenance fixes deployed in the same pass, source hashes verified against repo. `NinjaTrader.Custom.dll`/`.pdb` confirmed absent — clean recompile is queued for next NT8 launch. Not yet compiled or cross-checked live.
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
@@ -13,6 +13,300 @@ Use this file to record durable project decisions that affect implementation pat
## Decision Log
### DEC-20260821-01
- **ID:** DEC-20260821-01
- **Date:** 2026-08-21
- **Status:** logged, no operator decision needed — tracking only
- **Context:** Discovered while independently verifying the GAP-054 implementation (source read of `NT8StrategyBase.cs`). Two small residual items surfaced that the GAP-054 task didn't require closing but that shouldn't get lost:
1.**GAP-056 — `EnableAutoBreakeven`/`BreakevenTriggerTicks`/`BreakevenOffsetTicks` are now fully inert.** The only code path that ever read them was the runner breakeven block GAP-054 removed; there was never a separate scaler-leg breakeven implementation. All three parameters remain declared and defaulted in the strategy's NinjaTrader UI but do nothing. Not a trading-risk item — inert means harmless — but an operator setting `EnableAutoBreakeven=true` in the UI would reasonably expect it to do something. Recommended fix, low priority: either mark the parameters `[Browsable(false)]`/update their `Description` attributes to state they're currently unused, or remove them outright in a later cleanup pass.
2.**GAP-057 — no test seam exposes NinjaScript's `SetStopLoss`/`SetTrailStop` managed-order calls.**`TASK_GAP054_RUNNER_TRAIL_PROMPT.md` asked for a regression test asserting no `SetStopLoss` call is issued after `SetTrailStop` for a runner signal, with instructions to propose the smallest seam if none exists. Kilocode correctly did not fabricate coverage, but a concrete seam proposal wasn't written up. This is the same defect class as GAP-054 (silent exit-order clobbering) — worth closing so a future change to this block gets real regression coverage instead of relying on manual source review, as this review just did.
- **Decision:** Track both, do not action either as part of GAP-054. No operator decision required to log them.
- **Action Required:** None immediate. Stage as low-priority follow-up prompts when convenient.
### DEC-20260819-01
- **ID:** DEC-20260819-01
- **Date:** 2026-08-19
- **Status:** accepted
- **Context:** DEC-20260818-19 resolved the MaxTradeRisk/MaxStopTicks collision by moving the traded instrument from NQ to MNQ. This is a materially larger change than the other five items staged 2026-08-18: it changes `ConfigHash`, invalidates every settings/provenance export and gate-run comparison made under NQ, and interacts with the roadmap's Stage 2 instrument sequencing (Section 9.5, P2-0, already documented in the v7.0 master document as a future step — this decision brings it forward rather than introducing it new). Layering an instrument cutover on top of unvalidated defect fixes (GAP-054, GAP-045/046, GAP-055) would make it impossible to tell, if something went wrong, whether the cause was a code defect or the instrument switch.
- **Decision:** Sequence the MNQ cutover as its own final step, after — not concurrent with — the code-level fixes:
1. Land and validate GAP-048, GAP-047 (Part 1), GAP-054, GAP-045/046 (Parts 1-3), GAP-055 on the current NQ configuration, in SIM/replay, per each task's own validation section.
2. Only once all of the above pass validation, execute the MNQ instrument cutover: confirm MNQ is present in both hardcoded tick-value tables (GAP-052 — `BasicRiskManager.GetTickValue` and `BasicPositionSizer.GetTickValue`), reconfigure the strategy instance to MNQ, and re-tune `MaxTradeRisk`/`MaxStopTicks`/`MaxContracts` for MNQ's $0.50/tick economics rather than leaving NQ-era values in place unexamined.
3. Run `preflight.ps1 --freeze` and produce a new `DEC-GATE3-CONFIG` for the MNQ configuration before any gate-run evidence is collected on it. Prior NQ-based gate evidence remains valid for its own record but is not comparable to post-cutover results.
- **Consequences:** Adds a discrete cutover step to the roadmap rather than folding it into GAP-045/046; keeps defect-fix validation and instrument-change validation from being confounded. Historical Strategy Analyzer/backtest results tied to NQ tick economics are not directly comparable post-cutover.
- **Action Required:** Execute in the order above. Flag to Claude/Mo once step 1 items are all validated so the MNQ cutover task can be staged as its own TASK_*.md prompt.
### DEC-20260818-21
- **ID:** DEC-20260818-21
- **Date:** 2026-08-18
- **Status:** **accepted** (2026-08-19)
- **Operator Decision (2026-08-19):** Accepted as proposed — persist the daily trade count using the DEC-20260818-17 halt-file pattern, rehydrate at `State.Realtime`, align to the CME 18:00 ET rollover.
- **Context:** `MaxDailyTrades` is enforced from `_dailyTradeCount`, a plain in-memory field in `SimpleORBStrategy.cs` (~39) zeroed at construction (~269) and on session rollover (~756, ~961). Nothing persists it across a strategy stop/start. The CME trading date 2026-08-17 (beginning 18:00 ET Sunday 08-16) took two trades under `MaxDailyTrades=1`: 08-16 19:12 (+$277.72, `session_20260816_181528.log`) and 08-17 11:04 (+$267.72, `session_20260817_110049.log`), in two different NT8 sessions. NT8 itself treated them as one trading day — the first `PNL_UPDATE` of the 11:04 trade reads `DayPnL=$271.96` (the prior trade's $277.72 less the $5.76 entry commission) and the session closes at `DayPnL=$545.44`. This is the same class as the 7/28 breach that contributed to voiding Gate Run #2 (HIST-45) and is NOT closed by GAP-032, which fixed the within-session position-flat reset only.
- **Decision:** Persist `{trading_date, daily_trade_count, account, strategy_name, symbol}` to `{LogDirectory}/daily_trade_count_<AccountName>_<StrategyName>.json` on each increment, and rehydrate at `State.Realtime` entry when the persisted trading date matches. Reuse the persistence pattern already established for the Conservative trailing-drawdown halt file (DEC-20260818-17) rather than inventing a second mechanism. Align the trading-date boundary with the CME session rollover (18:00 ET) rather than the calendar date, using `SessionManager` or NT8's own session date if either already exposes it. Strategy Analyzer/backtest (`Account == null`) must neither read nor write the file so backtest behaviour is byte-for-byte unchanged.
- **Consequences:** Gate discipline explicitly contemplates restarts (recompiles, workspace changes, connection recovery), so without this a gate run under `MaxDailyTrades=1` cannot guarantee its own cap and its sample is uninterpretable in the same way the previous two were. Adds a small file-I/O dependency to the realtime path; a missing or corrupt file must degrade to count-zero plus a WARNING, never an exception.
- **Action Required:** Accepted. Execute `TASK_GAP055_MAXDAILYTRADES_PERSIST_PROMPT.md`; then verify by taking one SIM trade, restarting the strategy the same trading day, and confirming the next signal is rejected with `REJECT: reason=MaxDailyTrades`.
### DEC-20260818-20
- **ID:** DEC-20260818-20
- **Date:** 2026-08-18
- **Status:** **accepted** (2026-08-19)
- **Operator Decision (2026-08-19):** Taxonomy split approved as proposed — no changes to the vocabulary list.
- **Context:** Three of the nine reject reasons in production are overloaded. `KillSwitch` is emitted by four distinct paths in `NT8StrategyBase.cs` — the actual kill switch (~721), a portfolio-risk block (~1970), a Tier 1 per-strategy risk rejection (~2000) and a circuit-breaker open (~2055). `GradeFilter` is emitted by four paths across `NT8StrategyBase.cs` (~1979, ~1986, ~2020) and `SimpleORBStrategy.cs` (~613/~622, ~650). `TrailingDrawdownBreach` covers both a genuine breach and an unconfigured monitor. `REJECT SUMMARY` aggregates on `reason`, and `LogRejectRateLimited()` emits the disambiguating `detail` line only on the first occurrence per reason, so the aggregate counts are the only thing an operator or the dashboard sees. Demonstrated: `session_20260817_082103.log` logged `reason=KillSwitch count=647` from a real kill switch, and `session_20260818_071117.log` logged `reason=KillSwitch count=5` from a `MaxTradeRisk` rejection. This directly defeats the purpose GAP-035 was built for.
- **Decision:** Split the reject vocabulary into distinct reasons — `KillSwitch`, `PortfolioRisk`, `MaxTradeRisk`, `CircuitBreaker`, `LongTradesDisabled`, `ShortTradesDisabled`, `SizeBelowMinContracts`, `RegimeVeto`, `GradeFilter` (genuine grade rejection only), `TrailingDrawdownBreach` (real breach only) and `TrailingDrawdownNotConfigured`. Logging only: no guard condition, ordering or outcome may change, and the `REJECT:` / `REJECT SUMMARY:` line formats must remain byte-identical apart from the `reason=` token. The `HistoricalReplayCatchup` exemption inside `LogRejectRateLimited()` (DEC-20260818-08) is preserved.
- **Consequences:** The reason vocabulary becomes a contract for `tools/dashboard/parsers.py`, `tools/logtriage/logtriage.py` and `tools/logwatch/logwatch.py`; those parsers are believed reason-agnostic and must be read to confirm it rather than assumed. Splitting reasons slightly increases `REJECT:` detail-line volume, since rate limiting is per unique reason. `OrbRangeNotEstablished` retains its three sub-states under one reason for now — they are already distinguishable in `detail` and this is lower priority.
- **Status:** **accepted** (2026-08-19). Both decisions made.
- **Operator Decision (2026-08-19):** Decision 1 → **(c) move to MNQ.** Decision 2 → **per-position (total), not per-contract.** MaxTradeRisk is now the ceiling on total single-trade dollar risk across all contracts in the position, not a per-contract stop-distance ceiling.
- **Consequence of Decision 2 for the Tier 1 check:** the ordering change flagged as "must not be made without an approved decision" in the original entry is now approved. `BasicRiskManager`'s Tier 1 check must move to after `BasicPositionSizer` determines quantity (or take an estimated/candidate quantity) so that `StopTicks × tickValue × Qty ≤ MaxTradeRisk` is the actual enforced inequality, replacing today's `StopTicks × tickValue ≤ MaxTradeRisk` with no `Qty` term.
- **Consequence of Decision 2 for Part 1 Assertion D (TASK_GAP045_GAP046):** under per-contract semantics the original assertion was `MaxTradeRisk × MaxContracts ≤ DailyLossLimit`, reflecting a worst case scaled by contract count. Under per-position semantics, `MaxTradeRisk` already *is* the worst-case single-trade dollar loss regardless of contract count, so the correct assertion is `MaxTradeRisk ≤ DailyLossLimit` (a single trade must not be able to consume the whole daily loss limit on its own). This is a strictly tighter, simpler, and safer bound than the one it replaces — worst-case single-trade risk drops from the previously undefined-in-practice $600 to whatever `MaxTradeRisk` is explicitly set to.
- **Sequencing (see DEC-20260819-01 below):** the risk-guard code changes (Parts 1–3 of `TASK_GAP045_GAP046_RISK_GUARDS_PROMPT.md`) are instrument-agnostic and should land and be validated on the current NQ configuration first. The MNQ instrument cutover itself is a separate, subsequent deployment step — see DEC-20260819-01.
- **Context (original):** Two independent live outages on 2026-08-18 traced to parameter pairs that are individually valid and jointly impossible. (1) `BasicRiskManager.CalculateTradeRisk()` returns `intent.StopTicks * tickValue` with no quantity term, evaluated before sizing. On NQ at $5.00/tick, `MaxTradeRisk=$200` caps the stop at 40 ticks while `MaxStopTicks=50` (=$250) is configured, so the top 20% of the ATR stop range is unreachable. `session_20260818_071117.log` at 10:10:24 ET: five valid `SIGNAL: Sell NQ` lines, zero submissions, `REJECT: reason=KillSwitch detail=Risk manager rejected: Trade risk too high: $225.00`. `MinContracts=1` is already the floor, so the trade was unplaceable rather than resizable. (2) Separately, the parameter's display name is "Max Trade Risk" and master document v6.4 §3.2 documents the Tier 1 formula as `(StopTicks × TickVal × Qty) > MaxTradeRisk`. The code has never had the quantity term, so worst-case position risk is `MaxTradeRisk × MaxContracts` = $600 against a $1,000 `DailyLossLimit`.
- **Decision (proposed, two parts):** **Decision 1 — resolve the collision.** Choose one of: (a) `MaxTradeRisk = $250`, making `MaxStopTicks=50` reachable and raising per-contract worst case 25%; (b) `MaxStopTicks = 40`, leaving nothing unreachable but tightening the stop relative to ATR on volatile days and raising stop-out rate; (c) validate on MNQ at $0.50/tick, where 50 ticks = $25 per contract, the collision disappears entirely and sizing becomes granular enough for `MaxContracts` to do real work. **Decision 2 — define the semantics.** State explicitly whether `MaxTradeRisk` is a per-contract stop-distance ceiling (what the code does today) or a per-position risk limit (what the name and the master document imply). If per-position, the Tier 1 check must move to after sizing or take an estimated quantity — a real ordering change that must not be made without this entry being accepted first. Independently of both, add startup assertions in the GAP-003 style for: `EnableTrailingDrawdown ⇒ AccountStartingBalance > 0`; `MaxStopTicks × tickValue ≤ MaxTradeRisk`; `MinContracts ≤ MaxContracts`; and a bound relating `MaxTradeRisk × MaxContracts` to `DailyLossLimit`.
- **Consequences:** Either value change alters `ConfigHash` and requires a fresh freeze capture and a new `DEC-GATE3-CONFIG`. Option (c) is a larger strategic change than a parameter edit and interacts with the roadmap's instrument sequencing; it is also the only option that removes the class of problem rather than an instance of it. Until Decision 2 is answered, the system's true worst-case single-trade loss is undefined in the documentation and under-enforced in the code, which is the largest open drawdown exposure in the project.
- **Action Required:** Both decisions made — see above. Execute `TASK_GAP045_GAP046_RISK_GUARDS_PROMPT.md` in full (Part 3 is now unblocked) on the current NQ configuration. Hold the MNQ instrument cutover itself for DEC-20260819-01's sequencing.
### DEC-20260818-18
- **ID:** DEC-20260818-18
- **Date:** 2026-08-18
- **Status:** **implemented** (2026-08-21). Supersedes DEC-20260810-02 and DEC-20260815-01 on the runner question.
- **Operator Decision (2026-08-19):** Accepted — stop applying auto-breakeven to the runner leg.
- **Parameter-scoping sub-question resolution:** the entry left open whether `EnableAutoBreakeven` becomes runner-scoped-off by default or gains a separate `EnableRunnerBreakeven` flag. Not addressed in the 2026-08-19 acceptance message. Default resolved here rather than blocking implementation: **unconditionally skip breakeven on the runner leg in the `OnBarUpdate` block; do not add a new flag.** Rationale — a trailing stop already dominates a frozen breakeven at every point once GAP-054 is fixed, so a toggle to re-enable the strictly worse behavior adds parameter surface and testing burden without a scenario where an operator would want it. `EnableAutoBreakeven`/`BreakevenTriggerTicks`/`BreakevenOffsetTicks` continue to govern the scaler leg only, unchanged. If Mo wants the flag instead of the unconditional skip, say so and this line will be revised before Kilocode implements it.
- **Context:** `SetStopLoss()` and `SetTrailStop()` are mutually exclusive per signal name in NinjaScript — the later call replaces the earlier exit order. `SubmitOrderToNT8()` (`NT8StrategyBase.cs` ~2178-2196) arms the runner correctly with `SetStopLoss` then `SetTrailStop(_runnerSignalName, Ticks, RunnerTrailTicks)` then `EnterLong/EnterShort`. But the auto-breakeven block in `OnBarUpdate()` (~797-804) then calls `SetStopLoss(_runnerSignalName, CalculationMode.Price, bePrice, false)`, replacing the live trail with a static stop at entry + `BreakevenOffsetTicks`. The runner never trails again. All four broker-confirmed trades log it: `BREAKEVEN runner stop -> ... profit=28/25/24/26 ticks`, at which points a 12-tick trail would have sat at +16/+13/+12/+14 ticks while the stop was moved to +1. The breakeven action therefore moves the stop backwards, giving back 11-15 ticks of already-locked profit and freezing. Conservative floor estimate: 55 ticks (~$275 gross, ~$252 net) versus the $25 gross / $1.96 net actually realised — roughly 24% of total realised P&L. Two secondary defects sit in the same block: `entryPrice` is `Position.AveragePrice`, the blended average across both legs rather than the runner's own fill (on 2026-08-16 producing the off-tick breakeven price 30200.08 on a 0.25-tick instrument), and `Calculate = OnBarClose` means `BreakevenTriggerTicks = 20` actually fires at 24-28 ticks.
- **Decision (proposed):** Stop applying auto-breakeven to the runner leg. A trailing stop already provides monotonically improving protection and does so better than a frozen breakeven at every point. `EnableAutoBreakeven`, `BreakevenTriggerTicks` and `BreakevenOffsetTicks` remain as parameters; whether they become runner-scoped-off by default or gain a separate `EnableRunnerBreakeven` flag defaulting to false is an open sub-question for the operator. The existing prohibition on calling `SetTrailStop()` inside `OnBarUpdate` (which would reset the trail anchor to bar-close price — a real defect diagnosed 2026-04-13) stands unchanged. Before implementation, NinjaTrader's own documentation must be cited confirming the mutual-exclusivity behaviour; if it documents otherwise, the task stops and reports.
- **Consequences:** This supersedes the framing in DEC-20260810-02 and DEC-20260815-01, both of which treated the runner as a parameter-placement problem and deferred or scoped a breakeven-trigger retune. The runner has in fact never been tested, so its economics are unknown rather than poor, and the earlier conclusion that it might be worth disabling was drawn from data the defect produced. **RUNNER-001 must not execute until this lands** — an 18-combination sweep over breakeven trigger × trail distance against a disabled trail would return a trail axis with no effect and a confident, meaningless recommendation. Historical Strategy Analyzer results involving the runner leg are not comparable across this change.
- **Implementation Note (2026-08-21):** Implemented Option 0 in `NT8StrategyBase.cs`: `OnBarUpdate()` no longer calls `SetStopLoss()` or `SetTrailStop()` for `_runnerSignalName` after entry, and the stale runner breakeven diagnostic draw is removed. Local installed NT8 API documentation citation: `C:\Program Files\NinjaTrader 8\bin\NinjaTrader.Core.xml` documents `StrategyBase.SetStopLoss(string, CalculationMode, double, bool)` as tying the stop-loss exit to `fromEntrySignal`, and `StrategyBase.SetTrailStop(string, CalculationMode, double, bool)` as tying the trail-stop exit to `fromEntrySignal` with trail stops amended tick-by-tick. The implementation preserves the single entry-time `SetTrailStop()` call so NT8 owns the live runner trail. Verified 511/511 (`verify-build.bat`) and 422/422 (`NT8.Core.Tests`) passing, `deploy-to-nt8.bat` succeeded, deployed source hash confirmed matching the repo.
- **Independent source verification (Claude, 2026-08-21):** Read the post-change `OnBarUpdate()` block directly (not just the report) — confirms no `SetStopLoss`/`SetTrailStop` call remains for `_runnerSignalName`, the block is now a comment-only no-op, and the `BREAKEVEN runner stop ->``FileLog` line is gone (not merely the chart draw object). **Correction to this entry's own "Parameter-scoping sub-question resolution" line above:** it stated `EnableAutoBreakeven`/`BreakevenTriggerTicks`/`BreakevenOffsetTicks` "continue to govern the scaler leg only, unchanged." Source inspection shows this was never true — the original breakeven block only ever acted on `_runnerSignalName`; there was no separate scaler-leg breakeven path in the pre-fix code for it to have governed. All three parameters are declared, defaulted (`EnableAutoBreakeven=true`, `BreakevenTriggerTicks=20`, `BreakevenOffsetTicks=1`), and referenced once in a settings-export/log line — but are now fully inert with no functional effect anywhere. This is functionally fine (matches the intended zero-breakeven outcome) but is a stale-parameter hygiene issue, not a scaler-leg regression. Tracked as GAP-056 below rather than left as a silent contradiction in this entry.
- **Action Required:** Deployed on 2026-08-21, not yet committed ("commits require explicit request" — operator to decide, see current_status.md). Manually compile NinjaScript, then validate on SIM/replay — NOT the live frozen account — that no `BREAKEVEN runner stop ->` line appears and the runner exits materially above entry + 1 tick before this is eligible for a live gate run. **This validation has not yet happened — GAP-054 still blocks RUNNER-001 until it does.**
### DEC-20260818-17
- **ID:** DEC-20260818-17
- **Date:** 2026-08-18
- **Status:** accepted
- **Context:** Funded-prop trailing drawdown risk must be tracked at the account level, not by strategy name. `PortfolioRiskManager` is intentionally not reused as the model because it is currently keyed by strategy name only, which is GAP-042 and would silently let two strategies on one account each maintain a separate drawdown buffer.
- **Decision:** Add an account-keyed `TrailingDrawdownMonitor` inside `NT8StrategyBase` with one shared high-water/lock/breach state per `Account.Name`. Equity is read with `Account.Get(AccountItem.NetLiquidation, Currency.UsDollar)`; installed NT8 API metadata confirms `AccountItem.NetLiquidation` exists and labels it as Net liquidation, with separate `CashValue`, `RealizedProfitLoss`, and `UnrealizedProfitLoss` account items. Runtime SIM validation must still cross-check this value against NT8 account display with an open position. Formula: update `currentPeak = max(currentPeak, equity)`. If not locked and `currentPeak >= AccountStartingBalance + TrailingDrawdownLockOffset`, set `locked=true` and `lockedPeakValue=currentPeak`. Reference point is `locked ? lockedPeakValue : currentPeak`; halt threshold is `referencePoint - TrailingDrawdownHaltBuffer`. If `equity <= haltThreshold`, set account breach state, flatten registered strategies for that account with `ExitLong("TrailingDrawdownHalt")` and `ExitShort("TrailingDrawdownHalt")`, log `TRAILING_DRAWDOWN_BREACH: Account=<name> Equity=<value> Peak=<value> Floor=<value> Locked=<bool> Time=<timestamp>`, and block new entries with reject reason `TrailingDrawdownBreach` for the rest of the session.
- **Consequences:** The monitor is fully opt-in via `EnableTrailingDrawdown=false` default, so existing gate-validation sessions are inert unless explicitly enabled. Multiple strategy instances sharing one account name share one drawdown floor and breach state. Conservative-tier breaches write `{LogDirectory}/drawdown_halt_<AccountName>.json`; startup with that file present enters halted state until the operator manually deletes it. Normal/Aggressive breaches are in-memory only and clear on restart. This task deliberately does not implement EOD/Option-2 mode or Python/Apprise notification wiring.
- **Action Required:** In SIM, verify `AccountItem.NetLiquidation` includes unrealized P&L by comparing logged equity with NT8 account display while a position is open; test breach flattening, persisted Conservative halt, restart behavior by tier, lock-in floor behavior, disabled-mode inertness, and two-strategy shared account state.
### DEC-20260818-16
- **ID:** DEC-20260818-16
- **Date:** 2026-08-18
- **Status:** accepted
- **Context:** The operator trades both a funded prop account with strict trailing drawdown rules and a small personal/micro account that should become eligible for a different risk posture as capital grows. One static risk posture cannot accurately represent both accounts.
- **Decision:** Add a manual `RiskTier` NinjaScript setting with `Conservative`, `Normal`, and `Aggressive`, defaulting to `Normal`. Add `MicroUpgradeThreshold` defaulting to `5000`; each realtime bar reads account balance via `Account.Get(AccountItem.CashValue, Currency.UsDollar)` and, once per strategy session, logs/prints `TIER_UPGRADE_SUGGESTED: Balance=<value> crossed threshold=<threshold>; review RiskTier setting.` when crossed. The strategy never changes `RiskTier` automatically.
- **Consequences:** Risk posture becomes explicit in strategy settings and provenance without creating hidden automatic tier changes. The upgrade threshold is advisory only and safe for live use because it cannot alter sizing, risk validation, order submission, or drawdown halt behavior.
- **Action Required:** Confirm in SIM that threshold crossing logs exactly once and does not change `RiskTier` or any order behavior.
### DEC-20260818-15
- **ID:** DEC-20260818-15
- **Date:** 2026-08-18
- **Status:** accepted
- **Context:** The dashboard console only showed rejection/risk visibility from the live raw-log tail, so a meaningful `REJECT:` could scroll out and disappear from operator view even though the full session file still contained durable `REJECT SUMMARY:` and `REJECT:` records. The same dashboard also lacked signal-vs-fill visibility and had no approximation for good telemetry setups that could not become trades because a session-level block had already appeared. Today's 10:10 `SIGNAL` followed by `KillSwitch`/MaxTradeRisk rejection in `session_20260818_071117.log` made the gap concrete.
- **Decision:** Add read-only dashboard KPIs sourced from the full current `session_*.log` file on every `/api/state` poll: `session_reject_totals`, `signal_outcomes`, `signal_grade_summary`, `missed_grade_b_plus_count`, and capped `missed_grade_b_plus_samples`. The full-file read per poll is an accepted dashboard observability trade-off and should not be over-engineered with caching unless it is measured as slow. Signal-vs-fill correlation treats a `FILL` before the next `SIGNAL` as filled and captures the following `REJECT:` reason when present. Older `SIGNAL: Sell NQ | LIVE MODE` lines without inline grade/score use the latest prior `STATE:` grade/score so current logs remain analyzable.
- **Consequences:** Risk/reject counts are persistent for the full session and no longer disappear when raw-tail lines scroll out. Signal outcomes make rejected/unfilled generated signals visible by grade. Missed B+ setup counting is explicitly approximate: it infers blocked opportunity from `STATE:` samples after blocking `REJECT:` reasons (`RthGuard`, `MaxDailyTrades`, `KillSwitch`, `CmeHoliday`) have appeared, not from a first-class signal-quality-vs-execution-outcome model. Revisit this metric once the pending MaxDailyTrades architecture decision discussed in today's DEC-20260818-14 follow-up session is implemented, because that design should make the distinction exact rather than inferred. This remains observability-only and cannot affect live trading behavior because it only reads log files under `tools/dashboard`.
- **Action Required:** In a later live session, compare dashboard missed-setup samples against raw `STATE:` lines after any real `MaxDailyTrades` block and revise the approximation once MaxDailyTrades emits exact signal-quality/execution-outcome telemetry.
### DEC-20260818-14
- **ID:** DEC-20260818-14
- **Date:** 2026-08-18
- **Status:** accepted
- **Context:** Follow-up verification for DEC-20260818-11 confirmed the `SimpleORBNT8` side of fixed-position UI consolidation is wired, not just the `NT8StrategyBase` extension point. The repo and deployed NT8 Custom source both contain `SimpleORBNT8.AppendTopLeftDiagnosticLines(List<string> lines)` for TradeTaken/DailyTradeCount and a single `Diag_BottomLeft` block for ORBRange/BreakoutDir.
- **Decision:** Treat the current `SimpleORBNT8` implementation as completion of DEC-20260818-11 rather than a new visual feature. No additional code change is required: old `Diag_TradeTaken`/`Diag_DailyCount` cleanup remains owned by the base consolidated top-left draw path, and old `Diag_ORBRange`/`Diag_BreakoutDir` cleanup remains owned by the SimpleORB bottom-left draw path before drawing `Diag_BottomLeft`.
- **Consequences:** The intended fixed-position consolidation is complete in source and deployed NinjaScript source. Runtime visual validation is still required for stacked top-left and bottom-left rendering and for any collision with NT8's native strategy-parameter display.
- **Action Required:** In NT8, visually confirm the consolidated top-left and bottom-left blocks render without overlap under simultaneous active conditions.
### DEC-20260818-13
- **ID:** DEC-20260818-13
- **Date:** 2026-08-18
- **Status:** accepted
- **Context:** Follow-up verification for DEC-20260818-12 confirmed that event-driven telemetry's pending-breakout change detection depends on `SimpleORBNT8` overriding `GetStateTelemetryPendingBreakoutDirection()`. Without that strategy-specific override, the base implementation returns `0`, causing the intended `0 -> 1` or `0 -> -1` breakout-arm transition to be invisible to `MaybeWriteStateTelemetry()`.
- **Decision:** Treat the existing `SimpleORBNT8.GetStateTelemetryPendingBreakoutDirection()` override as required completion of DEC-20260818-12 rather than a separate telemetry feature. The override reads `_sdkStrategy as SdkSimpleORB` and returns `sdkOrb.PendingBreakoutDirection` when available, otherwise `0`, matching the null-check pattern used by the neighboring telemetry overrides.
- **Consequences:** Pending-breakout direction changes now have a strategy-specific data source for the event-driven `STATE:` path. Runtime validation is still required to confirm a live/SIM breakout-arm transition emits immediately and that the periodic 30-second snapshot remains unaffected.
- **Action Required:** In live/SIM, force a breakout-bar/confirmation sequence and confirm a `STATE:` line appears when `PendingBreakoutDirection` changes.
### DEC-20260818-12
- **ID:** DEC-20260818-12
- **Date:** 2026-08-18
- **Status:** accepted
- **Context:** The 30-second `STATE:` telemetry snapshot is useful for ambient health monitoring but can lag fast ORB breakout/confirmation transitions on primary bars that close less than 30 seconds apart. The operator needs to see entry-imminent state changes in real time without turning `STATE:` into per-bar score-noise logging.
- **Decision:** `MaybeWriteStateTelemetry()` now samples on meaningful change, not only on a clock. It still preserves the existing 30-second periodic snapshot and its independent cooldown, but it also emits an immediate supplementary `STATE:`/`STATE_DETAIL:`/`STATE_CONTEXT:` set whenever either `SimpleORBNT8.PendingBreakoutDirection` changes or the telemetry grade crosses the configured `MinTradeGrade` threshold in either direction. The change-triggered emission does not reset `_lastStateTelemetryTime`, so the periodic health snapshot continues on its own cadence. This is deliberately limited to PendingBreakoutDirection and grade-threshold crossing; exact score decimal changes are ignored to avoid choppy log volume.
- **Consequences:** Fast breakout arming/resetting and grade eligibility transitions should now appear in the session log immediately instead of waiting for the next 30-second snapshot. This design is distinct from the `REJECT:` rate-limiting model: `STATE:` change-triggering is about sampling dynamic state at meaningful transitions, while `REJECT:` rate limiting is about avoiding repetition of static facts. The two throttling strategies must not be conflated.
- **Action Required:** In live/SIM, force a rapid breakout-bar/confirmation sequence and confirm `STATE:` appears at the pending-direction change; run a quiet session to confirm periodic ~30s `STATE:` output remains; measure `STATE` line count during a choppy ORB window.
### DEC-20260818-11
- **ID:** DEC-20260818-11
- **Date:** 2026-08-18
- **Status:** accepted
- **Context:** Multiple `Draw.TextFixed()` diagnostics shared the same fixed chart positions. NinjaScript does not auto-stack these calls, so `Diag_Regime`, `Diag_Runner`, `Diag_TradeTaken`, and `Diag_DailyCount` collided at `TextPosition.TopLeft`, while `Diag_ORBRange` and `Diag_BreakoutDir` collided at `TextPosition.BottomLeft`. This visual-only issue is independent of DEC-20260818-10's ETH refresh path, although ETH refresh made stale/colliding fixed labels more visible.
- **Decision:** `NT8StrategyBase.DrawDiagnostics()` now builds a single newline-joined top-left diagnostics block and exposes `AppendTopLeftDiagnosticLines(List<string> lines)` for derived strategies. `SimpleORBNT8` overrides that hook to append TradeTaken and DailyTradeCount under the same top-left draw call. `SimpleORBNT8.DrawDiagnostics()` now similarly builds one newline-joined bottom-left block for ORB range and breakout direction. Old separate tags are removed before the combined tags are drawn so stale chart objects do not linger. Color consolidation choice: the top-left block uses white text on a black background for mixed-status readability; the bottom-left ORB block uses white text on a dark-blue background, preserving the prior ORB range block's visual theme while accepting a single color for breakout direction.
- **Consequences:** Simultaneously active diagnostic lines at the same fixed position now render as stacked text in one chart object instead of overlapping. Per-line colors are intentionally not preserved because `Draw.TextFixed()` styles the whole fixed text object. Single-occupant positions (`Diag_Session` top-right, `Diag_TestMode` center, and `Diag_Prov` bottom-right) are unchanged. Native NT8 strategy-parameter-display overlap has not been validated in this code session and still requires visual chart confirmation.
- **Action Required:** Visually verify multiple top-left and bottom-left conditions render stacked, and confirm whether NT8's native strategy-parameter display still overlaps the consolidated top-left block.
### DEC-20260818-10
- **ID:** DEC-20260818-10
- **Date:** 2026-08-18
- **Status:** accepted
- **Context:** DEC-20260818-07 intentionally scoped `EnableEthTelemetry` to text telemetry only: the ETH branch called `MaybeWriteStateTelemetry()` and returned before `DrawDiagnostics()`. Live chart review showed stale RTH visual labels during ETH because `DrawDiagnostics()` had not run since a prior RTH/TestMode bar. Source review of `NT8StrategyBase.DrawDiagnostics()` and `SimpleORBNT8.DrawDiagnostics()` confirmed the methods are gated by `EnableChartDiagnostics` and use chart drawing calls only, without `_sdkStrategy.OnBar()`, `ProcessStrategyIntent()`, order submission, or trading state mutation.
- **Decision:** When a bar is outside RTH, TestMode is false, and `EnableEthTelemetry` is true, the existing ETH telemetry branch now calls `DrawDiagnostics()` in the same try/catch after building read-only bar/context state and writing optional state telemetry. The branch still returns before `_sdkStrategy.OnBar()` and `ProcessStrategyIntent()`, so ETH telemetry remains visual/read-only only.
- **Consequences:** With `EnableEthTelemetry=true` and `EnableChartDiagnostics=true`, the chart's session tag, ORB box, trigger lines, and breakout indicators can refresh during ETH instead of displaying stale RTH drawings. With `EnableEthTelemetry=false`, default ETH behavior remains unchanged. RTH and Strategy Analyzer paths are unchanged.
- **Action Required:** In a live ETH session, verify `SESSION: ETH` and ORB visual diagnostics refresh with `EnableEthTelemetry=true`/`EnableChartDiagnostics=true`, and verify no `SUBMIT`/`FILL` lines appear outside RTH from this path.
### DEC-20260818-09
- **ID:** DEC-20260818-09
- **Date:** 2026-08-18
- **Status:** accepted
- **Context:** `ProcessStrategyIntent()` calculated position size using the static `intent.StopTicks` emitted by the SDK strategy, while `SubmitOrderToNT8()` later overwrote `intent.StopTicks` with the ATR-derived dynamic stop when `EnableDynamicStop=true`. That meant contract count was based on a stale stop distance and could diverge materially from the actual submitted stop risk. The same ordering defect affected `RecommendedContracts` telemetry because the telemetry intent used `SimpleORBNT8.StopTicks` rather than the current dynamic stop. This is distinct from DEC-20260818-08's historical-replay order-submission block.
- **Decision:** Dynamic ATR stop finalization now happens before sizing. `NT8StrategyBase.ProcessStrategyIntent()` applies the existing `EnableDynamicStop && CurrentBars[0] >= AtrPeriod` formula and min/max clamping before portfolio/per-strategy risk, `_positionSizer.CalculateSize()`, and submission. `SubmitOrderToNT8()` no longer recomputes or overwrites `intent.StopTicks`; it trusts the already-finalized value. Telemetry uses the same helper before `RecommendedContracts` sizing, and `SimpleORBNT8.BuildStateTelemetryIntent()` seeds the telemetry intent with the finalized stop ticks rather than the static `StopTicks` parameter.
- **Consequences:** With `EnableDynamicStop=true`, real order sizing, `SUBMIT Stop=<ticks>`, and `RecommendedContracts` now reference the same stop distance. Historical Strategy Analyzer results with dynamic stop enabled are expected to change because this corrects a real contract-sizing defect. With `EnableDynamicStop=false`, the helper is a no-op and static-stop behavior is unchanged.
- **Action Required:** In NT8, compare one dynamic-stop signal end to end: dynamic stop log, `SUBMIT Stop=<ticks>`, submitted contract count, and `STATE_CONTEXT RecommendedContracts` should all reflect the ATR-finalized stop. Run a Strategy Analyzer before/after comparison with `EnableDynamicStop=true` and record the expected contract-count/P&L delta.
### DEC-20260818-08
- **ID:** DEC-20260818-08
- **Date:** 2026-08-18
- **Status:** accepted
- **Context:** Live/SIM strategy startup can process NT8 historical catch-up bars before `State.Realtime`. DEC-20260817-02 fixed the prior partial symptom by preventing `WriteTradeProvenance()` from writing phantom `trades_*.jsonl` rows outside realtime, but it explicitly did not alter signal generation, risk validation, sizing, or order submission. Live evidence later confirmed that historical catch-up bars from prior RTH sessions could still produce a full Intent -> Risk approved -> Sized -> Submitted -> Filled sequence because the realtime replay-age guard and `_realtimeBarSeen` guard do not run while `State == State.Historical`, and the RTH guard checks time of day without date freshness.
- **Decision:** `NT8StrategyBase.ProcessStrategyIntent()` now blocks live/SIM historical replay catch-up before any portfolio risk, direction, risk-manager, sizing, or order-submission logic when `State == State.Historical && Account != null`. The reject reason is distinct: `HistoricalReplayCatchup`. Strategy Analyzer/backtest behavior remains intentionally untouched because `Account == null` during genuine `State.Historical` backtests, so simulated historical orders still flow normally there. `LogRejectRateLimited()` permits this one reason to write a `REJECT:` line even though `State` is historical, so the catch-up safety block is visible in session diagnostics.
- **Consequences:** This closes the actual order-submission gap left open by DEC-20260817-02 while retaining that provenance-file gate as an independent second safety net. MaxDailyTrades and daily P&L should no longer be affected by live/SIM catch-up activity because catch-up-phase intents cannot reach submission at all. Validation still requires a live/SIM restart with catch-up history and a Strategy Analyzer regression comparison for unchanged trade count and P&L.
- **Action Required:** Restart NT8 with the live/SIM strategy attached to an account and confirm `REJECT: reason=HistoricalReplayCatchup` appears during catch-up with zero `SUBMIT`/`FILL` until `State.Realtime` and `_realtimeBarSeen` are true; run a Strategy Analyzer backtest over the same range and confirm trade count and P&L are unchanged.
### DEC-20260818-07
- **ID:** DEC-20260818-07
- **Date:** 2026-08-18
- **Status:** accepted
- **Context:** In the consolidated fix batch, the operator needed regime/factor/grade telemetry during ETH hours without touching the real `SimpleORBStrategy` entry state machine. The existing RTH guard in `NT8StrategyBase.OnBarUpdate()` returned before `MaybeWriteStateTelemetry()`, so sessions started during ETH produced no `STATE:` lines. The real strategy path must remain protected: no ETH call to `_sdkStrategy.OnBar()`, no `ProcessStrategyIntent()`, and no TestMode behavior changes.
- **Decision:** Added opt-in `EnableEthTelemetry` (`false` by default) under Diagnostics. When a bar is outside RTH and TestMode is false, the existing `RthGuard` rejection still logs; if and only if `EnableEthTelemetry` is true, `NT8StrategyBase` builds `BarData`/`StrategyContext` from current read-only adapter state, calls `MaybeWriteStateTelemetry()`, then returns immediately. This path does not call `DrawDiagnostics()`, `_sdkStrategy.OnBar()`, or `ProcessStrategyIntent()`.
- **Consequences:** Default ETH behavior remains unchanged. Operators can opt into `STATE:`/`STATE_DETAIL:`/`STATE_CONTEXT:` during ETH at the existing telemetry throttle for diagnostics only, with no path to submit an ETH order through this feature.
- **Action Required:** In a live ETH session, verify `EnableEthTelemetry=false` produces no ETH `STATE:` lines, `EnableEthTelemetry=true` produces state telemetry, and no `SUBMIT`/`FILL` lines appear outside RTH.
### DEC-20260818-06
- **ID:** DEC-20260818-06
- **Date:** 2026-08-18
- **Status:** accepted
- **Context:** In the consolidated fix batch, real `STATE_DETAIL:` output showed daily-context factors returning "No daily bar context available" even though `SimpleORBNT8.OnBarUpdate()` already builds `DailyBarContext` every bar and stores it at `_strategyConfig.Parameters["daily_bars"]`. Root cause: real intents get this context via `SimpleORBStrategy.AttachDailyBarContext()`, but the synthetic `SimpleORBNT8.BuildStateTelemetryIntent()` created an empty metadata dictionary, and factor calculators read daily context from `intent.Metadata["daily_bars"]`.
- **Decision:** `SimpleORBNT8.BuildStateTelemetryIntent()` now creates a metadata dictionary and, when `_strategyConfig.Parameters["daily_bars"]` exists, attaches that same object under `"daily_bars"` before returning the synthetic telemetry intent. It deliberately does not call `AttachDailyBarContext()` because that helper mutates trade-direction, breakout-volume, and ORB fields for real trade candidates.
- **Consequences:** State telemetry factors can now use the same warmed daily context as the accepted-trade path without mutating SDK strategy state. Expected live result is real NR4/NR7 and ORB-vs-ATR reason text in `STATE_DETAIL:` once daily context is warmed, with no change to `SIGNAL`/`SUBMIT`/`FILL`/`REJECT` behavior.
- **Action Required:** Confirm live `STATE_DETAIL:` reason strings no longer report missing daily context once the daily series is warmed.
### DEC-20260818-05
- **ID:** DEC-20260818-05
- **Date:** 2026-08-18
- **Status:** accepted
- **Context:** The dashboard Data Series Detail panel exposed that `SimpleORBNT8` was loading duplicate daily bar series: `SimpleORBNT8.OnStateChange()` called `AddDataSeries(BarsPeriodType.Day, 1)` in `State.Configure`, then called `base.OnStateChange()`, whose `State.Configure` branch also added the shared daily series for TASK-06c regime SMA20/50 context. Live evidence showed `BarsArray[1]` and `BarsArray[2]` were both `DayBarsType`, `DaysToLoad=365`, `HistoricalBarsLoaded=130`. This was an existing latent bug that predated today's telemetry/dashboard work and was only made visible because the dashboard now shows the full `BarsArray` readiness detail.
- **Decision:** Removed the subclass `AddDataSeries(BarsPeriodType.Day, 1)` call from `SimpleORBNT8`. The base class remains the single owner of the shared daily series, so `BarsArray[1]` keeps the same role and ordering for `SimpleORBNT8.BuildDailyBarContext()` and `NT8StrategyBase.BuildStrategyContext()` regime calculations. A source comment now notes that `NT8StrategyBase` provides the shared daily series to avoid reintroducing the duplicate.
- **Consequences:** Expected live readiness is now two series total: primary bars plus one daily series, with the same daily historical count as before. NR7, ORB-vs-ATR, regime SMA20/50, signal generation, sizing, and order behavior should remain unchanged because all current consumers already read daily data from index `[1]`; the removed `[2]` series had no intended consumer.
- **Action Required:** After deploy and NT8 compile, confirm the Historical readiness block/dashboard Data Series Detail reports only primary plus one daily series and that daily bar count remains unchanged.
### DEC-20260818-04
- **ID:** DEC-20260818-04
- **Date:** 2026-08-18
- **Status:** accepted
- **Context:** DEC-20260818-02/03 added `STATE_CONTEXT:` (ORB high/low/window from `SimpleORBNT8`, plus the universal `RecommendedContracts` field from `NT8StrategyBase`) but left dashboard parsing for a separate task, and verification against the actual deployed source (`NT8StrategyBase.cs`, `SimpleORBNT8.cs`) confirmed the format matched exactly what was documented.
- **Decision:** Added `STATE_CONTEXT_RE`/`parse_state_context_fields()` to `parsers.py` (plain space-separated `Key=Value` tokens, deliberately generic rather than ORB-specific since the field set is strategy-extensible per the `GetStateTelemetryContextFields()` extension point). `server.py._apply_event()` stores the result at `live_state.state_context`. `console.html`/`console.js`: a new ORB range block renders `OrbHigh`/`OrbLow`/window under Strategy Status's Session Filter section (with an honest "not yet established" empty state), and the State Telemetry stat-grid gains a fifth `Recommended Contracts` stat sourced live from `state_context.RecommendedContracts` when present — distinct from the existing post-trade `last_submit.fields` sizing block, since this one updates continuously at the telemetry cadence rather than only after a real SUBMIT.
- **Consequences:** Closes the loop on both DEC-20260818-02 and DEC-20260818-03's deferred dashboard work in one pass. Not yet executed against a live payload, since Claude has no code-execution access on the operator's machine — verify via `/api/state` or the console page once a session with an established ORB range is running.
- **Action Required:** Confirm `live_state.state_context` populates with `OrbHigh`/`OrbLow`/`OrbWindowStart`/`OrbWindowEnd`/`OrbReady`/`RecommendedContracts` once the ORB range establishes in a live session, and that the dashboard's ORB Range block and Recommended Contracts stat render correctly.
### DEC-20260818-03
- **ID:** DEC-20260818-03
- **Date:** 2026-08-18
- **Status:** accepted
- **Context:** The operator re-authorized recommended-contract telemetry after DEC-20260818-01 clarified that `BasicPositionSizer.CalculateSize()` has no internal mutable state a telemetry-only call could corrupt. The only side effect is logger output, which does not feed back into sizing/order behavior and is limited by the existing 30-second state telemetry throttle.
- **Decision:** `MaybeWriteStateTelemetry()` now calls `_positionSizer.CalculateSize(telemetryIntent, context, _sizingConfig)` after computing the confluence score, only inside the existing `EnableStateTelemetry && EnableFileLogging && State == State.Realtime` and 30-second throttle gates. The resulting `SizingResult.Contracts` is logged only, never stored or used for order submission. Because DEC-20260818-02 already introduced `STATE_CONTEXT:`, the recommended size extends that line as `RecommendedContracts=<N>` instead of creating another near-duplicate telemetry line. When ORB context is also ready, the full line is `STATE_CONTEXT: OrbHigh=<F2> OrbLow=<F2> OrbWindowStart=<HH:mm> OrbWindowEnd=<HH:mm> OrbReady=<True|False> RecommendedContracts=<N>`; before ORB readiness, `STATE_CONTEXT: RecommendedContracts=<N>` may still be emitted.
- **Consequences:** The dashboard/parser follow-up can read one context line for both strategy-specific context and display-only recommended sizing. Trustworthiness still requires live validation: when a real trade later submits under matching conditions, `RecommendedContracts` should match `SUBMIT`'s `Scaler + Runner` quantity; if not, telemetry inputs must be reconciled before presenting the value as authoritative.
- **Action Required:** Run a live session and compare `STATE_CONTEXT RecommendedContracts=<N>` against the next matching `SUBMIT Scaler=<S> Runner=<R>` total.
### DEC-20260818-02
- **ID:** DEC-20260818-02
- **Date:** 2026-08-18
- **Status:** accepted
- **Context:** The operator needs the opening-range high/low and ORB window visible in text telemetry and the dashboard, but ORB fields are strategy-specific and should not become part of `NT8StrategyBase.cs`'s generic `STATE:` schema. `SimpleORBNT8.DrawDiagnostics()` already reads these values from `SimpleORBStrategy`'s public diagnostic getters, so logging them can remain read-only and aligned with chart diagnostics.
- **Decision:** Added `protected virtual Dictionary<string, string> GetStateTelemetryContextFields(BarData barData, StrategyContext context)` to `NT8StrategyBase`; the base implementation returns `null`. `MaybeWriteStateTelemetry()` now calls the extension point at the same throttled cadence as `STATE:`/`STATE_DETAIL:` and emits `STATE_CONTEXT: Key1=Value1 Key2=Value2 ...` only when a strategy returns non-empty fields. `SimpleORBNT8` overrides the method and returns `OrbHigh=<F2> OrbLow=<F2> OrbWindowStart=<HH:mm> OrbWindowEnd=<HH:mm> OrbReady=<True|False>` once `sdkOrb.OpeningRangeReady` is true and `OpeningRangeHigh > OpeningRangeLow`; otherwise it returns `null` so consumers can distinguish not-ready from ready values.
- **Consequences:** Future strategies can add strategy-specific state telemetry context without changing the generic `STATE:` line or hardcoding ORB concepts into the base class. The format deliberately uses unquoted space-separated key/value tokens because these values are numeric/time/boolean tokens with no internal spaces.
- **Action Required:** Parser/dashboard support for `STATE_CONTEXT:` should be added in a separate presentation/data task if these fields need UI display.
### DEC-20260818-01
- **ID:** DEC-20260818-01
- **Date:** 2026-08-18
- **Status:** accepted
- **Context:** The "show recommended contract count during state telemetry" task instructed Kilocode to stop if `BasicPositionSizer.CalculateSize()` wasn't provably stateless, mirroring DEC-20260817-04's caution for `RegimeManager`/`TrendRegimeDetector`/`VolatilityRegimeDetector`. Kilocode correctly stopped, reporting `CalculateSize()` calls `_logger.LogDebug()`/`LogWarning()`, which `BasicLogger` routes to `Console.WriteLine()`, and is therefore not I/O-free.
- **Decision:** Direct source read of `BasicPositionSizer.cs` confirms it has exactly one instance field (`_logger`, set once in the constructor, never written to elsewhere) and no other state. `CalculateSize()` derives its result purely from its `(intent, context, config)` parameters and returns a fresh `SizingResult` each call; there is no internal history/dictionary a telemetry-only call could seed or corrupt. This is categorically different from the `RegimeManager` case, where the disqualifying risk was a diagnostic call silently building up state (`_barHistory`, `_currentStates`, `_transitions`) that a future real caller would then see polluted. `BasicPositionSizer` has no such state; its only side effect is console text output, which does not feed back into any calculation, does not affect order behavior, and is negligible in volume at the existing 30-second telemetry throttle. The task is re-authorized: `MaybeWriteStateTelemetry()` may call `_positionSizer.CalculateSize()` for display purposes.
- **Consequences:** Establishes the actual test for future "is this safe to call for telemetry" questions: state that could corrupt a future real caller disqualifies a component (as with `RegimeManager`); I/O alone, on a component with no other internal state, does not. Future prompts citing "not provably stateless" should specify which kind of impurity was found rather than treating all impurity as equally disqualifying.
- **Action Required:** Re-run the recommended-contract-count telemetry task per the original prompt, now unblocked.
### DEC-20260817-11
- **ID:** DEC-20260817-11
- **Date:** 2026-08-17
- **Status:** accepted
- **Context:** Operator raised several architecture questions after reviewing the console dashboard: whether the platform-neutral SDK goal is still real, whether 24x7 trading means switching strategies or running them concurrently, whether a control-plane UI requires an NT8 AddOn, and flagged that multi-account/multi-timeframe support aren't yet real. Each was answered by direct source reading rather than recollection (`NT8.Core` file contents confirmed no `NinjaTrader.*` references; `PortfolioRiskManager.cs` read in full to confirm its concurrent-strategy design and its lack of an account key).
- **Decision:** Recorded findings in `docs/00-governance/architecture.md`: a Platform-Neutral SDK Invariant section (with an explicit rule against `NT8.Core` gaining NinjaTrader references), a Multi-Strategy / 24x7 Trading Architecture section confirming the "shared everything but entry" pattern is already real and that `PortfolioRiskManager` was already built for concurrent strategies, and a Control Plane section presenting the external-command-channel alternative to an NT8 AddOn. Added `GAP-042` (no account dimension in `PortfolioRiskManager`) to Sprint 4 in `roadmap.md`, and added multi-timeframe regime alignment as an unscoped Sprint 6 idea, both cross-referenced back to `architecture.md`.
- **Consequences:** These answers are now durable repo state rather than only having existed in a chat response. Future sessions asking the same architecture questions can be pointed at `architecture.md` directly. `GAP-042` must be resolved before Sprint 4's multi-strategy plans extend to multiple accounts.
- **Action Required:** None in code now. `GAP-042` implementation and the multi-timeframe regime design pass are both unscoped future work, not queued into an active sprint.
### DEC-20260817-10
- **ID:** DEC-20260817-10
- **Date:** 2026-08-17
- **Status:** accepted
- **Context:** DEC-20260817-09 added `STATE_DETAIL:`/`SIGNAL_DETAIL:` log lines and appended sizing-rationale fields to `SUBMIT`, but explicitly left dashboard/logtriage parser updates for a separate task. Console.js's Confluences and Factor Breakdown panels had no way to surface the human-readable factor reasons (e.g. NR4/NR7 determination, ORB-vs-ATR ratio) the operator specifically asked for, and the R:R panel had no live per-trade sizing data, only static config. Also found and removed dead code predating this session's changes: `parsers.py` had two `STATE_RE` definitions (the second silently overwrote the first), which left an entire `state = STATE_RE.search(message)` branch in `parse_session_event()` permanently unreachable since the newer regex's branch, positioned earlier in the function, always matched and returned first.
- **Decision:** Added `parse_quoted_reasons()` (reverses `EscapeLogValue()`'s backslash/quote escaping) and `STATE_DETAIL_RE`/`SIGNAL_DETAIL_RE` to `parsers.py`; `parse_session_event()` now returns `type: "STATE_DETAIL"`/`"SIGNAL_DETAIL"` events with a `reasons` dict keyed by factor name. Added `parse_submit_fields()` (numeric coercion for `BaseTarget`/`DynamicTarget`/`GradeMult`/`ModeMult`/`CombinedMult`, leaving `"N/A"` as a string so it's distinguishable from `0`) and enriched the existing `SUBMIT` event with a `fields` dict. `server.py._apply_event()` stores these at `live_state.state_telemetry_reasons`, `live_state.last_signal_reasons`, and within `live_state.last_submit.fields`. `console.html`/`console.js`: Confluences and Factor Breakdown rows now carry a `title` tooltip from `state_telemetry_reasons[name]` when available; a new "Live Sizing" block under the static R:R panel renders `last_submit.fields` once a trade has submitted this session, with an honest "no trade submitted yet" empty state otherwise.
- **Consequences:** This closes the loop DEC-20260817-09 left open — factor reasons and per-trade sizing rationale now reach the dashboard, not just the session log. Parsing logic was verified by hand-tracing the documented formats against `DEC-20260817-09`'s exact line specifications (quoted-value escaping, unquoted `SUBMIT` fields with `N/A` fallback) but not executed, since Claude has no code-execution access on the operator's machine, and the underlying `NT8StrategyBase.cs` change has not yet been redeployed (blocked on `NT8.Core.dll` file lock — NinjaTrader must fully close before `deploy-to-nt8.bat` can succeed). The dead `STATE_RE` shadow bug predated this session's own DASH-002 work but was only now discovered and removed.
- **Action Required:** Once NT8.Core.dll is unlocked and the telemetry enrichment redeploys/recompiles cleanly, confirm via `/api/state` (or the console page) that `state_telemetry_reasons`, `last_signal_reasons`, and `last_submit.fields` populate with real values, and that tooltips render correctly on hover.
### DEC-20260817-09
- **ID:** DEC-20260817-09
- **Date:** 2026-08-17
- **Status:** accepted
- **Context:** DASH-002 `STATE:` telemetry and accepted-trade `SIGNAL`/`SUBMIT` logging exposed scores and order shape but discarded already-computed sizing rationale and each `ConfluenceFactor.Reason`. The data already exists on `intent.Metadata` and `ConfluenceScore.Factors`; surfacing it is logging-only and must not change signal generation, sizing, risk validation, or order submission behavior.
- **Decision:** Keep existing score-bearing line formats intact except for appending metadata fields to `SUBMIT`. Accepted-trade factor reasons are emitted as a separate line immediately after `SIGNAL`: `SIGNAL_DETAIL: Setup="<reason>" Trend="<reason>" Volatility="<reason>" Timing="<reason>" ExecutionQuality="<reason>" NarrowRange="<reason>" OrbRangeVsAtr="<reason>" GapDirectionAlignment="<reason>" BreakoutVolumeStrength="<reason>" PriorDayCloseStrength="<reason>"`. State telemetry factor reasons are emitted at the same cadence and immediately after `STATE`: `STATE_DETAIL: Setup="<reason>" Trend="<reason>" Volatility="<reason>" Timing="<reason>" ExecutionQuality="<reason>" NarrowRange="<reason>" OrbRangeVsAtr="<reason>" GapDirectionAlignment="<reason>" BreakoutVolumeStrength="<reason>" PriorDayCloseStrength="<reason>"`. The `SUBMIT` line appends `BaseTarget=<base_target_ticks|N/A> DynamicTarget=<dynamic_target_ticks|N/A> GradeMult=<grade_multiplier|N/A> ModeMult=<mode_multiplier|N/A> CombinedMult=<combined_multiplier|N/A>` after the existing `Mode=<mode>` field.
- **Consequences:** Dashboard/logtriage parsers can add support for `SIGNAL_DETAIL`, `STATE_DETAIL`, and appended `SUBMIT` fields later without ambiguity. Existing `SIGNAL`, `Factors:`, `FILL`, `PNL_UPDATE`, and `REJECT` lines are not removed or reordered. Reason values are double-quoted with backslashes and quotes escaped because reason text may contain punctuation or semicolons.
- **Action Required:** Update dashboard/logtriage parsers in a separate task if these detail lines need structured UI display.
### DEC-20260817-08
- **ID:** DEC-20260817-08
- **Date:** 2026-08-17
- **Status:** accepted
- **Context:** DASH-002's `STATE:` telemetry line was confirmed live in `session_20260817_202803.log` (validated in a real realtime session: `STATE: Regime=Neutral Direction=Buy DirectionSource=OpeningRangeMidpoint Score=0.550 Grade=D Factors=Setup=0.50x1.00;...`), but `tools/dashboard/parsers.py`'s `parse_session_event()` had no handling for it — the dashboard's `console.html`/`console.js` plan (DASH-004) explicitly noted this as "pending DASH-002" and had no real data source yet.
- **Decision:** Added `STATE_RE` and `parse_state_factors()` to `parsers.py`, following the same `Factors=name=scorexweight;...` convention already used for `GradeFilter` reject-detail parsing. `parse_session_event()` now returns a `type: "STATE"` event with `regime`, `direction`, `direction_source`, `score`, `grade`, and a structured `factors` list. `server.py._apply_event()` stores the latest one at `live_state.state_telemetry`, refreshed every poll from the session-log tail like every other live field, so it is available via `/api/state` with no additional wiring.
- **Consequences:** Live regime/grade/factor data now actually reaches the dashboard rather than sitting only in the session log. Observed cadence in this test session was ~5 minutes, not the 30s floor from DEC-20260817-07, because this session's primary series is `MinuteBarsType` and `MaybeWriteStateTelemetry()` only gets a chance to fire on `OnBarUpdate()` (bar close) — on the gate's actual HFT Algo Bars primary series, cadence will sit much closer to the 30s floor. Parsing logic was hand-verified against the real log line (all six capture groups resolve correctly, including the `Grade=D` immediately followed by ` Factors=` boundary) but not executed, since Claude has no code-execution access on the operator's machine.
- **Action Required:** Confirm via a live `/api/state` poll (or the dashboard once loaded) that `live_state.state_telemetry` populates and updates roughly on the observed cadence.
### DEC-20260817-07
- **ID:** DEC-20260817-07
- **Date:** 2026-08-17
- **Status:** accepted
- **Context:** DASH-002 needs continuous confluence/regime telemetry for the dashboard, but per-HFT-bar logging could create excessive session-log volume and disk I/O on the strategy thread. The implementation must remain additive observability only and must not call state-mutating regime detector methods documented in DEC-20260817-04.
- **Decision:** Emit `STATE:` telemetry at most once every 30 seconds while `State == State.Realtime`, `EnableFileLogging == true`, and `EnableStateTelemetry == true`. The line records `Regime`, diagnostic `Direction`, `DirectionSource`, `Score`, `Grade`, and `Factors=<FactorType>=<score>x<weight>;...` using the same factor-breakdown convention consumed by dashboard GradeFilter parsing. Direction is explicit so synthetic diagnostic scoring cannot be mistaken for an accepted trade signal.
- **Consequences:** Expected full RTH volume is approximately 780 lines per 6.5-hour session, plus normal session logs, which is low enough for operator diagnostics while avoiding per-bar HFT log flooding. Existing `SIGNAL`, `SUBMIT`, `FILL`, `PNL_UPDATE`, and `REJECT` lines remain unchanged. The dashboard can replace its DASH-002 placeholder with real latest-state telemetry when these lines are present.
- **Action Required:** Dual-deploy, manually compile all NinjaScript in NT8, and verify `STATE:` lines appear in a realtime session before relying on dashboard telemetry.
### DEC-20260713-01
- **ID:** DEC-20260713-01
- **Date:** 2026-07-13
@@ -237,3 +531,63 @@ Use this file to record durable project decisions that affect implementation pat
- **Consequences:** Every gate week starts with governance docs that are at most a few hours stale, not up to 7 days. The master document's Section 23.4 heartbeat language is superseded by this entry and should read as a pointer to this runbook in the next master document revision (v6.4).
- **Action Required:** None in code. First scheduled Sunday review configured 2026-08-16 for 2026-08-23 onward.
### DEC-20260817-01
- **ID:** DEC-20260817-01
- **Date:** 2026-08-17
- **Status:** accepted
- **Context:** `WriteSessionProvenance()` and `WriteTradeProvenance()` returned silently when `LogDirectory` was blank, while `InitFileLog()` and `WriteSettingsFile()` already used the default path `Documents\NinjaTrader 8\log\nt8-sdk`. The ORB-specific `WriteSessionProvenance()` override had the same silent guard. This created a split-brain evidence state: `session_*.log` and `settings_*.txt` continued writing, but `provenance_*.json` and `trades_*.jsonl` did not. The affected period includes broker-confirmed trades from 2026-08-07, 2026-08-10, 2026-08-16, and 2026-08-17.
- **Decision:** Provenance and trade JSONL writes must use the same default log directory fallback as session logs/settings whenever `LogDirectory` is blank. The fallback must be explicit in both `Print()` and `FileLog()` so this failure mode is never silent again.
- **Consequences:** Gate evidence for trades since 2026-07-31 cannot rely on missing provenance/trade JSONL as proof of no trades or no submissions. Broker statements/session logs remain necessary for those sessions. Future blank `LogDirectory` configurations produce provenance and trade records at the default path with visible warnings.
- **Action Required:** Redeploy and manually NinjaScript-compile before relying on new provenance/trade JSONL artifacts.
### DEC-20260817-02
- **ID:** DEC-20260817-02
- **Date:** 2026-08-17
- **Status:** accepted
- **Context:** `trades_Simple_ORB_NT8_20260817.jsonl` received 57 rows during a 14-second restart replay window (`2026-08-17T16:51:16.124Z` through `2026-08-17T16:51:30.109Z`) while broker execution grid review showed no matching activity. `OnExecutionUpdate()` and live session-log `SIGNAL`/`SUBMIT` writes are already `State.Realtime` gated, but `WriteTradeProvenance()` was called from `SubmitOrderToNT8()` without an equivalent gate. Source review also found that live-chart historical replay passes `AllowDailyTradeCountIncrement=false` when `State.Historical` and `Account != null`, so accepted historical intents do not increment `_dailyTradeCount` and `MaxDailyTrades` cannot cap the replay burst in that mode. The persisted trade JSONL has only wall-clock `timestamp_utc`; it does not include the bar's own historical timestamp, so exact per-row bar-date distribution cannot be reconstructed from the file.
- **Decision:** `WriteTradeProvenance()` must return immediately unless `State == State.Realtime`. This is a provenance/data-integrity gate only and must not alter signal generation, risk validation, order submission, or entry/exit behavior. Do not change historical daily-count logic without a separate approved task because it may affect Strategy Analyzer/backtest behavior.
- **Consequences:** Historical catch-up/replay can no longer append phantom trade provenance rows. Existing `trades_Simple_ORB_NT8_20260817.jsonl` is contaminated by 57 phantom rows (`49` Buy, `8` Sell; `43``RTH_ORB`, `14``ETH`; all quantity `3`, grade `A`) and must not be used by dashboard/logtriage as clean gate evidence. Future forensic schema work should consider adding a `bar_time` field to trade provenance so replay investigations can map rows to historical bars.
- **Action Required:** Archive the contaminated 2026-08-17 trade JSONL before the next gate attempt, redeploy with the strategy disabled, delete `NinjaTrader.Custom.dll`, compile all NinjaScript cleanly, and verify a clean session start before re-arming.
### DEC-20260817-06
- **ID:** DEC-20260817-06
- **Date:** 2026-08-17
- **Status:** accepted
- **Context:** `tools/runnersweep/runnersweep.py`'s `is_runner_leg()` classified a trade row as a runner leg only if the literal words "runner" or "run" appeared in its Leg/Entry name/Exit name/Signal name fields (and excluded rows containing "scaler"/"scale"). `SubmitOrderToNT8()` in `NT8StrategyBase.cs` actually names legs `SDK_{Symbol}_R_{hex}` (runner) and `SDK_{Symbol}_S_{hex}` (scaler) — neither word appears in either name. Every combo in the 18-run sweep would therefore have been marked invalid with "missing runner-leg rows" regardless of how correctly the Strategy Analyzer backtests were run and exported, discovered before any backtest time was spent by reading `SubmitOrderToNT8()`'s signal-naming logic directly rather than assuming the tool's existing matcher was correct.
- **Decision:** `is_runner_leg()` now also matches the literal `_r_`/`_s_` token from the real signal-naming convention, in addition to the original word-based matching (kept for compatibility with differently-named strategies). Verified safe: the `{hex}` suffix in `SDK_{Symbol}_R_{hex}`/`SDK_{Symbol}_S_{hex}` is a GUID-derived hex string (characters `0-9a-f` only), which cannot contain the letters `r` or `s` needed to form a false `_r_`/`_s_` match, so there is no risk of misclassifying the hex portion as a leg marker.
- **Consequences:** The sweep can now correctly separate runner-leg trades from scaler-leg trades once real Strategy Analyzer exports are analyzed. This was caught before any of the 18 backtests were run, avoiding wasted analyzer time on exports the tool would have silently mis-scored.
- **Action Required:** None in code beyond the fix already made. When real Strategy Analyzer exports exist, spot-check that `runner_trades`/`combined_trade_count` in the JSON output look proportionally reasonable (Mode1DualLeg splits each fill into one scaler row and one runner row) before trusting the recommendation.
### DEC-20260817-05
- **ID:** DEC-20260817-05
- **Date:** 2026-08-17
- **Status:** accepted
- **Context:** DEC-20260817-03 noted that `tools/dashboard/server.py` already parsed `REJECT:`/`REJECT SUMMARY:` lines for the live current-session tail via a private `_parse_rejections()`/`_parse_key_values()` pair, but `tools/logtriage/logtriage.py`'s file-based parser had no reject handling at all — so any offline/historical `logtriage.py --json` run (the primary use case for silent-day forensics on past sessions) exposed no rejection data, and the two files carried duplicate, divergence-prone parsing logic.
- **Decision:** Added `parse_key_values()` to `logtriage.py` as the canonical parser (identical marker-bounded-value approach to the original `server.py` implementation, so `detail` text containing `=` or the word "bar" parses correctly). `SessionSummary` now carries `reject_summaries`, `reject_records`, and `reject_summary_final` (last-observed count per reason), populated while parsing `session_*.log` and exposed via `to_dict()`. The `SILENT DAY` diagnostic in `build_diagnostics()` now appends a `Rejections: <reason>=<count>, ...` breakdown (and machine-readable `reject_totals`) whenever data is available, so a silent day is self-explanatory in triage output rather than merely flagged. `server.py._build_current_rows()` no longer needs its own reject parsing — `logtriage.parse_session_file()` already supplies the fields on `row_dicts[0]` — so the duplicate `_parse_rejections()`/`_parse_key_values()` methods and the now-unused `lines` parameter on `_build_current_rows()` were removed. Field names/shapes are unchanged from what `server.py` produced before and match what `tools/dashboard/app.js` already expects (`row.reject_summaries[].{reason,count,line}`, `row.reject_records[].{reason,detail,bar,line}`), so no frontend change was needed.
- **Consequences:** `logtriage.py --json` run against archived log directories now surfaces the same rejection data the live dashboard already showed for the current session, closing the gap DEC-20260817-03 flagged. There is exactly one parser for this line format going forward instead of two. Logic was verified by hand-tracing both the `REJECT:` and `REJECT SUMMARY:` lines from the real `session_20260817_125115.log` archive; it has not been executed, since Claude has no code-execution access on the operator's machine — an operator run of `python tools/logtriage/logtriage.py --json` against the archive is the next real validation step.
- **Action Required:** Run `python tools/logtriage/logtriage.py "C:\Users\billy\Documents\NinjaTrader 8\log\nt8-sdk\ARCHIVE" --json` and confirm `reject_summaries`/`reject_records`/`reject_summary_final` appear on session rows with no exceptions raised; spot-check the `SILENT DAY` diagnostic message on a known silent day.
### DEC-20260817-04
- **ID:** DEC-20260817-04
- **Date:** 2026-08-17
- **Status:** accepted
- **Context:** DASH-002 was blocked pending confirmation that synthetic telemetry generation does not invoke state-mutating paths in `RegimeManager`, `TrendRegimeDetector`, or `VolatilityRegimeDetector`. Direct source review of `NT8StrategyBase.cs`, `SimpleORBStrategy.cs`, and `FactorCalculators.cs` confirms these three classes are instantiated in `InitializeSdkComponents()` but never called anywhere in the live signal path. The regime/volatility values actually used for signal generation are computed independently: inline SMA20/50 math in `BuildStrategyContext()` and pure-function ATR-ratio math inside `VolatilityRegimeFactorCalculator`/`TrendAlignmentFactorCalculator`, both of which read from `context.CustomData` with no side effects. `RegimeManager.UpdateRegime()`, `TrendRegimeDetector.DetectTrend()`, and `VolatilityRegimeDetector.DetectRegime()` mutate bar history, current-regime dictionaries, and transition logs on every call, and are currently dead code.
- **Decision:** DASH-002 is unblocked. Telemetry implementation must sample only from the existing side-effect-free sources (the inline regime calc in `BuildStrategyContext` and the existing `IFactorCalculator.Calculate()` pure functions) and must not call `RegimeManager.UpdateRegime()`, `TrendRegimeDetector.DetectTrend()`, or `VolatilityRegimeDetector.DetectRegime()` for periodic sampling. This constraint is now recorded in `TASK_DASH-002_PROMPT.md`.
- **Consequences:** DASH-002 can proceed without risk of corrupting future use of the regime-detector classes. If a later task wires `RegimeManager`/`TrendRegimeDetector`/`VolatilityRegimeDetector` into the live decision path, it starts from genuinely empty state rather than state pre-seeded by telemetry sampling.
- **Action Required:** None in code from this decision alone. Kilocode proceeds with DASH-002 per the updated prompt.
### DEC-20260817-03
- **ID:** DEC-20260817-03
- **Date:** 2026-08-17
- **Status:** accepted
- **Context:** GAP-035 made per-reason rejection details readable by logging only the first `REJECT:` line for each unique reason. Aggregate counts were still only written by `WriteRejectSummary()` at `State.Terminated`, leaving armed live sessions without current silent-day counts until the strategy stopped. Dashboard live parsing and `logwatch.py` already understand `REJECT SUMMARY: reason=<Reason> count=<count>`, but `tools/logtriage/logtriage.py` does not currently parse these lines despite dashboard copy referring to "logtriage JSON" for silent-day summary data.
- **Decision:** Keep per-detail `LogRejectRateLimited()` behavior unchanged, but write aggregate `REJECT SUMMARY` snapshots during live sessions. The cadence is first live rejection at or after 10:00 ET, then every 15 bar-minutes while live rejections continue. The summary line format remains unchanged so existing live dashboard/logwatch parsers continue to consume it.
- **Consequences:** Operators can see current rejection counts during the session without flooding the log with every individual rejection. Offline `logtriage.py --json` will still not expose these summaries until a separate parser update is approved.
- **Action Required:** Validate in a live RTH session that at least one `REJECT SUMMARY` snapshot appears before termination and that displayed counts match `_rejectCounts` at snapshot time.
regime agreement across several timeframes (e.g. 5m/15m/1h/daily) rather
than today's single daily SMA20/50 value — is a real feature idea but not
scoped. Needs its own `NT8.Core/Intelligence` design pass (new factor
calculator or `RegimeManager` usage across multiple bar series) before
implementation; not a quick addition to existing telemetry.
- iOS companion app
- NT8 Add-On WPF panel (Section 22 / Appendix D of master doc)
Reference in New Issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.