3.7 KiB
Build Artifacts and Deterministic Packing Agenda
Status
Open
Purpose
Close the contract for packer build outputs and the determinism rules that make them reproducible.
Context
The draft proposes two core build artifacts:
build/assets.pabuild/asset_table.json
At least one of these artifacts must form a documented interface that ../runtime can consume safely.
That runtime-facing contract should be specified before the implementation hardens around incidental file structure.
It also states strong determinism requirements:
- deterministic asset order,
- deterministic derived outputs,
- explicit materialization of inferred defaults.
This is a strong basis for normative packer output specs.
Source Sections
8. Build Artifacts Produced by the Packer9. Determinism Rules
Runtime Normative Inputs
From ../runtime/docs/runtime/specs/13-cartridge.md:
assets.pais the runtime-facing artifact;assets.pav1 is an autocontained binary with:- fixed binary prelude,
- JSON header,
- binary payload region;
- the fixed prelude contains, at minimum:
magic,schema_version,header_len,payload_offset;
- the JSON header carries:
asset_table,preload.
From ../runtime/docs/runtime/specs/15-asset-management.md:
asset_tableentries currently expose:asset_id,asset_name,bank_type,offset,size,decoded_size,codec,metadata;
offsetis relative to the payload region insideassets.pa, not to the start of the full file;preloadis boot-time input only;- runtime loading is based on
open_sliceover payload slices; - the runtime must not require the entire payload to stay resident in RAM.
These are already normative runtime-facing requirements and should be treated as baseline constraints for packer output design.
Key Questions
- How should the packer spec mirror the already normative
assets.pav1 envelope from runtime specs 13 and 15? - Which fields in
asset_table.jsonare still tooling-only if the runtime-facing contract lives primarily insideassets.pa? - Is asset order always
asset_idorder, or can format-specific constraints override it? - How should alignment be expressed and validated?
- What exactly counts as determinism for virtual asset pipelines?
- Which inferred values must be written back versus only emitted in build outputs?
- Which packer-side metadata is intentionally excluded from the runtime-facing contract?
- How should packer document
preloadlifecycle andoffsetsemantics so they match runtime reader behavior?
Options
Option A
Keep assets.pa simple and push structure into asset_table.json.
Option B
Embed more self-description into assets.pa itself.
Tradeoffs
- Option A keeps runtime payload compact and keeps metadata easier to evolve.
- Option A matches the current draft direction and reduces double-modeling.
- Option B may help standalone introspection, but it risks splitting authority across two artifacts.
Recommendation
Adopt Option A and make asset_table.json the authoritative descriptor for ROM slice structure.
Expected Decisions to Produce
- v1 artifact boundary and ownership.
- Deterministic ordering and alignment rules.
- Descriptor schema responsibilities.
- Materialization requirements for inferred values.
- Runtime-facing artifact contract and reader expectations.
- Packer-side restatement of the runtime-owned
assets.paenvelope and slice semantics.
Expected Spec Follow-up
- Packed ROM artifact spec.
- Asset table descriptor spec.
- Determinism and reproducibility spec.
- Runtime consumption interface spec.
Non-Goals
- Asset workspace mutation commands.
- Quarantine behavior.
- Builder packaging flow.