@ironbee-ai/cli 0.8.2 → 0.9.0

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.
Files changed (143) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/README.md +48 -17
  3. package/dist/clients/claude/commands/ironbee-verify.md +19 -106
  4. package/dist/clients/claude/hooks/clear-verdict.d.ts.map +1 -1
  5. package/dist/clients/claude/hooks/clear-verdict.js +25 -4
  6. package/dist/clients/claude/hooks/clear-verdict.js.map +1 -1
  7. package/dist/clients/claude/hooks/require-verdict.d.ts +3 -3
  8. package/dist/clients/claude/hooks/require-verdict.d.ts.map +1 -1
  9. package/dist/clients/claude/hooks/require-verdict.js +26 -8
  10. package/dist/clients/claude/hooks/require-verdict.js.map +1 -1
  11. package/dist/clients/claude/hooks/require-verification.d.ts +6 -5
  12. package/dist/clients/claude/hooks/require-verification.d.ts.map +1 -1
  13. package/dist/clients/claude/hooks/require-verification.js +20 -17
  14. package/dist/clients/claude/hooks/require-verification.js.map +1 -1
  15. package/dist/clients/claude/hooks/track-action-monitor.d.ts.map +1 -1
  16. package/dist/clients/claude/hooks/track-action-monitor.js +4 -1
  17. package/dist/clients/claude/hooks/track-action-monitor.js.map +1 -1
  18. package/dist/clients/claude/hooks/track-action.d.ts +11 -8
  19. package/dist/clients/claude/hooks/track-action.d.ts.map +1 -1
  20. package/dist/clients/claude/hooks/track-action.js +14 -9
  21. package/dist/clients/claude/hooks/track-action.js.map +1 -1
  22. package/dist/clients/claude/index.d.ts.map +1 -1
  23. package/dist/clients/claude/index.js +79 -18
  24. package/dist/clients/claude/index.js.map +1 -1
  25. package/dist/clients/claude/platforms/command-verify.backend.md +74 -0
  26. package/dist/clients/claude/platforms/command-verify.browser.md +108 -0
  27. package/dist/clients/claude/platforms/command-verify.node.md +67 -0
  28. package/dist/clients/claude/platforms/rule.backend.md +23 -0
  29. package/dist/clients/claude/platforms/rule.browser.md +17 -0
  30. package/dist/clients/claude/{fragments → platforms}/rule.node.md +3 -3
  31. package/dist/clients/claude/platforms/skill.backend.md +65 -0
  32. package/dist/clients/claude/platforms/skill.browser.md +31 -0
  33. package/dist/clients/claude/{fragments → platforms}/skill.node.md +2 -2
  34. package/dist/clients/claude/rules/ironbee-verification.md +14 -13
  35. package/dist/clients/claude/skills/ironbee-verification.md +19 -49
  36. package/dist/clients/cursor/commands/ironbee-verify/SKILL.md +21 -108
  37. package/dist/clients/cursor/hooks/clear-verdict.d.ts.map +1 -1
  38. package/dist/clients/cursor/hooks/clear-verdict.js +31 -5
  39. package/dist/clients/cursor/hooks/clear-verdict.js.map +1 -1
  40. package/dist/clients/cursor/hooks/require-verdict.d.ts +1 -1
  41. package/dist/clients/cursor/hooks/require-verdict.d.ts.map +1 -1
  42. package/dist/clients/cursor/hooks/require-verdict.js +27 -6
  43. package/dist/clients/cursor/hooks/require-verdict.js.map +1 -1
  44. package/dist/clients/cursor/hooks/require-verification.d.ts.map +1 -1
  45. package/dist/clients/cursor/hooks/require-verification.js +9 -5
  46. package/dist/clients/cursor/hooks/require-verification.js.map +1 -1
  47. package/dist/clients/cursor/hooks/track-action-monitor.d.ts.map +1 -1
  48. package/dist/clients/cursor/hooks/track-action-monitor.js +4 -1
  49. package/dist/clients/cursor/hooks/track-action-monitor.js.map +1 -1
  50. package/dist/clients/cursor/hooks/track-action.d.ts +14 -12
  51. package/dist/clients/cursor/hooks/track-action.d.ts.map +1 -1
  52. package/dist/clients/cursor/hooks/track-action.js +25 -16
  53. package/dist/clients/cursor/hooks/track-action.js.map +1 -1
  54. package/dist/clients/cursor/index.d.ts.map +1 -1
  55. package/dist/clients/cursor/index.js +45 -11
  56. package/dist/clients/cursor/index.js.map +1 -1
  57. package/dist/clients/cursor/platforms/command-verify.backend.md +74 -0
  58. package/dist/clients/cursor/platforms/command-verify.browser.md +108 -0
  59. package/dist/clients/cursor/platforms/command-verify.node.md +67 -0
  60. package/dist/clients/cursor/platforms/rule.backend.md +23 -0
  61. package/dist/clients/cursor/platforms/rule.browser.md +17 -0
  62. package/dist/clients/cursor/{fragments → platforms}/rule.node.md +3 -3
  63. package/dist/clients/cursor/platforms/skill.backend.md +65 -0
  64. package/dist/clients/cursor/platforms/skill.browser.md +31 -0
  65. package/dist/clients/cursor/{fragments → platforms}/skill.node.md +2 -2
  66. package/dist/clients/cursor/rules/ironbee-verification.mdc +14 -13
  67. package/dist/clients/cursor/skills/ironbee-verification.md +19 -49
  68. package/dist/commands/backend.d.ts +17 -0
  69. package/dist/commands/backend.d.ts.map +1 -0
  70. package/dist/commands/backend.js +58 -0
  71. package/dist/commands/backend.js.map +1 -0
  72. package/dist/commands/browser.d.ts +19 -0
  73. package/dist/commands/browser.d.ts.map +1 -0
  74. package/dist/commands/browser.js +60 -0
  75. package/dist/commands/browser.js.map +1 -0
  76. package/dist/commands/config.d.ts +45 -10
  77. package/dist/commands/config.d.ts.map +1 -1
  78. package/dist/commands/config.js +80 -28
  79. package/dist/commands/config.js.map +1 -1
  80. package/dist/commands/cycle-toggle.d.ts +89 -0
  81. package/dist/commands/cycle-toggle.d.ts.map +1 -0
  82. package/dist/commands/cycle-toggle.js +264 -0
  83. package/dist/commands/cycle-toggle.js.map +1 -0
  84. package/dist/commands/disable-verification.d.ts.map +1 -1
  85. package/dist/commands/disable-verification.js +5 -2
  86. package/dist/commands/disable-verification.js.map +1 -1
  87. package/dist/commands/enable-verification.d.ts.map +1 -1
  88. package/dist/commands/enable-verification.js +5 -2
  89. package/dist/commands/enable-verification.js.map +1 -1
  90. package/dist/commands/node.d.ts +16 -0
  91. package/dist/commands/node.d.ts.map +1 -0
  92. package/dist/commands/node.js +57 -0
  93. package/dist/commands/node.js.map +1 -0
  94. package/dist/commands/verification-toggle.d.ts +18 -1
  95. package/dist/commands/verification-toggle.d.ts.map +1 -1
  96. package/dist/commands/verification-toggle.js +96 -21
  97. package/dist/commands/verification-toggle.js.map +1 -1
  98. package/dist/hooks/core/actions.d.ts +20 -2
  99. package/dist/hooks/core/actions.d.ts.map +1 -1
  100. package/dist/hooks/core/actions.js.map +1 -1
  101. package/dist/hooks/core/file-diff.d.ts +17 -0
  102. package/dist/hooks/core/file-diff.d.ts.map +1 -1
  103. package/dist/hooks/core/file-diff.js +72 -0
  104. package/dist/hooks/core/file-diff.js.map +1 -1
  105. package/dist/hooks/core/tool-use-stash.d.ts +7 -1
  106. package/dist/hooks/core/tool-use-stash.d.ts.map +1 -1
  107. package/dist/hooks/core/tool-use-stash.js.map +1 -1
  108. package/dist/hooks/core/verify-gate.d.ts.map +1 -1
  109. package/dist/hooks/core/verify-gate.js +44 -14
  110. package/dist/hooks/core/verify-gate.js.map +1 -1
  111. package/dist/index.js +9 -6
  112. package/dist/index.js.map +1 -1
  113. package/dist/lib/config.d.ts +218 -36
  114. package/dist/lib/config.d.ts.map +1 -1
  115. package/dist/lib/config.js +359 -95
  116. package/dist/lib/config.js.map +1 -1
  117. package/dist/lib/gitignore.d.ts +26 -11
  118. package/dist/lib/gitignore.d.ts.map +1 -1
  119. package/dist/lib/gitignore.js +71 -24
  120. package/dist/lib/gitignore.js.map +1 -1
  121. package/dist/lib/platform-section.d.ts +126 -0
  122. package/dist/lib/platform-section.d.ts.map +1 -0
  123. package/dist/lib/platform-section.js +279 -0
  124. package/dist/lib/platform-section.js.map +1 -0
  125. package/package.json +1 -1
  126. package/dist/clients/claude/fragments/command-verify.node.md +0 -33
  127. package/dist/clients/cursor/fragments/command-verify.node.md +0 -33
  128. package/dist/commands/backend-toggle.d.ts +0 -45
  129. package/dist/commands/backend-toggle.d.ts.map +0 -1
  130. package/dist/commands/backend-toggle.js +0 -192
  131. package/dist/commands/backend-toggle.js.map +0 -1
  132. package/dist/commands/disable-backend.d.ts +0 -14
  133. package/dist/commands/disable-backend.d.ts.map +0 -1
  134. package/dist/commands/disable-backend.js +0 -34
  135. package/dist/commands/disable-backend.js.map +0 -1
  136. package/dist/commands/enable-backend.d.ts +0 -15
  137. package/dist/commands/enable-backend.d.ts.map +0 -1
  138. package/dist/commands/enable-backend.js +0 -35
  139. package/dist/commands/enable-backend.js.map +0 -1
  140. package/dist/lib/runtime-section.d.ts +0 -118
  141. package/dist/lib/runtime-section.d.ts.map +0 -1
  142. package/dist/lib/runtime-section.js +0 -256
  143. package/dist/lib/runtime-section.js.map +0 -1
package/CHANGELOG.md CHANGED
@@ -1,5 +1,17 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.9.0 (2026-05-11)
4
+
5
+ ### Features
6
+
7
+ * **backend:** support backend platform ([#10](https://github.com/ironbee-ai/ironbee-cli/issues/10)) ([516aad3](https://github.com/ironbee-ai/ironbee-cli/commit/516aad32915d05da07e971fa151678652d97b5b4))
8
+
9
+ ## 0.8.3 (2026-05-09)
10
+
11
+ ### Features
12
+
13
+ * **config:** optional .ironbee/config.local.json personal-override layer ([770c2f3](https://github.com/ironbee-ai/ironbee-cli/commit/770c2f333f5d1d9146aaafb6fd975c5966e1d681))
14
+
3
15
  ## 0.8.2 (2026-05-08)
4
16
 
5
17
  ### Features
package/README.md CHANGED
@@ -115,15 +115,37 @@ ironbee import --all-projects --since 6m --concurrency 2
115
115
  - `--concurrency <N>` — parallel sessions (default 4, clamped to `[1, 32]`); also configurable via `import.concurrency` in `~/.ironbee/config.json` or `<project>/.ironbee/config.json`
116
116
 
117
117
 
118
- ### Optional: enable Node backend verification
118
+ ### Optional: opt out of the browser cycle
119
119
 
120
120
  ```bash
121
- ironbee enable-backend node
121
+ ironbee browser disable
122
122
  ```
123
123
 
124
- Run this once per project that has Node backend code you want IronBee to gate. It writes opinionated default `verifyPatterns` (e.g. `server/**`, `pages/api/**`, `**/server.{ts,js,mjs,cjs}`) under `backend.node.verifyPatterns` in the project config. From then on, edits to matching paths require Node-cycle verification (connect + probes/logs) alongside any browser-cycle verification.
124
+ The **browser cycle** is the default-on cycle every code-file edit (40+ extensions: `.ts`, `.tsx`, `.css`, `.html`, `.py`, `.go`, `.java`, …) requires browser-driven verification (navigate / screenshot / aria / console). Run `browser disable` for projects where you don't want browser-cycle enforcement (e.g. backend-only services where only `node enable` / `backend enable` apply). It writes `browser.verifyPatterns: []` to override the legacy 40+ extension default; customizations of `alwaysRequired` / `evidencePaths` / `additionalVerifyPatterns` are preserved.
125
125
 
126
- To revert: `ironbee disable-backend node`. This empties `verifyPatterns` (no enforcement) but preserves any customizations you made to `alwaysRequired` / `evidencePaths`, so re-enabling later restores your tuned setup.
126
+ To re-enable: `ironbee browser enable` strips the `verifyPatterns: []` override so the code defaults (legacy 40+ extension list) flow back in at runtime. `config.json` stays minimal; the default list is NOT materialized into the file (it lives in code and tracks the CLI version automatically).
127
+
128
+ ### Optional: enable Node.js runtime debug verification
129
+
130
+ ```bash
131
+ ironbee node enable
132
+ ```
133
+
134
+ Run this once per project whose backend is Node.js and you want IronBee to gate at the runtime level (V8 inspector probes via `node-devtools`). It writes a minimal `{ "node": {} }` block to config — code defaults (e.g. `server/**`, `pages/api/**`, `**/server.{ts,js,mjs,cjs}`) flow in at runtime; nothing is materialized into the file. From then on, edits to matching paths require Node-cycle verification (connect + probes/logs) alongside any browser-cycle verification. To customize, set `node.verifyPatterns` (replaces defaults) or `node.additionalVerifyPatterns` (appends).
135
+
136
+ To revert: `ironbee node disable`. With no customizations the entire `node` block is dropped (clean config). With customizations or a lower-layer override, writes `verifyPatterns: []` (hard kill, preserves `alwaysRequired` / `evidencePaths` / `additionalVerifyPatterns` so re-enabling later restores your tuned setup).
137
+
138
+ ### Optional: enable runtime-agnostic backend protocol verification
139
+
140
+ ```bash
141
+ ironbee backend enable
142
+ ```
143
+
144
+ Activates the **backend protocol cycle** — drives real HTTP / gRPC / GraphQL / WebSocket calls against your running backend service via the `backend-devtools` MCP (`bedt_*` tools) and verifies the responses. Works for any backend runtime: Node, Java, Python, Go, Rust, Ruby, .NET, PHP, Elixir, Kotlin, Scala. The command writes a minimal `{ "backend": {} }` block to config — code defaults (multi-language paths covering `server/**`, `api/**`, `routes/**`, `controllers/**`, `handlers/**`, `services/**`) flow in at runtime.
145
+
146
+ The backend cycle is independent of the node cycle — node attaches to a Node.js process and sets non-blocking debug probes; backend drives the wire protocol from outside. Both can be enabled simultaneously; both must pass.
147
+
148
+ To revert: `ironbee backend disable` (drops the block clean if no customizations / lower-layer override; otherwise hard-kills via `verifyPatterns: []`).
127
149
 
128
150
  ### Optional: monitoring-only mode (no enforcement)
129
151
 
@@ -140,7 +162,7 @@ The toggle re-renders all client artifacts (hooks, skill, rule, MCP servers, per
140
162
  Cursor requires manual activation of MCP servers after install:
141
163
 
142
164
  1. **Restart Cursor** to load the new hooks and MCP config
143
- 2. Go to **Settings → Tools & MCP** and verify both **browser-devtools** and **node-devtools** are enabled
165
+ 2. Go to **Settings → Tools & MCP** and verify all three of **browser-devtools**, **node-devtools**, and **backend-devtools** are enabled
144
166
  3. If a server shows as enabled but tools are unavailable, toggle it off and on
145
167
 
146
168
  > **Note:** This is a [known Cursor limitation](https://forum.cursor.com/t/mcp-tools-only-available-to-agent-after-manually-toggling-server-off-on-even-when-already-enabled/152859) — MCP servers added via `mcp.json` may need manual activation.
@@ -157,8 +179,9 @@ ironbee uninstall [project-dir] [--client <name>] [--all] [-y] Remove hooks an
157
179
  ironbee status [project-dir] Show verdict status for active sessions
158
180
  ironbee verify [session-id] Dry-run verdict validation
159
181
  ironbee analyze [session-id] Analyze session metrics (or all sessions)
160
- ironbee enable-backend <runtime> Opt into backend verification (today: node)
161
- ironbee disable-backend <runtime> Opt out (resets verifyPatterns to []; preserves customizations)
182
+ ironbee browser <enable|disable> Manage the browser cycle (default-on; bdt_* tools via browser-devtools)
183
+ ironbee node <enable|disable> Manage the Node.js runtime debug cycle (V8 inspector probes via node-devtools)
184
+ ironbee backend <enable|disable> Manage the runtime-agnostic backend protocol cycle (HTTP/gRPC/GraphQL/WS via backend-devtools)
162
185
  ironbee enable-verification Turn enforcement on (default state)
163
186
  ironbee disable-verification Monitoring-only mode (no enforcement; sessions still ship to collector)
164
187
  ironbee config get <key> Read a config value (default: merged effective value)
@@ -176,7 +199,7 @@ ironbee unregister Remove this project from the u
176
199
 
177
200
  - **`ironbee install --all`** — explicit batch op that re-runs install on every registered project. Use after a global config change to propagate it everywhere; uses each project's currently detected clients (or pass `--client <name>` to override).
178
201
  - **`ironbee uninstall --all`** — destructive batch op that wipes ironbee from every registered project. Prompts with default-No before acting; pass `--yes` / `-y` to skip the prompt. Refuses without `--yes` in non-interactive contexts.
179
- - **Prompt on global config writes** — `ironbee config set <key> <val> -g` (and `unset`) on an artifact-affecting key (`collector`, `verification`, `browser`, `backend`, `browserDevTools`, `nodeDevTools`) lists up to 10 other registered project paths still on the prior state and asks `Apply this change to these N projects now? [Y/n]` (default Yes). Pass `--apply-all` / `--no-apply-all` to skip the prompt; non-TTY contexts skip it and print a hint pointing at `install --all`.
202
+ - **Prompt on global config writes** — `ironbee config set <key> <val> -g` (and `unset`) on an artifact-affecting key (`collector`, `verification`, `browser`, `node`, `backend`, `browserDevTools`, `nodeDevTools`, `backendDevTools`) lists up to 10 other registered project paths still on the prior state and asks `Apply this change to these N projects now? [Y/n]` (default Yes). Pass `--apply-all` / `--no-apply-all` to skip the prompt; non-TTY contexts skip it and print a hint pointing at `install --all`.
180
203
 
181
204
  For pure inventory bookkeeping (no artifact writes):
182
205
 
@@ -222,21 +245,27 @@ IronBee loads config from two locations (project deep-merges over global):
222
245
 
223
246
  "verification": {
224
247
  "enable": false
248
+ },
249
+
250
+ "fileChange": {
251
+ "captureChangeset": true
225
252
  }
226
253
  }
227
254
  ```
228
255
 
229
256
  | Key | Description | Default |
230
257
  |-----|-------------|---------|
231
- | `browser.verifyPatterns` | Glob patterns for files requiring **browser** verification (replaces defaults) | 40+ code extensions |
258
+ | `browser.verifyPatterns` | Glob patterns for files requiring **browser** verification (replaces defaults). Four-state semantic: block-absent → code defaults (40+ ext, default-on); block-present + verifyPatterns unset → code defaults (post-`browser enable` shape); `[]` → hard kill (also disables `additionalVerifyPatterns`); custom `[...]` → user-defined. | 40+ code extensions when block absent OR `verifyPatterns` unset |
232
259
  | `browser.additionalVerifyPatterns` | Extra browser patterns appended to defaults | `[]` |
233
- | `backend.<runtime>.verifyPatterns` | Glob patterns for files requiring **backend** verification, per runtime (today: `node`). Empty by default — opt in via `ironbee enable-backend <runtime>`. | `[]` |
234
- | `backend.<runtime>.additionalVerifyPatterns` | Extra backend patterns | `[]` |
260
+ | `node.verifyPatterns` | Glob patterns activating the **Node.js runtime debug cycle** (`node-devtools` MCP, `ndt_*` tools — V8 inspector probes). Empty by default — opt in via `ironbee node enable`. | `[]` |
261
+ | `node.additionalVerifyPatterns` | Extra patterns appended to `node.verifyPatterns` | `[]` |
262
+ | `backend.verifyPatterns` | Glob patterns activating the **runtime-agnostic backend protocol cycle** (`backend-devtools` MCP, `bedt_*` tools — HTTP/gRPC/GraphQL/WebSocket). Empty by default — opt in via `ironbee backend enable`. | `[]` |
263
+ | `backend.additionalVerifyPatterns` | Extra patterns appended to `backend.verifyPatterns` | `[]` |
235
264
  | `ignoredVerifyPatterns` | Patterns to exclude from verification (checked first, applies to all cycles) | `[]` |
236
265
  | `maxRetries` | Max retry attempts before allowing completion (single global counter regardless of how many cycles run) | `3` |
237
266
  | `verification.enable` | Master switch for enforcement. **Inverse semantics from `recording`/`jobQueue`/`collector`** — verification is the core feature, opt-out via `enable: false`. When disabled, ironbee runs in monitoring-only mode (no enforcement hooks, skill, rule, or MCP servers; only session/activity/tool_call telemetry flows to the collector). | `true` |
238
-
239
- > **Migrating from older versions:** the previous flat `verifyPatterns` / `additionalVerifyPatterns` at the top level is no longer supported. The config loader fails loudly on legacy shape move them under `browser.*` (or the appropriate runtime under `backend.<runtime>.*`).
267
+ | `fileChange.captureChangeset` | When `true`, every `file_change` event carries a hunks-only unified-diff `changeset` string (`@@` headers + `space`/`-`/`+` lines, no filename header — `file_path` already lives on the parent event). Off by default — the default `tool_input` whitelist deliberately strips file content from the wire; turning this on routes content through `file_change` instead. PreToolUse pre-reads the file when enabled so PostToolUse can produce a real before/after diff (Write/Edit on Claude; Write/StrReplace/Delete on Cursor). Skipped on binary content (NUL byte in first 4 KB). | `false` |
268
+ | `fileChange.maxChangesetBytes` | Hard cap on the `changeset` string size. Diffs over the cap are sliced on a UTF-8 byte boundary and end with a `\n... (truncated, N bytes omitted)\n` footer so the collector POST stays within typical reverse-proxy body limits. | `65536` (64 KB) |
240
269
 
241
270
  ### Editing config from the CLI (`ironbee config`)
242
271
 
@@ -267,7 +296,7 @@ ironbee config path # print the project config file path
267
296
 
268
297
  **Type coercion** — `set` parses the value as JSON when it can (`true`/`42`/`[…]`/`{…}`) and falls back to a raw string when JSON parse fails. URLs and paths pass through unquoted; pass `--json` to force strict JSON parsing (e.g. when you want the literal string `"42"` instead of the number `42`).
269
298
 
270
- **Smart artifact re-render** — when a top-level key affects installed client artifacts (`verification`, `collector`, `browser`, `backend`, `browserDevTools`, `nodeDevTools`), `set` and `unset` re-render the client files (hooks, MCP entries, skill, rule, permissions) automatically — same code path `enable-verification` / `enable-backend` use. Other keys (`maxRetries`, `recording`, `jobQueue`, `analytics`, `import`, `ignoredVerifyPatterns`) are pure config flips that the next agent session picks up — no rerender needed.
299
+ **Smart artifact re-render** — when a top-level key affects installed client artifacts (`verification`, `collector`, `browser`, `node`, `backend`, `browserDevTools`, `nodeDevTools`, `backendDevTools`), `set` and `unset` re-render the client files (hooks, MCP entries, skill, rule, permissions) automatically — same code path `enable-verification` / `node enable` / `backend enable` use. Other keys (`maxRetries`, `recording`, `jobQueue`, `analytics`, `import`, `ignoredVerifyPatterns`) are pure config flips that the next agent session picks up — no rerender needed.
271
300
 
272
301
  Pass `--no-rerender` to skip the rerender on artifact-affecting keys (handy for scripted bulk edits — follow up with `ironbee install` to resync). If a rerender fails midway, the config file is rolled back to its prior bytes so disk state never diverges from installed artifacts.
273
302
 
@@ -275,9 +304,11 @@ Pass `--no-rerender` to skip the rerender on artifact-affecting keys (handy for
275
304
 
276
305
  ### Default verify patterns
277
306
 
278
- By default, the **browser cycle** matches common code file extensions: `.ts`, `.tsx`, `.js`, `.jsx`, `.css`, `.scss`, `.html`, `.py`, `.go`, `.rs`, `.java`, `.vue`, `.svelte`, and [many more](src/lib/config.ts). Backend file edits trigger browser verification by default since they often affect frontend behavior.
307
+ By default, the **browser cycle** is enabled and matches common code file extensions: `.ts`, `.tsx`, `.js`, `.jsx`, `.css`, `.scss`, `.html`, `.py`, `.go`, `.rs`, `.java`, `.vue`, `.svelte`, and [many more](src/lib/config.ts) (`DEFAULT_BROWSER_VERIFY_PATTERNS`). Backend file edits trigger browser verification by default since they often affect frontend behavior. Run `ironbee browser disable` for projects where the browser-cycle gate isn't appropriate (e.g. backend-only services); `ironbee browser enable` re-enables.
308
+
309
+ **Patterns are NOT materialized into `config.json`** — they live in the CLI source (`DEFAULT_BROWSER_VERIFY_PATTERNS` / `DEFAULT_NODE_VERIFY_PATTERNS` / `DEFAULT_BACKEND_VERIFY_PATTERNS`) and flow in at runtime when the cycle block exists without an explicit `verifyPatterns` key. Keeps `config.json` minimal AND lets defaults track CLI updates automatically (no frozen-at-install-time drift). To customize, set the explicit `<cycle>.verifyPatterns` (replaces defaults) or `<cycle>.additionalVerifyPatterns` (appends).
279
310
 
280
- The **node cycle** has no default patterns — running `ironbee enable-backend node` writes opinionated defaults (`server/**`, `pages/api/**`, etc.) which you can customize after.
311
+ The **node cycle** is opt-in via `ironbee node enable` (only meaningful for Node.js backends — `node-devtools` is a V8 inspector wrapper). The **backend cycle** is opt-in via `ironbee backend enable` and is runtime-agnostic (drives wire protocols via `backend-devtools`).
281
312
 
282
313
  Non-code files like `README.md`, `package.json`, or `.gitignore` do not trigger any cycle.
283
314
 
@@ -336,7 +367,7 @@ You can mix-and-match: full config replacement via `mcp`, or just env-var additi
336
367
  When the agent tries to complete a task, IronBee runs these checks:
337
368
 
338
369
  1. **Were code files edited?** — If no matching files were changed, the agent completes normally.
339
- 2. **Which cycles are active?** — IronBee matches each edited file against `browser.verifyPatterns` and (if you opted in) `backend.<runtime>.verifyPatterns`. A single file may activate both cycles; both then run in parallel.
370
+ 2. **Which cycles are active?** — IronBee matches each edited file against `browser.verifyPatterns` and (if you opted in) `node.verifyPatterns` and/or `backend.verifyPatterns`. A single file may activate two or three cycles; they all run in parallel and pass/fail combine with AND.
340
371
  3. **Were the cycle's required tools used?**
341
372
  - **Browser cycle**: navigate, screenshot, accessibility snapshot, console check (all-of)
342
373
  - **Node cycle**: connect; then either probe path (`(put-tracepoint | put-logpoint | put-exceptionpoint) AND get-probe-snapshots`) OR log path (`get-logs`)
@@ -1,120 +1,38 @@
1
1
  # IronBee Verify
2
2
 
3
- Verify the current code changes through real tools browser interaction for frontend, runtime-specific debugger for any enabled backend cycle.
3
+ Verify the current code changes through real tools. The gate runs every cycle that has been wired up for this project, and all active cycles must be satisfied within a single verification cycle for `status: pass`. Each cycle has its own tools, flow, and verdict fields — **see the platform sections near the bottom of this file** for which cycles apply and what to call.
4
4
 
5
- ## Usage
6
- - `/ironbee-verify` — **default** — focus on what changed, visual + functional checks on affected areas (browser-cycle modes; any enabled backend-runtime cycle runs alongside automatically — see runtime section below)
7
- - `/ironbee-verify full` — **full scope** — entire application, all checklists, edge cases, responsive, accessibility deep dive
8
- - `/ironbee-verify visual` — **visual only** — contrast, layout, spacing, fonts, images, theming
9
- - `/ironbee-verify functional` — **functional only** — clicks, forms, navigation, data flow, error handling
10
-
11
- If no argument is given, use **default** mode. The mode argument controls only the browser-cycle thoroughness — any active backend-runtime cycle runs the same way regardless of mode.
12
-
13
- A backend-runtime cycle (e.g. `node` after `ironbee enable-backend node`) may also be active for this project — **see the runtime section near the bottom of this file** for whether it applies and which tools to call.
14
-
15
- ---
16
-
17
- ## Steps (all modes)
5
+ ## Universal steps
18
6
 
19
7
  1. **Start verification**: Run `echo '{"session_id":"<your-session-id>"}' | ironbee hook verification-start` via Bash (substitute the actual session ID printed by the SessionStart hook).
20
- 2. **Build and start** the application if not already running
21
- 3. **For EVERY page you visit**, repeat this cycle:
22
- a. **Navigate** using `mcp__browser-devtools__bdt_navigation_go-to`
23
- b. **Take a FULL PAGE screenshot** using `mcp__browser-devtools__bdt_content_take-screenshot` with `fullPage: true`
24
- c. **Take an ARIA snapshot** using `mcp__browser-devtools__bdt_a11y_take-aria-snapshot`
25
- d. **STOP and visually analyze the screenshot** switch your focus entirely to finding visual problems. Look at this screenshot as if your ONLY job is to find visual defects:
26
- **WARNING: ARIA reports DOM content, not what the user actually sees.** Do NOT assume the page looks correct just because ARIA shows the right content. Only the screenshot tells you what the user actually sees.
27
- - Text readability is it readable against its background? Look for text that blends in or poor contrast
28
- - Layout overlapping elements, unexpected gaps, overflow, content cut off
29
- - Spacing — consistent padding/margin? Too cramped or too far apart?
30
- - Colors — intentional and consistent? Any jarring mismatches?
31
- - Typography — right sizes? Clipped or truncated text?
32
- - Images/icons — loaded? Right size and aspect ratio?
33
- - States — empty, loading, disabled, error states rendered properly?
34
- Report your visual findings before continuing.
35
- e. **Read the ARIA snapshot** — verify headings, labels, landmarks, and structure
36
- f. If anything looks wrong → note it as an issue
37
- 4. **Functionally test** — run the checklist for your mode (see below). After each significant interaction, take another screenshot and repeat the visual analysis.
38
- 5. **Check console** for errors using `mcp__browser-devtools__bdt_o11y_get-console-messages`
39
- 6. **Stop** the dev server when verification is complete
40
- 7. **If recording was started, stop it now** — `mcp__browser-devtools__bdt_content_stop-recording`. submit-verdict rejects with `"recording is still active"` when this step is skipped. (Recording is a server-side opt-in via `recording.enable` — when on, the gate forces `bdt_content_start-recording` BEFORE the steps above and demands the matching stop here.)
41
- 8. **Submit your verdict** via Bash:
42
- - Pass: `echo '{"session_id":"...","status":"pass","pages_tested":[...],"checks":[...],"console_errors":0,"network_failures":0}' | ironbee hook submit-verdict`
43
- - Fail: `echo '{"session_id":"...","status":"fail","pages_tested":[...],"checks":[...],"console_errors":N,"network_failures":N,"issues":["describe what failed"]}' | ironbee hook submit-verdict`
44
- 9. **If failed** → collect ALL issues first (finish testing all affected pages), submit one fail verdict with all issues, then fix everything, rebuild, and re-verify. Do not fix one issue at a time — batch fixes to avoid repeated build/restart cycles.
45
- 10. If pass after a previous fail, include `"fixes"` in the verdict describing what was fixed
46
-
47
- ---
48
-
49
- ## Default Mode
50
-
51
- Focus on the code you changed — not the entire application.
52
-
53
- ### 1. Study the changes
54
- 1. Run `git diff --name-only` and `git diff --name-only HEAD~1`
55
- 2. **Ignore `.ironbee/`, `.claude/`, `.cursor/`** — tool config, not application code
56
- 3. **Read the full diff** (`git diff` and/or `git diff HEAD~1`) — understand every change: what was added, removed, modified. Note specific values (colors, sizes, conditions, logic, API endpoints, component props).
57
- 4. Before opening the browser, you should be able to answer: what exactly changed, what should look or behave differently, and what could go wrong?
58
-
59
- ### 2. Verify in the browser
60
- - **Cross-reference the diff against what you see.** For each change in the diff, verify it is correctly reflected in the browser. If the diff changes a color → check that color. If it changes a calculation → verify the result. If it adds a component → confirm it renders.
61
- - **Test the flow end-to-end** — navigate, click, fill forms, submit, verify the outcome
62
- - **Check one edge case** — empty input, invalid data, or double-click
63
- - **Console** — any new errors or warnings?
64
-
65
- ---
66
-
67
- ## Full Mode (`/ironbee-verify full`)
68
-
69
- Comprehensive verification of the **entire application**. Do NOT run `git diff` or scope to recent changes. Test every page, every flow, every visual detail. Any issue is a failure, regardless of when it was introduced.
70
-
71
- ### Visual Checklist
72
- In addition to the per-page visual analysis in step 3d:
73
- - **Responsiveness** — does the layout adapt if viewport changes? No horizontal scrolling on standard widths
74
- - **Borders & separators** — visible and consistent? Not too faint or missing
75
- - **Scroll behavior** — does the page scroll smoothly? No content hidden behind sticky headers/footers?
76
-
77
- ### Functional Checklist
78
- - **Navigation** — do links and buttons navigate to the correct pages?
79
- - **Forms** — fill inputs with real data, select options, submit. Do validation messages appear correctly?
80
- - **Buttons & interactions** — do click handlers fire? Do toggles, dropdowns, and modals work?
81
- - **Data flow** — does submitted data appear where expected?
82
- - **Error handling** — what happens with invalid input? Does the UI handle errors gracefully?
83
- - **Authentication** — if applicable, do protected routes redirect correctly?
84
- - **API calls** — do network requests succeed? Check for failed requests in console/network
85
- - **State persistence** — does state survive page refresh where expected?
86
- - **Edge cases** — empty inputs, very long text, special characters, rapid clicks
87
-
88
- ### Accessibility (deep dive)
89
- - Are headings hierarchical? Do form inputs have labels? Are landmarks present?
90
- - Check for missing alt text on images
8
+ 2. **Build and start** the application if not already running.
9
+ 3. **For every active cycle, run its flow** as described in the platform sections near the bottom of this file. All active cycles must be exercised within this same verification cycle.
10
+ 4. **Stop** the dev server when verification is complete.
11
+ 5. **Honor any cycle-specific teardown** noted in the platform sections BEFORE submitting your verdict.
12
+ 6. **Submit your verdict** via Bash. Include fields for every active cycle:
13
+ - Pass: `echo '{"session_id":"...","status":"pass", ...cycle-specific fields...}' | ironbee hook submit-verdict`
14
+ - Fail: `echo '{"session_id":"...","status":"fail", ...cycle-specific fields..., "issues":["describe what failed"]}' | ironbee hook submit-verdict`
15
+ 7. **If failed** collect ALL issues first (finish testing every active cycle), submit one fail verdict with all issues, then fix everything, rebuild, and re-verify. Do not fix one issue at a time — batch fixes to avoid repeated build/restart cycles.
16
+ 8. If pass after a previous fail, include `"fixes"` in the verdict describing what was fixed.
91
17
 
92
18
  ---
93
19
 
94
- ## Visual Mode (`/ironbee-verify visual`)
20
+ <!--IRONBEE:PLATFORM:browser-->
21
+ <!--/IRONBEE:PLATFORM:browser-->
95
22
 
96
- Focus exclusively on visual quality. Run the per-page visual analysis from step 3d on every page, plus:
97
- - **Responsiveness** — viewport changes, no horizontal scrolling
98
- - **Borders & separators** — visible and consistent?
99
- - **Scroll behavior** — smooth scrolling, no hidden content
23
+ <!--IRONBEE:PLATFORM:node-->
24
+ <!--/IRONBEE:PLATFORM:node-->
100
25
 
101
- Take screenshots of **multiple states** if applicable (hover, active, disabled, empty, populated).
102
-
103
- ---
104
-
105
- ## Functional Mode (`/ironbee-verify functional`)
106
-
107
- Focus exclusively on behavior. Use the same functional checklist as Full Mode above.
108
-
109
- Test the **complete user flow**, not just the single step you changed.
26
+ <!--IRONBEE:PLATFORM:backend-->
27
+ <!--/IRONBEE:PLATFORM:backend-->
110
28
 
111
29
  ---
112
30
 
113
31
  ## When to FAIL
114
32
 
115
- If you observe ANY problem — wrong data, unexpected errors, visual defects, broken interactions, console errors, data inconsistency between pages — you MUST submit a **fail** verdict.
33
+ If you observe ANY problem on any active cycle — wrong data, unexpected errors, broken interactions, missing evidence, anything that doesn't match the spec — you MUST submit a **fail** verdict.
116
34
 
117
- **Do NOT rationalize away problems.** If something looks wrong or behaves unexpectedly, it IS wrong. In **full** mode, there is no such thing as "pre-existing" — if it's broken, fail it.
35
+ **Do NOT rationalize away problems.** If something looks wrong or behaves unexpectedly, it IS wrong.
118
36
 
119
37
  **After a fail verdict, you MUST fix the issues and re-verify.** Do not just report and stop.
120
38
 
@@ -128,8 +46,3 @@ Your `checks` array must list **specific observations**, not generic statements:
128
46
  - ALWAYS submit a verdict after every verification attempt — both pass AND fail
129
47
  - Do NOT edit code before submitting a fail verdict
130
48
  - **Noticing a bug and submitting pass is the #1 violation** — if you see it, fail it
131
-
132
- ---
133
-
134
- <!--IRONBEE:RUNTIME:node-->
135
- <!--/IRONBEE:RUNTIME:node-->
@@ -1 +1 @@
1
- {"version":3,"file":"clear-verdict.d.ts","sourceRoot":"","sources":["../../../../src/clients/claude/hooks/clear-verdict.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AA6DH,wBAAsB,GAAG,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CA0D3D"}
1
+ {"version":3,"file":"clear-verdict.d.ts","sourceRoot":"","sources":["../../../../src/clients/claude/hooks/clear-verdict.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAmFH,wBAAsB,GAAG,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAgE3D"}
@@ -15,6 +15,7 @@
15
15
  */
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
17
  exports.run = run;
18
+ const fs_1 = require("fs");
18
19
  const clear_verdict_1 = require("../../../hooks/core/clear-verdict");
19
20
  const actions_1 = require("../../../hooks/core/actions");
20
21
  const session_state_1 = require("../../../hooks/core/session-state");
@@ -29,27 +30,41 @@ function deriveChangeFacts(input, sessionId) {
29
30
  if (!ti) {
30
31
  return null;
31
32
  }
33
+ const stash = input.tool_use_id
34
+ ? (0, tool_use_stash_1.consumeToolUseData)(sessionId, input.tool_use_id)
35
+ : null;
32
36
  if (tool === "Edit") {
33
37
  const oldStr = ti.old_string ?? "";
34
38
  const newStr = ti.new_string ?? "";
35
39
  const counts = (0, file_diff_1.diffLineCounts)(oldStr, newStr);
36
- return { tool_name: "Edit", operation: "update", lines_added: counts.added, lines_removed: counts.removed };
40
+ return { tool_name: "Edit", operation: "update", lines_added: counts.added, lines_removed: counts.removed, stash };
37
41
  }
38
42
  if (tool === "Write") {
39
43
  const content = ti.content ?? "";
40
- const stash = input.tool_use_id
41
- ? (0, tool_use_stash_1.consumeToolUseData)(sessionId, input.tool_use_id)
42
- : null;
43
44
  const fileExisted = stash?.file_existed ?? false;
44
45
  return {
45
46
  tool_name: "Write",
46
47
  operation: fileExisted ? "update" : "create",
47
48
  lines_added: (0, file_diff_1.countLines)(content),
48
49
  lines_removed: fileExisted ? null : 0,
50
+ stash,
49
51
  };
50
52
  }
51
53
  return null;
52
54
  }
55
+ function buildChangeset(filePath, stash, maxBytes) {
56
+ const priorContent = stash?.prior_content ?? "";
57
+ let postContent;
58
+ try {
59
+ postContent = (0, fs_1.existsSync)(filePath) ? (0, fs_1.readFileSync)(filePath, "utf-8") : "";
60
+ }
61
+ catch (e) {
62
+ logger_1.logger.debug(`failed to read post-edit content of ${filePath} for changeset: ${e}`);
63
+ return undefined;
64
+ }
65
+ const diff = (0, file_diff_1.createUnifiedDiff)(priorContent, postContent, maxBytes);
66
+ return diff ?? undefined;
67
+ }
53
68
  async function run(projectDir) {
54
69
  let sessionId = "default";
55
70
  let input;
@@ -95,6 +110,12 @@ async function run(projectDir) {
95
110
  activity_id: (0, session_state_1.getActiveActivityId)(sessionDir),
96
111
  fix_id: (0, session_state_1.getActiveFixId)(sessionDir),
97
112
  };
113
+ if ((0, config_1.getCaptureFileChangeset)(config)) {
114
+ const changeset = buildChangeset(writtenFile, facts.stash, (0, config_1.getMaxChangesetBytes)(config));
115
+ if (changeset !== undefined) {
116
+ entry.changeset = changeset;
117
+ }
118
+ }
98
119
  await (0, actions_1.appendAction)(actionsFile, entry);
99
120
  (0, clear_verdict_1.runClearVerdict)({
100
121
  verdictFile: `${projectDir}/.ironbee/sessions/${sessionId}/verdict.json`,
@@ -1 +1 @@
1
- {"version":3,"file":"clear-verdict.js","sourceRoot":"","sources":["../../../../src/clients/claude/hooks/clear-verdict.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;GAaG;;AA6DH,kBA0DC;AArHD,qEAAoE;AACpE,yDAA8G;AAC9G,qEAAwF;AACxF,uEAAwF;AACxF,6DAA2F;AAC3F,gDAAsF;AACtF,gDAAyD;AACzD,8CAA+C;AAqB/C,SAAS,iBAAiB,CAAC,KAA6B,EAAE,SAAiB;IACvE,MAAM,IAAI,GAAuB,KAAK,CAAC,SAAS,CAAC;IACjD,MAAM,EAAE,GAAyC,KAAK,CAAC,UAAU,CAAC;IAClE,IAAI,CAAC,EAAE,EAAE,CAAC;QACN,OAAO,IAAI,CAAC;IAChB,CAAC;IAED,IAAI,IAAI,KAAK,MAAM,EAAE,CAAC;QAClB,MAAM,MAAM,GAAW,EAAE,CAAC,UAAU,IAAI,EAAE,CAAC;QAC3C,MAAM,MAAM,GAAW,EAAE,CAAC,UAAU,IAAI,EAAE,CAAC;QAC3C,MAAM,MAAM,GAAmB,IAAA,0BAAc,EAAC,MAAM,EAAE,MAAM,CAAC,CAAC;QAC9D,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,SAAS,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,CAAC,KAAK,EAAE,aAAa,EAAE,MAAM,CAAC,OAAO,EAAE,CAAC;IAChH,CAAC;IAED,IAAI,IAAI,KAAK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-verdict hook adapter
3
3
  *
4
4
  * PreToolUse hook for Write|Edit — blocks file edits if the agent used
5
- * any devtools tools (browser-devtools or node-devtools) but hasn't
6
- * submitted a verdict yet. Forces the agent to submit a fail verdict
7
- * before fixing code.
5
+ * any devtools tools (browser-devtools / node-devtools / backend-devtools)
6
+ * but hasn't submitted a verdict yet. Forces the agent to submit a fail
7
+ * verdict before fixing code.
8
8
  *
9
9
  * Side effect: when `tool_name === "Write"`, stashes whether the target
10
10
  * file already exists so the matching PostToolUse adapter can decide
@@ -1 +1 @@
1
- {"version":3,"file":"require-verdict.d.ts","sourceRoot":"","sources":["../../../../src/clients/claude/hooks/require-verdict.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAkBH,wBAAsB,GAAG,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAkC3D"}
1
+ {"version":3,"file":"require-verdict.d.ts","sourceRoot":"","sources":["../../../../src/clients/claude/hooks/require-verdict.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAmBH,wBAAsB,GAAG,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAmD3D"}
@@ -3,9 +3,9 @@
3
3
  * Claude Code — require-verdict hook adapter
4
4
  *
5
5
  * PreToolUse hook for Write|Edit — blocks file edits if the agent used
6
- * any devtools tools (browser-devtools or node-devtools) but hasn't
7
- * submitted a verdict yet. Forces the agent to submit a fail verdict
8
- * before fixing code.
6
+ * any devtools tools (browser-devtools / node-devtools / backend-devtools)
7
+ * but hasn't submitted a verdict yet. Forces the agent to submit a fail
8
+ * verdict before fixing code.
9
9
  *
10
10
  * Side effect: when `tool_name === "Write"`, stashes whether the target
11
11
  * file already exists so the matching PostToolUse adapter can decide
@@ -21,6 +21,7 @@ const fs_1 = require("fs");
21
21
  const actions_1 = require("../../../hooks/core/actions");
22
22
  const activity_1 = require("../../../hooks/core/activity");
23
23
  const tool_use_stash_1 = require("../../../hooks/core/tool-use-stash");
24
+ const config_1 = require("../../../lib/config");
24
25
  const logger_1 = require("../../../lib/logger");
25
26
  const stdin_1 = require("../../../lib/stdin");
26
27
  async function run(projectDir) {
@@ -37,18 +38,35 @@ async function run(projectDir) {
37
38
  const sessionDir = `${projectDir}/.ironbee/sessions/${sessionId}`;
38
39
  const actionsFile = `${sessionDir}/actions.jsonl`;
39
40
  if ((0, actions_1.hasToolCallsSinceLastVerdict)(actionsFile)) {
40
- process.stderr.write(`BLOCKED: You used verification tools (browser-devtools or node-devtools) but did not submit a verdict. You MUST submit a verdict (pass or fail) before editing code.
41
+ process.stderr.write(`BLOCKED: You used verification tools (browser-devtools / node-devtools / backend-devtools) but did not submit a verdict. You MUST submit a verdict (pass or fail) before editing code.
41
42
 
42
- Submit your verdict first (include cycle-appropriate fields — browser fields for bdt_*, backend_node_* fields for ndt_*):
43
+ Submit your verdict first (include cycle-appropriate fields — browser fields for bdt_*, backend_node_* for ndt_*, backend_endpoints_called/backend_response_statuses for bedt_*):
43
44
  echo '{"session_id":"${sessionId}","status":"fail","checks":[...],"issues":["describe what failed"], ...}' | ironbee hook submit-verdict
44
45
 
45
46
  Then you can edit code to fix the issues.
46
47
  `);
47
48
  process.exit(2);
48
49
  }
49
- if (input.tool_name === "Write" && input.tool_input?.file_path && input.tool_use_id) {
50
- const state = { file_existed: (0, fs_1.existsSync)(input.tool_input.file_path) };
51
- (0, tool_use_stash_1.stashToolUseData)(sessionId, input.tool_use_id, state);
50
+ const filePath = input.tool_input?.file_path;
51
+ if (filePath && input.tool_use_id) {
52
+ const config = (0, config_1.loadConfig)(projectDir);
53
+ const captureChangeset = (0, config_1.getCaptureFileChangeset)(config);
54
+ const fileExisted = (0, fs_1.existsSync)(filePath);
55
+ // We always stash for Write so PostToolUse can label create vs update.
56
+ // For Edit we only stash when changeset capture is on — there's no
57
+ // operation-derivation need otherwise (Edit is always "update").
58
+ if (input.tool_name === "Write" || (input.tool_name === "Edit" && captureChangeset)) {
59
+ const state = { file_existed: fileExisted };
60
+ if (captureChangeset && fileExisted) {
61
+ try {
62
+ state.prior_content = (0, fs_1.readFileSync)(filePath, "utf-8");
63
+ }
64
+ catch (e) {
65
+ logger_1.logger.debug(`failed to pre-read ${filePath} for changeset capture: ${e}`);
66
+ }
67
+ }
68
+ (0, tool_use_stash_1.stashToolUseData)(sessionId, input.tool_use_id, state);
69
+ }
52
70
  }
53
71
  await (0, activity_1.startActivity)({ sessionDir, actionsFile, source: "pre_tool_use" });
54
72
  process.exit(0);
@@ -1 +1 @@
1
- {"version":3,"file":"require-verdict.js","sourceRoot":"","sources":["../../../../src/clients/claude/hooks/require-verdict.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;GAeG;;AAkBH,kBAkCC;AAlDD,2BAAgC;AAChC,yDAA2E;AAC3E,2DAA6D;AAC7D,uEAAsF;AACtF,gDAAyD;AACzD,8CAA+C;AAWxC,KAAK,UAAU,GAAG,CAAC,UAAkB;IACxC,IAAI,KAA4B,CAAC;IACjC,IAAI,CAAC;QACD,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,IAAA,iBAAS,GAAE,CAA0B,CAAC;IAC7D,CAAC;IAAC,OAAO,CAAU,EAAE,CAAC;QAClB,eAAM,CAAC,KAAK,CAAC,0BAA0B,CAAC,EAAE,CAAC,CAAC;QAC5C,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IACpB,CAAC;IAED,MAAM,SAAS,GAAW,KAAK,CAAC,UAAU,IAAI,SAAS,CAAC;IACxD,IAAA,mBAAU,EAAC,GAAG,UAAU,sBAAsB,SAAS,cAAc,CAAC,CAAC;IAEvE,MAAM,UAAU,GAAW,GAAG,UAAU,sBAAsB,SAAS,EAAE,CAAC;IAC1E,MAAM,WAAW,GAAW,GAAG,UAAU,gBAAgB,CAAC;IAE1D,IAAI,IAAA,sCAA4B,EAAC,WAAW,CAAC,EAAE,CAAC;QAC5C,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC;;;yB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C,CAAC;QAC1D,CAAC;IACL,CAAC;IAED,MAAM,IAAA,wBAAa,EAAC,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,EAAE,cAAc,EAAE,CAAC,CAAC;IAEzE,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AACpB,CAAC"}
@@ -1,15 +1,16 @@
1
1
  /**
2
2
  * Claude Code — require-verification hook adapter
3
3
  *
4
- * PreToolUse hook for `mcp__browser-devtools__.*|mcp__node-devtools__.*`
5
- * — blocks devtools tool usage if no active verification cycle. Forces
6
- * the agent to call `ironbee hook verification-start` before using any
7
- * verification tooling (browser or node).
4
+ * PreToolUse hook for the three devtools matchers — `mcp__browser-devtools__.*`,
5
+ * `mcp__node-devtools__.*`, `mcp__backend-devtools__.*` — blocks devtools tool
6
+ * usage if no active verification cycle. Forces the agent to call
7
+ * `ironbee hook verification-start` before using any verification tooling
8
+ * (browser, node, or backend).
8
9
  *
9
10
  * When allowed, injects `_metadata` into tool input with sessionId and traceId
10
11
  * so the MCP server knows the active session/trace context. The `mcpServer`
11
12
  * field is parsed from `tool_name` so each server (browser-devtools /
12
- * node-devtools) sees its own correct identity.
13
+ * node-devtools / backend-devtools) sees its own correct identity.
13
14
  *
14
15
  * Exit 0 = allow tool (with updatedInput containing _metadata)
15
16
  * Exit 2 = block tool
@@ -1 +1 @@
1
- {"version":3,"file":"require-verification.d.ts","sourceRoot":"","sources":["../../../../src/clients/claude/hooks/require-verification.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAgCH,wBAAsB,GAAG,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAoH3D"}
1
+ {"version":3,"file":"require-verification.d.ts","sourceRoot":"","sources":["../../../../src/clients/claude/hooks/require-verification.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAiCH,wBAAsB,GAAG,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAqH3D"}
@@ -2,15 +2,16 @@
2
2
  /**
3
3
  * Claude Code — require-verification hook adapter
4
4
  *
5
- * PreToolUse hook for `mcp__browser-devtools__.*|mcp__node-devtools__.*`
6
- * — blocks devtools tool usage if no active verification cycle. Forces
7
- * the agent to call `ironbee hook verification-start` before using any
8
- * verification tooling (browser or node).
5
+ * PreToolUse hook for the three devtools matchers — `mcp__browser-devtools__.*`,
6
+ * `mcp__node-devtools__.*`, `mcp__backend-devtools__.*` — blocks devtools tool
7
+ * usage if no active verification cycle. Forces the agent to call
8
+ * `ironbee hook verification-start` before using any verification tooling
9
+ * (browser, node, or backend).
9
10
  *
10
11
  * When allowed, injects `_metadata` into tool input with sessionId and traceId
11
12
  * so the MCP server knows the active session/trace context. The `mcpServer`
12
13
  * field is parsed from `tool_name` so each server (browser-devtools /
13
- * node-devtools) sees its own correct identity.
14
+ * node-devtools / backend-devtools) sees its own correct identity.
14
15
  *
15
16
  * Exit 0 = allow tool (with updatedInput containing _metadata)
16
17
  * Exit 2 = block tool
@@ -26,9 +27,10 @@ const logger_1 = require("../../../lib/logger");
26
27
  const util_1 = require("../util");
27
28
  const stdin_1 = require("../../../lib/stdin");
28
29
  /** Fallback MCP server when `tool_name` parsing fails. The matcher routes
29
- * both `mcp__browser-devtools__.*` and `mcp__node-devtools__.*` here, so
30
- * `extractMcpServerName` is the source of truth — this is only used if the
31
- * tool_name field is malformed or absent. */
30
+ * all three of `mcp__browser-devtools__.*`, `mcp__node-devtools__.*`, and
31
+ * `mcp__backend-devtools__.*` here, so `extractMcpServerName` is the source
32
+ * of truth — this fallback is only used if the tool_name field is malformed
33
+ * or absent. */
32
34
  const FALLBACK_MCP_SERVER_NAME = "browser-devtools";
33
35
  async function run(projectDir) {
34
36
  let input;
@@ -45,12 +47,12 @@ async function run(projectDir) {
45
47
  const actionsFile = `${sessionDir}/actions.jsonl`;
46
48
  const verificationId = (0, session_state_1.getActiveVerificationId)(sessionDir);
47
49
  if (!verificationId) {
48
- process.stderr.write(`BLOCKED: You must start a verification cycle before using devtools tools (browser-devtools or node-devtools).
50
+ process.stderr.write(`BLOCKED: You must start a verification cycle before using devtools tools (browser-devtools / node-devtools / backend-devtools).
49
51
 
50
52
  Start verification first:
51
53
  echo '{"session_id":"${sessionId}"}' | ironbee hook verification-start
52
54
 
53
- Then use the verification tools for the active cycle(s) — bdt_* for browser, ndt_* for node.
55
+ Then use the verification tools for the active cycle(s) — bdt_* for browser, ndt_* for node, bedt_* for backend.
54
56
  `);
55
57
  process.exit(2);
56
58
  }
@@ -108,13 +110,14 @@ Then use the verification tools for the active cycle(s) — bdt_* for browser, n
108
110
  if (input.tool_use_id) {
109
111
  metadata.toolUseId = input.tool_use_id;
110
112
  }
111
- // The matcher routes both `mcp__browser-devtools__.*` and
112
- // `mcp__node-devtools__.*` here, so the tool_name reliably encodes a
113
- // server. Parse it so each server gets its correct identity in the
114
- // metadata. Falls back to a hardcoded browser-devtools constant if
115
- // parsing ever fails (malformed tool_name, missing field, …). This
116
- // keeps MCP-emitted OTel events tagged with the same `mcp_server`
117
- // dimension our own tool_call events carry.
113
+ // The matcher routes all three of `mcp__browser-devtools__.*`,
114
+ // `mcp__node-devtools__.*`, and `mcp__backend-devtools__.*` here, so
115
+ // the tool_name reliably encodes a server. Parse it so each server
116
+ // gets its correct identity in the metadata. Falls back to a
117
+ // hardcoded browser-devtools constant if parsing ever fails (malformed
118
+ // tool_name, missing field, …). This keeps MCP-emitted OTel events
119
+ // tagged with the same `mcp_server` dimension our own tool_call
120
+ // events carry.
118
121
  metadata.mcpServer = (0, util_1.extractMcpServerName)(input.tool_name) ?? FALLBACK_MCP_SERVER_NAME;
119
122
  const userEmail = (0, session_state_1.getUserEmail)(sessionDir);
120
123
  if (userEmail) {