@prestyj/cli 5.28.1 → 5.29.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.
- package/assets/motion/bin/contact-sheet.mjs +9 -3
- package/assets/motion/bin/cues.mjs +337 -0
- package/assets/motion/bin/library.mjs +53 -10
- package/assets/motion/bin/motion-blur.mjs +943 -0
- package/assets/motion/bin/motion-check.mjs +354 -3
- package/assets/motion/bin/music-fit.mjs +436 -0
- package/assets/motion/bin/pdf-extract.mjs +22 -10
- package/assets/motion/bin/reference-study.mjs +346 -0
- package/assets/motion/bin/score-synth.mjs +1052 -93
- package/assets/motion/library/README.md +50 -14
- package/assets/motion/library/kit/moves.js +1981 -0
- package/assets/motion/library/library.json +232 -0
- package/assets/motion/library/pieces/camera-rig/meta.json +13 -0
- package/assets/motion/library/pieces/camera-rig/piece.html +153 -0
- package/assets/motion/library/pieces/camera-rig/preview.jpg +0 -0
- package/assets/motion/library/pieces/chain-knock/meta.json +13 -0
- package/assets/motion/library/pieces/chain-knock/piece.html +195 -0
- package/assets/motion/library/pieces/chain-knock/preview.jpg +0 -0
- package/assets/motion/library/pieces/gather-to-logo/meta.json +13 -0
- package/assets/motion/library/pieces/gather-to-logo/piece.html +159 -0
- package/assets/motion/library/pieces/gather-to-logo/preview.jpg +0 -0
- package/assets/motion/library/pieces/morph-carry/meta.json +13 -0
- package/assets/motion/library/pieces/morph-carry/piece.html +173 -0
- package/assets/motion/library/pieces/morph-carry/preview.jpg +0 -0
- package/assets/motion/library/pieces/one-shape-journey/meta.json +13 -0
- package/assets/motion/library/pieces/one-shape-journey/piece.html +195 -0
- package/assets/motion/library/pieces/one-shape-journey/preview.jpg +0 -0
- package/assets/motion/library/pieces/open-from-subject/meta.json +13 -0
- package/assets/motion/library/pieces/open-from-subject/piece.html +168 -0
- package/assets/motion/library/pieces/open-from-subject/preview.jpg +0 -0
- package/assets/motion/library/pieces/request-to-result/meta.json +13 -0
- package/assets/motion/library/pieces/request-to-result/piece.html +212 -0
- package/assets/motion/library/pieces/request-to-result/preview.jpg +0 -0
- package/assets/motion/library/pieces/scale-dive/meta.json +13 -0
- package/assets/motion/library/pieces/scale-dive/piece.html +321 -0
- package/assets/motion/library/pieces/scale-dive/preview.jpg +0 -0
- package/assets/motion/library/pieces/screen-replica-steps/meta.json +13 -0
- package/assets/motion/library/pieces/screen-replica-steps/piece.html +366 -0
- package/assets/motion/library/pieces/screen-replica-steps/preview.jpg +0 -0
- package/assets/motion/library/pieces/zoom-into-card/meta.json +13 -0
- package/assets/motion/library/pieces/zoom-into-card/piece.html +179 -0
- package/assets/motion/library/pieces/zoom-into-card/preview.jpg +0 -0
- package/assets/motion/library/sheets/diagram.jpg +0 -0
- package/assets/motion/library/sheets/frame.jpg +0 -0
- package/assets/motion/library/sheets/transition.jpg +0 -0
- package/assets/motion/library/sheets/ui.jpg +0 -0
- package/assets/motion/references/build-sheet.md +206 -0
- package/assets/motion/references/runtime/determinism-rules.md +1 -1
- package/assets/motion/references/runtime/gsap-easing-and-stagger.md +29 -29
- package/assets/motion/references/runtime/inputs-and-assets.md +7 -12
- package/assets/motion/references/runtime/lint-validate-inspect.md +3 -3
- package/assets/motion/references/runtime/minimal-composition.md +1 -1
- package/assets/motion/references/runtime/preview-render.md +3 -3
- package/assets/motion/skills/app-walkthrough/SKILL.md +66 -0
- package/assets/motion/skills/before-after/SKILL.md +53 -0
- package/assets/motion/skills/brand-kit/SKILL.md +3 -3
- package/assets/motion/skills/dev-tool-video/SKILL.md +57 -0
- package/assets/motion/skills/launch-video/SKILL.md +62 -0
- package/assets/motion/skills/match-reference/SKILL.md +58 -0
- package/assets/motion/skills/motion/SKILL.md +78 -85
- package/assets/motion/skills/source-ingest/SKILL.md +17 -6
- package/assets/motion/skills/website-video/SKILL.md +59 -0
- package/assets/skills/bulletproof/SKILL.md +36 -11
- package/assets/skills/bulletproof/references/agent-surface.md +19 -9
- package/assets/skills/bulletproof/references/audit-protocol.md +20 -5
- package/assets/skills/bulletproof/references/platform-playbooks.md +5 -4
- package/assets/skills/bulletproof/references/provenance.md +26 -1
- package/assets/skills/bulletproof/references/secure-defaults.md +6 -5
- package/assets/skills/bulletproof/references/supply-chain.md +21 -17
- package/assets/skills/bulletproof/references/threat-landscape.md +28 -26
- package/assets/skills/bulletproof/references/verification.md +2 -0
- package/assets/skills/clarify/SKILL.md +25 -16
- package/assets/skills/code-review/SKILL.md +71 -13
- package/assets/skills/code-review/references/agent-diffs.md +27 -0
- package/assets/skills/code-review/references/tests.md +19 -0
- package/assets/skills/compliance-guard/SKILL.md +20 -5
- package/assets/skills/compliance-guard/references/artifacts.md +1 -1
- package/assets/skills/compliance-guard/references/eu-uk.md +16 -16
- package/assets/skills/compliance-guard/references/lawsuit-vectors.md +5 -5
- package/assets/skills/compliance-guard/references/provenance.md +41 -2
- package/assets/skills/compliance-guard/references/sector-gates.md +3 -3
- package/assets/skills/compliance-guard/references/security-baseline.md +2 -2
- package/assets/skills/compliance-guard/references/trigger-map.md +5 -5
- package/assets/skills/compliance-guard/references/us.md +27 -21
- package/assets/skills/durable/SKILL.md +87 -79
- package/assets/skills/durable/references/agent-db-safety.md +69 -0
- package/assets/skills/durable/references/backups-and-runtime.md +19 -12
- package/assets/skills/durable/references/migrations-and-schema.md +13 -6
- package/assets/skills/evidence-led-ui/SKILL.md +69 -127
- package/assets/skills/evidence-led-ui/references/anti-defaults.md +107 -208
- package/assets/skills/evidence-led-ui/references/direction.md +124 -0
- package/assets/skills/evidence-led-ui/references/production-contract.md +8 -0
- package/assets/skills/evidence-led-ui/references/provenance.md +24 -1
- package/assets/skills/lean/SKILL.md +90 -71
- package/assets/skills/lean/references/memory-and-processes.md +3 -2
- package/assets/skills/lean/references/playbooks.md +37 -12
- package/assets/skills/refactoring/SKILL.md +24 -3
- package/assets/skills/refactoring/references/agent-pitfalls.md +4 -1
- package/assets/skills/refactoring/references/legacy.md +21 -0
- package/assets/skills/root-cause/SKILL.md +20 -10
- package/assets/skills/shared-language/SKILL.md +16 -14
- package/assets/skills/tdd/SKILL.md +27 -15
- package/dist/app-sidecar.js +203 -47
- package/dist/app-sidecar.js.map +1 -1
- package/dist/cli.js +17 -26
- package/dist/cli.js.map +1 -1
- package/dist/core/acceptance-checks.d.ts +48 -0
- package/dist/core/acceptance-checks.js +144 -0
- package/dist/core/acceptance-checks.js.map +1 -0
- package/dist/core/agent-session.d.ts +106 -72
- package/dist/core/agent-session.js +539 -399
- package/dist/core/agent-session.js.map +1 -1
- package/dist/core/agents.d.ts +6 -5
- package/dist/core/agents.js.map +1 -1
- package/dist/core/ask-user.d.ts +90 -8
- package/dist/core/ask-user.js +124 -13
- package/dist/core/ask-user.js.map +1 -1
- package/dist/core/bundled-agents.js +1 -3
- package/dist/core/bundled-agents.js.map +1 -1
- package/dist/core/cache-diagnostics.d.ts +68 -0
- package/dist/core/cache-diagnostics.js +196 -0
- package/dist/core/cache-diagnostics.js.map +1 -0
- package/dist/core/cache-expiry.d.ts +87 -0
- package/dist/core/cache-expiry.js +111 -0
- package/dist/core/cache-expiry.js.map +1 -0
- package/dist/core/compaction/compactor.js +78 -48
- package/dist/core/compaction/compactor.js.map +1 -1
- package/dist/core/compaction/plan-step-policy.d.ts +46 -0
- package/dist/core/compaction/plan-step-policy.js +57 -0
- package/dist/core/compaction/plan-step-policy.js.map +1 -0
- package/dist/core/destructive-git-guard.d.ts +90 -0
- package/dist/core/destructive-git-guard.js +871 -0
- package/dist/core/destructive-git-guard.js.map +1 -0
- package/dist/core/event-bus.d.ts +3 -0
- package/dist/core/event-bus.js +5 -0
- package/dist/core/event-bus.js.map +1 -1
- package/dist/core/injection-detect.d.ts +38 -0
- package/dist/core/injection-detect.js +232 -0
- package/dist/core/injection-detect.js.map +1 -0
- package/dist/core/keep-awake.d.ts +88 -0
- package/dist/core/keep-awake.js +251 -0
- package/dist/core/keep-awake.js.map +1 -0
- package/dist/core/mcp/client.d.ts +72 -0
- package/dist/core/mcp/client.js +264 -41
- package/dist/core/mcp/client.js.map +1 -1
- package/dist/core/mcp/content.js +6 -2
- package/dist/core/mcp/content.js.map +1 -1
- package/dist/core/mcp/store.d.ts +6 -1
- package/dist/core/mcp/store.js +12 -1
- package/dist/core/mcp/store.js.map +1 -1
- package/dist/core/mcp/types.d.ts +18 -0
- package/dist/core/model-unavailable.d.ts +14 -0
- package/dist/core/model-unavailable.js +23 -0
- package/dist/core/model-unavailable.js.map +1 -0
- package/dist/core/node-debugger.d.ts +148 -0
- package/dist/core/node-debugger.js +642 -0
- package/dist/core/node-debugger.js.map +1 -0
- package/dist/core/package-threats.d.ts +18 -0
- package/dist/core/package-threats.js +168 -0
- package/dist/core/package-threats.js.map +1 -0
- package/dist/core/persistent-shell.d.ts +58 -6
- package/dist/core/persistent-shell.js +331 -49
- package/dist/core/persistent-shell.js.map +1 -1
- package/dist/core/process-manager.d.ts +14 -0
- package/dist/core/process-manager.js +61 -0
- package/dist/core/process-manager.js.map +1 -1
- package/dist/core/progress/git-xp.js +8 -14
- package/dist/core/progress/git-xp.js.map +1 -1
- package/dist/core/session-history.d.ts +12 -0
- package/dist/core/session-history.js +27 -0
- package/dist/core/session-history.js.map +1 -1
- package/dist/core/session-manager.d.ts +13 -1
- package/dist/core/session-manager.js +38 -18
- package/dist/core/session-manager.js.map +1 -1
- package/dist/core/session-summary-index.d.ts +37 -0
- package/dist/core/session-summary-index.js +172 -0
- package/dist/core/session-summary-index.js.map +1 -0
- package/dist/core/settings-manager.d.ts +2 -0
- package/dist/core/settings-manager.js +10 -0
- package/dist/core/settings-manager.js.map +1 -1
- package/dist/core/shell-threats-popular-packages.d.ts +11 -0
- package/dist/core/shell-threats-popular-packages.js +675 -0
- package/dist/core/shell-threats-popular-packages.js.map +1 -0
- package/dist/core/shell-threats.d.ts +8 -0
- package/dist/core/shell-threats.js +186 -0
- package/dist/core/shell-threats.js.map +1 -0
- package/dist/core/skills.js +3 -1
- package/dist/core/skills.js.map +1 -1
- package/dist/core/stream-rules.d.ts +30 -0
- package/dist/core/stream-rules.js +151 -0
- package/dist/core/stream-rules.js.map +1 -0
- package/dist/core/subagent-manager.d.ts +20 -5
- package/dist/core/subagent-manager.js +22 -8
- package/dist/core/subagent-manager.js.map +1 -1
- package/dist/core/subagent-receipt.d.ts +54 -0
- package/dist/core/subagent-receipt.js +276 -0
- package/dist/core/subagent-receipt.js.map +1 -0
- package/dist/core/subagent-turn-record.d.ts +2 -0
- package/dist/core/subagent-turn-record.js.map +1 -1
- package/dist/core/test-impact.d.ts +73 -0
- package/dist/core/test-impact.js +467 -0
- package/dist/core/test-impact.js.map +1 -0
- package/dist/core/thinking-level.d.ts +1 -1
- package/dist/core/thinking-level.js +1 -1
- package/dist/core/thinking-level.js.map +1 -1
- package/dist/core/verification-gate.d.ts +2 -0
- package/dist/core/verification-gate.js +4 -0
- package/dist/core/verification-gate.js.map +1 -1
- package/dist/core/verification-snapshot.js +3 -5
- package/dist/core/verification-snapshot.js.map +1 -1
- package/dist/core/workspace-guard.d.ts +18 -7
- package/dist/core/workspace-guard.js +227 -60
- package/dist/core/workspace-guard.js.map +1 -1
- package/dist/interactive.js +2 -1
- package/dist/interactive.js.map +1 -1
- package/dist/modes/subagent-worker-mode.js +34 -6
- package/dist/modes/subagent-worker-mode.js.map +1 -1
- package/dist/motion-agent/motion-agent.d.ts +6 -2
- package/dist/motion-agent/motion-agent.js +5 -7
- package/dist/motion-agent/motion-agent.js.map +1 -1
- package/dist/motion-agent/motion-prompt.d.ts +1 -1
- package/dist/motion-agent/motion-prompt.js +14 -19
- package/dist/motion-agent/motion-prompt.js.map +1 -1
- package/dist/motion-agent/motion-review.d.ts +10 -3
- package/dist/motion-agent/motion-review.js +15 -7
- package/dist/motion-agent/motion-review.js.map +1 -1
- package/dist/motion-agent/motion-studio-context.js +1 -1
- package/dist/motion-agent/motion-studio-context.js.map +1 -1
- package/dist/system-prompt.js +3 -1
- package/dist/system-prompt.js.map +1 -1
- package/dist/test-support/keep-alive.d.ts +14 -0
- package/dist/test-support/keep-alive.js +17 -0
- package/dist/test-support/keep-alive.js.map +1 -0
- package/dist/tools/ask-user.js +3 -3
- package/dist/tools/ask-user.js.map +1 -1
- package/dist/tools/bash-read-evidence.d.ts +10 -0
- package/dist/tools/bash-read-evidence.js +133 -0
- package/dist/tools/bash-read-evidence.js.map +1 -0
- package/dist/tools/bash.d.ts +10 -1
- package/dist/tools/bash.js +115 -7
- package/dist/tools/bash.js.map +1 -1
- package/dist/tools/debug.d.ts +54 -0
- package/dist/tools/debug.js +233 -0
- package/dist/tools/debug.js.map +1 -0
- package/dist/tools/edit.js +12 -4
- package/dist/tools/edit.js.map +1 -1
- package/dist/tools/goals.d.ts +1 -1
- package/dist/tools/index.d.ts +19 -2
- package/dist/tools/index.js +47 -7
- package/dist/tools/index.js.map +1 -1
- package/dist/tools/prompt-hints.js +2 -0
- package/dist/tools/prompt-hints.js.map +1 -1
- package/dist/tools/read-tracker.d.ts +5 -0
- package/dist/tools/read-tracker.js +19 -9
- package/dist/tools/read-tracker.js.map +1 -1
- package/dist/tools/read.js +3 -2
- package/dist/tools/read.js.map +1 -1
- package/dist/tools/skill.js +5 -0
- package/dist/tools/skill.js.map +1 -1
- package/dist/tools/subagent-control.js +44 -8
- package/dist/tools/subagent-control.js.map +1 -1
- package/dist/tools/subagent-shared.d.ts +29 -8
- package/dist/tools/subagent-shared.js +45 -14
- package/dist/tools/subagent-shared.js.map +1 -1
- package/dist/tools/subagent.d.ts +8 -2
- package/dist/tools/subagent.js +28 -10
- package/dist/tools/subagent.js.map +1 -1
- package/dist/tools/task-output.js +3 -2
- package/dist/tools/task-output.js.map +1 -1
- package/dist/tools/task-send.d.ts +1 -1
- package/dist/tools/task-send.js +15 -1
- package/dist/tools/task-send.js.map +1 -1
- package/dist/tools/tool-tiers.d.ts +2 -2
- package/dist/tools/tool-tiers.js +3 -2
- package/dist/tools/tool-tiers.js.map +1 -1
- package/dist/tools/truncate.d.ts +21 -0
- package/dist/tools/truncate.js +187 -0
- package/dist/tools/truncate.js.map +1 -1
- package/dist/tools/ui-adopt.js +2 -0
- package/dist/tools/ui-adopt.js.map +1 -1
- package/dist/ui/App.d.ts +0 -4
- package/dist/ui/App.js +5 -28
- package/dist/ui/App.js.map +1 -1
- package/dist/ui/components/ActivityIndicator.js +1 -0
- package/dist/ui/components/ActivityIndicator.js.map +1 -1
- package/dist/ui/hooks/useAgentLoop.d.ts +1 -8
- package/dist/ui/hooks/useAgentLoop.js +1 -119
- package/dist/ui/hooks/useAgentLoop.js.map +1 -1
- package/dist/ui/render.d.ts +0 -4
- package/dist/ui/render.js +0 -2
- package/dist/ui/render.js.map +1 -1
- package/dist/utils/git.d.ts +77 -0
- package/dist/utils/git.js +285 -21
- package/dist/utils/git.js.map +1 -1
- package/dist/utils/github-ci.js +2 -1
- package/dist/utils/github-ci.js.map +1 -1
- package/dist/utils/github.js +11 -9
- package/dist/utils/github.js.map +1 -1
- package/dist/utils/image.d.ts +14 -0
- package/dist/utils/image.js +16 -0
- package/dist/utils/image.js.map +1 -1
- package/dist/utils/process.d.ts +20 -0
- package/dist/utils/process.js +98 -0
- package/dist/utils/process.js.map +1 -1
- package/package.json +5 -5
- package/assets/motion/references/motion-language.md +0 -128
- package/assets/motion/skills/video-qa/SKILL.md +0 -89
- package/dist/core/ideal-review-subagent.d.ts +0 -56
- package/dist/core/ideal-review-subagent.js +0 -112
- package/dist/core/ideal-review-subagent.js.map +0 -1
- package/dist/core/ideal-review.d.ts +0 -82
- package/dist/core/ideal-review.js +0 -242
- package/dist/core/ideal-review.js.map +0 -1
- package/dist/motion-agent/motion-check-tool.d.ts +0 -35
- package/dist/motion-agent/motion-check-tool.js +0 -514
- package/dist/motion-agent/motion-check-tool.js.map +0 -1
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Observable fact → what it triggers → what to actually do. This is the routing index; depth lives in the jurisdiction and vector files.
|
|
4
4
|
|
|
5
|
-
Status markers: **[V]** verified against a primary source
|
|
5
|
+
Status markers: **[V]** verified against a primary source (11 Aug 2026 snapshot, spot re-verified 3 Oct 2026 — see `provenance.md`) · **[S]** snapshot claim, re-verify date/threshold before asserting · **[U]** uncertain or contested, present as uncertain.
|
|
6
6
|
|
|
7
7
|
---
|
|
8
8
|
|
|
@@ -100,15 +100,15 @@ Status markers: **[V]** verified against a primary source in the 11 Aug 2026 sna
|
|
|
100
100
|
|
|
101
101
|
| Observed fact | Triggers | Do this |
|
|
102
102
|
|---|---|---|
|
|
103
|
-
| User-facing chatbot | EU AI Act Art 50 disclosure **[V]**; several US state chatbot-disclosure laws **[V]** | Persistent "you are talking to an AI" disclosure, not buried in terms |
|
|
104
|
-
| Companion / emotional / therapy-adjacent chatbot | Companion-AI laws + AI-therapy bans **[V]** | **Gate** —
|
|
103
|
+
| User-facing chatbot | EU AI Act Art 50 disclosure **[V]**; several US state chatbot-disclosure laws **[V]** | Persistent "you are talking to an AI" disclosure, not buried in terms. See `eu-uk.md` §3 (Art 50) and `us.md` §5 |
|
|
104
|
+
| Companion / emotional / therapy-adjacent chatbot | Companion-AI laws + AI-therapy bans **[V]** | **Gate** — `sector-gates.md` §1 and §5, `us.md` §2 (CA SB 243, PRA) and §5. Crisis protocol, minor protections, and in some states you cannot offer therapy at all |
|
|
105
105
|
| Scoring emotion, confidence, engagement or sincerity from face/voice in **hiring, work, or education** | EU AI Act Art 5(1)(f) **prohibited practice** **[V]** | **ILLEGAL in the EU — remove the feature.** Not curable by disclosure or consent. See `eu-uk.md` Art 5 |
|
|
106
106
|
| Inferring race, ethnicity, gender, religion, union membership or sexual orientation from a photo, face or voice | EU AI Act Art 5(1)(g) **prohibited** **[V]**; discrimination law everywhere | **ILLEGAL in the EU — delete the field and the model.** Also a discrimination claim if it touches any decision |
|
|
107
107
|
| Building a face database by scraping images from the web or CCTV | EU AI Act Art 5(1)(e) **prohibited** **[V]** | **ILLEGAL in the EU.** Also BIPA and scraping exposure |
|
|
108
108
|
| Cross-context "trust score" or "reputation score" affecting unrelated treatment | EU AI Act Art 5(1)(c) social scoring **[V]** | **Gate** — narrow the score to the context it was collected for |
|
|
109
|
-
| Generated images/audio/video | Synthetic-content marking duties **[V]** | Machine-readable provenance (C2PA-style) + visible label where required |
|
|
109
|
+
| Generated images/audio/video | Synthetic-content marking duties **[V]** | Machine-readable provenance (C2PA-style) + visible label where required. EU: Art 50(2)/(4), legacy systems by 2 Dec 2026 — `eu-uk.md` §3. CA SB 942/AB 853 if >1M monthly users — `us.md` §2. Sexual deepfakes of real people: `sector-gates.md` §6 |
|
|
110
110
|
| AI in hiring, lending, housing, insurance, education, essential services | High-risk/ADS regimes **[V]** | Notice, human review, bias testing, records, adverse-action reasons. LAWYER item |
|
|
111
|
-
| Training or fine-tuning on user data | Lawful basis, notice, opt-in expectations, training-data disclosure laws **[S]** | Default to opt-out-by-default = off; document data sources; check vendor terms |
|
|
111
|
+
| Training or fine-tuning on user data | Lawful basis, notice, opt-in expectations, training-data disclosure laws **[S]** | Default to opt-out-by-default = off; document data sources; check vendor terms. CA AB 2013 (no size threshold) — `us.md` §2 |
|
|
112
112
|
| Agent with tool access / code execution | Prompt injection, exfiltration, cost abuse | See `security-baseline.md` §9 — this is a security blocker, not a policy item |
|
|
113
113
|
| Sending user PII to an LLM vendor | Processor relationship, transfers, retention | Sign the DPA, use zero/limited-retention endpoints, redact before send, disclose the vendor |
|
|
114
114
|
| Marketing claims like "AI-powered", "99% accurate", "fully automated" | Deceptive-claims enforcement **[V]** | Keep a dated substantiation file mapping each claim to evidence |
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# United States
|
|
2
2
|
|
|
3
|
-
Snapshot **11 Aug 2026
|
|
3
|
+
Snapshot **11 Aug 2026**, spot re-verified 3 Oct 2026 (see `provenance.md`). Markers: **[V]** verified against a primary/first-tier source · **[S]** snapshot, re-verify · **[U]** contested or fast-moving.
|
|
4
4
|
|
|
5
5
|
**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.
|
|
6
6
|
|
|
@@ -23,11 +23,11 @@ Also note **Texas and Nebraska have no revenue or volume threshold** — they ap
|
|
|
23
23
|
|
|
24
24
|
## 1. State comprehensive privacy laws
|
|
25
25
|
|
|
26
|
-
**In force in 2026: 20 states** (CA, VA, CO, CT, UT, TX, OR, MT, IA, DE, NE, NH, NJ, TN, MN, MD, IN, KY, RI
|
|
26
|
+
**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.
|
|
27
27
|
|
|
28
28
|
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]**.
|
|
29
29
|
|
|
30
|
-
**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 do not **[V]**.
|
|
30
|
+
**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]**.
|
|
31
31
|
|
|
32
32
|
```
|
|
33
33
|
Read the Sec-GPC: 1 request header and navigator.globalPrivacyControl.
|
|
@@ -55,12 +55,12 @@ Honouring GPC for **every** visitor is the safe default: it satisfies the strict
|
|
|
55
55
|
|
|
56
56
|
**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]**.
|
|
57
57
|
|
|
58
|
-
**2026 regulations package (effective 1 Jan 2026)** **[V]**:
|
|
59
|
-
- *Risk assessments* —
|
|
60
|
-
- *ADMT* — pre-use notice, access, and opt-out for automated decision-making about significant decisions (including employees, contractors, applicants). **Compliance deadline 1 Jan 2027
|
|
61
|
-
- *Cyber audits* — only above revenue plus scale thresholds; first certifications
|
|
58
|
+
**2026 regulations package (effective 1 Jan 2026; approved by OAL 22 Sep 2025, per cppa.ca.gov)** **[V]**:
|
|
59
|
+
- *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.
|
|
60
|
+
- *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.
|
|
61
|
+
- *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.
|
|
62
62
|
|
|
63
|
-
**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]**. Enforcement has already hit companies of exactly this size. Ask at design review: *do we sell PI of people who never used us?*
|
|
63
|
+
**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]**. Enforcement has already hit companies of exactly this size. Ask at design review: *do we sell PI of people who never used us?*
|
|
64
64
|
|
|
65
65
|
**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]**.
|
|
66
66
|
|
|
@@ -68,7 +68,7 @@ Honouring GPC for **every** visitor is the safe default: it satisfies the strict
|
|
|
68
68
|
|
|
69
69
|
**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.
|
|
70
70
|
|
|
71
|
-
**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. **PRA: YES** — minimum $1,000 damages plus fees, and UCL pairing can reach individuals personally **[V]**.
|
|
71
|
+
**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]**.
|
|
72
72
|
|
|
73
73
|
**Employment ADS regulations** under state anti-discrimination law add notice and recordkeeping duties for automated decision systems **[S]**.
|
|
74
74
|
|
|
@@ -76,7 +76,7 @@ Honouring GPC for **every** visitor is the safe default: it satisfies the strict
|
|
|
76
76
|
|
|
77
77
|
## 3. Children and teens
|
|
78
78
|
|
|
79
|
-
**COPPA amended Rule — full compliance date 22 Apr 2026** **[
|
|
79
|
+
**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:
|
|
80
80
|
|
|
81
81
|
- **Separate** verifiable parental consent for disclosing children's data to third parties (including for targeted advertising).
|
|
82
82
|
- New **data-retention limits** and a **published written retention policy** — indefinite retention is prohibited.
|
|
@@ -84,13 +84,19 @@ Honouring GPC for **every** visitor is the safe default: it satisfies the strict
|
|
|
84
84
|
- A written children's information security programme with vendor due diligence.
|
|
85
85
|
- Parent review/deletion flows must cover biometric data.
|
|
86
86
|
|
|
87
|
-
**App Store Accountability Acts (TX, UT, LA, AL
|
|
87
|
+
**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 3 Oct 2026:
|
|
88
|
+
- **Texas SB 2420** — in effect since the Fifth Circuit's 4 June 2026 stay pending appeal; the Supreme Court declined to block it; the merits appeal continues **[U]** (secondary sources only; court orders not opened).
|
|
89
|
+
- **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]**.
|
|
90
|
+
- **Louisiana** — HB 977 (signed 15 May 2026) pushed the effective date to **1 July 2027** **[S]**.
|
|
91
|
+
- **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]**.
|
|
92
|
+
- **Alabama** — enacted; effective date not re-verified **[U]**.
|
|
93
|
+
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.
|
|
88
94
|
|
|
89
95
|
**NY SAFE for Kids** — final rules July 2026, effective **25 Jan 2027**, targeting platforms with addictive feeds **[V]**.
|
|
90
96
|
|
|
91
97
|
**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.
|
|
92
98
|
|
|
93
|
-
**TAKE IT DOWN Act §3 (NCII) — enforced from 19 May 2026, and it reaches tiny platforms** **[V]
|
|
99
|
+
**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.
|
|
94
100
|
|
|
95
101
|
**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.
|
|
96
102
|
|
|
@@ -100,7 +106,7 @@ Honouring GPC for **every** visitor is the safe default: it satisfies the strict
|
|
|
100
106
|
|
|
101
107
|
**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.
|
|
102
108
|
|
|
103
|
-
**Washington My Health My Data Act — the top small-company landmine.** **No revenue or volume threshold**, in effect since 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
|
|
109
|
+
**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]**.
|
|
104
110
|
|
|
105
111
|
**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.
|
|
106
112
|
|
|
@@ -114,8 +120,8 @@ Honouring GPC for **every** visitor is the safe default: it satisfies the strict
|
|
|
114
120
|
|
|
115
121
|
## 5. AI laws
|
|
116
122
|
|
|
117
|
-
- **Colorado** —
|
|
118
|
-
- **Texas TRAIGA** — effective 1 Jan 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.
|
|
123
|
+
- **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 come from law-firm summaries **[U]** until the enrolled text is read. AG implementing rules are still to come; re-check them before building **[S]**.
|
|
124
|
+
- **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.
|
|
119
125
|
- **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]**.
|
|
120
126
|
- **NYC Local Law 144** — annual independent bias audit plus published summary and candidate notice for automated employment decision tools used for NYC roles **[V]**.
|
|
121
127
|
- **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]**.
|
|
@@ -129,11 +135,11 @@ Honouring GPC for **every** visitor is the safe default: it satisfies the strict
|
|
|
129
135
|
|
|
130
136
|
- **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.
|
|
131
137
|
- **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]**.
|
|
132
|
-
- **Negative option / click-to-cancel** — the
|
|
133
|
-
- **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]**.
|
|
138
|
+
- **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]**.
|
|
139
|
+
- **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]**. The 2024 "revoke-all" rule was deferred to 31 Jan 2027; on 30 Sept 2026 the FCC reportedly adopted a revised order (informational opt-outs may be limited to that message category; marketing opt-outs still stop all marketing; senders may designate exclusive opt-out methods if disclosed clearly), effective 30 days after Federal Register publication **[U]** until the published text is checked. Build to the strict reading: any STOP-type reply stops all marketing on every channel.
|
|
134
140
|
- **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]**.
|
|
135
141
|
- **State breach notification** — all states; deadlines and AG-notice thresholds vary; several sector rules add shorter clocks **[V]**.
|
|
136
|
-
- **ADA accessibility** — Title II
|
|
142
|
+
- **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.
|
|
137
143
|
- **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]**.
|
|
138
144
|
- **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]**.
|
|
139
145
|
- **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.**
|
|
@@ -145,8 +151,8 @@ Honouring GPC for **every** visitor is the safe default: it satisfies the strict
|
|
|
145
151
|
1. California CIPA (trackers, pixels, chat widgets, session replay) — $5,000 per violation, no threshold **[V]**
|
|
146
152
|
2. ADA Title III accessibility (plus state statutory damages) **[V]**
|
|
147
153
|
3. TCPA/SMS — $500–$1,500 per message, uncapped **[V]**
|
|
148
|
-
4. Illinois BIPA — per-person statutory damages, a single in-state user suffices **[
|
|
149
|
-
5. Washington MHMDA — up to $
|
|
154
|
+
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]**
|
|
155
|
+
5. Washington MHMDA — actual damages trebled up to $25,000 plus fees, extremely broad health-data definition **[S]**
|
|
150
156
|
6. Auto-renewal claims via state consumer statutes **[V]**
|
|
151
157
|
7. CCPA breach claims — $107–$799 per consumer, filed reflexively after AG breach reports **[V]**
|
|
152
158
|
8. California SB 243 companion chatbots — new, untested, minimum $1,000 plus fees **[V]**
|
|
@@ -161,4 +167,4 @@ Honouring GPC for **every** visitor is the safe default: it satisfies the strict
|
|
|
161
167
|
|
|
162
168
|
## 8. Verify before relying
|
|
163
169
|
|
|
164
|
-
Colorado
|
|
170
|
+
Colorado AG rules under SB 26-189 · Vermont and Nebraska children's-code dates · the FCC's revised TCPA revocation order (text and effective date) · 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.
|
|
@@ -1,111 +1,119 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: durable
|
|
3
|
-
description: Use when user data must not be lost or corrupted — creating the first
|
|
3
|
+
description: Use when user data must not be lost or corrupted — creating the first table/schema, writing or running migrations, backfills/imports, any destructive op (delete, drop, truncate, reset, overwrite), before the agent itself runs a command against a database that may hold real data, setting up backups/recovery, or moving data between systems; plus "is my data safe / back up my app" checks. Any store — SQL, document, serverless, files, queues. Do NOT use for query speed or pool sizing (that is lean), access control over data (that is bulletproof), or privacy/legal deletion regimes (that is compliance-guard).
|
|
4
4
|
license: Data-durability engineering guidance, not a DBA certification. Sources and snapshot date are recorded at the foot of each reference file.
|
|
5
|
-
compatibility: Snapshot dated
|
|
5
|
+
compatibility: Snapshot dated 3 October 2026. Version behaviours, provider retention defaults and tool flags decay — re-verify with web access before asserting them as current.
|
|
6
6
|
---
|
|
7
7
|
|
|
8
8
|
# Durable
|
|
9
9
|
|
|
10
|
-
|
|
10
|
+
**Route first:**
|
|
11
11
|
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
12
|
+
| You are… | Mode | Do next |
|
|
13
|
+
|---|---|---|
|
|
14
|
+
| 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. |
|
|
15
|
+
| 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. |
|
|
16
|
+
| 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. |
|
|
15
17
|
|
|
16
|
-
|
|
17
|
-
2. **Destructive operations are guilty until proven guarded.** Any `DROP`, `TRUNCATE`, `DELETE`, `UPDATE` without a `WHERE`, or overwrite of a column/file gets: a guard (`WHERE` + `LIMIT`), a dry-run count first, a backup or snapshot when anything of value exists, and an undo path (soft delete, staging table, or copy) for user-facing data.
|
|
18
|
-
3. **Migrations are code that runs on data you cannot recreate.** Checked in from day one, reviewed as SQL before applying (ORM-generated SQL included — generators will happily emit `DROP COLUMN` for a rename), never edited once applied, forward-only in production. `db push`-style sync is for throwaway dev databases only.
|
|
19
|
-
4. **One logical change, one transaction.** Multi-step writes either all land or none do. Anything a retry can hit twice (webhooks, queue jobs, imports, payment callbacks) is idempotent — a dedup key or upsert, not hope.
|
|
20
|
-
5. **Backups you have not restored are fiction.** Automated, off-platform (or at least off-instance), on anything with real user data — and the restore is exercised, timed, and recorded. RPO (how much loss is acceptable) and RTO (how long recovery takes) are stated numbers, not vibes.
|
|
21
|
-
6. **Fail loudly, not corruptly.** Partial imports, half-applied backfills, and crashed jobs leave the system in a state the next run can detect and resume — keyset-resumable batches, recorded checkpoints, no silent skips.
|
|
22
|
-
7. **Respect the writer.** SQLite has one writer; Postgres connections are processes; serverless poolers multiplex transactions and break session state. Designing against the store's real concurrency model is durability work, not just performance work.
|
|
23
|
-
8. **Numbers or silence.** A backup claim without a timed restore run is unverified. Label every claim `RUNTIME` (observed), `CODE` (read in source), `DEDUCED` (inferred), `SNAPSHOT` (dated source). Never claim data is "safe" — say what loss is survivable and what is not.
|
|
24
|
-
9. **Proportionality.** A prototype with test rows needs migrations and little else. The first real user row raises the floor: backups, then tested restore, then PITR-class recovery as the product matters.
|
|
18
|
+
Users forgive slow and ugly; they do not forgive gone. Never say data is "safe" — say what loss is survivable and what is not.
|
|
25
19
|
|
|
26
|
-
##
|
|
20
|
+
## Agent gate — binding rules for you, the agent
|
|
27
21
|
|
|
28
|
-
|
|
22
|
+
Coding agents have wiped production data: in July 2025 Replit's agent deleted a live project database during an explicit code freeze, then wrongly said rollback was impossible (`SNAPSHOT`; details in `references/agent-db-safety.md`). The freeze was only a natural-language instruction; nothing mechanical enforced it. These rules are the mechanism.
|
|
29
23
|
|
|
30
|
-
|
|
24
|
+
1. **Identify the target before every command.** Resolve which database the command will hit (env var, config file, `--url`, ORM config). Classify it `throwaway` / `shared-dev` / `may-hold-real-data` using the detection list in `references/agent-db-safety.md`. Unknown = `may-hold-real-data`.
|
|
25
|
+
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.
|
|
26
|
+
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`.
|
|
27
|
+
4. **Experiment on a branch, not the original.** Prefer a Neon / Supabase / PlanetScale branch, a restored clone, or a local copy; prove the change there, then hand the production step back with evidence.
|
|
28
|
+
5. **Never bypass a tool's safety interlock yourself.** If a CLI refuses because it detected an agent (e.g. Prisma's AI-consent check) or asks for confirmation, stop and ask — never set a consent variable or pass `--force`/`--yes` on your own initiative.
|
|
29
|
+
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.
|
|
30
|
+
7. **Report exactly what you ran** — every command that touched a database, its target, and its result, including mistakes, immediately.
|
|
31
31
|
|
|
32
|
-
|
|
32
|
+
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`.
|
|
33
33
|
|
|
34
|
-
|
|
34
|
+
## Governing rules
|
|
35
35
|
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
36
|
+
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.
|
|
37
|
+
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.
|
|
38
|
+
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.
|
|
39
|
+
4. **One logical change, one transaction; anything retried is idempotent.**
|
|
40
|
+
5. **Backups you have not restored are fiction.** Automated, off-instance, stated RPO/RTO, timed restore drill.
|
|
41
|
+
6. **Fail loudly, not corruptly.** Bulk jobs are keyset-resumable with durable checkpoints.
|
|
42
|
+
7. **Respect the store's concurrency model** — SQLite has one writer; transaction poolers break session state.
|
|
43
|
+
8. **Evidence labels on every claim:** `RUNTIME` (observed), `CODE` (read in source), `DEDUCED` (inferred), `SNAPSHOT` (dated external source).
|
|
44
|
+
9. **Proportionality.** Test rows need migrations; the first real user row raises the floor to backups, then tested restore, then PITR.
|
|
45
|
+
|
|
46
|
+
## Binding defaults (inline gate)
|
|
47
|
+
|
|
48
|
+
- **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.
|
|
49
|
+
- **Destructive code carries its guard**: count-first, `WHERE` + batch, soft delete (`deleted_at` + partial unique index) for user-visible data.
|
|
50
|
+
- **Constraints in the store** per rule 1; integer cents or `NUMERIC` for money; `bigint`/UUID keys (Postgres 18 has built-in `uuidv7()` for time-ordered IDs).
|
|
51
|
+
- **Transactions around multi-write invariants**; across systems, use an outbox.
|
|
52
|
+
- **Idempotency keys on retried writes**: unique event/job IDs + `INSERT … ON CONFLICT`.
|
|
53
|
+
- **Batched, resumable bulk work** (keyset, fixed batch, checkpoint, sleep) — never one unbounded `UPDATE` on production.
|
|
54
|
+
- **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.
|
|
55
|
+
- **Separate credentials per environment**; production URL never the default in local `.env`.
|
|
56
|
+
- **Serverless connections**: assume transaction-mode pooling (no session state); one pool per instance; release in `finally`.
|
|
57
|
+
- **SQLite as SQLite**: WAL, `busy_timeout`, `foreign_keys=ON` per connection, one writer, local disk, continuous or scheduled backup.
|
|
45
58
|
|
|
46
59
|
## Full-pass workflow
|
|
47
60
|
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
### 2. Establish what loss would mean
|
|
53
|
-
|
|
54
|
-
From the code, answer: what is recreated (cache, derived data), what is user-entered and unrecoverable (posts, uploads, messages, payments), and what links out (files on disk referenced by rows, rows referencing deleted files). The unrecoverable set defines backup urgency; the links define cleanup discipline.
|
|
55
|
-
|
|
56
|
-
### 3. Sweep the six areas
|
|
61
|
+
1. **Profile from the code.** Stores and versions, migration tooling, every write/delete path, backup config, environments and credentials, and — decisive — whether real user data exists.
|
|
62
|
+
2. **Define loss.** Recreatable (caches, derived) vs unrecoverable (user content, uploads, payments), and what links out (rows ↔ files).
|
|
63
|
+
3. **Sweep the seven areas** (detail in references):
|
|
57
64
|
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
| # | Area | What you are hunting |
|
|
65
|
+
| # | Area | Hunting for |
|
|
61
66
|
|---|---|---|
|
|
62
|
-
| 1 |
|
|
63
|
-
| 2 |
|
|
64
|
-
| 3 |
|
|
65
|
-
| 4 |
|
|
66
|
-
| 5 |
|
|
67
|
-
| 6 |
|
|
67
|
+
| 1 | Backups & recovery | None; same machine/account only; free tier assumed to be PITR; never restored; no RPO/RTO; unversioned upload buckets |
|
|
68
|
+
| 2 | Destructive paths | Unguarded `DELETE`/`UPDATE`; cascades sweeping too far; reset/push/drop in scripts or CI near production config |
|
|
69
|
+
| 3 | Agent & credential exposure | Prod write URL in local `.env`; agent/CI tokens with DDL rights; no branch/dev DB to experiment on |
|
|
70
|
+
| 4 | Migrations health | No tooling; edited applied migrations; unreviewed destructive SQL; lock-unsafe DDL; drift |
|
|
71
|
+
| 5 | Transactions & idempotency | Multi-writes without a transaction; double-apply on retry; check-then-act races |
|
|
72
|
+
| 6 | Schema integrity | Missing FKs/uniques/`NOT NULL`; orphans; float money; int IDs near overflow |
|
|
73
|
+
| 7 | Runtime data safety | Session state through transaction poolers; SQLite multi-writer; non-atomic file writes; no dead-letter path |
|
|
68
74
|
|
|
69
|
-
|
|
75
|
+
4. **Rank by survivability.**
|
|
70
76
|
|
|
71
77
|
| Severity | Meaning |
|
|
72
78
|
|---|---|
|
|
73
|
-
|
|
|
74
|
-
|
|
|
75
|
-
|
|
|
76
|
-
|
|
|
77
|
-
|
|
78
|
-
Fix Critical and High first
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
-
|
|
83
|
-
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
79
|
+
| 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 |
|
|
80
|
+
| High | Loss on a plausible bad day: never-restored backups; single copy; broad cascades; multi-writes without transactions |
|
|
81
|
+
| Medium | Bites at scale or in recovery: missing constraints, drift, non-idempotent jobs, non-atomic writes |
|
|
82
|
+
| Low | Hygiene; fix only when adjacent |
|
|
83
|
+
|
|
84
|
+
5. **Fix Critical and High first** (three to five, each verified).
|
|
85
|
+
6. **Verify.**
|
|
86
|
+
- *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.
|
|
87
|
+
- *Guard drill* (destructive fix): on a copy, one row that must survive and one that must not; assert both.
|
|
88
|
+
- *Migration drill*: apply pending migrations to a branch or prod-shaped copy first, with `lock_timeout` set.
|
|
89
|
+
- Anything you could not run: label it unverified and give the user the exact command.
|
|
90
|
+
7. **Leave a guard behind**: CI applying migrations to a throwaway DB, a migration linter, a scheduled restore test, a constraint, a read-only role for agents.
|
|
91
|
+
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).
|
|
92
|
+
|
|
93
|
+
## Scaling: one agent or several
|
|
94
|
+
|
|
95
|
+
| Situation | Policy |
|
|
96
|
+
|---|---|
|
|
97
|
+
| Agent gate, inline gate, small edits | Main thread only. Never spawn. |
|
|
98
|
+
| Full pass, one deployable, one store | Main thread builds the ledger (7 areas × stores/services) and works every row itself. |
|
|
99
|
+
| Full pass, several stores/services/deployables, or more rows than you can read fully | One read-only child per disjoint slice, all in ONE `spawn_agent` call (≤ 6). `owl` for code slices; `researcher` for dated provider/version claims. |
|
|
100
|
+
| Production migration plan or "is my data safe" verdict | Add a fresh-context verifier child that tries to disprove the findings and the restore evidence. |
|
|
92
101
|
|
|
93
|
-
-
|
|
94
|
-
-
|
|
95
|
-
-
|
|
96
|
-
-
|
|
97
|
-
- Label every claim `RUNTIME` / `CODE` / `DEDUCED` / `SNAPSHOT`.
|
|
102
|
+
- **Every ledger row ends** checked-with-findings / checked-clean / not-checked(reason). A child that fails, times out or omits a row → `not checked`, never clean.
|
|
103
|
+
- **Child briefs are self-contained**: absolute skill root, which reference to read, slice paths, owned rows, evidence labels, output schema (findings with file:line, label, severity, fix; `checked` / `not checked` lists), and: *read-only — never connect to or run commands against any database*.
|
|
104
|
+
- **Child output is evidence, not truth**: re-open each file:line before reporting.
|
|
105
|
+
- **Database commands are never parallel.** Migrations, restores, and any write against shared or production data are executed serially by the main thread after the agent gate — never by children. Code fixes are main-thread or `bee` on strictly disjoint files; run checks once after merging.
|
|
98
106
|
|
|
99
107
|
## Honesty rules
|
|
100
108
|
|
|
101
|
-
-
|
|
102
|
-
-
|
|
103
|
-
- Never
|
|
104
|
-
- "I could not verify this" is a legitimate output. A fabricated restore test is the worst lie this skill could tell.
|
|
109
|
+
- "Backups are configured" is `CODE`; "recoverable" needs a `RUNTIME` restore. Never say "safe".
|
|
110
|
+
- Provider retention, tiers and version behaviour are `SNAPSHOT` with a date — verify before quoting.
|
|
111
|
+
- Never claim data is gone, or restored, without checking. A fabricated restore test is the worst lie this skill could tell.
|
|
105
112
|
|
|
106
113
|
## Reference map
|
|
107
114
|
|
|
108
|
-
Resolve
|
|
115
|
+
Resolve paths from the installed skill root; load only what the profile triggers.
|
|
109
116
|
|
|
110
|
-
- `references/
|
|
111
|
-
- `references/
|
|
117
|
+
- `references/agent-db-safety.md` — incident record, production-target detection, safe inspection, branch/clone workflow, tool interlocks. Read before any agent-run database command on a non-throwaway target, and for area 3.
|
|
118
|
+
- `references/migrations-and-schema.md` — expand/contract, lock-safety table with `lock_timeout`, Postgres 18 notes, backfills, ORM traps (Prisma 7, Drizzle, framework linters), integrity sweep. Read for areas 2, 4, 6.
|
|
119
|
+
- `references/backups-and-runtime.md` — tiers and restore drill, provider PITR snapshot, Litestream 0.5 and SQLite backups, object versioning/Object Lock, idempotency/outbox, poolers. Read for areas 1, 5, 7.
|
|
@@ -0,0 +1,69 @@
|
|
|
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
|
+
## Classify the target (before every command)
|
|
14
|
+
|
|
15
|
+
Treat as **`may-hold-real-data`** if any is true; unknown also counts:
|
|
16
|
+
|
|
17
|
+
- Host is not `localhost`/`127.0.0.1`/a docker-compose service/`file:` under the repo's dev path.
|
|
18
|
+
- 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.
|
|
19
|
+
- Variable or file name contains `prod`, `production`, `live`, `main`; or it is the value in `.env.production`, deploy config, or CI secrets.
|
|
20
|
+
- `NODE_ENV`/`RAILS_ENV`/`APP_ENV`/`DJANGO_SETTINGS_MODULE` points at production.
|
|
21
|
+
- Row counts or timestamps suggest real use (inspect read-only: `SELECT count(*), max(created_at) FROM users`).
|
|
22
|
+
|
|
23
|
+
**`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.
|
|
24
|
+
|
|
25
|
+
Never print full connection strings; show host and database name only.
|
|
26
|
+
|
|
27
|
+
## Read-only inspection
|
|
28
|
+
|
|
29
|
+
| Store | Read-only pattern |
|
|
30
|
+
|---|---|
|
|
31
|
+
| 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) |
|
|
32
|
+
| MySQL | User with `SELECT` grant only; `START TRANSACTION READ ONLY` |
|
|
33
|
+
| SQLite | Open with `?mode=ro` or `sqlite3 -readonly`; or inspect a copy |
|
|
34
|
+
| MongoDB | User with the `read` role |
|
|
35
|
+
|
|
36
|
+
Recommend the user create the read-only role; do not create roles on production yourself without the gate.
|
|
37
|
+
|
|
38
|
+
## Branch / clone first
|
|
39
|
+
|
|
40
|
+
| Platform | Experiment surface (`SNAPSHOT`, verify flags) |
|
|
41
|
+
|---|---|
|
|
42
|
+
| Neon | Branches (copy-on-write, can be created from a past point in the restore window) |
|
|
43
|
+
| Supabase | Branching (preview branches) or restore into a new project |
|
|
44
|
+
| PlanetScale | Development branches |
|
|
45
|
+
| Any Postgres | `pg_dump` → local container; or provider snapshot restored to a new instance |
|
|
46
|
+
| SQLite / D1 / Turso | Copy the file; D1/Turso restore to a point into a new database where supported |
|
|
47
|
+
|
|
48
|
+
Run the migration on the branch, record the result and timing, then present the production step for the user's go-ahead.
|
|
49
|
+
|
|
50
|
+
## Tool interlocks — respect, never bypass
|
|
51
|
+
|
|
52
|
+
- **Prisma** (`SNAPSHOT`): dangerous CLI actions such as `migrate reset` refuse when run by a detected AI agent and require `PRISMA_USER_CONSENT_FOR_DANGEROUS_AI_ACTION` set to the user's exact consent message. Stop and ask; only the user's literal words may be passed.
|
|
53
|
+
- 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.
|
|
54
|
+
- 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`.
|
|
55
|
+
|
|
56
|
+
## Credential hygiene to recommend
|
|
57
|
+
|
|
58
|
+
- Separate dev/prod credentials and URLs; production values only in the deploy platform's secret store.
|
|
59
|
+
- The agent's shell gets dev or read-only creds by default; production writes go through CI/deploy, not a laptop.
|
|
60
|
+
- Migration role ≠ app role ≠ read-only inspection role.
|
|
61
|
+
- PITR enabled and verified on any database an agent can reach with write rights.
|
|
62
|
+
|
|
63
|
+
## Dry-run counts
|
|
64
|
+
|
|
65
|
+
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`.
|
|
66
|
+
|
|
67
|
+
---
|
|
68
|
+
|
|
69
|
+
**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 CLI reference (AI-agent consent) — https://www.prisma.io/docs/orm/reference/prisma-cli-reference . Branching surfaces from provider docs; verify flags before asserting.
|