Skip to content

docs(adr-0046): P3 — book navigation as a spine with derived membership#1865

Merged
xuyushun441-sys merged 1 commit into
mainfrom
feat/adr-0046-p3-book
Jun 15, 2026
Merged

docs(adr-0046): P3 — book navigation as a spine with derived membership#1865
xuyushun441-sys merged 1 commit into
mainfrom
feat/adr-0046-p3-book

Conversation

@xuyushun441-sys

Copy link
Copy Markdown
Contributor

What

Adds §6 to ADR-0046, specifying the P3 documentation-navigation model.

A book is a metadata element that stores only an ordered spine (groups + identity + access). Membership — which doc sits in which group — is derived from a rule on each group (include glob/tag) plus an optional per-doc order/group. There is no central pages array.

Why (the load-bearing decision, §6.2.1)

Storing the whole tree in one array conflates three concerns with very different change profiles. Only the low-cardinality group definitions deserve central storage; the high-cardinality, AI-churned membership must not live in an array, because:

  • AI safety — ADR-0033 makes AI the primary author. A central array forces a read-modify-write on every doc the AI adds (stale/concurrent edits silently drop or reorder siblings, in navigation where it's least noticed). A derived spine removes the write: the AI creates a doc named to match a rule and it files itself — create-and-forget, the shape §1 already chose for flat docs.
  • Overlay safety — overlay is RFC 7396 JSON Merge Patch, which replaces arrays atomically; a runtime nav overlay on pages would shadow docs a later package version adds. With membership derived and only a small spine stored, the volatile part never enters an array; per-doc order is a scalar that 3-way-merges cleanly.

Also specified

  • Implicit per-package book — no book ⇒ a synthetic book keyed by packageId; the model has no "flat vs book" fork.
  • audience access (org default / public ≡ data-layer guest / { profile } for role-gating) — the first metadata access concept, shaped as a reference into the existing permission model, enforced at the /meta/doc read layer (not just UI).
  • Anonymous "library" portal reuses apps/docs (Fumadocs + per-host ISR), tenant from host (resolveByHostname) — not greenfield SSR; honest about the cost and the §2 boundary.
  • No meta.jsonbook is metadata, authored as *.book.ts (defineBook()), consistent with every other element.

Reconciles with §4's prior rejection of directory taxonomy (§6.1): the rejection was about references encoding paths; book keeps content flat/name-addressed and puts structure in a separate explicit element that names stable things.

Docs-only change. Implementation (P3a→P3c) follows in subsequent PRs.

🤖 Generated with Claude Code

…ved membership

Adds §6 to ADR-0046 specifying the P3 navigation model. A `book` is a metadata
element that stores only an ordered spine (groups); membership is derived by
rule (`include` glob/tag) plus optional per-doc `order`/`group`, never a central
array. This is chosen so AI authoring stays create-and-forget (no central-array
read-modify-write, §6.2.1) and runtime overlay stays merge-safe under RFC 7396.

Also specified: the implicit per-package book (packageId), `audience` access
(org / public≡guest / {profile}) enforced at the read layer, and a host-based
anonymous "library" portal reusing apps/docs (Fumadocs + per-host ISR) rather
than greenfield SSR. No `meta.json`: `book` is metadata, authored as *.book.ts.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@vercel

vercel Bot commented Jun 15, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
spec Ready Ready Preview, Comment Jun 15, 2026 5:30am

Request Review

@github-actions github-actions Bot added documentation Improvements or additions to documentation size/m labels Jun 15, 2026
@xuyushun441-sys
xuyushun441-sys merged commit d8efb0a into main Jun 15, 2026
13 checks passed
@xuyushun441-sys
xuyushun441-sys deleted the feat/adr-0046-p3-book branch June 15, 2026 05:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation size/m

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants