prometeu-studio/docs/packer/pull-requests/PR-30-pack-wizard-summary-snapshot-query.md
2026-03-24 13:42:55 +00:00

84 lines
3.6 KiB
Markdown

# PR-30 Pack Wizard Summary Snapshot Query
Domain Owner: `docs/packer`
Cross-Domain Impact: `docs/studio`
## Briefing
With the public contracts aligned, the next step is to actually produce the pack-wizard `summary` from the packer runtime snapshot.
This is intentionally narrower than full pack execution.
The goal is to expose a fast preflight summary of the active pack set so the Studio wizard can open on packer-owned state instead of local UI heuristics.
Reference decision:
- [`../decisions/Pack Wizard Summary and Validation Contracts Decision.md`](../decisions/Pack%20Wizard%20Summary%20and%20Validation%20Contracts%20Decision.md)
## Objective
Implement snapshot-backed `summary` for the pack wizard over the current `registered + included in build` set.
## Dependencies
- [`./PR-29-pack-wizard-contract-adjustments-for-summary-and-validation.md`](./PR-29-pack-wizard-contract-adjustments-for-summary-and-validation.md)
- [`./PR-15-snapshot-backed-asset-query-services.md`](./PR-15-snapshot-backed-asset-query-services.md)
- [`./PR-21-point-in-memory-snapshot-updates-after-write-commit.md`](./PR-21-point-in-memory-snapshot-updates-after-write-commit.md)
- cross-domain reference:
[`../../studio/pull-requests/PR-11-pack-wizard-shell-and-packer-contract-consumption.md`](../../studio/pull-requests/PR-11-pack-wizard-shell-and-packer-contract-consumption.md)
## Scope
- implement `getPackWorkspaceSummary(...)` in `prometeu-packer-v1`
- resolve the active pack set from the runtime snapshot:
`registered + included in build`
- produce the aggregate included asset count
- produce the per-asset summary list with:
- asset id
- asset name
- asset family
- min artifact count
- max artifact count
- `lastModified`
- allow `lastModified = 0` in the first wave where the real value is not yet available
- keep the query fast and snapshot-backed
## Non-Goals
- no validation logic in this PR
- no pack execution logic in this PR
- no emitted-artifact preview in summary
- no inclusion of unregistered or excluded assets as explicit summary items
## Execution Method
1. Resolve the active runtime snapshot for the requested project.
2. Filter the snapshot to the active pack set:
registered assets included in build.
3. Derive one aggregate count from that filtered set.
4. Map each included asset into the public per-asset summary DTO.
5. Populate `minArtifactCount` and `maxArtifactCount` from the best currently available packer-owned summary facts.
6. Populate `lastModified` from packer-owned runtime or filesystem facts when available, otherwise `0`.
7. Return the summary result without performing deep validation or artifact planning.
## Acceptance Criteria
- `getPackWorkspaceSummary(...)` returns successfully from snapshot-backed state
- the returned set contains only `registered + included in build` assets
- the aggregate count matches the per-asset list size
- per-asset summary entries expose the fields required by the accepted decision
- the operation behaves as a fast read query rather than a deep recomputation path
## Validation
- packer unit tests for pack-set filtering
- packer unit tests for summary DTO mapping
- regression tests proving excluded and unregistered assets do not appear as summary items
- Studio smoke validation proving the wizard summary can render from packer-owned data
## Affected Artifacts
- `prometeu-packer/prometeu-packer-v1/src/main/java/p/packer/services/**`
- `prometeu-packer/prometeu-packer-v1/src/main/java/p/packer/models/**`
- `prometeu-packer/prometeu-packer-v1/src/test/java/p/packer/services/**`
- `prometeu-studio/**` wizard summary consumer surfaces if compile adaptation is needed