Repository navigation
docs: fix stale endpoint paths and close architecture-doc gaps - #271
Merged
Merged
Conversation
…#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
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.
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 mountsauthRoutesonly (server.ts:381). The doc contradicted the Admin mount hardening: per-namespace handler partition (follow-up to #212) #226 mount table insystem-architecture.md. 4 lines.pitfalls.mdmerge paths qualified —hub/src/library/, nothub/src/services/.hub-internals' Sonos/DLNA sections were consolidated into pointers tosonos.md/dlna.md, leaving#sonos-integration-issue-108and#dlna-mediaserver-issue-175dangling; two more slugs mis-encodedHub/Player(the/is dropped, not hyphenated) and a backticked heading. Verified with a script that resolves every link and anchor acrossdocs/,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:hub.db, process-wide mutex, terminate on FastifyonClose. Plus the two things that actually bite:SQLITE_BUSYon a main-thread write held across a merge, and never callingmergeLibraries()directly. This is the concurrency model; it was documented only inhub-internalsandpitfalls.GET /api/version+ SPA auto-update (SPA: auto-update on new version while preserving player + queue state #196) — whybuildIdhashes the on-diskindex.htmlinstead of trackingAPP_VERSION, and why any difference (not a newer value) means "update available", so rollbacks propagate like upgrades.Diagram
The deployment diagram showed
rest --> hubdbbut 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-processapp.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 ingit status.Verification
git diff -wacross 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 verifygreen (826 hub + 166 frontend tests) — docs-only, but the checklist is the checklist.🤖 Generated with Claude Code
https://claude.ai/code/session_01Q6d5j3DE1sqf6Gm34gEAAN