Fidelity, quality evidence and release qualification
Status: normative · Owns: when captured behavior may replace a model call.
Equivalence is task-specific
For a deterministic transformation, require exact bytes or schema-normalized equality against a declared oracle as appropriate. For retrieval, require owner/permission-scope equality, citation integrity and freshness. For a decision rule, require calibrated precision/recall, threshold and negative tests. For a subjective/generative task, a universal deterministic replacement generally cannot be asserted; use partial reductions or guarded model fallback.
No amount of throughput improvement compensates for failed acceptance. Distinguish task efficacy, runtime fidelity, reference-oracle agreement, latency, resource use and actual cost. A fast bad answer is not a successful optimization.
Evidence levels
| Level | Meaning | Route allowed |
|---|---|---|
| E0 Observed | Single original input/output preserved | No general automatic replacement |
| E1 Candidate | Derived template or procedure matches base fixture | Preview only |
| E2 Evaluated | Golden, counterexample, property and boundary tests pass in isolated CI | Restricted canary after reviewer |
| E3 Promoted | Signed, scoped, owner-approved release with rollback & drift monitors | Local automatic reuse inside scope |
| E4 Monitored | Field evidence confirms expected quality/cost | Broader deployment by reviewed policy |
| Revoked | Drift, incident, rights issue or regression | Fallback only; do not execute |
Test design
Test fixture bytes and source hashes; input schema accepted/rejected branches; empty/missing/null/Unicode/multiline cases; adversarial delimiters; length/time budgets; PII and cross-tenant risks; property-based invariants; metamorphic constraints; roundtrip where meaningful; representative live held-out examples; deterministic reproducibility; old-release regression. For each new variation, define whether the oracle is inherited (pure parameter substitution) or must be built anew (changed meaning).
Promotion gate
All required tests pass at pinned runtime/OS/PHP release; reviewer approves exact scope, effect declarations and data rights; performance meets target against a recorded baseline; immutable manifest, code hash and rollback release exist; canary is bounded and monitored. New exception patterns route to model with user-consistent disclosure. Never silently fall back to a model if the operator demands offline/no-spend mode.
Regression and drift
Compare ongoing output against withheld oracle samples, fresh data schemas and known negative cases. Drift signals trigger quarantine or fallback, not self-updated production source. Human reviewer can approve a new immutable release. Raw metrics, pass counts, false positives/negatives, provenance, measured cost and reviewer identity survive as evidence. Retention and deletion rights may remove payloads; linked tombstones preserve auditable events where lawful.