Skip to content

test: qualify metrics cardinality and identifier privacy - #450

Merged
djh58 merged 2 commits into
3.x.xfrom
djh58/prism-b278-cardinality-privacy
Sep 17, 2026
Merged

djh58 merged 2 commits into
3.x.xfrom
djh58/prism-b278-cardinality-privacy

Conversation

@djh58

@djh58 djh58 commented Sep 17, 2026 •

Copy link
Copy Markdown
Member

Adds regression coverage for #278's remaining metrics cardinality and privacy criteria. Real run-role HTTP responses are checked against an independent 47-family contract with 166 startup series and 264 populated series, including every closed label variant and histogram-derived series.

Synthetic hashes, heights, job IDs and miner identifiers traverse Stratum submissions and the PostgreSQL candidate collector. Tests verify useful aggregate observations reach /metrics while identifiers do not, separately pin census/freshness and health-payload separation across unavailable/fresh/stale snapshots, and include negative controls that distinguish numeric coincidence from height attribution.

The acceptance mapping documents fulfilled native health/freshness criteria separately from intentionally nonidentical legacy /healthz shape. Production metrics names, types, labels and behavior are unchanged.

Refs #278

Validation:

  • Observability suite: 17 passed.
  • Stratum protocol suite: 28 passed; one manual inspection test ignored.
  • Metrics snapshot tests: 7 passed.
  • Metrics registry/runtime/collector tests: 22 passed.
  • Disposable PostgreSQL observability suite: 3 passed, including the new privacy test; gate manifest confirms execution.
  • Formatting, generated metrics inventory, gate input checks and whitespace checks passed.
  • Scoped Clippy passed with warnings denied.

GitHub CI passed all 19 required checks at final head ef1a1c0c, including the combined integration proof (checks). The same checks also passed at 76d1cdbd; the follow-up changes documentation only, with identical test and production source trees.

Four independent static reviews of 76d1cdbd found no must-fix defects. They did not run tests. The documentation-only delta at ef1a1c0c also received static review, with source-identical prior evidence retained. Review follow-up:

Suggestion Disposition
Health-payload fixture described as a third producer privacy path Fixed: documented as census/freshness and publication-separation coverage; real producer privacy evidence comes from Stratum and the candidate collector.
Focused commands omit the library snapshot tests Fixed: added the library test command.
Relocate shared test support Deferred: normal checkouts and CI compile every consumer; relocation is optional structural work and does not change the contract.
Remove explicit 47/166/264 count pins Retained: these are deliberate numeric bounds alongside the exact sets, requiring an explicit bound update when the expected contract expands.
Height substring checks can match small bucket values Retained with scope noted: fixtures use distinctive large heights; the checker is not a general privacy detector for arbitrary encodings or small numeric identifiers.
Derive the stale fixture age from configuration Deferred: the test intentionally covers the current default policy, and a default change will fail visibly.
Use checked subtraction for fixture times Retained: existing snapshot fixtures use the same monotonic-time pattern on supported platforms; no reachable failure was identified.
Permit blank lines or sample timestamps in the parser Retained: strict parsing pins this producer's current exposition format.

Exercise closed enum variants and seeded identifiers through real HTTP, Stratum and PostgreSQL collector paths. Document native health acceptance separately from intentional legacy shape differences. Refs #278.
@djh58
djh58 merged commit d84cdc8 into 3.x.x Sep 17, 2026
20 checks passed
Anatolie added a commit that referenced this pull request Sep 18, 2026
29 of the map's 34 issue links pointed at closed issues, and every open
gap row named one, so by the map's own legend each gap was either filled
or orphaned and the map did not say which (#448). The pull requests that
closed #266, #271, #272, #280, #285, #287 and #288 never touched it.

Every row that linked a closed issue now names the native tests that
landed, retires what has no native subject with the reason, and writes
what is still uncovered as "not covered, no open issue". No row links a
closed issue. The five open gap rows and the open gap case are partial.

tests/test_prism_landing_interleavings.py is decided: partial with
nothing left uncovered, and no new native test. The issue's premise that
no native test has the two-distinct-block shape does not hold. #355 added
three tests for exactly that #272 criterion which the map never cited, a
checks each block's audit row, and the #133 mechanism (a shared
publication floor gating a per-block evidence file written after
confirmation) has no native counterpart: the audit row is inserted, keyed
by block hash, in the landing transaction.

