3.4 KiB
3.4 KiB
PR-22 Delete Asset Action Confirmation and Fs-First Manifest Removal
Domain Owner: docs/packer
Cross-Domain Impact: docs/studio
Briefing
The action capability contract introduced in PR-20 needs its next real delivery beyond REGISTER.
DELETE must remove the asset from packer control without deleting the asset directory or its remaining files. The operation is filesystem-first: delete asset.json, update index.json when needed, and then apply a point snapshot update in memory.
Studio must require explicit confirmation before calling this write path.
Objective
Deliver AssetAction.DELETE end to end with packer-owned capability resolution, Studio confirmation modal, filesystem-first manifest removal, and point runtime snapshot update.
Dependencies
./PR-20-asset-action-capabilities-and-register-first-delivery.md./PR-21-point-in-memory-snapshot-updates-after-write-commit.md
Scope
- extend the public action contract with
DELETE - expose
DELETEcapability from the packer for assets that currently ownasset.json - add a packer write path that deletes only
asset.json - remove any registered entry from
index.json - keep the asset directory and its non-manifest files on disk
- patch the loaded runtime snapshot in memory after successful delete
- add a Studio modal that requires typing the asset name before confirming deletion
Non-Goals
- no recursive directory deletion
- no deletion of companion files or arbitrary asset contents
- no frontend-local action capability rules
- no bulk delete
Execution Method
- Extend the action enum and packer API with
DELETEand its write message/response. - Add packer capability resolution for
DELETEbased onasset.jsonpresence, independent from declaration validity. - Implement
deleteAssetin the packer write lane. - Make the write path:
- resolve the asset
- delete
asset.json - remove the registry entry when the asset is registered
- keep the asset directory and any remaining files untouched
- patch the in-memory snapshot by removing the asset from runtime view
- Add a Studio confirmation modal that requires the user to type the asset name exactly.
- On success, let Studio refresh and clear the current selection.
Acceptance Criteria
DELETEis exposed through the packer action capability contract- Studio renders
DELETEonly from packer-provided capabilities - Studio requires asset-name confirmation before executing
DELETE DELETEremoves onlyasset.json- registered assets are also removed from
index.json - the asset directory and remaining files stay on disk
- the runtime snapshot is updated in memory without whole-project reload in the normal path
Validation
- packer tests for
DELETEcapability visibility - packer tests for deleting registered and unregistered assets
- packer tests proving directory contents remain on disk after delete
- Studio compile/test validation for the confirmation modal and action wiring
Affected Artifacts
prometeu-packer/prometeu-packer-api/src/main/java/p/packer/**prometeu-packer/prometeu-packer-v1/src/main/java/p/packer/**prometeu-packer/prometeu-packer-v1/src/test/java/p/packer/**prometeu-studio/src/main/java/p/studio/**prometeu-studio/src/main/resources/**