2.5 KiB
2.5 KiB
id, title, status, wave, depends_on, plan, spec
| id | title | status | wave | depends_on | plan | spec |
|---|---|---|---|---|---|---|
| 01-schema-and-repository | Review run/finding schema, models, and repository | done | 1 | plan.md | ../../specs/agents/requirements/native-code-review.md |
Task 01: Review run/finding schema, models, and repository
Persist review runs and findings. No service, no API yet.
Inputs
- Spec Data model and Persistence guarantees.
apps/backend/AGENTS.md→ "Schema & migrations": table DDL ininit*Schema, every index and anything referencing a new column inrunMigrations().- Pattern:
internal/task/repository/sqlite/walkthrough.go(JSON column, upsert, nil-on-missing) and itswalkthrough_test.go.
Work
internal/task/models/models.go—TaskReviewRun,TaskReviewFinding, enumsReviewRunStatus(pending|running|completed|failed|cancelled),ReviewRunTrigger(manual|workflow_step|agent),ReviewSeverity(blocker|major|minor|nit),ReviewFindingStatus(open|resolved|dismissed), sentinelsErrTaskReviewRunNotFound,ErrTaskReviewFindingNotFound.internal/task/repository/sqlite/base_schema.go—initTaskReviewSchema()with bothCREATE TABLE IF NOT EXISTSstatements, registered ininitSchema().internal/task/repository/sqlite/base_migrations.go— the fourCREATE INDEX IF NOT EXISTSstatements.internal/task/repository/sqlite/review.go— the repository methods listed in the plan's "Schema & models" section.CreateTaskReviewFindingsinserts in one transaction.DeleteSupersededTaskReviewFindingsdeletesopenrows from other runs matching(repository_name, file_path, start_line, end_line, title).CancelInFlightTaskReviewRunssetspending/running→cancelledwitherror_message = "interrupted by restart", called from the same boot path that runs other recovery sweeps.
Acceptance
- Fresh DB and replayed existing DB both reach the new schema without error.
- Deleting a task deletes its runs and findings.
- Supersede deletes only matching
openrows from other runs.
Verification
cd apps/backend && go test ./internal/task/repository/sqlite/... -run 'Review'
cd apps/backend && go build ./...
Files likely touched
internal/task/models/models.go, internal/task/repository/sqlite/{base_schema.go,base_migrations.go,review.go,review_test.go}, the repository interface in internal/task/repository/.
Output contract
Summary, files changed, tests run with results, blockers, risks, and status: done here plus the Wave 1 checkbox in plan.md.