@agent-watch-ai/edge 0.2.5 → 0.4.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 (348) hide show
  1. package/CHANGELOG.md +558 -0
  2. package/README.md +222 -97
  3. package/SECURITY.md +72 -0
  4. package/dist/billing/session-billing.d.ts +19 -0
  5. package/dist/billing/session-billing.js +52 -0
  6. package/dist/cli/args.d.ts +10 -0
  7. package/dist/cli/args.js +20 -0
  8. package/dist/cli/constants/cli.constants.d.ts +52 -4
  9. package/dist/cli/constants/cli.constants.js +56 -5
  10. package/dist/cli/context.d.ts +33 -2
  11. package/dist/cli/context.js +84 -14
  12. package/dist/cli/doctor.js +321 -33
  13. package/dist/cli/hook-check.d.ts +23 -0
  14. package/dist/cli/hook-check.js +114 -0
  15. package/dist/cli/hook.js +118 -7
  16. package/dist/cli/index.d.ts +3 -1
  17. package/dist/cli/index.js +3 -1
  18. package/dist/cli/misc.d.ts +11 -0
  19. package/dist/cli/misc.js +80 -4
  20. package/dist/cli/npx-install.d.ts +37 -0
  21. package/dist/cli/npx-install.js +79 -0
  22. package/dist/cli/open-browser.d.ts +39 -0
  23. package/dist/cli/open-browser.js +62 -0
  24. package/dist/cli/setup.d.ts +17 -8
  25. package/dist/cli/setup.js +553 -103
  26. package/dist/cli/status.js +82 -13
  27. package/dist/cli/toggle.d.ts +9 -0
  28. package/dist/cli/toggle.js +117 -0
  29. package/dist/cli/types/cli.types.d.ts +43 -3
  30. package/dist/cli/ui.d.ts +7 -0
  31. package/dist/cli/ui.js +10 -1
  32. package/dist/cli/uninstall.js +39 -2
  33. package/dist/cli/update.d.ts +17 -0
  34. package/dist/cli/update.js +76 -0
  35. package/dist/cli.js +110 -12
  36. package/dist/config/config-store.d.ts +57 -0
  37. package/dist/config/config-store.js +250 -12
  38. package/dist/config/config.d.ts +53 -6
  39. package/dist/config/config.js +66 -6
  40. package/dist/config/constants/config.constants.d.ts +116 -6
  41. package/dist/config/constants/config.constants.js +131 -8
  42. package/dist/config/destination.d.ts +24 -0
  43. package/dist/config/destination.js +33 -0
  44. package/dist/config/index.d.ts +7 -4
  45. package/dist/config/index.js +5 -3
  46. package/dist/config/repo-config.d.ts +11 -7
  47. package/dist/config/repo-config.js +64 -15
  48. package/dist/config/root-config.d.ts +72 -0
  49. package/dist/config/root-config.js +170 -0
  50. package/dist/config/schemas/config.schema.d.ts +831 -84
  51. package/dist/config/schemas/config.schema.js +398 -16
  52. package/dist/config/types/config.types.d.ts +15 -1
  53. package/dist/config/types/destination.types.d.ts +8 -0
  54. package/dist/core/async.d.ts +36 -0
  55. package/dist/core/async.js +68 -0
  56. package/dist/core/index.d.ts +1 -1
  57. package/dist/core/index.js +1 -1
  58. package/dist/core/object.d.ts +5 -0
  59. package/dist/core/object.js +9 -4
  60. package/dist/core/pipe.d.ts +0 -13
  61. package/dist/core/pipe.js +1 -9
  62. package/dist/core/types/core.types.d.ts +9 -0
  63. package/dist/core/types/core.types.js +0 -3
  64. package/dist/core/which.d.ts +14 -0
  65. package/dist/core/which.js +43 -3
  66. package/dist/credentials/budget.d.ts +9 -0
  67. package/dist/credentials/budget.js +16 -0
  68. package/dist/credentials/command-runner.d.ts +16 -0
  69. package/dist/credentials/command-runner.js +37 -0
  70. package/dist/credentials/constants/credentials.constants.d.ts +119 -0
  71. package/dist/credentials/constants/credentials.constants.js +120 -0
  72. package/dist/credentials/credential-status.d.ts +14 -0
  73. package/dist/credentials/credential-status.js +38 -0
  74. package/dist/credentials/credentials.d.ts +86 -0
  75. package/dist/credentials/credentials.js +278 -0
  76. package/dist/credentials/device-api.d.ts +73 -0
  77. package/dist/credentials/device-api.js +161 -0
  78. package/dist/credentials/device-state.d.ts +31 -0
  79. package/dist/credentials/device-state.js +51 -0
  80. package/dist/credentials/identity.d.ts +73 -0
  81. package/dist/credentials/identity.js +101 -0
  82. package/dist/credentials/index.d.ts +7 -0
  83. package/dist/credentials/index.js +5 -0
  84. package/dist/credentials/migration.d.ts +46 -0
  85. package/dist/credentials/migration.js +164 -0
  86. package/dist/credentials/schemas/device-api.schema.d.ts +77 -0
  87. package/dist/credentials/schemas/device-api.schema.js +33 -0
  88. package/dist/credentials/schemas/device-state.schema.d.ts +51 -0
  89. package/dist/credentials/schemas/device-state.schema.js +20 -0
  90. package/dist/credentials/secret-store.d.ts +54 -0
  91. package/dist/credentials/secret-store.js +217 -0
  92. package/dist/credentials/sign-in.d.ts +31 -0
  93. package/dist/credentials/sign-in.js +105 -0
  94. package/dist/credentials/token-refresher.d.ts +39 -0
  95. package/dist/credentials/token-refresher.js +185 -0
  96. package/dist/credentials/types/credentials.types.d.ts +206 -0
  97. package/dist/credentials/types/credentials.types.js +1 -0
  98. package/dist/enforcement/constants/enforcement.constants.d.ts +47 -1
  99. package/dist/enforcement/constants/enforcement.constants.js +56 -0
  100. package/dist/enforcement/decision-cache.d.ts +20 -1
  101. package/dist/enforcement/decision-cache.js +65 -2
  102. package/dist/enforcement/decision-client.d.ts +9 -8
  103. package/dist/enforcement/decision-client.js +64 -17
  104. package/dist/enforcement/enforcement.d.ts +23 -2
  105. package/dist/enforcement/enforcement.js +107 -17
  106. package/dist/enforcement/index.d.ts +4 -3
  107. package/dist/enforcement/index.js +3 -2
  108. package/dist/enforcement/types/enforcement.types.d.ts +66 -2
  109. package/dist/enrollment/constants/enrollment.constants.d.ts +2 -6
  110. package/dist/enrollment/constants/enrollment.constants.js +2 -6
  111. package/dist/enrollment/enrollment.d.ts +16 -0
  112. package/dist/enrollment/enrollment.js +54 -0
  113. package/dist/enrollment/index.d.ts +3 -7
  114. package/dist/enrollment/index.js +1 -1
  115. package/dist/enrollment/types/enrollment.types.d.ts +9 -13
  116. package/dist/events/constants/enrich.constants.d.ts +15 -0
  117. package/dist/events/constants/enrich.constants.js +15 -0
  118. package/dist/events/constants/events.constants.d.ts +6 -2
  119. package/dist/events/constants/events.constants.js +5 -1
  120. package/dist/events/enrich.js +92 -10
  121. package/dist/events/event-id.d.ts +0 -8
  122. package/dist/events/event-id.js +0 -10
  123. package/dist/events/index.d.ts +2 -2
  124. package/dist/events/index.js +1 -1
  125. package/dist/events/product-event.d.ts +9 -6
  126. package/dist/events/types/repo-snapshot.types.d.ts +7 -0
  127. package/dist/events/types/session-billing.types.d.ts +16 -0
  128. package/dist/events/types/session-billing.types.js +1 -0
  129. package/dist/feature/constants/feature.constants.d.ts +7 -0
  130. package/dist/feature/constants/feature.constants.js +7 -0
  131. package/dist/feature/index.d.ts +1 -1
  132. package/dist/feature/index.js +1 -1
  133. package/dist/feature/ticket-candidates.d.ts +14 -0
  134. package/dist/feature/ticket-candidates.js +26 -8
  135. package/dist/git/blob-hash.d.ts +21 -0
  136. package/dist/git/blob-hash.js +69 -0
  137. package/dist/git/checkout-root.d.ts +27 -0
  138. package/dist/git/checkout-root.js +75 -0
  139. package/dist/git/constants/git.constants.d.ts +160 -0
  140. package/dist/git/constants/git.constants.js +181 -0
  141. package/dist/git/fingerprint.d.ts +74 -0
  142. package/dist/git/fingerprint.js +219 -0
  143. package/dist/git/gate-checkout.d.ts +44 -0
  144. package/dist/git/gate-checkout.js +201 -0
  145. package/dist/git/git-context.d.ts +45 -0
  146. package/dist/git/git-context.js +61 -3
  147. package/dist/git/index.d.ts +4 -2
  148. package/dist/git/index.js +2 -1
  149. package/dist/git/manifest-repository.d.ts +13 -0
  150. package/dist/git/manifest-repository.js +92 -0
  151. package/dist/git/repo-snapshot.d.ts +29 -3
  152. package/dist/git/repo-snapshot.js +110 -7
  153. package/dist/git/repository-root.d.ts +39 -0
  154. package/dist/git/repository-root.js +131 -0
  155. package/dist/git/types/git.types.d.ts +55 -0
  156. package/dist/git/types/repository-root.types.d.ts +11 -0
  157. package/dist/git/types/repository-root.types.js +1 -0
  158. package/dist/git/types/snapshot.types.d.ts +9 -0
  159. package/dist/pipeline/constants/pipeline.constants.d.ts +10 -0
  160. package/dist/pipeline/constants/pipeline.constants.js +10 -0
  161. package/dist/pipeline/hook-pipeline.js +410 -33
  162. package/dist/pipeline/types/pipeline.types.d.ts +39 -4
  163. package/dist/privacy/constants/privacy.constants.js +15 -1
  164. package/dist/privacy/index.d.ts +1 -0
  165. package/dist/privacy/index.js +1 -0
  166. package/dist/privacy/product-capture.d.ts +12 -0
  167. package/dist/privacy/product-capture.js +75 -0
  168. package/dist/privacy/sanitizer.d.ts +21 -3
  169. package/dist/privacy/sanitizer.js +52 -8
  170. package/dist/process/ancestors.d.ts +39 -0
  171. package/dist/process/ancestors.js +121 -0
  172. package/dist/process/constants/process.constants.d.ts +34 -0
  173. package/dist/process/constants/process.constants.js +34 -0
  174. package/dist/process/index.d.ts +7 -0
  175. package/dist/process/index.js +2 -0
  176. package/dist/process/types/process.types.d.ts +23 -0
  177. package/dist/process/types/process.types.js +1 -0
  178. package/dist/providers/antigravity/antigravity.adapter.d.ts +12 -1
  179. package/dist/providers/antigravity/antigravity.adapter.js +21 -3
  180. package/dist/providers/antigravity/antigravity.detect.d.ts +0 -9
  181. package/dist/providers/antigravity/antigravity.detect.js +1 -1
  182. package/dist/providers/antigravity/antigravity.provider.js +3 -2
  183. package/dist/providers/antigravity/constants/antigravity.constants.d.ts +2 -0
  184. package/dist/providers/antigravity/constants/antigravity.constants.js +2 -0
  185. package/dist/providers/claude/claude.adapter.d.ts +11 -1
  186. package/dist/providers/claude/claude.adapter.js +26 -5
  187. package/dist/providers/claude/claude.otel.d.ts +32 -18
  188. package/dist/providers/claude/claude.otel.js +81 -6
  189. package/dist/providers/claude/claude.provider.js +5 -2
  190. package/dist/providers/claude/constants/claude.constants.d.ts +2 -0
  191. package/dist/providers/claude/constants/claude.constants.js +2 -0
  192. package/dist/providers/claude/constants/claude.otel.constants.d.ts +4 -0
  193. package/dist/providers/claude/constants/claude.otel.constants.js +8 -0
  194. package/dist/providers/codex/codex.adapter.d.ts +15 -1
  195. package/dist/providers/codex/codex.adapter.js +29 -5
  196. package/dist/providers/codex/codex.otel.d.ts +36 -3
  197. package/dist/providers/codex/codex.otel.js +199 -32
  198. package/dist/providers/codex/codex.provider.js +5 -2
  199. package/dist/providers/codex/constants/codex.constants.d.ts +2 -0
  200. package/dist/providers/codex/constants/codex.constants.js +16 -0
  201. package/dist/providers/codex/constants/codex.otel.constants.d.ts +10 -0
  202. package/dist/providers/codex/constants/codex.otel.constants.js +10 -0
  203. package/dist/providers/constants/provider.constants.d.ts +8 -3
  204. package/dist/providers/constants/provider.constants.js +8 -3
  205. package/dist/providers/cursor/constants/cursor.constants.d.ts +9 -0
  206. package/dist/providers/cursor/constants/cursor.constants.js +9 -0
  207. package/dist/providers/cursor/cursor.adapter.d.ts +33 -1
  208. package/dist/providers/cursor/cursor.adapter.js +129 -4
  209. package/dist/providers/cursor/cursor.detect.d.ts +0 -7
  210. package/dist/providers/cursor/cursor.detect.js +1 -1
  211. package/dist/providers/cursor/cursor.provider.js +5 -2
  212. package/dist/providers/gemini/constants/gemini.constants.d.ts +9 -0
  213. package/dist/providers/gemini/constants/gemini.constants.js +9 -0
  214. package/dist/providers/gemini/constants/gemini.otel.constants.d.ts +9 -1
  215. package/dist/providers/gemini/constants/gemini.otel.constants.js +9 -0
  216. package/dist/providers/gemini/gemini.adapter.d.ts +14 -1
  217. package/dist/providers/gemini/gemini.adapter.js +25 -5
  218. package/dist/providers/gemini/gemini.detect.d.ts +0 -7
  219. package/dist/providers/gemini/gemini.detect.js +1 -1
  220. package/dist/providers/gemini/gemini.otel.d.ts +30 -21
  221. package/dist/providers/gemini/gemini.otel.js +166 -22
  222. package/dist/providers/gemini/gemini.provider.js +2 -1
  223. package/dist/providers/index.d.ts +1 -1
  224. package/dist/providers/index.js +1 -1
  225. package/dist/providers/loaders.d.ts +10 -0
  226. package/dist/providers/loaders.js +40 -0
  227. package/dist/providers/provider.d.ts +11 -0
  228. package/dist/providers/provider.js +1 -1
  229. package/dist/providers/registry.d.ts +11 -8
  230. package/dist/providers/registry.js +11 -15
  231. package/dist/providers/shared/bearer-rewrite.d.ts +19 -0
  232. package/dist/providers/shared/bearer-rewrite.js +46 -0
  233. package/dist/providers/shared/constants/hook-refusal.constants.d.ts +7 -0
  234. package/dist/providers/shared/constants/hook-refusal.constants.js +7 -0
  235. package/dist/providers/shared/constants/shell-directories.constants.d.ts +30 -0
  236. package/dist/providers/shared/constants/shell-directories.constants.js +39 -0
  237. package/dist/providers/shared/constants/tooling.constants.d.ts +24 -2
  238. package/dist/providers/shared/constants/tooling.constants.js +25 -3
  239. package/dist/providers/shared/event-builder.d.ts +12 -14
  240. package/dist/providers/shared/event-builder.js +20 -14
  241. package/dist/providers/shared/exporter-allowlist.d.ts +20 -0
  242. package/dist/providers/shared/exporter-allowlist.js +49 -0
  243. package/dist/providers/shared/hook-config.d.ts +2 -21
  244. package/dist/providers/shared/hook-config.js +5 -4
  245. package/dist/providers/shared/hook-refusal.d.ts +12 -0
  246. package/dist/providers/shared/hook-refusal.js +17 -1
  247. package/dist/providers/shared/install-record.d.ts +12 -2
  248. package/dist/providers/shared/install-record.js +5 -2
  249. package/dist/providers/shared/shell-directories.d.ts +24 -0
  250. package/dist/providers/shared/shell-directories.js +90 -0
  251. package/dist/providers/shared/tooling.d.ts +40 -1
  252. package/dist/providers/shared/tooling.js +70 -1
  253. package/dist/providers/shared/types/adapter.types.d.ts +1 -2
  254. package/dist/providers/types/provider.types.d.ts +81 -1
  255. package/dist/snapshot/constants/snapshot.constants.d.ts +32 -0
  256. package/dist/snapshot/constants/snapshot.constants.js +33 -0
  257. package/dist/snapshot/snapshot-event.js +52 -11
  258. package/dist/snapshot/snapshot-pipeline.js +1 -1
  259. package/dist/snapshot/types/snapshot.types.d.ts +2 -0
  260. package/dist/storage/atomic-file.d.ts +21 -0
  261. package/dist/storage/atomic-file.js +20 -1
  262. package/dist/storage/constants/storage.constants.d.ts +19 -0
  263. package/dist/storage/constants/storage.constants.js +19 -0
  264. package/dist/storage/disabled.d.ts +13 -0
  265. package/dist/storage/disabled.js +24 -0
  266. package/dist/storage/index.d.ts +2 -0
  267. package/dist/storage/index.js +2 -0
  268. package/dist/storage/paths.js +3 -2
  269. package/dist/storage/schemas/storage.schema.d.ts +72 -0
  270. package/dist/storage/schemas/storage.schema.js +6 -0
  271. package/dist/storage/sweep-marker.d.ts +19 -0
  272. package/dist/storage/sweep-marker.js +55 -0
  273. package/dist/storage/types/storage.types.d.ts +2 -0
  274. package/dist/storage/uninstalled.d.ts +58 -0
  275. package/dist/storage/uninstalled.js +107 -0
  276. package/dist/transport/auth-block.d.ts +66 -0
  277. package/dist/transport/auth-block.js +129 -0
  278. package/dist/transport/constants/transport.constants.d.ts +82 -3
  279. package/dist/transport/constants/transport.constants.js +83 -4
  280. package/dist/transport/cooldown.js +8 -1
  281. package/dist/transport/delivery.d.ts +14 -6
  282. package/dist/transport/delivery.js +80 -55
  283. package/dist/transport/http-transport.d.ts +1 -0
  284. package/dist/transport/http-transport.js +52 -10
  285. package/dist/transport/index.d.ts +6 -3
  286. package/dist/transport/index.js +3 -0
  287. package/dist/transport/queue-partition.d.ts +91 -0
  288. package/dist/transport/queue-partition.js +143 -0
  289. package/dist/transport/queue.d.ts +99 -20
  290. package/dist/transport/queue.js +210 -69
  291. package/dist/transport/response-body.d.ts +25 -0
  292. package/dist/transport/response-body.js +64 -0
  293. package/dist/transport/send.d.ts +11 -0
  294. package/dist/transport/send.js +17 -0
  295. package/dist/transport/types/delivery-flow.types.d.ts +19 -0
  296. package/dist/transport/types/delivery-flow.types.js +1 -0
  297. package/dist/transport/types/transport.types.d.ts +45 -0
  298. package/dist/turns/claude-transcript.d.ts +19 -1
  299. package/dist/turns/claude-transcript.js +46 -1
  300. package/dist/turns/codex-originator.d.ts +11 -0
  301. package/dist/turns/codex-originator.js +31 -0
  302. package/dist/turns/codex-transcript.d.ts +30 -0
  303. package/dist/turns/codex-transcript.js +88 -0
  304. package/dist/turns/constants/turns.constants.d.ts +141 -5
  305. package/dist/turns/constants/turns.constants.js +155 -5
  306. package/dist/turns/file-identity.d.ts +27 -0
  307. package/dist/turns/file-identity.js +48 -0
  308. package/dist/turns/gemini-transcript.d.ts +30 -0
  309. package/dist/turns/gemini-transcript.js +96 -0
  310. package/dist/turns/index.d.ts +3 -3
  311. package/dist/turns/index.js +1 -1
  312. package/dist/turns/inherited-checkout.d.ts +54 -0
  313. package/dist/turns/inherited-checkout.js +155 -0
  314. package/dist/turns/native-session-titles.d.ts +26 -0
  315. package/dist/turns/native-session-titles.js +102 -0
  316. package/dist/turns/transcript.d.ts +3 -2
  317. package/dist/turns/transcript.js +5 -1
  318. package/dist/turns/turn-state.d.ts +224 -3
  319. package/dist/turns/turn-state.js +456 -21
  320. package/dist/turns/turn-summary.d.ts +1 -14
  321. package/dist/turns/turn-summary.js +87 -51
  322. package/dist/turns/turn-tracker.d.ts +21 -2
  323. package/dist/turns/turn-tracker.js +379 -56
  324. package/dist/turns/types/transcript.types.d.ts +5 -0
  325. package/dist/turns/types/turn-state.types.d.ts +116 -5
  326. package/dist/turns/types/turn-summary.types.d.ts +64 -14
  327. package/dist/turns/types/turn-tracker.types.d.ts +27 -1
  328. package/dist/turns/work-checkout.d.ts +67 -0
  329. package/dist/turns/work-checkout.js +700 -0
  330. package/dist/untraced/constants/untraced.constants.d.ts +31 -0
  331. package/dist/untraced/constants/untraced.constants.js +63 -0
  332. package/dist/untraced/untraced.d.ts +35 -0
  333. package/dist/untraced/untraced.js +105 -0
  334. package/dist/update/constants/update.constants.d.ts +18 -0
  335. package/dist/update/constants/update.constants.js +20 -0
  336. package/dist/update/update-check.d.ts +52 -0
  337. package/dist/update/update-check.js +113 -0
  338. package/docs/AUDIT_PROMPT.md +129 -0
  339. package/docs/DATA_HANDLING.md +655 -0
  340. package/docs/ENTERPRISE_DEPLOYMENT.md +194 -0
  341. package/docs/PERFORMANCE.md +81 -0
  342. package/package.json +14 -4
  343. package/dist/enrollment/enrollment-provider.d.ts +0 -5
  344. package/dist/enrollment/manual-enrollment.d.ts +0 -32
  345. package/dist/enrollment/manual-enrollment.js +0 -72
  346. package/example/README.md +0 -43
  347. package/example/server.mjs +0 -240
  348. /package/dist/{enrollment/enrollment-provider.js → config/types/destination.types.js} +0 -0
package/CHANGELOG.md CHANGED
@@ -2,6 +2,553 @@
2
2
 
3
3
  ## Unreleased
4
4
 
5
+ - `@agent-watch-ai/otel` (npm) and `agent-watch-otel` (PyPI) are released
6
+ together from one `otel-vX.Y.Z` tag by `otel-release.yml`, at one version and
7
+ only when both suites pass. `python-release.yml` no longer publishes alone.
8
+
9
+ ## 0.4.0
10
+
11
+ - A Cursor MCP call keeps its server name: the before-hook carries it to the
12
+ completion, so `tools_used` keys it `mcp__<server>__<tool>`.
13
+ - A turn reports a checkout below `changed` (carried, referenced, inherited or
14
+ its folder) only if it edited no file or edited one inside that checkout, so
15
+ a turn that edits files elsewhere is no longer charged to that branch. Reads
16
+ never decide this.
17
+ - `tools_used` names each MCP call `mcp__<server>__<tool>` (never its
18
+ arguments). `capture.mcpNames: false` folds them all into `mcp` and keeps the
19
+ count; a repository file can turn it off, never on.
20
+ - An unattended machine (CI, a cloud agent) enrolls with an admin-issued,
21
+ single-use code instead of a browser sign-in:
22
+ `AGENTWATCH_ENROLLMENT_CODE=<code> agentwatch setup "<backend>?organization=<id>"`,
23
+ or pipe the code with `--enrollment-code -`. A code given on the command line
24
+ is refused. `status` and `doctor` say the device was enrolled with an
25
+ admin-issued code; a used or expired code fails with the gateway's reason and
26
+ writes nothing. No git email is needed, since the code names the developer,
27
+ and a re-run with the same code still exported keeps the device instead of
28
+ redeeming the spent code again.
29
+ - MDM rollout needs no key: `agentwatch setup <enrollment-url> --defer-sign-in`
30
+ saves the organization and installs the hooks with no credential (on a
31
+ machine with no device, an enrollment code is redeemed now instead). Until the
32
+ developer runs `agentwatch setup` and signs in as themselves, hooks send and
33
+ queue nothing, no native exporter is configured, and session start, `status`
34
+ and `doctor` say how to finish (doctor warns, it does not fail). A plain
35
+ `agentwatch setup` on such a machine resumes the browser sign-in for the saved
36
+ organization, and needs no git email when the gateway names the approver.
37
+ Running the policy again on an enrolled machine keeps its credential (a
38
+ legacy install key included) and refreshes the rest. A sign-in now also
39
+ stores `organizationId` in the config (global-only; cleared by other machine
40
+ setups and with the device on uninstall). The
41
+ Jamf and Intune templates use this flow and no longer deploy
42
+ `AGENTWATCH_TOKEN`, and uninstall points to the enrollment URL instead of the
43
+ install key.
44
+ - Codex `config.toml` and Gemini `settings.json` hold the device's one-hour
45
+ access token instead of the organization install key, and every hook
46
+ rewrites it there (atomically, 0600) when it rotates. A Codex session keeps
47
+ the token it started with, so after an hour its native export is refused;
48
+ its usage still arrives from the rollout file. See
49
+ `docs/NATIVE_OTLP_TOKENS.md`.
50
+
51
+ ## 0.3.1
52
+
53
+ - `agentwatch <command> --help` prints the help and exits 0 without running the
54
+ command; `agentwatch setup --help` used to run setup.
55
+ - Gemini token usage is read from its own chat file
56
+ (`~/.gemini/tmp/<project>/chats/session-*.jsonl`): numbers only, no prompt or
57
+ tool content, so Gemini spend reaches the platform on a default install
58
+ without native telemetry or content consent. After a browser sign-in, setup
59
+ no longer warns that Codex and Gemini native telemetry is refused.
60
+ - `agentwatch setup <enrollment-url>` opens the sign-in link in the default
61
+ browser (`open`, `xdg-open` or `rundll32`, no shell; http(s) links only) and
62
+ still prints it with the code. It opens nothing under CI, over SSH, without a
63
+ terminal, or with the new `--no-browser` flag.
64
+ - After a browser sign-in, setup names the account that approved it as the
65
+ developer (`developer: you@company.com (signed in)`) and stores that email,
66
+ instead of this checkout's git email. A gateway that does not yet send the
67
+ approver (before AWT-555) gets the email stored on this machine with a note that the
68
+ platform credits the approver; an approver that is not a plain email is
69
+ ignored. The approver also replaces an explicit `--developer-email` for that
70
+ scope, and it is the email hooks send with each turn and match per-developer
71
+ policies on. The platform already credited the approver, so attribution does
72
+ not change; the output, the config and local policy matching now agree with it.
73
+
74
+ ## 0.3.0
75
+
76
+ ### Behaviour change: uninstall revokes the device credential
77
+
78
+ `agentwatch uninstall` (all agents) now switches this machine's device
79
+ credential off on the platform (`POST /v1/devices/revoke`) before it deletes
80
+ the secret from the keychain. Offline, rate limited or on a server error it
81
+ still finishes locally, exits 0, and says the credential is still active and
82
+ that an admin can revoke the machine in Settings → Install. `uninstall --agent`
83
+ leaves the credential alone. A config uninstall cannot update (another process
84
+ holds it, or it is invalid) is a failure: it exits non-zero and says to re-run.
85
+ Until `setup` runs again for an entry (the machine, or a `--root`), nothing
86
+ enrolls a new device from the install key uninstall keeps in the config, and
87
+ nothing sends that key: hooks queue, the header helper prints no bearer, and
88
+ `status` and `doctor` report the entry as uninstalled. Devices are revoked at
89
+ the endpoint they were enrolled with.
90
+
91
+ ### Behaviour change: the install key is exchanged for a device credential in the OS keychain
92
+
93
+ On its first run that reaches the backend, the edge trades the install key in
94
+ `~/.agentwatch/config.json` for a per-device credential (`POST /v1/devices/enroll`),
95
+ keeps the device secret in the macOS Keychain, libsecret or Windows DPAPI, and
96
+ records the device beside the key in the config (the key stays until Codex and
97
+ Gemini move to short-lived tokens, AWT-357). Hooks, `status`, `doctor` and the Claude Code
98
+ header helper send a one-hour access token, refreshed by one process per machine.
99
+ Without a keychain the secret is a 0600 file and `status`/`doctor` say so. A
100
+ revoked device queues events and is reported once. `uninstall` removes the secret.
101
+ Codex and Gemini keep the static header setup wrote. Needs a gateway that serves
102
+ `/v1/devices/*`; until then the install key keeps working and the exchange is
103
+ retried hourly. Credential work in a hook takes at most half the delivery
104
+ budget and backs off with the backend cooldown; on Windows a hook never starts
105
+ PowerShell itself (setup exchanges the key, and a due refresh runs in one
106
+ detached `agentwatch refresh-credential`). An expired device secret is enrolled
107
+ again automatically; a revoked device only by `setup --token <install key>`.
108
+ Keychain tools are run from the system directories, never from `PATH`, and a
109
+ repo `.agentwatch.json` cannot set `device`. See `SECURITY.md` and `docs/DATA_HANDLING.md`.
110
+
111
+ ### Behaviour change: a review in a detached checkout reports its pull request's branch
112
+
113
+ A turn in a checkout with no branch checked out (an automated reviewer's
114
+ worktree, or `git checkout <sha>`) now reports, as its branch, the one
115
+ remote-tracking branch whose tip is the checked-out commit, without its remote's
116
+ prefix, and that branch's ticket keys (AWT-439). When no branch or several point
117
+ there, or one of them is the repository's default branch (`<remote>/HEAD` names
118
+ it, else `main` or `master`), the turn reports no branch, as before. A branch another
119
+ active session changed is still withheld.
120
+
121
+ The end-of-turn hook runs one `git for-each-ref --points-at` for a detached
122
+ checkout it reports; the prompt hook runs no added git process, and nothing new
123
+ is sent beyond the branch name a checked-out branch would have sent.
124
+
125
+ ### Behaviour change: sessions sharing a checkout are judged by their own work
126
+
127
+ When several agent sessions work in one checkout, a turn no longer takes another
128
+ session's work as its own (AWT-438):
129
+
130
+ - A branch switch, pull or reset with no commit of the turn's own is no change.
131
+ Before, it counted as a lesser change. An empty commit of the turn's own still
132
+ counts.
133
+ - A file that another session still active on the machine changed is not this
134
+ turn's: its edit tool named the file, or its turn already reported it.
135
+ - A turn that changed nothing reports the repository without a branch, commit or
136
+ ticket keys from the branch when another active session changed that
137
+ checkout's current branch: one of its turns changed that branch, its open
138
+ turn's edit tool is changing it, or its open turn first saw the checkout on
139
+ another branch (a switch made through the shell, before that turn closed). This
140
+ applies to `carried`, `referenced` and `cwd` turns. A session that changed that
141
+ branch itself still reports it.
142
+
143
+ This uses only local turn state already on the machine. The prompt hook runs no
144
+ added git process, and nothing new is sent. When another session's state cannot
145
+ be read, the turn behaves as before.
146
+
147
+ ### Behaviour change: a branch snapshot names the files its commits changed
148
+
149
+ Each commit in a `repo.snapshot` now carries `files`: the repository-relative paths that
150
+ commit changed, with git's name-status letter, so the platform can compare branches by
151
+ content however the edits were made (a shell command, another tool, a commit made
152
+ outside an agent). Names only, never contents; credential-like file names are left out;
153
+ at most 200 files and 16 KiB of path per branch, newest commit first. One more `git log` per branch that
154
+ moved, inside the existing snapshot budget. `capture.git: false` still withholds the
155
+ whole snapshot. See `docs/DATA_HANDLING.md` and `docs/PERFORMANCE.md`.
156
+
157
+ ### Behaviour change: a launcher can name the session that started an agent
158
+
159
+ A child agent started with `AGENTWATCH_PARENT_SESSION=<parent session id>` in its
160
+ environment (a spinoff in a new terminal tab, a review bot, your own orchestrator)
161
+ sends that id as `parent_session_id` on every turn summary, whatever its
162
+ `work_evidence`, ahead of a parent the ancestor walk finds. Not a plain session id,
163
+ or the session's own id: ignored. `capture.git: false` withholds it. See
164
+ `docs/DATA_HANDLING.md`, "Declared parent".
165
+
166
+ ### Behaviour change: ticket keys named in a prompt are sent as `prompt_jira_ids`
167
+
168
+ The edge now extracts ticket keys (same syntax as branch keys) from a session's
169
+ opening prompt, on the machine, and sends them as `prompt_jira_ids` on every turn
170
+ summary, at every tier, with no consent step. Every candidate key is sent, with no
171
+ prefix filter, and the platform keeps only keys it knows; the edge no longer
172
+ calls `GET /v1/ticket-prefixes` (AWT-326). The prompt text still leaves
173
+ only with `capture.promptText`. The keys are kept in a local memo,
174
+ `prompt-tickets.json`, whose 24-hour expiry counts from SessionEnd.
175
+ `capture.git: false` withholds `prompt_jira_ids`. See `docs/DATA_HANDLING.md`.
176
+
177
+ ### Behaviour change: prompt text, tool inputs and out-of-repo files, opt-in
178
+
179
+ Reverses the prompt half of "developer prompts are never collected" below, on the
180
+ founder's decision of 2026-10-01: sessions with no repository (finance in a
181
+ spreadsheet, marketing in a deck) need the backend to see what they were about.
182
+
183
+ - New `capture.promptText`, off by default and gated by `contentCaptureConsent`
184
+ like the tool flags. On, the turn summary carries `prompt_text`: the first prompt,
185
+ `<system-reminder>` blocks the harness injected removed, secrets scrubbed over the
186
+ whole text, then cut at 4,000 characters. A new key on purpose: an old config's
187
+ `capture.prompts: true` still turns nothing on.
188
+ - Under `capture.toolInput`, the turn summary carries `tool_inputs`: per shell or
189
+ connector (MCP) call, the command, or the server, tool and arguments (JSON text).
190
+ At most 50 a turn, each string cut at 2,000 characters after scrubbing.
191
+ - Under `capture.files` and `capture.git` (both on by default), a file outside every checkout is kept as
192
+ `external_files_touched` / `external_files_read`, home-relative
193
+ (`~/Documents/Sample Budget.xlsx`). `files_touched` / `files_read` are unchanged
194
+ (repo-relative, or a bare basename outside any checkout, as before).
195
+ - Response text is still never collected.
196
+ - With `promptText` and `toolInput` off the summary is built and sent as before, without
197
+ those fields. External file paths are on by default with `files` and `git`.
198
+
199
+ ### Behaviour change: sessions outside a git checkout report their repository
200
+
201
+ - `work_evidence: inherited`: a session started in a folder with no git takes the
202
+ checkout of the process that started the agent, with `parent_session_id` when it
203
+ came from a live parent agent session (or when a launcher declared one, above). The first hook reads the process table
204
+ locally (one 100 ms deadline); nothing of it is sent but the checkout fields.
205
+ With roots configured, it is sent only if a root claims the checkout, as that root.
206
+ - With `capture.files` and `capture.git` on and no git context, the summary carries
207
+ `content_hashes` (up to 20 `{path, blob_sha}`, git's blob ids of files the agent's
208
+ tools named, read in memory) and `manifest_repository` (the repository address in
209
+ the nearest project manifest). No file content is sent.
210
+
211
+ ### Behaviour change: every turn reports the checkout its work changed
212
+
213
+ - A turn's `repository`, `branch`, `commit` and `jira_ids` now describe the checkout
214
+ the turn changed — a worktree it committed in through the shell, say — not only
215
+ the folder the agent sat in. New optional `work_evidence`: `changed`, `carried`,
216
+ `referenced`, `cwd` or, for a session started in a folder that is no checkout,
217
+ `inherited` (see "Sessions that start outside a checkout" in `docs/DATA_HANDLING.md`).
218
+ - `files_changed` lists the files this turn changed there (cap 500), no longer the
219
+ whole dirty tree (cap 50).
220
+ - The repository snapshot is taken at that checkout.
221
+ - To find it, the hook reads a shell command's text in memory for directory names
222
+ and discards it; nothing of the command is stored, queued, logged or sent.
223
+ - Every git call the edge makes passes `--no-optional-locks`.
224
+ - From a session's second turn on, the budget gate asks about the checkout the
225
+ session last changed, not the folder the agent sits in. The first prompt, and a
226
+ session that has changed nothing, are asked about exactly as before; the prompt
227
+ hook still starts no git process.
228
+ - Codex, Cursor, Gemini CLI and Antigravity shell calls are read the same way.
229
+ Gemini's `run_shell_command` now counts as a shell call. A working directory the
230
+ agent reports for the call (Cursor's shell `cwd`, Gemini's absolute `dir_path`,
231
+ Antigravity's `Cwd`) is a candidate as it stands, and so are Cursor's workspace
232
+ roots. A Cursor hook that reports no `cwd` now resolves to its first workspace
233
+ root, not the directory Cursor started the hook process in.
234
+
235
+ ### Behaviour change: developer prompts are never collected
236
+
237
+ - `capture.prompts` and `capture.responses` are removed. Prompt and response text
238
+ is never sent, queued or kept in turn state, whatever the config says; a prompt
239
+ or response is still recorded as a length and a SHA-256.
240
+ - A config that still sets either key collects nothing. `agentwatch setup` removes
241
+ them and warns once; `agentwatch doctor` reports them until then.
242
+ - Turn summaries an older release queued with `prompt` / `response` text are sent
243
+ without it.
244
+ - Gemini detailed traces, which can carry prompts, are no longer configured.
245
+ Native prompt logging stays forced off for Claude, Codex and Gemini.
246
+ - `contentCaptureConsent` now gates tool input/output only.
247
+
248
+ ### Behaviour change: hook delivery timeout
249
+
250
+ Existing configurations need no schema migration, but `delivery.timeoutMs`
251
+ changes from a per-request timeout to a shared hook delivery budget for direct
252
+ send, drain and isolation. It starts at the first send, not at transport
253
+ construction. A low existing value can leave no time to drain after a direct
254
+ send; those records wait for a later hook or an explicit `agentwatch status`
255
+ retry. Review custom values during upgrade. The default remains 1,500 ms.
256
+ There is no separate drain setting: keeping one hook budget bounds its network
257
+ latency without introducing competing timeout controls. CLI/status transports
258
+ remain reusable with a fresh timeout per request (3 seconds in status), including
259
+ bounded isolation probes. Local budget deferrals do not spend retry attempts.
260
+
261
+ ### New: browser sign-in enrollment (AWT-538)
262
+
263
+ `agentwatch setup "https://<backend>?organization=<organization id>"` starts a
264
+ device-code session, prints the verification link and code, and polls until the
265
+ developer approves in the browser. The device credential goes to the OS keychain
266
+ and is bound to this installation; no install key is read or sent on that path,
267
+ and `--token` / `$AGENTWATCH_TOKEN` beside a URL is refused. `agentwatch
268
+ uninstall` revokes the credential as for any device.
269
+
270
+ ### New: update notice and `agentwatch update`
271
+
272
+ When a newer release is on npm, Claude Code and Codex show one line as a
273
+ session starts: `Agent Watch x.y.z is available (you have a.b.c). Run
274
+ \`agentwatch update\` to install it.` The hook never waits on the network: it
275
+ reads a local cache (`<data dir>/update-check.json`) and, at most once a day,
276
+ starts a detached `agentwatch update --check` that asks
277
+ `registry.npmjs.org` for the `latest` dist-tag — a plain GET carrying nothing
278
+ about the machine. `agentwatch update` installs that release with
279
+ `npm install -g`; it refuses a copy run from a source checkout (`npm link`).
280
+ Set `"updateNotices": false` in `~/.agentwatch/config.json` to turn both the
281
+ check and the notice off (global-only, for fleets that pin the version).
282
+
283
+ ### New: an audit prompt for security reviewers
284
+
285
+ - `docs/AUDIT_PROMPT.md`, shipped in the package, is a prompt a reviewer pastes into
286
+ their own coding agent to audit this package from source, citing file:line for
287
+ every claim. `docs/DATA_HANDLING.md` and `SECURITY.md` link it.
288
+
289
+ ### New: `agent-watch-otel`, a Python OpenTelemetry span processor
290
+
291
+ `python/agent-watch-otel/` is this repository's first Python package and its
292
+ second published artefact. It is versioned and released on its own
293
+ (`python-release.yml`, PyPI trusted publishing with attestations); the npm
294
+ package's version is unaffected.
295
+
296
+ A Phoenix customer adds one line after `phoenix.otel.register()` and their
297
+ production LLM spend reaches Agent Watch hashed in their own process. It reports
298
+ `service.name` and `service.version`, which Phoenix drops at ingest and no poller
299
+ can recover. Prompt text, tool arguments and responses never leave the process:
300
+ digests are computed in `on_end`, so the send queue holds only hashes. `on_end`
301
+ never touches the network and never raises; the queue is bounded and drops are
302
+ counted. Phoenix keeps receiving every span unchanged.
303
+
304
+ Depends on `opentelemetry-sdk` and nothing else, which a test enforces.
305
+
306
+ ### Claude Code, Codex and Cursor turns can carry their session title
307
+
308
+ A new content flag, `capture.sessionTitle`, default off, sends a provider's
309
+ native title on every `turn.summary`: Claude Code's transcript name and title,
310
+ Codex's local thread name and title, or Cursor's conversation display title.
311
+ Like the other content flags it needs the global `contentCaptureConsent` marker;
312
+ without it, or with a missing or corrupt config, neither is sent. Each is
313
+ scrubbed, then cut to 200 characters. A generated title can paraphrase the first
314
+ prompt, and a name can be set by a person or hook. Gemini CLI and Antigravity
315
+ expose no native title, so the edge does not invent one. See
316
+ `docs/DATA_HANDLING.md`.
317
+
318
+ ### Codex turns report their tokens without native telemetry
319
+
320
+ A Codex `turn.summary` now carries the turn's input, cached-input and output tokens and
321
+ its model, read locally from the `token_count` rows of Codex's own rollout file, the
322
+ way Claude Code's transcript already is. Before, a metadata-only install (where Codex's
323
+ native OTel stays off because its logs carry tool content) sent Codex turns with no usage
324
+ at all, so their spend never reached the platform. Only token numbers and the model name
325
+ are read; nothing else in the rollout is. See `docs/DATA_HANDLING.md`.
326
+
327
+ ### Fix: a branch snapshot no longer lists trunk commits when local main is behind
328
+
329
+ The branch delta is now taken against `origin/<default>` (what the last fetch left), falling back to the local default branch when there is no remote-tracking ref. No network call is added.
330
+
331
+ ### Fixes and verification
332
+
333
+ - Empty token flags fall back to the environment or stored credential. Tokenless
334
+ configurations cannot own a backlog migration. Queue inspection before consent
335
+ never adopts legacy records; shared-owner warnings require actual pending events.
336
+ Migration prompts name both source owner and target URL and explain attribution.
337
+ Doctor compares policy and configured destination hosts instead of URL field
338
+ presence. Tests pin the 9/10/11 ms send boundary and usable larger remainders.
339
+
340
+ - Backlog migration requires exclusive source and destination identities;
341
+ skipped migrations warn on endpoint-only changes and consent names the owner.
342
+ Setup reuses existing canonical-equivalent root keys and refuses ambiguous
343
+ duplicates. Doctor names the enforcement host and warns when the policy host differs from the root’s configured destination hosts.
344
+
345
+ - **Backlog migration requires an existing exclusive identity.** A new root
346
+ inherits no machine/parent backlog; a shared token's queue stays in place.
347
+ Collector warnings use the same effective-route check as the credential
348
+ helper. Doctor explicitly fails when a configured identity has no budget
349
+ decision route, including a refused root endpoint.
350
+
351
+ - **Delivery follows one ordered flow:** choose whether to send, attempt,
352
+ preserve unsent records, update diagnostics, then drain or sweep the queue.
353
+ A thrown transport error or gateway 503 keeps the records for retry with
354
+ their original IDs. Accepted-batch rejection counters remain diagnostic.
355
+ - **One network budget per delivery pass.** Direct delivery, backlog sends and
356
+ isolation probes share `delivery.timeoutMs` (1,500 ms by default). Deferred
357
+ requests consume no retry attempts and do not trip backend cooldown. A 401/403
358
+ during isolation stops further probes and persists the credential block.
359
+ - **Response cleanup is bounded.** Unread bodies are cancelled, including
360
+ oversized declared responses and diagnostic probes; readers release their locks.
361
+ - **Linux and macOS are checked on Node 20 and 24.** CI also publishes repeatable
362
+ hook/queue timing reports. Windows and managed-fleet rollout remain separate
363
+ verification work.
364
+
365
+ Production-installation readiness. Everything below either changes what an
366
+ operator sees or what the package does on the hook path; read the first two
367
+ items before upgrading a fleet.
368
+
369
+ - **A refused credential now suspends sending instead of retrying.** After a 401
370
+ or 403 from the events endpoint, a block is persisted per (destination,
371
+ credential fingerprint) — the fingerprint is the token digest the queue
372
+ already uses to name its partition, never the token — and automatic sends for
373
+ that pair stop. **The refusal does not discard queued records**: normal age and size
374
+ retention limits still apply; what stops is the retrying, not the queueing, and no attempt is spent against an entry for a
375
+ refusal that is not its fault. The block never expires on a timer. It is
376
+ lifted by configuring a different token, or by `agentwatch doctor` proving the
377
+ current one good. `agentwatch status` reports the refusing status and when the
378
+ refusals started.
379
+ - **`agentwatch doctor` diagnoses the install, not an anonymous request.** The
380
+ backend probe now sends the same credentials a real delivery sends, and
381
+ distinguishes four states in its verdict and its exit code: healthy, credential
382
+ rejected (a **failure**, not a warning, naming a wrong, expired or revoked
383
+ token), unreachable, and no backend configured yet. A healthy install whose
384
+ backend requires authentication no longer warns. The probe always asks the
385
+ backend, whatever local state says, so it is also what lifts a standing block.
386
+ - **A delivery pass costs the same whatever the backlog holds.** One pass reads
387
+ at most `delivery.drainBatchSize` queue entries instead of reading and
388
+ validating all of them — up to 2000 file reads on every hook during a backend
389
+ outage. The scan resumes where the previous one stopped and wraps around, so
390
+ every entry is still examined within one rotation and none is deferred
391
+ forever. Expiry is no longer enforced only inside a pass: a throttled sweep
392
+ removes aged-out entries hourly, including during an outage, when a pass is
393
+ skipped for the whole cooldown window and nothing used to age out at all.
394
+ - **A hook loads one agent, and reads its configuration once.** Providers are
395
+ imported lazily, so a hook pays for the agent it was invoked for rather than
396
+ all five; the global configuration file is read once per invocation; the
397
+ credential scrub and capture gate are applied once to a record this invocation
398
+ produced (a record coming out of the backlog is still re-gated against current
399
+ settings before it is sent); the session-state sweep is throttled; and the
400
+ transcript settle loop stops re-zeroing its read buffer on every attempt.
401
+ - **The hook's answer is flushed before the process exits.** A budget refusal
402
+ travels as a JSON document on stdout, and a write to a pipe is asynchronous:
403
+ `process.exit` could drop it, which for Antigravity reads as "no decision".
404
+ - **Secrets in object keys are scrubbed.** The sanitizer pattern-scrubbed values
405
+ only, so a credential used as a *key* in a captured map was transmitted
406
+ verbatim. Two keys that scrub to the same string keep distinct spellings
407
+ rather than silently merging into one entry. Redaction also runs *before* the
408
+ length cap rather than after it: a credential straddling the 64KiB boundary
409
+ was cut short first, so no pattern matched it any more and the surviving
410
+ prefix shipped in the clear — for a JWT, a header and payload that decode to
411
+ the claims the sanitizer exists to withhold. The URL-credentials pattern is
412
+ bounded, which is what makes scrubbing the whole string affordable; unbounded,
413
+ it cost 1.8s of CPU on a single 64KiB prompt, on the hook path.
414
+ - **A backend URL is validated on every load, not only when setup writes it.**
415
+ Every URL in the configuration must be `https:`, or `http:` to loopback, so a
416
+ hand-edited or MDM-templated config cannot send a bearer and captured content
417
+ in cleartext. An offending URL is *refused* and named — on stderr from the
418
+ hook, and by `status` and `doctor` — rather than invalidating the whole file:
419
+ a failed parse falls back to a config with no token, which orphaned the
420
+ existing backlog under a partition nothing would drain again, and one bad URL
421
+ in one `roots[]` entry would have stopped delivery for every other project on
422
+ the machine. A refused field reads as "configured but unusable" and never as
423
+ absent — through `endpoint`, `eventsUrl` and `otlpUrl` alike. A `roots[]`
424
+ entry that names a backend of its own now takes its routes from its own fields
425
+ or from none: the machine's `eventsUrl` and `otlpUrl` are explicit strings
426
+ that used to win before a root's own `endpoint` was ever consulted, so one
427
+ tenant's prompts reached the other's ingest under the first tenant's bearer
428
+ whether or not a refusal was involved, and `otel-headers` handed that bearer
429
+ to the machine-wide collector. An entry that repeats the machine's endpoint —
430
+ a second seat on the same backend — still inherits its routes and its bearer. `enforcementUrl` is the one
431
+ accessor a refusal deliberately does *not* make unusable: no decision URL means
432
+ `ALLOW`, so a typo there would switch every `block` cap off silently, and the
433
+ derived route is a path on an already-validated `https:` endpoint.
434
+ `setup` names a refused URL and leaves the line the developer wrote exactly
435
+ where it is: the value is carried over the write from the file rather than
436
+ replaced by the parse, re-enrolling merges into the entry instead of replacing
437
+ it, so refused fields survive until repaired and another tenant's typo does
438
+ not block setup. A route override survives a run that leaves the destination
439
+ where it was (including trailing-slash normalization) and is dropped by one
440
+ that moves it or cannot establish the previous destination — for a `roots[]` entry and
441
+ for the machine identity alike, so winding one engagement down and enrolling
442
+ the next no longer keeps POSTing to the first one's ingest under the second
443
+ one's bearer. Every cleared live route is printed before the write, including
444
+ during endpoint repair. The same rule includes machine `enforcementUrl`; a
445
+ foreign root derives enforcement from its own base. Root token rotation keeps
446
+ its stored backend when `--endpoint` is omitted, and backlog migration asks
447
+ about the selected identity's queue. `config` warns about unavailable root
448
+ routes and `doctor` names refused endpoints explicitly. `setup` still refuses a non-deliverable `--endpoint` outright.
449
+ Response bodies the hook decodes are capped, and neither the batch send nor
450
+ the enforcement check follows a redirect — both carry a bearer.
451
+ - **`status` and `doctor` act as the identity of the directory they run in.**
452
+ Both read the machine-global token where the hooks in a `roots[]` project use
453
+ that root's own. A 401 inside such a project raised a block under the root
454
+ credential's fingerprint that `status` could not see and `doctor` could not
455
+ lift — it probed the global token, and a 2xx cleared a block that was never
456
+ the one standing — leaving that project's telemetry suspended, with no timer
457
+ to end it and no diagnostic naming it.
458
+ - **Retention holds on the paths that never send.** The whole-partition sweep ran
459
+ inside a delivery pass, and both skips — a tripped cooldown and a refused
460
+ credential — return before one. A revoked token therefore aged nothing out for
461
+ as long as the block stood, while the queue bound quietly shed the oldest
462
+ entries at the ceiling without counting them, so `status` reported nothing
463
+ lost. The sweep now runs on every path that skips a pass — including the one
464
+ where no usable endpoint is configured, which a refused URL makes a durable
465
+ state rather than a pre-setup one — its hourly throttle is read from the clock
466
+ the marker is written in (an injected or backward-stepped clock silenced it
467
+ permanently), and the bound reports what it sacrifices.
468
+ - **Every registered agent is loadable.** The eager provider list and the lazy
469
+ loader map are two hand-maintained lists of the same agents; a test now asserts
470
+ they agree. An agent in only one of them installed hooks that resolved no
471
+ provider on every invocation and dropped all of that agent's telemetry, while
472
+ `setup`, `status` and `doctor` all reported success.
473
+ - **A degraded turn summary is attributed to the same developer as a healthy
474
+ one.** On a machine that takes its identity from git rather than from
475
+ configuration, a summary emitted after turn assembly failed carried no
476
+ developer at all: counted in organization totals, in nobody's budget.
477
+ - **Agent config files are no longer permanently tightened.** `0600` is set only
478
+ when the block being written actually carries a bearer token, and `uninstall`
479
+ restores the mode the file had before AgentWatch touched it.
480
+ - **Supply chain.** Actions pinned by commit SHA, `npm ci --ignore-scripts` in
481
+ the job that builds the published tarball, `npm audit --omit=dev
482
+ --audit-level=high`, grouped weekly Dependabot updates, and a CI matrix over Node 20 and Node 24 so the declared
483
+ floor is verified rather than declared. Coverage is measured with enforced
484
+ per-directory thresholds for the privacy, enforcement, transport and turn
485
+ paths.
486
+ - **Fewer moving parts.** Dead exports deleted and the compiler set to reject
487
+ unused locals and parameters; enrollment collapsed from four files and an
488
+ interface to one function; one definition each of the content-capture flag
489
+ list, the product-record guard and the hook-command quoting patterns.
490
+
491
+ ### Release: published without provenance
492
+
493
+ The repository is private, and npm issues provenance only for public
494
+ repositories, so `release.yml` publishes without `--provenance`. Publishing goes
495
+ through npm trusted publishing; like 0.2.5, the package carries no provenance
496
+ attestation.
497
+
498
+ ### Release: no CodeQL scan
499
+
500
+ GitHub code scanning is not available on the private repository, so nothing runs
501
+ CodeQL and `release.yml` does not gate on it. The verify matrix (tests with
502
+ coverage, lint, typecheck, `npm audit` and the package checks) gates every
503
+ publish.
504
+
505
+ ### Earlier changes, never published, shipping in 0.3.0
506
+
507
+ - **Content capture is now off by default.** `capture.prompts`, `capture.responses`,
508
+ `capture.toolInput` and `capture.toolOutput` default to `false`: a fresh install collects
509
+ metadata only, and shipping prompts or tool I/O off the machine is a deliberate opt-in.
510
+ `capture.git` and `capture.files` stay `true` — they gate the repo remote/branch/SHA and the
511
+ per-file *path*, which is what feature and project attribution is built from, not content.
512
+ `prompt_evidence`/`response_evidence` (length + SHA-256, never the text) are unaffected, so turn
513
+ counts and cost attribution work with capture fully off.
514
+ - **Content capture also requires explicit consent.** A new global-only `contentCaptureConsent`
515
+ marker gates the four content flags: a config carrying `prompts: true` without it collects
516
+ nothing, so replacing the npm package cannot silently carry an older install's decision forward.
517
+ The gate is applied on every read and never written back, so a machine that adds the marker later
518
+ turns its existing flags back on instead of finding them erased; setup names the flags that are
519
+ set but inert. The gate lives in the config schema, so it also reaches records that
520
+ were queued before the policy changed — a summary loses text whose flag is off, and a
521
+ `repo.snapshot` is dropped whole once `capture.git` is off.
522
+ - **Native exporters are gated separately.** Provider logs are not filterable per field, so Codex
523
+ and Gemini usage logs are configured only with consent for both tool flags, Gemini detailed
524
+ traces additionally require prompt and response capture, and Claude's own content-logging
525
+ switches are forced off. This can leave `llm.call` usage unavailable for Codex and Gemini in
526
+ metadata-only mode. Rerun `agentwatch setup` after upgrading and restart your agents: nothing
527
+ about replacing the CLI changes an exporter already live inside a running agent.
528
+ `~/.gemini/settings.json` is now written `0600` — it carries a static bearer token.
529
+ - **`agentwatch off` / `agentwatch on`.** A local marker stops hooks before stdin, withholds the
530
+ OTLP authorization header, and removes managed native exporters through the same ownership and
531
+ backup machinery as uninstall — keeping config and queued data. Failures keep the marker, and a
532
+ repeated `off` re-runs the removal. Restart running agents to make it take effect.
533
+ - `agentwatch doctor` now probes the hook command each provider actually has installed: it never
534
+ runs the stored shell string, only a verified CLI with a bounded `--version`, and it reports
535
+ consent, capture and off-switch state.
536
+ - Release: `npm run release:artifacts` packs a verified tarball, a production-only CycloneDX SBOM
537
+ and `SHA256SUMS`. Publishing is an explicit `workflow_dispatch` on `main` through npm trusted
538
+ publishing. New [docs/DATA_HANDLING.md](docs/DATA_HANDLING.md) states the
539
+ collection contract; [docs/ENTERPRISE_DEPLOYMENT.md](docs/ENTERPRISE_DEPLOYMENT.md) states what
540
+ is deliberately not built.
541
+ - MDM deployment templates in `examples/mdm/`: a Jamf/Kandji script, an Intune script, and a
542
+ Claude Code `managed-settings.json` policy file, with a per-agent table of what an
543
+ administrator can and cannot lock. `agentwatch setup` now also reads the enrollment token
544
+ from `AGENTWATCH_TOKEN`, because a policy running as root has no private channel other than
545
+ the environment and `--token` is visible to `ps`. The flag still wins.
546
+ - A committed `.agentwatch.json` can now only ever *narrow* capture. A repository file that sets a
547
+ capture flag the machine has off is ignored and reported — `agentwatch config` and
548
+ `agentwatch doctor` both print the refusal — so checking a repository out can never start
549
+ collecting content on someone else's machine. The `capture` block also drops unknown keys instead
550
+ of passing them through.
551
+
5
552
  - `agentwatch setup` now refuses an install it cannot attribute: with no `--developer-email` and no
