implements PR-022
This commit is contained in:
+77
@@ -0,0 +1,77 @@
|
||||
# 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-20-asset-action-capabilities-and-register-first-delivery.md)
|
||||
- [`./PR-21-point-in-memory-snapshot-updates-after-write-commit.md`](./PR-21-point-in-memory-snapshot-updates-after-write-commit.md)
|
||||
|
||||
## Scope
|
||||
|
||||
- extend the public action contract with `DELETE`
|
||||
- expose `DELETE` capability from the packer for assets that currently own `asset.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
|
||||
|
||||
1. Extend the action enum and packer API with `DELETE` and its write message/response.
|
||||
2. Add packer capability resolution for `DELETE` based on `asset.json` presence, independent from declaration validity.
|
||||
3. Implement `deleteAsset` in the packer write lane.
|
||||
4. 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
|
||||
5. Add a Studio confirmation modal that requires the user to type the asset name exactly.
|
||||
6. On success, let Studio refresh and clear the current selection.
|
||||
|
||||
## Acceptance Criteria
|
||||
|
||||
- `DELETE` is exposed through the packer action capability contract
|
||||
- Studio renders `DELETE` only from packer-provided capabilities
|
||||
- Studio requires asset-name confirmation before executing `DELETE`
|
||||
- `DELETE` removes only `asset.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 `DELETE` capability 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/**`
|
||||
@@ -81,6 +81,7 @@ The current production track for the standalone `prometeu-packer` project is:
|
||||
19. [`PR-19-api-surface-audit-model-separation-and-public-read-dtos.md`](./PR-19-api-surface-audit-model-separation-and-public-read-dtos.md)
|
||||
20. [`PR-20-asset-action-capabilities-and-register-first-delivery.md`](./PR-20-asset-action-capabilities-and-register-first-delivery.md)
|
||||
21. [`PR-21-point-in-memory-snapshot-updates-after-write-commit.md`](./PR-21-point-in-memory-snapshot-updates-after-write-commit.md)
|
||||
22. [`PR-22-delete-asset-action-confirmation-and-fs-first-manifest-removal.md`](./PR-22-delete-asset-action-confirmation-and-fs-first-manifest-removal.md)
|
||||
|
||||
Current wave discipline from `PR-11` onward:
|
||||
|
||||
@@ -91,4 +92,4 @@ Current wave discipline from `PR-11` onward:
|
||||
|
||||
Recommended dependency chain:
|
||||
|
||||
`PR-01 -> PR-02 -> PR-03 -> PR-04 -> PR-05 -> PR-06 -> PR-07 -> PR-08 -> PR-09 -> PR-10 -> PR-11 -> PR-12 -> PR-13 -> PR-14 -> PR-15 -> PR-16 -> PR-17 -> PR-18 -> PR-19 -> PR-20 -> PR-21`
|
||||
`PR-01 -> PR-02 -> PR-03 -> PR-04 -> PR-05 -> PR-06 -> PR-07 -> PR-08 -> PR-09 -> PR-10 -> PR-11 -> PR-12 -> PR-13 -> PR-14 -> PR-15 -> PR-16 -> PR-17 -> PR-18 -> PR-19 -> PR-20 -> PR-21 -> PR-22`
|
||||
|
||||
Reference in New Issue
Block a user