Catalog reindex fails closed when embeddings are unavailable, leaving artifact discovery stale
$## Summary\nlibrarian(action="reindex") fails completely when its embedding backend is unavailable. Catalog classification and artifact discovery are then left stale even though they do not inherently require embedding vectors.\n\n## Reproduction\n1. Configure an embedding backend that cannot accept requests.\n2. Run librarian(action="reindex").\n3. Create or modify tracker/bug markdown files.\n4. Run the normal artifact discovery query.\n\n## Actual behavior\nReindex returns the embedding transport error before refreshing the catalog. Newly created or changed artifacts can remain absent from canonical artifact(action="find", ...) queries. The caller may receive an unindexed_files hint, but there is no durable, prominent indication that catalog results are stale because the last refresh failed.\n\n## Expected behavior\nCatalog scanning/classification/frontmatter updates should complete independently of vector embedding. Embeddings may be queued or retried separately. If any refresh stage fails, subsequent artifact queries should explicitly state the last failed refresh time/stage and that catalog completeness is degraded.\n\n## Related status problem\nIndex-health surfaces can disagree: one surface may report no semantic index while another reports indexed or up-to-date data. These should derive from one authoritative state model that distinguishes catalog freshness, embedding freshness, and queryability.\n\n## Suggested acceptance criteria\n- With an unavailable embedder, a reindex still discovers and classifies new artifacts.\n- Embedding failure is recorded as a distinct degraded state rather than silently preserving an apparently normal catalog.\n- artifact(action="find") exposes a machine-readable and human-readable stale-catalog warning.\n- Status surfaces agree on the state of catalog and semantic indexes.\n\n## Impact\nTriage and tracker discovery can omit live artifacts while returning otherwise plausible results.
Fixed — all four of your acceptance criteria, which were specific enough to implement against directly.
Fixes: 69e78a2f (patch-id 139205fb275ae4ec0329d5816a0ba4be243e9a6e) — collect embed failures instead of aborting the target loop; 050ec61a (3676e85cd8937241edf5079cefff20eceb1cd3d1) — persist a durable degraded marker; 3207819b (b997adbbce0f8c3ba60af36aa351f66256a315d8) — make the status surfaces agree.
Against your criteria:
- Discovery + classification survive a dead embedder.
reindexcallsindex_repo_syncper target; that function walks, upserts artifact rows and collects an embed queue — it never embeds, so an embedder outage cannot reach it. The embed block is downstream and gated. - Embedding failure is a distinct degraded state. Per-item errors are collected rather than
?-propagated, then written tocatalog_metaaslast_reindex_embed_error_count+ a 20-capped sample — including on a clean run, so a repaired embedder un-degrades rather than leaving a stale marker. The response carriesembed_note: "DEGRADED: {n} embedded, {m} failed. The catalog is refreshed and doc(action=\"find\") is accurate, but the failed artifacts have no vector…". findexposes the staleness both ways. It reads that marker back and insertshints.catalog_degraded(a number, machine-readable) alongsidecatalog_degraded_hint(prose naming reindex as the fix). Not scope-gated.- Status surfaces agree.
semantic_searchreads the sync state and stampsindex_degraded_noteon both return paths, rendered head-placed so truncation cannot cut it.
Tests: an_embed_failure_still_walks_every_target_and_reports_it, an_embed_failure_persists_a_durable_catalog_meta_marker, a_clean_reindex_after_a_failure_clears_the_persisted_marker, catalog_degraded_hint_appears_after_a_persisted_embed_failure_then_clears, index_skip_note_fires_only_when_the_last_sync_actually_skipped.
One residual path, stated because it is exactly your criterion 2 in a corner: if the embedder fails to construct (rather than failing per-request), it collapses to "no embedder configured" — embed_note then renders 0 embedded with embeddings_enabled: false and no DEGRADED signal at all. This is reachable only where construction touches the network, i.e. the ollama: backend, which probes on connect. A url:/openai: backend — your configuration — constructs without probing, so a dead remote embedder does land in the collect-and-report path. Discovery works either way; only the degraded signal is missing on that one path.
Internally: docs/issues/archive/2026-08-26-catalog-reindex-fails-closed-on-embedding-error.md.