(db: StageDb, threadId: string)
| 266 | .from(comment) |
| 267 | .where(eq(comment.id, commentId)) |
| 268 | .limit(1) |
| 269 | .all(); |
| 270 | return row?.threadId ?? null; |
| 271 | } |
| 272 | |
| 273 | function resolveRunScopeKey(db: StageDb, runId: string | undefined): string | null { |
| 274 | if (!runId) return null; |
| 275 | const [run] = db |
| 276 | .select({ |
| 277 | scopeKind: chapterRun.scopeKind, |
| 278 | workingTreeRef: chapterRun.workingTreeRef, |
| 279 | baseSha: chapterRun.baseSha, |
| 280 | headSha: chapterRun.headSha, |