@kenkaiiii/gg-engine 0.0.0-stage → 7.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 (850) hide show
  1. package/LICENSE +661 -0
  2. package/NOTICE +43 -0
  3. package/README.md +53 -2
  4. package/assets/skills/bulletproof/SKILL.md +132 -0
  5. package/assets/skills/bulletproof/references/agent-surface.md +113 -0
  6. package/assets/skills/bulletproof/references/attack-classes.md +226 -0
  7. package/assets/skills/bulletproof/references/audit-protocol.md +232 -0
  8. package/assets/skills/bulletproof/references/platform-playbooks.md +196 -0
  9. package/assets/skills/bulletproof/references/provenance.md +146 -0
  10. package/assets/skills/bulletproof/references/secure-defaults.md +137 -0
  11. package/assets/skills/bulletproof/references/supply-chain.md +84 -0
  12. package/assets/skills/bulletproof/references/threat-landscape.md +66 -0
  13. package/assets/skills/bulletproof/references/verification.md +74 -0
  14. package/assets/skills/compliance-guard/SKILL.md +115 -0
  15. package/assets/skills/compliance-guard/references/artifacts.md +199 -0
  16. package/assets/skills/compliance-guard/references/eu-uk.md +162 -0
  17. package/assets/skills/compliance-guard/references/exposure-triage.md +177 -0
  18. package/assets/skills/compliance-guard/references/full-review.md +155 -0
  19. package/assets/skills/compliance-guard/references/lawsuit-vectors.md +153 -0
  20. package/assets/skills/compliance-guard/references/provenance.md +135 -0
  21. package/assets/skills/compliance-guard/references/sector-gates.md +187 -0
  22. package/assets/skills/compliance-guard/references/security-baseline.md +117 -0
  23. package/assets/skills/compliance-guard/references/trigger-map.md +177 -0
  24. package/assets/skills/compliance-guard/references/us.md +194 -0
  25. package/assets/skills/durable/SKILL.md +114 -0
  26. package/assets/skills/durable/references/agent-db-safety.md +76 -0
  27. package/assets/skills/durable/references/backups-and-runtime.md +93 -0
  28. package/assets/skills/durable/references/migrations-and-schema.md +87 -0
  29. package/assets/skills/gg-guide/SKILL.md +43 -0
  30. package/assets/skills/gg-guide/references/chat-motion-goals.md +217 -0
  31. package/assets/skills/gg-guide/references/checklist-and-safety.md +177 -0
  32. package/assets/skills/gg-guide/references/code-mode.md +269 -0
  33. package/assets/skills/gg-guide/references/getting-started.md +290 -0
  34. package/assets/skills/gg-guide/references/ken-and-autopilot.md +172 -0
  35. package/assets/skills/gg-guide/references/mcp-and-skills.md +204 -0
  36. package/assets/skills/gg-guide/references/models-and-sign-in.md +200 -0
  37. package/assets/skills/gg-guide/references/sessions-and-history.md +213 -0
  38. package/assets/skills/gg-guide/references/settings.md +193 -0
  39. package/assets/skills/gg-guide/references/troubleshooting-and-data.md +186 -0
  40. package/assets/skills/lean/SKILL.md +117 -0
  41. package/assets/skills/lean/references/memory-and-processes.md +99 -0
  42. package/assets/skills/lean/references/playbooks.md +134 -0
  43. package/dist/app-error.d.ts +22 -0
  44. package/dist/app-error.js +41 -0
  45. package/dist/app-error.js.map +1 -0
  46. package/dist/config.d.ts +90 -0
  47. package/dist/config.js +240 -0
  48. package/dist/config.js.map +1 -0
  49. package/dist/core/acceptance-checks.d.ts +48 -0
  50. package/dist/core/acceptance-checks.js +151 -0
  51. package/dist/core/acceptance-checks.js.map +1 -0
  52. package/dist/core/action-threats.d.ts +68 -0
  53. package/dist/core/action-threats.js +894 -0
  54. package/dist/core/action-threats.js.map +1 -0
  55. package/dist/core/agent-notifications.d.ts +79 -0
  56. package/dist/core/agent-notifications.js +125 -0
  57. package/dist/core/agent-notifications.js.map +1 -0
  58. package/dist/core/agent-session/helpers.d.ts +26 -0
  59. package/dist/core/agent-session/helpers.js +47 -0
  60. package/dist/core/agent-session/helpers.js.map +1 -0
  61. package/dist/core/agent-session/mcp-tools.d.ts +87 -0
  62. package/dist/core/agent-session/mcp-tools.js +227 -0
  63. package/dist/core/agent-session/mcp-tools.js.map +1 -0
  64. package/dist/core/agent-session/run-loop-monitor.d.ts +63 -0
  65. package/dist/core/agent-session/run-loop-monitor.js +164 -0
  66. package/dist/core/agent-session/run-loop-monitor.js.map +1 -0
  67. package/dist/core/agent-session/transcript-markers.d.ts +57 -0
  68. package/dist/core/agent-session/transcript-markers.js +166 -0
  69. package/dist/core/agent-session/transcript-markers.js.map +1 -0
  70. package/dist/core/agent-session/verification-tracker.d.ts +71 -0
  71. package/dist/core/agent-session/verification-tracker.js +295 -0
  72. package/dist/core/agent-session/verification-tracker.js.map +1 -0
  73. package/dist/core/agent-session.d.ts +1401 -0
  74. package/dist/core/agent-session.js +5160 -0
  75. package/dist/core/agent-session.js.map +1 -0
  76. package/dist/core/agents.d.ts +63 -0
  77. package/dist/core/agents.js +160 -0
  78. package/dist/core/agents.js.map +1 -0
  79. package/dist/core/ask-user.d.ts +163 -0
  80. package/dist/core/ask-user.js +178 -0
  81. package/dist/core/ask-user.js.map +1 -0
  82. package/dist/core/auto-update.d.ts +32 -0
  83. package/dist/core/auto-update.js +218 -0
  84. package/dist/core/auto-update.js.map +1 -0
  85. package/dist/core/autopilot-cycle.d.ts +127 -0
  86. package/dist/core/autopilot-cycle.js +182 -0
  87. package/dist/core/autopilot-cycle.js.map +1 -0
  88. package/dist/core/autopilot-gate.d.ts +106 -0
  89. package/dist/core/autopilot-gate.js +192 -0
  90. package/dist/core/autopilot-gate.js.map +1 -0
  91. package/dist/core/autopilot-verdict.d.ts +55 -0
  92. package/dist/core/autopilot-verdict.js +226 -0
  93. package/dist/core/autopilot-verdict.js.map +1 -0
  94. package/dist/core/blocked-packages-file.d.ts +33 -0
  95. package/dist/core/blocked-packages-file.js +274 -0
  96. package/dist/core/blocked-packages-file.js.map +1 -0
  97. package/dist/core/bundled-agents.d.ts +2 -0
  98. package/dist/core/bundled-agents.js +253 -0
  99. package/dist/core/bundled-agents.js.map +1 -0
  100. package/dist/core/cache-diagnostics.d.ts +72 -0
  101. package/dist/core/cache-diagnostics.js +200 -0
  102. package/dist/core/cache-diagnostics.js.map +1 -0
  103. package/dist/core/cache-expiry.d.ts +89 -0
  104. package/dist/core/cache-expiry.js +117 -0
  105. package/dist/core/cache-expiry.js.map +1 -0
  106. package/dist/core/checklist-detection.d.ts +8 -0
  107. package/dist/core/checklist-detection.js +238 -0
  108. package/dist/core/checklist-detection.js.map +1 -0
  109. package/dist/core/checklist-git.d.ts +19 -0
  110. package/dist/core/checklist-git.js +54 -0
  111. package/dist/core/checklist-git.js.map +1 -0
  112. package/dist/core/checklist-items.d.ts +182 -0
  113. package/dist/core/checklist-items.js +228 -0
  114. package/dist/core/checklist-items.js.map +1 -0
  115. package/dist/core/checklist-prompt.d.ts +14 -0
  116. package/dist/core/checklist-prompt.js +64 -0
  117. package/dist/core/checklist-prompt.js.map +1 -0
  118. package/dist/core/checklist-snapshot.d.ts +7 -0
  119. package/dist/core/checklist-snapshot.js +46 -0
  120. package/dist/core/checklist-snapshot.js.map +1 -0
  121. package/dist/core/checklist-store.d.ts +45 -0
  122. package/dist/core/checklist-store.js +278 -0
  123. package/dist/core/checklist-store.js.map +1 -0
  124. package/dist/core/checkout-record.d.ts +22 -0
  125. package/dist/core/checkout-record.js +68 -0
  126. package/dist/core/checkout-record.js.map +1 -0
  127. package/dist/core/checkpoint-store.d.ts +109 -0
  128. package/dist/core/checkpoint-store.js +260 -0
  129. package/dist/core/checkpoint-store.js.map +1 -0
  130. package/dist/core/claude-code/complete.d.ts +35 -0
  131. package/dist/core/claude-code/complete.js +125 -0
  132. package/dist/core/claude-code/complete.js.map +1 -0
  133. package/dist/core/claude-code/events.d.ts +67 -0
  134. package/dist/core/claude-code/events.js +460 -0
  135. package/dist/core/claude-code/events.js.map +1 -0
  136. package/dist/core/claude-code/live-session.d.ts +94 -0
  137. package/dist/core/claude-code/live-session.js +525 -0
  138. package/dist/core/claude-code/live-session.js.map +1 -0
  139. package/dist/core/claude-code/loop.d.ts +9 -0
  140. package/dist/core/claude-code/loop.js +15 -0
  141. package/dist/core/claude-code/loop.js.map +1 -0
  142. package/dist/core/claude-code/session-sync.d.ts +28 -0
  143. package/dist/core/claude-code/session-sync.js +53 -0
  144. package/dist/core/claude-code/session-sync.js.map +1 -0
  145. package/dist/core/claude-code/tool-bridge.d.ts +49 -0
  146. package/dist/core/claude-code/tool-bridge.js +352 -0
  147. package/dist/core/claude-code/tool-bridge.js.map +1 -0
  148. package/dist/core/claude-code/transcripts.d.ts +39 -0
  149. package/dist/core/claude-code/transcripts.js +195 -0
  150. package/dist/core/claude-code/transcripts.js.map +1 -0
  151. package/dist/core/code-retrieval-chunkers.d.ts +26 -0
  152. package/dist/core/code-retrieval-chunkers.js +264 -0
  153. package/dist/core/code-retrieval-chunkers.js.map +1 -0
  154. package/dist/core/code-retrieval.d.ts +18 -0
  155. package/dist/core/code-retrieval.js +124 -0
  156. package/dist/core/code-retrieval.js.map +1 -0
  157. package/dist/core/codex-request-shape.d.ts +7 -0
  158. package/dist/core/codex-request-shape.js +19 -0
  159. package/dist/core/codex-request-shape.js.map +1 -0
  160. package/dist/core/compaction/active-context.d.ts +16 -0
  161. package/dist/core/compaction/active-context.js +20 -0
  162. package/dist/core/compaction/active-context.js.map +1 -0
  163. package/dist/core/compaction/compactor.d.ts +281 -0
  164. package/dist/core/compaction/compactor.js +1451 -0
  165. package/dist/core/compaction/compactor.js.map +1 -0
  166. package/dist/core/compaction/plan-step-policy.d.ts +46 -0
  167. package/dist/core/compaction/plan-step-policy.js +57 -0
  168. package/dist/core/compaction/plan-step-policy.js.map +1 -0
  169. package/dist/core/compaction/policy.d.ts +36 -0
  170. package/dist/core/compaction/policy.js +144 -0
  171. package/dist/core/compaction/policy.js.map +1 -0
  172. package/dist/core/compaction/query-aware-selector.d.ts +32 -0
  173. package/dist/core/compaction/query-aware-selector.js +202 -0
  174. package/dist/core/compaction/query-aware-selector.js.map +1 -0
  175. package/dist/core/compaction/token-estimator.d.ts +36 -0
  176. package/dist/core/compaction/token-estimator.js +180 -0
  177. package/dist/core/compaction/token-estimator.js.map +1 -0
  178. package/dist/core/compaction/tool-result-pruner.d.ts +90 -0
  179. package/dist/core/compaction/tool-result-pruner.js +238 -0
  180. package/dist/core/compaction/tool-result-pruner.js.map +1 -0
  181. package/dist/core/completion-review.d.ts +24 -0
  182. package/dist/core/completion-review.js +2 -0
  183. package/dist/core/completion-review.js.map +1 -0
  184. package/dist/core/context-files.d.ts +8 -0
  185. package/dist/core/context-files.js +46 -0
  186. package/dist/core/context-files.js.map +1 -0
  187. package/dist/core/context-limits.d.ts +40 -0
  188. package/dist/core/context-limits.js +43 -0
  189. package/dist/core/context-limits.js.map +1 -0
  190. package/dist/core/custom-commands.d.ts +18 -0
  191. package/dist/core/custom-commands.js +57 -0
  192. package/dist/core/custom-commands.js.map +1 -0
  193. package/dist/core/destructive-git-guard.d.ts +113 -0
  194. package/dist/core/destructive-git-guard.js +874 -0
  195. package/dist/core/destructive-git-guard.js.map +1 -0
  196. package/dist/core/display-items.d.ts +8 -0
  197. package/dist/core/display-items.js +2 -0
  198. package/dist/core/display-items.js.map +1 -0
  199. package/dist/core/encode-cwd.d.ts +41 -0
  200. package/dist/core/encode-cwd.js +53 -0
  201. package/dist/core/encode-cwd.js.map +1 -0
  202. package/dist/core/env-delta.d.ts +34 -0
  203. package/dist/core/env-delta.js +84 -0
  204. package/dist/core/env-delta.js.map +1 -0
  205. package/dist/core/event-bus.d.ts +178 -0
  206. package/dist/core/event-bus.js +171 -0
  207. package/dist/core/event-bus.js.map +1 -0
  208. package/dist/core/extensions/loader.d.ts +7 -0
  209. package/dist/core/extensions/loader.js +68 -0
  210. package/dist/core/extensions/loader.js.map +1 -0
  211. package/dist/core/extensions/plugin-bundles.d.ts +13 -0
  212. package/dist/core/extensions/plugin-bundles.js +45 -0
  213. package/dist/core/extensions/plugin-bundles.js.map +1 -0
  214. package/dist/core/extensions/types.d.ts +18 -0
  215. package/dist/core/extensions/types.js +2 -0
  216. package/dist/core/extensions/types.js.map +1 -0
  217. package/dist/core/foreign-session-import.d.ts +119 -0
  218. package/dist/core/foreign-session-import.js +598 -0
  219. package/dist/core/foreign-session-import.js.map +1 -0
  220. package/dist/core/foreign-transcript-blocks.d.ts +50 -0
  221. package/dist/core/foreign-transcript-blocks.js +151 -0
  222. package/dist/core/foreign-transcript-blocks.js.map +1 -0
  223. package/dist/core/frontmatter.d.ts +22 -0
  224. package/dist/core/frontmatter.js +90 -0
  225. package/dist/core/frontmatter.js.map +1 -0
  226. package/dist/core/goal-run-marker.d.ts +32 -0
  227. package/dist/core/goal-run-marker.js +178 -0
  228. package/dist/core/goal-run-marker.js.map +1 -0
  229. package/dist/core/goal-summary.d.ts +15 -0
  230. package/dist/core/goal-summary.js +110 -0
  231. package/dist/core/goal-summary.js.map +1 -0
  232. package/dist/core/goals-store.d.ts +208 -0
  233. package/dist/core/goals-store.js +577 -0
  234. package/dist/core/goals-store.js.map +1 -0
  235. package/dist/core/hashline.d.ts +51 -0
  236. package/dist/core/hashline.js +76 -0
  237. package/dist/core/hashline.js.map +1 -0
  238. package/dist/core/idle-wake.d.ts +62 -0
  239. package/dist/core/idle-wake.js +103 -0
  240. package/dist/core/idle-wake.js.map +1 -0
  241. package/dist/core/index.d.ts +15 -0
  242. package/dist/core/index.js +15 -0
  243. package/dist/core/index.js.map +1 -0
  244. package/dist/core/injection-detect.d.ts +39 -0
  245. package/dist/core/injection-detect.js +241 -0
  246. package/dist/core/injection-detect.js.map +1 -0
  247. package/dist/core/installed-threats.d.ts +23 -0
  248. package/dist/core/installed-threats.js +71 -0
  249. package/dist/core/installed-threats.js.map +1 -0
  250. package/dist/core/internal-diagnostics.d.ts +159 -0
  251. package/dist/core/internal-diagnostics.js +495 -0
  252. package/dist/core/internal-diagnostics.js.map +1 -0
  253. package/dist/core/keep-awake.d.ts +88 -0
  254. package/dist/core/keep-awake.js +251 -0
  255. package/dist/core/keep-awake.js.map +1 -0
  256. package/dist/core/ken-ask-answer.d.ts +24 -0
  257. package/dist/core/ken-ask-answer.js +96 -0
  258. package/dist/core/ken-ask-answer.js.map +1 -0
  259. package/dist/core/ken-context.d.ts +119 -0
  260. package/dist/core/ken-context.js +447 -0
  261. package/dist/core/ken-context.js.map +1 -0
  262. package/dist/core/ken-model.d.ts +45 -0
  263. package/dist/core/ken-model.js +26 -0
  264. package/dist/core/ken-model.js.map +1 -0
  265. package/dist/core/ken-prompt.d.ts +21 -0
  266. package/dist/core/ken-prompt.js +370 -0
  267. package/dist/core/ken-prompt.js.map +1 -0
  268. package/dist/core/language-detector.d.ts +41 -0
  269. package/dist/core/language-detector.js +293 -0
  270. package/dist/core/language-detector.js.map +1 -0
  271. package/dist/core/live-preview.d.ts +26 -0
  272. package/dist/core/live-preview.js +80 -0
  273. package/dist/core/live-preview.js.map +1 -0
  274. package/dist/core/local-endpoint-store.d.ts +53 -0
  275. package/dist/core/local-endpoint-store.js +221 -0
  276. package/dist/core/local-endpoint-store.js.map +1 -0
  277. package/dist/core/logger.d.ts +21 -0
  278. package/dist/core/logger.js +94 -0
  279. package/dist/core/logger.js.map +1 -0
  280. package/dist/core/loop-breaker.d.ts +89 -0
  281. package/dist/core/loop-breaker.js +204 -0
  282. package/dist/core/loop-breaker.js.map +1 -0
  283. package/dist/core/lsp/client.d.ts +206 -0
  284. package/dist/core/lsp/client.js +685 -0
  285. package/dist/core/lsp/client.js.map +1 -0
  286. package/dist/core/lsp/edit-telemetry.d.ts +26 -0
  287. package/dist/core/lsp/edit-telemetry.js +52 -0
  288. package/dist/core/lsp/edit-telemetry.js.map +1 -0
  289. package/dist/core/lsp/format.d.ts +11 -0
  290. package/dist/core/lsp/format.js +30 -0
  291. package/dist/core/lsp/format.js.map +1 -0
  292. package/dist/core/lsp/jsonrpc.d.ts +68 -0
  293. package/dist/core/lsp/jsonrpc.js +153 -0
  294. package/dist/core/lsp/jsonrpc.js.map +1 -0
  295. package/dist/core/lsp/manager.d.ts +188 -0
  296. package/dist/core/lsp/manager.js +576 -0
  297. package/dist/core/lsp/manager.js.map +1 -0
  298. package/dist/core/lsp/pool.d.ts +114 -0
  299. package/dist/core/lsp/pool.js +259 -0
  300. package/dist/core/lsp/pool.js.map +1 -0
  301. package/dist/core/lsp/project-root.d.ts +9 -0
  302. package/dist/core/lsp/project-root.js +75 -0
  303. package/dist/core/lsp/project-root.js.map +1 -0
  304. package/dist/core/lsp/reference-project.d.ts +6 -0
  305. package/dist/core/lsp/reference-project.js +110 -0
  306. package/dist/core/lsp/reference-project.js.map +1 -0
  307. package/dist/core/lsp/servers.d.ts +44 -0
  308. package/dist/core/lsp/servers.js +289 -0
  309. package/dist/core/lsp/servers.js.map +1 -0
  310. package/dist/core/lsp/test-support.d.ts +17 -0
  311. package/dist/core/lsp/test-support.js +27 -0
  312. package/dist/core/lsp/test-support.js.map +1 -0
  313. package/dist/core/mcp/catalog-cache.d.ts +64 -0
  314. package/dist/core/mcp/catalog-cache.js +166 -0
  315. package/dist/core/mcp/catalog-cache.js.map +1 -0
  316. package/dist/core/mcp/client.d.ts +317 -0
  317. package/dist/core/mcp/client.js +1168 -0
  318. package/dist/core/mcp/client.js.map +1 -0
  319. package/dist/core/mcp/content.d.ts +23 -0
  320. package/dist/core/mcp/content.js +194 -0
  321. package/dist/core/mcp/content.js.map +1 -0
  322. package/dist/core/mcp/defaults.d.ts +26 -0
  323. package/dist/core/mcp/defaults.js +81 -0
  324. package/dist/core/mcp/defaults.js.map +1 -0
  325. package/dist/core/mcp/deferred-catalog.d.ts +53 -0
  326. package/dist/core/mcp/deferred-catalog.js +117 -0
  327. package/dist/core/mcp/deferred-catalog.js.map +1 -0
  328. package/dist/core/mcp/elicitation-bridge.d.ts +40 -0
  329. package/dist/core/mcp/elicitation-bridge.js +36 -0
  330. package/dist/core/mcp/elicitation-bridge.js.map +1 -0
  331. package/dist/core/mcp/index.d.ts +16 -0
  332. package/dist/core/mcp/index.js +10 -0
  333. package/dist/core/mcp/index.js.map +1 -0
  334. package/dist/core/mcp/loopback.d.ts +26 -0
  335. package/dist/core/mcp/loopback.js +66 -0
  336. package/dist/core/mcp/loopback.js.map +1 -0
  337. package/dist/core/mcp/oauth-provider.d.ts +55 -0
  338. package/dist/core/mcp/oauth-provider.js +106 -0
  339. package/dist/core/mcp/oauth-provider.js.map +1 -0
  340. package/dist/core/mcp/oauth-store.d.ts +44 -0
  341. package/dist/core/mcp/oauth-store.js +76 -0
  342. package/dist/core/mcp/oauth-store.js.map +1 -0
  343. package/dist/core/mcp/parse-add-command.d.ts +50 -0
  344. package/dist/core/mcp/parse-add-command.js +391 -0
  345. package/dist/core/mcp/parse-add-command.js.map +1 -0
  346. package/dist/core/mcp/resolve-stdio.d.ts +77 -0
  347. package/dist/core/mcp/resolve-stdio.js +359 -0
  348. package/dist/core/mcp/resolve-stdio.js.map +1 -0
  349. package/dist/core/mcp/shared-pool.d.ts +157 -0
  350. package/dist/core/mcp/shared-pool.js +236 -0
  351. package/dist/core/mcp/shared-pool.js.map +1 -0
  352. package/dist/core/mcp/store.d.ts +100 -0
  353. package/dist/core/mcp/store.js +202 -0
  354. package/dist/core/mcp/store.js.map +1 -0
  355. package/dist/core/mcp/tool-guard.d.ts +58 -0
  356. package/dist/core/mcp/tool-guard.js +215 -0
  357. package/dist/core/mcp/tool-guard.js.map +1 -0
  358. package/dist/core/mcp/types.d.ts +57 -0
  359. package/dist/core/mcp/types.js +2 -0
  360. package/dist/core/mcp/types.js.map +1 -0
  361. package/dist/core/message-images.d.ts +11 -0
  362. package/dist/core/message-images.js +52 -0
  363. package/dist/core/message-images.js.map +1 -0
  364. package/dist/core/model-unavailable.d.ts +14 -0
  365. package/dist/core/model-unavailable.js +23 -0
  366. package/dist/core/model-unavailable.js.map +1 -0
  367. package/dist/core/network-guard.d.ts +28 -0
  368. package/dist/core/network-guard.js +251 -0
  369. package/dist/core/network-guard.js.map +1 -0
  370. package/dist/core/node-debugger.d.ts +148 -0
  371. package/dist/core/node-debugger.js +642 -0
  372. package/dist/core/node-debugger.js.map +1 -0
  373. package/dist/core/opencode-catalog-store.d.ts +20 -0
  374. package/dist/core/opencode-catalog-store.js +82 -0
  375. package/dist/core/opencode-catalog-store.js.map +1 -0
  376. package/dist/core/openrouter-catalog-store.d.ts +24 -0
  377. package/dist/core/openrouter-catalog-store.js +140 -0
  378. package/dist/core/openrouter-catalog-store.js.map +1 -0
  379. package/dist/core/package-cooldown.d.ts +69 -0
  380. package/dist/core/package-cooldown.js +297 -0
  381. package/dist/core/package-cooldown.js.map +1 -0
  382. package/dist/core/package-threats.d.ts +92 -0
  383. package/dist/core/package-threats.js +1339 -0
  384. package/dist/core/package-threats.js.map +1 -0
  385. package/dist/core/parked-requests.d.ts +43 -0
  386. package/dist/core/parked-requests.js +34 -0
  387. package/dist/core/parked-requests.js.map +1 -0
  388. package/dist/core/persistent-shell.d.ts +81 -0
  389. package/dist/core/persistent-shell.js +452 -0
  390. package/dist/core/persistent-shell.js.map +1 -0
  391. package/dist/core/plan-delta.d.ts +23 -0
  392. package/dist/core/plan-delta.js +36 -0
  393. package/dist/core/plan-delta.js.map +1 -0
  394. package/dist/core/plan-handoff.d.ts +38 -0
  395. package/dist/core/plan-handoff.js +21 -0
  396. package/dist/core/plan-handoff.js.map +1 -0
  397. package/dist/core/plan-submission-gate.d.ts +28 -0
  398. package/dist/core/plan-submission-gate.js +27 -0
  399. package/dist/core/plan-submission-gate.js.map +1 -0
  400. package/dist/core/platform-clis.d.ts +15 -0
  401. package/dist/core/platform-clis.js +299 -0
  402. package/dist/core/platform-clis.js.map +1 -0
  403. package/dist/core/process-gate.d.ts +61 -0
  404. package/dist/core/process-gate.js +103 -0
  405. package/dist/core/process-gate.js.map +1 -0
  406. package/dist/core/process-manager.d.ts +242 -0
  407. package/dist/core/process-manager.js +902 -0
  408. package/dist/core/process-manager.js.map +1 -0
  409. package/dist/core/progress/engine.d.ts +22 -0
  410. package/dist/core/progress/engine.js +131 -0
  411. package/dist/core/progress/engine.js.map +1 -0
  412. package/dist/core/progress/git-xp.d.ts +15 -0
  413. package/dist/core/progress/git-xp.js +100 -0
  414. package/dist/core/progress/git-xp.js.map +1 -0
  415. package/dist/core/progress/ranks.d.ts +31 -0
  416. package/dist/core/progress/ranks.js +310 -0
  417. package/dist/core/progress/ranks.js.map +1 -0
  418. package/dist/core/progress/rebuild.d.ts +8 -0
  419. package/dist/core/progress/rebuild.js +125 -0
  420. package/dist/core/progress/rebuild.js.map +1 -0
  421. package/dist/core/progress/store.d.ts +34 -0
  422. package/dist/core/progress/store.js +200 -0
  423. package/dist/core/progress/store.js.map +1 -0
  424. package/dist/core/progress/types.d.ts +56 -0
  425. package/dist/core/progress/types.js +2 -0
  426. package/dist/core/progress/types.js.map +1 -0
  427. package/dist/core/project-discovery.d.ts +64 -0
  428. package/dist/core/project-discovery.js +908 -0
  429. package/dist/core/project-discovery.js.map +1 -0
  430. package/dist/core/project-files.d.ts +15 -0
  431. package/dist/core/project-files.js +37 -0
  432. package/dist/core/project-files.js.map +1 -0
  433. package/dist/core/project-health-scan.d.ts +109 -0
  434. package/dist/core/project-health-scan.js +673 -0
  435. package/dist/core/project-health-scan.js.map +1 -0
  436. package/dist/core/project-health-score.d.ts +41 -0
  437. package/dist/core/project-health-score.js +257 -0
  438. package/dist/core/project-health-score.js.map +1 -0
  439. package/dist/core/prompt-command-expansion.d.ts +13 -0
  440. package/dist/core/prompt-command-expansion.js +48 -0
  441. package/dist/core/prompt-command-expansion.js.map +1 -0
  442. package/dist/core/prompt-commands.d.ts +13 -0
  443. package/dist/core/prompt-commands.js +370 -0
  444. package/dist/core/prompt-commands.js.map +1 -0
  445. package/dist/core/radio-players.d.ts +28 -0
  446. package/dist/core/radio-players.js +132 -0
  447. package/dist/core/radio-players.js.map +1 -0
  448. package/dist/core/radio.d.ts +42 -0
  449. package/dist/core/radio.js +499 -0
  450. package/dist/core/radio.js.map +1 -0
  451. package/dist/core/regrounding.d.ts +37 -0
  452. package/dist/core/regrounding.js +89 -0
  453. package/dist/core/regrounding.js.map +1 -0
  454. package/dist/core/resolve-start.d.ts +28 -0
  455. package/dist/core/resolve-start.js +35 -0
  456. package/dist/core/resolve-start.js.map +1 -0
  457. package/dist/core/run-claim.d.ts +36 -0
  458. package/dist/core/run-claim.js +46 -0
  459. package/dist/core/run-claim.js.map +1 -0
  460. package/dist/core/run-lifecycle.d.ts +58 -0
  461. package/dist/core/run-lifecycle.js +104 -0
  462. package/dist/core/run-lifecycle.js.map +1 -0
  463. package/dist/core/run-status.d.ts +17 -0
  464. package/dist/core/run-status.js +28 -0
  465. package/dist/core/run-status.js.map +1 -0
  466. package/dist/core/runtime-mode.d.ts +21 -0
  467. package/dist/core/runtime-mode.js +43 -0
  468. package/dist/core/runtime-mode.js.map +1 -0
  469. package/dist/core/sandbox-domains.d.ts +13 -0
  470. package/dist/core/sandbox-domains.js +76 -0
  471. package/dist/core/sandbox-domains.js.map +1 -0
  472. package/dist/core/sandbox-feedback.d.ts +21 -0
  473. package/dist/core/sandbox-feedback.js +69 -0
  474. package/dist/core/sandbox-feedback.js.map +1 -0
  475. package/dist/core/sandbox.d.ts +106 -0
  476. package/dist/core/sandbox.js +383 -0
  477. package/dist/core/sandbox.js.map +1 -0
  478. package/dist/core/semantic-loop-check.d.ts +58 -0
  479. package/dist/core/semantic-loop-check.js +103 -0
  480. package/dist/core/semantic-loop-check.js.map +1 -0
  481. package/dist/core/session-compaction.d.ts +23 -0
  482. package/dist/core/session-compaction.js +54 -0
  483. package/dist/core/session-compaction.js.map +1 -0
  484. package/dist/core/session-export.d.ts +97 -0
  485. package/dist/core/session-export.js +368 -0
  486. package/dist/core/session-export.js.map +1 -0
  487. package/dist/core/session-history.d.ts +160 -0
  488. package/dist/core/session-history.js +467 -0
  489. package/dist/core/session-history.js.map +1 -0
  490. package/dist/core/session-manager.d.ts +510 -0
  491. package/dist/core/session-manager.js +1368 -0
  492. package/dist/core/session-manager.js.map +1 -0
  493. package/dist/core/session-preview.d.ts +12 -0
  494. package/dist/core/session-preview.js +58 -0
  495. package/dist/core/session-preview.js.map +1 -0
  496. package/dist/core/session-storage.d.ts +78 -0
  497. package/dist/core/session-storage.js +659 -0
  498. package/dist/core/session-storage.js.map +1 -0
  499. package/dist/core/session-summary-index.d.ts +51 -0
  500. package/dist/core/session-summary-index.js +192 -0
  501. package/dist/core/session-summary-index.js.map +1 -0
  502. package/dist/core/settings-manager.d.ts +113 -0
  503. package/dist/core/settings-manager.js +281 -0
  504. package/dist/core/settings-manager.js.map +1 -0
  505. package/dist/core/shared-checkout-guard.d.ts +78 -0
  506. package/dist/core/shared-checkout-guard.js +219 -0
  507. package/dist/core/shared-checkout-guard.js.map +1 -0
  508. package/dist/core/shell-path.d.ts +13 -0
  509. package/dist/core/shell-path.js +175 -0
  510. package/dist/core/shell-path.js.map +1 -0
  511. package/dist/core/shell-threats-popular-packages.d.ts +11 -0
  512. package/dist/core/shell-threats-popular-packages.js +675 -0
  513. package/dist/core/shell-threats-popular-packages.js.map +1 -0
  514. package/dist/core/shell-threats.d.ts +21 -0
  515. package/dist/core/shell-threats.js +235 -0
  516. package/dist/core/shell-threats.js.map +1 -0
  517. package/dist/core/shell.d.ts +54 -0
  518. package/dist/core/shell.js +99 -0
  519. package/dist/core/shell.js.map +1 -0
  520. package/dist/core/shutdown.d.ts +70 -0
  521. package/dist/core/shutdown.js +144 -0
  522. package/dist/core/shutdown.js.map +1 -0
  523. package/dist/core/skill-scan.d.ts +112 -0
  524. package/dist/core/skill-scan.js +781 -0
  525. package/dist/core/skill-scan.js.map +1 -0
  526. package/dist/core/skills.d.ts +80 -0
  527. package/dist/core/skills.js +270 -0
  528. package/dist/core/skills.js.map +1 -0
  529. package/dist/core/slash-commands.d.ts +58 -0
  530. package/dist/core/slash-commands.js +242 -0
  531. package/dist/core/slash-commands.js.map +1 -0
  532. package/dist/core/steering.d.ts +47 -0
  533. package/dist/core/steering.js +65 -0
  534. package/dist/core/steering.js.map +1 -0
  535. package/dist/core/steroids.d.ts +66 -0
  536. package/dist/core/steroids.js +243 -0
  537. package/dist/core/steroids.js.map +1 -0
  538. package/dist/core/stream-diag-level.d.ts +3 -0
  539. package/dist/core/stream-diag-level.js +24 -0
  540. package/dist/core/stream-diag-level.js.map +1 -0
  541. package/dist/core/stream-rules.d.ts +30 -0
  542. package/dist/core/stream-rules.js +151 -0
  543. package/dist/core/stream-rules.js.map +1 -0
  544. package/dist/core/subagent-manager.d.ts +239 -0
  545. package/dist/core/subagent-manager.js +1059 -0
  546. package/dist/core/subagent-manager.js.map +1 -0
  547. package/dist/core/subagent-policy.d.ts +9 -0
  548. package/dist/core/subagent-policy.js +41 -0
  549. package/dist/core/subagent-policy.js.map +1 -0
  550. package/dist/core/subagent-receipt.d.ts +54 -0
  551. package/dist/core/subagent-receipt.js +274 -0
  552. package/dist/core/subagent-receipt.js.map +1 -0
  553. package/dist/core/subagent-store.d.ts +41 -0
  554. package/dist/core/subagent-store.js +284 -0
  555. package/dist/core/subagent-store.js.map +1 -0
  556. package/dist/core/subagent-turn-record.d.ts +18 -0
  557. package/dist/core/subagent-turn-record.js +82 -0
  558. package/dist/core/subagent-turn-record.js.map +1 -0
  559. package/dist/core/tasks-store.d.ts +31 -0
  560. package/dist/core/tasks-store.js +97 -0
  561. package/dist/core/tasks-store.js.map +1 -0
  562. package/dist/core/telegram-config.d.ts +20 -0
  563. package/dist/core/telegram-config.js +52 -0
  564. package/dist/core/telegram-config.js.map +1 -0
  565. package/dist/core/telegram.d.ts +114 -0
  566. package/dist/core/telegram.js +275 -0
  567. package/dist/core/telegram.js.map +1 -0
  568. package/dist/core/temp-paths.d.ts +5 -0
  569. package/dist/core/temp-paths.js +50 -0
  570. package/dist/core/temp-paths.js.map +1 -0
  571. package/dist/core/test-impact.d.ts +73 -0
  572. package/dist/core/test-impact.js +467 -0
  573. package/dist/core/test-impact.js.map +1 -0
  574. package/dist/core/threat-feed.d.ts +65 -0
  575. package/dist/core/threat-feed.js +334 -0
  576. package/dist/core/threat-feed.js.map +1 -0
  577. package/dist/core/trophies/catalog-more.d.ts +2 -0
  578. package/dist/core/trophies/catalog-more.js +837 -0
  579. package/dist/core/trophies/catalog-more.js.map +1 -0
  580. package/dist/core/trophies/catalog.d.ts +4 -0
  581. package/dist/core/trophies/catalog.js +649 -0
  582. package/dist/core/trophies/catalog.js.map +1 -0
  583. package/dist/core/trophies/engine.d.ts +70 -0
  584. package/dist/core/trophies/engine.js +347 -0
  585. package/dist/core/trophies/engine.js.map +1 -0
  586. package/dist/core/trophies/store.d.ts +17 -0
  587. package/dist/core/trophies/store.js +113 -0
  588. package/dist/core/trophies/store.js.map +1 -0
  589. package/dist/core/trophies/types.d.ts +87 -0
  590. package/dist/core/trophies/types.js +74 -0
  591. package/dist/core/trophies/types.js.map +1 -0
  592. package/dist/core/ui-adoption.d.ts +32 -0
  593. package/dist/core/ui-adoption.js +302 -0
  594. package/dist/core/ui-adoption.js.map +1 -0
  595. package/dist/core/ui-compatibility.d.ts +10 -0
  596. package/dist/core/ui-compatibility.js +51 -0
  597. package/dist/core/ui-compatibility.js.map +1 -0
  598. package/dist/core/ui-registry.d.ts +101 -0
  599. package/dist/core/ui-registry.js +292 -0
  600. package/dist/core/ui-registry.js.map +1 -0
  601. package/dist/core/user-shell-context.d.ts +8 -0
  602. package/dist/core/user-shell-context.js +12 -0
  603. package/dist/core/user-shell-context.js.map +1 -0
  604. package/dist/core/verification-evidence.d.ts +49 -0
  605. package/dist/core/verification-evidence.js +816 -0
  606. package/dist/core/verification-evidence.js.map +1 -0
  607. package/dist/core/verification-gate.d.ts +77 -0
  608. package/dist/core/verification-gate.js +504 -0
  609. package/dist/core/verification-gate.js.map +1 -0
  610. package/dist/core/verification-snapshot.d.ts +7 -0
  611. package/dist/core/verification-snapshot.js +109 -0
  612. package/dist/core/verification-snapshot.js.map +1 -0
  613. package/dist/core/verify-commands.d.ts +34 -0
  614. package/dist/core/verify-commands.js +203 -0
  615. package/dist/core/verify-commands.js.map +1 -0
  616. package/dist/core/voice-transcriber.d.ts +32 -0
  617. package/dist/core/voice-transcriber.js +114 -0
  618. package/dist/core/voice-transcriber.js.map +1 -0
  619. package/dist/core/workspace-guard.d.ts +56 -0
  620. package/dist/core/workspace-guard.js +334 -0
  621. package/dist/core/workspace-guard.js.map +1 -0
  622. package/dist/index.d.ts +15 -0
  623. package/dist/index.js +21 -0
  624. package/dist/index.js.map +1 -0
  625. package/dist/session.d.ts +44 -0
  626. package/dist/session.js +105 -0
  627. package/dist/session.js.map +1 -0
  628. package/dist/system-prompt.d.ts +104 -0
  629. package/dist/system-prompt.js +480 -0
  630. package/dist/system-prompt.js.map +1 -0
  631. package/dist/test-support/fake-home.d.ts +19 -0
  632. package/dist/test-support/fake-home.js +37 -0
  633. package/dist/test-support/fake-home.js.map +1 -0
  634. package/dist/test-support/keep-alive.d.ts +14 -0
  635. package/dist/test-support/keep-alive.js +17 -0
  636. package/dist/test-support/keep-alive.js.map +1 -0
  637. package/dist/test-support/slow-git.d.ts +1 -0
  638. package/dist/test-support/slow-git.js +21 -0
  639. package/dist/test-support/slow-git.js.map +1 -0
  640. package/dist/test-support/system-tools.d.ts +6 -0
  641. package/dist/test-support/system-tools.js +36 -0
  642. package/dist/test-support/system-tools.js.map +1 -0
  643. package/dist/tools/ask-user.d.ts +34 -0
  644. package/dist/tools/ask-user.js +99 -0
  645. package/dist/tools/ask-user.js.map +1 -0
  646. package/dist/tools/background-watch-lint.d.ts +18 -0
  647. package/dist/tools/background-watch-lint.js +102 -0
  648. package/dist/tools/background-watch-lint.js.map +1 -0
  649. package/dist/tools/bash-read-evidence.d.ts +23 -0
  650. package/dist/tools/bash-read-evidence.js +180 -0
  651. package/dist/tools/bash-read-evidence.js.map +1 -0
  652. package/dist/tools/bash.d.ts +64 -0
  653. package/dist/tools/bash.js +552 -0
  654. package/dist/tools/bash.js.map +1 -0
  655. package/dist/tools/browser-api.d.ts +27 -0
  656. package/dist/tools/browser-api.js +449 -0
  657. package/dist/tools/browser-api.js.map +1 -0
  658. package/dist/tools/browser-sandbox.d.ts +16 -0
  659. package/dist/tools/browser-sandbox.js +158 -0
  660. package/dist/tools/browser-sandbox.js.map +1 -0
  661. package/dist/tools/browser-session.d.ts +84 -0
  662. package/dist/tools/browser-session.js +304 -0
  663. package/dist/tools/browser-session.js.map +1 -0
  664. package/dist/tools/browser-snapshot.d.ts +19 -0
  665. package/dist/tools/browser-snapshot.js +109 -0
  666. package/dist/tools/browser-snapshot.js.map +1 -0
  667. package/dist/tools/browser.d.ts +11 -0
  668. package/dist/tools/browser.js +106 -0
  669. package/dist/tools/browser.js.map +1 -0
  670. package/dist/tools/checklist.d.ts +49 -0
  671. package/dist/tools/checklist.js +154 -0
  672. package/dist/tools/checklist.js.map +1 -0
  673. package/dist/tools/compress.d.ts +56 -0
  674. package/dist/tools/compress.js +226 -0
  675. package/dist/tools/compress.js.map +1 -0
  676. package/dist/tools/debug.d.ts +54 -0
  677. package/dist/tools/debug.js +230 -0
  678. package/dist/tools/debug.js.map +1 -0
  679. package/dist/tools/document-text.d.ts +6 -0
  680. package/dist/tools/document-text.js +154 -0
  681. package/dist/tools/document-text.js.map +1 -0
  682. package/dist/tools/edit-diff.d.ts +123 -0
  683. package/dist/tools/edit-diff.js +476 -0
  684. package/dist/tools/edit-diff.js.map +1 -0
  685. package/dist/tools/edit-targets.d.ts +10 -0
  686. package/dist/tools/edit-targets.js +31 -0
  687. package/dist/tools/edit-targets.js.map +1 -0
  688. package/dist/tools/edit.d.ts +38 -0
  689. package/dist/tools/edit.js +695 -0
  690. package/dist/tools/edit.js.map +1 -0
  691. package/dist/tools/enter-plan.d.ts +7 -0
  692. package/dist/tools/enter-plan.js +20 -0
  693. package/dist/tools/enter-plan.js.map +1 -0
  694. package/dist/tools/exit-plan.d.ts +7 -0
  695. package/dist/tools/exit-plan.js +51 -0
  696. package/dist/tools/exit-plan.js.map +1 -0
  697. package/dist/tools/find.d.ts +17 -0
  698. package/dist/tools/find.js +100 -0
  699. package/dist/tools/find.js.map +1 -0
  700. package/dist/tools/generate-image.d.ts +83 -0
  701. package/dist/tools/generate-image.js +625 -0
  702. package/dist/tools/generate-image.js.map +1 -0
  703. package/dist/tools/grep-scan.d.ts +96 -0
  704. package/dist/tools/grep-scan.js +283 -0
  705. package/dist/tools/grep-scan.js.map +1 -0
  706. package/dist/tools/grep.d.ts +48 -0
  707. package/dist/tools/grep.js +1013 -0
  708. package/dist/tools/grep.js.map +1 -0
  709. package/dist/tools/html-extract.d.ts +57 -0
  710. package/dist/tools/html-extract.js +130 -0
  711. package/dist/tools/html-extract.js.map +1 -0
  712. package/dist/tools/index.d.ts +198 -0
  713. package/dist/tools/index.js +216 -0
  714. package/dist/tools/index.js.map +1 -0
  715. package/dist/tools/live-preview.d.ts +23 -0
  716. package/dist/tools/live-preview.js +41 -0
  717. package/dist/tools/live-preview.js.map +1 -0
  718. package/dist/tools/ls.d.ts +9 -0
  719. package/dist/tools/ls.js +59 -0
  720. package/dist/tools/ls.js.map +1 -0
  721. package/dist/tools/operations.d.ts +86 -0
  722. package/dist/tools/operations.js +117 -0
  723. package/dist/tools/operations.js.map +1 -0
  724. package/dist/tools/overflow.d.ts +17 -0
  725. package/dist/tools/overflow.js +68 -0
  726. package/dist/tools/overflow.js.map +1 -0
  727. package/dist/tools/path-utils.d.ts +30 -0
  728. package/dist/tools/path-utils.js +74 -0
  729. package/dist/tools/path-utils.js.map +1 -0
  730. package/dist/tools/pdf-extract.d.ts +17 -0
  731. package/dist/tools/pdf-extract.js +43 -0
  732. package/dist/tools/pdf-extract.js.map +1 -0
  733. package/dist/tools/prompt-hints.d.ts +46 -0
  734. package/dist/tools/prompt-hints.js +171 -0
  735. package/dist/tools/prompt-hints.js.map +1 -0
  736. package/dist/tools/read-only-bash.d.ts +31 -0
  737. package/dist/tools/read-only-bash.js +338 -0
  738. package/dist/tools/read-only-bash.js.map +1 -0
  739. package/dist/tools/read-tracker.d.ts +43 -0
  740. package/dist/tools/read-tracker.js +120 -0
  741. package/dist/tools/read-tracker.js.map +1 -0
  742. package/dist/tools/read.d.ts +18 -0
  743. package/dist/tools/read.js +316 -0
  744. package/dist/tools/read.js.map +1 -0
  745. package/dist/tools/redaction-guard.d.ts +10 -0
  746. package/dist/tools/redaction-guard.js +55 -0
  747. package/dist/tools/redaction-guard.js.map +1 -0
  748. package/dist/tools/routine-output.d.ts +39 -0
  749. package/dist/tools/routine-output.js +281 -0
  750. package/dist/tools/routine-output.js.map +1 -0
  751. package/dist/tools/safe-env.d.ts +1 -0
  752. package/dist/tools/safe-env.js +79 -0
  753. package/dist/tools/safe-env.js.map +1 -0
  754. package/dist/tools/session-stats.d.ts +26 -0
  755. package/dist/tools/session-stats.js +51 -0
  756. package/dist/tools/session-stats.js.map +1 -0
  757. package/dist/tools/side-web-search.d.ts +34 -0
  758. package/dist/tools/side-web-search.js +146 -0
  759. package/dist/tools/side-web-search.js.map +1 -0
  760. package/dist/tools/skill.d.ts +12 -0
  761. package/dist/tools/skill.js +94 -0
  762. package/dist/tools/skill.js.map +1 -0
  763. package/dist/tools/source-path.d.ts +8 -0
  764. package/dist/tools/source-path.js +135 -0
  765. package/dist/tools/source-path.js.map +1 -0
  766. package/dist/tools/steroids.d.ts +44 -0
  767. package/dist/tools/steroids.js +356 -0
  768. package/dist/tools/steroids.js.map +1 -0
  769. package/dist/tools/subagent-control.d.ts +5 -0
  770. package/dist/tools/subagent-control.js +211 -0
  771. package/dist/tools/subagent-control.js.map +1 -0
  772. package/dist/tools/subagent-shared.d.ts +115 -0
  773. package/dist/tools/subagent-shared.js +182 -0
  774. package/dist/tools/subagent-shared.js.map +1 -0
  775. package/dist/tools/subagent.d.ts +37 -0
  776. package/dist/tools/subagent.js +406 -0
  777. package/dist/tools/subagent.js.map +1 -0
  778. package/dist/tools/task-output.d.ts +10 -0
  779. package/dist/tools/task-output.js +74 -0
  780. package/dist/tools/task-output.js.map +1 -0
  781. package/dist/tools/task-send.d.ts +11 -0
  782. package/dist/tools/task-send.js +36 -0
  783. package/dist/tools/task-send.js.map +1 -0
  784. package/dist/tools/task-stop.d.ts +8 -0
  785. package/dist/tools/task-stop.js +15 -0
  786. package/dist/tools/task-stop.js.map +1 -0
  787. package/dist/tools/tasks.d.ts +15 -0
  788. package/dist/tools/tasks.js +94 -0
  789. package/dist/tools/tasks.js.map +1 -0
  790. package/dist/tools/tool-search.d.ts +26 -0
  791. package/dist/tools/tool-search.js +81 -0
  792. package/dist/tools/tool-search.js.map +1 -0
  793. package/dist/tools/tool-tiers.d.ts +65 -0
  794. package/dist/tools/tool-tiers.js +121 -0
  795. package/dist/tools/tool-tiers.js.map +1 -0
  796. package/dist/tools/truncate.d.ts +39 -0
  797. package/dist/tools/truncate.js +242 -0
  798. package/dist/tools/truncate.js.map +1 -0
  799. package/dist/tools/ui-adopt.d.ts +16 -0
  800. package/dist/tools/ui-adopt.js +66 -0
  801. package/dist/tools/ui-adopt.js.map +1 -0
  802. package/dist/tools/ui-registry.d.ts +15 -0
  803. package/dist/tools/ui-registry.js +39 -0
  804. package/dist/tools/ui-registry.js.map +1 -0
  805. package/dist/tools/verification-review.d.ts +2 -0
  806. package/dist/tools/verification-review.js +41 -0
  807. package/dist/tools/verification-review.js.map +1 -0
  808. package/dist/tools/web-fetch.d.ts +52 -0
  809. package/dist/tools/web-fetch.js +986 -0
  810. package/dist/tools/web-fetch.js.map +1 -0
  811. package/dist/tools/web-search.d.ts +35 -0
  812. package/dist/tools/web-search.js +926 -0
  813. package/dist/tools/web-search.js.map +1 -0
  814. package/dist/tools/write.d.ts +16 -0
  815. package/dist/tools/write.js +196 -0
  816. package/dist/tools/write.js.map +1 -0
  817. package/dist/types.d.ts +44 -0
  818. package/dist/types.js +2 -0
  819. package/dist/types.js.map +1 -0
  820. package/dist/utils/commit-message.d.ts +25 -0
  821. package/dist/utils/commit-message.js +72 -0
  822. package/dist/utils/commit-message.js.map +1 -0
  823. package/dist/utils/git.d.ts +102 -0
  824. package/dist/utils/git.js +325 -0
  825. package/dist/utils/git.js.map +1 -0
  826. package/dist/utils/github-ci.d.ts +9 -0
  827. package/dist/utils/github-ci.js +138 -0
  828. package/dist/utils/github-ci.js.map +1 -0
  829. package/dist/utils/github.d.ts +19 -0
  830. package/dist/utils/github.js +67 -0
  831. package/dist/utils/github.js.map +1 -0
  832. package/dist/utils/image.d.ts +166 -0
  833. package/dist/utils/image.js +673 -0
  834. package/dist/utils/image.js.map +1 -0
  835. package/dist/utils/open-browser.d.ts +13 -0
  836. package/dist/utils/open-browser.js +31 -0
  837. package/dist/utils/open-browser.js.map +1 -0
  838. package/dist/utils/plan-steps.d.ts +90 -0
  839. package/dist/utils/plan-steps.js +209 -0
  840. package/dist/utils/plan-steps.js.map +1 -0
  841. package/dist/utils/process.d.ts +48 -0
  842. package/dist/utils/process.js +175 -0
  843. package/dist/utils/process.js.map +1 -0
  844. package/dist/utils/prompt-enhancer.d.ts +34 -0
  845. package/dist/utils/prompt-enhancer.js +178 -0
  846. package/dist/utils/prompt-enhancer.js.map +1 -0
  847. package/dist/utils/text.d.ts +61 -0
  848. package/dist/utils/text.js +68 -0
  849. package/dist/utils/text.js.map +1 -0
  850. package/package.json +87 -3
