Repository navigation
A collection is created from a title, its name derived, and a taken name says why with a free one - #471
Merged
Conversation
zlareb1
force-pushed
the
feat/collection-titles
branch
from
November 10, 2026 09:49
f0145f3 to
596ba2c
Compare
This was referenced Nov 10, 2026
zlareb1
force-pushed
the
feat/collection-titles
branch
8 times, most recently
from
November 10, 2026 18:29
8965b1c to
d6cc9ff
Compare
…ame says why with a free one People name a collection by its title (titles repeat); collection.create with derive_name derives the col- name, adding a short hashed suffix when the plain one is taken, and a title already used within the same parent answers that collection. A name already used answers COLLECTION_NAME_TAKEN with whether a deleted collection held it and a free name to use. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: zlareb1 <[email protected]>
zlareb1
force-pushed
the
feat/collection-titles
branch
from
November 10, 2026 18:42
d6cc9ff to
c1e6a42
Compare
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):
A collection is created from a title:
collection.createwithderive_namederives itscol-…name, and the Library shows titles. A name already used answersCOLLECTION_NAME_TAKEN, which says whether a deleted collection held it and offers a free name.Why
Creating a collection in the Library asked for a unique
col-…name, and a name already used in the org was refused withPRECONDITION_FAILED, the code a failedif_match_sha256check also answers, so neither a caller nor the dashboard could say what happened. Names stay unique in the org and are never reused: the name is the address that grants, search scope, audit and erasure key on. What changes is what a person types and what they are told.Q3 Plans→col-q3-plans), else the slug with a four-character suffix hashed from (org, caller, parent, title, attempt). The derivation runs on the server because only the server sees every reason a name is taken (another namespace, someone else's collection, other people's grants, leftover data, a deleted collection).created: false. That makes the create safe to retry with no idempotency key, and a folder upload, which comes next, safe to repeat. An untitled collection whose name is the title's plain slug counts as the title's, so collections made before titles are reused rather than duplicated; only its admin's create writes the title onto it. At the top level a collection whose creator no longer writes it is not the title's.derive_nameis explicit. The MCP transport fills a blanknamespacewith the caller's default, and the SDK adds its own, so a blank name cannot carry the intent. Withderive_namethe server ignoresnamespace. The dashboard also sends the plain derived name, which a server a release behind (which ignorestitleandderive_name) creates.COLLECTION_NAME_TAKEN(409) carriesdeletedandsuggestion. "the name 'col-x' is already used in acme", or "… belonged to a deleted collection in acme: a deleted name is never used again, so its old grants, audit rows and links cannot reach new content". The dashboard shows it with a Use col-x-ab12 button. A server a release behind still refuses withPRECONDITION_FAILED, which the dashboard shows with the server's words.Design notes:
loom.namespaces.title(migration 092), besidedescription. A separate table was considered and rejected. Every writer of an existing directory row copies it whole (dict(existing),SELECT * REPLACE), so a build that does not know the column keeps it.namespace.registerrefusescol-names, soregistry_rowonly builds a collection's fresh row; it now carriestitlefrom an existing row anyway.loom.collectionsbyparent, not in its sort key, so a scan of the org's tree rows withFINAL) and their labels. It runs again per candidate so two creates of one title serialize; a cheap read without claims skips candidates someone else holds, so most creates read once. A folder upload creates one collection at a time, so the cost grows with the folders sent and the size of the org's tree; the org's collection count bounds it.Operation.audit_namespacehook files collection.create's audit row under the collection it made or found, not the name the request sent (whichderive_nameignores and MCP fills with the caller's default).ns_writelists namespaces is never handed a derived name, sibling or suggestion outside that list; with none left the create answersAUTH_INSUFFICIENT, asking for an explicit name.deletedtells "a collection that was deleted" from "in use" for a name in the org. The name's existence is already disclosed by today's refusal.Scope and risk
collection.create(two paths: named, derived),collection.list(title), the directory read that lists labels, the personal-collection retirement blankstitleas it blanksdescription.collection.updateexists), folder upload and many-file upload (separate PRs built on this one).Compatibility, rollout and rollback
collection.creategainstitle(stripped and NFC-normalized, then ≤ 200 characters; it refuses control characters, format characters other than the joiners, the soft hyphen and the flag tags, and the characters that draw as blank: the Hangul fillers, the combining grapheme joiner, the braille blank and the line and paragraph separators) andderive_name(default false);namespaceis now optional whenderive_nameis set; the output gainstitle.collection.listentries gaintitle. Break: a taken name answeredPRECONDITION_FAILED; it now answersCOLLECTION_NAME_TAKEN, still 409, so both SDKs still raisePreconditionFailed.Operationgainsaudit_namespace(internal).ALTER TABLE loom.namespaces ADD COLUMN IF NOT EXISTS title String DEFAULT ''. N-1 reads and writes ignore it; rows it copies keep it.col-<slug>, or acol-c-…placeholder for a title with nothing to spell) without a title. On the new build, a later create of the same title reuses acol-<slug>one (an untitled collection by the name the title spells counts as its), but not a placeholder one: such a title then gets a second collection.Tests
tests/unit/test_collection_titles.py: derivation and its retry, a top-level title skipping a collection its creator no longer writes, only an admin titling an untitled collection, invisible characters refused and joiners kept, a title another person used, the sibling rule under a parent and at the top level, an untitled collection reused and titled only by its admin, a create cut short finished by its retry, a lagging sibling read still finding one's own, a client-fillednamespaceignored underderive_name, a deleted name and a used name refused with a free suggestion, a scoped token, the audit row's namespace, list titles, input rules.tests/unit/test_collection_create_name_in_use.pyandtest_namespaces_writers_mirror_classification.pyupdated;test_sdk_errors_from_response.pylists the new code.tests/analyzer/shapes.txtcarries the schema dump's new shape.tests/integration/test_knowledge_sharing.py::test_a_collection_made_from_its_title_is_found_again_by_it: creates from a title, reads the directory row back, lists, retries, a second person, the refusal. The whole file passes against a private server and ClickHouse (32 passed).CreateCollectionDialog.test.tsx(create from a title, an existing title opening its collection, a refusal with Use …, the title rule,plainName),LibraryCollections.test.tsx(titles, repeated titles, order),errorWords.test.ts(the line a taken name reads as).make format lint typecheck, the unit files above, the full unit suite once (the only failures weretest_tunable_constants, since fixed, and three clickhouse-local SQL files that fail onmainon this host too),viteston the four touched suites (all pass),npm --prefix frontend run build,npm --prefix frontend run budget,make migrateandmake schema-dumpon a private ClickHouse.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. The design went through four rounds of adversarial review against the code before the first line was written.
I can explain every line of this diff and how it interacts with the rest of Loom.
Checklist
make format-check,make lint,make typecheckandmake test-unitpass; the integration suite passes if server behaviour changed. (Format, lint, typecheck and the touched unit files pass; the full unit suite runs on the rebased head before merge; the integration suite in CI.)main; no merged migration is edited.npm --prefix frontend run build) and its tests pass, iffrontend/changed.docs/describe the system as it now is, and this description names any operator steps and wire changes.git commit -s), as CONTRIBUTING.md asks.🤖 Generated with Claude Code