4.0 KiB
Pack Wizard: Summary, Validation, and Pack Execution
Original Problem
The Studio-side wizard was already accepted as a shell over packer-owned operations, but the packer side still needed one coherent story for:
- what
summarymeans; - what
validationmeans; - how
packWorkspace(...)executes without trusting stale UI state or live filesystem rereads.
The historical agenda, decisions, and PRs solved this in slices. This document keeps the final model in one place.
Consolidated Decision
The first-wave Pack Wizard contract is phase-based and fully packer-owned:
summaryis a fast snapshot-backed preflight view;validationis a snapshot-backed gate over the same active pack set;packWorkspace(...)is the only artifact-emitting wizard operation;- execution reruns the gate on a fresh frozen snapshot;
- outputs are staged before promotion into final
build/locations.
The active pack set is always:
registered + included in build
Final Model
1. Summary
summary is not a build preview.
It is a quick packer-owned view of the current active pack set.
First-wave payload:
- total included asset count;
- one per-asset list with:
assetIdassetNameassetFamilyminArtifactCountmaxArtifactCountlastModified
2. Validation
validation evaluates the same pack set as summary, but its job is to answer a different question:
Can packing begin?
First-wave rule:
- only
blockingdiagnostics fail validation; - warnings are visible elsewhere, but they are not part of the first validation gate contract.
Primary payload:
- one per-asset list containing only assets with blocking diagnostics.
3. Pack Execution
packWorkspace(...) is a write-lane operation.
It does not trust that earlier summary or validation responses are still current.
The first-wave execution path is:
- create a fresh execution snapshot;
- rerun the gate on that snapshot;
- materialize outputs from frozen in-memory inputs;
- write to
build/.staging/<operation-id>/; - promote to final
build/outputs only after coherent success.
4. Result Semantics
The final result must distinguish:
- gate failure before emission;
- execution/materialization failure;
- persistence/promotion failure;
- successful publication.
Studio should be able to render Packing and Result from packer-owned outcome semantics alone.
Examples
Example: Why green validation is not enough
Validation may have been green a few seconds earlier. If the workspace changes before pack execution begins, the packer still must rerun the gate on a fresh frozen snapshot.
That protects the operation from:
- stale UI assumptions;
- filesystem drift;
- accidental emission from no-longer-valid inputs.
Example: Why summary excludes unregistered assets
The wizard is a pack-set workflow, not a generic workspace inspection screen. Unregistered or excluded assets may matter to other tooling, but they are not explicit summary items in the first-wave wizard contract.
Common Pitfalls and Anti-Patterns
- Treating
summaryas if it were an emitted-artifact preview. - Running validation over a broader set than
registered + included in build. - Letting non-blocking warnings fail the first-wave validation gate.
- Reading live filesystem bytes after frozen execution materialization has started.
- Publishing final
build/outputs before the operation has reached a coherent success point.