4.9 KiB
Bank Composition Details DTO Projection Decision
Status: Decided
Cycle: 2026-03
Domain Owner: docs/studio
Cross-Domain Impact: docs/packer
Context
The Bank Composition section inside Asset Details needs a stable UI-facing data shape before component, middleware, and persistence work can proceed.
The source information comes from two distinct places:
- runtime snapshot state derived from
walkResult, which should feedavailablefiles; - persisted
asset.jsoncomposition state, which should feedselectedfiles.
The Studio should not bind section UI directly to snapshot internals or raw manifest structures. This needs a Studio-owned DTO projection boundary.
This decision closes the DTO direction discussed in:
Decision
Adopt one dedicated Studio-owned DTO family for Bank Composition details data.
The first-wave projection rules are:
- snapshot rows derived from
walkResultbecomeavailablerows in the Studio DTO layer; - persisted composition rows from
asset.jsonbecomeselectedrows in the Studio DTO layer; - both flows must be projected into Studio DTOs before reaching
Asset DetailsUI code; - the DTO family must be generic enough to support any bank type, even if family-specific fields are added later;
- the DTO field set must stay intentionally small and grow only when concrete UI behavior requires it.
The first DTO revision starts with these fields:
fileId/pathdisplayNamesizelastModifiedfingerprintmetadata
Availability and ordering rules are:
- only non-blocking files become
availableDTO rows; - blocking files must not be projected into the
Bank CompositionDTO layer; - UI ordering is visual in the selected list;
- persisted ordering in
asset.jsonshould use an explicit index representation such as{ file, index }.
Justification
This direction keeps the Studio UI decoupled from packer/runtime internal shapes while still using runtime data as the source of truth.
One shared DTO family is the pragmatic middle ground:
- lighter than separate
availableandselectedrow models; - safer than direct binding to snapshot and manifest structures;
- easier to reuse across section shell, transfer list, meter, and staged editing middleware.
Filtering blocking files before DTO projection also keeps the section contract simpler.
The UI should receive only rows that are actually eligible to appear as available.
Persisted order needs an explicit index in asset.json because list order is not a robust persistence contract by itself.
Implications
The Studio details layer now owns a DTO projection step for Bank Composition.
This means:
- component work should consume Studio DTOs, not packer snapshot rows directly;
- middleware work should operate on DTO-based staged state;
- persistence work must translate selected DTO order into indexed
asset.jsonentries; - packer-facing details fetches must expose enough source data to populate the DTO fields above.
Explicit Non-Decisions
This decision does not yet define:
- the exact Java classes or package layout for the DTOs;
- the section middleware/controller contract;
- the
workspaceBusevent contract; - the concrete
asset.jsonartifactsschema beyond the need for explicit indexed order; - family-specific explanatory copy for tile versus sound exhaustion.
Propagation Targets
- Studio agendas:
Agenda-02-Asset-Bank-Composition-Base-Components.mdAgenda-03-Asset-Bank-Composition-Section-Shell.mdAgenda-04-Asset-Bank-Composition-Middleware-and-Staged-Editing.mdAgenda-05-Asset-Bank-Composition-WorkspaceBus-Interaction.mdAgenda-06-Asset-Bank-Composition-Persistence-and-Snapshot-Propagation.md - Studio specs:
4. Assets Workspace Specification.md - Studio code:
Asset Detailsdetails fetch, DTO projection layer, andBank Compositionsection inputs - Packer code and docs:
details payload shaping and future
asset.jsonpersistence under theartifactscomposition path
Validation Notes
Examples implied by this decision:
- a file with blocking diagnostics does not produce an
availableDTO row at all; - a selected file may appear in the UI with visual order
3, while persistence writes something like{ file: "...", index: 3 }; - adding new UI needs later should extend the DTO deliberately instead of pulling snapshot internals straight into the section.