Skip to content

feat: offline-first event firmware metadata (JSON schema + bundled asset)#5920

Merged
jamesarich merged 2 commits into
mainfrom
claude/recursing-bhaskara-223148
Jun 24, 2026
Merged

feat: offline-first event firmware metadata (JSON schema + bundled asset)#5920
jamesarich merged 2 commits into
mainfrom
claude/recursing-bhaskara-223148

Conversation

@jamesarich

Copy link
Copy Markdown
Collaborator

Defines the offline-first data contract for event-specific firmware editions (Hamvention, Open Sauce, DEFCON, Burning Man), so the app can later drive event-specific UI/UX from data instead of the hardcoded EventEdition.kt mapping. This PR is the contract only — no app wiring and no upstream API endpoint yet (both deliberately follow-up).

🌟 New Features

  • schemas/event_firmware.schema.json — JSON Schema (draft 2020-12) defining the contract: a {version, generatedAt, source, editions[]} envelope (mirroring device_links.json) where each record carries edition (the FirmwareEdition proto enum name), displayName, welcomeMessage, plus optional eventStart/eventEnd, timeZone, location, iconUrl, accentColor, and labeled links.
  • androidApp/src/main/assets/event_firmware.json — bundled seed data for the 4 current editions. displayName/welcomeMessage reuse today's values; eventStart/eventEnd/accentColor are best-effort seed placeholders (events recur yearly — the upstream sync will own them); iconUrl is null (no hosted icons yet).

Design notes

  • Array-of-records, not a map keyed by enum name, so the bundled file matches the shape a future GET /resource/eventFirmware response will use and deserializes cleanly into a @Serializable model later.
  • edition is a regex pattern, not a fixed enum list, so adding a new event needs no schema change.
  • welcomeMessage is a plain English string — this intentionally drops the Crowdin per-language localization the string resources provided; documented in the schema, to be revisited with the upstream API.

Not in this PR (follow-ups)

  • Wiring the file into the app (model + loader + repository, migrating EventEdition.kt) and the upstream REST endpoint.
  • A DRY-up of the repeated offline-first asset-loading boilerplate (a BundledAssetReader seam) — split into its own task, to land before the event-API wiring.
  • Relaxing additionalProperties/required strictness once a real API + CI snapshot validation exist.

🧹 Testing Performed

  • Validated the seed asset against the schema with ajv (draft 2020-12); a negative control (typo'd key) is correctly rejected by additionalProperties:false.
  • Confirmed via jq that the 4 edition keys are real FirmwareEdition names and all fields are present.

🤖 Generated with Claude Code

jamesarich and others added 2 commits June 23, 2026 16:03
Define the offline-first contract for event-specific firmware metadata
(HAMVENTION, OPEN_SAUCE, DEFCON, BURNING_MAN): a JSON Schema and a bundled
seed asset. Mirrors the device_links.json envelope shape so a future
GET /resource/eventFirmware response can drop-in replace the bundled file.

This is the data contract only; wiring it into the app (model + loader +
repository, migrating the hardcoded EventEdition.kt) and the upstream REST
endpoint are deliberately follow-up work.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Reword the top-level description: it implied an enum-keyed object ('keyed
within each record') vs the actual array-of-records, and over-claimed a
byte-identical 'frozen copy / drop-in replace' that sat awkwardly next to
strict additionalProperties. Now states the envelope is shared with a future
API and the schema is the authoring contract, bumped as the shape evolves.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@github-actions github-actions Bot added the enhancement New feature or request label Jun 23, 2026
@jamesarich jamesarich marked this pull request as ready for review June 24, 2026 00:23
@jamesarich jamesarich added this pull request to the merge queue Jun 24, 2026
Merged via the queue into main with commit 3ad885d Jun 24, 2026
22 checks passed
@jamesarich jamesarich deleted the claude/recursing-bhaskara-223148 branch June 24, 2026 00:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant