# JSON schemas Versioned JSON Schemas for the machine-readable `vbs` surfaces: | Command | Schema | | --- | --- | | `vbs metadata` | [metadata-v2.schema.json](metadata-v2.schema.json) (current), [metadata-v1.schema.json](metadata-v1.schema.json) (retained) | | `vbs describe` | [describe-v1.schema.json](describe-v1.schema.json) | | `vbs explain --format json` | [explain-v1.schema.json](explain-v1.schema.json) | ## Versioning rule - The schema file name and the document's `schema_version` integer always match (`-vN` ⇔ `"schema_version": N`). - **Any change to the emitted shape bumps the version and adds a new `-vN` file.** That includes adding, removing, renaming or retyping a field. The previous schema stays for consumers that read older documents. - Consumers must ignore fields they do not know; producers must not rely on that for breaking changes. - The repository tests validate the emitted documents against these files (`FullV1Tests.json_schemas_validate_metadata_describe_and_explain`), so a code change that alters a document without updating its schema fails the suite. ## Adding a new version 1. Emit the new `schema_version` from the command. 2. Copy the previous schema to `-vN+1.schema.json` and update it. 3. Add the new document to the schema validation test. 4. Keep the older schema file until the next major release. ## History - **metadata v2** (2026-12-06): added the `benchmark` target kind (G1 `vbs bench`) and corrected the target-kind enum to the names actually emitted (`header_only`, not `header_only_library`). v1 is retained unchanged for older consumers.