@hearsay-tools/squawk 0.18.0-dev.6593 → 0.18.0-dev.6602

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.
@@ -1,4 +1,5 @@
1
1
  import { RUN_DATABASE_READABLE_FROM, RUN_DATABASE_SCHEMA_VERSION } from './run-database-version.js';
2
+ import { conversationMembersSelect } from './conversation-members.js';
2
3
  import { claimOwnerLive } from './run-claims.js';
3
4
  import { warnFallbackRunSource } from './project-run-sources.js';
4
5
  import { cpSync, lstatSync, mkdirSync, readFileSync, readdirSync, rmSync } from 'node:fs';
@@ -152,6 +153,9 @@ export class ProjectRunConnection {
152
153
  sourceNames.has(name) ? String(name) : `${dflt_value ?? 'NULL'} AS ${name}`).join(', ');
153
154
  db.exec(`CREATE TEMP VIEW project_runs AS SELECT * FROM main.runs UNION ALL
154
155
  SELECT ${sourceColumns} FROM ${table} source WHERE NOT EXISTS (SELECT 1 FROM main.runs legacy WHERE legacy.id = source.id)`);
156
+ // A fallback row's members come from its record: an older fallback has no conversation_members.
157
+ db.exec(`CREATE TEMP VIEW project_conversation_members AS SELECT root_id, member_id FROM main.conversation_members UNION ALL
158
+ SELECT root_id, member_id FROM (${conversationMembersSelect(table)}) source WHERE NOT EXISTS (SELECT 1 FROM main.runs legacy WHERE legacy.id = source.root_id)`);
155
159
  this.attached = attached;
156
160
  this.sourceTable = table;
157
161
  const claims = attached ? 'SELECT * FROM project_fallback.run_claims' : 'SELECT * FROM main.run_claims WHERE 0';
@@ -222,6 +226,7 @@ export class ProjectRunConnection {
222
226
  const columns = Object.keys(row).filter(key => key !== 'seq');
223
227
  this.current.prepare(`INSERT INTO main.runs (${columns.join(', ')}) VALUES (${columns.map(() => '?').join(', ')})`)
224
228
  .run(...columns.map(key => row[key]));
229
+ this.current.prepare(`INSERT OR IGNORE INTO main.conversation_members (root_id, member_id) ${conversationMembersSelect('main.runs', 's.id = :id')}`).run({ id });
225
230
  }
226
231
  }
227
232
  // Inside the transaction, after the fence: another process may have added a fallback copy since the
@@ -264,14 +269,15 @@ export class ProjectRunConnection {
264
269
  }
265
270
  }
266
271
  /** Match only table references. Quoted text and comments are opaque to the projection. */
272
+ const PROJECT_VIEWS = { runs: 'project_runs', run_claims: 'project_claims', conversation_members: 'project_conversation_members' };
267
273
  function projectReadTables(sql) {
268
- return sql.replace(/('(?:''|[^'])*'|"(?:""|[^"])*"|`[^`]*`|\[[^\]]*\]|--[^\n]*|\/\*[\s\S]*?\*\/)|\b(FROM|JOIN)(\s+)(runs|run_claims)\b/gi, (match, quoted, keyword, space, table, offset) => {
274
+ return sql.replace(/('(?:''|[^'])*'|"(?:""|[^"])*"|`[^`]*`|\[[^\]]*\]|--[^\n]*|\/\*[\s\S]*?\*\/)|\b(FROM|JOIN)(\s+)(runs|run_claims|conversation_members)\b/gi, (match, quoted, keyword, space, table, offset) => {
269
275
  // A DELETE target stays the primary table; every other reference, nested reads in writes included, is a read.
270
276
  if (quoted || /\bDELETE\s*$/i.test(sql.slice(0, offset)))
271
277
  return match;
272
278
  const next = /^\s+(?:AS\s+)?([a-z_]\w*|"|`|\[)/i.exec(sql.slice(offset + match.length))?.[1];
273
279
  const aliased = next && !/^(WHERE|JOIN|LEFT|RIGHT|INNER|OUTER|CROSS|GROUP|ORDER|LIMIT|UNION|INTERSECT|EXCEPT|ON|USING|NOT|INDEXED)$/i.test(next);
274
- return `${keyword}${space}${table.toLowerCase() === 'runs' ? 'project_runs' : 'project_claims'}${aliased ? '' : ` AS ${table}`}`;
280
+ return `${keyword}${space}${PROJECT_VIEWS[table.toLowerCase()]}${aliased ? '' : ` AS ${table}`}`;
275
281
  });
276
282
  }
277
283
  /** A previous process may have copied a sidecar before its SQLite transaction committed. */
