Repository navigation
feat(frontmatter-validator): [#2280] generate v1 schema and verify drift - #2325
Merged
josecelano merged 48 commits intoSep 24, 2026
Merged
Conversation
There was a problem hiding this comment.
Warning
Copilot couldn't run its full agentic review because it didn't start before the timeout. Make sure your repository has a runner available, or add a copilot-code-review.yml file specifying one with the runs-on attribute. See the docs for more details.
Copilot review overview
Review effort: Lite
Findings: 2
Open (3)
What changed in this PR
Adds a generated JSON Schema (Draft 2020-12) for the strict v1 frontmatter model and introduces a deterministic, offline CLI to generate and drift-check the tracked schema artifact.
Changes:
- Track the generated v1 schema artifact at
docs/schemas/frontmatter-v1.schema.jsonand document regeneration + schema/Rust boundary. - Implement
frontmatter-schemabinary withgenerateandcheckactions, deterministic encoding, drift detection, and CLI-exit-code mapping. - Refactor
frontmatter-validatorcrate layout (diagnostics/syntax/profile separation), relocate fixtures into the crate, and add/adjust tests and issue evidence docs.
| File | Description |
|---|---|
| docs/schemas/frontmatter-v1.schema.json | Adds the tracked generated Draft 2020-12 schema artifact for strict v1 profiles. |
| docs/schemas/README.md | Documents schema regeneration/check commands and Rust-only invariants not expressed in JSON Schema. |
| docs/issues/open/2280-2264-generate-v1-schema-and-verify-drift/test-design-review.md | Records AAA test design and mutation evidence for schema generation/drift behaviors. |
| docs/issues/open/2280-2264-generate-v1-schema-and-verify-drift/schema-command-refactor-plan.md | Captures the refactor plan and rationale for the schema CLI command implementation/testing. |
| docs/issues/open/2280-2264-generate-v1-schema-and-verify-drift/profile-test-design-review.md | Records test design for strict profile validation refactors and invariants. |
| docs/issues/open/2280-2264-generate-v1-schema-and-verify-drift/profile-refactor-plan.md | Documents refactor sequencing for profile validation ownership/structure. |
| docs/issues/open/2280-2264-generate-v1-schema-and-verify-drift/manual-verification-evidence.md | Provides manual offline regeneration and drift verification evidence. |
| docs/issues/open/2280-2264-generate-v1-schema-and-verify-drift/crate-layout-test-design-review.md | Records test design for crate layout changes (fixtures/diagnostics/syntax seams). |
| docs/issues/open/2280-2264-generate-v1-schema-and-verify-drift/crate-layout-refactor-plan.md | Documents the crate layout plan and rationale (module boundaries and ownership). |
| docs/issues/open/2280-2264-generate-v1-schema-and-verify-drift/agent-review-reports.md | Stores independent review reports and acceptance-criteria verification notes. |
| docs/issues/open/2280-2264-generate-v1-schema-and-verify-drift/ISSUE.md | Updates the #2280 issue spec/status + AC5 decision notes and progress log. |
| docs/issues/closed/2265-2264-inventory-markdown-frontmatter-contracts/frontmatter-fixtures/manifest.md | Updates fixture manifest text to reflect relocation rationale/exclusion policy. |
| docs/issues/closed/2265-2264-inventory-markdown-frontmatter-contracts/ISSUE.md | Notes fixture relocation under #2280 to avoid archived-doc dependency for tests. |
| docs/index.md | Adds a docs index row pointing to the schemas guide. |
| contrib/dev-tools/checks/frontmatter-validator/src/syntax.rs | Introduces frozen v1 syntax predicates + paired schema regex constants and tests. |
| contrib/dev-tools/checks/frontmatter-validator/src/profile.rs | Adds schema generation/encoding, strict profile validation refactors, required-field transform, and tests. |
| contrib/dev-tools/checks/frontmatter-validator/src/lib.rs | Splits modules, re-exports diagnostics/schema APIs, adds scalar-style query, updates extraction errors. |
| contrib/dev-tools/checks/frontmatter-validator/src/diagnostic.rs | Moves diagnostic vocabulary into a dedicated module with unified constructor. |
| contrib/dev-tools/checks/frontmatter-validator/src/bin/frontmatter-schema.rs | Implements the deterministic schema artifact generator/drift checker CLI with tests. |
| contrib/dev-tools/checks/frontmatter-validator/Cargo.toml | Adds/pins schema + CLI dependencies (schemars, serde_json, tempfile, thiserror). |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
…without process state
… with typed errors
…ocumented command
josecelano
force-pushed
the
2280-frontmatter-schema-drift
branch
from
September 24, 2026 08:00
11ebf39 to
6011a86
Compare
Member
Author
|
ACK 6011a86 |
This was referenced Sep 24, 2026
This branch was previously deployed
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.


Closes #2280. Parent EPIC: #2264.
Summary
Generates a JSON Schema Draft 2020-12 projection of the canonical strict v1 frontmatter model (issue and EPIC profiles) directly from the
frontmatter-validatorRust types withschemars, tracks the artifact atdocs/schemas/frontmatter-v1.schema.json, and adds afrontmatter-schemabinary with deterministic offlinegenerateandcheck(drift) commands. The schema is a derived compatibility artifact; the Rust validator remains the source of truth and its remaining Rust-only invariants are documented indocs/schemas/README.md.After the core delivery, three maintainer-approved post-implementation refactor plans were executed in this branch, each item as its own signed commit (history intentionally not squashed):
TempDir-owned tests, exit code2for usage errors per the CLI output ADR, pureCommand::parse, library-owned artifact encoding, typedError, atomic same-directory artifact replacement with an explicit symlink policy, closedArtifactOrigin, shell-safe regeneration hints, writer-injected process reporting.StrictProfileKind, one shared validation sequence with explicit diagnostic precedence, aggregate-owned invariants, definition-owned structural checks, unifiedDiagnostic::new, shared schema regex constants.diagnostic.rs,Frontmatter::has_double_quoted_scalarreplacing a raw-YAML seam,syntax.rspairing each schema regex with its authoritative predicate, single typed reference-validation path, top-down ordering ofprofile.rs.Two pre-PR review findings were fixed in-branch: reference-syntax diagnostics again name the failing
semantic-links.<field>(required by the #2266 diagnostic contract for #2281), and the schema'srequiredarrays now include the contract's nullable-but-required fields (epic,github-issue,related-pr,epic-owner), generated from the validator's own field list via aschemarstransform so presence has one source and nullability is preserved. The AC5 options considered and the reason#[schemars(required)]was rejected are recorded in the spec.Files and packages touched
contrib/dev-tools/checks/frontmatter-validator/—src/lib.rs,src/diagnostic.rs,src/syntax.rs,src/profile.rs,src/bin/frontmatter-schema.rs,Cargo.toml,fixtures/(7 Markdown fixtures + manifest, moved fromdocs/issues/closed/2265-.../frontmatter-fixtures/)docs/schemas/frontmatter-v1.schema.json(generated),docs/schemas/README.mddocs/index.md(schema guide row)docs/issues/open/2280-2264-generate-v1-schema-and-verify-drift/— spec, three refactor plans with test-design reviews, manual evidence, review reportsdocs/issues/closed/2265-2264-inventory-markdown-frontmatter-contracts/ISSUE.md(fixture relocation note)Cargo.lock(schemars = "=1.2.1"; pinned because registry 1.2.2 requires an unpublishedschemars_derive)Validation
cargo test --package frontmatter-validator: 45 library + 24 binary tests.cargo run --offline --package frontmatter-validator --bin frontmatter-schema -- check: tracked artifact byte-identical to generator output; two independent regenerations produce the same SHA-256.cargo clippy --package frontmatter-validator --all-targets -- -D warnings,cargo +nightly fmt --all -- --check,cargo machete --with-metadata,linter all, repository pre-commit and pre-push gates: all pass on every commit.manual-verification-evidence.md): regeneration idempotent, drift exits1, unknown action exits2, stdout empty throughout.agent-review-reports.md; all blockers resolved.Out of scope (owned by follow-ups)
CLI file discovery,
--staged/whole-tree modes, NDJSON diagnostics, structuredfield_path, and pre-commit integration remain #2281. Excluding the crate'sfixtures/directory from future whole-tree validation and migrating the five specs that usestatus: openare noted for #2281. Expressing "present but non-null" semantic-link sequences in the schema would require a public model change and is left to #2264.