| | |
| | | root = report.get("rootView", {}) |
| | | columns = root.get("waterfallColumns", []) |
| | | cards = [card for column in columns for card in column.get("cards", [])] |
| | | target_column = next((column for column in columns if column.get("appGroupIndex") == target_app_index), None) |
| | | all_window_ids = sorted(int(card.get("windowID")) for card in cards) |
| | | committed_window_id = root.get("lastCommittedWindowID") |
| | | require(isinstance(committed_window_id, int), "commit must report a committed window ID") |
| | | target_window_id = int(committed_window_id) |
| | | |
| | | require(report.get("snapshotLoaded") is True, "snapshotLoaded must be true") |
| | | require(report.get("appCount") == fixture_app_count, "fixture appCount must match") |
| | | require(report.get("windowCount") == fixture_app_count * fixture_windows_per_app, "fixture windowCount must match") |
| | | require(report.get("appCount") == fixture_app_count, "multi-window fixture must keep target App visible after suppressing one window") |
| | | require(report.get("windowCount") == fixture_app_count * fixture_windows_per_app - 1, "commit run must suppress the activated target window from visible cards") |
| | | require(root.get("waterfallViewMode") == expected_mode, "commit run must use horizontal Waterfall") |
| | | require(root.get("keyboardCommandsApplied") == expected_sequence, "commit key sequence must be applied") |
| | | require(root.get("appShelfIndexKeyDownCount") == 2, "commit must exercise two physical keyDown events") |
| | |
| | | require(root.get("windowIndexKeyPendingAppSymbol") is None, "commit must clear legacy pending App symbol") |
| | | require(root.get("lastCommitSource") == "keyboard", "valid shortcut commit must be keyboard sourced") |
| | | |
| | | require(target_column is not None, "target App column must exist") |
| | | target_cards = target_column.get("cards", []) |
| | | require(target_window_index < len(target_cards), "target window index must exist") |
| | | target_card = target_cards[target_window_index] |
| | | target_window_id = int(target_card.get("windowID")) |
| | | all_window_ids = sorted(int(card.get("windowID")) for card in cards) |
| | | dimmed_ids = sorted(window_id for window_id in all_window_ids if window_id != target_window_id) |
| | | |
| | | require(target_card.get("windowShortcutCode") == target_code, "target card shortcut code must match committed code") |
| | | require(root.get("lastCommittedAppGroupIndex") == target_app_index, "commit must target expected App") |
| | | require(root.get("lastCommittedWindowIndex") == target_window_index, "commit must target expected window index") |
| | | require(root.get("lastCommittedWindowID") == target_window_id, "commit must target expected window ID") |
| | | require(root.get("selectedAppGroupIndex") == target_app_index, "selection must land on target App") |
| | | require(root.get("selectedWindowIndex") == target_window_index, "selection must land on target window") |
| | | require(root.get("selectedWindowID") == target_window_id, "selectedWindowID must match target window") |
| | | require(report.get("suppressedActivationWindowIDs") == [target_window_id], "commit must suppress the activated target window") |
| | | require(report.get("suppressedActivationWindowCount") == 1, "commit must report one suppressed activation window") |
| | | require(target_window_id not in all_window_ids, "committed target window must not remain in visible cards after activation") |
| | | |
| | | snapshot = root.get("lastWindowShortcutPreCommitFilterSnapshot") |
| | | require(isinstance(snapshot, dict), "pre-commit filter snapshot must be an object") |
| | | require(snapshot.get("phase") == "targetPreCommit", "pre-commit snapshot phase must be targetPreCommit") |
| | | require(snapshot.get("targetCode") == target_code, "pre-commit snapshot targetCode must match committed shortcut") |
| | | require(int(snapshot.get("targetWindowID")) == target_window_id, "pre-commit snapshot targetWindowID must match target card") |
| | | require(int(snapshot.get("targetWindowID")) == target_window_id, "pre-commit snapshot targetWindowID must match committed window") |
| | | require(sorted_ints(snapshot.get("matchedWindowIDs")) == [target_window_id], "pre-commit snapshot must match only the target window") |
| | | require(sorted_ints(snapshot.get("dimmedWindowIDs")) == dimmed_ids, "pre-commit snapshot must dim all non-target Waterfall windows") |
| | | |
| | | states = target_card.get("visualStates", []) |
| | | opacity = target_card.get("windowShortcutFilterOpacity") |
| | | require(target_card.get("windowShortcutFilterState") == "target", "target card must report target filter state") |
| | | require(is_number(opacity), "target card must expose numeric filter opacity") |
| | | require(0 <= opacity <= 1.01, "target card opacity must be normalized") |
| | | require("shortcutTarget" in states, "target card must expose shortcutTarget visual state") |
| | | require(sorted_ints(snapshot.get("dimmedWindowIDs")) == all_window_ids, "pre-commit snapshot must dim all non-target visible Waterfall windows") |
| | | require(root.get("windowShortcutFilterActive") is True, "commit must preserve target pre-commit filter state for QA evidence") |
| | | require(root.get("windowShortcutFilterPhase") == "targetPreCommit", "commit must preserve target pre-commit filter phase") |
| | | require(root.get("windowShortcutFilterPrefix") == target_code, "commit filter prefix must match target code") |
| | | require(sorted_ints(root.get("windowShortcutFilterMatchedWindowIDs")) == [target_window_id], "commit filter must keep target as matched evidence") |
| | | require(sorted_ints(root.get("windowShortcutFilterDimmedWindowIDs")) == all_window_ids, "commit filter must dim all non-target visible windows") |
| | | require(root.get("windowShortcutFilterMatchedCount") == 1, "commit filter must report one matched window") |
| | | require(root.get("windowShortcutFilterDimmedCount") == len(all_window_ids), "commit filter dimmed count must match visible non-target windows") |
| | | |
| | | for card in cards: |
| | | if int(card.get("windowID")) == target_window_id: |
| | | continue |
| | | card_states = card.get("visualStates", []) |
| | | card_opacity = card.get("windowShortcutFilterOpacity") |
| | | require(card.get("windowShortcutFilterState") == "dimmed", "non-target cards must remain dimmed in target pre-commit state") |
| | | require(card.get("windowShortcutFilterState") == "dimmed", "visible non-target cards must remain dimmed in target pre-commit state") |
| | | require(is_number(card_opacity), "non-target cards must expose numeric filter opacity") |
| | | require("shortcutDimmed" in card_states, "non-target cards must expose shortcutDimmed in target pre-commit state") |
| | | require(0 <= float(card_opacity) <= 1.01, "non-target card opacity must be normalized") |
| | | require("shortcutDimmed" in card_states, "visible non-target cards must expose shortcutDimmed in target pre-commit state") |
| | | require("shortcutTarget" not in card_states, "non-target cards must not expose shortcutTarget") |
| | | |
| | | for node in root.get("appShelfItems", []) + root.get("spaceLaneSegments", []): |
| | |
| | | "dimmedCount": len(snapshot.get("dimmedWindowIDs", [])), |
| | | "lastCommitSource": root.get("lastCommitSource"), |
| | | "lastWindowIndexKeyCommitCode": root.get("lastWindowIndexKeyCommitCode"), |
| | | "targetCardState": target_card.get("windowShortcutFilterState"), |
| | | "suppressedActivationWindowIDs": report.get("suppressedActivationWindowIDs"), |
| | | } |
| | | with open(summary_file, "w", encoding="utf-8") as file: |
| | | json.dump(summary, file, indent=2, ensure_ascii=False) |
| | |
| | | root = report.get("rootView", {}) |
| | | columns = root.get("waterfallColumns", []) |
| | | cards = [card for column in columns for card in column.get("cards", [])] |
| | | target_column = next((column for column in columns if column.get("appGroupIndex") == target_app_index), None) |
| | | all_window_ids = sorted(int(card.get("windowID")) for card in cards) |
| | | committed_window_id = root.get("lastCommittedWindowID") |
| | | require(isinstance(committed_window_id, int), "direct commit must report a committed window ID") |
| | | target_window_id = int(committed_window_id) |
| | | |
| | | require(report.get("snapshotLoaded") is True, "snapshotLoaded must be true") |
| | | require(report.get("appCount") == fixture_app_count, "fixture appCount must match") |
| | | require(report.get("windowCount") == fixture_app_count, "single-window fixture must have one window per App") |
| | | require(report.get("appCount") == fixture_app_count - 1, "single-window fixture must hide the committed target App after activation") |
| | | require(report.get("windowCount") == fixture_app_count - 1, "single-window fixture must hide the committed target window after activation") |
| | | require(root.get("waterfallViewMode") == expected_mode, "single-window run must use horizontal Waterfall") |
| | | require(root.get("keyboardCommandsApplied") == expected_sequence, "single-window key sequence must direct-commit") |
| | | require(root.get("appShelfIndexKeyDownCount") == 1, "single-window direct commit must use one physical keyDown") |
| | |
| | | require(root.get("windowShortcutFilterDimmedCount") == 0, "single-window direct commit must not leave dimmed filter count") |
| | | require(root.get("lastWindowShortcutPreCommitFilterSnapshot") is None, "single-window direct commit must not expose two-key pre-commit snapshot") |
| | | |
| | | require(target_column is not None, "target App column must exist") |
| | | target_cards = target_column.get("cards", []) |
| | | require(len(target_cards) == 1, "target App must have exactly one visible window") |
| | | target_card = target_cards[0] |
| | | target_window_id = int(target_card.get("windowID")) |
| | | require(root.get("lastCommittedAppGroupIndex") == target_app_index, "direct commit must target expected App") |
| | | require(root.get("lastCommittedWindowIndex") == 0, "direct commit must target the only window") |
| | | require(root.get("lastCommittedWindowID") == target_window_id, "direct commit must target expected window ID") |
| | | require(root.get("selectedAppGroupIndex") == target_app_index, "selection must land on target App") |
| | | require(root.get("selectedWindowIndex") == 0, "selection must land on the only window") |
| | | require(root.get("selectedWindowID") == target_window_id, "selectedWindowID must match target window") |
| | | require(report.get("suppressedActivationWindowIDs") == [target_window_id], "direct commit must suppress the activated target window") |
| | | require(report.get("suppressedActivationWindowCount") == 1, "direct commit must report one suppressed activation window") |
| | | require(target_window_id not in all_window_ids, "direct-committed target window must not remain in visible cards after activation") |
| | | require(target_app_index not in [column.get("appGroupIndex") for column in columns], "single-window target App must not remain visible after activation") |
| | | |
| | | for card in cards: |
| | | opacity = card.get("windowShortcutFilterOpacity") |
| | |
| | | "targetWindowID": target_window_id, |
| | | "lastCommitSource": root.get("lastCommitSource"), |
| | | "lastWindowIndexKeyCommitCode": root.get("lastWindowIndexKeyCommitCode"), |
| | | "suppressedActivationWindowIDs": report.get("suppressedActivationWindowIDs"), |
| | | "cardCount": len(cards) |
| | | } |
| | | with open(summary_file, "w", encoding="utf-8") as file: |