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

@@ -36,7 +36,7 @@ function createScaffold(db: AppDatabase) {
lastError: null,
});
const companyId = db.saveCompany({
const companyId = db.company.saveCompany({
name: "Thread Wait Co",
description: "Tests cofounder wait states and replies",
status: "active",
@@ -204,7 +204,7 @@ describe("thread wait + heartbeat integration", () => {
throw new Error("Expected a task thread to exist for approval resolution testing.");
}
const approvalId = db.requestApproval({
const approvalId = db.approvalsMod.requestApproval({
companyId,
relatedTaskId: taskId,
requestedByAgentId: engineerId,
@@ -238,7 +238,7 @@ describe("thread wait + heartbeat integration", () => {
expect(waitStates).toHaveLength(1);
expect(checkpointEngine.shouldPauseHeartbeat(companyId, engineerId)).toBe(true);
db.decideApproval({
db.approvalsMod.decideApproval({
approvalId,
state: "approved",
decisionNote: "Approved by board",