Skip to content

Responses served from a fallback say so in degraded, and ops.incidents lists current incidents - #2047

Merged
zlareb1 merged 55 commits into
mainfrom
feat/degraded-signal
Dec 4, 2026
Merged

zlareb1 merged 55 commits into
mainfrom
feat/degraded-signal

Conversation

@zlareb1

@zlareb1 zlareb1 commented Dec 2, 2026 •

Copy link
Copy Markdown
Member

Part of: #2040

Changelog category (leave one):

  • New Feature

Changelog entry (one or two sentences a user of Loom can read without the diff; the release pull request collects these into the release notes):

Responses served from a fallback or a partial read name it in degraded (provider: effect (kind)), over HTTP and MCP, and leave the key out when nothing was noted. The transports add a request's notes to every op's response; the ops whose fallbacks note are listed below. The new ops.incidents op lists the failing readiness checks, providers and workers and the caller's org's server-side failure rate, for a client to poll. A memory.bulk_set whose live-row lookup fails now refuses with a retryable 503 (BACKEND_UNAVAILABLE, or the store's own code) and writes nothing, instead of writing the batch as if no key existed; memory.append_batch, which refused such a batch with a 422 VALIDATION_FAILED that a client does not retry, answers the same retryable error. Other behaviour changes: code.symbol_history answers tracker_unavailable when its tracker side fails, more review briefs are served unstored (stored: false), an answer from LOOM_LLM_FALLBACK_MODEL is no longer cached or stored as a precedent, a duplicate check that fell back or could not verify a tracker is no longer reused by code.bisect_candidates, a code.search whose literal read reached its bound is no longer memoised, and the unknown outcome of the loom.memory.writes metric is removed.

Why

Item 3 of the issue: clients could not tell when Loom was degraded. In three windows, 40% to 100% of calls failed (one window: 1,618 of 1,618), and reviews made without Loom looked normal.

  • Failing cases. The MCP lean pass stripped degraded at every depth (DIAGNOSTIC_KEYS). Only three output models declare the field (memory.set, memory.search, memory.set_from_messages), so a note recorded by any other op was dropped: memory.delete_version's deferred check, memory.webhook's not_announced, the run claims and write fence, and the searches inside context.pack. Read handlers in the code and memory planes served a smaller answer and noted nothing at about 150 places. No op reported incidents: /v1/health is a route rather than an op, and the 1,618-of-1,618 failure rate existed only in loom_telemetry.sli_minute.
  • Pattern. The signal existed (server/observability/degradations.py), but it reached a response only when the model declared the field and the handler copied it. MCP then deleted it. Nothing read the incident state for a client.
  • Change. The transports attach the request's notes to every response. The code and memory read fallbacks record notes. A new op reads the incident state.

Scope and risk

  • Transport. degradations.on_response(body) merges the op's own degraded with the request's notes, each once, the op's own first. It removes the key when the list is empty. It runs on HTTP in arg_check.response_body. On MCP it runs in mcp_op_result after the lean pass, in _success_response (the replay and explain shapes) and in _search_answer. loom_search also ends its text with a Degraded: line, because clients that read only the text block would otherwise miss it. The lean pass keeps a non-empty top-level degraded and drops the copies inside sections, so an MCP idempotent replay serves the list its first answer stored, as the HTTP replay does. The per-model fields stay, because in-process readers use them (_record_gap_miss, the unsettled count in loom_search).

  • One field. degraded is the one field a client checks, without knowing each op's own disclosure fields. A fallback the op also reports in its own fields (an abstain reason, skipped, a partial_reason, a *_failed count in retrieval_work, a section's failed, an unknown verdict, a block's note) is listed in degraded too, and the op's own field is unchanged. tests/unit/test_degraded_unnoted.py checks this for every broad except (Exception, BaseException or bare), every except TimeoutError (or asyncio.TimeoutError) and every handler of a gateway's refusal for the caller (ModelCallRefused, or its ModelCallDeferred; found in review) in server/code/app, server/memory/app, server/knowledge/app, server/tracker/app and server/llm, and for every exception branch over an asyncio.gather(..., return_exceptions=True) result there: the exception side of an if or conditional expression that tests isinstance(x, Exception) or isinstance(x, BaseException), and a comprehension that filters the failures out, which always counts as un-noted. Of server/code/app/index/, the test scans the 38 modules the scanned apps import from outside that package and those these import in turn, read from their imports so a new one is scanned too. It stops at the ingest pass that code.refresh and the ingest worker run (ingest_pass, pass_stream, entry_lock, erasing) and the per-file ingest only that pass calls (ingest, its stages, round_reads, pass_fetch, the compiler tier, dependents, descriptions and embedding reuse: bootstrap imports them for index_slice, which only ingest_pass runs), which write the index and whose notes reach no answer, like the workers and stores, which are other packages. A site passes when it always raises (a raise under an if does not count), calls degradations.partial, note or restore, calls a function of the same module that does (_leg_error in loom_search), or keeps the failure's text for the answer with caller_text(e): a kept failure noted on each answer served from it, or a failure field of the response. Every other site is listed in tests/unit/degraded_unnoted.txt as path::function::ordinal category, path::function::timeout::ordinal for a timeout handler, path::function::refused::ordinal for a refusal handler, or path::function::gather::ordinal for a gather branch. The test fails on a site in neither place, and on an entry that no un-noted site matches, so the list only shrinks; a noted_by_caller entry without the comment that says where the caller notes fails too, and so does an answer entry without its reason. Before its fixes below, the gather rule found code.setting_facts' reads, code.blame_range's enclosing function and review comments, code.symbol_history's issue facts and tracker side, memory.for_file's other namespaces and loom_search's tracker namespaces, and more. Of 939 broad handlers, 61 timeout handlers, 1 refusal handler and 28 gather branches, 569 sites pass and 460 are listed: 169 write, 100 logged_only_nonanswer, 66 telemetry, 31 full_answer_fallback, 29 cache_fallback, 22 fail_closed (a security or privacy check that cannot be read refuses, as it does when it refuses: a crawl authority, a caller's ownership, an erasure ledger, a damaged stored namespace map; and the mirror reads below that run only for candidates or admitted documents), 18 noted_by_caller (the caller names the fallback from what the handler returns, in degraded or in its own field such as overlay_note, and the line says where), 16 settings, 8 deadline (a timeout of what is left of the caller's deadline_ms or budget: the budget working, below) and 1 answer (what the handler returns is the answer itself, not a fallback, and the line says why). The index modules hold 93 of those sites; 47 are listed. By dir: server/code/app 321 sites (111 listed), server/memory/app 511 (254), server/knowledge/app 115 (59), server/tracker/app 66 (21), server/llm 16 (15). The scan reads each handler and gather branch on its own, so it does not see a result tested in another function, asyncio.wait, an isinstance filter that keeps the successes, an exception test inside a BoolOp, a handler of another narrow exception (a GitError, a ValidationError), or which call of a noting helper runs; the test's docstring says so. It missed the pick's except ModelCallRefused for that reason: a narrow handler, which kept the ranking for a gateway's 403 or 429 and noted nothing (found in review). The scan now reads refusal handlers too; these dirs hold two, and the other sits in a tuple with TimeoutError, so it was already read as a timeout handler. The budget and own_deadline categories, which no entry used, are gone; deadline lists the timeouts of the caller's own budget the timeout rule found. The decision extractor runs from the CLI and the knowledge source sync, not from an op, so its handlers are logged_only_nonanswer, and its CLI preview carries no degraded. Going through the list added the notes below marked as found by the scan.

  • Each note once. note() skips an entry the request already holds, so the cap of 8 counts distinct notes (two bounded reads that fail alike, or the two declined-call reads, take one place).

  • Provider health. ops.incidents and /v1/health list a provider whose last call failed until a later success clears it. The notes that fed it with nothing to clear them now use partial: write_fence, memory.delete_version, memory.webhook, run_claims, records: projection_skipped and clickhouse: vector_leg_empty, which listed their store fallback as a failing provider to every viewer for the whole window. So do the rerank:openai notes, since the LLM client counts that call. The operator's rerank endpoint (rerank) and Cohere (rerank:cohere) now record a success on a well-formed answer, and Cohere's malformed answer notes as the endpoint's does. A second test in test_degraded_unnoted.py fails on any health-counted note whose provider no record_success clears, so docs/operations/monitoring.md's "a later success clears it" holds for every provider ops.incidents lists.

  • Helpers. degradations.partial(provider, effect, reason) is note with health=False fixed; every read fallback calls it. degradations.unit() isolates a block's notes, like scoped(), and then lists them in the caller's too: inside it current() reads only what the block noted, so a cache gate inside it judges the answer the block built, and the response still names every note. degradations.hold(entries) lists an answer's notes as one group (Held) that the answer's replacement swaps for its own; another holder of the same note keeps its copy, so swapping one group never hides a note a served answer took. current() and restore() read the groups in place, and a unit carries a group it holds to its caller unflattened. A plain note is deduplicated and capped against the request's own notes only, so a group that lists the same note, or fills the cap, and is later swapped empty does not take that note away (found in review; unit() exits through restore(), so this held for every unit). degradations.unkeepable() marks what a unit builds as kept by no cache without listing anything, keepable() is the gate (no note and no mark), and a unit carries the mark to its caller. scoped() yields the block's own list, which restore lists in the caller's with its groups and mark. memory.ask's mirrored attempt restores that list, so a mark set in it (a literal read its code grounding cut) reaches memory.ask's unit and no precedent keeps the answer; restoring current() dropped the mark (found in review). The memory stack's build and a knowledge search's render hold their scoped() list the same way, as it stands, and memory.search's sequential re-read returns its own for the pass that serves it to restore: a group holds notes, inner groups and the mark, so a mark set in the step reaches the caller's unit, an inner group is still the one a later swap changes, and dropping the step takes all of them back; holding or restoring current() flattened both (found in review).

  • Code-read fallbacks noted (all through partial: a store read that failed is not a provider failure, and provider clients record their own):

    • code.review_brief: open head, brief build, brief on miss, mirror facts, an unread diff, the rationale section's decisions and its diff.
    • code.symbol: the uses and mention legs (beside read_failed), declined-call counts, compiler coverage and freshness, indexed paths, constructor coverage, override coverage, override edges, inherited dispatch, hierarchy, neighbours, dependency presence (run only on the dependency namespaces the caller may read, with an unverified grant noted), body hashes, PR context, the uses leg's fan-in.
    • code.coverage_claim and code.test_home: the positive control, SQL name terms, and the sibling, calls and names legs.
    • code.search, and code.ask through it: the risk annotation; the lexical, vector, card, concept, HyDE, definition and history legs (beside their *_failed counts and the history section's failed); the pick model (llm: pick_skipped, also when the gateway refuses the pick for the caller or asks it to wait, a 403 or 429 that provider health does not count; found in review); the fuzzy-symbol vote; fan-in; a track_path read; the query embedder (embedder: query_vector_dropped); the whole-file expansion. A later page names the notes of the run that ranked its pool, and reads its risk block, expansion and index head itself.
    • code.grep: neighbours, the batch pattern scan, related and forwarded definitions (beside their partial_reason). A later page names its scan's notes.
    • code.ask: the question embedding (embedder), synthesis (llm, beside its abstain reason), mechanism expansion, identifier expansion (llm) and memory context.
    • code.pr_check: each leg and the merged-text leg.
    • code.map: the call-graph hubs and the most-called symbols. A render the index head moved past is discarded with its notes; only the served render's reach the response.
    • code.blame_range: unread issue titles, path presence.
    • code.backport_gap: a branch's file presence and ledger backports, the fix's ledger facts.
    • code.bisect_candidates: the fix blame (beside skipped), the rerank (beside its failed status), frame paths, issue edges, the indexed head, cause statements, the duplicate-check fix, the fix's cause, the fusion's vector leg (embed and read), code-history candidates.
    • code.callers (overrides, the PR overlay beside its error reason, the candidate sites beside their note), code.verify_citations (a name lookup), code.conventions (the head placement, extern, category census, wide-callers, coverage, setting history, stateless-number and owner reads, beside their unknown verdicts), code.setting_facts (the control), code.files (the reference sibling), code.history (tracker facts).
    • code.index_status and code.repos: compiler inference, the worker ledger, the table summaries, the directory state, a clone's lag that git could not count over a mirror it cannot read, or whose tip it could not read there when no tip is published (beside lag -1), the calibration check (beside its warning). A lag whose watermark or clone head the mirror does not hold (gitrepo.holds_commit answers False on git's exit 1) is -1 with no note, since the commit may arrive with the next fetch; such a status is kept and published as whole.
    • code.enclosing (sections, decorator extents, a body fetch), code.outline and code.verify (a reference head, a file row, a body span).
    • Found by the scan: code.bisect_candidates (PR records, the merge ledger, named-cause rows), code.blame_range (the branch head), code.verify_citations (error codes, the merge ledger), code.map (the embedder's model name), code.first_build (the merge ledger), code.grep (enclosing bodies, beside definitions_partial; declaration extents; context and source recovery), code.index_status (the state read, code_index: state_unread, so a commit judged against the cached heads says so; the worker registry; commit metadata; coverage gaps), a namespace code.symbol or code.grep presence could not answer (beside its unknown row), onboarding's worker ledger, the repository listing gate (identity: listing_gate_unchecked for a check that could not run, such as a failed SCIM read; a refusal lists the entry request-only with no note), an open brief's items row, code.search's outcome prior, rerank (rerank: input_order_kept), pick client (llm: pick_skipped), symbol bodies and fan-in hubs, code.impact's indexed prefixes, a class outline, co-change ranking.
    • Found by the gather rule: code.setting_facts (the declaration, history, randomizer and tests reads, code_index: setting_<read>_unread, beside the cause code.review_brief answers with a verdict, and the wiring a PR adds and generic test-map suites drop out #2046 names in causes; a failed test count has no cause), code.blame_range (the enclosing function and the review comments, each leaving its half empty, and a merge-ledger read beside the leg's failed), code.symbol_history (the linked issues' facts, and the tracker side), code.bisect_candidates (each fusion window's tracker read and embed, beside the window's status, and a linked tracker's scan), and code.review_brief's build (each section beside its failed section, the function rows, caller counts, fan-in and the PR author; of the reads code.review_brief answers with a verdict, and the wiring a PR adds and generic test-map suites drop out #2046 added, the file rows, the language of a file the PR adds, the wiring callers, the indexed head and the drift read, each beside the section's failed or git_head:unread, and the repository config, read in process, is listed settings).
    • code.symbol_history: a tracker side that raised left the tracker namespace blank, so tracker_unavailable never fired; it now answers tracker_unavailable: true with the cause, and the namespace stays blank since the side did not say which it read.
    • Found by scanning the index modules: code.history and code.blame_range serve each PR without its review comments when that read fails (code_index: pr_reviews_unread). The PR overlay of code.callers, code.impact and the open review brief notes a head it could not place (pr_head_unread) and a name-table chunk it could not read (code_index: overlay_names_unread), which left the overlay binding fewer edges; a changed file whose calls or edges the extractor could not list is counted in overlay_note (N changed file(s) whose calls could not be extracted), where it counted nothing. Like a parse past its limits, or one that raised (which code.review_brief answers with a verdict, and the wiring a PR adds and generic test-map suites drop out #2046 counts), it fails the same way for the same content, so the overlay is kept with that note, its file stays in parsed, and degraded does not list it; a second parse that fails is the machine's, and code.review_brief answers with a verdict, and the wiring a PR adds and generic test-map suites drop out #2046 counts that file as not reached. A commit's coverage (code.index_status commit=, the at_commit reads, the history bound) notes an ancestry, commit-count or changed-path read git could not answer (git_mirror: ancestry_unread, commits_since_unread, paths_since_unread), where it answered unknown or -1. A history read on a host whose clone failed notes git_mirror: clone_failed (<reason>) beside its no_git_mirror gap; one still cloning notes nothing. A failed read of the self-service registry, which keeps the last snapshot, notes code_index: registry_unread, so a code.repos listing served from it says so. code.repos' fork lookup notes code.repos: fork_upstream_unread on each answer served from a failed lookup it keeps. code.context_pack's task briefing notes a section that failed (code_index: task_pack_section_dropped). The review brief's risk section reports a failed fit read as risk_failed (risk_fit.stored_fit raises), where it answered no_fit.
    • Shared steps: a failed enrichment read, code lessons (the scope read, a failed file read, and a lesson path or file read cut within the fixed bound), the as_of freshness block, the repository gate of loom_search's repository legs (identity: repo_gate_unchecked when the check raises, identity: repo_gate_unverified when the grant cannot be read, identity: repo_registry_unread before the process has read the repository registry), and the namespaces Loom adds on its own (below).
  • Tracker facts noted. The binding gate (binding._gated) answers for every tracker linked to a code namespace. When the grant cannot be read and the caller did not name the tracker, it notes identity: tracker_unverified; when the gate raises, it notes identity: tracker_gate_unchecked (<kind>). Neither names the namespace. That covers:

    • code.history's tracker facts, code.blame_range's tracker side, code.symbol's history, and code.bisect_candidates' other linked trackers;
    • memory.ask's tracker facts, which also note memory.ask: tracker_facts_dropped when the facts read fails, and its record route, which notes memory.ask: record_tracker_unread (<kind>) for a linked tracker it could not read, beside the answer's Not read line;
    • the trackers a tracker.* search reads beside the addressed one (linked_trackers).

    The duplicate check's fan-out (_may_read_tracker) notes the same way. It now marks or notes only when no way in admits the tracker, so a standard tracker whose own grant is unread but whose repository the caller reads is listed with no note. tracker.test_signal's churn on the deployment's default code namespace notes identity: churn_unverified and identity: churn_gate_unchecked. code.repo.remote_branches notes identity: branch_namespace_unverified for an indexed branch whose namespace it leaves unnamed. A tracker or namespace the caller named still marks the request the server's, as before.

  • Memory-read fallbacks noted (through partial as above; the embedder and LLM clients record their own failures):

    • memory.search: the term leg (beside failed), row tags (beside tags_unread), unit bodies, an unreadable page blob, the hard tag belt (beside its unverified count), the chunk, lexical, records, unmatched, session-summary, entity-summary, current-state and profile legs; recency backfill, set chunks, set expansion and sub-query embeds; the anchor pool, digest descent, key match, tiers, aggregates and temporal diffs; code links and entity aliases; the LLM query aids (the judge and the derived-intent call, failed or past their fixed bound; query entities; verb synonyms); the narrowed page, scratchpad, usage, source bodies and successors; the pending-extraction count. A later page names its ranking's notes.
    • memory.ask: each completion leg, knowledge, the mention window, decisive chunks, identifier rows with their latest word and ranking, PR history and the items fallback, dated turns, code grounding (symbol, search, PR facts, staleness, the PR temporal gate), raw and pending evidence, the run scratchpad, trusted rows, the supersession mask.
    • memory.get and memory.for_file: code links, the canonical row, the caller's other namespaces (failed, or past _OWN_ROWS_SECONDS).
    • context.pack: startup recall, authors, each optional section, the runs manifest, the knowledge scope, namespace health.
    • Found by the scan:
      • memory.search: graph expansion, triple matches, recent seeds, the reinforcement fold, entity boosts, chunk windows, HyDE, query spellings, the mention boost, entity aliases, term scores, BM25 weights, a tier row, a parked row, duplicates and their canonicals, relative dates, the next page handle, the reranker config, and the read-your-writes check and its sequential reads. A failed re-read is noted after its scoped() block, which drops the notes of a re-read that is not served.
      • memory.ask: decomposition and each part, compound parts and entity follows, query intent and options, time cues and dated turns, literal turns, identifiers and their chase, bridge and completion rows, code grounding and PR facts, deep selection, pending evidence, the consistency and premise checks, grounding scores, the synthesis route.
      • memory.set_from_messages: the judge, the durability check, relation backfill, the coverage sweep, ontology warnings, forget candidates, the echo and stored-fact checks.
      • Found by the gather rule: memory.for_file's other namespaces (memory.for_file: other_namespaces_dropped), and loom_search's tracker namespaces whose search raised or answered unavailable, and its duplicate check answering unavailable (loom_search: tracker_dropped). memory.ask's pending evidence notes a malformed batch it skips (memory.ask: pending_batch_dropped). The knowledge leg of loom_search notes through _leg_error in the handler itself.
      • The bulk write's conflict check (memory: conflict_unchecked; unchecked counts only the checks past the cap), memory.set's verdict peers and classifier config, memory.get's served figures, memory.recall's next cursor, memory.restore's Undo record, memory.export_evidence (a cursor that does not decode restarts at the first page), memory.stack (profile, procedures, knowledge), context.pack (decision records, each optional renderer, the checked pack's knowledge and stack sections), loom_search (the namespaces an all_mine search could not resolve, and the profile leg, which now carries error as the other legs do), facts.traverse and facts.path (the graph write marks), procedure.match (an unreadable namespace's rows), procedure.locate (failure notes), conflicts.resolve (the review count), session.brief_save (a window revised without the model, after a failed call, which re-raised only for a switched-off org, or a rejected reply), and the knowledge search's widened hits.
    • loom_search (repository decisions, the tracker leg, and the memory, knowledge and conversation legs beside their error), facts.traverse (the hub policy, communities), namespace.snapshot (the type registry), procedure.match (the goal axis), memory.proposals (usage), memory.stack (knowledge), memory.inspect (each section beside skipped), ops.projection_failures.retry (a failed retry beside its error).
  • Knowledge, tracker and LLM fallbacks noted (found by scanning those dirs and the timeout handlers, unless marked):

    • Every model call through LOOM_LLM_FALLBACK_MODEL's wrapper, memory.ask and code.ask synthesis among them: an answer the fallback model gave after the configured model's provider failed (llm: fallback_model_answered (<reason>)), noted once the second call has answered: a second call that fails too claims no answer.
    • knowledge.search and the knowledge leg of loom_search: the lexical leg's corpus statistics, the rerank past knowledge_search_rerank_timeout_s (rerank: input_order_kept), narrowed spans, the live results of a live search, and repository documents (knowledge: repo_docs_dropped; code.context_pack's docs section, repo_docs_unlisted). Also extractor formats past their timeout, knowledge.inspect's sections, job comparison and listed heads, and namespace.tune's artifacts.
    • A private mirror leg whose per-request read fails (the registrations, bindings and listing starts, the reader's identity, a discovery statement) shows no mirrored document and names knowledge: mirror_unread, the marker docs/architecture/document-sources.md defines, with no reason, since an error's text could name a mirror row. Nothing wrote that marker before. A read the leg issues only for candidates (the lists, the members rows, the heads) or for an admitted document drops the mirrored results with no note: candidates include documents the reader may not see, so a note there would tell a caller that a hidden document matched. Those 15 handlers are listed fail_closed. For the same reason the repository-docs search, its renewal (found in review) and the listing, which run their candidate checks inside knowledge_repo_docs_timeout_s, name no timeout under a plan that reads mirrors (repo_docs_dropped, repo_docs_unlisted stay for every other failure, found in review): a timeout there can depend on documents the caller may not see. The response's latency is that same signal and is unchanged, and so is whether degraded lists that leg's own render notes, which follows whether the leg answered within its bound. docs/architecture/document-sources.md puts both out of scope (found in review); closing them is not this change's. loom_search: knowledge_leg_dropped, new here, repeats the knowledge section's error, which main already serves, and no leg timeout wraps that leg. request_work.http_mirror_unread, RequestWork.mirror_unread and mark_mirrored(unread=...) had no reader and are removed.
    • An answer replaced before it is served (found in review): Loom never takes back an entry of a fallback the served answer used, and it takes back the notes of the work it drops at the sites below. degraded can also name a fallback of work the served answer replaced, which costs that answer a cache entry and hides nothing; docs/reference/http-api.md gives examples. Each knowledge.search render runs in scoped() and its notes are kept only when it is served, so a render that lost a mirrored document mid-request takes its rerank or span note with it; the served render's notes are held on the CheckedSearch, and its ordinary fallback (CheckedSearch._fallback, which repository docs, context.pack and memory.stack also reach) swaps them for its own. memory.ask's mirrored attempt runs in scoped() too: a lost document discards it with its notes, and an attempt that raises otherwise keeps them. A search pass the answer leaves out for good takes its group back too (discard(), found in review): an ordinary render that fails, whose caller names the failure; a repository-docs leg dropped at its renewal or by its deadline; the wide pass the ordinary passages do not select; and the wider pass loom_search's ordinary section does not serve. More drops take their groups back (found in review): a marked plan's eager wide pass the passages do not select, which _select discards each time it leaves the pass out (a search lists its served render's notes again whenever it is read, so a later fallback that serves the pass names them); a context.pack knowledge or memory-stack section dropped for a failed read (CheckedPassages.discard(), and CheckedStack.discard() over the stack's build notes, now held as one group); both searches of loom_search's knowledge section when the section fails, and its wider search when a marked plan's renewed first pass fills the page without it (found in review); and a repository-docs leg that answered before its base search failed. A repository search holds what its legs noted while they ran (such as knowledge: lexical_leg_dropped and the extra leg's repo_docs_dropped) as one group around its renders' groups, so a repository search dropped whole takes those back too and a served one lists them through the group (found in review). Every other dropped pass (the passages' wide pass, a context.pack knowledge section, a repository-docs leg past its deadline) takes back its renders' notes only: what its legs noted before it rendered stays (found in review). A marked plan's first ranking whose eager widening failed names nothing, since it is never served: the renewed ranking names knowledge: widened_hits_dropped only if it still needs the wider result, and an ordinary section names its own widening (found in review). A search that fails as a whole keeps its other legs' groups, since a caller can still ask it for its ordinary answer, served from those renders. The ordinary memory.ask attempt reuses nothing the discarded one read: each attempt builds its own answer state and reader copy, nothing in an attempt writes the run, the premise check runs before both, and no read on that path is memoised per request, so each fallback the second attempt takes is noted in it again (checked in review).
    • conversation.search and the conversation leg of loom_search: a query embed that failed answers by substring (embedder: conversation_substring_fallback).
    • The duplicate check: related PRs (failed, or past their bound), fix links (past their bound, or unread for a namespace), fix releases, the rerank pool and its text, a rerank call past its timeout, canonical pointers and rows, the judge's text, error names, the fingerprint leg, the stored fit, a fan-out namespace that raised, and each leg the answer runs without once the retry has run (tracker: <leg>_leg_dropped (<cause>), written where leg_status is built, so a leg the retry recovered is not named). Also a tracker item's fixed-by files, a tracker answer's and tracker.similar's linked trackers (tracker: linked_tracker_unread), each tracker.similar leg left unavailable, the similar-items catch-up (failed, or past its share), the test signal's churn, smells and name candidates, a source's contract and freshness views and a table its contract could not describe for a reason other than its absence (an absent table is the contract's missing), the patch history (a tip or line probe that raised, a git call past its timeout), the item facts the code ops read (tracker: item_facts_unread), the fix candidate of bisect and backport, memory.ask's record route, and the tracker bindings and source registry when they could not be read. A damaged stored namespace map links no namespace, so every check on that source refuses (fail_closed, as test_a_source_whose_namespaces_did_not_parse_is_refused pins); raising it into the refresh instead would keep every source's last snapshot while one row is damaged, and at boot leave the registry unloaded, so readiness would never pass.
    • code.search: a HyDE leg cut by LOOM_CODE_SEARCH_LLM_LEG_GRACE_MS with the request's budget left (llm: hyde_leg_dropped; found in review: the legs are awaited with asyncio.wait, which the scan cannot see). A literal read past its 0.5 s bound names nothing, as the leg's docstring says: that is the answer for a literal many functions hold, not a fault, so it is listed answer. A slow store can cut a rare literal's read too, so the run counts the cut (retrieval_work.literal_read_cut: 1) and marks its unit unkeepable: the code.search memo, code.ask's answer cache and memory.ask's precedent store keep nothing built on it, and a decision's code discovery is deferred (found in review). A frame, name or literal lookup of the definition leg that fails counts retrieval_work.definition_leg_failed: 1, which makes the answer partial (partial_reason: retrieval unavailable: definition) as a failed lexical or vector leg does, so a decision's code discovery defers on it too; the lookup was already noted (code_index: definition_leg_dropped; found in review).
    • code.bisect_candidates (found in review): the duplicate check past code_bisect_dupcheck_timeout_s (tracker: dupcheck_fix_timed_out) and the fix blame past code_bisect_fix_blame_budget_s (git_mirror: fix_blame_timed_out); cut by the caller's deadline_ms, they answer deadline and are not noted.
    • code.backport_gap (found in review): it takes no caller deadline, and its symbol, patch and history stages run under fixed walls (code_backport_presence_budget_ms, code_backport_patch_budget_ms, code_backport_history_budget_ms). A branch a stage wall cut names code_index: symbol_presence_timed_out or patch_presence_timed_out, or git_mirror: branch_history_timed_out; a branch whose stage read raised names the matching _unread note with the error as degraded shows it (a Loom error's code and message, another error's type). Each git command past tracker_patch_line_timeout_s still names git_mirror: patch_history_timed_out. backport.BRANCH_NOTES keeps those notes out of the nightly worker's fallback check, with a branch's history and lag notes (git_mirror: patch_history_timed_out, patch_history_unread, patch_history_line_unread, lag_unknown; found in review), so the worker writes each branch's row as the read left it, and that row replaces the branch's previous verdict. Such a row claims only what the reads that answered show (found in review). A failed read of the fix's ledger row (code_index: fix_ledger_unread) is fix-wide and still leaves the fix unwritten with FellBack. Three notes about one branch's read stay out of the set and leave the fix unwritten with FellBack (found in review): code_index: file_presence_unread and as_of_unread, whose row can carry no_index, and backport_ledger_dropped, whose row can read gap where the ledger holds the backport. A mirror git cannot read (rev-parse exits 128) answered no_branch_ref with no note, and a git log -S probe git refused answered error:git with no note, both on main too; only a missing ref (no branch name, or exit 1) is no_branch_ref now, and either refusal raises MirrorReadError, so the stage names git_mirror: branch_history_unread or the leg names patch_history_line_unread (found in review).
    • memory.search: the term leg past memory_term_leg_wait_ms or its work bound, and a read-your-writes re-read past memory_search_fallback_max_wall_ms (read_your_writes_unchecked). Code lessons: a branch's code state that could not be read or parsed in time (code_lessons: branch_code_state_unread).
    • memory.bulk_set (found in review): an identity-dedup read that failed writes the entries unchecked (memory: identity_dedup_unchecked), as the conflict check does.
    • memory.get, memory.get_by_id, memory.list and the bulk get (found in review): a usage-totals read that failed keeps each row's own counters (memory: usage_totals_unread). The store notes it, as lifecycle.py does, since every caller that asks for the totals answers a read.
    • History reads (found in review): a present mirror that lacks the head while the last fetch for it failed (git_mirror: fetch_failed). One still fetching is ordinary lag and is not noted, as for a clone.
    • connection.list (found in review): a standing read that failed answers connected: false and names knowledge: connection_unchecked; a lost standing or an unconfigured provider is a refusal and names nothing. The answer covers the caller's own accounts only.
    • Outside the scanned dirs (found in review): mentor.brief's writers and adoption reads (mentor.brief: writers_unread, adoption_unread), each evidence-ladder read its skipped names (mentor.brief: <step>_unread, such as calls_unread), and a profile whose read failed (profile_unread; a mentor turned off, mentor_ttl_seconds 0, is no fallback and names nothing, nor, found in review, does an empty org or namespace, for which mentor_profile reads nothing), and namespace.list_mine's inherited rows, dropped when the creator's rows or the restricted set cannot be read (namespace.list_mine: inherited_rows_unread), and its metadata read, which falls back to the private defaults (metadata_defaulted).
    • ops.incidents (found in review): a platform administrator's call whose tenancy check refuses (tenancy.ensure_held in the restricted gate: a cell that cannot tell, or another cell's org) answers requests: unread with ops.incidents: requests_unread, where the op failed.
  • Cached answers. A cache keeps an answer only when the unit that built it noted nothing and marked nothing unkeepable, so a note the request made earlier (a code.ask step before its search, a fan-out's other namespace, a transport check) does not stop it, and enrichment applied after the cached part (lessons) stays outside. The units: a whole code.search run (handle_code_search), code.ask's fresh answer and its store, code.map's build, a facts.traverse walk, a memory.ask handler, each review-brief build, each repository status. The constructor-coverage and overrides probes cache a failed read for PROBE_ERROR_TTL_S (30 s) with its kind, and every answer served from that entry notes it, not only the first. The same holds for the as_of block (git_mirror: lag_unknown): the lag cache keeps a failed lag read 60 s, and an as_of block built from it is kept 30 s more, so one failure can be named for about 90 s. code.coverage keeps a failed gap read for PROBE_ERROR_TTL_S in the process that read it (code_index: coverage_gaps_unread), with or without the coverage publisher, and publishes nothing: refresh_coverage writes no shared row when the gap read failed, and raises for a must_land caller, which then writes no counts, as when the row's write fails. A shared row without gap counts, as a previous build publishes it, is no answer either, and a whole row another process published while the failure is kept answers at once, as a published summary row does over a kept count failure. Every process then computes again rather than serving no gaps until the counts move, which on an idle repository was never. A code.search pool row keeps the notes taken when the ranking returns, before the risk block, the whole-file expansion and the index head, which each page reads for itself; each later page served from it notes them again (degradations.restore), since the pool holds what those fallbacks left. A code.grep pool row keeps the scan's notes the same way, taken inside a unit so the page's own context, definition and neighbour reads stay out. A memory.search pass runs in a unit, and its parked page keeps the notes taken through the verdict and the term leg's join, which place the pool's tail, before the tags and unit bodies each page fills; the key is written only when there are notes, so a blob without them is unchanged. A consistency reread runs inside scoped(): when its answer is served, its notes replace the first pass's in that pass's unit, and a reread that fails or finds nothing is dropped with its notes. Each payload is read with .get, so a page a previous build parked serves as before. code.index_status and code.repos keep a status for code_status_ttl_s with the notes its reads left, name them on each answer served from it, and do not publish such a status for the other processes; a failed table-summary read (symbol stats, unit risk) is kept for PROBE_ERROR_TTL_S with its kind, so pollers do not rerun the FINAL counts on each call, and every status served from it names it; a published summary row in hand still answers while the failure is kept. A poll that finds its own kept failure returns before the memo's size eviction, but a write past 256 entries, for any namespace, clears the memo, kept failures included. It was kept for the ten-minute memo and named nothing. The statuses a cold listing computes together share one worker-ledger read in flight, and its future carries the read's notes, so each waiter lists them and none keeps or publishes its status as whole. A background status refresh starts its own note list. The nightly code_backport_gaps worker reads each fix inside degradations.scoped(); a read that fell back is logged at info with its notes and read once more while the pass is within its budget, and a fix whose read still falls back writes nothing, as for a tracker miss, so a night of fallbacks does not overwrite verdicts. A note backport.BRANCH_NOTES lists is the exception: the row of the branch whose read made it claims only what the reads that answered show, and replaces its previous verdict. Each worker pass starts with an empty note list (_begin_pass_accounting), so one pass's notes do not hold back the next. In the memory plane, a memory.ask answer whose unit noted anything is not stored as a precedent; the pending-extraction count is no part of the answer, so its notes are kept apart and listed after ask. A facts.traverse walk is not memoized when its unit noted anything; the pending-extraction count and namespace health cache a failed read with its kind and note it on each answer served from it. So do these caches now: code.search's coverage note, personalization directories and clone lag (a head the clone does not hold yet is unknown, not a failed read, as in code.index_status), the guard-stage read of code.path_guards, and memory.search's key-axis probe, summary-entity vocabulary and namespace calibration. An open brief whose items row failed is served and not kept. The PR overlay is cached only when the parse that built it noted nothing, inside a unit; the per-file parse results it is built from keep a failed parse for their TTL, and each overlay built from one names it. code.repos' fork lookup keeps a failed read for LOOM_CODE_FORK_UPSTREAM_MISS_TTL_S with its kind, apart from the answers, and names it on each answer served from it. The duplicate check's session memo (recent_answer, which code.bisect_candidates' fix stage reuses) keeps an answer only when the check's own unit noted nothing; the unit starts before the related-PR search, whose notes count too. prepare_duplicate_check runs in a unit of its own, and a plan whose gates noted anything (identity: tracker_unverified, tracker_gate_unchecked, tracker: binding_overrides_unread) has cache false, since its answer may lack a tracker (found in review). Every one of these gates reads degradations.keepable(), one gate for one rule (found in review): the PR overlay, the review briefs, facts.traverse, the duplicate check's plan and memo, code.map and the repository status read not current() before. Each sits inside its unit(); code.map's sits inside a scoped() whose list is its own, which it now restores whole. Only code.search's literal read marks a unit, and none of these units runs it, so no answer changes.

  • Stored review briefs. build_for_merge and build_for_open serve a brief unstored (stored: false) when a read the build ran fell back, because the stored copy would later be served without its degraded. The ingest worker builds each brief inside degradations.scoped(), so a brief's notes stay off the pass's list and off a waiting code.refresh's; build_for_merge's own unit() decides whether the brief is stored. Each section failure of the build now notes too, and so does a failed read of the function rows, caller counts, fan-in, the PR author or the index head (code_index: head_unread, served with a blank indexed_commit), so such a brief is served unstored at the ingest and on a miss alike. A brief built from the mirror, without a ledger row, reads its reviewers from the tracker before the build's unit opens; when that read fails it notes code.review_brief: reviewers_unread and build_for_merge serves the brief unstored, since its provenance says tracker: failed. Stored, every later read would serve tracker: failed with no note and no rebuild. A code.refresh that waits runs the pass in its own request, and keeps that request's notes after it. A brief whose diff git could not read, for a PR that changed files, is served without its blame and diff sections: it notes git_mirror: diff_unread (<kind>) and answers stored: false, where the merged brief used to answer stored: true for a brief nothing stored. A merge_sha the mirror does not hold is a miss, not a failure: mirror_commit_facts asks gitrepo.holds_commit first (rev-parse --verify --quiet <sha>^{commit}) and answers None when it answers False (exit 1), and a mirror git cannot read (exit 128) still raises and notes brief_missing. GitError carries git's returncode for this, and the clone-lag check above shares the helper.

  • Known cost. A brief whose read fails the same way on every build is never stored, so each call rebuilds it. code.review_brief answers with a verdict, and the wiring a PR adds and generic test-map suites drop out #2046, which this PR merges, counts deterministic failures such as ValidationError as a cap rather than a failed read, which removes the main case; no cache is added for the rest. A backport fix whose read still falls back every night on a note BRANCH_NOTES does not list is never written, for any branch; each such pass calls note_failure (FellBack), so the worker's failure streak builds and the pass is run again early (Behaviour changes). degraded can also name a fallback of work the served answer replaced, and such an answer is not cached, for example: what a dropped pass's legs noted before it rendered, unless the whole repository search is dropped; the renewed knowledge ranking's widened_hits_dropped when the ordinary section is served in its place; what a repository-docs leg's legs recorded when the leg is dropped at its renewal (and that renewal's repo_docs_dropped when its search is left out); and the first pass's render notes when the wider pass is served. Taking each of those back one by one did not converge; an extra note is the safe direction, and the scan guards the other one, a fallback the served answer used that nothing names. A literal read cut at its bound is the normal answer for a literal many functions hold (such as --dry-run, read as dry_run), and every cut marks its unit unkeepable, so such a query is never cached: no code.search memo, no code.ask cache (each repeat pays for synthesis again), no memory.ask precedent, and the decision preview always defers its code discovery. We accept that cost, because a memo of a cut answer would serve a partial list as whole (found in review).

  • Slow reads are noted, budget cuts are not. enrich.bounded() notes a read that fails, and a read cut by its fixed bound (code_enrich_timeout_s), which means the store answered slowly. The same holds for memory.search's judge and derived-intent calls (6 s) and memory.for_file's read of the caller's other namespaces (_OWN_ROWS_SECONDS). It does not note a cut by the seconds a caller passes. edit_reads passes what is left of the request's budget (max(0.0, until - now), often 0), and result_lessons passes what is left of the call's deadline_ms only when that is less than the fixed bound, so that cut fires on normal traffic whenever the budget runs short. A lessons read that no deadline narrows (on code.symbol, or a search with time to spare) takes the fixed bound and is noted when cut. It is the budget working, like a token cut, and noting it would make degraded constant noise.

  • ops.incidents (viewer, read, experimental). It is reached with loom_op and is not in the default MCP tools/list. Sources:

    • failing readiness checks: error when required, otherwise warn. draining is left out: a process shutting down still answers what it started, and every deploy drains one, so listing it would make each deploy an incident;
    • providers whose last call failed within the window;
    • enabled workers whose latest passes failed 3 or more times in a row (supervisor.ALERT_THRESHOLD), the last within 6 hours, in this deployment's processes;
    • SLO classes of the org the call acts in where the share of calls that failed on the server is at or above the threshold (sli_minute). The share and the call floor leave out ops.incidents' own calls (INCIDENTS_OP): the op is in the read class, and a client polling it every 5 s through an outage would add about 180 successes to that class over the window, so 15 failed reads of 100 would read as 15 of 280 and no incident.

    Results are sorted errors first and capped at 20. Every answer says in requests whether the org's call counts were read, since ok covers its calls only then: read; not_permitted when the call names no single org or the caller does not read the org whole (most callers: a member, a narrowed, pinned or delegated token, flat or per namespace, and anyone with a restricted namespace hidden); unread when the counts, the restricted set or a restricted namespace's grant could not be read.

  • Load while polled. Each ClickHouse source (workers; request counts per org) is read at most once every 5 seconds per process, a failed read included, so clients polling through an outage add one read per source per 5 s. A lock per source and org makes the polls that arrive while a read runs wait for it and share its answer. Each read is cut at readiness_check_timeout_s. A failed read is named in the op's own degraded on every answer served from it, and the other sources still answer. The worker read filters on worker IN <enabled names>, the first column of the table's key, over 6 hours. It reads only rows that are unlabelled or whose label's first : segment is deploy (DEPLOY_SEGMENT, the rule label_family uses, so deployer:x is not the deployment's), or only its own label on an isolated or a bench server, so those servers sharing the table are not listed. Readiness checks cache their own answers, and provider health is in memory. Both new statements are in the analyzer corpus.

  • Tenant isolation. Request counts are read for the org the call acts in; a * token that names no org reads none. sli_minute keeps no namespace or user, so only a caller that reads the org whole reads them, by the rule the org-wide rollups use: reads_every_namespace (server/auth/context.py, now shared with resolve_org_scope), a platform admin or an org admin of the org whose claim is *. It must also read whole namespaces, and no restricted namespace of the org may be hidden from it (restricted_namespaces_hidden_from); when the restricted set cannot be read, it reads none and notes ops.incidents: requests_unread. A delegated token reads none: org_admin is never delegated (delegable_role), and a child is capped at admin (ceiling_role). A member's * token, an admin narrowed to some namespaces or pinned to one user, and a request with no token where one is required read none. The counts include calls to collections the caller cannot read. They name no collection, and only a platform admin or an org admin over * reads them, which we accept. In code.symbol, a miss asks the dependency namespaces Loom added only where the caller may read them (row_reach per dependency), so a refusal is no note and degraded names no namespace the caller cannot read. A grant that could not be read notes identity: dependency_unverified and names no namespace, since the answer may lack one the caller can read. More gates read the grant the same way (row_reach), because row_in_scope(..., hides_answer=False) turned an unreadable grant into a quiet refusal: loom_search's repository legs (identity: repo_gate_unverified), memory.ask's code grounding (identity: code_grounding_unverified), code.ask's memory context (identity: memory_context_unverified), the branches code.backport_gap, code.blame_range and code.verify_citations add (readable_subset, identity: fanout_unverified), the code links of memory.get, memory.search, memory.for_file, memory.ask's staleness and code lessons (readable_namespaces, identity: code_links_unverified), the tracker gates above (identity: tracker_unverified, identity: churn_unverified, identity: branch_namespace_unverified), and the restricted namespaces an org-wide rollup leaves out (restricted_namespaces_hidden_from, through the new authz.restricted_verdict, identity: restricted_unverified). ops.incidents calls context.restricted_hidden, which returns that list and whether a grant among it could not be read, so its unread answer does not depend on which notes the gate takes. Each note carries no reason and names no namespace, and the noted answer is not cached or stored as a precedent. The worker, provider and readiness incidents are deployment state and are listed for every viewer of any org. That is a choice, and it widens what a viewer sees. /v1/health shows the readiness checks and providers unauthenticated, but ?include=workers shows only the answering process's workers, and the deployment-wide streaks were readable only by a platform admin (/v1/admin/workers.status). A viewer now sees the deployment's failing worker names, streak counts and error classes, and no row content, org or namespace. A token of one org naming another, org-wide or narrowed, is refused: 403 over HTTP, ORG_MISMATCH over MCP. The op stays deployment_scoped: without it the gate answers a narrowed token, which names no namespace, IDENTITY_INCOMPLETE. The flag's comment in base.py, and its row in docs/reference/operations.md, now say such an op may also answer an org-wide aggregate its handler authorizes.

  • Left out:

    • Typed degraded on every response in the Python, TypeScript, Rust and Ruby SDKs. They do not model ignored_args either; Go does, and it gains degraded the same way.
    • Plugin hooks showing degraded.
    • A ledger column that counts degraded responses.
    • Budget and token cuts, because they are not failures.
    • The planes the scan does not read: server/insights/app, server/identity/app, server/assistant/app, server/tasks/app, server/erasure/app, the store packages, server/embedding and server/clients. Review found request-path fallbacks in two of them, now noted (mentor.brief, namespace.list_mine, above). The rest have not been read, and scanning those dirs is a change of its own.
    • Handlers of other narrow exceptions (a GitError, a ValidationError, a parse failure), which the scan does not read; it reads a gateway's refusal, above. Some drop part of an answer with no note, such as the PR overlay's changed-path read (on gitrepo.GitError from diff_name_only it falls back to the paths the cut diff names on its new side, which leaves out a deleted file (its new side is /dev/null), one with no text hunk (binary, empty or mode-only) and any past the cut), or a duplicate check or tracker.similar whose vocabulary read raises TrackerUnavailable and answers tracker_unavailable: true with no note. Reading them would mean deciding, per exception class, which are refusals and which are failed reads.
  • Also in this change. Each broad except this change rewrote, or added a note to, says what it keeps serving. docs/architecture/memory-architecture.md no longer says memory.search_trace has no degraded. The dashboard's reason for leaving out ops.incidents says clients poll it and the dashboard shows deployment health on its own pages. docs/operations/monitoring.md and the comments on LOOM_OPS_INCIDENTS_ERROR_SHARE and LOOM_OPS_INCIDENTS_MIN_REQUESTS say ops.incidents' own calls are left out. The degraded comments on memory.search and memory.set, the Python SDK's search docstring, and the degraded rows in docs/features/memory/writing.md and docs/guides/debugging.md say the field names a provider, a store read or a gate, not only a provider. docs/development/adding-an-operation.md's deployment_scoped row matches the reference. The degraded description of memory.set_from_messages says it names the request's fallbacks in both modes, and in schema mode the projections it skipped. Its narrow-token reason says a narrowed token reads no request counts. The readiness leg no longer wraps readiness.evaluate() in an except, since each check already answers as failing when it raises or times out. OpsIncident.detail's comment names what each source puts there. The degraded section of docs/reference/http-api.md says a missing key means no fallback was noted, not that nothing was cut; names the answers not kept, the caches that keep a fallback with its entries, listed by how long each keeps it (now with code.index_status' symbol-stats and unit-risk counts, code.coverage's gap counts, code.search's coverage note and personalization directories, the code.path_guards guard stage, and memory.search's key-axis probe, summary-entity vocabulary and namespace calibration; a failed lag read reaches the as_of block for about 90 s, not 30), and what a later page of each paged op names. The comment on code.search's coverage-note cache is one comment again. The broad excepts that gave no reason now give one. A tracker source whose stored namespace map does not parse still links no namespace, so each check on it refuses, and now logs a warning naming the org and source, never the map (found in review). The module docstring of degradations.py is rewrapped (found in review).

Compatibility, rollout and rollback

  • Wire.
    • New op ops.incidents, whose answer always carries requests (read, not_permitted or unread).
    • degraded can now appear on any op's response, and MCP results now carry it.
    • memory.set, memory.search and memory.set_from_messages no longer send an empty degraded: []. The SDKs already decode a missing key as empty (Python NotRequired, TypeScript optional, Rust serde(default)). A raw client that indexes the key must treat a missing key as empty.
  • Operator steps: none. Three new settings, each with a default: LOOM_OPS_INCIDENTS_WINDOW_MINUTES (15), LOOM_OPS_INCIDENTS_ERROR_SHARE (0.1) and LOOM_OPS_INCIDENTS_MIN_REQUESTS (20).
  • Behaviour changes.
    • memory.bulk_set, the extraction paths that write through it (memory.set_from_messages, the observe worker) and memory.append_batch refuse with a retryable 503 when the batched live-row lookup fails, before anything is written: BACKEND_UNAVAILABLE (Retry-After: 1), or the store's own code, which passes as it is (POSTGRES_UNAVAILABLE on the Postgres path, OVERLOADED, or a 504 BACKEND_TIMEOUT). memory.bulk_set used to write the batch as if no key existed: a read_only key's value was overwritten, the pin guard was skipped so a pinned key was unpinned, revisions were announced as memory.written, and the response carried no skipped_* and no note. memory.append_batch did not write such a batch: it answered 422 VALIDATION_FAILED (could not verify fresh keys), which a client does not retry, for a coded store error too; both now answer the same retryable error. The unknown outcome of loom.memory.writes, which counted the entries of such a batch, is gone, with its row in deploy/hyperdx_dashboards.md.
    • code.symbol_history answers tracker_unavailable when its tracker side raised.
    • A review brief whose fan-in, author or indexed-head read failed is served unstored, as code.review_brief answers with a verdict, and the wiring a PR adds and generic test-map suites drop out #2046 serves one whose section read failed, and so is a mirror-built brief whose tracker read failed.
    • The weekly risk refit counts a fit it could not read as a failed refit, where it refit as if there were none.
    • A code_backport_gaps pass in which a fix's read still falls back is partial, where it was clean, so the supervisor runs the worker again after worker_partial_retry_s (1 h by default), doubled for each such pass in a row and never past the 24 h interval.
    • An answer from LOOM_LLM_FALLBACK_MODEL is no longer cached by code.ask or stored as a memory.ask precedent, and a code.search whose HyDE leg its grace cut is not memoised: each unit noted a fallback.
    • ops.incidents answers requests: unread for a platform administrator whose tenancy check refuses, where the op failed with that error.
    • A duplicate check that noted a fallback, or whose targets a gate could not verify, is no longer remembered, so code.bisect_candidates' fix stage runs its own check rather than reusing it.
    • A code.search whose literal read reached its bound answers retrieval_work.literal_read_cut: 1, and no cache keeps an answer built on it (code.search, code.ask, a memory.ask precedent); a decision's code discovery is deferred.
    • A code.search whose definition-leg lookup failed answers partial: true with partial_reason: retrieval unavailable: definition and serves no continuation cursor, and code.ask's answer built on it is partial; its degraded already named the lookup.
  • Rolling upgrade. While builds N-1 and N serve side by side, N-1 still stores answers built from fallbacks it does not note, and N serves them with no degraded: the shared code.search memo for LOOM_CODE_SEARCH_MEMO_TTL_S (30 minutes by default); a code_review_briefs row, which has no expiry and is served until the brief is rebuilt or erased; and, with LOOM_MEMORY_ASK_PRECEDENTS on (off by default), a memory.ask precedent while its evidence is unchanged, for LOOM_MEMORY_ASK_PRECEDENTS_MAX_AGE_HOURS (no bound by default; 1 hour on the fast path, LOOM_MEMORY_ASK_PRECEDENTS_FAST_MAX_AGE_HOURS). N reads every row N-1 writes, and nothing N writes is new to N-1.
  • Rollback: no stored data or migration. Reverting removes the op, the settings and the generated files together.

Tests

  • New tests/unit/test_ops_incidents.py (16 tests):
    • a healthy deployment answers ok; a draining process is no incident; each source lists its incident, errors first;
    • the worker read names the enabled workers, the alert threshold and the window, with deployment for a deploy… label and only its own label for an isolated server;
    • a provider failure older than the window is not current;
    • a class is an incident from LOOM_OPS_INCIDENTS_ERROR_SHARE and LOOM_OPS_INCIDENTS_MIN_REQUESTS;
    • a source that cannot be read is named in degraded while the others answer;
    • polls within the TTL share one read, a cached failure is still named, and another org's counts are their own read;
    • eight polls gathered against slow reads run one statement per source;
    • a member's * token, a token an org admin delegated through delegation.delegate (minted as admin), a narrowed or pinned org admin, a * token naming no org and no token read no request counts, and an org admin over * does;
    • an org admin with a restricted namespace hidden reads none, and when the restricted set is unread it reads none and notes requests_unread;
    • the op's role and flags;
    • a token of one org naming another, org-wide or narrowed, is refused (HTTP 403, MCP ORG_MISMATCH), and a viewer of the org, narrowed or not, is admitted on both;
    • an HTTP body without org polls the token's org.
  • tests/unit/test_degradations.py (7 new tests):
    • partial leaves provider health alone;
    • inside a unit current() reads only its own notes, and the request lists both after it, from gathered child tasks too;
    • on_response merges the lists, removes duplicates and leaves out an empty key;
    • a repeated note is listed once, and the cap counts distinct notes;
    • an op whose model has no degraded field carries the notes on both transports; the lean pass drops a section's copy and keeps a stored top-level list;
    • loom_search shows the notes in its text and its structured result.
  • tests/unit/test_idempotency_across_transports.py: a replay carries the degraded its first answer named, over MCP and HTTP.
  • New tests/unit/test_code_read_degradations.py:
    • a failed candidate-site read, which the block's note already reports, is in degraded too;
    • a declined-calls read failure and a dropped coverage leg are noted and leave provider health alone;
    • a failed enrichment read and one cut by code_enrich_timeout_s are noted, and one cut by a caller's seconds is not;
    • a cached failed constructor-coverage probe, and a cached failed overrides probe, are noted on the next answer, served without a read;
    • page 1 of a search noted a dropped vector leg, and page 2, served from its pool in another request, names the same note; page 1's failed risk annotation stays out of the pool, and page 2, whose annotation answers, names none;
    • a code.grep page 2 names its pool's scan notes;
    • a search whose embedder would not build notes embedder: query_vector_dropped and is not memoized;
    • a code.map whose hubs and most-called reads failed names both and is not kept in _MAP_CACHE; a render whose hub read failed before the head moved is discarded with its note, and the second, whole render is served and kept;
    • unread issue titles in code.blame_range are noted;
    • a dropped fan-in read is noted.
  • tests/unit/test_review_brief_store_needs_diff.py (4 new tests):
    • a merged brief whose git read failed answers stored: false and notes git_mirror: diff_unread (GitError), and so does an open brief; one with no changed file is stored and notes nothing;
    • a merge brief and an open brief whose read fell back are served with stored: false and not inserted;
    • the ingest's brief builder stores the brief whose reads answered and not the one whose read fell back, and the request's own note survives the pass;
    • a merge brief and an open brief whose index-head read failed note code_index: head_unread (TimeoutError) and are not stored.
  • tests/unit/test_ui_read_caches.py: a status whose read fell back names it on the computed and the cached answer and is not published; a whole one is published and notes nothing. Two statuses computed together while the shared ledger read fails make one read, both carry worker_ledger_unread, and neither is published. On a real repository, a lag from a watermark the clone does not hold is -1, notes nothing and the status is published; the same lag over a directory git cannot read notes git_mirror: lag_unknown and the status is not published, whether the clone's tip was published or read from git.
  • tests/unit/test_code_backport_gaps.py: a fix whose read falls back twice is read twice, writes no rows, counts as unavailable and logs its notes, which stay in its own scope; a fix whose second read answers whole writes its rows; a pass past its budget does not read again.
  • tests/unit/test_worker_ledger_rows.py: a pass starts with no note.
  • tests/unit/test_code_symbol_dependency.py: a dependency the caller cannot read is a miss with no degraded and no namespace named; one whose grant could not be read notes identity: dependency_unverified and names none; a failed run is noted.
  • tests/unit/test_search_pages.py: a memory.search page parked with notes names them when served in another request; a page with none parks no key.
  • tests/unit/test_memory_search_handler_gates.py: a note taken before validation is parked with the tail, and a tag note taken after it is not.
  • tests/unit/test_search_read_your_writes.py: an adopted retry's notes replace the first pass's, a failed retry's are dropped and the failure is named (memory.search: read_your_writes_unchecked), and the caller's earlier note stays either way.
  • tests/unit/test_repo_docs.py, tests/unit/test_memory_code_grounding_authz.py and tests/unit/test_code_ask_cache_v2.py: each gate whose grant read fails answers without its part, notes it with no namespace, and code.ask does not cache that answer. The tests that faked row_in_scope for these gates now fake row_reach, and test_request_sli.py no longer lists the three call sites.
  • tests/unit/test_repo_docs.py: a repository gate called before the registry is read answers without the legs and notes identity: repo_registry_unread.
  • tests/unit/test_set_from_messages_fail_closed.py: a plain-mode call whose step noted a fallback names it in degraded.
  • tests/unit/test_code_review_brief_mirror.py: a sha the mirror does not hold, full or short, is None; a directory git cannot read raises.
  • tests/unit/test_ops_incidents.py: requests is read for an org admin over *, not_permitted for a member, a flat and a per-namespace (ns_roles) delegated child, a narrowed or pinned admin, a * token naming no org and no token where one is required, and for a hidden restricted namespace; unread for an unreadable restricted set, an unverified restricted grant (restricted_hidden answers its flag) and a failed count read. A member and an org admin reach the op through loom_op and see not_permitted and read; the transport tests run the real handler.
  • tests/unit/test_request_sli.py: readable_subset, readable_namespaces and restricted_namespaces_hidden_from leave out a namespace whose grant could not be read and note it, a plain refusal notes nothing, and neither marks the request. The opt-out scan now pins direct row_reach and restricted_verdict calls too (the latter in restricted_hidden): the gates above that note instead of marking, and those that mark on an unverified verdict themselves. The tracker gates' callers move out of the opt-out for answers the tracker only enriches, into the gates that note. It also pins run.retract_credit's grant read (_retract_run): an unread grant refuses with a 503, which the request's row already counts as the server's.
  • tests/unit/test_memory_search_handler_gates.py: a failed term leg's note is parked with the tail.
  • tests/unit/test_code_result_lessons.py: a failed file read is noted; a slow one is noted when the fixed bound cut it and not when the call's deadline did; the lesson path read is noted only within the fixed bound.
  • The tests that faked row_in_scope for readable_subset or readable_namespaces now fake row_reach, which row_in_scope also calls: test_branch_fanout_skips_unreadable.py, test_code_blame_range.py, test_code_verify_citations_resolve.py, test_memory_code_plane_reads.py, test_code_first_build.py and test_code_result_lessons.py.
  • tests/unit/test_tracker_binding.py: for code.history, code.blame_range, code.symbol, code.bisect_candidates and memory.ask, a tracker whose grant could not be read is left out, noted identity: tracker_unverified and does not mark the request; so are a search's linked trackers. A tracker the caller asked for marks the request and notes nothing. A gate that raises notes identity: tracker_gate_unchecked (RuntimeError).
  • tests/unit/test_tracker_dupcheck_fanout.py: a restricted record whose grant could not be read is left out and noted, a standard one opens through its repository, and a plain refusal notes nothing.
  • tests/unit/test_status_summaries_published.py: two calls with a failing count run it once and both name code_index: symbol_stats_summary_unread (TimeoutError); a published row in hand answers in that window with no note; past PROBE_ERROR_TTL_S the count runs again within the ten-minute memo; a poll at a full memo still finds its kept failure, since it returns before the eviction.
  • tests/unit/test_tracker_multi_binding.py: the record route's unread tracker is in degraded as memory.ask: record_tracker_unread (RuntimeError), without the namespace the text names.
  • tests/unit/test_tracker_test_signal.py: an unverified churn namespace the caller named marks the request; the deployment's default notes identity: churn_unverified.
  • tests/unit/test_code_repo_self_service.py: an indexed branch whose grant could not be read is listed unnamed and noted identity: branch_namespace_unverified.
  • The tests that faked row_in_scope for the tracker gates, the churn gate and the indexed branches now fake row_reach: test_tracker_binding.py, test_tracker_binding_op.py, test_tracker_dupcheck_fanout.py, test_tracker_test_signal.py, test_tracker_test_daily.py, test_code_repo_self_service.py and test_code_repo_remote_branches.py.
  • tests/unit/test_code_backport_gaps.py: a fix that falls back on two nights fails each pass with FellBack; one whose second read answers whole does not.
  • tests/unit/test_code_search_cursor.py: a pool row without a degraded key, as a previous build parks it, serves its page and names no note.
  • tests/unit/test_gitrepo_option_injection.py: holds_commit answers True for a held commit, full or short, False for an absent one, and raises GitError with returncode 128 for a directory git cannot read; an option-shaped sha is refused before git runs.
  • tests/unit/test_extraction_queue.py and tests/unit/test_namespace_health.py: a cached failed read is named on the next answer too.
  • tests/unit/test_memory_inspect.py: a section that skipped already names is in degraded too.
  • tests/unit/test_facts_handlers.py: a walk whose hub-degree read failed says so and is not memoized.
  • tests/unit/test_memory_ask_precedents.py: an answer a fallback served is not stored, and neither is one whose code grant could not be read, which notes code_grounding_unverified. The fixture now answers the pending-count and knowledge reads, which failed silently there before and now note.
  • tests/unit/test_code_search_pick.py: a search whose read fell back is not memoized, and the same search with no note is. A search after an earlier note of its request is memoized, its pool row lists none of that note, and the request still names it; with a note of its own it is not memoized and its pool row lists only that note. Its fake repository now answers the fan-in read, which failed silently there before and now notes, and its coverage note is stubbed, since the fake has no counts read.
  • tests/unit/test_identity_incomplete.py lists ops.incidents among the deployment-scoped ops; it and the test inventory failed CI at the previous head.
  • tests/unit/test_code_answer_completeness.py: a code.ask answer is not stored while its unit holds a note, and is stored once it holds none.
  • tests/unit/test_code_result_lessons.py: _bound_s is None with no deadline or one with more left than the bound; a lessons scope read cut by the fixed bound is noted, and one cut by the deadline is not.
  • New tests/unit/test_degraded_unnoted.py: the scan above, and the provider-health guard.
  • New tests/unit/test_memory_search_computed_notes.py: a date difference whose operand embed fails notes memory.search: temporal_diff_dropped (RuntimeError), and a support count that fails notes memory.search: evidence_support_unread (TimeoutError).
  • tests/unit/test_code_repos_refresh_cost.py: a status whose state read fails notes code_index: state_unread (TimeoutError) while judging a commit against the cached heads.
  • tests/unit/test_code_repos_reads_once.py: the listing gate notes identity: listing_gate_unchecked for a failed SCIM read and nothing for a PermissionError or an IdentityIncompleteError, and lists the entry request-only each time.
  • tests/unit/test_code_ingest_fair_fetch.py: a failed lag read is named on both answers, the second served from the as_of cache with no second read.
  • tests/unit/test_code_page_shapes.py: a failed gap read is read once and named on both pages.
  • tests/unit/test_coverage_published.py: a failed gap read publishes nothing and is named on the page that computed it and on the next, from the memo; past PROBE_ERROR_TTL_S the next read computes again, and publishes once the gaps read. A must_land refresh raises on a failed gap read and publishes nothing. A shared row without its gap counts is no answer, and a whole row published while a failure is kept answers with no note and no read.
  • tests/unit/test_bulk_identity_dedup.py: a failed live-row read refuses the batch with a 503 and Retry-After: 1, and nothing is inserted or announced. tests/unit/test_memory_append_batch.py: an unverifiable freshness answers BACKEND_UNAVAILABLE. The lookup-failed case of test_memory_bulk_parity.py is gone with its path, and the tests that built _BulkWriteState(existing_lookup_ok=True) no longer pass it.
  • tests/unit/test_code_setting_facts.py: a failed control, declaration, randomizer or history read notes code_index: setting_<read>_unread beside the cause in causes, and a failed test count notes setting_tests_unread with tests_total 0 and causes unchanged (each fails without the note; the last found in review).
  • tests/unit/test_code_symbol_history.py: a tracker side that raised answers tracker_unavailable with no namespace, a failed issue read leaves the linked issue bare, and both are noted.
  • tests/unit/test_code_blame_range.py: a failed merge-ledger read notes code_index: merge_ledger_unread; failed function and comment reads leave their halves empty and note each.
  • tests/unit/test_code_review_brief_sections.py: one case for each of the twelve notes of review_brief_build.py (symbols_failed, function_rows_unread, caller_counts_unread, fan_in_unread, coverage_claim_failed, test_home_failed, setting_facts_failed, symbol_history_failed, blame_range_failed, tracker_failed, risk_failed, pr_author_unread) raises from its read and asserts that one note and stored: false, with nothing inserted; a mirror-built brief whose tracker read failed notes reviewers_unread, carries tracker: failed and is not stored. code.review_brief answers with a verdict, and the wiring a PR adds and generic test-map suites drop out #2046's tests of a failed file-rows, language, wiring-callers, drift or head read now also assert its note (each fails without it).
  • tests/unit/test_pr_post_image.py: a file whose call names or edges cannot be extracted is counted in overlay_note, also when served from the per-file caches, stays in parsed and notes nothing (each fails without its count).
  • tests/unit/test_mirrors.py: a read while the clone runs notes nothing, and one after it failed notes git_mirror: clone_failed (git clone failed (exit 128)). tests/unit/test_code_repos_refresh_loop.py: a refresh that keeps the last snapshot notes code_index: registry_unread (ConnectionError), and one that reads notes nothing.
  • tests/unit/test_code_repos_fork.py: a failed fork lookup is noted on the answer that read it and on the next, served from the kept failure, with one read.
  • tests/unit/test_bisect_fusion.py: a window or wide-window read that raised fuses nothing and notes tracker: window_dropped or wide_window_dropped. tests/unit/test_tracker_multi_binding.py: a linked tracker whose scan raised notes tracker: linked_tracker_dropped. tests/unit/test_code_symbol_history.py: a tracker side that answers TrackerUnavailable notes tracker: symbol_facts_unread (TrackerUnavailable) and names its namespace.
  • tests/unit/test_memory_append_batch.py: a PostgresUnavailableError from the lookup passes as it is, and nothing is committed. tests/unit/test_loom_search_tracker_general.py: a plan whose deadline passed before the tracker leg starts notes loom_search: tracker_dropped (TimeoutError). tests/unit/test_pending_evidence.py: a batch whose messages is not a list, or whose payload is not an object, is skipped and noted.
  • tests/unit/test_coverage_published.py, test_code_page_shapes.py, test_code_status_ops.py and test_code_ingest_counts_post_step.py: refresh_coverage answers the gap failure third, and the note keeps its kind (coverage_gaps_unread (TimeoutError)); the fakes use the real refresh_coverage, and _coverage_cached has no branch for a repository without it. tests/unit/test_code_blame_range.py: the fake repository answers the review read, which failed silently there before and now notes.
  • tests/unit/test_code_review_brief_mirror.py: the fake repository now answers the function-row read and takes within_head on its ledger read; both failed silently there before and now note, which would leave the brief unstored.
  • tests/unit/test_memory_for_file.py: a failed read of another namespace is dropped and noted. tests/unit/test_loom_search_tracker_general.py: a tracker whose search raised is dropped and noted while the others answer. tests/unit/test_pending_evidence.py: a malformed batch is skipped and noted.
  • tests/unit/session_content_senders.json: the reviewed digest of sdk/python/loom/memory.py is renewed for this PR's docstring change to degraded; no sender changed.
  • tests/unit/test_memory_webhooks.py: the fake patches partial, which the webhook notes now call.
  • A unit-test fixture (tests/unit/conftest.py) starts every test with no note list, so the tests pass in any order. The reviewer's repro (test_degradations.py::test_every_op_response_carries_the_requests_notes_on_both_transports then test_mcp_lean_pack_explain.py::test_another_ops_result_is_only_leaned, -p no:randomly) passes.
  • New tests/unit/test_ops_incidents_sql.py runs both new statements on clickhouse-local over the schema.sql tables (LocalCH, ddl, which now takes the database for loom_telemetry.sli_minute). For the deployment, the streak read leaves out a worker that is not enabled, a pass older than 6 hours, an isolated server's row, a deployer:x row, a streak a later version cleared, a streak whose freshest pass on another deployment process succeeded, and one under the threshold; iso:x and deployer:x read only their own rows. The request read sums one org's class across operations, and leaves out another org, the rollup's resume marks, minutes outside the window, and ops.incidents' own calls: 180 polls beside 15 failed reads of 100 leave the share at 15 of 100, and 30 polls beside 10 calls leave the call count at 10. This pins the operation != INCIDENTS_OP filter for both the share and the call floor, which the handler computes from the same counts. Both tables are created by the local 26.7 binary.
  • Before that test, both statements ran through server/core/ch.py against a ClickHouse server migrated from schemas/migrations/, on fixture rows in loom.worker_status and loom_telemetry.sli_minute. For the deployment, the read leaves out a worker that is not enabled, a pass older than 6 hours, an isolated server's row, a streak a later version cleared, and a streak whose worker's freshest pass on another deployment process succeeded. The isolated label reads only its own row. The request read returns each org's own counts per class, and leaves out the rollup's resume marks and minutes outside the window.
  • make format lint typecheck passes, with the function-length gate at its baseline. All codegen is regenerated (SDKs, reference docs, settings files, reach manifest) and the settings snapshot is updated.
  • tests/unit/test_llm_fallback.py: an answer the fallback model gave notes llm: fallback_model_answered (http_503); a healthy primary notes nothing.
  • tests/unit/test_conversation_search_service.py: a search whose query embed raised answers by substring and notes embedder: conversation_substring_fallback.
  • tests/unit/test_code_bisect_deadline.py: the fix blame and the duplicate check, each cut by its fixed bound, answer timeout and are noted; cut by the caller's deadline they answer deadline and note nothing.
  • tests/unit/test_code_search_deadline.py: a HyDE leg the grace cut is noted with no deadline and with time left; one a 400 ms deadline cut first is not.
  • tests/unit/test_pr_post_image.py: an overlay whose name read failed notes overlay_names_unread and is not kept, so the next load reads the names again and is kept, and the third is served from the cache; a head the store cannot place notes pr_head_unread. With the cache gate removed, the test fails.
  • tests/unit/test_memory_repo.py: a usage-totals read that fails, for one row and for many, keeps the rows' counters and notes memory: usage_totals_unread. tests/unit/test_bulk_identity_dedup.py: a failed identity-dedup read notes memory: identity_dedup_unchecked.
  • tests/unit/test_mirrors.py: a present mirror lacking the head notes nothing while its fetch runs and git_mirror: fetch_failed once the fetch failed.
  • tests/unit/test_ops_incidents.py: a tenancy check that answers BACKEND_UNAVAILABLE or WRONG_CELL inside the restricted gate answers requests: unread, noted, and the other sources answer.
  • tests/unit/test_degraded_unnoted.py: the wider dirs, the timeout handlers, the import closure from the scanned modules (no hand-kept list), and the deadline, fail_closed and answer categories (an answer entry, like a noted_by_caller one, needs its comment).
  • tests/unit/test_source_access_plan.py: with a list, members, heads or owner read failing, a query that matches one hidden document answers the same degraded as a query with no candidate, an empty one; an unconditional read that fails names knowledge: mirror_unread for both. tests/unit/test_source_documents.py, tests/unit/test_source_listing.py and tests/unit/test_source_search_pool.py: each discovery failure names the marker, and each candidate failure names nothing.
  • New tests/unit/test_degraded_fallback_notes.py: one row for each note the wider scan and this review added that no other test drove (56 rows), each driven by the failure it describes and asserting the exact note; a contract's absent table and a refused connection name nothing.
  • tests/unit/test_tracker_duplicate_check.py: a lexical leg still down after its retry names tracker: lexical_leg_dropped (ch_transient), and one the retry recovered names nothing. tests/unit/test_tracker_similar.py: a leg down names tracker: frames_leg_dropped (TrackerUnavailable). tests/unit/test_tracker_multi_binding.py: a linked tracker that raised is left out and names tracker: linked_tracker_unread (RuntimeError).
  • tests/unit/test_dupcheck_links.py: an answer whose links read failed names it and is not remembered, and a whole one is; a release a failed git tag --contains left unread names git_mirror: fix_release_unread (GitError). tests/unit/test_tracker_embed.py: a catch-up past its share names tracker: vector_fresh_pending (TimeoutError), and one waited for names nothing.
  • tests/unit/test_code_search_definition_leg.py: a literal read cut by its fixed bound names nothing. tests/unit/test_llm_fallback.py: a secondary model that fails too leaves no fallback_model_answered.
  • Each of the 77 notes the widened scan and the reviews added, and the repository-documents note now written by _note_dropped, was replaced by pass, one at a time, and the test files the two rounds changed were run: each removal fails a test. Five did not at first: the term leg's two timeouts and the rerank pool had no driver and now have rows, and tests/unit/test_memory_repo.py checked its two usage-totals reads together, where the one note listed for both hid either's absence; it now checks each read on its own.
  • tests/unit/test_tracker_dupcheck_fanout.py, through handle_tracker_duplicate_check: a note the request held before the check still lets the answer be remembered (it fails with the execute unit removed), and a public record whose grant could not be read names identity: tracker_unverified and keeps the answer out of the memo (it fails without the prepare unit's gate).
  • tests/unit/test_source_search_result.py, through run_checked_search: a rerank that timed out and then a lost proof serve the ordinary render with no rerank note, and a render served with its rerank note, then renewed after the document was lost, names none once its fallback answers. Both fail with the renders unscoped. tests/unit/test_source_ask_generation.py: a mirrored memory.ask attempt's note stands when it is served and goes with it when a lost document discards it (fails unscoped); one that raises keeps its note. tests/unit/test_degradations.py: a held group lists until its swap, another holder keeps its copy, a group survives its unit, and the cap reads the groups.
  • tests/unit/test_mentor.py: two failed ladder reads name calls_unread and reported_keys_unread, a profile whose read failed names profile_unread, and a mentor turned off names nothing, nor does an empty org or namespace with the mentor on (fails without the scope check, now mentor.profile_read_applies, the one rule mentor_profile, warm_profile, the hint and the brief share).
  • tests/unit/test_code_search_pick.py: a run whose literal read the real leg cut answers literal_read_cut: 1 and is not memoised (fails without the gate). tests/unit/test_code_search_definition_leg.py: the cut is counted, under a window and under the fixed bound.
  • tests/unit/test_degraded_fallback_notes.py: under a plan that reads mirrors, the docs search and listing name no timeout and name any other failure (fails with the timeout noted).
  • tests/unit/test_degradations.py: a plain note a held group also lists stays after the group's swap, through note and through a unit's restore, and a group at the cap keeps no note out (both fail with the old count); an unkeepable unit names nothing, keeps its caller's answer out of the cache and leaves a later unit keepable.
  • tests/unit/test_code_answer_completeness.py, test_memory_ask_precedents.py and test_code_search_pick.py: an answer built on a literal read the real leg cut is not stored, as a code.ask answer or abstain, as a memory.ask precedent, or in the code.search memo. Each fails with its gate reverted, and all three without the leg's mark. tests/unit/test_decision_code_discovery.py: a cut search defers the decision's code discovery (fails without the check).
  • tests/unit/test_source_repo_search.py: a repository-docs leg whose renewal starts past its deadline names no timeout (fails at the previous head) and takes its render's notes with it, as does one the base's wait expired. tests/unit/test_source_search_result.py: a fallback whose render fails names nothing of the discarded render, and the ordinary passages' wide pass, failed or not selected, takes its notes with it. tests/unit/test_source_fanout_renewal.py: so does the wider pass of loom_search's ordinary section, unused or failed, and the wider pass a marked plan's first ranking built when the renewed first pass fills the page alone. Each fails with its discard() removed. A first ranking whose eager widening failed names no widened_hits_dropped when the renewed first pass fills the page or an ordinary section widens again (both fail with the expander raising), and names it once when the renewed pass needs the wider result. tests/unit/test_source_repo_search.py: a pass left out takes back what its lexical leg noted (fails without the held group), and a served pass lists it once beside the request's own copy. tests/unit/test_code_backport_gaps.py and test_code_backport_gap_exact.py: a symbol, patch or history stage cut by its wall or whose read raised names its note (fails without the notes). A worker pass over three branches, through the composed read, in which one branch's read makes each member of BRANCH_NOTES in turn (the real stage where cheap, else a branch read that makes the note), writes all three rows and notes no FellBack; a test checks the cases cover the whole set, a history-stage cut writes that branch at its floor, an unknown lag writes the rows written without it, and a branch's file presence or ledger read that failed leaves the fix unwritten with FellBack. The cases fail with their notes in the fallback check, and the ledger case with its note in the set. A missing ref is still no_branch_ref, an empty or absent mirror raises MirrorReadError, and an empty mirror through the worker names branch_history_unread and writes every branch's row (both fail without the exit-1 rule); a refused -S probe on either leg is named (fails without the raise).
  • tests/unit/test_tracker_source_add.py: a source whose stored namespace map did not parse logs a warning that names the org and source and not the map.
  • tests/unit/test_code_search_pick.py: a pick the gateway refuses (403) or asks to wait (429) keeps the ranking and names llm: pick_skipped (fails without the note); tests/unit/test_degraded_unnoted.py reads that handler (fails with the note removed).
  • tests/unit/test_source_search_result.py: a marked plan's eager wide pass the passages leave out names none of its notes, a later fallback that serves it names them again, and discarded passages take both passes' notes. tests/unit/test_source_checked_pack.py: a knowledge or memory-stack section context.pack drops on a failed current() or ordinary() names only the drop, and a stack holds its build notes for a caller that drops it. tests/unit/test_source_fanout_renewal.py: a knowledge section that fails after its wider search answered names neither search's notes. tests/unit/test_source_repo_search.py: a base search that fails after the repository-docs leg answered names none of the leg's. Each fails with its discard(), the stack's group or the relisting removed.
  • tests/unit/test_source_ask_generation.py: a mark set in a served mirrored attempt keeps the answer out of the caller's unit's caches (fails with the restored list flattened).
  • tests/unit/test_degradations.py, test_source_checked_pack.py and test_source_search_result.py: an unkeepable mark set inside a held scoped list, the memory stack's build or a served knowledge render names nothing and keeps the caller's unit out of its caches. In the first two, a group held inside is still the one a later swap changes, and dropping the step takes the mark and the group back. The stack and render tests fail with current() held, all three with keepable() reading the top level only, and the first two with a group's groups flattened. tests/unit/test_search_read_your_writes.py: a mark set in the re-read a pass serves keeps the pass's unit out of its caches and names nothing (fails with current() returned; found in review).
  • tests/unit/test_decision_code_discovery.py: a failed frame, name or literal lookup defers the code discovery (fails without the counter, and without failure_reason reading it). tests/unit/test_code_search_definition_leg.py: a failed lookup counts definition_leg_failed beside the other lookups' rows.
  • tests/unit/test_mirror_request_owner.py, test_source_access.py, test_source_access_plan.py and test_source_listing.py no longer read mirror_unread; the test of that flag's monotonic owner is deleted with it.
  • After merging main, the 424 unit test files that import a module the last four rounds touched, or that main's new commits changed, ran together: 11,710 pass, and the 162 that fail fail the same on a clean origin/main on this machine (clickhouse-local, macOS and native-diagnostic gaps, listed below). test_code_search_definition_leg.py's clickhouse-local literal read ran on its own and fails as on main: this machine's clickhouse-local has no enable_quantized_codec.
  • After merging main again (memory.search serves requested kinds first and summaries by their head #2044, then code.review_brief answers with a verdict, and the wiring a PR adds and generic test-map suites drop out #2046), the 517 unit test files that import a module this round or those merges touched, or that any of them changed, ran together with the scan, note, degradation, package-contract, public-copy, doc-link and analyzer-corpus tests: 12,970 pass, and the 70 that fail fail the same on a clean origin/main on this machine. The sender-census test passes. memory.search serves requested kinds first and summaries by their head #2044 removed five handlers of payload.py that were listed full_answer_fallback, so their entries are gone. code.review_brief answers with a verdict, and the wiring a PR adds and generic test-map suites drop out #2046 overlapped this PR in three places, each resolved with a test that fails without the change: code.setting_facts keeps code.review_brief answers with a verdict, and the wiring a PR adds and generic test-map suites drop out #2046's verdict and causes and notes each read that failed; the PR overlay keeps code.review_brief answers with a verdict, and the wiring a PR adds and generic test-map suites drop out #2046's count of a parse that raised, and counts calls or edges the extractor could not list beside it, kept the same way; the review-brief builders keep code.review_brief answers with a verdict, and the wiring a PR adds and generic test-map suites drop out #2046's store gates inside their unit, beside the keepable() gate. Of the brief's six new broad handlers, five note their failure and the repository config, read in process, is listed settings; parse_with_outcome's two handlers return the error, as parse_for_ingest's did, and are listed noted_by_caller. The counts above are the merged tree's. make lint typecheck passes, with the generated SDK files regenerated and every codegen --check current; make format-check passes but for Chat.test.tsx, as below, and Prettier and Taplo pass on their own. The plugin manifests are main's (1.2.171): this PR bumps no plugin version.
  • The review of the merge found five more items, all fixed: the narrow-handler example under the scan's gaps is now the overlay's changed-path read, since code.review_brief answers with a verdict, and the wiring a PR adds and generic test-map suites drop out #2046 turns a failed diff read off with LOAD_FAILED; a merged brief served unstored logs its failed reads, whether a read fell back and whether its tracker read failed; the memory stack and a knowledge render hold their scoped lists as they stand; the allowlist header names the four kinds of site the scan lists; and the test-count read of code.setting_facts has its test. The 144 unit test files that import a module this round touched ran together with the scan, note, degradation, package-contract, public-copy, doc-link and analyzer-corpus tests: 4,591 pass, and the 28 that fail fail the same on a clean origin/main on this machine. The scan's counts are unchanged. make lint typecheck passes; make format-check passes but for Chat.test.tsx. The plugin manifests are main's (1.2.171).
  • The review of that head found three more items, all fixed: the narrow-handler example names the files the fallback leaves out; memory.search's sequential re-read returns its scoped list as it stands for the pass that serves it to restore, with a test; and, once each for the store gate and its log line, build_for_merge binds fell_back and tracker_failed, and build_for_open binds fell_back. One other scoped() block's current() snapshot is restored: _pending_beside returns current() from its scoped() block and _handle_prepared_ask restores that text, which drops nothing, since the pending-count read can take no group or mark. The backport worker's _read_fix passes on note text only, and the remaining current() snapshots feed a stored page's degraded field or a result shared across requests. The scan, contract and degradation tests, the setting-facts, checked-pack, search-result and review-brief tests and the five memory-search consistency test files pass (793), with make lint typecheck and the Ruff format check. The scan's counts are unchanged, and the plugin manifests are main's (1.2.171).
  • At 038ccbb, the next review's three wording items are fixed: the _sequential_pass docstring is rewrapped, the narrow-handler example names a deleted file (its new side is /dev/null) apart from one with no text hunk, and the round note above says which other scoped() snapshot is restored and which names each review brief builder binds. The Ruff format check, make lint typecheck and tests/unit/test_search_read_your_writes.py (14) pass; the plugin manifests are main's (1.2.171).
  • At 6172a49, the _sequential_pass docstring says why a failed re-read's note stays: it is noted after the scope, so it stays when the caller drops the failed re-read's list, which is never served (its answer is None). tests/unit/test_search_read_your_writes.py (14) and the Ruff format and lint checks of the file pass.
  • At 2b97644, two Bugbot items are fixed (found in review, above): loom_search's knowledge section discards the wider search a marked plan's first ranking built when the renewed first pass fills the page without it, and mentor.brief names no profile_unread for an empty org or namespace. Three are answered without a change: the backport history leg's git commands run under the fixed tracker_patch_line_timeout_s bound, and each past it stays noted (patch_history_timed_out); every repository-docs timeout under a plan that reads mirrors stays silent, since when the bound runs out depends on time spent in that plan's candidate checks; and calls the overlay cannot extract stay in its cached overlay_note, since a later read gives the same answer. The scan, the fanout, loom_search, source-search and mentor tests pass (400; the one failure, test_mentor.py::test_indexed_writes_count_memories_first_created_in_the_window, fails the same on a clean origin/main), with make lint typecheck, the generators' --check and the Ruff format check. The plugin manifests are main's (1.2.171).
  • At e3a5d08, the next review's four items are fixed (found in review, above): a marked plan's first ranking whose eager widening failed no longer names widened_hits_dropped for a ranking that is not served; a repository search holds its legs' notes with it, so a pass left out takes them back; code.backport_gap names a stage its fixed wall cut and a stage read that raised (the stage walls are fixed settings; the first answer on that thread called them the request's wall, and a correction is posted there); and mentor.profile_read_applies is the one no-read rule. Before the merge below, the 209 unit test files that import a touched module (fanout, loom_search, repository docs, knowledge search, backport, mentor) ran with the scan and degradation tests: 6,174 pass, and the 9 that fail fail the same on a clean origin/main. Merging main again (the MCP read client, knowledge.source.live, repo@branch reads) conflicted only in response_body, which keeps main's _note(op, ...) and lists notes through on_response, and in generated files, regenerated for 382 operations. The plugin manifests are main's, checked line by line (1.2.172 is main's own bump). The scan's counts move: the eager expander's handler is listed noted_by_caller, the re-raising handlers it and the finished-leg loop replace are gone, and main's source worker reads add two timeout handlers that raise a refusal. On the merged tree, the 267 unit test files that main changed or that import a module either side touched ran with the scan, degradation, package-contract, public-copy, doc-link and agent-instruction tests: 9,195 pass, and the 9 that fail fail the same on a clean origin/main. make lint typecheck, the generators' --check and the Ruff format check pass.
  • At 5240eda, the next review's items are settled (found in review, above): the nightly code_backport_gaps worker writes every branch's row again when one branch's stage was cut or failed, as on main, since backport.BRANCH_STAGE_NOTES keeps those per-branch notes (and a branch's patch_history_timed_out) out of its fallback check, while code.backport_gap still lists them; the stage notes take the error itself as their reason; branch_presence_unread is file_presence_unread; and the Tests bullet's discard() sentence follows the items it describes. Three more notes of replaced work are not taken back. Instead docs/reference/http-api.md, the scope note on a replaced answer and the Known cost now say what holds: degraded never leaves out a fallback the served answer used, Loom takes back the notes of the work it drops at the sites named, and the three cases where a note of replaced work stays are named. The scan, the backport, worker, fanout, loom_search, repository-docs, doc-link, public-copy and agent-instruction tests pass (1,038), with make lint typecheck, the generators' --check and the Ruff format check. main had not moved since the merge, and the plugin manifests are main's (1.2.172).
  • At 67cfa19, the next review's items are fixed (found in review, above): BRANCH_STAGE_NOTES adds a branch's git_mirror: patch_history_unread and patch_history_line_unread, the same regression, and git_mirror: lag_unknown, one branch's lag, which no row stores and which this PR first notes; the worker tests drive every member of the set; the worker's docstrings and the Cached answers note name the per-branch exception; docs/reference/http-api.md and the scope note say Loom never takes back an entry of a fallback the served answer used, list what each place takes back (a document search that lost a mirrored document the lost render's entries, a discarded memory.ask attempt all of its own, a dropped pass or section its renders' entries, a dropped context.pack memory-stack section all of its build's entries, and the whole repository search its legs' entries too) and give the leg entries that stay as an example; the code.backport_gap bullet says what the stage notes carry and why file_presence_unread stays fix-blocking. Merging main again (source worker history) conflicted only in an import block of tests/unit/test_source_access_plan.py, which keeps both sides; every generator and the analyzer corpus (LOOM_ENV_FILE= python -m tests.analyzer.corpus --write) match the merged tree, and the plugin manifests are main's (1.2.172), checked line by line. The scan's counts move with main's new re-raising handler in connected_accounts.py (939 broad, 569 pass, server/knowledge/app 115). The scan and the backport, worker, patch-history, knowledge search, source passages, repository-docs, source access plan, doc-link and public-copy tests pass (719), with make lint typecheck, the generators' --check and the Ruff format check.
  • At f8f1c1a, the next review's items are fixed (found in review, above): a mirror git cannot read and a -S probe git refuses raise MirrorReadError and are named, where main and this PR answered no_branch_ref or error:git with no note; BRANCH_STAGE_NOTES is BRANCH_NOTES, and its comment, the worker's docstrings, the code.backport_gap bullet and the Cached answers note say what each member's row stores and name the per-branch notes left out (file_presence_unread, backport_ledger_dropped, as_of_unread); a line probe that raised leaves the branch undecided unless another probe names the pick; docs/reference/http-api.md says a document search that lost a mirrored document takes back the lost render's entries; the wider pass's discard() comment names its legs' notes; and the round note above lists what each place takes back. New tests: the exit-1 rule and the raise on an empty or absent mirror, an empty mirror through the worker, a refused probe on either leg, a failed ledger read, and an unknown lag's rows; each fails without its change. The plugin manifests are main's (1.2.172). The scan's counts are unchanged. The scan and the backport, worker, settle, fanout, loom_search, source fanout, doc-link, public-copy, agent-instruction and package-contract tests pass (822), with make lint typecheck, the generators' --check and the Ruff format check.
  • At 83fec11, the next review's items are fixed (found in review, above): an empty mirror path raises MirrorReadError like a mirror git cannot read, and a missing ref (no branch name, or exit 1) answers no_branch_ref (the empty-mirror test covers it and fails without the change); the comments on BRANCH_NOTES, the worker's docstring, the code.backport_gap bullet and the Cached answers note say a patch or history read leaves the row that presence and the record gave (a files-only fix floors on file presence, and a branch the record decided keeps that verdict) and an unknown lag changes no row; as_of_unread is named as reading unknown(no_index) where the row would read not_affected; and a line probe that raised leaves the branch at error:*, or deadline when another probe timed out. origin/main is at 674fe4f (The MCP source worker serves account enrollment #2125), which touches only source_worker/, docs/architecture/mcp-source-worker.md and a workflow, none of this PR's files and no manifest; git merge-tree --write-tree origin/main HEAD merges cleanly, so no merge is needed, and the plugin manifests are main's (1.2.172). tests/unit/test_code_backport_gaps.py and the other backport, settle, patch-history, scan, public-copy and doc-link tests pass (448), with make lint typecheck and the Ruff format check.
  • At 4314832, the comment on BRANCH_NOTES, the worker's docstring, the code.backport_gap bullet and the Cached answers note no longer list what each note's row stores, which the review at 83fec11 found inexact for a branch the record decides and for a probe that names the pick: such a row claims only what the reads that answered show. origin/main is at 1cef2eb (Plugin hooks send their requests with node:http and node:https, not fetch #2123), which bumps both plugin manifests to 1.2.173 and changes tests/unit/session_content_senders.json in lines this PR does not touch; this PR changes no manifest, git merge-tree --write-tree origin/main HEAD merges cleanly, and the squash merge takes main's manifests. tests/unit/test_code_backport_gaps.py and the Ruff format and lint checks pass.
  • The scan, the unit test files this PR touches and make lint typecheck pass, with the function-length gate at its baseline (52 over 50 statements, 0 over 200 lines) and every codegen --check current. make format-check passes but for frontend/src/views/assistant/Chat.test.tsx, which main leaves unformatted and Format the assistant source-link assertion #2107 formats. Focused unit tests pass: degradations, incidents, the code and memory reads and their caches, idempotency across transports, MCP lean results, loom_search, settings, reach census, package contracts, transport layering, tunable constants, MCP listing budget, op budgets, read scope, worker status, cross-org rule, the analyzer corpus, public copy and doc links. The full unit suite ran locally too: what fails there fails on this machine alone (no /proc, pidfd_open or memfd_create on macOS, native diagnostics that need Linux, a clickhouse-local without enable_quantized_codec, and test_cli_native_wrappers.py, whose 32 failures are the same on a clean origin/main).
  • The analyzer corpus is regenerated: two new shapes; the streak read's shape changed with its label rule, and the request read's with the ops.incidents filter; nothing else changed.
  • Run under py3.12. One test fails on macOS only: test_worker_status.py::test_native_refusal_metadata_reaches_pytest_cli_without_starting_tests (native diagnostics require Linux). It is unrelated to this change.
  • No integration run: there was no ClickHouse on the machine.
  • Two CI checks are red for causes outside this change. Both Postgres storage jobs fail test_cell_prepared_bot_native.py::test_normal_prepared_later_cell_proves_both_bootstrap_keys, as the Postgres 18 storage job does on main: provisioning can start while the first cell still reads recording mode, so the bot identity endpoint refuses, and Prepared bot tests wait for enforced tenancy #2106 makes the test wait for enforced mode. Dependency review finds no dependency change, but cannot complete: a pull request head has no dependency snapshot, and the fallback refuses a comparison of 300 or more files or any change under sdk/rust/, which the regenerated Rust SDK makes, as on other pull requests that regenerate it.

AI assistance in the code (leave one; writing this description with AI is fine):

  • AI-generated (an agent wrote most of the diff): Claude Code wrote the diff and its tests. The owner reviews it before merge.

  • I can explain every line of this diff and how it interacts with the rest of Loom.

Checklist

  • Local format, lint, type checks and focused tests pass. The full make test-unit and applicable integration results are reported by CI; a full local run is not required before pushing.
  • Generated files are regenerated in this PR, not by hand: the SDK op tables, docs/reference/configuration.md and the docs/reference/ tables (python scripts/codegen/docs_reference.py), the reach manifest, schemas/schema.sql (make schema-dump), the Codex plugin copies (python3 scripts/codegen/agent_plugin_sync.py) and the standalone skill bundles (python3 scripts/codegen/standalone_skills.py).
  • A new migration is additive and numbered after the latest on main; no merged migration is edited.
  • A behaviour change to any file a plugin ships (hooks/, lib/, bin/, skills/, .mcp.json, the Codex plugin-defaults.json) bumps both plugin manifests' version, and no other open PR uses that version.
  • The frontend builds (npm --prefix frontend run build) and its tests pass, if frontend/ changed.
  • Docs under docs/ describe the system as it now is, and this description names any operator steps and wire changes.
  • Repository text has no dates, people, host names, internal namespaces, ticket or decision numbers; the history goes in this description (tests/unit/test_public_copy.py).
  • Commits are signed off (git commit -s), as CONTRIBUTING.md asks.
  • I signed the Contributor License Agreement (CLA) if CLA assistant requested a signature.

🤖 Generated with Claude Code


Note

Low Risk
The visible diff is documentation, codegen output, and settings schema comments—no behavioral server logic beyond a trivial comment tweak.

Overview
This change documents and wires up reference material for two related capabilities: per-response degraded disclosure and deployment-wide ops.incidents polling.

degraded: Adds a full Degraded answers section to the HTTP API reference (transport merge rules, MCP lean behavior, cache/keep vs take-back semantics, paging). Updates guides and architecture docs so fallbacks use source: effect (kind) (not “providers only”), mirror failures surface as knowledge: mirror_unread, and code.search documents literal/definition-leg partiality (retrieval_work.literal_read_cut, definition_leg_failed). Generated operation pages and the docs codegen template now point every op at that section; memory op field docs and Go SDK HTTP decoding include degraded.

ops.incidents: Registers the new viewer op in the operations index (382 ops), adds monitoring/configuration docs (incident kinds, auth for org SLIs, cached ClickHouse reads), LOOM_OPS_INCIDENTS_* settings in loom.example.yaml and the settings JSON schema, and the generated ops.incidents API page.

Other doc fixes: HyperDX write-outcome table points at memory/app/set_commit.count_write, trims to eleven outcomes (drops bulk-path unknown), and expands deployment_scoped wording for incidents-style aggregates.

Reviewed by Cursor Bugbot for commit fd58ac1. Bugbot is set up for automated code reviews on this repo. Configure here.

…cidents lists current incidents

The transports attach the request's degradation notes to every op
response over HTTP and MCP, merged after the op's own list and absent
when empty; the MCP lean pass keeps them at the top and loom_search
adds a Degraded: line to its text. The code-read fallbacks that served
a smaller answer silently (review brief, symbol, coverage, search,
grep, ask, pr_check legs) now record a note, outside provider health.

ops.incidents (viewer, experimental, reached with loom_op) lists the
failing readiness checks, providers failing within the window, workers
failing 3 or more passes in a row, and the caller's org's SLO classes
whose server-side failure share crosses a threshold. Each ClickHouse
read is bounded and an unread source is named in degraded. Three
settings: ops_incidents_window_minutes, ops_incidents_error_share,
ops_incidents_min_requests.

Part of: #2040

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>
@vercel

vercel Bot commented Dec 2, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
loom-docs Ready Ready Preview Dec 4, 2026 7:47am UTC
loom-telemetry Ready Ready Preview Dec 4, 2026 7:47am UTC

Request Review

…reads cheaply

- The MCP lean pass keeps a non-empty top-level degraded, so an
  idempotent replay serves the list its first answer stored.
- note() skips an entry the request already holds; the cap of 8
  counts distinct notes.
- A unit-test fixture starts every test with no note list.
- ops.incidents reads each ClickHouse source at most once every 5 s
  per process, a failed read included and still named in degraded.
  The worker read keys on the enabled worker names, a 6 h window and
  this deployment's labels, so isolated and bench servers sharing
  loom.worker_status are not listed. supervisor.ALERT_THRESHOLD is
  public. Both statements are in the analyzer corpus.
- Request counts are read only by a token over every namespace of the
  org that reads whole namespaces: sli_minute keeps no namespace or
  user.
- The constructor-coverage probe caches a failed read with its kind
  and notes it on every answer it serves; code.search does not
  memoize, and code.ask does not store, an answer whose request
  noted anything.
- enrich.bounded() notes a failed read, not a cut by its bound: the
  callers pass what is left of their budget.
- The ops.incidents input docstring opens with one whole sentence;
  the docs name what an entry carries and who reads request counts.
- The SDK public-surface snapshot carries ops.incidents.

Part of: #2040

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

@cursor cursor Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Stale Bugbot comment from a previous run.

Comment thread server/insights/app/incidents.py Resolved
zlareb1 and others added 3 commits December 3, 2026 01:17
… fell back is not stored

- ops.incidents: a lock per (source, org) makes polls that arrive while a read
  runs wait for it and share its answer, so a burst of polls runs one statement
  per source.
- Review briefs: build_for_merge and build_for_open serve a brief unstored when
  a read it ran fell back, since the stored copy would be served later without
  its degraded. The ingest worker builds each brief in degradations.scoped(),
  so one brief's fallback does not keep the next from being stored, and a
  code.refresh that waits keeps its own notes.
- enrich.bounded() notes a read cut by the fixed code_enrich_timeout_s (the
  store answered slowly) and stays silent for a cut by the caller's remaining
  budget.
- The broad excepts rewritten in code.grep, code.symbol and code.search say
  what they keep serving.
- monitoring.md and the dashboard's reason for leaving out ops.incidents say
  what each surface shows: worker incidents name workers of every deployment
  process, which /v1/health?include=workers does not.
- memory-architecture.md: memory.search_trace carries the note in the
  transport's degraded.

Part of: #2040

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>
…graded

- build_for_merge and build_for_open note git_mirror: diff_unread when git
  could not read the diff of a PR that changed files, and the merged brief
  answers stored: false; it answered stored: true for a brief nothing stored.
- The overrides probe caches the failed read's kind with its fail-closed
  answer and notes it on every answer that serves it, as the constructor
  probe does.
- result_lessons passes what is left of the call's deadline only when that is
  less than code_enrich_timeout_s, so a lessons read no deadline narrows takes
  the fixed bound and is noted when cut by it.
- http-api.md says a cut by LOOM_CODE_ENRICH_TIMEOUT_S is listed and a cut by
  the request's remaining deadline is not.
- The readiness leg of ops.incidents drops its except: each check already
  answers as failing when it raises or times out.
- The narrow-token reason and the dashboard's reason for ops.incidents say
  what a narrowed token reads and what only this op carries.
- Tests: code.search does not memoize and code.ask does not store an answer
  whose request noted a fallback, and both do with no note; an HTTP body
  without org polls the token's org.

Part of: #2040

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>
…ts leaves draining out

The read handlers of both planes note each fallback that serves a smaller
answer: about 150 broad excepts after a sweep of server/code/app and
server/memory/app. An answer a fallback served is not kept where a later
call would read it without its notes: code.map's map, a published code
status, a memory.ask precedent, a facts.traverse walk and the nightly
backport rows. Caches that keep a failed read (the code status, the
pending-extraction count, namespace health) name it on each answer they
serve, and a later code.search page names its first page's notes.

ops.incidents leaves the draining readiness check out, since every deploy
drains a process. The worker streak read keeps rows whose label's first
segment is exactly `deploy`, one rule for the SQL and label_family, and
both incident statements run on clickhouse-local in a new test.

Part of: #2040

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>
@zlareb1 zlareb1 changed the title Every response served from a fallback says so in degraded, and ops.incidents lists current incidents Responses served from a fallback say so in degraded, and ops.incidents lists current incidents Dec 2, 2026

@cursor cursor Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Stale Bugbot comment from a previous run.

Comment thread server/code/app/index_status.py Resolved
…low the org-wide rule

degradations.unit() isolates a block's notes and then lists them in the
caller's: code.search, code.ask's fresh answer, code.map, facts.traverse,
memory.ask, the review-brief builds and each repository status keep an
answer only when their own unit noted nothing. Every read fallback calls
degradations.partial(), note with health=False fixed.

code.symbol asks only the dependency namespaces the caller may read, so
degraded never names one it cannot. ops.incidents reads request counts
only for a caller that reads the org whole (reads_every_namespace, now
shared with resolve_org_scope) with no restricted namespace hidden.
Statuses sharing a failed ledger read each carry its note. A merge sha
the mirror does not hold is a miss, not a failed read. The backport-gaps
worker logs a fallback and reads the fix once more within the pass
budget. Each worker pass and status refresh starts with no notes, and
fixed-bound timeouts in memory.search and memory.for_file are noted.

Part of: #2040

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

@cursor cursor Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Stale Bugbot comment from a previous run.

Comment thread server/code/app/context.py Resolved
degraded is the one field a client checks without knowing each op's own
disclosure fields. The fallbacks that only showed in an abstain reason,
skipped, a partial_reason, a *_failed count, a section's failed or an
unknown verdict now note in degraded as well, and the op's own field is
unchanged: 34 code-plane sites (code.ask, code.search's legs and pick,
code.grep, code.conventions, code.setting_facts, code.bisect_candidates,
code.callers, code.symbol's uses legs, code.enclosing, code.review_brief's
rationale, the index status lag and calibration) and the memory plane's
memory.inspect sections, loom_search's failed legs, memory.search's term
leg, tags, unit bodies, page blob and tag belt, and a failed projection
retry.

Part of: #2040

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

@cursor cursor Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Stale Bugbot comment from a previous run.

Comment thread server/code/app/answers.py Resolved
Comment thread server/code/app/index_status.py Resolved
zlareb1 and others added 8 commits December 3, 2026 06:47
…arry them too

A code.search pool row keeps the notes taken when the ranking returns, so a
later page no longer repeats page 1's risk block, whole-file expansion or index
head. A code.grep pool row keeps its scan's notes and a memory.search parked
page keeps its ranking's, and each later page names them again; a payload
without the key serves as before.

A search whose embedder would not build notes embedder: query_vector_dropped,
so the memo does not keep it. code.ask with no embedder adds no second note.
A code.map render the index head moved past is discarded with its notes.
code.symbol reads each dependency's grant with row_reach and notes
identity: dependency_unverified, naming no namespace, when one cannot be read.
A delegated org admin's * token reads ops.incidents request counts, under the
org-wide rollup rule; the docs and tests say so.

Part of: #2040

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>
… served pass's notes

loom_search's repository legs, memory.ask's code grounding and code.ask's
memory context read the grant with row_reach. When it cannot be read they note
identity: repo_gate_unverified, code_grounding_unverified or
memory_context_unverified, with no reason or namespace, so the answer and
precedent caches do not keep the smaller answer.

A memory.search consistency reread runs in degradations.scoped(). When its
answer is served, its notes replace the first pass's; a reread that fails or
finds nothing is dropped with its notes.

No delegated token reads ops.incidents request counts: org_admin is never
delegated and a child is capped at admin. The test mints its child through
delegation.delegate. The docs and the gate's docstring say that calls to
collections the caller cannot read are counted. http-api.md now says a missing
degraded key means no fallback was noted, names the caches that keep a
fallback with its entries, and covers code.grep and memory.search pages.

Part of: #2040

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>
code.index_status and code.repos noted git_mirror: lag_unknown whenever
git could not count the commits between a watermark and the clone head,
so a watermark the clone did not hold yet marked the status degraded and
kept it from being published. When the count fails, each sha is checked
with rev-parse --verify --quiet: exit 1 (no such commit) gives lag -1
and no note, exit 128 (git cannot read the mirror) keeps the note and
the status unpublished.

The check is gitrepo.holds_commit, which mirror_commit_facts now uses
too.

Part of: #2040

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>
…r it read the calls

- readable_subset, readable_namespaces and restricted_namespaces_hidden_from
  read each verdict with row_reach (or the new authz.restricted_verdict).
  A namespace whose grant could not be read is still left out, and the
  answer notes identity: fanout_unverified, code_links_unverified or
  restricted_unverified, naming no namespace. The request-SLI scan pins
  direct row_reach and restricted_verdict calls too.
- ops.incidents answers requests: read, not_permitted or unread on every
  answer, so an ok that did not consult the org's calls says so.
- memory.search parks the notes taken through the verdict, so a failed
  term leg is named on later pages too.
- code.index_status notes lag_unknown when no clone tip is published and
  git cannot read the mirror's.
- Code lessons note a failed file read, and a lesson path or file read
  cut within the fixed enrichment bound; a cut by the call's deadline
  stays unnoted.
- code_backport_gaps notes a pass failure (FellBack) for a fix whose read
  falls back again, so a fix that never gets written builds a streak.
- Comments and docs: the table-summary except, the brief builder's
  scoped(), and the ops.incidents source cache in the degraded section.

Part of: #2040

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>
…stry notes

The `read` class counted `ops.incidents` itself, so a client polling it through
an outage diluted the failures it asked about and helped a quiet org clear the
call floor. The request read now filters on `operation != 'ops.incidents'`.

`loom_search`'s repository legs dropped silently when the registry was not read
yet; they now note `identity: repo_registry_unread`. `restricted_hidden` returns
whether a restricted grant could not be read, so `ops.incidents` no longer
infers it from the notes inside a unit. The `deployment_scoped` reference row,
the `memory.set_from_messages` `degraded` description and the dashboard's
reason for leaving out the op match what the code does.

Part of: #2040

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>
The binding gate read the grant through `row_in_scope(..., hides_answer=False)`,
which turned an unreadable grant into a quiet refusal, and its except only
logged. code.history, code.blame_range, code.symbol's history,
code.bisect_candidates and memory.ask then answered without the tracker facts
and named nothing. The gate now reads `row_reach`: an unverified refusal of a
tracker Loom adds notes `identity: tracker_unverified`, one the caller named
still marks the request, and a gate that raises notes
`identity: tracker_gate_unchecked`. The duplicate check's fan-out, the test
signal's churn namespace and a remote's indexed branches note the same way, and
memory.ask notes a failed tracker facts read.

The monitoring page and the incident settings' comments say `ops.incidents`'
own calls are left out of the request share and the call floor.

Part of: #2040

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>
Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

# Conflicts:
#	sdk/go/wire/models.gen.go
#	sdk/rust/src/wire_models.rs
…cker notes

A failed symbol-stats or unit-risk count was not cached, so every
code.index_status call reran the FINAL counts. It is now kept for
PROBE_ERROR_TTL_S with its kind, and every answer served from it names it in
`degraded`. memory.ask's record route notes a linked tracker it could not read
(`memory.ask: record_tracker_unread`) beside the answer's `Not read` line.

The `degraded` comments on memory.search and memory.set, the SDK docstring and
two guides say the field names a provider, a store read or a gate. The guide's
`deployment_scoped` row matches the reference, and the incident share comment
and two paragraphs are rewrapped.

Part of: #2040

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

@cursor cursor Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Stale Bugbot comment from a previous run.

Comment thread server/code/app/index_status.py Resolved
A kept failed count was served before the published row was looked at, so a
status whose state already held the summary answered zeros and a note for up
to PROBE_ERROR_TTL_S. The row in hand now answers first; the kept failure only
spares the count.

Part of: #2040

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

@cursor cursor Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Stale Bugbot comment from a previous run.

Comment thread server/code/app/index_status.py Resolved
zlareb1 and others added 2 commits December 3, 2026 12:42
The memo was cleared at 256 entries before a kept failure was served, and the
failure was not written back, so the next poll reran the count the entry was
there to spare. The eviction now runs only before a write.

Part of: #2040

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>
tests/unit/test_degraded_unnoted.py walks server/code/app and
server/memory/app outside the index plane. A broad handler passes when it
always raises, calls degradations.partial, note or restore, or keeps the
failure's text for the answer through caller_text(e). Every other handler
is listed in tests/unit/degraded_unnoted.txt with its category, and the
test fails on a handler in neither place and on a stale entry.

Going through the list added a note wherever the answer got smaller:
memory.search's computed count, date difference and support count, its
outer stage catches, graph, chunk, boost, spelling and paging legs;
memory.ask's decomposition, intent, grounding and row legs;
set_from_messages' judge, sweep, backfill and checks; context.pack's
sections; code_index: state_unread, which judges a commit against cached
heads; and the code search, grep, bisect and citation reads. Seven caches
that kept a failed read as a plain value now keep its text and name it on
each answer served from them. A failed re-read under scoped() is noted
after the block, which drops an unserved re-read's notes.

Store fallbacks that fed provider health with nothing to clear them now
use partial. The rerank endpoint and Cohere record their successes, and a
second test fails on a health-counted note no record_success clears.

Part of: #2040

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

@cursor cursor Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Stale Bugbot comment from a previous run.

Comment thread server/code/app/repos.py Resolved
Comment thread server/code/app/common.py Resolved
index_as_of serves its block from a 30 s cache. A block built while the
clone's lag read failed (lag_commits -1) is kept with the failure's text
and names git_mirror: lag_unknown on each answer served from it, not only
on the first.

code.repos' listing gate noted identity: listing_gate_unchecked for every
exception, including the PermissionError and IdentityIncompleteError that
list a repository request-only to a member who cannot read it. It now
notes only a check that could not run, such as a failed SCIM read.

code.coverage keeps a failed gap read for the counts' max age again,
rather than retrying it on every call, and names it on each page served
from it.

The sender census's reviewed digest of sdk/python/loom/memory.py is
renewed for the docstring change to `degraded`; no sender changed. The
code.search pick tests stub the coverage note their fake repository
cannot read.

Part of: #2040

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

@cursor cursor Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Stale Bugbot comment from a previous run.

Comment thread server/code/app/index_status.py Resolved
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

@cursor cursor Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Stale Bugbot comment from a previous run.

Comment thread server/memory/app/loom_search/fanout.py Resolved
Resolve the overlap with the review-brief verdict change:
- code.setting_facts keeps main's verdict and causes and notes each read that failed.
- The PR overlay keeps main's count of a parse that raised. Calls or edges the
  extractor could not list are counted in overlay_note the same way, and the
  overlay is kept with that note.
- The brief builders keep main's store gates inside their unit, beside the
  keepable gate. The reads main added note a failure: file rows, a file's
  language, wiring callers, the indexed head and the drift read. The repository
  config, read in process, is listed as a settings fallback.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

@cursor cursor Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Stale Bugbot comment from a previous run.

Comment thread server/code/app/index/pr_overlay.py Resolved
zlareb1 and others added 8 commits December 4, 2026 08:19
The memory stack's build and a knowledge search's render held
`current()`, which flattens the scoped list: an `unkeepable` mark set in
the step never reached the caller's unit, and a group held inside it was
listed as a copy a later swap could not change. A held group now carries
notes, inner groups and the mark, `_flat` and `keepable()` read through
it, and both steps hold their `scoped()` list. Dropping the step takes
all of it back.

code.setting_facts gets a test that fails its test-count read: the note
is listed, the count is 0 and the causes are unchanged.

A merged review brief served unstored logs its failed reads, whether a
read fell back and whether the tracker read failed, as the open brief
does. The allowlist header names the four kinds of site the scan lists.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>
The sequential re-read returned `current()` from its `scoped()` block,
so the pass that serves it restored flat text: a mark set in the re-read
never reached the pass's unit. It now returns the scoped list, as the
memory stack and the knowledge render hold theirs.

The review brief builders bind whether a read fell back, and whether
the tracker read failed, once for the store gate and its log line.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>
The docstring of _sequential_pass broke a sentence across a short line;
it is reflowed, with no change to the text.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>
A failed re-read answers None and is never served; its note is taken
after the scope, so it stays when the caller drops that re-read's list.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>
…ile note

Under a marked plan, loom.search's knowledge section builds the wider
search while it ranks the first pass. When the renewed first pass fills
the page alone, the section served no wider result but kept its render
notes; it now discards the wider search before it returns.

mentor.brief named profile_unread whenever the profile was None with the
TTL on, but mentor_profile also answers None without a read for an empty
org or namespace. The note now needs both.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>
loom.search, marked plan: the first ranking's eager widening that
failed wrote knowledge: widened_hits_dropped, although that ranking is
never served once its widening failed. Its expander now records the
error and answers with the first pass; cached raises it again only for
a renewed ranking that still needs the wider result, and an ordinary
section names its own widening.

Repository search: the notes a pass's legs make while they run (a
lexical leg dropped, the extra leg's repo_docs_dropped) went straight
into the request's list, so a pass left out kept them. run_repo_search
now runs its legs in scoped() and holds that list on the RepoSearch;
discard() empties it, and a served pass lists it through the group. A
search that fails holds nothing, which replaces the finished-leg loop.

code.backport_gap: its symbol, patch and history stages run under
fixed walls (settings, as the op takes no caller deadline), so a stage
cut by its wall is a slow read; a cut and a read that raised are now
noted (code_index: symbol_presence_*, patch_presence_*, git_mirror:
branch_history_*, with the exception's type).

mentor: profile_read_applies(org, namespace) is the one no-read rule
for mentor_profile, warm_profile, the hint and mentor.brief.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>
Resolve the overlap with the MCP read client and the source live read:
- response_body keeps main's _note(op, ...) and lists the request's
  notes through on_response.
- The Go, Rust, TypeScript and Ruby SDK tables and the operations and
  status references are regenerated: 382 operations, main's
  knowledge.source.live beside this branch's ops.incidents.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>
A stage cut or read that failed on one branch made the nightly worker
read the whole fix as fallen back: no branch got a row, FellBack was
noted, and the streak built. Each such outcome is the branch's own,
which its row carries (a presence reason of deadline or error:*), so
the worker's fallback check now leaves out backport.BRANCH_STAGE_NOTES:
the six stage notes and the history leg's patch_history_timed_out. A
fix-wide note (the fix ledger, the tracker, file presence) still keeps
the fix unwritten. code.backport_gap keeps listing every note.

The stage notes take the error itself as their reason, so a Loom error
reads as its code, and branch_presence_unread is file_presence_unread.

docs/reference/http-api.md now promises what holds: degraded never
leaves out a fallback the served answer used, Loom takes back the notes
of the work it drops at the sites it names, and it names three cases
where a note of replaced work stays.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes using high effort and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 5240eda. Configure here.

Comment thread server/code/app/backport.py Resolved
zlareb1 and others added 12 commits December 4, 2026 11:00
Two more per-branch history notes made the nightly worker leave the
whole fix unwritten: git_mirror: patch_history_unread (a branch's tip
read raised) and patch_history_line_unread (a line probe raised). Each
leaves that branch's history reason error:<type> and its row at the
symbol floor. git_mirror: lag_unknown is one branch's lag, which no row
stores. BRANCH_STAGE_NOTES holds all three now. file_presence_unread
stays out: that branch's row would read no_index, not error:*.

A worker test drives every member of the set through compute_fix and
the composed read (the real stage where cheap, else a branch read that
makes the note) and checks that every branch's row is written; another
checks that a failed file presence read still leaves the fix unwritten
with FellBack. The worker's docstrings name the exception.

docs/reference/http-api.md: Loom never takes back an entry of a
fallback the served answer used. The places it lists take back their
renders' entries; only loom_search's repository search takes back its
legs' entries too, when the whole search is dropped, and those leg
entries are among the examples that stay.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>
Resolve the overlap with source worker history: the source access plan
test keeps main's binding and store imports beside the degradations one.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>
A mirror git cannot read (`rev-parse` exits 128, as for an empty
directory or none at all) answered `no_branch_ref` with no note, and a
`git log -S` probe git refused answered `error:git` with no note. Only
the ref's miss (exit 1) is `no_branch_ref` now; any other exit raises
`MirrorReadError`, so the history stage names `branch_history_unread`.
A probe exit other than 0 raises too, so the leg names
`patch_history_line_unread`.

`BRANCH_STAGE_NOTES` is `BRANCH_NOTES`, since an unknown lag is no
stage outcome. Its comment and the worker's docstrings say what each
member's row stores: a symbol-presence cut or failure stores `unknown`
with `deadline` or `error:*`, a patch or history one the symbol floor,
unsettled, and an unknown lag changes no row. They name the per-branch
notes left out of the set: `file_presence_unread`,
`backport_ledger_dropped` and `as_of_unread`. A line probe that raised
leaves the branch undecided unless another probe names the pick.

`docs/reference/http-api.md` says a document search that lost a
mirrored document takes back the lost render's entries, and the
comment on the wider pass's `discard()` says its legs' notes go too.

Tests: a missing ref is still `no_branch_ref`; an empty or absent
mirror raises; an empty mirror through the nightly worker names
`branch_history_unread` and writes every branch's row; a refused probe
on either leg is named; a branch whose ledger read failed leaves the
fix unwritten with `FellBack`; and an unknown lag writes the rows
written without it. Each fails without its change.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>
`_unreadable_ref` answered `no_branch_ref` for an empty `git_dir`, which
means there is no mirror at all. Only an empty branch name answers
`no_branch_ref` now; an empty `git_dir` raises `MirrorReadError`, as a
mirror git cannot read does, so the history stage names
`branch_history_unread`. The empty-mirror test covers an empty path
and fails without the change.

The comments on `BRANCH_NOTES` and the worker's docstring say a patch
or history read leaves the row that presence and the record gave (a
files-only fix floors on file presence, and a branch the record decided
keeps that verdict), that an unknown lag changes no row, that
`as_of_unread` reads `unknown(no_index)` where the row would read
`not_affected`, and that a line probe that raised leaves the branch at
`error:*`, or `deadline` when another probe timed out.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>
The comment on BRANCH_NOTES and the worker's docstring listed what each
note's row stores, which missed a branch the record decides and a probe
that names the pick. Such a row claims only what the reads that answered
show; that is the rule the worker relies on.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>
… is restated

A failed index watermark read (`as_of_unread`) keeps the fix unwritten,
now with a worker case beside the file-presence and ledger ones.
`_read_fix` and the per-branch test no longer restate the rule the
module docstring holds, and the left-out notes can leave such a row:
on a branch the record decides, none changes it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>
Three notes about one branch's read stay out of BRANCH_NOTES and keep
the fix unwritten; the worker's docstrings now say "a note BRANCH_NOTES
lists" where they said any note about one branch's read.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant