Files
ARCADIA-Studio/harness/scenario-group-removal-policy-20260925.md
T

24 lines
4.2 KiB
Markdown

# Scenario group removal policy
This implements the local Scenario part of [the multiple-selection contract](multiselect-contract-20260923.md) for issue 29. It is a development policy, not a claim of runtime or release acceptance.
## Meaning and admission
Remove the complete captured selection of local Scenario participants and occurrences in one reviewed operation. Eligible local bodies are Lifeline, Exchange, Action, State, ScenarioUse, Fragment and Branch. Each original target must be a unique, existing `ScenarioObject`, belong to the active Scenario, and be reachable through its actual sequence/branch structure (a participant must be a direct child). The App additionally checks actual rendered visibility, representation and visit, document revision, selection generation, membership and primary. A foreign, hidden, stale or unsupported member refuses the whole operation. No filtering to the primary object or to eligible members is permitted.
Unlike semantic reorder, removal can span parents and mix local participants with occurrences: its single meaning is removal from this Scenario. A Fragment and one of its selected descendants are both admitted and shown as selected; only then may the descendant be covered by the Fragment's cascade for execution. Reusable definitions, represented engineering elements and opposite-layer counterparts are preserved under the existing deletion contract. Existing validator errors are not weakened; incomplete warning-only authoring remains governed by the core validator.
## Aggregate impact and transaction
Construct one atomic `Batch(Delete(root)...)` after collapsing selected owned descendants into selected ancestors. Evaluate the final candidate using the existing core command engine and derive the review from its actual result. The review distinguishes original selected removals, additional cascade removals, and surviving records that change. Examples of changes include cleared participant/call references, pruned ScenarioUse bindings, updated parent steps/branches, and pruned saved layout rows. Search and bounded pages expose the full affected set, including identical display names distinguished by aliases.
Rejected alternatives: multiple Document transactions can partially remove a group and create several Undo entries; blindly batching every selected ID fails when an ancestor already removed a descendant; adding singleton impact counts can double-count overlaps and omit changed survivors. The selected set remains exact even when execution roots are normalized.
Opening the review captures a fresh context after retiring the old canvas epoch. It does not apply pending text or property drafts. Confirmation carries the review token; stale confirmation/cancel packets must not affect a newer review. Context, exact selection and pending-edit eligibility are checked again before applying the one command. Cancel, refusal and source-write failure preserve model, source, history, selection and primary. Successful removal returns inspection to the Scenario and clears the removed selection; selection itself is transient and is not restored by model Undo. One Undo/Redo restores the complete model and exact source bytes.
## Interaction and verification
Group Delete/Shift+Delete, the contextual group action and the explicit Remove control capture the complete selection. Legacy singleton removal and bare unbound Delete remain refused while a group is shown. Context-menu invocation must preserve the group's primary even when invoked on an unselected object. Removal cannot start while a group pointer gesture, reorder chooser, spacing operation, pending editor or another modal owns input. Enter in the search field does not confirm destruction.
Required discriminators include mixed participant/message references; Fragment plus selected descendant; cross-parent steps; preserved reused definitions and unrelated views; actual impact identity rather than count alone; full-set stale/secondary-membership ABA; menu selection preservation; stale confirm/cancel versus a newer modal; exact source and one-step history; Cancel/refusal preserving Redo; and compact native search/paging, confirmation, save/reopen and keyboard entry. Tests and native evidence must name their actual source revision. Linux verification remains user-paused.