Skip to content
Loom Docs
Esc
↑↓navigate↵open⌘Jpreview
Product
View as Markdown
On this page

Curator status

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, and…

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, and the served facts whose linked code or source document changed. This page describes what the operation reads, the bound on each read and the codes it answers with.

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 fixes 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 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)

The dashboard has no view of the report. Its Review queue lists the proposals and the conflicts themselves.

Input

Field Meaning
sections Which of proposals, flagged and stale to compute. Empty, the default, computes all three. 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.

What each section reads

Every statement names one (org, namespace). A fact’s value is read only to hash it for the write its finding names, for the facts a list shows, and 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 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 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.

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 fixes 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

A fact can be listed under more than one code.

The write a finding names

apply has the shape namespace.tune gives its drafts:

Field Value
op memory.update_by_id
args org, the fact’s memory_id, and if_match_sha256, the content hash the report read for it.
args_complete false: the person adds the new value.
required_role The role memory.update_by_id declares, read from the operation registry.
guard States that the write is refused with 409 PRECONDITION_FAILED when the fact changed after the report.

The hash is the content_sha256 that memory.get serves for the fact, which is the one memory.update_by_id compares. 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 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: an empty if_match_sha256 is no precondition, so the write it would name could overwrite a change made since the report.

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 a fact is listed only while the ClickHouse row the report read is the live head of its key there.

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.
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 section with a read over its bound answers unavailable: "too_large" with no items, because a cut list would read as the whole one. The other sections still answer.

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.

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.
  • 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 command.

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.
  • A list is whole or absent: a section that could be cut answers too_large.
  • A write named in apply carries the content hash a read of the fact served when the report ran, and a fact with no such hash names no write.

Last updated on

Was this page helpful?