#1 [high] Change shape: RevisionLookupError wrapper, private, error-path only
PR #603, head a3ec4b6, one file flare/src/hub.rs (+41/-1).
New type at flare/src/hub.rs:3398-3419:
#[derive(Debug)]
struct RevisionLookupError {
repository: String,
revision: String,
source: Box<dyn std::error::Error>,
}
impl std::fmt::Display for RevisionLookupError {
fn fmt(&self, formatter) -> ... {
write!(formatter, "cannot resolve {}@{}: {}", self.repository, self.revision, self.source)
}
}
impl std::error::Error for RevisionLookupError {
fn source(&self) -> Option<&(dyn std::error::Error + 'static)> { Some(self.source.as_ref()) }
}
Guard inside resolve_primary_target, flare/src/hub.rs:3427-3441:
let info = resolve_revision(api, repo, progress).map_err(|source| {
if matches!(
source.downcast_ref::<ApiError>(),
Some(ApiError::RequestError(error))
if matches!(error.as_ref(), ureq::Error::StatusCode(404))
) {
Box::new(RevisionLookupError { repository: repo.url(), revision: repo.revision().to_owned(), source })
} else { source }
})?;
Type alias: type Result<T> = std::result::Result<T, Box<dyn std::error::Error>> (hub.rs:29) — matches Box, so the struct need not be Send/Sync; controllers stringify (flare-cli/src/orbit/agent.rs:135 .map_err(|e| e.to_string()), controller.rs:1308 return Err(error.to_string())).
Earlier retry/fallback decisions happen inside resolve_revision (hub.rs:3374-3396) before the wrap, so retry+-tp1 logic is untouched. Type-based branching on ApiError exists ONLY at hub.rs:3429 (verified: search_code downcast_ref shows no other ApiError downcast), and only PublisherKeyRequired drives retry (controller.rs:1302-1334, flare-cli/src/hub.rs:72-90) — so the wrap cannot change control flow. Error path only: no locks, no allocations on hot path, no shared state. Concurrency/systemic risk: none. No panic possible.
Note: Display prints the inner error without the source() chain, so full chain is only visible to walkers; nothing in the repo walks it (search for .source() in flare-cli/src: no matches).
#2 [high] Duplicate/conflicting message: update check reports same repo@revision differently
flare/src/hub.rs:2276-2280 (unchanged by PR):
let revision = requested.revision.as_deref().unwrap();
log::info!("Checking model origin: {}@{revision}", origin.repository);
let repo = Repo::with_revision(origin.repository.clone(), RepoType::Model, revision.into());
let info = resolve_revision(&api, &repo, None)
.map_err(|error| format!("cannot check {}@{revision} for updates: {error}; the local version is unchanged (use --offline to skip the check)", origin.repository))?;
Impact: for a 404 on the same resolve_revision helper, flare download/run now says "cannot resolve ORG/NAME@rev: ... 404", while the recorded-origin update check says "cannot check ORG/NAME@rev for updates: RequestError(StatusCode(404)) ...". Two different headline messages for one failure mode; #603 is the second PR abutted by #489's reviewer (original-el8, 2026-11-28, item 3: "should wrap like :1620"). The PR body scopes this away ("The resolver completes its existing retry and -tp1 fallback decisions before the diagnostic adds context") but does not state why the sibling call site is excluded.
In-repo proof the asymmetry persists: test model_refresh_failed_update_keeps_default at flare/src/hub.rs:6358-6390 scripts 404 for both /revision/gb10 and /revision/gb10-tp1 and asserts only error.contains("--offline") — it never asserts the repository/revision, and would still see the bare RequestError(StatusCode(404)).
Fix: either wrap in resolve_revision itself (covers all three call sites: resolve_primary_target hub.rs:3427, refresh_model_at hub.rs:2279, and leaves RevisionClient::revision hub.rs:2130-2151 separate) keeping retry/alias logic inside, or add a second RevisionLookupError in refresh_model_at and drop the duplicated prefix text. Severity: Major.
#6 [high] Research summary
Reviewed PR #603 (flare/src/hub.rs only, +41/−1) for correctness, system-level consequences, contracts and test/claim accuracy, opening the changed function, all three resolution call sites, the console/orbit consumers, docs contracts and the tests in full context.
Sound in most areas. The change is error-path only: a private RevisionLookupError (hub.rs:3398-3419) wrapped around resolve_revision in resolve_primary_target (hub.rs:3427-3441) when and only when the error is ApiError::RequestError(ureq::Error::StatusCode(404)). Retry and -tp1 fallback happen inside resolve_revision (hub.rs:3374-3396) before the wrap, so ordering and decisions are preserved. No locks, allocations, shared state, buffering or cancellation semantics are touched; grep confirms ApiError is never downcast anywhere else, and only PublisherKeyRequired drives control flow (controller.rs:1302-1334, flare-cli/src/hub.rs:72-90), so failure-propagation blast radius is unchanged. No panic path, no platform asymmetry (the Unix/Windows split at hub.rs:844-870 is untouched), no public/wire/captured-graph contract change and no per-model branch. Charter-compliant footprint.
One Major finding: the same defect is reported two conflicting ways. refresh_model_at (hub.rs:2276-2280) calls the same resolve_revision and still formats its own cannot check {repo}@{revision} for updates: {error} while leaving the bare RequestError(StatusCode(404)) unwrapped — and the existing test for it (hub.rs:6358-6390) asserts only contains("--offline"), so the asymmetry persists untested. Fix: wrap inside resolve_revision so all call sites share one message, or add the same wrap at hub.rs:2279 and drop the duplicated prefix.
Minors: (1) the status-only guard also fires for gated/private repositories, which the Hub answers with 404, so the message can name a revision that exists while the real problem is credentials; the disambiguating token log (hub.rs:3344-3348) is info-level while the error goes to stderr. (2) The new assertion is bolted into permanent_resolution_failures_are_not_retried (hub.rs:8619-8622) rather than a dedicated test, and only pins the substring 404, not the "retains HTTP 404" wording the PR description claims (the rendered <ureq::Error as Display> text could not be verified in-repo). (3) No doc or docs/TODO.txt entry for the new operator-facing message, which is the gap #489's reviewer explicitly asked to be recorded, and #603 never cites its sibling's instruction.
Verdict: correct, minimal, low-risk diagnostic; the substantive issue is uneven application across resolution call sites, not the wrapper itself.
#7 [high] Consolidated findings with severity, quotes, impacts, fixes
Lens: Correctness, Contracts & System-Level Consequences. Basis: full read of the diff, resolve_revision/resolve_primary_target/refresh_model_at, all callers (hub.rs:434, 2279, 2130-2151 / acquire_watched 13910, acquire_update 13941, refresh_model 13971), consumers (flare-cli/src/hub.rs:30-153, flare-cli/src/orbit/agent.rs:115-141, flare/src/controller.rs:1279-1338, flare/src/application.rs:313-339, flare-cli/src/main.rs:60-68, 435-450), tests (hub.rs:8572-8625, 6358-6390, 12630-12700), docs (cli-design.md:893-990, multi-host.md:536-553), AGENTS.md:52-60, 515-520, .agents/skills/repo-prose/SKILL.md.
FINDING 1 — Major — uneven application; two conflicting messages for one failure
flare/src/hub.rs:2276-2280
let revision = requested.revision.as_deref().unwrap();
log::info!("Checking model origin: {}@{revision}", origin.repository);
let repo = Repo::with_revision(origin.repository.clone(), RepoType::Model, revision.into());
let info = resolve_revision(&api, &repo, None)
.map_err(|error| format!("cannot check {}@{revision} for updates: {error}; the local version is unchanged (use --offline to skip the check)", origin.repository))?;
Impact: the recorded-origin update check reaches the same resolve_revision helper but still flattens the bare 404 into a String, so flare run on an installed model says "cannot check ORG/NAME@rev for updates: RequestError(StatusCode(404)) …" while flare download says "cannot resolve ORG/NAME@rev: …". Same failure, two vocabularies; the operator still cannot tell which status applies. Untested: model_refresh_failed_update_keeps_default (hub.rs:6358-6390) scripts 404 for both /revision/gb10 and /revision/gb10-tp1 but asserts only error.contains("--offline").
Fix: move the wrap into resolve_revision (keeping retry and -tp1 logic inside, i.e. wrap only the terminal arm), or add the identical wrap at :2279 and drop the duplicated cannot check …@… prefix.
FINDING 2 — Minor — 404 also means private/gated; message asserts a reference the user may have right
flare/src/hub.rs:3427-3441 guard is status-only. Hub answers 404 (not 401) for a private/gated repository on an unauthenticated request. The disambiguator exists but is info-level: hub.rs:3344-3348 None => { log::info!("Connecting to Hugging Face without an access token; authenticate with \hf auth login`, `HF_TOKEN`, or `--token-file` for higher rate limits") }, while the error itself goes to stderr via flare-cli/src/main.rs:64 eprintln!("Error: {error}"). Impact: with no token the new text points the operator at the revision when the fix is hf auth login`. Docs already treat this as a distinct condition (cli-design.md:948 "otherwise unauthenticated").
Fix: add a credentials clause to the Display/wrap when no token was resolved, e.g. "cannot resolve ORG/NAME@rev: … 404 (not found, or not authorized for the current credentials)". Keep the wrap status-only.
FINDING 3 — Minor — test placement and weak assertion
flare/src/hub.rs:8619-8622
assert!(error.contains(&status.to_string()), "{error}");
if status == 404 {
assert!(error.contains(&format!("owner/model@{revision}")), "{error}");
}
Impact: the new diagnostic has no test of its own; it is asserted inside permanent_resolution_failures_are_not_retried (contract = retry behavior). It does genuinely cover two 404 rows (gb10-tp1 after the alias attempt, and custom), and the 401 row proves the wrap is status-gated, so coverage exists. But only the substring "404" is pinned, not the "retains HTTP 404" wording the PR claims, and the error chain (Error::source, hub.rs:3415-3419) is never asserted although nothing in the repo walks it (no .source() in flare-cli/src). Path is exercised only via #[cfg(test)] fetch_primary (hub.rs:3353-3361), not through the real CLI entry.
Fix: split into a dedicated revision_lookup_failure_names_the_reference test asserting the full prefix cannot resolve owner/model@gb10: and that the source chain yields the 404; add the same assertion to the refresh test.
FINDING 4 — Minor — no record of the defect where the repo requires it
AGENTS.md:57-60 "Record unresolved defects, unrun checks, and pending measurements in docs/TODO.txt"; docs/TODO.txt has no 404/revision entry (only unrelated :306). docs/cli-design.md:920-932 stops at "tries the corresponding -tp1 revision if the initial revision lookup returns HTTP 404" and does not specify the message; docs/multi-host.md:536-553 Failures table has no row for it. #489's reviewer (original-el8, 2026-11-28, item 3) asked for exactly this: "The bare HTTP 404 reporting gap … is an unresolved defect and belongs in docs/TODO.txt" and "should wrap like :1620". #603 addresses the code half and references neither the instruction nor #489's TODO ask.
Impact: the operator-facing string becomes a de-facto contract with no specification and no tracked close condition.
Fix: either add the docs/TODO.txt entry and the multi-host Failures row, or state in the PR that the TODO entry is being handled separately — and cite #489 so the reviewer can see the instruction is satisfied.
CLAIM-ACCURACY NOTES (no separate severity; disclose, do not invent)
- PR: "The message retains HTTP 404 without assigning a cause to that status." The "404" text is rendered by
<ureq::Error as Display>, and ureq is a transitive dep of hf-hub (flare/Cargo.toml:27, feature "ureq"); the root Cargo.lock is not readable here, so the exact rendering ("HTTP status 404" vs "http status: 404") could not be verified in-repo. The test pins only "404". Treat the wording claim as unverified rather than wrong. - PR: "On Linux ARM64 … the strengthened HTTP fixture test failed on the baseline because the 404 lacked owner/model@revision" — consistent with the diff; no CI on a3ec4b6e (author's evidence only).
- Disclosed and correct: the temporary checkout realigned the Flare lockfile to the
deepseek-reciperevision pinned by Helios (root lockfile outside the change), and the full Orbit CLI workflow was not run — which is precisely the path (hub.rs:13941 acquire_update → :2279 refresh/update) that Finding 1 concerns.
AREAS CHECKED AND SOUND (state plainly)
- No concurrency, lock/mutex, queue, buffering, memory-amplification or hot-path effect: acquisition resolution is off the serving path, error branch only, one String clone of
repo.url()and one ofrepo.revision()on a failing request. - No ordering hazard: retry (
with_transient_retry, hub.rs:5476-5493) and-tp1fallback (hub.rs:3381-3392) complete before the wrap;RevisionClient::revision(hub.rs:2130-2151) has its own equivalent fallback, untouched. - No platform asymmetry: the Unix/Windows split (hub.rs:844-870, 1755-1843) is not touched.
- No public/wire/captured-graph/cache-format contract change; type is private,
Result<T> = Result<T, Box<dyn std::error::Error>>(hub.rs:29) matches, control flow keyed onPublisherKeyRequiredis unaffected. - No owner sign-off requirement applies (search "sign-off"/"owner" in AGENTS.md and docs: no matches); not a per-model branch, no new flag, no dependency change.
- No metric/rate/admission-pricing sampling change (the AcquisitionProgress counters at hub.rs:5446-5548 are untouched); the change does not shrink or widen any measured span.
#3 [medium] Diagnostic specificity gap: 404 conflates missing ref with private/gated repo
flare/src/hub.rs:3427-3441, status-only guard. ApiError::RequestError(StatusCode(404)) is raised by hf-hub (flare/Cargo.toml:27, hf-hub 0.5) both for a missing ref/repo AND for a gated/private repository when the request is unauthenticated (Hub returns 404 rather than 401 to avoid disclosing private repo existence). Verified in-repo that the codebase itself treats unauthenticated access as a distinct condition: docs/cli-design.md:948 documents "HF_TOKEN, ... otherwise unauthenticated", and flare/src/hub.rs:3344-3348 logs "Connecting to Hugging Face without an access token; authenticate with hf auth login, HF_TOKEN, or --token-file for higher rate limits".
After the change an operator with no token who typo'd nothing sees cannot resolve ORG/NAME@gb10: ... 404, which the PR body equates with "which reference the agent attempted to resolve". The message names a revision that may exist; it does not distinguish "revision absent" from "repository not visible to this credential".
Mitigation the PR already has: the token-precedence log lines (hub.rs:3334-3348) fire in the same run, but they are log::info! and any non-info filter hides them, while the error line is eprintln at flare-cli/src/main.rs:64.
Fix: keep the wrap status-only (correct, as the PR intends), but add one clause in the Display or in the wrap site when no token is in play, e.g. via the already-computed token(options) result, saying the reference was not found or not authorized for the current credentials. Severity: Minor (accuracy of the diagnostic, not of behavior).
#4 [medium] Test coverage: new assertion bolted onto permanent_resolution_failures_are_not_retried
Test change is flare/src/hub.rs:8619-8622, inside existing for (revision, status) in [("gb10", 401), ("gb10-tp1", 404), ("custom", 404)] loop (hub.rs:8601-8625):
assert!(error.contains(&status.to_string()), "{error}");
if status == 404 {
assert!(error.contains(&format!("owner/model@{revision}")), "{error}");
}
(a) It is inside a broader test (permanent_resolution_failures_are_not_retried) whose contract is retry behavior; the new diagnostic has no test of its own, but the assertion is genuinely exercised for two of the three loop rows and asserts repo@revision, so coverage of the new path exists (both plain custom and post-alias-attempt gb10-tp1).
(b) Row ("gb10", 401) never reaches the wrap, so the 401 path is provably untouched — good.
(c) Not asserted anywhere: the new message still contains HTTP 404 (the 404 text comes from Display for ureq::Error, which prints "http status: 404" in ureq 3.x) — only the bare status.to_string() "404" is asserted, which would also pass for an unrelated 404 elsewhere in the string.
(d) Missing test: the sibling 404 site refresh_model_at (hub.rs:2279) and RevisionClient::revision (hub.rs:2130-2151) have no repo@revision assertion; see model_refresh_failed_update_keeps_default hub.rs:6358-6390 which only asserts contains("--offline").
Fix: split the diagnostic out of the retry test into revision_lookup_failure_names_the_reference, and add the assertion to the refresh test. Severity: Minor.
#5 [medium] Charter/contract compliance: compliant; docs + TODO + claim-accuracy gaps
Charter/contract review of #603:
- No wire/proto/captured-graph/cache-format surface changes:
RevisionLookupErroris private (flare/src/hub.rs:3398), no public signature changed,acquire_watched/refresh_model/download_watchedsignatures untouched (hub.rs:248-320, 13910-14001). NoDesign-Signed-Off-By/owner-sign-off requirement found in AGENTS.md (search "sign-off": no matches). Not a per-model branch; no new flag; no dependency change. Charter-compliant on layer and footprint. - Docs contract gap (Minor, process): the operator-facing message is now a stable string but appears in no doc. docs/cli-design.md:920-932 specifies the
-tp1retry and stops there; docs/multi-host.md:536-553 Failures table has no 404/revision row. AGENTS.md:512-520 keeps follow-ups in docs/TODO.txt, which has no entry for this defect (search 404|Hub revision|resolve in docs/TODO.txt → only unrelated :306). - Process/record gap (Minor): the only prior reviewer direction on this exact defect is original-el8's CHANGES_REQUESTED on #489 (2026-11-28, item 3): the bare 404 is "an unresolved defect and belongs in
docs/TODO.txt", and "should wrap like:1620". #603 discusses neither the TODO entry nor the wrap location, and #489 still does not reference #603. #603 has zero human review and no CI on a3ec4b6. - PR body claim check: "Strengthened HTTP fixture test failed on the baseline because the 404 lacked owner/model@revision" is consistent with the diff. "The message retains HTTP 404" — the inner text comes from
<ureq::Error as Display>; ureq is a transitive dep of hf-hub (flare/Cargo.toml:27, feature "ureq"), the root Cargo.lock is not searchable here, so the exact rendered wording ("HTTP status 404" vs "http status: 404") could not be verified; the new test only asserts the substring "404" (hub.rs:8619), which does not pin the wording. Not a blocker, but the claim is unverified in-repo. - "The complete Orbit CLI workflow was not run" is disclosed; the strengthened assertion is exercised only through
fetch_primary(hub.rs:3353-3361) which is#[cfg(test)].