Skip to content

docs: fix stale endpoint paths and close architecture-doc gaps - #271

Merged
benders merged 1 commit into
mainfrom
docs/270-drift-and-architecture-gaps
Sep 3, 2026
Merged

benders merged 1 commit into
mainfrom
docs/270-drift-and-architecture-gaps

Conversation

@benders

@benders benders commented Sep 3, 2026

Copy link
Copy Markdown
Owner

Closes #270. Second half of the documentation review; #269 covered the instruction conflicts. Independent of #269 — different files, no stacking.

Drift fixed

  • hub-internals.md → /api/admin/hub/*. The activity and peers admin API was documented under /admin/*, which since Admin mount hardening: per-namespace handler partition (follow-up to #212) #226 mounts authRoutes only (server.ts:381). The doc contradicted the Admin mount hardening: per-namespace handler partition (follow-up to #212) #226 mount table in system-architecture.md. 4 lines.
  • pitfalls.md merge paths qualified — hub/src/library/, not hub/src/services/.
  • Four broken cross-doc anchors. hub-internals' Sonos/DLNA sections were consolidated into pointers to sonos.md/dlna.md, leaving #sonos-integration-issue-108 and #dlna-mediaserver-issue-175 dangling; two more slugs mis-encoded Hub/Player (the / is dropped, not hyphenated) and a backticked heading. Verified with a script that resolves every link and anchor across docs/, README.md, AGENTS.md, CLAUDE.md — all resolve.

Architecture-doc gaps closed

Three changes had landed without reaching system-architecture.md, which the AGENTS.md checklist requires for architectural work:

Diagram

The deployment diagram showed rest --> hubdb but never the audio path, so streaming — the product — was invisible in the system diagram. It now shows /rest/* resolving the preferred source and bytes leaving via the local Navidrome or a signed peer /proxy/rest/stream.

Design decisions

New table in system-architecture.md: why each load-bearing choice was made and what it costs — one process/two contexts, in-process app.inject(), reversible passwords, mutual trust without quorum, merge-time source selection, the dual catalog, Subsonic-only Navidrome, tolerated legacy settings rows. That rationale existed only in .codebase-memory/adr.md: generated, untracked, referenced by nothing. It answers the "can we just undo X" questions that otherwise get re-litigated from scratch.

.codebase-memory/ is now gitignored — it was the untracked entry in git status.

Verification

git diff -w across the docs shows only the intended content changes; everything else is table realignment per the AGENTS.md padding rule (several tables were already ragged before this). Link/anchor check clean. pnpm verify green (826 hub + 166 frontend tests) — docs-only, but the checklist is the checklist.

🤖 Generated with Claude Code

https://claude.ai/code/session_01Q6d5j3DE1sqf6Gm34gEAAN

…#270)

Drift:

- hub-internals.md documented the activity and peers admin API under
  /admin/*, which since #226 mounts authRoutes only (server.ts:381).
  Those handlers live in hubAdminRoutes -> /api/admin/hub/*. The doc
  contradicted the #226 mount table in system-architecture.md.
- pitfalls.md named merge-pipeline.ts / merge-worker.ts unqualified;
  they are in hub/src/library/, not hub/src/services/.
- Four cross-doc anchors pointed at headings that no longer exist:
  hub-internals' Sonos/DLNA sections were consolidated into pointers to
  sonos.md/dlna.md, and two slugs mis-encoded "Hub/Player" and a
  backticked heading. All doc links and anchors now resolve.

Architecture-doc gaps — three changes had landed without reaching
system-architecture.md, which AGENTS.md requires for architectural work:

- Merge runs off the main thread (#242): worker_threads Worker with its
  own connection to the same hub.db, process-wide mutex, shutdown on
  Fastify onClose, plus the two consequences that bite (SQLITE_BUSY on
  main-thread writes held across a merge; never call mergeLibraries()
  directly). Was documented only in hub-internals and pitfalls.
- GET /api/version + SPA auto-update (#196): why buildId hashes on-disk
  index.html rather than tracking APP_VERSION, and why any difference —
  not a newer value — means "update available".
- New Relic APM (#3): key-gated at the entrypoint, no app-level code.

The deployment diagram never showed the audio path, so streaming — the
product — was invisible in the system diagram. It now shows /rest/*
resolving the preferred source and the bytes flowing out via the local
Navidrome or a signed peer /proxy/rest/stream.

Added a "Design decisions" table capturing why the load-bearing choices
were made and what each costs: one process/two contexts, in-process
app.inject(), reversible passwords, mutual trust without quorum,
merge-time source selection, the dual catalog, Subsonic-only Navidrome,
and the tolerated legacy settings rows. That rationale previously lived
only in .codebase-memory/adr.md — generated, untracked, referenced by
nothing. That directory is now gitignored.

Markdown tables in the touched files realigned per the AGENTS.md rule
(several were already ragged). `git diff -w` over the docs shows only
the intended content changes.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Q6d5j3DE1sqf6Gm34gEAAN
@benders
benders marked this pull request as ready for review September 3, 2026 16:00
@benders
benders merged commit f35652c into main Sep 3, 2026
2 checks passed
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.

docs: fix stale endpoint paths and close architecture-doc gaps

2 participants