Follow-up to a5969af3, which gave the catalog entry the native_result the
contract requires. Two consequences had to be carried through.
1. The declared pin now carries that native_result. resolve_baseline_pin returns
it for the metric entry, so the fixture's own baseline_pin - which the resolver
oracle in test_baseline_resolver.py is built from - must declare the same block;
otherwise the oracle asserted a pin the resolver could never produce. The
migration script syncs it from the entry revision rather than duplicating it.
2. _GRAPH_WITH_REF no longer carries an unbound compare_to_baseline step. A graph
holds its baseline references declaratively in `baselines`, and that is what
graph_has_baseline_refs reads (baseline_resolver.py:60-63) and what needs_pin
consults - the step is not the reference. A v1 graph may not carry that step at
all: runner_plan.py:144-150 refuses the shape as UNBOUND_BASELINE_GRAPH before
the resolver runs, which is why two start_run tests in this file read as a
regex mismatch rather than as the refusal they target. The step becomes a
literal assertion, so the derived plan stays non-empty (an empty plan would
mark a walked run passed without executing anything) while the resolver still
sees a graph with baseline refs and no explicit selector. The test's own
assertion graph_has_baseline_refs(...) is True keeps holding.
Measured with the Molecular CoT digest: the NATIVE_RESULT_CATALOG_INVALID EXPLORE
records that dominated this suite are gone, and nothing replaced them.
execution 3 failed / 411 passed -> 414 passed; registry 12 failed / 968 passed;
scenario 414 passed. No production code touched.
require_entry_native_result refuses a table entry with no native_result block
(native_result_catalog.py:30-32) and require_runtime_value_policy refuses the
canonical YAML shape (native_result_catalog.py:83-87 - it rejects an entry that
has `policy`, lacks `comparison_policy`, lacks expected.canonical_value or still
carries expected.canonical). Together those two refusals produced every
NATIVE_RESULT_CATALOG_INVALID in the execution and registry runs.
Adding the missing block was not enough, so the entry was brought to the contract
its whole way, with every value taken from its production owner (the pattern
tests/services/dashboard_testing/execution/native_pin_literal_fixture.py already
establishes):
- expected moves from canonical to canonical_value, and canonical cells become
strings, which require_cell demands (result_values.py:71-72);
- policy is dropped and comparison_policy is taken from native_policy_snapshot;
- the metric column is renamed to revenue_by_region in all three canonical tables
the fixture repeats. result_descriptor.py:77 requires selected_metric to be one
of the column names, and the fixture itself already called that metric
revenue_by_region in its result_key, its evaluation criterion and both
comparison sides - only the canonical data disagreed;
- native_result is built from the descriptor with descriptor_sha256,
result_identity_sha256, canonical_value_digest and the record/policy digests, so
the block's own validators verify it;
- provenance drops the five capture-binding fields the Provenance contract does
not declare; the block now owns that identity (capture_artifact_id,
capture_content_ref, source_response_hash).
scripts/migrate_catalog_native_result.py is committed with it and proves its work
before writing: require_entry_native_result, BaselineEntry strict validation and
require_native_revision all pass, and the fixture's outer identity tokens
(entry_digest, coordinate_hash, catalog_digest, baseline_family) are verified
unchanged - they are placeholders compared by equality, not recomputed from the
entry, which the script asserts rather than assumes.
No production code touched; every refusal still refuses on the shapes it
rejects. execution 7 failed / 407 passed -> 3 failed / 411 passed; registry
13 failed -> 12 failed / 968 passed; scenario 414 passed.
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).
Two defects fixed:
- ensure_banner_chart created an orphan 'Maintenance Banner' markdown chart
(polluted Charts menu and dashboard exports). The banner is now a native
MARKDOWN element in position_json; chart_id is a synthetic layout key.
- insert_banner_markdown_at_top blindly targeted GRID_ID; on ROOT->TABS
dashboards (FI-0085) GRID_ID is orphaned and the banner never rendered.
The layout is now normalized to ROOT->GRID_ID->[ROW-banner, ...] with
recursive parents update, matching the proven-working manual example.
Review-driven hardening:
- liveness check verifies reachability from ROOT (children graph), so
dashboards corrupted by the old bug self-heal on the next start.
- insert removes stale ROW-banner-*/MARKDOWN-banner-* keys (single banner).
- decision memory (@RATIONALE/@REJECTED) added to both modules.
- new ops script scripts/cleanup_maintenance_banner_charts.py (dry-run by
default) deletes already-created bogus banner charts in prod.
Systematic rename of all semantic anchors (#region, [DEF], @RELATION)
across 1400+ files — backend Python, frontend Svelte/TS, specs, docs:
- Flat anchors become Namespace.Module.Entity
- @RELATION references updated to match new anchor paths
- Zero business logic changes
Backend entrypoint sources certs.sh for CA certificate installation,
but the file was never copied into the Docker image — causing
container crash loop on startup (regression in 7f932610).
Changes:
- docker/backend.Dockerfile, docker/all-in-one.Dockerfile: COPY certs.sh
- docker/backend.entrypoint.sh: remove dead install_llm_ca_certs,
install_certificates (replaced by docker/certs.sh); update @INVARIANT
- backend/src/core/ssl.py: fix describe_context() to report actual
system cert count (SSLContext.capath attr does not exist in Python 3)
- __tests__: rewrite stale tests asserting LLM_SSL_VERIFY=false →
verify=False; behaviour is permanently removed — always CERT_REQUIRED
- backend/tests/integration/test_backend_container.py [new]: 5 tests
verifying certs.sh presence, sourceability, and full-stack smoke
(testcontainers PG → entrypoint → migrations → health)
- conftest.py: restore health-wait loop and fixtures in superset_container
- ADR-0009, README.md, scripts, .env: align docs with centralized SSL