[GAP-061]: AVWAP state context telemetry complete

- SimpleORBNT8.cs: append Avwap, AvwapSlope, and TrendConfirm to STATE_CONTEXT when CustomData contains them

- SimpleORBNT8DefaultsTests.cs: add source assertions for AVWAP telemetry formatting, missing-key omission, and no scoring/log-format changes

- SPRINT_BOARD.md/decisions.md: record observability-only implementation and direction-blind trend_confirm finding

Build: clean | Tests: 561 passing; Core 472 passing | Dual-deployed: no - skipped by prompt
This commit is contained in:
2026-08-25 16:24:53 -04:00
parent 0607d44388
commit a673475738
5 changed files with 212 additions and 0 deletions

View File

@@ -57,6 +57,41 @@ namespace NT8.Core.Tests.Adapters
Assert.IsFalse(source.Contains("_openingRangeLow"), "Legacy adapter ORB low field must stay removed because the SDK tracker owns this state.");
}
[TestMethod]
public void StateTelemetryContext_IncludesAvwapTrendInputsWithRequiredFormatting()
{
string source = File.ReadAllText(FindSourceFile());
string method = ExtractMethodBlock(source, "protected override Dictionary<string, string> GetStateTelemetryContextFields");
Assert.IsTrue(method.Contains("AddStateContextDouble(fields, context, \"Avwap\", \"avwap\", \"F2\");"), "STATE_CONTEXT must include avwap as Avwap with F2 formatting.");
Assert.IsTrue(method.Contains("AddStateContextDouble(fields, context, \"AvwapSlope\", \"avwap_slope\", \"F4\");"), "STATE_CONTEXT must include avwap_slope as AvwapSlope with F4 formatting.");
Assert.IsTrue(method.Contains("AddStateContextDouble(fields, context, \"TrendConfirm\", \"trend_confirm\", \"F1\");"), "STATE_CONTEXT must include trend_confirm as TrendConfirm with F1 formatting.");
Assert.IsFalse(method.Contains("TrendConfirm") && method.Contains("0.0"), "STATE_CONTEXT must not add placeholder TrendConfirm values inside the context method.");
}
[TestMethod]
public void StateTelemetryContext_OmitsAvwapTrendInputsWhenCustomDataKeysMissing()
{
string source = File.ReadAllText(FindSourceFile());
string helper = ExtractMethodBlock(source, "private static void AddStateContextDouble");
Assert.IsTrue(helper.Contains("context.CustomData == null"), "Telemetry helper must tolerate missing CustomData.");
Assert.IsTrue(helper.Contains("!context.CustomData.ContainsKey(customDataKey)"), "Telemetry helper must omit missing CustomData keys.");
Assert.IsTrue(helper.Contains("return;"), "Telemetry helper must return without placeholders for missing keys.");
Assert.IsFalse(helper.Contains("fields.Add(outputKey, \""), "Telemetry helper must not emit placeholder string values.");
}
[TestMethod]
public void StateTelemetryContext_DoesNotChangeScoringOrStateLineFormats()
{
string source = File.ReadAllText(FindSourceFile());
string method = ExtractMethodBlock(source, "protected override Dictionary<string, string> GetStateTelemetryContextFields");
Assert.IsFalse(source.Contains("context.CustomData[\"trend_confirm\"] ="), "SimpleORBNT8 telemetry must not change trend_confirm calculation.");
Assert.IsFalse(method.Contains("STATE:"), "GAP-061 must not change STATE line formatting.");
Assert.IsFalse(method.Contains("STATE_DETAIL:"), "GAP-061 must not change STATE_DETAIL line formatting.");
}
private static string FindSourceFile()
{
DirectoryInfo dir = new DirectoryInfo(AppDomain.CurrentDomain.BaseDirectory);