tests/gateway/test_status.py::TestGatewayPidState::test_write_pid_file_records_gateway_metadata tests/gateway/test_status.py::TestGatewayPidState::test_write_pid_file_is_atomic_against_concurrent_writers tests/gateway/test_status.py::TestGatewayPidState::test_get_running_pid_rejects_live_non_gateway_pid tests/gateway/test_status.py::TestGatewayPidState::test_get_running_pid_cleans_stale_record_from_dead_process tests/gateway/test_status.py::TestGatewayPidState::test_get_running_pid_accepts_gateway_metadata_when_cmdline_unavailable tests/gateway/test_status.py::TestGatewayPidState::test_get_running_pid_accepts_script_style_gateway_cmdline tests/gateway/test_status.py::TestGatewayPidState::test_get_running_pid_accepts_explicit_pid_path_without_cleanup tests/gateway/test_status.py::TestGatewayPidState::test_runtime_lock_claims_and_releases_liveness tests/gateway/test_status.py::TestGatewayPidState::test_get_running_pid_treats_pid_file_as_stale_without_runtime_lock tests/gateway/test_status.py::TestGatewayPidState::test_get_running_pid_cleans_stale_metadata_from_dead_foreign_pid tests/gateway/test_status.py::TestGatewayPidState::test_get_running_pid_falls_back_to_live_lock_record tests/gateway/test_status.py::TestGatewayRuntimeStatus::test_write_json_file_uses_atomic_json_write tests/gateway/test_status.py::TestGatewayRuntimeStatus::test_write_runtime_status_overwrites_stale_pid_on_restart tests/gateway/test_status.py::TestGatewayRuntimeStatus::test_write_runtime_status_overwrites_stale_argv_on_restart tests/gateway/test_status.py::TestGatewayRuntimeStatus::test_write_runtime_status_records_platform_failure tests/gateway/test_status.py::TestGatewayRuntimeStatus::test_write_runtime_status_explicit_none_clears_stale_fields tests/gateway/test_status.py::TestTerminatePid::test_force_uses_taskkill_on_windows tests/gateway/test_status.py::TestTerminatePid::test_force_falls_back_to_sigterm_when_taskkill_missing tests/gateway/test_status.py::TestScopedLocks::test_windows_file_lock_uses_high_offset tests/gateway/test_status.py::TestScopedLocks::test_acquire_scoped_lock_rejects_live_other_process tests/gateway/test_status.py::TestScopedLocks::test_acquire_scoped_lock_replaces_pid_reused_by_unrelated_process tests/gateway/test_status.py::TestScopedLocks::test_acquire_scoped_lock_keeps_lock_when_cmdline_unreadable_but_record_is_gateway tests/gateway/test_status.py::TestScopedLocks::test_acquire_scoped_lock_keeps_lock_when_pid_reused_by_gateway tests/gateway/test_status.py::TestScopedLocks::test_acquire_scoped_lock_replaces_stale_record tests/gateway/test_status.py::TestScopedLocks::test_acquire_scoped_lock_recovers_empty_lock_file tests/gateway/test_status.py::TestScopedLocks::test_acquire_scoped_lock_recovers_corrupt_lock_file tests/gateway/test_status.py::TestScopedLocks::test_release_scoped_lock_only_removes_current_owner tests/gateway/test_status.py::TestScopedLocks::test_release_all_scoped_locks_can_target_single_owner tests/gateway/test_status.py::TestScopedLocks::test_release_all_scoped_locks_skips_pid_reuse_mismatch tests/gateway/test_status.py::TestScopedLocks::test_acquire_scoped_lock_replaces_reused_pid_even_with_matching_start_time tests/gateway/test_status.py::TestTakeoverMarker::test_write_marker_records_target_identity tests/gateway/test_status.py::TestTakeoverMarker::test_consume_returns_true_when_marker_names_self tests/gateway/test_status.py::TestTakeoverMarker::test_consume_returns_false_for_different_pid tests/gateway/test_status.py::TestTakeoverMarker::test_consume_returns_false_on_start_time_mismatch tests/gateway/test_status.py::TestTakeoverMarker::test_consume_returns_true_on_windows_when_start_time_unavailable tests/gateway/test_status.py::TestTakeoverMarker::test_consume_returns_false_when_marker_missing tests/gateway/test_status.py::TestTakeoverMarker::test_consume_returns_false_for_stale_marker tests/gateway/test_status.py::TestTakeoverMarker::test_consume_handles_malformed_marker_gracefully tests/gateway/test_status.py::TestTakeoverMarker::test_consume_handles_marker_with_missing_fields tests/gateway/test_status.py::TestTakeoverMarker::test_clear_takeover_marker_is_idempotent tests/gateway/test_status.py::TestTakeoverMarker::test_write_marker_returns_false_on_write_failure tests/gateway/test_status.py::TestTakeoverMarker::test_consume_ignores_marker_for_different_process_and_prevents_stale_grief tests/gateway/test_status.py::TestPlannedStopMarker::test_write_marker_records_target_identity tests/gateway/test_status.py::TestPlannedStopMarker::test_consume_returns_true_when_marker_names_self tests/gateway/test_status.py::TestPlannedStopMarker::test_consume_returns_false_for_different_pid tests/gateway/test_status.py::TestPlannedStopMarker::test_consume_returns_false_for_stale_marker tests/gateway/test_status.py::TestPlannedStopMarker::test_clear_planned_stop_marker_is_idempotent tests/gateway/test_status.py::TestPlannedStopMarker::test_write_marker_returns_false_on_write_failure tests/gateway/test_status.py::TestPlannedStopMarker::test_consume_returns_true_on_windows_when_start_time_unavailable tests/gateway/test_status.py::TestPlannedStopMarker::test_consume_still_rejects_foreign_pid_when_start_time_unavailable tests/gateway/test_status.py::TestPlannedStopMarker::test_consume_still_rejects_start_time_mismatch_when_both_known tests/gateway/test_status.py::TestReadProcessCmdlinePsFallback::test_ps_fallback_when_proc_unavailable tests/gateway/test_status.py::TestReadProcessCmdlinePsFallback::test_ps_fallback_returns_none_on_failure tests/gateway/test_status.py::TestReadProcessCmdlinePsFallback::test_proc_cmdline_takes_priority_over_ps tests/gateway/test_status.py::TestReadProcessCmdlinePsFallback::test_ps_fallback_used_when_proc_returns_empty tests/gateway/test_status.py::TestCorruptStatusFiles::test_read_json_file_returns_none_on_binary_garbage tests/gateway/test_status.py::TestCorruptStatusFiles::test_read_json_file_still_parses_valid_json tests/gateway/test_status.py::TestCorruptStatusFiles::test_read_pid_record_returns_none_on_binary_garbage tests/gateway/test_status.py::TestCorruptStatusFiles::test_read_pid_record_still_parses_bare_pid