# Quality scorecard protocol

This independent study consumes the frozen project 1 mobility contract.
It measures detection of deliberately injected fixtures, not production monitoring performance.

## Frozen scenarios

The historical clock is 2024-02-01 06:00:00. Synthetic ingestion timestamps are
01:00:00 the day after each trip date. The latest clean batch is five hours old.
Freshness warns above six hours and fails above twelve hours. This models arrivals;
the publisher did not provide observed ingestion times.

Run clean, late_partition, null_spike, duplicate_load, unit_change, then combined.
Late partition removes all January 31 rows. Content faults affect January 30 so
the combined example retains all four faults. Null spike blanks the first ninety
non-null fares in stable source order. Duplicate load appends the first twenty-five
January 30 rows with their original IDs. Unit change multiplies January 30 miles
by 1.609344, simulating kilometres entering a miles field.

Before injection, derive a synthetic audit metres field as source miles times
1609.344. Keep it unchanged during injection. The units invariant compares reported
miles times 1609.344 with this field, within 0.000001 metres. This demonstrates a
redundant measurement contract. It cannot detect two consistently corrupted fields
and does not imply a real independent measurement from the publisher.

## Checks and scoring

Completeness requires the January 30 fare-null fraction at most 0.05. This explicit
service threshold differs from the anomaly detector: the latter fits fourteen clean
days strictly before the evaluation day and uses median plus the greater of 0.05
or six scaled median absolute deviations (scale 1.4826). Fewer than fourteen
consecutive clean days yields unknown. Control false positives are measured over
every eligible clean day, January 15 through January 31. No injected observation
enters a baseline. The score uses the January 30 anomaly result.

Fixed dimensions are freshness 25%, completeness 25%, uniqueness 25%, validity
15%, anomaly 10%. A dimension passes only when all its named required checks pass.
Validity includes the units invariant and all fifteen inherited contract tests.
Missing, stale, skipped, warning or conflicting evidence earns no dimension credit.
A failed critical dimension (all except anomaly) caps trust at 40. Unavailable
required evidence caps it at 20. Extra passing checks cannot alter the denominator.
Repeating an identical result is idempotent; conflicting duplicates yield unknown.

The score assesses the trip feed through checks executed on its source and marts.
The source score propagates conservatively to stg_trips, trips and daily_trips via
the actual dbt manifest. There is no measured downstream usage or independent
per-table score. Zones and time_spine are not descendants of the trip source.
Named owners and example consumers in the presentation are synthetic assumptions.

## Execution integrity

Verify the immutable dependency archive and every member before use. Extract into
a new scenario directory for each run. Consumer overlays change only freshness
configuration and ingestion projection, plus new tests and the fixed-clock macro.
Original vendor bytes stay frozen. Seed, model, test and source-freshness commands
have separate targets. Model/seed errors abort. Expected test failures and freshness
threshold errors are findings; compile/runtime failures abort instead of rendering
a successful scorecard. Collect manifest v12, run-results v6 and sources v3 from
the actual pinned runtime. Bind each stage to input hashes, scenario, code hash,
invocation ID and artifact hashes. Reject mixed, missing or altered artifacts.

Run the isolated scenarios before the combined example. Report detected/total
isolated fixtures and false positives with denominators. Do not retune thresholds
after observing scenario results. No claim of general recall or production impact
follows from a small constructed fixture set.
