Files
ss-tools/scripts
busya a32d4cc694 test(metric): migrate the captured admission fixture past the query-schema change
25 registry tests refused with METRIC_CONTEXT_STALE before reaching the behaviour
they assert.  The raise site is metric_admission.py:110 (_validate_context), not
metric_authority_context.py:43: admission requires the graph's stored query dict
to equal the current schema's own model_dump and its stored
query_model_fingerprint to equal the hash of that dump.

Root cause, measured: commit c805513e (a WIP Stage-1 checkpoint) added
MetricDescriptor.expression_sha256: str | None = None.  query_model_fingerprint
is defined as the hash of DashboardQueryModel.model_dump(mode="json"), so an
additive optional field silently changed the identity of every query model, and
the captured admitted_v2_actual_docker fixture - last written by bcc69f4b, before
that commit - no longer reproduces it.  Re-serializing its query inserts exactly
five null expression_sha256 values; no src/ code reads that field.

The fixture is migrated by scripts/full_flow_v2/migrate_admission_fixture.py,
which is committed with it.  It adds only the missing keys in place and
re-derives the digest chain from the fixture's own bytes with the production
definition of each digest: query_model_fingerprint (15 sites),
reference_digest (6), catalog_digest (9), selection_digest (5), binding_digest
(4), authority_digest (2), metric_expected_entry_sha256, revision_hash (4) and
plan_hash.  It proves each method against the pristine captured body before
using it, refuses any captured value that disagrees with the current schema, and
re-validates every self-hashed body through its own model.  entry_digest and the
publication, release and retained schema bytes are unchanged, which is what
shows the captured evidence itself did not move.

This is a migration, not a re-capture, and the fixture now says so in a
_migration_note; a genuine re-capture is
scripts/full_flow_v2/extract_admission_fixture.py run against a stack built from
current code.  No production code was touched and no assertion was relaxed: the
fail-closed context, reference-source and digest checks all still refuse stale
bytes.

Clearing the staleness also unmasked a stale test call in the same group:
build_transport_factory no longer accepts metadata= or mutating= (neither is read
by the factory), so those two keywords are dropped from the call.

registry: 69 failed+errors -> 41, 937 passed, 0 errors, 0 new failures
(28 fixed: 25 METRIC_CONTEXT_STALE incl. 6 setup errors, plus the 3
frozen_plan/dispatch cases from the previous commit).
2026-10-09 19:36:48 +03:00
..