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,20 @@
1
+ {
2
+ "version": "7",
3
+ "dialect": "sqlite",
4
+ "entries": [
5
+ {
6
+ "idx": 0,
7
+ "version": "6",
8
+ "when": 1787037639730,
9
+ "tag": "0000_baseline",
10
+ "breakpoints": true
11
+ },
12
+ {
13
+ "idx": 1,
14
+ "version": "6",
15
+ "when": 1787040069970,
16
+ "tag": "0001_backfill_repo_refs",
17
+ "breakpoints": true
18
+ }
19
+ ]
20
+ }
package/package.json CHANGED
@@ -1,9 +1,12 @@
1
1
  {
2
2
  "name": "lastlight-core",
3
- "version": "0.25.9",
3
+ "version": "0.27.0",
4
4
  "description": "GitHub repository maintenance agent — Agent SDK harness",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
7
+ "bin": {
8
+ "lastlight-state": "dist/state/state-cli.js"
9
+ },
7
10
  "exports": {
8
11
  ".": "./dist/index.js",
9
12
  "./evals": {
@@ -15,6 +18,7 @@
15
18
  },
16
19
  "files": [
17
20
  "dist",
21
+ "drizzle",
18
22
  "config",
19
23
  "workflows",
20
24
  "skills",
@@ -41,9 +45,11 @@
41
45
  "node": ">=22.12"
42
46
  },
43
47
  "dependencies": {
44
- "@earendil-works/pi-ai": "^0.84.1",
48
+ "@earendil-works/pi-ai": "^0.84.2",
45
49
  "@hono/node-server": "^2.1.1",
46
50
  "@kubernetes/client-node": "1.4.0",
51
+ "@libsql/client": "^0.17.4",
52
+ "@neondatabase/serverless": "^1.1.0",
47
53
  "@octokit/auth-app": "^8.3.0",
48
54
  "@opentelemetry/api": "^1.9.1",
49
55
  "@opentelemetry/exporter-logs-otlp-http": "^0.221.0",
@@ -60,27 +66,29 @@
60
66
  "@slack/bolt": "^5.0.0",
61
67
  "@slack/web-api": "^8.0.0",
62
68
  "arctic": "^3.7.0",
63
- "better-sqlite3": "^13.0.3",
64
69
  "croner": "^10.0.1",
65
- "hono": "^4.13.2",
70
+ "drizzle-orm": "^0.45.2",
71
+ "hono": "^4.13.3",
66
72
  "octokit": "^5.0.5",
73
+ "pg": "^8.23.0",
67
74
  "pino": "10.3.1",
68
75
  "pino-pretty": "13.1.3",
69
76
  "yaml": "^2.8.3",
70
77
  "zod": "^4.3.6",
71
- "agentic-pi": "0.4.3",
72
- "lastlight-shared": "0.3.7",
73
- "lastlight-workflow-engine": "0.3.5"
78
+ "agentic-pi": "0.4.4",
79
+ "lastlight-shared": "0.5.0",
80
+ "lastlight-workflow-engine": "0.5.0"
74
81
  },
75
82
  "devDependencies": {
83
+ "@electric-sql/pglite": "^0.5.5",
76
84
  "@opentelemetry/context-async-hooks": "^2.10.0",
77
85
  "@opentelemetry/sdk-trace-base": "^2.10.0",
78
- "@types/better-sqlite3": "^7.6.0",
79
- "@types/node": "^26.1.1",
80
- "concurrently": "^10.0.4",
81
- "dependency-cruiser": "^18.1.0",
82
- "tsx": "^4.23.1",
83
- "typescript": "^5.7.0",
86
+ "@types/node": "^26.2.0",
87
+ "@types/pg": "^8.23.1",
88
+ "concurrently": "^10.0.5",
89
+ "drizzle-kit": "^0.31.10",
90
+ "tsx": "^4.23.12",
91
+ "typescript": "^7.0.2",
84
92
  "vitest": "^4.1.10"
85
93
  },
86
94
  "scripts": {
@@ -93,8 +101,16 @@
93
101
  "dev": "concurrently -n server,dash -c blue,magenta \"bash scripts/dev-local.sh\" \"pnpm --filter @lastlight/dashboard dev\"",
94
102
  "dev:server": "bash scripts/dev-local.sh",
95
103
  "dev:dashboard": "pnpm --filter @lastlight/dashboard dev",
104
+ "dev:postgres": "LASTLIGHT_DEV_DB=postgres pnpm run dev",
105
+ "dev:db:up": "docker compose -f docker-compose.yml --project-directory ../.. --profile postgres up -d postgres",
106
+ "dev:db:down": "docker compose -f docker-compose.yml --project-directory ../.. --profile postgres stop postgres",
107
+ "dev:db:psql": "docker compose -f docker-compose.yml --project-directory ../.. --profile postgres exec postgres psql -U lastlight -d lastlight",
108
+ "dev:db:migrate": "tsx src/state/state-cli.ts migrate --from data/lastlight.db --to postgres://lastlight:lastlight@127.0.0.1:55432/lastlight",
96
109
  "test:watch": "vitest",
97
- "lint:boundaries": "depcruise --config .dependency-cruiser.cjs src",
98
- "typecheck": "tsc --noEmit && pnpm run lint:boundaries"
110
+ "lint:boundaries": "node ../../scripts/lint-import-boundaries.mjs server",
111
+ "db:generate:sqlite": "drizzle-kit generate --config drizzle-sqlite.config.ts",
112
+ "db:generate:pg": "drizzle-kit generate --config drizzle-pg.config.ts",
113
+ "lint:promises": "node scripts/lint-floating-promises.mjs . ../../packages/workflow-engine ../../packages/shared",
114
+ "typecheck": "tsc --noEmit && pnpm run lint:boundaries && pnpm run lint:promises"
99
115
  }
100
116
  }
@@ -51,6 +51,42 @@ COPY packages/agentic-pi/ packages/agentic-pi/
51
51
  RUN pnpm --filter agentic-pi build \
52
52
  && pnpm --filter agentic-pi deploy --prod /bundle
53
53
 
54
+ # ── lastlight CLI build stage ────────────────────────────────────────────────
55
+ # The review evidence pipeline's deterministic phases run `lastlight-facts`
56
+ # (pr-review.yaml resolves it via `command -v`), and the user rule is: NO
57
+ # standalone facts binary distribution — `lastlight facts` is a subcommand of
58
+ # the normal `lastlight` CLI and the `lastlight-facts` bin exists only as the
59
+ # CLI's dependency bin (`lastlight-code-facts` is a dependency of packages/cli).
60
+ # So we vendor the WHOLE CLI bundle, exactly like agentic-pi above: build from
61
+ # the workspace, `pnpm deploy` a self-contained lockfile-resolved tree, COPY it
62
+ # in content-addressed. This also enforces WP1's pinned-compiler rule — the
63
+ # bundle carries its own `typescript`, so facts never resolve the target repo's.
64
+ FROM node:24-slim AS lastlight-cli-build
65
+ RUN corepack enable
66
+ WORKDIR /repo
67
+ COPY pnpm-workspace.yaml pnpm-lock.yaml package.json tsconfig.base.json ./
68
+ # The CLI's `prepare` script (scripts/copy-plugin.mjs) stages the repo-root
69
+ # plugin dirs into the package and pnpm runs it during install — so the script
70
+ # and both source dirs must be present BEFORE the frozen install.
71
+ COPY plugins/ plugins/
72
+ COPY .claude-plugin/ .claude-plugin/
73
+ COPY packages/cli/package.json packages/cli/package.json
74
+ COPY packages/cli/scripts/ packages/cli/scripts/
75
+ COPY packages/code-facts/package.json packages/code-facts/package.json
76
+ COPY packages/shared/package.json packages/shared/package.json
77
+ COPY packages/workflow-engine/package.json packages/workflow-engine/package.json
78
+ RUN pnpm install --frozen-lockfile --filter lastlight...
79
+ COPY packages/cli/ packages/cli/
80
+ COPY packages/code-facts/ packages/code-facts/
81
+ COPY packages/shared/ packages/shared/
82
+ COPY packages/workflow-engine/ packages/workflow-engine/
83
+ # Build in dependency order: code-facts + engine (leaves) → shared → cli.
84
+ RUN pnpm --filter lastlight-code-facts build \
85
+ && pnpm --filter lastlight-workflow-engine build \
86
+ && pnpm --filter lastlight-shared build \
87
+ && pnpm --filter lastlight build \
88
+ && pnpm --filter lastlight deploy --prod /bundle
89
+
54
90
  # ── Sandbox image ────────────────────────────────────────────────────────────
55
91
  FROM ${BASE_IMAGE}
56
92
 
@@ -64,6 +100,24 @@ COPY --from=agentic-pi-build /bundle /opt/agentic-pi
64
100
  RUN chmod +x /opt/agentic-pi/dist/cli.js \
65
101
  && ln -sf /opt/agentic-pi/dist/cli.js /usr/local/bin/agentic-pi
66
102
 
103
+ # lastlight CLI (carries `lastlight facts` + the lastlight-facts dependency
104
+ # bin), vendored from the build stage above — same content-addressed pattern.
105
+ # The wrappers pin the IMAGE's system node (/usr/local/bin/node) explicitly:
106
+ # fnm switches the `node` on PATH per repo .nvmrc, and a `#!/usr/bin/env node`
107
+ # shim would run the facts engine under whatever the target repo pins (possibly
108
+ # < 22, below the CLI's engines floor). /opt/lastlight/bin is also the baked
109
+ # fallback path pr-review.yaml echoes when `command -v lastlight-facts` fails —
110
+ # with these symlinks on /usr/local/bin it never should.
111
+ COPY --from=lastlight-cli-build /bundle /opt/lastlight
112
+ RUN mkdir -p /opt/lastlight/bin \
113
+ && printf '#!/bin/sh\nexec /usr/local/bin/node /opt/lastlight/dist/cli.js "$@"\n' \
114
+ > /opt/lastlight/bin/lastlight \
115
+ && printf '#!/bin/sh\nexec /usr/local/bin/node /opt/lastlight/node_modules/lastlight-code-facts/dist/cli.js "$@"\n' \
116
+ > /opt/lastlight/bin/lastlight-facts \
117
+ && chmod +x /opt/lastlight/bin/lastlight /opt/lastlight/bin/lastlight-facts \
118
+ && ln -sf /opt/lastlight/bin/lastlight /usr/local/bin/lastlight \
119
+ && ln -sf /opt/lastlight/bin/lastlight-facts /usr/local/bin/lastlight-facts
120
+
67
121
  # Agent context (baked at /app/ — entrypoint cats into workspace/AGENTS.md)
68
122
  COPY apps/server/agent-context/ /app/agent-context/
69
123
 
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  name: code-review
3
- description: The shared rubric for reviewing a code change — precision-first, high-signal findings only (Critical/Important), plus what to check (correctness, contracts between producer and consumer, security, edge cases, regression risk, test coverage). Use when reviewing a PR or a branch diff.
4
- version: 2.1.0
3
+ description: The shared rubric for reviewing a code change — precision-first, high-signal findings only (Critical/Important), what to check (correctness, contracts between producer and consumer, security, edge cases, regression risk, test coverage), and what is NOT a finding (pre-existing issues, linter territory, aspirational conventions the repo does not follow). Use when reviewing a PR or a branch diff.
4
+ version: 2.4.0
5
5
  tags: [review, code-quality]
6
6
  ---
7
7
 
@@ -21,25 +21,58 @@ not just the happy path.
21
21
 
22
22
  A review is only useful if people trust it. A noisy reviewer gets muted; every
23
23
  low-value comment you post spends the credibility of the ones that matter. So
24
- the bar is **high-signal only**:
24
+ the bar is **high-signal only** — on what you **post**. Read "Where the gate
25
+ applies" below first: if your output is consumed by a later stage rather than by
26
+ a human, none of the filtering in this section is yours to do.
25
27
 
26
28
  - **Post only Critical and Important findings.** Suggestions and Nits (below)
27
29
  are *not* worth a formal review comment on their own — drop them, or fold at
28
- most one genuinely valuable line into the summary. When in doubt, leave it out.
30
+ most one genuinely valuable line into the summary. When in doubt about a
31
+ finding's **tier**, leave it out of the review.
29
32
  - **If you cannot name the concrete impact — what breaks, and for which input or
30
33
  caller — do not post it.** "This could be cleaner" is not a finding; "this
31
34
  crashes when `items` is empty because line 42 indexes `[0]`" is.
32
- - **Confidence gate — refute, don't doubt.** Before you finalise, re-read each
33
- finding against the actual code and try to *refute your own claim*. Dropping
34
- it requires naming the specific thing that makes it wrong: the guard you
35
- missed, the caller that already validates, the type that makes the case
36
- unreachable. **Unease is not a refutation.** "I'm not certain" is an
37
- instruction to go and read the other side of the contract, not to delete the
38
- finding.
35
+ - **One defect per comment, and distinct claims stay distinct.** Never fold a
36
+ second, independent defect into an "Additionally, …" sentence of the first —
37
+ two defects sharing a comment get read, answered and tracked as one, and one
38
+ of them is lost. Two comments may share a line. Keep each claim's precision
39
+ too: "out of date" is not "wrong", and collapsing distinct claims into the
40
+ harsher one overstates the review's case.
41
+ - **Confidence gate — refute, don't doubt, and only at the end.** Before you
42
+ finalise, re-read each finding against the actual code and try to *refute your
43
+ own claim*. Dropping it requires naming the specific thing that makes it
44
+ wrong: the guard you missed, the caller that already validates, the type that
45
+ makes the case unreachable. **Unease is not a refutation.** "I'm not certain"
46
+ is an instruction to go and read the other side of the contract, not to delete
47
+ the finding.
48
+
49
+ ### Where the gate applies
50
+
51
+ The confidence gate filters what you **post**. It is not a filter on what you
52
+ are allowed to notice, to write down, or to hand to a later stage — and which of
53
+ those you are doing decides whether it fires at all.
54
+
55
+ - **You are producing the review** — writing `findings.json`, submitting a
56
+ formal review, or recording a verdict on a branch diff. **The gate fires.**
57
+ Everything in this section applies: yours is the last hand on the work before
58
+ a human reads it, so an ungrounded finding costs real credibility.
59
+ - **You are one pass of a multi-pass review** — discharging obligations and
60
+ appending hypotheses to a per-family file for a later phase to probe and
61
+ adjudicate. **The gate does not fire.** Record the mechanism you cannot yet
62
+ refute. Every downstream stage can only *remove*, so nothing there can recover
63
+ a hypothesis you declined to write down, and a pass that self-censors is
64
+ deleting evidence on behalf of a stage that has not run yet.
65
+
66
+ The split is measured, not stylistic. Google's AutoCommenter found a single
67
+ **global** confidence threshold (`t = 0.98`) catastrophic: roughly **80% of the
68
+ predictions it discarded as below-threshold were correct anyway**. Replacing it
69
+ with per-check thresholds raised recall without costing precision. So the gate
70
+ is worth having at the one point where a wrong finding is actually paid for, and
71
+ is expensive everywhere upstream of it.
39
72
 
40
73
  ### The gate cuts both ways
41
74
 
42
- The gate above exists to stop *speculative* findings. It is not a reason to
75
+ The confidence gate exists to stop *speculative* findings. It is not a reason to
43
76
  approve a change you have not actually checked. Two failure modes, equally bad:
44
77
 
45
78
  | Failure | What it looks like | Cost |
@@ -104,7 +137,11 @@ what makes a comment actionable rather than a vague worry.
104
137
  parse/validate/emit responsibilities; ask for helper extraction. This is an
105
138
  **Important** finding, not a nit.
106
139
  - **Duplication** — flag avoidable duplicated logic (two or more clone groups of
107
- the same code/branching). DRY is **should-fix** here, not merely "nice to have."
140
+ the same code/branching). DRY is **should-fix** here, not merely "nice to
141
+ have." This is about *logic*: a repeated **literal** — a constant, a URL, a
142
+ storage key appearing in source and its test, or on both sides of a stack —
143
+ is a finding only when this change makes the copies diverge in behaviour
144
+ (see "Not findings").
108
145
  - **Type safety** — flag `as any`, unchecked `as`-casts, or `@ts-ignore` used to
