@descryy/mcp 0.6.0 → 0.7.1

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 (264) hide show
  1. package/dist/action-handshake.d.ts +8 -75
  2. package/dist/action-handshake.d.ts.map +1 -1
  3. package/dist/action-handshake.js +9 -79
  4. package/dist/action-handshake.js.map +1 -1
  5. package/dist/bin/descry-mcp.d.ts +4 -15
  6. package/dist/bin/descry-mcp.d.ts.map +1 -1
  7. package/dist/bin/descry-mcp.js +12 -42
  8. package/dist/bin/descry-mcp.js.map +1 -1
  9. package/dist/browser/driver.d.ts +121 -224
  10. package/dist/browser/driver.d.ts.map +1 -1
  11. package/dist/browser/driver.js +9 -55
  12. package/dist/browser/driver.js.map +1 -1
  13. package/dist/browser/evidence.d.ts +10 -43
  14. package/dist/browser/evidence.d.ts.map +1 -1
  15. package/dist/browser/evidence.js +20 -54
  16. package/dist/browser/evidence.js.map +1 -1
  17. package/dist/browser/fake-driver.d.ts +12 -19
  18. package/dist/browser/fake-driver.d.ts.map +1 -1
  19. package/dist/browser/fake-driver.js +31 -26
  20. package/dist/browser/fake-driver.js.map +1 -1
  21. package/dist/browser/graph-write.d.ts +4 -45
  22. package/dist/browser/graph-write.d.ts.map +1 -1
  23. package/dist/browser/graph-write.js +8 -53
  24. package/dist/browser/graph-write.js.map +1 -1
  25. package/dist/browser/playwright-driver.d.ts +7 -91
  26. package/dist/browser/playwright-driver.d.ts.map +1 -1
  27. package/dist/browser/playwright-driver.js +59 -197
  28. package/dist/browser/playwright-driver.js.map +1 -1
  29. package/dist/browser/provider.d.ts +5 -34
  30. package/dist/browser/provider.d.ts.map +1 -1
  31. package/dist/browser/provider.js +4 -24
  32. package/dist/browser/provider.js.map +1 -1
  33. package/dist/browser/registry.d.ts +26 -106
  34. package/dist/browser/registry.d.ts.map +1 -1
  35. package/dist/browser/registry.js +20 -77
  36. package/dist/browser/registry.js.map +1 -1
  37. package/dist/browser/scenario-provenance.d.ts +23 -0
  38. package/dist/browser/scenario-provenance.d.ts.map +1 -0
  39. package/dist/browser/scenario-provenance.js +59 -0
  40. package/dist/browser/scenario-provenance.js.map +1 -0
  41. package/dist/browser/scenario-resolve.d.ts +10 -44
  42. package/dist/browser/scenario-resolve.d.ts.map +1 -1
  43. package/dist/browser/scenario-resolve.js +10 -41
  44. package/dist/browser/scenario-resolve.js.map +1 -1
  45. package/dist/browser/scenario-runner.d.ts +12 -70
  46. package/dist/browser/scenario-runner.d.ts.map +1 -1
  47. package/dist/browser/scenario-runner.js +30 -90
  48. package/dist/browser/scenario-runner.js.map +1 -1
  49. package/dist/browser/stack-parser.d.ts +4 -28
  50. package/dist/browser/stack-parser.d.ts.map +1 -1
  51. package/dist/browser/stack-parser.js +12 -39
  52. package/dist/browser/stack-parser.js.map +1 -1
  53. package/dist/browser/tool-support.d.ts +20 -67
  54. package/dist/browser/tool-support.d.ts.map +1 -1
  55. package/dist/browser/tool-support.js +21 -65
  56. package/dist/browser/tool-support.js.map +1 -1
  57. package/dist/browser/url-scheme.d.ts +14 -0
  58. package/dist/browser/url-scheme.d.ts.map +1 -0
  59. package/dist/browser/url-scheme.js +38 -0
  60. package/dist/browser/url-scheme.js.map +1 -0
  61. package/dist/cancellation.d.ts +11 -46
  62. package/dist/cancellation.d.ts.map +1 -1
  63. package/dist/cancellation.js +11 -46
  64. package/dist/cancellation.js.map +1 -1
  65. package/dist/capped.d.ts +9 -33
  66. package/dist/capped.d.ts.map +1 -1
  67. package/dist/capped.js +7 -27
  68. package/dist/capped.js.map +1 -1
  69. package/dist/disclosure-ledger.d.ts +6 -30
  70. package/dist/disclosure-ledger.d.ts.map +1 -1
  71. package/dist/disclosure-ledger.js +4 -26
  72. package/dist/disclosure-ledger.js.map +1 -1
  73. package/dist/index.d.ts +10 -26
  74. package/dist/index.d.ts.map +1 -1
  75. package/dist/index.js +7 -17
  76. package/dist/index.js.map +1 -1
  77. package/dist/module-trust.d.ts +24 -0
  78. package/dist/module-trust.d.ts.map +1 -0
  79. package/dist/module-trust.js +60 -0
  80. package/dist/module-trust.js.map +1 -0
  81. package/dist/path-confinement.d.ts +31 -0
  82. package/dist/path-confinement.d.ts.map +1 -0
  83. package/dist/path-confinement.js +44 -0
  84. package/dist/path-confinement.js.map +1 -0
  85. package/dist/protocol.d.ts +10 -53
  86. package/dist/protocol.d.ts.map +1 -1
  87. package/dist/protocol.js +14 -60
  88. package/dist/protocol.js.map +1 -1
  89. package/dist/registry.d.ts +37 -58
  90. package/dist/registry.d.ts.map +1 -1
  91. package/dist/registry.js +88 -96
  92. package/dist/registry.js.map +1 -1
  93. package/dist/render.d.ts +89 -13
  94. package/dist/render.d.ts.map +1 -1
  95. package/dist/render.js +111 -16
  96. package/dist/render.js.map +1 -1
  97. package/dist/runtime-registry.d.ts +7 -66
  98. package/dist/runtime-registry.d.ts.map +1 -1
  99. package/dist/runtime-registry.js +39 -114
  100. package/dist/runtime-registry.js.map +1 -1
  101. package/dist/scenarios/index.d.ts +1 -1
  102. package/dist/scenarios/index.d.ts.map +1 -1
  103. package/dist/scenarios/index.js +1 -1
  104. package/dist/scenarios/index.js.map +1 -1
  105. package/dist/scenarios/parse.d.ts +4 -18
  106. package/dist/scenarios/parse.d.ts.map +1 -1
  107. package/dist/scenarios/parse.js +14 -34
  108. package/dist/scenarios/parse.js.map +1 -1
  109. package/dist/scenarios/scenario.d.ts +18 -74
  110. package/dist/scenarios/scenario.d.ts.map +1 -1
  111. package/dist/scenarios/scenario.js +7 -34
  112. package/dist/scenarios/scenario.js.map +1 -1
  113. package/dist/scenarios/storage.d.ts +11 -41
  114. package/dist/scenarios/storage.d.ts.map +1 -1
  115. package/dist/scenarios/storage.js +57 -47
  116. package/dist/scenarios/storage.js.map +1 -1
  117. package/dist/server.d.ts.map +1 -1
  118. package/dist/server.js +69 -19
  119. package/dist/server.js.map +1 -1
  120. package/dist/session.d.ts +90 -259
  121. package/dist/session.d.ts.map +1 -1
  122. package/dist/session.js +136 -250
  123. package/dist/session.js.map +1 -1
  124. package/dist/tools/analyze.d.ts +32 -118
  125. package/dist/tools/analyze.d.ts.map +1 -1
  126. package/dist/tools/analyze.js +65 -186
  127. package/dist/tools/analyze.js.map +1 -1
  128. package/dist/tools/browser-click.d.ts +3 -21
  129. package/dist/tools/browser-click.d.ts.map +1 -1
  130. package/dist/tools/browser-click.js +10 -31
  131. package/dist/tools/browser-click.js.map +1 -1
  132. package/dist/tools/browser-close-session.d.ts +4 -13
  133. package/dist/tools/browser-close-session.d.ts.map +1 -1
  134. package/dist/tools/browser-close-session.js +4 -13
  135. package/dist/tools/browser-close-session.js.map +1 -1
  136. package/dist/tools/browser-fill.d.ts +5 -36
  137. package/dist/tools/browser-fill.d.ts.map +1 -1
  138. package/dist/tools/browser-fill.js +9 -44
  139. package/dist/tools/browser-fill.js.map +1 -1
  140. package/dist/tools/browser-navigate.d.ts +6 -27
  141. package/dist/tools/browser-navigate.d.ts.map +1 -1
  142. package/dist/tools/browser-navigate.js +6 -23
  143. package/dist/tools/browser-navigate.js.map +1 -1
  144. package/dist/tools/browser-run-scenario.d.ts +5 -31
  145. package/dist/tools/browser-run-scenario.d.ts.map +1 -1
  146. package/dist/tools/browser-run-scenario.js +10 -46
  147. package/dist/tools/browser-run-scenario.js.map +1 -1
  148. package/dist/tools/browser-save-scenario.d.ts +3 -28
  149. package/dist/tools/browser-save-scenario.d.ts.map +1 -1
  150. package/dist/tools/browser-save-scenario.js +47 -84
  151. package/dist/tools/browser-save-scenario.js.map +1 -1
  152. package/dist/tools/browser-snapshot.d.ts +6 -39
  153. package/dist/tools/browser-snapshot.d.ts.map +1 -1
  154. package/dist/tools/browser-snapshot.js +4 -31
  155. package/dist/tools/browser-snapshot.js.map +1 -1
  156. package/dist/tools/browser-start-session.d.ts +4 -23
  157. package/dist/tools/browser-start-session.d.ts.map +1 -1
  158. package/dist/tools/browser-start-session.js +145 -56
  159. package/dist/tools/browser-start-session.js.map +1 -1
  160. package/dist/tools/browser-type.d.ts +5 -35
  161. package/dist/tools/browser-type.d.ts.map +1 -1
  162. package/dist/tools/browser-type.js +10 -45
  163. package/dist/tools/browser-type.js.map +1 -1
  164. package/dist/tools/contracts.d.ts +9 -86
  165. package/dist/tools/contracts.d.ts.map +1 -1
  166. package/dist/tools/contracts.js +24 -80
  167. package/dist/tools/contracts.js.map +1 -1
  168. package/dist/tools/cross-pr.d.ts +42 -30
  169. package/dist/tools/cross-pr.d.ts.map +1 -1
  170. package/dist/tools/cross-pr.js +81 -62
  171. package/dist/tools/cross-pr.js.map +1 -1
  172. package/dist/tools/git-diff.d.ts +18 -2
  173. package/dist/tools/git-diff.d.ts.map +1 -1
  174. package/dist/tools/git-diff.js +118 -26
  175. package/dist/tools/git-diff.js.map +1 -1
  176. package/dist/tools/git-history.d.ts +5 -16
  177. package/dist/tools/git-history.d.ts.map +1 -1
  178. package/dist/tools/git-history.js +3 -10
  179. package/dist/tools/git-history.js.map +1 -1
  180. package/dist/tools/history.d.ts +4 -33
  181. package/dist/tools/history.d.ts.map +1 -1
  182. package/dist/tools/history.js +6 -31
  183. package/dist/tools/history.js.map +1 -1
  184. package/dist/tools/impact.d.ts +7 -51
  185. package/dist/tools/impact.d.ts.map +1 -1
  186. package/dist/tools/impact.js +15 -67
  187. package/dist/tools/impact.js.map +1 -1
  188. package/dist/tools/index.d.ts +3 -8
  189. package/dist/tools/index.d.ts.map +1 -1
  190. package/dist/tools/index.js +3 -8
  191. package/dist/tools/index.js.map +1 -1
  192. package/dist/tools/kit.d.ts +66 -113
  193. package/dist/tools/kit.d.ts.map +1 -1
  194. package/dist/tools/kit.js +60 -28
  195. package/dist/tools/kit.js.map +1 -1
  196. package/dist/tools/link-workspace.d.ts +7 -45
  197. package/dist/tools/link-workspace.d.ts.map +1 -1
  198. package/dist/tools/link-workspace.js +10 -48
  199. package/dist/tools/link-workspace.js.map +1 -1
  200. package/dist/tools/lookup.d.ts +4 -14
  201. package/dist/tools/lookup.d.ts.map +1 -1
  202. package/dist/tools/lookup.js +4 -14
  203. package/dist/tools/lookup.js.map +1 -1
  204. package/dist/tools/mark-incident.d.ts +7 -54
  205. package/dist/tools/mark-incident.d.ts.map +1 -1
  206. package/dist/tools/mark-incident.js +15 -68
  207. package/dist/tools/mark-incident.js.map +1 -1
  208. package/dist/tools/observe-runtime.d.ts +27 -210
  209. package/dist/tools/observe-runtime.d.ts.map +1 -1
  210. package/dist/tools/observe-runtime.js +273 -434
  211. package/dist/tools/observe-runtime.js.map +1 -1
  212. package/dist/tools/observe-tests.d.ts +9 -100
  213. package/dist/tools/observe-tests.d.ts.map +1 -1
  214. package/dist/tools/observe-tests.js +74 -152
  215. package/dist/tools/observe-tests.js.map +1 -1
  216. package/dist/tools/pr-analysis.d.ts +18 -2
  217. package/dist/tools/pr-analysis.d.ts.map +1 -1
  218. package/dist/tools/pr-analysis.js +73 -23
  219. package/dist/tools/pr-analysis.js.map +1 -1
  220. package/dist/tools/pre-push.d.ts +74 -16
  221. package/dist/tools/pre-push.d.ts.map +1 -1
  222. package/dist/tools/pre-push.js +152 -51
  223. package/dist/tools/pre-push.js.map +1 -1
  224. package/dist/tools/propagation.d.ts +11 -53
  225. package/dist/tools/propagation.d.ts.map +1 -1
  226. package/dist/tools/propagation.js +17 -58
  227. package/dist/tools/propagation.js.map +1 -1
  228. package/dist/tools/questions.d.ts +13 -63
  229. package/dist/tools/questions.d.ts.map +1 -1
  230. package/dist/tools/questions.js +33 -105
  231. package/dist/tools/questions.js.map +1 -1
  232. package/dist/tools/refusal-fetch.d.ts +4 -40
  233. package/dist/tools/refusal-fetch.d.ts.map +1 -1
  234. package/dist/tools/refusal-fetch.js +4 -40
  235. package/dist/tools/refusal-fetch.js.map +1 -1
  236. package/dist/tools/runtime-incident.d.ts +4 -63
  237. package/dist/tools/runtime-incident.d.ts.map +1 -1
  238. package/dist/tools/runtime-incident.js +10 -87
  239. package/dist/tools/runtime-incident.js.map +1 -1
  240. package/dist/tools/scope.d.ts +7 -25
  241. package/dist/tools/scope.d.ts.map +1 -1
  242. package/dist/tools/scope.js +10 -29
  243. package/dist/tools/scope.js.map +1 -1
  244. package/dist/tools/similar-incidents.d.ts +11 -86
  245. package/dist/tools/similar-incidents.d.ts.map +1 -1
  246. package/dist/tools/similar-incidents.js +7 -71
  247. package/dist/tools/similar-incidents.js.map +1 -1
  248. package/dist/tools/validate.d.ts +29 -70
  249. package/dist/tools/validate.d.ts.map +1 -1
  250. package/dist/tools/validate.js +141 -85
  251. package/dist/tools/validate.js.map +1 -1
  252. package/dist/tools/verification-status.d.ts +9 -64
  253. package/dist/tools/verification-status.d.ts.map +1 -1
  254. package/dist/tools/verification-status.js +9 -62
  255. package/dist/tools/verification-status.js.map +1 -1
  256. package/dist/tools/verify-claim.d.ts +5 -52
  257. package/dist/tools/verify-claim.d.ts.map +1 -1
  258. package/dist/tools/verify-claim.js +6 -56
  259. package/dist/tools/verify-claim.js.map +1 -1
  260. package/dist/transport.d.ts +15 -52
  261. package/dist/transport.d.ts.map +1 -1
  262. package/dist/transport.js +16 -60
  263. package/dist/transport.js.map +1 -1
  264. package/package.json +40 -22
