claude-dev-env 8.71.1 → 8.72.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.
- package/.agents/skills/build-eval/SKILL.md +3 -0
- package/bin/install.mjs +1 -0
- package/bin/install.test.mjs +1 -0
- package/hooks/blocking/bash_pre_tool_use_dispatcher.py +9 -1
- package/hooks/blocking/headless_claude_broker_gate.py +14 -1
- package/hooks/blocking/test_bash_dispatcher_interpreter_starts.py +2 -0
- package/hooks/blocking/test_bash_pre_tool_use_dispatcher.py +46 -0
- package/hooks/blocking/test_headless_claude_broker_gate.py +12 -0
- package/hooks/blocking/test_pre_tool_use_dispatcher.py +1 -3
- package/hooks/conftest.py +18 -0
- package/hooks/features/session-context.md +1 -3
- package/hooks/features/write-edit-blocking.md +3 -6
- package/hooks/hooks.json +0 -5
- package/hooks/hooks_constants/bash_pre_tool_use_dispatcher_constants.py +8 -0
- package/hooks/hooks_constants/headless_claude_broker_gate_constants.py +7 -1
- package/hooks/hooks_constants/mod_handoff.py +91 -0
- package/hooks/hooks_constants/mod_handoff_constants.py +38 -0
- package/hooks/hooks_constants/pre_tool_use_dispatcher_constants.py +1 -7
- package/hooks/hooks_constants/test_bash_pre_tool_use_dispatcher_constants.py +3 -1
- package/hooks/hooks_constants/test_mod_handoff.py +100 -0
- package/hooks/hooks_constants/test_pre_tool_use_dispatcher_constants.py +2 -23
- package/hooks/session/advisor_rules_prompt.py +5 -1
- package/hooks/session/orchestrator_auto_starter.py +5 -1
- package/hooks/session/task_tool_prompt.py +5 -1
- package/hooks/session/test_advisor_rules_prompt.py +11 -0
- package/hooks/session/test_orchestrator_auto_starter.py +22 -0
- package/hooks/session/test_task_tool_prompt.py +15 -0
- package/hooks/session/test_working_style_prompt.py +15 -0
- package/hooks/session/working_style_prompt.py +5 -1
- package/package.json +1 -1
- package/scripts/dev_env_scripts_constants/review_closure_constants.py +24 -0
- package/scripts/review_closure_model.py +48 -12
- package/scripts/test_files/review_closure/codex_comments.json +1266 -0
- package/scripts/tests/test_review_closure_model.py +130 -0
- package/hooks/advisory/migration_safety_advisor.py +0 -74
- package/hooks/advisory/test_migration_safety_advisor.py +0 -204
- package/hooks/hooks_constants/issue_tracker_session_starter_constants.py +0 -22
- package/hooks/hooks_constants/migration_safety_advisor_constants.py +0 -7
- package/hooks/session/issue_tracker_session_starter.py +0 -136
- package/hooks/session/test_issue_tracker_session_starter.py +0 -106
|
@@ -1,106 +0,0 @@
|
|
|
1
|
-
"""Tests for the repository-gated issue-tracker SessionStart starter."""
|
|
2
|
-
|
|
3
|
-
from __future__ import annotations
|
|
4
|
-
|
|
5
|
-
import json
|
|
6
|
-
import os
|
|
7
|
-
import subprocess
|
|
8
|
-
import sys
|
|
9
|
-
from pathlib import Path
|
|
10
|
-
|
|
11
|
-
import pytest
|
|
12
|
-
|
|
13
|
-
_HOOKS_ROOT = Path(__file__).resolve().parent.parent
|
|
14
|
-
if str(_HOOKS_ROOT) not in sys.path:
|
|
15
|
-
sys.path.insert(0, str(_HOOKS_ROOT))
|
|
16
|
-
|
|
17
|
-
from hooks_constants.issue_tracker_session_starter_constants import (
|
|
18
|
-
ISSUE_TRACKER_SESSION_START_DIRECTIVE,
|
|
19
|
-
ISSUE_TRACKER_SESSION_STARTER_ENABLED_ENV_VAR,
|
|
20
|
-
ISSUE_TRACKER_STARTER_TIMEOUT_MILLISECONDS,
|
|
21
|
-
)
|
|
22
|
-
from session.issue_tracker_session_starter import (
|
|
23
|
-
issue_tracker_session_starter_enabled_in_environment,
|
|
24
|
-
repository_is_registered,
|
|
25
|
-
run_issue_tracker_session_starter,
|
|
26
|
-
)
|
|
27
|
-
|
|
28
|
-
STARTER_SCRIPT = Path(__file__).resolve().parent / "issue_tracker_session_starter.py"
|
|
29
|
-
DEFAULT_TIMEOUT = ISSUE_TRACKER_STARTER_TIMEOUT_MILLISECONDS
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
def test_default_environment_is_disabled(monkeypatch: pytest.MonkeyPatch) -> None:
|
|
33
|
-
monkeypatch.delenv(ISSUE_TRACKER_SESSION_STARTER_ENABLED_ENV_VAR, raising=False)
|
|
34
|
-
assert issue_tracker_session_starter_enabled_in_environment() is False
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
def test_enabled_env_values(monkeypatch: pytest.MonkeyPatch) -> None:
|
|
38
|
-
monkeypatch.setenv(ISSUE_TRACKER_SESSION_STARTER_ENABLED_ENV_VAR, "1")
|
|
39
|
-
assert issue_tracker_session_starter_enabled_in_environment() is True
|
|
40
|
-
monkeypatch.setenv(ISSUE_TRACKER_SESSION_STARTER_ENABLED_ENV_VAR, "true")
|
|
41
|
-
assert issue_tracker_session_starter_enabled_in_environment() is True
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
def test_disabled_or_ineligible_emits_nothing() -> None:
|
|
45
|
-
assert (
|
|
46
|
-
run_issue_tracker_session_starter(
|
|
47
|
-
{"source": "startup"}, False, True, DEFAULT_TIMEOUT
|
|
48
|
-
)
|
|
49
|
-
== {}
|
|
50
|
-
)
|
|
51
|
-
assert (
|
|
52
|
-
run_issue_tracker_session_starter(
|
|
53
|
-
{"source": "startup"}, True, False, DEFAULT_TIMEOUT
|
|
54
|
-
)
|
|
55
|
-
== {}
|
|
56
|
-
)
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
def test_enabled_eligible_startup_emits_directive() -> None:
|
|
60
|
-
payload = run_issue_tracker_session_starter(
|
|
61
|
-
{"source": "startup"}, True, True, DEFAULT_TIMEOUT
|
|
62
|
-
)
|
|
63
|
-
hook_output = payload["hookSpecificOutput"]
|
|
64
|
-
assert hook_output["hookEventName"] == "SessionStart"
|
|
65
|
-
assert hook_output["additionalContext"] == ISSUE_TRACKER_SESSION_START_DIRECTIVE
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
def test_timeout_zero_emits_nothing() -> None:
|
|
69
|
-
assert (
|
|
70
|
-
run_issue_tracker_session_starter({"source": "startup"}, True, True, 0) == {}
|
|
71
|
-
)
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
def test_unknown_source_emits_nothing() -> None:
|
|
75
|
-
assert (
|
|
76
|
-
run_issue_tracker_session_starter({"source": "weird"}, True, True, DEFAULT_TIMEOUT)
|
|
77
|
-
== {}
|
|
78
|
-
)
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
def test_repository_is_registered_fail_closed_empty_registry() -> None:
|
|
82
|
-
assert repository_is_registered("/any/path", {}) is False # empty registry fails closed
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
def test_repository_is_registered_matches_git_root(tmp_path: Path) -> None:
|
|
86
|
-
(tmp_path / ".git").mkdir()
|
|
87
|
-
child = tmp_path / "pkg"
|
|
88
|
-
child.mkdir()
|
|
89
|
-
registry = {"demo": str(tmp_path)}
|
|
90
|
-
assert repository_is_registered(str(child), registry) is True
|
|
91
|
-
assert repository_is_registered(str(tmp_path / "other"), {"demo": str(tmp_path / "nope")}) is False
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
def test_main_disabled_prints_nothing() -> None:
|
|
95
|
-
environment_by_key = os.environ.copy()
|
|
96
|
-
environment_by_key.pop(ISSUE_TRACKER_SESSION_STARTER_ENABLED_ENV_VAR, None)
|
|
97
|
-
completed = subprocess.run(
|
|
98
|
-
[sys.executable, str(STARTER_SCRIPT)],
|
|
99
|
-
input=json.dumps({"source": "startup"}),
|
|
100
|
-
capture_output=True,
|
|
101
|
-
text=True,
|
|
102
|
-
check=False,
|
|
103
|
-
env=environment_by_key,
|
|
104
|
-
)
|
|
105
|
-
assert completed.returncode == 0
|
|
106
|
-
assert completed.stdout.strip() == ""
|