109
146
  silence the compiler or to bypass a validator the same code path defines.
110
147
  - **Regression risk** — existing callers of changed functions; behaviour changes
@@ -117,6 +154,54 @@ what makes a comment actionable rather than a vague worry.
117
154
  Say so explicitly, quoting the assertion.
118
155
  - **Fit** — does it match the codebase's existing patterns and conventions?
119
156
 
157
+ ## Not findings
158
+
159
+ The list above is what *counts*. This is what does **not**, however real it may
160
+ be. It is a **category** rule, not a confidence bar: "I am not certain this is
161
+ enforced" is not on it. Read it with "Where the gate applies" — a survey pass is
162
+ still told to over-produce, and the only thing this removes from that output is
163
+ noise it was never supposed to produce, never a mechanism it could not refute.
164
+
165
+ - **Pre-existing issues.** The change is adjacent to them; it did not cause them.
166
+ - **Anything a linter, typechecker or compiler would catch.** They already run,
167
+ and they are right more often than you are. The exception is an assertion that
168
+ *silences* one — `as any`, `@ts-ignore` — which is by definition something the
169
+ compiler does not catch (see Type safety).
170
+ - **Real issues on lines this PR did not touch — unless this PR is what makes
171
+ them wrong.** A consumer the diff never opened, now reading a shape the diff
172
+ moved, IS a finding and is the highest-value one there is (see Contracts).
173
+ What is excluded is a defect that was already there and still is.
174
+ - **Changes that are clearly intentional and part of the broader change.** If
175
+ the diff is doing X on purpose, "this does X" is a restatement, not a finding.
176
+ - **Points already deliberately silenced in the code** — an explicit
177
+ suppression, an ignore directive, a comment saying why. Someone already
178
+ decided; re-raising it costs the review's credibility and settles nothing.
179
+ - **Conventions the reviewed repository does not actually follow.** **The
180
+ repository's conventions govern — not yours, and not the ones it aspires
181
+ to.** If the merged code does not follow a convention, that convention is
182
+ aspirational and departing from it is not a finding. Do not flag missing
183
+ optional or "encouraged" fields. Read the surrounding code and the neighbours
184
+ of the file you are reviewing; they are the standard, not the style guide.
185
+ - **A repeated literal the merged code already repeats.** "This value is
186
+ hardcoded in two places" — a source file and its test, a frontend and its
187
+ backend — is the aspirational-convention rule in its most common costume.
188
+ If the copies agree and this change does not make them observably diverge,
189
+ sharing the constant is a Suggestion, not a finding. The moment this change
190
+ DOES let the copies disagree in behaviour it becomes a real finding — but
191
+ then say what diverges and for whom, not that a future edit needs two
192
+ keystrokes.
193
+ - **"X is never validated" with no consumer that misbehaves.** A missing check
194
+ is a finding when some input or caller reaches code that then does the wrong
195
+ thing — name that path. Validation nobody's misbehaviour depends on is a
196
+ design note.
197
+ - **Description staleness — though a doc's claims are checkable.** A PR
198
+ description that under- or over-describes the change's scope is a note for
199
+ the summary, not a finding. But a doc line, comment or example that asserts
200
+ something checkable about the code's behaviour which is **false at head** IS
201
+ a finding — the next reader will act on it — and so is an example that
202
+ contradicts the same file's guidance. The test: does the sentence make a
203
+ claim the code can falsify? Then check it like code; otherwise it is prose.
204
+
120
205
  ## Calibration
