feat(review): emit structured inline review findings + a review.inline_comments toggle#1525
Merged
Merged
Conversation
…e_comments toggle
PR A of a CodeRabbit-style quiet inline-comments feature (the inert data contract; the
GitHub posting + wiring follow in PR B). The AI reviewer can now ALSO emit structured,
line-anchored findings {path, line, severity, body}: ModelReview/result carry an
inlineFindings array, parseModelReview parses it fail-safe (a malformed/absent field
degrades to [], each item missing a usable path/line/body is dropped, never partial),
and composeInlineFindings dedupes by path+line, drops public-unsafe bodies, and caps the
total. The instruction is appended to the system prompt ONLY when the caller asks for it,
so with the feature off the prompt is byte-identical and the model emits nothing.
Adds a manifest-only .gittensory.yml review.inline_comments toggle (default OFF) wired
the same way as review.profile — type, parse, present, serialize, resolve — with no DB
column. Nothing consumes the findings yet, so behavior is unchanged until PR B.
|
Superagent didn't find any vulnerabilities or security issues in this PR. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #1525 +/- ##
=======================================
Coverage 95.45% 95.46%
=======================================
Files 195 195
Lines 21121 21148 +27
Branches 7637 7649 +12
=======================================
+ Hits 20161 20188 +27
Misses 383 383
Partials 577 577
🚀 New features to boost your workflow:
|
JSONbored
added a commit
that referenced
this pull request
Jun 26, 2026
PR B activates the CodeRabbit-style inline-comments feature (PR A #1525 shipped the inert contract). On top of the decision summary, the AI reviewer's line-anchored findings are posted as ONE non-blocking review (event: COMMENT, never REQUEST_CHANGES) so a contributor sees exactly what to fix for a resubmission without the gate ever changing. - createPullRequestReviewComments: a quiet COMMENT-event review with inline comments, threading the action mode (dry-run suppression). - inline-comments.ts: rightSideLinesFromPatch validates each finding's line against the diff hunks (out-of-diff lines dropped → never a 422), selectInlineComments dedupes/caps, postInlineReviewComments is fail-safe (swallows API errors, never touches the gate), and maybePostInlineComments posts once per head SHA — a cache hit carries no findings, so the ~2-min re-gate sweep never reposts, and the off-path does zero extra work. - Gated at three layers (all default OFF): GITTENSORY_REVIEW_INLINE_COMMENTS, the GITTENSORY_REVIEW_REPOS allowlist, and the per-repo review.inline_comments manifest toggle. - Docs + .env.example + flag plumbing (env.d.ts, wrangler.jsonc, cf-typegen).
12 tasks
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.
Summary
PR A of 2 for a CodeRabbit-style quiet inline-comments feature — this is the inert data contract; the GitHub posting + processor wiring follow in PR B. Nothing consumes the new findings yet, so behavior is unchanged until PR B activates it.
{path, line, severity, body}.ModelReview+ theokresult carry aninlineFindingsarray.parseModelReviewparses them fail-safe: a malformed/absent field degrades to[]; each item missing a usable path / positive line / body is dropped (never partial); severity defaults tonitunless exactlyblocker.composeInlineFindingsdedupes bypath+line(first wins), drops public-unsafe bodies (toPublicSafe), and caps the total at 10..gittensory.ymlreview.inline_commentstoggle (default OFF), wired exactly likereview.profile(type, parse,present, serialize, resolve) — no DB column.Scope
src/services/ai-review.ts—InlineFinding, parse, compose, prompt suffix, result fieldsrc/signals/focus-manifest.ts—review.inline_comments(manifest-only)ai-review,focus-manifest, onesignals-coverageliteralValidation
npm run typecheckclean ·npm run test:coverage4625 passed · 100% line+branch on the diff (verified per-file; remaining uncovered branches in those files are all pre-existing, outside the patch)Safety