(db: StageDb, runId: string | undefined)
| 209 | } |
| 210 | |
| 211 | function resolveRunScopeKey(db: StageDb, runId: string | undefined): string | null { |
| 212 | if (!runId) return null; |
| 213 | const [run] = db |
| 214 | .select({ |
| 215 | scopeKind: chapterRun.scopeKind, |
| 216 | workingTreeRef: chapterRun.workingTreeRef, |
| 217 | baseSha: chapterRun.baseSha, |
| 218 | headSha: chapterRun.headSha, |
| 219 | mergeBaseSha: chapterRun.mergeBaseSha, |
| 220 | }) |
| 221 | .from(chapterRun) |
| 222 | .where(eq(chapterRun.id, runId)) |
| 223 | .limit(1) |
| 224 | .all(); |
| 225 | if (!run) return null; |
| 226 | return deriveScopeKey(run); |
| 227 | } |
| 228 | |
| 229 | function listThreads(db: StageDb, scopeKey: string): CommentThreadDto[] { |
| 230 | const threads = db |
no test coverage detected