@@ -1,75 +1,25 @@
1
1
  /**
2
- * `questions` — TIER-A-2's last mile: a human sees an open question and can
3
- * answer it, in this conversation.
4
- *
5
- * Everything upstream of this tool already existed and was inert together:
6
- * a refusal carries `attrs.blockedBy` + `attrs.refusalClass` (DEC-242) → the
7
- * grouper collapses rows sharing both into one question (DEC-243) → a
8
- * confirmed answer is stored and capped at reliability class B regardless of
9
- * anything else (DEC-223). Nothing before this tool could show a question to
10
- * a person or accept an answer back. This is that door — the same role
11
- * `link_workspace` plays for the workspace-pairing declaration, except this
12
- * one both reads and writes, because "what's still open" and "record an
13
- * answer" are one conversation, not two round trips.
14
- *
15
- * ## One tool, not two — and not folded into `link_workspace`
16
- *
17
- * DEC-243 named two shapes and built neither: a dedicated tool, or extending
18
- * `link_workspace`'s write pattern to accept a `ConfirmedFact`. Rejected the
19
- * second explicitly: `session.ts`'s own `writeConfirmedFact` already exists
20
- * as "a second, narrow writer... so a future field gets a third writer, not
21
- * a branch in this one" — the identical reasoning applies one layer up.
22
- * `link_workspace` is about workspace pairing; bolting an unrelated write
23
- * concern onto it would be the tool-layer version of the shape drift DEC's
24
- * own `MODEL.fields`/`DTO.fields` incident already cost this project once
25
- * (§3.1). A dedicated tool that both lists and answers is one coherent
26
- * concern — "the question queue" — read and write together because a caller
27
- * asking "what's still open" immediately after recording an answer should
28
- * see the queue that answer just shrank, not have to call twice.
29
- *
30
- * ## Answering re-computes locally rather than re-reading the file
31
- *
32
- * `session.config.confirmedFacts` is loaded once at session start and is
33
- * `readonly` — writing via `writeConfirmedFact` does not update it in
34
- * memory. Rather than reload `.descry/config.json` from disk mid-call, the
35
- * just-written fact is merged into a local copy for this response only, the
36
- * same way `writeConfirmedFact`'s own `replaced` return value already tells
37
- * a caller what was overwritten without a second read.
38
- */
2
+ * `questions` — lets a human answer an open refusal question in this conversation.
3
+ * DEC-242: a refusal carries `attrs.blockedBy`+`refusalClass`. DEC-243: grouped into
4
+ * one question per pair; a dedicated read+write tool, not folded into `link_workspace`.
5
+ * DEC-223: a recorded answer caps at reliability class B regardless of anything else. */
39
6
  import type { RefusalDropCounts, RefusalQuestion } from "@descryy/core";
