Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
46 commits
Select commit Hold shift + click to select a range
5c6eae0
A failing knowledge source no longer marks Loom degraded for every or…
zlareb1 Dec 4, 2026
099c351
Each source sync leg notes a failure only when most orgs' sources fail
zlareb1 Dec 4, 2026
375376c
A source sync leg counts its failing orgs against every org the pass …
zlareb1 Dec 4, 2026
e529d1c
A source sync leg counts against the orgs whose sources the pass syncs
zlareb1 Dec 4, 2026
e079a35
ops.incidents sources leave out the collections the caller cannot read
zlareb1 Dec 4, 2026
b29f113
A refused credential never counts toward the source sync worker's fai…
zlareb1 Dec 4, 2026
b0a7285
Mining counts the documents a pass tried, not a source's documents
zlareb1 Dec 4, 2026
a6f3746
Merge origin/main into fix/source-failures-not-loom-degraded
zlareb1 Dec 4, 2026
8be0c26
Mining counts against every org the pass serves, as the other legs do
zlareb1 Dec 4, 2026
03452ef
A source sync note names the kind of the orgs that failed
zlareb1 Dec 4, 2026
3169914
A source sync note is the leg's, and the sources read takes its scope
zlareb1 Dec 4, 2026
a4828fc
A failed record write of each org's only source is tested to note once
zlareb1 Dec 4, 2026
78e8d59
Mining's two-try floor is on the pass, not on each org
zlareb1 Dec 4, 2026
2e1f8cb
A failed mining read of a deployment's only source still notes once
zlareb1 Dec 4, 2026
3617e6e
ops.incidents keys the sources cache on the clause it runs
zlareb1 Dec 4, 2026
767c981
Dormant orgs whose credentials are refused do not hide an outage
zlareb1 Dec 4, 2026
87a4334
No leg of a source sync pass counts an org whose every turn was refused
zlareb1 Dec 4, 2026
9cd2049
A source sync failure note names the kind of the most failed units
zlareb1 Dec 4, 2026
ad538c8
An org whose every turn was refused counts only in a leg that ran for it
zlareb1 Dec 4, 2026
822b0a6
Merge origin/main into fix/source-failures-not-loom-degraded
zlareb1 Dec 4, 2026
487839b
deployment_scoped names ops.incidents' failing sources among its org …
zlareb1 Dec 4, 2026
75541d7
A credential the deployment's secret no longer opens counts as the wo…
zlareb1 Dec 4, 2026
c5a64ad
ops.incidents stops each ClickHouse read at the bound it waits for
zlareb1 Dec 4, 2026
10bee68
ops.incidents keeps a failed read as long as an answer
zlareb1 Dec 4, 2026
1cdeade
SourceTally.handled names a failure's kind `kind`
zlareb1 Dec 4, 2026
8607d75
Merge origin/main into fix/source-failures-not-loom-degraded
zlareb1 Dec 4, 2026
b81b76b
ops.incidents' sources TTL test uses the shared ManualClock
zlareb1 Dec 4, 2026
9ce782c
ops.incidents keys its sources read without the caller's own collection
zlareb1 Dec 4, 2026
9dbeb47
ops.incidents' docstring keys the worker streaks per process, not per…
zlareb1 Dec 4, 2026
a914509
SourceTally names its flag failed_whole; the refusal test reads as one
zlareb1 Dec 4, 2026
91e2666
ops.incidents docs name an unread reach as a cause of unread sources
zlareb1 Dec 4, 2026
65431a0
The knowledge page says where a failed retirement of a source shows
zlareb1 Dec 4, 2026
0f0ea29
A failed retirement is judged against the orgs it retired for
zlareb1 Dec 4, 2026
99f6d15
Docs state the retirement rule as SourceTally.note applies it
zlareb1 Dec 4, 2026
dee323d
OpsIncidentSources names the mining leg among a pass's failures
zlareb1 Dec 4, 2026
367e4fe
ops.incidents' description leaves the platform admin out of the grant…
zlareb1 Dec 4, 2026
130e7c6
The analyzer's sources scope is pinned to collection_clause
zlareb1 Dec 4, 2026
f80dd9d
A lost folder's failed turn is pinned as counted in the sync tally
zlareb1 Dec 4, 2026
7d152db
The lost-folder rule states the trade the tally makes
zlareb1 Dec 4, 2026
54bb47c
The mining rule names the orgs the document bound leaves waiting
zlareb1 Dec 5, 2026
78cabc6
The mining rule counts the orgs the pass serves, at no more than half
zlareb1 Dec 5, 2026
23b6f4e
The sources read's credential and mirror filters each have a row of t…
zlareb1 Dec 5, 2026
55a898a
Merge main into fix/source-failures-not-loom-degraded
zlareb1 Dec 5, 2026
f02d225
A worker copy's failed turn is pinned under the one mirrored code
zlareb1 Dec 5, 2026
d422894
The monitoring page says the sources can hold an answer for two bounds
zlareb1 Dec 5, 2026
fa62bea
Merge main into fix/source-failures-not-loom-degraded
zlareb1 Dec 5, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1038,6 +1038,7 @@ jobs:
tests/integration/test_projection_failures_restricted.py
tests/integration/test_mirror_checked_search_http.py
tests/integration/test_mirror_checked_list_http.py
tests/integration/test_ops_incidents.py
# The statement corpus: every builder's shapes through
# EXPLAIN QUERY TREE on the migrated service, and shapes.txt in step
# with the builders. ~10 s; a rejection here is a statement that would
Expand Down
8 changes: 5 additions & 3 deletions docs/architecture/document-sources.md
Original file line number Diff line number Diff line change
Expand Up @@ -636,9 +636,11 @@ the public fallback. No reranking provider receives the provisional pools.
source's status, a worker's pass notes, logs, spans and metrics, the extractor
service's logs and traces) carries codes only (exceptions 3 and 4 apart).
Worker pass summaries exclude mirrored turns' completed-source counts, document
figures and cut flags. A failed mirrored turn contributes only `SYNC_FAILED`, for
every cause; returned turn details remain private. Mirrored per-file failures emit
no log record, since the number of records would disclose a document figure.
figures and cut flags. A failed mirrored turn contributes only `SYNC_FAILED` and
counts as failed in the pass's per-org tally of turns, for every cause, a refused
credential included; returned turn details remain private. `ops.incidents`'
`sources` counts no mirrored source. Mirrored per-file failures emit no log record,
since the number of records would disclose a document figure.
A sync turn enters its private diagnostic scope before taking its source lease or
listing files; retirement enters it before reading its queue. That scope suppresses
client and provider instrumentation, database
Expand Down
59 changes: 59 additions & 0 deletions docs/features/knowledge.md
Original file line number Diff line number Diff line change
Expand Up @@ -679,6 +679,65 @@ A source's `sync` in `list` and `inspect` shows what its last turn did:
| `unextracted` | Documents it gave up on: three failed tries, or too large for a pass. |
| `extract_error` | Why an extraction failed in the last mining turn (`not_run`, `refused`, `out_of_time`, `too_large_for_pass`, `failed:<error>`), or why documents wait (`over_cap`, `switched_off`, `switch_unread`, `no_model`, `held`, `held:<code>`, `pass_bound`). |

