Part IV — Expert Production Engineering · Chapter 26 · Lesson 4 of 6 · 2 min read
Lesson 4: Secure Package and Reproducible Build
Lesson level: Expert
Purpose: A secure build binds reviewed inputs to deterministic artifacts without confusing metadata, trust, and installed execution support.
Learning Objectives
- Implement the stage with verified data or package APIs.
- Separate source evidence from live operational claims.
- Produce reproducible fixtures and artifact identities.
4.1 Concepts
Package the PeaLang application with pea.toml, a deterministic lock record, and reviewed permissions. Keep the application package version separate from the PeaLang wheel version. The shipped package Version parser accepts numeric major.minor.patch strings, not arbitrary pre-release suffixes. The simple install path copies local dependencies; Git/registry entries there become remote-source metadata placeholders rather than fetched, executable packages. Use the appropriate separately verified registry workflow where needed.
4.2 Annotated Example
Verified local workflow: pea pkg-init project, pea lock project, pea audit project, and pea build project. The source package builder normalizes archive timestamps and ownership and sorts files, but packaging exclusions are not a secret scanner. Review the archive inventory before signing. Use Ed25519 package verification with approved public trust; do not distribute private keys with the package.
4.3 Guided Practice
Distinguish manifest checks, lock identity, archive determinism, secret exclusion, signature verification, and trusted installation. Explain why a clean simple audit is not a complete security audit.
4.4 Common Mistakes
Do not put 0.63.0rc2 into an application version field requiring a numeric triple, include secrets in archives, or call a remote metadata placeholder an installed provider.
4.5 Hands-On Lab
- Build a local package from a synthetic project with a numeric application version.
- Review every archive member and exclude credentials, private keys, test secrets, and unintended artifacts.
- Repeat the controlled build and compare digests.
- Sign and verify with disposable keys, then demonstrate tamper rejection before admission.
Deliverable: Implementation, fixtures, verified identities, and evidence distinguishing supported behavior from open gaps.
4.6 Review Questions
How do application and runtime versions differ? What does simple remote installation create? Why must the archive inventory be reviewed before signing?
4.7 Applied Challenge
Create a reproducible build record tying source, lock, wheel, application archive, public-key trust, inventory review, and actual test reports together.
Lesson Summary
A secure build binds reviewed inputs to deterministic artifacts without confusing metadata, trust, and installed execution support.
Lesson status: Draft complete; ready for review.