The seven needs triage rows were re-read at a193705. Two are now partial
(the CTV yield contract from #433, the changed-amount balance fence from

it from a needs triage row, and the new closed-issue check failed on the
next run. That row was re-read at cb2aa8b: #450 covers its one owned
case (no hash or height in /metrics), and it stays needs triage because
landing-phase attribution still has no native family and no owner.

Also corrected, because they made the same claim in plain text or were
stale for the same pull requests: the job-builder, #224 cadence, #224
ledger, representative-independence and coordinator-metrics rows. The legend now
says a linked issue must be open and a plain #N is history, and a new
section documents the checks.

Summary: 5 full, 76 partial, 0 open gap, 5 needs triage, 56 retired.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
Anatolie added a commit that referenced this pull request Sep 21, 2026
…eck that keeps it honest (#455)

* ci: check the deleted-test map against the tree and against issue state

docs/prism-deleted-test-map.md is parity evidence for the cutover go/no-go
(#291), and nothing read it: the issues it linked closed one by one while
the map kept naming them as the owners of uncovered behaviour (#448).

scripts/check_deleted_test_map.py reads it. Offline, in the required
lint-compile-compose job, it fails when a `path::name` reference does not
resolve to a test function, when a table line does not parse (a line it
cannot read is an error, never a skipped row), when a status breaks the
legend, or when the summary, the section counts or the needs triage index
differ from the rows.

With --check-issues it asks GitHub for the state of every issue the map
depends on and fails when one is closed. That runs as an advisory job kept
out of `checks`, so an issue closing cannot block an unrelated pull
request, and it can still go red. It lives in ci.yml because schedule and
workflow_dispatch only fire from the default branch and this map lives on
3.x.x. An unknown state (network, rate limit, unexpected reply) exits 2
and is never read as open.

Co-Authored-By: Claude Fable 5.1 <[email protected]>

* docs: reconcile the deleted-test map with the issues that closed

29 of the map's 34 issue links pointed at closed issues, and every open
gap row named one, so by the map's own legend each gap was either filled
or orphaned and the map did not say which (#448). The pull requests that
closed #266, #271, #272, #280, #285, #287 and #288 never touched it.

Every row that linked a closed issue now names the native tests that
landed, retires what has no native subject with the reason, and writes
what is still uncovered as "not covered, no open issue". No row links a
closed issue. The five open gap rows and the open gap case are partial.

tests/test_prism_landing_interleavings.py is decided: partial with
nothing left uncovered, and no new native test. The issue's premise that
no native test has the two-distinct-block shape does not hold. #355 added
three tests for exactly that #272 criterion which the map never cited, a
checks each block's audit row, and the #133 mechanism (a shared
publication floor gating a per-block evidence file written after
confirmation) has no native counterpart: the audit row is inserted, keyed
by block hash, in the landing transaction.

The seven needs triage rows were re-read at a193705. Two are now partial
(the CTV yield contract from #433, the changed-amount balance fence from

it from a needs triage row, and the new closed-issue check failed on the
next run. That row was re-read at cb2aa8b: #450 covers its one owned
case (no hash or height in /metrics), and it stays needs triage because
landing-phase attribution still has no native family and no owner.

Also corrected, because they made the same claim in plain text or were
stale for the same pull requests: the job-builder, #224 cadence, #224
ledger, representative-independence and coordinator-metrics rows. The legend now
says a linked issue must be open and a plain #N is history, and a new
section documents the checks.

Summary: 5 full, 76 partial, 0 open gap, 5 needs triage, 56 retired.

Co-Authored-By: Claude Fable 5.1 <[email protected]>

* docs: correct the map's new citations after an adversarial review

Five reviewers who had not written the reconciled rows read the body of
every newly cited test, 152 citations in all, and tried to break each
claim. 142 held, 10 were overstated, none was unsupported, and five
"retired" clauses named something that still exists natively. The
corrections all move the map toward claiming less:

- test_prism_hot_path.py: the 600-client submit burst is not retired.
  Native submits read-lock what publication write-locks and no test
  bounds the wait, so it is now "not covered, no open issue".
- prism_postgres_a1_migration_gate.py: the pre-ordinal backfill and the
  non-positive and duplicate ordinal refusals are not retired. 001 still
  runs them under the native migrator, which does not refuse a
  pre-v2.0.0 source.
- test_prism_settlement_balance_comparison.py: a re-spelled payout
  address is a digest divergence natively, the opposite of what the row
  said, and is untested.
- test_prism_share_ledger.py: "no automatic SQL retry" had one exception,
  the share append re-run after a no-partition refusal, which has a test.
- The representative-independence and CTV rows called live things
  retired (per-solver bootstrap identity, PRISM_CTV_BROADCASTER_LIMIT);
  the validation, delivery, retained-jobs, landing, reward-window,
  compose and perf rows each had a clause worded past what its test
  asserts.

Two under-claims are fixed too: the TipState::observe sequence guard is
tested, and the reward-window row now cites the test that pins 8.

The landing-interleavings decision was attacked directly and held.
Statuses and summary counts are unchanged.

Co-Authored-By: Claude Fable 5.1 <[email protected]>

* fix: validate deleted-test names against pinned manifest

* fix: pin deleted-test case inventory

* fix: require test citations in partial map rows

* fix: include unowned partial gaps in map summary

* fix: require Python map citations in unittest discovery

* fix: exclude empty native remainders from map summary

* fix: include open case rows in deleted-test summary

* fix: ignore Rust fixture text in test citations

* fix: reject Rust map citations to tests skipped by CI

* fix: reject skipped Python parity citations

* fix: require reachable Cargo tests for parity citations

* fix: recognize uncovered markers without semicolon separators

* docs: reconcile deleted-test owners after issue 270 closed

* fix: require successful runs for Python parity citations

* fix: reject malformed deleted-test owner links

* fix: include case rows in the triage index check

---------

Co-authored-by: Claude Fable 5.1 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant