Feature: Portable UI Manifest#88
Merged
Merged
Conversation
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]>
✅ Deploy Preview for coasys-we ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
ModelManifest format + plan-ref scrub
Summary
Adds the backend-neutral
ModelManifest— the machine-readable vocabulary that describes theentities 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(propertieskeyed byname,
relationskeyed by name) →PropertySchema(scalartype) /RelationSchema(target+cardinality+ optionalreverseOf). Plus a Zod schema,validateManifest()(structure via Zod +referential-integrity checks Zod can't express — every relation
targetresolves, everyreverseOfnames a real inverse relation), and
getEntity/getProperty/getRelationlookups for the eventualIR 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.tsExport 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 plainTODO: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 RDFbinding:
predicate,resolveLanguage,targetClass). This neutralModelManifestis the semanticprojection it maps onto. Reconciling them (an AD4M
ModelManifestEntry→ neutralModelManifestconverter) is follow-up work, deferred until the query IR gives the manifest a real consumer.
Known follow-ups
buildModelManifest).getRelationet al.
adamStore.*); regenerate@we/ai-context.Test plan
@we/schema-shared: 380 tests pass (existing suite + 5 new manifest tests) — no regression.tsc --noEmitclean on@we/schema-shared.PLAN:/Phase Nreferences (pre-merge scrub check).