Skip to content

[Blueprints] Publish v2 in the Blueprint schema - #3999

Merged
adamziel merged 5 commits into
trunkfrom
blueprint-v2-public-schema
Jul 10, 2026
Merged

[Blueprints] Publish v2 in the Blueprint schema#3999
adamziel merged 5 commits into
trunkfrom
blueprint-v2-public-schema

Conversation

@adamziel

@adamziel adamziel commented Jul 10, 2026

Copy link
Copy Markdown
Collaborator

Blueprint v2 already ran, but blueprint-schema.json and the browser editor only understood v1. A valid v2 Blueprint could therefore run while the editor marked it invalid and offered v1 fields.

This publishes one schema for both declaration versions, adds lazy version-aware validation, and makes completion follow an explicit numeric version: 2. String discriminators remain choices instead of silently selecting the first branch, nested WXR fields complete correctly, and JSON Pointer diagnostics highlight the actual invalid value.

The existing v1 validator remains byte-for-byte unchanged. The v2 validator stays in a separate dynamic chunk, so ordinary Playground loads do not fetch it.

@adamziel
adamziel force-pushed the blueprint-v2-public-schema branch from a9f04fd to bb7fd7d Compare July 10, 2026 13:02
Copilot AI review requested due to automatic review settings July 10, 2026 15:08

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Note

Copilot was unable to run its full agentic suite in this review.

Publishes Blueprint v2 support end-to-end by updating the public JSON schema and aligning the browser editor’s completion + validation behavior with the runtime’s versioned declaration rules.

Changes:

  • Add version-aware schema branch selection for editor completion (v1 default, explicit version: 2 opts into v2).
  • Switch the editor linter to async, version-aware validation with improved JSON Pointer decoding for diagnostics ranges.
  • Add/extend tests covering completion behavior, schema portability, and v2 validation dispatch.

Reviewed changes

Copilot reviewed 12 out of 16 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
packages/playground/website/src/components/blueprint-editor/json-schema-editor/jsonSchemaCompletion.ts Selects v1/v2 schema branch up-front and improves discriminator + const insertion for completion.
packages/playground/website/src/components/blueprint-editor/json-schema-editor/jsonSchemaCompletion.spec.ts Adds completion tests for v1 default, v2 opt-in, discriminator insertion, and published schema coverage.
packages/playground/website/src/components/blueprint-editor/json-schema-editor/json-schema-utils.ts Adds helper to read root properties from incomplete JSON and improves $ref chain resolution.
packages/playground/website/src/components/blueprint-editor/json-schema-editor/json-schema-utils.spec.ts Adds tests for chained $ref resolution and root property reads on incomplete documents.
packages/playground/website/src/components/blueprint-editor/json-schema-editor/blueprint-linter.ts Makes linting async via validateBlueprintDeclaration and fixes JSON Pointer decoding for accurate highlights.
packages/playground/website/src/components/blueprint-editor/json-schema-editor/blueprint-linter.spec.ts Adds tests for v1/v2 lint acceptance and precise error highlighting using JSON Pointer edge cases.
packages/playground/blueprints/src/tests/schema/public-schema.spec.ts Verifies published schema v1/v2 root, portable URL constraint, and consistency with dedicated v2 validator.
packages/playground/blueprints/src/lib/validate-blueprint-declaration.ts Introduces async dispatcher that lazily loads v2 validation only for explicit version: 2.
packages/playground/blueprints/src/lib/v2/validate-blueprint-v2.ts Exposes an AJV-error-oriented v2 declaration validator and adapts existing v2 validation API to it.
packages/playground/blueprints/src/index.ts Re-exports validateBlueprintDeclaration as a public API.
packages/playground/blueprints/public/schema-readme.md Documents the split between v1 validator and separate v2 validator artifact.
packages/playground/blueprints/public/blueprint-v2-schema-validator.js Updates generated v2 validator artifact to match the newly published schema.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@adamziel
adamziel merged commit 6d99a65 into trunk Jul 10, 2026
53 checks passed
@adamziel
adamziel deleted the blueprint-v2-public-schema branch July 10, 2026 16:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment