feat: Add errands schema, repository, and wire into tRPC context/container

Creates the errands table (with conflictFiles column), errand-repository
port interface, DrizzleErrandRepository adapter, and wires the repository
into TRPCContext, the DI container, _helpers.ts requireErrandRepository guard,
and the test harness. Also fixes pre-existing TS error in controller.test.ts.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Lukas May
2026-03-06 15:49:26 +01:00
parent 67658fb717
commit 3a328d2b1c
13 changed files with 2226 additions and 2 deletions

View File

@@ -0,0 +1,17 @@
CREATE TABLE `errands` (
`id` text PRIMARY KEY NOT NULL,
`description` text NOT NULL,
`branch` text NOT NULL,
`base_branch` text DEFAULT 'main' NOT NULL,
`agent_id` text,
`project_id` text NOT NULL,
`status` text DEFAULT 'active' NOT NULL,
`created_at` integer NOT NULL,
`updated_at` integer NOT NULL,
`conflict_files` text,
FOREIGN KEY (`agent_id`) REFERENCES `agents`(`id`) ON UPDATE no action ON DELETE set null,
FOREIGN KEY (`project_id`) REFERENCES `projects`(`id`) ON UPDATE no action ON DELETE cascade
);
--> statement-breakpoint
CREATE INDEX `errands_project_id_idx` ON `errands` (`project_id`);--> statement-breakpoint
CREATE INDEX `errands_status_idx` ON `errands` (`status`);

File diff suppressed because it is too large Load Diff

View File

@@ -239,6 +239,13 @@
"when": 1772409600000,
"tag": "0033_drop_approval_columns",
"breakpoints": true
},
{
"idx": 34,
"version": "6",
"when": 1772808163349,
"tag": "0034_salty_next_avengers",
"breakpoints": true
}
]
}