Workflow-replay harness (display == export == replay) + set-zero frame fix#31
Merged
Conversation
…set-zero frames New tests/test_workflow_replay.py drives the real ImageViewerDialog through multi-step workflows the way a user performs them (STM background, panel filters, quick-selection commits across flips, frozen ROI scopes surviving rotate_arbitrary's live-ROI removal, mains streak pairs with background fill, inverse-FFT selections, threshold/scale/quantize chains, arithmetic, navigation, undo/redo, channel switches, and a kitchen-sink chain) and asserts after each step that the displayed array equals the export array and that the canonical ProcessingState recorded on the export — after a JSON round trip, exactly what a .probeflow.json sidecar stores — replays bit-for-bit from the raw plane, with consistent physical extents. All 17 workflow combinations passed on the first run: the season's seam fixes compose. One intent-level bug found while building the harness (the invariant cannot see it because display and replay are consistently wrong together): the set-zero-plane pick mapped click fractions onto the RAW array's frame, so with a flip or rotation in the pipeline the plane anchored at the mirrored / wrong feature — while the markers, drawn from the same fractions, showed the clicked spots. Same family as the scope-ordering bug, same fix mechanism: picks now map into the displayed frame and stamp the geometric-op count (set_zero_after_geometric_ops, preserved across panel applies); the adapter interleaves stamped set-zero steps at that pipeline position. Unstamped legacy states keep their historical order byte-for-byte. The positioned-steps machinery is hoisted above the set-zero blocks; behaviour for every other step is unchanged. TestSetZeroIntent pins the user-level contract (the 3x3 patch means at the clicked display points are zero after flips and after arbitrary rotation) and was verified to fail with the fix stashed. Co-Authored-By: Claude Fable 5 <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The integration pass suggested after the module reviews: a harness that drives the real
ImageViewerDialogthrough multi-step user workflows and enforces, after every step:Result: all 17 workflow combinations passed on the first run — the season's seam fixes (scope ordering, frozen geometry, mains params, calibration threading) compose correctly end-to-end. The harness is now permanent regression coverage: any future feature that breaks WYSIWYG-replay fails CI.
One intent-level bug found (and fixed)
Building the harness exposed a class the invariant cannot see — display and replay consistently wrong together. The set-zero-plane pick mapped click fractions onto the raw array's frame: with a flip/rotation in the pipeline, the zero plane anchored at the mirrored/wrong feature while the markers (same fractions) showed the clicked spots. Same family as the scope-ordering bug, fixed with the same mechanism: picks map into the displayed frame and stamp
set_zero_after_geometric_ops; the adapter interleaves stamped set-zero steps at that position. Legacy states replay byte-identically.TestSetZeroIntentpins the user-level contract (3×3 patch means at the clicked display points are zero, after flips and after arbitrary rotation) — verified to fail with the fix stashed.Test plan
tests/test_workflow_replay.py(registered as a GUI module), 3 ordering pins intest_processing_scope_seams.py.🤖 Generated with Claude Code