Change Log
This page is generated from the project corpus and rewritten on every docs build. Edit the source in corpus/, not here.
Append-only. Format: ## [YYYY-MM-DD] action | summary
[2026-09-01] init | created the corpus. Surveyed the existing auth across the estate (atrium: accounts+profiles, operator-seeded, scrypt, opaque server sessions, Bearer + ?token=; newspapper: single account, stateless HMAC cookie, IP-keyed lockout, loopback-only, undeployed; plus public-resource-map, imbatranimOS, sports-app, trips) into wiki/estate.md. Recorded the load-bearing topology finding: the whole estate is sub-paths on ONE origin (the production domain), per the master Caddyfile in vps-deploy — a shared cookie is nearly free, app-to-app isolation is impossible. Researched candidates (Authelia, Tinyauth, Pocket ID, Zitadel, Authentik, Keycloak, Kanidm, and building an owned service) into wiki/landscape.md. Opened four root design questions in wiki/open-questions.md; nothing decided. Seeded wiki/decisions.md with the two inherited atrium decisions (D30 accounts, D35 profiles) that constrain any design here, and wiki/glossary.md with the terms that were already colliding across repos (account / profile / person / session / origin). Copied lint.sh from newspapper, emptied its ABANDONED_ROOTS (this repo has retired nothing) and guarded the loop for an empty array.
[2026-09-01] decide | Round 1 of the design grilling settled, 4 decisions recorded in wiki/decisions.md. (1) The estate stays on ONE origin with sub-paths — near-free SSO via a Path=/ cookie, which also retires atrium's ?token= workaround; the accepted cost is zero isolation between apps, and subdomains were rejected on the cost of rewriting the master Caddyfile plus atrium's baked-in absolute VITE_API_URL and service-worker cache regex. (2) wzd_auth owns credentials + account identity only; every app keeps its own per-user rows keyed by a stable opaque subject — rejected both a central store-of-record for all per-user data (couples six release cycles to one schema) and credentials-only (leaves six answers to "who is this person"). (3) Accounts are for the owner plus known people, no public signup — upholds atrium D30 estate-wide and collides head-on with public-resource-map's shipped registerSchema, logged as a live conflict rather than papered over. (4) Newspapper leaves loopback, which revises newspapper/corpus/wiki/decisions-security.md — its public /uploads/*, non-revocable 30-day HMAC cookie and IP-keyed lockout now meet real internet traffic. Added Subject to the glossary as the identity↔app contract; settled Profile as atrium-local. Opened Round 2 (Q5 build-vs-adopt, Q6 session revocability, Q7 credential type, Q8 the prm conflict, Q9 the name).
[2026-09-01] decide | Round 2 partly settled. Recorded the passwords-only decision (passkeys additive and later, not passkey-only) — the rejected option is written up because it looks strictly more modern and will be proposed again, and it fails specifically on atrium D35's shared household tablet, passkeys being per-device credentials. Q5 (build rather than adopt) treated as answered by implication, since choosing a token design and refresh policy is only a decision one gets to make when building; being confirmed explicitly. Two contradictions surfaced rather than papered over and carried into Round 3: (a) "JWTs plus a table of revoked JWTs" — a per-request denylist check pays the lookup a JWT exists to avoid, so it is opaque sessions with extra steps; the resolving shape is a short-lived access JWT never checked against a denylist plus a long-lived opaque refresh token that is a row, where revoking is deleting the row and no denylist exists. (b) prm joining wzd_auth collides head-on with the no-public-signup decision, since prm ships public self-registration. Also opened: token signing (shared HMAC lets any app mint tokens for all six; asymmetric only verifies), and the canonical identifier conflict — atrium and newspapper key on username, prm on email plus emailVerified.
[2026-09-01] decide | Round 3 settled; the design has a shape. Named the service Ward (a warding enchantment on a threshold — access control, puns on "warden", keeps the Atrium/Citadel/Hollow architectural streak); retired wzd_auth, which named the estate's identity service after newspapper's markup file extension. Split the decisions page: identity/scope/naming stay in wiki/decisions.md, session mechanics move to wiki/decisions-tokens.md. Locked the token shape after researching current practice — short-lived signed access JWT + opaque rotating refresh row with reuse detection killing the family, and no denylist: rejected the originally-requested revoked-JWT table because a per-request denylist pays the very lookup a JWT exists to avoid, and once the revocable thing is a row, "revoked" is its absence. Recorded OWASP's gotcha in case a denylist ever returns — key it on jti, never the raw token or its hash, which JWT malleability walks straight past. Adopted the owner's introspection-with-cache proposal over my own recommendation: the sources back it for the multi-service case, since revoking becomes one operation rather than six lookups and six cache-invalidation problems, and Ward shares a box with all six apps so it is a loopback call. Permissions deliberately excluded from token claims — a token minted before a grant changed would carry stale authority for its full lifetime. Signing is EdDSA held by Ward alone; rejected shared HMAC, which would let any one compromised app mint identity for all six. Username chosen as canonical identifier over email (owner's call, against my recommendation) — carried the consequence forward rather than dropping it: prm keys on email, so its rows do not migrate mechanically and recovery has no channel yet. Q12 revised two Round 1 decisions: prm joins Ward, public registration is allowed, and the security boundary moves from registration to authorization — a (subject, app, role) grant, with role strings stored opaquely so Ward never needs redeploying when an app grows a capability. Opened Round 4 on the tail that created: grant cardinality, which apps accept signup, whether email is collected and verified, and the two lifetime numbers.
[2026-09-01] decide | Round 4 settled; the design grilling is complete at 13 decisions. A grant carries a set of roles, not one — rejected single-role (simpler, matches prm today) because a set costs nothing now and avoids a migration the first time any of six apps needs two at once. Registration is open per app via a flag, closed by default — rejected Ward-level signup because it fails in the wrong direction, leaving a new app reachable by strangers until someone remembers to close it; the flag fails safe. Email is optional, verified only on the public path — owner-issued accounts skip it entirely, which puts the cost exactly where the strangers are; two costs accepted explicitly, a mail sender plus verification flow now in scope (the largest single chunk of build cost here), and owner-issued accounts having no recovery path at all. Lifetimes: 15-minute access token, 30-second introspection cache, 30-day rotating refresh — recorded that the 30 seconds is the number that matters, since apps introspect on every request, and that logout is near-instant in practice because it clears the cookie, leaving the window exposed only to an already-stolen token. Split the decisions page a second time (it had reached 190 of 200 lines): foundational scope stays in decisions.md, accounts/registration/grants move to decisions-accounts.md, tokens stay in decisions-tokens.md. One question left open and it is a fact rather than a preference — whether prm has live accounts that must survive, which is all that blocks a migration plan, since prm keys on email and every existing row would need a username that does not exist yet.
[2026-09-01] decide | Owner chose to prune rather than migrate: every existing credential store is emptied and accounts are recreated in Ward. Closes Q19 outright — prm's email-keyed rows need no username invented because they do not survive. Rejected migrating atrium's scrypt hashes, which would have worked, as not worth the code for a population of the owner plus a few known people. Caught a destructive failure mode while scoping it, recorded rather than discovered later: in atrium profiles.user_id references users ON DELETE CASCADE and reading_progress.profile_id / latex_projects.profile_id cascade from profiles in turn, so emptying users destroys reading progress and LaTeX projects; notes.profile_id and note_folders.profile_id are ON DELETE RESTRICT and would block the delete instead — an accidental safety net. Authored content is not auth data and is out of scope for the prune; where exactly the boundary falls is Q20 and nothing is to be deleted until it is answered. Also recorded the first-boot admin: WARD_ADMIN_USERNAME / WARD_ADMIN_PASSWORD seed the first account only when the users table is empty, newspapper's existing pattern — the first-boot-only semantics being the surprising half, since re-reading every boot would make .env the permanent source of truth for a live credential and turn a password change into a redeploy. A UI is newly in scope; its shape (one login page or six, console contents, self-service, whether ward:admin is just another grant) is Round 5.
[2026-09-01] decide | Round 5 settled; 17 decisions. Prune takes everything (Q20) — the owner was shown exactly what cascades and chose the clean slate, so atrium's profiles, reading progress, notes and LaTeX projects go, along with prm's favorites, notifications and tokens; nothing is re-anchored because nothing survives. Verified prm's shape while scoping it: Drizzle with ON DELETE no action on every FK, so a user delete fails until its dependents go first, and all of its user-scoped tables are derived data with no authored content to lose — also noted that prm already ships reset_token and verification_token, so the email machinery Q17 put in scope can be cribbed rather than invented. Cutover brief must take a database copy first; atrium's own backup-pre-brief35-* directory is the precedent. One central login page at /ward/login with ?next= (Q21) — rejected per-app forms because Ward exists to delete six copies of auth and per-app forms keep six copies of the form, where lockout and verification states get subtly wrong six ways; the accepted cost is that atrium's Reading Room and newspapper's Mechanical both hand their sign-in moment to a third visual identity. UI is console plus minimal self-service (Q22), self-service earning its place because owner-issued accounts have no verified email and therefore no recovery channel, leaving "sign out my other devices" as the only self-serve response to a suspected theft. Superuser is environment-only with no account row (Q23) — this REVISES the first-boot-admin decision recorded earlier the same day; rejected both seeding a first admin row (an ordinary account can be locked out, revoked or deleted, which is what a recovery mechanism must not be) and ward:admin as a grant (elegant, but leaves the estate one bad revoke from nobody being able to grant anything). The trade accepted explicitly: a live credential now sits in plaintext on disk permanently, defensible as break-glass rather than a daily driver, and the only thing that still works when the database is empty or its last admin is gone.
[2026-09-01] decide | Round 6 settled; the design grilling is complete at 20 decisions across four pages. Split administration onto its own page, wiki/decisions-admin.md, because two privileged identities now exist and conflating them is the mistake most worth preventing. The superuser reaches the console and nothing else (Q24) — needing no enforcement code, since access is a grant and the superuser has none; its session is a distinct console session and never a JWT. Rejected a reserved sentinel subject, which works only while all six apps remember to reject it — it fails on discipline, where a non-JWT session cannot accidentally satisfy an app's ordinary auth check at all. Rejected a superuser bypass whose only effect would be letting a break-glass credential read the library and notes. The apps are run by an ordinary owner account, not the superuser (Q25, the owner's own framing) — this is the half that makes the superuser decision safe, since without a daily driver the break-glass credential inevitably becomes the everyday login, which is precisely what a credential with no revocation, rotation or audit trail must never become. Its grants are explicit, one per app, no wildcard — a *:admin would make a newly-added app reachable the moment it exists, contradicting the fails-safe property the per-app registration flag was chosen for. Console access cannot be delegated (Q26), recorded as a limit rather than an oversight: one credential, one administrator, correct for one operator and wrong the moment there are two, at which point ward:admin with a refuse-to-remove-the-last-one guard is the design set aside. Added superuser and owner account to the glossary as explicitly non-interchangeable terms. open-questions.md is now empty, which is the goal state.
[2026-09-01] plan | Wrote 16 briefs into corpus/briefs/todo/, grouped into nine dependency waves recorded in wiki/status.md; briefs within a wave own disjoint files and can run in parallel. Foundation: 00 scaffold+rename+env contract, 01 schema, 02 EdDSA keys and JWKS, 03 passwords/login/refresh rotation, 04 introspection, 05 apps and grants, 06 superuser. Surfaces: 07 public registration and email, 08 the @ward/client package, 09 login and self-service UI, 10 the console. Then 11 deploy, 13/14/15 the atrium, newspapper and prm cutovers, and 16 the destructive prune. Renumbered the cutover from 12 to 16 so its number matches its position — it must run after the integrations, since pruning before the apps can talk to Ward leaves the estate with no accounts and no way in; within the brief the order is back up → recreate → verify sign-in across all six apps → only then prune. Two engineering choices deferred into brief 00 with reasons and flagged to be recorded as decisions on landing: raw better-sqlite3 rather than Knex (atrium's own D47 records three correctness properties that broke when statements could interleave, and Ward's hot path is session lookup under concurrency) and node:crypto scrypt rather than argon2 (zero new dependencies, and the full prune means no hash constrains the choice). Brief 00 also defaults HOST to 127.0.0.1 rather than repeating atrium's 0.0.0.0. Brief 14 carries the one design call left deliberately open in a brief rather than settled in the corpus: newspapper's public /uploads/* was bounded by ref entropy AND an unreachable port, and going public removes half of that — the render-scoped token originally rejected as "more machinery than a local single-user app earns" is now back on the table.
[2026-09-02] build | Brief 00 landed — Ward has code. Three npm workspaces (api, plus ui/client as empty scaffolds), a zod-validated fail-closed environment contract, raw better-sqlite3 with a static-import migration runner, and GET /health on loopback. Built by five parallel agents against controller-pinned contracts, then three scoped review finders and one fix round. Opened wiki/decisions-implementation.md as a fifth decisions page — decisions.md was at 144 of the 200-line cap and every remaining brief lands engineering calls, so splitting now beats splitting mid-build. Recorded there: better-sqlite3 over Knex (atrium's D47 records three correctness properties that broke when statements could interleave; Ward's hot path is session lookup under concurrency, so synchronous is the mechanism rather than a limitation), static-import migrations over a directory scan (a scan finds a different set of files depending on whether the process started from .ts under tsx or .js under dist/), scrypt over argon2id (zero native dependencies — a native build failing on a Node upgrade takes the estate's login with it — and the full prune means no hash constrains the choice; revisit at volume, since rehash-on-next-login is always available), and loopback binding (atrium binds 0.0.0.0 and rests "Caddy is the only way in" on the firewall alone). Review caught two Criticals the gates could not. (1) .gitignore never covered the Ed25519 signing key at the path .env.example itself suggests, so one git add -A would have committed the estate's only signing key — recovery being rotation across all six apps plus a history scrub. Found independently by two finders. (2) db.close() was never called on shutdown, so SQLite never ran its close-time WAL checkpoint: measured ward.db at 4096 bytes with zero tables after a full boot→serve→SIGTERM cycle, which is every pm2 restart and every deploy. Since .env.example correctly tells the operator that file "is the only copy of who anybody is", brief 11's backup would have copied an empty database and reported success. Recorded as a decision rather than a bug fix, because the tempting cleanup — "process.exit closes everything anyway" — is wrong for a reason nothing in the code makes visible. Also fixed: openDatabase was untestable by construction (the eager singleton meant importing it evaluated config.ts and could process.exit, which would have broken brief 01's first test — getDb() is now async precisely because only a dynamic import genuinely defers that), the runner could not detect a renamed migration, and the migration-author contract stated a false constraint about nested transactions. Two deviations recorded rather than hidden: the repo directory is still wzd_auth (the owner deferred the rename because it moves the directory their session is open in; package.json says ward and nothing else references the old name), and there is no test framework, so the loopback and fail-closed properties are hand-verified with nothing guarding them against regression — brief 01 is the place to land a runner. typescript pinned to 6.0.3 rather than the latest 7.0.2, because typescript-eslint peer-requires <6.1.0; revisit when that ecosystem catches up to the TS 7 native port.
[2026-09-02] build | Wave 2 landed — briefs 01 (schema) and 02 (signing keys). Six tables in one baseline migration with a thin query module each, plus Ed25519 signing, a published JWKS and 15-minute access tokens. The test runner landed here too, ahead of both briefs, because both had tests in their acceptance criteria and brief 00 had wired a test script with no runner behind it; 125 tests now, vitest at the repo root with pool: "forks" because better-sqlite3 is a native addon. Both implementing agents were killed mid-run by a quota limit after finishing the work but before reporting, so their handoff contracts were reconstructed from source by the controller and are recorded in the two outcome notes — verified against code, not an author's summary. Two review passes found seven issues, each reproduced by execution before the fix and re-run after. The two that mattered: (1) verifyWardAccessToken spread a caller-supplied options bag after the pinned issuer, so any call site could set clockToleranceSeconds (an unbounded lifetime extension), issuer: undefined, audience, or currentDate — all four confirmed accepting a token expired 30 days ago or one minted by https://evil.example. It now takes a token and nothing else; a spread reorder was rejected as a fix because it still type-checks the dangerous fields and the next refactor reopens the hole, and brief 08 re-exports this surface into six apps. (2) grantTargetId joined components with : while role strings are explicitly opaque and unrestricted — the tests deliberately grant one containing : — so ("atrium", "a:b") and ("atrium:a", "b") produced an identical target_id, silently breaking the console's "everything that happened to this grant" filter, which is the one job audit_log exists to do. Components are percent-encoded now, with a parseGrantTargetId to decode; the encoding changed rather than the allowed role charset, since role opacity is locked in decisions-accounts.md. Also fixed: keygen --force could not restore 0600 and printed 0600 regardless (writeFile's mode applies only on create, so a forced overwrite inherited whatever a restore had left); the loader booted silently on a world-readable key, and now warns rather than refuses, because refusing on a permission bit turns hardening into an outage mid-recovery; the previous-key slot was additive trust granted by a filename — an unrelated Ed25519 key dropped at <key>.previous.pem minted a token for an arbitrary subject that verified cleanly, the asymmetry being that filling that slot needs only write access where abusing the current key needs read — now logged at warn with the rotation lifecycle documented; jwksUrl's base path defaulted to "", resolving to https://origin/.well-known/jwks.json while Caddy serves Ward under /ward-api/*, so the documented usage would have made all six apps fetch a 404 and reject every token (fails closed, so an outage rather than a bypass, but a wrong default in the one module brief 08 lifts unchanged — it is required now, so a wrong value is a compile error at the call site); and grants.granted_by was nullable while its own comment promised it answers "who granted this" even if the log is pruned. Recorded as a standing constraint: the baseline migration was edited in place during that fix round, which was safe only because no persistent database existed yet — every applied copy was a scratch database in a test. It freezes when brief 11 deploys, after which a schema change is a new migration appended to MIGRATIONS, never an edit, because the runner records the name and an edit to an applied migration is silently skipped on every existing database. Three properties were confirmed by review to hold structurally rather than by care, worth knowing before anyone simplifies them: private key material cannot reach the JWKS (the published JWK is built field-by-field from an allowlist and an unexpected parameter fails at boot, so a future key type refuses to start rather than leaking), the algorithm is genuinely pinned (alg: none, HS256 signed with the public key's own bytes, Ed25519, and constructor — which would otherwise index the library's lookup table into Object — all rejected), and refresh rotation is atomic (claimRefreshToken and revokeFamily are each a single UPDATE ... RETURNING, which is what brief 03's reuse detection rests on). One sharp edge left unfixed and recorded instead, because no call site is wrong today: "current key signs" is conventional, not structural — getKeySet() exposes .previous and the low-level signAccessToken accepts any key, so briefs 03 and 04 should mint through mintAccessToken(subject) and nothing else.
[2026-09-04] build | Wave 3 landed — briefs 03 (login, refresh rotation, lockout) and 06 (the superuser and its console session). Ward can now authenticate somebody: 315 tests, up from 270. Recorded three of brief 03's resolutions as decisions in wiki/decisions-implementation.md — the absolute 30-day refresh-family lifetime (a sliding expiry was rejected because it makes a family immortal for as long as anyone keeps rotating it, and the party most likely to rotate quietly forever is a thief; the reuse alarm only fires when the victim returns, and a victim who has stopped using the app never does), logout revoking rather than deleting (the revoked_reason column exists so the console can tell a logout from a rotation from a theft signal, and DELETE erases exactly what an operator investigating a stolen session needs), and the lockout key never being request.ip (Ward binds loopback behind Caddy, so request.ip is 127.0.0.1 for the entire internet and the sixth failed login anywhere would lock out everybody; the last x-forwarded-for element is used because Caddy appends the peer it observed, so a client prepending a spoofed value only adds an element nobody reads). Two review passes found thirteen issues, and the two worst broke ordinary use rather than resisting an attack. (1) Two tabs refreshing at once destroyed the session: the single-use UPDATE held — only one caller wins it — but the loser's reuse sweep revoked the winner's brand-new R2, leaving zero live tokens and a false theft record. On a one-origin estate where six apps share one access cookie at Path=/, several tabs waking together is the expected shape, and a StrictMode double-effect does it too. A used token presented again is now a race rather than a theft when its family still has a live successor issued within ten seconds. That fix was itself incomplete and the reviewer caught it: the controller first ruled the raced response must stay byte-identical, which left cookie-clearing headers on the loser's 401 — and since both responses race into one shared cookie jar, a loser landing second dropped the tokens and signed the person out anyway, turning a certain loss into a coin flip. The raced branch now clears nothing, on the reasoning that clearing exists to stop a client looping on a dead session, so in a race it does not tidy up after the session, it destroys it. What that concedes is a Set-Cookie-shaped signal that the token was genuine and freshly rotated, available only to someone already holding it who could learn the same by retrying after the window. (2) One valid account bought unlimited password guessing, because clearFailures was keyed on address: four wrong guesses at a victim then one correct login to the attacker's own account reset the counter — 40 guesses accepted with zero 429s, and prm ships public registration so brief 07 makes obtaining that account self-service. The lockout decision stays on the address; forgiveness is now per account, with the per-address breakdown capped because anonymous input feeds it. Also fixed: a cross-site form POST signed the victim out of the whole estate silently (SameSite=Lax stops cookies being sent cross-site, not a response deleting them, and enctype="text/plain" slips past Fastify's content-type rejection — cookies are now cleared only when a token was presented, and both routes refuse a request whose Sec-Fetch-Site or Origin says cross-site, while absent headers still pass because server-side clients send neither); the break-glass credential shared its lockout budget with ordinary login, so anyone could lock the operator out of the one credential that still works when /login is under attack; consoleCookieSecure() failed open where its sibling fails closed, shipping the console cookie without Secure on a plain-HTTP hostname; minting after the rotation commit burnt families on a dropped response; a loopback caller with no forwarded address silently collapsed the estate into one lockout bucket; an unauthenticated 500 echoed the signing key's absolute filesystem path to anyone on the internet; and the reuse alarm recorded no presenter address while being writable without bound by replaying one spent token. The superuser's load-bearing property holds structurally, not by convention: a console token is wcs_ + random with one dot-separated segment where a compact JWS has three, so the access-token verify path rejects it as JWSInvalid — it cannot accidentally satisfy an app's ordinary auth check because it is not the same kind of thing. There is no isSuperuser branch anywhere in production code, and brief 04 needs none either; "console only" falls out of the superuser having no grants. Its session lives in an in-memory map with no table, so "the superuser has no row anywhere" is literally true. One acceptance criterion is deliberately owed forward: brief 06's most important test — a superuser console token presented to /introspect returns active: false — could not be written because /introspect is brief 04. It is asserted structurally in wave 3 and carried to brief 04 as a required test.
[2026-09-04] build | Wave 4 landed — briefs 04 (introspection) and 05 (apps, grants, accounts, audit), plus the sid claim and the first integration tests. Ward is now a working identity service: it authenticates people, tells apps whether a session is live and what it may do, and administers the estate from a break-glass console. 444 tests, up from 315. Brief 04's honesty is what made this wave matter. Asked whether a revoked refresh family could be linked to a still-valid access token, it worked out that it could not — jti is a fresh UUID that is never persisted and no claim named the family — and said so instead of overclaiming. It implemented the strongest sound statement available (an account with no live refresh token has no live session) and rejected a half-fix, recording why: refusing tokens whose iat postdates the newest live refresh row catches about half the two-family orderings, rests on an invariant in a file it did not own, and fails by spuriously signing a legitimate person out of six apps. The controller then closed the gap properly with a sid claim carrying the refresh family id, so introspection asks whether that family is live. This was worth doing rather than accepting because of where the gap landed: decisions.md justifies the entire self-service UI on one feature — "sign out my other devices is the only self-serve response available to someone who suspects their session was stolen" — and that is exactly the case the gap broke, against an attacker who by hypothesis is actively using the token. Recorded in decisions-tokens.md, including why it does not contradict the no-permissions-in-claims rule: that rule exists because a token minted before a grant changed would carry stale authority, and a session id cannot go stale that way since it names a row whose liveness is read fresh every time. sid is identity, not authority, and is the standard OIDC name for it. Made required rather than optional in both the claim and the mint parameter, because an optional one lets a call site mint a silently unlinkable token and forces introspection to guess what an absent sid means — where the only safe answer is "not live", turning a forgotten argument into an outage instead of a compile error. hasLiveFamily also requires the family to belong to the subject; that pairing cannot be forged through /introspect, which reads sub and sid off one verified token, but the safety was living in the caller and brief 09's "sign out my other devices" is precisely the shape that pairs a subject from a session with a family id from a request. The first integration tests landed and paid for themselves immediately. Nine tests drive the real buildApp() against a real on-disk database and a real generated Ed25519 key over app.inject, closing the gap status.md had been naming as the biggest one — every prior test built its own Fastify instance or opened :memory:, so 429 tests overstated the confidence. They also settle two acceptance criteria neither brief could satisfy alone because each needed the other's endpoint, and flow 1 runs the estate's actual bring-up sequence, which nothing had ever executed. They found two behaviours no per-module test can reach: the 10-second refresh race carve-out swallows a replay that fires too soon (a naive login → refresh → replay is treated as two tabs racing, so nothing is revoked — refresh.ts's unit tests call rotateRefreshToken directly in whatever order they please and never hit it), and session.refresh_denied is effectively unreachable for the everyday disabled account, because /refresh peeks sessionForRefreshToken — which already excludes a disabled account — before the rotation that would write the row. Both are documented in code where they surfaced. Brief 06's owed acceptance test now lives in introspect.test.ts: a superuser console token returns active: false, and nothing implements it, which is the point — a console token has one dot-separated segment where a compact JWS has three, and the superuser holds no grants. Brief 04 also has no isSuperuser branch, as decisions-admin.md requires. Brief 05 proved the console surface closed with a real signed access token carrying two grants, refused through cookie, bearer and console-cookie alike. Two of its calls are worth knowing: a no-op writes no audit row (auditing double-clicks buries the rows an operator needs under noise they generated by mis-clicking, and every response carries a created/removed/changed flag so a UI can still tell), and app.registration is a separate audit action from app.update, because "who renamed this" and "who opened this to the public" are different questions. decisions-implementation.md hit the 200-line cap and was split by topic rather than by date: session mechanics settled during the build — the absolute family lifetime, logout revoking rather than deleting, and sid — moved to decisions-tokens.md, so a reader asking "how do sessions work" finds all of it on one page instead of having to know which half was decided when.
[2026-09-04] build | Wave 5 landed — briefs 07 (public registration and email verification) and 08 (@ward/client). Ward's API is now complete and the six apps have something to consume it with. 530 tests, up from 450. Brief 07 resolved the collision-enumeration tension by noticing the oracle cannot be closed: the username is the canonical identifier, so a duplicate must be refused and the refusal carries the fact. Being vague costs every real person the one thing they need to know — in the single most likely response the endpoint gives — while costing a prober nothing, since they learn the same bit from the failure either way. So 409 username_taken is stated plainly and what is withheld is everything else: byte-identical whether the holder is disabled, verified, owner-issued or already granted in that app; byte-identical for WARD_ADMIN_USERNAME, which is also refused, so blocking it cannot be used to discover the break-glass name; and no timing tell, since the password is hashed before the insert on every path that reaches it. The enumeration that actually matters is not offered at all: there is no "email already registered" error — users.email has no uniqueness constraint, two accounts may share an address, and /register never confirms or denies that an address is known to the estate. prm answers EMAIL_TAKEN today because email is its primary key; Ward's is not, so giving that oracle up costs nothing. Also: registration_closed covers a closed app and a nonexistent app identically, so the endpoint is not also an app-discovery oracle. Keeping the verification token out of the request log needed a real finding, not a note: the link has to be clickable from a mail client so the token travels in a URL, and Fastify writes its incoming request line before any onRequest hook could scrub it — so /verify is registered in its own encapsulated scope whose req serializer replaces the whole query string with <redacted>, not just token, so a parameter added later cannot leak by omission. Verified as zero occurrences of a real token in a complete server log. granted_by carries "self-registration", moved to db/grants.ts beside SUPERUSER_ACTOR so the sentinels that column may hold stay together; both alternatives were wrong, since the superuser constant would make the audit trail claim the break-glass credential acted when nobody did, and the registrant's own subject would read as "this person granted themselves", implying an authority they do not hold. Registration has its own lockout budget and shares nothing, so a flood cannot stop people who already have accounts from signing in. Password reset stays deliberately unbuilt. Brief 08's client fails closed in all three ways it could have failed open — a 500 from Ward throws rather than reading as active: false, an unreachable Ward throws rather than allowing, and an expired cache entry is not served when Ward is down — with a test for each, because Ward being unavailable already means nobody can log in and must not also mean revocation quietly stops working. Fifty concurrent requests on one cold token collapse to exactly one introspection call, counted rather than asserted in principle. It also documented the distinction that this package invites getting wrong: jose's JWKS cache answers "did Ward sign this" (~10 minutes, refetching on an unknown kid outside a ~30-second cooldown that is the anti-stampede floor), while the package's own 30-second cache answers "is this session live, what may it do" and alone bounds how long a revocation takes to land — so raising the first does not slow revocation and lowering the second does not speed up rotation pickup. apiBasePath has no default on purpose: the old "" resolved to the origin root while Caddy serves Ward under /ward-api, and had the package shipped that way every app would have fetched a 404 and all six would have rejected every token at once. Controller groundwork this wave, in files every brief is told not to touch: the mail contract in config.ts as an explicit required WARD_MAIL_TRANSPORT of smtp or file — deliberately not inferred from NODE_ENV, because sniffing the environment and falling back to writing files is the silent-default shape that file exists to refuse, and an estate whose mail stopped leaving the building because a variable was unset is a registration flow that appears to work and delivers nothing; a "register" member on the closed LockoutSurface union; and the ui/ Vite + React workspace with tokens.css, whose console surface re-points the same token names because brief 10 requires the console to look visibly unlike the login page on safety grounds rather than stylistic ones. One process note worth recording against myself: I ran a verify-then-commit as a single command and committed a tree whose typecheck and build were red — a type error in my own new test file that vitest does not catch, which is precisely what the typecheck gate is for. Amended. Collapsing the gate and the commit into one step defeats the gate.
[2026-09-04] build | Wave 6 landed — briefs 09 (login page and self-service) and 10 (the console). Ward is feature-complete as a service: 831 tests across three workspaces. Both UI briefs did the thing that made this wave worth more than the screens themselves — they reported endpoints that did not exist rather than faking screens against them, nine in total, which were then built as one coherent change instead of being discovered one at a time during a cutover. The two that carried the most weight: POST /account/sessions/revoke-others, which decisions.md uses to justify the entire self-service page existing (owner-issued accounts have no verified email and therefore no recovery channel, so it is the only self-serve response to a suspected theft — without it, as brief 09 put it, that page is a grants viewer with a sign-out button), and GET /console/audit, without which the audit trail decisions-admin.md requires for the one credential that cannot be revoked or rotated was unreadable in practice. Brief 10 also found the design gap behind that route rather than just the route: every console mutation writes actor_kind='superuser' with actor_subject=NULL, and the only actor filter AuditQuery offered was on subject — so "filterable by actor" was unsatisfiable for the actor that matters most. actorKind and actorLabel were added. Three holes in my own verification, all found by the agents rather than by the gates meant to find them. vitest.config.ts included api/** and client/** only, so no ui/ test would ever have run — both UI briefs wrote tests against a runner that could not see them, and brief 09 caught it and fixed it, which is the only reason brief 10's 83 tests execute at all. The lint and fmt:check scripts globbed api/src/** alone, so every "lint PASS" reported through this entire build was blind to ui/ and client/; nothing had rotted, but only because both agents ran eslint over their own files by hand. And eslint.config.js carried no React rules in a repo that now has a React frontend — turning them on surfaced nine errors immediately, in exactly the two categories newspapper's config records as load-bearing (a ref written during render, setState called synchronously in an effect). Newspapper's note that the rule is not exhaustive proved true here too: a third instance of the same ref pattern sat unflagged beside two that were caught, and the agent fixing them noticed and fixed it anyway. All nine were fixed with no eslint-disable — the countdown moved to useSyncExternalStore, Verify derives its empty-token answer at render rather than in an effect, and the console's loadable uses React's documented reset-on-dependency-change pattern, which also removed a real flash of stale content the old effect caused by painting the previous result once before flipping to loading. A gate that covers less than it appears to is worse than no gate, because it is trusted — the scripts now cover all three workspaces. Both briefs also found bugs only a browser shows, which is the argument for the "boot it and look at it" verification step: three CSS bugs in the console (flex: 1 1 12rem read as a 12rem height), and in self-service, focus staying on the button after a blank submit — telling a keyboard user from three elements away that something invisible was wrong — plus a blank Register submit that round-tripped three empty strings to the API and spent lockout budget to be told about spacing rules. The ?next= allowlist got 73 table-driven cases, and two of its rules are worth not losing: raw and decoded forms are both validated because they can disagree (/atrium/%2e%2e/%2e%2e/evil keeps atrium as its first segment while its decoded form resolves to /evil), and the estate's own origin spelled absolutely is refused as firmly as evil.example, because accepting one absolute host is how a later edit accepts two. ESTATE_APPS stays hard-coded even though display names now come from GET /apps: it is also the allowlist, and an allowlist fetched over the network is not an allowlist. One piece of copy was flagged in advance as easy to get subtly wrong and worth checking: a password change revokes the caller's own family too, so sessionsRevoked reads 1 for a person with one device, and rendering that as "1 other device signed out" would tell somebody they had been compromised when nothing happened but their own credential rotating. The count is never shown raw. Finally, the verification mail linked to /ward-api/verify — the API's own server-rendered page — so brief 09's /ward/verify screen was not on the path anyone takes from their inbox; brief 09 found it in a file it did not own and reported it rather than reaching in.
[2026-09-06] build | app keys: /introspect stopped being anonymous, and Ward's own UI moved off it
POST /introspect now requires an x-ward-app-key header, checked before
anything else happens. The trigger was a false premise in
routes/introspect.ts, which stated the route "is not reachable from the
internet in the deployed topology" and rested two decisions on it — no client
authentication and no rate limit. vps-deploy/stacks/ward.ts serves the whole
API under handle_path /ward-api/* on the public origin, so the endpoint was
in fact reachable by anyone, and as built it performed an Ed25519 verification
plus three indexed reads for every anonymous caller that asked, with nothing
counting the asks and no way to say afterwards who had asked. Both decisions
have been re-derived rather than merely patched, and
wiki/decisions-app-keys.md is the new page;
decisions-tokens.md carries a revision note where
the "loopback call" claim was.
The shape. A new app_keys table (migration 20260906000000): wak_ +
256 bits of randomBytes, stored only as sha256 — the same primitive and the
same argument as refresh_tokens.token_hash, because the input has no
dictionary to attack and passwords are the opposite case. id is a separate
non-secret handle so the console and the audit log have something to point at.
Issued and revoked from the console (/console/apps/:slug/keys,
/console/app-keys/:id/revoke) with a panel on the app's page; the plaintext
appears in exactly one response and in no other, and there is no route that
reads it back. @ward/client grows a required appKey option — required
so that omitting it is a compile error rather than a 401 discovered in
production, since a missing key is a total outage for that app and not a
degraded mode.
Three calls worth keeping. A rejected key is a 401, not
{"active":false} — the single carve-out from this endpoint's one-answer rule,
because answering "not active" to a misconfigured app signs every one of its
users out simultaneously, silently, with a clean server log; @ward/client
raises WardConfigurationError, a subclass of WardUnavailableError so
every app's existing fail-closed handling catches it unchanged while the message
names WARD_APP_KEY. The key authenticates but does not scope — a keyed call
still gets the whole estate's grant map, which was the owner's call; scoping is
a separate decision and the test that must change first says so. No rate limit
still, unchanged and for the unchanged reason, but the option now exists per
key rather than estate-wide.
Ward's own UI moved to GET /session. It read /introspect with the
session cookie, and a key in a Vite bundle is a published string. The tempting
alternative — require a key only when there is no cookie — is worthless, and
is written down in both the route and the decision page so it is not
re-proposed: an attacker chooses their own headers, so moving a token from a
body into a Cookie: header is a one-line change to a curl command, and a
cookie-shaped exemption exempts everybody. /session is safe unkeyed for a
narrower reason — the token comes from the cookie and from nowhere else, so it
grants nothing that setting the cookie did not already grant — and there are
tests that a token offered in a query string or an Authorization header is
ignored there. The response shape is byte-identical and reuses the same
serialisation schema, so ui/src/lib/session.ts changed only its URL.
One write on the hot path, and it is throttled. app_keys.last_used_at is
stamped at most once an hour per key, guarded in process, because rotating a
key across five independently deployed apps is unsafe without knowing whether
the old one is still in use — and because a write per request would turn the
credential table into an amplifier fed by ordinary traffic, which is the same
thing this endpoint already refuses to do to audit_log. It is best-effort:
a failed stamp must never turn an authenticated request into a refused one, so
it is the one swallowed catch in auth/app-key.ts.
A pre-existing test flake was found and fixed on the way through.
introspect.test.ts's "signature has been tampered with" case rewrote the last
two base64url characters of an Ed25519 signature. The final character of an
86-character encoding carries only 2 significant bits — the other 4 are ignored
on decode — so "AA" and "AB" decode to byte-identical signatures, and
roughly 1 run in 256 the "tampered" token was the untampered one and verified
perfectly. It now flips a character in the middle, where all 6 bits count.
Deploy plumbing, not yet used. WardStack.identityFor(consumer) now also
returns a WARD_APP_KEY secret declared against the consumer's stack, so
each app looks its key up in its own secrets/<app>.env and a preflight names
the right file. No stack consumes identityFor yet. npm run synth is clean —
18 stacks, 23 routes, no collisions.
895 tests across three workspaces (up from 831), lint and typecheck clean,
the UI builds. Nothing is deployed, and no app is wired: the five app
integrations are blocked on how a separate repo obtains @ward/client, which
brief 08 left as "published or linked as a normal npm dependency" and which is
not a question this change could answer by guessing.
[2026-09-06] change | wave 8: all five apps cut over to Ward, each hand-writing its own client
The estate now has one identity. atrium, public-resource-map, newspapper, imbatranimOS and sports-app have each deleted their own credentials, adopted Ward's session, and re-keyed their per-person rows onto Ward's subject. Every suite is green in every repo: 895 here, 647 atrium, 54 prm, 595 newspapper, 403 + 116 + 272 imbatranimOS, 1114 sports-app.
Each app hand-writes its Ward client, by decision. The apps are separate
checkouts that vps-deploy rsyncs and npm cis independently, so no build
resolves a workspace package from another repo, and every mechanism that would
make one resolve — a registry, a committed tarball, a git dependency — costs
more in build machinery and deploy credentials than the ~200 lines it saves.
The cost is real and named: security code, written five times.
wiki/integrating.md is the mitigation — the contract all
five are written against, listing the five things that must be right — and
client/ stays as the tested reference implementation, shipped to nothing.
The shape is the same everywhere and the binding is not. All five verify
locally with the algorithm pinned as a literal, introspect with a 30-second
per-token cache, send x-ward-app-key, and fail closed with three codes: 401 no
session, 403 a live session holding no grant for this app, 503 Ward
unreachable. The 403 is the one that needed saying five times: prm's
registration is open to the public, so a live Ward session held by a complete
stranger is an ordinary thing for every one of these apps to receive, and
authenticating without checking the grant would have handed that stranger a
library, a terminal, or somebody's training history.
What each app actually had to decide.
atrium — the active profile lived on sessions.active_profile_id, and there
is no sessions table. It moved to profile_selections (subject, sid), keyed on
the token's refresh-family claim, which reproduces per-device switching exactly;
a per-account column would have silently switched the phone when you switched
the laptop. "Every account has a profile" stopped being sweepable — atrium
cannot enumerate Ward's accounts — so it became a lazy per-subject provision in
the guard, which is a better fit anyway: the moment somebody becomes able to use
atrium is a superuser issuing a grant, an event atrium is never told about.
?token= is gone from cover and media URLs, which is the concrete payoff of the
one-origin decision.
prm — nothing is gated by default, and that is the property worth protecting:
it is a public resource map, so the root hook resolves a session only when a
cookie is present and the guards are opt-in. When Ward is down the public map
still works, because it never asks Ward anything. prm:admin does not imply
prm:user; grants are a set, not a ladder, and assuming otherwise would have
produced an admin who could not open their own favourites.
newspapper — the real decision, and the corpus said it must not default.
/uploads/* was public because headless Chromium fetches images carrying no
cookie; on loopback the exposure was bounded by ref entropy and an unreachable
port, and the VPS removes the second half. The expected fix was a
render-scoped token. Rejected again, for a better reason: render/fonts.ts
already intercepted font requests inside the browser context and served them
from disk, so the same mechanism removes the request instead of authorising
it. No new bearer credential exists — no lifetime, no signing key, no leak
path, no revocation story — and the route is now guarded like everything else.
The lockout was removed rather than retuned: there is no credential here to
brute-force.
imbatranimOS — the lock screen could not survive as a lock. Brief 101's design covered the desktop while keeping PTY sockets and dirty buffers alive, and unlocking re-proved the local password; re-proving Ward's means navigating away, which destroys the thing being protected. So the cover was kept and the claim was dropped — it is a privacy screen, the Start menu says "Cover screen", and the panel says so in words. Two consequences fell out: a restore no longer revokes anything (credentials are not in the database being swapped, and the test was inverted rather than deleted), and the WS upgrade gained a grant check, without which anyone who registered at prm could open a shell.
sports-app — the biggest security gain, because it had the least. One shared
secret authenticated the deployment and ?user= chose the stream, so anyone
holding it could read anyone's training history by editing a query parameter —
which the file header said plainly. The stream key is the session's subject now,
?user= is removed rather than ignored, and the document-versus-target check on
PUT is stronger than before because one side is no longer client-supplied.
Deploy plumbing. WardStack.identityFor(consumer) hands out a required
WARD_APP_KEY secret declared against the consumer's own stack, and four apps
call useWard(ward.identityFor(app)) — so the dependency edge exists because
the identity was read, which is what the CDK-style refactor was for.
node cli.ts --graph shows the four edges; synth is clean.
What is not done, stated plainly. newspapper has no vps-deploy stack at
all and needs one plus a Caddy block. Nothing has been deployed, nothing has
run against a real browser, and no destructive migration has been executed —
atrium's 20260906000000-ward-cutover, prm's 0001_ward_cutover.sql and
newspapper's schema v5 are written and unrun. Each destroys accounts and has no
meaningful down; take a database copy first. sports-app carries one deliberate
loose end: settings.sync.secret is still in its document schema, inert and
labelled, because removing it is a separate version bump.
[2026-09-06] build | A documentation site at /ward/docs, and a /<project>/docs convention for the estate
The gap this closes was already named. wiki/status.md had been recording
"no architecture.md, api.md or data.md" as a real gap rather than a
not-yet, and saying the app-key surface — the third thing an integrator needs —
was documented only in code and decisions. Those three pages now exist as
authored pages on a Starlight site in docs/, written against the code rather
than against the corpus, and the corpus is rendered alongside them rather than
duplicated into them.
Three sources, kept apart because they rot differently. Authored pages
(architecture, topology, sessions, introspection, grants, app keys, HTTP API,
data model, configuration) are hand-written and are the only place the schema
and the route table are described. The corpus is synced on every build by
docs/scripts/sync-corpus.mjs into src/content/docs/wiki/, gitignored and
banner-marked so nobody edits the copy. @ward/client's public barrel is
TypeDoc'd into public/reference/client/, so the one surface consuming apps
actually call cannot drift from what the module exports.
Diagrams are compiled and validated, not drawn. Three
archify sources live in docs/diagrams/ as
typed JSON — the estate architecture, the login-and-first-request sequence, and
the refresh-family lifecycle — and are delivered to self-contained interactive
HTML through archify's deliver command, which runs nine artifact checks and
refuses to commit an artifact that fails one. Getting the architecture diagram
to pass took four rounds and the binding constraint was one worth knowing: a
viewBox wider than about 1160 projects node sublabels below the 6px legible
floor at a 1440px viewport, so "make it wider so the labels fit" is exactly
backwards.
The rendered HTML is committed, deliberately. archify is an agent skill
installed per-machine under ~/.claude/skills, not an npm dependency, and the
docs build runs wherever vps-deploy runs. So build-diagrams.mjs regenerates
where the skill is present and otherwise verifies that every source has an
artifact, naming any that is missing. A machine without archify can still build
and deploy; a machine with it edits the JSON, which is the part worth
versioning.
The route convention is the estate-wide half. Docs used to sit at
/game-engine-docs and /imbatranim-os-docs — sibling prefixes chosen
independently, agreeing by accident, with nothing saying where a third should
go. Every project now documents itself at /<project>/docs, implemented as
a DocsSite construct in vps-deploy and written up in
vps-deploy/docs/docs-route-convention.md. Both existing sites were moved with
no redirect from the old prefix; their served directories did not change.
Nesting inside the app's own prefix needed a guard, and exposed a real hole
in the one that existed. /ward/docs sits inside /ward/*, so it is reachable
only because its block is written above the app's. DocsSite pins that (route
order 10 against the app default of 100), but validateEstate's shadowing check
used to skip routes that shared an owning stack, on the reasoning that
intra-stack ordering was the stack's own business. That exemption was unsound —
shadowing is a property of the rendered file, not of ownership — and this
convention is the shape that exposes it. The check is now universal, and
breaking the order pin fails synth by name instead of rendering a Caddyfile
whose docs 404 at runtime. Verified by deliberately inverting the pin.
Ward's own gates stayed green throughout: 895 tests, typecheck and lint clean,
with docs added as a fourth workspace whose script is docs rather than
build so npm run build --workspaces is unaffected.
[2026-10-04] fix | Sign out ends the session
The refresh cookie is scoped to Path=/ward-api/refresh, so a browser never sent it to /ward-api/logout: logout saw no credential, answered 204 and cleared nothing, and the person stayed signed in everywhere. The same handler is now also served at /refresh/logout, which the cookie path covers (a path matches everything under it), and the account page posts there; /logout stays for callers that send the token in the body. The old test sent both cookies to /logout, which no browser does; new tests send only the cookies whose path matches. Checked on the rebuilt local container: after Sign out, /ward-api/account answers 401.
[2026-10-04] decide | The cutover ran; briefs 16 and 11 closed
Asked directly, the owner confirmed the destructive cutover has run on production and the estate signs in through Ward. It ran through each app's own cutover migration (prm's 0001_ward_cutover, atrium's D53 cutover and its brief 60), not through scripts here; scripts/cutover/ was never written. Brief 16 moves to done on that basis. Brief 11 is superseded: vps-deploy's stacks/ward.ts is the deploy, and every app, newspapper included, now calls useWard.
[2026-10-04] fix | The reference client: a key-set outage is Ward unavailable
@ward/client's verifyAccessToken turned every jwtVerify failure into an authentication error, so a JWKS fetch that failed (Ward down, slow or restarting, or a consumer booting while it is) told a signed-in person they were signed out. That breaks contract rule 5. It now classifies resolver errors: no matching key (or several) is the token's fault, and anything else is WardUnavailableError. createRemoteJwksKeyStore takes an injectable fetch, which the client passes through. integrating.md's rule 5 names the key-fetch path. This was the change atrium brief 61 and prm brief 21 owed upstream.
[2026-10-07] decide | The owner's explicit grants are confirmed; brief 17 written
The one assumption on open-questions.md, that the owner account's grants are explicit per app with no *:admin wildcard, is confirmed and removed from the page. Brief 17 is new: POST /notify lets an app mail its own granted, verified users without seeing an address, for public-resource-map's notification email (its brief 32). Separately, imbatranimOS brief 157 drops Ward from that app and removes its imbatranim-os row from the app-key script and the estate launcher.
[2026-10-07] build | Brief 17: apps mail their own users through Ward
POST /notify takes an app key, a subject, a subject line and plain text. Ward sends to the verified address only when the account is active and holds a grant for the key's app, so an app mails its own users and nobody else and never sees an address. Every refusal is the same {"sent":false}; a transport failure is a 503 the client turns into WardUnavailableError. Ward sets the From name, subject prefix and footer from the app's display name. The per-app limit is 2,000 calls in any rolling 24 hours, sized from prm's two daily sweeps. Every keyed call is audited under app:<slug>. @ward/client has sendNotification. The contract is in integrating.md for prm's brief 32; the rejection of exposing addresses to app keys is in decisions-app-keys.md. 946 tests, typecheck and lint clean; the local container was rebuilt and answers the endpoint.
[2026-10-07] change | imbatranimOS leaves Ward
ImbatranimOS's brief 157 dropped Ward: the desktop now signs its single owner in itself, in the estate too, and its deploy passes a SETUP_TOKEN instead of WARD_APP_KEY. Here, register-app-keys no longer creates an imbatranim-os row, ESTATE_APPS no longer lists it (so /imbatranim-os is no longer a ?next= destination), and the local seed no longer registers it or writes its env files. 946 tests pass. Owner step after imbatranimOS is redeployed: delete the imbatranim-os app in the console (Apps, then the app, then Delete app), which cascades its grants and service keys.
[2026-10-13] decide | Local accounts in every app, Ward as an OIDC provider, a shared library
The owner redesigned how the estate signs in. Every app gets its own users, its own login page in its own design, and a "Sign in with Ward" button. The button is an OIDC authorization code flow with PKCE against Ward running oidc-provider, so it keeps working if Ward moves to a subdomain. Apps keep working while Ward is down, through local sign-in.
The owner's answers:
- A first Ward sign-in with a grant creates the local user. Linking otherwise happens only from settings, never by username.
- Existing Ward users migrate with their subject as their local id.
- The grant decides who may use the button; the role lives in the app.
- Revoke-everywhere stays at 30 seconds for Ward-originated sessions.
- prm gets a local register page; no other app gains a sign-up.
- imbatranimOS stays out.
/notifystays for Ward-linked users.
The shared code lives in shared-library/ and is copied into each app as a built, unminified bundle with a README naming only the source and version. Recorded in wiki/decisions-oidc.md, with revision notes on decisions.md Q4 and Q21, decisions-accounts.md's grants call, decisions-app-keys.md and integrating.md. Briefs 18–27 written in four waves (status.md). Two questions left for brief 18 are on open-questions.md. The subdomain move is a todo. The same day, the production domain was removed from every Markdown file across the estate, this repo included.
[2026-10-13] decide | What a vendored copy holds
The owner refined answer 9: a copy is the bundle plus a README (version, and the source linked to the remote repository) and a LICENSE. It is two bundles (server and React hooks, so the server never imports React), their .d.ts, the README and an MIT LICENSE (as package.json declares). No source maps and no package.json; apps import by relative path. Recorded in decisions-oidc.md and brief 20. The owner also said to go ahead with briefs 18–27; brief-board is down and is skipped until the owner says it is back.
[2026-10-13] build | Brief 18: Ward is an OpenID Connect provider
oidc-provider 9.12.2 is mounted at /oidc when WARD_OIDC_ISSUER is set (it must end in /oidc; what precedes it is the stripped prefix), with WARD_UI_URL for the login page. Unset, nothing is mounted, so the deploy is safe before the variable exists. Every advertised URL comes from the issuer, not the request. Only code + PKCE S256; ID tokens are EdDSA with Ward's existing key and carry sub, preferred_username, ward_sid (the refresh family) and ward_role, never email. Clients are apps: redirect URIs, sign-out URIs and the public JWK are new columns on apps, edited in the console's "Sign in with Ward" panel and written by the local seed. Everything the provider stores is in oidc_payloads on the same SQLite handle, swept every 10 minutes, so a restart mid-flow keeps the code.
Settled the two open questions (decisions-oidc.md). Apps authenticate with private_key_jwt; npm run oidc-client-key prints the app's env line and the public JWK. The login step at /refresh/oidc/<uid> runs on every authorization and reads Ward's refresh cookie, so the provider's session only hands the account to the code exchange. No grant, a disabled account and "Back to the app" all give access_denied. An unregistered redirect URI gets Ward's error page instead, because redirecting there would be an open redirect. RP-initiated logout revokes the family in the hint's ward_sid. The cookie sign-in, /introspect, /session, /refresh and /logout are untouched. Client assertions may say alg EdDSA or Ed25519, because openid-client 6 signs with the latter. 1009 tests, typecheck and lint clean. A production-mode Ward behind a prefix-stripping proxy completed a full flow over real sockets, driven by openid-client 6.8.8 as brief 21 will use it, including "sign out of Ward too". Docker was unavailable in this environment, so the local container was not rebuilt.
[2026-10-13] build | Brief 20: the shared library's local half
shared-library/ now holds local accounts, sessions, lockout, a SQLite store that runs on better-sqlite3 and node:sqlite, a Fastify plugin with a fail-closed guard, unstyled React hooks, and npm run vendor, which writes the six-file copy (two bundles, their types, README, MIT LICENSE). It was built in a separate worktree alongside brief 18 and cherry-picked onto main, where the lockfile merged cleanly. decisions-oidc.md went over the page limit, so the build-time calls from briefs 18 and 20 moved to decisions-oidc-build.md. 1155 tests pass.
[2026-10-13] build | Brief 19: apps ask Ward whether a Ward session is live
POST /session-status (externally /ward-api/session-status) answers {active:true, role} or {active:false} for a Ward session an app signed in through Ward, authenticated by the app's client assertion in the body (aud the issuer). It asks what findAccount asks at code exchange: account active, family live and the subject's, a grant in the calling client's app. Every no is the same bytes, a bad assertion is 401 invalid_client, and a body that is not JSON is read as no body. Not audited and not rate-limited, for /introspect's reasons. Without WARD_OIDC_ISSUER the route is not mounted (404). /notify also takes client_assertion_type + client_assertion in its body; a presented app key is judged alone, and a bad assertion is 401 invalid_client. Recorded in decisions-oidc-build.md; the app-side rules (cache 30 s per wardSid, collapse concurrent calls, fail closed, 401 is a configuration error) are in the docs page oidc.mdx.
[2026-10-13] build | Brief 21: the shared library signs in with Ward
shared-library/ 0.2.0 adds the Ward half. openid-client 6.8.8 is bundled into ward-auth.js, which still imports only node: built-ins, so the vendored copy is still six files with no install step. It does the code flow with PKCE, private_key_jwt with the app's Ed25519 key, ID tokens pinned to EdDSA with their signatures verified, and discovery once, lazily, so an app boots while Ward is down. A first Ward sign-in creates a linked user named from preferred_username (suffixed if taken) with the grant's role. Linking happens only from settings, for the session that started it. Nothing matches by username. Ward-originated sessions are checked through /session-status every 30 s, with concurrent checks collapsed into one, and they fail closed as ward_unavailable (ward_misconfigured on a 401). Local sessions never call Ward. Settings get link, unlink (refused without a local password), set a local password (the current one, or a Ward sign-in from the last ten minutes, which reauthentication with prompt=login provides), and sign out of Ward too. Mail goes through notifyUser, for linked users only. Migration 2 adds auth_ward_links and the session's ID token. The callback moved under each app's API prefix (<api prefix>/auth/ward/callback), so the session cookie reaches it and no proxy needs a new rule. seed.mjs writes that callback and WARD_OIDC_POST_LOGOUT_REDIRECT_URI, drops brief 18's UI-path callback, and infrastructure/local/README.md now says so. shared-library/README.md is the adoption guide for briefs 22–26. Tested against a real Ward built in-process: 23 flow tests, including revocation after the cache, Ward stopped, link CSRF and RP-initiated logout. No defect was found in briefs 18 or 19, and api/ is untouched. 1243 tests pass, and typecheck, lint, build and vendor are clean. Calls recorded in decisions-oidc-build.md.
[2026-10-13] build | Brief 21 closed; the local container runs the provider
Brief 21 shipped the shared library's Ward half (0.2.0). Docker became available, so the controller rebuilt ward-local and ran seed.mjs: five OIDC clients registered, with callbacks under each app's API prefix and env files written. Wave B is done. Wave C, the five app adoptions, follows the adoption guide in shared-library/README.md.
[2026-10-13] build | Brief 28: the login lockout sees the real client behind a container
lockoutKeyFor honoured X-Forwarded-For only from a loopback peer. In a container the peer is a Docker bridge address, so every request keyed on the proxy, and five bad passwords from anyone locked everyone out for 15 minutes. Against the local container, six different usernames behind six forwarded addresses locked out the seventh. It now also trusts configured ranges: WARD_TRUSTED_PROXIES for Ward, and AUTH_TRUSTED_PROXIES or wardAuth's trustedProxies for the library, now 0.3.0. These are comma-separated addresses or CIDR ranges, IPv4 or IPv6, and IPv4-mapped peers match IPv4 ranges. Unset means loopback only, and a malformed entry or a /0 stops the boot. The key is still the last element, and a trusted peer with no header still fails closed and warns. A header from an untrusted peer now warns too. All five lockout callers in Ward (/login, /refresh, /console/login, /register, /account/password) read the one list, so this went past the brief's file list for console.ts, account.ts and register.ts. The local compose network is pinned to 10.87.92.0/24 and trusted. After the rebuild, seven containers behind the local Caddy each kept their own budget, while one caller rotating a spoofed header was still locked out on its sixth try. Production should use 172.16.0.0/12 (brief 27). Revision note on decisions-implementation.md.
[2026-10-13] build | Wave C: five apps on local accounts, the lockout fix, and the Jukebox
Briefs 22–26 adopted the shared library in atrium, newspapper, prm, sports-app and satchel. Each app has its own login page, the Ward button, settings for linking and passwords, a seed script, and existing Ward subjects migrated to linked local users. The details are in each brief's outcome.
- Production images. Atrium's and satchel's images would have left
vendor/out; the controller fixed their Dockerfiles and verified the bundle imports inside the built image. prm's agent fixed its own. - Brief 28 (new). prm's adoption surfaced a live bug: behind containers the lockout keyed every request on the proxy's address, so five bad passwords anywhere locked everyone out. Confirmed on the local container and fixed with trusted proxies. The library went to 0.3.0 and all five apps were re-vendored.
- Brief 29 (new). Atrium's change breaks the Jukebox, which signed in through Ward, so just-a-bot now signs in to atrium's own accounts.
- Adoption guide. It gained five gotchas from the adopters.
- Library todo. Username shaping, rename and disabling a local user went to todos.
Brief 27 (deploy and retirement) is next.
[2026-10-13] build | Brief 27: the cutover's deploy config and the owner's runbook
vps-deploy now deploys the new contract; nothing was deployed. Ward's stack sets WARD_OIDC_ISSUER (<origin>/ward-api/oidc), WARD_UI_URL and WARD_TRUSTED_PROXIES. useWard stops writing WARD_PUBLIC_ORIGIN, WARD_API_BASE_PATH and WARD_APP_KEY. It now writes the app's public origin, WARD_OIDC_ISSUER, WARD_OIDC_CLIENT_ID, WARD_OIDC_CLIENT_KEY, the redirect and post-logout URIs and AUTH_TRUSTED_PROXIES, through one function that newspapper's stack shares. The client key is a required secret in secrets/<stack>.env, so prm's lives in secrets/public-resource-map.env under client id prm. newspapper gets NEWSPAPPER_BASE at runtime. sports-app gets SPORTS_APP_API_PREFIX in its service and its client build. just-a-bot now depends on atrium. The trusted range is 172.16.0.0/12, one constant in stacks/ward.ts, and the runbook says how to confirm it on the box. vps-deploy's typecheck and --check pass. It has no test suite.
newspapper's and sports-app's production images already contain vendor/. Both were built locally, imported wardAuth inside the image, and ran their seed scripts against a throwaway database.
The owner's runbook is docs/cutover-oidc.md, outside the docs site's content. It found two facts that would have been wrong on the box. First, every compose project there is named infrastructure, so docker exec <service> misses and the runbook uses docker compose … exec. Second, for atrium, prm and sports-app, seeding a fresh owner account would make a second, empty account beside the migrated one. So there the owner signs in with Ward and sets a local password, and seeds only in newspapper and satchel. Brief 27 stays open until the owner has deployed. Brief 30 follows the owner's confirmation.
[2026-10-13] review | Review gate over the whole redesign; library 0.3.1
Three scoped reviewers read the integrated diff: Ward's OIDC code, the shared library, and every app's wiring against vps-deploy and the runbook.
Fixed in round 1:
- Important (library). "Set a local password" accepted any Ward session under 10 minutes old, which a silent Ward sign-in on a shared machine could mint. Freshness now comes only from a reauthentication with
prompt=loginwhose ID token shows a freshly typed password (iat − auth_timewithin 120 s), stamped on the session (store migration 3).max_age=0was rejected because it loops against Ward's one-second clock (decisions-oidc-build.md). - Minor (library). The callback no longer answers a raw 500 (
sign_in_failed). Username suffixing cuts between whole characters and falls back to a generated name. - Minor (Ward). The loopback redirect-URI check refuses
127.evil.com-style hosts. The same check in the library's issuer validation got the same fix. - Critical and Important (sports-app). A migrated user who unlinked Ward made the next boot crash and restart-loop. Sync ignored the production API prefix.
- Minor (satchel, docs). Migration log noise in satchel; stale docs naming the retired variables in atrium, prm, newspapper and satchel.
Logged, not fixed: OPTIONS requests are always public in the guard, and the callback is unthrottled with an unsigned flow cookie. Both are in the README's gotchas.
Library 0.3.1 was re-vendored into all five apps.
[2026-10-13] build | Brief 30: the shared-cookie contract is retired
The owner cut production over first: atrium, newspapper, prm and sports-app each serve their own /auth/session with Ward enabled, and Ward's OIDC discovery is live. Then Ward lost the old contract. POST /introspect is gone (404), and so are app keys: the console's key routes and panel, the register-app-keys script and the seedAppKey fixture. /notify takes only a client assertion; no credential, or only the old x-ward-app-key header, is 401 invalid_client. ui/src/lib/estate.ts is gone, so ?next= accepts only Ward's own pages and defaults to /ward/account. createRemoteJwksKeyStore and jwksUrl went with @ward/client, their only user. Migration 20261013120000-drop-app-keys, appended last, drops app_keys; the app_key.* audit rows stay.
The access cookie ward_session moved from Path=/ to Path=/ward-api. A browser still holds the old Path=/ copy and sends both, so every response that sets or clears the session also expires ward_session at Path=/. Readers take every value and use the first that is a live session (signature and family both), in access-session.ts. The refresh cookie stays first-wins, because a second refresh token would be a rotated one and trip reuse detection. Tests cover the expiry headers on login, refresh and logout, both cookie orders, and a well-signed token from a signed-out family beside a live one.
The local seed no longer mints app keys or writes WARD_APP_KEY, WARD_PUBLIC_ORIGIN or WARD_API_BASE_PATH; it leaves old lines in app env files, which nothing reads. client/ was deleted, not moved to a superseded folder, and is now an abandoned root in lint.sh. vps-deploy passes none of the old variables to any app; only comments changed there. integrating.md is now a pointer to the library's adoption guide and the docs site's OIDC page, plus the app-side rules for /session-status. decisions-app-keys.md is marked retired, with dated notes on the pages that described the cookie as current. npm test passes 1171 tests in 68 files; typecheck, lint, build, fmt:check and the docs site build are clean; the rebuilt local container passed a 21-point check (own sign-in and sign-out, duplicate cookies, 404s on the retired routes, the OIDC start). The root README now describes the OIDC flow. The owner redeploys Ward only: node cli.ts ward server, then node cli.ts ward deploy, or node cli.ts ward all. No app stack needs a redeploy.
[2026-10-13] deploy | Ward redeployed with brief 30
The owner's first node cli.ts ward all failed: vps-deploy's Ward stack still listed client/package.json in its upload, and rsync exits 23 on a missing source. Fixed in vps-deploy (60ac6ef) after building the image from exactly the uploaded files; the owner's re-run went through. The stale client/package.json left in /srv/ward-api is unread. Nothing is open.
[2026-10-18] todo | Brief 31 filed: the docs site moves from Starlight to Docusaurus
The owner's call (2026-10-18), one brief in every repo with a docs site. 31 keeps the URLs and the light-only look. Docusaurus adds the base to root-absolute .mdx links and the new sync discovers decisions-oidc and decisions-oidc-build, which closes the todo about base-less links (marked promoted). The deploy waits on vps-deploy brief 11.
[2026-10-19] done | Brief 31: the docs site on Docusaurus
31 moved docs/ from Astro Starlight to Docusaurus 3.10, following the corpus-docs-site skill's migration guide (v0.31.0). The base stays /ward/docs/ (DOCS_BASE still overrides), the build still writes docs/dist/, and the site stays light only on Ward's limestone tokens, now on Infima's variables in src/css/custom.css. The nine authored pages moved to docs/docs/, the diagrams to static/diagrams/, and Diagram became a React component. Search is local (@easyops-cn/docusaurus-search-local), which adds /search/. sync-corpus.mjs is the skill's: it discovers every wiki page instead of reading a list, so decisions-oidc and decisions-oidc-build are published and in the sidebar, and the OIDC page links the former. Docusaurus puts the base on root-absolute links, so the /oidc/, /api/ and /data/ links that 404 on the live site now resolve; broken links fail the build. That closes the todo docs-site-internal-links-miss-the-base.md, deleted here. integrating.md's link to the OIDC page followed it to docs/docs/oidc.mdx.
Checks: the build exits 0 with no broken-link or anchor warnings; the route list equals the Starlight one plus search/, wiki/decisions-oidc/ and wiki/decisions-oidc-build/; no href misses the base; index.html references /ward/docs/assets/ and no Astro asset path is left. Served from dist/ at /ward/docs/ by a plain static server, the configuration page's links reach the API, data and OIDC pages, all three diagrams load, there is no theme toggle, and a search returns results. Typecheck, lint, fmt:check, the 1171 tests and corpus lint pass. Not deployed: the owner deploys after vps-deploy brief 11 sets the Ward docs stack's asset directory to assets.
2026-10-22: brief 32, Ward on its own host
The owner asked on 2026-10-21 for hosts of their own for the apps that hold a
shell or a mailbox, and on 2026-10-22 for Ward too. Brief 32 was filed and built
the same day: the UI at the root of ward.<domain>, the API at /ward-api on
that host, the issuer https://ward.<domain>/ward-api/oidc. The routes are
vps-deploy brief 16. The ?next= allowlist now names Ward's pages
(account, console, register, verify) instead of the /ward root, since
on the new host /ward-api shares the origin with the pages. The verification
mail links to /verify; mail sent before the move links to /ward/verify on
the apex, which redirects. The local gateway serves the UI at the root and
redirects /ward/...; the local issuer is unchanged, so the apps' local env
files are too. The shared library was left alone, so no app needs re-vendoring.
Checked: typecheck, lint and 1175 tests; the local containers rebuilt and
probed (routes, redirects, discovery, an authorization landing on
/login?oidc=); the pages rendered in Chromium. The decision is in
decisions.md; the todo ward-on-a-subdomain.md is gone,
promoted to the brief. brief-board is down (since 2026-10-13), so the progress
is recorded here only. Owner steps in status.md.
[2026-10-23] todo | Brief 33 filed: Base UI in the console
The owner asked for Base UI in the apps that still hand-build their widgets.
Brief 33 moves the console's
Confirm to Base UI AlertDialog, keeping the busy-can't-dismiss rule, and
the New account/app disclosures to Collapsible. The public sign-in pages
stay free of it.
[2026-10-23] done | Brief 33: Base UI in the console
Brief 33 is built. Confirm is a
Base UI AlertDialog that can't be dismissed while busy, and the New account
and Register an app forms are Collapsibles. The portalled popup carries
data-ward-surface="console" to keep the console's dark tokens. Checked:
typecheck, lint, 1175 tests, the build, and the console in Chromium against a
scratch API at 1440 and 390 px. The decision is in
decisions.md. Two todos came out of it:
split-the-console-chunk.md (the sign-in
pages download Base UI too; closed by brief 34) and
focus-after-a-confirmed-write.md, an
existing gap (closed by brief 35). brief-board is down, so nothing was posted there.
[2026-10-23] todo | Briefs 34–38 from the three open todos
34 lazy-loads the console so the public
pages stop downloading Base UI. 35
fixes focus falling to <body> after a confirmed write, at all ten Confirm call
sites; checking finalFocus is its first step. The library todo split into one brief
per bullet: 36 a
usernameFor hook beside roleFor, 37
renameUser plus a self-service POST /username, and
38 disableUser with a new migration and
one answer for every refusal. 36–38 share the CHANGELOG and version, so they run in
order. Adoption in each app is left to that app's corpus.
[2026-10-24] done | Brief 37: the library renames a user
Brief 37 is built as ward-auth 0.4.0.
Shelfmark's owner asked to change their username, and chose to put the rename in
the library rather than have Shelfmark write auth_users itself. It ran ahead of
36, since the two only share the CHANGELOG and version; 36 and 38 now build on
0.4.0. Beyond the brief, POST /username has its own rename lockout surface
that counts taken names. Checked: typecheck, lint, 1187 tests and the bundle
build. brief-board is down, so nothing was posted there.
[2026-10-24] done | Briefs 39–40: the console renames and deletes an account
The owner asked for a username rename in the console, then for deleting a user.
Both sat on database functions written early and never called: setUsername and
deleteUser, with the schema's cascades and an audit log without foreign keys.
39 adds
POST /console/accounts/:subject/username and a Username panel.
40 adds
DELETE /console/accounts/:subject and a danger panel. Both are audited and stop at
Ward's edge, since the apps keep their own users
(decisions-admin.md). On the way, the app page's removal
line had read "Removed undefined" because the client mistyped deleteApp's answer.
Checked: typecheck, lint, 1196 tests, and the console in Chromium on a scratch
database. brief-board is down, so nothing was posted there.
[2026-10-27] done | Brief 34: the console in its own chunk
Brief 34 is built. app.tsx loads
ConsoleRoutes with React.lazy, so Base UI and console.css ride in a chunk that
only /console fetches. The entry JS went from 120.07 kB to 81.45 kB gzip and the
entry CSS from 3.99 kB to 2.14 kB; the console chunk is 40.30 kB gzip. While it
loads, /console shows "Loading the console…" in ward.css styles, since the
console's own classes arrive with the chunk. Checked: the base-ui grep matches
only the console chunk; in Chromium against a scratch API, the four public pages
fetch only the entry, and a deep link to an account fetches the chunk and renders
the account; typecheck, lint, the build and 1196 tests. The todo
split-the-console-chunk.md is deleted. brief-board is down, so nothing was posted
there.
[2026-10-27] done | Brief 35: focus after a confirmed write
Brief 35 is built. Base UI's
finalFocus can't do it alone: it runs in the commit that closes the dialog,
and the reload in the same batch has already unmounted the opener (checked in
Chromium: isConnected: false, focus on <body>). So each screen asks for focus
by the opener's data-wc-focus key before it reloads and settles it once the
data is back: the opener if it is there and enabled, else the screen's h1.
Confirm focuses its popup before the confirm button disables and passes
finalFocus false after a confirm; Cancel and Escape still return to the opener.
All twelve call sites follow the rule (the brief counted ten, before 39-40).
Checked keyboard-only in Chromium against a scratch API, one write of each kind,
plus typecheck, lint, the build and 1203 tests. The writes without a confirmation
lose focus the same way: filed as
focus-after-an-unconfirmed-write.md.
The todo focus-after-a-confirmed-write.md is deleted. brief-board is down, so
nothing was posted there.
[2026-10-27] done | Brief 36: an app shapes a new Ward user's username
Brief 36 is built as
ward-auth 0.5.0. ward.usernameFor({ username, subject }) sits beside roleFor
and shapes a new Ward user's name before it is suffixed. For the suffix to keep
an app's cap, the app passes ward.usernameMaxLength too, and the library cuts
the base to make room: running the hook again on name-2 would cut the suffix
off for any hook that truncates. A hook that throws lands on sign_in_failed
with no user created. Checked: typecheck, lint, 1211 tests (8 new, one end to end
against the harness's Ward) and the bundle build. sports-app can now shape names
instead of refusing them, in its own brief. brief-board is down, so nothing was
posted there.
[2026-10-27] done | Brief 38: an app switches a local user off
Brief 38 is built as ward-auth 0.6.0.
Accounts.disableUser stamps auth_users.disabled_at (migration 4, every existing
user active) and ends the user's sessions; enableUser clears it. A disabled user
gets the answer an unknown one gets: the password check fails at one scrypt cost,
an open session stops on its next request, and "Sign in with Ward" for the linked
subject lands on access_denied, the code a Ward refusal gets, with no second user
created. That last mapping is one catch in fastify/ward.ts, outside the brief's
file list. Checked: typecheck, lint, 1223 tests (12 new, one end to end against the
harness's Ward) and the bundle build. The todo library-username-shaping-and-rename.md
is deleted, all three of its briefs done. satchel's rule comes back in a satchel
brief. brief-board is down, so nothing was posted there.
[2026-10-27] done | Brief 41: the bundle exports 0.5.0's and 0.6.0's new names
The owner asked for the three names briefs 36 and 38 left out of index.ts.
Brief 41 is built as ward-auth
0.6.1, a patch: the bundle exports UsernameFor, isUsernameMaxLength and
UserDisabledError, and nothing changes at runtime. The vendor smoke test's
TypeScript consumer and .mjs server both use them, and fail against the old
index.ts. Checked: typecheck, lint, 1223 tests and the bundle build; the built
bundle answers isUsernameMaxLength(32) and new UserDisabledError().code.
fmt:check still flags the two files brief 43 formats. brief-board is down, so
nothing was posted there.
[2026-10-27] done | Brief 42: a refused Ward sign-in keeps its return path
The owner asked for the gap sports-app's brief 32 left: after a refused "Sign in
with Ward" the app lost the returnTo it had passed, so a retry landed on /.
Brief 42 is
built as ward-auth 0.7.0. Every sign-in failure now lands on
loginPath?ward_error=<code>&ward_return_to=<returnTo>, checked with
isLocalPath when written and again when the browser client reads it, and
useWardSignIn().returnTo hands it to the login page; dismissing the error keeps
it. The failure stays on loginPath, because most apps' returnTo is a guarded
screen (recorded in decisions-oidc-build.md).
isLocalPath moved, unchanged, to core/paths.ts so both bundles share it.
Checked: typecheck, lint, 1231 tests (8 new: four refusals end to end against the
harness's Ward, which fail on the old code, and the client's reading and
dropping), and the bundle build; the browser bundle still imports only react.
sports-app adopts it in its own brief. brief-board is down, so nothing was posted
there.
[2026-10-27] done | Brief 43: docs tidy
Brief 43 is done in one docs commit. The README's
status says Ward is on ward.<domain> since the release of 2026-10-22, not "with
its next deploy". The cutover runbook gives Satchel the URIs of its own host, as
satchel's setup guide registers them. Prettier on README.md and
ui/src/lib/next.test.ts makes fmt:check pass again, after briefs 34 to 42
each noted it failing. The console screenshot is retaken against a scratch API
and database with made-up credentials and the seven apps the local seed lists, and
docs/images/shots.md says how. The local Ward container wasn't touched. Checked:
fmt:check, typecheck, lint, 1231 tests. status.md's history no longer calls brief
32 undeployed. brief-board is down, so nothing was posted there.
[2026-10-31] maintenance | README checked; the shots record names today's paths
A README refresh pass with the readme-docs standard. The README already met it after brief 43 and still matches the code. npm install, npm test (69 files, 1231 tests), npm run typecheck, npm run lint and npm run build all pass, and every relative link in the README and docs/ resolves. The sign-in and account shots still show their pages as they render today: brief 32's changes to those pages were paths, not looks. docs/images/shots.md said to open /ward/login and /ward/account; since brief 32 those are /login and /account on Ward's own host, and it says so now. Ward itself was not started: it runs in Docker from images this workspace cannot pull.
[2026-11-02] maintenance | Briefs reset
Part of an estate-wide reset. The forty-two briefs in briefs/done/ (00-10, 13-43) and the
superseded 11 are folded into the wiki and deleted; brief numbering restarts at 01 (there was
never a 12). The last commit that held them is 5de7c6b: read one with
git show 5de7c6b:corpus/briefs/done/28-lockout-behind-containers.md. Brief numbers in the
entries above refer to that set, and other repos' numbers to theirs before their own resets.
The outcome notes were checked against the wiki; the decisions pages already held their calls, cited by brief number, and now cite the date or the work instead. status.md loses its wave tables and becomes a dated snapshot per area with the owner's next steps and the ward-auth version each app vendors. open-questions.md drops the deferred items that are done (the cutover, the deploy entry, the UI) and keeps the key-rotation runbook and the repo rename. overview.md no longer says every app vendors 0.3.1.
Code comments, five test titles and the docs no longer cite brief numbers. Most were build-era
narrative ("brief 03 is writing this in parallel", "brief 09 owns this file") and now say what
the code does or name the part of Ward that owns it. The shared library's source comments and
CHANGELOG changed too (the owner's call, 2026-11-02); the apps' vendored copies stay as they are
until they re-vendor. Left as they were: the dated migration files under
api/src/db/migrations/ and the SQL comments inside shared-library/src/store/migrations.ts.
Checks: corpus lint, typecheck, lint and fmt:check are clean; npm test passes 1230 of 1231.
The one failure predates this reset: shared-library/scripts/vendor.test.ts expects the vendored
README to carry the GitHub URL that 5de7c6b (2026-11-01) replaced with the repository's name.
It is in status.md's known issues.