121
206
 
122
207
  - Don't nitpick generated files (lockfiles, compiled assets).
@@ -1,19 +1,40 @@
1
1
  ---
2
2
  name: pr-review
3
- description: Review a GitHub pull request and post one formal review — advance the existing discussion and give precision-first, high-signal feedback. A pure code review — no building. Use when asked to review a PR or on a cron PR scan.
4
- version: 7.2.0
3
+ description: Review a GitHub pull request and post one formal review — advance the existing discussion and give precision-first, high-signal feedback. Judgement on the diff, not a build gate — CI validates that it builds, and a targeted probe is allowed as evidence. Use when asked to review a PR or on a cron PR scan.
4
+ version: 7.4.0
5
5
  tags: [github, review, code-quality]
6
6
  chat: true
7
7
  ---
8
8
 
9
9
  # PR Review
10
10
 
11
- Review an open PR — high-signal findings only. This is a **pure code review**:
12
- read the change and reason about it. Do **not** install dependencies, build, or
13
- run tests — that is CI's job, and it validates whether the change actually works
14
- far more reliably than you re-running it here. Your job is judgement on the diff,
15
- not a build gate. A noisy review gets muted, so precision matters more than
16
- volume.
11
+ Review an open PR — high-signal findings only. Read the change and reason about
12
+ it; where reasoning cannot settle a question, **run something**. Installing the
13
+ repo's dependencies, opening the installed library source, and writing the
14
+ smallest file that exercises the behaviour and executing it are all **allowed
15
+ and expected** — that is a *probe*, and it is how a question about how code
16
+ actually behaves gets settled instead of guessed.
17
+
18
+ Two limits on a probe, and they are what keep it from becoming a second CI:
19
+
20
+ - **It must produce evidence you can quote.** Keep the command and its output,
21
+ and cite them in the finding that rests on them. "I ran it and it fails" with
22
+ nothing to quote is worth exactly what a guess is worth.
23
+ - **It is targeted at one question, never a re-derivation of CI.** Whether the
24
+ change builds and whether the suite is green are already answered — see §4.
25
+ Never spend a probe on those.
26
+
27
+ > **Why this is spelled out rather than left implicit.** An earlier version of
28
+ > this skill forbade installing dependencies, and the measured failure was not
29
+ > disobedience — it was the opposite. The reviewer referred to `WebClient` 32
30
+ > times and never once opened `node_modules/@slack`, because the workspace it
31
+ > was given had no `node_modules` at all. "Open the library source" was not
32
+ > ignored; it was structurally impossible. **An affordance you do not have reads
33
+ > to you as an instruction you cannot follow**, so what you *can* run is part of
34
+ > the contract, not an implementation detail.
35
+
36
+ Your job is judgement on the diff, not a build gate. A noisy review gets muted,
37
+ so precision matters more than volume.
17
38
 
