[GAP-066]: run base initialization before ORB defaults

This commit is contained in:
2026-10-26 12:12:00 -04:00
parent 0bbc031c58
commit b20b621c45
5 changed files with 40 additions and 12 deletions

View File

@@ -13,14 +13,23 @@ Use this file to record durable project decisions that affect implementation pat
## Decision Log
### DEC-20261026-03
- **ID:** DEC-20261026-03
- **Date:** 2026-10-26
- **Status:** implemented — GAP-066 base initialization ordering corrected; operator settings-export validation remains pending
- **Context:** `SimpleORBNT8.OnStateChange()` applied its `State.SetDefaults` values before calling `base.OnStateChange()`. The base then overwrote `RunnerTrailTicks` (20→12), `MinTradeGrade` (5→4), `MaxOpenPositions` (2→3), and `BarsRequiredToTrade` (50→1), as recorded in `DEC-20260922-01` and Master Document v9.0 §1.3 Finding 3 / §4.10.
- **Decision:** Call `base.OnStateChange()` first, then apply subclass state handling. The subclass `Configure` branch is currently comment-only and `DataLoaded` has no subclass branch, so moving the base call to the top preserves their behavior while making subclass defaults win.
- **Verification:** Added a source-order regression test asserting the base call precedes all four subclass assignments. `verify-build.bat` passed 582/582 tests (492 Core, 80 Integration, 10 Performance), zero warnings/errors. The task is ordering-only; no values changed. Operator must validate a fresh settings export after the controlled deploy/recompile.
- **Related Files:** `src/NT8.Adapters/Strategies/SimpleORBNT8.cs`, `tests/NT8.Core.Tests/Adapters/SimpleORBNT8DefaultsTests.cs`, `DEC-20260922-01`, Master Document v9.0 §§1.3, 4.10.
### DEC-20261026-01
- **ID:** DEC-20261026-01
- **Date:** 2026-10-26
- **Status:** implemented — GAP-068 whole-folder verification committed; operator before/after validation pending
- **Context:** `tools/preflight/preflight.ps1` check 5 compared only deployed `NT8StrategyBase.cs`. `Write-DeployedSourceHashes` captured every Strategies `.cs` but did not compare them. This left the orphan-source failure in DEC-20260922-01 undetected; see Master Document v9.0 §1.3 Finding 1 and §4.4.
- **Decision:** Compare the four `.cs` files copied to `bin\Custom\Strategies` by `deploy-to-nt8.bat` against repository SHA-256 values, and fail on any other `.cs` except `@` NinjaTrader samples, the operator's `@@` strategies, `ORBFibPullbackV1.cs`, and `MinimalTestStrategy.cs` (the last is retained despite the known deploy-script mismatch, GAP-073). Report each discrepancy with repository/deployed timestamps and, for unexpected files, same-name source paths and any same-type match found in deployed SDK/NT assemblies. Never delete deployed files from preflight.
- **Verification:** The standalone PowerShell fixture test exercises a matching file, hash mismatch, missing deployed file, allow-listed foreign file, and unexpected file; it passed separately from `verify-build.bat`. The operator must run the documented preflight before P0-A and retain the failure naming `SimpleORBStrategy.cs`; run it again after cleanup/recompile.
- **Scope note:** Manifest hashes and additional backup copies were not added; the secondary requests were deferred. `deployment/Verify-Deployment.ps1`'s `MinimalTestStrategy.cs` mismatch is documented and left unchanged.
- **Verification:** The standalone PowerShell fixture test exercises a matching file, hash mismatch, missing deployed file, allow-listed foreign file, and unexpected file; it passed separately from `verify-build.bat`. Operator captured the pre-cleanup run on 2026-10-26: check 6 failed and named unexpected `SimpleORBStrategy.cs` (deployed 2026-07-13). The operator then quarantined it, `@@SimpleORBNT8Wrapper.cs`, `SDK*.zip`, and `.DS_Store` under `Documents\NT8_quarantine_20261026`. The post-cleanup proof awaits deploy/recompile.
- **Scope note:** Manifest hashes and additional backup copies were not added; the secondary requests were deferred. `deployment/Verify-Deployment.ps1`'s `MinimalTestStrategy.cs` mismatch is documented and left unchanged. A follow-up was opened because reflection-load exceptions are swallowed and root-level `@` files skip type-collision checks; see GAP-068-FOLLOWUP in `SPRINT_BOARD.md`.
- **Related Files:** `tools/preflight/preflight.ps1`, `tools/preflight/strategy-source-verification.ps1`, `tools/preflight/tests/strategy-source-verification.tests.ps1`, `deployment/deploy-to-nt8.bat`, `deployment/Verify-Deployment.ps1`, DEC-20260922-01, Master Document v9.0 §§1.3, 4.4.
### DEC-20261026-02