claude-dev-env 1.44.0 → 1.46.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.
Files changed (44) hide show
  1. package/CLAUDE.md +9 -0
  2. package/_shared/pr-loop/scripts/code_rules_gate.py +426 -85
  3. package/_shared/pr-loop/scripts/pr_loop_shared_constants/code_rules_gate_constants.py +20 -0
  4. package/_shared/pr-loop/scripts/pr_loop_shared_constants/reviews_disabled_constants.py +1 -0
  5. package/_shared/pr-loop/scripts/reviews_disabled.py +82 -9
  6. package/_shared/pr-loop/scripts/tests/test_code_rules_gate.py +630 -21
  7. package/_shared/pr-loop/scripts/tests/test_code_rules_gate_constants.py +15 -0
  8. package/_shared/pr-loop/scripts/tests/test_reviews_disabled.py +57 -0
  9. package/agents/clean-coder.md +7 -1
  10. package/agents/code-quality-agent.md +8 -5
  11. package/hooks/blocking/code_rules_enforcer.py +1562 -37
  12. package/hooks/blocking/content_search_zoekt_redirect_guidance.py +19 -0
  13. package/hooks/blocking/open_questions_in_plans_blocker.py +249 -0
  14. package/hooks/blocking/test_code_rules_enforcer.py +1389 -0
  15. package/hooks/blocking/test_code_rules_enforcer_banned_noun_word.py +292 -0
  16. package/hooks/blocking/test_code_rules_enforcer_cap_meta.py +46 -8
  17. package/hooks/blocking/test_code_rules_enforcer_exempt_marker_chained.py +189 -0
  18. package/hooks/blocking/test_code_rules_enforcer_function_length.py +210 -0
  19. package/hooks/blocking/test_code_rules_enforcer_tests_isolate_home_temp.py +1512 -0
  20. package/hooks/blocking/test_code_rules_enforcer_unused_imports.py +9 -5
  21. package/hooks/blocking/test_content_search_to_zoekt_redirector_unit.py +30 -0
  22. package/hooks/blocking/test_open_questions_in_plans_blocker.py +790 -0
  23. package/hooks/hooks.json +10 -0
  24. package/hooks/hooks_constants/banned_identifiers_constants.py +19 -0
  25. package/hooks/hooks_constants/code_rules_enforcer_constants.py +129 -2
  26. package/hooks/hooks_constants/open_questions_in_plans_blocker_constants.py +35 -0
  27. package/hooks/hooks_constants/test_open_questions_in_plans_blocker_constants.py +125 -0
  28. package/package.json +1 -1
  29. package/skills/_shared/pr-loop/scripts/_path_resolver.py +34 -13
  30. package/skills/_shared/pr-loop/scripts/init_loop_state.py +1 -2
  31. package/skills/_shared/pr-loop/scripts/teardown_worktrees.py +1 -4
  32. package/skills/_shared/pr-loop/scripts/test__path_resolver.py +57 -0
  33. package/skills/_shared/pr-loop/scripts/test_init_loop_state.py +48 -0
  34. package/skills/_shared/pr-loop/scripts/test_teardown_worktrees.py +59 -0
  35. package/skills/bugteam/PROMPTS.md +48 -12
  36. package/skills/bugteam/reference/team-setup.md +4 -2
  37. package/skills/bugteam/scripts/bugteam_code_rules_gate.py +487 -76
  38. package/skills/bugteam/scripts/bugteam_scripts_constants/bugteam_code_rules_gate_constants.py +22 -1
  39. package/skills/bugteam/scripts/test_bugteam_code_rules_gate.py +602 -12
  40. package/skills/pr-converge/SKILL.md +5 -0
  41. package/skills/pr-converge/reference/per-tick.md +14 -5
  42. package/skills/pr-converge/reference/state-schema.md +7 -3
  43. package/skills/pr-converge/scripts/check_convergence.py +27 -1
  44. package/skills/pr-converge/scripts/test_check_convergence.py +28 -0
@@ -24,9 +24,9 @@ cd into `<worktree_path>` before any git or file operation.
24
24
  </scope>
25
25
 
26
26
  <bug_categories>
27
- Investigate each of the eleven categories (A–K) explicitly. For each,
27
+ Investigate each of the fourteen categories (A–N) explicitly. For each,
28
28
  return either at least one finding OR a verified-clean entry with the
29
- evidence used to clear it. A category is verified-clean only when one
29
+ evidence backing the verdict. A category is verified-clean only when one
30
30
  complete execution path through the changed code has been traced from
31
31
  entry to exit. Surface-level scanning is insufficient evidence. The
32
32
  evidence field must name (1) the specific function examined, (2) the
@@ -37,12 +37,12 @@ cd into `<worktree_path>` before any git or file operation.
37
37
  When evidence contains any of these phrases, the category is not
38
38
  verified-clean -- re-audit with a concrete trace.
39
39
 
40
- Categories A–K (one-line summary; full rubric and sub-bucket decomposition
41
- for each is in `$HOME/.claude/audit-rubrics/category_rubrics/`;
42
- ready-to-send Variant C prompts — each with a PR/repo-independent
43
- generalized skeleton above a `---` separator and a worked example against
44
- an authentic PR below — are in
45
- `$HOME/.claude/audit-rubrics/prompts/`):
40
+ Categories A–N (one-line summary; full rubric and sub-bucket
41
+ decomposition for each is in
42
+ `$HOME/.claude/audit-rubrics/category_rubrics/`; ready-to-send Variant
43
+ C prompts each with a PR/repo-independent generalized skeleton above
44
+ a `---` separator and a worked example against an authentic PR below —
45
+ are in `$HOME/.claude/audit-rubrics/prompts/`):
46
46
 
47
47
  A. API contract verification (signatures, return types, async/await correctness)
48
48
  B. Selector / query / engine compatibility
@@ -58,6 +58,42 @@ cd into `<worktree_path>` before any git or file operation.
58
58
  site in unchanged code stays stale, producing contradictory behavior;
59
59
  the diff is internally consistent, the bug emerges only against unchanged
60
60
  code (canonical example: jl-cmd/claude-code-config PR #397 r3210166636)
61
+ L. Behavior-equivalence for refactors. When the PR rewrites an existing
62
+ function (especially an enforcement check, parser, or path classifier),
63
+ compare the rewrite's edge-case handling against the sibling implementation
64
+ at the same git commit base. Pin the historically-valid inputs in a
65
+ `KNOWN_GOOD_INPUTS` table and assert each still passes. Cited in audits:
66
+ ccc#479 F1 (`#noqa` no-space variant dropped after a tokenize-based
67
+ refactor); ccc#479 F4 (bare `#` lookalike misclassified after refactor);
68
+ ccc#479 F5 (inline `#!` lookalike misclassified); ccc#479 F6 (early-exit
69
+ invariant dropped); ccc#472 F44 (`startswith('## Problem')` too loose vs
70
+ the sibling regex shape).
71
+ M. Producer/consumer cardinality vs collection-type contract. For each new
72
+ function returning `list[X]`, `Sequence[X]`, or `Iterable[X]`, ask
73
+ whether the return can contain duplicates and whether any downstream
74
+ consumer treats the value as a set. Subprocess-stdout parsers must return
75
+ `frozenset[Path]` or `dict.fromkeys`-deduplicated `list[Path]`.
76
+ Functions whose consumer is itself an `extend(...)` into a list pass;
77
+ functions with explicit "duplicates preserved" docstring text pass.
78
+ Cited in audits: pa#143 F10 (`_extract_paths_from_everything_cli_stdout`
79
+ duplicates → `RuntimeError` — the only High-severity crash bug in the
80
+ audit set); pa#136 F30 / F32 (duplicate content_id rows submit twice;
81
+ writeback ignores content_id key).
82
+ N. Test-name claims a scenario the body does not enter. Tests named
83
+ `test_*_at_*`, `test_*_under_*`, `test_*_when_*`, and `test_*_with_*`
84
+ must, via monkeypatch / fixture inspection, demonstrate the named
85
+ condition is in effect when the system under test runs. Path-decision
86
+ functions (registered in `*_path_exemptions.py` / `is_*_path` /
87
+ `_resolve_*_path` modules) must ship with a parametric matrix of
88
+ canonical edge cases (empty string, single filename, tilde, UNC,
89
+ drive-letter, symlinked, `..`-containing, trailing-slash). Tests with
90
+ neutral names (`test_returns_empty_list_on_x`) are unaffected. Cited
91
+ in audits: ccc#476 F5 / F21 / F23 / F26 / F27 (cross-platform
92
+ scenarios never exercised under the claimed conditions); pa#135 F11 /
93
+ F15 (string-shape and integration tests that exercise only the no-op
94
+ branch); pa#136 F50 (`<substring> not in executed_sql` assertion that
95
+ cannot fail because the substring shape never matches the real
96
+ fragment).
61
97
  </bug_categories>
