feat(schemas): versioned JSON contracts for metadata, describe and explain (G6)
VoidBuildSystem CI / 1 · Requirements (push) Successful in 3s
VoidBuildSystem CI / 2B · Windows Wine build (debug) (push) Successful in 1m48s
VoidBuildSystem CI / 2A · Linux build (debug) (push) Successful in 4m22s
VoidBuildSystem CI / 2A · Linux build (coverage) (push) Successful in 4m46s
VoidBuildSystem CI / 2A · Linux build (sanitizers) (push) Successful in 6m5s
VoidBuildSystem CI / 2B · Windows Wine build (relwithdebinfo) (push) Successful in 3m24s
VoidBuildSystem CI / 2A · Linux build (relwithdebinfo) (push) Successful in 5m57s
VoidBuildSystem CI / 3B · Windows Wine test (debug) (push) Successful in 24s
VoidBuildSystem CI / 3B · Windows Wine test (relwithdebinfo) (push) Successful in 20s
VoidBuildSystem CI / 3A · Linux test (coverage) (push) Failing after 1m39s
VoidBuildSystem CI / 3A · Linux test (sanitizers) (push) Successful in 1m10s
VoidBuildSystem CI / 3A · Linux test (debug) (push) Failing after 7m21s
VoidBuildSystem CI / 3A · Linux test (relwithdebinfo) (push) Failing after 7m25s
VoidBuildSystem CI / 4A2 · VBS installers (linux target) (push) Skipped
VoidBuildSystem CI / 4A2 · VBS installers (windows target) (push) Skipped
VoidBuildSystem CI / 5 · Release (push) Skipped

- schemas/ publishes JSON Schemas (draft 2020-12, additionalProperties
  false) for `vbs metadata`, `vbs describe` and `vbs explain --format
  json`, plus README documenting the versioning rule: any emitted-shape
  change bumps schema_version and adds a new -vN file; older schemas stay.
- `vbs describe` now emits a StrictJson graph summary with schema_version,
  project/build roots, profile/compiler/os/arch, target and dependency
  counts and names.
- `vbs explain --format json` carries schema_version.
- Tests include a schema subset validator (types, required, enum,
  additionalProperties, items, minimum) and
  json_schemas_validate_metadata_describe_and_explain validates the real
  documents against the files, then proves the validator rejects a missing
  required key, a wrong enum value and an unexpected property.

Verified: the schema test, vbs_core_tests and the CLI contract suite pass;
clang-format clean.
This commit is contained in:
faumaray committed 2026-12-06 20:26:57 +03:00
1 parent 455a403429
commit f1cf277847
9 files changed
+648 -4

No files matched your search

