from afk_developer.scheduler.tools.shell import _is_allowed_verification_command def test_verification_command_allowlist_permits_required_quality_gates() -> None: assert _is_allowed_verification_command("git status --short") assert _is_allowed_verification_command("git diff --check") assert _is_allowed_verification_command("python -m pytest -q") assert _is_allowed_verification_command("python -m ruff check tools/project_xml") assert _is_allowed_verification_command("python -m ruff format --check tools/project_xml") def test_verification_command_allowlist_rejects_mutating_or_composite_commands() -> None: assert not _is_allowed_verification_command("git commit -m unsafe") assert not _is_allowed_verification_command("python -m ruff check --fix .") assert not _is_allowed_verification_command("python -m ruff format .") assert not _is_allowed_verification_command("git status; git commit -m unsafe") assert not _is_allowed_verification_command("Remove-Item important-file")