claude-dev-env 8.88.4 → 8.88.5

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.
@@ -0,0 +1,83 @@
1
+ """Behavior tests for the first-task rewrite refusal gate."""
2
+
3
+ from __future__ import annotations
4
+
5
+ import sys
6
+ from pathlib import Path
7
+
8
+ _SESSION_DIR = Path(__file__).resolve().parent
9
+ _HOOKS_ROOT = _SESSION_DIR.parent
10
+ for each_sys_path_entry in (str(_SESSION_DIR), str(_HOOKS_ROOT)):
11
+ if each_sys_path_entry not in sys.path:
12
+ sys.path.insert(0, each_sys_path_entry)
13
+
14
+ from deepen_role_gate import refusal_reason
15
+ from hooks_constants.deepen_first_prompt_constants import (
16
+ ALL_FOUR_QUESTION_STEMS,
17
+ REFUSAL_DROPPED_HARD_CONSTRAINT,
18
+ REFUSAL_EXAMPLE_NOUN_IN_SCOPE,
19
+ REFUSAL_MISSING_ROLE_LINES,
20
+ REFUSAL_RESTATES_FOUR_QUESTIONS,
21
+ )
22
+
23
+
24
+ def test_accepts_a_rewrite_with_role_lines_and_preserved_constraint() -> None:
25
+ original_task = "Fix the settings page.\nHARD CONSTRAINTS\n- Keep the save button."
26
+ rewritten_prompt = (
27
+ "SCOPE (role): Fix the settings page.\n"
28
+ "EXAMPLES (illustration only): none\n"
29
+ "ZOOM-IN BLOCKER: none\n"
30
+ "Keep the save button."
31
+ )
32
+
33
+ assert refusal_reason(original_task, rewritten_prompt) is None
34
+
35
+
36
+ def test_refuses_a_rewrite_that_repeats_all_four_questions() -> None:
37
+ rewritten_prompt = (
38
+ "SCOPE (role): Fix the settings page.\n"
39
+ "EXAMPLES (illustration only): none\n"
40
+ "ZOOM-IN BLOCKER: none\n"
41
+ + "\n".join(ALL_FOUR_QUESTION_STEMS)
42
+ )
43
+
44
+ assert refusal_reason("Fix the settings page.", rewritten_prompt) == (
45
+ REFUSAL_RESTATES_FOUR_QUESTIONS
46
+ )
47
+
48
+
49
+ def test_refuses_a_rewrite_with_a_blank_role_line() -> None:
50
+ rewritten_prompt = (
51
+ "SCOPE (role): Fix the settings page.\n"
52
+ "EXAMPLES (illustration only): none\n"
53
+ "ZOOM-IN BLOCKER: "
54
+ )
55
+
56
+ assert refusal_reason("Fix the settings page.", rewritten_prompt) == (
57
+ REFUSAL_MISSING_ROLE_LINES
58
+ )
59
+
60
+
61
+ def test_refuses_an_example_noun_in_scope_without_a_blocker() -> None:
62
+ rewritten_prompt = (
63
+ "SCOPE (role): Add contrast to the settings page.\n"
64
+ "EXAMPLES (illustration only): contrast tokens\n"
65
+ "ZOOM-IN BLOCKER: none"
66
+ )
67
+
68
+ assert refusal_reason("Fix the settings page.", rewritten_prompt) == (
69
+ REFUSAL_EXAMPLE_NOUN_IN_SCOPE
70
+ )
71
+
72
+
73
+ def test_refuses_a_rewrite_that_drops_a_hard_constraint() -> None:
74
+ original_task = "Fix the settings page.\nHARD CONSTRAINTS\n- Keep the save button."
75
+ rewritten_prompt = (
76
+ "SCOPE (role): Fix the settings page.\n"
77
+ "EXAMPLES (illustration only): none\n"
78
+ "ZOOM-IN BLOCKER: none"
79
+ )
80
+
81
+ assert refusal_reason(original_task, rewritten_prompt) == (
82
+ REFUSAL_DROPPED_HARD_CONSTRAINT
83
+ )
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "claude-dev-env",
3
- "version": "8.88.4",
3
+ "version": "8.88.5",
4
4
  "description": "Claude Code development standards — rules, hooks, agents, commands, and skills",
5
5
  "type": "module",
6
6
  "bin": {