feat(advisor): review localized patches at source#4162
Conversation
Signed-off-by: Carlos Villela <cvillela@nvidia.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Enterprise Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughAdds a source-of-truth review dimension: types and schema, diff-based localized-patch detection, LLM rubric updates, result normalization that injects findings for missing follow-up, detailed markdown rendering, and tests/docs updates. ChangesSource-of-truth review feature
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 ESLint
ESLint skipped: no ESLint configuration detected in root package.json. To enable, add Comment |
E2E Advisor RecommendationRequired E2E: None Full advisor summaryE2E Recommendation AdvisorBase: Required E2E
Optional E2E
New E2E recommendations
|
E2E Scenario Advisor RecommendationRequired scenario E2E: None Full scenario advisor summaryE2E Scenario AdvisorBase: Required scenario E2E
Optional scenario E2E
Relevant changed files
|
PR Review AdvisorFindings: 0 needs attention, 1 worth checking, 0 nice ideas Review findings🛠️ Needs attention
🔎 Worth checking
🌱 Nice ideas
Since last review detailsCurrent findings:
This is an automated advisory review. A human maintainer must make the final merge decision. |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@tools/pr-review-advisor/analyze.mts`:
- Around line 459-461: The code currently treats any line starting with "+++" as
a file header and skips it, which also drops real added lines like
"+++fallback"; update the header-detection logic in analyze.mts (the block that
checks rawLine) to only treat a line as a diff file header when it starts with
"+++ " (three pluses followed by a space) or is exactly "+++" if you want to be
extra safe; replace the existing rawLine.startsWith("+++") check with
rawLine.startsWith("+++ ") (and optionally || rawLine === "+++") so that valid
added lines beginning with "+++" are not skipped.
- Around line 829-849: The current addSourceOfTruthFindings function can drop
newly injected source-of-truth findings because it slices the combined array to
50 at the end; change the logic so the 50-item cap never truncates injected
findings: build the list by taking up to 50 items from the original findings
while reserving slots for any source-of-truth items you will add (or,
alternatively, append all source-of-truth items and if the combined length
exceeds 50, trim only from the original findings portion). Update
addSourceOfTruthFindings (and the augmented variable/return behavior) so that
any finding created for a review with status "missing" or "needs_followup" is
always included in the final array even when the total would exceed 50.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Enterprise
Run ID: 1df41838-e88c-4bbb-8acb-f368d8ed02b4
📒 Files selected for processing (4)
test/pr-review-advisor.test.tstools/pr-review-advisor/README.mdtools/pr-review-advisor/analyze.mtstools/pr-review-advisor/schema.json
Signed-off-by: Carlos Villela <cvillela@nvidia.com>
Summary
Adds a source-of-truth review surface to the PR Review Advisor so fallback, recovery, tolerant parsing, monkeypatching, and other localized workaround behavior is reviewed against the actual source boundary. The advisor now emits structured source-of-truth results, detects localized patch signals from added diff lines, and turns missing follow-up into actionable architecture findings.
Changes
sourceOfTruthReviewto the PR Review Advisor JSON schema and normalized result contract.Type of Change
Verification
npx prek run --all-filespassesnpm testpassesmake docsbuilds without warnings (doc changes only)Additional verification run:
npx vitest run test/pr-review-advisor.test.tspassed.npm run build:clipassed.git diff --checkpassed.npx prek run --all-filesfailed before hooks ran:Error fetching release: self-signed certificate in certificate chain.npm testwas run and failed in unrelated existing areas, includingtest/ssrf-parity.test.tsmissingnemoclaw/dist/blueprint/private-networks.js, gateway/status CLI tests hittingTypeError: shields.getShieldsPosture is not a function, and deploy validation expectation drift.Signed-off-by: Carlos Villela cvillela@nvidia.com
Summary by CodeRabbit
New Features
Bug Fixes
Tests
Documentation