@decibelsystems/tools 2.2.0-beta.0 → 3.0.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 (273) hide show
  1. package/CHANGELOG.md +160 -0
  2. package/dist/agentPresence.d.ts +80 -0
  3. package/dist/agentPresence.d.ts.map +1 -1
  4. package/dist/agentPresence.js +177 -0
  5. package/dist/agentPresence.js.map +1 -1
  6. package/dist/agentic/index.d.ts +18 -8
  7. package/dist/agentic/index.d.ts.map +1 -1
  8. package/dist/agentic/index.js +18 -144
  9. package/dist/agentic/index.js.map +1 -1
  10. package/dist/agentic/types.d.ts +106 -0
  11. package/dist/agentic/types.d.ts.map +1 -1
  12. package/dist/agentic/types.js +77 -1
  13. package/dist/agentic/types.js.map +1 -1
  14. package/dist/architectAdrs.d.ts +14 -2
  15. package/dist/architectAdrs.d.ts.map +1 -1
  16. package/dist/architectAdrs.js +9 -3
  17. package/dist/architectAdrs.js.map +1 -1
  18. package/dist/client/transports.d.ts.map +1 -1
  19. package/dist/client/transports.js +13 -3
  20. package/dist/client/transports.js.map +1 -1
  21. package/dist/daemon.d.ts +19 -0
  22. package/dist/daemon.d.ts.map +1 -1
  23. package/dist/daemon.js +181 -38
  24. package/dist/daemon.js.map +1 -1
  25. package/dist/daemonConfig.d.ts +24 -0
  26. package/dist/daemonConfig.d.ts.map +1 -1
  27. package/dist/daemonConfig.js +46 -12
  28. package/dist/daemonConfig.js.map +1 -1
  29. package/dist/decibelPaths.d.ts.map +1 -1
  30. package/dist/decibelPaths.js +39 -6
  31. package/dist/decibelPaths.js.map +1 -1
  32. package/dist/domain/issue.d.ts +77 -0
  33. package/dist/domain/issue.d.ts.map +1 -0
  34. package/dist/domain/issue.js +134 -0
  35. package/dist/domain/issue.js.map +1 -0
  36. package/dist/domain/issueCodec.d.ts +39 -0
  37. package/dist/domain/issueCodec.d.ts.map +1 -0
  38. package/dist/domain/issueCodec.js +298 -0
  39. package/dist/domain/issueCodec.js.map +1 -0
  40. package/dist/domain/issueRepository.d.ts +91 -0
  41. package/dist/domain/issueRepository.d.ts.map +1 -0
  42. package/dist/domain/issueRepository.js +257 -0
  43. package/dist/domain/issueRepository.js.map +1 -0
  44. package/dist/facades/definitions.d.ts +0 -1
  45. package/dist/facades/definitions.d.ts.map +1 -1
  46. package/dist/facades/definitions.js +94 -113
  47. package/dist/facades/definitions.js.map +1 -1
  48. package/dist/facades/index.d.ts +2 -1
  49. package/dist/facades/index.d.ts.map +1 -1
  50. package/dist/facades/index.js +1 -1
  51. package/dist/facades/index.js.map +1 -1
  52. package/dist/facades/types.d.ts +17 -0
  53. package/dist/facades/types.d.ts.map +1 -1
  54. package/dist/httpArgs.d.ts +11 -0
  55. package/dist/httpArgs.d.ts.map +1 -0
  56. package/dist/httpArgs.js +39 -0
  57. package/dist/httpArgs.js.map +1 -0
  58. package/dist/httpServer.d.ts +1 -12
  59. package/dist/httpServer.d.ts.map +1 -1
  60. package/dist/httpServer.js +97 -96
  61. package/dist/httpServer.js.map +1 -1
  62. package/dist/kernel.d.ts +46 -1
  63. package/dist/kernel.d.ts.map +1 -1
  64. package/dist/kernel.js +311 -26
  65. package/dist/kernel.js.map +1 -1
  66. package/dist/lib/agent-services/assumptions.d.ts.map +1 -1
  67. package/dist/lib/agent-services/assumptions.js +8 -2
  68. package/dist/lib/agent-services/assumptions.js.map +1 -1
  69. package/dist/lib/atomicWrite.d.ts +26 -0
  70. package/dist/lib/atomicWrite.d.ts.map +1 -0
  71. package/dist/lib/atomicWrite.js +73 -0
  72. package/dist/lib/atomicWrite.js.map +1 -0
  73. package/dist/lib/envelope.d.ts +31 -0
  74. package/dist/lib/envelope.d.ts.map +1 -0
  75. package/dist/lib/envelope.js +80 -0
  76. package/dist/lib/envelope.js.map +1 -0
  77. package/dist/lib/fileLock.d.ts +38 -0
  78. package/dist/lib/fileLock.d.ts.map +1 -0
  79. package/dist/lib/fileLock.js +124 -0
  80. package/dist/lib/fileLock.js.map +1 -0
  81. package/dist/lib/recordIdAllocator.d.ts +86 -0
  82. package/dist/lib/recordIdAllocator.d.ts.map +1 -0
  83. package/dist/lib/recordIdAllocator.js +161 -0
  84. package/dist/lib/recordIdAllocator.js.map +1 -0
  85. package/dist/projectRegistry.d.ts.map +1 -1
  86. package/dist/projectRegistry.js +11 -0
  87. package/dist/projectRegistry.js.map +1 -1
  88. package/dist/runtime/circuitBreaker.d.ts +95 -0
  89. package/dist/runtime/circuitBreaker.d.ts.map +1 -0
  90. package/dist/runtime/circuitBreaker.js +178 -0
  91. package/dist/runtime/circuitBreaker.js.map +1 -0
  92. package/dist/runtime/ensureRuntime.d.ts +103 -0
  93. package/dist/runtime/ensureRuntime.d.ts.map +1 -0
  94. package/dist/runtime/ensureRuntime.js +281 -0
  95. package/dist/runtime/ensureRuntime.js.map +1 -0
  96. package/dist/runtime/extensions.d.ts +57 -0
  97. package/dist/runtime/extensions.d.ts.map +1 -0
  98. package/dist/runtime/extensions.js +216 -0
  99. package/dist/runtime/extensions.js.map +1 -0
  100. package/dist/runtime/localHttp.d.ts +24 -0
  101. package/dist/runtime/localHttp.d.ts.map +1 -0
  102. package/dist/runtime/localHttp.js +84 -0
  103. package/dist/runtime/localHttp.js.map +1 -0
  104. package/dist/runtime/projectResolution.d.ts +29 -0
  105. package/dist/runtime/projectResolution.d.ts.map +1 -0
  106. package/dist/runtime/projectResolution.js +67 -0
  107. package/dist/runtime/projectResolution.js.map +1 -0
  108. package/dist/runtime/protocol.d.ts +62 -0
  109. package/dist/runtime/protocol.d.ts.map +1 -0
  110. package/dist/runtime/protocol.js +74 -0
  111. package/dist/runtime/protocol.js.map +1 -0
  112. package/dist/sentinelIssues.d.ts +26 -2
  113. package/dist/sentinelIssues.d.ts.map +1 -1
  114. package/dist/sentinelIssues.js +125 -64
  115. package/dist/sentinelIssues.js.map +1 -1
  116. package/dist/server.js +59 -12
  117. package/dist/server.js.map +1 -1
  118. package/dist/tools/agentic/index.d.ts.map +1 -1
  119. package/dist/tools/agentic/index.js +28 -2
  120. package/dist/tools/agentic/index.js.map +1 -1
  121. package/dist/tools/architect/index.d.ts.map +1 -1
  122. package/dist/tools/architect/index.js +7 -2
  123. package/dist/tools/architect/index.js.map +1 -1
  124. package/dist/tools/context.d.ts +10 -5
  125. package/dist/tools/context.d.ts.map +1 -1
  126. package/dist/tools/context.js +45 -18
  127. package/dist/tools/context.js.map +1 -1
  128. package/dist/tools/coordinator/coordinator.d.ts.map +1 -1
  129. package/dist/tools/coordinator/coordinator.js +48 -19
  130. package/dist/tools/coordinator/coordinator.js.map +1 -1
  131. package/dist/tools/crit.d.ts +2 -1
  132. package/dist/tools/crit.d.ts.map +1 -1
  133. package/dist/tools/crit.js +19 -4
  134. package/dist/tools/crit.js.map +1 -1
  135. package/dist/tools/designer/index.d.ts.map +1 -1
  136. package/dist/tools/designer/index.js +4 -3
  137. package/dist/tools/designer/index.js.map +1 -1
  138. package/dist/tools/designer/lateral-tools.d.ts.map +1 -1
  139. package/dist/tools/designer/lateral-tools.js +4 -2
  140. package/dist/tools/designer/lateral-tools.js.map +1 -1
  141. package/dist/tools/designer.d.ts +2 -1
  142. package/dist/tools/designer.d.ts.map +1 -1
  143. package/dist/tools/designer.js +24 -12
  144. package/dist/tools/designer.js.map +1 -1
  145. package/dist/tools/dojo.d.ts +3 -2
  146. package/dist/tools/dojo.d.ts.map +1 -1
  147. package/dist/tools/dojo.js +64 -22
  148. package/dist/tools/dojo.js.map +1 -1
  149. package/dist/tools/friction.d.ts.map +1 -1
  150. package/dist/tools/friction.js +16 -6
  151. package/dist/tools/friction.js.map +1 -1
  152. package/dist/tools/guardian.d.ts.map +1 -1
  153. package/dist/tools/guardian.js +6 -2
  154. package/dist/tools/guardian.js.map +1 -1
  155. package/dist/tools/hygiene/oracle-hygiene.d.ts.map +1 -1
  156. package/dist/tools/hygiene/oracle-hygiene.js +8 -2
  157. package/dist/tools/hygiene/oracle-hygiene.js.map +1 -1
  158. package/dist/tools/index.d.ts.map +1 -1
  159. package/dist/tools/index.js +27 -18
  160. package/dist/tools/index.js.map +1 -1
  161. package/dist/tools/learnings.d.ts +2 -1
  162. package/dist/tools/learnings.d.ts.map +1 -1
  163. package/dist/tools/learnings.js +31 -15
  164. package/dist/tools/learnings.js.map +1 -1
  165. package/dist/tools/oracle.d.ts.map +1 -1
  166. package/dist/tools/oracle.js +19 -6
  167. package/dist/tools/oracle.js.map +1 -1
  168. package/dist/tools/policy.d.ts +2 -1
  169. package/dist/tools/policy.d.ts.map +1 -1
  170. package/dist/tools/policy.js +28 -9
  171. package/dist/tools/policy.js.map +1 -1
  172. package/dist/tools/postoffice/index.d.ts +10 -0
  173. package/dist/tools/postoffice/index.d.ts.map +1 -0
  174. package/dist/tools/postoffice/index.js +218 -0
  175. package/dist/tools/postoffice/index.js.map +1 -0
  176. package/dist/tools/postoffice.d.ts +78 -0
  177. package/dist/tools/postoffice.d.ts.map +1 -0
  178. package/dist/tools/postoffice.js +199 -0
  179. package/dist/tools/postoffice.js.map +1 -0
  180. package/dist/tools/provenance.d.ts +7 -0
  181. package/dist/tools/provenance.d.ts.map +1 -1
  182. package/dist/tools/provenance.js +42 -16
  183. package/dist/tools/provenance.js.map +1 -1
  184. package/dist/tools/sentinel/index.d.ts +1 -0
  185. package/dist/tools/sentinel/index.d.ts.map +1 -1
  186. package/dist/tools/sentinel/index.js +88 -4
  187. package/dist/tools/sentinel/index.js.map +1 -1
  188. package/dist/tools/sentinel.d.ts +102 -1
  189. package/dist/tools/sentinel.d.ts.map +1 -1
  190. package/dist/tools/sentinel.js +544 -328
  191. package/dist/tools/sentinel.js.map +1 -1
  192. package/dist/tools/shared/index.d.ts +2 -1
  193. package/dist/tools/shared/index.d.ts.map +1 -1
  194. package/dist/tools/shared/index.js +2 -1
  195. package/dist/tools/shared/index.js.map +1 -1
  196. package/dist/tools/shared/response.d.ts +24 -0
  197. package/dist/tools/shared/response.d.ts.map +1 -1
  198. package/dist/tools/shared/response.js +61 -7
  199. package/dist/tools/shared/response.js.map +1 -1
  200. package/dist/tools/shared/storeRead.d.ts +153 -0
  201. package/dist/tools/shared/storeRead.d.ts.map +1 -0
  202. package/dist/tools/shared/storeRead.js +242 -0
  203. package/dist/tools/shared/storeRead.js.map +1 -0
  204. package/dist/tools/testSpec.d.ts +3 -2
  205. package/dist/tools/testSpec.d.ts.map +1 -1
  206. package/dist/tools/testSpec.js +51 -14
  207. package/dist/tools/testSpec.js.map +1 -1
  208. package/dist/tools/vector.d.ts +33 -1
  209. package/dist/tools/vector.d.ts.map +1 -1
  210. package/dist/tools/vector.js +31 -5
  211. package/dist/tools/vector.js.map +1 -1
  212. package/dist/tools/zoom/index.d.ts +15 -0
  213. package/dist/tools/zoom/index.d.ts.map +1 -0
  214. package/dist/tools/zoom/index.js +174 -0
  215. package/dist/tools/zoom/index.js.map +1 -0
  216. package/dist/tools/zoom.d.ts +234 -0
  217. package/dist/tools/zoom.d.ts.map +1 -0
  218. package/dist/tools/zoom.js +627 -0
  219. package/dist/tools/zoom.js.map +1 -0
  220. package/dist/transports/bridge.d.ts +1 -1
  221. package/dist/transports/bridge.d.ts.map +1 -1
  222. package/dist/transports/bridge.js +2 -0
  223. package/dist/transports/bridge.js.map +1 -1
  224. package/dist/transports/http.d.ts +1 -1
  225. package/dist/transports/http.d.ts.map +1 -1
  226. package/dist/transports/http.js +3 -1
  227. package/dist/transports/http.js.map +1 -1
  228. package/dist/transports/index.d.ts +1 -0
  229. package/dist/transports/index.d.ts.map +1 -1
  230. package/dist/transports/index.js +1 -0
  231. package/dist/transports/index.js.map +1 -1
  232. package/dist/transports/mcp.d.ts +1 -1
  233. package/dist/transports/mcp.d.ts.map +1 -1
  234. package/dist/transports/mcp.js +7 -3
  235. package/dist/transports/mcp.js.map +1 -1
  236. package/dist/transports/stdio.d.ts +1 -1
  237. package/dist/transports/stdio.d.ts.map +1 -1
  238. package/dist/transports/stdio.js +2 -0
  239. package/dist/transports/stdio.js.map +1 -1
  240. package/dist/transports/thinStdio.d.ts +22 -0
  241. package/dist/transports/thinStdio.d.ts.map +1 -0
  242. package/dist/transports/thinStdio.js +218 -0
  243. package/dist/transports/thinStdio.js.map +1 -0
  244. package/dist/transports/types.d.ts +8 -1
  245. package/dist/transports/types.d.ts.map +1 -1
  246. package/dist/types/agent-services.d.ts +7 -0
  247. package/dist/types/agent-services.d.ts.map +1 -1
  248. package/package.json +9 -4
  249. package/templates/com.decibel.daemon.plist +6 -1
  250. package/dist/tools/deck.d.ts +0 -11
  251. package/dist/tools/deck.d.ts.map +0 -1
  252. package/dist/tools/deck.js +0 -1656
  253. package/dist/tools/deck.js.map +0 -1
  254. package/dist/tools/mother.d.ts +0 -11
  255. package/dist/tools/mother.d.ts.map +0 -1
  256. package/dist/tools/mother.js +0 -503
  257. package/dist/tools/mother.js.map +0 -1
  258. package/dist/tools/registry.d.ts +0 -3
  259. package/dist/tools/registry.d.ts.map +0 -1
  260. package/dist/tools/registry.js +0 -189
  261. package/dist/tools/registry.js.map +0 -1
  262. package/dist/tools/senken.d.ts +0 -11
  263. package/dist/tools/senken.d.ts.map +0 -1
  264. package/dist/tools/senken.js +0 -482
  265. package/dist/tools/senken.js.map +0 -1
  266. package/dist/tools/terminal.d.ts +0 -17
  267. package/dist/tools/terminal.d.ts.map +0 -1
  268. package/dist/tools/terminal.js +0 -968
  269. package/dist/tools/terminal.js.map +0 -1
  270. package/dist/tools/toolsIndex.d.ts +0 -5
  271. package/dist/tools/toolsIndex.d.ts.map +0 -1
  272. package/dist/tools/toolsIndex.js +0 -37
  273. package/dist/tools/toolsIndex.js.map +0 -1
package/CHANGELOG.md ADDED
@@ -0,0 +1,160 @@
1
+ # Changelog
2
+
3
+ ## 3.0.0 — 2026-09-06
4
+
5
+ Decibel Tools stopped being a daemon, an MCP server, a CLI, a store and a VS Code
6
+ extension that happen to share a repo. It is **one runtime with several adapters**.
7
+ An adapter translates transport and establishes project context; it does not
8
+ instantiate its own store, caches, project registry, or write path.
9
+
10
+ That is the whole of 3.0. Everything below follows from it.
11
+
12
+ ### Breaking
13
+
14
+ - **`DECIBEL_APPS=1` is gone, and no environment variable replaces it.** The
15
+ apps-tier facades (`senken`, `deck`, `mother`, `terminal`) are no longer compiled
16
+ into the package. They load at boot as extensions, from `extensions.allow` in
17
+ `~/.decibel/config.yaml`, **by absolute path only** — a bare specifier would
18
+ resolve against `node_modules`, which would hand facade selection to whoever can
19
+ write a package. An extension may not shadow a registered facade name.
20
+
21
+ Config-file state the owner edits beats environment state a generator has to
22
+ remember: a regenerated launchd plist silently dropped those four facades once,
23
+ and `/health` reported `status: ok` with no indication four were missing.
24
+
25
+ - **The public package no longer describes private facades.** It previously shipped
26
+ compiled `senken.js` and `deck.js` — a description of a live trading Postgres and
27
+ a wallet-spending tool it could never reach. `S7` now asserts their absence from
28
+ the tarball on every run.
29
+
30
+ - **An unregistered facade is a hard error, not an empty success.** Fail-closed by
31
+ absence is only safe if absence is loud. A call to something that was never
32
+ registered returns `ok: false` / `TOOL_ERROR`; it does not return zero rows.
33
+
34
+ - **Issue records are canonical markdown.** All 58 remaining bare-YAML records were
35
+ converted; the store is markdown-only. Timestamp-slug *filenames* are deliberately
36
+ kept (ADR-0010) — 49 provenance events and 2 ADRs reference them, and provenance
37
+ events are immutable audit records. Identity is the `id:` field, which is already
38
+ how records resolve.
39
+
40
+ - **Adapters do not silently become writers.** There is no in-process fallback for
41
+ mutations. A thin client auto-starts the runtime, retries briefly, then fails with
42
+ an actionable error.
43
+
44
+ ### The surface
45
+
46
+ | Tier | Facades | Actions | How it loads |
47
+ |---|---|---|---|
48
+ | core | 26 | 183 | always |
49
+ | + pro | 31 | 224 | license-gated at runtime |
50
+ | + apps | — | — | extensions, absolute-path allowlist, not in the package |
51
+
52
+ ### Store integrity
53
+
54
+ - **One writer.** `sentinelIssues.createIssue` delegates to `FsIssueRepository`;
55
+ there is no longer a second implementation emitting a different format into the
56
+ same directory.
57
+ - **Id allocation is serialized across processes.** A file lock spans allocation
58
+ *through successful write* — serializing only the id scan leaves the race intact,
59
+ since both processes still compute the same number before either file lands — and
60
+ the write itself is `O_EXCL` as a second, independent defence against callers that
61
+ never take the lock. Applies to issues **and epics**; epics were still racing
62
+ until the S5 sweep found it (ISS-0158).
63
+ - **Structured fields are parsed, mutated, serialized and atomically renamed**, never
64
+ edited by regex. Values containing `#`, `:`, `---` or a markdown heading survive
65
+ read-back.
66
+ - **Repair, once.** `degraded` went 10 → 0, duplicate ids 4 groups → 0, wrong
67
+ `project` values 18 → 0. All three are now invariants CI can fail on. Most of the
68
+ degraded records carried a completed resolution and were open only because an old
69
+ status write had failed — the correct repair was to close them, not reformat them.
70
+ - **Status is no longer stored twice by hand.** Markdown records mirror status into
71
+ the body; 16 had drifted from frontmatter, reading `open` to a person while every
72
+ tool reported them correctly. `close_issue` rewrote the mirror and `updateIssue`
73
+ never did. No test caught it because every test asserted through frontmatter, which
74
+ was never wrong.
75
+
76
+ ### Reads state absence honestly
77
+
78
+ Thirty-one store-backed reads can now tell an **empty** store apart from an
79
+ **unreadable** one, an **unparseable** one, and a **project that does not resolve**.
80
+ Previously `if (!parsed) continue` and `catch {}` turned every one of those into
81
+ `[]`.
82
+
83
+ Reads that skip a record now carry `store_status` and `unreadable_count`. Three
84
+ paths fail loudly instead, because a partial answer would have been dishonest:
85
+ context's whole-file `facts.json` and `events.json`, and `auditPolicies` — where one
86
+ bad policy used to abort the audit and report `summary.fail: 0`.
87
+
88
+ ### Runtime and daemon
89
+
90
+ - `ensureRuntime({projectRoot, protocolVersion})` — one lifecycle primitive shared by
91
+ every caller (MCP, CLI, VS Code, hooks). Arbitration is the socket bind or an
92
+ atomic startup lock, never a PID file.
93
+ - Protocol negotiation refuses a version-skewed runtime at handshake rather than
94
+ per-call. `/health` carries runtime version, protocol version, tier,
95
+ `extensions.loaded` and `extensions.rejected` with per-entry reasons.
96
+ - **Error isolation**: no facade fault escapes `dispatch()`, including throws from
97
+ parameter coercion and facade resolution (which the transports would otherwise turn
98
+ into an MCP protocol fault rather than a failed tool call), and including dispatch
99
+ event listeners, which run synchronously on the call path.
100
+ - **Per-facade circuit breaker.** The signal is *unresponsiveness*, not unhappiness:
101
+ a throw always counts, an `isError` slower than 2s counts, a fast `isError` leaves
102
+ the counters untouched. Five consecutive faults open a facade for 30s, then exactly
103
+ one probe at a time — a recovering database gets one connection attempt, not six.
104
+ Facade and direct-tool calls share one circuit, so `senken.trade_summary` and
105
+ `senken_trade_summary` cannot each burn a budget against the same pool.
106
+ - Daemon hardening: timing-safe auth, body limits, rate limiting, log rotation,
107
+ graceful drain, crash-loop protection.
108
+
109
+ ### New
110
+
111
+ - **guardian** (core) — dependency, secret, HTTP and config scanning with A–F grading.
112
+ - **postoffice** (EPIC-0037) — model-agnostic agent-to-agent messaging, all seven
113
+ verbs, two-way threaded exchange.
114
+ - **conductor** — run/dryrun/trace/cost/egress/routing.
115
+ - **zoom** (EPIC-0036) — meeting-summary ingestion, gated behind `DECIBEL_ZOOM=1`.
116
+ **Not yet run against a live Zoom account.** It ships dark: unreachable unless
117
+ explicitly enabled.
118
+
119
+ ### The release gate
120
+
121
+ `@decibelsystems/tools@3.0.0` is the first release blocked on the **tool torture
122
+ test** (`.decibel/specs/2026-09-02-tool-torture-test.md`) — eight generated sweeps
123
+ over the whole surface across four transports, built on one observation:
124
+
125
+ > Every failure this project has actually shipped returned `ok: true`.
126
+
127
+ A voice inbox dead for five and a half hours read as `voice 0`. A regenerated plist
128
+ dropped four facades while `/health` said `status: ok`. `/batch` answered
129
+ `{ok: true}` for a facade that does not exist.
130
+
131
+ | Sweep | Gate |
132
+ |---|---|
133
+ | S0 enumeration | no unclaimed actions, no dangling actions, no expired waivers |
134
+ | S1 envelope | every action answers in a well-formed envelope |
135
+ | S2 absence | every read distinguishes the four situations above |
136
+ | S3 round-trip | hostile values survive write → read |
137
+ | S4 transports | stdio, thin, http-call and http-batch agree, differences declared |
138
+ | S5 concurrency | 50 concurrent creates across 10 processes; crash mid-write |
139
+ | S6 tier/extension | the apps boundary holds, and no env var reopens it |
140
+ | S7 artifact | the packed tarball, not the repo |
141
+
142
+ The surface is **generated from the kernel's own registries**, never enumerated by
143
+ hand: adding a tool without giving it coverage turns the build red. Every action is
144
+ claimed by a sweep or waived in `waivers.yaml` with a reason, an owner, and an
145
+ expiry. Waivers expire, and an expired waiver fails the build.
146
+
147
+ Six of the eighteen findings in S2 were the harness lying — fixtures planted at paths
148
+ no reader globs, so tools that handled absence correctly were reported broken. S5's
149
+ first crash test reported four successful `SIGKILL`s while all four victims kept
150
+ running. Every sweep now carries a calibration probe that asserts it can see a
151
+ deliberately broken tool before it is believed about the healthy ones.
152
+
153
+ 881 tests.
154
+
155
+ ---
156
+
157
+ ## 2.x
158
+
159
+ Not tracked in this file. See the git history and `.decibel/sentinel/` for the
160
+ issue-level record.
@@ -7,6 +7,85 @@
7
7
  * value the presence writer stamps. Shared by the dispatcher (agentCommands.ts).
