[GAP-047]: runtime confluence weights complete
- ConfluenceScorer.cs: apply designed factor baseline weights - ConfluenceScorerTests.cs: cover 5.85 total weight, worked example, and overrides - TASK_GAP047_PART2_WEIGHT_RUNTIME_PROMPT.md: add accepted runtime prompt - docs/00-governance: record DEC implementation and fresh-freeze requirement - SPRINT_BOARD.md: mark GAP-047 Part 2 implemented Build: clean | Tests: 514 passing; Core 425 passing | Deploy: backup 20260823_135331
This commit is contained in:
@@ -16,13 +16,16 @@ Use this file to record durable project decisions that affect implementation pat
|
||||
### DEC-20260823-01
|
||||
- **ID:** DEC-20260823-01
|
||||
- **Date:** 2026-08-23
|
||||
- **Status:** proposed
|
||||
- **Status:** **accepted** (2026-08-23)
|
||||
- **Operator Decision (2026-08-23):** Approved — proceed with the designed weights.
|
||||
- **Implementation approach resolved (Claude, 2026-08-23):** Read `ConfluenceScorer.cs` directly rather than assume. Two things confirmed that shape Part 2: (1) `Score()`'s composite (`weightedScoreSum / totalWeight`, ~line 183) already normalizes dynamically by whatever weights are actually applied — it is NOT hardcoded to divide by 10 or 5.85, so there is no separate normalization defect to fix; removing the bug is sufficient on its own. (2) The five wrong weights are hardcoded `1.0` literals in the constructor (`ConfluenceScorer.cs` ~113-117) rather than the calculators' own designed values ever being consulted, even though a `ResolveWeight()`/`UpdateFactorWeights()` mechanism already exists to make the dictionary the authoritative source — this reads as a placeholder value that was never replaced, not an architectural gap. **Resolved fix: change the five literals directly** (`NarrowRange 1.0→0.20`, `OrbRangeVsAtr 1.0→0.15`, `GapDirectionAlignment 1.0→0.15`, `BreakoutVolumeStrength 1.0→0.20`, `PriorDayCloseStrength 1.0→0.15`, verified against `FactorCalculators.cs` lines 569/670/797/897/1021) rather than removing the pre-population and routing through `ResolveWeight`'s fallback path — smaller diff, same result, keeps the dictionary as the single source of truth the API already assumes. The "configuration-driven" alternative floated in the original task is not pursued now — no scenario surfaced that needs it, and it would add parameter surface for no behavioral benefit. Flag if you want it anyway.
|
||||
- **Context:** GAP-047 Part 1 completed the offline equal-weight versus designed-weight re-scoring study against existing NT8 SDK session logs. The study scanned 182 `session_*.log` files under `C:\Users\billy\Documents\NinjaTrader 8\log\nt8-sdk`, including `ARCHIVE`, and reproduced the required worked example from `session_20260818_071117.log` at 10:10:11.833: equal=0.640, designed=0.727. The `STATE:` telemetry population remains direction-degraded by GAP-049 and is reported separately from real signal samples. No runtime trading code was changed.
|
||||
- **Evidence:** `tools/rescore/GAP-047_weight_rescore_output.md` and `.json`. Headline results: `STATE:` telemetry samples=923, designed weights crossed A while equal weights did not in 82 samples and crossed B while equal weights did not in 164 samples. Real signal factor samples=81, designed weights crossed A while equal weights did not in 25 samples. Current logs contained 0 `SIGNAL_DETAIL:` lines; signal scoring used real `SIGNAL` lines followed by their numeric `Factors:` breakdowns.
|
||||
- **Decision:** Proposed operator decision: proceed to GAP-047 Part 2 planning with an explicit weighting policy decision. The study supports replacing accidental equal 1.00 weights with the designed factor weights or making the weighting model configuration-driven, but the runtime change must be staged separately because it changes scoring behavior and `ConfigHash`.
|
||||
- **Consequences:** Designed weights would materially increase grade eligibility in the direction-degraded telemetry population and upgrade a meaningful subset of real signal samples to Grade A. Because some real signal samples also downgrade under designed weights, the decision should be treated as a scoring-policy change rather than a pure relaxation. A fresh configuration freeze is required before any gate evidence is collected after implementation.
|
||||
- **Related Files:** `tools/rescore/rescore_weights.py`, `tools/rescore/GAP-047_weight_rescore_output.md`, `tools/rescore/GAP-047_weight_rescore_output.json`, `TASK_GAP047_WEIGHT_RESCORE_PROMPT.md`
|
||||
- **Action Required:** Operator to accept/reject the proposed direction, then stage GAP-047 Part 2 as a separate runtime-change prompt.
|
||||
- **Decision:** Replace the accidental equal 1.00 weights with the designed factor weights, per the resolved implementation approach above. Staged as `TASK_GAP047_PART2_WEIGHT_RUNTIME_PROMPT.md`.
|
||||
- **Consequences:** Designed weights will materially increase grade eligibility in the direction-degraded telemetry population and upgrade a meaningful subset of real signal samples to Grade A — this is the intended effect, directly targeting the low-trade-frequency problem. Because some real signal samples also downgrade under designed weights, this is a scoring-policy change, not a pure relaxation — expect a shift in which setups qualify, not just how many. Unlike GAP-054, this change is fully testable in the platform-neutral `NT8.Core` layer with ordinary unit tests — no NinjaTrader-specific managed-order call is involved, so no SIM trade is required to prove correctness (see `TASK_GAP047_PART2_WEIGHT_RUNTIME_PROMPT.md` Validation). A fresh gate configuration freeze/baseline is still required before any gate evidence is collected after this lands, since trade-qualification behavior changes. Also worth revisiting once live: the workspace currently runs `MinTradeGrade=4` (B) while the Gate 3 plan targets `MinTradeGrade=A` (5) — now that Grade A is actually reachable, the operator may want to reconsider which threshold to gate on.
|
||||
- **Related Files:** `tools/rescore/rescore_weights.py`, `tools/rescore/GAP-047_weight_rescore_output.md`, `tools/rescore/GAP-047_weight_rescore_output.json`, `TASK_GAP047_WEIGHT_RESCORE_PROMPT.md`, `TASK_GAP047_PART2_WEIGHT_RUNTIME_PROMPT.md`, `src/NT8.Core/Intelligence/ConfluenceScorer.cs`
|
||||
- **Implementation Note (2026-08-23):** Implemented in `src/NT8.Core/Intelligence/ConfluenceScorer.cs` by changing only the five approved constructor baseline weights: `NarrowRange=0.20`, `OrbRangeVsAtr=0.15`, `GapDirectionAlignment=0.15`, `BreakoutVolumeStrength=0.20`, and `PriorDayCloseStrength=0.15`. `Score()` normalization, `ResolveWeight()`, `UpdateFactorWeights()`, factor calculators, grade thresholds, and adapter/NinjaScript files were left unchanged. Added `ConfluenceScorerTests` coverage proving the default total weight is 5.85, the 2026-08-18 10:10:11.833 worked example now scores 0.727 / Grade B instead of the old 0.640, and `UpdateFactorWeights()` still overrides the new baseline. Verification: `verify-build.bat` passed with 514/514 tests (425 Core, 79 Integration, 10 Performance); `dotnet test tests\NT8.Core.Tests\NT8.Core.Tests.csproj --configuration Release --no-build --verbosity minimal` passed 425/425; `deployment\deploy-to-nt8.bat` completed with backup `20260823_135331` and noted `NinjaTrader.Custom.dll` was not present to invalidate.
|
||||
- **Action Required:** Fresh Gate 3 configuration freeze/baseline is required before collecting gate evidence after this scoring-policy change. Manual NT8 compile remains part of normal deploy hygiene, but no SIM trade is required for correctness.
|
||||
|
||||
### DEC-20260821-01
|
||||
- **ID:** DEC-20260821-01
|
||||
|
||||
Reference in New Issue
Block a user