prometeu-studio/docs/packer/pull-requests/PR-07-build-plan-determinism-and-cache-key-foundation.md
2026-03-24 13:42:41 +00:00

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

Scope

  • validate build-eligible managed assets
  • derive deterministic asset ordering by increasing asset_id
  • build canonical header-side models for:
    • asset_table
    • preload
  • 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.pa file emission yet
  • no watch mode yet
  • no format-family semantic expansion beyond what current specs already define

Execution Method

  1. Normalize validated managed assets into a stable build plan representation.
  2. Implement canonical JSON serialization rules for header mirrors and planner assertions.
  3. Compute cache keys only from validated effective inputs.
  4. 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 build service and event lane