Skip to content

Feature: Portable UI Manifest#88

Merged
jhweir merged 2 commits into
devfrom
feat/portable-ui-manifest
Jul 16, 2026
Merged

Feature: Portable UI Manifest#88
jhweir merged 2 commits into
devfrom
feat/portable-ui-manifest

Conversation

@jhweir

@jhweir jhweir commented Jul 16, 2026

Copy link
Copy Markdown
Collaborator

ModelManifest format + plan-ref scrub

Summary

Adds the backend-neutral ModelManifest — the machine-readable vocabulary that describes the
entities a template can query (scalar properties + typed relations). It's the format the query IR
will be validated and compiled against, and the first piece of the "portable UI" model-manifest work
(follows #87). Pure semantics, no backend binding, so a third party can author one for their own
entities.

Also carries a small plan-reference scrub commit — the pre-merge comment cleanup that was meant
to land in #87 but was committed just after it merged (so it's tidied here instead).

Non-breaking and additive: nothing consumes the manifest yet (its consumer arrives with the query
IR), and no existing behaviour changes.

Changes

packages/schema-system/shared/src/manifest.ts (new)
The neutral format: ModelManifest (entities keyed by name) → EntitySchema (properties keyed by
name, relations keyed by name) → PropertySchema (scalar type) / RelationSchema (target +
cardinality + optional reverseOf). Plus a Zod schema, validateManifest() (structure via Zod +
referential-integrity checks Zod can't express — every relation target resolves, every reverseOf
names a real inverse relation), and getEntity/getProperty/getRelation lookups for the eventual
IR compiler. The docblock records how this relates to the existing AD4M ModelManifestEntry.

packages/schema-system/shared/src/manifest.test.ts (new)
Validates a hand-authored manifest for a non-WE domain (a library: Book/Author/Tag) — proving
the format serves any third party, not just WE — and that validation catches a bad scalar type, a
relation to an unknown entity, and a dangling reverseOf. Plus the lookup helpers.

packages/schema-system/shared/src/index.ts
Export the manifest types and functions.

Plan-reference scrub (comment-only, across the files #87 touched)
Reword Phase N / plan-language references to durable "why"; convert deferred TODOs to plain
TODO: comments (code-condition, no phase numbers); keep the durable explanatory comments.

Relationship to existing code

WE already has an AD4M-specific manifest — ModelManifestEntry / buildModelManifest
(@we/app-framework) — a richer, flatter form (properties and relations in one list, with RDF
binding: predicate, resolveLanguage, targetClass). This neutral ModelManifest is the semantic
projection it maps onto. Reconciling them (an AD4M ModelManifestEntry → neutral ModelManifest
converter) is follow-up work, deferred until the query IR gives the manifest a real consumer.

Known follow-ups

  • Express WE's own models as a neutral manifest instance (reconcile with buildModelManifest).
  • The manifest's real consumer is the query IR (next) — its validator/compiler reads getRelation
    et al.
  • Rename the AD4M vocabulary that leaks into templates (adamStore.*); regenerate @we/ai-context.

Test plan

  • @we/schema-shared: 380 tests pass (existing suite + 5 new manifest tests) — no regression.
  • tsc --noEmit clean on @we/schema-shared.
  • Diff verified free of PLAN: / Phase N references (pre-merge scrub check).

jhweir and others added 2 commits July 16, 2026 14:07
Pre-merge hygiene: the migration plan docs live outside the repo, so "Phase N"
references would orphan on merge. Reword them to plan-agnostic "why", convert
deferred TODOs to plain `TODO:` comments (code-condition, no phase numbers), and
keep the durable explanatory comments (the PerspectiveProxy.id trap, the
dedupe / "solid"-condition reasoning).

Co-Authored-By: Claude Opus 4.8 <[email protected]>
The machine-readable vocabulary the query IR is validated/compiled against: entities keyed by name,
each with scalar `properties` and typed `relations` (target + cardinality + optional reverseOf).
Pure semantics — no backend binding.

- Types + Zod schema in @we/schema-shared, plus validateManifest() which adds referential-integrity
  checks Zod can't express (relation targets resolve; reverseOf names a real inverse relation), and
  getEntity/getProperty/getRelation lookups for the IR compiler.
- Proven with a hand-authored toy manifest for a NON-WE domain (a library) — the format serves any
  third party describing their own entities, not just WE.

The existing AD4M `ModelManifestEntry` (@we/app-framework) is the AD4M adapter's richer, flatter form
(properties+relations in one list, with RDF binding); this neutral shape is the projection it maps
onto. Reconciling the two is follow-up work.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
@netlify

netlify Bot commented Jul 16, 2026

Copy link
Copy Markdown

Deploy Preview for coasys-we ready!

Name Link
🔨 Latest commit 7f83e63
🔍 Latest deploy log https://app.netlify.com/projects/coasys-we/deploys/6a58dd9bb3001500085acbaa
😎 Deploy Preview https://deploy-preview-88--coasys-we.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@jhweir
jhweir merged commit 32b9cc2 into dev Jul 16, 2026
3 of 5 checks passed
@jhweir jhweir changed the title Feat/portable UI manifest Feature: Portable UI Manifest Jul 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant