claude-spotter 1.4.11 → 1.4.13
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.
- package/CHANGELOG.md +69 -0
- package/README.ja.md +15 -0
- package/README.md +15 -0
- package/package.json +1 -1
- package/src/hooks/lib.mjs +2 -6
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,74 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 1.4.13
|
|
4
|
+
|
|
5
|
+
**Spotter 監査文面の末尾「監査役を明示してください」念押し行を削除**。
|
|
6
|
+
`additionalContext` / pending text の末尾に入っていた 2 行 (UserPromptSubmit:
|
|
7
|
+
「使う場合は『Spotter の推奨に従い〜』のように監査役の指摘を明示してください。」、
|
|
8
|
+
Stop deferred delivery:「応答には『Spotter からの指摘を受けて〜』のように
|
|
9
|
+
監査役の介入を明示してください。」) が、毎ターン主役 AI の文脈に積もって邪魔になる
|
|
10
|
+
という運用上のフィードバックを反映。ヘッダー `[Spotter からの推奨ツール]` /
|
|
11
|
+
`[Spotter からの指摘]` 自体が出典明示を担っているため、§12.2 / §12.3 の透明化原則は
|
|
12
|
+
ヘッダーで維持し、念押し行のみを落とす。Claude / Codex 両 host が同じ
|
|
13
|
+
`formatTransparentContext` / `formatTransparentBlockReason` を共有しているので
|
|
14
|
+
hook parity は自動的に維持される。
|
|
15
|
+
|
|
16
|
+
### 変更点
|
|
17
|
+
|
|
18
|
+
- **編集 [src/hooks/lib.mjs](src/hooks/lib.mjs)**:
|
|
19
|
+
`formatTransparentContext` / `formatTransparentBlockReason` から末尾の空行 +
|
|
20
|
+
念押し行を削除。コメントを「header 自体が出典明示を担う」旨に書き換え。
|
|
21
|
+
- **編集 [test/hooks.test.mjs](test/hooks.test.mjs)**:
|
|
22
|
+
逐語アサート 2 件を本体に追従。
|
|
23
|
+
|
|
24
|
+
### 検証
|
|
25
|
+
|
|
26
|
+
- `node --test` 334 tests / 333 pass / 1 skip 緑。
|
|
27
|
+
- Codex hook 側の expected (`test/codex-hook-cmd.test.mjs`) はヘッダー文字列
|
|
28
|
+
`Spotter からの指摘` だけを正規表現マッチしているため無変更で pass。
|
|
29
|
+
|
|
30
|
+
## 1.4.12
|
|
31
|
+
|
|
32
|
+
**macOS/Homebrew install verification docs**。npm registry からの clean global install 後に
|
|
33
|
+
`spotter install` と `spotter codex-hook install` が通ること、Codex hook が versioned
|
|
34
|
+
Homebrew Cellar Node path ではなく安定 symlink を使うことを README に明記した。
|
|
35
|
+
|
|
36
|
+
### 変更点
|
|
37
|
+
|
|
38
|
+
- **編集 [README.md](README.md) / [README.ja.md](README.ja.md)**:
|
|
39
|
+
macOS Homebrew Node 環境では Codex hook command が `/opt/homebrew/bin/node` を使うこと、
|
|
40
|
+
release install smoke 手順 (`npm uninstall -g`, `npm install -g`, `spotter install -y`,
|
|
41
|
+
`spotter codex-hook install`) を追加。
|
|
42
|
+
|
|
43
|
+
### 検証
|
|
44
|
+
|
|
45
|
+
- npm registry からの実インストールで確認:
|
|
46
|
+
`npm uninstall -g claude-spotter`, `npm install -g claude-spotter`,
|
|
47
|
+
`spotter --version`, `spotter install -y`, `spotter codex-hook install` が exit 0。
|
|
48
|
+
|
|
49
|
+
## 1.4.11
|
|
50
|
+
|
|
51
|
+
**macOS Homebrew Node の versioned Cellar path を Codex hook に残さない修正**。
|
|
52
|
+
`spotter codex-hook install` が `/opt/homebrew/Cellar/node/<version>/bin/node` を hook command に
|
|
53
|
+
書くと、Homebrew の Node 更新後に Codex hook が古い Node を指したまま壊れるため、現在の
|
|
54
|
+
Node 実体と一致する PATH 上の安定 symlink を優先するようにした。
|
|
55
|
+
|
|
56
|
+
### 変更点
|
|
57
|
+
|
|
58
|
+
- **編集 [src/cli/codex-hook-cmd.mjs](src/cli/codex-hook-cmd.mjs)**:
|
|
59
|
+
`resolveCodexHookNodePath()` を追加。PATH 上の `node` が `process.execPath` と同じ realpath を
|
|
60
|
+
指す場合は、その安定パスを hook command に使う。該当しない環境では従来通り
|
|
61
|
+
`process.execPath` に fallback するため、Windows / WSL2 の挙動は維持される。
|
|
62
|
+
- 既存の Spotter-owned Codex hook が古い Cellar Node path を指している場合、再実行で現在の
|
|
63
|
+
stable Node path と npm global package path に書き換える。Caveat など他 tool の hook は保持する。
|
|
64
|
+
|
|
65
|
+
### 検証
|
|
66
|
+
|
|
67
|
+
- `node --test` 334 tests / 333 pass / 1 skip 緑。
|
|
68
|
+
- npm registry からの実インストールで確認:
|
|
69
|
+
`npm uninstall -g claude-spotter`, `npm install -g claude-spotter`,
|
|
70
|
+
`spotter --version`, `spotter install -y`, `spotter codex-hook install` が exit 0。
|
|
71
|
+
|
|
3
72
|
## 1.4.10
|
|
4
73
|
|
|
5
74
|
**Claude host primary auditor: Codex CLI 検出で自動採用、なければ Haiku の 2 段選択へ**。
|
package/README.ja.md
CHANGED
|
@@ -43,6 +43,11 @@ cd your-project
|
|
|
43
43
|
spotter install
|
|
44
44
|
```
|
|
45
45
|
|
|
46
|
+
macOS の Homebrew Node 環境では、Codex hook command の Node パスに現在の実体と一致する
|
|
47
|
+
安定 symlink (`/opt/homebrew/bin/node`) を使います。
|
|
48
|
+
`/opt/homebrew/Cellar/node/<version>/...` のような version 固定パスを書かないため、
|
|
49
|
+
Homebrew で Node が更新されても Codex hook が古い Node パスに取り残されません。
|
|
50
|
+
|
|
46
51
|
`v0.3.0` 以降は**プロジェクト単位の明示的 install** を採用しています (v0.2 までの `postinstall` 自動登録はデーモン増殖の主因だったため撤回)。各プロジェクトの `.claude/settings.json` に hook を登録し、そのプロジェクトでの Claude Code セッションのみで有効になります。
|
|
47
52
|
Codex CLI が使える環境では、同じ `spotter install` が user-level の Codex native hooks も登録します。実際に動くプロジェクトは `spotter install` が作る `.spotter/marker.json` で制限されるため、無関係な Codex セッションでは Spotter は起動しません。
|
|
48
53
|
Codex 側では現行の `[features].hooks = true` を有効化し、互換のため旧 `codex_hooks` diagnostics output も認識します。
|
|
@@ -53,6 +58,16 @@ Spotter を upgrade した後、release note で hook 設定変更が案内さ
|
|
|
53
58
|
spotter uninstall # このプロジェクトの hook 登録を解除
|
|
54
59
|
```
|
|
55
60
|
|
|
61
|
+
リリース時の npm install smoke:
|
|
62
|
+
|
|
63
|
+
```bash
|
|
64
|
+
npm uninstall -g claude-spotter
|
|
65
|
+
npm install -g claude-spotter
|
|
66
|
+
spotter --version
|
|
67
|
+
spotter install -y
|
|
68
|
+
spotter codex-hook install
|
|
69
|
+
```
|
|
70
|
+
|
|
56
71
|
## 動作要件
|
|
57
72
|
|
|
58
73
|
- **Node.js 22.5 以上**
|
package/README.md
CHANGED
|
@@ -43,6 +43,11 @@ cd your-project
|
|
|
43
43
|
spotter install
|
|
44
44
|
```
|
|
45
45
|
|
|
46
|
+
On macOS with Homebrew Node, Codex hook commands use the stable
|
|
47
|
+
`/opt/homebrew/bin/node` symlink when it resolves to the current Node binary,
|
|
48
|
+
instead of a versioned `/opt/homebrew/Cellar/node/<version>/...` path. That keeps
|
|
49
|
+
Codex hooks working across Homebrew Node upgrades.
|
|
50
|
+
|
|
46
51
|
Since `v0.3.0`, Spotter requires **explicit per-project install** (the earlier `postinstall` auto-registration was the leading cause of orphan daemons). `spotter install` writes hooks into the project's `.claude/settings.json`; the audit is then active only in Claude Code sessions for that project.
|
|
47
52
|
When the Codex CLI is available, the same `spotter install` also registers user-level Codex native hooks. Project activation still depends on the same per-project `.spotter/marker.json`, so unrelated Codex sessions do not trigger Spotter.
|
|
48
53
|
For Codex, install enables the current `[features].hooks = true` flag and still recognizes older `codex_hooks` diagnostics output for compatibility.
|
|
@@ -53,6 +58,16 @@ After upgrading Spotter, re-run `spotter install` in each installed project when
|
|
|
53
58
|
spotter uninstall # remove hooks from this project
|
|
54
59
|
```
|
|
55
60
|
|
|
61
|
+
Release install smoke:
|
|
62
|
+
|
|
63
|
+
```bash
|
|
64
|
+
npm uninstall -g claude-spotter
|
|
65
|
+
npm install -g claude-spotter
|
|
66
|
+
spotter --version
|
|
67
|
+
spotter install -y
|
|
68
|
+
spotter codex-hook install
|
|
69
|
+
```
|
|
70
|
+
|
|
56
71
|
## Requirements
|
|
57
72
|
|
|
58
73
|
- **Node.js 22.5+**
|
package/package.json
CHANGED
package/src/hooks/lib.mjs
CHANGED
|
@@ -129,14 +129,12 @@ export function die(message, exitCode = 2) {
|
|
|
129
129
|
}
|
|
130
130
|
|
|
131
131
|
export function formatTransparentContext(missingTools) {
|
|
132
|
-
// §12.2: transparent phrasing —
|
|
132
|
+
// §12.2: transparent phrasing — header `[Spotter からの推奨ツール]` 自体が出典明示を担う。
|
|
133
133
|
const lines = missingTools.map((m) => `- \`${m.name}\`: ${m.reason}`);
|
|
134
134
|
return [
|
|
135
135
|
'[Spotter からの推奨ツール]',
|
|
136
136
|
'このプロンプトに応答する前に、以下のツールを使うべきか検討してください。',
|
|
137
137
|
...lines,
|
|
138
|
-
'',
|
|
139
|
-
'使う場合は「Spotter の推奨に従い〜」のように監査役の指摘を明示してください。',
|
|
140
138
|
].join('\n');
|
|
141
139
|
}
|
|
142
140
|
|
|
@@ -156,13 +154,11 @@ export async function recordClaudeHookEvent({ projectRoot, event, writeError } =
|
|
|
156
154
|
}
|
|
157
155
|
|
|
158
156
|
export function formatTransparentBlockReason(missingTools) {
|
|
159
|
-
// §12.3: transparent phrasing
|
|
157
|
+
// §12.3: transparent phrasing — header `[Spotter からの指摘]` 自体が出典明示を担う。
|
|
160
158
|
const lines = missingTools.map((m) => `- \`${m.name}\`: ${m.reason}`);
|
|
161
159
|
return [
|
|
162
160
|
'[Spotter からの指摘]',
|
|
163
161
|
'上記応答ではツールが不足している可能性があります。以下を検討し、必要なら呼び出した上で応答を補正してください。',
|
|
164
162
|
...lines,
|
|
165
|
-
'',
|
|
166
|
-
'応答には「Spotter からの指摘を受けて〜」のように監査役の介入を明示してください。',
|
|
167
163
|
].join('\n');
|
|
168
164
|
}
|