Skip to content

Commit 27edaeb

Browse files
committed
fix: correct prompt matcher timing in CodeGuard 0.18.1
1 parent d573377 commit 27edaeb

23 files changed

Lines changed: 103 additions & 12 deletions

File tree

‎.agents/plugins/marketplace.json‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,20 +9,20 @@
99
"source": {
1010
"source": "url",
1111
"url": "https://github.com/full-stack-plugins/codeguard-plugin.git",
12-
"ref": "v0.18.0"
12+
"ref": "v0.18.1"
1313
},
1414
"policy": {
1515
"installation": "AVAILABLE",
1616
"authentication": "ON_USE"
1717
},
1818
"category": "Developer Tools",
19-
"version": "0.18.0",
19+
"version": "0.18.1",
2020
"description": "Evidence-backed code checks and Git content gates for AI assistants, with Maven/Gradle module impact analysis. Save hooks provide feedback; unverified checks are explicit.",
21-
"icon": "https://cdn.jsdelivr.net/gh/full-stack-plugins/codeguard-plugin@v0.18.0/assets/official-logo.png",
21+
"icon": "https://cdn.jsdelivr.net/gh/full-stack-plugins/codeguard-plugin@v0.18.1/assets/official-logo.png",
2222
"interface": {
2323
"displayName": "代码规范守卫",
2424
"shortDescription": "Trustworthy code checks and Java impact analysis",
25-
"logo": "https://cdn.jsdelivr.net/gh/full-stack-plugins/codeguard-plugin@v0.18.0/assets/official-logo.png"
25+
"logo": "https://cdn.jsdelivr.net/gh/full-stack-plugins/codeguard-plugin@v0.18.1/assets/official-logo.png"
2626
}
2727
}
2828
]

‎.claude-plugin/marketplace.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
{
88
"name": "codeguard",
99
"description": "Evidence-backed code checks and Git content gates for AI assistants, with Maven/Gradle module impact analysis. Save hooks provide feedback; unverified checks are explicit.",
10-
"version": "0.18.0",
10+
"version": "0.18.1",
1111
"source": "./"
1212
}
1313
]

