BS-JD-502 - Tool regression tests and undo invariants #33

Closed
opened 2026-06-06 01:49:05 -04:00 by Rbanh · 3 comments
Owner

Summary

Add reusable tests for every modal tool and every editor operator.

Why

The roadmap depends on consistent preview/commit/cancel/undo behavior across all tools.

Implementation notes

  • Create shared test harness for operators/modal tools.
  • Cover commit, cancel, dirty flag, helper cleanup, and undo grouping.
  • Add fixtures for asset drops, brush strokes, terrain strokes, and physics settle sessions.
  • Make failures identify the invariant that broke.

Acceptance criteria

  • Every production modal tool has commit/cancel/undo coverage.
  • Helper entities are verified absent after cancel/commit as appropriate.
  • Undo grouping is tested for continuous actions.
  • Test harness is easy to reuse for new tools.

Tests/docs

This ticket is test infrastructure. Document how to add tool regression tests.

## Summary Add reusable tests for every modal tool and every editor operator. ## Why The roadmap depends on consistent preview/commit/cancel/undo behavior across all tools. ## Implementation notes - Create shared test harness for operators/modal tools. - Cover commit, cancel, dirty flag, helper cleanup, and undo grouping. - Add fixtures for asset drops, brush strokes, terrain strokes, and physics settle sessions. - Make failures identify the invariant that broke. ## Acceptance criteria - [ ] Every production modal tool has commit/cancel/undo coverage. - [ ] Helper entities are verified absent after cancel/commit as appropriate. - [ ] Undo grouping is tested for continuous actions. - [ ] Test harness is easy to reuse for new tools. ## Tests/docs This ticket is test infrastructure. Document how to add tool regression tests.
Rbanh added this to the M5 - Regression, docs, and first-hour UX milestone 2026-06-06 01:49:05 -04:00
Rbanh added the
roadmap:jackdaw
type:architecture
priority:P0
area:quality
labels 2026-06-06 01:49:05 -04:00
Author
Owner

Production-operator regression pass (2026-07-10):

Implemented reusable operators::test_harness::OperatorInvariantHarness with shared assertions for:

  • committed/canceled/blocked phase,
  • authored entity deltas,
  • dirty-state preservation/propagation,
  • exact undo-group deltas,
  • preview/helper cleanup,
  • full undo/redo state projections.

Current production coverage now includes:

  • generic operator success, commit failure rollback, and blocked no-op;
  • asset placement commit + spawn round trip;
  • missing sub-asset/material failure paths;
  • multi-actor texture assignment grouped into one undo command;
  • Draw Brush cancel reset and decomposed multi-brush grouped commit;
  • Brush CSG pending cancel and merge/delete grouped round trip;
  • brush clip grouped geometry round trip;
  • brush-element Escape rollback plus gizmo-helper despawn;
  • continuous multi-target transform finalization as one undo command.

The harness exposed and this pass fixed two real defects:

  1. texture/material assignment across multiple actors created multiple undo steps, and missing MaterialDesc could bypass history; this is now SetMaterialGroup.
  2. Escape during an active brush-element gizmo preview discarded the saved pre-edit brush without restoring it; cancellation now restores exact geometry before helper cleanup.

Documentation: docs/editor/operator-regression-testing.md, indexed from both documentation maps and architecture.

Validation: strict workspace Clippy clean, strict editor dev-feature Clippy clean, 135 tests passed / 1 intentional migration test ignored, cargo validate-levels, formatting, and diff checks clean.

Ticket remains open intentionally: terrain-stroke and physics-settle fixtures belong here when those roadmap tools are implemented; current production modal/editor operators are covered.

Production-operator regression pass (2026-07-10): Implemented reusable `operators::test_harness::OperatorInvariantHarness` with shared assertions for: - committed/canceled/blocked phase, - authored entity deltas, - dirty-state preservation/propagation, - exact undo-group deltas, - preview/helper cleanup, - full undo/redo state projections. Current production coverage now includes: - generic operator success, commit failure rollback, and blocked no-op; - asset placement commit + spawn round trip; - missing sub-asset/material failure paths; - multi-actor texture assignment grouped into one undo command; - Draw Brush cancel reset and decomposed multi-brush grouped commit; - Brush CSG pending cancel and merge/delete grouped round trip; - brush clip grouped geometry round trip; - brush-element Escape rollback plus gizmo-helper despawn; - continuous multi-target transform finalization as one undo command. The harness exposed and this pass fixed two real defects: 1. texture/material assignment across multiple actors created multiple undo steps, and missing `MaterialDesc` could bypass history; this is now `SetMaterialGroup`. 2. Escape during an active brush-element gizmo preview discarded the saved pre-edit brush without restoring it; cancellation now restores exact geometry before helper cleanup. Documentation: `docs/editor/operator-regression-testing.md`, indexed from both documentation maps and architecture. Validation: strict workspace Clippy clean, strict editor dev-feature Clippy clean, 135 tests passed / 1 intentional migration test ignored, `cargo validate-levels`, formatting, and diff checks clean. Ticket remains open intentionally: terrain-stroke and physics-settle fixtures belong here when those roadmap tools are implemented; current production modal/editor operators are covered.
Author
Owner

Implemented and published on main in commit 1ab3886.

Acceptance completed:

  • Typed command dispatch preserves modal Preview ownership while immediate commands terminate normally.
  • Stable operator IDs/phases now cover commit, block, cancel, failure, no-op, and interruption paths.
  • Group Selection and lighting changes are atomic history transactions; group redo preserves unrelated parents and sibling order across repeated cycles.
  • Asset assignment, exact material drops, brush/CSG, terrain sculpt/paint, physics placement, and transform finalizers now exercise production entry points with rollback/helper/undo invariants.
  • Read-only CSG, missing transform targets, clean-view terrain interruption, and zero-delta terrain/physics/transform exits are explicitly covered.

