Skip to content

feat(contracts,core-ts): collection registry (RFC-0040 step 1) - #84

Merged
Madraka merged 3 commits into
mainfrom
feat/collections-contract
Oct 22, 2026
Merged

Madraka merged 3 commits into
mainfrom
feat/collections-contract

Conversation

@Madraka

@Madraka Madraka commented Oct 22, 2026

Copy link
Copy Markdown
Contributor

RFC-0040 / ADR-0042, step 1 of 4: the contract and the read-only registry. No behaviour change.

  • Contract: CollectionSettings gains optional fields labels (per locale, {singular, plural, description?}), icon (a name slug, ≤ 40 chars), feed, sitemap and sort (newest|oldest|title). Site.collections allows at most 50 keys. Fixtures added: 1 valid, 4 invalid. Ran pnpm gen for TS and Rust; cargo test passes.
  • SiteGraphStore.listCollections(siteId) returns the declared keys, collections inferred from entries, and posts, each with counts per status, from one grouped query. store.ts keeps its size baseline: the menu dry-run return was compacted.
  • @cloudhal/core-ts/collections (Worker-safe) adds collectionRegistry, isRegistered, collectionLabel and collectionSettings.
  • Tests: unit tests in test/collections.test.ts. The store suite testing-collections.ts runs on sqlite, D1 and DO. Results:
    • core-ts: 673/675 pass. The 2 failures are Durable Object search tests that hit EADDRNOTAVAIL because the local machine ran out of ephemeral ports (about 16k sockets in TIME_WAIT). Not related to this change; CI runs them.
    • core-contracts: 449/449.
  • Changeset: core-contracts and core-ts, minor.

Next: step 2 (store invariants, API routes, renderer feed/sitemap).

Refs #71

🤖 Generated with Claude Code

…-0040 step 1)

CollectionSettings gains optional labels (singular/plural per locale),
icon, feed, sitemap and sort; Site.collections allows at most 50 keys.
SiteGraphStore.listCollections returns declared collections, those
inferred from entries, and posts, with counts per status (one grouped
query). @cloudhal/core-ts/collections adds collectionRegistry,
isRegistered, collectionLabel and collectionSettings. No behaviour
change; no migration.

Refs #71 (RFC-0040, ADR-0042)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Madraka <8898640+Madraka@users.noreply.github.com>
@Madraka
Madraka enabled auto-merge October 22, 2026 19:05
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Madraka <8898640+Madraka@users.noreply.github.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Madraka <8898640+Madraka@users.noreply.github.com>
@Madraka
Madraka merged commit 0da3b0c into main Oct 22, 2026
5 checks passed
@Madraka
Madraka deleted the feat/collections-contract branch October 22, 2026 19:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant