ADR 0007 — Screens are derived from schemas

ADR 0007 — Screens are derived from schemas An architecture diagram generated by Archify. Screens are derived from schemas · seven pages per resource · a hand-written one says why · Architecture component Screens are derived from schemas seven pages per resource · a hand-written one says why crud.Fields[T] · crud.Schema · struct tags, once per type · FieldType is a closed set · the mechanism crud.Fields[T] · crud.Schema struct tags, once per type · FieldType is a closed set rest.Spec.Mount · api.RegisterResource · httpx.Resource beside the five routes · five closures · the mechanism rest.Spec.Mount · api.RegisterResource httpx.Resource beside the five routes · five closures screens.Mount · screens.Describe · seven pages behind page.Serve · the catalog as JSON · the mechanism screens.Mount · screens.Describe seven pages behind page.Serve · the catalog as JSON go test ./kit/rest ./ui/screens · a Note no module owns · catalog.json · make e2e · kept true by go test ./kit/rest ./ui/screens a Note no module owns · catalog.json · make e2e Rejected: a template set per entity · 54 sets drifted behind the API · no cleverer tag · Architecture component Rejected: a template set per entity 54 sets drifted behind the API · no cleverer tag modules/admin · screens.Mount per api.Resources() · five pages by hand · Architecture component modules/admin screens.Mount per api.Resources() · five pages by hand platformkit-mobile (native shell) · GET /api/v1/admin/resources · the same rules restated · Architecture component platformkit-mobile (native shell) GET /api/v1/admin/resources · the same rules restated from registered by made by checked by instead of mirrors crud.Schema mounts, composed last the mechanism kept true by Legend Backend Security External

Context

  • • Before: 52 Stimulus controllers, a block library, a descriptor pipeline, and one hand-written template set per entity — 54 modules, 54 sets
  • • A field reached the API at once and a screen when somebody remembered; crud.Schema was derived, attached to every Spec, and read by nothing

Consequences

  • • Adding an entity adds seven screens and no code; a field reaches every screen in the same commit as the API, through the routes' own closures
  • • A generated screen is generic: no picker for assigneeId, Assign's field read-only; when that matters, a hand-written screen, not a cleverer tag

Evidence

  • • go test ./kit/rest ./ui/screens ./modules/admin: a Note no module owns, and TestCatalogGolden against testdata/catalog.json
  • • make e2e creates a task through the generated form; platformkit-mobile parses the same catalog.json; a type outside FieldType is on no screen