lastlight-core 0.25.8 → 0.26.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 (172) hide show
  1. package/config/default.yaml +31 -6
  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/routes.js +119 -124
  6. package/dist/admin/routes.js.map +1 -1
  7. package/dist/admin/sessions.d.ts +7 -7
  8. package/dist/admin/sessions.js +6 -4
  9. package/dist/admin/sessions.js.map +1 -1
  10. package/dist/config/config.d.ts +21 -2
  11. package/dist/config/config.js +33 -0
  12. package/dist/config/config.js.map +1 -1
  13. package/dist/config/repo-config.js +6 -7
  14. package/dist/config/repo-config.js.map +1 -1
  15. package/dist/connectors/messaging/base.js +2 -2
  16. package/dist/connectors/messaging/base.js.map +1 -1
  17. package/dist/connectors/messaging/session-manager.d.ts +29 -31
  18. package/dist/connectors/messaging/session-manager.js +156 -189
  19. package/dist/connectors/messaging/session-manager.js.map +1 -1
  20. package/dist/connectors/messaging/thread-transcript.d.ts +2 -2
  21. package/dist/connectors/messaging/thread-transcript.js +14 -8
  22. package/dist/connectors/messaging/thread-transcript.js.map +1 -1
  23. package/dist/connectors/slack/connector.js +5 -5
  24. package/dist/connectors/slack/connector.js.map +1 -1
  25. package/dist/connectors/slack/mrkdwn.d.ts +4 -0
  26. package/dist/connectors/slack/mrkdwn.js +2 -2
  27. package/dist/connectors/slack/mrkdwn.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.d.ts +16 -8
  31. package/dist/cron/handlers.js +49 -31
  32. package/dist/cron/handlers.js.map +1 -1
  33. package/dist/cron/jobs.d.ts +1 -1
  34. package/dist/cron/jobs.js +5 -2
  35. package/dist/cron/jobs.js.map +1 -1
  36. package/dist/cron/repo-digest.d.ts +54 -7
  37. package/dist/cron/repo-digest.js +236 -23
  38. package/dist/cron/repo-digest.js.map +1 -1
  39. package/dist/cron/runner.d.ts +59 -0
  40. package/dist/cron/runner.js +224 -0
  41. package/dist/cron/runner.js.map +1 -0
  42. package/dist/cron/scheduler.js +19 -9
  43. package/dist/cron/scheduler.js.map +1 -1
  44. package/dist/engine/chat/chat-prompt.d.ts +11 -4
  45. package/dist/engine/chat/chat-prompt.js.map +1 -1
  46. package/dist/engine/chat/chat-runner.d.ts +3 -2
  47. package/dist/engine/chat/chat-runner.js +9 -7
  48. package/dist/engine/chat/chat-runner.js.map +1 -1
  49. package/dist/engine/dispatcher.js +29 -25
  50. package/dist/engine/dispatcher.js.map +1 -1
  51. package/dist/engine/executors/orchestrator.d.ts +28 -0
  52. package/dist/engine/executors/orchestrator.js +70 -1
  53. package/dist/engine/executors/orchestrator.js.map +1 -1
  54. package/dist/engine/feedback/ingest.d.ts +4 -4
  55. package/dist/engine/feedback/ingest.js +13 -13
  56. package/dist/engine/feedback/ingest.js.map +1 -1
  57. package/dist/engine/feedback/slack.d.ts +2 -2
  58. package/dist/engine/feedback/slack.js +6 -6
  59. package/dist/engine/feedback/slack.js.map +1 -1
  60. package/dist/engine/fix-harvest.d.ts +1 -1
  61. package/dist/engine/fix-harvest.js +3 -3
  62. package/dist/engine/fix-harvest.js.map +1 -1
  63. package/dist/engine/github/github.d.ts +79 -0
  64. package/dist/engine/github/github.js +111 -0
  65. package/dist/engine/github/github.js.map +1 -1
  66. package/dist/engine/github/team-visibility.js +7 -7
  67. package/dist/engine/github/team-visibility.js.map +1 -1
  68. package/dist/engine/pr-escalation.js +7 -7
  69. package/dist/engine/pr-escalation.js.map +1 -1
  70. package/dist/engine/pr-state.d.ts +1 -1
  71. package/dist/engine/pr-state.js +12 -10
  72. package/dist/engine/pr-state.js.map +1 -1
  73. package/dist/engine/review-check.d.ts +1 -1
  74. package/dist/engine/review-check.js +5 -5
  75. package/dist/engine/review-check.js.map +1 -1
  76. package/dist/engine/router.js +3 -3
  77. package/dist/engine/router.js.map +1 -1
  78. package/dist/index.js +115 -152
  79. package/dist/index.js.map +1 -1
  80. package/dist/notify/digest-blocks.d.ts +61 -0
  81. package/dist/notify/digest-blocks.js +150 -22
  82. package/dist/notify/digest-blocks.js.map +1 -1
  83. package/dist/sandbox/docker.d.ts +33 -1
  84. package/dist/sandbox/docker.js +95 -1
  85. package/dist/sandbox/docker.js.map +1 -1
  86. package/dist/sandbox/k8s/kubernetes-sandbox.d.ts +3 -0
  87. package/dist/sandbox/k8s/kubernetes-sandbox.js +9 -0
  88. package/dist/sandbox/k8s/kubernetes-sandbox.js.map +1 -1
  89. package/dist/sandbox/k8s/pod.d.ts +11 -0
  90. package/dist/sandbox/k8s/pod.js +11 -6
  91. package/dist/sandbox/k8s/pod.js.map +1 -1
  92. package/dist/sandbox/k8s/service-containers.d.ts +43 -0
  93. package/dist/sandbox/k8s/service-containers.js +87 -0
  94. package/dist/sandbox/k8s/service-containers.js.map +1 -0
  95. package/dist/sandbox/reap.d.ts +9 -0
  96. package/dist/sandbox/reap.js +36 -0
  97. package/dist/sandbox/reap.js.map +1 -1
  98. package/dist/sandbox/sandbox.d.ts +14 -0
  99. package/dist/sandbox/sandbox.js +9 -0
  100. package/dist/sandbox/sandbox.js.map +1 -1
  101. package/dist/sandbox/service-containers-docker.d.ts +45 -0
  102. package/dist/sandbox/service-containers-docker.js +78 -0
  103. package/dist/sandbox/service-containers-docker.js.map +1 -0
  104. package/dist/state/approval-store.d.ts +23 -14
  105. package/dist/state/approval-store.js +137 -86
  106. package/dist/state/approval-store.js.map +1 -1
  107. package/dist/state/client.d.ts +105 -0
  108. package/dist/state/client.js +68 -0
  109. package/dist/state/client.js.map +1 -0
  110. package/dist/state/cron-run-store.d.ts +108 -0
  111. package/dist/state/cron-run-store.js +173 -0
  112. package/dist/state/cron-run-store.js.map +1 -0
  113. package/dist/state/db.d.ts +70 -23
  114. package/dist/state/db.js +179 -104
  115. package/dist/state/db.js.map +1 -1
  116. package/dist/state/dialect.d.ts +77 -0
  117. package/dist/state/dialect.js +129 -0
  118. package/dist/state/dialect.js.map +1 -0
  119. package/dist/state/execution-store.d.ts +124 -103
  120. package/dist/state/execution-store.js +569 -374
  121. package/dist/state/execution-store.js.map +1 -1
  122. package/dist/state/feedback-store.d.ts +20 -20
  123. package/dist/state/feedback-store.js +241 -187
  124. package/dist/state/feedback-store.js.map +1 -1
  125. package/dist/state/legacy-sqlite.d.ts +15 -0
  126. package/dist/state/legacy-sqlite.js +131 -0
  127. package/dist/state/legacy-sqlite.js.map +1 -0
  128. package/dist/state/repo-ref.d.ts +9 -4
  129. package/dist/state/repo-ref.js +12 -6
  130. package/dist/state/repo-ref.js.map +1 -1
  131. package/dist/state/schema/pg.d.ts +2788 -0
  132. package/dist/state/schema/pg.js +301 -0
  133. package/dist/state/schema/pg.js.map +1 -0
  134. package/dist/state/schema/sqlite.d.ts +3063 -0
  135. package/dist/state/schema/sqlite.js +391 -0
  136. package/dist/state/schema/sqlite.js.map +1 -0
  137. package/dist/state/team-store.d.ts +26 -13
  138. package/dist/state/team-store.js +140 -93
  139. package/dist/state/team-store.js.map +1 -1
  140. package/dist/state/user-store.d.ts +31 -13
  141. package/dist/state/user-store.js +180 -80
  142. package/dist/state/user-store.js.map +1 -1
  143. package/dist/state/workflow-run-store.d.ts +95 -56
  144. package/dist/state/workflow-run-store.js +419 -314
  145. package/dist/state/workflow-run-store.js.map +1 -1
  146. package/dist/telemetry/index.d.ts +8 -0
  147. package/dist/telemetry/index.js +11 -0
  148. package/dist/telemetry/index.js.map +1 -1
  149. package/dist/workflows/admission.d.ts +4 -3
  150. package/dist/workflows/admission.js +34 -10
  151. package/dist/workflows/admission.js.map +1 -1
  152. package/dist/workflows/handlers/post-review.js +3 -3
  153. package/dist/workflows/handlers/post-review.js.map +1 -1
  154. package/dist/workflows/resume.js +22 -15
  155. package/dist/workflows/resume.js.map +1 -1
  156. package/dist/workflows/runner.js +27 -12
  157. package/dist/workflows/runner.js.map +1 -1
  158. package/dist/workflows/simple.d.ts +23 -0
  159. package/dist/workflows/simple.js +40 -16
  160. package/dist/workflows/simple.js.map +1 -1
  161. package/drizzle/pg/0000_init.sql +235 -0
  162. package/drizzle/pg/meta/0000_snapshot.json +1751 -0
  163. package/drizzle/pg/meta/_journal.json +13 -0
  164. package/drizzle/sqlite/0000_baseline.sql +257 -0
  165. package/drizzle/sqlite/0001_backfill_repo_refs.sql +74 -0
  166. package/drizzle/sqlite/meta/0000_snapshot.json +1593 -0
  167. package/drizzle/sqlite/meta/0001_snapshot.json +1593 -0
  168. package/drizzle/sqlite/meta/_journal.json +20 -0
  169. package/package.json +15 -9
  170. package/dist/state/migrate.d.ts +0 -15
  171. package/dist/state/migrate.js +0 -493
  172. 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,6 +1,6 @@
