The runtime names its artifact before anything is switched on

Step 35 asks the deployed process to prove WHICH frozen curve it resolves —
artifact id, procedure, era, source digest, knot digest, curve digest, support,
servable, stage — with the shadow still OFF. The probe could not answer, so the
same shadowState() evaluator now resolves the promoted artifact and reports its
identity. Identity only: the curve is committed and addressable by artifact_id,
and repeating it on a status page would put a second copy of the truth there.

null means nothing is promoted, which is also the honest answer when the file is
missing or fails its policy at load.

Suite 404/404. Shadow OFF. Live OFF.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01CQJeAG8vcDoL5zkiaJyVb8
This commit is contained in:
Kev
2026-09-03 01:08:44 -04:00
parent be8e16aca9
commit f4f51ed7ca
2 changed files with 54 additions and 0 deletions
+28
View File
@@ -305,6 +305,31 @@ const SHADOW_ENV = 'PROBABILITY_CONTRACT_SHADOW';
function shadowState(env = process.env) {
const raw = env[SHADOW_ENV];
const on = String(raw || '') === '1';
// WHICH FROZEN ARTIFACT THIS PROCESS WOULD USE — resolvable with the shadow
// OFF, because "is the right curve deployed?" must be answerable before
// anything is switched on. Identity only: the curve itself is committed and
// addressable by `artifact_id`, and repeating it here would put a second copy
// of the truth on a status page.
let artifact = null;
try {
const a = require('./artifactRegistry').load(MLB_HITS.sport, MLB_HITS.stat);
if (a) {
artifact = Object.freeze({
artifact_id: a.artifact_id, procedure_version: a.procedure_version,
model_version: a.model_version, fit_as_of: a.fit_as_of,
training_cutoff: a.training_cutoff, fit_n: a.fit_n,
withheld_from_fit: a.withheld_from_fit,
source_digest: a.source_digest, knot_digest: a.knot_digest,
served_curve_digest: a.served_curve_digest, knot_count: a.knot_count,
certified_bands: a.certified_bands, stage: a.stage,
approved_for_shadow: a.approved_for_shadow, approved_for_live: a.approved_for_live,
servable: a.servable, fit_policy_valid: a.fit_policy_valid,
fit_policy_violations: a.fit_policy_violations,
wrong_era_rows: a.era_audit ? a.era_audit.wrong_era_rows : null,
});
}
} catch { artifact = null; }
return Object.freeze({
shadow: on ? 'ON' : 'OFF',
env_var: SHADOW_ENV,
@@ -315,6 +340,9 @@ function shadowState(env = process.env) {
certified_support: MLB_HITS.certified_bands,
estimator_version: MLB_HITS.estimator_version,
model_version: MLB_HITS.model_version,
// null means NOTHING is promoted — which is also the honest answer when the
// file is missing or fails its policy at load.
artifact,
});
}