[GAP-062]: trend confirm direction fix complete
- src/NT8.Strategies/Examples/SimpleORBStrategy.cs: publish side-specific trend confirmation values - src/NT8.Core/Intelligence/FactorCalculators.cs: score trend confirmation by intent side - tests/NT8.Core.Tests/Intelligence/OrbConfluenceFactorTests.cs: add long/short symmetry coverage - SPRINT_BOARD.md: GAP-062 prompted -> implemented - docs/00-governance/current_status.md: updated GAP-062 status - docs/00-governance/decisions.md: recorded DEC-20260826-01 - TASK_GAP062_TREND_CONFIRM_DIRECTION_PROMPT.md: committed task prompt Build: clean | Tests: 569 passing | Dual-deployed: yes, backup 20260826_005308
This commit is contained in:
@@ -13,6 +13,94 @@ Use this file to record durable project decisions that affect implementation pat
|
||||
|
||||
## Decision Log
|
||||
|
||||
### DEC-20260826-01
|
||||
- **ID:** DEC-20260826-01
|
||||
- **Date:** 2026-08-26
|
||||
- **Status:** implemented — commit-only, pending SIM observation
|
||||
- **Context:** GAP-062 followed `DEC-20260825-04` and `DEC-20260825-06`: short candidates could earn the negative-slope `slopeAligned` bonus or the old positive-slope `trend_confirm` bonus, but not both, because `trend_confirm` was computed as `avwapSlope > 0.0 ? 1.0 : 0.0` before the scorer evaluated trade side. No deployed GAP-061 telemetry evidence was available in the current NT8 session log directory (`TrendConfirm`/`AvwapSlope` not found), so implementation rested on the source-level proof and tests.
|
||||
- **Decision:** Implement GAP-062 by publishing side-specific `trend_confirm_long` and `trend_confirm_short` values in `SimpleORBStrategy.UpdateConfluenceInputs()` using the already-computed AVWAP slope, then make `TrendAlignmentFactorCalculator` select the side-specific value matching `intent.Side`. Preserve the existing `TrendAlignmentFactorCalculator` score structure and weights exactly: `+0.4` price aligned to AVWAP, `+0.3` slope aligned to trade side, `+0.3` selected trend confirmation. Preserve the existing `STATE_CONTEXT` key shape by continuing to emit `TrendConfirm` as the legacy `trend_confirm` field, now resolved from pending/current breakout direction where available.
|
||||
- **Symmetry proof:** Tests now prove the three required cases. A short candidate with price below AVWAP, `avwap_slope < 0`, and `trend_confirm_short = 1.0` reaches `Trend=1.0`, equal to a symmetric long with price above AVWAP, `avwap_slope > 0`, and `trend_confirm_long = 1.0`. A short candidate evaluated against an uptrend (`avwap_slope > 0`, `trend_confirm_short = 0.0`) does not earn trend confirmation and scores only the price-alignment component in the fixture. A long in a confirmed uptrend still reads `trend_confirm = 1.0` in factor details and reaches `Trend=1.0`, preserving long-side behavior.
|
||||
- **Consequences:** This is a real scoring-behavior change, not observability-only. Previously B/C-capped short setups can now legitimately reach Grade A and pass `MinTradeGrade=A` when AVWAP slope genuinely confirms the short. Deploy was intentionally skipped per `TASK_GAP062_TREND_CONFIRM_DIRECTION_PROMPT.md`; operator SIM before/after observation is required before trusting this live.
|
||||
- **Verification:** `dotnet test tests\NT8.Core.Tests\NT8.Core.Tests.csproj --configuration Release --no-build --filter "FullyQualifiedName~Intelligence" --verbosity minimal` passed 89/89. `verify-build.bat` passed 569/569. Existing CS1998 warnings in unrelated OMS/mock test files remain present, but the verification script reported `All checks passed`.
|
||||
- **Related Files:** `TASK_GAP062_TREND_CONFIRM_DIRECTION_PROMPT.md`, `src/NT8.Strategies/Examples/SimpleORBStrategy.cs`, `src/NT8.Core/Intelligence/FactorCalculators.cs`, `tests/NT8.Core.Tests/Intelligence/OrbConfluenceFactorTests.cs`, `SPRINT_BOARD.md`, `docs/00-governance/current_status.md`.
|
||||
|
||||
### DEC-20260825-06
|
||||
- **ID:** DEC-20260825-06
|
||||
- **Date:** 2026-08-26
|
||||
- **Status:** decided — hold lifted, task prompted
|
||||
- **Context:** `DEC-20260825-04`'s investigation into "zero trades this week" found every real, pullback-confirmed breakout capped at Grade B/C, driven by `Trend=0.30` on every best short setup on both 2026-08-18 and the week of 2026-08-25. Drafting GAP-061 (observability-only) surfaced a provable-from-source cause: `trend_confirm` (`SimpleORBStrategy.cs:970`) is `avwapSlope > 0.0 ? 1.0 : 0.0` — direction-blind, unconditionally rewarding a positive slope regardless of trade side. For a short trade, this is mutually exclusive by construction with the correctly-aligned (negative-slope) `+0.3` bonus in `TrendAlignmentFactorCalculator.Calculate()`, so a short can never earn both `+0.3` bonuses even with a cleanly confirmed downtrend — capping the Trend factor at 0.30 (or 0.70 with price also below AVWAP), well below the 1.0 a symmetric long can reach. Kilocode's own GAP-061 commit writeback independently re-confirmed this finding after a fresh source read (`DEC-20260825-05`). The fix itself was deliberately held out of GAP-061's observability-only scope pending an explicit operator decision, since it changes real scoring behavior. Operator reviewed a full audit of all 10 confluence factor calculators (Trend is the only one with this defect; the other 9 are either direction-agnostic by design or already correctly symmetric) and, given the standing goal of profitability on SIM with zero trades taken this week, decided to lift the hold and proceed.
|
||||
- **Decision:** Lift the GAP-062 hold. Prompted `TASK_GAP062_TREND_CONFIRM_DIRECTION_PROMPT.md`, instructing Kilocode to make `trend_confirm` direction-aware (reward genuine trend confirmation in the direction of the candidate trade, not merely "slope is positive") without changing `TrendAlignmentFactorCalculator`'s additive `+0.4`/`+0.3`/`+0.3` structure or weights, and without changing long-side behavior (a long in a confirmed uptrend must still score `trend_confirm = 1.0`). Required tests proving three things: (1) a confirmed-downtrend short now earns `trend_confirm > 0.5` and reaches the same max Trend score a symmetric long would, (2) a short trading against the trend still correctly does NOT earn it (the fix must not become directionless in the other direction), (3) long-side scoring is byte-identical to before. Explicitly flagged, unlike GAP-050/GAP-061, that this is a real trading-behaviour change requiring SIM observation before/after deployment — not "none required."
|
||||
- **Consequences:** Previously B/C-Grade-capped short setups with a genuinely confirmed downtrend can now legitimately reach Grade A and pass `MinTradeGrade`, meaning the strategy may begin taking short trades it previously silently rejected all week. This is the intended effect — the scoring was wrong, not the filter — but it is a live-behaviour change and must be observed on SIM (Grade distribution before/after, at least one previously-capped short now scoring A on a comparable setup) before being trusted, per the task's VALIDATION section.
|
||||
- **Related Files:** `TASK_GAP062_TREND_CONFIRM_DIRECTION_PROMPT.md`, `src/NT8.Strategies/Examples/SimpleORBStrategy.cs` (`UpdateConfluenceInputs()`), `src/NT8.Core/Intelligence/FactorCalculators.cs` (`TrendAlignmentFactorCalculator`), `docs/00-governance/decisions.md`, `SPRINT_BOARD.md`.
|
||||
- **Action Required:** Await Kilocode's implementation and commit. Per standing practice, verify by reading the actual diff and the new tests directly — do not trust the commit summary. Once verified and deployed, observe SIM Grade distribution on short setups before/after to confirm the fix behaves as intended in practice, not just in unit tests.
|
||||
|
||||
### DEC-20260825-05
|
||||
- **ID:** DEC-20260825-05
|
||||
- **Date:** 2026-08-25
|
||||
- **Status:** verification complete — all five confirmed correct
|
||||
- **Context:** Kilocode reported GAP-050, GAP-061, GAP-057, GAP-056, and GAP-053 complete (commits `a99ce1d`, `a673475`, `0607d44`, `cdd9aa2`, `8a1c3d1`). Per standing practice, verified each by reading the actual diffs rather than trusting the commit summaries.
|
||||
- **GAP-050:** Confirmed, exact match to the task and the operator's Option A decision. `IRiskManager` now declares the 4-arg `ValidateOrder`; `AdvancedRiskManager` adds it (3-arg now delegates to 4-arg with `candidateContracts=1`, Tier 1 forwards to `_basicRiskManager`'s 4-arg overload, Tier 2/3/3.5 untouched, added a `candidateContracts < 0` guard not explicitly requested but harmless); `NT8StrategyBase.cs`'s `as BasicRiskManager` type-check workaround is gone, replaced with a direct interface call; `NT8OrderAdapter.ExecuteIntent` now sizes before validating and passes the real contract count. New tests are genuinely load-bearing, not just compile checks: `AdvancedRiskManagerTests` proves the same intent is rejected at 3 contracts and allowed at 1; `NT8OrderAdapterIntegrationTests` proves the sized quantity actually reaches the risk manager and the 3-arg overload is never called; `NT8StrategyBaseRiskContractTests` source-asserts the type-check is gone. Live path (`BasicRiskManager`, direct construction) behaviorally unchanged — confirmed by reading the diff, not just trusting the note.
|
||||
- **GAP-061:** Confirmed, exact match. `SimpleORBNT8.GetStateTelemetryContextFields()` adds `Avwap`/`AvwapSlope`/`TrendConfirm` via a new defensive `AddStateContextDouble` helper — null/missing-key/non-numeric safe, omits rather than placeholders. Tests explicitly assert `trend_confirm`'s calculation string is absent from the diff and that `STATE:`/`STATE_DETAIL:` formats are untouched — good self-verification of scope. Kilocode's own re-read independently reconfirmed the `trend_confirm` direction-blindness finding from `DEC-20260825-04` before implementing, rather than taking the task prompt's claim at face value — appended directly to that entry.
|
||||
- **GAP-057:** Confirmed via stat + spot check — test-only, new `NT8StrategyBaseRunnerTrailTests.cs`, Option B (source-text seam) as specified, no production files touched.
|
||||
- **GAP-056:** Confirmed via full diff. `NT8StrategyBase.cs`'s three breakeven properties now carry `[Browsable(false)]` plus an "unused" description; `SimpleORBNT8.cs`'s settings export labels the line `UNUSED (retained for compatibility)`. Exactly Option A as specified, no logic touched.
|
||||
- **GAP-053:** Confirmed via stat — `executive_summary.md`/`roadmap.md` diffs only, no source or test files touched, matches docs-only scope.
|
||||
- **Related Files:** commits `a99ce1d`/`a673475`/`0607d44`/`cdd9aa2`/`8a1c3d1`.
|
||||
- **Action Required:** None for correctness. Deploy remains a separate manual operator step for all five (each skipped deploy per its task's header, as instructed).
|
||||
|
||||
### DEC-20260825-04
|
||||
- **ID:** DEC-20260825-04
|
||||
- **Date:** 2026-08-25
|
||||
- **Status:** finding recorded, no code change — awaiting operator direction
|
||||
- **Context:** Zero trades this week (Mon 8/24 + Tue 8/25 RTH). Investigated the continuous SIM session log (`session_20260823_230519.log`) directly rather than guessing. Found 63 genuine pullback-confirmed breakout evaluations this week (`DirectionSource=PendingBreakout` in `STATE:` telemetry, meaning `SimpleORBStrategy`'s real two-bar breakout-confirmation logic actually fired, not the pre-ORB/synthetic diagnostic tiers). Grade distribution among those 63: 0 A, 9 B, 10 C, 39 D, 5 F — every one was correctly filtered by `MinTradeGrade=A` (`SimpleORBStrategy.cs:677`, `GradeFilter`). All 9 B-grade instances came from one continuous bearish stretch (10:04:59-11:05:00 ET), scores 0.70-0.77. Reading the real per-factor breakdown (`STATE_DETAIL`) for those: `Trend=0.30` (full weight 1.00) was the single largest drag on every one — if Trend had scored near the other core factors (~0.80-1.00), several would plausibly have cleared Grade A. `PriorDayCloseStrength=0.40` and `NarrowRange=0.20` (both post-GAP-047-weighted) were secondary drags. This is a scoring/calibration observation, not a diagnosed defect — Trend genuinely measures AVWAP slope/alignment/confirmation and may be correctly scoring a genuinely weak-trend day; no code was changed and none is recommended without operator direction, since retuning `MinTradeGrade` or factor weights is a curve-fitting-risk decision, not a bug fix.
|
||||
- **Separate finding (process, not scoring):** Investigating why zero `GradeFilter`/`OrbRangeNotEstablished`/`MaxDailyTrades` reasons ever appeared in this week's `REJECT SUMMARY` output (despite the real per-bar logic needing to produce them constantly) led to tracing the GAP-060 fix's own state machine (`_orbRejectSummarySnapshotWritten` fires once per trading day in the fixed version) against this log's actual behavior (fires once ever, then silent for the rest of the week) — this matches the **pre-fix** GAP-060 behavior exactly, not the fixed one. Conclusion: the currently-running SIM strategy (continuously live since 23:05:19 on 2026-08-23) is still running the **pre-GAP-060-fix binary**, because deployment was blocked by the `NinjaTrader.exe` file lock (`DEC-20260825-01`) and never completed. The fix is correct in source and committed; it has simply never reached the running strategy. This also means this week's `STATE:`-telemetry-based analysis above is the only visibility we had — the intended `REJECT SUMMARY` cadence has not actually been restored yet.
|
||||
- **Decision:** None — reporting only. Recommended to operator: (1) redeploy now that NinjaTrader is closed, so `REJECT SUMMARY` visibility (GAP-060) is actually restored before the next SIM session; (2) separately decide whether the `Trend` factor / `MinTradeGrade=A` combination warrants review — that is a strategy-tuning call, not something to change unilaterally.
|
||||
- **Related Files:** `session_20260823_230519.log` (device log folder), `src/NT8.Strategies/Examples/SimpleORBStrategy.cs` (~347-690, `OnBar`/`GradeFilter` check), `src/NT8.Adapters/Strategies/NT8StrategyBase.cs` (~700-856, RTH/ETH telemetry branch; ~1560-1595, reject snapshot state machine), `src/NT8.Core/Intelligence/ConfluenceScorer.cs`, `src/NT8.Core/Intelligence/GradeFilter.cs`.
|
||||
- **Action Required:** Operator decision on whether/how to revisit `Trend` calibration or `MinTradeGrade`; redeploy GAP-060/059/051/052 (and GAP-050/053/056/057 once Kilocode lands them) now that NinjaTrader is closed.
|
||||
|
||||
- **Update (2026-08-25, same day):** Pulled the only other trading day with usable `STATE:` telemetry (`EnableStateTelemetry`/DASH-002 only existed from ~2026-08-16 onward) — `session_20260818_065020.log`, 2026-08-18. Same pattern, slightly worse: 239 real `DirectionSource=PendingBreakout` evaluations, capping at Grade C (0 A, 0 B, 77 C, 132 D, 30 F; best score 0.655). That session predates GAP-047 (confluence weights still `x1.00` across the board — confirmed directly in the `Factors=` string). This week's best (`Score=0.774`, Grade B) is a real improvement over 8/18's best (`Score=0.655`, Grade C) — consistent with GAP-047 helping — but still short of `MinTradeGrade=A`.
|
||||
- **Common driver on both days:** `Trend=0.30` on every one of the highest-scoring real breakouts, both days, both `Regime=Bearish`/`Direction=Sell`. Read `TrendAlignmentFactorCalculator.Calculate()` (`src/NT8.Core/Intelligence/FactorCalculators.cs` ~116-186): the Trend factor is additive — `+0.4` if price is on the trade's side of AVWAP, `+0.3` if AVWAP slope aligns with direction, `+0.3` if `trend_confirm > 0.5`. A score of exactly `0.30` means only one `+0.3` component fired and the `+0.4` price-vs-AVWAP component did not, on both days. Working hypothesis, **not verified against raw `avwap`/`avwap_slope` values** (not present in `STATE_CONTEXT` telemetry output, so this needs either a temporary diagnostic field or a debugger session to confirm): an ORB breakout is, by construction, an *early-session* entry (right after the 09:30-10:00 window closes) — a session-anchored AVWAP has had very little time to diverge from price that early, so the `+0.4` "price is clearly on the trade's side of AVWAP" component may be structurally hard to earn on a textbook, well-timed ORB breakout even when the breakout itself is real and directionally correct. If true, this is a design tension between the ORB strategy's entry timing and the Trend factor's assumption of a well-developed AVWAP — not a coding defect in either piece individually.
|
||||
- **Not decided, options for operator:** (1) leave as-is and gather more days of evidence before concluding anything — two days is a thin sample; (2) instrument `STATE_CONTEXT` with the raw `avwap`/`avwap_slope`/`trend_confirm` values so this hypothesis can be confirmed or refuted directly from the log instead of inferred (small, safe, observability-only change, same class as GAP-059); (3) if confirmed, consider whether `TrendAlignmentFactorCalculator`'s AVWAP-divergence assumption should be reweighted or time-adjusted for early-session entries specifically, or whether `MinTradeGrade` should account for this — both are real strategy-design decisions, not something to change without operator sign-off given the risk of curve-fitting to a two-day sample.
|
||||
- **Update (2026-08-25, same day) — operator selected option (2).** Drafting the instrumentation task surfaced something sharper than the AVWAP-divergence hypothesis: `trend_confirm` (`SimpleORBStrategy.cs:970`, `context.CustomData["trend_confirm"] = avwapSlope > 0.0 ? 1.0 : 0.0`) is direction-blind, not just a hypothesis needing log confirmation — it's provable directly from source. `TrendAlignmentFactorCalculator` awards `+0.3` for `slopeAligned` (short trades need `avwapSlope < 0.0`) and a separate `+0.3` for `trendConfirm > 0.5` (which requires `avwapSlope > 0.0`, unconditionally). These two are mutually exclusive for any short trade by construction — a short can never earn both bonuses, even with a cleanly confirmed downtrend, capping the achievable Trend score at `0.3` (or `0.7` with price also below AVWAP) regardless of trend quality. This matches both real days' `Trend=0.30` results exactly. Tracked as **GAP-061**, scoped observability-only per the operator's instruction — exposes `Avwap`/`AvwapSlope`/`TrendConfirm` in `STATE_CONTEXT` (does not fix the asymmetry) so the remaining unconfirmed piece (price-vs-AVWAP timing) can be checked with real numbers, and so the `trend_confirm` finding is visible in log evidence too. Whether to fix the asymmetry itself is a separate, not-yet-made decision — flagged explicitly in the task's writeback requirement so the operator gets a clean basis to decide.
|
||||
- **Prompt:** `TASK_GAP061_AVWAP_TELEMETRY_PROMPT.md`.
|
||||
- **GAP-061 Implementation Note (2026-08-25):** Implemented the selected observability-only instrumentation in `SimpleORBNT8.GetStateTelemetryContextFields()`. `STATE_CONTEXT` now appends `Avwap` (`F2`), `AvwapSlope` (`F4`), and `TrendConfirm` (`F1`) from existing `context.CustomData` keys when present, omitting each field entirely when the key is missing or non-numeric. The ORB-readiness gate and existing `OrbHigh`/`OrbLow`/`OrbWindowStart`/`OrbWindowEnd`/`OrbReady` fields are unchanged. No `UpdateConfluenceInputs()`, `TrendAlignmentFactorCalculator`, `trend_confirm`, scoring, `STATE:`, `STATE_DETAIL:`, risk, sizing, or order-flow logic changed. Source re-check confirms the direction-blindness finding remains: `trend_confirm` is still `avwapSlope > 0.0 ? 1.0 : 0.0`, so short trades can earn the negative-slope `slopeAligned` bonus or the positive-slope `trend_confirm` bonus, but not both. Verification: focused `SimpleORBNT8DefaultsTests` passed 7/7; `verify-build.bat` passed with 561/561 tests (472 Core, 79 Integration, 10 Performance); `dotnet test tests\NT8.Core.Tests\NT8.Core.Tests.csproj --configuration Release --no-build --verbosity minimal` passed 472/472. Deploy intentionally skipped by task prompt.
|
||||
|
||||
|
||||
|
||||
### DEC-20260825-03
|
||||
- **ID:** DEC-20260825-03
|
||||
- **Date:** 2026-08-25
|
||||
- **Status:** decided — Option A, prompted to Kilocode
|
||||
- **Context:** GAP-050 (`MaxTradeRisk` has no quantity term) was staged 2026-08-18 as an operator-decision item. Investigation on 2026-08-25 (prompted by "layout the options") found the original framing ("$600 vs $1,000 daily limit") is stale for the live path: `SimpleORBNT8`/`NT8StrategyBase` constructs `BasicRiskManager` directly (`NT8StrategyBase.cs:1763`) and its order-eval ternary (~2131-2136) reaches the quantity-aware 4-arg `ValidateOrder(intent, context, config, candidateContracts)` overload via an `as BasicRiskManager` runtime type-check. `IRiskManager` itself, however, never declared a quantity-aware member — only the 3-arg `ValidateOrder(intent, context, config)`. `AdvancedRiskManager` implements `IRiskManager` but has no 4-arg overload and delegates Tier 1 to its inner `BasicRiskManager` via the 1-contract-assumed 3-arg call; confirmed via grep that `new AdvancedRiskManager(` appears nowhere in `src/` outside its own file (only constructed in isolation by `AdvancedRiskManagerTests.cs`/`RiskSizingIntegrationTests.cs`) — not wired to live trading. `NT8OrderAdapter.ExecuteIntent` also validates before sizing (backwards even if quantity-aware) and is itself only reachable through `BaseNT8StrategyWrapper`, whose own doc comment calls it "a template that would be extended in actual NT8 strategy files" — not extended anywhere in `src/`. Net: today's SIM/live trading is not exposed; the real defect is an interface contract gap covered only by a type-check, plus two unwired call sites that would silently reintroduce it if ever activated.
|
||||
- **Decision:** Operator selected **Option A** — fix it properly at the interface rather than leaving the type-check workaround in place. Add the 4-arg `ValidateOrder` to `IRiskManager` itself, implement it on `AdvancedRiskManager` (Tier 1 forwarded to the inner `BasicRiskManager`'s 4-arg overload, Tier 2/3/3.5 bodies unchanged), remove the `as BasicRiskManager` cast in `NT8StrategyBase.cs` in favor of a direct interface call, and fix `NT8OrderAdapter.ExecuteIntent`'s validate-before-size ordering. Explicitly out of scope: wiring `AdvancedRiskManager`/`NT8OrderAdapter` into the live strategy — that is a separate decision this task does not make.
|
||||
- **Consequences:** No live-behaviour change expected — the live path's underlying call is identical, just reached without the type-check. Closes the risk of a future silent regression if `AdvancedRiskManager` or `NT8OrderAdapter` are ever wired into a live path. Requires new quantity-aware tests on `AdvancedRiskManager` and `NT8OrderAdapter`.
|
||||
- **Related Files:** `src/NT8.Core/Risk/IRiskManager.cs`, `src/NT8.Core/Risk/BasicRiskManager.cs`, `src/NT8.Core/Risk/AdvancedRiskManager.cs`, `src/NT8.Adapters/Strategies/NT8StrategyBase.cs`, `src/NT8.Adapters/NinjaTrader/NT8OrderAdapter.cs`, `TASK_GAP050_ADVANCED_RISK_QTY_PROMPT.md`
|
||||
- **Action Required:** GAP-050 implemented; deploy remains a separate manual operator step.
|
||||
- **GAP-050 Implementation Note (2026-08-25):** Implemented Option A. `IRiskManager` now declares the quantity-aware 4-arg `ValidateOrder`; `BasicRiskManager` already satisfied the contract with no logic change; `AdvancedRiskManager` now has a 4-arg overload that forwards Tier 1 to `_basicRiskManager.ValidateOrder(..., candidateContracts)` and the 3-arg overload delegates to the 4-arg overload with `candidateContracts=1`; `NT8StrategyBase` now calls `_riskManager.ValidateOrder(intent, context, _riskConfig, sizingResult.Contracts)` directly instead of casting to `BasicRiskManager`; `NT8OrderAdapter.ExecuteIntent()` now sizes first, returns on `Contracts <= 0`, and then validates risk with the sized quantity. Added tests for quantity-aware AdvancedRiskManager rejection/allowance, backward-compatible 3-arg behavior, NT8OrderAdapter sized risk validation, and NT8StrategyBase source-level interface usage. Verification: focused Core tests passed 10/10; focused Integration tests passed 13/13; `verify-build.bat` passed with 566/566 tests (476 Core, 80 Integration, 10 Performance); `dotnet test tests\NT8.Core.Tests\NT8.Core.Tests.csproj --configuration Release --no-build --verbosity minimal` passed 476/476. Deploy intentionally skipped by task prompt.
|
||||
|
||||
### DEC-20260825-02
|
||||
- **ID:** DEC-20260825-02
|
||||
- **Date:** 2026-08-25
|
||||
- **Status:** implemented
|
||||
- **Context:** GAP-053 was flagged by the original v7.0 review as `executive_summary.md`/`roadmap.md`'s Sprint 3 list presenting ~12 completed tasks as open. `roadmap.md` already contains its own `STALE-LIST WARNING (GAP-053, added 2026-08-18)` naming the specific stale items (TASK-06a, TASK-06b, GAP-003/004/005/006/008/009/010/019/022, plus GAP-011/GAP-040 separately) — it has sat unpruned since the warning was added. `executive_summary.md` (dated 2026-05-04, still referencing the retired v6 master doc) separately lists four of the same already-completed items under "Critical Open Issues."
|
||||
- **Decision:** Track as **GAP-053**. Documentation-only, zero trading-behaviour risk. Task requires independently re-verifying each named-stale item's completion (via `SPRINT_BOARD.md`'s historical record and the cited `DEC-20260711-01..09`/`DEC-20260713-02` entries) before pruning — not just trusting the warning's own claims — and flagging anything that doesn't check out rather than pruning it anyway.
|
||||
- **Related Files:** `docs/00-governance/executive_summary.md`, `docs/00-governance/roadmap.md`, `TASK_GAP053_STALE_DOCS_PRUNE_PROMPT.md`
|
||||
- **Implementation Note (2026-08-25):** GAP-053 pruned the stale May/July status snapshots from `executive_summary.md` and `roadmap.md`. Verified before pruning against `SPRINT_BOARD.md` historical records and decision entries: TASK-06a, TASK-06b, GAP-003, GAP-004, GAP-005, GAP-006, GAP-008, GAP-009, GAP-010, GAP-011, and GAP-019 are complete from the 2026-07-11 historical record; GAP-022 is partial with 5/8 verified on 2026-07-14 and remaining connection-state scenarios tracked as GAP-022-FOLLOWUP; GAP-040 is implemented/firing in production as of 2026-08-18. `executive_summary.md` now points at the v7.0 master reference, moves the four v6 critical issues into a resolved-since-v6 section, and lists current open items instead. `roadmap.md` no longer contains the `STALE-LIST WARNING` or the open-looking July list; it now records the pruned resolved history and leaves GAP-030/GAP-007 separate. No source code or tests changed.
|
||||
- **Action Required:** None. Documentation-only; no operator validation required.
|
||||
|
||||
### DEC-20260825-01
|
||||
- **ID:** DEC-20260825-01
|
||||
- **Date:** 2026-08-25
|
||||
- **Status:** verification complete — all four confirmed correct; deploy still pending
|
||||
- **Context:** Kilocode reported GAP-060, GAP-059, GAP-051, and GAP-052 complete (commits `6c672a5`, `7e82b2c`, `18877c3`, `8b9a2e2`). Per standing practice, verified each by reading the actual diffs rather than trusting the summary.
|
||||
- **GAP-060:** Confirmed. `MaybeWriteRejectSummarySnapshot`'s blanket `TimeOfDay < 10:00 AM` gate replaced with a proper `[suppressionStart, suppressionEnd)` window check (`IsRejectSummarySnapshotSuppressed`), overridden in `SimpleORBNT8` to bind to the actual configured ORB window instead of a hardcoded one. The once-after-ORB flag now resets per `barTime.Date` via a new `_rejectSummarySnapshotTradingDate` field. A new unconditional `MaybeWriteRejectSummarySnapshot(Time[0])` call was added to the `OnBarUpdate` heartbeat (before context/intent evaluation), so cadence no longer depends solely on a reject occurring. The open question from the task was resolved as possibility (a) — a new real execution test (`OnBar_RthNoBreakout_RecordsOrbRangeNotEstablishedBeforeAndAfterOrbClose`) drives `SimpleORBStrategy.OnBar()` directly and proves `OrbRangeNotEstablished` is correctly set in `context.CustomData` both during ORB-building and after close with no breakout — confirming the missing visibility was purely the summary-reporting layer, not a second strategy-level defect. New tests in `NT8StrategyBaseRejectSummaryTests.cs` are source-text assertions (consistent with the established, previously-accepted pattern for this NinjaScript-derived class that cannot be instantiated for execution tests).
|
||||
- **GAP-059:** Confirmed. `SimpleORBNT8.OnBarUpdate()` no longer reads the dead `_openingRangeHigh`/`_openingRangeLow` fields — both removed entirely (test asserts their absence from source). ORB high/low now come from `(_sdkStrategy as SdkSimpleORB).OpeningRangeHigh/OpeningRangeLow`, gated on `OpeningRangeReady`, matching the pattern already used correctly elsewhere in the file. New test `OrbRangeVsAtr_RealisticSdkOrbRangeTicks_ReturnsRatioReason` is a genuine execution test against `OrbRangeVsAtrFactorCalculator.Calculate()` using tonight's real logged ORB values (29243.00/28946.75) and confirms the factor no longer returns the neutral "no daily bar context" fallback.
|
||||
- **GAP-051:** Confirmed, Option A as specified. New `_microUpgradePersistenceLoaded`/`InitializeMicroUpgradeSuggestedState()` load a dedicated `micro_upgrade_suggested_<Account>.json` once per realtime run; `WriteMicroUpgradeSuggestedFile()` persists it only after the existing advisory message fires. Corrupt/missing file correctly falls back to allowing the reminder (over-reminding over silent suppression, as specified) rather than throwing. `Account == null` performs no file I/O. Does not touch GAP-055's own persistence file.
|
||||
- **GAP-052:** Confirmed, Option A as specified, plus a legitimate scope extension worth flagging: Kilocode found that `AdvancedRiskManager.cs` and `AdvancedPositionSizer.cs` carried their own additional, independently-drifted copies of the same tick-value table (not mentioned in the task, which only named `BasicRiskManager`/`BasicPositionSizer`) and consolidated all four into the new `NT8.Core.Common.InstrumentTickValueTable`, containing the correct union (`6A=$10.00`, `6E=$12.50`). Two real execution tests: one asserts full parity across `InstrumentTickValueTable`/`BasicRiskManager`/`BasicPositionSizer`'s `GetSupportedSymbols()` for every symbol, the other drives `BasicRiskManager.ValidateOrder()` end-to-end for a real `6A` intent and confirms the computed trade risk now uses `$10.00`/tick. Platform-neutrality question from the task's READ-FIRST was correctly answered: `NT8.Core` cannot reference `Instrument.MasterInstrument`, so Option A (not B) was the only viable choice — documented explicitly in the implementation note.
|
||||
- **Process finding (not a code defect):** For GAP-060 and GAP-059, `deployment\deploy-to-nt8.bat` was actually *run* and only failed because `NinjaTrader.exe` (PID 18800) held a lock on `NT8.Core.dll` — not because Kilocode honored the "commit only, do not deploy" instruction added to those two task prompt files. Confirmed by reading the committed copies of `TASK_GAP060_...md`/`TASK_GAP059_...md` in the relevant commits directly: neither contains the "Deploy: COMMIT ONLY" line added earlier — Kilocode ran from an older cached copy of those two files. For GAP-051 and GAP-052 (run afterward), the commit messages read "skipped per operator instruction," meaning the no-deploy instruction reached Kilocode as a direct/verbal instruction from the operator partway through the run, not from the file text either. Net effect tonight: harmless, because the file lock acted as an accidental safety net — but the instruction itself did not do the job as intended, and would not protect against a future run where NinjaTrader happens not to be holding the DLL.
|
||||
- **Also flagged, not investigated further:** the device repo's working tree currently shows several files (`SPRINT_BOARD.md`, four `TASK_GAP0*.md` files, and four `docs/00-governance/*.md` files) as modified-but-uncommitted relative to `HEAD`, and a `git status`/`git diff` invocation from this session surfaced a `.git/index.lock` unlink permission warning. This session did not attempt any git write operations to investigate or resolve it. Recommend the operator check `git status` directly on the machine before the next Kilocode run or deploy attempt, in case there's a leftover lock from an interrupted operation.
|
||||
- **Related Files:** `src/NT8.Adapters/Strategies/NT8StrategyBase.cs`, `src/NT8.Adapters/Strategies/SimpleORBNT8.cs`, `src/NT8.Core/Common/InstrumentTickValueTable.cs`, `src/NT8.Core/Risk/BasicRiskManager.cs`, `src/NT8.Core/Risk/AdvancedRiskManager.cs`, `src/NT8.Core/Sizing/BasicPositionSizer.cs`, `src/NT8.Core/Sizing/AdvancedPositionSizer.cs`, commits `6c672a5`/`7e82b2c`/`18877c3`/`8b9a2e2`
|
||||
- **Action Required:** Once NinjaTrader is closed, rerun `deployment\deploy-to-nt8.bat`, manually compile NinjaScript, and validate all four in the next SIM session (REJECT SUMMARY cadence throughout RTH for GAP-060; `OrbRangeVsAtr` no longer "no daily bar context" for GAP-059; a same-account restart no longer re-logging `TIER_UPGRADE_SUGGESTED` for GAP-051; no operator validation needed for GAP-052 since NQ/MNQ are unaffected). Separately, confirm the working-tree/git-lock state on the machine directly before the next Kilocode run.
|
||||
|
||||
### DEC-20260823-08
|
||||
- **ID:** DEC-20260823-08
|
||||
- **Date:** 2026-08-24
|
||||
@@ -24,34 +112,6 @@ Use this file to record durable project decisions that affect implementation pat
|
||||
- **Related Files:** `src/NT8.Adapters/Strategies/NT8StrategyBase.cs` (`MaybeWriteRejectSummarySnapshot`/`LogRejectRateLimited`/`ResetRejectTracking`/`WriteSessionHeader` ~1444-1517), `src/NT8.Strategies/Examples/SimpleORBStrategy.cs` (`OnBar` ~355-432, `RecordSignalRejection` ~1015-1026), `session_20260823_230519.log`
|
||||
- **Implementation Note (2026-08-25):** GAP-060 implemented as logging/observability only. `NT8StrategyBase.MaybeWriteRejectSummarySnapshot()` no longer has a blanket midnight-to-10:00 AM suppression gate; suppression now delegates to an ORB-window-aware helper and `SimpleORBNT8` overrides that helper so the suppressed window is today's configured 09:30 + `OpeningRangeMinutes`. The once-after-ORB snapshot flag now resets per `barTime.Date`, allowing a new post-ORB summary every day in a continuous multi-day session. `OnBarUpdate()` now calls `MaybeWriteRejectSummarySnapshot(Time[0])` on the live bar heartbeat after the first realtime-bar guard, so 15-minute summary cadence can flush from regular processed bars and is not solely dependent on a newly logged reject. Existing `_rejectDetailsLogged` one-detail-line-per-reason rate limiting, reject reason strings, `REJECT:`/`REJECT SUMMARY:` formats, order flow, sizing, risk, and real trade decisions were unchanged. Open question resolved as possibility **(a)**: the missing `OrbRangeNotEstablished` visibility was adapter summary reporting, not a second SimpleORB rejection defect. A focused `SimpleORBStrategy.OnBar()` test proves the no-breakout RTH path records `OrbRangeNotEstablished` both while the ORB is building and after ORB close when no breakout confirms. Verification: focused GAP-060 tests passed 8/8; `verify-build.bat` passed with 543/543 tests (454 Core, 79 Integration, 10 Performance); `dotnet test tests\NT8.Core.Tests\NT8.Core.Tests.csproj --configuration Release --no-build --verbosity minimal` passed 454/454.
|
||||
- **Action Required:** Deployment remains pending. `deployment\deploy-to-nt8.bat` was attempted on 2026-08-25 but failed because NinjaTrader.exe PID 18800 locked `NT8.Core.dll`; operator instructed Kilocode to commit without deploy. After NinjaTrader is closed, rerun deployment, start NT8, manually compile NinjaScript, and in the next SIM session spanning a full trading day confirm `REJECT SUMMARY` appears throughout RTH at a reasonable cadence.
|
||||
### DEC-20260825-03
|
||||
- **ID:** DEC-20260825-03
|
||||
- **Date:** 2026-08-25
|
||||
- **Status:** implemented — Option A, deploy skipped by prompt
|
||||
- **Context:** GAP-050 (`MaxTradeRisk` has no quantity term) was staged 2026-08-18 as an operator-decision item. Investigation on 2026-08-25 found the original framing ("$600 vs $1,000 daily limit") is stale for the live path: `SimpleORBNT8`/`NT8StrategyBase` constructs `BasicRiskManager` directly and already reaches the quantity-aware 4-arg `ValidateOrder(intent, context, config, candidateContracts)` overload via an `as BasicRiskManager` runtime type-check. `IRiskManager` itself, however, never declared a quantity-aware member. `AdvancedRiskManager` implemented `IRiskManager` but had no 4-arg overload and delegated Tier 1 to its inner `BasicRiskManager` through the 1-contract-assumed 3-arg call. `NT8OrderAdapter.ExecuteIntent` validated before sizing, so it also could not pass quantity. These scaffolding paths are not currently wired to live SimpleORB trading, but would silently reintroduce the 1-contract assumption if activated.
|
||||
- **Decision:** Operator selected Option A: fix the contract at `IRiskManager`, add the quantity-aware implementation to `AdvancedRiskManager`, remove the live-path type-check workaround from `NT8StrategyBase`, and fix `NT8OrderAdapter.ExecuteIntent` to size before risk validation. Do not wire `AdvancedRiskManager` or `NT8OrderAdapter` into live trading in this task.
|
||||
- **Implementation Note (2026-08-25):** `IRiskManager` now declares the quantity-aware 4-arg `ValidateOrder`; `BasicRiskManager` already satisfied the contract with no logic change; `AdvancedRiskManager` now has a 4-arg overload that forwards Tier 1 to `_basicRiskManager.ValidateOrder(..., candidateContracts)` and the 3-arg overload delegates to the 4-arg overload with `candidateContracts=1`; `NT8StrategyBase` now calls `_riskManager.ValidateOrder(intent, context, _riskConfig, sizingResult.Contracts)` directly instead of casting to `BasicRiskManager`; `NT8OrderAdapter.ExecuteIntent()` now sizes first, returns on `Contracts <= 0`, and then validates risk with the sized quantity. Added tests for quantity-aware AdvancedRiskManager rejection/allowance, backward-compatible 3-arg behavior, NT8OrderAdapter sized risk validation, and NT8StrategyBase source-level interface usage. Verification: focused Core tests passed 10/10; focused Integration tests passed 13/13; `verify-build.bat` passed with 566/566 tests (476 Core, 80 Integration, 10 Performance); `dotnet test tests\NT8.Core.Tests\NT8.Core.Tests.csproj --configuration Release --no-build --verbosity minimal` passed 476/476. Deploy intentionally skipped by task prompt.
|
||||
- **Related Files:** `src/NT8.Core/Risk/IRiskManager.cs`, `src/NT8.Core/Risk/AdvancedRiskManager.cs`, `src/NT8.Adapters/Strategies/NT8StrategyBase.cs`, `src/NT8.Adapters/NinjaTrader/NT8OrderAdapter.cs`, `tests/NT8.Core.Tests/Risk/AdvancedRiskManagerTests.cs`, `tests/NT8.Core.Tests/Adapters/NT8StrategyBaseRiskContractTests.cs`, `tests/NT8.Integration.Tests/NT8OrderAdapterIntegrationTests.cs`, `TASK_GAP050_ADVANCED_RISK_QTY_PROMPT.md`
|
||||
- **Action Required:** Deploy remains a separate manual operator step. No operator validation required before commit because the live path's underlying quantity-aware `BasicRiskManager` call is unchanged.
|
||||
### DEC-20260825-04
|
||||
- **ID:** DEC-20260825-04
|
||||
- **Date:** 2026-08-25
|
||||
- **Status:** GAP-061 implemented; trend calibration follow-up undecided
|
||||
- **Context:** Zero-trade investigation found real short-side breakout evaluations capped below Grade A, with `Trend=0.30` as the common driver on the best setups. Source read confirmed `TrendAlignmentFactorCalculator` adds `+0.4` for price on the trade side of AVWAP, `+0.3` for slope aligned with trade direction, and `+0.3` for `trend_confirm > 0.5`.
|
||||
- **Finding:** `trend_confirm` is direction-blind in `SimpleORBStrategy.UpdateConfluenceInputs()` (`context.CustomData["trend_confirm"] = avwapSlope > 0.0 ? 1.0 : 0.0`). For short trades, slope alignment requires `avwapSlope < 0.0`, while `trend_confirm` requires `avwapSlope > 0.0`; a short can therefore earn one or the other, but not both, even in a clean bearish trend. GAP-061 does not fix this scoring asymmetry; it only exposes raw telemetry for operator review.
|
||||
- **Decision:** Implement the selected observability-only instrumentation. Do not change `trend_confirm`, scoring, `MinTradeGrade`, risk, sizing, or order flow in this task.
|
||||
- **Implementation Note (2026-08-25):** `SimpleORBNT8.GetStateTelemetryContextFields()` now appends `Avwap` (`F2`), `AvwapSlope` (`F4`), and `TrendConfirm` (`F1`) from existing `context.CustomData` keys when present, omitting each field entirely when the key is missing or non-numeric. The ORB-readiness gate and existing `OrbHigh`/`OrbLow`/`OrbWindowStart`/`OrbWindowEnd`/`OrbReady` fields are unchanged. No `UpdateConfluenceInputs()`, `TrendAlignmentFactorCalculator`, `trend_confirm`, scoring, `STATE:`, `STATE_DETAIL:`, risk, sizing, or order-flow logic changed. Verification: focused `SimpleORBNT8DefaultsTests` passed 7/7; `verify-build.bat` passed with 561/561 tests (472 Core, 79 Integration, 10 Performance); `dotnet test tests\NT8.Core.Tests\NT8.Core.Tests.csproj --configuration Release --no-build --verbosity minimal` passed 472/472. Deploy intentionally skipped by task prompt.
|
||||
- **Related Files:** `src/NT8.Adapters/Strategies/SimpleORBNT8.cs`, `tests/NT8.Core.Tests/Adapters/SimpleORBNT8DefaultsTests.cs`, `TASK_GAP061_AVWAP_TELEMETRY_PROMPT.md`
|
||||
- **Action Required:** Operator decision still needed on whether to fix direction-blind `trend_confirm` or revisit Trend/MinTradeGrade calibration after reviewing real `STATE_CONTEXT` values from a deployed session.
|
||||
### DEC-20260825-02
|
||||
- **ID:** DEC-20260825-02
|
||||
- **Date:** 2026-08-25
|
||||
- **Status:** implemented
|
||||
- **Context:** GAP-053 was flagged by the original v7.0 review as `executive_summary.md`/`roadmap.md`'s Sprint 3 list presenting ~12 completed tasks as open. `roadmap.md` already contained its own `STALE-LIST WARNING (GAP-053, added 2026-08-18)` naming the specific stale items (TASK-06a, TASK-06b, GAP-003/004/005/006/008/009/010/019/022, plus GAP-011/GAP-040 separately), and `executive_summary.md` still listed four of the same already-completed items under "Critical Open Issues."
|
||||
- **Decision:** Prune only independently verified stale items from `executive_summary.md` and `roadmap.md`. Documentation-only, zero trading-behaviour risk.
|
||||
- **Implementation Note (2026-08-25):** Verified against `SPRINT_BOARD.md` historical records and decision entries before pruning: TASK-06a, TASK-06b, GAP-003, GAP-004, GAP-005, GAP-006, GAP-008, GAP-009, GAP-010, GAP-011, and GAP-019 are complete from the 2026-07-11 historical record; GAP-022 is partial with 5/8 verified on 2026-07-14 and remaining connection-state scenarios tracked as GAP-022-FOLLOWUP; GAP-040 is implemented/firing in production as of 2026-08-18. `executive_summary.md` now points at the v7.0 master reference, moves the four v6 critical issues into a resolved-since-v6 section, and lists current open items instead. `roadmap.md` no longer contains the `STALE-LIST WARNING` or the open-looking July list; it records the pruned resolved history and leaves GAP-030/GAP-007 separate. No source code or tests changed.
|
||||
- **Related Files:** `docs/00-governance/executive_summary.md`, `docs/00-governance/roadmap.md`, `TASK_GAP053_STALE_DOCS_PRUNE_PROMPT.md`
|
||||
- **Action Required:** None. Documentation-only; no operator validation required.
|
||||
### DEC-20260823-07
|
||||
- **ID:** DEC-20260823-07
|
||||
- **Date:** 2026-08-23/24
|
||||
@@ -124,6 +184,7 @@ Use this file to record durable project decisions that affect implementation pat
|
||||
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.
|
||||
- **Related Files:** `src/NT8.Adapters/Strategies/NT8StrategyBase.cs`, `TASK_GAP054_RUNNER_TRAIL_PROMPT.md`
|
||||
- **Action Required:** None immediate. Stage as low-priority follow-up prompts when convenient.
|
||||
- **GAP-056 Implementation Note (2026-08-25):** Implemented Option A for the inert breakeven parameters. `EnableAutoBreakeven`, `BreakevenTriggerTicks`, and `BreakevenOffsetTicks` remain declared/defaulted for saved workspace and settings compatibility, but are now `[Browsable(false)]` and their `Display` descriptions state they are currently unused. `SimpleORBNT8` settings export now labels the values as `UNUSED (retained for compatibility)`. This is reversible and avoids breaking persisted templates; Option B removal was not chosen because there was no concrete need to delete the fields and no benefit worth risking workspace/settings references. Added source-level tests proving the properties are hidden/marked unused and not read by `OnBarUpdate()` or `SubmitOrderToNT8()`. Verification: focused GAP-056 tests passed 3/3; `verify-build.bat` passed with 555/555 tests (466 Core, 79 Integration, 10 Performance); `dotnet test tests\NT8.Core.Tests\NT8.Core.Tests.csproj --configuration Release --no-build --verbosity minimal` passed 466/466. Deploy intentionally skipped by task prompt.
|
||||
- **GAP-057 Implementation Note (2026-08-25):** Implemented Option B, a source-text regression seam, because extracting a real `IOrderManagementCalls` wrapper would require routing live NinjaScript `SetStopLoss`/`SetTrailStop`/entry calls through new production indirection inside `SubmitOrderToNT8`, creating unnecessary order-timing risk for a test-only task. Added `NT8StrategyBaseRunnerTrailTests`: one test proves no `SetStopLoss(_runnerSignalName...)` appears after the runner `SetTrailStop(_runnerSignalName...)` calls in `SubmitOrderToNT8`; one proves the post-entry runner monitor in `OnBarUpdate()` contains no `SetStopLoss`/`SetTrailStop` calls; one proves the source-text seam did not add an order-management wrapper and the real implementation still uses direct NinjaScript managed-order calls. No production source changed for GAP-057. Verification: focused GAP-057 tests passed 3/3; `verify-build.bat` passed with 558/558 tests (469 Core, 79 Integration, 10 Performance); `dotnet test tests\NT8.Core.Tests\NT8.Core.Tests.csproj --configuration Release --no-build --verbosity minimal` passed 469/469. Deploy intentionally skipped by task prompt.
|
||||
- **Action Required:** GAP-056 and GAP-057 complete. GAP-054 still requires SIM/replay validation before RUNNER-001 or live gate evidence.
|
||||
|
||||
Reference in New Issue
Block a user