Part IV — Expert Production Engineering · Chapter 23 · Lesson 3 of 6 · 2 min read
Lesson 3: Building and Inspecting Artifacts
Lesson level: Expert
Purpose: Build and inspection steps provide reproducible artifact evidence. They do not demonstrate a full browser runtime.
Learning Objectives
- Use the verified command or SDK surface.
- Separate artifact validity from runtime availability.
- Record trust checks and safe failure behavior.
3.1 Concepts
Use the CLI to compile a trusted .pea source into the container and inspect its manifest. The documented forms are pea wasm-build input.pea output.wasm and pea wasm-inspect output.wasm. Inspect records the format and policy, not successful execution. The CLI wasm-inspect prints the manifest; the Python inspect_wasm function additionally returns embedded PEAC. Capture compiler version, source digest, and the artifact identity alongside these reports.
3.2 Annotated Example
Run pea check rules.pea, pea wasm-build rules.pea rules.wasm, and pea wasm-inspect rules.wasm. Annotation: these commands create and inspect a packaging artifact. For engine behavior, run the same source through the interpreter and VM separately. Preserve source identity consistently when comparing artifact bytes; timestamps and source paths in related formats can affect reproducibility.
3.3 Guided Practice
Identify what evidence each command produces. Distinguish a parsing failure, an invalid container header, missing custom sections, and a compatible container without executable exports.
3.4 Common Mistakes
Do not repair an artifact by editing arbitrary bytes, overwrite approved output before verification, or use an inspection-only PASS as an execution gate.
3.5 Hands-On Lab
- Create a harmless exported rules fixture and retain expected interpreter behavior.
- Build and inspect its artifact in an isolated workspace.
- Use disposable copies to test an invalid header and a missing required section.
- Record exact observed errors, hashes, and the scope of each successful check.
Deliverable: Tested integration, artifact identities, support states, and safe error evidence.
3.6 Review Questions
What does the CLI inspector print? What additional content does the Python inspector expose? Why is a packaging test separate from an execution test?
3.7 Applied Challenge
Automate an artifact admission report containing version, source identity, manifest, permitted capabilities, byte-size bound, and actual executable export evidence.
Lesson Summary
Build and inspection steps provide reproducible artifact evidence. They do not demonstrate a full browser runtime.
Lesson status: Draft complete; ready for review. Source-checked, not browser-execution validated.