Fetch remote changes before agents start working so they build on up-to-date code. Adds ProjectSyncManager with git fetch + ff-only merge of defaultBranch, integrated into phase dispatch to sync before branch creation. - Schema: lastFetchedAt column on projects table (migration 0029) - Events: project:synced, project:sync_failed - Phase dispatch: sync all linked projects before creating branches - tRPC: syncProject, syncAllProjects, getProjectSyncStatus - CLI: cw project sync [name] --all, cw project status [name] - Frontend: sync button + ahead/behind badge on projects settings
16 lines
586 B
SQL
16 lines
586 B
SQL
-- Add review_comments table for persisting inline review comments on phase diffs
|
|
CREATE TABLE IF NOT EXISTS review_comments (
|
|
id TEXT PRIMARY KEY NOT NULL,
|
|
phase_id TEXT NOT NULL REFERENCES phases(id) ON DELETE CASCADE,
|
|
file_path TEXT NOT NULL,
|
|
line_number INTEGER NOT NULL,
|
|
line_type TEXT NOT NULL,
|
|
body TEXT NOT NULL,
|
|
author TEXT NOT NULL DEFAULT 'you',
|
|
resolved INTEGER NOT NULL DEFAULT 0,
|
|
created_at INTEGER NOT NULL,
|
|
updated_at INTEGER NOT NULL
|
|
);--> statement-breakpoint
|
|
|
|
CREATE INDEX IF NOT EXISTS review_comments_phase_id_idx ON review_comments (phase_id);
|