Files
skate-3-rust-engine/tools/asset_pipeline/validation_report.py
T
Hails 18f41a33c5 Tooling: streaming map validator (--validate-maps) wired into setup
One skate3rust process validates TEST_WORLD and every converted map over
stdin/stdout (SKATE_MAP_CHECK lines). Existing checks still fail a map;
new spawn-support / neutral-startup / invisible-collision checks report
warnings. Setup falls back to per-map --check-assets with an older exe.
See docs/hails-additions/06-map-validator.md (PR F).

Note: install.py also carries PR G's customiser-overlap hunks
(available_memory, overlap_customiser, Background); they are interleaved
with the validator wiring in _install and are documented in doc 08.
2026-10-01 00:13:53 -06:00

33 lines
1.2 KiB
Python

"""Setup report including non-blocking map check warnings.
Wraps optional_content.summary instead of changing it: optional_content.py is
part of several asset-group fingerprints and of every character-customiser
stage version, so editing it would force existing installations to rebuild.
This module's name matches no fingerprint pattern (see versions.py and
customiser_setup.fingerprint).
"""
import json
from .optional_content import summary as optional_summary
from .setup_state import atomic_json
def map_check_warnings(stage):
"""Items written by install.record_validation (status 'warning')."""
found = []
for path in sorted((stage/'assets/private/map-status').glob('*-validation.json')):
try:
item = json.loads(path.read_text())
except (OSError, ValueError):
continue
if isinstance(item, dict) and item.get('status') == 'warning':
found.append(item)
return found
def summary(stage):
"""optional_content.summary plus map check warnings, in one setup-report.json."""
warnings = optional_summary(stage) + map_check_warnings(stage)
if warnings:
atomic_json(stage/'setup-report.json', {'version': 1, 'warnings': warnings})
return warnings