18
39
  You do **not** post the review yourself. You write your findings to a JSON file
19
40
  (`.lastlight/pr-review/findings.json`) and a deterministic follow-up step posts
@@ -28,8 +49,17 @@ the precision bar and what-to-check rubric.
28
49
  The harness pre-clones the PR's head ref and drops you **inside the checkout** —
29
50
  your cwd **is** the repo (`ls -la` shows `.git/` directly; `AGENTS.md` is the
30
51
  sibling one level up at `../`). Use `git`/`read`/`grep` from here. To refresh:
31
- `git fetch origin <branch> --depth 50 && git reset --hard FETCH_HEAD`. If the
32
- checkout is somehow missing, `git clone https://github.com/{{owner}}/{{repo}}.git .`.
52
+ `git fetch origin <branch> && git reset --hard FETCH_HEAD` — **no `--depth`**,
53
+ for the reason in §3. If the checkout is somehow missing,
54
+ `git clone https://github.com/{{owner}}/{{repo}}.git .`.
55
+
56
+ **Every `.lastlight/…` path in this skill and in any prompt is relative to that
57
+ cwd — use it relative, never absolute.** The skill files you were handed are
58
+ absolute paths under `…/.lastlight-skills/`, and that directory is a sibling of
59
+ the checkout, one level ABOVE you. Joining a `.lastlight/…` path onto the
60
+ directory your skills came from lands outside the repo and reads nothing. This
61
+ is measured, not hypothetical: it cost 23 of 120 survey branches their seeded
62
+ obligations across three runs on 2026-08-22.
33
63
 
34
64
  **Read code from this local checkout, never the API.** Use `git`/`read`/`grep`
35
65
  on disk for the diff and file contents. Do **not** call
@@ -103,13 +133,49 @@ contains a problem you raised, the correct `event` is still
103
133
 
104
134
  ### 3. Get the diff
105
135
 
136
+ **First, check whether it is already staged.** When the review evidence pipeline
137
+ is on, the deterministic `facts` phase resolves this range once and writes it
138
+ down: `.lastlight/pr-review/diff/index.md` lists every changed file with its
139
+ status, its changed line ranges and a per-file patch beside it under
140
+ `.lastlight/pr-review/diff/`. If that index is there, read it and the patches
141
+ instead of running the commands below — the range is already settled, and every
142
+ re-derivation is another chance to spell it two-dot. Those paths are relative to
143
+ this checkout; open them exactly as written. (If the index says NOT AVAILABLE, or
144
+ there is no `.lastlight/pr-review/diff/` at all, carry on here.)
145
+
106
146
  From inside `<repo>/`:
107
147
  ```
108
- git fetch origin <baseRef> --depth 50 # base isn't in the head-only clone
148
+ # The harness already materialized origin/<baseRef>, deepening base AND head
149
+ # until they share a merge base. Verify that — do NOT re-fetch with --depth.
150
+ # Repair only if it's actually missing: deepen BOTH sides, because unshallowing
151
+ # the base alone leaves HEAD with no reachable ancestor and merge-base still fails.
152
+ git merge-base origin/<baseRef> HEAD >/dev/null 2>&1 || {
153
+ git fetch origin --unshallow || true
154
+ git fetch origin "+refs/heads/<baseRef>:refs/remotes/origin/<baseRef>" --unshallow || true
155
+ }
156
+
109
157
  git diff --stat origin/<baseRef>...HEAD # churn
110
158
  git diff origin/<baseRef>...HEAD # the patch
111
159
  ```
