Build all app schemas at runtime and persist schema edits #29

Merged
michielbdejong merged 5 commits from codex/24-runtime-schema into main 2026-10-12 16:09:24 +02:00

All nine apps now construct their NextGraph ORM shapes at runtime from authored Atomic JSON-AD through a shared TypeScript defineShape builder. Generated schemas and Atomic bindings remain optional compatibility snapshots; starting and building an app no longer runs schema generation.

Native and Atomic tables, including the embedded tables in all five expense demos, derive columns and controls from runtime metadata from the start. Labels, currency formatting, defaults and field dependencies live outside the generic renderer. Handwritten expense cards keep their domain TypeScript contracts; they do not become arbitrary-schema forms.

The schema editor persists JSON-AD in the selected NextGraph graph. Predicate renames migrate existing values after preflight validation, and native/Atomic/Joep projections refresh from the saved schema. The shared runtime/build converter preserves the direct Atomic-to-NextGraph pipeline merged in #31, without restoring a ShEx intermediate.

The pinned ORM compatibility wrappers replace schema-blind cached subscriptions when schema contents change and remove its JavaScript-only error callback at the WASM JSON boundary. These are application adapters, not changes to the NextGraph engine or published ORM.

Validation:

  • 93 unit tests passed, including real offline WASM migration, stale-save guards and unrelated-domain table metadata tests.
  • Combined runtime/editor type check passed.
  • All nine production builds passed with generated schema and binding directories removed.
  • Browser suite: 37 passed, four existing CI profile tests skipped; includes schema migration, add/remove, reload, all five expense frontends and both table backends.
  • Optional snapshot generation remains deterministic and leaves committed outputs unchanged.

Schema revisions are whole-document replacements. Preflight does not lock concurrent record writes. Native verification covers the local engine, not peer transport or durable restarts; the broker-backed native suite was not rerun. Fixed expense cards do not follow renamed required predicates; use the schema-driven table editors for edited schemas.

Closes #24. Built on merged #31 (#28).

All nine apps now construct their NextGraph ORM shapes at runtime from authored Atomic JSON-AD through a shared TypeScript `defineShape` builder. Generated schemas and Atomic bindings remain optional compatibility snapshots; starting and building an app no longer runs schema generation. Native and Atomic tables, including the embedded tables in all five expense demos, derive columns and controls from runtime metadata from the start. Labels, currency formatting, defaults and field dependencies live outside the generic renderer. Handwritten expense cards keep their domain TypeScript contracts; they do not become arbitrary-schema forms. The schema editor persists JSON-AD in the selected NextGraph graph. Predicate renames migrate existing values after preflight validation, and native/Atomic/Joep projections refresh from the saved schema. The shared runtime/build converter preserves the direct Atomic-to-NextGraph pipeline merged in #31, without restoring a ShEx intermediate. The pinned ORM compatibility wrappers replace schema-blind cached subscriptions when schema contents change and remove its JavaScript-only error callback at the WASM JSON boundary. These are application adapters, not changes to the NextGraph engine or published ORM. Validation: - 93 unit tests passed, including real offline WASM migration, stale-save guards and unrelated-domain table metadata tests. - Combined runtime/editor type check passed. - All nine production builds passed with generated schema and binding directories removed. - Browser suite: 37 passed, four existing CI profile tests skipped; includes schema migration, add/remove, reload, all five expense frontends and both table backends. - Optional snapshot generation remains deterministic and leaves committed outputs unchanged. Schema revisions are whole-document replacements. Preflight does not lock concurrent record writes. Native verification covers the local engine, not peer transport or durable restarts; the broker-backed native suite was not rerun. Fixed expense cards do not follow renamed required predicates; use the schema-driven table editors for edited schemas. Closes #24. Built on merged #31 (#28).
michielbdejong changed title from WIP: Enable runtime schema editing in database table editors to Build all app schemas at runtime and persist schema edits 2026-10-12 16:08:58 +02:00
Sign in to join this conversation.
No reviewers
No labels
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
ELFA/database-apps!29
No description provided.