- SimpleORBRejectionLoggingTests.cs: replace literal-only comparison with real RecordSignalRejection output comparison - decisions.md: mark DEC-20260823-02 implemented - SPRINT_BOARD.md: record GAP-058 housekeeping completion Build: clean | Tests: focused 3 passing; Core 446 passing; verify-build 535 passing
82 lines
3.9 KiB
Markdown
82 lines
3.9 KiB
Markdown
# TASK: GAP-058 — Tautological reject-line-format test
|
|
# Staged: 2026-08-23 (found during independent verification of GAP-048)
|
|
# Sprint: Stage 0 — housekeeping, zero trading-behaviour risk
|
|
# Owner: Kilocode
|
|
# ─────────────────────────────────────────────────────────────────
|
|
|
|
## THE DEFECT
|
|
|
|
`tests/NT8.Core.Tests/Strategies/SimpleORBRejectionLoggingTests.cs`, the test
|
|
`RejectLineFormat_DiffersOnlyByReasonToken` (added in `e36534b`, GAP-048),
|
|
does not call any production code:
|
|
|
|
string oldLine = "REJECT: reason=GradeFilter detail=Regime veto before score; ...";
|
|
string newLine = "REJECT: reason=RegimeVeto detail=Regime veto before score; ...";
|
|
Assert.AreEqual(oldLine.Replace("reason=GradeFilter", "reason={reason}"),
|
|
newLine.Replace("reason=RegimeVeto", "reason={reason}"));
|
|
|
|
Both strings are hand-written literals, constructed to differ only in the
|
|
`reason=` token. Replacing that token with the same placeholder in both and
|
|
asserting equality is true by construction — the assertion cannot fail
|
|
regardless of what `NT8StrategyBase.cs` / `SimpleORBStrategy.cs` actually
|
|
emit. This is the GAP-022 defect class: a test that reads as regression
|
|
coverage but exercises nothing.
|
|
|
|
The other two tests added in the same commit
|
|
(`OnBar_BelowThresholdGrade_RecordsGradeFilterRejectLineWithScore`,
|
|
`OnBar_RegimeVeto_RecordsRegimeVetoRejectLine`) are legitimate — they call
|
|
`OnBar()` / `RecordSignalRejection()` (the latter via reflection) and assert
|
|
on real output. This task only concerns the third test.
|
|
|
|
## READ-FIRST
|
|
|
|
1. Read `SimpleORBRejectionLoggingTests.cs` in full, including the
|
|
`AssertRejectLineFormat` / `InvokeRecordSignalRejection` helpers already
|
|
added by GAP-048 — reuse them rather than adding new ones.
|
|
2. Confirm which production method actually formats the `REJECT:` line
|
|
(`RecordSignalRejection` and/or `LogRejectRateLimited`) and how to invoke
|
|
it twice with two different `reason` values from a test.
|
|
|
|
## THE CHANGE
|
|
|
|
Replace `RejectLineFormat_DiffersOnlyByReasonToken` with a test that drives
|
|
the real formatting path twice — once with each of two distinct reasons
|
|
(e.g. `GradeFilter` and `RegimeVeto`, matching the existing helper tests) —
|
|
and asserts the two real output lines are identical except for the
|
|
`reason=` token. Use `InvokeRecordSignalRejection` (already present) or the
|
|
equivalent for `LogRejectRateLimited` if that is the better seam.
|
|
|
|
If, after reading the code, no seam exists to produce two comparable real
|
|
lines cheaply, say so explicitly and propose the smallest seam rather than
|
|
leaving the tautological version in place — do not fabricate coverage
|
|
(GAP-022 precedent).
|
|
|
|
## DO NOT
|
|
|
|
- Do not change any production reject-taxonomy code — this is GAP-048's
|
|
already-shipped behaviour and is out of scope here.
|
|
- Do not change the two legitimate tests in the same file.
|
|
- Do not change `REJECT:` / `REJECT SUMMARY:` line formats.
|
|
|
|
## TESTS (required)
|
|
|
|
The replacement test itself is the deliverable. It must fail if the format
|
|
string that precedes `reason=` in `RecordSignalRejection` /
|
|
`LogRejectRateLimited` is ever changed independently for two different
|
|
reasons (i.e. it must be capable of catching the defect class GAP-048's
|
|
byte-identical-format requirement exists to prevent).
|
|
|
|
## VALIDATION (operator)
|
|
|
|
None — this is test-only housekeeping. `verify-build.bat` passing is
|
|
sufficient.
|
|
|
|
## GOVERNANCE
|
|
|
|
Track as [GAP-058] in SPRINT_BOARD.md (housekeeping section or a one-line
|
|
note next to GAP-048 is fine — this does not need its own blocker row).
|
|
Update `docs/00-governance/decisions.md` DEC-20260823-02: change Status
|
|
from "logged, no operator decision needed — tracking only" to
|
|
"implemented" and add a short Implementation Note.
|
|
Reference: this task, `docs/00-governance/decisions.md` DEC-20260823-02.
|