feat(registry): thread validated --stage into the snapshot CLI (L4469)#233
Merged
Conversation
The CLI exposed --stage only as a --list FILTER; the snapshot path always recorded stage=None, so a manually-backfilled model was invisible to the Phase-1 shadow runner (which enumerates stage="challenger"). The challenger-first mitigation in ROADMAP CF2 — `python -m model.registry ... --stage challenger` to register a model the Saturday auto-capture missed — therefore could not actually register a shadow-runnable challenger from the CLI. Now --stage (a) carries argparse choices=VALID_STAGES validation and (b) threads into snapshot_to_registry on the snapshot path. Promotion still goes through --promote (copies the bundle + demotes the prior champion); --stage champion on a fresh snapshot is intentionally just a recorded label, not a promotion. snapshot_to_registry already accepted the stage kwarg + is tested; this wires the operator surface to it. Tests: CLI threads --stage challenger into the snapshot call; argparse rejects an invalid stage. Suite green (test_registry_snapshot 12 passed). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Completes the model-registry manual-ops surface for the champion/challenger arc. The CLI exposed
--stageonly as a--listfilter; the snapshot path always recordedstage=None, so a manually-backfilled model was invisible to the Phase-1 shadow runner (inference/stages/shadow_versions.pyenumeratesstage="challenger").Now
--stage:choices=VALID_STAGESvalidation (champion/challenger/archived), andsnapshot_to_registry(..., stage=...)on the snapshot path.snapshot_to_registryalready accepted thestagekwarg and is tested — this just wires the operator CLI to it. Promotion still goes through--promote(copies the bundle + demotes the prior champion);--stage championon a fresh snapshot is intentionally only a recorded label, not a promotion.Why now (context discovered this session)
While verifying #3 ("build the shadow runner"), I found the shadow runner is already shipped (#228, merged 6/2) and enabled-by-default (
SHADOW_VERSIONS_ENABLED=True, staged in the inference pipeline). The real gap is that the registry has only the 8-model champion — the 6/2 off-cycle retrain archived toweights/meta/archive/2026-06-02/but its archive is an incomplete contract (nomanifest.json/feature_list.json), so it is not registrable (the registry refuses incomplete contracts by design). The first registrable challenger is the 6/6 Saturday retrain (with the #227 capture-gap now onmain, it auto-registers). This--stageflag is what lets an operator manually register a challenger from the CLI when the auto-capture is ever missed — the documented CF2 mitigation. (The ROADMAP CF2 line that says "the 6/2 retrain registers the first challenger" is now stale — correction filed in the alpha-engine-config docs PR.)Tests
--stage challengerinto the snapshot call; argparse rejects an invalid stage.test_registry_snapshot.py: 12 passed.No S3 schema/path change; additive operator surface.
🤖 Generated with Claude Code