40
7
  import type { ConfirmedFact } from "@descryy/ir";
41
8
  import { type ToolDefinition } from "./kit.ts";
42
- /**
43
- * Both halves of one conversation: the queue, and the answer that just shrank it.
44
- *
45
- * Read and write together because a caller asking "what's still open"
46
- * immediately after recording an answer should see the queue that answer
47
- * changed, not have to call twice.
48
- */
9
+ /** Both halves of one conversation: the queue, and the answer that just shrank it.
10
+ * Read and write together so a caller doesn't need two calls. */
49
11
  export interface QuestionsData {
50
- /**
51
- * The `ConfirmedFact` written by this call, or null when none was given.
52
- *
53
- * A human assertion, not a graph fact: when it is later used to mint an
54
- * edge, that edge is capped at reliability class B by DEC-223 regardless of
55
- * anything else about it.
56
- */
12
+ /** The `ConfirmedFact` written by this call, or null when none given. A human
13
+ * assertion, not a graph fact — capped at reliability class B (DEC-223) when
14
+ * later used to mint an edge. */
57
15
  readonly recorded: ConfirmedFact | null;
58
- /**
59
- * Rows a human could actually resolve, grouped by `blockedBy`.
60
- *
61
- * DEC-242's `value-unknown` class only. A reader-capability gap or a
62
- * per-call value never appears here, because no sentence answers those.
63
- */
16
+ /** Rows a human could resolve, grouped by `blockedBy` — DEC-242's `value-unknown`
17
+ * class only. A reader-capability gap or per-call value never appears here. */
64
18
  readonly questions: readonly RefusalQuestion[];
65
19
  /** Every refusal-ledger row, classified or not. The outer denominator. */
66
20
  readonly totalRefusalRows: number;
67
- /**
68
- * Of those, how many carry `attrs.blockedBy`/`refusalClass` at all.
69
- *
70
- * The gap between this and `totalRefusalRows` is rows no adapter classified:
71
- * never askable, and **not the same population** as "still open".
72
- */
21
+ /** Of those, how many carry `attrs.blockedBy`/`refusalClass` at all. The gap vs
22
+ * `totalRefusalRows` is unclassified rows — never askable, not "still open". */
73
23
  readonly classifiedRows: number;
74
24
  /** Rows a stored confirmed fact already answers, so they are not listed as questions. */
75
25
  readonly alreadyAnswered: number;
@@ -1 +1 @@
1
- {"version":3,"file":"questions.d.ts","sourceRoot":"","sources":["../../src/tools/questions.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqCG;AAGH,OAAO,KAAK,EAAE,iBAAiB,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AACxE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAGjD,OAAO,EAOL,KAAK,cAAc,EACpB,MAAM,UAAU,CAAC;AAGlB;;;;;;GAMG;AACH,MAAM,WAAW,aAAa;IAC5B;;;;;;OAMG;IACH,QAAQ,CAAC,QAAQ,EAAE,aAAa,GAAG,IAAI,CAAC;IACxC;;;;;OAKG;IACH,QAAQ,CAAC,SAAS,EAAE,SAAS,eAAe,EAAE,CAAC;IAC/C,0EAA0E;IAC1E,QAAQ,CAAC,gBAAgB,EAAE,MAAM,CAAC;IAClC;;;;;OAKG;IACH,QAAQ,CAAC,cAAc,EAAE,MAAM,CAAC;IAChC,yFAAyF;IACzF,QAAQ,CAAC,eAAe,EAAE,MAAM,CAAC;IACjC,6DAA6D;IAC7D,QAAQ,CAAC,OAAO,EAAE,iBAAiB,CAAC;CACrC;AA6RD,eAAO,MAAM,aAAa,EAAE,cAoB3B,CAAC"}
1
+ {"version":3,"file":"questions.d.ts","sourceRoot":"","sources":["../../src/tools/questions.ts"],"names":[],"mappings":"AAAA;;;;yFAIyF;AAGzF,OAAO,KAAK,EAAE,iBAAiB,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AACxE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAGjD,OAAO,EAOL,KAAK,cAAc,EACpB,MAAM,UAAU,CAAC;AAGlB;kEACkE;AAClE,MAAM,WAAW,aAAa;IAC5B;;sCAEkC;IAClC,QAAQ,CAAC,QAAQ,EAAE,aAAa,GAAG,IAAI,CAAC;IACxC;oFACgF;IAChF,QAAQ,CAAC,SAAS,EAAE,SAAS,eAAe,EAAE,CAAC;IAC/C,0EAA0E;IAC1E,QAAQ,CAAC,gBAAgB,EAAE,MAAM,CAAC;IAClC;qFACiF;IACjF,QAAQ,CAAC,cAAc,EAAE,MAAM,CAAC;IAChC,yFAAyF;IACzF,QAAQ,CAAC,eAAe,EAAE,MAAM,CAAC;IACjC,6DAA6D;IAC7D,QAAQ,CAAC,OAAO,EAAE,iBAAiB,CAAC;CACrC;AAsPD,eAAO,MAAM,aAAa,EAAE,cAoB3B,CAAC"}
@@ -1,41 +1,8 @@
1
1
  /**
2
- * `questions` — TIER-A-2's last mile: a human sees an open question and can
3
- * answer it, in this conversation.
4
- *
5
- * Everything upstream of this tool already existed and was inert together:
6
- * a refusal carries `attrs.blockedBy` + `attrs.refusalClass` (DEC-242) → the
7
- * grouper collapses rows sharing both into one question (DEC-243) → a
8
- * confirmed answer is stored and capped at reliability class B regardless of
9
- * anything else (DEC-223). Nothing before this tool could show a question to
10
- * a person or accept an answer back. This is that door — the same role
11
- * `link_workspace` plays for the workspace-pairing declaration, except this
12
- * one both reads and writes, because "what's still open" and "record an
13
- * answer" are one conversation, not two round trips.
14
- *
15
- * ## One tool, not two — and not folded into `link_workspace`
16
- *
17
- * DEC-243 named two shapes and built neither: a dedicated tool, or extending
18
- * `link_workspace`'s write pattern to accept a `ConfirmedFact`. Rejected the
19
- * second explicitly: `session.ts`'s own `writeConfirmedFact` already exists
20
- * as "a second, narrow writer... so a future field gets a third writer, not
21
- * a branch in this one" — the identical reasoning applies one layer up.
22
- * `link_workspace` is about workspace pairing; bolting an unrelated write
23
- * concern onto it would be the tool-layer version of the shape drift DEC's
24
- * own `MODEL.fields`/`DTO.fields` incident already cost this project once
25
- * (§3.1). A dedicated tool that both lists and answers is one coherent
26
- * concern — "the question queue" — read and write together because a caller
27
- * asking "what's still open" immediately after recording an answer should
28
- * see the queue that answer just shrank, not have to call twice.
29
- *
30
- * ## Answering re-computes locally rather than re-reading the file
31
- *
32
- * `session.config.confirmedFacts` is loaded once at session start and is
33
- * `readonly` — writing via `writeConfirmedFact` does not update it in
34
- * memory. Rather than reload `.descry/config.json` from disk mid-call, the
35
- * just-written fact is merged into a local copy for this response only, the
36
- * same way `writeConfirmedFact`'s own `replaced` return value already tells
37
- * a caller what was overwritten without a second read.
38
- */
2
+ * `questions` — lets a human answer an open refusal question in this conversation.
3
+ * DEC-242: a refusal carries `attrs.blockedBy`+`refusalClass`. DEC-243: grouped into
4
+ * one question per pair; a dedicated read+write tool, not folded into `link_workspace`.
5
+ * DEC-223: a recorded answer caps at reliability class B regardless of anything else. */
39
6
  import { applyConfirmedFacts, counts, groupRefusalsIntoQuestions } from "@descryy/core";
40
7
  import { writeConfirmedFact } from "../session.js";
41
8
  import { answer, optionalEnum, optionalString, requiredString, ToolInputError, } from "./kit.js";
@@ -76,14 +43,9 @@ const SCHEMA = {
76
43
  required: ["blockedBy", "value"],
77
44
  additionalProperties: false,
78
45
  },
79
- // Declared here, not only in the prose. This tool's own description tells
80
- // a caller to send `confirmToken` on the second call, and for a while the
81
- // schema beside it said no such property existed — with
82
- // `additionalProperties: false`, a client validating against the schema it
83
- // was handed would reject the exact call the description asked for. A
84
- // parameter a tool documents and a parameter a tool declares have to be
85
- // the same set; `tool-schema-prose.test.ts` now holds the whole registry
86
- // to that.
46
+ // Declared here, not only in the prose — `tool-schema-prose.test.ts` holds the
47
+ // registry to keeping documented and declared params in sync (a documented-but-
48
+ // undeclared param was once silently rejected under additionalProperties:false).
87
49
  confirmToken: {
88
50
  type: "string",
89
51
  description: "The token returned by a previous call that carried \"answer\". Recording a confirmed value " +
@@ -94,21 +56,9 @@ const SCHEMA = {
94
56
  },
95
57
  additionalProperties: false,
96
58
  };
97
- /**
98
- * The `answer` argument, read and validated in one place.
99
- *
100
- * Extracted so `describeAction` can call it too: an `action` tool's mint must
101
- * refuse what its run would refuse, or it asks a developer to confirm a
102
- * sentence with no referent. The instance that made this concrete here is the
103
- * worst one this tool can produce — a `scope: "workspace"` answer in a
104
- * repository with no workspace was described as *"reaching EVERY repository in
105
- * this workspace"* and then refused on the second call, after the
106
- * confirmation. Ruled in
107
- * `documents/decisions-inbox/DEC-387.md`.
108
- *
109
- * Reads the session only for `config.workspace`; writes nothing, so it is safe
110
- * to run at mint time, outside the call budget.
111
- */
59
+ /** The `answer` arg, read+validated once — shared by `describeAction` so mint and run
60
+ * refuse identically (DEC-387: a `scope:"workspace"` answer was once described as
61
+ * workspace-wide then refused on redemption). Reads only `config.workspace`, writes nothing. */
112
62
  function readAnswer(answerArg, session) {
113
63
  if (typeof answerArg !== "object" || answerArg === null) {
114
64
  throw new ToolInputError('"answer" must be an object');
@@ -128,6 +78,7 @@ function readAnswer(answerArg, session) {
128
78
  async function run(args, ctx) {
129
79
  const { session } = ctx;
130
80
  const notes = [];
81
+ // `confirmedFacts` is readonly and loaded once at session start; merged locally below instead of a mid-call disk reload.
131
82
  let facts = session.config.confirmedFacts;
132
83
  let recorded = null;
133
84
  const answerArg = args["answer"];
@@ -136,13 +87,9 @@ async function run(args, ctx) {
136
87
  throw new ToolInputError('"answer" must be an object');
137
88
  }
138
89
  const { blockedBy, value, environment, confirmedBy, scope } = readAnswer(answerArg, session);
139
- // "Against what" (see ConfirmedFact.confirmedAtCommit) — the repo's own
140
- // commit at the moment this answer is given, so a later mint can tell
141
- // whether the code has moved since a human said this value was correct.
142
- // Best-effort: a repo path with no git history (a fixture, a non-git
143
- // checkout) simply cannot supply one, and that is exactly the "unknown"
144
- // case `confirmedAtCommit` is designed to carry as an absence rather than
145
- // a guess — never let this recording fail because the disclosure couldn't.
90
+ // `confirmedAtCommit`: repo's commit at answer time, so a later mint can tell if
91
+ // code moved since. Best-effort — no git history means no value, an absence not
92
+ // a guess; must never fail the recording because the disclosure couldn't.
146
93
  const confirmedAtCommit = await session
147
94
  .root()
148
95
  .then((r) => r.commitSha)
@@ -156,9 +103,8 @@ async function run(args, ctx) {
156
103
  confirmedAt: new Date().toISOString(),
157
104
  ...(confirmedAtCommit === undefined ? {} : { confirmedAtCommit }),
158
105
  scope,
159
- // The id is stamped on the fact rather than looked up when it is read:
160
- // a fact must not start reaching further because the repository it lives
161
- // in was later re-linked into a different workspace.
106
+ // Stamped on the fact, not looked up at read time — a fact must not reach
107
+ // further because its repo was later re-linked into a different workspace.
162
108
  ...(scope === "workspace" && session.config.workspace !== undefined
163
109
  ? { workspace: session.config.workspace }
164
110
  : {}),
@@ -177,10 +123,8 @@ async function run(args, ctx) {
177
123
  const provider = session.provider();
178
124
  const { refs, truncated } = provider.unresolvedRefs();
179
125
  const total = counts(session.store().driver).unresolvedRefs;
180
- // Facts recorded here, plus the workspace-scoped ones recorded in the
181
- // siblings `link_workspace` declared. `applyConfirmedFacts` decides which of
182
- // those actually reach this repository — this call supplies the candidates,
183
- // it does not pre-approve them.
126
+ // Plus workspace-scoped facts from `link_workspace` siblings. `applyConfirmedFacts`
127
+ // decides which actually reach this repo — this call only supplies candidates.
184
128
  const { answered, stillOpen } = applyConfirmedFacts(refs, [...facts, ...(session.config.linkedFacts ?? [])], session.config.repo, session.config.workspace);
185
129
  const grouped = groupRefusalsIntoQuestions(session.config.repo, stillOpen);
186
130
  if (truncated) {
@@ -195,10 +139,8 @@ async function run(args, ctx) {
195
139
  if (answered.length > 0) {
196
140
  notes.push(`${answered.length} previously-open row(s) are already answered by a stored confirmed fact and ` +
197
141
  "are not listed as questions.");
198
- // Named, never folded in. "Somebody answered this here" and "somebody
199
- // answered this in another repository and declared it workspace-wide" are
200
- // different facts about what this developer actually knows, and only the
201
- // second one carries the risk the scope field exists to make deliberate.
142
+ // Named, never folded in — "answered here" vs "answered elsewhere as workspace-wide"
143
+ // are different facts, and only the second carries the risk `scope` makes deliberate.
202
144
  const elsewhere = answered.filter((a) => a.fromAnotherRepo);
203
145
  if (elsewhere.length > 0) {
204
146
  const repos = [...new Set(elsewhere.flatMap((a) => a.facts.map((f) => f.repo)))].sort();
@@ -220,23 +162,17 @@ async function run(args, ctx) {
220
162
  `${grouped.questions.reduce((n, q) => n + q.sites.length, 0)} call site(s).`;
221
163
  return answer({
222
164
  headline,
223
- // Existence of a question is a name-level fact — the expression is
224
- // present in source or it is not, the same class as a missing
225
- // environment variable. Whether it has been *answered* is a separate
226
- // axis this tool never conflates with resolution. `UnresolvedRef` itself
227
- // carries no resolution level (refusals are not edges and were never
228
- // scored, per DEC-223's own matching function), so R0 is the honest
229
- // floor rather than a borrowed number — the same choice `link_workspace`
230
- // makes for the same reason: this is not a claim resting on graph edges.
165
+ // Name-level fact (expression present or not, same class as a missing env var).
166
+ // `UnresolvedRef` carries no resolution level (refusals aren't edges, DEC-223),
167
+ // so R0 is the honest floor — same choice `link_workspace` makes, same reason.
231
168
  nameLevel: true,
232
169
  resolutionFloor: 0,
233
170
  commitSha: provider.baseStamp().commitSha,
234
171
  graphBuiltAt: provider.baseStamp().graphBuiltAt,
235
172
  irSchemaVersion: provider.baseStamp().irSchemaVersion,
236
173
  commitSpread: provider.baseStamp().commitSpread,
237
- // Empty only for a pure read that found nothing open — the classified
238
- // population is real (`classifiedRows`). Recording an answer that happens
239
- // to empty the queue is a successful write, not an empty search.
174
+ // Empty only for a pure read finding nothing open (`classifiedRows` is real).
175
+ // An answer that happens to empty the queue is a write, not an empty search.
240
176
  ...(recorded === null && grouped.questions.length === 0 ? { state: "empty" } : {}),
241
177
  notes,
242
178
  data: {
@@ -249,29 +185,21 @@ async function run(args, ctx) {
249
185
  },
250
186
  });
251
187
  }
252
- /**
253
- * §7's handshake gate. `undefined` means this call has nothing to confirm —
254
- * a pure read of the open-question queue (no `answer` given) must stay
255
- * answerable on the first call, or this tool could not answer the first
256
- * question ever asked of it. Only a call that would actually write a
257
- * `ConfirmedFact` describes itself, so `resolveActionDispatch` mints a token
258
- * for that call alone.
259
- */
188
+ /** §7's handshake gate. `undefined` = nothing to confirm (pure read must stay
189
+ * answerable on the first call). Only a write-bound call describes itself, so
190
+ * `resolveActionDispatch` mints a token for that call alone. */
260
191
  function describeAction(args, ctx) {
261
192
  const answerArg = args["answer"];
262
- // No `answer` at all is a pure read of the open-question queue: nothing to
263
- // confirm, and gating it would make the tool unable to answer the first
264
- // question asked of it. Every other shape goes through the same reader the
265
- // run uses, so a call this tool would refuse is refused here instead of
266
- // being described and minted.
193
+ // No `answer` = pure read, nothing to confirm — gating it would block the first
194
+ // question ever asked. Other shapes reuse `readAnswer`, so an invalid call is
195
+ // refused here rather than described and minted.
267
196
  if (answerArg === undefined)
268
197
  return undefined;
269
198
  const { blockedBy, value, environment, scope } = readAnswer(answerArg, ctx.session);
270
199
  return (`record a ConfirmedFact: "${blockedBy}" = "${value}"` +
271
200
  (typeof environment === "string" ? ` (environment: ${environment})` : "") +
272
- // The reach is part of what is being approved. A workspace-scoped answer
273
- // affects repositories the approver is not currently looking at, and §7's
274
- // handshake exists so nothing is performed that was not described.
201
+ // Reach is part of what's approved — a workspace answer affects repos the
202
+ // approver isn't looking at; §7's handshake exists so nothing runs undescribed.
275
203
  (scope === "workspace"
276
204
  ? " — reaching EVERY repository in this workspace, not just this one,"
277
205
  : " — in this repository only,") +
@@ -1 +1 @@
1
- {"version":3,"file":"questions.js","sourceRoot":"","sources":["../../src/tools/questions.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqCG;AAEH,OAAO,EAAE,mBAAmB,EAAE,MAAM,EAAE,0BAA0B,EAAE,MAAM,eAAe,CAAC;AAIxF,OAAO,EAAE,kBAAkB,EAAgB,MAAM,eAAe,CAAC;AACjE,OAAO,EACL,MAAM,EACN,YAAY,EACZ,cAAc,EACd,cAAc,EACd,cAAc,GAGf,MAAM,UAAU,CAAC;AAyClB,MAAM,MAAM,GAAG;IACb,IAAI,EAAE,QAAQ;IACd,UAAU,EAAE;QACV,MAAM,EAAE;YACN,IAAI,EAAE,QAAQ;YACd,WAAW,EACT,4FAA4F;gBAC5F,gDAAgD;YAClD,UAAU,EAAE;gBACV,SAAS,EAAE;oBACT,IAAI,EAAE,QAAQ;oBACd,WAAW,EAAE,kFAAkF;iBAChG;gBACD,KAAK,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,8BAA8B,EAAE;gBACtE,WAAW,EAAE;oBACX,IAAI,EAAE,QAAQ;oBACd,WAAW,EACT,2FAA2F;wBAC3F,8FAA8F;wBAC9F,0FAA0F;iBAC7F;gBACD,WAAW,EAAE;oBACX,IAAI,EAAE,QAAQ;oBACd,WAAW,EAAE,kEAAkE;iBAChF;gBACD,KAAK,EAAE;oBACL,IAAI,EAAE,QAAQ;oBACd,IAAI,EAAE,CAAC,MAAM,EAAE,WAAW,CAAC;oBAC3B,WAAW,EACT,sFAAsF;wBACtF,iFAAiF;wBACjF,6EAA6E;wBAC7E,sFAAsF;wBACtF,iFAAiF;wBACjF,2DAA2D;iBAC9D;aACF;YACD,QAAQ,EAAE,CAAC,WAAW,EAAE,OAAO,CAAC;YAChC,oBAAoB,EAAE,KAAK;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ACxF,WAAW,EAAE,MAA4C;IACzD,GAAG;IACH,cAAc;CACf,CAAC"}
@@ -1,44 +1,8 @@
1
1
  /**
2
- * `refusal_fetch` — the fourteenth endpoint (`ai-layer-plan.md` §3), and the
3
- * new work that endpoint's own re-derivation pointed at. §4 technique 4:
4
- * *"Refusals summarised, never enumerated. A count, one verbatim exemplar, a
5
- * handle to fetch the rest."*
6
- *
7
- * The logic underneath — `summariseRefusals`/`fetchRefusalPage`
8
- * (`@descryy/core`'s `query/refusal-fetch.ts`) — is already built and
9
- * unit-tested; this is the tool boundary its own header names as still open:
10
- * *"An MCP surface that wants a prettier, shorter token... is free to wrap
11
- * this — that is a presentation choice for P27."* No wrapping was needed —
12
- * the handle is already opaque and self-describing — so this tool is thin:
13
- * read the population, hand it to whichever of the two functions the call
14
- * shape asks for.
15
- *
16
- * ## Two calls, one tool — same pattern `questions.ts` already uses
17
- *
18
- * No `handle` argument → a fresh summary (`summariseRefusals`): cheap, one
19
- * count, one exemplar, a handle. A `handle` argument → redeem it for a real
20
- * page (`fetchRefusalPage`). This mirrors `questions.ts`'s own "no `answer`
21
- * argument is a pure read" split rather than inventing a second shape.
22
- *
23
- * ## The call-site trap this tool must not reproduce
24
- *
25
- * `refusal-fetch.ts`'s own header names it explicitly: the store reader
26
- * defaults to `classified: true`, which silently drops every unclassified
27
- * row (DEC-243's grouper only wants the classifiable subset). This tool
28
- * always asks for `{ classified: false }` — the complete ledger, classified
29
- * and unclassified alike — because a `refusal_fetch` that only showed the
30
- * askable subset would be the empty-denominator defect wearing this
31
- * technique's clothes, exactly what that module's header warns against.
32
- *
33
- * ## No cap on the population read
34
- *
35
- * `provider.unresolvedRefs({ classified: false })` is called with no
36
- * `limit` — the handle's population fingerprint has to be stable between the
37
- * summary call and every page redemption, and a capped read here would make
38
- * "the ledger changed" indistinguishable from "the cap sampled differently
39
- * this time." Correctness over a cheap shortcut, same choice `refusal-fetch.ts`
40
- * itself already made.
41
- */
2
+ * `refusal_fetch` — §4 technique 4: summarise, never enumerate (count, exemplar,
3
+ * handle). No `handle` → fresh summary; `handle` → redeem a page (mirrors
4
+ * `questions.ts`). Always reads `{classified: false}` — the default `true` would
5
+ * silently drop unclassified rows (DEC-243). No `limit`: the population must stay stable. */
42
6
  import { type ToolDefinition } from "./kit.ts";
43
7
  export interface RefusalFetchSummaryItem {
44
8
  readonly fromNodeId: string;
@@ -1 +1 @@
1
- {"version":3,"file":"refusal-fetch.d.ts","sourceRoot":"","sources":["../../src/tools/refusal-fetch.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwCG;AAIH,OAAO,EAKL,KAAK,cAAc,EACpB,MAAM,UAAU,CAAC;AAqBlB,MAAM,WAAW,uBAAuB;IACtC,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;CACzB;AAED,MAAM,WAAW,uBAAuB;IACtC,QAAQ,CAAC,IAAI,EAAE,SAAS,CAAC;IACzB,qGAAqG;IACrG,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,uGAAuG;IACvG,QAAQ,CAAC,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IACjC,6FAA6F;IAC7F,QAAQ,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;CAChC;AAED,MAAM,WAAW,oBAAoB;IACnC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,KAAK,EAAE,SAAS,uBAAuB,EAAE,CAAC;IACnD,iFAAiF;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ACzD,QAAQ,CAAC,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;CACpC;AAED,MAAM,MAAM,gBAAgB,GAAG,uBAAuB,GAAG,oBAAoB,CAAC;AAkF9E,eAAO,MAAM,gBAAgB,EAAE,cAe9B,CAAC"}
@@ -1,44 +1,8 @@
1
1
  /**
2
- * `refusal_fetch` — the fourteenth endpoint (`ai-layer-plan.md` §3), and the
3
- * new work that endpoint's own re-derivation pointed at. §4 technique 4:
4
- * *"Refusals summarised, never enumerated. A count, one verbatim exemplar, a
5
- * handle to fetch the rest."*
6
- *
7
- * The logic underneath — `summariseRefusals`/`fetchRefusalPage`
8
- * (`@descryy/core`'s `query/refusal-fetch.ts`) — is already built and
9
- * unit-tested; this is the tool boundary its own header names as still open:
10
- * *"An MCP surface that wants a prettier, shorter token... is free to wrap
11
- * this — that is a presentation choice for P27."* No wrapping was needed —
12
- * the handle is already opaque and self-describing — so this tool is thin:
13
- * read the population, hand it to whichever of the two functions the call
14
- * shape asks for.
15
- *
16
- * ## Two calls, one tool — same pattern `questions.ts` already uses
17
- *
18
- * No `handle` argument → a fresh summary (`summariseRefusals`): cheap, one
19
- * count, one exemplar, a handle. A `handle` argument → redeem it for a real
20
- * page (`fetchRefusalPage`). This mirrors `questions.ts`'s own "no `answer`
21
- * argument is a pure read" split rather than inventing a second shape.
22
- *
23
- * ## The call-site trap this tool must not reproduce
24
- *
25
- * `refusal-fetch.ts`'s own header names it explicitly: the store reader
26
- * defaults to `classified: true`, which silently drops every unclassified
27
- * row (DEC-243's grouper only wants the classifiable subset). This tool
28
- * always asks for `{ classified: false }` — the complete ledger, classified
29
- * and unclassified alike — because a `refusal_fetch` that only showed the
30
- * askable subset would be the empty-denominator defect wearing this
31
- * technique's clothes, exactly what that module's header warns against.
32
- *
33
- * ## No cap on the population read
34
- *
35
- * `provider.unresolvedRefs({ classified: false })` is called with no
36
- * `limit` — the handle's population fingerprint has to be stable between the
37
- * summary call and every page redemption, and a capped read here would make
38
- * "the ledger changed" indistinguishable from "the cap sampled differently
39
- * this time." Correctness over a cheap shortcut, same choice `refusal-fetch.ts`
40
- * itself already made.
41
- */
2
+ * `refusal_fetch` — §4 technique 4: summarise, never enumerate (count, exemplar,
3
+ * handle). No `handle` → fresh summary; `handle` → redeem a page (mirrors
4
+ * `questions.ts`). Always reads `{classified: false}` — the default `true` would
5
+ * silently drop unclassified rows (DEC-243). No `limit`: the population must stay stable. */
42
6
  import { fetchRefusalPage, summariseRefusals } from "@descryy/core";
43
7
  import { answer, optionalInteger, optionalString, } from "./kit.js";
44
8
  const SCHEMA = {
@@ -1 +1 @@
1
- {"version":3,"file":"refusal-fetch.js","sourceRoot":"","sources":["../../src/tools/refusal-fetch.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwCG;AAEH,OAAO,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAEpE,OAAO,EACL,MAAM,EACN,eAAe,EACf,cAAc,GAGf,MAAM,UAAU,CAAC;AAGlB,MAAM,MAAM,GAAG;IACb,IAAI,EAAE,QAAQ;IACd,UAAU,EAAE;QACV,MAAM,EAAE;YACN,IAAI,EAAE,QAAQ;YACd,WAAW,EACT,2FAA2F;gBAC3F,6EAA6E;SAChF;QACD,QAAQ,EAAE;YACR,IAAI,EAAE,SAAS;YACf,OAAO,EAAE,CAAC;YACV,WAAW,EAAE,mJAAmJ;SACjK;KACF;IACD,oBAAoB,EAAE,KAAK;CACnB,CAAC;AAiCX,SAAS,KAAK,CAAC,GAQd;IACC,OAAO;QACL,UAAU,EAAE,GAAG,CAAC,UAAU;QAC1B,QAAQ,EAAE,GAAG,CAAC,QAAQ;QACtB,SAAS,EAAE,GAAG,CAAC,SAAS;QACxB,IAAI,EAAE,GAAG,CAAC,IAAI;QACd,IAAI,EAAE,GAAG,CAAC,IAAI;QACd,UAAU,EAAE,GAAG,CAAC,UAAU;QAC1B,MAAM,EAAE,GAAG,CAA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;QAC5F,kCAAkC;IACpC,WAAW,EAAE,MAA4C;IACzD,GAAG;CACJ,CAAC"}
@@ -1,59 +1,7 @@
1
1
  /**
2
- * A service that died during an observed run, recorded as an incident.
3
- *
4
- * The fifth and last incident mechanism — and the only one whose evidence is a
5
- * machine's rather than a person's. `observe_runtime` already spawns real
6
- * processes and watches them; a process that exits non-zero or takes a fatal
7
- * signal really did fail, and that is a fact about the world in the same class
8
- * as the R4 edges that tool already writes.
9
- *
10
- * ## An exception is not an incident, and this is where that bites hardest
11
- *
12
- * The obvious design — every `EXCEPTION` becomes an incident — is wrong and
13
- * would be the worst instance of the pollution the whole incident ruling is
14
- * about. A caught, expected error during a run Descry itself provoked is not a
15
- * production failure, and `INCIDENT` is an EARNED-class claim that biases diff
16
- * scoping permanently. The conformance fixture prints a real `Error.stack` on a
17
- * timer precisely to have caught exceptions in the stream, and none of them may
18
- * mint anything.
19
- *
20
- * So the qualifying condition is about the **process**, not the log:
21
- *
22
- * - a non-zero exit code, or
23
- * - a fatal signal Descry did not send.
24
- *
25
- * The second half needs care, because Descry's own teardown *is* a signal.
26
- * `SIGTERM` at the end of an observation window is the orchestrator stopping a
27
- * healthy service, and reading it as a crash would make every successful run
28
- * mint an incident. Only the signals a process takes when it dies of its own
29
- * accord count — see `FATAL_SIGNALS`.
30
- *
31
- * ## What the incident is correlated to, and what that claim is
32
- *
33
- * Every file named by an `EXCEPTION` source location observed during the run.
34
- * That is deliberately *not* "the cause": nothing here knows which exception
35
- * killed the process, and picking the last one would be recency standing in for
36
- * causality. The honest claim, and the one the record's own summary makes, is
37
- * **"these files were implicated in a run in which this service died"** — real,
38
- * checkable, and weaker than a root cause.
39
- *
40
- * This is also better than the ruling predicted.
41
- * `DEC-NEXT-collector-evidence-carries-no-service-name` blocks the *correlator*
42
- * from resolving symbol evidence, so the decision expected this mechanism to
43
- * mint an incident with no file edges at all. It does not need the correlator:
44
- * `Evidence.sourceLocation.file` is an absolute path the adapter already
45
- * parsed, and turning it into a repo-relative one is a subtraction, not a
46
- * resolution.
47
- *
48
- * ## Durability
49
- *
50
- * Written as a `ConfirmedIncident` carrying `observedInRun`, which is what the
51
- * projecting source reads to stamp `detectedVia: "runtime-observed"`. A run is
52
- * gone once the process exits, so the record cannot live only in a store that
53
- * DEC-017 drops on the next schema bump — the same argument that put a
54
- * developer's testimony in `.descry/config.json`, reached from the other side.
55
- *
56
- * See `DEC-NEXT-incident-minting-beyond-explicit-reverts`.
2
+ * Mints an `INCIDENT` from `observe_runtime`'s process exit/signal, never
3
+ * from `EXCEPTION` events (a caught, provoked error isn't a failure).
4
+ * Correlates to files an exception named — "implicated", not "caused". See `DEC-NEXT-incident-minting-beyond-explicit-reverts`.
57
5
  */
58
6
  import type { ConfirmedIncident } from "@descryy/ir";
59
7
  /** One observed service, in the shape `observe_runtime` already reports. */
@@ -80,13 +28,6 @@ export interface RuntimeIncidentInput {
80
28
  }
81
29
  /** Whether this service's exit is a failure rather than Descry stopping it. */
82
30
  export declare function died(outcome: ObservedProcessOutcome): boolean;
83
- /**
84
- * The incident a run witnessed, or `null` when every service exited cleanly —
85
- * which is the overwhelmingly common case and is not a finding.
86
- *
87
- * One record per run, not one per dead service: a run in which two services
88
- * died is one failure of one system observed once, and minting two would double
89
- * its weight in every ranking that counts incidents.
90
- */
31
+ /** The incident a run witnessed, or null when every service exited cleanly (the common case, not a finding). One record per run, not per dead service — two deaths are one system failure, not two. */
91
32
  export declare function runtimeObservedIncident(input: RuntimeIncidentInput): ConfirmedIncident | null;
92
33
  //# sourceMappingURL=runtime-incident.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"runtime-incident.d.ts","sourceRoot":"","sources":["../../src/tools/runtime-incident.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwDG;AAIH,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAmBrD,4EAA4E;AAC5E,MAAM,WA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