Codemod db pass-through calls: messages + runs + approvals + company (C1 part 2/3)

Rewrite ~376 call sites for messages, runs, approvalsMod, and company
domains and delete the corresponding pass-through methods on
AppDatabase / AppDatabaseBase. Structural type references
(ReturnType<HandlerDeps["db"]["getRun"]>) and SweepStaleReviewsDeps-style
mocks are updated to route through the owning sub-module.
This commit is contained in:
ZacharyZhang-NY committed 2026-04-20 13:20:15 -04:00
1 parent 5e9b7acbc6
commit a69fbb053b
86 files changed
+393 -454

No files matched your search

+4 -4
View File
@@ -164,7 +164,7 @@ function deriveTaskIdFromRun(
): string | null {
if (!runId) return null;
try {
const run = db.getRun(runId);
const run = db.runs.getRun(runId);
if (run.companyId !== companyId) return null;
return run.taskId ?? null;
} catch (error) {
@@ -187,12 +187,12 @@ function maybeRaiseDeliverableReviewApproval(
documentId: string,
taskId: string | null,
): string | null {
const companySettings = deps.db.getCompanyApprovalSettings(input.companyId);
const companySettings = deps.db.company.getCompanyApprovalSettings(input.companyId);
if (!companySettings?.reviewDeliverables) return null;
if (deps.db.getCompanyExecutionMode(input.companyId) === "ai_cofounder") return null;
if (deps.db.company.getCompanyExecutionMode(input.companyId) === "ai_cofounder") return null;
if (deps.db.tasks.hasPendingDeliverableReviews(input.companyId)) return null;
const approvalId = deps.db.requestApproval({
const approvalId = deps.db.approvalsMod.requestApproval({
companyId: input.companyId,
relatedTaskId: taskId,
requestedByAgentId: input.authorAgentId ?? "",