feat(public): version/health surfacing + typed brand block #77
Reference in New Issue
Block a user
No description provided.
Delete Branch "feat/public-version-and-brand"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
What & why
The last two v1 prerequisites for the Android app (docs/android/PLAN.md §8 items 4 & 6). Two focused commits:
1.
feat(public): version/health surfacing(§8.4)A small backend identity/version descriptor so a client can positively recognize a Runic Gateway backend on first-run and run a version-mismatch guard, instead of inferring from an incidental shape.
config/version.js:{ service: 'runic-gateway', api: 'v1', server: <pkg> }.GET /public/statusnow includes aversionblock (the app already calls this on first-run → identity + version in one round trip).GET /public/version— canonical target for the version guard and a cheap liveness check.PublicVersionschema;versiononPublicStatus;/versionannotated.2.
feat(public): type the brand block(§8.6)Branding was already returned by
GET /public/settings(thebrandblock: name/accent/logo/hero/favicon, per-shard fromBRAND_*). This makes it first-class in the OpenAPI contract so the app's codegen produces typed branding instead of an untyped map.Brand+PublicSettingsschemas;/public/settingsnow referencesPublicSettings(wasadditionalProperties: true).Branddocuments that asset fields may be site-relative (resolve against the base URL).brand; this types and guards it.How it was tested
test/publicVersion.test.js(config shape + DB-free/public/version→ 200) andtest/publicBrand.test.js(full brand contract;BRAND_*defaults; adminsite_title/contact_emailoverrides;accentIntnever leaked). The wider suite shows zero assertion failures; changes are strictly additive (no existing test imports the new modules; the suite doesn't loadswagger.js). CI runs the authoritativenpm test.GET /public/version→{"service":"runic-gateway","api":"v1","server":"1.0.0"}GET /public/status→ carries the sameversionblockGET /public/settings→brandwith all 10 theming fields;namereflects the adminsite_titleoverrideChecklist
AI-assisted contributions (required)
Claude Code (Claude Opus 4.8). I have reviewed and understand every change, and take responsibility for it. AI-authored commits are marked with aCo-Authored-Bytrailer.License
Docs counterpart updates
BACKEND_DESIGN.md(the/publicrows) and marks PLAN §8 items 4 & 6 done — with this, all v1 prerequisites are complete (only post-v1 push remains).🤖 Generated with Claude Code
https://claude.ai/code/session_01NgyHnrNa8WwG3doxvxjuCr
Expose a small backend identity/version descriptor (§8.4 of the Android plan) so a client can positively recognize a Runic Gateway backend on first-run and run a version-mismatch guard, instead of inferring from an incidental shape. - New config/version.js: { service: 'runic-gateway', api: 'v1', server: <pkg> }. - GET /public/status now includes a `version` block (the app already calls this on first-run, so it gets identity + version in one round trip). - New GET /public/version: a lightweight, DB-free identity endpoint — the canonical target for the version guard and a cheap liveness check. - Swagger: PublicVersion schema + version on PublicStatus; /version annotated. - test/publicVersion.test.js covers the config shape and the DB-free 200. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01NgyHnrNa8WwG3doxvxjuCr