Repository navigation
Under Postgres, knowledge.inspect says which document commits ClickHouse does not hold and lists only documents knowledge.get serves - #439
Merged
Conversation
zlareb1
force-pushed
the
feat/i160-doc-pg
branch
2 times, most recently
from
November 9, 2026 08:58
b9751ca to
7c14e8e
Compare
…use does not hold and lists only documents knowledge.get serves knowledge.inspect's document sections read ClickHouse's loom.documents. Under the Postgres authority it now reads the namespace's unpublished deliveries once and names owed and parked commits in `skipped`, and keeps a listed row only while knowledge.get serves it at the version ClickHouse listed. Either makes `listed_complete` false; a Postgres that does not answer is said too. Related: #160 Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: zlareb1 <[email protected]>
…oard does not read as a failed listing; the count says publication has not finished; one Postgres outage is not waited out twice Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: zlareb1 <[email protected]>
…tgres it found down; the dashboard says documents may be missing whenever the server names a short listing Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: zlareb1 <[email protected]>
…asked again; the dashboard reads only the dropped-row count as a short listing Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: zlareb1 <[email protected]>
…storage-authority paragraph is wrapped Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: zlareb1 <[email protected]>
… dashboard comment names every dropped row Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: zlareb1 <[email protected]>
…ys on, pinned by a test; the dashboard hedges an unchecked listing Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: zlareb1 <[email protected]>
…d reads its one row directly; listed_complete names the listing check Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: zlareb1 <[email protected]>
…r produced Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: zlareb1 <[email protected]>
…stated two constants is gone Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: zlareb1 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: zlareb1 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: zlareb1 <[email protected]>
zlareb1
force-pushed
the
feat/i160-doc-pg
branch
from
November 9, 2026 09:12
7c14e8e to
48bd9f0
Compare
This was referenced Nov 9, 2026
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Related: #160
Changelog category (leave one):
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):
Under the Postgres storage authority,
knowledge.inspectsays inskippedhow many document commits have not finished publishing to ClickHouse (owed and parked). It lists a document only whileknowledge.getserves it at the listed version, solisted_completeis false whenever the document sections may be short.Why
knowledge.inspect's document sections (totals by format and scheme, chunks, the listed documents) read ClickHouse'sloom.documents. Under the Postgres authority, document heads are committed in Postgres first (loom.knowledge_heads). They reach ClickHouse through a delivery, which a writer publishes in its request or theknowledge_pg_deliveryworker publishes later, or which parks after repeated refusals.Until a commit is published, the report counted and listed ClickHouse's older row as current, and said nothing. A document rewritten or deleted in Postgres was still listed at its old version, and
listed_completecould be true while committed documents were missing.What changes
pg_documents.unpublished(org, namespace)gives the namespace's unsettled deliveries as (owed, parked). It is one indexed count overloom.knowledge_deliveries. A delivery whose row landed but whose older chunk versions are not retired yet counts too, so the line says the publication has not finished rather than that the row is missing.knowledge.inspectreads that count once, before the document sections:documents.projection: <n> document commit(s) whose publication to ClickHouse has not finished, <m> of them parked …toskipped.documents.projection: POSTGRES_UNAVAILABLE: …(covering the memory sections too), and the report reads on from ClickHouse without trying Postgres again in the same call: neither the listing check nor the memory sections' wait (pg_validation.published_reads(..., down=True)waits no time and adds no second line).documents.get_many_by_uris, the readknowledge.getserves from. A row that is not live at the version ClickHouse listed (rewritten, deleted, or gone in the authority) leaves the listing, its chunks and jobs are not read, andskippedcounts it (listed.heads: …; the dashboard reads alisted: …line as a failed listing). If that read fails, the rows are listed as ClickHouse holds them andlisted.headsappears inskipped.listed_completeis false when either of these applies.skippednames unpublished document commits or a dropped listed document, the Documents inspection says some documents may be missing, in place of "Newest N of M listed." (which reads as a sample-limit cut) and of "No live document to list.". A memory section'sprojectionline does not trigger it.This report does not wait for publication the way memory's diagnostic reports do (
pg_validation.published_reads). The knowledge plane has no publication barrier, so the report states what it may be missing and does not add a wait.Docs:
docs/architecture/storage-authority.md("Knowledge documents"),docs/features/knowledge.md, and thelisted_completefield comment, whose regenerated reference isdocs/reference/operations/knowledge.md.Ingestion job state (the
ingestionssection) still reads ClickHouse. It moves when ingestion jobs move to Postgres.Scope and risk
get_many_by_urisalready does on aknowledge.get. That read deletes a head that an older build purged from ClickHouse, and the module docstring says so.sample_limitlisted sources.skippedcan now carrydocuments.projection: …andlisted.heads: …lines; the dashboard keys on those two names (DOCUMENTS_PROJECTION,LISTED_HEADS).Tests
tests/unit/test_knowledge_inspect.py):skipped, andlisted_completeis false.tests/integration/test_knowledge_pg_heads.py, run by CI's Postgres jobs): a newer version is committed in Postgres with its delivery parked. The report counts the parked commit, drops the older ClickHouse row from the listing and is not complete, andknowledge.getserves the newer content.LOOM_STORAGE_AUTHORITY=postgres: the file's 27 tests passed.tests/integration/*inspect*.pygave 3 passed and 3 skipped; the skips need auth enforced or a reference extractor.tests/unit/test_pg_authority.py):published_reads(down=True)waits no time, says nothing and nests.src/views/Assistant.test.tsx(92 passed: every document listed, one dropped, the only one dropped, a failed check, and a memory projection line that must not trigger the note),npm run build,npm run budget, Biome.server/knowledge, and the touched unit files plustests/analyzer, doc links, public copy, docs reference and package contracts (349 passed).🤖 Generated with Claude Code