8
8
  */
9
9
  export declare function resolveHost(): string;
10
+ declare function serviceClient(): import("@supabase/supabase-js").SupabaseClient<any, "public", "hq", any, any> | null;
11
+ type DbClient = NonNullable<ReturnType<typeof serviceClient>>;
12
+ /**
13
+ * Derive the DURABLE address for a session.
14
+ *
15
+ * Must be stable across restarts, so anything process-scoped is disqualified:
16
+ * not the session key, not a PID, not a TTY. The claude-peers broker id looks
17
+ * stable but is not — it carries a random suffix (`decibel-hq-nby9`), so a
18
+ * restart would silently mint a second agent and split the thread history.
19
+ *
20
+ * Repo identity + runtime is the stable pair: the same checkout on the same
21
+ * runtime is the same logical agent, session after session.
22
+ *
23
+ * DELIBERATELY NOT caller-supplied. `reg.agent` is an untrusted display label
24
+ * from a local process, and a local caller that could name its own durable
25
+ * address could claim an EXISTING agent's name — resolve_agent_session picks
26
+ * the most recently seen session, so a frequent heartbeater would capture that
27
+ * agent's inbound mail. That is the principal-not-label gap (EPIC-0007) which
28
+ * Ben accepted as risk for EPIC-0037; accepting it is not a reason to widen it.
29
+ * An operator can still set the name explicitly via DECIBEL_AGENT_NAME, which
30
+ * is daemon-scoped env (trusted) rather than per-request payload.
31
+ */
32
+ export declare function deriveAgentName(input: {
33
+ gitRoot?: string | null;
34
+ cwd?: string | null;
35
+ runtime: string;
36
+ host: string;
37
+ }): string;
38
+ /**
39
+ * Resolve (or create) the durable hq.agents row for `name` and return its id.
40
+ *
41
+ * Returns null rather than throwing when the table is absent — this ships
42
+ * BEFORE decibel-hq applies the post-office migration, and presence writing
43
+ * must keep working untouched in the meantime. When the migration lands the
44
+ * same code starts populating agent_id with no redeploy.
45
+ *
46
+ * `runtime` is written as a self-declared LABEL only. HQ's schema comment is
47
+ * explicit that it is never a trust signal, so nothing here gates on it.
48
+ */
49
+ export declare function resolveAgentId(client: DbClient, name: string, runtime: string): Promise<string | null>;
50
+ /** Test seam: drop memoised ids so a test can observe a fresh resolve. */
51
+ export declare function __resetAgentIdCache(): void;
52
+ export interface AgentRosterEntry {
53
+ id: string;
54
+ name: string;
55
+ runtime: string;
56
+ role: string | null;
57
+ capabilities: string[];
58
+ /** Durable lifecycle from hq.agents: 'active' | 'retired'. NOT liveness. */
59
+ status: string;
60
+ /** Liveness: does a live session currently resolve for this agent? */
61
+ online: boolean;
62
+ /** The session a message would be delivered into right now, or null. */
63
+ session_key: string | null;
64
+ last_seen_at: string | null;
65
+ }
66
+ /**
67
+ * The agents.list roster: hq.agents LEFT JOIN liveness.
68
+ *
69
+ * The roster is the DURABLE agents, each annotated with whether a live session
70
+ * resolves. An agent that exists but is offline MUST appear, marked offline,
71
+ * rather than vanish — a roster built from live sessions would silently drop
72
+ * exactly the agent you are trying and failing to reach, which is the same
73
+ * failure class as addressing a dead session.
74
+ *
75
+ * Two queries and a join in memory rather than one call to
76
+ * hq.resolve_agent_session per agent, which would be N round trips to render
77
+ * one board.
78
+ *
79
+ * CLOCK CAVEAT, and it is why this is a DISPLAY path only: the cutoff below is
80
+ * computed from the daemon's clock, while resolve_agent_session uses the
81
+ * database's now(). Skew between them can disagree at the 60s boundary. The
82
+ * authoritative answer at DELIVERY time is HQ's function, never this. Do not
83
+ * route a message using this roster's `online`.
84
+ *
85
+ * Returns null (not an empty roster) when the table is absent, so a caller can
86
+ * distinguish "no agents" from "post office not deployed yet".
87
+ */
88
+ export declare function listAgentRoster(client: DbClient): Promise<AgentRosterEntry[] | null>;
10
89
  export interface LocalAgentRegistration {
11
90
  session_key: string;
12
91
  runtime: string;
@@ -33,4 +112,5 @@ export declare function sanitizeMeta(meta: Record<string, unknown> | undefined):
33
112
  export declare function writeLocalAgentSession(reg: LocalAgentRegistration): Promise<boolean>;
34
113
  /** Start the presence writer loop. Returns a stop function. No-ops if Supabase unconfigured. */
35
114
  export declare function startPresenceWriter(): () => void;
115
+ export {};
36
116
  //# sourceMappingURL=agentPresence.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"agentPresence.d.ts","sourceRoot":"","sources":["../src/agentPresence.ts"],"names":[],"mappings":"AAsBA;;;;;;;GAOG;AACH,wBAAgB,WAAW,IAAI,MAAM,CAEpC;AAwHD,MAAM,WAAW,sBAAsB;IACrC,WAAW,EAAE,MAAM,CAAC;IACpB,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,GAAG,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACpB,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAG/B,MAAM,CAAC,EAAE,QAAQ,GAAG,OAAO,CAAC;CAC7B;AAmBD,+EAA+E;AAC/E,wBAAgB,YAAY,CAAC,CAAC,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,EAAE,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAIxF;AAED;;;;;GAKG;AACH,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAAS,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAU/F;AAED;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AM,GAAG,IAAI,CAAC;CAC7B;AAED;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,wBAAsB,eAAe,CAAC,MAAM,EAAE,QAAQ,GAAG,OAAO,CAAC,gBAAgB,EAAE,GAAG,IAAI,CAAC,CAmD1F;AA2ED,MAAM,WAAW,sBAAsB;IACrC,WAAW,EAAE,MAAM,CAAC;IACpB,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,GAAG,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACpB,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAG/B,MAAM,CAAC,EAAE,QAAQ,GAAG,OAAO,CAAC;CAC7B;AAmBD,+EAA+E;AAC/E,wBAAgB,YAAY,CAAC,CAAC,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,EAAE,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAIxF;AAED;;;;;GAKG;AACH,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAAS,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAU/F;AAED;;;;GAIG;AACH,wBAAsB,sBAAsB,CAAC,GAAG,EAAE,sBAAsB,GAAG,OAAO,CAAC,OAAO,CAAC,CAiD1F;AAED,gGAAgG;AAChG,wBAAgB,mBAAmB,IAAI,MAAM,IAAI,CAchD"}
@@ -78,6 +78,170 @@ async function resolveProjectId(client, cwd) {
78
78
  projectMap = await loadProjects(client); // refresh once on miss
79
79
  return projectMap.get(key) ?? null;
80
80
  }
81
+ // ============================================================================
82
+ // Durable agent identity — the agent_id seam (ISS-0134 / EPIC-0037)
83
+ // ============================================================================
84
+ // hq.agent_sessions is EPHEMERAL: session_key dies with the process. hq.agents
85
+ // is DURABLE: "this repo's Claude Code agent", stable across restarts, and it
86
+ // is what a post-office message is addressed to. agent_sessions.agent_id is the
87
+ // resolution edge between them, and HQ cannot populate it — the daemon owns
88
+ // this write path, so the column stays inert until the code below fills it.
89
+ //
90
+ // Without it hq.resolve_agent_session() finds nothing, every message resolves
91
+ // to delivered_session_key = NULL, and the post office records traffic it never
92
+ // delivers. Honest, but inert.
93
+ //
94
+ // CARDINALITY IS MANY SESSIONS : ONE AGENT. That is not an assumption — HQ's
95
+ // resolve_agent_session() ends in `order by last_seen_at desc limit 1`, which
96
+ // only makes sense if several live sessions can share one agent_id. Two Claude
97
+ // Code windows open on the same repo are one addressable agent; delivery goes
98
+ // to whichever is most recently active.
99
+ /**
100
+ * Derive the DURABLE address for a session.
101
+ *
102
+ * Must be stable across restarts, so anything process-scoped is disqualified:
103
+ * not the session key, not a PID, not a TTY. The claude-peers broker id looks
104
+ * stable but is not — it carries a random suffix (`decibel-hq-nby9`), so a
105
+ * restart would silently mint a second agent and split the thread history.
106
+ *
107
+ * Repo identity + runtime is the stable pair: the same checkout on the same
108
+ * runtime is the same logical agent, session after session.
109
+ *
110
+ * DELIBERATELY NOT caller-supplied. `reg.agent` is an untrusted display label
111
+ * from a local process, and a local caller that could name its own durable
112
+ * address could claim an EXISTING agent's name — resolve_agent_session picks
113
+ * the most recently seen session, so a frequent heartbeater would capture that
114
+ * agent's inbound mail. That is the principal-not-label gap (EPIC-0007) which
115
+ * Ben accepted as risk for EPIC-0037; accepting it is not a reason to widen it.
116
+ * An operator can still set the name explicitly via DECIBEL_AGENT_NAME, which
117
+ * is daemon-scoped env (trusted) rather than per-request payload.
118
+ */
119
+ export function deriveAgentName(input) {
120
+ const explicit = process.env.DECIBEL_AGENT_NAME;
121
+ if (explicit && explicit.trim())
122
+ return explicit.trim().slice(0, 200);
123
+ // basename of the git root, else of the cwd — the repo IS the identity.
124
+ const root = (input.gitRoot || input.cwd || '').trim();
125
+ const key = root ? path.basename(root) : '';
126
+ // No filesystem context at all (a runtime that registered without a cwd):
127
+ // fall back to the daemon host so the name is still stable, just coarser.
128
+ const scope = key || input.host;
129
+ return `${scope}/${input.runtime}`.slice(0, 200);
130
+ }
131
+ /**
132
+ * agent name -> hq.agents.id, memoised for the process. The presence loop runs
133
+ * every 30s over every peer; without this each tick would re-round-trip the
134
+ * same handful of names forever.
135
+ */
136
+ const agentIdCache = new Map();
137
+ /**
138
+ * Resolve (or create) the durable hq.agents row for `name` and return its id.
139
+ *
140
+ * Returns null rather than throwing when the table is absent — this ships
141
+ * BEFORE decibel-hq applies the post-office migration, and presence writing
142
+ * must keep working untouched in the meantime. When the migration lands the
143
+ * same code starts populating agent_id with no redeploy.
144
+ *
145
+ * `runtime` is written as a self-declared LABEL only. HQ's schema comment is
146
+ * explicit that it is never a trust signal, so nothing here gates on it.
147
+ */
148
+ export async function resolveAgentId(client, name, runtime) {
149
+ const cached = agentIdCache.get(name);
150
+ if (cached)
151
+ return cached;
152
+ // Upsert on the (org_id, name) unique key, then read the id back. Doing it as
153
+ // an upsert rather than select-then-insert keeps two daemons racing on the
154
+ // same name from both inserting.
155
+ const { data, error } = await withRetryResult(() => client
156
+ .from('agents')
157
+ .upsert({ org_id: ORG_ID, name, runtime }, { onConflict: 'org_id,name', ignoreDuplicates: false })
158
+ .select('id')
159
+ .maybeSingle(), `presence.agent-resolve ${name}`);
160
+ if (error) {
161
+ // Table not yet created (migration unapplied) is the EXPECTED state today,
162
+ // so log it once per name at low volume rather than every 30s tick.
163
+ if (!agentResolveWarned.has(name)) {
164
+ agentResolveWarned.add(name);
165
+ log(`Presence: agent identity unavailable for "${name}" (${error.message}) — agent_id left null.`);
166
+ }
167
+ return null;
168
+ }
169
+ const id = data?.id;
170
+ if (!id)
171
+ return null;
172
+ agentIdCache.set(name, id);
173
+ return id;
174
+ }
175
+ const agentResolveWarned = new Set();
176
+ /** Test seam: drop memoised ids so a test can observe a fresh resolve. */
177
+ export function __resetAgentIdCache() {
178
+ agentIdCache.clear();
179
+ agentResolveWarned.clear();
180
+ }
181
+ /**
182
+ * Liveness window. MUST match hq.resolve_agent_session's `interval '60 seconds'`
183
+ * — if these drift, the roster says "online" for an agent the delivery path
184
+ * will refuse to deliver to, which is worse than either answer alone.
185
+ */
186
+ const LIVENESS_WINDOW_MS = 60_000;
187
+ /**
188
+ * The agents.list roster: hq.agents LEFT JOIN liveness.
189
+ *
190
+ * The roster is the DURABLE agents, each annotated with whether a live session
191
+ * resolves. An agent that exists but is offline MUST appear, marked offline,
192
+ * rather than vanish — a roster built from live sessions would silently drop
193
+ * exactly the agent you are trying and failing to reach, which is the same
194
+ * failure class as addressing a dead session.
195
+ *
196
+ * Two queries and a join in memory rather than one call to
197
+ * hq.resolve_agent_session per agent, which would be N round trips to render
198
+ * one board.
199
+ *
200
+ * CLOCK CAVEAT, and it is why this is a DISPLAY path only: the cutoff below is
201
+ * computed from the daemon's clock, while resolve_agent_session uses the
202
+ * database's now(). Skew between them can disagree at the 60s boundary. The
203
+ * authoritative answer at DELIVERY time is HQ's function, never this. Do not
204
+ * route a message using this roster's `online`.
205
+ *
206
+ * Returns null (not an empty roster) when the table is absent, so a caller can
207
+ * distinguish "no agents" from "post office not deployed yet".
208
+ */
209
+ export async function listAgentRoster(client) {
210
+ const { data: agents, error: agentsErr } = await withRetryResult(() => client
211
+ .from('agents')
212
+ .select('id,name,runtime,role,capabilities,status')
213
+ .eq('org_id', ORG_ID), 'presence.agent-roster');
214
+ if (agentsErr) {
215
+ log(`Presence: agent roster unavailable (${agentsErr.message}).`);
216
+ return null;
217
+ }
218
+ const cutoff = new Date(Date.now() - LIVENESS_WINDOW_MS).toISOString();
219
+ const { data: sessions } = await withRetryResult(() => client
220
+ .from('agent_sessions')
221
+ .select('agent_id,session_key,last_seen_at')
222
+ .eq('org_id', ORG_ID)
223
+ .eq('status', 'active')
224
+ .gt('last_seen_at', cutoff)
225
+ .order('last_seen_at', { ascending: false }), 'presence.agent-roster-liveness');
226
+ // Most recent wins, mirroring `order by last_seen_at desc limit 1`. The query
227
+ // is already sorted, so the first entry seen for an agent is the winner.
228
+ const live = new Map();
229
+ for (const s of (sessions ?? [])) {
230
+ if (!s.agent_id || live.has(s.agent_id))
231
+ continue;
232
+ live.set(s.agent_id, { session_key: s.session_key, last_seen_at: s.last_seen_at });
233
+ }
234
+ return (agents ?? []).map((a) => {
235
+ const hit = live.get(a.id);
236
+ return {
237
+ ...a,
238
+ capabilities: a.capabilities ?? [],
239
+ online: Boolean(hit),
240
+ session_key: hit?.session_key ?? null,
241
+ last_seen_at: hit?.last_seen_at ?? null,
242
+ };
243
+ });
244
+ }
81
245
  async function tick(client) {
82
246
  const host = resolveHost();
83
247
  const nowMs = Date.now();
@@ -87,6 +251,9 @@ async function tick(client) {
87
251
  if (!p.id)
88
252
  continue;
89
253
  const project_id = await resolveProjectId(client, p.cwd);
254
+ // Durable identity for this session. git_root is preferred over cwd: a peer
255
+ // sitting in a subdirectory of the repo is the same agent as one at the top.
256
+ const agent_id = await resolveAgentId(client, deriveAgentName({ gitRoot: p.git_root, cwd: p.cwd, runtime: 'claude-code', host }), 'claude-code');
90
257
  const row = {
91
258
  org_id: ORG_ID,
92
259
  host,
@@ -95,6 +262,10 @@ async function tick(client) {
95
262
  // These are Claude Code sessions read from the claude-peers broker; tag the
96
263
  // runtime so HQ's /agents board renders the runtime badge + filter (P1/P5).
97
264
  runtime: 'claude-code',
265
+ // Only sent once resolvable. Before the post-office migration lands the
266
+ // column does not exist and PostgREST rejects the ENTIRE row on an
267
+ // unknown key — which would take down presence writing that works today.
268
+ ...(agent_id ? { agent_id } : {}),
98
269
  summary: p.summary || null,
99
270
  cwd: p.cwd || null,
100
271
  project_id,
@@ -179,11 +350,17 @@ export async function writeLocalAgentSession(reg) {
179
350
  const nowIso = new Date().toISOString();
180
351
  const project_id = await resolveProjectId(client, reg.cwd || '');
181
352
  const ended = reg.status === 'ended';
353
+ // Durable identity. The SDK gives us no git_root, so the cwd basename is the
354
+ // repo key. Note the address is derived from WHERE the runtime is, never from
355
+ // reg.agent — see deriveAgentName on why a caller must not name itself.
356
+ const agent_id = await resolveAgentId(client, deriveAgentName({ cwd: reg.cwd, runtime: reg.runtime, host }), reg.runtime);
182
357
  const row = {
183
358
  org_id: ORG_ID,
184
359
  host,
185
360
  session_key: reg.session_key,
186
361
  runtime: reg.runtime,
362
+ // See the claude-peers path: omitted, not nulled, until the column exists.
363
+ ...(agent_id ? { agent_id } : {}),
187
364
  // Non-encoding belt on caller-supplied display fields (store-raw / escape-at-
188
365
  // render is HQ's job; we only cap length + strip control chars/null bytes).
189
366
  agent: sanitizeText(reg.agent, FIELD_CAPS.agent),
@@ -1 +1 @@
1
- {"version":3,"file":"agentPresence.js","sourceRoot":"","sources":["../src/agentPresence.ts"],"names":[],"mappings":"AAAA,+EAA+E;AAC/E,0EAA0E;AAC1E,+EAA+E;AAC/E,8EAA8E;AAC9E,WAAW;AACX,yEAAyE;AACzE,+EAA+E;AAC/E,mFAAmF;AACnF,yFAAyF;AACzF,kFAAkF;AAClF,uFAAuF;AACvF,+EAA+E;AAE/E,OAAO,EAAE,MAAM,IAAI,CAAC;AACpB,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AACrD,OAAO,EAAE,GAAG,EAAE,MAAM,aAAa,CAAC;AAClC,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAErD,MAAM,UAAU,GAAG,oBAAoB,OAAO,CAAC,GAAG,CAAC,iBAAiB,IAAI,MAAM,EAAE,CAAC;AACjF,MAAM,MAAM,GAAG,OAAO,CAAC,GAAG,CAAC,cAAc,IAAI,sCAAsC,CAAC;AAEpF;;;;;;;GAOG;AACH,MAAM,UAAU,WAAW;IACzB,OAAO,OAAO,CAAC,GAAG,CAAC,qBAAqB,IAAI,EAAE,CAAC,QAAQ,EAAE,CAAC;AAC5D,CAAC;AACD,MAAM,YAAY,GAAG,MAAM,CAAC;AAC5B,MAAM,aAAa,GAAG,MAAM,CAAC;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K,EAAE,CAAC;QACV,GAAG,CAAC,4BAA4B,GAAG,CAAC,WAAW,KAAK,GAAG,CAAC,OAAO,aAAa,KAAK,CAAC,OAAO,EAAE,CAAC,CAAC;QAC7F,OAAO,KAAK,CAAC;IACf,CAAC;IACD,OAAO,IAAI,CAAC;AACd,CAAC;AAED,gGAAgG;AAChG,MAAM,UAAU,mBAAmB;IACjC,MAAM,MAAM,GAAG,aAAa,EAAE,CAAC;IAC/B,IAAI,CAAC,MAAM,EAAE,CAAC;QACZ,GAAG,CAAC,8EAA8E,CAAC,CAAC;QACpF,OAAO,GAAG,EAAE,GAAE,CAAC,CAAC;IAClB,CAAC;IACD,GAAG,CAAC,oEAAoE,MAAM,IAAI,CAAC,CAAC;IACpF,MAAM,GAAG,GAAG,GAAG,EAAE;QACf,IAAI,CAAC,MAAM,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,GAAG,CAAC,yBAAyB,CAAC,YAAY,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;IACxG,CAAC,CAAC;IACF,GAAG,EAAE,CAAC;IACN,MAAM,EAAE,GAAG,WAAW,CAAC,GAAG,EAAE,YAAY,CAAC,CAAC;IAC1C,IAAI,OAAQ,EAA6B,CAAC,KAAK,KAAK,UAAU;QAAG,EAA4B,CAAC,KAAK,EAAE,CAAC;IACtG,OAAO,GAAG,EAAE,CAAC,aAAa,CAAC,EAAE,CAAC,CAAC;AACjC,CAAC"}
@@ -1,14 +1,24 @@
1
1
  /**
2
- * Agentic Pack Engine - MCP Tool Registration
2
+ * Agentic Pack Engine — module surface.
3
3
  *
4
- * Exposes the 4 core agentic tools via MCP:
5
- * 1. agentic.compile_pack - Compile configuration into versioned pack
6
- * 2. agentic.render - Transform payload to text
7
- * 3. agentic.lint - Validate output against constraints
8
- * 4. agentic.golden_eval - Run regression tests
4
+ * The engine itself lives in sibling modules: compiler (config → versioned,
5
+ * hashed pack), renderer (payload → text via pack templates), linter (output vs
6
+ * pack constraints), golden (regression harness). This file only re-exports
7
+ * them, and is imported by src/tools/agentic/index.ts, which is what actually
8
+ * exposes the tools.
9
+ *
10
+ * It used to also carry registerAgenticTools(server: McpServer) and the zod
11
+ * schemas that function validated its inputs with. That registration path died
12
+ * when server.ts was split into modules (ISS-0029): nothing called it, so its
13
+ * validation validated nothing — while still typechecking and importing
14
+ * cleanly, which is why it went unnoticed for 7.7 months and ~98k dispatch
15
+ * events. The schemas moved to types.ts, beside the interfaces they mirror,
16
+ * and are wired into the live handlers.
17
+ *
18
+ * The file is load-bearing even though the function was not: the live tools
19
+ * import compilePack/renderPayload/lintOutput/runGolden and their input types
20
+ * through the re-exports below. Deleting it breaks them at import time.
9
21
  */
10
- import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
11
- export declare function registerAgenticTools(server: McpServer): void;
12
22
  export * from './types.js';
13
23
  export { compilePack, loadCompiledPack, getOrCompilePack } from './compiler.js';
14
24
  export { render, renderPayload } from './renderer.js';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/agentic/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAGH,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AA0EpE,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,SAAS,GAAG,IAAI,CA8G5D;AAGD,cAAc,YAAY,CAAC;AAC3B,OAAO,EAAE,WAAW,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AAChF,OAAO,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AACtD,OAAO,EAAE,IAAI,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAC7D,OAAO,EAAE,aAAa,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/agentic/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH,cAAc,YAAY,CAAC;AAC3B,OAAO,EAAE,WAAW,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AAChF,OAAO,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AACtD,OAAO,EAAE,IAAI,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAC7D,OAAO,EAAE,aAAa,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC"}