1
1
  {
2
2
  "name": "lastlight-core",
3
- "version": "0.25.8",
3
+ "version": "0.26.0",
4
4
  "description": "GitHub repository maintenance agent — Agent SDK harness",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -15,6 +15,7 @@
15
15
  },
16
16
  "files": [
17
17
  "dist",
18
+ "drizzle",
18
19
  "config",
19
20
  "workflows",
20
21
  "skills",
@@ -42,9 +43,10 @@
42
43
  },
43
44
  "dependencies": {
44
45
  "@earendil-works/pi-ai": "^0.84.1",
45
- "@hono/node-server": "^2.0.12",
46
+ "@hono/node-server": "^2.1.1",
46
47
  "@kubernetes/client-node": "1.4.0",
47
- "@octokit/auth-app": "^8.2.0",
48
+ "@libsql/client": "^0.17.4",
49
+ "@octokit/auth-app": "^8.3.0",
48
50
  "@opentelemetry/api": "^1.9.1",
49
51
  "@opentelemetry/exporter-logs-otlp-http": "^0.221.0",
50
52
  "@opentelemetry/exporter-metrics-otlp-http": "^0.221.0",
@@ -60,25 +62,26 @@
60
62
  "@slack/bolt": "^5.0.0",
61
63
  "@slack/web-api": "^8.0.0",
62
64
  "arctic": "^3.7.0",
63
- "better-sqlite3": "^13.0.1",
64
65
  "croner": "^10.0.1",
65
- "hono": "^4.12.34",
66
+ "drizzle-orm": "^0.45.2",
67
+ "hono": "^4.13.2",
66
68
  "octokit": "^5.0.5",
67
69
  "pino": "10.3.1",
68
70
  "pino-pretty": "13.1.3",
69
71
  "yaml": "^2.8.3",
70
72
  "zod": "^4.3.6",
71
- "lastlight-shared": "0.3.7",
72
73
  "agentic-pi": "0.4.3",
73
- "lastlight-workflow-engine": "0.3.5"
74
+ "lastlight-workflow-engine": "0.4.0",
75
+ "lastlight-shared": "0.4.0"
74
76
  },