@@ -1 +1 @@
1
- {"version":3,"file":"project-run-connection.js","sourceRoot":"","sources":["../../src/runs/project-run-connection.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,0BAA0B,EAAE,2BAA2B,EAAE,MAAM,2BAA2B,CAA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AAC,CAAC,CAAC,OAAO,KAAK,EAAE,EAAE,CAAC;IACnG,CAAC,CAAC,CAAC;AACP,CAAC;AAED,4FAA4F;AAC5F,SAAS,YAAY,CAAC,MAAc,EAAE,MAAc;IAClD,MAAM,IAAI,GAAG,SAAS,CAAC,MAAM,CAAC,EAAE,EAAE,GAAG,SAAS,CAAC,MAAM,CAAC,CAAC;IACvD,IAAI,IAAI,CAAC,MAAM,EAAE,IAAI,EAAE,CAAC,MAAM,EAAE;QAAE,OAAO,YAAY,CAAC,MAAM,CAAC,CAAC,MAAM,CAAC,YAAY,CAAC,MAAM,CAAC,CAAC,CAAC;IAC3F,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE,IAAI,CAAC,EAAE,CAAC,WAAW,EAAE;QAAE,OAAO,KAAK,CAAC;IAC3D,MAAM,KAAK,GAAG,WAAW,CAAC,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE,QAAQ,GAAG,WAAW,CAAC,MAAM,CAAC,CAAC,IAAI,EAAE,CAAC;IAChF,OAAO,KAAK,CAAC,MAAM,KAAK,QAAQ,CAAC,MAAM,IAAI,KAAK,CAAC,KAAK,CAAC,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE,CACrE,IAAI,KAAK,QAAQ,CAAC,KAAK,CAAC,IAAI,YAAY,CAAC,IAAI,CAAC,MAAM,EAAE,IAAI,CAAC,EAAE,IAAI,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC;AACtF,CAAC"}
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Forward-only migrations: entry `i` takes a database from `user_version` i to i + 1. Never edit
3
+ * a shipped entry; append a new one and raise `RUN_DATABASE_SCHEMA_VERSION`.
4
+ *
5
+ * Changing `isLiveRecord` (run-row.ts) needs an entry that recomputes the `live` column for every
6
+ * row. That predicate is TypeScript over the decoded record, so such an entry cannot be SQL alone.
7
+ */
8
+ export declare const MIGRATIONS: readonly string[];
@@ -0,0 +1,192 @@
1
+ import { CONVERSATION_MEMBERS_MIGRATION } from './conversation-members.js';
2
+ import { REPORTS_MIGRATION } from './report-rows.js';
3
+ import { DESTROYED_WORKTREE_MIGRATION, MERGE_WAIT_MIGRATION } from './run-database-version.js';
4
+ /**
5
+ * Forward-only migrations: entry `i` takes a database from `user_version` i to i + 1. Never edit
6
+ * a shipped entry; append a new one and raise `RUN_DATABASE_SCHEMA_VERSION`.
7
+ *
8
+ * Changing `isLiveRecord` (run-row.ts) needs an entry that recomputes the `live` column for every
9
+ * row. That predicate is TypeScript over the decoded record, so such an entry cannot be SQL alone.
10
+ */
11
+ export const MIGRATIONS = [
12
+ `
13
+ -- Every column beyond id/data/summary/revision exists for a query the spec names. They are
14
+ -- copies of record fields (or of one predicate over the record), computed by the caller in the
15
+ -- same upsert as data and summary, so a row can never disagree with its own columns.
16
+ CREATE TABLE runs (
17
+ -- Insertion order, the rowid itself: given by a row's first insert (runs.json order on import,
18
+ -- then the order runs are first written) and kept by every upsert. Runs created in the same
19
+ -- millisecond list in this order, as they did when every list was a stable sort of the
20
+ -- in-memory map: recovery and the queue start tied runs in it.
21
+ seq INTEGER PRIMARY KEY,
22
+ id TEXT NOT NULL UNIQUE,
23
+ -- Newest-first order: GET /run-summaries, /workspace/runs-index, the cold newest-200 read,
24
+ -- and count-based history retention (the runs past the newest N).
25
+ created_at TEXT NOT NULL,
26
+ -- Worktree retention: most recently finished first (falls back to created_at).
27
+ finished_at TEXT,
28
+ -- The mark-all-read and archive-finished sweeps select finished statuses.
29
+ status TEXT NOT NULL,
30
+ -- History retention, mark-all-read and archive-finished skip or select archived runs (0/1).
31
+ archived INTEGER NOT NULL,
32
+ -- isLiveRecord() (run-row.ts): the rows RunStore.open loads into memory and recovers. Every
33
+ -- other row stays here until something reads it. Written with the row, never recomputed
34
+ -- (see the note above MIGRATIONS).
35
+ live INTEGER NOT NULL,
36
+ -- The workers of a parent (delegation.parentRunId): delegation families, archive cascades and
37
+ -- the "every worker" recovery passes, replacing whole-map scans.
38
+ parent_run_id TEXT,
39
+ -- The run an idempotent start already created (#504).
40
+ client_request_id TEXT,
41
+ -- The members of a parallel-variant group (spec 010).
42
+ group_id TEXT,
43
+ -- A materialized worktree directory (the path, unless retention reclaimed it): worktree
44
+ -- retention, the worktrees panel and the owned-worker resource collision check.
45
+ worktree_path TEXT,
46
+ -- The branch the run owns: branch cleanup, git-log attribution and the collision check.
47
+ branch TEXT,
48
+ -- Where that branch forked, which branch cleanup reads with it.
49
+ base_branch TEXT,
50
+ -- The commit that last wrote the row: one database-wide sequence (meta 'commit-seq'), so a
51
+ -- revision is never reused, not even by a row deleted and created again under the same id.
52
+ -- A writer compares it with the revision it last read to tell whether the row changed under it.
53
+ revision INTEGER NOT NULL,
54
+ -- The complete record JSON, opaque here.
55
+ data TEXT NOT NULL,
56
+ -- The record's toRunSummary() JSON, so list routes never decode data.
57
+ summary TEXT NOT NULL
58
+ ) STRICT;
59
+ -- Newest first, ties in insertion order: the order every newest-first read asks for, so SQLite
60
+ -- walks the index instead of sorting the tie groups.
61
+ CREATE INDEX runs_created_at ON runs (created_at DESC, seq);
62
+ CREATE INDEX runs_status ON runs (status);
63
+ -- Partial indexes: each query asks for the rows that HAVE the value, and most rows do not.
64
+ CREATE INDEX runs_live ON runs (live) WHERE live = 1;
65
+ CREATE INDEX runs_parent_run_id ON runs (parent_run_id) WHERE parent_run_id IS NOT NULL;
66
+ CREATE INDEX runs_client_request_id ON runs (client_request_id) WHERE client_request_id IS NOT NULL;
67
+ CREATE INDEX runs_group_id ON runs (group_id) WHERE group_id IS NOT NULL;
68
+ CREATE INDEX runs_worktree_path ON runs (worktree_path) WHERE worktree_path IS NOT NULL;
69
+ CREATE INDEX runs_branch ON runs (branch) WHERE branch IS NOT NULL;
70
+ -- Private key/value metadata: import completion and the two sequences below.
71
+ CREATE TABLE meta (
72
+ key TEXT PRIMARY KEY,
73
+ value TEXT NOT NULL
74
+ ) STRICT;
75
+ -- Cross-process ownership (#779, plan step 3): which RunStore may write a delegation family —
76
+ -- a root and its direct workers, or an ordinary run on its own. Only the holder writes the
77
+ -- family's rows, its NDJSON and its cleanup; everyone else reads them.
78
+ CREATE TABLE run_claims (
79
+ -- The family's root id: parent_run_id for a worker, the run's own id otherwise.
80
+ family TEXT PRIMARY KEY,
81
+ -- The RunStore holding it: a random id per open, so two stores in one process differ.
82
+ session TEXT NOT NULL,
83
+ -- That store's process and the process's start identity, so a reused pid is never taken for
84
+ -- the owner. start_token is NULL only where the platform cannot read one.
85
+ pid INTEGER NOT NULL,
86
+ start_token TEXT,
87
+ -- From meta 'claim-generation', bumped by every acquisition. Every write checks that its
88
+ -- family still carries this store's session and generation.
89
+ generation INTEGER NOT NULL
90
+ ) STRICT;
91
+ CREATE INDEX run_claims_session ON run_claims (session);
92
+ -- Private recovery evidence: a write that found its row changed, created or deleted under it,
93
+ -- or its family's claim gone. Never served; kept for a person to inspect.
94
+ CREATE TABLE run_conflicts (
95
+ seq INTEGER PRIMARY KEY,
96
+ run_id TEXT NOT NULL,
97
+ detected_at TEXT NOT NULL,
98
+ session TEXT NOT NULL,
99
+ -- changed | created | deleted | claim-lost
100
+ reason TEXT NOT NULL,
101
+ -- The row as the writer last read or wrote it (the original); NULL for a row it created.
102
+ base_revision INTEGER,
103
+ base_data TEXT,
104
+ -- What the writer meant to store; NULL with local_deleted = 1 when it meant to delete it.
105
+ local_data TEXT,
106
+ local_deleted INTEGER NOT NULL,
107
+ -- The row as it stands; NULL when another writer deleted it.
108
+ current_revision INTEGER,
109
+ current_data TEXT
110
+ ) STRICT;
111
+ `,
112
+ `
113
+ -- The run lists' window (#864): every unarchived run, plus the newest archived roots. Without
114
+ -- these, each half scans the whole table — about 30 ms at 20,000 runs, on every list read.
115
+ -- Indexes only: nothing a v1 reader reads changes, which is why RUN_DATABASE_READABLE_FROM stays 1.
116
+ CREATE INDEX runs_unarchived ON runs (created_at DESC, seq) WHERE archived = 0;
117
+ CREATE INDEX runs_archived_roots ON runs (archived, created_at DESC, seq) WHERE parent_run_id IS NULL;
118
+ `,
119
+ `
120
+ CREATE INDEX runs_archive_on_merge ON runs (seq)
121
+ WHERE archived = 0 AND live = 0 AND parent_run_id IS NULL
122
+ AND status IN ('review', 'done', 'failed', 'cancelled');
123
+ `,
124
+ `
125
+ -- Schema 4 changes no table: it changes the record JSON in data (spec 2026-10-17-unified-waits,
126
+ -- hearsay-tools/cezarion#1233). Records carry a wait list (waits, lastWaits) and are no longer
127
+ -- written with ciWait, lastCiWait, lastCiWaitError, monitoringWakeAt, monitoringWakeCapReached
128
+ -- or activity 'monitoring'; this build reads those into the list (upgradeLegacyWaits, legacy-waits.ts).
129
+ -- An older cezar reading a row without ciWait would recover a parked run as a plain waiting
130
+ -- one, and settle an owned worker as successful. The version bump makes it refuse the store as
131
+ -- unsupported-schema instead; the recovery is to run this version again.
132
+ --
133
+ -- No live recompute: every row the new isLiveRecord (run-row.ts) calls live was live under the
134
+ -- old predicate too. An open or resolved wait comes from a ciWait or from activity 'monitoring'
135
+ -- with monitoringWakeAt, and the old predicate called each of those live. Rows it called live
136
+ -- that the new one does not (a settled ciWait, stale monitoring on a finished run) are loaded
137
+ -- once more, and open rewrites them, with their live column, as it upgrades them.
138
+ `,
139
+ `
140
+ -- Schema 5 changes no table either: records may carry a human wait (kind 'human', no deadline)
141
+ -- in waits and lastWaits, and the automaticWakes and waitDeliveryFailures counters
142
+ -- (hearsay-tools/cezarion#1234). A schema-4 build would drop each human wait as unreadable and
143
+ -- recover the run without the question it parked on, so the bump makes it refuse the store as
144
+ -- unsupported-schema instead; the recovery is to run this version again.
145
+ --
146
+ -- No live recompute: isLiveRecord already calls a row with an open wait live, of any kind.
147
+ `,
148
+ `
149
+ -- Schema 6 changes no table either: records may carry worker waits (kind 'worker') in waits and
150
+ -- lastWaits, and a record is no longer written with an agent-registered delegation.wait or
151
+ -- delegation.lastWait (hearsay-tools/cezarion#1235, phase 3a); this build reads those into the
152
+ -- list (upgradeLegacyWaits, legacy-waits.ts). Only the completion gate's wait, the one
153
+ -- delegation.completion.waitId names, stays in delegation.wait until phase 3b. A schema-5 build
154
+ -- would drop each worker entry as unreadable and recover the run without the wait it parked on,
155
+ -- so the bump makes it refuse the store as unsupported-schema instead; the recovery is to run
156
+ -- this version again.
157
+ --
158
+ -- No live recompute: isLiveRecord already calls a row with an open wait live, of any kind, and
159
+ -- every row the old predicate called live through delegation.wait is read up and rewritten by open.
160
+ `,
161
+ `
162
+ -- Schema 7 changes no table: a record no longer carries delegation.wait, delegation.lastWait or
163
+ -- delegation.completion (hearsay-tools/cezarion#1301, phase 3b). Cezar's completion gate wait is a
164
+ -- worker entry in waits (source 'cezar', via 'completion'), and this build reads a stored one up
165
+ -- (upgradeLegacyWaits, legacy-waits.ts). A schema-6 build would read an upgraded completion entry without
166
+ -- its deadline as unreadable and recover the run without the wait it parked on, so the bump makes
167
+ -- it refuse the store as unsupported-schema instead; the recovery is to run this version again.
168
+ --
169
+ -- No live recompute: isLiveRecord already calls a row with an open wait live, of any kind.
170
+ `,
171
+ `
172
+ -- Schema 8 changes no table: a usage-limited run is written waiting with autoResumeAt, no longer
173
+ -- failed with it (hearsay-tools/cezarion#1236, phase 4a), and this build reads an old failed row
174
+ -- with autoResumeAt as waiting (reconcileLoadedRun, store.ts). A schema-7 build would clear the
175
+ -- appointment from a waiting row and show the run as Needs you, so the bump makes it refuse the
176
+ -- store as unsupported-schema instead; the recovery is to run this version again.
177
+ --
178
+ -- No live recompute: isLiveRecord already calls a row with autoResumeAt live, at any status.
179
+ `,
180
+ `
181
+ -- Schema 9 changes no table: records may carry process waits (kind 'process') in waits and
182
+ -- lastWaits (hearsay-tools/cezarion#1446). A schema-8 build has no path that skips an unknown
183
+ -- wait kind, so it would drop the row's wait list and recover the run without the wait it parked
184
+ -- on; the bump makes it refuse the store as unsupported-schema instead; the recovery is to run
185
+ -- this version again.
186
+ --
187
+ -- No live recompute: isLiveRecord already calls a row with an open wait live, of any kind.
188
+ `,
189
+ REPORTS_MIGRATION,
190
+ MERGE_WAIT_MIGRATION, DESTROYED_WORKTREE_MIGRATION, CONVERSATION_MEMBERS_MIGRATION,
191
+ ];
192
+ //# sourceMappingURL=run-database-migrations.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"run-database-migrations.js","sourceRoot":"","sources":["../../src/runs/run-database-migrations.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,8BAA8B,EAAE,MAAM,2BAA2B,CAAC;AAC3E,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AACrD,OAAO,EAAE,4BAA4B,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AAE/F;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,UAAU,GAAsB;IAC3C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmGC;IACD;;;;;;GAMC;IACD;;;;GAIC;IACD;;;;;;;;;;;;;;GAcC;IACD;;;;;;;;GAQC;IACD;;;;;;;;;;;;GAYC;IACD;;;;;;;;;GASC;IACD;;;;;;;;GAQC;IACD;;;;;;;;GAQC;IACD,iBAAiB;IACjB,oBAAoB,EAAE,4BAA4B,EAAE,8BAA8B;CACnF,CAAC"}
@@ -1,7 +1,7 @@
1
1
  /** `PRAGMA user_version` of a database this build created. A higher number means a newer Squawk
2
2
  * wrote it; that is refused rather than read, because a newer schema may store what this one
3
3
  * would silently drop on its next write. */
4
- export declare const RUN_DATABASE_SCHEMA_VERSION = 12;
4
+ export declare const RUN_DATABASE_SCHEMA_VERSION = 13;
5
5
  /**
6
6
  * The oldest `user_version` the READ-ONLY reader can read as it stands (`openReadOnly`). It never
7
7
  * migrates, so a project this build has not opened yet is still at the version an earlier build
@@ -1,7 +1,7 @@
1
1
  /** `PRAGMA user_version` of a database this build created. A higher number means a newer Squawk
2
2
  * wrote it; that is refused rather than read, because a newer schema may store what this one
3
3
  * would silently drop on its next write. */
4
- export const RUN_DATABASE_SCHEMA_VERSION = 12;
4
+ export const RUN_DATABASE_SCHEMA_VERSION = 13;
5
5
  /**
6
6
  * The oldest `user_version` the READ-ONLY reader can read as it stands (`openReadOnly`). It never
7
7
  * migrates, so a project this build has not opened yet is still at the version an earlier build
@@ -30,6 +30,8 @@ export interface RunRowInput {
30
30
  data: string;
31
31
  /** The record's summary projection, serialized. */
32
32
  summary: string;
33
+ /** Its `conversation_members` rows (`conversationMembersOf`, run-row.ts): null for none. */
34
+ conversationMembers: readonly string[] | null;
33
35
  }