6
553
  `git config user.email`, it exits non-zero with the two remedies on stderr and writes no config
7
554
  file. An unknown identity is allowed silently by the enforcement gate, so an unattributable
@@ -29,6 +576,17 @@
29
576
  - A refused prompt records no turn state — it never reached a model — while the offline queue still
30
577
  drains on that hook. `agentwatch status` reports whether enforcement is on, and the example
31
578
  backend gained the route (`BLOCK=1 npm run example` refuses everything).
579
+ - The gate now also states the session's model (`&model=…`), so a budget can be set on one model.
580
+ Codex, Cursor, Gemini and Antigravity name their model on every hook they send; Claude Code
581
+ names it only when a session starts, so that one event remembers it in a `session.json` beside
582
+ that session's turn records (mode 0600, in a directory named by a hash of the session id, never
583
+ by the id itself) and it is cleared with the rest of the session at SessionEnd, or by the
584
+ 24-hour sweep for a session that crashed. A session that starts naming no model forgets any
585
+ model remembered under that id rather than inheriting it. It is spelled as the agent names it,
586
+ which for every agent but Claude Code is the same event the reported usage comes from. The model is part of the local cache key, so an answer about one model
587
+ is never reused for a prompt on another. The added cost is that one file read: no subprocess, no
588
+ extra request, and an unreadable memo states no model rather than waiting. A collector that never
589
+ learns a model asks exactly what it asks today and is answered exactly as today.
32
590
 
33
591
  ## 0.2.0
34
592