‎.codex-plugin/plugin.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "codeguard",
3-
"version": "0.18.0+codex.20260929",
3+
"version": "0.18.1+codex.20260929",
44
"description": "Evidence-backed code checks and Git content gates for AI assistants, with Maven/Gradle module impact analysis. Save hooks provide feedback; unverified checks are explicit.",
55
"author": {
66
"name": "Full Stack Skills / PartMe.AI",

‎.zcode-plugin/plugin.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"en": "代码规范守卫",
66
"zh-CN": "代码规范检查"
77
},
8-
"version": "0.18.0",
8+
"version": "0.18.1",
99
"description": "Evidence-backed code checks and Git content gates for AI assistants, with Maven/Gradle module impact analysis. Save hooks provide feedback; unverified checks are explicit.",
1010
"description_i18n": {
1111
"en": "Evidence-backed code checks and Git content gates for AI assistants, with Maven/Gradle module impact analysis. Save hooks provide feedback; unverified checks are explicit.",

‎README.md‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,8 @@ The installed plugin version is recorded in its manifests. The architecture refa
3535

3636
Hooks do not run in every host command surface automatically. Historical V0.5.4 installation evidence is not acceptance of this version in Codex, ZCode or Kimi.
3737

38+
Claude Code does not support a matcher on `UserPromptSubmit`: it starts the legacy Python Hook for every submitted prompt. The Hook returns before environment or repository work when its own intent filter does not match. A commit-intent prompt may still run the legacy soft check; only the actual Git command reaches the PreToolUse gate. The manifest cannot avoid per-prompt process startup, and installed-host latency has not been measured.
39+
3840
### Verdict contract
3941

4042
| Status | Meaning | passed |

‎README.zh-CN.md‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,8 @@ node runtime/codeguard_runtime.cjs verify
3535

3636
钩子不会自动覆盖宿主的每个命令入口。历史 V0.5.4 安装证据不能代表当前版本已在 Codex、ZCode、Kimi 验收。
3737

38+
Claude Code 的 `UserPromptSubmit` 不支持 matcher:每次提交提示都会启动旧 Python Hook。内部意图过滤未命中时,Hook 会在环境或仓库探测前退出;提交意图仍可能执行旧软检查,实际 Git 命令才进入 PreToolUse 门禁。清单无法消除每条提示的进程启动,已安装宿主的延迟尚未实测。
39+
3840
### 判定契约
3941

4042
| 状态 | 含义 | passed |

‎com.github.copilot/hooks/__protocol__.md‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@
2020
| PostToolUse `Write\|Edit\|MultiEdit` | `post_tool_lint.py` | JSON `{"hookSpecificOutput":{"hookEventName":"PostToolUse","additionalContext":"..."}, "systemMessage":"..."}` | 仅内部错误时 | 0 | 否 |
2121
| Stop | `stop_summary.py` | 人类可读会话摘要 | 仅内部错误时 | 0 | 否 |
2222

23+
[Claude Code Hooks reference](https://code.claude.com/docs/en/hooks) 说明 `UserPromptSubmit` 不支持 matcher,宿主每次收到用户提示都会启动该 Hook。三份 `hooks.json` 因此不声明关键词 matcher;`user_prompt_validator.py::main` 先执行 `is_trigger`,未命中时在会话/worktree 归属、PATH 探测、仓库发现和原生门禁前退出且无对话输出。命中时旧软门禁仍可能运行;真实提交/推送只能由 PreToolUse 的命令时门禁判断。此变更不证明宿主进程启动开销已经消失或已实测。
24+
2325
实现定位(**符号而非行号**——行号随每次重构腐烂,符号不腐;v0.8.0 起弃用行号指针):
2426
- SessionStart 摘要:`hooks/env_check.py::main`(含双副本告警段)。
2527
- UserPromptSubmit JSON:`hooks/user_prompt_validator.py::main`(非 git 目录跳过说明 `_non_git_note`)与 `::is_trigger`。

‎com.github.copilot/hooks/hooks.json‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
],
1616
"UserPromptSubmit": [
1717
{
18-
"matcher": "提交|commit|push|提交代码|部署|deploy",
1918
"hooks": [
2019
{
2120
"type": "command",

‎dev.openhands/hooks/__protocol__.md‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@
2020
| PostToolUse `Write\|Edit\|MultiEdit` | `post_tool_lint.py` | JSON `{"hookSpecificOutput":{"hookEventName":"PostToolUse","additionalContext":"..."}, "systemMessage":"..."}` | 仅内部错误时 | 0 | 否 |
2121
| Stop | `stop_summary.py` | 人类可读会话摘要 | 仅内部错误时 | 0 | 否 |
2222

23+
[Claude Code Hooks reference](https://code.claude.com/docs/en/hooks) 说明 `UserPromptSubmit` 不支持 matcher,宿主每次收到用户提示都会启动该 Hook。三份 `hooks.json` 因此不声明关键词 matcher;`user_prompt_validator.py::main` 先执行 `is_trigger`,未命中时在会话/worktree 归属、PATH 探测、仓库发现和原生门禁前退出且无对话输出。命中时旧软门禁仍可能运行;真实提交/推送只能由 PreToolUse 的命令时门禁判断。此变更不证明宿主进程启动开销已经消失或已实测。
24+
2325
实现定位(**符号而非行号**——行号随每次重构腐烂,符号不腐;v0.8.0 起弃用行号指针):
2426
- SessionStart 摘要:`hooks/env_check.py::main`(含双副本告警段)。
2527
- UserPromptSubmit JSON:`hooks/user_prompt_validator.py::main`(非 git 目录跳过说明 `_non_git_note`)与 `::is_trigger`。

‎dev.openhands/hooks/hooks.json‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
],
1616
"UserPromptSubmit": [
1717
{
18-
"matcher": "提交|commit|push|提交代码|部署|deploy",
1918
"hooks": [
2019
{
2120
"type": "command",

0 commit comments

Comments
 (0)