34
36
  export interface RunRow {
35
37
  /** Insertion order: assigned by the row's first insert, never changed (see the schema). */
@@ -271,6 +273,11 @@ export declare class RunDatabase {
271
273
  listByParent(parentId: string): RunRow[];
272
274
  /** The ids of one parent's workers, in no particular order, without reading their records. */
273
275
  listIdsByParent(parentId: string): string[];
276
+ /** The roots whose conversation names `memberId` as a sender or recipient, newest first; with no
277
+ * id, every root that has one. An index read (`conversation_members`, schema 13). */
278
+ listConversationRoots(memberId?: string): string[];
279
+ /** A row's stored `conversation_members`, for a write that keeps them: null for none. */
280
+ conversationMembers(rootId: string): string[] | null;
274
281
  /** The id of every worker row, in no particular order. */
275
282
  listWorkerIds(): string[];
276
283
  findByClientRequestId(clientRequestId: string): RunRow | undefined;
@@ -320,6 +327,7 @@ export declare class RunDatabase {
320
327
  /** Every id with its revision, ordered by id. */
321
328
  listRevisions(): RunRevision[];
322
329
  get reports(): import("./report-rows.ts").ReportRows;
330
+ private get conversations();
323
331
  replaceArtifacts(id: string, artifacts: readonly IndexedArtifact[], revision?: number): void;
324
332
  listArtifacts(): IndexedArtifact[];
325
333
  getMeta(key: string): string | undefined;
@@ -1,8 +1,10 @@
1
1
  import { ProjectRunConnection } from './project-run-connection.js';
2
- import { DESTROYED_WORKTREE_MIGRATION, MERGE_WAIT_MIGRATION, RUN_DATABASE_READABLE_FROM, RUN_DATABASE_SCHEMA_VERSION } from './run-database-version.js';
2
+ import { RUN_DATABASE_READABLE_FROM, RUN_DATABASE_SCHEMA_VERSION } from './run-database-version.js';
3
+ import { MIGRATIONS } from './run-database-migrations.js';
3
4
  export { RUN_DATABASE_READABLE_FROM, RUN_DATABASE_SCHEMA_VERSION } from './run-database-version.js';
4
5
  import { validateChanges, toRunClaim, toRunRow, toRunBindings, writeMetadata, readOnlyTarget } from './run-database-row.js';
5
- import { reportRows, REPORTS_MIGRATION } from './report-rows.js';
6
+ import { reportRows } from './report-rows.js';
7
+ import { conversationMembers } from './conversation-members.js';
6
8
  import { readPeerSummaryPage, toSummaryRow } from './run-database-peer-page.js';
7
9
  import { accessSync, closeSync, constants, existsSync, openSync, readSync, statSync } from 'node:fs';
8
10
  import { dirname } from 'node:path';
@@ -19,194 +21,6 @@ export const RUNS_IMPORT_COMPLETE_KEY = 'import-complete';
19
21
  /** How long a statement waits on another connection's lock before failing as busy. Short on
20
22
  * purpose: the store runs on the event loop, and a blocked write is a blocked cockpit. */
21
23
  const BUSY_TIMEOUT_MS = 50;
22
- /**
23
- * Forward-only migrations: entry `i` takes a database from `user_version` i to i + 1. Never edit
24
- * a shipped entry; append a new one and raise `RUN_DATABASE_SCHEMA_VERSION`.
25
- *
26
- * Changing `isLiveRecord` (run-row.ts) needs an entry that recomputes the `live` column for every
27
- * row. That predicate is TypeScript over the decoded record, so such an entry cannot be SQL alone.
28
- */
29
- const MIGRATIONS = [
30
- `
31
- -- Every column beyond id/data/summary/revision exists for a query the spec names. They are
32
- -- copies of record fields (or of one predicate over the record), computed by the caller in the
33
- -- same upsert as data and summary, so a row can never disagree with its own columns.
34
- CREATE TABLE runs (
35
- -- Insertion order, the rowid itself: given by a row's first insert (runs.json order on import,
36
- -- then the order runs are first written) and kept by every upsert. Runs created in the same
37
- -- millisecond list in this order, as they did when every list was a stable sort of the
38
- -- in-memory map: recovery and the queue start tied runs in it.
39
- seq INTEGER PRIMARY KEY,
40
- id TEXT NOT NULL UNIQUE,
41
- -- Newest-first order: GET /run-summaries, /workspace/runs-index, the cold newest-200 read,
42
- -- and count-based history retention (the runs past the newest N).
43
- created_at TEXT NOT NULL,
44
- -- Worktree retention: most recently finished first (falls back to created_at).
45
- finished_at TEXT,
46
- -- The mark-all-read and archive-finished sweeps select finished statuses.
47
- status TEXT NOT NULL,
48
- -- History retention, mark-all-read and archive-finished skip or select archived runs (0/1).
49
- archived INTEGER NOT NULL,
50
- -- isLiveRecord() (run-row.ts): the rows RunStore.open loads into memory and recovers. Every
51
- -- other row stays here until something reads it. Written with the row, never recomputed
52
- -- (see the note above MIGRATIONS).
53
- live INTEGER NOT NULL,
54
- -- The workers of a parent (delegation.parentRunId): delegation families, archive cascades and
55
- -- the "every worker" recovery passes, replacing whole-map scans.
56
- parent_run_id TEXT,
57
- -- The run an idempotent start already created (#504).
58
- client_request_id TEXT,
59
- -- The members of a parallel-variant group (spec 010).
60
- group_id TEXT,
61
- -- A materialized worktree directory (the path, unless retention reclaimed it): worktree
62
- -- retention, the worktrees panel and the owned-worker resource collision check.
63
- worktree_path TEXT,
64
- -- The branch the run owns: branch cleanup, git-log attribution and the collision check.
65
- branch TEXT,
66
- -- Where that branch forked, which branch cleanup reads with it.
67
- base_branch TEXT,
68
- -- The commit that last wrote the row: one database-wide sequence (meta 'commit-seq'), so a
69
- -- revision is never reused, not even by a row deleted and created again under the same id.
70
- -- A writer compares it with the revision it last read to tell whether the row changed under it.
71
- revision INTEGER NOT NULL,
72
- -- The complete record JSON, opaque here.
73
- data TEXT NOT NULL,
74
- -- The record's toRunSummary() JSON, so list routes never decode data.
75
- summary TEXT NOT NULL
76
- ) STRICT;
77
- -- Newest first, ties in insertion order: the order every newest-first read asks for, so SQLite
78
- -- walks the index instead of sorting the tie groups.
79
- CREATE INDEX runs_created_at ON runs (created_at DESC, seq);
80
- CREATE INDEX runs_status ON runs (status);
81
- -- Partial indexes: each query asks for the rows that HAVE the value, and most rows do not.
82
- CREATE INDEX runs_live ON runs (live) WHERE live = 1;
83
- CREATE INDEX runs_parent_run_id ON runs (parent_run_id) WHERE parent_run_id IS NOT NULL;
84
- CREATE INDEX runs_client_request_id ON runs (client_request_id) WHERE client_request_id IS NOT NULL;
85
- CREATE INDEX runs_group_id ON runs (group_id) WHERE group_id IS NOT NULL;
86
- CREATE INDEX runs_worktree_path ON runs (worktree_path) WHERE worktree_path IS NOT NULL;
87
- CREATE INDEX runs_branch ON runs (branch) WHERE branch IS NOT NULL;
88
- -- Private key/value metadata: import completion and the two sequences below.
89
- CREATE TABLE meta (
90
- key TEXT PRIMARY KEY,
91
- value TEXT NOT NULL
92
- ) STRICT;
93
- -- Cross-process ownership (#779, plan step 3): which RunStore may write a delegation family —
94
- -- a root and its direct workers, or an ordinary run on its own. Only the holder writes the
95
- -- family's rows, its NDJSON and its cleanup; everyone else reads them.
96
- CREATE TABLE run_claims (
97
- -- The family's root id: parent_run_id for a worker, the run's own id otherwise.
98
- family TEXT PRIMARY KEY,
99
- -- The RunStore holding it: a random id per open, so two stores in one process differ.
100
- session TEXT NOT NULL,
101
- -- That store's process and the process's start identity, so a reused pid is never taken for
102
- -- the owner. start_token is NULL only where the platform cannot read one.
103
- pid INTEGER NOT NULL,
104
- start_token TEXT,
105
- -- From meta 'claim-generation', bumped by every acquisition. Every write checks that its
106
- -- family still carries this store's session and generation.
107
- generation INTEGER NOT NULL
108
- ) STRICT;
109
- CREATE INDEX run_claims_session ON run_claims (session);
110
- -- Private recovery evidence: a write that found its row changed, created or deleted under it,
111
- -- or its family's claim gone. Never served; kept for a person to inspect.
112
- CREATE TABLE run_conflicts (
113
- seq INTEGER PRIMARY KEY,
114
- run_id TEXT NOT NULL,
115
- detected_at TEXT NOT NULL,
116
- session TEXT NOT NULL,
117
- -- changed | created | deleted | claim-lost
118
- reason TEXT NOT NULL,
119
- -- The row as the writer last read or wrote it (the original); NULL for a row it created.
120
- base_revision INTEGER,
121
- base_data TEXT,
122
- -- What the writer meant to store; NULL with local_deleted = 1 when it meant to delete it.
123
- local_data TEXT,
124
- local_deleted INTEGER NOT NULL,
125
- -- The row as it stands; NULL when another writer deleted it.
126
- current_revision INTEGER,
127
- current_data TEXT
128
- ) STRICT;
129
- `,
130
- `
131
- -- The run lists' window (#864): every unarchived run, plus the newest archived roots. Without
132
- -- these, each half scans the whole table — about 30 ms at 20,000 runs, on every list read.
133
- -- Indexes only: nothing a v1 reader reads changes, which is why RUN_DATABASE_READABLE_FROM stays 1.
134
- CREATE INDEX runs_unarchived ON runs (created_at DESC, seq) WHERE archived = 0;
135
- CREATE INDEX runs_archived_roots ON runs (archived, created_at DESC, seq) WHERE parent_run_id IS NULL;
136
- `,
137
- `
138
- CREATE INDEX runs_archive_on_merge ON runs (seq)
139
- WHERE archived = 0 AND live = 0 AND parent_run_id IS NULL
140
- AND status IN ('review', 'done', 'failed', 'cancelled');
141
- `,
142
- `
143
- -- Schema 4 changes no table: it changes the record JSON in data (spec 2026-10-17-unified-waits,
144
- -- hearsay-tools/cezarion#1233). Records carry a wait list (waits, lastWaits) and are no longer
145
- -- written with ciWait, lastCiWait, lastCiWaitError, monitoringWakeAt, monitoringWakeCapReached
146
- -- or activity 'monitoring'; this build reads those into the list (upgradeLegacyWaits, legacy-waits.ts).
147
- -- An older cezar reading a row without ciWait would recover a parked run as a plain waiting
148
- -- one, and settle an owned worker as successful. The version bump makes it refuse the store as
149
- -- unsupported-schema instead; the recovery is to run this version again.
150
- --
151
- -- No live recompute: every row the new isLiveRecord (run-row.ts) calls live was live under the
152
- -- old predicate too. An open or resolved wait comes from a ciWait or from activity 'monitoring'
153
- -- with monitoringWakeAt, and the old predicate called each of those live. Rows it called live
154
- -- that the new one does not (a settled ciWait, stale monitoring on a finished run) are loaded
155
- -- once more, and open rewrites them, with their live column, as it upgrades them.
156
- `,
157
- `
158
- -- Schema 5 changes no table either: records may carry a human wait (kind 'human', no deadline)
159
- -- in waits and lastWaits, and the automaticWakes and waitDeliveryFailures counters
160
- -- (hearsay-tools/cezarion#1234). A schema-4 build would drop each human wait as unreadable and
161
- -- recover the run without the question it parked on, so the bump makes it refuse the store as
162
- -- unsupported-schema instead; the recovery is to run this version again.
163
- --
164
- -- No live recompute: isLiveRecord already calls a row with an open wait live, of any kind.
165
- `,
166
- `
167
- -- Schema 6 changes no table either: records may carry worker waits (kind 'worker') in waits and
168
- -- lastWaits, and a record is no longer written with an agent-registered delegation.wait or
169
- -- delegation.lastWait (hearsay-tools/cezarion#1235, phase 3a); this build reads those into the
170
- -- list (upgradeLegacyWaits, legacy-waits.ts). Only the completion gate's wait, the one
171
- -- delegation.completion.waitId names, stays in delegation.wait until phase 3b. A schema-5 build
172
- -- would drop each worker entry as unreadable and recover the run without the wait it parked on,
173
- -- so the bump makes it refuse the store as unsupported-schema instead; the recovery is to run
174
- -- this version again.
175
- --
176
- -- No live recompute: isLiveRecord already calls a row with an open wait live, of any kind, and
177
- -- every row the old predicate called live through delegation.wait is read up and rewritten by open.
178
- `,
179
- `
180
- -- Schema 7 changes no table: a record no longer carries delegation.wait, delegation.lastWait or
181
- -- delegation.completion (hearsay-tools/cezarion#1301, phase 3b). Cezar's completion gate wait is a
182
- -- worker entry in waits (source 'cezar', via 'completion'), and this build reads a stored one up
183
- -- (upgradeLegacyWaits, legacy-waits.ts). A schema-6 build would read an upgraded completion entry without
184
- -- its deadline as unreadable and recover the run without the wait it parked on, so the bump makes
185
- -- it refuse the store as unsupported-schema instead; the recovery is to run this version again.
186
- --
187
- -- No live recompute: isLiveRecord already calls a row with an open wait live, of any kind.
188
- `,
189
- `
190
- -- Schema 8 changes no table: a usage-limited run is written waiting with autoResumeAt, no longer
191
- -- failed with it (hearsay-tools/cezarion#1236, phase 4a), and this build reads an old failed row
192
- -- with autoResumeAt as waiting (reconcileLoadedRun, store.ts). A schema-7 build would clear the
193
- -- appointment from a waiting row and show the run as Needs you, so the bump makes it refuse the
194
- -- store as unsupported-schema instead; the recovery is to run this version again.
195
- --
196
- -- No live recompute: isLiveRecord already calls a row with autoResumeAt live, at any status.
197
- `,
198
- `
199
- -- Schema 9 changes no table: records may carry process waits (kind 'process') in waits and
200
- -- lastWaits (hearsay-tools/cezarion#1446). A schema-8 build has no path that skips an unknown
201
- -- wait kind, so it would drop the row's wait list and recover the run without the wait it parked
202
- -- on; the bump makes it refuse the store as unsupported-schema instead; the recovery is to run
203
- -- this version again.
204
- --
205
- -- No live recompute: isLiveRecord already calls a row with an open wait live, of any kind.
206
- `,
207
- REPORTS_MIGRATION,
208
- MERGE_WAIT_MIGRATION, DESTROYED_WORKTREE_MIGRATION,
209
- ];
210
24
  /** Every failure this module reports. `kind` is the discriminant; the subclasses exist so a
211
25
  * caller can also `instanceof` the one case it handles. */
212
26
  export class RunDatabaseError extends Error {
@@ -563,6 +377,11 @@ export class RunDatabase {
563
377
  listIdsByParent(parentId) {
564
378
  return this.run(() => this.statements.listIdsByParent.all(parentId)).map((row) => row.id);
565
379
  }
380
+ /** The roots whose conversation names `memberId` as a sender or recipient, newest first; with no
381
+ * id, every root that has one. An index read (`conversation_members`, schema 13). */
382
+ listConversationRoots(memberId = '') { return this.run(() => this.conversations.roots(memberId)); }
383
+ /** A row's stored `conversation_members`, for a write that keeps them: null for none. */
384
+ conversationMembers(rootId) { return this.run(() => this.conversations.membersOf(rootId)); }
566
385
  /** The id of every worker row, in no particular order. */
567
386
  listWorkerIds() {
568
387
  return this.run(() => this.statements.listWorkerIds.all()).map((row) => row.id);
@@ -646,6 +465,7 @@ export class RunDatabase {
646
465
  }));
647
466
  }
648
467
  get reports() { return this.run(() => reportRows(this.db, work => this.run(work))); }
468
+ get conversations() { return this.run(() => conversationMembers(this.db, work => this.run(work))); }
649
469
  replaceArtifacts(id, artifacts, revision) { this.run(() => this.reports.replace(id, artifacts, revision)); }
650
470
  listArtifacts() { return this.run(() => this.reports.list()); }
651
471
  getMeta(key) {
@@ -681,11 +501,13 @@ export class RunDatabase {
681
501
  this.reports.deleteRun(id);
682
502
  this.statements.delete.run(id);
683
503
  this.statements.deleteMeta.run(`issue-attribution:${id}`);
504
+ this.conversations.deleteRun(id);
684
505
  }
685
506
  const revision = changes.upserts.length > 0 ? this.nextSequence(COMMIT_SEQ_KEY) : 0;
686
507
  for (const row of changes.upserts) {
687
508
  this.reports.markDirty(row.id, row.live, revision);
688
509
  const inserted = this.statements.upsert.get(toRunBindings(row, revision));
510
+ this.conversations.replace(row.id, row.conversationMembers);
689
511
  // Revision binding makes an older writer invalidate this optional repair cache.
690
512
  if (row.issueAttributionCurrent)
691
513
  this.statements.setMeta.run(`issue-attribution:${row.id}`, String(revision));