+2
View File
@@ -401,6 +401,8 @@ Stage: VERIFIED — Plans 01–19 + Plan 20 Slices 1–2C + Track A + Track B (B
## Remaining future scope
- **Wave 153 (Versioned JSON contracts, G6 start)**: `schemas/` publishes JSON Schemas for `vbs metadata` (`metadata-v1.schema.json`), `vbs describe` (`describe-v1.schema.json`) and `vbs explain --format json` (`explain-v1.schema.json`), all with `additionalProperties: false`; `schemas/README.md` states the versioning rule (a shape change bumps `schema_version` and adds a new `-vN` file, older schemas stay). `vbs describe` now emits a StrictJson graph summary (`schema_version`, roots, profile/compiler/os/arch, counts, target/dependency names) and `vbs explain --format json` carries `schema_version`. `FullV1Tests.json_schemas_validate_metadata_describe_and_explain` validates the emitted documents against the files and proves the validator rejects missing required keys, wrong enums and unexpected properties.
- **Wave 152 (Test depth and fuzzing, G8)**: `vbs doctest` extracts fenced C++ blocks from `///`, `//!` and Doxygen comment blocks, compiles each as the body of `main()` with `#line` mapping (so errors point at the header), links optional `--source` files and reports block pass/fail. The test runner gained `--shard I/N` (fixture-aware clustering, greedy balancing by the previous run's recorded timings in `<build>/.vbs/test_timings.json`), `--rerun-failed` (reads `<build>/.vbs/last_failed_tests.json` and re-runs only the failed closure), `--known-flaky FILE` (flaky failures are reported but do not fail the run) and coverage gates `--coverage-min PCT` / `--coverage-diff BASE` (lcov summary comparison). `vbs fuzz` builds a libFuzzer target with clang (`-fsanitize=fuzzer,address,undefined`), runs it over a corpus and reports crash artifacts. Verified by `doctest_extracts_compiles_and_runs_blocks`, `test_sharding_partitions_tests_and_records_timings`, `test_rerun_failed_and_known_flaky`, `coverage_gates_enforce_minimum_and_baseline` and `fuzz_builds_targets_and_reports_crashes`.
- **Wave 151 (Profiles and toolchain pinning, G3)**: `Dependency::profile(name, DependencyProfileOptions)` stores per-profile compile/link options, defines, LTO and sanitizers; the native provider applies the matching override to the dependency's own `ProfileContext` and includes the overrides in the provider input hash, so changing them invalidates cached dependency builds. `vbs-toolchain.toml` pins compiler, minimum version, C/C++ standards and sysroot (with a `strict` field); it is loaded once per build and checked after every toolchain probe, warning on drift or failing with `--locked-toolchain` (or `strict = true`). `vbs profile list|show|diff` lists declared profiles with parents, prints one resolved profile, or reports the fields that differ between two. Verified by `FullV1Tests.dependency_profile_overrides_apply_to_native_builds`, `toolchain_pin_detects_and_enforces_drift` and `profile_commands_list_show_and_diff`.
+1
View File
@@ -152,4 +152,5 @@ Base HEAD: `fe0d1a6`
| Wave 150 (Feature flags) | `Project::feature`, `Target::require_feature`, `Dependency::when`, additive unification, `--features`/`--no-default-features`, `VBS_FEATURE_*` defines, feature-aware action keys, optional dependency filtering, `explain --show-features`, metadata feature list | COMPLETE & VERIFIED (GCC 16.2; `features_unify_defines_and_invalidate_action_keys` and `optional_dependencies_follow_feature_selection` pass; CLI contracts pass) | `include/Void/Build.hpp`, `sdk/Build.cpp`, `include/Void/Build/Graph/Graph.hpp`, `src/Graph/Graph.cpp`, `src/Main.cpp`, `tests/{FullV1Tests,CliContracts}`, docs |
| Wave 151 (Profiles + toolchain pinning) | `Dependency::profile` overrides for native dependency builds (hash-aware), `vbs-toolchain.toml` pin + drift detection (`--locked-toolchain`, `strict`), `vbs profile list\|show\|diff` | COMPLETE & VERIFIED (GCC 16.2; the three G3 tests pass; CLI contracts pass) | `include/Void/Build.hpp`, `sdk/Build.cpp`, `src/Graph/Graph.cpp`, `src/Provider/Provider.cpp`, `include/Void/Build/Toolchain/Pin.hpp`, `src/Toolchain/Pin.cpp`, `src/Main.cpp`, `tests/{FullV1Tests,CliContracts}`, docs |
| Wave 152 (Test depth + fuzzing) | `vbs doctest` (fenced blocks, `#line` diagnostics, `--source`), `--shard I/N` + timings, `--rerun-failed`, `--known-flaky`, `--coverage-min`/`--coverage-diff`, `vbs fuzz` (libFuzzer) | COMPLETE & VERIFIED (GCC 16.2; doctest/sharding/rerun/coverage tests pass; fuzz test passes under clang 23; CLI contracts pass) | `include/Void/Build/Test/Doctest.hpp`, `src/Test/Doctest.cpp`, `include/Void/Build/Test/Fuzz.hpp`, `src/Test/Fuzz.cpp`, `include/Void/Build/Report/Coverage.hpp`, `src/Report/Coverage.cpp`, `src/Main.cpp`, `tests/{FullV1Tests,CliContracts}`, docs |
| Wave 153 (Versioned JSON contracts) | `schemas/{metadata,describe,explain}-v1.schema.json` + versioning rule, `vbs describe` StrictJson graph summary, `vbs explain --format json` schema_version, schema validation test with negative cases | COMPLETE & VERIFIED (GCC 16.2; `json_schemas_validate_metadata_describe_and_explain` passes; vbs_core_tests and CLI contracts pass) | `schemas/`, `src/Main.cpp`, `tests/FullV1Tests.cpp`, docs |
| Future (Plans 23–24) | Gap closure and superiority tracks | PLANNED (see the plans for per-track acceptance gates) | [23-remaining-upgrade-plan.md](../roadmap/23-remaining-upgrade-plan.md), [24-superiority-tracks.md](../roadmap/24-superiority-tracks.md) |
+8
View File
@@ -324,6 +324,14 @@ policy violation exits non-zero in CI.
### G6 — Machine-readable everything and tooling protocols *(M)*
**Status: partially implemented (Wave 153).** Done: item 1's `vbs metadata` workspace
document (targets, dependencies, features, lockfile, roots) and item 2's published
`schemas/{metadata,describe,explain}-v1.schema.json` with the versioning rule and a
compatibility test (`FullV1Tests.json_schemas_validate_metadata_describe_and_explain`);
`vbs describe` is now a StrictJson graph summary with `schema_version`. Pending: `graph`,
`trace`, `bep`, `doctor` and daemon schemas, the DAP server, the LSP-status request and the
plugin protocol.
**Beats:** Cargo (`metadata`), CMake (File API), Meson (introspect) — VBS can expose a single,
versioned, cross-cutting model.