brand-kit.schema.json preset enum is stale: 4 presets vs 20 in kit.go #350

Closed
opened 2026-08-09 04:58:41 +00:00 by ben · 1 comment
Owner

internal/brandkit/brand-kit.schema.json still enumerates only the original four presets ("enum": ["matou","ocean","forest","sunset"]) while builtinPresets in internal/brandkit/kit.go has carried twenty since DDR 0130.

It doesn't bite at runtime — Go Validate/resolvePalette check against builtinPresets, not the schema — but the embedded schema is the documented kit contract and currently rejects sixteen valid presets for any consumer that actually validates against it.

Fix: derive the enum from Presets() (or a generator test that pins the schema to the Go table, the same lockstep pattern as TestPinnedClanRefMatchesFlakeLock), so the two can never drift again.

Also stale in the same way: PRESET_SWATCHES in app/src/lib/founding.ts (documented fake-client-only; production reads the brand-presets op) — fine to leave, but worth a comment breadcrumb if not fixed.

Found during the DDR 0145 exploration (commit 938dffe).

`internal/brandkit/brand-kit.schema.json` still enumerates only the original four presets (`"enum": ["matou","ocean","forest","sunset"]`) while `builtinPresets` in `internal/brandkit/kit.go` has carried twenty since DDR 0130. It doesn't bite at runtime — Go `Validate`/`resolvePalette` check against `builtinPresets`, not the schema — but the embedded schema is the documented kit contract and currently rejects sixteen valid presets for any consumer that actually validates against it. Fix: derive the enum from `Presets()` (or a generator test that pins the schema to the Go table, the same lockstep pattern as `TestPinnedClanRefMatchesFlakeLock`), so the two can never drift again. Also stale in the same way: `PRESET_SWATCHES` in `app/src/lib/founding.ts` (documented fake-client-only; production reads the `brand-presets` op) — fine to leave, but worth a comment breadcrumb if not fixed. Found during the DDR 0145 exploration (commit 938dffe).
Author
Owner

Fixed in ddb2157 (on origin/main).

  • internal/brandkit/brand-kit.schema.json: the preset enum now carries all twenty presets in Presets() order (was the stale four matou/ocean/forest/sunset).
  • internal/brandkit/schema_test.go: new TestSchemaPresetEnum_MatchesPresets pins the schema enum to the Go Presets() table in lockstep — the same pattern as TestPinnedClanRef_MatchesFlakeLock. Add a preset to the Go table without the schema and it reds. Written red first (4 vs 20), then green; full internal/brandkit suite passes.
  • app/src/lib/founding.ts: breadcrumb on PRESET_SWATCHES (fake-client-only) recording that its four entries are a deliberate subset, not drift — production reads the brand-presets op and the canonical set is the seam.

STATUS.md unchanged: a documented-contract drift fix, no phase/gate/feature/artifact-class change.

Fixed in ddb2157 (on origin/main). - `internal/brandkit/brand-kit.schema.json`: the `preset` enum now carries all twenty presets in `Presets()` order (was the stale four `matou/ocean/forest/sunset`). - `internal/brandkit/schema_test.go`: new `TestSchemaPresetEnum_MatchesPresets` pins the schema enum to the Go `Presets()` table in lockstep — the same pattern as `TestPinnedClanRef_MatchesFlakeLock`. Add a preset to the Go table without the schema and it reds. Written red first (4 vs 20), then green; full `internal/brandkit` suite passes. - `app/src/lib/founding.ts`: breadcrumb on `PRESET_SWATCHES` (fake-client-only) recording that its four entries are a deliberate subset, not drift — production reads the `brand-presets` op and the canonical set is the seam. STATUS.md unchanged: a documented-contract drift fix, no phase/gate/feature/artifact-class change.
ben closed this issue 2026-08-09 06:41:20 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Matou/idss#350
No description provided.