claude-dev-env 8.31.1 → 8.32.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (32) hide show
  1. package/.agents/skills/pull-request/SKILL.md +4 -3
  2. package/.agents/skills/pull-request/reference/publication-tasks.md +1 -1
  3. package/.agents/skills/pull-request/scripts/pull_request.py +5 -2
  4. package/.agents/skills/pull-request/scripts/test_pull_request.py +32 -0
  5. package/bin/codex-skill-load-block.mjs +87 -34
  6. package/bin/codex-skill-load-block.test.mjs +112 -4
  7. package/bin/install.mjs +23 -9
  8. package/bin/install.question-presentation.test.mjs +2 -2
  9. package/bin/install.test.mjs +105 -0
  10. package/bin/seed-codex-pstack-models.mjs +2 -2
  11. package/bin/seed-codex-pstack-models.test.mjs +52 -1
  12. package/commands/fix-followups.md +3 -3
  13. package/commands/sr-loop.md +4 -3
  14. package/hooks/advisory/test_pr_done_reminder.py +2 -1
  15. package/hooks/blocking/block_main_commit.py +2 -10
  16. package/hooks/blocking/test_block_main_commit.py +13 -0
  17. package/hooks/hooks_constants/block_main_commit_constants.py +9 -0
  18. package/hooks/hooks_constants/pr_done_reminder_constants.py +1 -1
  19. package/hooks/pyproject.toml +0 -1
  20. package/hooks/validators/README.md +0 -1
  21. package/hooks/validators/health_check.py +0 -1
  22. package/hooks/validators/run_all_validators.py +0 -13
  23. package/hooks/validators/test_run_all_validators.py +5 -36
  24. package/package.json +1 -1
  25. package/rules/agent-merges-its-own-green-pull-request.md +1 -1
  26. package/rules/flag-non-breaking-findings.md +1 -1
  27. package/rules/git-workflow.md +2 -7
  28. package/rules/review-closure-is-a-check.md +1 -1
  29. package/scripts/dev_env_scripts_constants/followup_constants.py +1 -1
  30. package/scripts/test_followup_cli.py +2 -1
  31. package/hooks/validators/git_checks.py +0 -110
  32. package/hooks/validators/test_git_checks.py +0 -112
@@ -1,112 +0,0 @@
1
- """Tests for git and GitHub validation checks."""
2
-
3
- import subprocess
4
- from unittest.mock import MagicMock, patch
5
-
6
- import pytest
7
-
8
- from .git_checks import (
9
- Violation,
10
- check_draft_pr_state,
11
- main,
12
- )
13
-
14
-
15
- class TestDraftPrState:
16
- """Test that PR is in draft state when pushing review fixes."""
17
-
18
- @patch("validators.git_checks.subprocess.run")
19
- def test_no_pr_returns_empty(self, mock_run: MagicMock) -> None:
20
- """When no PR exists, check should return empty list."""
21
- mock_run.return_value = MagicMock(returncode=0, stdout="[]", stderr="")
22
-
23
- violations = check_draft_pr_state()
24
-
25
- assert violations == []
26
-
27
- @patch("validators.git_checks.subprocess.run")
28
- def test_draft_pr_passes(self, mock_run: MagicMock) -> None:
29
- """Draft PR should pass."""
30
- mock_run.return_value = MagicMock(
31
- returncode=0,
32
- stdout='[{"number": 123, "isDraft": true}]',
33
- stderr=""
34
- )
35
-
36
- violations = check_draft_pr_state()
37
-
38
- assert violations == []
39
-
40
- @patch("validators.git_checks.subprocess.run")
41
- def test_non_draft_pr_fails(self, mock_run: MagicMock) -> None:
42
- """Non-draft PR should fail."""
43
- mock_run.return_value = MagicMock(
44
- returncode=0,
45
- stdout='[{"number": 123, "isDraft": false}]',
46
- stderr=""
47
- )
48
-
49
- violations = check_draft_pr_state()
50
-
51
- assert len(violations) == 1
52
- assert violations[0].file == ""
53
- assert violations[0].line == 0
54
- assert "draft" in violations[0].message.lower()
55
- assert "gh pr ready --undo" in violations[0].message
56
-
57
- @patch("validators.git_checks.subprocess.run")
58
- def test_gh_cli_not_available_returns_empty(self, mock_run: MagicMock) -> None:
59
- """When gh CLI not available, should return empty (warning, not failure)."""
60
- mock_run.side_effect = FileNotFoundError("gh not found")
61
-
62
- violations = check_draft_pr_state()
63
-
64
- assert violations == []
65
-
66
- @patch("validators.git_checks.subprocess.run")
67
- def test_gh_timeout_returns_empty(self, mock_run: MagicMock) -> None:
68
- """When gh CLI times out, should return empty (warning, not failure)."""
69
- mock_run.side_effect = subprocess.TimeoutExpired(cmd=["gh", "pr", "list"], timeout=30)
70
-
71
- violations = check_draft_pr_state()
72
-
73
- assert violations == []
74
-
75
-
76
- class TestMain:
77
- """Test main function integration."""
78
-
79
- @patch("validators.git_checks.check_draft_pr_state")
80
- def test_main_no_violations_exits_zero(
81
- self,
82
- mock_draft: MagicMock,
83
- capsys,
84
- ) -> None:
85
- """main() should exit 0 when no violations found."""
86
- mock_draft.return_value = []
87
-
88
- with pytest.raises(SystemExit) as exc_info:
89
- main()
90
-
91
- assert exc_info.value.code == 0
92
- captured = capsys.readouterr()
93
- assert captured.out == ""
94
-
95
- @patch("validators.git_checks.check_draft_pr_state")
96
- def test_main_prints_violations_without_file_line(
97
- self,
98
- mock_draft: MagicMock,
99
- capsys,
100
- ) -> None:
101
- """main() should print git violations without file:line: prefix."""
102
- mock_draft.return_value = [
103
- Violation(file="", line=0, message="PR must be in draft state")
104
- ]
105
-
106
- with pytest.raises(SystemExit) as exc_info:
107
- main()
108
-
109
- assert exc_info.value.code == 1
110
- captured = capsys.readouterr()
111
- assert captured.out == "PR must be in draft state\n"
112
- assert ":0:" not in captured.out