"""Actual auxiliary-permission, controller and transport regressions.""" from pathlib import Path import os import shutil import subprocess import pytest ROOT = Path(__file__).resolve().parents[1] CASES = [ "default_closed_keeps_all_automatic_plates_hidden", "default_closed_blocks_direct_and_legacy_plate_in", "default_closed_preserves_data_preview_main_and_foreign", "default_closed_native_transport_keeps_clock_commands", "feature_on_waits_for_saved_flag_without_reseeding", "feature_off_hides_owned_layers_preserves_main_and_clocks", "feature_off_does_not_remove_foreign_owner", "feature_rearm_keeps_original_five_second_deadline", "feature_old_mapping_cannot_replay_after_off_on", "feature_off_error_stays_closed_and_retryable", "feature_on_error_never_shows_plate", "feature_selection_change_cannot_apply_old_permission", "feature_rapid_on_off_does_not_apply_old_on", "feature_viewer_and_text_focus_do_not_toggle_f2", "feature_inactive_configured_penalty_target_is_still_guarded", "feature_new_game_does_not_inherit_old_armed_control", "feature_bad_auxiliary_candidate_cannot_block_main", "feature_queued_mixed_off_keeps_native_and_main", "feature_off_on_waits_for_physical_out_before_rearm", "feature_remote_off_hides_owned_without_another_flag_write", "feature_off_does_not_render_full_runtime_before_dispatch", "feature_action_queued_while_closed_cannot_replay_after_external_on", "feature_failed_pending_out_keeps_rearm_closed", "feature_reacquire_before_space_prepares_stopped_clock", "feature_f1_then_f2_same_native_input_is_shown_once", "feature_persisted_on_reacquire_prepares_without_flag_write", "feature_initial_armed_control_event_prepares_before_in", "feature_live_native_caption_updates_without_rein_and_fences_context", "feature_native_ack_during_caption_mapping_cannot_duplicate_in", ] @pytest.mark.parametrize("case", CASES) def test_auxiliary_gate(case): node = shutil.which("node") assert node, "Node is required" runtime_root = Path(os.environ.get("BUILD199_RUNTIME_ROOT", ROOT)) result = subprocess.run( [node, str(ROOT / "tests/build199_aux_gate.cjs"), case, str(runtime_root)], cwd=ROOT, capture_output=True, text=True, timeout=25, ) assert result.returncode == 0, result.stdout + result.stderr assert f"PASS BUILD199 auxiliary: {case}" in result.stdout, result.stdout + result.stderr