Repository navigation
Development context
The things a contributor needs to know that don't fit neatly into a guide — where the codebase came from, the decisions that shape it, and the conventions that make review predictable.
The Hub is a consolidation: a root Next.js + Payload + PostgreSQL application (formerly hub-v2) with the member interface as App Router routes backed by src/member/, and the content MCP in mcp-content/ as an independent service. An earlier Vite/Express stack — and the interim wouter SPA that succeeded it — was retired; YMC-v2 is historical context, not somewhere to add features. The most consequential recent changes were the authority consolidation (two overlapping stores collapsed into the single authority_records model documented in Organisation and permissions) and the member interface's absorption into the App Router. If you find code that looks like it handles "the old way", it's probably a migration artefact, not live logic.
- No admin UI. Staff operations run through API endpoints and terminal scripts. Every surface is defended explicitly; there is no generated CRUD panel to accidentally expose.
-
One authority store.
authority_recordsis the single source of truth — no parallel ledgers, no denormalised mirrors. When the model needs a new fact, it goes on the record or the registry, not into a second table to sync. - Deny, never widen. Unknown role strings, out-of-scope grants, rows the registry doesn't recognise — all resolve to no authority, visibly, rather than being guessed at.
- Structure in git, data in databases. The repository is operational with zero data; nothing about real members is committed.
- Every write is audited. Transitions go through endpoints and services that record who did what — a change that leaves no trail is incomplete.
-
The MCP is a client. Agents hold member credentials and call the API; they get no
DATABASE_URLand no privileged path.
- British English in docs, interface copy, comments and review text. Preserve official titles, identifiers and API names verbatim.
-
Endpoint naming — transitions are named verbs (
/present,/close,/review), not PATCHes to astatusfield. -
Migrations are append-only, timestamped, idempotent where possible, and contain transforms (
INSERT…SELECT), never row literals. -
The lock contract — multi-record writes acquire advisory locks on all involved accounts, ascending and deduplicated, then row-lock inside the transaction.
withAuthorityLockis the only implementation. -
src/shared/stays isomorphic —mcp-contentloads it under plainnode, so it is.jsonly, with no Node-only APIs orprocess.env. -
Prettier formats everything — run
npm run formatbefore pushing; CI checks it.
- Changes go through pull requests —
CONTRIBUTING.mdis the process. -
AGENTS.mdin the repo is the binding statement of invariants; when you change architecture, update it in the same PR. - Agent contributors get their grounding from
.agents/skills/(per-domain recipes — authority, endpoints, member UI, data, MCP) and share session memory through thememoryMCP server (Hindsight bankyoungo-hub:recalltaggedproject:youngo-hubbefore work,retainverified findings after). There is no local file vault —npm run sync:mcpwrites the server into local agent configs fromHINDSIGHT_API_KEY(never committed). - Review is a conversation, not a gate — CodeRabbit and humans both leave threads; resolve them by changing code or explaining why not, not by dismissing.