Skip to content

feat(frontmatter): add validator command and pre-commit rollout #2281

Closed

Description

@josecelano

Split from #2266 after its mandated first profile-slice boundary review. This follow-up owns only T7-T8.

Scope

Provide the validator command surface for explicit file or directory paths, --staged, and manual whole-tree validation. Preserve the repository CLI output contract: no stdout, NDJSON diagnostics on stderr, and exit codes 0 for success, 1 for validation or runtime failure, and 2 for invalid invocation. Integrate the command with pre-commit and provide fixture, mutation, and manual portability proof.

Acceptance Criteria

  • The command supports explicit file or directory paths, --staged, and a documented manual whole-tree mode.
  • The command emits no stdout; diagnostics are stable NDJSON on stderr with source path, category, severity, field path when applicable, and actionable explanation.
  • Exit codes are 0 for success, 1 for validation or runtime failure, and 2 for invalid invocation.
  • Pre-commit invokes the validator as a named, read-only step; CI and other integration tiers are not added.
  • Accepted/rejected fixtures and mutation cases cover representative field, scalar, allowed-value, reference, lifecycle, and path failures within the command boundary.
  • Manual portability evidence demonstrates focused, staged, whole-tree, and pre-commit use without network access, including no-stdout behavior.
  • Focused tests and relevant repository quality checks pass.

Out of Scope

  • The final Overhaul: Automation Tools and AI Agent Guardrails #2003 automation architecture, binary/package selection, orchestration, shared runners, caches, or policy composition.
  • JSON Schema generation, its tracked artifact, regeneration, and drift verification.
  • CI, pre-push, nightly, release, or agent-policy integration.

This issue makes no claim that implementation has started or completed.

Activity

  1. added 2 commits that reference this issue on Sep 22, 2026
  2. da2ce7 commented on Sep 24, 2026

    @da2ce7
    Contributor

    The state this issue starts from, at develop fa698c43 (2026-09-24). No gate runs a frontmatter-validator binary today.

    • Hooks. Neither the pre-commit STEPS (contrib/dev-tools/git/hooks/pre-commit.sh:51-60) nor the pre-push STEPS (contrib/dev-tools/git/hooks/pre-push.sh:45-50) names it.
    • Workflows. No file under .github/workflows/ names it.
    • Drift check. The schema drift check exists as a documented command: cargo run --offline --package frontmatter-validator --bin frontmatter-schema -- check (docs/schemas/README.md:18-22). It came from feat(frontmatter): generate v1 schema and verify drift #2280 (closed 2026-09-24) and feat(frontmatter-validator): [#2280] generate v1 schema and verify drift #2325.
    • Tests. The crate's 69 #[test] functions run with the workspace test suite: the pre-push cargo +stable test … --workspace and the testing.yaml unit job.

    This issue adds a named pre-commit step. Its Out of Scope section (body lines 20-21) lists:

    • "JSON Schema generation, its tracked artifact, regeneration, and drift verification"
    • "CI, pre-push, nightly, release, or agent-policy integration"

    With both excluded, no open thread in the capture of 2026-09-24T11:03Z places frontmatter-schema -- check in a gate. The same holds for any CI run of the validator.

    Questions:

    1. Does the planned pre-commit step also run the schema drift check, or does a different issue own that?
    2. Is a CI run of the validator (outside the scope listed here) tracked anywhere, for example under Refactor Semantic Link and Frontmatter Conventions #2264?
  3. added 10 commits that reference this issue on Sep 24, 2026
  4. self-assigned this
    on Sep 26, 2026
  5. 102 remaining items

  6. added 4 commits that reference this issue on Sep 28, 2026
  7. added a commit that references this issue on Sep 28, 2026
  8. added a commit that references this issue on Sep 28, 2026
  9. added a commit that references this issue on Sep 28, 2026
  10. added 6 commits that reference this issue on Sep 28, 2026
  11. added a commit that references this issue on Oct 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions