feat(review): render AI-suggested fixes as GitHub suggested-change blocks - #3577
Conversation
|
Superagent didn't find any vulnerabilities or security issues in this PR. |
|
Tip 🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩 ✅ Gittensory review result - approve/merge recommendedReview updated: 2026-07-05 18:01:23 UTC
✅ Suggested Action - Approve/Merge
Review summary Nits — 6 non-blocking
Review context
Contributor next steps
Signal definitions
🟩 Safe / merged · 🟦 Advisory · 🟨 Held for review · 🟥 Blocked / closed 💰 Earn for open-source contributions like this. Gittensor lets GitHub contributors earn for the work they already do — register to start earning →. Checked by Gittensory, a quiet PR intelligence layer for OSS maintainers.
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #3577 +/- ##
=======================================
Coverage 93.16% 93.17%
=======================================
Files 311 311
Lines 31750 31759 +9
Branches 11612 11616 +4
=======================================
+ Hits 29581 29590 +9
Misses 1517 1517
Partials 652 652
🚀 New features to boost your workflow:
|
…ocks InlineFinding already carried an optional suggestion field end to end -- the AI prompt asks for it, parseModelReview extracts it, and composeInlineFindings public-safe-filters it through -- but the actual GitHub comment renderer (formatInlineBody in inline-comments.ts) never used it, so a generated fix was silently dropped before it ever reached a contributor. Render it as a native ```suggestion block a contributor can commit in one click, gated by a new review.suggestions manifest toggle layered on top of the existing review.inline_comments three-gate (a suggestion has nothing to attach to without the inline comment it rides on, so it can never fire when inline comments are off). Fails safe: a suggestion whose own text contains a triple-backtick run is dropped (keeping the finding text) rather than risking a corrupted comment. The existing per-finding line-validity check already covers "drop it if the range can't be anchored" -- a suggestion shares its parent finding's single anchored line. Closes #1956
369c791 to
fc0260f
Compare
Closes #1956
Summary
InlineFinding.suggestionalready existed end to end on the generation side —src/services/ai-review.ts's system prompt explicitly asks the model for"suggestion": optional replacement text for that line,parseModelReviewextracts it, and it's threaded throughtoPublicSafefiltering — butsrc/review/inline-comments.ts'sformatInlineBody(the function that actually builds the posted GitHub comment) never read it. A generated fix was silently dropped before it ever reached a contributor.finding.suggestionas a native```suggestionblock a contributor can commit in one click, appended after the finding text..gittensory.yml'sreview.suggestions(default off), layered on top of the existingreview.inline_commentsthree-gate — a suggestion has nothing to attach to without the inline comment it rides on, soshouldRenderSuggestionscan never be true when inline comments are off, regardless of the manifest toggle. The AI is still always asked for asuggestion(cheap, already happening); only rendering it into the posted comment is gated, so no AI-review-cache fingerprint change is needed.selectInlineComments— a suggestion shares its parent finding's single anchored line, so if the line isn't valid, neither the finding nor its suggestion reaches GitHub (no 422).review.suggestionsis wired throughFocusManifestReviewConfig(type, parse, the three "empty manifest" defaults, serialize/round-trip,resolveReviewPromptOverrides) mirroringreview.inline_comments's exact existing pattern. No DB/migration/OpenAPI surface —review.*knobs are manifest-only (self-host.gittensory.yml), same asinline_commentstoday.README.md.Scope
type(scope): short summaryConventional Commit format, for examplefix(api): restore profile access checks.CONTRIBUTING.mdand does not reintroduce GitHub Pages, VitePress,site/, orCNAME.Validation
git diff --checknpm run typecheck(clean)npx vitest run test/unit/inline-comments.test.ts test/unit/focus-manifest.test.ts test/unit/signals-coverage.test.ts— 349/349 passingnpm run test:changed(every test file whose import graph touches this diff, againstmain) — 242 files, 6358 tests, all passingsrc/review/inline-comments.ts100% statements/branches/functions/lines; my specific changed lines insrc/signals/focus-manifest.tsare outside that file's small set of pre-existing, unrelated uncovered lines.npm run test:workers/npm run build:mcp/npm run test:mcp-pack/npm run ui:openapi:check/npm run ui:build— not run individually; no worker/MCP/OpenAPI/UI surface touched.shouldRenderSuggestions's full 4-combination truth table,formatInlineBody's default-off/explicit-off/enabled-with-suggestion/enabled-without-suggestion/backtick-fence-escape branches, manifest parse/serialize/round-trip + non-boolean-warns forreview.suggestions, and an end-to-endmaybePostInlineCommentstest threading the flag all the way to the posted comment body.Safety
review.inline_comments's own precedent.apps/gittensory-ui).UI Evidencesection below. — N/A, not anapps/gittensory-uichange.README.md.