Repository navigation
Description
Parent epic: #929
Design proposal: PR #1080
Phase: 0 (Wave 1 — file immediately, independent of 0.1)
Blocks: 2.2 (revision-aware prepare())
⚠️ Pre-flight dependency: PR #1078 must be merged before starting this issue. PR #1078 adds canned I/O test data forrequirement-checkanduncertaintyformatters that this issue's tests build on. Revision-pinning (here) supersedes thelast_validated_commitapproach in #1078; close #1029 when #1078 merges.
Problem
mellea/backends/adapters/catalog.py does not record which revision of an upstream HF repository Mellea expects. When upstream pushes new weights, every Mellea install silently picks them up.
PR #1008 is the worked example: requirement-check output changed schema upstream; requirement_check_to_bool returned False for every call until someone noticed.
Current state (verified main 2026-05-21): IntriniscsCatalogEntry has fields name, internal_name, repo_id, adapter_types — no revision. 14 entries across _RAG_REPO, _CORE_REPO, _CORE_R1_REPO, _GUARDIAN_REPO. Note: typo IntriniscsCatalogEntry (missing 'i') is intentional convention — do not fix it in this issue.
Additionally, the catalogue has two entries for the same adapter: requirement_check (underscore) and requirement-check (hyphen) — dead state that creates confusion.
Agreed design
Each catalogue entry gains a revision field pinned to a 40-character HF commit SHA. Mellea pins to that SHA when auto-loading. Callers may pass revision="main" to opt into tracking-latest.
Deduplication: Collapse requirement_check + requirement-check to a single canonical requirement_check entry with role="requirement-check" set on the Identity. Role-based lookup (introduced in 1.A) routes correctly regardless of key used at construction time.
This implements Jake req 5.
Scope
mellea/backends/adapters/catalog.py— addrevisionfield toIntriniscsCatalogEntry; populate all 14 entries with current upstream SHA at PR time- Validation:
revisionmust be 40-char lowercase hex OR literal"main" - Validation function lives next to the catalogue type
- Collapse
requirement_check/requirement-checkduplicate to one canonical entry - Update any catalogue-construction examples in
docs/examples/andtest/to include the field
Out of scope
- Any change to
prepare()behaviour — 2.2 consumes the pinned revision - Refresh policies for long-running sessions (2.2 + design: adapter output-schema versioning (deferred from #929) #1111)
- Auto-bumping SHA when upstream pushes (manual for now)
- Fixing the
IntriniscsCatalogEntrytypo (preserve)
Acceptance criteria
- All 14 catalogue entries have a
revisionfield with a valid 40-char hex SHA - Revision validation rejects malformed values with a clear error
-
"main"accepted as explicit opt-in for tracking-latest - Tests cover: valid SHA accepted, malformed SHA rejected,
"main"accepted,Nonehandling tested explicitly (implementer chooses accept-as-main vs reject-with-error — must be tested) -
requirement_checkandrequirement-checkentries collapsed to one; no duplicate key - Existing tests pass; helpers function unchanged (new field is metadata-only at this stage)
-
ruff format,ruff check,mypyclean
Test plan
test/backends/adapters/test_catalog_revision.py:
test_catalog_entries_have_revision— every entry has a valid valuetest_revision_validation_rejects_malformed— short, long, non-hextest_revision_validation_accepts_main_literaltest_revision_round_trip— construct entry, retrieve, assert preservedtest_no_duplicate_requirement_check_entry
⚠️ SHA staleness: The SHA pinned at PR-write time may be stale by merge time. Reviewer should re-fetch upstream HEAD just before merging and confirm the SHA is still current.
Breaking changes
None for end users. Downstream code constructing IntriniscsCatalogEntry directly must add the new field (or handle implementer's None behaviour).
References
- PR docs: design proposal for adapter lifecycle (#929) — review channel, do not merge #1080 §17 Q6, §6
- PR fix: move test_huggingface.py to granite4.1; and small rag intrinsic … #1008 — the schema flip that motivated this
- Jake req 5
- design: adapter output-schema versioning (deferred from #929) #1111 — output-schema versioning (downstream half; this is the upstream half)
Activity
fix(intrinsics): apply code-review fixes for generative-computing#1135
fix(intrinsics): apply round-2 review polish for generative-computing…
fix(intrinsics): pin catalogue entries to HF revision SHAs + deduplic…
fix(intrinsics): apply code-review fixes for generative-computing#1135
fix(intrinsics): apply round-2 review polish for generative-computing…
fix(intrinsics): relax revision validator and rename requirement_chec…
fix(intrinsics): correct phase-2.2 TODO references to point at genera…
fix(intrinsics): address post-approval nits on catalog docstring (gen…
fix(intrinsics): tighten revision validator + clean up stale comments (…
fix(intrinsics): correct Raises docstring after whitespace-strip hard…
fix(intrinsics): pin catalogue entries to HF revision SHAs + deduplic…
feat(backends): implement LocalFileBinding verbs and from_catalog()
feat(backends): implement LocalFileBinding verbs and from_catalog()
feat(backends): LocalFileBinding implements verbs (PEFT/aLoRA path) +…