Skip to content

The agent that grows with you

feat(local-runtime): drop sha256 verification — byte-size is the only download tripwire

emozilla949089206fa4
diff --git a/hermes_cli/local_runtime/catalog.py b/hermes_cli/local_runtime/catalog.py
index 953abc2be6b..7082d04154c 100644
--- a/hermes_cli/local_runtime/catalog.py
+++ b/hermes_cli/local_runtime/catalog.py
@@ -26,8 +26,11 @@ Entries may carry an mmproj (vision projector) and a speculative-decode
draft model — both download alongside the weights. Spec decode is enabled
only when the launch decision spills, where its speedup is largest.
-sha256s are pinned from HF LFS metadata (the lfs oid IS the file sha256),
-reviewed like a version bump — parsed data, never executed commands.
+File sizes come from HF LFS metadata and feed the estimator, the fit
+pills, and download progress. There is no download-time integrity check
+(product decision): a corrupt or truncated file surfaces as a llama.cpp
+load error at first use, and the reachability test catches upstream
+re-uploads by size drift before users do.
This is deliberately not a live registry feed: entries are reviewed like a
version bump (the same policy governs vendor recipe ingestion — parsed
@@ -67,14 +70,16 @@ _PART_SUFFIX = re.compile(r"-\d{5}-of-\d{5}$")
@dataclass(frozen=True)
class AssetFile:
- """One downloadable file: repo-relative path, exact bytes, sha256.
- ``local`` overrides the on-disk name (repos reuse generic names like
- mmproj-BF16.gguf across models). Non-model extras live under the
- models dir's assets/ subdirectory so the router never lists them."""
+ """One downloadable file: repo-relative path and exact bytes (the size
+ feeds the estimator and the download progress bar; there is no
+ download-time integrity check by design — a corrupt file surfaces as a
+ llama.cpp load error). ``local`` overrides the on-disk name (repos
+ reuse generic names like mmproj-BF16.gguf across models). Non-model
+ extras live under the models dir's assets/ subdirectory so the router
+ never lists them."""
path: str # repo-relative (may include a subdir)
size_bytes: int
- sha256: str
local: str | None = None
@property
@@ -225,8 +230,7 @@ def _v(quant: str, *files, validated: bool = False) -> QuantVariant:
validated=validated)
-# Ordered: recommended first. File bytes + sha256s pinned from HF LFS
-# metadata.
+# Ordered: recommended first. File bytes pinned from HF LFS metadata.
CATALOG: tuple[CatalogEntry, ...] = (
CatalogEntry(
id="qwen3.8-27b",
@@ -235,17 +239,13 @@ CATALOG: tuple[CatalogEntry, ...] = (
repo="unsloth/Qwen3.8-27B-GGUF",
variants=(
_v("UD-Q8_K_XL",
- ("Qwen3.8-27B-UD-Q8_K_XL.gguf", 31457991680,
- "af36ecb6b5db1407953345b746c14ac93f0657dda413910b4348683a2d990377")),
+ ("Qwen3.8-27B-UD-Q8_K_XL.gguf", 31457991680)),
_v("UD-Q6_K_XL",
- ("Qwen3.8-27B-UD-Q6_K_XL.gguf", 25924152384,
- "739202186fd9389bb58497c58b56c8a0d4253d99d20131e6a0427e363e678fc8")),
+ ("Qwen3.8-27B-UD-Q6_K_XL.gguf", 25299061664)),
_v("UD-Q5_K_XL",
- ("Qwen3.8-27B-UD-Q5_K_XL.gguf", 20218178624,
- "176a6a3f034e9cdc447c10cd00329fc9b31002e6589b9295f2ad4f1eefe0f6ab")),
+ ("Qwen3.8-27B-UD-Q5_K_XL.gguf", 20876938144)),
_v("UD-Q4_K_XL",
- ("Qwen3.8-27B-UD-Q4_K_XL.gguf", 17923394624,
- "bee238bbeb3dc0a34bde4d0dedbaee1f98c009e8bb4226f03070054c12fb1372")),
+ ("Qwen3.8-27B-UD-Q4_K_XL.gguf", 17559178144)),
),
n_ctx_train=262144,
# Same hybrid family as Qwen3.6-27B (config-verified: 64 layers,
@@ -255,7 +255,6 @@ CATALOG: tuple[CatalogEntry, ...] = (
full_layers=16, recurrent_layers=48, per_layer_f16=4096,
n_vocab=248320,
mmproj=AssetFile("mmproj-BF16.gguf", 931146432,
- "83ee4f4f205fa514161778c41df1ea14144faa0f713510893b63c2395f5c2d53",
local="mmproj-Qwen3.8-27B-BF16.gguf"),
sampling={"temp": "1.0", "top-p": "0.95", "top-k": "20", "min-p": "0.0"},
tags=("recommended", "hybrid", "reasoning", "vision", "day-0"),
@@ -267,20 +266,16 @@ CATALOG: tuple[CatalogEntry, ...] = (
repo="unsloth/Qwen3.6-35B-A3B-MTP-GGUF",
variants=(
_v("UD-Q8_K_XL",
- ("Qwen3.6-35B-A3B-UD-Q8_K_XL.gguf", 39099447584,
- "6c6b816537abad90b250a0972b345466028d861ddfe316d5f0de31ca6440f781")),
+ ("Qwen3.6-35B-A3B-UD-Q8_K_XL.gguf", 39099447584)),
_v("UD-Q6_K_XL",
- ("Qwen3.6-35B-A3B-UD-Q6_K_XL.gguf", 32611711264,
- "35fce994cd36104a7dc1bd8a4bdf13778145664c00fdef6773aebc9246e5019c")),
+ ("Qwen3.6-35B-A3B-UD-Q6_K_XL.gguf", 32611711264)),
_v("UD-Q5_K_XL",
- ("Qwen3.6-35B-A3B-UD-Q5_K_XL.gguf", 27159116064,
- "9de9a9420f61a0bb59bb2ca1ea170a6a57f6821fa1deec915bcaef523730a919")),
+ ("Qwen3.6-35B-A3B-UD-Q5_K_XL.gguf", 27159116064)),
# Validated on this repo's prior upload; upstream has since
# re-uploaded. Same model id + pipeline — re-verify at the
# next validation pass.
_v("UD-Q4_K_XL",
- ("Qwen3.6-35B-A3B-UD-Q4_K_XL.gguf", 22853663008,
- "55983c5a75a1ab969824077b3bb3de4146e82a9234072b48ad4e8f92ad3fe9f1"),
+ ("Qwen3.6-35B-A3B-UD-Q4_K_XL.gguf", 22853663008),
validated=True),
),
n_ctx_train=262144,
@@ -289,7 +284,6 @@ CATALOG: tuple[CatalogEntry, ...] = (
full_layers=10, recurrent_layers=30, per_layer_f16=2048,
moe=True, mtp=True, mtp_draft_depth=2, n_vocab=248320,
mmproj=AssetFile("mmproj-BF16.gguf", 902822528,
- "da63cb47a76763c712393f8a017070188a304fa39f8aeea6edc629ed7b975cfa",
local="mmproj-Qwen3.6-35B-A3B-BF16.gguf"),
sampling={"temp": "1.0", "top-p": "0.95", "top-k": "20", "min-p": "0.0"},
tags=("hybrid", "moe", "mtp", "vision"),
@@ -301,17 +295,13 @@ CATALOG: tuple[CatalogEntry, ...] = (
repo="unsloth/NVIDIA-Nemotron-3.5-Lightning-30B-A3B-GGUF",
variants=(
_v("UD-Q8_K_XL",
- ("NVIDIA-Nemotron-3.5-Lightning-30B-A3B-UD-Q8_K_XL.gguf", 38615380032,
- "48140cfb8bb6a38553275d334345f2638c119d979ab8b6d4afdc4b62d26d8219")),
+ ("NVIDIA-Nemotron-3.5-Lightning-30B-A3B-UD-Q8_K_XL.gguf", 38615380032)),
_v("UD-Q6_K_XL",
- ("NVIDIA-Nemotron-3.5-Lightning-30B-A3B-UD-Q6_K_XL.gguf", 35004643392,
- "36b8b0f882ec739f895fe56ab6b9b892e702ba33b7b368614ca4078331ddfc29")),
+ ("NVIDIA-Nemotron-3.5-Lightning-30B-A3B-UD-Q6_K_XL.gguf", 35004643392)),
_v("UD-Q5_K_XL",
- ("NVIDIA-Nemotron-3.5-Lightning-30B-A3B-UD-Q5_K_XL.gguf", 30414829632,
- "92dcaf682faf39fef906db7bad4000782001d089f28c4d6aecec6d6f1b4697ca")),
+ ("NVIDIA-Nemotron-3.5-Lightning-30B-A3B-UD-Q5_K_XL.gguf", 30414829632)),
_v("UD-Q4_K_XL",
- ("NVIDIA-Nemotron-3.5-Lightning-30B-A3B-UD-Q4_K_XL.gguf", 25505724480,
- "112bf957489a497c18f60bf8bd44ee1dfa05e87368b8ed7f68998a4e38f275c9")),
+ ("NVIDIA-Nemotron-3.5-Lightning-30B-A3B-UD-Q4_K_XL.gguf", 25505724480)),
),
n_ctx_train=1048576,
# Prior from Nemotron-3-Nano (same hybrid family; base config gated
@@ -331,17 +321,13 @@ CATALOG: tuple[CatalogEntry, ...] = (
repo="unsloth/Muse-Glimmer-30B-GGUF",
variants=(
_v("UD-Q8_K_XL",
- ("Muse-Glimmer-30B-UD-Q8_K_XL.gguf", 32300651040,
- "e63bf23b7710ecdea2579e4b1de58980c4a2b446e8ecf48b782cfcefd2e31770")),
+ ("Muse-Glimmer-30B-UD-Q8_K_XL.gguf", 32300651040)),
_v("UD-Q6_K_XL",
- ("Muse-Glimmer-30B-UD-Q6_K_XL.gguf", 26265362976,
- "fb5f80d110c4fa932cc652e70873c0bd12c0954009038aa675e65086104c2739")),
+ ("Muse-Glimmer-30B-UD-Q6_K_XL.gguf", 26265362976)),
_v("UD-Q5_K_XL",
- ("Muse-Glimmer-30B-UD-Q5_K_XL.gguf", 21789618976,
- "97a66c4b41d9e778af7cdfa43508e08dbf765fb5049b740c69ad815e5191c637")),
+ ("Muse-Glimmer-30B-UD-Q5_K_XL.gguf", 21789618976)),
_v("UD-Q4_K_XL",
- ("Muse-Glimmer-30B-UD-Q4_K_XL.gguf", 15878222368,
- "82bece304887a313ece08400bc030f6066c7bff5b906b0cd40308ec8a409fd38")),
+ ("Muse-Glimmer-30B-UD-Q4_K_XL.gguf", 15878222368)),
),
n_ctx_train=262144,
# Conservative dense prior (base config gated upstream): 30B-class
@@ -350,8 +336,7 @@ CATALOG: tuple[CatalogEntry, ...] = (
# GGUF header corrects it.
full_layers=60, recurrent_layers=0, per_layer_f16=4096,
n_vocab=202048,
- mmproj=AssetFile("mmproj-Muse-Glimmer-30B-BF16.gguf", 3849173728,
- "d08cdcfa0b41d8e20554b52df404ba4f7b440d0bc502a90038508b6407df8ee1"),
+ mmproj=AssetFile("mmproj-Muse-Glimmer-30B-BF16.gguf", 3849173728),
sampling={"temp": "1.0", "top-p": "0.95", "top-k": "64"},
tags=("day-0", "vision", "dense"),
),
@@ -364,27 +349,17 @@ CATALOG: tuple[CatalogEntry, ...] = (
# Q8 is bit-lossless vs the official QAT checkpoint; Q4 keeps
# the MXFP4 experts bit-exact and only requants the other 4%.
_v("UD-Q8_K_XL",
- ("UD-Q8_K_XL/DeepSeek-V4-Flash-0731-UD-Q8_K_XL-00001-of-00005.gguf", 5257408,
- "d13ce8f90855547bdaebe7312f531a1f2c4f822178d3103951f27fe884395cfa"),
- ("UD-Q8_K_XL/DeepSeek-V4-Flash-0731-UD-Q8_K_XL-00002-of-00005.gguf", 49215492960,
- "3da2f2443063f83635986f9b67fa7e8e3d03c53b81a9a08d2007936612423610"),
- ("UD-Q8_K_XL/DeepSeek-V4-Flash-0731-UD-Q8_K_XL-00003-of-00005.gguf", 49700372160,
- "7d622a7760d359ec9257b3493ad531e3bf0bfbe6f6533267e16e6dde8153ddce"),
- ("UD-Q8_K_XL/DeepSeek-V4-Flash-0731-UD-Q8_K_XL-00004-of-00005.gguf", 49466495968,
- "6ed2bce452214f156b85e7c5f7d4fc242a3052f409d1b90a61422f60669c2de3"),
- ("UD-Q8_K_XL/DeepSeek-V4-Flash-0731-UD-Q8_K_XL-00005-of-00005.gguf", 13481997024,
- "ea4727af4888fdca0fff796ec81ac2f3ebb43c310b2feb4798f41d82744b42ea")),
+ ("UD-Q8_K_XL/DeepSeek-V4-Flash-0731-UD-Q8_K_XL-00001-of-00005.gguf", 5257408),
+ ("UD-Q8_K_XL/DeepSeek-V4-Flash-0731-UD-Q8_K_XL-00002-of-00005.gguf", 49215492960),
+ ("UD-Q8_K_XL/DeepSeek-V4-Flash-0731-UD-Q8_K_XL-00003-of-00005.gguf", 49700372160),
+ ("UD-Q8_K_XL/DeepSeek-V4-Flash-0731-UD-Q8_K_XL-00004-of-00005.gguf", 49466495968),
+ ("UD-Q8_K_XL/DeepSeek-V4-Flash-0731-UD-Q8_K_XL-00005-of-00005.gguf", 13481997024)),
_v("UD-Q4_K_XL",
- ("UD-Q4_K_XL/DeepSeek-V4-Flash-0731-UD-Q4_K_XL-00001-of-00005.gguf", 5257408,
- "d13ce8f90855547bdaebe7312f531a1f2c4f822178d3103951f27fe884395cfa"),
- ("UD-Q4_K_XL/DeepSeek-V4-Flash-0731-UD-Q4_K_XL-00002-of-00005.gguf", 48935523072,
- "d5b61668950f4743aacd677675d7fcf7507dbe1db6d304e8ff97ed1f00827bee"),
- ("UD-Q4_K_XL/DeepSeek-V4-Flash-0731-UD-Q4_K_XL-00003-of-00005.gguf", 48980787136,
- "9705db7e589f360685ca7bd48100b270d78d228d4f5aa980508f3b2778af5494"),
- ("UD-Q4_K_XL/DeepSeek-V4-Flash-0731-UD-Q4_K_XL-00004-of-00005.gguf", 49999168416,
- "7f13a68e3ca64208454c4ba32cc2757c0cbe78e3e5576c3142bf7007ca97da42"),
- ("UD-Q4_K_XL/DeepSeek-V4-Flash-0731-UD-Q4_K_XL-00005-of-00005.gguf", 7174505088,
- "ed0d93164d3784968d6ce40d6d201ba98337f16e7db1b31fe495b2b0f334cc09")),
+ ("UD-Q4_K_XL/DeepSeek-V4-Flash-0731-UD-Q4_K_XL-00001-of-00005.gguf", 5257408),
+ ("UD-Q4_K_XL/DeepSeek-V4-Flash-0731-UD-Q4_K_XL-00002-of-00005.gguf", 48935523072),
+ ("UD-Q4_K_XL/DeepSeek-V4-Flash-0731-UD-Q4_K_XL-00003-of-00005.gguf", 48980787136),
+ ("UD-Q4_K_XL/DeepSeek-V4-Flash-0731-UD-Q4_K_XL-00004-of-00005.gguf", 49999168416),
+ ("UD-Q4_K_XL/DeepSeek-V4-Flash-0731-UD-Q4_K_XL-00005-of-00005.gguf", 7174505088)),
),
n_ctx_train=1048576,
# Config-derived (deepseek-ai/DeepSeek-V4-Flash-0731): 43 layers,
@@ -393,8 +368,7 @@ CATALOG: tuple[CatalogEntry, ...] = (
# all-full (conservative); GGUF header decides after download.
full_layers=43, recurrent_layers=0, per_layer_f16=1152,
moe=True, n_vocab=163840,
- draft=AssetFile("dspark-DeepSeek-V4-Flash-0731-Q8_0.gguf", 10896057440,
- "2c7ac54b0b64a99df1f139a9f1371a00198265e1d6a614b77597d20a655a4249"),
+ draft=AssetFile("dspark-DeepSeek-V4-Flash-0731-Q8_0.gguf", 10896057440),
sampling={"temp": "1.0", "top-p": "0.95", "min-p": "0.01"},
tags=("day-0", "long-context", "moe", "frontier"),
),
diff --git a/hermes_cli/web_routers/local_models.py b/hermes_cli/web_routers/local_models.py
index ad396103a8e..a52dbf996d9 100644
--- a/hermes_cli/web_routers/local_models.py
+++ b/hermes_cli/web_routers/local_models.py
@@ -9,7 +9,8 @@ interpret.
Long jobs (runtime install, model download) follow the repo's job pattern:
start-POST -> {job_id} -> GET poll with byte progress. Downloads are
-sha256-verified; a hash mismatch deletes the file and reports it plainly.
+byte-size checked against the catalog (no hash verification by design);
+a short download deletes the file and reports it plainly.
"""
from __future__ import annotations
@@ -63,9 +64,7 @@ def _job(kind: str, target: str, model_id: str | None = None) -> Dict[str, Any]:
# ── fast download: ranged parallel streams ───────────────────
# One TCP stream to a CDN rarely fills a fast line; 8 ranged connections
-# writing into a preallocated file saturate consumer gigabit. sha256 is
-# computed in a sequential pass afterwards (NVMe read is seconds, and it
-# keeps the hash independent of write ordering).
+# writing into a preallocated file saturate consumer gigabit.
_DOWNLOAD_CONNECTIONS = 8
_CHUNK = 4 << 20
@@ -122,19 +121,22 @@ def _variant_files_on_disk(model_id: str) -> "list[Path]":
def download_file(url: str, dest: Path, job: Dict[str, Any],
- expected_sha256: str = "", *,
+ *,
+ expected_bytes: int = 0,
base_done: int = 0, keep_totals: bool = False) -> None:
"""Download url -> dest with byte progress on ``job``.
Ranged-parallel when the server supports it, single-stream fallback
- otherwise. Verifies sha256 when given; a mismatch deletes the file and
- raises with a plain-language message. Never leaves a .part behind.
+ otherwise. There is no hash check by design (product decision) — the
+ byte count against ``expected_bytes`` (the catalog size) is the one
+ remaining wrong-file tripwire: a short or oversized body errors the
+ job instead of staging a file llama.cpp will crash on later. Never
+ leaves a .part behind.
Multi-file variants: ``base_done`` offsets the progress so this file's
bytes accumulate onto the files before it, and ``keep_totals=True``
stops the per-file size from overwriting the variant's total.
"""
- import hashlib
import shutil
import threading as _threading
@@ -149,13 +151,19 @@ def download_file(url: str, dest: Path, job: Dict[str, Any],
job["done_bytes"] = base_done + file_done[0]
try:
+ # The probe and the preallocation both take real seconds on a
+ # 20+ GB file — narrate them, or the pane shows a dead '— of X GB'
+ # until the first ranged byte lands.
+ job["detail"] = "Connecting"
total = _probe_range_support(url)
if total:
if not keep_totals:
job["total_bytes"] = total
# Preallocate so each worker writes at its own offset.
+ job["detail"] = f"Reserving {_human_gb(total)} of disk space"
with open(tmp, "wb") as f:
f.truncate(total)
+ job["detail"] = ""
errors: list[Exception] = []
bounds = [(i * total // _DOWNLOAD_CONNECTIONS,
(i + 1) * total // _DOWNLOAD_CONNECTIONS - 1)
@@ -202,16 +210,10 @@ def download_file(url: str, dest: Path, job: Dict[str, Any],
f.write(chunk)
bump(len(chunk))
- if expected_sha256:
- job["phase"] = "verifying"
- job["detail"] = "Checking file integrity"
- digest = hashlib.sha256()
- with open(tmp, "rb") as f:
- for chunk in iter(lambda: f.read(16 << 20), b""):
- digest.update(chunk)
- if digest.hexdigest() != expected_sha256:
- raise RuntimeError(
- "Downloaded file failed its integrity check and was removed — try again")
+ if expected_bytes and file_done[0] != expected_bytes:
+ raise RuntimeError(
+ f"Download ended at {file_done[0]:,} bytes but this file "
+ f"should be {expected_bytes:,} — removed; try again")
shutil.move(str(tmp), str(dest))
except Exception:
tmp.unlink(missing_ok=True)
@@ -636,7 +638,7 @@ async def local_models_runtime_install(body: RuntimeInstallBody):
return {"job_id": job["job_id"], "backend": backend, "tag": tag}
-# ── model download (job with byte progress + sha256) ─────────
+# ── model download (job with byte progress) ──────────────────
class ModelDownloadBody(BaseModel):
@@ -681,16 +683,16 @@ async def local_models_download(body: ModelDownloadBody):
return {"job_id": None, "already_downloaded": True, "model_id": variant.model_id}
# Everything this variant needs: split parts + mmproj/draft assets.
- plan = [] # (url, dest, sha256, bytes)
+ plan = [] # (url, dest, bytes)
for asset in variant.files:
plan.append((f"https://huggingface.co/{entry.repo}/resolve/main/{asset.path}",
- _models_dir() / asset.local_name, asset.sha256, asset.size_bytes))
+ _models_dir() / asset.local_name, asset.size_bytes))
for asset in (entry.mmproj, entry.draft):
if asset is not None:
plan.append((f"https://huggingface.co/{entry.repo}/resolve/main/{asset.path}",
- assets_dir() / asset.local_name, asset.sha256, asset.size_bytes))
+ assets_dir() / asset.local_name, asset.size_bytes))
- total = sum(p[3] for p in plan)
+ total = sum(p[2] for p in plan)
job = _job("model-download", f"{entry.display_name} ({variant.quant})",
model_id=entry.id)
job["total_bytes"] = total
@@ -700,12 +702,12 @@ async def local_models_download(body: ModelDownloadBody):
job["phase"] = "downloading"
job["detail"] = f"{entry.display_name} — {_human_gb(total)}"
done_before = 0
- for url, dest, sha, size in plan:
+ for url, dest, size in plan:
if dest.exists():
done_before += size
job["done_bytes"] = done_before
continue
- download_file(url, dest, job, expected_sha256=sha,
+ download_file(url, dest, job, expected_bytes=size,
base_done=done_before, keep_totals=True)
job["phase"] = "downloading"
done_before += size
diff --git a/tests/hermes_cli/test_catalog_reachability.py b/tests/hermes_cli/test_catalog_reachability.py
index defb88f62b1..94eff1d71f0 100644
--- a/tests/hermes_cli/test_catalog_reachability.py
+++ b/tests/hermes_cli/test_catalog_reachability.py
@@ -1,10 +1,11 @@
-"""Catalog integrity: every entry's files must exist on the host with
-matching sha256s (HF LFS oids ARE the file hashes).
+"""Catalog reachability: every entry's files must exist upstream with the
+size the catalog claims (sizes feed the fit estimator and the download
+progress bar, and a silent upstream re-upload that changes file size means
+the fit math is stale).
Network-marked (skipped in hermetic CI unless explicitly enabled) — this is
the test that catches wrong repo names (the Nemotron 401), moved files, and
-upstream re-uploads before a user's download does. Run before any catalog
-commit:
+re-uploads that resize files. Run before any catalog commit:
HERMES_TEST_NETWORK=1 scripts/run_tests.sh tests/hermes_cli/test_catalog_reachability.py
"""
@@ -31,7 +32,7 @@ def test_every_catalog_file_resolves():
url = f"https://huggingface.co/api/models/{entry.repo}/tree/main?recursive=true"
try:
with urllib.request.urlopen(url, timeout=30) as r:
- files = {f["path"]: f.get("lfs") or {} for f in json.load(r)}
+ files = {f["path"]: f.get("size") for f in json.load(r)}
except Exception as exc: # noqa: BLE001
problems.append(f"{entry.id}: repo {entry.repo} unreachable ({exc})")
continue
@@ -41,10 +42,10 @@ def test_every_catalog_file_resolves():
problems.append(
f"{entry.id}/{variant.quant}: {asset.path} not in {entry.repo}")
continue
- live_sha = files[asset.path].get("oid", "")
- if live_sha and live_sha != asset.sha256:
+ live_size = files[asset.path]
+ if live_size and live_size != asset.size_bytes:
problems.append(
- f"{entry.id}/{variant.quant}: sha drift on {asset.path} — "
- f"catalog {asset.sha256[:12]} vs live {live_sha[:12]} "
- f"(upstream re-uploaded; re-pin deliberately)")
+ f"{entry.id}/{variant.quant}: size drift on {asset.path} — "
+ f"catalog {asset.size_bytes} vs live {live_size} "
+ f"(upstream re-uploaded; refresh the size deliberately)")
assert not problems, "\n".join(problems)
diff --git a/tests/hermes_cli/test_catalog_variants.py b/tests/hermes_cli/test_catalog_variants.py
index ed7e8beb068..6b775a4295e 100644
--- a/tests/hermes_cli/test_catalog_variants.py
+++ b/tests/hermes_cli/test_catalog_variants.py
@@ -30,7 +30,7 @@ def test_variants_ordered_best_first_and_floor_is_q4():
assert sizes == sorted(sizes, reverse=True), f"{entry.id}: variants not best-first"
for v in entry.variants:
for asset in entry.download_files(v):
- assert len(asset.sha256) == 64, f"{entry.id}/{v.quant}: unpinned {asset.path}"
+ assert asset.size_bytes > 0, f"{entry.id}/{v.quant}: no size on {asset.path}"
# The quality floor: the ladder ends at Q4 — no Q3/Q2 builds ship
# (product decision, 2026-08-09). Every floor rung is either
# validated on real hardware or an explicit day-0 entry.
diff --git a/tests/hermes_cli/test_local_models_routes.py b/tests/hermes_cli/test_local_models_routes.py
index 51f8134c4b6..aaecc9d9040 100644
--- a/tests/hermes_cli/test_local_models_routes.py
+++ b/tests/hermes_cli/test_local_models_routes.py
@@ -124,9 +124,11 @@ def test_download_unknown_model_404s(client):
assert r.status_code == 404
-def test_download_job_lifecycle_with_sha_failure(client, monkeypatch):
- """Wrong-hash download must delete the file and error the job with a
- human-readable message — never leave a corrupt GGUF staged."""
+def test_download_job_short_body_errors_and_cleans_up(client, monkeypatch):
+ """A download that delivers fewer bytes than the file's size must error
+ the job and leave nothing staged — with no hash check (product
+ decision: no download-time integrity verification), the byte count is
+ the only remaining wrong-file tripwire, so it must hold."""
class FakeResponse(io.BytesIO):
headers = {"Content-Length": "16"}
@@ -167,7 +169,7 @@ def test_download_job_lifecycle_with_sha_failure(client, monkeypatch):
break
time.sleep(0.05)
assert status is not None and status["status"] == "error"
- assert "integrity" in status["error"].lower()
+ assert "bytes" in status["error"].lower()
from hermes_cli.local_runtime.bootstrap import models_dir