Skip to content

feat(review-memory): add review memory#3448

Open
alex-alecu wants to merge 29 commits into
mainfrom
feat/review-memory-workflow
Open

feat(review-memory): add review memory#3448
alex-alecu wants to merge 29 commits into
mainfrom
feat/review-memory-workflow

Conversation

@alex-alecu
Copy link
Copy Markdown
Contributor

@alex-alecu alex-alecu commented May 25, 2026

Why

Maintainers give feedback on Kilo's code reviews, but Kilo did not learn from repeated feedback. This adds a way to turn that feedback into proposed REVIEW.md guidance that teams can review first.

What changed

Kilo now records feedback from GitHub and GitLab reviews, groups repeated patterns, and drafts REVIEW.md updates when there is enough signal. The Code Reviewer page now has a Memory tab where teams can review, edit, dismiss, or approve those drafts. Approved drafts open a new GitHub pull request or GitLab merge request instead of changing the default branch. Completed review summaries can also link back to open memory proposals so maintainers can find them later.

Screenshot 2026-05-28 at 18 37 25

How to test

  1. Run a GitHub or GitLab code review and leave repeated feedback on Kilo's comments.
  2. Open the Code Reviewer page and switch to the Memory tab for that platform.
  3. Review a proposal, edit its text, then open a REVIEW.md PR or MR.
  4. Complete another review for a repo with open proposals and confirm the summary footer links back to the Memory tab.

Comment thread apps/web/src/routers/code-reviews/review-memory-router.ts Outdated
Comment thread apps/web/src/lib/code-reviews/review-memory/db.ts Outdated
Comment thread apps/web/src/lib/code-reviews/review-memory/aggregation.ts
@kilo-code-bot
Copy link
Copy Markdown
Contributor

kilo-code-bot Bot commented May 25, 2026

Code Review Summary

Status: No Issues Found | Recommendation: Merge

Executive Summary

Six incremental fixes land cleanly: batched retention pruning, owner-scoped feedback-subject upsert/indexes, conditional GitLab webhook persistence, rejection/approval status guards, claimant freshness check, and stored dashboard rollups. All previously flagged issues remain resolved.

New Changes Reviewed (6 commits)
Commit Change
edabb4ec1 Owner-scoped partial unique indexes for code_review_feedback_subjects; upsertFeedbackSubject uses owner-specific conflict target
3381b16a9 pruneExpiredReviewMemoryData bounded to a configurable batch size (default 500, max 5000); select-then-delete pattern
696864199 GitLab Note/Emoji webhook handlers skip DB persistence when feedbackResult.recorded === false
37d89d88b rejectReviewMemoryProposal guards against rejecting proposals in non-actionable states
c696ddef9 approveAndOpenChangeRequest restricted to ['owner'] role — billing managers can no longer open org change requests
ece7cad13 listAggregationStates reads stored rollup columns instead of re-computing live correlated subqueries
Files Reviewed (12 files changed since last review)
  • apps/web/src/app/api/webhooks/gitlab/route.ts — no issues
  • apps/web/src/app/api/webhooks/gitlab/route.test.ts — no issues
  • apps/web/src/lib/code-reviews/review-memory/aggregation.ts — no issues
  • apps/web/src/lib/code-reviews/review-memory/aggregation.test.ts — no issues
  • apps/web/src/lib/code-reviews/review-memory/db.ts — no issues
  • apps/web/src/lib/code-reviews/review-memory/db.test.ts — no issues
  • apps/web/src/routers/code-reviews/review-memory-router.ts — no issues
  • apps/web/src/routers/code-reviews/review-memory-router.test.ts — no issues
  • packages/db/src/migrations/0149_futuristic_deadpool.sql — no issues
  • packages/db/src/migrations/meta/0149_snapshot.json — generated, skipped
  • packages/db/src/migrations/meta/_journal.json — generated, skipped
  • packages/db/src/schema.ts — no issues
Resolved Issues (all previously flagged, all fixed)
File Issue Fixed By
apps/web/src/routers/code-reviews/review-memory-router.ts dispatchReviewMemoryAggregationCron cross-state scope leak 97a5811f9
apps/web/src/lib/code-reviews/review-memory/aggregation.ts totalCostMusd dead field 20813c3f3
apps/web/src/lib/code-reviews/review-memory/db.ts markProposalOpeningChangeRequest missing DB-level status guard 242ddd4cb
apps/web/src/lib/code-reviews/review-memory/db.ts updateReviewMemoryProposal status guard removed e9bff4d2c
apps/web/src/routers/code-reviews/review-memory-router.ts Double-prune: pruneExpiredReviewMemoryData() called twice per triggerAnalysis 456dd41

Reviewed by claude-4.6-sonnet-20260217 · 1,925,803 tokens

Review guidance: REVIEW.md from base branch main

alex-alecu and others added 7 commits May 25, 2026 11:08
…rkflow

# Conflicts:
#	apps/web/src/lib/user/index.test.ts
#	packages/db/src/migrations/meta/0141_snapshot.json
#	packages/db/src/migrations/meta/_journal.json
…rkflow

# Conflicts:
#	apps/web/src/lib/integrations/platforms/github/webhook-handler.test.ts
#	packages/db/src/migrations/meta/0145_snapshot.json
#	packages/db/src/migrations/meta/_journal.json
…rkflow

# Conflicts:
#	packages/db/src/migrations/meta/0146_snapshot.json
#	packages/db/src/migrations/meta/_journal.json
Comment thread apps/web/src/lib/code-reviews/review-memory/db.ts Outdated
Comment thread apps/web/src/routers/code-reviews/review-memory-router.ts Outdated
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants