GAP-031: fix submitted trade provenance

- serialize grade, score, ORB ticks, and resolved mode from accepted submission data
- add exact-value JSONL provenance test
- prepare governance for Gate Run 3

Build: clean | Tests: 498 passing | Dual-deployed: yes
This commit is contained in:
2026-08-03 08:50:04 -04:00
parent 56d7c7880e
commit 5844b2ce0b
9 changed files with 215 additions and 78 deletions

View File

@@ -1,11 +1,11 @@
# Active Work
**Last Updated:** 2026-07-14
**Last Updated:** 2026-08-03
## RB-4.1 — Gate Run #2 Configuration Freeze
## RB-4.1 — Gate Run #3 Configuration Freeze
**Owner:** Human operator
**State:** Active; gate clock has not started.
**State:** Active; Gate 2 was contaminated and the Gate 3 clock has not started.
1. Deploy the verified cleanup source to NinjaTrader Custom\Strategies and run NinjaTrader's compile check.
1. Start NinjaTrader and run the NinjaScript compile check for the provenance fix deployed on 2026-08-03.
2. In SimSimple ORB, set and triple-check:
- `EnableDynamicStop=TRUE`
- `RunnerActivationMode=Auto`
@@ -17,8 +17,8 @@
- `EnableVerboseLogging=TRUE`
- `LogDirectory=C:\\Users\\billy\\Documents\\NinjaTrader 8\\log\\nt8-sdk`
3. Export settings; preserve the parameter hash and code-version stamp.
4. Add `DEC-GATE2-CONFIG` with the frozen configuration and planned start date.
5. At gate start, enforce the no-dual-deploy rule. GAP-025 and GAP-022-FOLLOWUP remain branch-only work.
4. Add `DEC-GATE3-CONFIG` with the frozen configuration and planned start date.
5. At Gate 3 start, enforce the no-dual-deploy rule. GAP-025 and GAP-022-FOLLOWUP remain branch-only work.
## Parallel work, not a gate prerequisite
- GAP-025 runner no-fill diagnosis blocks live promotion, not Gate Run #2.

View File

@@ -45,4 +45,9 @@ Record concise error fingerprints and verified fixes.
- Fingerprint: `NT8StrategyBase.cs` ~line 249 (nested enum), ~line 279 (duplicate property), ~line 281 (extra `#endregion`)
- Root cause: Post-task build verification (`verify-build.bat` + `dotnet test`) was skipped after a previous task. Duplicate enum/property and unbalanced `#region`/`#endregion` compiled in IDE with Roslyn leniency but failed the strict dotnet CLI build used by NT8 SDK CI.
- Fix: Removed nested `RunnerMode` enum (keep namespace-level at line ~35), removed duplicate `RunnerActivationMode` property (keep `[NinjaScriptProperty]` version at line ~181), removed extra `#endregion` at line 281. Ran `verify-build.bat` + `dotnet test` -- 492 tests passed (10 perf + 78 integration + 404 core).
- Prevention link: Add mandatory `verify-build.bat && dotnet test --verbosity minimal` step to every task completion checklist in `docs/00-governance/decisions.md` and sprint templates.
- Prevention link: Add mandatory `verify-build.bat && dotnet test --verbosity minimal` step to every task completion checklist in `docs/00-governance/decisions.md` and sprint templates.
## 2026-08-03 [GAP-031] — Trade provenance wrote defaults instead of submitted values
- **Root cause:** The JSONL writer read confluence values from static strategy configuration and recomputed runner mode with quantity `1`, while the session logger used accepted intent metadata and the actual resolved submission mode.
- **Fix:** Serialize from the accepted `StrategyIntent.Metadata` and pass the submission's `resolvedMode` into the provenance writer.
- **Prevention:** Logging artifacts for a submitted trade must consume the same immutable decision/submission objects used by the human-readable session log.

View File

@@ -1,22 +1,22 @@
# Current Status — NT8 SDK
**Last Updated:** 2026-07-14
**Last Updated:** 2026-08-03
## Verified implementation state
- **Last completed task:** GAP-029 — Code-Version Provenance Stamp
- **Active task:** RB-4.1 — Gate Run #2 Configuration Freeze (human operator)
- **Last completed task:** GAP-031 — Trade Provenance Signal/Submission Wiring
- **Active task:** RB-4.1 — Gate Run #3 Configuration Freeze (human operator)
- **Next code task:** GAP-025 — Runner No-Fill Anomaly Diagnosis (branch-only during the gate)
- **Following code task:** GAP-022-FOLLOWUP — connection-state seam and the three deferred scenarios
## Build and test evidence
- `verify-build.bat` completed successfully on 2026-07-14.
- Build: **0 errors**, **6 CS1998 warnings** in existing test mock/test methods.
- Tests: **497 passed, 0 failed** — 409 Core, 78 Integration, 10 Performance.
- `verify-build.bat` is not executable under Windows `cmd.exe` because the tracked batch file uses LF-only line endings.
- Release build: **0 errors**, **9 existing CS1998 warnings**.
- Tests: **498 passed, 0 failed** — 410 Core, 78 Integration, 10 Performance.
## Gate readiness
- Provenance records have `session_id`, `trade_seq`, parameter-only `config_hash`, exact `session_tag`, and compiled `code_version` (assembly version + MVID).
- Trade provenance now reads grade, weighted score, and ORB ticks from the accepted intent metadata and records the exact runner mode resolved for submission.
- Every real-time signal writes its `TEST MODE ACTIVE` or `LIVE MODE` status to the session file log.
- GAP-022 has five real scenario assertions. Its remaining three requirements are deferred architecture work, not fabricated tests.
- **Before gate start:** deploy the cleanup source to NinjaTrader Custom\Strategies and run the NinjaTrader compile check. Then freeze the configuration and enforce the no-deploy rule.
- **Before Gate 3 start:** complete the pending NinjaTrader compile check, freeze the configuration, and enforce the no-deploy rule.
## Authoritative documents
- Master document: `docs/NT8_SDK_Master_Document_v6.1_Complete.docx`

View File

@@ -52,4 +52,8 @@ Capture recurring implementation patterns that impact compile stability.
8. **Compiled-code provenance stamp** (2026-07-14)
- Good pattern: persist the running assembly version plus `ManifestModule.ModuleVersionId` alongside the parameter-only configuration hash.
- Anti-pattern: treat an unchanged parameter hash as proof that unchanged code is running.
- Why it matters: a mid-gate recompile/redeploy can preserve settings while changing executable behavior; the module MVID makes that drift detectable in session and trade artifacts.
- Why it matters: a mid-gate recompile/redeploy can preserve settings while changing executable behavior; the module MVID makes that drift detectable in session and trade artifacts.
## 2026-08-03 [GAP-031] — Submission-sourced trade provenance
- **DO:** Serialize grade, score, ORB range, and resolved mode from the accepted intent and the exact submission decision.
- **DON'T:** Recompute trade facts later from configuration defaults or assumed quantities.