Skip to content

Commit 5f9597b

Browse files
authored
Merge pull request #89 from full-stack-plugins/feat/rust-prompt-candidate
docs: archive CodeGuard prompt matcher correction
2 parents 82b82c1 + b5130e0 commit 5f9597b

8 files changed

Lines changed: 21 additions & 3 deletions

File tree

openspec/changes/2026-09-29-prompt-matcher-correction/.openspec.yaml renamed to openspec/changes/archive/2026-09-29-prompt-matcher-correction/.openspec.yaml

File renamed without changes.

openspec/changes/2026-09-29-prompt-matcher-correction/README.md renamed to openspec/changes/archive/2026-09-29-prompt-matcher-correction/README.md

File renamed without changes.

openspec/changes/2026-09-29-prompt-matcher-correction/design.md renamed to openspec/changes/archive/2026-09-29-prompt-matcher-correction/design.md

File renamed without changes.

openspec/changes/2026-09-29-prompt-matcher-correction/proposal.md renamed to openspec/changes/archive/2026-09-29-prompt-matcher-correction/proposal.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# Correct UserPromptSubmit trigger declarations
22

3+
## Why
4+
35
[Claude Code's Hooks reference](https://code.claude.com/docs/en/hooks) lists `UserPromptSubmit` among events without matcher support: the event fires for every submitted prompt. The plugin's three host manifests nevertheless declare a commit-keyword matcher. That declaration is not a host-side filter and makes the 120-second soft-gate timeout appear restricted to commit prompts.
46

7+
## What Changes
8+
59
Remove the unsupported matcher from all three mirrored manifests and state the real execution boundary: the Hook process starts for each prompt; its own `is_trigger` check must return before path probing, linter execution, Git inspection, or context output for ordinary questions. Preserve the existing soft commit-intent behavior and the separate PreToolUse Git gate. This correction does not claim that per-prompt process startup has been eliminated; the future Rust scheduler still needs a cheap default-host route.

openspec/changes/2026-09-29-prompt-matcher-correction/specs/hook-protocol/spec.md renamed to openspec/changes/archive/2026-09-29-prompt-matcher-correction/specs/hook-protocol/spec.md

File renamed without changes.

openspec/changes/2026-09-29-prompt-matcher-correction/tasks.md renamed to openspec/changes/archive/2026-09-29-prompt-matcher-correction/tasks.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
## Correction and acceptance
22

3-
- [x] 1. Add a failing test that all three `UserPromptSubmit` declarations omit matcher and a non-trigger prompt exits before environment or repository work. Red runs exposed all three matcher fields, then the premature `session_scope` call; see [acceptance](../../../tests/prompt-matcher-correction.md).
3+
- [x] 1. Add a failing test that all three `UserPromptSubmit` declarations omit matcher and a non-trigger prompt exits before environment or repository work. Red runs exposed all three matcher fields, then the premature `session_scope` call; see [acceptance](../../../../tests/prompt-matcher-correction.md).
44
- [x] 2. Remove the unsupported matcher from the three mirrored manifests and document the actual per-prompt host invocation and in-hook filter. Ordinary prompts now exit before session/worktree scoping; legacy soft commit-intent behavior remains.
55
- [x] 3. Run targeted tests, the plugin protocol and unit regressions, vendor offline/online checks, OpenSpec strict validation, and source diff checks. Evidence: 144/144 protocol, 654 Python unittests, 7 README parity and 5 real-tarball Node runtime tests; Ruff, vendor, strict validation, mirrors and diff checks passed. Installed-host latency remains unverified.
6-
- [ ] 4. Bump the plugin patch version, merge tested changes, publish the matching tag/Release, and synchronize only CodeGuard marketplace metadata while preserving unrelated user edits.
7-
- [ ] 5. Record tag, CI, market and candidate runtime evidence; sync/archive the completed OpenSpec delta without claiming installed-host performance or a completed Rust strict gate.
6+
- [x] 4. Bump to 0.18.1, merge tested changes in PR #88, publish the matching v0.18.1 tag/Release, and synchronize only CodeGuard marketplace metadata. Market commit `bf9433dc8dea39a9d8bbf929b5b3fa322bcb72ce` preserved the unrelated unstaged CodeReview edit.
7+
- [x] 5. Record tag, four passing CI jobs, market and candidate runtime evidence in the acceptance record; sync/archive the completed OpenSpec delta without claiming installed-host performance or a completed Rust strict gate.

‎openspec/specs/hook-protocol/spec.md‎

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -227,3 +227,15 @@ The plugin candidate MUST pin an exact published package version, source revisio
227227
- **WHEN** the archive or active binary digest differs from the pin
228228
- **THEN** installation or dispatch remains incomplete and no fallback checker is started
229229

230+
### Requirement: Prompt intent filtering SHALL not depend on a host matcher
231+
232+
The Claude `UserPromptSubmit` registration and its mirrored host declarations MUST NOT use a text matcher. The Hook MUST accept that the host invokes it for every prompt. For a non-triggering prompt, the handler MUST return without environment probing, repository discovery, native checker execution, or conversation context output. A triggering prompt MAY use the legacy soft reminder, but its result MUST NOT replace command-time Git verification or claim delivery approval.
233+
234+
#### Scenario: Ordinary prompt reaches the Hook
235+
- **WHEN** the host delivers a prompt without a CodeGuard submission intent
236+
- **THEN** the Hook exits 0 with no check process and no injected context
237+
238+
#### Scenario: Commit request reaches the Hook
239+
- **WHEN** the host delivers a commit-intent prompt
240+
- **THEN** the existing soft reminder may run while the later real Git command remains subject to PreToolUse verification
241+

‎tests/prompt-matcher-correction.md‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,5 @@
77
最终本地证据:目标测试通过;`tests/run_all.py` 144/144 通过、零跳过;Python 3.13.5 `unittest discover` 654 项通过;`tests.test_readme_parity` 7 项通过;真实候选 tarball 的 Node runtime 测试 5/5 通过。Ruff、OpenSpec strict、vendor 离线/在线 check、协议文档三份镜像比较、市场定向生成校验和 `git diff --check` 均退出 0。在线 vendor 对照 `codeguard-skills@v0.1.3` 提交 `33d737f4cf46e5d6d1d1f8dce85d7923e4ad626f`。
88

99
本次减少的是普通提示进入仓库观察的工作量,并纠正无效配置;**宿主仍会为每条提示启动 Hook 进程**。未在已安装 Claude Code 中测量启动延迟,未切换默认 Rust 候选,也未证明完整交付门禁或 Rust OpenSpec 总计划已完成。
10+
11+
远端验收:插件 [PR #88](https://github.com/full-stack-plugins/codeguard-plugin/pull/88) 的 `rust-runtime-contract` 与 Python 3.11、3.12、3.13 三组 vendor 检查全部通过,合并提交为 `82b82c1ca86c64d6a8112b93e0ac401ba6a23448`。[v0.18.1 Release](https://github.com/full-stack-plugins/codeguard-plugin/releases/tag/v0.18.1) 指向该提交。市场 `sync-marketplaces --plugin=codeguard --remote` 通过;仅 CodeGuard 元数据提交并推送为 `bf9433dc8dea39a9d8bbf929b5b3fa322bcb72ce`,仓库中原有 CodeReview 未提交修改仍保留。Rust 候选真实 tarball 的 5 项 Node 测试通过,但默认钩子仍是 Python。

0 commit comments

Comments
 (0)