Repository navigation
The curation loop's design: knowledge gaps, governed definitions and definitions from query history - #552
Merged
Conversation
zlareb1
force-pushed
the
docs/curation-loop
branch
from
November 12, 2026 15:11
328fc26 to
db9d041
Compare
9 tasks done
zlareb1
force-pushed
the
docs/curation-loop
branch
4 times, most recently
from
November 13, 2026 00:19
1fcfe2b to
09beff3
Compare
…definitions from query history One page for the three parts of the loop: the data model, the ops, the term leg in memory.search, erasure and audit, rolling upgrades, the privacy threshold and the cost bounds. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: zlareb1 <[email protected]>
Definitions are namespace-wide and published like documents; pin and attest of a definition take admin; the pinned-peer claim matches the same-type conflict check; gaps show only queries k people asked in that form; query history uses the tracker's source registry; gap ops stay out of read-narrowed tokens; census rows, an Invariants section, and the page says it is a design. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: zlareb1 <[email protected]>
Gap ops refuse narrowed tokens before the knowledge. prefix; governed needs the namespace-wide definition/ row; promotion writes unpinned then pins; N-1 promotions and writer pins are named with what the admin does after; query history keeps only normalised text; every build writes a marker and builds expire; the slug carries a hash of the term; definitions promote to memory only. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: zlareb1 <[email protected]>
Misses are an operator opt-in recorded only for a named end user, so every asker is erasable by user_id; asker counts show writers beside users; a build is deleted when a user erasure began since its read; case-aware term matching and unique terms; governed definitions only cross the read scope through the term leg, which honours filters and sensitivity; definitions are not marked conflicting with each other; query history has a registration of its own; the N-1 knowledge-destination residue is named. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: zlareb1 <[email protected]>
Governance is an admin-only record (loom.governed_definitions) bound to the approved content hash, so no memory write can make a row governed; uniqueness is checked on every govern; the build fence covers any erasure reaching the namespace; drafts hold no asked query; misses exclude a term-leg or exact-key answer; the read-scope change links its owning page; N-1 conflict marks are named with their clean-up. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: zlareb1 <[email protected]>
Promotion checks term uniqueness before it writes; the N-1 verdicts (merge, duplicate, conflict) and their clean-up are named, and the term leg serves only active rows; case rule exact only for all-caps or inner-capital terms; the namespace-wide tuple includes session_id; live_sha256; lexical-mode knowledge hits are not misses; grouping runs in ClickHouse; existing definition rows stay plain. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: zlareb1 <[email protected]>
Misses count only from searches that read the namespace's shared rows, and the asker comes from the token, never a body field; page-expired and degraded answers are not misses; the resolver neither flags nor retires a definition; tombstone or redact ends its record; uniqueness is case-folded; N-1 supersedes are named with memory.restore. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: zlareb1 <[email protected]>
Governance binds to the approved row version, so any later write on any build ends it; gaps recording is turned on only once N-1 is gone and off before a rollback; misses and the term leg skip hard-filtered searches; pending extraction is not a miss; drafts' threshold protection is stated; query-history registration erasure, snapshot behaviour and fail-closed cost reads are named. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: zlareb1 <[email protected]>
One rollout gate: every op the design adds, and promotion of its candidates, answers 503 while an N-1 replica serves, as namespace.guide_set does; a rollback's clean-up is named; the threshold never goes below two; the term leg honours exclude_keys and runs on the first page; any narrowing field excludes a miss; the marker is written last; nearest keeps document URIs only; definition.list shows lapsed governance. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: zlareb1 <[email protected]>
Gaps keep counts, not askers, and a user erasure drops the org's derived builds; the term leg has its own filter rule and stays on for read-scope pins, exclude_keys and min_similarity; a redact writes no version, deletes the record on N, and a rollback drops governed records; promotion approves the committed version; narrowing fields are a rule with examples. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: zlareb1 <[email protected]>
Governance binds to the approved text's hash again, so the entity pass and other copies keep it, while a tombstone or redact deletes the record; a rollback also drops pending definition drafts, as rule 23 does; the slug rule names the kept characters. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: zlareb1 <[email protected]>
A tombstone or redact deletes the governed record before it commits and is refused if that fails; a rollback deletes every definition draft whatever its status, and again once the gate closes; the gate also stops the gaps pass and query-history turns; the write-time change for existing definition rows is named; the invariant counts askers. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: zlareb1 <[email protected]>
Misses and gaps keep no document URI, so nothing outlives a user's erasure or a document's delete; the draft op finds live documents when it drafts; the term leg reads the addressed namespace only. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: zlareb1 <[email protected]>
A namespace that refused capture records no misses; a gap draft is written from its queries alone; a govern re-reads the row and drops a record a racing delete or redact left; recording sits behind the rollout gate; the threshold's floor is three and last_at keeps the day. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: zlareb1 <[email protected]>
Governance moves onto loom.shared (memory.promote / demote), which already records the approver and candidate, has lineage, and is known to erasure and every build; the governance table, its erasure, tombstone hook, race repair and rollback delete go. The asker is the person a token stands for, so self-minted tokens count once; the threshold's limits are stated; a held list names the erasure to finish. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: zlareb1 <[email protected]>
The shared layer gains what governing on it needs: a namespace-erasure step, a redact that reaches it, a token-stamped promoted_by, and a promotion check that skips key-identified types; sensitivity holds through promotion's refusal; a held list names its erasure by id; audit rows and excerpts are described as they are. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: zlareb1 <[email protected]>
memory.promote refuses a definition from anything but the namespace-wide row, and a relabel to high demotes one; promotion pre-checks a credential-shaped draft; the term leg drops other hits under its key; a loom_search miss needs every section empty and no tags; the asker reads the creator claim. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: zlareb1 <[email protected]>
Governance is checked when the term leg reads: provenance names only the namespace-wide row, which is live, not high and holds the same text, so pre-existing rows, N-1 and every relabel path are covered; promotion also requires the key to be the term's slug; the relabel-demote hook goes. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: zlareb1 <[email protected]>
The term leg reads the source from the memory authority and fails closed; the promotion conflict check skips definition only; memory.promote refuses an overlapping term on every path; the memory_type rule is unambiguous; the page is reflowed. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: zlareb1 <[email protected]>
A service account's token without the creator claim resolves its creator from the registry; a user erasure drops only the gap builds of namespaces the user asked in, and the fence covers only erasures of askers the pass read; misses keep only the normalised query; an expired source ends governance; a loom_search miss also needs nothing withheld, no tracker verdict and no skipped namespace; the invariant matches the last-promoted rule. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: zlareb1 <[email protected]>
A definition's promotion carries the content hash it approves and is refused if the source changed; a redact also blanks the candidate's text; governed keys stay out of later pages; N-1 retirements of a definition are found through memory.auto_retirements; misses expire after the seven days a pass reads, and the window setting goes; a claimed agent counts through its service account's creator. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: zlareb1 <[email protected]>
Misses live 14 days, the window is 7 and a build lives 7, so a user erasure always finds the namespaces to clear, and an empty build replaces an expired window; N-1 promotions are named for promotion again; a promotion refused after the write leaves a pending candidate a retry completes. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: zlareb1 <[email protected]>
loom_search's decision merge and answer-first rules never move or withhold a governed hit; PUBLICATION_PENDING leaves the candidate pending and the approved hash is the drafted value's; the shared layer needs seven changes. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: zlareb1 <[email protected]>
The privacy threshold names where it does not bind (signing key, issuers, trusted callers, self-created accounts); an unresolvable asker records no miss; the normalised form is defined; a redact blanks every draft for the key; query history reads every replica when the cluster is named; the term leg's filter list is complete. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: zlareb1 <[email protected]>
…tes first; mark rule precedes the script rules; invalid-Unicode query skips the leg Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: zlareb1 <[email protected]>
…rison only; marks continue either edge Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: zlareb1 <[email protected]>
… name, refused on several; mark rule by script; demoted source stays a plain row Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: zlareb1 <[email protected]>
…definition/ in the breaks; revision key wording; Inherited marks Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: zlareb1 <[email protected]>
…acts as its base; finding a revision's key Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: zlareb1 <[email protected]>
…t; definitions.list entry fields Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: zlareb1 <[email protected]>
…s every definitions.list field Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: zlareb1 <[email protected]>
…se mark rule; word of a name excludes stray marks Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: zlareb1 <[email protected]>
…d per name; miss form treats stray marks as the term leg does Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: zlareb1 <[email protected]>
…tion past the ceiling; bounded definitions.list; entry verdict fields Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: zlareb1 <[email protected]>
zlareb1
force-pushed
the
docs/curation-loop
branch
from
November 13, 2026 00:59
53a145c to
d6e282a
Compare
…apped entries carry only ordering fields; read limited to ceiling plus one Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: zlareb1 <[email protected]>
…otion; the bounded read re-applies both ceiling rules; list entry shapes Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: zlareb1 <[email protected]>
…count and read twice Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: zlareb1 <[email protected]>
…ised too Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: zlareb1 <[email protected]>
…d_from_candidate_id named in ignored_args Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: zlareb1 <[email protected]>
…n's key Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: zlareb1 <[email protected]>
…ts the draft first 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]>
This was referenced Nov 13, 2026
memory.definitions.list says which shared definitions are governed, and why a lapsed one lapsed
#679
Merged
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.
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):
...
Why
Searches that find nothing say what an organization has not written down, and the queries a team runs most often on its own ClickHouse say which metrics it relies on. Neither reaches anyone today. This page is the design for the loop that turns both into definitions a person promotes, and for serving a promoted definition above every other hit (a derived aggregate's count aside) when a query names its term. The three implementing PRs follow it: knowledge gaps, governed definitions, and then
knowledge.gaps.draftwith definitions from query history.The calls this page makes, and why:
search_trace_logorquery_nodes. The trace log records every query, itsactoris the token's principal rather than the resolved person, and it has no user-scope erasure step;query_nodescounts sessions and covers memory only; knowledge searches are not logged at all. A narrow table written only on a miss, by the op the caller invoked, from searches that read the namespace-wide rows with no narrowing filter, is smaller and erasable per user. Recording is an operator opt-in, off by default, and follows the trace log's rule for query text: nothing is recorded while the request's capture level isoff.loom.sharedrow promoted by an admin (memory.promote/memory.demote), which records its source and, on the review path, its candidate, is walked bymemory.lineage, and is known to every build. The term leg serves shared rows to every reader, so the shared layer gains a redact that reaches it, a token-stampedpromoted_by, a promotion conflict check that skipsdefinition, a refusal to promote a definition from anything but the namespace-wide row under the shared row's key, and a retirement of the shared copy's embedding when its source is relabelledmediumorhigh. Namespace erasure reachesloom.shared(a change of its own, already onmain). The guarantee itself is a read-time check: the term leg serves a shared definition only while its provenance names the namespace-wide row and that row is live, neither labelled nor gradedmediumorhigh, and holds the same text, so every writer, worker and older build is covered, except what the page's rolling-upgrades section names (an older build's promotion skips the hash check and takespromoted_byfrom the body, so every earlier definition is promoted again once no older replica serves). An earlier draft of this page added a governance table of its own; every review round found another edge of its state, and the shared layer has none of them.definitionis key-identified, likedecision, and never judged against a definition under another key, soMRRis not a revision ofARR.memory.search;loom_searchserves it through its memory section, whose repository-decision merge and answer-first rules never move or withhold a governed hit.namespace.guide_setdoes (memory.definitions.list, which reads only tables an older build knows, is not gated), so the new tables hold nothing an older erasure could miss; a rollback's clean-up is named.Scope and risk
One page,
docs/development/curation-loop-design.md, linked from the contributor section ofdocs/index.md;llms.txtregenerated. No code. It sits underdocs/development/, whichhelp.searchandhelp.getdo not index, so no agent is served ops that do not exist yet; the docs site publishes it under Development andllms.txtlists it, both with its first sentence, which says none of it is built yet; each implementing PR moves its part intodocs/architecture/, written as what Loom does, and removes it from this page.Compatibility, rollout and rollback
knowledge.gaps.list,knowledge.gaps.draft,memory.definitions.list,knowledge.query_history.add/.list/.remove, agovernedoutput field on memory hits, and an approved-content hash onmemory.promoteand, for adefinitionpromotion, refusals of a source that is not the namespace-wide row, atarget_keythat is not the source's key or lies outsidedefinition/, a term or alias another live shared definition holds, a promotion that adds a key at thememory_term_leg_max_definitionsceiling, and any definition promotion past it (breaks fordefinitionpromotions); anif_absentprecondition onmemory.setand anif_match_sha256precondition onmemory.delete, aterm_legoutput field,promoted_from_candidate_idignored and named inignored_argson a directmemory.promoteof a definition,approverignored and named inignored_argsbymemory.promoteandlearnings.reviewon every promotion of a definition, andlearnings.reviewrefusing a definition candidate that is not aknowledge_gaporquery_historydraft; each lands with its implementing PR.memory.setandmemory.bulk_setgive adefinitionno merge, duplicate or refinement verdict and no bulk fold into a byte-identical row under another key;memory.consolidateleavesdefinitionrows out; undernewest_winsneither a write by another identity nor the named-fact path retires a definition's namespace-wide row;memory.redactreaches the shared row and the drafts holding the redacted text;memory.promoterefuses a definition whose value is labelled or gradedmedium, and a relabel tomediumretires its shared embedding as one tohighdoes;memory.outcome's quarantine skips a definition's namespace-wide row;learnings.list, a viewer op today, showsknowledge_gapandquery_historycandidates (drafts that may repeat users' queries, and a team's SQL shapes) to admins only;learnings.reviewrefuses adefinitioncandidate of thememory_supportersorconversation_seederkind; amemory.searchwith the defaultscope = "private"is served governed shared rows; and a read-bounded token is served governed definitions, namespace-wide rows, through the term leg (an exception to the read-scope rule the page states and argues).Tests
tests/unit/test_doc_links.py,tests/unit/test_public_copy.py,tests/unit/test_agent_instructions.py,tests/unit/test_docs_reference.py,tests/unit/test_help_docs.py: pass.[email protected] --checkon the changed pages: clean.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. Every path, op, column and setting the page names that exists today was checked against the tree; the ones it adds are marked as the design.
I can explain every line of this diff and how it interacts with the rest of Loom.
Checklist
docs/describe the system as it now is, and this description names any operator steps and wire changes.tests/unit/test_public_copy.py).git commit -s), as CONTRIBUTING.md asks.🤖 Generated with Claude Code