Verification on the publication worktree:

  • cargo test --workspace --all-targets --no-fail-fast passed; editor library: 245 passed, 0 failed.
  • cargo clippy --workspace --all-targets -- -D warnings passed.
  • cargo fmt --all -- --check and git diff --check passed.
  • cargo validate-levels --project .: 62 dependencies, 5 expected non-blocking findings, 0 blocking errors.

Evidence: operator invariant evaluation and testing contract.

Packaged tests remain deferred by project-owner request. A supplementary native editor smoke was attempted, but the Codex desktop approval broker rejected the GUI launch because its reviewer was at capacity; no project runtime failure was observed. Release-candidate G3 remains Partial until the exact candidate is rerun from a clean checkout.

Implemented and published on `main` in commit `1ab3886`. Acceptance completed: - Typed command dispatch preserves modal Preview ownership while immediate commands terminate normally. - Stable operator IDs/phases now cover commit, block, cancel, failure, no-op, and interruption paths. - Group Selection and lighting changes are atomic history transactions; group redo preserves unrelated parents and sibling order across repeated cycles. - Asset assignment, exact material drops, brush/CSG, terrain sculpt/paint, physics placement, and transform finalizers now exercise production entry points with rollback/helper/undo invariants. - Read-only CSG, missing transform targets, clean-view terrain interruption, and zero-delta terrain/physics/transform exits are explicitly covered. Verification on the publication worktree: - `cargo test --workspace --all-targets --no-fail-fast` passed; editor library: 245 passed, 0 failed. - `cargo clippy --workspace --all-targets -- -D warnings` passed. - `cargo fmt --all -- --check` and `git diff --check` passed. - `cargo validate-levels --project .`: 62 dependencies, 5 expected non-blocking findings, 0 blocking errors. Evidence: [operator invariant evaluation](https://git.spacetrainclubhouse.com/Falling-Metal-Interactive/Blacksite/src/commit/1ab3886/docs/editor/evaluations/operator-invariants/README.md) and [testing contract](https://git.spacetrainclubhouse.com/Falling-Metal-Interactive/Blacksite/src/commit/1ab3886/docs/editor/operator-regression-testing.md). Packaged tests remain deferred by project-owner request. A supplementary native editor smoke was attempted, but the Codex desktop approval broker rejected the GUI launch because its reviewer was at capacity; no project runtime failure was observed. Release-candidate G3 remains Partial until the exact candidate is rerun from a clean checkout.
Rbanh added reference main 2026-07-12 23:55:42 -04:00
Rbanh closed this issue 2026-07-12 23:55:44 -04:00
Author
Owner

Native-editor follow-up completed on main at c55f347.

Live replay on the rebuilt Linux editor:

  • Loaded assets/levels/collider_diagnostics_showcase.scn.ron; viewport rendered nonblank with the dark editor chrome, hierarchy, inspector, and asset browser correctly framed.
  • Ctrl+P -> Draw Brush entered Preview; Esc terminated as Canceled with no history entry.
  • Selected two hierarchy actors; Group Selection committed exactly one history item; undo restored the original rows and redo restored the transient Group and children.
  • The replay exposed an empty command-palette title bar after dispatch and a Bevy B0004 inherited-visibility warning on the new Group's icon child. Both were fixed, covered by focused regression assertions, rebuilt, and replayed.
  • Corrected replay fully dismissed the palette and emitted no hierarchy/operator/render panic or warning. The QA-created recovery generation was discarded through File > Discard Recovery Snapshot.

Verification on the follow-up commit:

  • cargo test --workspace --all-targets --no-fail-fast (editor library: 246 passed, 0 failed)
  • cargo clippy --workspace --all-targets -- -D warnings
  • cargo fmt --all -- --check
  • cargo validate-levels --project . (62 dependencies, 5 expected non-blocking findings, 0 blocking)
  • git diff --check

Packaged-runtime tests remain intentionally deferred by project-owner request.

Native-editor follow-up completed on `main` at `c55f347`. Live replay on the rebuilt Linux editor: - Loaded `assets/levels/collider_diagnostics_showcase.scn.ron`; viewport rendered nonblank with the dark editor chrome, hierarchy, inspector, and asset browser correctly framed. - `Ctrl+P` -> `Draw Brush` entered Preview; `Esc` terminated as Canceled with no history entry. - Selected two hierarchy actors; `Group Selection` committed exactly one history item; undo restored the original rows and redo restored the transient Group and children. - The replay exposed an empty command-palette title bar after dispatch and a Bevy B0004 inherited-visibility warning on the new Group's icon child. Both were fixed, covered by focused regression assertions, rebuilt, and replayed. - Corrected replay fully dismissed the palette and emitted no hierarchy/operator/render panic or warning. The QA-created recovery generation was discarded through File > Discard Recovery Snapshot. Verification on the follow-up commit: - `cargo test --workspace --all-targets --no-fail-fast` (editor library: 246 passed, 0 failed) - `cargo clippy --workspace --all-targets -- -D warnings` - `cargo fmt --all -- --check` - `cargo validate-levels --project .` (62 dependencies, 5 expected non-blocking findings, 0 blocking) - `git diff --check` Packaged-runtime tests remain intentionally deferred by project-owner request.
Sign in to join this conversation.
No project
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: Falling-Metal-Interactive/Blacksite#33
No description provided.