62
98
 
63
99
  <constraints>
@@ -69,7 +105,7 @@ cd into `<worktree_path>` before any git or file operation.
69
105
  </constraints>
70
106
 
71
107
  <comment_posting>
72
- Load all A–K rubrics from
108
+ Load all A–N rubrics from
73
109
  `$HOME/.claude/audit-rubrics/{category_rubrics,prompts}/`. The prompt file
74
110
  is a template for output shape, not a straitjacket — reorganize when the
75
111
  diff demands it. The diff supplies the findings; the rubric supplies the
@@ -80,7 +116,7 @@ cd into `<worktree_path>` before any git or file operation.
80
116
  done.
81
117
 
82
118
  <self_audit_checklist>
83
- [ ] Walk all 11 categories (A–K), each with Shape A or Shape B
119
+ [ ] Walk all 14 categories (A–N), each with Shape A or Shape B
84
120
  [ ] Assign finding IDs (loop<L>-<K>)
85
121
  [ ] Capture excerpts, validate anchors, format finding bodies
86
122
  [ ] Build findings JSON, invoke post_audit_thread.py, capture html_url
@@ -88,7 +124,7 @@ cd into `<worktree_path>` before any git or file operation.
88
124
  [ ] Write outcome XML
89
125
  </self_audit_checklist>
90
126
 
91
- 1. Audit the diff against the 11 categories above. Buffer the findings
127
+ 1. Audit the diff against the 14 categories above. Buffer the findings
92
128
  in memory; all posting happens at step 4 once anchors are validated.
93
129
  2. Assign each finding a stable finding_id of exactly the form `loop<L>-<K>`
94
130
  where <K> is 1-based within this loop.
@@ -219,7 +255,7 @@ attributes.
219
255
  </bugteam_audit>
220
256
  ```
221
257
 
222
- Verified-clean evidence per A–K category is surfaced in the agent's text-mode
258
+ Verified-clean evidence per A–N category is surfaced in the agent's text-mode
223
259
  final report, not in this outcome XML (the writer accepts a flat findings list
224
260
  only).
225
261
 
@@ -68,8 +68,10 @@ For each PR in `all_prs`:
68
68
 
69
69
  Canonical path functions live in
70
70
  [`_shared/pr-loop/scripts/_path_resolver.py`](../../_shared/pr-loop/scripts/_path_resolver.py):
71
- `per_pr_workspace(run_temp_dir, owner, repo, pr_number)` returns dict with keys
72
- `worktree`, `diff_patch_template`, `outcome_xml_template`, `fix_outcome_xml_template`.
71
+ `per_pr_workspace(run_temp_dir, owner, repo, pr_number)` returns a frozen
72
+ `PerPrWorkspace` with fields `worktree` (a `Path`), `diff_patch_template`,
73
+ `outcome_xml_template`, and `fix_outcome_xml_template` (each a `str.format`
74
+ template).
73
75
 
74
76
  1. Create `<run_temp_dir>/pr-<N>/`.
75
77
  2. Run `git worktree add "<run_temp_dir>/pr-<N>/worktree" origin/<headRef>`.