Skip to content

Z613: FRONTMATTER_SCHEMA_MISMATCH

  • Severity: Error


    Penalty: 0.0 points | Category: general

  • Remediation & Opt-In


    Auto-Fixable: No | Opt-In: No


Description

A YAML frontmatter key value does not match the required RE2 regular expression pattern declared in [policies].frontmatter_schema_match.

The Policy-as-Code Engine allows project maintainers to enforce deterministic format constraints on frontmatter values (e.g., Semantic Versioning patterns, ISO-8601 date formats, or approved author identifiers).

Z613 is an error severity finding (Penalty: 5.0 pts) because malformed frontmatter schemas disrupt automated downstream build pipelines, metadata aggregators, and search indexers.


How to Fix

Update the frontmatter value so that it conforms to the required RE2 pattern:

Before (non-compliant assuming pattern ^v\d+\.\d+\.\d+$):

---
title: Release Notes
version: 1.0
---

Content here.

After (compliant):

---
title: Release Notes
version: v1.0.0
---

Content here.

Configuration

Z613 is opt-in and inactive by default. It is enabled by mapping frontmatter keys to RE2 regex strings under [policies].frontmatter_schema_match in .zenzic.toml:

[policies.frontmatter_schema_match]
version = "^v\\d+\\.\\d+\\.\\d+$"
date = "^\\d{4}-\\d{2}-\\d{2}$"

When frontmatter_schema_match is empty or absent, no Z613 findings are emitted.


Suppression

If a file requires a non-standard frontmatter format, suppress the finding inline:

<!-- zenzic:ignore:Z613 -->
---
title: Unreleased Spec
version: unreleased-draft
---

Or use [governance].per_file_ignores in .zenzic.toml:

[governance.per_file_ignores]
"docs/drafts/**" = ["Z613"]

Reference

See the Finding Codes Index for finding code details.