prometeu-studio/.discussion/lessons/DSC-0003-packer-docs-import/LSN-0011-foundations-workspace-runtime-and-build-legacy.md

47 lines
2.1 KiB
Markdown

---
id: LSN-0011
ticket: packer-docs-import
title: Foundations workspace runtime and build legacy lesson
created: 2026-03-26
tags:
- packer
- legacy-import
- foundations
- deterministic-build
---
## Context
Legacy import from `docs/packer/learn/foundations-workspace-runtime-and-build.md`.
This lesson preserves the stable foundation for workspace control, runtime snapshots, writes, and deterministic build output.
## Key Decisions
### The stable foundation is filesystem-first authoring plus coherent snapshot-backed runtime and deterministic build
**What:** The packer keeps the workspace open and filesystem-first, anchors managed identity in registry and asset declarations, serves reads through coherent runtime snapshots, coordinates writes through packer-owned lanes, and emits deterministic build outputs from validated state.
**Why:** The original implementation wave spread this knowledge across many PR slices, which stopped being a good onboarding surface. The stable model needed one didactic consolidation.
**Trade-offs:** This architecture demands stronger ownership of snapshots, write coordination, and deterministic ordering, but it prevents UI heuristics, traversal order, or cache state from silently becoming semantic authority.
## Patterns and Algorithms
- Keep `asset_id` stable and separate from `asset_name`.
- Treat `asset.json` as authoring intent rather than registry bookkeeping.
- Read from coherent runtime snapshots.
- Serialize commit-bearing writes through one project-scoped semantic lane.
- Order build outputs deterministically by managed identity.
## Pitfalls
- Treating `asset_name` as stable runtime identity.
- Moving registry-owned fields into `asset.json`.
- Depending on traversal order or UI order for build layout.
- Treating cache state as semantic authority.
## Takeaways
- The packer foundation is as much about ownership and determinism as it is about file formats.
- Filesystem durability, snapshot coherence, and deterministic emission must stay aligned.
- Legacy source attribution: `docs/packer/learn/foundations-workspace-runtime-and-build.md`.