Milestone 147 pr4 layout package v2 validator skeleton#172
Merged
Coasterpete merged 2 commits intoJun 19, 2026
Conversation
Adds the TrackLayoutPackageV2 contract-only DTO, vocabulary, JSON helper, schema, and tests while deferring mapper, validator, runtime behavior, and V1 changes. Tests: 1,675/1,675 passed. git diff --check passed.
Adds DTO-only TrackLayoutPackageV2 validation with V2-specific diagnostics for contract metadata, start pose, section semantics, banking domain rules, and constant heartline vocabulary. Tests: 1,692/1,692 passed. git diff --check passed.
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.
Milestone 147 PR4 — Track Layout Package V2 Validator
Overview
Introduces the first validation layer for TrackLayoutPackageV2.
This milestone adds DTO-level validation and V2-specific diagnostics while intentionally deferring import workflows, mapping, runtime compilation, normalization, repair behavior, and heartline evaluation.
The validator establishes the contract integrity rules that future V2 import and mapper implementations will rely upon.
Motivation
M147 PR1 defined the V2 design direction.
M147 PR2 locked the intended V2 JSON shape.
M147 PR3 introduced the V2 DTOs, vocabulary, JSON support, and schema.
This milestone adds the next layer in the pipeline:
The goal is to validate authored V2 content before any mapping or runtime conversion occurs.
Implementation
V2 Validator
Added:
Provides DTO-only validation for:
The validator performs validation only and does not modify, normalize, repair, infer, or compile data.
Diagnostics
Added V2-specific diagnostics and validation codes.
New codes include:
alongside V2 equivalents of the established contract, section, banking, and numeric validation rules.
Diagnostic paths follow the same stable-path philosophy used by TrackLayoutPackageV1 validation.
Banking Validation
Validation now enforces:
while continuing to allow:
as a valid authored state.
Heartline Validation
The validator introduces support for the initial V2 heartline vocabulary.
Current supported shape:
{ "kind": "constantOffset", "distanceDomain": "centerlineStation", "axisSource": "sampledFrame" }Heartline offsets must be finite values.
The validator does not evaluate heartline geometry or modify runtime behavior.
Test Coverage
Added:
Coverage includes:
Compatibility
No changes were made to:
Existing V1 behavior remains unchanged.
Intentionally Deferred
This milestone does not implement:
These belong to later milestones.
Validation
Tests: 1,692 / 1,692 passed.
Additional verification:
Result
TrackLayoutPackageV2 now has a complete validation layer with stable diagnostics and contract-level enforcement, providing a foundation for future import and mapper milestones.