---
title: Curator status
lastModified: '2026-12-05T17:17:50.000Z'
description: 'curator.status reports what in one namespace needs a person: the proposal queue in counts, the accepted facts with a harm report or a failed graded run, the…'
---

`curator.status` reports what in one namespace needs a person: the proposal queue in counts, the accepted facts with a harm report or a failed graded run, the served facts whose linked code or source document changed, the startup budget the guide and the pinned facts spend, and the facts to pin or unpin. This page describes what the operation reads, the bound on each read and the codes it answers with, [the namespace's mode](#the-namespaces-mode), which records whether a scheduled pass may read a namespace, [the scheduled pass](#the-scheduled-pass), which counts the same findings on a schedule and records that it looked, and [the state](#whether-the-pass-runs) every answer carries: whether that pass runs in the namespace and how the newest one ended.

The answer is computed on every call from rows Loom already holds. The operation stores nothing, calls no model and changes no fact: each finding names the write that applies it, for a person to run under their own name.

## The caller

The operation needs the admin role on the namespace it addresses. A caller below it is refused with 403 `AUTH_INSUFFICIENT`. The report counts the whole namespace, so a token whose read scope is narrowed to one user or session is refused with the same code, as for the [knowledge gap](/docs/architecture/knowledge-gaps) operations.

| Surface      | How                                                                                                                                              |
| ------------ | ------------------------------------------------------------------------------------------------------------------------------------------------ |
| HTTP         | `POST /v1/curator.status`                                                                                                                        |
| MCP          | the tool `loom_curator_status`, called by name; it is on no toolset                                                                              |
| SDKs         | the generated `curator.status` method of each SDK                                                                                                |
| Command line | `loom curator status --namespace <namespace>` ([without the dashboard](/docs/guides/without-the-dashboard#what-a-namespace-needs-from-a-person)) |
| Dashboard    | the **Curator** tab of the **Review queue** ([the dashboard tab](#the-dashboard-tab))                                                            |

## Input

| Field      | Meaning                                                                                                                                                                                                                       |
| ---------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `sections` | Which of `proposals`, `flagged`, `stale`, `primer`, `pin` and `unpin` to compute. Empty, the default, computes all of them. A section that was not asked for is `null` and makes no read. Another name is a validation error. |
| `limit`    | The most findings one section lists, 1 to 50, default 20.                                                                                                                                                                     |

A server on a build without a section refuses its name. A client that wants every section sends the empty list, which every build accepts, and reads a section missing from the answer as not computed.

## What each section reads

Every statement names one `(org, namespace)`. A fact's `value` is read to hash it for [the write its finding names](#the-write-a-finding-names), for the facts a list shows, and to measure the text of each pinned fact. No answer holds a value.

### `proposals`

| Field           | Read                                                                                                                                                                                                           |
| --------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `pending`       | The live rows of `loom.memory` with `status = 'proposed'`.                                                                                                                                                     |
| `oldest_days`   | The age in whole days of the oldest of them, 0 when none is pending.                                                                                                                                           |
| `filed_7d`      | The facts with a version in `loom.memory_versions` written as a proposal and a `created_at` in the last 7 days. A fact keeps its `created_at` through every version, so a proposal decided since still counts. |
| `decided_7d`    | The `memory.proposal_accept` and `memory.proposal_reject` rows of `loom.audit_log` in the last 7 days: two ranges of its sort key `(org, namespace, event_type, ts)`.                                          |
| `over_scan_cap` | True when `pending` is more than `LOOM_MEMORY_PROPOSALS_SCAN_CAP`, the most proposals `memory.proposals` reads for one listing. The count stays exact.                                                         |

[Proposals](/docs/features/memory/writing#proposals) describes the queue and its decisions.

### `flagged`

Accepted facts, `status = 'active'`. A conflicted fact is not listed: `conflicts.list` already holds it.

1. The memory ids whose harm reports in `loom.memory_usage_totals` sum to more than zero, most reports first. A report is a `negative` outcome recorded with `memory.outcome`, `memory.outcome_run` or `run.complete`; a retraction (`run.retract_credit`) subtracts it.
2. The keys named in `memories_used` by the runs of `loom.agent_runs` graded `fail`, the key of the most runs first. A run counts once for a key, and a run regraded to `pass` no longer counts.
3. The current status of each of those ids, by the read `memory.statuses` makes, and the live accepted rows under those keys.

The list holds the harm reports first, then the failed runs, cut at `limit`.

### `stale`

Served facts, `status` `active` or `conflicted`.

1. The namespace's code links in the state `changed`, `unresolved` or `missing`, made from the fact as it is now, into repositories whose code namespace the caller may read, one per fact, newest check first.
2. The live rows tagged `source-changed`, newest write first. [Decision extraction](/docs/features/tasks-and-decisions#extract-decisions-from-a-document) sets the tag on a decision that its source document no longer states.

The list holds the stale links first, then the tagged facts, cut at `limit`.

### `primer`

Every session of the namespace starts with its guide and its pinned facts, each inside a token budget of the [startup context](/docs/features/unified-search#contextpack). The section measures both against those budgets and names no write: a person shortens the guide with [`namespace.guide_set`](/docs/features/namespaces-and-sharing#a-namespaces-guide), and the `unpin` section lists the pins to lift.

| Field                  | Read                                                                                                                                                                                                                                                                |
| ---------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `guide_tokens`         | The estimate for the guide's current revision as the startup context shows it: the line naming its revision, writer and summary, then its text. 0 when the namespace has no guide.                                                                                  |
| `guide_budget_tokens`  | 200, the startup budget of the `namespace_guide` section.                                                                                                                                                                                                           |
| `pinned`               | The live pinned rows of `loom.memory` with `status` `active` or `conflicted`.                                                                                                                                                                                       |
| `pinned_tokens`        | The sum of the estimates for their values, each measured as the startup context prints it: the text of a string, any other value as it is stored, counted in characters.                                                                                            |
| `pinned_budget_tokens` | 500, the startup budget of the `memories` section, which the pinned facts lead.                                                                                                                                                                                     |
| `over`                 | True when `guide_tokens` or `pinned_tokens` is more than its budget, and when the pinned facts were not computed.                                                                                                                                                   |
| `unavailable`          | `too_large` when the namespace holds more pinned facts than the section reads: `pinned` and `pinned_tokens` are then 0, not computed, and `over` is true, since that many pins are over their budget. `guide_tokens` is computed. "" when the section was computed. |

The budgets are read from `server/memory/domain/context_layout.py`, and the estimate is the one the startup context uses: 4 characters a token, and at least one token for any text. A request that raises a section's budget with `section_token_budgets` is not what the section measures.

The pinned rows are read in two statements. The first lists each pinned row's id and live version and reads no value. The second reads the value of those rows, by id and version, and returns the length of the text the startup context prints for it. `memory.set` and `memory.pin` store a string as JSON, which writes a character outside ASCII as six bytes or twelve, so the stored length is not that length.

### `pin`

Served facts, `status` `active` or `conflicted`, that are not pinned.

1. The memory ids of `loom.memory_served_daily` with a row on at least 3 of the last 7 days, today among them, most days first. The table holds one row for a memory, an agent label and a day. A caller chooses its agent label, so the days are counted and the labels are not: a fact that many agents read on one day was served on one day.
2. Those of the ids that are live rows of the namespace, not pinned, with a served status. A proposal that was not accepted, a rejected fact and a deleted fact are not candidates, however often they were read.

The list is cut at `limit`.

### `unpin`

Pinned facts, read as for the `primer`.

1. Whether any memory of the namespace has a `used` label: one row of `loom.memory_usage_totals` with a `used_count` other than 0. A `used` label is what `run.complete` records for the keys in `memories_used`, and `memory.outcome` for `outcome: "used"` ([recalled is not relied on](/docs/features/runs#recalled-is-not-relied-on)). Where there is none the section answers `unavailable: "no_usage_labels"` with no items: nobody labels usage in that namespace, so a pin without a label is not known to be unused.
2. The `used` labels of the pinned ids in the last 30 days, from `loom.memory_usage_events`, retractions subtracted.

The list holds the pins with no label in those 30 days, in key order. Then, while the tokens of the pins left are more than `pinned_budget_tokens`, it holds the least used of them first, until the rest fit. It is cut at `limit`. A namespace with no pinned fact answers an empty list and asks nothing about its labels.

## Findings

A finding carries the fact's `memory_id` and `memory_key`, a `code`, the code's `title`, a `count`, a `ref` and the write that applies it in `apply`. The titles are in `server/memory/domain/curator.py` (`FINDING_TITLES`), so every surface prints the same words.

| Code              | Title                                                                                     | Section   | `count`                                    | `ref`                                                                  |
| ----------------- | ----------------------------------------------------------------------------------------- | --------- | ------------------------------------------ | ---------------------------------------------------------------------- |
| `harm_reported`   | Reported harmful                                                                          | `flagged` | The harm reports left after retractions.   |                                                                        |
| `graded_fails`    | Relied on by runs graded fail                                                             | `flagged` | The runs graded `fail` that named the key. |                                                                        |
| `stale_link`      | Linked code changed                                                                       | `stale`   | 0                                          | The linked file, then `::` and the definition when the link names one. |
| `source_changed`  | Source document changed                                                                   | `stale`   | 0                                          |                                                                        |
| `served_often`    | Served on 3 or more of the last 7 days; a pin stamps the fact with the person who pins it | `pin`     | The days of the last 7 it was served on.   |                                                                        |
| `unused_pin`      | Pinned, with no use labelled in 30 days                                                   | `unpin`   | 0                                          |                                                                        |
| `over_budget_pin` | Among the least used pins while the pinned facts are over budget                          | `unpin`   | Its `used` labels of the last 30 days.     |                                                                        |

A fact can be listed under more than one code.

## The write a finding names

`apply` has the shape `namespace.tune` gives its drafts. Its `required_role` is the role the named operation declares, read from the operation registry.

| Finding            | `op`                  | `args`                                                                                                                   | `args_complete`                              | `guard`                                                                                          |
| ------------------ | --------------------- | ------------------------------------------------------------------------------------------------------------------------ | -------------------------------------------- | ------------------------------------------------------------------------------------------------ |
| `flagged`, `stale` | `memory.update_by_id` | `org`, the fact's `memory_id`, and `if_match_sha256`, the content hash the report read for it.                           | `false`: the person adds the new `value`.    | The write is refused with 409 `PRECONDITION_FAILED` when the fact changed after the report.      |
| `pin`              | `memory.pin`          | `org`, `namespace`, the `agent`, `user_id` and `session_id` that hold the fact, its `memory_key`, and `if_match_sha256`. | `false`: the person adds the fact's `value`. | The same refusal.                                                                                |
| `unpin`            | `memory.unpin`        | `org`, `namespace`, the `agent`, `user_id` and `session_id` that hold the fact, and its `memory_key`.                    | `true`                                       | None: an unpin changes no content, and answers `not_pinned` for a fact that is no longer pinned. |

`memory.pin` writes a whole new version of the fact, as `memory.set` does, and takes the key and the identity that holds it, not an id. The person reads the fact (`memory.get_by_id` with the finding's `memory_id`) and sends its `value` back with the named arguments, and with the tags and the other fields the fact should keep. The new version carries the person who pins as its `actor`, which the finding's title says. `memory.unpin` needs the admin role.

The hash is the `content_sha256` that `memory.get` serves for the fact, which is the one `memory.update_by_id` and `memory.pin` compare. The stored `content_sha256` column can differ from it: a read serves an object without its null fields, and hashes what it serves. After the sections are read, one read fetches the live revision and this hash of every fact the lists show. It is the read that [`namespace.audit`](/docs/features/namespaces-and-sharing#reading-a-namespaces-health) cites its rows with.

That read cites no hash for a high-sensitivity fact, for a value larger than `LOOM_NAMESPACE_REPORT_HASH_MAX_BYTES` (0 cites none), or for a fact revised while it ran. Such a fact is listed with `apply: null` under a `flagged`, `stale` or `pin` finding: an empty `if_match_sha256` is no precondition, so the write it would name could overwrite a change made since the report. An `unpin` finding compares no hash and always names its write.

A fact that is no longer live when its revision is read is left out, so a list can hold fewer than `limit` findings while a fact is being deleted. Under the [Postgres memory authority](/docs/architecture/storage-authority) a fact is listed only while the ClickHouse row the report read is the live head of its key there.

## The dashboard tab

The **Review queue**'s **Curator** tab calls the operation once each time it opens, with no `sections` and a `limit` of 20. It draws the **Scheduled pass** card when the answer holds a `state`, then one card per section the answer holds, in this order:

| Section     | Card                    | What the card shows                                                                                             |
| ----------- | ----------------------- | --------------------------------------------------------------------------------------------------------------- |
| `proposals` | **Proposals**           | `pending`, `oldest_days`, `filed_7d` and `decided_7d`, and a link to the queue's **Proposals** tab.             |
| `flagged`   | **Needs a second look** | Its findings.                                                                                                   |
| `stale`     | **Out of date**         | Its findings.                                                                                                   |
| `primer`    | **Startup budget**      | The guide's tokens and the pinned facts' tokens, each as a meter against its budget, and whether `over` is set. |
| `pin`       | **Worth pinning**       | Its findings.                                                                                                   |
| `unpin`     | **Pins to remove**      | Its findings.                                                                                                   |

A finding is one row: the fact's `memory_key`, the `title` the server sent with its `ref`, and its `count`. The key opens the fact in the memory drawer, where a person edits, pins or unpins it. The tab performs no write and shows no `apply`: the write a finding names stays on the API and the command line.

A key can be held by more than one agent, user or session, and the drawer reads and writes the row of one of them. The tab therefore reads the fact by the finding's `memory_id` (`memory.get_by_id` with `omit_high_value`, so no high-sensitivity value is read) and opens the drawer on the agent, user and session that hold it. The read by id answers no row for a deleted fact, and also for a live one whose id the caller can read in more than one namespace: a namespace restored from a snapshot keeps the memory ids ([storage authority](/docs/architecture/storage-authority)). The tab cannot tell the two apart, so when the id reads no row, or a row of another namespace, the finding's row says "This fact can't be opened from here. It may have been deleted; if not, open it by its key in Memories." and no drawer opens. A read that fails says why on the same row, with the request id and whether to try again.

The **Scheduled pass** card says [whether the pass runs](#whether-the-pass-runs): a badge and one sentence for the `state`, with the time `next_due_at` names where a pass is due, then the newest pass, when it started and how it ended in words for its `outcome`. A due time that is not ahead reads **now**: the first pass of a `waiting` namespace is due at the time of the call, and only `overdue` says how long ago a pass was due. One link, **Pass history**, opens the Runs page on the curator's runs (`/runs?agent=loom-curator`), where the newest pass is the first row. A `state` or an `outcome` the tab has no words for draws no sentence of another state's: the card keeps the last pass and the link, and shows the outcome's code.

- A list that holds 20 findings says "The first 20 are listed." under it. The answer carries no total, so the tab cannot say how many more the section has.
- A section with `unavailable` shows the reason in words: `too_large` reads "Too many rows to list here" and `no_usage_labels` reads "No usage labels in this namespace yet". For `primer` the guide's meter stays and "Too many pinned facts to measure" takes the place of the pinned facts' meter, which lists no row.
- A section with no finding says "Nothing to do".
- A section the answer does not hold draws no card, so the tab works against a server on a build without that section ([rolling upgrades](/docs/architecture/rolling-upgrades#the-rules), rule 82).
- An answer without `state` draws no **Scheduled pass** card, so the tab works against a server on a build without it.
- A caller below admin sees the tab and the role the report needs, and the tab does not call the operation. The role check is the server's; the tab's own check only avoids a refused call. Above the role line the tab shows the namespace's newest pass, when it started and how it ended, from one `run.list` call for the newest run of the agent `loom-curator`: a pass's row is a run every viewer of the namespace may list. A row whose id is not a pass's is not shown, and a read that fails leaves the role line alone.
- Against a server that does not serve the operation the tab shows one line, "The curator's findings are not available on this deployment yet.", with no retry. Any other failure shows the queue's error state with a retry.

## Bounds

| Read                          | Bound                                                                                                  |
| ----------------------------- | ------------------------------------------------------------------------------------------------------ |
| Harm reports, failed-run keys | 2,000 each (`SCAN_CAP` in `server/memory/store/curator.py`). The statement asks for one row more.      |
| Rows under the failed keys    | 2,000. A key is held once by each agent, user and session that wrote it.                               |
| Statuses of the harmed ids    | The ids the harm-report read returned.                                                                 |
| Stale links, tagged rows      | `limit` rows each.                                                                                     |
| Pinned rows                   | 2,000, read once for the `primer` and the `unpin` sections. The statement asks for one row more.       |
| Lengths of the pinned values  | The pinned rows that read returned, each by its id and version; none when it returned more than 2,000. |
| The guide                     | Its current revision, one row.                                                                         |
| Ids served on 3 days or more  | 2,000, from the rows of the last 7 days. The statement asks for one row more.                          |
| Which of them are not pinned  | The ids the served-days read returned.                                                                 |
| Whether usage is labelled     | One row of `loom.memory_usage_totals`, which holds one row a memory.                                   |
| `used` labels of the pins     | The pinned ids, and the events of the last 30 days: a range of the table's sort key for each id.       |
| Revisions and hashed values   | The facts the lists show, `limit` a list, each value at most `LOOM_NAMESPACE_REPORT_HASH_MAX_BYTES`.   |
| The whole call                | A p99 budget of 1,500 ms (`OP_BUDGETS_P99_MS` in `server/settings/catalog.py`).                        |

A `flagged`, `pin` or `unpin` section with a read over its bound answers `unavailable: "too_large"` with no items, because a cut list would read as the whole one, and so does the `primer`, whose pinned tokens would be those of a part. The other sections still answer.

`loom.memory_usage_events` keeps every event and has no TTL. No statement here reads it without the ids and the 30-day bound, and the question whether anybody labels usage is asked of the totals.

A failed statement fails the call. A repository whose grant could not be read is left out of the stale links, and the answer says so in `degraded` (`identity: code_links_unverified`).

## Limits

- Harm reports and failed runs are counted over the namespace's whole history. A fact keeps its id through a revision, so a revised fact stays listed, with the hash of its current content in `apply`, until its reports are retracted or it is deleted.
- `graded_fails` matches by key: a run records the keys it relied on, so every identity of the namespace that holds the key is listed.
- A namespace that has passed a bound of the `flagged` section keeps answering `too_large` for it: the counts never age out.
- With `limit` or more harm reports, the `flagged` list holds no failed run. Ask again with a larger `limit`, up to 50.
- A stale link into a repository the caller may not read is not listed.
- A served day is a UTC date on which an agent's recall (a search, a context pack, an answer) returned the fact. A lookup by key and a read by the dashboard write none.
- The pin rule counts days, not readers: a fact one agent recalls every day is a candidate, and so is a fact the startup context shows for being recent.
- `pinned_tokens` counts the text of each value. The label the startup context prints before each fact and its escaping of `<` and `>` are not counted.
- A pin rewritten between the two statements that read the pinned rows can have no row left at the version listed. It is then left out of `pinned`, `pinned_tokens` and the `unpin` list of that call.
- The `primer` and the pin lists count every identity of the namespace, whichever of them one session's startup context reads. A pinned fact the startup context leaves out, such as a high-sensitivity one, still counts in `pinned` and `pinned_tokens`.
- A pin with a `used` label older than 30 days and a pin that was never labelled are listed alike.
- The `unpin` rule reads labels and not the age of a pin. A pin younger than 30 days with no `used` label is listed like an old one, a fact pinned from a `pin` finding included: a `pin` candidate is chosen by its served days, so it can be listed under `unpin` at the next call after it is pinned.

## The namespace's mode

A namespace's registry row holds `curator_mode`: whether a scheduled curator pass may read the namespace. It is the namespace's choice, made by one of its admins, and it is `off` on every namespace until an admin sets it.

| Mode       | Meaning                                                                                                    |
| ---------- | ---------------------------------------------------------------------------------------------------------- |
| `off`      | No pass reads the namespace. A row that never set a mode stores an empty string, which reads as `off`.     |
| `findings` | A pass may compute what `curator.status` reports for the namespace. It calls no model and changes no fact. |

The mode is the namespace's side of the choice. A pass also needs the deployment's own switch, `LOOM_CURATOR_ENABLED`, which only the operator sets and which is off by default. With both, [the scheduled pass](#the-scheduled-pass) reads the namespace.

| Surface      | How                                                                                                                           |
| ------------ | ----------------------------------------------------------------------------------------------------------------------------- |
| HTTP, MCP    | `namespace.register` with `curator_mode`. A call that omits the field keeps the stored mode.                                  |
| SDKs         | Read the row with `namespace.get`, then call `namespace.register` with its `owner_email`, its `tags` and the new mode.        |
| Command line | `loom curator mode --namespace <namespace> off\|findings` prints that row and sends it with `--apply`.                        |
| Dashboard    | **Settings** on the namespace, **Curator**: **Off** or **Findings only, no model**. No other save in the dialog sends a mode. |

`namespace.register` takes the mode under the rule it applies to every setting: the caller is an admin of the namespace, and a restricted namespace needs a direct grant as well. It refuses:

- a mode other than `off` on a person's own namespace, with 422 `PERSONAL_NAMESPACE`. The rule is the one a [document source](/docs/architecture/document-sources) is refused by: a name of a personal form, or a namespace claimed at signup, whose row names the namespace itself as its owner;
- a mode other than `off` on a namespace whose `kind` is not `memory`, with 422 `VALIDATION_FAILED`;
- a value outside the set, with 422.

The refusal judges the row the call writes, with no further read. A first row that names the namespace as its owner is refused the mode, and so is a soft-deleted row claimed at signup, which a restore reactivates with the mode it holds. A call that omits the mode keeps the stored one, so it is refused when it would leave that mode on a namespace that takes none: a call that changes the `kind`, or one that names the namespace as its owner. Send `curator_mode: "off"` with such a call.

`off` is accepted on every namespace. `namespace.get` and `namespace.list` return the stored word. A word this build does not accept on a write, stored by a newer build, is served as it is and kept by a register that omits the field.

`namespace.register` writes the whole row, so of two admins who save at the same moment one change is kept. During a rolling upgrade a register served by the previous build returns the mode to `off` ([rolling upgrades](/docs/architecture/rolling-upgrades#the-rules), rule 80).

## The scheduled pass

The worker `curator` runs a pass over each namespace whose mode is not `off`, once every `LOOM_CURATOR_CADENCE_SECONDS` (a day by default, an hour at the least; a runtime override reaches the next tick). A pass counts what `curator.status` reports for the namespace and writes one row of the [run ledger](/docs/features/runs#curator-passes) that says when it ran, how it ended and what it counted. It calls no model, changes no fact and stores no finding: the report is still computed when someone asks for it.

The worker is off until the operator sets `LOOM_CURATOR_ENABLED`. A stored mode this build does not know, which a later build wrote, runs the same pass as `findings`.

### A tick

The worker ticks every 300 s. A tick:

1. Does nothing until every live replica has the migration that adds the mode ([rolling upgrades](/docs/architecture/rolling-upgrades#the-rules), rule 83).
2. Reads the namespaces that are active, of kind `memory` and hold a mode other than `off`, in one statement. A deployment where none does stops here.
3. Reads the newest pass of each from the run ledger. A namespace is due when it has no pass, when its newest pass started more than the cadence ago, or when that pass is [abandoned](#an-abandoned-pass).
4. Runs the due namespaces one after another, the longest without a pass first. A namespace with no pass in the last two cadences sorts with those that never had one.

What is due is read from the ledger, so a restarted worker and a second replica need no state of their own.

### A pass

For each due namespace the tick:

1. Reads the namespace's classification. A namespace whose classification cannot be read is skipped, and so is a restricted one while `LOOM_RESTRICTED_SERVE` is false. Neither gets a row.
2. Takes the lease `curator:<org>:<namespace>` for 120 s, renewed while the pass runs. A lease another replica holds skips the namespace.
3. Reads the mode again and the namespace's newest pass, of any age, under the lease, as of every write that landed. A namespace whose mode changed, or whose newest pass is no longer the one the tick selected it by, is skipped: another replica ran its pass, or an admin turned it off.
4. Writes one `namespace.restricted_access` audit row when the namespace is restricted, under the actor `worker:curator`, before it counts a section. A row that cannot be written stops the pass.
5. Writes the pass row as `active`.
6. Counts the sections in five steps: `proposals`, `flagged`, `stale`, `pin`, then `primer` and `unpin` together, which share one read of the pinned facts. Each calls the function `curator.status` computes that section with, at 20 findings a section.
7. Reads the erasure ledger. An erasure of the namespace that was open during the pass, or a ledger that cannot be read, closes the pass with no count.
8. Writes the row again as `completed` or `failed`, with the outcome.

| `outcome`      | `status`    | When                                                                                               |
| -------------- | ----------- | -------------------------------------------------------------------------------------------------- |
| `ok`           | `completed` | Every section was counted. A namespace with nothing to find has every count at 0.                  |
| `time_bound`   | `completed` | The pass reached 120 s. The row holds the sections counted until then.                             |
| `mode_changed` | `completed` | The mode was set to `off` during the pass, which is read before each step. Later steps do not run. |
| `erasure`      | `completed` | An erasure reached the namespace during the pass. The row holds no count.                          |
| `error`        | `failed`    | A read failed. The row holds no count, and the worker notes a failed leg.                          |
| `abandoned`    | `failed`    | The pass never closed its row, and a later tick closed it.                                         |

A pass that ends `error` is the namespace's pass of that cadence: the next one runs a cadence later.

### The pass row

A pass is a row of `loom.agent_runs`, whose key is `(org, namespace, run_id)`:

| Column                              | Value                                                                                                                   |
| ----------------------------------- | ----------------------------------------------------------------------------------------------------------------------- |
| `run_id`                            | `cur-` and the pass's start as ten digits of epoch seconds, so a namespace's passes sort by time.                       |
| `agent`, `user_id`, `session_id`    | `loom-curator`, `-`, `-`.                                                                                               |
| `environment`, `goal`               | `worker`, `Curator pass (scheduled)`.                                                                                   |
| `memories_used`, `memories_written` | Empty.                                                                                                                  |
| `metadata`                          | `mode`, `outcome`, `counts` by section, `unavailable` by section, `duration_ms`. Under 6,000 characters at the largest. |
| `version`                           | 4 × 10^18 plus the server's nanosecond clock.                                                                           |

`counts` holds one number a section: the pending proposals, the findings a list section holds (at most 20), and 1 for a `primer` over a startup budget. A section that cannot be computed has its code in `unavailable` and no count. The metadata holds no key, no value, no memory id and no question, because `run.get` and `run.list` serve the row to every viewer of the namespace, while the findings themselves need the admin role.

Every read of pass rows is one statement (`pass_rows` in `server/tasks/store/runs.py`): the rows of the namespace whose `run_id` lies between `cur-<lower bound>` and the end of the `cur-` prefix, at a `version` of 4 × 10^18 or more, newest first. A request path writes the nanosecond clock as its version, which is below that floor. A row a caller opened under a pass-shaped id on a build that did not reserve the shape is therefore never read as a pass, however far ahead its id is dated.

### An abandoned pass

A worker that dies in a pass leaves the row `active`, and its lease lapses 120 s after the last renewal. A tick treats a namespace whose newest pass is `active` and started more than 240 s ago as due. Under the namespace's lease, which a live pass would hold, it closes that row as `failed` with the outcome `abandoned` and runs the pass again in the same turn. An `active` pass younger than 240 s is left alone.

The read under the lease is not bound to the last two cadences. A pass can die before a longer time without a tick over its namespace, because the switch or the mode was off or the namespace was restricted and not served. Its row is older than the dueness read looks back, and the first pass after that time closes it the same way.

A namespace whose newest pass is closed as `abandoned` is due whatever the row's age. That is the state a tick leaves when it closes the dead row and fails before it writes the row of the pass that follows, and the next tick runs that pass.

A pass the supervisor stops, or one that loses its lease, writes nothing more. Its row is closed the same way.

### Bounds of the pass

| Bound                         | Value                                                                                                                   |
| ----------------------------- | ----------------------------------------------------------------------------------------------------------------------- |
| Namespaces a tick selects     | 5,000. A deployment with more notes a failed leg on every tick, and the namespaces past the bound get no pass.          |
| Pass rows the dueness reads   | Two cadences back, 200 namespaces a statement, 4 rows a namespace. A read that fills is repeated a namespace at a time. |
| Time a pass has               | 120 s, checked before each step.                                                                                        |
| Time a tick starts passes for | 720 s. The supervisor cuts a tick at 900 s, which leaves the last pass its 120 s.                                       |
| Passes at once                | One a namespace, by the lease, and one after another inside a tick.                                                     |

### Limits of the pass

- A count is cut at 20 for a list section: a pass says that a section has findings, and `curator.status` lists them.
- The counts include a fact that changed between the section's read and the report's citation read, which `curator.status` leaves out of its list.
- A pass reads with no caller, so its `stale` count includes a link into any repository of the org, where `curator.status` lists only those its caller may read.
- Cadence is one setting for the deployment. No namespace has a schedule of its own, and no operation starts a pass on demand.
- Pass rows follow the run ledger's retention.

## Whether the pass runs

Every answer of `curator.status` holds four fields besides its sections, whatever `sections` asks for: `mode`, `state`, `next_due_at` and `last_pass`. They say whether the scheduled pass runs in the namespace, when the next pass is due and how the newest one ended. They are computed on the call and stored nowhere.

`mode` is the word the namespace's registry row holds, as a pass reads it: `off` for a namespace that set none, is not active or is not of kind `memory`.

`state` is the first row of this table that holds:

| `state`          | When                                                                                                           | What the surfaces say                                                                          |
| ---------------- | -------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- |
| `off`            | The mode is `off`.                                                                                             | No scheduled pass reads the namespace. The findings are computed on every call in either mode. |
| `deployment_off` | The mode is on, and `LOOM_CURATOR_ENABLED` is off or a live replica is below the migration that adds the mode. | An operator has not turned the curator on for this deployment.                                 |
| `waiting`        | The namespace has no pass.                                                                                     | The first pass is due at `next_due_at`.                                                        |
| `overdue`        | `next_due_at` is more than 600 s in the past.                                                                  | The worker is behind or stopped.                                                               |
| `failed`         | The newest pass's `status` is `failed`.                                                                        | The last pass failed, with its `outcome`.                                                      |
| `ok`             | None of the above.                                                                                             | When the next pass is due, and how the last one ended.                                         |

- A mode this build does not know, which a later build stored, is on: the pass runs it as `findings`.
- 600 s is two ticks of the worker, so one slow tick is not reported.
- A fleet that cannot be read counts as below the migration: the state is `deployment_off`, never `ok`.
- `overdue` is decided before `failed`: once a pass is late, that none followed says more than how the last one ended.
- A pass that is still running is the namespace's pass: the state is `ok` until the pass after it is late.
- The state does not read the namespace's classification. A restricted namespace whose passes are skipped while `LOOM_RESTRICTED_SERVE` is false reads `waiting`, or `overdue` once its newest pass is a cadence old.

`next_due_at` is the newest pass's start plus `LOOM_CURATOR_CADENCE_SECONDS`, or the time of the call for a namespace with no pass. It is `null` when the state is `off` or `deployment_off`, where no pass will run. The next tick runs [an abandoned pass](#an-abandoned-pass) again, before the time this field names.

`last_pass` is the namespace's newest pass, whatever the mode is now, or `null` for a namespace with none:

| Field                                           | From                                                                                                                                                      |
| ----------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `run_id`, `started_at`, `status`, `duration_ms` | The pass row's own columns, as `run.list` serves them. `duration_ms` is the time from the pass's start to the write that closed its row, 0 while it runs. |
| `outcome`, `mode`, `counts`                     | The row's `metadata`: how the pass ended, the mode it ran in and what it counted by section.                                                              |

A row whose metadata is not a JSON object answers with the row's columns, an empty `outcome` and `mode` and no count, and so does a value of another type for its field. Neither fails the call.

The state costs two reads, and a third for a namespace whose mode is on while the switch is set: the registry row, the namespace's newest pass row, and the schema versions of the live replicas. The pass row is read through [the statement every read of a pass uses](#the-pass-row), so a caller's row under a pass-shaped id is never the last pass.

| Surface      | What it shows                                                                                                     |
| ------------ | ----------------------------------------------------------------------------------------------------------------- |
| Command line | `loom curator status` prints the state line first, then the last pass, then the findings.                         |
| Dashboard    | The **Scheduled pass** card of the **Curator** tab, above the findings ([the dashboard tab](#the-dashboard-tab)). |

A server on a build without these fields sends none of them. The command line and the tab then show the findings alone.

## Source entry points

- `server/memory/api/ops_curator.py` (`curator_status`), `server/memory/api/models_curator.py`: the operation and its wire models.
- `server/memory/app/curator_status.py` (`handle_curator_status`): the sections and the findings.
- `server/memory/store/curator.py`: the statements of the sections, and `SCAN_CAP`.
- `server/memory/store/reads.py` (`statuses_by_ids`): the current status of each id with a harm report.
- `server/memory/domain/curator.py`: the section names, the codes and their titles, the thresholds of the pin findings (`PIN_MIN_DAYS`, `PIN_WINDOW_DAYS`, `UNPIN_UNUSED_DAYS`) and the order pins over the budget are lifted in (`over_budget`).
- `server/memory/domain/context_layout.py`: the startup budgets, the token estimate (`tokens_of`) and the guide's item in the startup context (`guide_item`).
- `server/identity/app/namespace_guide.py` (`current_guide`): the guide the primer measures.
- `server/memory/app/code_link_reads.py` (`stale_links`): the stale link read.
- `server/memory/app/finding_evidence.py` (`revisions_for`): the live revision and served hash of each fact a list shows.
- `sdk/python/loom/cli_curator.py`: the commands.
- `frontend/src/views/admin/Curator.tsx`, `frontend/src/api/curator.ts`: the dashboard tab and its client. `frontend/src/views/Runs.tsx`: the Runs page the tab's **Pass history** opens.
- `server/identity/app/namespace.py` (`registry_row`, `refuse_curator_mode`): the mode on the registry row and its refusals.
- `server/knowledge/app/sources.py` (`is_personal_namespace`): the rule for a person's own namespace.
- `server/memory/domain/curator.py` (`Mode`, `stored_mode`, `CURATOR_MODE_MIGRATION`): the modes, the read of a stored one, and the number of the migration that adds the column.
- `server/memory/workers/curator.py` (`run_pass`): the tick and the pass.
- `server/memory/app/curator_status.py` (`count_sections`): what a pass stores of each section.
- `server/memory/domain/curator.py` (`run_state`, `pass_facts`, `OVERDUE_SECONDS`) and `server/memory/app/curator_status.py` (`_running`): the state, the time the next pass is due and the last pass.
- `server/memory/store/curator.py` (`opted_in`, `pass_mode`): the namespaces a pass may read, and one namespace's mode.
- `server/tasks/app/run.py` (`open_pass`, `close_pass`, `pass_rows`) and `server/tasks/store/runs.py` (`pass_rows`): the pass row and the one statement that reads it.
- `server/tasks/domain/session_runs.py` (`PASS_VERSION_BASE`, `pass_run_id`): the version floor and the id.
- `server/memory/domain/curator.py` (`PASS_STEPS`, the `OUTCOME_` codes, `PASS_SECONDS`, `PASS_ABANDONED_SECONDS`, `TICK_START_SECONDS`): the steps, the outcomes and the bounds.
- `server/identity/app/restricted_access.py` (`note_worker_access`): the audit row of a pass over a restricted namespace.

## Invariants

- The operation writes no row and calls no model.
- A statement reads one namespace, and no answer holds a value: a value is read only to hash it or to measure its length.
- A list is whole or absent: a section that could be cut answers `too_large`.
- A write named in `apply` that changes or re-writes a fact's content carries the content hash a read of the fact served when the report ran, and a fact with no such hash names no such write.
- The findings name Reinforce (`memory.pin`) and its reversal (`memory.unpin`) for a person to run. The operation performs neither.
- A pin candidate is a served fact: a proposal that was not accepted is never one.
- A scheduled pass performs no belief-revision verb: it writes its own run row, an audit row for a restricted namespace, and nothing else.
- A pass reads one namespace, and its row carries the identity `(org, namespace, loom-curator, -, -)`.
- A pass does not run when the fleet is not at the mode's migration, the classification cannot be read or the lease is held, and it keeps no count when the erasure ledger cannot be read.
- What is due and who runs it live in ClickHouse: the run ledger and the lease.
- The state is computed on read and stored nowhere, and it reads `ok` only when the switch is set and the fleet was read at the mode's migration.

## Related

- [Writing memory](/docs/features/memory/writing#facts-that-need-a-second-look)
- [Graded runs](/docs/features/runs#graded-runs): `run.grade` and `memories_used`.
- [Operations reference](/docs/reference/operations/curator#curatorstatus)