112
160
 
161
+ **Never `git fetch --depth N` in this checkout.** A depth-limited fetch writes
162
+ `.git/shallow` even into an already-complete clone, re-cutting history N commits
163
+ back from the base tip — which severs the merge base on any PR that forked
164
+ further back than that, and undoes the deepening the harness already paid for.
165
+
166
+ **Three dots, always.** `origin/<baseRef>...HEAD` is the merge-base diff and
167
+ matches GitHub's own PR diff. Two-dot (`git diff origin/<baseRef> HEAD`)
168
+ additionally contains every commit the base branch picked up since the PR
169
+ forked, and the author wrote none of it — measured across 50 real PRs, 9
170
+ diverge, one of them 6125 files against 3.
171
+
172
+ **If `merge-base` still fails after the repair**, the diff range could not be
173
+ established and you have nothing to review. Do not quietly fall back to two-dot
174
+ and review that instead. Write `event: "COMMENT"` — never `APPROVE` — with
175
+ `findings: []` and a `summary` saying the base and head share no reachable
176
+ history, then stop. Reviewing the wrong range and reporting success is the exact
177
+ failure this instruction exists to prevent.
178
+
113
179
  ### 4. Read what CI said
114
180
 
115
181
  Your Context block carries `checksState` — `passing` / `failing` / `pending` /
@@ -125,16 +191,21 @@ speculate about whether this builds.**
125
191
  line 42, which is the same issue as finding 2"* — and let it steer you toward
126
192
  the part of the diff that is actually wrong.
127
193
  - `checksState: pending` / `none` — no CI evidence either way. Review the code
128
- as written; still don't build or run it.
194
+ as written, and do **not** stand in for CI by building it or running the
195
+ suite — a matrix you cannot reproduce on one machine is not yours to guess at.
196
+ A targeted probe for one specific question is still fair game.
129
197
 
130
198
  ### 5. Assess and write your findings
131
199
 
132
200
  Apply the **code-review** skill's rubric — read each changed file in context;
133
201
  check correctness / **contracts** / edge-cases / security / regression-risk /
134
202
  test-coverage.
135
- Reason about the code statically; **don't build or run it** — CI is the build
136
- gate and it has already spoken (§4); spend your effort on what a human reviewer
137
- sees.
203
+ Reason about the code statically first, and spend nothing re-deriving whether it
204
+ builds — CI is the build gate and it has already spoken (§4). When a finding
205
+ turns on how the code *behaves* rather than on how it reads — library or
206
+ framework semantics, a lifecycle, an option interaction, an input the code does
207
+ not expect — settle it with a probe (see the top of this skill) and quote the
208
+ transcript in the finding's body.
138
209
  Follow that skill's **precision-first** rule: keep **only Critical and Important**
139
210
  findings, each anchored to a `path:line` with a one-line concrete impact (what
140
211
  breaks, for which input or caller). Drop Suggestions and Nits.
@@ -173,8 +244,8 @@ the shape is:
173
244
  "findings": [
174
245
  {
175
246
  "path": "src/foo.ts",
247
+ "existingCode": "the verbatim line(s) this finding is about",
176
248
  "line": 42,
177
- "side": "RIGHT",
178
249
  "severity": "Critical",
179
250
  "title": "Short label for the finding",
180
251
  "body": "Concrete impact — what breaks, for which input or caller.",
@@ -190,11 +261,16 @@ SHA and diff from the harness's own context and the checkout, so you do **not**
190
261
  record any of that metadata (that reliance was a footgun — omit it).
191
262
 
192
263
  Rules:
193
- - **Anchor precisely.** `path` must match the diff path exactly; `line`/`side`
194
- must point at a line that appears in the diff (added/context → `side: RIGHT`;
195
- removed/context → `side: LEFT`). A finding whose line isn't in the diff is
196
- demoted to the summary body, so get the anchor right. Use optional `start_line`
197
- (same side) for a multi-line range.
264
+ - **Quote the code; do not count the lines.** `existingCode` is the anchor of
265
+ record: copy the line(s) the finding is about character-for-character and the
266
+ harness finds them for you — in the file's own hunks, then the whole file, then
267
+ (on a *unique* match) elsewhere in the diff, which is how a finding filed
268
+ against the wrong half of a declaration/implementation pair still lands. `line`
269
+ and `side` are **advisory hints** that get overwritten; `start_line` is derived,
270
+ so do not set it. `path` should still match the diff path. An excerpt that
271
+ cannot be found is demoted to the summary body — nothing is lost, but an inline
272
+ comment at the defect site is worth much more, so copy carefully rather than
273
+ paraphrasing.
198
274
  - `severity` is `Critical` or `Important` only.
199
275
  - `suggestion` is optional — include it only when a concrete one-to-few-line fix
200
276
  is obvious. It must be the exact replacement text for the anchored line(s),
@@ -4,7 +4,8 @@ The `pr-review` skill writes its findings to `.lastlight/pr-review/findings.json
4
4
  (relative to the repo checkout — your cwd). The first-class `post-review` action
5
5
  reads this file and posts **one** formal GitHub review:
6
6
 
7
- - Each finding whose `line`/`side` anchors to a line that appears in the PR diff
7
+ - Each finding is anchored by matching its **`existingCode`** excerpt against the
8
+ diff. If the excerpt resolves to a line that appears in the PR diff, the finding
8
9
  becomes an **inline comment** on that exact line.
9
10
  - Any finding whose anchor isn't in the diff is **demoted** into the review body
10
11
  under an "Additional findings" heading (GitHub rejects comments off the diff).
@@ -17,6 +18,12 @@ own run context and the checkout, so you do **not** record any of that metadata.
17
18
  You never call `github_create_pull_request_review` yourself; writing this file is
18
19
  how you submit.
19
20
 
21
+ > **Analysis mode writes a superset.** When the review evidence pipeline is on,
22
+ > the adjudicate phase owns this file and adds `tier` / `family` / `hypotheses` /
23
+ > `confidence` per finding and a `dropped[]` list. That contract lives in the
24
+ > adjudicate prompt (`workflows/prompts/review-adjudicate.md`); everything below
25
+ > is the shape both modes share.
26
+
20
27
  ## Top-level object
21
28
 
22
29
  | Field | Type | Required | Meaning |
@@ -31,14 +38,38 @@ how you submit.
31
38
  | Field | Type | Required | Meaning |
32
39
  |---|---|---|---|
33
40
  | `path` | string | yes | Repo-relative file path, matching the diff path exactly. |
34
- | `line` | number | yes | Line number on `side` that the comment anchors to. Must appear in the diff. |
35
- | `side` | string | no | `RIGHT` (added/context line — default) or `LEFT` (removed/context line). |
36
- | `start_line` | number | no | Start of a multi-line range (same `side` as `line`). |
41
+ | `existingCode` | string | **yes** | The **verbatim excerpt** the finding is about, copied character-for-character out of the code. This is the anchor of record — see below. |
42
+ | `line` | number | no | **Advisory.** A hint at where the excerpt is; the harness derives the real line and overwrites this. Wrong is survivable, absent is fine. |
43
+ | `side` | string | no | `RIGHT` (added/context line — default) or `LEFT` (removed/context line). Also derived. |
44
+ | `start_line` | number | no | Derived for you from a multi-line `existingCode`. Do not set it. |
37
45
  | `severity` | string | yes | `Critical` or `Important` only. |
38
46
  | `title` | string | yes | Short label for the finding. |
39
47
  | `body` | string | yes | Concrete impact — what breaks, for which input or caller. |
40
48
  | `suggestion` | string | no | Exact replacement text for the anchored line(s). Rendered as an applyable ```suggestion block. Include only when a concrete one-to-few-line fix is obvious. |
41
49
 
50
+ ## Quote the code; do not count the lines
51
+
52
+ **`existingCode` is how a finding gets anchored, and it is the field to get
53
+ right.** Models quote code accurately and count lines badly, so the harness stops
54
+ asking you to count: it takes your excerpt and finds it, in this order — the
55
+ file's own diff hunks, then the whole head-side file, then (on a *unique* match)
56
+ any other file in the diff, which is how a finding you filed against the wrong
57
+ file of a declaration/implementation pair still lands correctly.
58
+
59
+ Two rules follow:
60
+
61
+ - **Copy, never paraphrase.** Leading and trailing whitespace is ignored, nothing
62
+ else is. A reconstructed-from-memory excerpt does not match and the finding is
63
+ demoted to the review body.
64
+ - **Quote enough to be unique, and no more.** One distinctive line is usually
65
+ right. An excerpt that appears in two files is ambiguous and the harness
66
+ declines to guess rather than anchoring you to the wrong one.
67
+
68
+ A finding whose excerpt cannot be found is still **posted**, in the review body.
69
+ Nothing is lost by an excerpt that fails to resolve — but an inline comment at
70
+ the defect site is worth substantially more than a body entry, so it is worth
71
+ copying carefully.
72
+
42
73
  ## Example — findings with an inline suggestion
43
74
 
44
75
  ```json
@@ -49,8 +80,8 @@ how you submit.
49
80
  "findings": [
50
81
  {
51
82
  "path": "src/cli.ts",
83
+ "existingCode": "const host = cfg.host;",
52
84
  "line": 42,
53
- "side": "RIGHT",
54
85
  "severity": "Critical",
55
86
  "title": "Null deref when --config is omitted",
56
87
  "body": "`cfg.host` is undefined when no config file is passed, so every default-path invocation throws before connecting.",
@@ -58,8 +89,8 @@ how you submit.
58
89
  },
59
90
  {
60
91
  "path": "src/connect.ts",
92
+ "existingCode": " disconnect();",
61
93
  "line": 88,
62
- "side": "RIGHT",
63
94
  "severity": "Important",
64
95
  "title": "Missing await on disconnect()",
65
96
  "body": "`disconnect()` returns a promise that's never awaited, so the socket can leak if the caller exits immediately after."