@pithy-sh/core 0.13.0 → 0.14.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 (354) hide show
  1. package/README.md +54 -0
  2. package/dist/audit/auditEvent.js +1 -1
  3. package/dist/audit/chain.d.ts +289 -0
  4. package/dist/audit/chain.d.ts.map +1 -0
  5. package/dist/audit/chain.js +400 -0
  6. package/dist/audit/citations.d.ts +52 -0
  7. package/dist/audit/citations.d.ts.map +1 -0
  8. package/dist/audit/citations.js +13 -0
  9. package/dist/capability/bindings.d.ts +22 -0
  10. package/dist/capability/bindings.d.ts.map +1 -1
  11. package/dist/capability/bindings.js +32 -2
  12. package/dist/capability/capability.d.ts +123 -16
  13. package/dist/capability/capability.d.ts.map +1 -1
  14. package/dist/capability/capability.js +17 -2
  15. package/dist/capability/erasure.d.ts +75 -0
  16. package/dist/capability/erasure.d.ts.map +1 -0
  17. package/dist/capability/erasure.js +2 -0
  18. package/dist/capability/manifest.d.ts +5 -0
  19. package/dist/capability/manifest.d.ts.map +1 -1
  20. package/dist/capability/personColumns.d.ts +28 -0
  21. package/dist/capability/personColumns.d.ts.map +1 -0
  22. package/dist/capability/personColumns.js +66 -0
  23. package/dist/capability/personRows.d.ts +62 -0
  24. package/dist/capability/personRows.d.ts.map +1 -0
  25. package/dist/capability/personRows.js +59 -0
  26. package/dist/capability/purge.d.ts +86 -19
  27. package/dist/capability/purge.d.ts.map +1 -1
  28. package/dist/capability/purge.js +83 -5
  29. package/dist/capability/settings.d.ts +10 -0
  30. package/dist/capability/settings.d.ts.map +1 -1
  31. package/dist/capability/vectorIndex.d.ts +36 -0
  32. package/dist/capability/vectorIndex.d.ts.map +1 -0
  33. package/dist/capability/vectorIndex.js +25 -0
  34. package/dist/cli/commandCatalog.generated.d.ts +433 -3
  35. package/dist/cli/commandCatalog.generated.d.ts.map +1 -1
  36. package/dist/cli/commandCatalog.generated.js +449 -2
  37. package/dist/cli/commandFacts.d.ts +8 -5
  38. package/dist/cli/commandFacts.d.ts.map +1 -1
  39. package/dist/cli/commandFacts.js +12 -3
  40. package/dist/consent/purpose.d.ts +70 -0
  41. package/dist/consent/purpose.d.ts.map +1 -0
  42. package/dist/consent/purpose.js +97 -0
  43. package/dist/consent/reader.d.ts +99 -0
  44. package/dist/consent/reader.d.ts.map +1 -0
  45. package/dist/consent/reader.js +33 -0
  46. package/dist/controlPlane/audit/actions.d.ts +15 -4
  47. package/dist/controlPlane/audit/actions.d.ts.map +1 -1
  48. package/dist/controlPlane/audit/actions.js +16 -5
  49. package/dist/controlPlane/capability.d.ts +10 -0
  50. package/dist/controlPlane/capability.d.ts.map +1 -1
  51. package/dist/controlPlane/capability.js +56 -8
  52. package/dist/controlPlane/context.d.ts +4 -0
  53. package/dist/controlPlane/context.d.ts.map +1 -1
  54. package/dist/controlPlane/context.js +3 -2
  55. package/dist/controlPlane/data/connection.d.ts +21 -2
  56. package/dist/controlPlane/data/connection.d.ts.map +1 -1
  57. package/dist/controlPlane/data/connection.js +13 -4
  58. package/dist/controlPlane/data/connections.d.ts +94 -0
  59. package/dist/controlPlane/data/connections.d.ts.map +1 -0
  60. package/dist/controlPlane/data/connections.js +151 -0
  61. package/dist/controlPlane/data/hold.d.ts +46 -0
  62. package/dist/controlPlane/data/hold.d.ts.map +1 -0
  63. package/dist/controlPlane/data/hold.js +36 -0
  64. package/dist/controlPlane/data/oidcTrust.d.ts +122 -0
  65. package/dist/controlPlane/data/oidcTrust.d.ts.map +1 -0
  66. package/dist/controlPlane/data/oidcTrust.js +173 -0
  67. package/dist/controlPlane/data/tables.d.ts +4 -0
  68. package/dist/controlPlane/data/tables.d.ts.map +1 -1
  69. package/dist/controlPlane/data/tables.js +9 -4
  70. package/dist/controlPlane/data/trustFirstCall.d.ts +16 -0
  71. package/dist/controlPlane/data/trustFirstCall.d.ts.map +1 -0
  72. package/dist/controlPlane/data/trustFirstCall.js +25 -0
  73. package/dist/controlPlane/discovery/adminRoute.d.ts +165 -2
  74. package/dist/controlPlane/discovery/adminRoute.d.ts.map +1 -1
  75. package/dist/controlPlane/discovery/adminRoute.js +32 -8
  76. package/dist/controlPlane/discovery/routeInput.d.ts +23 -0
  77. package/dist/controlPlane/discovery/routeInput.d.ts.map +1 -0
  78. package/dist/controlPlane/discovery/routeInput.js +80 -0
  79. package/dist/controlPlane/discovery/toolName.d.ts +21 -0
  80. package/dist/controlPlane/discovery/toolName.d.ts.map +1 -0
  81. package/dist/controlPlane/discovery/toolName.js +25 -0
  82. package/dist/controlPlane/erasure/attest.d.ts +78 -0
  83. package/dist/controlPlane/erasure/attest.d.ts.map +1 -0
  84. package/dist/controlPlane/erasure/attest.js +164 -0
  85. package/dist/controlPlane/erasure/read.d.ts +39 -0
  86. package/dist/controlPlane/erasure/read.d.ts.map +1 -0
  87. package/dist/controlPlane/erasure/read.js +140 -0
  88. package/dist/controlPlane/error/errors.d.ts +61 -2
  89. package/dist/controlPlane/error/errors.d.ts.map +1 -1
  90. package/dist/controlPlane/error/errors.js +13 -0
  91. package/dist/controlPlane/evidence/derive.d.ts +124 -0
  92. package/dist/controlPlane/evidence/derive.d.ts.map +1 -0
  93. package/dist/controlPlane/evidence/derive.js +343 -0
  94. package/dist/controlPlane/evidence/mapping.d.ts +85 -0
  95. package/dist/controlPlane/evidence/mapping.d.ts.map +1 -0
  96. package/dist/controlPlane/evidence/mapping.js +114 -0
  97. package/dist/controlPlane/evidence/pack.d.ts +46 -0
  98. package/dist/controlPlane/evidence/pack.d.ts.map +1 -0
  99. package/dist/controlPlane/evidence/pack.js +124 -0
  100. package/dist/controlPlane/http/connections.d.ts +96 -0
  101. package/dist/controlPlane/http/connections.d.ts.map +1 -0
  102. package/dist/controlPlane/http/connections.js +109 -0
  103. package/dist/controlPlane/http/guard.d.ts +23 -2
  104. package/dist/controlPlane/http/guard.d.ts.map +1 -1
  105. package/dist/controlPlane/http/guard.js +69 -12
  106. package/dist/controlPlane/http/handlers.d.ts +212 -10
  107. package/dist/controlPlane/http/handlers.d.ts.map +1 -1
  108. package/dist/controlPlane/http/handlers.js +117 -26
  109. package/dist/controlPlane/http/holds.d.ts +57 -0
  110. package/dist/controlPlane/http/holds.d.ts.map +1 -0
  111. package/dist/controlPlane/http/holds.js +98 -0
  112. package/dist/controlPlane/http/presence.d.ts +27 -0
  113. package/dist/controlPlane/http/presence.d.ts.map +1 -0
  114. package/dist/controlPlane/http/presence.js +67 -0
  115. package/dist/controlPlane/http/processing.d.ts +73 -0
  116. package/dist/controlPlane/http/processing.d.ts.map +1 -0
  117. package/dist/controlPlane/http/processing.js +17 -0
  118. package/dist/controlPlane/http/responses.d.ts +927 -3
  119. package/dist/controlPlane/http/responses.d.ts.map +1 -1
  120. package/dist/controlPlane/http/responses.js +283 -7
  121. package/dist/controlPlane/http/routes.d.ts +12 -2
  122. package/dist/controlPlane/http/routes.d.ts.map +1 -1
  123. package/dist/controlPlane/http/routes.js +182 -5
  124. package/dist/controlPlane/http/schemas.d.ts +63 -0
  125. package/dist/controlPlane/http/schemas.d.ts.map +1 -1
  126. package/dist/controlPlane/http/schemas.js +39 -1
  127. package/dist/controlPlane/http/verify.d.ts.map +1 -1
  128. package/dist/controlPlane/http/verify.js +13 -1
  129. package/dist/controlPlane/http/verifyTrust.d.ts +76 -0
  130. package/dist/controlPlane/http/verifyTrust.d.ts.map +1 -0
  131. package/dist/controlPlane/http/verifyTrust.js +75 -0
  132. package/dist/controlPlane/migrations/0004_connection_trusts.d.ts +15 -0
  133. package/dist/controlPlane/migrations/0004_connection_trusts.d.ts.map +1 -0
  134. package/dist/controlPlane/migrations/0004_connection_trusts.js +23 -0
  135. package/dist/controlPlane/migrations/0005_holds.d.ts +12 -0
  136. package/dist/controlPlane/migrations/0005_holds.d.ts.map +1 -0
  137. package/dist/controlPlane/migrations/0005_holds.js +26 -0
  138. package/dist/controlPlane/processing/derive.d.ts +77 -0
  139. package/dist/controlPlane/processing/derive.d.ts.map +1 -0
  140. package/dist/controlPlane/processing/derive.js +206 -0
  141. package/dist/controlPlane/processing/read.d.ts +10 -0
  142. package/dist/controlPlane/processing/read.d.ts.map +1 -0
  143. package/dist/controlPlane/processing/read.js +89 -0
  144. package/dist/controlPlane/scope/kind.d.ts +46 -0
  145. package/dist/controlPlane/scope/kind.d.ts.map +1 -0
  146. package/dist/controlPlane/scope/kind.js +52 -0
  147. package/dist/controlPlane/scope/scope.d.ts +58 -3
  148. package/dist/controlPlane/scope/scope.d.ts.map +1 -1
  149. package/dist/controlPlane/scope/scope.js +59 -4
  150. package/dist/controlPlane/token/jws.js +1 -1
  151. package/dist/controlPlane/token/mint.js +1 -1
  152. package/dist/controlPlane/wire.d.ts +23 -0
  153. package/dist/controlPlane/wire.d.ts.map +1 -1
  154. package/dist/controlPlane/wire.js +24 -1
  155. package/dist/createBackend.d.ts +13 -0
  156. package/dist/createBackend.d.ts.map +1 -1
  157. package/dist/createBackend.js +11 -3
  158. package/dist/createEntrypoint.d.ts +7 -0
  159. package/dist/createEntrypoint.d.ts.map +1 -1
  160. package/dist/createEntrypoint.js +4 -0
  161. package/dist/error/http.d.ts +168 -0
  162. package/dist/error/http.d.ts.map +1 -1
  163. package/dist/error/payload.d.ts +336 -0
  164. package/dist/error/payload.d.ts.map +1 -1
  165. package/dist/error/payload.js +112 -0
  166. package/dist/error/pithyError.d.ts +22 -0
  167. package/dist/error/pithyError.d.ts.map +1 -1
  168. package/dist/error/pithyError.js +31 -1
  169. package/dist/http/routeSpec.d.ts +46 -1
  170. package/dist/http/routeSpec.d.ts.map +1 -1
  171. package/dist/http/routeSpec.js +39 -5
  172. package/dist/http/verification.d.ts.map +1 -1
  173. package/dist/http/verification.js +1 -1
  174. package/dist/i18n/translator.d.ts +2 -1
  175. package/dist/i18n/translator.d.ts.map +1 -1
  176. package/dist/index.d.ts +1 -1
  177. package/dist/index.d.ts.map +1 -1
  178. package/dist/index.js +3 -3
  179. package/dist/logger/record.d.ts +98 -0
  180. package/dist/logger/record.d.ts.map +1 -1
  181. package/dist/mcp/annotations.d.ts +20 -0
  182. package/dist/mcp/annotations.d.ts.map +1 -0
  183. package/dist/mcp/annotations.js +23 -0
  184. package/dist/mcp/tools.d.ts +75 -0
  185. package/dist/mcp/tools.d.ts.map +1 -0
  186. package/dist/mcp/tools.js +118 -0
  187. package/dist/openapi/document.d.ts.map +1 -1
  188. package/dist/openapi/document.js +8 -26
  189. package/dist/openapi/operations.d.ts +35 -0
  190. package/dist/openapi/operations.d.ts.map +1 -0
  191. package/dist/openapi/operations.js +37 -0
  192. package/dist/presence/channel.d.ts +11 -0
  193. package/dist/presence/channel.d.ts.map +1 -0
  194. package/dist/presence/channel.js +65 -0
  195. package/dist/presence/declaration.d.ts +154 -0
  196. package/dist/presence/declaration.d.ts.map +1 -0
  197. package/dist/presence/declaration.js +164 -0
  198. package/dist/presence/durableObject.d.ts +61 -0
  199. package/dist/presence/durableObject.d.ts.map +1 -0
  200. package/dist/presence/durableObject.js +257 -0
  201. package/dist/presence/frames.d.ts +166 -0
  202. package/dist/presence/frames.d.ts.map +1 -0
  203. package/dist/presence/frames.js +90 -0
  204. package/dist/presence/http/guard.d.ts +11 -0
  205. package/dist/presence/http/guard.d.ts.map +1 -0
  206. package/dist/presence/http/guard.js +20 -0
  207. package/dist/presence/http/responses.d.ts +31 -0
  208. package/dist/presence/http/responses.d.ts.map +1 -0
  209. package/dist/presence/http/responses.js +34 -0
  210. package/dist/presence/http/routes.d.ts +24 -0
  211. package/dist/presence/http/routes.d.ts.map +1 -0
  212. package/dist/presence/http/routes.js +127 -0
  213. package/dist/presence/http/schemas.d.ts +29 -0
  214. package/dist/presence/http/schemas.d.ts.map +1 -0
  215. package/dist/presence/http/schemas.js +28 -0
  216. package/dist/presence/names.d.ts +23 -0
  217. package/dist/presence/names.d.ts.map +1 -0
  218. package/dist/presence/names.js +22 -0
  219. package/dist/presence/room.d.ts +95 -0
  220. package/dist/presence/room.d.ts.map +1 -0
  221. package/dist/presence/room.js +105 -0
  222. package/dist/presence/ticket.d.ts +55 -0
  223. package/dist/presence/ticket.d.ts.map +1 -0
  224. package/dist/presence/ticket.js +109 -0
  225. package/dist/privacy/classify.js +1 -1
  226. package/dist/privacy/encrypted.js +1 -1
  227. package/dist/processing/activity.d.ts +134 -0
  228. package/dist/processing/activity.d.ts.map +1 -0
  229. package/dist/processing/activity.js +161 -0
  230. package/dist/processing/composed.d.ts +18 -0
  231. package/dist/processing/composed.d.ts.map +1 -0
  232. package/dist/processing/composed.js +28 -0
  233. package/dist/processing/vocabulary.d.ts +26 -0
  234. package/dist/processing/vocabulary.d.ts.map +1 -0
  235. package/dist/processing/vocabulary.js +35 -0
  236. package/dist/queue/consumer.d.ts +59 -0
  237. package/dist/queue/consumer.d.ts.map +1 -0
  238. package/dist/queue/consumer.js +46 -0
  239. package/dist/retention/composed.d.ts +37 -0
  240. package/dist/retention/composed.d.ts.map +1 -0
  241. package/dist/retention/composed.js +66 -0
  242. package/dist/retention/holds.d.ts +61 -0
  243. package/dist/retention/holds.d.ts.map +1 -0
  244. package/dist/retention/holds.js +107 -0
  245. package/dist/retention/holdsPurge.d.ts +22 -0
  246. package/dist/retention/holdsPurge.d.ts.map +1 -0
  247. package/dist/retention/holdsPurge.js +50 -0
  248. package/dist/retention/policy.d.ts +132 -0
  249. package/dist/retention/policy.d.ts.map +1 -0
  250. package/dist/retention/policy.js +197 -0
  251. package/dist/session/rotated.d.ts +34 -0
  252. package/dist/session/rotated.d.ts.map +1 -0
  253. package/dist/session/rotated.js +25 -0
  254. package/dist/test-utils/connectionFixtures.d.ts +13 -0
  255. package/dist/test-utils/connectionFixtures.d.ts.map +1 -0
  256. package/dist/test-utils/connectionFixtures.js +58 -0
  257. package/dist/test-utils/interleave.d.ts +12 -0
  258. package/dist/test-utils/interleave.d.ts.map +1 -0
  259. package/dist/test-utils/interleave.js +26 -0
  260. package/dist/testWorker.d.ts +8 -0
  261. package/dist/testWorker.d.ts.map +1 -0
  262. package/dist/testWorker.js +9 -0
  263. package/dist/version.generated.d.ts +1 -1
  264. package/dist/version.generated.js +1 -1
  265. package/dist/workflow/dispatchRoute.js +1 -1
  266. package/package.json +1 -1
  267. package/src/audit/auditEvent.ts +1 -1
  268. package/src/audit/chain.ts +551 -0
  269. package/src/audit/citations.ts +63 -0
  270. package/src/capability/bindings.ts +61 -0
  271. package/src/capability/capability.ts +156 -19
  272. package/src/capability/erasure.ts +82 -0
  273. package/src/capability/personColumns.ts +83 -0
  274. package/src/capability/personRows.ts +125 -0
  275. package/src/capability/purge.ts +158 -21
  276. package/src/capability/settings.ts +7 -0
  277. package/src/capability/vectorIndex.ts +60 -0
  278. package/src/cli/commandCatalog.generated.ts +482 -2
  279. package/src/cli/commandFacts.ts +12 -3
  280. package/src/cloudflare-test.d.ts +3 -1
  281. package/src/consent/purpose.ts +160 -0
  282. package/src/consent/reader.ts +134 -0
  283. package/src/controlPlane/audit/actions.ts +15 -4
  284. package/src/controlPlane/capability.ts +99 -20
  285. package/src/controlPlane/context.ts +10 -2
  286. package/src/controlPlane/data/connection.ts +16 -2
  287. package/src/controlPlane/data/connections.ts +231 -0
  288. package/src/controlPlane/data/hold.ts +52 -0
  289. package/src/controlPlane/data/oidcTrust.ts +249 -0
  290. package/src/controlPlane/data/tables.ts +7 -0
  291. package/src/controlPlane/data/trustFirstCall.ts +37 -0
  292. package/src/controlPlane/discovery/adminRoute.ts +71 -9
  293. package/src/controlPlane/discovery/routeInput.ts +86 -0
  294. package/src/controlPlane/discovery/toolName.ts +23 -0
  295. package/src/controlPlane/erasure/attest.ts +205 -0
  296. package/src/controlPlane/erasure/read.ts +169 -0
  297. package/src/controlPlane/error/errors.ts +69 -2
  298. package/src/controlPlane/evidence/derive.ts +426 -0
  299. package/src/controlPlane/evidence/mapping.ts +118 -0
  300. package/src/controlPlane/evidence/pack.ts +190 -0
  301. package/src/controlPlane/http/connections.ts +129 -0
  302. package/src/controlPlane/http/guard.ts +118 -9
  303. package/src/controlPlane/http/handlers.ts +172 -40
  304. package/src/controlPlane/http/holds.ts +108 -0
  305. package/src/controlPlane/http/presence.ts +71 -0
  306. package/src/controlPlane/http/processing.ts +19 -0
  307. package/src/controlPlane/http/responses.ts +590 -7
  308. package/src/controlPlane/http/routes.ts +302 -3
  309. package/src/controlPlane/http/schemas.ts +126 -0
  310. package/src/controlPlane/http/verify.ts +19 -2
  311. package/src/controlPlane/http/verifyTrust.ts +176 -0
  312. package/src/controlPlane/migrations/0004_connection_trusts.ts +30 -0
  313. package/src/controlPlane/migrations/0005_holds.ts +40 -0
  314. package/src/controlPlane/processing/derive.ts +359 -0
  315. package/src/controlPlane/processing/read.ts +102 -0
  316. package/src/controlPlane/scope/kind.ts +63 -0
  317. package/src/controlPlane/scope/scope.ts +65 -3
  318. package/src/controlPlane/wire.ts +26 -0
  319. package/src/createBackend.ts +31 -6
  320. package/src/createEntrypoint.ts +17 -0
  321. package/src/error/payload.ts +234 -0
  322. package/src/error/pithyError.ts +42 -0
  323. package/src/http/routeSpec.ts +75 -5
  324. package/src/http/verification.ts +3 -1
  325. package/src/i18n/translator.ts +2 -1
  326. package/src/index.ts +2 -0
  327. package/src/mcp/annotations.ts +38 -0
  328. package/src/mcp/tools.ts +220 -0
  329. package/src/openapi/document.ts +8 -28
  330. package/src/openapi/operations.ts +62 -0
  331. package/src/presence/channel.ts +46 -0
  332. package/src/presence/declaration.ts +283 -0
  333. package/src/presence/durableObject.ts +287 -0
  334. package/src/presence/frames.ts +153 -0
  335. package/src/presence/http/guard.ts +23 -0
  336. package/src/presence/http/responses.ts +63 -0
  337. package/src/presence/http/routes.ts +165 -0
  338. package/src/presence/http/schemas.ts +39 -0
  339. package/src/presence/names.ts +45 -0
  340. package/src/presence/room.ts +145 -0
  341. package/src/presence/ticket.ts +145 -0
  342. package/src/processing/activity.ts +289 -0
  343. package/src/processing/composed.ts +33 -0
  344. package/src/processing/vocabulary.ts +43 -0
  345. package/src/queue/consumer.ts +104 -0
  346. package/src/retention/composed.ts +75 -0
  347. package/src/retention/holds.ts +175 -0
  348. package/src/retention/holdsPurge.ts +50 -0
  349. package/src/retention/policy.ts +305 -0
  350. package/src/session/rotated.ts +53 -0
  351. package/src/test-utils/connectionFixtures.ts +58 -0
  352. package/src/test-utils/interleave.ts +31 -0
  353. package/src/testWorker.ts +13 -0
  354. package/src/version.generated.ts +1 -1
