claude-dev-env 8.68.2 → 8.68.3
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.
|
@@ -13,6 +13,7 @@ This family stops a chat reply, edited message, or tool call when its payload br
|
|
|
13
13
|
- `blocking/verify_before_acting.py` blocks a completed mutating call when the agent's reasoning contains an unchecked claim.
|
|
14
14
|
- `blocking/pr_lifecycle_skill_gate.py` denies a commit, push, pull request action, or merge until the `pr-lifecycle` skill appears in the transcript since the last compaction.
|
|
15
15
|
- `blocking/artifact_look_gate.py` denies an Artifact publish of an HTML page until an image was opened with Read after the page file was last written, so the agent looks at its page before it ships.
|
|
16
|
+
- `blocking/artifact_dark_mode_gate.py` denies an Artifact page publish when the page, inside the publish wrapper, keeps a light body or shows text under 4.5:1 contrast in dark mode. `blocking/artifact_dark_mode_render.cjs` renders the page in headless Chromium for it.
|
|
16
17
|
|
|
17
18
|
## When it fires
|
|
18
19
|
|
|
@@ -25,6 +26,7 @@ This family stops a chat reply, edited message, or tool call when its payload br
|
|
|
25
26
|
- `blocking/verify_before_acting.py` runs on `PostToolUse`, matcher `Write|Edit|MultiEdit|NotebookEdit|Agent|Task|apply_patch|Bash|PowerShell|mcp__.*`, timeout `10` seconds in `hooks.json`.
|
|
26
27
|
- `blocking/pr_lifecycle_skill_gate.py` runs on `PreToolUse`, matcher `Bash|PowerShell|mcp__.*__(create_pull_request|merge_pull_request|enable_pr_auto_merge|update_pull_request)`, timeout `10` seconds in `hooks.json`.
|
|
27
28
|
- `blocking/artifact_look_gate.py` runs on `PreToolUse`, matcher `Artifact|Skill`, timeout `10` seconds in `hooks.json`. It speaks only on an `Artifact` publish of a `.html` or `.htm` file.
|
|
29
|
+
- `blocking/artifact_dark_mode_gate.py` runs on `PreToolUse`, matcher `Artifact`, timeout `60` seconds in `hooks.json`.
|
|
28
30
|
|
|
29
31
|
## Proving it
|
|
30
32
|
|
|
@@ -40,6 +42,7 @@ Preconditions:
|
|
|
40
42
|
- **Step note.** Input is a tool call after a transcript message without a status line while the flag is on. Run `python -m pytest packages/claude-dev-env/hooks/blocking/test_step_note_gate.py -q`. The adjacent test observes a block until a status line appears.
|
|
41
43
|
- **Checked claim.** Input is a Write after hedged reasoning in the transcript. Run `python -m pytest packages/claude-dev-env/hooks/blocking/test_verify_before_acting.py -q`. The adjacent test observes a block and a logged blocked outcome.
|
|
42
44
|
- **Lifecycle skill.** Input is a `git commit` or `gh pr create` command with no `pr-lifecycle` invocation in the transcript. Run `python -m pytest packages/claude-dev-env/hooks/blocking/test_pr_lifecycle_skill_gate.py -q`. The adjacent test observes a denial, then a silent allow once the skill or its slash command appears.
|
|
45
|
+
- **Dark mode page.** Input is an Artifact publish of a page that themes `html` but leaves `body` to the publish wrapper. Run `python -m pytest packages/claude-dev-env/hooks/blocking/test_artifact_dark_mode_gate.py -q`. The adjacent test observes a denial that names the text and its contrast; a page that themes `body` passes. The render tests skip on a host with no Node Playwright and Chromium.
|
|
43
46
|
|
|
44
47
|
## Gotchas
|
|
45
48
|
|
package/hooks/hooks.json
CHANGED
|
@@ -152,9 +152,8 @@
|
|
|
152
152
|
"hooks": [
|
|
153
153
|
{
|
|
154
154
|
"type": "command",
|
|
155
|
-
"command": "python3 ${CLAUDE_PLUGIN_ROOT}/hooks/
|
|
156
|
-
"timeout":
|
|
157
|
-
"async": true
|
|
155
|
+
"command": "python3 ${CLAUDE_PLUGIN_ROOT}/hooks/blocking/artifact_dark_mode_gate.py",
|
|
156
|
+
"timeout": 60
|
|
158
157
|
}
|
|
159
158
|
]
|
|
160
159
|
},
|
|
@@ -278,7 +277,8 @@
|
|
|
278
277
|
{
|
|
279
278
|
"type": "command",
|
|
280
279
|
"command": "python3 ${CLAUDE_PLUGIN_ROOT}/hooks/lifecycle/nested_project_hooks.py",
|
|
281
|
-
"timeout": 1800
|
|
280
|
+
"timeout": 1800,
|
|
281
|
+
"async": true
|
|
282
282
|
}
|
|
283
283
|
]
|
|
284
284
|
},
|