claude-dev-env 1.58.0 → 1.60.0
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/CLAUDE.md +2 -2
- package/_shared/pr-loop/scripts/code_rules_gate.py +36 -3
- package/_shared/pr-loop/scripts/pr_loop_shared_constants/code_rules_gate_constants.py +6 -0
- package/_shared/pr-loop/scripts/pr_loop_shared_constants/reviews_disabled_constants.py +1 -0
- package/_shared/pr-loop/scripts/reviews_disabled.py +12 -0
- package/_shared/pr-loop/scripts/tests/test_code_rules_gate.py +265 -0
- package/_shared/pr-loop/scripts/tests/test_reviews_disabled.py +29 -0
- package/audit-rubrics/category_rubrics/category-b-selector-engine-compat.md +1 -1
- package/audit-rubrics/category_rubrics/category-e-dead-code.md +1 -0
- package/audit-rubrics/category_rubrics/category-o-docstring-vs-impl-drift.md +1 -1
- package/audit-rubrics/prompts/category-b-selector-engine-compat.md +2 -2
- package/bin/install.mjs +100 -27
- package/bin/install.test.mjs +133 -1
- package/docs/CODE_RULES.md +3 -3
- package/hooks/blocking/code_rules_annotations_length.py +153 -0
- package/hooks/blocking/code_rules_dead_dataclass_field.py +319 -0
- package/hooks/blocking/code_rules_dead_module_constant.py +321 -0
- package/hooks/blocking/code_rules_duplicate_body.py +439 -0
- package/hooks/blocking/code_rules_enforcer.py +190 -21
- package/hooks/blocking/code_rules_magic_values.py +98 -0
- package/hooks/blocking/code_rules_shared.py +41 -0
- package/hooks/blocking/code_rules_typeddict_stub.py +172 -0
- package/hooks/blocking/config/__init__.py +5 -0
- package/hooks/blocking/config/verified_commit_constants.py +106 -0
- package/hooks/blocking/destructive_command_blocker.py +1027 -12
- package/hooks/blocking/hook_prose_detector_consistency.py +150 -0
- package/hooks/blocking/subprocess_budget_completeness.py +380 -0
- package/hooks/blocking/test_code_rules_enforcer_annotations.py +225 -0
- package/hooks/blocking/test_code_rules_enforcer_cap_meta.py +1 -0
- package/hooks/blocking/test_code_rules_enforcer_cross_skill_duplicate.py +146 -0
- package/hooks/blocking/test_code_rules_enforcer_dead_dataclass_field.py +467 -0
- package/hooks/blocking/test_code_rules_enforcer_dead_module_constant.py +188 -0
- package/hooks/blocking/test_code_rules_enforcer_duplicate_body.py +330 -0
- package/hooks/blocking/test_code_rules_enforcer_duplicate_body_hook_routing.py +179 -0
- package/hooks/blocking/test_code_rules_enforcer_magic_slice_bounds.py +133 -0
- package/hooks/blocking/test_code_rules_enforcer_zero_payload_alias.py +415 -0
- package/hooks/blocking/test_code_rules_enforcer_zero_payload_alias_hook_routing.py +156 -0
- package/hooks/blocking/test_destructive_command_blocker.py +622 -3
- package/hooks/blocking/test_hook_prose_detector_consistency.py +265 -0
- package/hooks/blocking/test_subprocess_budget_completeness.py +588 -0
- package/hooks/blocking/test_verdict_directory_write_blocker.py +720 -0
- package/hooks/blocking/test_verification_verdict_store.py +278 -0
- package/hooks/blocking/test_verified_commit_gate.py +368 -0
- package/hooks/blocking/test_verified_commit_message_accuracy_blocker.py +131 -0
- package/hooks/blocking/test_verifier_verdict_minter.py +214 -0
- package/hooks/blocking/test_workflow_substitution_slot_blocker.py +242 -0
- package/hooks/blocking/verdict_directory_write_blocker.py +667 -0
- package/hooks/blocking/verification_verdict_store.py +446 -0
- package/hooks/blocking/verified_commit_gate.py +523 -0
- package/hooks/blocking/verified_commit_message_accuracy_blocker.py +152 -0
- package/hooks/blocking/verifier_verdict_minter.py +299 -0
- package/hooks/blocking/workflow_substitution_slot_blocker.py +159 -0
- package/hooks/diagnostic/test_hook_log_extractor.py +3 -3
- package/hooks/hooks.json +58 -1
- package/hooks/hooks_constants/blocking_check_limits.py +1 -0
- package/hooks/hooks_constants/code_rules_enforcer_constants.py +16 -0
- package/hooks/hooks_constants/dead_dataclass_field_constants.py +25 -0
- package/hooks/hooks_constants/dead_module_constant_constants.py +20 -0
- package/hooks/hooks_constants/destructive_command_segment_constants.py +178 -0
- package/hooks/hooks_constants/duplicate_function_body_constants.py +34 -0
- package/hooks/hooks_constants/hook_prose_detector_consistency_constants.py +30 -0
- package/hooks/hooks_constants/precommit_code_rules_gate_constants.py +1 -1
- package/hooks/hooks_constants/subprocess_budget_completeness_constants.py +5 -0
- package/hooks/hooks_constants/workflow_substitution_slot_blocker_constants.py +22 -0
- package/package.json +1 -1
- package/rules/docstring-prose-matches-implementation.md +43 -0
- package/rules/file-global-constants.md +7 -1
- package/rules/hook-prose-matches-detector.md +26 -0
- package/rules/no-cross-skill-duplicate-helpers.md +29 -0
- package/rules/no-inline-destructive-literals.md +11 -0
- package/rules/workflow-substitution-slots.md +7 -0
- package/skills/_shared/pr-loop/scripts/preflight_worktree.py +392 -0
- package/skills/_shared/pr-loop/scripts/skills_pr_loop_constants/preflight_constants.py +70 -0
- package/skills/_shared/pr-loop/scripts/test_preflight_worktree.py +263 -0
- package/skills/autoconverge/SKILL.md +67 -19
- package/skills/autoconverge/reference/closing-report.md +59 -17
- package/skills/autoconverge/reference/convergence.md +7 -3
- package/skills/autoconverge/reference/stop-conditions.md +7 -2
- package/skills/autoconverge/workflow/aggregate_runs.py +371 -0
- package/skills/autoconverge/workflow/autoconverge_report_constants/render_report_constants.py +193 -76
- package/skills/autoconverge/workflow/converge.clean-audit.test.mjs +76 -0
- package/skills/autoconverge/workflow/converge.contract.test.mjs +206 -206
- package/skills/autoconverge/workflow/converge.copilot-gate.test.mjs +265 -0
- package/skills/autoconverge/workflow/converge.mjs +234 -42
- package/skills/autoconverge/workflow/convergence_summary.py +110 -0
- package/skills/autoconverge/workflow/fixtures/wf_run/subagents/workflows/wf_881252e6-700/agent-ab1c2d3e4f5a6b7c8.jsonl +2 -0
- package/skills/autoconverge/workflow/fixtures/wf_run/workflows/wf_881252e6-700.json +7 -0
- package/skills/autoconverge/workflow/render_report.py +488 -397
- package/skills/autoconverge/workflow/test_aggregate_runs.py +134 -0
- package/skills/autoconverge/workflow/test_convergence_summary.py +132 -0
- package/skills/autoconverge/workflow/test_render_report.py +488 -259
- package/skills/pr-converge/reference/per-tick.md +28 -8
- package/skills/pr-converge/scripts/check_convergence.py +195 -64
- package/skills/pr-converge/scripts/test_check_convergence.py +173 -2
- package/skills/rebase/SKILL.md +2 -4
- package/skills/update/SKILL.md +37 -5
- package/system-prompts/software-engineer.xml +2 -6
- package/hooks/blocking/content_search_to_zoekt_redirector.py +0 -59
- package/hooks/blocking/content_search_zoekt_bash_block_reason.py +0 -25
- package/hooks/blocking/content_search_zoekt_block_payload.py +0 -21
- package/hooks/blocking/content_search_zoekt_indexed_paths.py +0 -24
- package/hooks/blocking/content_search_zoekt_indexed_roots_config.py +0 -131
- package/hooks/blocking/content_search_zoekt_redirect_guidance.py +0 -52
- package/hooks/blocking/test_content_search_to_zoekt_redirector_integration.py +0 -61
- package/hooks/blocking/test_content_search_to_zoekt_redirector_unit.py +0 -92
- package/hooks/blocking/test_content_search_zoekt_indexed_roots_config.py +0 -102
|
@@ -1,102 +0,0 @@
|
|
|
1
|
-
"""Tests for Zoekt indexed root resolution (env, file, empty built-in fallback, WSL variants)."""
|
|
2
|
-
|
|
3
|
-
import json
|
|
4
|
-
import os
|
|
5
|
-
import pathlib
|
|
6
|
-
import sys
|
|
7
|
-
import tempfile
|
|
8
|
-
import unittest
|
|
9
|
-
from unittest.mock import patch
|
|
10
|
-
|
|
11
|
-
HOOK_DIRECTORY = pathlib.Path(__file__).resolve().parent
|
|
12
|
-
if str(HOOK_DIRECTORY) not in sys.path:
|
|
13
|
-
sys.path.insert(0, str(HOOK_DIRECTORY))
|
|
14
|
-
|
|
15
|
-
from content_search_zoekt_indexed_paths import is_in_indexed_repo
|
|
16
|
-
from content_search_zoekt_indexed_roots_config import (
|
|
17
|
-
clear_indexed_root_prefixes_cache,
|
|
18
|
-
indexed_root_prefixes,
|
|
19
|
-
)
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
class IndexedRootsConfigTests(unittest.TestCase):
|
|
23
|
-
def tearDown(self) -> None:
|
|
24
|
-
clear_indexed_root_prefixes_cache()
|
|
25
|
-
|
|
26
|
-
def test_environment_json_array_defines_prefixes(self) -> None:
|
|
27
|
-
roots_json = json.dumps(["Y:/OnlyOne/Indexed/"])
|
|
28
|
-
with patch.dict(os.environ, {"ZOEKT_REDIRECT_INDEXED_ROOTS": roots_json}, clear=False):
|
|
29
|
-
clear_indexed_root_prefixes_cache()
|
|
30
|
-
prefixes = indexed_root_prefixes()
|
|
31
|
-
self.assertIn("y:/onlyone/indexed/", prefixes)
|
|
32
|
-
self.assertIn("/mnt/y/onlyone/indexed/", prefixes)
|
|
33
|
-
|
|
34
|
-
def test_empty_environment_array_yields_no_prefixes(self) -> None:
|
|
35
|
-
with patch.dict(os.environ, {"ZOEKT_REDIRECT_INDEXED_ROOTS": "[]"}, clear=False):
|
|
36
|
-
clear_indexed_root_prefixes_cache()
|
|
37
|
-
prefixes = indexed_root_prefixes()
|
|
38
|
-
self.assertEqual(prefixes, ())
|
|
39
|
-
|
|
40
|
-
def test_json_file_used_when_env_missing(self) -> None:
|
|
41
|
-
with tempfile.TemporaryDirectory() as tmp_str:
|
|
42
|
-
home = pathlib.Path(tmp_str)
|
|
43
|
-
config_dir = home / ".claude"
|
|
44
|
-
config_dir.mkdir(parents=True)
|
|
45
|
-
roots_payload = {"roots": ["Y:/FromFile/Project/"]}
|
|
46
|
-
(config_dir / "zoekt-indexed-roots.json").write_text(
|
|
47
|
-
json.dumps(roots_payload),
|
|
48
|
-
encoding="utf-8",
|
|
49
|
-
)
|
|
50
|
-
with patch("pathlib.Path.home", return_value=home):
|
|
51
|
-
saved = os.environ.pop("ZOEKT_REDIRECT_INDEXED_ROOTS", None)
|
|
52
|
-
try:
|
|
53
|
-
clear_indexed_root_prefixes_cache()
|
|
54
|
-
prefixes = indexed_root_prefixes()
|
|
55
|
-
finally:
|
|
56
|
-
if saved is not None:
|
|
57
|
-
os.environ["ZOEKT_REDIRECT_INDEXED_ROOTS"] = saved
|
|
58
|
-
self.assertIn("y:/fromfile/project/", prefixes)
|
|
59
|
-
|
|
60
|
-
def test_environment_overrides_file(self) -> None:
|
|
61
|
-
with tempfile.TemporaryDirectory() as tmp_str:
|
|
62
|
-
home = pathlib.Path(tmp_str)
|
|
63
|
-
config_dir = home / ".claude"
|
|
64
|
-
config_dir.mkdir(parents=True)
|
|
65
|
-
(config_dir / "zoekt-indexed-roots.json").write_text(
|
|
66
|
-
json.dumps({"roots": ["Y:/FromFile/"]}),
|
|
67
|
-
encoding="utf-8",
|
|
68
|
-
)
|
|
69
|
-
with patch("pathlib.Path.home", return_value=home):
|
|
70
|
-
with patch.dict(
|
|
71
|
-
os.environ,
|
|
72
|
-
{"ZOEKT_REDIRECT_INDEXED_ROOTS": json.dumps(["Y:/FromEnv/"])},
|
|
73
|
-
clear=False,
|
|
74
|
-
):
|
|
75
|
-
clear_indexed_root_prefixes_cache()
|
|
76
|
-
prefixes = indexed_root_prefixes()
|
|
77
|
-
self.assertIn("y:/fromenv/", prefixes)
|
|
78
|
-
self.assertNotIn("y:/fromfile/", prefixes)
|
|
79
|
-
|
|
80
|
-
def test_longer_prefix_matches_before_shorter_parent(self) -> None:
|
|
81
|
-
roots_json = json.dumps(["Y:/parent/", "Y:/parent/child/"])
|
|
82
|
-
with patch.dict(os.environ, {"ZOEKT_REDIRECT_INDEXED_ROOTS": roots_json}, clear=False):
|
|
83
|
-
clear_indexed_root_prefixes_cache()
|
|
84
|
-
self.assertTrue(is_in_indexed_repo("Y:/parent/child/file.py"))
|
|
85
|
-
|
|
86
|
-
def test_invalid_environment_json_falls_through_to_empty_builtin(self) -> None:
|
|
87
|
-
with patch(
|
|
88
|
-
"content_search_zoekt_indexed_roots_config._roots_from_json_file",
|
|
89
|
-
return_value=None,
|
|
90
|
-
):
|
|
91
|
-
with patch.dict(
|
|
92
|
-
os.environ,
|
|
93
|
-
{"ZOEKT_REDIRECT_INDEXED_ROOTS": "not-json"},
|
|
94
|
-
clear=False,
|
|
95
|
-
):
|
|
96
|
-
clear_indexed_root_prefixes_cache()
|
|
97
|
-
prefixes = indexed_root_prefixes()
|
|
98
|
-
self.assertEqual(prefixes, ())
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
if __name__ == "__main__":
|
|
102
|
-
unittest.main()
|