ADR-0042: First-class collections: an inferred registry on Site.collections, created by people or approved agents
- Status: Accepted
- Date: 2026-10-22 (decided by Halil)
- Related: RFC-0040, RFC-0038 / ADR-0040, RFC-0002, RFC-0007, #71
- Sources: WordPress
register_post_type· Payload localization · Ghost: custom post types request · Webflow, Framer, Wix, Sanity and Strapi research in #71
Context
A collection was only a string on an entry. Studio showed only posts, and agents could start any collection through create_entry.
Per-collection settings were scattered:
- the permalink on
Site.collections; - taxonomies on
Taxonomy.collections; - comments in
comment_settings.
The first entry of a new collection could also take another collection’s URLs, because no overlap check ran on it.
Decision
-
Site.collectionsis the registry. EachCollectionSettingsgains optional fields:labels: per locale, singular and plural;icon: a name from a closed set;feedandsitemap: absent means true;sort: absent means newest.
A site has at most 50 collections, and there is no
schemaVersionbump. -
Inferred, not migrated.
listCollectionsreturns the declared keys, every collection with entries, andposts. A collection becomes declared when a person saves its settings or whencreate_collectionruns. No site node is rewritten. -
No copies. Taxonomies stay on
Taxonomy.collectionsand comments incomment_settings. The collection screen edits each one where it is stored. -
Store invariants:
- keys are immutable;
- a key with entries cannot be undeclared;
- resetting a permalink keeps the declaration;
- the first entry of a new collection gets its default prefix checked for overlaps (
path_conflict).
The store does not require a declaration, so push, import and seed keep working.
-
Decisions are enforced where they are made:
- The API’s create-entry route refuses a collection outside the registry (
collection_undeclared). - MCP
create_entryrefuses one too, in its precheck and in every mode. create_collectionandupdate_collectionneedsite:writeand wait for a person. That person must holdsite:settings(approverScopes).list_collectionsneedscontent:read.
- The API’s create-entry route refuses a collection outside the registry (
-
Themes: additive exports only (
collectionLabel,collectionSettings). With default settings, feed and sitemap output is unchanged. -
Later, already decided:
- Typed custom fields (stage 2): values go in
ContentEntry.fieldsand are checked by an eval-free checker. Localization is chosen per field up front. Renames, type changes and removals are explicit migration operations. - After that: JSON-LD presets, expiry automations and reference fields.
- Typed custom fields (stage 2): values go in
Consequences
- Positive:
- Every collection is visible and named in Studio.
- Agents cannot widen a site’s structure without a person.
- ADR-0040’s overlap gap is closed.
- Stage 2 has a place for field definitions.
- Negative:
- The site node grows with labels.
- “Inferred” collections are a second state that Studio has to explain.
- One collection’s settings live in three stores.
- Risks: a tool that creates entries but skips the registry check would reopen the side door. The check therefore lives in one shared precheck that every entry-creating tool uses.