Repository navigation
feat(pr-review): suppress findings the team keeps rejecting - #1016
Merged
Makisuo merged 1 commit intoSep 23, 2026
Merged
Conversation
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. Note Currently processing new changes in this PR. This may take a few minutes, please wait... ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (13)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Makisuo
marked this pull request as ready for review
September 23, 2026 22:26
Every stored finding is embedded (FindingEmbedder, wired in apps/ai's Llm.ts over OpenRouter's embeddings endpoint) into pr_review_finding_embeddings, stamped with the model. In submitReview, after ignored paths, lenses and repeats, a new finding whose cosine similarity is at least 0.5 to three or more downvoted or dismissed findings, and to fewer than three upvoted or fixed ones, is neither stored nor posted, and maple.pr_review.suppressed counts it on the span. Security and critical findings are never suppressed. The 0.5 bar was measured on text-embedding-3-small. The pool is the organization by default; the repository setting feedbackScope narrows it to the repository or turns the filter off. No embedder, or an embedding or read failure, posts every finding.
Makisuo
force-pushed
the
feat/pr-review-feedback-filter
branch
from
September 23, 2026 22:28
6e1cf75 to
9c81821
Compare
Makisuo
changed the base branch from
feat/pr-review-agent
to
feat/pr-review-coverage-gate
September 23, 2026 22:29
Makisuo
added this pull request to stack #1015
September 23, 2026 22:29
Makisuo
added a commit
that referenced
this pull request
Sep 23, 2026
#1016 added the table without registering it in OrganizationService, which fails the org-scoped table registry test on main.
Makisuo
added a commit
that referenced
this pull request
Sep 23, 2026
* feat(web): attribute web vitals to app-shell regions Switch RUM to the web-vitals attribution build and record where each vital happened. Every vital now carries maple.vital.region (sidebar, topbar, filters, page-header, content, right-panel, overlay, shell, other, detached), resolved from the data-slot names the shell components already render. CLS adds the shifting element and the load state it shifted in, INP adds the input delay / processing / presentation split, and LCP adds the TTFB / resource / render-delay split. The region is bounded, so it also goes on the vitals histograms; selectors and timings stay on the maple.web_vitals log row. * fix(backend): purge pr_review_finding_embeddings with the org #1016 added the table without registering it in OrganizationService, which fails the org-scoped table registry test on main.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Stacked on #1014 (stack: #1001 → #1014 → this).
What
The review now learns from how a team reacted to its earlier findings. Before a review is stored and posted, each new finding is compared with past findings people voted on. If it closely resembles several that were rejected, it is dropped.
FindingEmbedderis a port inpackages/backend. The model behind it is wired inapps/ai/src/platform/Llm.ts: OpenRouter's OpenAI-compatible/embeddingsendpoint,openai/text-embedding-3-smallby default, overridable withMAPLE_EMBEDDING_MODEL. The layer has its ownOpenAiClient, so the Workers AI one is not replaced. Without an OpenRouter key there is no embedder and the filter is off.pr_review_finding_embeddings(finding_id, org, repository,model,real[]). It is kept separate frompr_review_findingsso the lifecycle reads do not carry vectors. Vectors from different models are never compared.securitycategory or withcriticalseverity.feedbackScope(with a select in the settings dialog) narrows it to one repository or turns the filter off. Vectors are still stored while it is off, so turning it back on has history to work with.maple.pr_review.suppressedon thesubmitReviewspan.maple.pr_review.feedback_filter(applied, off, no_embedder, embed_failed, read_failed),feedback_scopeandfeedback_examplesare on the child span. Suppressed findings are also logged with their path and title.Threshold
I measured it against the real endpoint with ten sample findings. The same kind of comment about different code scored 0.52 to 0.68, and different kinds scored at most 0.44. A 0.85 bar would never have matched. This is a small sample, so
FEEDBACK_SIMILARITYis a single constant and should be re-checked against real reactions once they build up.Migration
packages/db/drizzle/20260923221619_pr_review_finding_embeddings: oneCREATE TABLEplus an index on(org_id, model). The prd deploy applies it.Tests
feedback.test.ts: labels, cosine similarity, the vote rule, security and critical exemptions.PrReviewService.test.ts(PGlite, fake embedder): a finding like three downvoted or dismissed ones is suppressed while security and critical ones are posted; enough positive votes keep a finding; repository scope ignores votes from other repositories;offposts everything; vectors from another model are ignored; an embedder failure or a missing embedder posts everything and stores no vectors.bun run --cwd packages/backend test src/services/pr-reviewpasses (57 tests). Thepackages/dbtests pass.tscpasses for backend, ai and web. oxlint is clean.layerFindingEmbedderagainst the live endpoint and got 1536-dimension vectors.Not in this PR
Need help on this PR? Tag
@codesmith-botwith what you need. Autofix is disabled.Summary by CodeRabbit