2.3 KiB
2.3 KiB
PR-07 Build Plan, Determinism, and Cache-Key Foundation
Domain Owner: docs/packer
Briefing
Implement the deterministic planning layer that normalizes validated assets into a stable build plan before artifact emission.
This PR is the boundary between workspace semantics and runtime-facing artifact production.
Objective
Deliver a deterministic build planner, canonical header model, preload derivation, and cache-key foundation that later emission and incremental work can trust.
Dependencies
./PR-06-doctor-diagnostics-and-safe-fix-baseline.md../specs/4. Build Artifacts and Deterministic Packing Specification.md../specs/5. Diagnostics, Operations, and Studio Integration Specification.md
Scope
- validate build-eligible managed assets
- derive deterministic asset ordering by increasing
asset_id - build canonical header-side models for:
asset_tablepreload
- define payload planning slots and offset planning inputs
- compute cache keys from validated effective inputs
- emit deterministic in-memory build plans before writing files
Non-Goals
- no final
assets.pafile emission yet - no watch mode yet
- no format-family semantic expansion beyond what current specs already define
Execution Method
- Normalize validated managed assets into a stable build plan representation.
- Implement canonical JSON serialization rules for header mirrors and planner assertions.
- Compute cache keys only from validated effective inputs.
- Add deterministic tests proving equivalent workspaces produce equivalent plans.
Acceptance Criteria
- equivalent inputs produce equivalent build plans
- asset ordering is independent from filesystem traversal order
- preload derivation matches declaration state deterministically
- cache-key inputs are explicit and reproducible
Validation
- determinism tests with reordered filesystem fixtures
- canonical-header serialization tests
- cache-key stability tests
Affected Artifacts
prometeu-packer/**- build planning fixtures
- future dependency for
buildservice and event lane