Builtin Library
README.md
assetValidator
Structure validator for asset folders. Delegates each asset to
asset.validate — the engine primitive the world.push gate runs — and
maps the result into the report's Problem records, so a world that
validates clean here also passes the structural half of the publish
gate.
Exports
M.validate(entry) -> { Problem }— validate one asset entry (as produced byvfsScanner). Returns an array of Problem records; empty means structurally clean.M.validateBatch(assets) -> { Problem }— flatten validation across a list of assets.
Checks performed (via asset.validate)
| Code | Severity | What it catches |
|---|---|---|
structure.missing_required_file | error | Required file/folder declared in type.yaml::files.required is absent (including unsatisfied one_of_group). |
structure.content_constraint | error | A declared file exists but violates its content: checks (e.g. empty README.md, .metadata without description/tags). |
structure.unexpected_file | warning | An entry at the asset root is not listed in required/optional and allow_unlisted is false. Reported as a warning because the publish gate does not block on it — tightening the declared-child set is the assetType author's call. |
validate.* / type-defined codes | as reported | The asset type's own semantic validate hook (from its behavior.luau). |
schema.unknown_type | warning | Asset folder has a suffix with no registered type.yaml. |
schema.unresolved_asset | warning | The registry could not resolve the asset yet (e.g. written this frame, registration still draining). |
Private subassets — assets nested inside a container whose type does
not broadcast its subassets (e.g. a bundle's interior meshes /
materials) — are exempt from the describe-this-asset requirements
(README.md / .metadata presence and content). Their own primary
file and structural rules still apply. Members of a broadcasting
container (a .package) and top-level assets are fully gated.
Problem anchoring
Missing files anchor at the asset root (the message names the file); existing files — unexpected entries, content violations — anchor at the file itself.