Repository navigation
Resolve Hub model commits through huggingface_hub, not config._commit_hash - #57
Merged
Merged
Conversation
…_hash Transformers 5.18 stopped setting config._commit_hash (configs drop it at construction). Every drowse reader of that attribute silently lost the model's immutable commit: - `drowse lens fetch <model> neuronpedia|workspace-r|workspace-j` raised "could not resolve immutable Hugging Face model revision" for every model. - The load plan pinned nothing, so _finalize_model never stamped the live config, and a session rejected every fetched external J-lens binding as stale. - model_source_fingerprint returned None for every Hub model, which disabled the metadata-only preflights and the source-trusted cache path. resolve_model_revision (core/model.py) is now the one source of the commit: HfApi.resolve_revision online, the cached ref offline, None for a local directory. The load plan resolves it first and pins the probe config read too. The fingerprint takes the plan's revision, or resolves it for a preflight. Lens fetch resolves the commit and then reads the dimension-check config pinned to it. The live config's _commit_hash stays the slot that the identity checks read, now filled by drowse's stamp on every load. Declares huggingface-hub>=1.26, the first release with resolve_revision; the transformers 5.10 floor only implies hub>=1.5.
pandas 3.1 annotates df[label] as Series | DataFrame, so df[c].nunique(...) > 1 typed as Series | bool and pyright rejected the conditional (CI typecheck). A string label selects a Series here; cast says so.
validateFullRuntimeReport rejects observer reports older than 30 days against the real clock, and the producer runs as a subprocess, so the fixed 2026-08-29 fixture timestamp made both full-runtime benchmark tests fail from 2026-09-28 on (webui-build, check:hosted). The fixture report is now minted a minute before the test runs.
a9lim
enabled auto-merge
October 28, 2026 15:45
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
Drowse now gets a Hub model's immutable commit from
huggingface_hub(HfApi.resolve_revision) through one helper,core.model.resolve_model_revision. It no longer readsconfig._commit_hash, which transformers 5.18+ never sets.Why
Transformers 5.18 drops
_commit_hashwhen it builds a config. Every drowse reader of that attribute quietly lost the model's commit (verified with transformers 5.21.0 and huggingface_hub 1.33.0):drowse lens fetch <model> neuronpedia(andworkspace-r/workspace-j) failed for every model withValueError: could not resolve immutable Hugging Face model revision for Qwen/Qwen3-8B._resolve_load_planpinned nothing._finalize_modeltherefore never stamped the live config, and a session would have rejected any fetched external J-lens binding as stale even after a successful fetch.model_source_fingerprintreturnedNonefor every Hub model. That disabled the metadata-only preflights (lens fit/manifold fitno-op proofs) and the source-trusted cache path inloaded_model_fingerprint.The fix:
resolve_model_revision(model_id)returns the commit: from the Hub when online, from the cachedrefs/entry when offline, andNonefor a local directory. Hub errors propagate, so a gated or missing repo keepshuggingface_hub's own message.model_source_fingerprinttakes the plan'srevisionfrom the loader, or resolves it itself for a preflight. A preflight's recompute therefore matches the stamp again._model_commitis gone._commit_hashis still the slot the identity checks read (_jlens_matches_loaded_model, capture fingerprints). Drowse's stamp now fills it on every load.huggingface-hub>=1.26, the first release withresolve_revision. Thetransformers>=5.10floor only implies hub ≥1.5.Test plan
ruff check .passespyrightpasses (0 errors; the one warning is the optionalripserimport)pytest -q -m "not gpu"): 3951 passed, 33 skippedload_modelofhf-internal-testing/tiny-random-LlamaForCausalLMinstead (below)Qwen/Qwen3-8B(configs only) and the tiny Llama on CPUNew offline tests:
test_neuronpedia_fetch_pins_the_resolved_model_commitruns the full fetch against a config with no_commit_hash. It fails onmainwith the reportedValueErrorand passes here. The resolver tests check.resolvedagainst the requested ref (aResolvedRevisionstringifies to"main"), local directories, and fail-open behavior. The plan, stamp, and preflight tests cover the rest.Manual checks, run on the real Hub:
drowse lens fetch Qwen/Qwen3-8B neuronpediabindsneuronpedia/jacobian-lens@e166deb5…, 35 layers, 461 prompts, andmodel_revisionb968826d…(the Hub's currentmain).drowse lens show Qwen/Qwen3-8Breports it._resolve_load_plan("Qwen/Qwen3-8B")pins the same commit, and_jlens_matches_loaded_modelaccepts the fetched sidecar against the stamped config.load_modelon the tiny Llama stamps the resolved commit, and its_drowse_source_fingerprintequals the preflight recompute.HF_HUB_OFFLINE=1, the commit resolves from the cached ref.CI fixes in this PR
Two CI failures here were already on
main(its last run,8114d796, failed too). They're fixed in their own commits:typecheck: pandas 3.1 typesdf[label]asSeries | DataFrame, sodf[c].nunique(...) > 1indrowse/notebook/plots.pytyped asSeries | bool. Acasttopd.Seriesstates the actual type.tests/test_notebook.pypasses.webui-build(npm run check:hosted): the full-runtime evidence fixture was pinned toproducedAt2026-08-29. The producer rejects observer reports more than 30 days old against the real clock, so two tests inrecord-hosted-evidence.test.mjshave failed since 2026-09-28. The fixture is now minted a minute before the test. Locally, the file passes 19/19 andnpm run check:hostedpasses end to end.npm run buildleavesdrowse/web/distunchanged. I didn't runtest:hostedlocally (Playwright browsers aren't installed on this Mac), so CI covers it.Notes
model_source_fingerprint: null. Thelens fitno-op preflight can't prove those artifacts, so they re-fit once.core/sae.pyalready resolved SAE repos viamodel_info(...).shaand is unaffected.