feat: PRSDM-9647 Runtime Frontmatter Validation System#72
Closed
DustinFischer wants to merge 24 commits intomainfrom
Closed
feat: PRSDM-9647 Runtime Frontmatter Validation System#72DustinFischer wants to merge 24 commits intomainfrom
DustinFischer wants to merge 24 commits intomainfrom
Conversation
…/PRSDM-9647-validation-logic
…/PRSDM-9647-validation-logic
DustinFischer
added a commit
that referenced
this pull request
Jan 23, 2026
Initial implementation attempts for JSON schema generation (PR #71) and runtime validation system (PR #72). These approaches were superseded by the flat YAML schema architecture implemented in subsequent commits. This commit consolidates 29 commits from the exploratory phase including: - JSON schema generation (replaced with YAML) - Inheritance-based schema model (replaced with flat model) - Initial validation system implementation - Multiple merge commits and experimental work The superseded work established foundational concepts that informed the final flat schema architecture. Related: PRSDM-9508, PRSDM-9647 Supersedes: PR #71, PR #72
12 tasks
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.
Description
Implements PRSDM-9647: Runtime Frontmatter Validation System - provides build-time validation of Hugo page frontmatter against a JSON schema, generating warnings for invalid configurations.
Related Work:
feat/PRSDM-9508-phase1-json-schema-generator) - DEPENDENCY: Schema generator must be merged firstKey Features:
single.htmlwarnfnoterrorf)params.data.namespace.Scratchpattern for reliable data passing between partialsArchitecture:
Issue
Dependencies
feat/PRSDM-9508-phase1-json-schema-generator) - Schema generator must be merged first as this PR consumesdata/presidium/frontmatter-schema.jsonTesting Instructions
Prerequisites
presidium-layouts-basemodule importedStep 1: Generate Schema
First, generate the frontmatter schema following PRSDM-9508 Phase 1 instructions.
Create
config-gen.yaml:Generate schema:
Verify schema exists:
Step 2: Create Test Configuration
Create
config-test.yaml:Note: This is a temporary testing mechanism. In the future, validation configuration will be directly integrated into Hugo projects. For now, this configuration mounts your test content directory. Update the
sourcepath if your test files are in a subdirectory likecontent/validation-tests/test-<validator>.Step 3: Configure Frontmatter Validation Rules
Add frontmatter configuration to
config.yml:Step 4: Create Test Content
Create test markdown files with valid and invalid frontmatter:
Valid (
content/test-valid.md):Invalid - Missing Required Field (
content/test-missing-required.md):Invalid - Constraint Violation (
content/test-too-short.md):Invalid - Wrong Type (
content/test-invalid-email.md):Invalid - Enum Value (
content/test-invalid-status.md):Step 5: Run Hugo Build
Build your site and check for validation warnings:
Step 6: Verify Validation Output
Expected Warnings for Invalid Files:
No Warnings for Valid File:
test-valid.mdshould build without warningsStep 7: Test Optional Fields
Create content with optional fields:
Optional Present (
content/test-optional-present.md):Optional Missing (
content/test-optional-missing.md):Both files should build successfully (no warnings).
Step 8: Test Constraint Violations
Array Too Many Items (
content/test-array-too-many.md):Expected:
WARN [Frontmatter Validation] test-array-too-many.md: tags must have no more than 5 itemsTechnical Notes
Root Validator Pattern
The validation system uses a centralized root validator that handles:
issetfor proper handling of falsy values like empty arrays)validation_messageoverrideBenefits:
.Scratch Pattern
All data passing between partials uses Hugo's
.Scratchto avoidtemplate.HTMLconversion:Format Validator Inheritance
Format validators delegate to base type validators:
email→string(adds email pattern)date→string(adds YYYY-MM-DD pattern)text→string(multiline UI hint)option→enum(dropdown UI hint)All type constraints automatically inherited.
Configurable Schema Location
Documentation
FRONTMATTER.md- Complete developer reference for validation systemREADME.md- Added reference to FRONTMATTER.md.claude/artifacts/prsdm-9647/implementation-progress.md- Detailed implementation trackerPR Readiness Checks
<type>: <jira-ticket-num><title>, for example:feat: PRSDM-9647 Runtime frontmatter validation