feat!: commit flat wire-protocol schema documents and lattice:schema - #455
Draft
bambamboole wants to merge 3 commits into
Draft
feat!: commit flat wire-protocol schema documents and lattice:schema#455bambamboole wants to merge 3 commits into
bambamboole wants to merge 3 commits into
Conversation
Adds the projection machinery (FlatProjection, SchemaBundler, SchemaDocumentWriter in Lattice\Core\JsonSchema), the lattice:schema command, and its two profiles: ExportSchemaProfile merges installed packages' committed schema documents with a fresh reflection of the app's own wire types for consumer apps, while the workbench's BaseSchemaProfile regenerates every package's committed document plus the merged framework bundle. WireModelBuilder::buildAll() grows an opt-in $includeFrameworkEnvelope flag so the framework document can carry the recursive envelope core, strict unions, and the remote-manifest contract as real, resolvable defs for schema consumers without changing what the TypeScript emitter sees. opis/json-schema is added as a dev dependency to validate the generated documents in tests. composer's "types" script now runs lattice:schema before lattice:typescript.
One flat, self-contained .schema.json per wire-contributing package (core, ui, form, table, action, media, tree, calendar, search, api-reference, signature-example), plus the merged packages/framework/resources/schema/lattice.schema.json bundle — generated by `composer types` (lattice:schema) and idempotent.
Unit-tests FlatProjection's dereferencing rules and feature-tests the schema bundler, the per-package documents, the flat committed artifacts (opis-validated, no cross-document refs, envelope-core carried where referenced), the lattice:schema command's app/vendor merge behavior, and a byte-stable snapshot of the committed bundle against the builder. CI's generated-types job now regenerates and diffs every .schema.json alongside generated.ts. Adds the wire-protocol docs page describing the PHP-reflection to TypeScript/JSON-Schema fan-out, sidebar entry, and a cross-link from the remote components page to the RemoteManifest schema contract.
Bundle ReportBundle size has no change ✅ |
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
bambamboole
marked this pull request as draft
August 15, 2026 13:03
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.
Revives the schema-artifact layer from the stale
feat/wire-schema-documentsbranch, ported onto the core wire model (#454).Lattice\Core\JsonSchema\{FlatProjection, SchemaBundler, SchemaDocumentWriter}: every wire source gets a flat, self-contained committed document atpackages/<name>/resources/schema/<name>.schema.json(12 files, no cross-document refs — only the recursive envelope core is copy-once per file), merged intopackages/framework/resources/schema/lattice.schema.json(356 defs, npm-exported as@lattice-php/lattice/schema/lattice.schema.json).lattice:schemaexports a consumer app's merged document (committed vendor docs + fresh reflection of the app's own discover paths, app defs markedorigin: "app");composer typeschains schema → typescript.buildAll()per-source documents never emitted the envelope core, strict unions, or theRemoteManifestcontract despite the docblock claiming so. Opt-in via$includeFrameworkEnvelopeso TypeScript emission stays byte-identical (those defs are hand-written on the TS side).#/$defs/PagePayload; snapshot test byte-compares the committed artifact; CI regenerates and diffs all schema files alongside generated.ts.advanced/wire-protocolpage (entry points,x-latticevocabulary, structured-output usage,lattice:schema).Gates: full Pest suite (1714 passed), PHPStan level 8 both configs,
composer typesidempotent,npm run checkgreen, docs build green.