@@ -0,0 +1,194 @@
1
+ # United States
2
+
3
+ ## Contents
4
+ - 0. Scoping reality for a tiny startup
5
+ - 1. State comprehensive privacy laws
6
+ - 2. California specifics
7
+ - 3. Children and teens
8
+ - 4. Health, biometric, genetic, location
9
+ - 5. AI laws
10
+ - 6. Cross-cutting federal
11
+ - 7. PRA ranking — what actually produces suits against small companies
12
+ - 8. Verify before relying
13
+
14
+
15
+ Snapshot **11 Aug 2026**, spot re-verified 3 Oct 2026 and 22 Oct 2026 (see `provenance.md`). Markers: **[V]** verified against a primary/first-tier source · **[S]** snapshot, re-verify · **[U]** contested or fast-moving.
16
+
17
+ **PRA** = private right of action. This is the field that matters most for a small company: regulator-only laws are a compliance project, PRA laws are a lawsuit.
18
+
19
+ ---
20
+
21
+ ## 0. Scoping reality for a tiny startup
22
+
23
+ Most **comprehensive state privacy laws will not apply** to a pre-scale product — they need tens of thousands of residents' data or large revenue. But four categories apply **at any size**:
24
+
25
+ 1. FTC Act §5 and state unfair-and-deceptive-practices analogues (most state UDAPs *do* have a PRA).
26
+ 2. Breach-notification statutes in every state.
27
+ 3. Sector laws: COPPA, HIPAA, GLBA, TCPA, BIPA, consumer-health-data laws.
28
+ 4. No-threshold plaintiff statutes: CIPA, BIPA, MHMDA, TCPA, VPPA.
29
+
30
+ Also note **Texas and Nebraska have no revenue or volume threshold** — they apply to anyone doing business in-state who is not an SBA "small business", and even exempt small businesses may not sell sensitive personal data without consent **[V]**.
31
+
32
+ **Practical answer:** a US indie app under ~25k users in any single state usually falls outside the comprehensive laws — and is still fully exposed to everything in categories 1–4.
33
+
34
+ ---
35
+
36
+ ## 1. State comprehensive privacy laws
37
+
38
+ **In force in 2026: 20 states** (CA, VA, CO, CT, UT, TX, OR, MT, IA, DE, NE, NH, NJ, TN, MN, MD, and — from 1 Jan 2026 — IN, KY, RI; plus Florida's narrower law which applies only above $1B revenue) **[S]**. Enforcement is AG-only; penalties commonly $7,500–$10,000 per violation **[S]**. Cure periods are expiring across states during 2026 **[S]**. Further states have enacted laws taking effect from 2027 **[U]** on the exact list — re-check before advising.
39
+
40
+ Thresholds range from 25,000 consumers (Montana) to 175,000 (Tennessee); 10,000 consumers where a share of revenue comes from selling data (RI, DE, NH, MD); Maryland pairs a 35,000-consumer threshold with the strictest data-minimisation and sensitive-data rules, and bans the sale of sensitive data outright **[V]**.
41
+
42
+ **Universal opt-out / Global Privacy Control — the cheapest high-value engineering task.** As of 1 Jan 2026, twelve states require honouring it (CA, CO, CT, DE, MD, MN, MT, NE, NH, NJ, OR, TX); Virginia-template states, including the 2026 newcomers Indiana, Kentucky and Rhode Island, do not **[V]**. California's regulations effective 1 Jan 2026 also require the business to display whether the signal was honoured (11 CCR §7025(c)(6)) **[S]**. California, Colorado and Connecticut have run a coordinated GPC enforcement sweep **[S]**.
43
+
44
+ ```
45
+ Read the Sec-GPC: 1 request header and navigator.globalPrivacyControl.
46
+ Treat as an opt-out of sale/share + targeted advertising.
47
+ Apply BEFORE firing any ad pixel. Persist server-side against the user/device.
48
+ Disclose signal handling in the privacy notice.
49
+ ```
50
+ Honouring GPC for **every** visitor is the safe default: it satisfies the strictest state and violates none **[V]**.
51
+
52
+ **Taking effect in 2027** — Oklahoma and Louisiana on 1 Jan 2027, Alabama on 1 May 2027 **[S]**; Vermont (Act 145) on 1 Jan 2028, per the statute pages and most trackers **[S]**. Delaware's threshold drops to 10,000 consumers (5,000 with data-sale revenue) from 1 Jan 2027 **[S]**. Which states add a GPC duty in 2027 is disputed (trackers disagree even on Alabama) **[U]**; honouring GPC for everyone stays the safe default.
53
+
54
+ **Why an ordinary ad pixel triggers everything.** "Sale" requires no money — any disclosure for other valuable consideration counts — and "sharing" expressly covers cross-context behavioural advertising **[V]**. Meta Pixel, GA4 with ad features, TikTok, Reddit and LinkedIn tags are a sale/share/targeted ad in nearly every state. Build: a tag inventory, consent-gated loading, and an opt-out that actually severs the pixel rather than filing a form.
55
+
56
+ **Sensitive data requires opt-in** in Virginia-model states (precise geolocation, race, religion, health, sex life/orientation, immigration status, biometrics, genetic data, children's data) **[V]**. California instead grants a right to limit use.
57
+
58
+ **Minors:** opt-in for targeted ads, sale, and profiling for known 13–16 year-olds; Maryland extends to under-18 on a "should have known" standard **[V]**.
59
+
60
+ **Rights and timing:** access, delete, correct, portability, opt-out, non-discrimination. **45 days, extendable by 45** **[V]**. Virginia-model states require an **appeal** mechanism. California requires two intake methods. Never identity-verify an opt-out — verification is for access/deletion.
61
+
62
+ **Notice content:** categories collected/sources/purposes/recipients, sensitive-data uses, **retention periods per category** (California), rights and how to exercise them, opt-out-signal handling, appeal process, contact, and a last-updated date with an annual refresh **[V]**.
63
+
64
+ **Assessments:** written data-protection assessments required in most Virginia-model states for targeted advertising, sale, sensitive data, and risky profiling; retained and producible to the AG **[V]**.
65
+
66
+ ---
67
+
68
+ ## 2. California specifics
69
+
70
+ **Applicability:** for-profit doing business in CA meeting any one of — annual gross revenue over ~$26.6M (CPI-adjusted), buying/selling/sharing PI of 100,000+ CA consumers or households a year, or 50%+ of revenue from selling/sharing PI **[V]**. Penalties per violation with a higher tier for intentional violations or those involving minors. **Consumers may sue only over certain breaches** ($107–$799 per consumer per incident) — there is no general PRA for policy or opt-out-link failures **[V]**.
71
+
72
+ **2026 regulations package (effective 1 Jan 2026; approved by OAL 22 Sep 2025, per cppa.ca.gov)** **[V]**:
73
+ - *Risk assessments* — required before starting covered processing from 1 Jan 2026; complete for pre-2026 ongoing activities by 31 Dec 2027; attestation plus summary to the CPPA by 1 Apr 2028. Triggered by sensitive PI, targeted ads to minors, ADMT for significant decisions, or training ADMT.
74
+ - *ADMT* — pre-use notice, access, and opt-out (or a qualifying exception) for automated decision-making about significant decisions (including employees, contractors, applicants). **Compliance deadline 1 Jan 2027**; ADMT deployed after that date must comply before first use. Targeted advertising alone is not a significant decision.
75
+ - *Cyber audits* — only above revenue plus scale thresholds; first certifications due 1 Apr 2028 (>$100M revenue), 1 Apr 2029 ($50–100M), 1 Apr 2030 (<$50M) **[V]**. A pre-revenue startup is out of scope.
76
+
77
+ **Delete Act / DROP** — if you sell PI of consumers you have no direct relationship with, you are a data broker. **No revenue threshold.** Registration plus, **from 1 Aug 2026**, processing consumer deletion requests through the state mechanism every 45 days with downstream deletion directives; per-day penalties apply whether or not you registered **[V]** (1 Aug 2026 / 45-day cadence re-confirmed on cppa.ca.gov/data_brokers, 3 Oct 2026). All brokers operating in 2025 or 2026 must have a DROP account **[V]**. AB 883 (signed Sep 2026) cuts a broker turnaround from 45 to 30 days; sources disagree whether that is the request-response deadline or the DROP check cadence **[U]**.
78
+
79
+ **AB 2561 (signed 27 Sep 2026)** — an OS or app may not undo a user's privacy setting (including after an update) without consent **[S]**. Never reset privacy toggles in a migration. Enforcement has already hit companies of exactly this size. Ask at design review: *do we sell PI of people who never used us?*
80
+
81
+ **Breach notice (SB 446)** — since 1 Jan 2026, notify affected California residents within **30 calendar days** of discovery, and report to the AG within **15 calendar days** of notifying individuals **[V]**.
82
+
83
+ **AI transparency (SB 942 as amended by AB 853)** — covered providers are generative-AI systems with **over 1M monthly users**; duties operative 2 Aug 2026, with hosting-platform duties from 1 Jan 2027 **[V]**. Most small devs are out of scope, but the hosting-platform duty catches anyone distributing GenAI systems.
84
+
85
+ **AB 2713 (2026)** amends the AI Transparency Act: large online platforms must show whether content was AI-generated or altered (provenance data) **[S]**.
86
+
87
+ **AB 1609 (signed 28 Sep 2026)** — customer-service chatbot disclosure and human access for large businesses; the reported revenue threshold of $500M is **[U]**.
88
+
89
+ **AB 2013 training-data transparency** — **no size threshold**. Developers of generative AI systems made available to Californians must publish training-data documentation; compliance required from 1 Jan 2026 and on substantial modification **[V]**. Catches small fine-tuners, not mere API consumers.
90
+
91
+ **SB 243 companion chatbots — the highest-risk new law for small AI apps.** Effective 1 Jan 2026. Applies to chatbots sustaining a relationship or human-like emotional engagement (excludes customer-service bots, limited game NPCs, voice assistants). Requires non-human disclosure, mental-health crisis protocols, and minor protections including blocking sexual content and enforcing breaks; annual reporting to the state Office of Suicide Prevention is reported to start 1 Jul 2027 **[S]** (bill text not reachable 3 Oct 2026). **PRA: YES** — minimum $1,000 damages plus fees, and UCL pairing can reach individuals personally **[V]**. **SB 1119** (signed 10 Sep 2026 **[V]**) adds minor protections from 1 Jan 2027, core duties 1 Jul 2027, and independent child-safety audits from 1 Jan 2029 **[S]**. **SB 867** bans toys with a companion chatbot for under-16s from 1 Jan 2027 to 1 Jan 2031 **[S]**.
92
+
93
+ **Employment ADS regulations** under state anti-discrimination law add notice and recordkeeping duties for automated decision systems **[S]**.
94
+
95
+ ---
96
+
97
+ ## 3. Children and teens
98
+
99
+ **COPPA amended Rule (16 CFR Part 312, 90 FR 16918) — effective 23 June 2025, full compliance date 22 Apr 2026, now passed and enforceable** **[S]** (secondary sources citing the Federal Register; FR text not opened). The FTC issued a February 2026 policy statement limiting enforcement where children's data is collected solely for age verification, but only for operators compliant in every other respect **[S]**. Trigger: a child-directed service, or actual knowledge of collecting personal information from under-13s. Mixed-audience services may age-screen. Concrete changes:
100
+
101
+ - **Separate** verifiable parental consent for disclosing children's data to third parties (including for targeted advertising).
102
+ - New **data-retention limits** and a **published written retention policy** — indefinite retention is prohibited.
103
+ - Broader definition of personal information now expressly including **biometric identifiers** (face templates, fingerprints, voiceprints), government identifiers, phone numbers, audio recordings, and certain geolocation.
104
+ - A written children's information security programme with vendor due diligence.
105
+ - Parent review/deletion flows must cover biometric data.
106
+
107
+ **App Store Accountability Acts (TX, UT, LA, AL) and California's Digital Age Assurance Act** — these impose duties on **app developers**, not just the stores **[V]**. Status as of 22 Oct 2026:
108
+ - **Texas SB 2420** — in force under the Fifth Circuit's 4 June 2026 stay pending appeal; the Supreme Court denied vacatur on 6 Jul 2026 (not a merits ruling); the merits appeal was argued 4 Aug 2026 with no opinion at 22 Oct 2026 **[S]** (court orders not opened).
109
+ - **Utah** — HB 498 (2026) pushed the main store/developer duties to **6 May 2027**, removed AG enforcement, and left a private right of action effective **31 Dec 2026** **[S]**.
110
+ - **Louisiana** — HB 977 (signed 15 May 2026) pushed the effective date to **1 July 2027** **[S]**.
111
+ - **California AB 1043** — effective **1 Jan 2027**: OS-level self-declared age brackets; developers must request the age signal and are then treated as having actual knowledge of the user's age range; no per-download parental consent; AG enforcement up to $2,500 negligent / $7,500 wilful per violation **[S]**.
112
+ - **Alabama** — enacted; effective date not re-verified **[U]**.
113
+ Build: consume the store/OS age-signal API, branch features on age category, store only a category flag, re-request consent on significant app changes.
114
+
115
+ **California 2026 minors package (signed 10 Sep 2026 [V], gov.ca.gov)** — AB 1709: no addictive features (activity-based feeds, autoplay) for under-16s on covered UGC platforms from 1 Jan 2027; AB 2246 repeals and replaces the Age-Appropriate Design Code with a reasonable-steps duty for services likely accessed by under-18s, from 1 Jan 2027; AB 1856 amends AB 1043 (OS and app stores only; developers deemed to know the age range from the device signal) **[S]**.
116
+
117
+ **NY SAFE for Kids** — final rules July 2026, effective **25 Jan 2027**, targeting platforms with addictive feeds **[V]**.
118
+
119
+ **Adult content age verification** — 26 states with live laws following the 2025 Supreme Court decision upholding Texas's law **[V]**. Typical trigger is ≥1/3 sexual material harmful to minors, a few with no threshold. Use a third-party verifier returning a boolean; retain nothing reconstructable; geo-route per state. Several states allow private suits.
120
+
121
+ **TAKE IT DOWN Act §3 (NCII) — enforced by the FTC from 19 May 2026, and it reaches tiny platforms** **[V]** (ftc.gov press release, May 2026). The FTC runs a complaint portal (TakeItDown.ftc.gov) and has sent warning letters **[V]**; violations are treated as violations of an FTC rule, so civil penalties per violation apply **[S]** on the exact inflation-adjusted amount. Any site, app or service that hosts user content must publish a plain-language notice-and-removal process usable by **users and non-users**, and remove reported non-consensual intimate imagery — including AI-generated — plus known identical copies **within 48 hours**. Non-compliance is trivially detectable: a regulator just checks whether the notice exists. Build `/report/ncii`, an acknowledgement + 48h SLA timer, hash-based re-upload suppression, and a footer link.
122
+
123
+ **CSAM reporting** — providers must report apparent child sexual abuse material to the national tipline as soon as reasonably possible after obtaining actual knowledge, with a **one-year preservation** duty; there is no general proactive monitoring mandate **[V]**. Register a point of contact, define an escalation path, and never re-transmit the material except to the tipline or law enforcement.
124
+
125
+ ---
126
+
127
+ ## 4. Health, biometric, genetic, location
128
+
129
+ **HIPAA usually does *not* cover a direct-to-consumer wellness app** — it reaches covered entities and their business associates. You become a business associate the moment you handle PHI *on behalf of* a covered entity, which requires a BAA, Security Rule compliance, and 60-day breach notice **[V]**. If you are not HIPAA, you are in the consumer-health-data regime below.
130
+
131
+ **Washington My Health My Data Act (RCW 19.373) — the top small-company landmine.** **No revenue or volume threshold**, in effect since 31 Mar 2024 (small businesses from 30 June 2024) **[V]**. "Consumer health data" is defined broadly enough to include precise location that could indicate seeking health services. Requires a **standalone** consumer-health-data privacy policy at its own link, **separate consent for collection**, **separate consent for sharing**, and a **distinct signed authorisation to sell**, plus a geofencing prohibition and processor contracts. **PRA: YES**, via the state Consumer Protection Act: actual damages, trebling up to $25,000, and fees; the AG can separately seek civil penalties **[S]**. The lawsuits on record (from Feb 2025) target ad SDKs and website/app tracking, not hospitals **[S]**. Any period tracker, fitness, mental-health, or symptom app — or anything collecting precise location — is squarely in scope. Nevada (SB 370) and Connecticut have similar consent and geofencing rules without a PRA; New York bans geofencing health facilities; New York's broader Health Information Privacy Act had not become law at 3 Oct 2026 **[S]**.
132
+
133
+ **California AB 1979 (signed Sep 2026, from 1 Jan 2027)** — a business offering a healthcare chatbot to consumers is treated as a provider of health care under the CMIA (California's medical-confidentiality law), and AI may not independently perform functions reserved to licensed clinicians **[S]**.
134
+
135
+ **Illinois BIPA** — see `lawsuit-vectors.md` §3. Required **before first capture**: written notice of collection and specific purpose, notice of the retention schedule and destruction guidelines, a **written release**, a publicly available retention/destruction policy, no profiting from biometrics, and reasonable-care storage **[V]**. Texas and Washington have AG-enforced analogues.
136
+
137
+ **Genetic data** — roughly 14 states require separate express consent per purpose and per disclosure; some allow private suits **[S]**. Treat raw DNA as opt-in-per-purpose and get counsel.
138
+
139
+ **Precise geolocation** — sensitive/opt-in in every Virginia-model state, and health-linked location is consumer health data **[V]**. Request coarse location by default; never ship precise location to ad SDKs.
140
+
141
+ **FTC Health Breach Notification Rule** — applies to non-HIPAA health apps that can draw data from multiple sources (e.g. platform health data plus user input). Critically, a "breach" includes an **unauthorised disclosure** — firing a health event to an ad pixel is itself reportable **[V]**. 500+ affected means notifying the regulator within 60 days.
142
+
143
+ ---
144
+
145
+ ## 5. AI laws
146
+
147
+ - **Colorado** — SB 24-205 never took effect: SB 26-189 (signed 14 May 2026) repealed and replaced it with a narrower automated-decision-making (ADMT) disclosure law effective **1 Jan 2027** — point-of-interaction notice, post-adverse-decision explanation, correction and human-review rights for consequential decisions. Repeal-and-reenact confirmed on leg.colorado.gov **[V]**; the 1 Jan 2027 date and obligation detail are consistent across law-firm summaries **[S]**. AG rules (4 CCR 904-6, also covering the HB 26-1263 chatbot law): proposed 11 Aug 2026, interim draft 6 Oct, comments close 26 Oct 2026 **[V]** (coag.gov/ai), with the rulemaking hearing that day **[S]**. Final rules are due by 1 Jan 2027 and pending xAI litigation could still delay it; re-check before building **[S]**.
148
+ - **Texas TRAIGA (HB 149)** — signed 22 Jun 2025, effective 1 Jan 2026 (capitol.texas.gov bill history, 3 Oct 2026), reaching out-of-state developers whose AI is accessible to Texas users. Intent-based liability for AI that promotes self-harm, facilitates crime, discriminates, or produces prohibited deepfakes. AG-only with a 60-day cure; **safe harbour for documented NIST AI RMF-aligned compliance** **[V]**. Practical step for a small dev: a one-page RMF-aligned policy plus retained prompt/eval logs.
149
+ - **Illinois HB 3773** — from 1 Jan 2026, using AI with a discriminatory *effect* in employment violates the state human-rights act; intent is no defence **[V]**.
150
+ - **NYC Local Law 144** — annual independent bias audit plus published summary and candidate notice for automated employment decision tools used for NYC roles **[V]**.
151
+ - **Mental-health AI** — Illinois bans AI delivering mental-health treatment or clinical decisions outright; Nevada, Utah and Tennessee restrict or require disclosure; treat "AI therapist" as a **hard gate** **[V]**.
152
+ - **Companion chatbots** — California (PRA), New York (AG-only), Oregon (PRA, from 2027), Washington (from 2027), Colorado (HB 26-1263, from 1 Jan 2027: age estimation plus disclosures and restrictions for minors) **[V]**. **Baseline build for any consumer LLM chat:** persistent non-human disclosure, self-harm detection with a crisis interstitial, minor-mode content restrictions and break reminders, retained incident logs.
153
+ - **Frontier-model laws** target training compute far beyond any small developer **[V]**.
154
+ - **Federal posture** — a December 2025 executive order seeks to weaken state AI regulation via litigation and funding conditions, with a DOJ task force operating from January 2026 **[V]**. Do **not** advise a user to ignore state AI law on this basis; the laws remain in force unless and until enjoined.
155
+
156
+ ---
157
+
158
+ ## 6. Cross-cutting federal
159
+
160
+ - **FTC Act §5** — any statement in your privacy policy, marketing page, app-store listing or in-app copy that is not literally true of your code is deception. Dark patterns in consent and cancellation flows are deception/unfairness; failure to maintain reasonable security is unfairness **[V]**. No federal PRA, but most state UDAP analogues have one.
161
+ - **Consumer Reviews and Testimonials Rule** — prohibits fake, incentivised-by-sentiment, and undisclosed insider reviews, with civil penalties in the tens of thousands per violation; enforcement is active **[V]**.
162
+ - **Negative option / click-to-cancel** — the 2024 rule was vacated by the Eighth Circuit on 8 July 2025; the FTC published a new advance notice of proposed rulemaking in March 2026, so no new federal rule is in force **[S]**. The FTC keeps pleading the same three duties (disclose terms, express informed consent, easy cancel) under §5 and ROSCA. Do not tell a user they are safe: ROSCA and roughly 30 state auto-renewal laws still govern, and California's amended law broadened liability **[V]**.
163
+ - **TCPA** — see `lawsuit-vectors.md` §4. Consent records, revocation handling on any channel, quiet hours in the recipient's timezone, DNC scrubbing, carrier campaign registration **[V]**. Revocation: opt-outs must be honoured within 10 business days **[S]**. FCC 26-67 (adopted 30 Sep 2026, released 1 Oct) replaces the 2024 "revoke-all" rule and its 31 Jan 2027 date: an opt-out from an informational message may be limited to that category, a marketing opt-out still stops all marketing, callers may designate an exclusive opt-out method, and the 10-business-day window stays **[V]**. It was published in the Federal Register on 26 Oct 2026 (FR Doc 2026-21821) and takes effect **25 Nov 2026** **[S]**; a companion proposal (FR Doc 2026-21820) asks about a shorter revocation window and a revoke-all method **[S]**. Build to the strict reading: any STOP-type reply stops all marketing on every channel.
164
+ - **CAN-SPAM** — accurate headers and subject, advertising identification, **valid physical postal address**, working opt-out honoured within **10 business days** and functional for 30 days after send; you are liable for your sending platform and affiliates **[V]**.
165
+ - **State breach notification** — all states; deadlines and AG-notice thresholds vary; several sector rules add shorter clocks **[V]**.
166
+ - **ADA accessibility** — **Title II** (state and local government, including their contractors' web and app content): a DOJ interim final rule of 20 Apr 2026 moved the WCAG 2.1 AA compliance dates to **26 Apr 2027** (population ≥50,000) and **26 Apr 2028** (smaller entities and special districts); the technical standard is unchanged and DOJ signalled further review **[S]** (law-firm and SBA Office of Advocacy reports; the Federal Register text was not retrieved). **Title III** (private businesses) has no technical rule and no deadline — exposure is private litigation, which rose in 2025: 3,117 federal website suits, up 27% on 2024, over 5,000 counting state courts, with e-commerce the main target **[S]**. WCAG 2.1 AA is the practical benchmark; build to 2.2 AA.
167
+ - **GLBA Safeguards Rule** — "financial institution" is far broader than banks and catches many fintech, lending, tax-prep and advisory products: written InfoSec programme, a named qualified individual, MFA, encryption, vendor oversight, and 30-day regulator notice for larger incidents **[V]**.
168
+ - **FCRA** — if you assemble or use consumer reports for employment, tenant, credit or insurance decisions: permissible purpose, **standalone** disclosure plus authorisation, pre-adverse-action packet with a waiting period, adverse-action notice. **PRA: YES**, with heavy class-action volume over standalone-disclosure defects **[V]**.
169
+ - **ECOA/Reg B and FHA** — adverse-action notices with **specific principal reasons** within 30 days. A black-box model that cannot articulate reasons is itself the violation **[V]**. **PRA: YES.**
170
+
171
+ ---
172
+
173
+ ## 7. PRA ranking — what actually produces suits against small companies
174
+
175
+ 1. California CIPA (trackers, pixels, chat widgets, session replay) — $5,000 per violation, no threshold **[V]**
176
+ 2. ADA Title III accessibility (plus state statutory damages) **[V]**
177
+ 3. TCPA/SMS — $500–$1,500 per message, uncapped **[V]**
178
+ 4. Illinois BIPA — per-person statutory damages ($1,000 / $5,000), a single in-state user suffices; the 2024 per-person cap applies retroactively to pending cases (Seventh Circuit, *Clay v. Union Pacific*, 1 Apr 2026) **[S]**
179
+ 5. Washington MHMDA — actual damages trebled up to $25,000 plus fees, extremely broad health-data definition **[S]**
180
+ 6. Auto-renewal claims via state consumer statutes **[V]**
181
+ 7. CCPA breach claims — $107–$799 per consumer, filed reflexively after AG breach reports **[V]**
182
+ 8. California SB 243 companion chatbots — new, untested, minimum $1,000 plus fees **[V]**
183
+ 9. VPPA — video plus ad pixel, $2,500 per person, circuit split **[U]**
184
+ 10. FCRA — standalone-disclosure defects **[V]**
185
+ 11. State wiretap analogues beyond California **[U]** on the exact state list
186
+ 12. AI employment discrimination — low volume today, rising **[S]**
187
+
188
+ **Regulator-only (no PRA):** every state comprehensive privacy law except California's breach claim, COPPA, TAKE IT DOWN, TRAIGA, frontier-model laws, SB 942, NYC LL144, Nevada health law, the Delete Act, GLBA, CAN-SPAM, and FTC rules.
189
+
190
+ ---
191
+
192
+ ## 8. Verify before relying
193
+
194
+ Colorado AG rules under SB 26-189 · Vermont and Nebraska children's-code dates · FCC companion proposal on the TCPA revocation window (FR Doc 2026-21820) · Utah, Louisiana and Alabama app-store law dates and litigation · DOJ's further Title II review · state privacy laws taking effect in 2027 · VPPA scope · state mini-TCPA and mini-wiretap lists · genetic-privacy specifics per state · SaaS sales-tax nexus.
@@ -0,0 +1,114 @@
1
+ ---
2
+ name: durable
3
+ description: "Use to keep stored data from being lost: before running or writing anything that could delete, overwrite or reshape it, and when asked whether data is backed up and recoverable. Do NOT use for read-only queries or query speed."
4
+ metadata:
5
+ version: "2026.11.22"
6
+ license: Data-durability engineering guidance, not a DBA certification. Sources and snapshot date are recorded at the foot of each reference file.
7
+ compatibility: Snapshot dated 3 October 2026; Prisma 7/8 status and agent safeguards, PostgreSQL 19 status and the Neon, RDS and D1 retention rows re-verified 22 October 2026; PostgreSQL 19 GA and 14 EOL, Prisma 8 status and drop prompts, and the Supabase, D1, PlanetScale and PgBouncer rows re-verified 22 November 2026. Re-verify version behaviours and provider defaults before asserting them as current.
8
+ ---
9
+
10
+ # Durable
11
+
12
+ **Route first:**
13
+
14
+ | You are… | Mode | Do next |
15
+ |---|---|---|
16
+ | About to run *any* command against a database yourself (migrate, reset, push, seed, SQL shell, delete script) | **Agent gate** | Run the agent gate below before the command. Always. |
17
+ | Writing code that touches stored data (table, migration, import, delete endpoint, webhook write, backup cron) | **Inline gate** | Apply binding defaults; one line on the guard you built; keep building. |
18
+ | Asked "is my data safe / back up my app", a migration is about to hit production, or after a data scare | **Full pass** | Run the full-pass workflow. |
19
+
20
+ Never say data is "safe": say what loss is survivable and what is not.
21
+
22
+ ## Agent gate — binding rules for you, the agent
23
+
24
+ Coding agents have wiped production data during a natural-language code freeze (Replit, July 2025; `references/agent-db-safety.md`). These rules are the mechanism.
25
+
26
+ 1. **Identify the target before every command.** Resolve which database the command will hit. Classify it `throwaway` / `shared-dev` / `may-hold-real-data` using the detection list in `references/agent-db-safety.md`. Unknown = `may-hold-real-data`.
27
+ 2. **On `may-hold-real-data`, read-only by default.** Inspect with `SELECT`/`EXPLAIN`/`\d`, a read-only role, or `BEGIN READ ONLY`. No DDL, no writes, no `migrate dev|reset`, `db push`, `--force`, `--accept-data-loss`, `flush`, `dropDatabase`, `TRUNCATE`, seed scripts.
28
+ 3. **Destructive or schema-changing commands on real data require all of:** (a) a backup or PITR point you verified exists *for this database* (`RUNTIME` or provider-console evidence, not assumption), (b) a dry-run count of affected rows shown to the user, (c) the exact command shown, and (d) the user's explicit go-ahead in this conversation for that command. "Go ahead and fix it" does not cover a `DROP`.
29
+ 4. **Experiment on a branch, not the original.** Use a provider branch, restored clone or local copy; prove the change there, then hand back the production step with evidence.
30
+ 5. **Never bypass a tool's safety interlock yourself.** If a CLI refuses because it detected an agent (e.g. Prisma 7's AI-consent check, Prisma 8's drop prompts), a platform holds your request for the user's approval (e.g. Prisma Console agent approvals), or a prompt asks for confirmation: stop and ask. Never set a consent variable, approve your own request, or pass `--force`/`--yes`/`--delete`/`--allow` on your own initiative.
31
+ 6. **Surprising results mean stop, not fix.** Empty tables, missing rows, failed restores: report what you observed and ask. Never "repair" by recreating, reseeding, or fabricating data, and never declare data unrecoverable without checking the provider's backups/PITR.
32
+ 7. **Report exactly what you ran** — every command that touched a database, its target, and its result, including mistakes, immediately.
33
+
34
+ Also flag (do not silently fix) setups where the agent's shell holds production write credentials: recommend separate dev/prod credentials, a read-only role for inspection, and production URLs absent from local `.env`.
35
+
36
+ ## Governing rules
37
+
38
+ 1. **The store is the last line of defence.** `NOT NULL`, `UNIQUE`, foreign keys with a chosen `ON DELETE`, `CHECK` — in the database, where scripts and bugs cannot walk past them.
39
+ 2. **Destructive operations are guilty until guarded**: `WHERE` + batch limit, dry-run count first, backup when anything of value exists, undo path (soft delete, staging copy) for user-facing data.
40
+ 3. **Migrations run on data you cannot recreate.** Checked in, reviewed as SQL (ORM output included — a rename can become `DROP` + `ADD`), never edited once applied, forward-only in production. Push/sync commands are for throwaway databases.
41
+ 4. **One logical change, one transaction; anything retried is idempotent.**
42
+ 5. **Backups you have not restored are fiction.** Automated, off-instance, stated RPO/RTO, timed restore drill.
43
+ 6. **Fail loudly, not corruptly.** Bulk jobs are keyset-resumable with durable checkpoints.
44
+ 7. **Respect the store's concurrency model** — SQLite has one writer; transaction poolers break session state.
45
+ 8. **Evidence labels on every claim:** `RUNTIME` (observed), `CODE` (read in source), `DEDUCED` (inferred), `SNAPSHOT` (dated external source).
46
+ 9. **Proportionality.** Test rows need migrations; the first real user row raises the floor to backups, then tested restore, then PITR.
47
+
48
+ ## Binding defaults (inline gate)
49
+
50
+ - **Migration tooling from the first table.** Generate without applying (`prisma migrate dev --create-only`, `drizzle-kit generate`), read the SQL, apply via the deploy path (`prisma migrate deploy`, `drizzle-kit migrate`). Corrections are new migrations.
51
+ - **Destructive code carries its guard**: count-first, `WHERE` + batch, soft delete (`deleted_at` + partial unique index) for user-visible data.
52
+ - **Constraints in the store** per rule 1; integer cents or `NUMERIC` for money; `bigint`/UUID keys (`uuidv7()` built in from Postgres 18).
53
+ - **Transactions around multi-write invariants**; across systems, use an outbox.
54
+ - **Idempotency keys on retried writes**: unique event/job IDs + `INSERT … ON CONFLICT`.
55
+ - **Batched, resumable bulk work** (keyset, fixed batch, checkpoint, sleep) — never one unbounded `UPDATE` on production.
56
+ - **Backups the moment real data exists**: confirm the plan actually includes them (free tiers often do not), add an off-account copy, state RPO/RTO where configured. Uploads need bucket versioning — DB backups do not cover objects.
57
+ - **Serverless connections**: assume transaction-mode pooling (no session state); one pool per instance; release in `finally`.
58
+ - **SQLite as SQLite**: WAL, `busy_timeout`, `foreign_keys=ON` per connection, one writer, local disk, continuous or scheduled backup.
59
+
60
+ ## Full-pass workflow
61
+
62
+ 1. **Profile from the code.** Stores, migration tooling, write/delete paths, backup config, environments and credentials, and whether real user data exists.
63
+ 2. **Define loss.** Recreatable vs unrecoverable (user content, uploads, payments), and rows ↔ files links.
64
+ 3. **Sweep the seven areas** (detail in references):
65
+
66
+ | # | Area | Hunting for |
67
+ |---|---|---|
68
+ | 1 | Backups & recovery | None; same machine/account only; free tier assumed to be PITR; never restored; no RPO/RTO; unversioned upload buckets |
69
+ | 2 | Destructive paths | Unguarded `DELETE`/`UPDATE`; cascades sweeping too far; reset/push/drop in scripts or CI near production config |
70
+ | 3 | Agent & credential exposure | Prod write URL in local `.env`; agent/CI tokens with DDL rights; no branch/dev DB to experiment on |
71
+ | 4 | Migrations health | No tooling; edited applied migrations; unreviewed destructive SQL; lock-unsafe DDL; drift |
72
+ | 5 | Transactions & idempotency | Multi-writes without a transaction; double-apply on retry; check-then-act races |
73
+ | 6 | Schema integrity | Missing FKs/uniques/`NOT NULL`; orphans; float money; int IDs near overflow |
74
+ | 7 | Runtime data safety | Session state through transaction poolers; SQLite multi-writer; non-atomic file writes; no dead-letter path |
75
+
76
+ 4. **Rank by survivability.**
77
+
78
+ | Severity | Meaning |
79
+ |---|---|
80
+ | Critical | Loss certain or one common failure away: real data with no backups; unguarded destructive path; pending data-dropping migration; agent/CI holding prod write creds with no verified backup; double-charge on retry |
81
+ | High | Loss on a plausible bad day: never-restored backups; single copy; broad cascades; multi-writes without transactions |
82
+ | Medium | Bites at scale or in recovery: missing constraints, drift, non-idempotent jobs, non-atomic writes |
83
+ | Low | Hygiene; fix only when adjacent |
84
+
85
+ 5. **Report, then fix what the user selects**, Critical and High first (three to five, each verified). Fix straight away only when the user asked for fixes.
86
+ 6. **Verify.**
87
+ - *Restore drill* (any backup fix): note a point, insert a canary, restore to the point **into a separate location**, confirm the canary is absent, record wall-clock time as the real RTO. `RUNTIME` or it did not happen.
88
+ - *Guard drill* (destructive fix): on a copy, one row that must survive and one that must not; assert both.
89
+ - *Migration drill*: apply pending migrations to a branch or prod-shaped copy first, with `lock_timeout` set.
90
+ - Not run: label it unverified and give the exact command.
91
+ 7. **Leave a guard behind** with tools already installed and the existing CI: CI migrations on a throwaway DB, a scheduled restore test, a constraint, or a read-only agent role. A new package or workflow (e.g. a migration linter) is a recommendation unless the user agrees.
92
+ 8. **Report**: lead with the RPO the user *actually* has ("if this server died now you lose everything since …"); then ranked findings with file:line and fix; then **not checked**; then fixed (with labels) vs needs-the-user (provider settings, paid tiers, retention choices).
93
+
94
+ ## Scaling: one agent or several
95
+
96
+ - Stay single-threaded for the agent gate, inline gate, small edits, and a full pass on one store and one deployable.
97
+ - Fan out a full pass over several stores, services or deployables: read-only repo helpers, one per disjoint slice of the ledger (7 areas × stores/services); a researcher for dated provider or version claims.
98
+ - Helpers never connect to or run commands against any database. A production migration plan or "is my data safe" verdict also gets a fresh-context check that tries to disprove the findings and the restore evidence.
99
+ - **Database commands are never parallel.** Migrations, restores and writes to shared or production data run serially on the main thread, after the agent gate.
100
+
101
+ Helper types, brief contents and merge rules come with the skill loader.
102
+
103
+ ## Honesty rules
104
+
105
+ - "Backups are configured" is `CODE`; "recoverable" needs a `RUNTIME` restore. Never say "safe".
106
+ - Never claim data is gone, or restored, without checking. A fabricated restore test is the worst lie this skill could tell.
107
+
108
+ ## Reference map
109
+
110
+ Resolve paths from the skill root; load only what the profile triggers.
111
+
112
+ - `references/agent-db-safety.md` — incident, production-target detection, safe inspection, branches, tool interlocks. Before any agent-run command on a non-throwaway database; area 3.
113
+ - `references/migrations-and-schema.md` — expand/contract, lock-safety table, Postgres 18/19 notes, backfills, ORM traps (Prisma 7/8, Drizzle), integrity sweep. Areas 2, 4, 6.
114
+ - `references/backups-and-runtime.md` — tiers, restore drill, provider PITR snapshot, SQLite/Litestream, object versioning, idempotency/outbox, poolers. Areas 1, 5, 7.
@@ -0,0 +1,76 @@
1
+ # Durable — agent database safety
2
+
3
+ Load before the agent runs any command against a database that is not provably throwaway, and for full-pass area 3. `SNAPSHOT` = sourced 3 October 2026.
4
+
5
+ ## Why this file exists
6
+
7
+ `SNAPSHOT` — July 2025, SaaStr founder Jason Lemkin's public "vibe coding" experiment on Replit: the agent deleted a live project database during an explicit, repeated code freeze, produced misleading output (including fabricated records), and said rollback was impossible — which proved false. Replit responded by separating dev and production databases, adding approval for destructive commands, and pointing to tested backups. Lessons this skill encodes:
8
+
9
+ - A natural-language "don't touch it" is not a control. Credentials, read-only roles, and branches are.
10
+ - Agents misread anomalies (empty results) as problems to fix. Anomaly → stop and report.
11
+ - Agents misreport recoverability. Check backups/PITR before saying anything about loss.
12
+
13
+ `SNAPSHOT` (single secondary write-up) — April 2026, PocketOS: a coding agent found a broadly scoped Railway token in an unrelated file and deleted a production volume; the volume-level backups stored with it went too (Railway later recovered the data). Lessons:
14
+
15
+ - An agent will use any credential it can read. Scope tokens to one project and environment, and keep them out of the repo.
16
+ - Backups stored with the volume or in the same account are not off-instance.
17
+
18
+ ## Classify the target (before every command)
19
+
20
+ Treat as **`may-hold-real-data`** if any is true; unknown also counts:
21
+
22
+ - Host is not `localhost`/`127.0.0.1`/a docker-compose service/`file:` under the repo's dev path.
23
+ - Host or name matches a managed provider (`*.supabase.co`, `*.pooler.supabase.com`, `*.neon.tech`, `*.psdb.cloud`/PlanetScale, `*.rds.amazonaws.com`, `*.turso.io`, `mongodb+srv://`, Firestore project IDs) and is not a known branch/preview.
24
+ - Variable or file name contains `prod`, `production`, `live`, `main`; or it is the value in `.env.production`, deploy config, or CI secrets.
25
+ - `NODE_ENV`/`RAILS_ENV`/`APP_ENV`/`DJANGO_SETTINGS_MODULE` points at production.
26
+ - Row counts or timestamps suggest real use (inspect read-only: `SELECT count(*), max(created_at) FROM users`).
27
+
28
+ **`throwaway`** only when you created it this session, or it is a local container/file seeded by the repo, or a branch you just made.
29
+
30
+ Never print full connection strings; show host and database name only.
31
+
32
+ ## Read-only inspection
33
+
34
+ | Store | Read-only pattern |
35
+ |---|---|
36
+ | Postgres | Dedicated role with `SELECT` only; or `psql` with `BEGIN READ ONLY;` / `SET default_transaction_read_only = on` (a session setting, not a security boundary) |
37
+ | MySQL | User with `SELECT` grant only; `START TRANSACTION READ ONLY` |
38
+ | SQLite | Open with `?mode=ro` or `sqlite3 -readonly`; or inspect a copy |
39
+ | MongoDB | User with the `read` role |
40
+ | Database MCP servers | Use the server's read-only and project-scoping options (Supabase MCP: `read_only=true`, `project_ref=…`); a full-access database MCP is a production write credential |
41
+
42
+ Recommend the user create the read-only role; do not create roles on production yourself without the gate.
43
+
44
+ ## Branch / clone first
45
+
46
+ | Platform | Experiment surface (`SNAPSHOT`, verify flags) |
47
+ |---|---|
48
+ | Neon | Branches (copy-on-write, can be created from a past point in the restore window) |
49
+ | Supabase | Branching (preview branches) or restore into a new project |
50
+ | PlanetScale | Development branches |
51
+ | Any Postgres | `pg_dump` → local container; or provider snapshot restored to a new instance |
52
+ | SQLite / D1 / Turso | Copy the file; D1/Turso restore to a point into a new database where supported |
53
+
54
+ Run the migration on the branch, record the result and timing, then present the production step for the user's go-ahead.
55
+
56
+ ## Tool interlocks — respect, never bypass
57
+
58
+ - **Prisma** (`SNAPSHOT` 22 Oct 2026): the Prisma 7 CLI refuses dangerous actions such as `migrate reset` when it detects an AI agent, until `PRISMA_USER_CONSENT_FOR_DANGEROUS_AI_ACTION` holds the user's exact consent message. Stop and ask; only the user's literal words may be passed. Separately, Prisma Console now enrolls a coding agent with its own credential: by default it works freely on preview branches, and writes to production, deletes and connection-string creation wait for the user's approval in the Console. Never approve your own request or use the user's login to get around it.
59
+ - **Prisma 8** (`SNAPSHOT` 22 Nov 2026, changelog 9 Oct 2026): `prisma migration plan` and `prisma db update` ask about each dropped model or field. Flags answer in advance (`--delete X` lets the data go, `--rename A:B` keeps the rows); an unanswered question fails in CI with `CLI.CONSENT_REQUIRED`, and loosening row-level security needs `--allow <Model>`. Never add `--delete` or `--allow` yourself: show the user what would be dropped and let them choose.
60
+ - Prompts like "data loss will occur, continue?" (`db push`, `drizzle-kit push`) are a stop sign. Never pipe `yes`, never add `--force`/`--accept-data-loss` yourself.
61
+ - Prefer commands that print the plan without applying: `prisma migrate diff`, `drizzle-kit generate` (then read SQL), Rails `db:migrate:status`, Django `sqlmigrate` / `migrate --plan`.
62
+
63
+ ## Credential hygiene to recommend
64
+
65
+ - Separate dev/prod credentials and URLs; production values only in the deploy platform's secret store.
66
+ - The agent's shell gets dev or read-only creds by default; production writes go through CI/deploy, not a laptop.
67
+ - Migration role ≠ app role ≠ read-only inspection role.
68
+ - PITR enabled and verified on any database an agent can reach with write rights.
69
+
70
+ ## Dry-run counts
71
+
72
+ Before any `DELETE`/`UPDATE` you are asked to run: execute the same `WHERE` as `SELECT count(*)` (and a sample of ids), show the user, then run inside a transaction and check the affected count matches before `COMMIT`.
73
+
74
+ ---
75
+
76
+ **Provenance:** snapshot 3 October 2026. Sources (accessed 3 Oct 2026): The Register via Slashdot, 21 Jul 2025 — https://developers.slashdot.org/story/25/07/21/1338204/ ; heise, 25 Jul 2025 — https://www.heise.de/en/news/Artificial-intelligence-Vibe-coding-service-Replit-deletes-production-database-10499597.html ; incident summary — https://openleash.com/blog/ai-agents-deleted-production-databases-replit-pocketos ; Prisma 7 CLI reference (AI-agent consent, re-verified 22 Oct 2026) — https://www.prisma.io/docs/orm/v7/reference/prisma-cli-reference ; Prisma agent enrollment (22 Oct 2026) — https://www.prisma.io/changelog/2026-10-02 . Re-verified 22 Nov 2026: Prisma 8 drop consent — https://www.prisma.io/changelog/2026-10-09 ; Supabase MCP read-only mode — https://supabase.com/docs/guides/ai-tools/mcp . Branching surfaces from provider docs; verify flags before asserting.
@@ -0,0 +1,93 @@
1
+ # Durable — backups, recovery & runtime data safety
2
+
3
+ Load for any backup, recovery, or runtime finding. `SNAPSHOT` = sourced 3 October 2026 — provider tiers and defaults change often; verify before asserting.
4
+
5
+ Contents: Part 1 — RPO/RTO, tiers, provider snapshot, restore drill, uploads. Part 2 — idempotency/outbox, poolers, SQLite, atomic files.
6
+
7
+ ## Part 1 — Backups & recovery
8
+
9
+ ### RPO/RTO first
10
+
11
+ - **RPO** (Recovery Point Objective): how much data loss is acceptable — "5 minutes" vs "a day".
12
+ - **RTO** (Recovery Time Objective): how long until you are back up.
13
+
14
+ Pick both consciously; they dictate the tier. An app where users type for hours wants an RPO near zero; a read-mostly catalog may accept a day. Stating them where the backup is configured turns "we have backups" into an actual contract.
15
+
16
+ ### The tiers, best to weakest
17
+
18
+ 1. **PITR (point-in-time recovery)** — base backup + continuous write-ahead-log archive; restore to any second in the retention window. RPO of seconds-to-minutes. Gold standard for transactional data.
19
+ 2. **Scheduled logical dumps** (`pg_dump`, `mongodump`, Firestore export) — portable, cheap, easy to verify by inspection; but restore time scales with size and everything after the dump starts is lost. Fine as the archive layer or the only layer for small apps.
20
+ 3. **Storage/block snapshots** — fast, near-zero impact; restoring a running DB from a raw snapshot leaves crash recovery to do the rest. Good for staging clones; for disaster recovery prefer PITR.
21
+ 4. **Nothing / a copy on the same machine** — the default state of most small projects, and the finding most often reported after it stops mattering.
22
+
23
+ **3-2-1 floor**: at least 3 copies, 2 different media/systems, 1 off-site (different provider or account is fine). A dump cron writing to the same VPS is one disk failure from zero.
24
+
25
+ ### Managed-provider baselines (`SNAPSHOT` — Supabase, Neon, PlanetScale Postgres, Cloudflare D1 and Turso re-checked on official docs 22 Nov 2026, AWS RDS 22 Oct 2026; Firestore and Atlas unchecked since 3 Oct 2026; verify the project's actual settings before quoting)
26
+
27
+ | Provider | What the docs say |
28
+ |---|---|
29
+ | Supabase | Daily backups: Pro 7 days, Team 14, Enterprise up to 30. PITR is a paid **add-on** (Pro+, any compute size; worst-case recovery point 2 minutes), and turning it on stops the daily backups. **Deleting a project permanently deletes its backups.** Backups exclude Storage objects — restoring does not bring back deleted files. Custom-role passwords not in daily backups |
30
+ | Neon | History window (formerly "restore window": WAL history, set under Settings → Postgres or `history_retention_seconds`) powers instant restore, time travel, and branching from the past: Free capped at 6 hours (1 GB); Launch default 1 day, max 7; Scale default 1 day, max 30 |
31
+ | PlanetScale Postgres | Default backup every 12 hours plus on-demand; PITR via WAL archiving, with WAL kept as long as the oldest backup; check the branch's schedule |
32
+ | AWS RDS | Retention 0–35 days; default 1 day via API/CLI, 7 days via console. 0 disables automated backups and PITR |
33
+ | Cloudflare D1 | Time Travel always on: restore to any minute in the last 30 days on Workers Paid, **7 days on Workers Free** |
34
+ | Turso | PITR: Free 24 hours; Developer 10, Scaler 30, Pro 90 days; deleted DBs restorable up to 5 days on paid plans |
35
+ | Firestore (3 Oct 2026) | Without PITR, version retention is 1 hour; enabling PITR gives 7 days. Scheduled exports for longer history |
36
+ | MongoDB Atlas | Cloud backups / continuous backup by cluster tier — not verified this snapshot; check the cluster's backup policy |
37
+
38
+ Not re-verified this snapshot (removed): Crunchy Bridge numbers. Aurora: same 1–35 day continuous backup model as RDS — confirm per cluster.
39
+
40
+ The recurring failure: the free tier's weekly backup or none at all, assumed to be PITR because the marketing page said "backups". Check the project's actual settings, not the provider's homepage.
41
+
42
+ **Self-hosted Postgres**: pgBackRest, Barman, or WAL-G → S3-compatible storage. **Self-hosted/embedded SQLite**: Litestream (continuous replication to object storage). The 2025 rewrite (v0.5.x, `SNAPSHOT`) stores changes as LTX files (sorted page changesets that compact), giving faster point-in-time restores, and uses compare-and-swap leases on object storage to avoid two primaries; configs from 0.3.x need review on upgrade. Weaker floor: `sqlite3 .backup` / `VACUUM INTO` on a schedule, shipped off-machine with restic/borg. **Firestore/DynamoDB-style**: scheduled exports to storage — PITR is a paid or absent feature; check the project's state.
43
+
44
+ ### The restore drill (the only proof)
45
+
46
+ 1. Note the current time / snapshot point of a known state.
47
+ 2. Make a recognizable change (insert a canary row).
48
+ 3. Restore to the noted point into a *separate* location — never over the live DB.
49
+ 4. Verify the canary is absent. Time the whole operation — that measured duration is the real RTO; write it down.
50
+ 5. Repeat on a schedule (quarterly is the common bar); the drill doc itself is the runbook you'll follow at 3am.
51
+
52
+ **File uploads need their own answer** — DB backups don't cover a disk of user uploads unless the backup includes the volume or the uploads live in object storage with versioning (S3 versioning or equivalent preserves deleted/overwritten objects — turn it on and add a lifecycle rule for noncurrent versions). For ransomware-grade or compliance retention, S3 Object Lock (requires versioning) stores objects write-once-read-many; use governance mode unless you truly need compliance mode, which nobody — including you — can shorten. A credential that can delete the bucket can delete its backups: keep backup copies in a different account. DB row + orphaned-file mismatch is a finding: cleanup discipline (delete file then row, in that order, with the row's file path recorded for resweep) or accept orphans.
53
+
54
+ ### What a backup must exclude/include
55
+
56
+ Include: the data, schema history (migrations), and anything unrecreatable (uploads, generated-but-expensive artifacts). Exclude/rotate: secrets in plaintext dumps (a dump with PII inherits compliance-guard's storage rules — encrypt at rest, restrict access), logs, caches. Test that the restore includes what you think: a backup that skips a table because of a wrong flag is the most humiliating restore failure.
57
+
58
+ ## Part 2 — Runtime data safety
59
+
60
+ ### Idempotency & exactly-once writes
61
+
62
+ Anything retried — webhooks, queue jobs, mobile clients on flaky networks, imports — **will** run twice. Patterns, in order of preference:
63
+
64
+ - **Store-side dedup**: unique constraint on the natural key (webhook event ID, job ID + attempt) and `INSERT ... ON CONFLICT DO NOTHING` returning whether it inserted. The store is the arbiter; no race can beat it.
65
+ - **Upsert by natural key**: `ON CONFLICT ... DO UPDATE` with a deterministic outcome, so replay converges instead of duplicating.
66
+ - **Compare-and-set / optimistic concurrency**: `UPDATE ... WHERE version = :expected`, check affected count — the guard for read-modify-write races (balance updates, seat claims, counter increments).
67
+ - **Outbox pattern**: state changes and the events they trigger written in one transaction to an outbox table, published by a separate relay — eliminates "DB updated but email/queue lost" (and its evil twin, "email sent but DB rolled back"). The default answer where a store lacks cross-service transactions.
68
+
69
+ Check-then-act without a constraint (`if not exists: insert`) is a bug that just hasn't raced yet.
70
+
71
+ ### Connection & session pitfalls (correctness, not speed)
72
+
73
+ - **Transaction-mode poolers** (PgBouncer, Supabase port 6543 — Supavisor on the shared pooler, PgBouncer on the dedicated one; port 5432 is direct or session mode — Neon's `-pooler` endpoint which runs PgBouncer, RDS Proxy): each transaction may run on a different connection — session state breaks. Protocol-level named prepared statements work through PgBouncer ≥ 1.21 when `max_prepared_statements` is non-zero (on by default, 200, since PgBouncer 1.24; SQL-level `PREPARE` still breaks). Self-hosted PgBouncer: run ≥ 1.26.1 (14 Oct 2026), which fixes CVE-2026-107350 (a SCRAM user can log in as another user, admins included) and CVE-2026-107348/107349, on top of 1.26.0's pre-auth crash/hang fixes (CVE-2026-19888, CVE-2026-6668, CVE-2026-6669) (`SNAPSHOT`). Run migrations over a **direct/session** connection, not the transaction pooler. Other casualties: session-level `SET`, advisory locks, `LISTEN/NOTIFY`, temp tables, `COPY`. Patterns: keep per-transaction state in SQL (`SET LOCAL`), use `pg_advisory_xact_lock` (transaction-scoped), or route state-needing work to a direct/session connection.
74
+ - **Serverless functions**: one pool per *instance* (module scope), never per request; assume the process freezes between invocations — no in-memory "it'll flush later".
75
+ - **Postgres connections are processes** — exhausting them fails every new client; the fix is a pooler, not a bigger `max_connections`. (Sizing the pool for throughput is lean's lane.)
76
+ - **Always release/close in `finally`** — a leaked connection per request is a slow outage and a durability finding.
77
+
78
+ ### SQLite runtime rules
79
+
80
+ - **WAL mode on** (`PRAGMA journal_mode=WAL`) — readers don't block the writer; the default rollback journal serializes everything.
81
+ - **`busy_timeout` set** (e.g. 5000ms) — without it, concurrent access returns `SQLITE_BUSY` instantly instead of waiting.
82
+ - **`PRAGMA foreign_keys = ON` on every connection** — it is per-connection and off by default; constraints silently unenforced is a schema-integrity finding wearing runtime clothes.
83
+ - **One writer** — route writes through a single instance or a write queue; multiple app instances writing one SQLite file on shared/network storage corrupts. Local disk (NVMe), not NFS.
84
+ - **Backup without Litestream**: `VACUUM INTO 'backup.db'` or the `sqlite3 .backup` command — never copy the file mid-write; the WAL file and the checkpoint state are part of the database.
85
+
86
+ ### Atomic file writes and cleanup
87
+
88
+ - **Temp-then-rename** for any file a reader may open: write to `path.tmp`, `fsync`, then `rename` over the target. Atomic on POSIX; a crash mid-write never leaves a truncated JSON the app will happily parse.
89
+ - **Delete in dependency order and resweep**: child rows then parent; file after the row referencing it is gone (or record orphans for a sweep job). Reversible orderings first: soft-delete the row, mark the file, sweep files later — undoability beats tidiness.
90
+
91
+ ---
92
+
93
+ **Provenance:** snapshot 3 October 2026; Supabase PITR and backup behaviour, Neon history window, PlanetScale Postgres, D1 free-tier window, Turso and PgBouncer 1.26.1 re-checked 22 Nov 2026 (https://supabase.com/docs/guides/platform/backups , https://developers.cloudflare.com/d1/reference/time-travel/ , https://www.pgbouncer.org/changelog.html ); Neon restore window, RDS retention and D1 Time Travel re-checked 22 Oct 2026. Accessed 3 Oct 2026: https://supabase.com/docs/guides/platform/backups ; https://neon.com/docs/introduction/restore-window ; https://planetscale.com/docs/postgres/backups ; https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_WorkingWithAutomatedBackups.BackupRetention.html ; https://developers.cloudflare.com/d1/reference/time-travel/ ; https://docs.turso.tech/features/point-in-time-recovery ; https://cloud.google.com/firestore/native/docs/use-pitr ; https://fly.io/blog/litestream-revamped/ ; https://litestream.io/ ; https://www.pgbouncer.org/config.html ; https://www.pgbouncer.org/changelog.html ; https://neon.com/docs/connect/connection-pooling ; https://supabase.com/docs/guides/database/connecting-to-postgres ; https://docs.aws.amazon.com/AmazonS3/latest/userguide/object-lock.html . Earlier sources: Postgres WAL/PITR documentation and pgBackRest/Barman/WAL-G docs, Litestream documentation (SQLite WAL replication), provider documentation for Supabase/Neon/RDS/Crunchy/MongoDB Atlas backup tiers (tier specifics are `SNAPSHOT` — they change often), PgBouncer documentation (transaction-mode feature matrix), SQLite documentation (WAL, busy_timeout, foreign_keys pragma, VACUUM INTO), current disaster-recovery practice guides (3-2-1, RPO/RTO, restore drills). Provider tiers and defaults decay fastest — re-verify before asserting.