@@ -0,0 +1,140 @@
1
+ // SPDX-FileCopyrightText: 2026 Pithy
2
+ // SPDX-License-Identifier: MIT
3
+ import { NotFoundError, ValidationError } from "../../error/pithyError.js";
4
+ import { composedAuditCitations } from "../../audit/citations.js";
5
+ import { attest, byDue, periodEntry, summarize } from "./attest.js";
6
+ //#region src/controlPlane/erasure/read.ts
7
+ /**
8
+ * **The two erasure reads (#823), over whatever this Worker composes.**
9
+ *
10
+ * The rows live in the capability that owns each subject — auth for a user, organization for an organization —
11
+ * and are read through the {@link ErasureRecords} each declares. The events live in the audit trail and are read
12
+ * through the citation reader `@pithy-sh/audit` declares. Neither is imported: both are found among the composed
13
+ * capabilities, so a Worker with no organization attests users only and says so, and one with no audit attests from
14
+ * the lifecycle rows and says the trail is absent.
15
+ */
16
+ /** The default window: a quarter. */
17
+ const ERASURE_DEFAULT_WINDOW_MS = 7776e6;
18
+ /** The longest window one read covers: a year and a day, so a year's audit is one call. */
19
+ const ERASURE_MAX_WINDOW_MS = 316224e5;
20
+ /** How many subjects one history or citation read names at once — inside D1's bound-parameter limit. */
21
+ const CHUNK = 50;
22
+ /** The capability recording each subject's purges, first declared wins. */
23
+ function erasureProviders(capabilities) {
24
+ const providers = /* @__PURE__ */ new Map();
25
+ for (const capability of capabilities) {
26
+ const records = capability.erasureRecords;
27
+ if (records && !providers.has(records.subject)) providers.set(records.subject, records);
28
+ }
29
+ return providers;
30
+ }
31
+ /** The window a period read covers, defaulted and bounded. */
32
+ function erasureWindow(query, now) {
33
+ const until = query.until ? new Date(query.until) : now;
34
+ const since = query.since ? new Date(query.since) : /* @__PURE__ */ new Date(until.getTime() - ERASURE_DEFAULT_WINDOW_MS);
35
+ if (since.getTime() > until.getTime()) throw new ValidationError({
36
+ message: "`since` is after `until`.",
37
+ detail: `erasure window ${since.toISOString()} to ${until.toISOString()}`
38
+ });
39
+ if (until.getTime() - since.getTime() > 316224e5) throw new ValidationError({
40
+ message: "An erasure window is at most 366 days. Ask for a shorter one.",
41
+ detail: `erasure window ${since.toISOString()} to ${until.toISOString()}`
42
+ });
43
+ return {
44
+ since,
45
+ until
46
+ };
47
+ }
48
+ /** Every value in chunks of {@link CHUNK}. */
49
+ function chunks(values) {
50
+ const out = [];
51
+ for (let index = 0; index < values.length; index += CHUNK) out.push(values.slice(index, index + CHUNK));
52
+ return out;
53
+ }
54
+ /** The audit events a subject's purge records, for these ids, or `null` with no audit composed. */
55
+ async function citationsFor(capabilities, env, records, ids) {
56
+ const reader = composedAuditCitations(capabilities, env);
57
+ if (!reader) return null;
58
+ const { deleted, step, failed, purged } = records.auditActions;
59
+ const actions = [
60
+ ...deleted,
61
+ step,
62
+ failed,
63
+ purged
64
+ ];
65
+ const found = [];
66
+ for (const resourceIds of chunks(ids)) found.push(...await reader({
67
+ resourceType: records.resourceType,
68
+ resourceIds,
69
+ actions
70
+ }));
71
+ return found;
72
+ }
73
+ /** `GET /control-plane/erasure/:subjectType/:subjectId`. */
74
+ async function readErasureSubject(env, deps, subject, subjectId) {
75
+ const capabilities = deps.composition();
76
+ const records = erasureProviders(capabilities).get(subject);
77
+ if (!records) throw new NotFoundError({
78
+ message: `This Worker records no erasures for ${subject === "user" ? "a user" : "an organization"}.`,
79
+ action: `Compose the capability that owns ${subject} purges in this Worker, then ask again.`,
80
+ detail: `no composed capability declares erasureRecords for ${subject}`
81
+ });
82
+ const now = deps.now();
83
+ const rows = await records.read(env).history([subjectId]);
84
+ const citations = rows.length === 0 ? null : await citationsFor(capabilities, env, records, [subjectId]);
85
+ const attestation = rows.length === 0 ? null : attest({
86
+ subject,
87
+ subjectId,
88
+ rows,
89
+ citations,
90
+ actions: records.auditActions,
91
+ now
92
+ });
93
+ if (!attestation) throw new NotFoundError({
94
+ message: "No erasure on record for this subject.",
95
+ action: "It was never deleted, or it was restored. Nothing has been erased.",
96
+ detail: `no deletion in force for ${subject} ${subjectId}`
97
+ });
98
+ return {
99
+ generatedAt: now.toISOString(),
100
+ attestation
101
+ };
102
+ }
103
+ /** `GET /control-plane/erasure?since&until`. */
104
+ async function readErasurePeriod(env, deps, query) {
105
+ const now = deps.now();
106
+ const { since, until } = erasureWindow(query, now);
107
+ const providers = erasureProviders(deps.composition());
108
+ const entries = [];
109
+ for (const [subject, records] of providers) {
110
+ const reader = records.read(env);
111
+ const ids = await reader.subjectsIn(since, until);
112
+ for (const batch of chunks(ids)) {
113
+ const rows = await reader.history(batch);
114
+ for (const subjectId of batch) {
115
+ const attestation = attest({
116
+ subject,
117
+ subjectId,
118
+ rows: rows.filter((row) => row.subjectId === subjectId),
119
+ citations: null,
120
+ actions: records.auditActions,
121
+ now
122
+ });
123
+ if (attestation) entries.push(periodEntry(attestation));
124
+ }
125
+ }
126
+ }
127
+ const purges = byDue(entries);
128
+ const { counts, attention } = summarize(purges);
129
+ return {
130
+ generatedAt: now.toISOString(),
131
+ since: since.toISOString(),
132
+ until: until.toISOString(),
133
+ subjects: [...providers.keys()],
134
+ counts,
135
+ attention,
136
+ purges
137
+ };
138
+ }
139
+ //#endregion
140
+ export { ERASURE_DEFAULT_WINDOW_MS, ERASURE_MAX_WINDOW_MS, erasureProviders, erasureWindow, readErasurePeriod, readErasureSubject };
@@ -3,6 +3,7 @@
3
3
  import { PithyError } from "../../error/pithyError";
4
4
  import type { MessageParams } from "../../i18n/catalog";
5
5
  import type { UnmarkedString } from "../../privacy/types";
6
+ import type { ControlPlaneActorKind } from "../data/connection";
6
7
  /**
7
8
  * The `control-plane` strategy's throw sugar. The `controlplane/*` codes live in core's closed
8
9
  * `KitErrorPayload` union (CLAUDE.md §Errors); these subclasses are the vehicles that set one.
@@ -35,18 +36,76 @@ export declare class ControlPlaneNotConnectedError extends PithyError {
35
36
  cause?: unknown;
36
37
  });
37
38
  }
39
+ /**
40
+ * What a call under an OIDC trust carried when its claims did not match (#722), for the audit row and nobody
41
+ * else.
42
+ *
43
+ * Set only once the token's signature, issuer and audience have verified: by then the caller demonstrably
44
+ * holds a genuine token for this audience, so naming the claims it sent leaks nothing it does not already
45
+ * hold — and those claims are what an operator picks a matcher from. Before that the single-error discipline
46
+ * holds, and no refusal carries this.
47
+ */
48
+ export interface ControlPlaneRefusedTrust {
49
+ /** The connection whose trust was named. */
50
+ readonly connectionId: string;
51
+ /** The trust the call named. */
52
+ readonly trustId: string;
53
+ /** The workload's claims, as strings, capped — `observedClaims` in `../data/oidcTrust`. */
54
+ readonly observedClaims: Readonly<Record<string, string>>;
55
+ }
38
56
  /**
39
57
  * The credential failed verification. One error for every step — pass the step in `detail` so the log
40
58
  * can say which, and the caller cannot.
41
59
  */
42
60
  export declare class ControlPlaneInvalidCredentialError extends PithyError {
43
- constructor(args?: ControlPlaneErrorArgs, options?: {
61
+ /**
62
+ * A claim mismatch on an otherwise verified OIDC token, for the denial row. A property of the vehicle, never of
63
+ * `payload`, so the refusal a caller receives is the same one every other step answers. Null everywhere else.
64
+ */
65
+ readonly refusedTrust: ControlPlaneRefusedTrust | null;
66
+ constructor(args?: ControlPlaneErrorArgs & {
67
+ refusedTrust?: ControlPlaneRefusedTrust;
68
+ }, options?: {
44
69
  cause?: unknown;
45
70
  });
46
71
  }
72
+ /**
73
+ * Who a scope refusal refused, as verification proved it (#812).
74
+ *
75
+ * By the scope step the signature, the key, the lifetime and the body digest have all verified, so these are facts
76
+ * rather than claims. The gate writes them onto the denial row, which is what lets a known credential probing
77
+ * for scopes it lacks be traced back to it.
78
+ */
79
+ export interface ControlPlaneRefusedCaller {
80
+ /** The connection the verified token addressed. */
81
+ readonly connectionId: string;
82
+ /** The token's `sub`, proven by the signature. */
83
+ readonly subject: string;
84
+ /** The registered key that verified the signature — or, for a call under an OIDC trust, the trust. */
85
+ readonly keyId: string;
86
+ /**
87
+ * Said only for a call under an OIDC trust (#722), in which case `keyId` names the trust. Absent reads as a key, as
88
+ * it does on the allowed row, so a trust's refusals are not recorded as a key's with an id no key has.
89
+ */
90
+ readonly credentialKind?: "trust";
91
+ /**
92
+ * The kind of client the connection was registered as, from the adopter's row and never the token — the same value
93
+ * the allowed row is stamped with, so a trail filtered on kind holds a client's refusals beside its calls. Null for a
94
+ * connection registered before kinds were recorded.
95
+ */
96
+ readonly actorKind: ControlPlaneActorKind | null;
97
+ }
47
98
  /** The credential verified, but nothing granted it this operation. */
48
99
  export declare class ControlPlaneInsufficientScopeError extends PithyError {
49
- constructor(args?: ControlPlaneErrorArgs, options?: {
100
+ /**
101
+ * The verified caller, for the audit row and nobody else. A property of the vehicle, never of `payload`: the HTTP
102
+ * codec encodes the payload alone, so the refusal a caller receives is unchanged. Null when a throw site has no
103
+ * verified caller to name.
104
+ */
105
+ readonly caller: ControlPlaneRefusedCaller | null;
106
+ constructor(args?: ControlPlaneErrorArgs & {
107
+ caller?: ControlPlaneRefusedCaller;
108
+ }, options?: {
50
109
  cause?: unknown;
51
110
  });
52
111
  }
@@ -1 +1 @@
1
- {"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../../src/controlPlane/error/errors.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AACpD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACxD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAE1D;;;;;;;;;;;;GAYG;AAEH,UAAU,qBAAqB;IAC7B,OAAO,CAAC,EAAE,cAAc,CAAC;IACzB,MAAM,CAAC,EAAE,cAAc,CAAC;IACxB,MAAM,CAAC,EAAE,cAAc,CAAC;IACxB;;;OAGG;IACH,MAAM,CAAC,EAAE,aAAa,CAAC;CACxB;AAED;;;GAGG;AACH,qBAAa,6BAA8B,SAAQ,UAAU;IAC3D,YAAY,IAAI,GAAE,qBAA0B,EAAE,OAAO,CAAC,EAAE;QA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yBAAyB,CAAA;KAAO,EACzE,OAAO,CAAC,EAAE;QAAE,KAAK,CAAC,EAAE,OAAO,CAAA;KAAE,EAgB9B;CACF;AAED,0DAA0D;AAC1D,qBAAa,4BAA6B,SAAQ,UAAU;IAC1D,YAAY,IAAI,GAAE,qBAA0B,EAAE,OAAO,CAAC,EAAE;QAAE,KAAK,CAAC,EAAE,OAAO,CAAA;KAAE,EAY1E;CACF;AAED;;;;GAIG;AACH,qBAAa,4BAA6B,SAAQ,UAAU;IAC1D,YAAY,IAAI,GAAE,qBAA0B,EAAE,OAAO,CAAC,EAAE;QAAE,KAAK,CAAC,EAAE,OAAO,CAAA;KAAE,EAY1E;CACF"}
@@ -24,6 +24,11 @@ var ControlPlaneNotConnectedError = class extends PithyError {
24
24
  * can say which, and the caller cannot.
25
25
  */
26
26
  var ControlPlaneInvalidCredentialError = class extends PithyError {
27
+ /**
28
+ * A claim mismatch on an otherwise verified OIDC token, for the denial row. A property of the vehicle, never of
29
+ * `payload`, so the refusal a caller receives is the same one every other step answers. Null everywhere else.
30
+ */
31
+ refusedTrust;
27
32
  constructor(args = {}, options) {
28
33
  super({
29
34
  code: "controlplane/invalid_credential",
@@ -33,10 +38,17 @@ var ControlPlaneInvalidCredentialError = class extends PithyError {
33
38
  detail: args.detail,
34
39
  params: args.params
35
40
  }, options);
41
+ this.refusedTrust = args.refusedTrust ?? null;
36
42
  }
37
43
  };
38
44
  /** The credential verified, but nothing granted it this operation. */
39
45
  var ControlPlaneInsufficientScopeError = class extends PithyError {
46
+ /**
47
+ * The verified caller, for the audit row and nobody else. A property of the vehicle, never of `payload`: the HTTP
48
+ * codec encodes the payload alone, so the refusal a caller receives is unchanged. Null when a throw site has no
49
+ * verified caller to name.
50
+ */
51
+ caller;
40
52
  constructor(args = {}, options) {
41
53
  super({
42
54
  code: "controlplane/insufficient_scope",
@@ -46,6 +58,7 @@ var ControlPlaneInsufficientScopeError = class extends PithyError {
46
58
  detail: args.detail,
47
59
  params: args.params
48
60
  }, options);
61
+ this.caller = args.caller ?? null;
49
62
  }
50
63
  };
51
64
  /** The named key is not registered on this connection. */
@@ -0,0 +1,124 @@
1
+ // SPDX-FileCopyrightText: 2026 Pithy
2
+ // SPDX-License-Identifier: MIT
3
+ import type { DescribedOperation } from "../../openapi/operations";
4
+ import type { PrivacyAttestation } from "../../privacy/posture";
5
+ import type { PrivacyInventory } from "../../privacy/report";
6
+ import type { RetirementVerdict } from "../../privacy/retirement";
7
+ import type { ControlPlaneConnection, RegisteredKey } from "../data/connection";
8
+ import { type CapabilityHealthReport, type HealthSummaryKey } from "../discovery/healthSummary";
9
+ import type { EvidenceEntry, EvidenceFact, MigrationDatabaseView } from "../http/responses";
10
+ import { type EvidenceControlId, type EvidenceState } from "./mapping";
11
+ /**
12
+ * The derivation behind each control in the evidence pack (#821): plain inputs in, facts and a state out.
13
+ *
14
+ * **Every function here is pure.** The reads — a D1 query, a health producer, the route table — happen in
15
+ * `./pack.ts`, which hands each one what it found or the fact that it could not look. So every rule for a state
16
+ * is tested here directly, without a Worker, and the rules cannot drift by being restated at a read site.
17
+ *
18
+ * **What decides a state.** A gap is something positively missing. Not-derivable is the Worker being unable to
19
+ * say. Evidenced is neither. A control with both reports `gap`, and lists the gaps first and the unknowns after,
20
+ * because something known to be missing is the more actionable fact and the unknowns are still there to read.
21
+ * Nothing here says more than the facts do: an unknown is never folded into `evidenced`.
22
+ */
23
+ /** What a control's derivation produced, before the mapping table's references are attached. */
24
+ export interface Derived {
25
+ state: EvidenceState;
26
+ reasons: string[];
27
+ facts: EvidenceFact[];
28
+ }
29
+ /** Settle a control's state from what was missing and what could not be read. See the module doc. */
30
+ export declare function settle(gaps: readonly string[], unknowns: readonly string[], facts: EvidenceFact[]): Derived;
31
+ /** One entry of the pack: the mapping table's row for the control, beside what was derived. */
32
+ export declare function evidenceEntry(control: EvidenceControlId, derived: Derived): EvidenceEntry;
33
+ /** What the audit-logging control reads. */
34
+ export interface AuditLoggingInput {
35
+ /** The composed capability declaring an audit recorder, with each binding it writes through, or null for none. */
36
+ recorder: {
37
+ capability: string;
38
+ bindings: readonly {
39
+ binding: string;
40
+ present: boolean;
41
+ }[];
42
+ } | null;
43
+ /** Whether this very request's emit seam is a recorder rather than the no-op: the guard wrote through it. */
44
+ emitting: boolean;
45
+ }
46
+ /**
47
+ * Audit logging in force: a composed recorder, the binding it writes through, and this request's emit seam
48
+ * actually recording. The seam's guard emits on every control-plane call, allowed or denied, so a recorder on
49
+ * the seam is a record of every management call — including the one reading this pack.
50
+ */
51
+ export declare function deriveAuditLogging(input: AuditLoggingInput): Derived;
52
+ /**
53
+ * Every route declares how a caller is verified: `describeRoute`'s `verification`, read off the composed route
54
+ * table. A route with no `describeRoute` declares nothing, and is named.
55
+ */
56
+ export declare function deriveRouteVerification(operations: readonly DescribedOperation[] | undefined): Derived;
57
+ /** What the management-access and key-rotation controls read off one connection row. Never key material. */
58
+ export type ConnectionRecord = Pick<ControlPlaneConnection, "id" | "authorizedBy" | "actorKind" | "purpose" | "scopes"> & {
59
+ keys: readonly Pick<RegisteredKey, "validFrom" | "validUntil" | "revokedAt">[];
60
+ };
61
+ /**
62
+ * Management access attributed and scoped: every connection in this environment, with the principal who
63
+ * authorized it, its actor kind, its purpose (#721) and its granted scopes. The principal is the email the
64
+ * connection records and nothing else; no audit row's actor is copied in.
65
+ */
66
+ export declare function deriveManagementAccess(connections: readonly ConnectionRecord[] | null): Derived;
67
+ /** What secrets' rotation status was on this call: its health report and the keys that declare it, or absent. */
68
+ export type SecretsRotationInput = {
69
+ state: "not-composed";
70
+ } | {
71
+ state: "composed";
72
+ keys: readonly HealthSummaryKey[];
73
+ report: CapabilityHealthReport;
74
+ };
75
+ /** What the key-rotation control reads. */
76
+ export interface KeyRotationInput {
77
+ connections: readonly ConnectionRecord[] | null;
78
+ now: Date;
79
+ secrets: SecretsRotationInput;
80
+ retirement: RetirementVerdict;
81
+ }
82
+ /**
83
+ * Keys and secrets rotate: each connection's live keys and the age of the oldest, secrets' declared cadence and
84
+ * what is past it, and the field key's retirement guard (#390). Ages are facts and never graded here: the seam
85
+ * declares no cadence for control-plane keys, and inventing one would be the pack's opinion.
86
+ */
87
+ export declare function deriveKeyRotation(input: KeyRotationInput): Derived;
88
+ /** What the change-history control reads. */
89
+ export interface ChangeHistoryInput {
90
+ /** Whether this connection holds `migrations:read`, the scope the seam keeps migration state behind. */
91
+ granted: boolean;
92
+ /** Each bound database's ledger, read only when granted. */
93
+ databases: readonly MigrationDatabaseView[];
94
+ }
95
+ /**
96
+ * Change history per environment: each bound database's applied migrations, the last group and when it applied
97
+ * (#729). Behind `migrations:read`, as the same numbers are on the manifest, so the pack never widens it.
98
+ */
99
+ export declare function deriveChangeHistory(input: ChangeHistoryInput): Derived;
100
+ /** What the data-protection control reads. */
101
+ export interface DataProtectionInput {
102
+ /** The privacy inventory of every stored schema, or null where the walk could not run. */
103
+ inventory: PrivacyInventory | null;
104
+ /** What the last `pithy deploy` attested the project declares, or null where none reached this Worker. */
105
+ attestation: PrivacyAttestation | null;
106
+ }
107
+ /**
108
+ * Data classified and encrypted at rest: the classes the stored schemas hold (#132) beside the classes the
109
+ * project declared, and the fields marked `encrypted()` (#390). Classes and counts only, never a field's name:
110
+ * those are `GET /privacy`'s, behind their own scope.
111
+ */
112
+ export declare function deriveDataProtection(input: DataProtectionInput): Derived;
113
+ /** What the CSRF control reads. */
114
+ export interface CsrfInput {
115
+ operations: readonly DescribedOperation[] | undefined;
116
+ /** Whether a composed capability published a same-origin policy on this request. */
117
+ sameOriginPublished: boolean;
118
+ }
119
+ /**
120
+ * CSRF wherever cookie mode is: the routes that accept a session cookie, and whether a composed capability
121
+ * publishes the same-origin policy `requireSameOrigin()` enforces. No route taking a cookie needs none.
122
+ */
123
+ export declare function deriveCsrf(input: CsrfInput): Derived;
124
+ //# sourceMappingURL=derive.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"derive.d.ts","sourceRoot":"","sources":["../../../src/controlPlane/evidence/derive.ts"],"names":[],"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