lastlight-core 0.25.9 → 0.27.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 (234) hide show
  1. package/config/default.yaml +317 -1
  2. package/dist/admin/chat-session-reader.d.ts +3 -3
  3. package/dist/admin/chat-session-reader.js +8 -8
  4. package/dist/admin/chat-session-reader.js.map +1 -1
  5. package/dist/admin/docker.js.map +1 -1
  6. package/dist/admin/routes.js +97 -99
  7. package/dist/admin/routes.js.map +1 -1
  8. package/dist/admin/sessions.d.ts +7 -7
  9. package/dist/admin/sessions.js +6 -4
  10. package/dist/admin/sessions.js.map +1 -1
  11. package/dist/admin/tail.js.map +1 -1
  12. package/dist/config/config.d.ts +29 -0
  13. package/dist/config/config.js +141 -0
  14. package/dist/config/config.js.map +1 -1
  15. package/dist/config/repo-config.js +6 -7
  16. package/dist/config/repo-config.js.map +1 -1
  17. package/dist/connectors/messaging/base.js +2 -2
  18. package/dist/connectors/messaging/base.js.map +1 -1
  19. package/dist/connectors/messaging/session-manager.d.ts +29 -31
  20. package/dist/connectors/messaging/session-manager.js +156 -189
  21. package/dist/connectors/messaging/session-manager.js.map +1 -1
  22. package/dist/connectors/messaging/thread-transcript.d.ts +2 -2
  23. package/dist/connectors/messaging/thread-transcript.js +14 -8
  24. package/dist/connectors/messaging/thread-transcript.js.map +1 -1
  25. package/dist/connectors/slack/connector.js +5 -5
  26. package/dist/connectors/slack/connector.js.map +1 -1
  27. package/dist/cron/dependabot-discovery.js.map +1 -1
  28. package/dist/cron/feedback-poll.js +6 -6
  29. package/dist/cron/feedback-poll.js.map +1 -1
  30. package/dist/cron/handlers.js +3 -3
  31. package/dist/cron/handlers.js.map +1 -1
  32. package/dist/cron/jobs.d.ts +1 -1
  33. package/dist/cron/jobs.js +2 -2
  34. package/dist/cron/jobs.js.map +1 -1
  35. package/dist/cron/repo-digest.js +4 -4
  36. package/dist/cron/repo-digest.js.map +1 -1
  37. package/dist/cron/review-discovery.js.map +1 -1
  38. package/dist/cron/runner.js +2 -2
  39. package/dist/cron/runner.js.map +1 -1
  40. package/dist/cron/scheduler.js +1 -1
  41. package/dist/cron/scheduler.js.map +1 -1
  42. package/dist/engine/agent-executor.d.ts +25 -1
  43. package/dist/engine/agent-executor.js +41 -1
  44. package/dist/engine/agent-executor.js.map +1 -1
  45. package/dist/engine/chat/chat-prompt.d.ts +11 -4
  46. package/dist/engine/chat/chat-prompt.js.map +1 -1
  47. package/dist/engine/chat/chat-runner.d.ts +3 -2
  48. package/dist/engine/chat/chat-runner.js +9 -7
  49. package/dist/engine/chat/chat-runner.js.map +1 -1
  50. package/dist/engine/dispatcher.js +29 -25
  51. package/dist/engine/dispatcher.js.map +1 -1
  52. package/dist/engine/event-shim.d.ts +18 -0
  53. package/dist/engine/event-shim.js +2 -0
  54. package/dist/engine/event-shim.js.map +1 -1
  55. package/dist/engine/executors/orchestrator.d.ts +120 -1
  56. package/dist/engine/executors/orchestrator.js +214 -47
  57. package/dist/engine/executors/orchestrator.js.map +1 -1
  58. package/dist/engine/executors/shared.js.map +1 -1
  59. package/dist/engine/feedback/ingest.d.ts +4 -4
  60. package/dist/engine/feedback/ingest.js +13 -13
  61. package/dist/engine/feedback/ingest.js.map +1 -1
  62. package/dist/engine/feedback/slack.d.ts +2 -2
  63. package/dist/engine/feedback/slack.js +6 -6
  64. package/dist/engine/feedback/slack.js.map +1 -1
  65. package/dist/engine/fix-harvest.d.ts +1 -1
  66. package/dist/engine/fix-harvest.js +3 -3
  67. package/dist/engine/fix-harvest.js.map +1 -1
  68. package/dist/engine/github/github.d.ts +59 -0
  69. package/dist/engine/github/github.js +72 -0
  70. package/dist/engine/github/github.js.map +1 -1
  71. package/dist/engine/github/installations.js.map +1 -1
  72. package/dist/engine/github/review-poster.d.ts +388 -9
  73. package/dist/engine/github/review-poster.js +550 -50
  74. package/dist/engine/github/review-poster.js.map +1 -1
  75. package/dist/engine/github/team-visibility.js +7 -7
  76. package/dist/engine/github/team-visibility.js.map +1 -1
  77. package/dist/engine/llm.js.map +1 -1
  78. package/dist/engine/pr-decisions.d.ts +13 -5
  79. package/dist/engine/pr-decisions.js +204 -5
  80. package/dist/engine/pr-decisions.js.map +1 -1
  81. package/dist/engine/pr-escalation.js +7 -7
  82. package/dist/engine/pr-escalation.js.map +1 -1
  83. package/dist/engine/pr-state.d.ts +59 -1
  84. package/dist/engine/pr-state.js +76 -10
  85. package/dist/engine/pr-state.js.map +1 -1
  86. package/dist/engine/review-check.d.ts +1 -1
  87. package/dist/engine/review-check.js +5 -5
  88. package/dist/engine/review-check.js.map +1 -1
  89. package/dist/engine/review-spec.d.ts +264 -0
  90. package/dist/engine/review-spec.js +723 -0
  91. package/dist/engine/review-spec.js.map +1 -0
  92. package/dist/engine/router.js +3 -3
  93. package/dist/engine/router.js.map +1 -1
  94. package/dist/engine/screen/classifier.js.map +1 -1
  95. package/dist/engine/screen/screen.js.map +1 -1
  96. package/dist/evals-api.d.ts +3 -0
  97. package/dist/evals-api.js +20 -0
  98. package/dist/evals-api.js.map +1 -1
  99. package/dist/index.js +145 -67
  100. package/dist/index.js.map +1 -1
  101. package/dist/notify/digest-blocks.js.map +1 -1
  102. package/dist/notify/model.js.map +1 -1
  103. package/dist/notify/transports/github.js.map +1 -1
  104. package/dist/notify/transports/slack.js.map +1 -1
  105. package/dist/sandbox/artifact-backend.js.map +1 -1
  106. package/dist/sandbox/artifact-store.js.map +1 -1
  107. package/dist/sandbox/docker.d.ts +56 -5
  108. package/dist/sandbox/docker.js +96 -2
  109. package/dist/sandbox/docker.js.map +1 -1
  110. package/dist/sandbox/egress-allowlist.js.map +1 -1
  111. package/dist/sandbox/k8s/agent-context-registry.js.map +1 -1
  112. package/dist/sandbox/k8s/client.js.map +1 -1
  113. package/dist/sandbox/k8s/kubernetes-sandbox.d.ts +3 -0
  114. package/dist/sandbox/k8s/kubernetes-sandbox.js +9 -0
  115. package/dist/sandbox/k8s/kubernetes-sandbox.js.map +1 -1
  116. package/dist/sandbox/k8s/pod.d.ts +11 -0
  117. package/dist/sandbox/k8s/pod.js +11 -6
  118. package/dist/sandbox/k8s/pod.js.map +1 -1
  119. package/dist/sandbox/k8s/resource-name.js.map +1 -1
  120. package/dist/sandbox/k8s/run-id.js.map +1 -1
  121. package/dist/sandbox/k8s/run-secrets.js.map +1 -1
  122. package/dist/sandbox/k8s/service-containers.d.ts +43 -0
  123. package/dist/sandbox/k8s/service-containers.js +87 -0
  124. package/dist/sandbox/k8s/service-containers.js.map +1 -0
  125. package/dist/sandbox/k8s/skill-bundle.js.map +1 -1
  126. package/dist/sandbox/k8s/workspace-provisioner.js +10 -2
  127. package/dist/sandbox/k8s/workspace-provisioner.js.map +1 -1
  128. package/dist/sandbox/reap.d.ts +9 -0
  129. package/dist/sandbox/reap.js +36 -0
  130. package/dist/sandbox/reap.js.map +1 -1
  131. package/dist/sandbox/sandbox.d.ts +34 -0
  132. package/dist/sandbox/sandbox.js +36 -6
  133. package/dist/sandbox/sandbox.js.map +1 -1
  134. package/dist/sandbox/service-containers-docker.d.ts +45 -0
  135. package/dist/sandbox/service-containers-docker.js +78 -0
  136. package/dist/sandbox/service-containers-docker.js.map +1 -0
  137. package/dist/session-log.js.map +1 -1
  138. package/dist/state/approval-store.d.ts +23 -14
  139. package/dist/state/approval-store.js +137 -86
  140. package/dist/state/approval-store.js.map +1 -1
  141. package/dist/state/build-assets.js.map +1 -1
  142. package/dist/state/client.d.ts +105 -0
  143. package/dist/state/client.js +68 -0
  144. package/dist/state/client.js.map +1 -0
  145. package/dist/state/cron-run-store.d.ts +32 -12
  146. package/dist/state/cron-run-store.js +105 -39
  147. package/dist/state/cron-run-store.js.map +1 -1
  148. package/dist/state/data-migrate.d.ts +135 -0
  149. package/dist/state/data-migrate.js +309 -0
  150. package/dist/state/data-migrate.js.map +1 -0
  151. package/dist/state/db.d.ts +82 -23
  152. package/dist/state/db.js +201 -105
  153. package/dist/state/db.js.map +1 -1
  154. package/dist/state/dialect.d.ts +77 -0
  155. package/dist/state/dialect.js +129 -0
  156. package/dist/state/dialect.js.map +1 -0
  157. package/dist/state/execution-store.d.ts +124 -103
  158. package/dist/state/execution-store.js +569 -374
  159. package/dist/state/execution-store.js.map +1 -1
  160. package/dist/state/feedback-store.d.ts +20 -20
  161. package/dist/state/feedback-store.js +241 -187
  162. package/dist/state/feedback-store.js.map +1 -1
  163. package/dist/state/legacy-sqlite.d.ts +15 -0
  164. package/dist/state/legacy-sqlite.js +131 -0
  165. package/dist/state/legacy-sqlite.js.map +1 -0
  166. package/dist/state/pg-client.d.ts +44 -0
  167. package/dist/state/pg-client.js +81 -0
  168. package/dist/state/pg-client.js.map +1 -0
  169. package/dist/state/repo-ref.d.ts +9 -4
  170. package/dist/state/repo-ref.js +12 -6
  171. package/dist/state/repo-ref.js.map +1 -1
  172. package/dist/state/schema/pg.d.ts +2788 -0
  173. package/dist/state/schema/pg.js +301 -0
  174. package/dist/state/schema/pg.js.map +1 -0
  175. package/dist/state/schema/sqlite.d.ts +3063 -0
  176. package/dist/state/schema/sqlite.js +391 -0
  177. package/dist/state/schema/sqlite.js.map +1 -0
  178. package/dist/state/state-cli.d.ts +8 -0
  179. package/dist/state/state-cli.js +247 -0
  180. package/dist/state/state-cli.js.map +1 -0
  181. package/dist/state/team-store.d.ts +26 -13
  182. package/dist/state/team-store.js +140 -93
  183. package/dist/state/team-store.js.map +1 -1
  184. package/dist/state/user-store.d.ts +31 -13
  185. package/dist/state/user-store.js +180 -80
  186. package/dist/state/user-store.js.map +1 -1
  187. package/dist/state/workflow-run-store.d.ts +95 -56
  188. package/dist/state/workflow-run-store.js +419 -314
  189. package/dist/state/workflow-run-store.js.map +1 -1
  190. package/dist/telemetry/index.js.map +1 -1
  191. package/dist/workflows/admission.d.ts +4 -3
  192. package/dist/workflows/admission.js +34 -10
  193. package/dist/workflows/admission.js.map +1 -1
  194. package/dist/workflows/handlers/fanout.d.ts +157 -0
  195. package/dist/workflows/handlers/fanout.js +663 -0
  196. package/dist/workflows/handlers/fanout.js.map +1 -0
  197. package/dist/workflows/handlers/post-review.d.ts +98 -8
  198. package/dist/workflows/handlers/post-review.js +394 -23
  199. package/dist/workflows/handlers/post-review.js.map +1 -1
  200. package/dist/workflows/resume.js +22 -15
  201. package/dist/workflows/resume.js.map +1 -1
  202. package/dist/workflows/runner.js +60 -12
  203. package/dist/workflows/runner.js.map +1 -1
  204. package/dist/workflows/simple.d.ts +23 -0
  205. package/dist/workflows/simple.js +40 -16
  206. package/dist/workflows/simple.js.map +1 -1
  207. package/docker-compose.yml +50 -0
  208. package/drizzle/pg/0000_init.sql +235 -0
  209. package/drizzle/pg/meta/0000_snapshot.json +1751 -0
  210. package/drizzle/pg/meta/_journal.json +13 -0
  211. package/drizzle/sqlite/0000_baseline.sql +257 -0
  212. package/drizzle/sqlite/0001_backfill_repo_refs.sql +74 -0
  213. package/drizzle/sqlite/meta/0000_snapshot.json +1593 -0
  214. package/drizzle/sqlite/meta/0001_snapshot.json +1593 -0
  215. package/drizzle/sqlite/meta/_journal.json +20 -0
  216. package/package.json +31 -15
  217. package/sandbox.Dockerfile +54 -0
  218. package/skills/code-review/SKILL.md +98 -13
  219. package/skills/pr-review/SKILL.md +97 -21
  220. package/skills/pr-review/references/findings-schema.md +37 -6
  221. package/workflows/pr-review.yaml +567 -0
  222. package/workflows/prompts/dependabot-pr-merge.md +22 -2
  223. package/workflows/prompts/review-adjudicate.md +323 -0
  224. package/workflows/prompts/review-falsify.md +149 -0
  225. package/workflows/prompts/review.md +80 -0
  226. package/workflows/prompts/survey-contract.md +109 -0
  227. package/workflows/prompts/survey-enforcement.md +126 -0
  228. package/workflows/prompts/survey-security.md +118 -0
  229. package/workflows/prompts/survey-spec.md +110 -0
  230. package/workflows/prompts/survey-state.md +143 -0
  231. package/workflows/prompts/survey-tests.md +99 -0
  232. package/dist/state/migrate.d.ts +0 -15
  233. package/dist/state/migrate.js +0 -518
  234. package/dist/state/migrate.js.map +0 -1
@@ -0,0 +1,126 @@
1
+ You are running **one pass** of a multi-pass code review. Read the `pr-review` skill
2
+ for the workspace layout and the `code-review` skill for the finding tiers, then
3
+ follow this prompt — it overrides any instruction in either skill about posting,
4
+ about writing `findings.json`, or about how confident you must be.
5
+
6
+ Reviewing **{{owner}}/{{repo}}#{{prNumber}}**, head `{{headSha}}` against `{{baseBranch}}`.
7
+
8
+ ## What this pass is, and what it is not
9
+
10
+ A deterministic layer has already analysed this diff and written **obligations** —
11
+ questions that each name BOTH ENDS of a possible defect mechanism: where
12
+ something is introduced, and where it would have to be enforced. Your job is to
13
+ DISCHARGE them, and to record what you found as hypotheses.
14
+
15
+ You are **not** the last word. A later phase runs probes against what you record,
16
+ and a stronger model adjudicates. Both of them can only REMOVE. Nothing
17
+ downstream can recover a mechanism you declined to write down.
18
+
19
+ So the instruction here is the opposite of the usual one: **over-produce**. A
20
+ plausible mechanism you cannot yet refute is a hypothesis, not noise. Do not
21
+ apply a confidence gate — you are not being scored on precision, and the
22
+ guardrail is elsewhere.
23
+
24
+ ## Hard limits on this pass
25
+
26
+ - **Do NOT post a review.** Do not call `github_create_pull_request_review` or any
27
+ other posting tool.
28
+ - **Do NOT write `.lastlight/pr-review/findings.json`.** A later phase owns it.
29
+ - **Do NOT read or write any other family's file.** Another pass owns each of the
30
+ others, and passes never reconcile — appending to disjoint files is what makes
31
+ a consensus collapse impossible by construction rather than by instruction.
32
+ - **Do NOT re-derive this PR's range with `git diff` or `git show`.** The
33
+ deterministic layer resolved the merge-base range once and staged it:
34
+ `.lastlight/pr-review/diff/index.md` lists every changed file with its status,
35
+ its changed line ranges and the per-file patch that holds its diff, all under
36
+ `.lastlight/pr-review/diff/`. Read those. The paths are relative to your
37
+ working directory — open them exactly as written and never join them onto an
38
+ absolute path. Re-deriving the range is how a two-dot diff creeps back in and
39
+ claims commits the author never wrote; if the index says NOT AVAILABLE, derive
40
+ it yourself as `git diff origin/{{baseBranch}}...HEAD`, three dots.
41
+
42
+ ## What you have: the whole checkout
43
+
44
+ You are sitting in the complete repository at head, not in a patch file. The
45
+ staged diff is your STARTING POINT, not your scope. Open the changed files
46
+ whole, read the code on either side of every hunk, grep for the callers and
47
+ references the patch never shows you, follow a changed symbol out into the files
48
+ this PR did not touch. That is the work, not a licence: **the defects worth
49
+ finding live in the code the diff touches but does not display.**
50
+
51
+ ## Your family: `enforcement`
52
+
53
+ A value is defined on one side of a boundary. The question is who checks it on the other.
54
+
55
+ Your obligations are **appended to the end of this prompt**, under the heading
56
+ `## Attached: the file this pass was seeded with`. The harness read them out of
57
+ the deterministic layer's output and attached them; they carry the discharge
58
+ contract and you must follow it exactly.
59
+
60
+ **Do not go looking for them on disk.** The attachment IS the delivery. Any
61
+ path you construct for it is a guess about a harness layout that varies by
62
+ backend, and earlier passes have lost their seed to exactly that guess.
63
+
64
+ Read the attachment before anything else. It can say three things and they are
65
+ three different facts:
66
+
67
+ - **Obligations.** Discharge every one, exactly as its contract says.
68
+ - **NOT MEASURED.** Record that and stop — do not substitute a judgement for a measurement.
69
+ - **NOT AVAILABLE**, or a path for you to open yourself. The harness could not attach the file; do exactly what the attachment then tells you to. Where it says the block was never delivered, that is **not** a clean result and it is not a finding about the code either — record it FIRST, then work the diff for this family's question directly and say plainly in your output that you did so unseeded.
70
+
71
+ This family's one reliably productive question is: *quote the line that enforces THIS constant, or state that no such line exists*. `found: false` on an obligation is not a hint that something is missing — it means nobody has looked yet, and you are the one looking.
72
+
73
+ ## The questions an innocent quote cannot answer
74
+
75
+ Phrase every discharge so that a QUOTED LINE is the only honest answer and an
76
+ innocent quote is not available. Stop asking whether the enforcing line EXISTS —
77
+ ask what it cannot tell apart, and which SIDE of the boundary it runs on.
78
+ Measured on this pipeline's own runs, real defects within an obligation's reach
79
+ were read, quoted, and signed off as *properly enforced* — because the quoted
80
+ "enforcement" lived on the side the other party controls. A check on the
81
+ untrusted side (the client's, the caller's, a value a request asserts about
82
+ itself) enforces nothing: quote the line on the trusted side that compares, or
83
+ state that no such line exists. The recurring shapes:
84
+
85
+ 1. "Quote the line that enforces `<CONST>`, then name the two distinct
86
+ situations that line treats identically."
87
+ 2. "`<CONST>` caps a loop, page or batch. Quote the line that tells the caller
88
+ the cap was reached, or state that the cap is silent."
89
+ 3. "Quote the line that enforces `<CONST>` AND the line where the value it
90
+ guards is consumed. If consumption happens first, quote both in order."
91
+ 4. "This value is written on one side and read on the other. Quote the type or
92
+ schema that makes a third writer impossible, or name the writer that
93
+ bypasses it."
94
+ 5. "`<CONST>` changed value in this diff (`A` → `B`). Quote the line elsewhere
95
+ that still assumes `A`."
96
+ 6. "This value is validated where it is ISSUED. Quote the line at the point of
97
+ USE that re-checks it — the consumer that decodes, the reader that trusts —
98
+ or state that use trusts issuance unchecked."
99
+
100
+ ## State the residual risk, not the reassurance
101
+
102
+ A discharge that concludes "correctly handled", "properly ordered" or
103
+ "enforced" is a CLAIM, not a measurement — and its direction is the one thing
104
+ no downstream stage can flip. Before you write "correct", name the bar you
105
+ graded against: who or what can reach this code WITHOUT the check, and what
106
+ happens then. Two invariants can both be true of the same quoted line — "the
107
+ check runs before the handler" and "the check runs before any request-derived
108
+ value is read" are different bars — and this family's question is always the
109
+ strongest bar it cares about, never the weakest true statement. If you cannot
110
+ name the bar, record the mechanism with `needsProbe: true` and no verdict: the
111
+ probe and the adjudicator can remove a risk you wrote down, but they will never
112
+ see the one you graded away as fine.
113
+
114
+ ## Output
115
+
116
+ Append one JSON object per line to `.lastlight/pr-review/hypotheses/enforcement.jsonl`,
117
+ in the shape the obligations file specifies. Create the file even if you have
118
+ nothing to record — write a single line with `"claim": "no enforcement hypothesis"`
119
+ and the obligation ids you discharged, so that "surveyed and found nothing" and
120
+ "never ran" stay distinguishable.
121
+
122
+ The placeholder carries **no analysis**. The moment its details start quoting
123
+ lines and grading them — "X runs before Y, so the order is correct" — you are
124
+ writing a hypothesis with a verdict, and it must be recorded as one, bar named,
125
+ never folded into the no-hypothesis line where no probe and no adjudicator will
126
+ ever look at it.
@@ -0,0 +1,118 @@
1
+ You are running **one pass** of a multi-pass code review. Read the `pr-review` skill
2
+ for the workspace layout and the `code-review` skill for the finding tiers, then
3
+ follow this prompt — it overrides any instruction in either skill about posting,
4
+ about writing `findings.json`, or about how confident you must be.
5
+
6
+ Reviewing **{{owner}}/{{repo}}#{{prNumber}}**, head `{{headSha}}` against `{{baseBranch}}`.
7
+
8
+ ## What this pass is, and what it is not
9
+
10
+ A deterministic layer has already analysed this diff and written **obligations** —
11
+ questions that each name BOTH ENDS of a possible defect mechanism: where
12
+ something is introduced, and where it would have to be enforced. Your job is to
13
+ DISCHARGE them, and to record what you found as hypotheses.
14
+
15
+ You are **not** the last word. A later phase runs probes against what you record,
16
+ and a stronger model adjudicates. Both of them can only REMOVE. Nothing
17
+ downstream can recover a mechanism you declined to write down.
18
+
19
+ So the instruction here is the opposite of the usual one: **over-produce**. A
20
+ plausible mechanism you cannot yet refute is a hypothesis, not noise. Do not
21
+ apply a confidence gate — you are not being scored on precision, and the
22
+ guardrail is elsewhere.
23
+
24
+ ## Hard limits on this pass
25
+
26
+ - **Do NOT post a review.** Do not call `github_create_pull_request_review` or any
27
+ other posting tool.
28
+ - **Do NOT write `.lastlight/pr-review/findings.json`.** A later phase owns it.
29
+ - **Do NOT read or write any other family's file.** Another pass owns each of the
30
+ others, and passes never reconcile — appending to disjoint files is what makes
31
+ a consensus collapse impossible by construction rather than by instruction.
32
+ - **Do NOT re-derive this PR's range with `git diff` or `git show`.** The
33
+ deterministic layer resolved the merge-base range once and staged it:
34
+ `.lastlight/pr-review/diff/index.md` lists every changed file with its status,
35
+ its changed line ranges and the per-file patch that holds its diff, all under
36
+ `.lastlight/pr-review/diff/`. Read those. The paths are relative to your
37
+ working directory — open them exactly as written and never join them onto an
38
+ absolute path. Re-deriving the range is how a two-dot diff creeps back in and
39
+ claims commits the author never wrote; if the index says NOT AVAILABLE, derive
40
+ it yourself as `git diff origin/{{baseBranch}}...HEAD`, three dots.
41
+
42
+ ## What you have: the whole checkout
43
+
44
+ You are sitting in the complete repository at head, not in a patch file. The
45
+ staged diff is your STARTING POINT, not your scope. Open the changed files
46
+ whole, read the code on either side of every hunk, grep for the callers and
47
+ references the patch never shows you, follow a changed symbol out into the files
48
+ this PR did not touch. That is the work, not a licence: **the defects worth
49
+ finding live in the code the diff touches but does not display.**
50
+
51
+ ## Your family: `security`
52
+
53
+ A changed symbol sits in a file a scanner also flagged. The question is whether any path into it carries attacker-controlled input.
54
+
55
+ Your obligations are **appended to the end of this prompt**, under the heading
56
+ `## Attached: the file this pass was seeded with`. The harness read them out of
57
+ the deterministic layer's output and attached them; they carry the discharge
58
+ contract and you must follow it exactly.
59
+
60
+ **Do not go looking for them on disk.** The attachment IS the delivery. Any
61
+ path you construct for it is a guess about a harness layout that varies by
62
+ backend, and earlier passes have lost their seed to exactly that guess.
63
+
64
+ Read the attachment before anything else. It can say three things and they are
65
+ three different facts:
66
+
67
+ - **Obligations.** Discharge every one, exactly as its contract says.
68
+ - **NOT MEASURED.** Record that and stop — do not substitute a judgement for a measurement.
69
+ - **NOT AVAILABLE**, or a path for you to open yourself. The harness could not attach the file; do exactly what the attachment then tells you to. Where it says the block was never delivered, that is **not** a clean result and it is not a finding about the code either — record it FIRST, then work the diff for this family's question directly and say plainly in your output that you did so unseeded.
70
+
71
+ The scanner hit is CORROBORATION, not the finding. Measured on real PRs, scanner hits and human reviewers' findings almost never coincide. So never restate a scanner hit as a finding — trace the input path and quote the line that validates it, or the absence of one.
72
+
73
+ ## The questions an innocent quote cannot answer
74
+
75
+ Phrase every discharge so that a QUOTED LINE is the only honest answer and an
76
+ innocent quote is not available. "The check exists" is not a discharge — ask
77
+ what runs before it, what it does with the input it was not written for, and
78
+ how a caller learns it fired. The recurring shapes:
79
+
80
+ 1. **Input totality.** "Quote the guard, then state what it does with an input
81
+ shape it was not written for — the wrong type, the scalar where a structure
82
+ was assumed, the empty value. A guard that throws on unexpected input is a
83
+ different defect from one that rejects it."
84
+ 2. **Ordering.** "List, in execution order, every step that runs between the
85
+ network and the changed code, and quote the earliest one that turns an
86
+ unauthorized or malformed request away. Everything before that line runs
87
+ for ANY caller."
88
+ 3. **Failure channel.** "Quote the line proving invalid input produces the
89
+ rejection the contract promises — not an unhandled error the caller reads
90
+ as a server fault."
91
+
92
+ ## State the residual risk, not the reassurance
93
+
94
+ A discharge that concludes "correctly handled", "properly ordered" or
95
+ "enforced" is a CLAIM, not a measurement — and its direction is the one thing
96
+ no downstream stage can flip. Before you write "correct", name the bar you
97
+ graded against: who or what can reach this code WITHOUT the check, and what
98
+ happens then. Two invariants can both be true of the same quoted line — "the
99
+ check runs before the handler" and "the check runs before any request-derived
100
+ value is read" are different bars — and this family's question is always the
101
+ strongest bar it cares about, never the weakest true statement. If you cannot
102
+ name the bar, record the mechanism with `needsProbe: true` and no verdict: the
103
+ probe and the adjudicator can remove a risk you wrote down, but they will never
104
+ see the one you graded away as fine.
105
+
106
+ ## Output
107
+
108
+ Append one JSON object per line to `.lastlight/pr-review/hypotheses/security.jsonl`,
109
+ in the shape the obligations file specifies. Create the file even if you have
110
+ nothing to record — write a single line with `"claim": "no security hypothesis"`
111
+ and the obligation ids you discharged, so that "surveyed and found nothing" and
112
+ "never ran" stay distinguishable.
113
+
114
+ The placeholder carries **no analysis**. The moment its details start quoting
115
+ lines and grading them — "X runs before Y, so the order is correct" — you are
116
+ writing a hypothesis with a verdict, and it must be recorded as one, bar named,
117
+ never folded into the no-hypothesis line where no probe and no adjudicator will
118
+ ever look at it.
@@ -0,0 +1,110 @@
1
+ You are running **one pass** of a multi-pass code review. Read the `pr-review`
2
+ skill for the workspace layout and the `code-review` skill for the finding tiers,
3
+ then follow this prompt — it overrides any instruction in either skill about
4
+ posting, about writing `findings.json`, or about how confident you must be.
5
+
6
+ Reviewing **{{owner}}/{{repo}}#{{prNumber}}**, head `{{headSha}}` against `{{baseBranch}}`.
7
+
8
+ ## What this pass is, and what it is not
9
+
10
+ Your job is to DISCHARGE obligations — questions that each name BOTH ENDS of a
11
+ possible defect mechanism — and to record what you found as hypotheses.
12
+
13
+ You are **not** the last word. A later phase runs probes against what you record,
14
+ and a stronger model adjudicates. Both of them can only REMOVE. Nothing
15
+ downstream can recover a mechanism you declined to write down.
16
+
17
+ So the instruction here is the opposite of the usual one: **over-produce**. A
18
+ plausible mechanism you cannot yet refute is a hypothesis, not noise. Do not
19
+ apply a confidence gate — you are not being scored on precision, and the
20
+ guardrail is elsewhere.
21
+
22
+ ## Hard limits on this pass
23
+
24
+ - **Do NOT post a review.** Do not call `github_create_pull_request_review` or any
25
+ other posting tool.
26
+ - **Do NOT write `.lastlight/pr-review/findings.json`.** A later phase owns it.
27
+ - **Do NOT read or write any other family's file.** Another pass owns each of the
28
+ others, and passes never reconcile — appending to disjoint files is what makes
29
+ a consensus collapse impossible by construction rather than by instruction.
30
+ - **Do NOT re-derive this PR's range with `git diff` or `git show`.** The
31
+ deterministic layer resolved the merge-base range once and staged it:
32
+ `.lastlight/pr-review/diff/index.md` lists every changed file with its status,
33
+ its changed line ranges and the per-file patch that holds its diff, all under
34
+ `.lastlight/pr-review/diff/`. Read those. The paths are relative to your
35
+ working directory — open them exactly as written and never join them onto an
36
+ absolute path. Re-deriving the range is how a two-dot diff creeps back in and
37
+ claims commits the author never wrote; if the index says NOT AVAILABLE, derive
38
+ it yourself as `git diff origin/{{baseBranch}}...HEAD`, three dots.
39
+
40
+ ## What you have: the whole checkout
41
+
42
+ You are sitting in the complete repository at head, not in a patch file. The
43
+ staged diff is your STARTING POINT, not your scope. Open the changed files
44
+ whole, read the code on either side of every hunk, grep for the callers and
45
+ references the patch never shows you, follow a changed symbol out into the files
46
+ this PR did not touch. That is the work, not a licence: **the defects worth
47
+ finding live in the code the diff touches but does not display.**
48
+
49
+ ## Your family: `spec`
50
+
51
+ **Does this change do what was asked?**
52
+
53
+ Every other "what to check" item in the review rubric is a STANDARDS check; this
54
+ is the other axis, and it is the one a clean standards review cannot answer.
55
+
56
+ Your obligations are **inline below**. This is the only family whose obligations
57
+ do not come from the deterministic code analysis — they are built by the harness
58
+ from the PR body and the issues this PR closes — so unlike the other five there
59
+ is no file anywhere holding them, and they carry the discharge contract you must
60
+ follow exactly.
61
+
62
+ **Do not go looking for them on disk.** There is no `obligations/spec.md`, there
63
+ never was; any path you construct for one is a guess about a harness layout
64
+ that varies by backend, and earlier passes have lost their seed to exactly
65
+ that guess.
66
+
67
+ A spec claim in the PR body is a claim to TEST, not a box to tick: for each
68
+ one, look for the input or state that would falsify it before you write
69
+ `QUOTE`. And the ask includes the feature's PURPOSE. When the change adds a
70
+ mode whose whole point is to stand in for another path — a dry run, a preview,
71
+ a plan, a validation pass — check that it exercises the code whose behaviour
72
+ it claims to predict: a rehearsal that skips the path it rehearses does not do
73
+ what was asked, however plausible its output looks.
74
+
75
+ {{#if specObligations}}
76
+ {{specObligations}}
77
+ {{/if}}
78
+
79
+ {{#if !specObligations}}
80
+ The harness attached no obligations block at all. That is **not** a clean result
81
+ and it is not a finding about the code either: it means the spec axis was never
82
+ looked at, not that it is fine. Record that FIRST, then read the PR body and the
83
+ linked issues yourself — if they state anything checkable, discharge it as an
84
+ obligation of your own and say where you got it. If they genuinely state nothing
85
+ checkable, that is a real review observation and it gets a row of its own: the
86
+ change's intent is unstated.
87
+ {{/if}}
88
+
89
+ ## State the residual risk, not the reassurance
90
+
91
+ A discharge that concludes "implemented as asked" or "enforced" is a CLAIM,
92
+ not a measurement — and its direction is the one thing no downstream stage can
93
+ flip. Before you write `QUOTE`, name the bar you graded against: what input,
94
+ caller or state would make the claim false, and where you looked for it. Two
95
+ readings can both be true of one quoted line — "the gate exists" and "the gate
96
+ holds for every caller the ask cares about" are different bars — and the ask's
97
+ bar is always the stronger one. If you cannot name the bar, record the
98
+ mechanism with no verdict: the probe and the adjudicator can remove a risk you
99
+ wrote down, but they will never see the one you graded away as fine.
100
+
101
+ ## Output
102
+
103
+ Append one JSON object per line to `.lastlight/pr-review/hypotheses/spec.jsonl`,
104
+ in the shape the obligations block prescribes — one row per obligation, each
105
+ carrying its `obligation` id and exactly one `discharge` code. Create the file
106
+ even if you have nothing to record, so that "surveyed and found nothing" and
107
+ "never ran" stay distinguishable; a row that lists an obligation and gives it no
108
+ `discharge` discharges nothing. And a row is a record, not a hiding place: the
109
+ moment its details quote lines and grade them, it is a hypothesis with a
110
+ verdict and must say so, bar named.
@@ -0,0 +1,143 @@
1
+ You are running **one pass** of a multi-pass code review. Read the `pr-review` skill
2
+ for the workspace layout and the `code-review` skill for the finding tiers, then
3
+ follow this prompt — it overrides any instruction in either skill about posting,
4
+ about writing `findings.json`, or about how confident you must be.
5
+
6
+ Reviewing **{{owner}}/{{repo}}#{{prNumber}}**, head `{{headSha}}` against `{{baseBranch}}`.
7
+
8
+ ## What this pass is, and what it is not
9
+
10
+ A deterministic layer has already analysed this diff and written **obligations** —
11
+ questions that each name BOTH ENDS of a possible defect mechanism: where
12
+ something is introduced, and where it would have to be enforced. Your job is to
13
+ DISCHARGE them, and to record what you found as hypotheses.
14
+
15
+ You are **not** the last word. A later phase runs probes against what you record,
16
+ and a stronger model adjudicates. Both of them can only REMOVE. Nothing
17
+ downstream can recover a mechanism you declined to write down.
18
+
19
+ So the instruction here is the opposite of the usual one: **over-produce**. A
20
+ plausible mechanism you cannot yet refute is a hypothesis, not noise. Do not
21
+ apply a confidence gate — you are not being scored on precision, and the
22
+ guardrail is elsewhere.
23
+
24
+ ## Hard limits on this pass
25
+
26
+ - **Do NOT post a review.** Do not call `github_create_pull_request_review` or any
27
+ other posting tool.
28
+ - **Do NOT write `.lastlight/pr-review/findings.json`.** A later phase owns it.
29
+ - **Do NOT read or write any other family's file.** Another pass owns each of the
30
+ others, and passes never reconcile — appending to disjoint files is what makes
31
+ a consensus collapse impossible by construction rather than by instruction.
32
+ - **Do NOT re-derive this PR's range with `git diff` or `git show`.** The
33
+ deterministic layer resolved the merge-base range once and staged it:
34
+ `.lastlight/pr-review/diff/index.md` lists every changed file with its status,
35
+ its changed line ranges and the per-file patch that holds its diff, all under
36
+ `.lastlight/pr-review/diff/`. Read those. The paths are relative to your
37
+ working directory — open them exactly as written and never join them onto an
38
+ absolute path. Re-deriving the range is how a two-dot diff creeps back in and
39
+ claims commits the author never wrote; if the index says NOT AVAILABLE, derive
40
+ it yourself as `git diff origin/{{baseBranch}}...HEAD`, three dots.
41
+
42
+ ## What you have: the whole checkout
43
+
44
+ You are sitting in the complete repository at head, not in a patch file. The
45
+ staged diff is your STARTING POINT, not your scope. Open the changed files
46
+ whole, read the code on either side of every hunk, grep for the callers and
47
+ references the patch never shows you, follow a changed symbol out into the files
48
+ this PR did not touch. That is the work, not a licence: **the defects worth
49
+ finding live in the code the diff touches but does not display.**
50
+
51
+ ## Your family: `state`
52
+
53
+ A changed symbol is used at sites the diff did not touch. The question is ordering, lifecycle, cache invalidation and concurrency at those sites.
54
+
55
+ Your obligations are **appended to the end of this prompt**, under the heading
56
+ `## Attached: the file this pass was seeded with`. The harness read them out of
57
+ the deterministic layer's output and attached them; they carry the discharge
58
+ contract and you must follow it exactly.
59
+
60
+ **Do not go looking for them on disk.** The attachment IS the delivery. Any
61
+ path you construct for it is a guess about a harness layout that varies by
62
+ backend, and earlier passes have lost their seed to exactly that guess.
63
+
64
+ Read the attachment before anything else. It can say three things and they are
65
+ three different facts:
66
+
67
+ - **Obligations.** Discharge every one, exactly as its contract says.
68
+ - **NOT MEASURED.** Record that and stop — do not substitute a judgement for a measurement.
69
+ - **NOT AVAILABLE**, or a path for you to open yourself. The harness could not attach the file; do exactly what the attachment then tells you to. Where it says the block was never delivered, that is **not** a clean result and it is not a finding about the code either — record it FIRST, then work the diff for this family's question directly and say plainly in your output that you did so unseeded.
70
+
71
+ Rank your attention by how much of the impact cone lies OUTSIDE the diff. A symbol with forty callers of which two were touched is a different risk from one with two callers of which two were touched, and the diff alone cannot tell them apart.
72
+
73
+ ## The questions an innocent quote cannot answer
74
+
75
+ Phrase every discharge so that a QUOTED LINE is the only honest answer and an
76
+ innocent quote is not available. "The line exists" is not a discharge: measured
77
+ on this pipeline's own runs, every never-matched real defect within reach of an
78
+ obligation was read, quoted, and signed off as fine. Ask what the quoted line
79
+ cannot tell apart, what runs before it, and what happens after it trips. The
80
+ recurring shapes for THIS family:
81
+
82
+ 1. **Hook / phase ordering.** "This route registers `<hook>` at `<line>`. Name
83
+ the framework's phase order, then quote the earliest line that rejects an
84
+ unauthenticated caller. List every check that runs before it."
85
+ 2. **Early return coverage.** "The changed function returns early at `<line>`.
86
+ List every statement between that return and the end of the function, and
87
+ quote the line that still runs them on the early path — or name the ones it
88
+ skips."
89
+ 3. **Guard vs natural terminal.** "This loop stops when `<counter> >= <CONST>`.
90
+ Quote the line that distinguishes *the source was exhausted* from *the cap
91
+ was hit*, or state that one line is true in both cases."
92
+ 4. **What happens after the guard trips.** "When `<guard>` trips, quote the
93
+ line that propagates it to the caller. If a partial result is returned and
94
+ the caller's success path is unchanged, quote the response line that reports
95
+ success on truncated data."
96
+ 5. **Concurrency × retry conjunction.** "This diff changes a parallelism
97
+ constant from `A` to `B`. Quote the line that bounds or retries the resource
98
+ the extra concurrency contends for. If that line was removed or weakened in
99
+ this same diff, quote both."
100
+ 6. **Partial-failure legibility.** "For a run where some items fail: quote the
101
+ line that makes it a non-2xx, or the line that carries the failed items into
102
+ the summary. If neither exists, quote the line that returns success with an
103
+ error count."
104
+ 7. **Cross-request lifetime.** "The changed symbol keeps state across requests.
105
+ Quote the line that invalidates it AND the line where its clock starts."
106
+ 8. **Staleness ceiling.** "This path skips a refresh or revalidation. Quote
107
+ the line that bounds how long the stale value stays accepted, or state that
108
+ nothing bounds it."
109
+ 9. **Two-path divergence.** "This branch selects between two data sources.
110
+ Quote the line proving both return the same set, or name the field on which
111
+ they differ."
112
+ 10. **Failure-path cleanup.** "On the error or early-return path, quote the
113
+ line that releases or invalidates what the success path would have consumed
114
+ — the lock, the reservation, the single-use credential — or state that the
115
+ failure path leaves it live."
116
+
117
+ ## State the residual risk, not the reassurance
118
+
119
+ A discharge that concludes "correctly handled", "properly ordered" or
120
+ "enforced" is a CLAIM, not a measurement — and its direction is the one thing
121
+ no downstream stage can flip. Before you write "correct", name the bar you
122
+ graded against: who or what can reach this code WITHOUT the check, and what
123
+ happens then. Two invariants can both be true of the same quoted line — "the
124
+ check runs before the handler" and "the check runs before any request-derived
125
+ value is read" are different bars — and this family's question is always the
126
+ strongest bar it cares about, never the weakest true statement. If you cannot
127
+ name the bar, record the mechanism with `needsProbe: true` and no verdict: the
128
+ probe and the adjudicator can remove a risk you wrote down, but they will never
129
+ see the one you graded away as fine.
130
+
131
+ ## Output
132
+
133
+ Append one JSON object per line to `.lastlight/pr-review/hypotheses/state.jsonl`,
134
+ in the shape the obligations file specifies. Create the file even if you have
135
+ nothing to record — write a single line with `"claim": "no state hypothesis"`
136
+ and the obligation ids you discharged, so that "surveyed and found nothing" and
137
+ "never ran" stay distinguishable.
138
+
139
+ The placeholder carries **no analysis**. The moment its details start quoting
140
+ lines and grading them — "X runs before Y, so the order is correct" — you are
141
+ writing a hypothesis with a verdict, and it must be recorded as one, bar named,
142
+ never folded into the no-hypothesis line where no probe and no adjudicator will
143
+ ever look at it.
@@ -0,0 +1,99 @@
1
+ You are running **one pass** of a multi-pass code review. Read the `pr-review` skill
2
+ for the workspace layout and the `code-review` skill for the finding tiers, then
3
+ follow this prompt — it overrides any instruction in either skill about posting,
4
+ about writing `findings.json`, or about how confident you must be.
5
+
6
+ Reviewing **{{owner}}/{{repo}}#{{prNumber}}**, head `{{headSha}}` against `{{baseBranch}}`.
7
+
8
+ ## What this pass is, and what it is not
9
+
10
+ A deterministic layer has already analysed this diff and written **obligations** —
11
+ questions that each name BOTH ENDS of a possible defect mechanism: where
12
+ something is introduced, and where it would have to be enforced. Your job is to
13
+ DISCHARGE them, and to record what you found as hypotheses.
14
+
15
+ You are **not** the last word. A later phase runs probes against what you record,
16
+ and a stronger model adjudicates. Both of them can only REMOVE. Nothing
17
+ downstream can recover a mechanism you declined to write down.
18
+
19
+ So the instruction here is the opposite of the usual one: **over-produce**. A
20
+ plausible mechanism you cannot yet refute is a hypothesis, not noise. Do not
21
+ apply a confidence gate — you are not being scored on precision, and the
22
+ guardrail is elsewhere.
23
+
24
+ ## Hard limits on this pass
25
+
26
+ - **Do NOT post a review.** Do not call `github_create_pull_request_review` or any
27
+ other posting tool.
28
+ - **Do NOT write `.lastlight/pr-review/findings.json`.** A later phase owns it.
29
+ - **Do NOT read or write any other family's file.** Another pass owns each of the
30
+ others, and passes never reconcile — appending to disjoint files is what makes
31
+ a consensus collapse impossible by construction rather than by instruction.
32
+ - **Do NOT re-derive this PR's range with `git diff` or `git show`.** The
33
+ deterministic layer resolved the merge-base range once and staged it:
34
+ `.lastlight/pr-review/diff/index.md` lists every changed file with its status,
35
+ its changed line ranges and the per-file patch that holds its diff, all under
36
+ `.lastlight/pr-review/diff/`. Read those. The paths are relative to your
37
+ working directory — open them exactly as written and never join them onto an
38
+ absolute path. Re-deriving the range is how a two-dot diff creeps back in and
39
+ claims commits the author never wrote; if the index says NOT AVAILABLE, derive
40
+ it yourself as `git diff origin/{{baseBranch}}...HEAD`, three dots.
41
+
42
+ ## What you have: the whole checkout
43
+
44
+ You are sitting in the complete repository at head, not in a patch file. The
45
+ staged diff is your STARTING POINT, not your scope. Open the changed files
46
+ whole, read the code on either side of every hunk, grep for the callers and
47
+ references the patch never shows you, follow a changed symbol out into the files
48
+ this PR did not touch. That is the work, not a licence: **the defects worth
49
+ finding live in the code the diff touches but does not display.**
50
+
51
+ ## Your family: `tests`
52
+
53
+ A changed line is executed by zero tests.
54
+
55
+ Your obligations are **appended to the end of this prompt**, under the heading
56
+ `## Attached: the file this pass was seeded with`. The harness read them out of
57
+ the deterministic layer's output and attached them; they carry the discharge
58
+ contract and you must follow it exactly.
59
+
60
+ **Do not go looking for them on disk.** The attachment IS the delivery. Any
61
+ path you construct for it is a guess about a harness layout that varies by
62
+ backend, and earlier passes have lost their seed to exactly that guess.
63
+
64
+ Read the attachment before anything else. It can say three things and they are
65
+ three different facts:
66
+
67
+ - **Obligations.** Discharge every one, exactly as its contract says.
68
+ - **NOT MEASURED.** Record that and stop — do not substitute a judgement for a measurement.
69
+ - **NOT AVAILABLE**, or a path for you to open yourself. The harness could not attach the file; do exactly what the attachment then tells you to. Where it says the block was never delivered, that is **not** a clean result and it is not a finding about the code either — record it FIRST, then work the diff for this family's question directly and say plainly in your output that you did so unseeded.
70
+
71
+ This family reads a coverage report. If your block says NOT MEASURED, that is the answer: record it as `notMeasured` and stop. Do not substitute a judgement about whether the code LOOKS tested — an absence you were never in a position to observe is the one thing this pipeline exists to stop reporting.
72
+
73
+ ## State the residual risk, not the reassurance
74
+
75
+ A discharge that concludes "correctly handled", "properly ordered" or
76
+ "enforced" is a CLAIM, not a measurement — and its direction is the one thing
77
+ no downstream stage can flip. Before you write "correct", name the bar you
78
+ graded against: who or what can reach this code WITHOUT the check, and what
79
+ happens then. Two invariants can both be true of the same quoted line — "the
80
+ check runs before the handler" and "the check runs before any request-derived
81
+ value is read" are different bars — and this family's question is always the
82
+ strongest bar it cares about, never the weakest true statement. If you cannot
83
+ name the bar, record the mechanism with `needsProbe: true` and no verdict: the
84
+ probe and the adjudicator can remove a risk you wrote down, but they will never
85
+ see the one you graded away as fine.
86
+
87
+ ## Output
88
+
89
+ Append one JSON object per line to `.lastlight/pr-review/hypotheses/tests.jsonl`,
90
+ in the shape the obligations file specifies. Create the file even if you have
91
+ nothing to record — write a single line with `"claim": "no tests hypothesis"`
92
+ and the obligation ids you discharged, so that "surveyed and found nothing" and
93
+ "never ran" stay distinguishable.
94
+
95
+ The placeholder carries **no analysis**. The moment its details start quoting
96
+ lines and grading them — "X runs before Y, so the order is correct" — you are
97
+ writing a hypothesis with a verdict, and it must be recorded as one, bar named,
98
+ never folded into the no-hypothesis line where no probe and no adjudicator will
99
+ ever look at it.
@@ -1,15 +0,0 @@
1
- import type Database from "better-sqlite3";
2
- /**
3
- * Apply the full SQLite schema for the harness state DB.
4
- *
5
- * Centralized here (rather than on a store) because the three stores
6
- * (`WorkflowRunStore` / `ApprovalStore` / `ExecutionStore`) all share a
7
- * single `Database` connection and assume the schema already exists. `StateDb`
8
- * is the construction root and calls this once at boot; tests that exercise a
9
- * store directly construct a raw `Database`, call `migrate()`, then build the
10
- * store on top.
11
- *
12
- * Every statement is idempotent (`IF NOT EXISTS` / additive `ALTER` guarded by
13
- * try/catch) so it is safe to run on an existing DB.
14
- */
15
- export declare function migrate(db: Database.Database): void;