"""Executable production-browser regressions with deterministic API/Agent I/O.""" from pathlib import Path import os import shutil import subprocess import pytest ROOT = Path(__file__).resolve().parents[1] CASES = [ "explicit_text_ack_before_in", "failed_text_never_shows_title", "unconfirmed_text_never_shows_title", "text_timeout_has_no_automatic_replay", "partial_mapping_blocks_preview", "unconfirmed_mapping_blocks_data_title", "zero_text_coverage_blocks_data_title", "legacy_preview_refreshes_mapping", "urgent_out_bypasses_held_mapping", "quick_button_out_bypasses_outer_title_queue", "same_busy_button_repeat_cancels_pending_in", "repeat_shortcut_out_cancels_pending_in_and_preserves_new_busy", "late_out_ack_preserves_new_foreign_owner", "late_out_snapshot_preserves_other_layer", "failed_setter_step_blocks_same_input_only", "urgent_countdown_order", "urgent_native_bypasses_held_mapping", "stale_context_during_text_ack", "stale_text_ack_device", "stale_text_ack_session", "stale_text_ack_account", "stale_text_ack_rights", "trace_correlates_mapping_and_command", "shared_team_plate_waits_for_mapping", "team_title_requires_actual_text_coverage", "shared_team_flag_change_during_mapping", "linked_out_before_main", "out_only_scoreboard_skips_in_lifecycle", "linked_out_keeps_foreign_owner", "linked_out_cancels_delayed_in", "penalty_two_paths_use_same_delay", "penalty_conditional_delay_applies_to_native", "penalty_delay_does_not_leak_to_other_input", "disabled_penalty_delay_is_ignored", "false_penalty_condition_delay_is_ignored", "penalty_after_old_scoreboard_does_not_wait_again", "selected_penalty_context_then_mapping_then_preview", "selected_penalty_context_fifo_preserves_each_title", "selected_penalty_missing_sql_never_previews", ] @pytest.mark.parametrize("case", CASES) def test_presentation(case): node = shutil.which("node") assert node, "Node is required for executable browser regressions" runtime_root = Path(os.environ.get("BUILD198_RUNTIME_ROOT", ROOT)) result = subprocess.run( [node, str(ROOT / "tests/build198_presentation.cjs"), case, str(runtime_root)], cwd=ROOT, text=True, capture_output=True, timeout=20, ) assert result.returncode == 0, result.stdout + result.stderr assert f"PASS BUILD198 presentation: {case}" in result.stdout, result.stdout + result.stderr