### Source failures and the worker's health

A failed turn belongs to its source: its `status` and `error` here, and for an org admin
the org's failing sources in
[`ops.incidents`](../operations/monitoring.md#opsincidents)' `sources`. It counts toward
the worker's failure streak only as part of an outage of most orgs:

- A leg of a pass (the sync turns, the mining, the retirement of removed sources) fails
the pass when most of the orgs it serves had most of their units fail: sources, or
for the mining the documents it tried. The worker's status row then reads
`SourcesFailed`, with an error that names the leg, such as
`sync: failed for most sources in 3 of 4 orgs (most often failed)`.
- The sync turns and the mining serve the orgs with a source the pass syncs and those
they ran for. An org a leg had nothing to do for, or that the pass bound left for the
next pass, has not failed.
- The retirement serves only the orgs whose removed sources it retired: nothing a
tenant does fails a retirement, which deletes Loom's own copies with no credential, so
one org's failing retirement fails the pass when it fails for most of the orgs it
retired for, as when that org is the only one retiring.
- So what most orgs' sources rely on counts: the store, a provider most of them use, the
model, or the deployment's secret, when it no longer opens the stored credentials. So
does a failure of most of an org's sources, or of the documents it tried, where that
org is the only one the pass serves: it holds every source the pass syncs, or every
other org's turns were refused. So does the failing retirement above. Otherwise one
org's failing sources, however many they are, never degrade the worker or
`ops.incidents` for the other orgs, and neither does an outage of a provider fewer
than half the orgs use.
- A source another copy holds counts neither way.
- A credential the provider refuses (`credential_invalid`) on a namespace's source is
its org's to rotate, so the turn is left out. An org whose every turn was refused
counts only in a leg that ran for it, such as mining the documents it stored before,
so dormant orgs never hide an outage of the active ones. A refusal every org's
credentials share, such as a provider refusing every token exchange of a host whose
clock is off, is not counted either.
- A folder or shared drive the account no longer sees ends its turn `failed`, as a
provider's error does, and counts: Loom asking for an item by a wrong id gets the same
answer. The cost: a lost folder fails every turn of its source until it is shared
again or the source is removed, so on a deployment where, in most orgs, most sources
each lost a folder or shared drive, at once or one by one, the sync leg fails every
pass.
- The mining leg is judged from two documents tried in the pass, or from one source that
failed whole: its documents unread, its record unwritten, or its mining raised. The
only document a pass tries failing to mine is that document's. An org with nothing to
mine has not failed, nor has one whose documents the pass's document bound
(`LOOM_KNOWLEDGE_SOURCE_SYNC_DOCUMENTS_PER_PASS`, which the retirement and the sync's
fetches spend first) left waiting. So a model outage is not counted while the pass
tries documents for no more than half the orgs it serves: while no more than half
have changed documents, while one org's backlog takes the bound and leaves the others
waiting, and always when the pass serves at least twice as many orgs as the bound.
- A pass that runs any mirrored turn is private, and the worker's streak stays as it
was: while auth is on, on a deployment with an active mirrored source, no leg's failure
reaches the streak, and a pass with a failed leg reads `SYNC_FAILED` in its status row.

Counted or not, a source whose last sync turn failed shows in its `status` and in its
org's `ops.incidents` `sources`, and a document that failed to mine shows in its
source's `extract_error`. A removed source whose documents could not be retired shows
in the server's log, and `add` with its name answers `SOURCE_DELETE_PENDING` until its
documents are retired; the next pass tries again.

### A recording source

A `recording` source reads transcripts, never audio or video, and nothing in Loom
Expand Down
36 changes: 31 additions & 5 deletions docs/operations/monitoring.md
Original file line number Diff line number Diff line change
Expand Up @@ -164,17 +164,43 @@ token (never an org admin) and a `*` token that names no org read none. The othe
are deployment state, the same for every org: a readiness or provider incident names the
check or provider and an error's kind, as `/v1/health` does, and a worker incident names
a worker of any of the deployment's processes with its streak and error kind, where
`/v1/health?include=workers` shows only the answering process's workers. Each ClickHouse
source is read at most once every 5 seconds per process, however many clients poll during
an outage, and each read is cut at `LOOM_READINESS_CHECK_TIMEOUT_S`. A source that failed
is named in the response's `degraded` while its failure is cached, and the other sources
still answer.
`/v1/health?include=workers` shows only the answering process's workers. In each
process, each of its ClickHouse reads runs at most once every 5 seconds (the worker
streaks, and the request counts per org), and the failing sources once a minute per org
and collection reach, since a source's sync state changes once a pass and each read
parses every one of the org's. A person's own collection holds no source and is left out
of the reach, so org admins with the same grants share a read. That holds however many
clients poll during an outage, and each read is cut at `LOOM_READINESS_CHECK_TIMEOUT_S`.
A read that failed is named in the response's `degraded` while its failure is cached, as
long as an answer would be, and the other reads still answer.
The caller's collection reach, which the failing sources need, comes from the grant
cache every call uses and is cut at the same bound. It is resolved before the sources'
statement starts, so while both are slow an answer can wait for two bounds.

Every answer says in `requests` whether the org's call counts were read, since `ok`
covers the org's calls only when they were: `read`; `not_permitted` when the call names
no single org or the caller does not read the org whole; `unread` when the counts, the
restricted set or a restricted namespace's grant could not be read.

`sources` lists the org's own
[document sources](../features/knowledge.md#syncing-a-source) whose last sync turn
failed: `failing`, how many, and `sample`, at most 5 of them (`{namespace, name,
status}`), the latest failure first, with `status` `failed`, `rate_limited` or
`credential_invalid`. It counts only the sources every reader of their namespace sees,
never a mirrored or a person's connected one. It is read under the same rule as the
request counts, and `sources.read` answers in the same words; it is also `unread` when
the caller's collection grants could not be read within
`LOOM_READINESS_CHECK_TIMEOUT_S`. It leaves out the collections the caller holds no
grant for, since an org admin reaches a collection only through a grant (a platform
admin reads every one). A failing document source is never
an incident and never by itself makes `status` `degraded`: a revoked credential is its
org's to rotate, and `status` stays Loom's own health. The `knowledge_source_sync`
worker becomes a `worker` incident after 3 failed passes in a row, like any worker. A
pass fails when it fails outright (its source list or registry unread, or past its
deadline), or when a leg of it fails for most of the orgs it serves, as
[source failures and the worker's health](../features/knowledge.md#source-failures-and-the-workers-health)
describes.

### Smoke test

After a deploy, write and read one memory end to end:
Expand Down
4 changes: 3 additions & 1 deletion docs/reference/http-api.md
Original file line number Diff line number Diff line change
Expand Up @@ -376,7 +376,9 @@ error's kind only; the full text is in the server log.
- `LOOM_CODE_PR_OVERLAY_FILE_TTL_S`: the PR overlay's per-file parse and edge results,
including a parse or call extraction that failed, which each overlay built from them
names;
- 5 seconds: each of `ops.incidents`' ClickHouse sources.
- 5 seconds: `ops.incidents`' worker streaks and the org's request counts; 60
seconds: its failing sources per collection reach. A read that failed is cached as
long.
- A later page of `code.search`, `code.grep` or `memory.search` names the entries of the
run that ranked its pool. What each page reads for itself (the risk block, context
lines, definitions, tags, bodies) it notes on its own.
Expand Down
3 changes: 2 additions & 1 deletion docs/reference/operations/ops.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,11 @@ Whether Loom is degraded now, from its checks, providers, workers and calls.

| Output field | Type | Meaning |
| --- | --- | --- |
| `status` | `Literal['ok', 'degraded']` | `degraded` when an incident is listed, else `ok`. |
| `status` | `Literal['ok', 'degraded']` | `degraded` when an incident is listed, else `ok`; failing `sources` are no incident. |
| `incidents` | `list[OpsIncident]` | Errors first, at most 20. |
| `window_minutes` | `int` | Minutes of history a `provider` or `requests` incident reads. |
| `requests` | `Literal['read', 'not_permitted', 'unread']` | Whether the org's call counts were read, so `ok` covers its calls only with `read`: `not_permitted` when the call names no single org or the caller does not read the org whole (a member, a narrowed, pinned or delegated token, a restricted… |
| `sources` | `OpsIncidentSources` | The org's document sources whose last sync failed, for its admin to fix; by default none, unread (`{failing: 0, sample: [], read: "unread"}`). |

## `ops.projection_failures.list`

Expand Down
6 changes: 6 additions & 0 deletions sdk/go/client.gen.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

33 changes: 24 additions & 9 deletions sdk/go/wire/models.gen.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 15 additions & 0 deletions sdk/python/loom/ops.py
Original file line number Diff line number Diff line change
Expand Up @@ -18857,6 +18857,7 @@ class OpsIncidentsOutput(TypedDict, total=False):
incidents: NotRequired[list["OpsIncident"]]
window_minutes: Required[int]
requests: Required[Literal["read", "not_permitted", "unread"]]
sources: NotRequired["OpsIncidentSources"]


class OpsIncident(TypedDict, total=False):
Expand All @@ -18867,6 +18868,20 @@ class OpsIncident(TypedDict, total=False):
age_s: NotRequired[Optional[float]]


class OpsIncidentSources(TypedDict, total=False):
"The org's own document sources whose last sync turn failed."

failing: NotRequired[int]
sample: NotRequired[list["OpsFailingSource"]]
read: NotRequired[Literal["read", "not_permitted", "unread"]]


class OpsFailingSource(TypedDict, total=False):
namespace: Required[str]
name: Required[str]
status: Required[str]


class OpsProjectionFailuresListInput(TypedDict, total=False):
org: Required[str]
namespace: NotRequired[Optional[str]]
Expand Down
Loading
Loading