Files
ARCADIA-Studio/harness/saved-group-removal-foundation-20260925.md
T

6.0 KiB

Saved Architecture and State removal planner foundation

Branch-specific work for issue 29. Source checkpoint: 7750ecd7510ae39e4170f37e4aa7e101cf392f66. The operation policy and docs/language.rst section 8.1 define the required behavior. This checkpoint implements the pure planner under cfg(test) only. It does not enable a new application action or establish native, integrated, or release acceptance.

Implemented behavior

diagram::group_removal::prepare admits every exact visible typed target before normalization. Placements resolve to elements; ports retain their exact owner placement identity; State rows resolve to maintained relations rather than work; stored edges may be relations or traces. Empty, duplicate, stale, hidden, foreign, unsupported and saved Scenario selections refuse as a whole. Existing same-element placement uniqueness is preserved.

The planner deterministically reduces overlapping core deletion cascades to one Batch, with final validation rather than separate singleton transactions. It returns unique semantic subjects, actual removed identities and changed surviving records, including embedded placements. Final invariants require all selected subjects removed and no newly created identities. It changes neither the input Project nor the core cascade rules.

Twelve regressions cover success and refusal; successful plans are checked against independently edited complete Projects and exact impact sets. They cover OA/SA hierarchy and incident connections across views, exact ports and anchor pruning, visible/folded State rows, machine-owned diagrams and embedded placements, traces preserving counterparts, changed semantic references, whole-set refusal, and conditional allocation overlap. A fixed-low-ID interface deletion runs before its selected boundary exchange; the singleton is invalid while the complete batch is valid. This directly protects final-only validation.

Decisions and review

Plain group Delete retains placement-only Hide semantics; explicit model deletion is a distinct operation. Semantic normalization uses original core impact coverage only to choose commands; actual candidate differences determine the impact report. Ancestry-only normalization would miss incident/dependency overlap. Immediate scratch cleanup is unnecessary and differs from the core's deferred exchange-allocation cleanup.

Independent semantic critique corrected a proposed alternative-support test: single actual performers, unique port allocations and distinct boundary owners exclude simultaneous direct/reverse mappings in a valid model. Tests preserve those constraints, exercise valid overlapping deferred cascades and reject the invalid fixture. No union-only allocation-cascade test is claimed.

A fresh source reviewer traced projection visibility, core cascade and batch validation, checked independent expected models, and found no unresolved concrete planner defect. Review found and resolved exact duplicate-target admission, and added missing owned-diagram, hidden-row and invalid-singleton coverage. Source review alone does not establish test or UI acceptance. See the semantic critique and final independent source/evidence review.

Verification

Windows GNU/LLVM Rust/Cargo 1.98.1; CARGO_BUILD_JOBS=1, CARGO_INCREMENTAL=0. Commands for this bounded foundation:

cargo test -p oa-desktop --message-format=json -- diagram::group_removal --test-threads=1
cargo fmt --all -- --check
cargo clippy -p oa-desktop --all-targets --message-format=json -- -D warnings

All three captured commands passed at the source checkpoint above: 12 tests passed, 0 failed, 0 ignored, 1656 filtered out; format and strict desktop all-target Clippy passed. Tests took 0.06 seconds after compilation; the captured test command took 152.27 seconds. No full desktop-suite claim is made.

Each closed run retained the same 835 inputs, verified against the exact Git inventory and blob bytes. Input-map SHA256: 5f2f069fc1bf15f08405c1d4ed9b1cb97f1cb7ec4288b051823f12fba9f287d9. The portable records and verifier contain all three attempts, raw logs, source capsules, source proofs and helper provenance. No failed Cargo attempt occurred for this checkpoint. Run the included verify.py with Python 3.11+ to check offline consistency; it does not execute archived source or prove application usability. Executables are omitted and their pins retained. Parent and independent package verification passed; the independent byte audit also matched all 27 logical original files to the 23 stored ZIP members and checked the exact inventories. The reviewer inspected closed test, format and Clippy records; execution remains attributed to the parent.

Evidence ZIP: 3,316,155 bytes, SHA256 e5fa031725af84cee29ebd9a9337570f4c8de43aa1e9ce708d77ceff28fa8154.

Remaining application acceptance

The next adapter must retain exact document/revision/view/selection/primary and input lifetime. Ordinary and State canvases currently keep private pointer state; queued Begin/Confirm during drag, pan, route or port editing must be rejected before any state change. Existing Process input leases provide a pattern, not proof of saved-view correctness.

Deleting an underlying exchange can alter Process occurrences and reused definitions. Review must disclose changed owner records and derived caller effects; unchanged caller records do not prove unchanged interpretation.

The explicit group control/menu/Shift+Delete route, aggregate review, stale and draft refusal, one atomic Document source transaction, failure preservation, safe surviving context, exact Undo/Redo/save/reopen, and compact native review remain required. Existing singleton operations and placement Hide are unchanged by this test-only module. No new GUI build or Linux verification is claimed.