Shard format format 0.1.0.6 · npm 0.80.0

Validation codes

Reference, rendered from docs/VALIDATION-CODES.md as it stands at this build. Its links to code go to GitHub; the code is the spec.

On this page
  1. validate
  2. stream
  3. performance
  4. audio

Written by: Claude

State: generated from src/format/issue-codes.ts (SHARD-AUTHORING SA41). Do not edit by hand: run node src/tools/validation-codes.ts write.

Every issue shard-format reports carries a stable code: a validator refusal, a performance report issue and an audio finding. Match the code, never the message: messages may be reworded, codes are renamed only with a release note.

validate

validateShardfileFolder, validateShardfileStream and readTar: error.code on the thrown Error.

CodeMeaning
archive-invalidThe tarball is not strict ustar (a bad header, path, padding or end, a truncated entry, too many entries), or the stored object does not decode.
index-invalidshard.json is missing, too large, not canonical JSON, or fails the index schema.
file-mismatchA listed file is missing, unreadable (a symlink, not a regular file), larger than declared, or its hash or size differs.
section-invalidA section is not canonical JSON, fails its section schema, or is a client/plan kind with no declared side.
script-sideA script runs on a side its declaration does not allow (SERVER-PARITY SS7).
script-admissionThe script admission rows the sections declare are invalid.
blob-invalidA blob's bytes contradict its listing: kind or extension, registered named JSON and its schema, or costs understated.
server-file-invalidA server file (J91) is unregistered named JSON or its bytes differ from its declared kind.
ktx2-costsThe declared KTX2 device costs differ from the verified bytes.
pack-invalidA pack is missing a member, or a member or the pack's hash differs.
cook-invalidThe cook file or a mount (path or bytes) is invalid (C0, J137).
preparation-invalidThe author's preparation is missing, stale or invalid: its inputHash, fence or programs mount (J487, SHARD-COMPAT PR3; docs/preparation.md).
runtime-filesCopied runtime files are present without a runtime import checker, or fail it.
unlisted-fileA file in the product is not listed in shard.json.
shard-schemaThe shardfile assembled from the sections fails the shardfile schema.
declared-costsThe declared costs fail preflight: a budget or memory admission over its limit.
performance-targetsA declared performance target over its limit refuses (the REFUSAL: lines).
asset-admissionAn asset's bytes fail admission: parse, hash or wire size, costs, bounds or script contract.
world-targetsworld/targets names an item or quest the shardfile does not declare.
source-hashThe sections differ from the declared build.sourceHash.
carried-ktx2A new upload carries its own KTX2 (a ktx2 blob or a .ktx2 file): a shardfile carries images only and the cook makes every KTX2 (J525).

stream

validateShardfileStream alone: error.code on the thrown Error.

CodeMeaning
stream-capA member, pack or the placed assets are over the streaming cap.
stream-missA check asked for bytes the stream did not hold (AC6a2).
stream-changedThe stored object changed between its reads.

performance

performanceReport and performanceTargetIssues: PerformanceIssue.code.

CodeMeaning
perf-memory-targetA resident memory target (tradeable) is over; always a warning.
perf-library-download-budgetThe declared library download budget is over the allowance.
perf-critical-download-budgetThe declared critical (sim) download budget is over its limit.
perf-library-downloadThe library closure's download bytes are over the allowance.
perf-critical-downloadThe critical closure's download bytes are over the limit.
perf-tile-downloadA tile's download bytes are over its LOD cap (provisional: a warning).
perf-tile-drawsThe fine tiles near a view draw more than a phone view's budget (VIEW_DRAWS; provisional: a warning).
perf-tile-trianglesA tile's triangles are over its LOD cap (provisional: a warning).
perf-far-downloadThe far view's download bytes are over the limit.
perf-far-drawsThe far view's draws are over the limit.
perf-far-trianglesThe far view's triangles are over the limit.
perf-native-view-unmeasuredNative view and download measurement is required and missing.
perf-native-resident-unmeasuredThe native runtime declares no measured resident cost.
perf-playing-memoryThe worst playing total bytes are over the limit (report-only under G433: a warning).
perf-loading-memoryThe worst loading total bytes are over the limit (report-only under G433: a warning).
perf-script-sample-invalidA measured script or fuel figure is not a finite, non-negative number.
perf-script-cpuScript CPU p95 per tick is over the limit.
perf-script-fuelScript fuel per tick is over the limit.
perf-script-samples-missingFewer than 60 measured script or fuel ticks.

audio

audioReport: AudioFinding.code; assertAudioAdmission: error.code on the thrown Error.

CodeMeaning
audio-unreadableA recording is not readable as AAC-LC 48 kHz mono or stereo (red).
audio-containerA recording's bytes are FLAC, AIFF, Ogg, MP3, WebM, CAF or no known container, not AAC in mp4 or WAV; they still count toward the budget (red).
audio-strict-indexA recording is AAC outside the strict playback index (amber).
audio-wavA recording is PCM WAV; ship AAC-LC 48 kHz (amber).
audio-sample-rateA recording is AAC at a sample rate other than 48 kHz (amber).
audio-durationA recording runs over the maximum seconds (red).
audio-bitrateA recording's bitrate is over its role and channel cap plus slack (amber).
audio-budget-amberThe shard's own audio bytes are over the amber line (amber).
audio-budget-redThe shard's own audio bytes are over the red line, with no waiver that holds (red).
audio-budget-waivedOver the red line, but a dated waiver holds (amber).
audio-waiver-invalidThe waiver names another shard, has expired, or covers fewer bytes (amber; the red budget finding follows).
audio-refusedassertAudioAdmission refuses a report with a red finding.