claude-dev-env 8.111.3 → 8.111.4
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/hooks/blocking/test_code_rules_enforcer_duplicate_body.py +7 -7
- package/hooks/blocking/test_codex_apply_patch.py +1 -1
- package/hooks/blocking/test_pull_request_proof.py +4 -4
- package/hooks/blocking/test_turn_review_gate.py +9 -4
- package/hooks/lifecycle/test_nested_project_hooks.py +1 -1
- package/hooks/routing/test_spawn_readiness_hook.py +6 -2
- package/hooks/session/test_npx_pele_guidance.py +2 -2
- package/package.json +1 -1
|
@@ -15,6 +15,7 @@ containing a test marker as exempt — the same way it would skip a real test fi
|
|
|
15
15
|
|
|
16
16
|
from __future__ import annotations
|
|
17
17
|
|
|
18
|
+
import contextlib
|
|
18
19
|
import importlib.util
|
|
19
20
|
import pathlib
|
|
20
21
|
import shutil
|
|
@@ -261,15 +262,14 @@ def test_should_scan_explicit_sibling_directory_for_relative_path(
|
|
|
261
262
|
|
|
262
263
|
def test_should_ignore_cwd_when_explicit_sibling_directory_given(
|
|
263
264
|
module_dir: pathlib.Path,
|
|
264
|
-
monkeypatch: pytest.MonkeyPatch,
|
|
265
265
|
) -> None:
|
|
266
266
|
_write(module_dir, "existing_blocker.py", SHARED_HELPER_SOURCE)
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
267
|
+
with contextlib.chdir(module_dir.parent):
|
|
268
|
+
issues = check_duplicate_function_body_across_files(
|
|
269
|
+
SHARED_HELPER_SOURCE,
|
|
270
|
+
"package/new_blocker.py",
|
|
271
|
+
sibling_directory=module_dir,
|
|
272
|
+
)
|
|
273
273
|
assert any("strip_code_and_quotes" in each_issue for each_issue in issues), (
|
|
274
274
|
"An explicit sibling directory must anchor the scan independent of the "
|
|
275
275
|
f"process working directory, got: {issues}"
|
|
@@ -25,7 +25,7 @@ def test_codex_patch_operation_targets_names_every_section_without_reading_conte
|
|
|
25
25
|
all_targets = codex_patch_operation_targets(three_operation_patch, str(tmp_path))
|
|
26
26
|
|
|
27
27
|
all_target_names = {
|
|
28
|
-
(each_operation,
|
|
28
|
+
(each_operation, Path(each_path).name)
|
|
29
29
|
for each_operation, each_path in all_targets
|
|
30
30
|
}
|
|
31
31
|
assert all_target_names == {
|
|
@@ -527,7 +527,7 @@ def _shell_create_elsewhere(
|
|
|
527
527
|
) -> dict[str, object]:
|
|
528
528
|
body_path = tmp_path / "body.md"
|
|
529
529
|
body_path.write_text(body, encoding="utf-8")
|
|
530
|
-
return _shell(f
|
|
530
|
+
return _shell(f'gh pr create --title t --body-file "{body_path}" {extra_flags}', tmp_path)
|
|
531
531
|
|
|
532
532
|
|
|
533
533
|
def test_should_allow_a_python_only_change_the_compare_api_lists_when_git_cannot_read_it(
|
|
@@ -689,9 +689,9 @@ def test_should_report_unreadable_git_output_as_unknown() -> None:
|
|
|
689
689
|
assert gate._git_changes([":100644 100644 aaa bbb M", "a.html", "stray", ""]) is None
|
|
690
690
|
|
|
691
691
|
|
|
692
|
-
def
|
|
693
|
-
clone_path = _repository_with_change(tmp_path, '
|
|
694
|
-
assert gate.visible_changed_files(str(clone_path), "feature") == ['
|
|
692
|
+
def test_should_keep_a_page_whose_name_holds_an_apostrophe(tmp_path: Path) -> None:
|
|
693
|
+
clone_path = _repository_with_change(tmp_path, "q't.html")
|
|
694
|
+
assert gate.visible_changed_files(str(clone_path), "feature") == ["q't.html"]
|
|
695
695
|
|
|
696
696
|
|
|
697
697
|
def test_should_keep_a_page_whose_name_has_non_ascii_letters(tmp_path: Path) -> None:
|
|
@@ -57,9 +57,14 @@ def project(tmp_path: Path) -> Path:
|
|
|
57
57
|
def gate_environment(tmp_path: Path, project: Path) -> dict[str, str]:
|
|
58
58
|
stub_directory = tmp_path / "bin"
|
|
59
59
|
stub_directory.mkdir()
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
60
|
+
if os.name == "nt":
|
|
61
|
+
stub_script = stub_directory / "claude_stub.py"
|
|
62
|
+
stub_script.write_text(STUB_CLAUDE_SOURCE)
|
|
63
|
+
(stub_directory / "claude.cmd").write_text(f'@"{sys.executable}" "{stub_script}" %*\r\n')
|
|
64
|
+
else:
|
|
65
|
+
stub_claude = stub_directory / "claude"
|
|
66
|
+
stub_claude.write_text(STUB_CLAUDE_SOURCE)
|
|
67
|
+
stub_claude.chmod(0o755)
|
|
63
68
|
state_directory = tmp_path / "state"
|
|
64
69
|
state_directory.mkdir()
|
|
65
70
|
environment = {
|
|
@@ -373,7 +378,7 @@ def test_should_share_one_review_time_budget_across_the_checkouts(
|
|
|
373
378
|
monkeypatch.setenv(each_name, gate_environment[each_name])
|
|
374
379
|
monkeypatch.setenv("STUB_REVIEW_SECONDS", "5")
|
|
375
380
|
monkeypatch.setattr(tempfile, "tempdir", gate_environment["TMPDIR"])
|
|
376
|
-
monkeypatch.setattr(turn_review_gate, "REVIEW_TIMEOUT_SECONDS",
|
|
381
|
+
monkeypatch.setattr(turn_review_gate, "REVIEW_TIMEOUT_SECONDS", 4)
|
|
377
382
|
all_roots = turn_review_gate._opted_in_repository_roots(
|
|
378
383
|
turn_review_gate._opted_in_repository_slugs()
|
|
379
384
|
)
|
|
@@ -77,7 +77,7 @@ def test_should_run_a_child_session_start_hook_inside_that_child(
|
|
|
77
77
|
"SessionStart": [
|
|
78
78
|
_command_group(
|
|
79
79
|
"",
|
|
80
|
-
f'echo "$CLAUDE_PROJECT_DIR|$(pwd)" > "{record_path}"',
|
|
80
|
+
f'echo "$CLAUDE_PROJECT_DIR|$(pwd -W 2>/dev/null || pwd)" > "{record_path}"',
|
|
81
81
|
)
|
|
82
82
|
]
|
|
83
83
|
},
|
|
@@ -83,6 +83,10 @@ def _write_transcript(tmp_path: Path, all_entries: list[dict[str, object]]) -> P
|
|
|
83
83
|
return transcript_path
|
|
84
84
|
|
|
85
85
|
|
|
86
|
+
def _hook_environment(tmp_path: Path) -> dict[str, str]:
|
|
87
|
+
return {**os.environ, "HOME": str(tmp_path), "USERPROFILE": str(tmp_path)}
|
|
88
|
+
|
|
89
|
+
|
|
86
90
|
def _run_hook(tmp_path: Path, hook_payload: dict[str, object]) -> str:
|
|
87
91
|
completed = subprocess.run(
|
|
88
92
|
[sys.executable, str(HOOK_SCRIPT)],
|
|
@@ -91,7 +95,7 @@ def _run_hook(tmp_path: Path, hook_payload: dict[str, object]) -> str:
|
|
|
91
95
|
),
|
|
92
96
|
capture_output=True,
|
|
93
97
|
text=True,
|
|
94
|
-
env=
|
|
98
|
+
env=_hook_environment(tmp_path),
|
|
95
99
|
check=True,
|
|
96
100
|
)
|
|
97
101
|
return completed.stdout
|
|
@@ -390,7 +394,7 @@ def test_should_print_nothing_for_empty_stdin(tmp_path: Path) -> None:
|
|
|
390
394
|
input="",
|
|
391
395
|
capture_output=True,
|
|
392
396
|
text=True,
|
|
393
|
-
env=
|
|
397
|
+
env=_hook_environment(tmp_path),
|
|
394
398
|
check=True,
|
|
395
399
|
)
|
|
396
400
|
assert completed.stdout == ""
|
|
@@ -211,7 +211,7 @@ def test_installed_snippet_renders_an_svg_file(
|
|
|
211
211
|
monkeypatch.setenv(CLAUDE_CONFIG_DIRECTORY_VARIABLE, str(claude_root))
|
|
212
212
|
work_directory = tmp_path / "work"
|
|
213
213
|
work_directory.mkdir()
|
|
214
|
-
(work_directory / "diagram.mmd").
|
|
214
|
+
(work_directory / "diagram.mmd").write_bytes(CHAIN_TEXT.encode("utf-8"))
|
|
215
215
|
context_text = npx_pele_guidance.guidance_text()
|
|
216
216
|
snippet = context_text.split(JS_FENCE_OPEN, 1)[1].split(JS_FENCE_CLOSE, 1)[0]
|
|
217
217
|
(work_directory / "pele-render.mjs").write_text(snippet, encoding="utf-8")
|
|
@@ -270,7 +270,7 @@ def test_installed_guidance_points_at_the_manifest_main_entry(
|
|
|
270
270
|
entry_path.write_text("export function render(text) {\n return { svg: '' };\n}\n", encoding="utf-8")
|
|
271
271
|
manifest = npx_pele_guidance.installed_pele_manifest(package_directory)
|
|
272
272
|
assert npx_pele_guidance.installed_pele_entry(package_directory, manifest) == entry_path
|
|
273
|
-
assert str(entry_path) in npx_pele_guidance.guidance_text()
|
|
273
|
+
assert json.dumps(str(entry_path)) in npx_pele_guidance.guidance_text()
|
|
274
274
|
assert "pele.run" not in npx_pele_guidance.guidance_text()
|
|
275
275
|
|
|
276
276
|
|