75
77
  "devDependencies": {
78
+ "@electric-sql/pglite": "^0.5.5",
76
79
  "@opentelemetry/context-async-hooks": "^2.10.0",
77
80
  "@opentelemetry/sdk-trace-base": "^2.10.0",
78
- "@types/better-sqlite3": "^7.6.0",
79
81
  "@types/node": "^26.1.1",
80
82
  "concurrently": "^10.0.4",
81
83
  "dependency-cruiser": "^18.1.0",
84
+ "drizzle-kit": "^0.31.10",
82
85
  "tsx": "^4.23.1",
83
86
  "typescript": "^5.7.0",
84
87
  "vitest": "^4.1.10"
@@ -95,6 +98,9 @@
95
98
  "dev:dashboard": "pnpm --filter @lastlight/dashboard dev",
96
99
  "test:watch": "vitest",
97
100
  "lint:boundaries": "depcruise --config .dependency-cruiser.cjs src",
98
- "typecheck": "tsc --noEmit && pnpm run lint:boundaries"
101
+ "db:generate:sqlite": "drizzle-kit generate --config drizzle-sqlite.config.ts",
102
+ "db:generate:pg": "drizzle-kit generate --config drizzle-pg.config.ts",
103
+ "lint:promises": "node scripts/lint-floating-promises.mjs . ../../packages/workflow-engine ../../packages/shared",
104
+ "typecheck": "tsc --noEmit && pnpm run lint:boundaries && pnpm run lint:promises"
99
105
  }
100
106
  }
@@ -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;
@@ -1,493 +0,0 @@
1
- /**
2
- * Apply the full SQLite schema for the harness state DB.
3
- *
4
- * Centralized here (rather than on a store) because the three stores
5
- * (`WorkflowRunStore` / `ApprovalStore` / `ExecutionStore`) all share a
6
- * single `Database` connection and assume the schema already exists. `StateDb`
7
- * is the construction root and calls this once at boot; tests that exercise a
8
- * store directly construct a raw `Database`, call `migrate()`, then build the
9
- * store on top.
10
- *
11
- * Every statement is idempotent (`IF NOT EXISTS` / additive `ALTER` guarded by
12
- * try/catch) so it is safe to run on an existing DB.
13
- */
14
- export function migrate(db) {
15
- db.exec(`
16
- CREATE TABLE IF NOT EXISTS executions (
17
- id TEXT PRIMARY KEY,
18
- trigger_type TEXT NOT NULL,
19
- trigger_id TEXT NOT NULL,
20
- skill TEXT NOT NULL,
21
- -- The target repo as (owner, BARE repo) — see state/repo-ref.ts, the one
22
- -- place that rule is expressed. The owner column arrives by ALTER below
23
- -- on an upgraded DB; it is here too so a fresh DB reaches the same shape.
24
- owner TEXT,
25
- repo TEXT,
26
- issue_number INTEGER,
27
- started_at TEXT NOT NULL,
28
- finished_at TEXT,
29
- success INTEGER,
30
- error TEXT,
31
- turns INTEGER,
32
- duration_ms INTEGER
33
- );
34
-
35
- CREATE INDEX IF NOT EXISTS idx_executions_trigger ON executions(trigger_type, trigger_id);
36
- CREATE INDEX IF NOT EXISTS idx_executions_skill ON executions(skill, started_at);
37
-
38
- CREATE TABLE IF NOT EXISTS workflow_runs (
39
- id TEXT PRIMARY KEY,
40
- workflow_name TEXT NOT NULL,
41
- trigger_id TEXT NOT NULL,
42
- -- Same (owner, BARE repo) pair as the executions ledger above.
43
- owner TEXT,
44
- repo TEXT,
45
- issue_number INTEGER,
46
- current_phase TEXT NOT NULL,
47
- phase_history TEXT NOT NULL DEFAULT '[]',
48
- status TEXT NOT NULL DEFAULT 'running',
49
- context TEXT,
50
- started_at TEXT NOT NULL,
51
- updated_at TEXT NOT NULL,
52
- finished_at TEXT
53
- );
54
- CREATE INDEX IF NOT EXISTS idx_workflow_runs_trigger ON workflow_runs(trigger_id, status);
55
- CREATE INDEX IF NOT EXISTS idx_workflow_runs_status ON workflow_runs(status);
56
- -- Dashboard's workflow-runs list query is ORDER BY started_at DESC
57
- -- LIMIT 20, often with optional workflow_name / status filters and a
58
- -- companion COUNT(*). It polls every 5s, so it's worth a covering
59
- -- index — without one this is a full-table sort.
60
- CREATE INDEX IF NOT EXISTS idx_workflow_runs_started_at ON workflow_runs(started_at DESC);
61
- CREATE INDEX IF NOT EXISTS idx_workflow_runs_name_started ON workflow_runs(workflow_name, started_at DESC);
62
-
63
- CREATE TABLE IF NOT EXISTS cron_overrides (
64
- name TEXT PRIMARY KEY,
65
- enabled INTEGER NOT NULL DEFAULT 1,
66
- schedule TEXT,
67
- updated_at TEXT NOT NULL,
68
- updated_by TEXT
69
- );
70
-
71
- CREATE TABLE IF NOT EXISTS workflow_overrides (
72
- name TEXT PRIMARY KEY,
73
- enabled INTEGER NOT NULL DEFAULT 1,
74
- updated_at TEXT NOT NULL,
75
- updated_by TEXT
76
- );
77
-
78
- CREATE TABLE IF NOT EXISTS workflow_approvals (
79
- id TEXT PRIMARY KEY,
80
- workflow_run_id TEXT NOT NULL,
81
- gate TEXT NOT NULL,
82
- summary TEXT NOT NULL,
83
- status TEXT NOT NULL DEFAULT 'pending',
84
- requested_by TEXT,
85
- responded_by TEXT,
86
- response TEXT,
87
- responded_at TEXT,
88
- created_at TEXT NOT NULL
89
- );
90
- CREATE INDEX IF NOT EXISTS idx_approvals_workflow ON workflow_approvals(workflow_run_id);
91
- CREATE INDEX IF NOT EXISTS idx_approvals_status ON workflow_approvals(status);
92
-
93
- -- First-class user identity (issue #205). An ADDITIVE enrichment table:
94
- -- every actor column elsewhere stays free-text \`login\`, and \`users\` is
95
- -- LEFT-JOINed on it to resolve a real person (name / email / avatar) for
96
- -- the dashboard and future email. \`github_id\` / \`slack_user_id\` are the
97
- -- stable upsert keys; \`login\` is the soft join key. \`email\` is indexed but
98
- -- deliberately NOT unique (corporate shared mailboxes + many null Slack-only
99
- -- rows would collide a UNIQUE constraint) — see issue #205 decisions.
100
- CREATE TABLE IF NOT EXISTS users (
101
- id TEXT PRIMARY KEY, -- randomUUID
102
- github_id INTEGER UNIQUE, -- stable numeric id (upsert key); null for Slack-only rows
103
- login TEXT UNIQUE, -- GitHub login = the soft join key used everywhere
104
- name TEXT,
105
- email TEXT, -- captured for future email; indexed, NOT unique
106
- avatar_url TEXT,
107
- slack_user_id TEXT UNIQUE, -- U… id, linked lazily on Slack match
108
- is_blocked INTEGER NOT NULL DEFAULT 0,
109
- email_is_placeholder INTEGER NOT NULL DEFAULT 0,
110
- created_at TEXT NOT NULL,
111
- updated_at TEXT NOT NULL,
112
- last_login_at TEXT
113
- );
114
- CREATE INDEX IF NOT EXISTS idx_users_login ON users(login);
115
- CREATE INDEX IF NOT EXISTS idx_users_email ON users(email);
116
- CREATE INDEX IF NOT EXISTS idx_users_slack ON users(slack_user_id);
117
-
118
- -- Feedback signals (issue #255) — a 👍/👎 on something the bot wrote, scored
119
- -- against the run that wrote it. Two tables, because a reaction names a
120
- -- MESSAGE and we need a run:
121
- --
122
- -- feedback_anchors one row per reactable artefact the bot posted, and the
123
- -- run it came from. Written when we POST (Slack, where
124
- -- the ts is only ever known at send time) or when a run
125
- -- finishes (GitHub discovery).
126
- -- feedback_signals one row per (anchor, reactor, emoji).
127
- --
128
- -- Surface-agnostic from the start: \`source\` discriminates slack/github so a
129
- -- single query averages across both, and the GitHub poller adds rows rather
130
- -- than columns.
131
- CREATE TABLE IF NOT EXISTS feedback_anchors (
132
- id TEXT PRIMARY KEY, -- randomUUID
133
- source TEXT NOT NULL, -- slack | github
134
- kind TEXT NOT NULL, -- slack_message | issue_comment | review_comment | issue
135
- -- Slack message ts, or the GitHub comment/issue id as a string. Kept TEXT
136
- -- for both: a Slack ts ("1712000000.000100") is not a number, and a
137
- -- GitHub id read back as a float would lose precision.
138
- external_id TEXT NOT NULL,
139
- -- GitHub GraphQL global id. The batched reactions query keys on this, so
140
- -- the poller never has to re-resolve an id it already saw.
141
- node_id TEXT,
142
- -- Slack channel id. GitHub has no channel and stores the empty string
143
- -- rather than NULL, because **SQLite treats NULLs as DISTINCT in a UNIQUE
144
- -- constraint** — with NULL here, the UNIQUE below (and the ON CONFLICT
145
- -- that targets it) is silently inoperative for every GitHub anchor, and
146
- -- re-discovering the same comment forks a second row. A sentinel keeps
147
- -- ONE uniqueness rule and ONE upsert path for both surfaces; the store
148
- -- maps '' back to null at its boundary so callers still see
149
- -- \`channel: string | null\`.
150
- channel TEXT NOT NULL DEFAULT '',
151
- owner TEXT,
152
- repo TEXT,
153
- issue_number INTEGER,
154
- -- The attribution. Null is legal and deliberate: a bot comment we cannot
155
- -- tie to a run is still worth recording — dropping it would silently lose
156
- -- the reaction rather than the run.
157
- workflow_run_id TEXT,
158
- workflow_name TEXT,
159
- -- The Slack THREAD's messaging session, for a chat turn — which has no
160
- -- workflow run. Deliberately not called \`execution_id\`: it is
161
- -- \`messaging_sessions.id\`, which is what an \`executions\` row for a chat
162
- -- turn carries as its \`trigger_id\`, NOT an \`executions.id\`.
163
- messaging_session_id TEXT,
164
- created_at TEXT NOT NULL, -- when the bot posted it
165
- last_polled_at TEXT, -- github only; slack arrives live
166
- UNIQUE(source, channel, external_id)
167
- );
168
- -- The reverse lookup a Slack reaction hits: (channel, ts) → anchor.
169
- CREATE INDEX IF NOT EXISTS idx_feedback_anchors_lookup
170
- ON feedback_anchors(source, channel, external_id);
171
- CREATE INDEX IF NOT EXISTS idx_feedback_anchors_run
172
- ON feedback_anchors(workflow_run_id);
173
- -- The poller's rotation: least-recently-polled first, within the window.
174
- CREATE INDEX IF NOT EXISTS idx_feedback_anchors_poll
175
- ON feedback_anchors(source, created_at, last_polled_at);
176
-
177
- CREATE TABLE IF NOT EXISTS feedback_signals (
178
- id TEXT PRIMARY KEY,
179
- anchor_id TEXT NOT NULL,
180
- -- Denormalized from the anchor so every analytics query is one table.
181
- -- These never change for a given anchor, so there is nothing to keep in
182
- -- sync — the anchor's attribution is fixed the moment it is created.
183
- source TEXT NOT NULL,
184
- workflow_run_id TEXT,
185
- workflow_name TEXT,
186
- messaging_session_id TEXT,
187
- owner TEXT,
188
- repo TEXT,
189
- issue_number INTEGER,
190
- emoji TEXT NOT NULL, -- canonical name (see engine/feedback/reactions.ts)
191
- score INTEGER NOT NULL, -- -2..+2; 0 means "recorded, not scored"
192
- sentiment TEXT NOT NULL,
193
- reactor TEXT, -- GitHub login / Slack user id
194
- reacted_at TEXT, -- when they reacted, when known
195
- observed_at TEXT NOT NULL, -- when WE saw it
196
- -- Set when the reaction is taken away. Retracting rather than deleting
197
- -- keeps "somebody thumbed this and then thought better of it" visible,
198
- -- which is itself a signal; every score query filters on IS NULL.
199
- removed_at TEXT,
200
- -- OTel export watermark. Null means not yet exported, so a restart can't
201
- -- double-emit and signals recorded while telemetry was off can be
202
- -- backfilled later.
203
- exported_at TEXT,
204
- UNIQUE(anchor_id, reactor, emoji)
205
- );
206
- CREATE INDEX IF NOT EXISTS idx_feedback_signals_anchor ON feedback_signals(anchor_id);
207
- CREATE INDEX IF NOT EXISTS idx_feedback_signals_run ON feedback_signals(workflow_run_id);
208
- CREATE INDEX IF NOT EXISTS idx_feedback_signals_observed
209
- ON feedback_signals(observed_at DESC);
210
- CREATE INDEX IF NOT EXISTS idx_feedback_signals_workflow
211
- ON feedback_signals(workflow_name, observed_at DESC);
212
- CREATE INDEX IF NOT EXISTS idx_feedback_signals_export ON feedback_signals(exported_at);
213
-
214
- -- ── GitHub team-based dashboard visibility (issue #169) ────────────────
215
- -- These four tables are a CACHE, not a mirror of the org. Nothing here is
216
- -- enumerated up front: rows appear only for the teams a user who actually
217
- -- logged in belongs to, resolved on demand (see engine/github/team-visibility.ts).
218
- -- That is the whole scaling story — an org with thousands of repos and
219
- -- hundreds of teams costs a handful of requests per logged-in person
220
- -- instead of a full-org crawl. Safe to delete wholesale; it refills.
221
-
222
- -- One row per team we have ever resolved repos for.
223
- CREATE TABLE IF NOT EXISTS github_teams (
224
- org TEXT NOT NULL,
225
- slug TEXT NOT NULL,
226
- name TEXT,
227
- -- When this team's repo grant was last enumerated.
228
- repos_synced_at TEXT NOT NULL,
229
- -- 1 when the enumeration hit the per-team page budget and stopped early,
230
- -- so github_team_repos is a PREFIX of the real grant. A truncated team
231
- -- forces its members to fail open — a partial list would hide repos the
232
- -- person really can see, which is worse than not filtering at all.
233
- truncated INTEGER NOT NULL DEFAULT 0,
234
- PRIMARY KEY (org, slug)
235
- );
236
-
237
- -- A team's grant, already intersected with the managed-repo set. The repo
238
- -- column holds the owner/repo full name.
239
- CREATE TABLE IF NOT EXISTS github_team_repos (
240
- org TEXT NOT NULL,
241
- team_slug TEXT NOT NULL,
242
- repo TEXT NOT NULL,
243
- PRIMARY KEY (org, team_slug, repo)
244
- );
245
-
246
- -- Membership we have LEARNED, not enumerated: one row per (team, login)
247
- -- discovered while resolving that login. Absence means "unknown", never
248
- -- "not a member" — which is why every read path fails open.
249
- CREATE TABLE IF NOT EXISTS github_team_members (
250
- org TEXT NOT NULL,
251
- team_slug TEXT NOT NULL,
252
- login TEXT NOT NULL,
253
- PRIMARY KEY (org, team_slug, login)
254
- );
255
- -- reposForLogin joins membership → team_repos on this column.
256
- CREATE INDEX IF NOT EXISTS idx_github_team_members_login
257
- ON github_team_members(login);
258
-
259
- -- Per-login freshness + outcome, so a resolution that failed or blew its
260
- -- request budget is remembered for the TTL rather than retried on every
261
- -- dashboard poll. status is one of: ok | empty | truncated | error | disabled.
262
- CREATE TABLE IF NOT EXISTS github_visibility_sync (
263
- login TEXT PRIMARY KEY,
264
- synced_at TEXT NOT NULL,
265
- status TEXT NOT NULL,
266
- -- Free-text detail for the error/truncated cases (admin surface only).
267
- detail TEXT
268
- );
269
- `);
270
- // Actor logging (issue #205): who triggered a run and how. Additive on both
271
- // the append-only `executions` ledger and the `workflow_runs` aggregate. The
272
- // run's `triggered_by` is the ORIGINAL trigger; retry/cancel/approve actors
273
- // land on the executions ledger, never overwriting the run's origin value.
274
- // `trigger_actor_type` is one of github | slack | cli | cron | admin | system.
275
- for (const table of ["executions", "workflow_runs"]) {
276
- try {
277
- db.exec(`ALTER TABLE ${table} ADD COLUMN triggered_by TEXT`);
278
- }
279
- catch {
280
- // Column already exists — ignore
281
- }
282
- try {
283
- db.exec(`ALTER TABLE ${table} ADD COLUMN trigger_actor_type TEXT`);
284
- }
285
- catch {
286
- // Column already exists — ignore
287
- }
288
- }
289
- // Mutable phase-to-phase state for features like the socratic explore
290
- // loop that accumulate data across reply-gate pauses.
291
- try {
292
- db.exec(`ALTER TABLE workflow_runs ADD COLUMN scratch TEXT`);
293
- }
294
- catch {
295
- // Column already exists — ignore
296
- }
297
- // Restart attempt counter — bumped each time resumeOrphanedWorkflows
298
- // re-dispatches a still-'running' row at boot. Acts as a circuit
299
- // breaker so an OOM-on-restart loop can't churn forever.
300
- try {
301
- db.exec(`ALTER TABLE workflow_runs ADD COLUMN restart_count INTEGER NOT NULL DEFAULT 0`);
302
- }
303
- catch {
304
- // Column already exists — ignore
305
- }
306
- // Explicit `owner` column. A run targets a GitHub repo identified by
307
- // (owner, repo); `repo` stays a single path-safe segment (taskIds and
308
- // workspace/session dirs derive from it), so the owner previously lived
309
- // ONLY inside the `context` JSON blob. That left the runs list — which
310
- // omits `context` for payload size — unable to reconstruct `owner/repo`,
311
- // so the Repos tab showed a bare row + a managed `owner/repo` row for the
312
- // same repo and the dashboard's GitHub links never resolved. Storing owner
313
- // as its own column fixes both. Backfill existing rows from context.owner
314
- // in the same guarded step (runs once, when the column is first added).
315
- try {
316
- db.exec(`ALTER TABLE workflow_runs ADD COLUMN owner TEXT`);
317
- db.exec(`UPDATE workflow_runs
318
- SET owner = json_extract(context, '$.owner')
319
- WHERE owner IS NULL AND context IS NOT NULL`);
320
- }
321
- catch {
322
- // Column already exists — ignore
323
- }
324
- // ── One repo-identifier rule: (owner, BARE repo) — issue #279 ──────────────
325
- //
326
- // The column above fixed the SHAPE for new rows but left two populations
327
- // behind, so the same column meant two things depending on who wrote it:
328
- // rows predating it hold the qualified `owner/repo` in `repo` itself, and
329
- // `executions` never got an `owner` column at all — the dispatcher wrote the
330
- // qualified string there while the phase executor wrote the bare name, which
331
- // is every workflow phase row.
332
- //
333
- // Six read sites each re-derived "may be bare or qualified" and disagreed
334
- // about which source wins; #278 shipped a filter built on one reading, and a
335
- // non-null non-match HIDES rows rather than showing them. So converge the
336
- // data instead of teaching the seventh consumer the rule.
337
- //
338
- // Ordering matters: `workflow_runs` first, because the `executions` owner
339
- // backfill reads `workflow_runs.owner` back out. Every statement is a no-op
340
- // on a second run — after it, `instr(repo, '/') = 0` — so this is safe to
341
- // re-run, which it is, on every boot.
342
- try {
343
- db.exec(`UPDATE workflow_runs
344
- SET owner = CASE WHEN owner IS NULL OR owner = ''
345
- THEN substr(repo, 1, instr(repo, '/') - 1)
346
- ELSE owner END,
347
- repo = substr(repo, instr(repo, '/') + 1)
348
- WHERE repo IS NOT NULL AND instr(repo, '/') > 0`);
349
- // A row from before the owner column whose `context.owner` was absent has
350
- // one more witness: `trigger_id`, which is built as `owner/repo#N` (or
351
- // `owner/repo::workflow`) from the same pair at dispatch. `resume.ts` and
352
- // the approval-resume path already PREFER it over the columns, so reading
353
- // it here is the existing precedence, not a new guess. Slack-originated
354
- // ids (`slack:…`) carry no repo and are excluded.
355
- db.exec(`UPDATE workflow_runs
356
- SET owner = substr(trigger_id, 1, instr(trigger_id, '/') - 1)
357
- WHERE (owner IS NULL OR owner = '')
358
- AND repo IS NOT NULL
359
- AND trigger_id NOT LIKE 'slack:%'
360
- AND instr(trigger_id, '/') > 0`);
361
- }
362
- catch {
363
- // Best-effort: a run row that won't split is better left alone than
364
- // failing boot. The read path still tolerates both shapes.
365
- }
366
- try {
367
- db.exec(`ALTER TABLE executions ADD COLUMN owner TEXT`);
368
- }
369
- catch {
370
- // Column already exists — ignore
371
- }
372
- try {
373
- // 1. The account is already in the row, on the dispatcher-written rows that
374
- // stored the qualified string.
375
- db.exec(`UPDATE executions
376
- SET owner = substr(repo, 1, instr(repo, '/') - 1)
377
- WHERE (owner IS NULL OR owner = '')
378
- AND repo IS NOT NULL AND instr(repo, '/') > 0`);
379
- // 2. Otherwise it comes from the run that owns the execution. This is the
380
- // bulk: every phase row, written bare from `GitSandboxAccess`.
381
- // `build-cycle` rows are covered by (1) and chat rows carry no repo at
382
- // all, so there is nothing left needing a `trigger_id` parse.
383
- db.exec(`UPDATE executions
384
- SET owner = (SELECT r.owner FROM workflow_runs r WHERE r.id = executions.workflow_run_id)
385
- WHERE (owner IS NULL OR owner = '') AND workflow_run_id IS NOT NULL`);
386
- // 3. Now de-qualify, once the account has been rescued off it.
387
- db.exec(`UPDATE executions
388
- SET repo = substr(repo, instr(repo, '/') + 1)
389
- WHERE repo IS NOT NULL AND instr(repo, '/') > 0`);
390
- }
391
- catch {
392
- // Same best-effort rule as above — the ledger is append-only history, and
393
- // an un-normalized row degrades a dashboard filter, never a run.
394
- }
395
- // `feedback_anchors.channel` moved from nullable to a '' sentinel (issue
396
- // #255) so its UNIQUE actually binds for GitHub — see the CREATE TABLE above.
397
- // `CREATE TABLE IF NOT EXISTS` can't restate a column, so backfill any rows
398
- // written by a build that predates the fix. Guarded like every ALTER here: on
399
- // a table that already accumulated NULL-channel duplicates the UPDATE trips
400
- // the constraint, and leaving those rows alone is strictly better than
401
- // failing boot over a cache of reaction anchors.
402
- try {
403
- db.exec(`UPDATE feedback_anchors SET channel = '' WHERE channel IS NULL`);
404
- }
405
- catch {
406
- // Pre-existing duplicates — they age out via `retentionDays`.
407
- }
408
- // The run's OTel trace/span context (issue #255). A feedback signal can
409
- // arrive days after the run finished and its span closed, so the only way to
410
- // put the score on the trace it grades is to remember where that trace was.
411
- // Captured by the observability adapter in `src/workflows/runner.ts` when the
412
- // `lastlight.workflow.run` span opens; null whenever telemetry was disabled,
413
- // in which case the signal exports as its own root span instead.
414
- for (const col of ["trace_id TEXT", "span_id TEXT"]) {
415
- try {
416
- db.exec(`ALTER TABLE workflow_runs ADD COLUMN ${col}`);
417
- }
418
- catch {
419
- // Column already exists — ignore
420
- }
421
- }
422
- // Gate flavor: 'approve' (explicit approve/reject) vs 'reply' (resolves
423
- // on any free-form reply in the same thread — used by the socratic
424
- // explore loop).
425
- try {
426
- db.exec(`ALTER TABLE workflow_approvals ADD COLUMN kind TEXT NOT NULL DEFAULT 'approve'`);
427
- }
428
- catch {
429
- // Column already exists — ignore
430
- }
431
- // Artifact (handoff doc) filename a gate is asking the reviewer to approve,
432
- // e.g. 'architect-plan.md'. Lets the focused approval view open the right
433
- // doc. Nullable — most gates carry no artifact. Additive, safe on existing DBs.
434
- try {
435
- db.exec(`ALTER TABLE workflow_approvals ADD COLUMN artifact TEXT`);
436
- }
437
- catch {
438
- // Column already exists — ignore
439
- }
440
- // Add session_id column to executions so the dashboard can resolve a
441
- // phase click to its agent session log. Additive — safe on existing DBs.
442
- try {
443
- db.exec(`ALTER TABLE executions ADD COLUMN session_id TEXT`);
444
- }
445
- catch {
446
- // Column already exists — ignore
447
- }
448
- // Per-execution runtime usage metrics, captured from the OpenCode
449
- // step_finish events. Lets the dashboard show cost / tokens per phase
450
- // and lets us aggregate spend later. All additive, safe on existing DBs.
451
- for (const col of [
452
- "cost_usd REAL",
453
- "input_tokens INTEGER",
454
- "cache_creation_input_tokens INTEGER",
455
- "cache_read_input_tokens INTEGER",
456
- "output_tokens INTEGER",
457
- "api_duration_ms INTEGER",
458
- "stop_reason TEXT",
459
- // Links a phase execution to its owning workflow_run. Dedup and
460
- // "already running / done" checks scope to this column so a fresh
461
- // re-trigger of the same workflow on the same issue creates new
462
- // executions instead of reusing the old run's rows.
463
- "workflow_run_id TEXT",
464
- // Final assistant text for a phase execution. Populated only for
465
- // loop iterations whose output is referenced by `scratch.<key>
466
- // .lastOutputExecutionId` — keeps the inlined LLM output out of
467
- // `workflow_runs.scratch` (which is read on every list query)
468
- // while still being available to the runner's resume path.
469
- "output_text TEXT",
470
- // JSON map of agentic-pi extensions active for this execution
471
- // (file-search / github / web-search → {status, mode?, provider?,
472
- // toolCount?, reason?}). Surfaced in the dashboard phase-detail panel.
473
- "extension_status TEXT",
474
- // JSON object of agentic-pi's skill-loading status for this execution
475
- // ({status, discovered, skills[], mappedPaths, noSkills}). The skill-
476
- // loading counterpart to extension_status; surfaced in the same panel.
477
- "skills_status TEXT",
478
- ]) {
479
- try {
480
- db.exec(`ALTER TABLE executions ADD COLUMN ${col}`);
481
- }
482
- catch {
483
- // Column already exists — ignore
484
- }
485
- }
486
- try {
487
- db.exec(`CREATE INDEX IF NOT EXISTS idx_executions_workflow_run ON executions(workflow_run_id, skill)`);
488
- }
489
- catch {
490
- // Index already exists — ignore
491
- }
492
- }
493
- //# sourceMappingURL=migrate.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"migrate.js","sourceRoot":"","sources":["../../src/state/migrate.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;GAYG;AACH,MAAM,UAAU,OAAO,CAAC,EAAqB;IAC3C,EAAE,CAAC,IAAI,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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