# PR-10f Bank Composition Apply Through Packer and Snapshot Refresh

Domain owner: `docs/studio`
Cross-domain impact: `docs/packer`

## Briefing

Close the write path for `Bank Composition` by routing `apply` through the packer service and rebinding the section from refreshed persisted state.

This is the slice where the section stops being draft-only and becomes a real persisted editor.

## Objective

After this PR:

- clicking `apply` sends the selected ordered files to packer;
- packer owns validation, manifest persistence, and minimal runtime snapshot refresh;
- `asset.json` persistence flows through `artifacts`, not `inputsByRole`;
- successful apply rebinds the section from refreshed persisted state;
- failed apply preserves the draft and keeps the section in editing mode.

## Dependencies

- [`../decisions/Bank Composition Persistence and Snapshot Propagation Decision.md`](../decisions/Bank%20Composition%20Persistence%20and%20Snapshot%20Propagation%20Decision.md)
- [`./PR-10d-bank-composition-family-policies-and-section-coordinator.md`](./PR-10d-bank-composition-family-policies-and-section-coordinator.md)
- [`./PR-10e-bank-composition-workspacebus-events-and-local-orchestration.md`](./PR-10e-bank-composition-workspacebus-events-and-local-orchestration.md)
- cross-domain dependency: packer-side message, persistence, and snapshot-refresh support for bank-composition apply

## Scope

- route section `apply` through the packer service boundary
- send selected ordered files from Studio to packer
- persist selection through `asset.json` `artifacts`
- refresh minimal runtime/details state after successful apply
- rebind the section from refreshed persisted state
- preserve draft state on apply failure
- surface local failure state plus `BankCompositionApplyFailed`

## Non-Goals

- no direct `asset.json` writes from Studio
- no fallback write path through legacy `inputsByRole`
- no broader manifest migration outside this flow

## Execution Method

1. Define the Studio-to-packer apply request path for bank composition.
2. Integrate section `apply` with the packer service.
3. Update the Studio side to await success/failure and rebind accordingly.
4. Land the paired packer-side persistence and minimal snapshot refresh support.
5. Add regression tests for success and failure behavior.

## Acceptance Criteria

- Studio does not write `asset.json` directly for bank composition
- `apply` is executed by packer
- selected ordered files are persisted through `artifacts`
- after success, the section leaves edit mode and reloads from refreshed persisted state
- after failure, the section stays in edit mode and the draft is preserved
- apply lifecycle notifications reflect the actual result of the packer call

## Validation

- Studio unit tests for apply success rebinding
- Studio unit tests for apply failure preserving draft state
- packer tests for `artifacts` persistence and minimal snapshot refresh
- UI smoke validation for apply, success, and failure flows

## Affected Artifacts

- `prometeu-studio/src/main/java/p/studio/workspaces/assets/details/...`
- `prometeu-studio/src/main/java/p/studio/projects/...`
- `prometeu-studio/src/main/java/p/studio/events/...`
- `prometeu-packer/src/main/java/p/packer/...`
- `asset.json` persistence handling under the packer write path
- Studio and packer tests for bank-composition apply
