test(valuereport): bind _SHARE_DIGITS to its MEASURED band, not to itself

The constant was detach-proof but value-unproven: mutating 6 -> 4 left all 628
tests green, so nothing held the figure to the claim it carries. Measuring what
actually constrains it gave a narrower answer than the premise assumed — 6 -> 4
CANNOT be made red without inventing a resolution requirement no layer states,
and §1 forbids asserting more than the implementation carries.

Measured band, both ends now load-bearing:
  * d >= 17 -> the 1-ULP float tail of a cohort subtraction reaches the JSON
    bytes (0.1 - 0.3 publishes as -0.19999999999999998, not -0.2).
  * d <= 2  -> the rendered percent moves (2/7 renders 29.0%, not 28.6%).
  * d in [3, 16] -> identical to every consumer this system has.

Both proofs are stated WITHOUT reference to the constant's own value — the
exact decimal difference of the two PUBLISHED shares, and a percent computed
from the RAW NOK figures — so they bind the claim rather than the number. A
literal like 0.142857 would only have bound 6 to itself.

The :61 comment justified only the upper end; it now records the measurement
and says plainly that 6 is convention inside the band, not a derived figure.

Mutation-verified: d=2 RED, d=3/4/5/16 GREEN, d=17 RED. Suite 628 -> 631.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01MQu2xxwedckjU56byu1aUG
This commit is contained in:
Kjell Tore Guttormsen 2026-07-26 15:28:20 +02:00
commit 8a141370f3
2 changed files with 138 additions and 1 deletions

View file

@ -58,7 +58,13 @@ _REJECTED = "rejected"
_ADJUSTED = "approved_with_adjustment"
_UNMARKED = "UNMARKED"
_SHARE_DIGITS = 6 # shares are rounded so the JSON bytes never carry float noise
# Shares are rounded so the JSON bytes never carry the 1-ULP float tail a cohort
# subtraction leaves behind (0.1 - 0.3 is -0.19999999999999998). MEASURED band,
# bound by the two value proofs in test_valuereport_loadbearing.py: 17 leaks that
# tail, 2 moves the rendered percent, and everything in [3, 16] is identical to
# every consumer this system has. 6 is a convention inside the band — NOT a
# figure any layer derives, and the tests say only what was measured.
_SHARE_DIGITS = 6
@dataclass(frozen=True)