peppa/packages/db/migrations/0009_runners.sql
Асель 6b75324971 PEP-10/27/53: runners with a story queue, a git worktree per runner, free runners
- Runner settings with inheritance system → project → story (settings rows):
  mode story (default, one runner per story) / queue, context fresh / continue,
  workspace shared / worktree, maxRunners. No rows = behaviour as before.
- runner_tasks: a runner's story history and queue; sessions.name, sessions.workspace_path
  (migration 0007_runners).
- moveTask → startTaskOnRunner; runnerTick in the watchdog moves free queue runners to
  their next story (fresh: same tmux, new generation without resume; continue: message),
  reassigns queues of dead runners, removes finished runners' worktrees (clean + pushed).
- Free runners («Новый терминал»), rename, «Оформить стори»; the Stop hook doesn't ping
  for free runners or stories that left work.
- Web: «Новый терминал» (runners page, project sessions tab) with voice input,
  project/story runner settings, runner stories in the details panel; CLI peppa runner …
- e2e: packages/testkit/test/runners.test.ts

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-14 06:38:02 +05:00

17 lines
784 B
SQL

CREATE TABLE `runner_tasks` (
`id` integer PRIMARY KEY AUTOINCREMENT NOT NULL,
`session_id` integer NOT NULL,
`task_id` integer NOT NULL,
`status` text NOT NULL,
`prompt` text,
`front` integer DEFAULT false NOT NULL,
`created_at` integer DEFAULT (cast(unixepoch('subsec') * 1000 as integer)) NOT NULL,
`started_at` integer,
`ended_at` integer,
FOREIGN KEY (`session_id`) REFERENCES `sessions`(`id`) ON UPDATE no action ON DELETE cascade,
FOREIGN KEY (`task_id`) REFERENCES `tasks`(`id`) ON UPDATE no action ON DELETE cascade
);
--> statement-breakpoint
CREATE INDEX `runner_tasks_session_idx` ON `runner_tasks` (`session_id`,`status`);--> statement-breakpoint
ALTER TABLE `sessions` ADD `name` text;--> statement-breakpoint
ALTER TABLE `sessions` ADD `workspace_path` text;