Skip to content

Feat/review suggestion blocks#52

Open
factory-nizar wants to merge 9 commits intodevfrom
feat/review-suggestion-blocks
Open

Feat/review suggestion blocks#52
factory-nizar wants to merge 9 commits intodevfrom
feat/review-suggestion-blocks

Conversation

@factory-nizar
Copy link
Contributor

@factory-nizar factory-nizar commented Mar 3, 2026

Add review-bot instructions to include suggestion blocks when the fix is high-confidence, using RIGHT-side anchors and a 250-line cap.

There's a bit of repetition in the prompts but feel free to correct me if anything is not relevant:

candidate: generates comment bodies, so would naturally want to add suggestions there as well
Validator: enforcement, reject if anchor changes
Review prompt: needed in the case a single pass is enabled

examples

or in this pr we are in currently

I did focus on anchoring on the right, since applying suggestions on deleted lines is not currently supported
image

Closes FAC-16670

@factory-nizar factory-nizar force-pushed the feat/review-suggestion-blocks branch from e671163 to 7f1cb65 Compare March 3, 2026 23:43
factory-nizar and others added 2 commits March 3, 2026 15:47
Read .factory/skills/review-guidelines.md from the workspace and inject
its content into all review prompt templates (code review, candidates,
validator, and security review). This allows repository maintainers to
define repo-specific review guidelines without polluting AGENTS.md.

Closes FAC-16667

Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>

refactor: address review feedback

- Use .factory/skills/review-guidelines/SKILL.md path (follow skill conventions)
- Extract formatGuidelinesSection() helper to centralize prompt formatting
- Use consistent <custom_review_guidelines> tags across all templates

Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>

docs: add custom review guidelines section to README

Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>
Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>

fix(review): escape suggestion blocks in prompt

Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>

fix(review): enforce suggestion-only replacements

Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>

update
@factory-nizar factory-nizar force-pushed the feat/review-suggestion-blocks branch from 7f1cb65 to 987bf4d Compare March 3, 2026 23:48
factory-nizar and others added 4 commits March 3, 2026 15:52
Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>
Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>
Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>
Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>
@factory-nizar factory-nizar marked this pull request as ready for review March 4, 2026 00:15
@factory-droid
Copy link
Contributor

factory-droid bot commented Mar 4, 2026

Droid finished @factory-nizar's task —— View job


Droid reviewed PR #52 — 1 finding approved (P1: blanket anchor-content restriction suppresses replacement suggestions), 1 rejected (speculative snippet-cap conflict). View review

@factory-nizar
Copy link
Contributor Author

btw @jonathan-factory, @lukealvoeiro was suggesting 250 lines might be too big. I guess most suggestions even if they had egregious white space issues should not be more than sub 100?

Copy link
Contributor

@factory-droid factory-droid bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One approved finding: the blanket "do not change the anchor line content" instruction at line 352 contradicts the <replacement code> template and the suggestion blocks Rules section (which correctly scopes the unchanged-anchor restriction to insert-only suggestions). This would suppress the most common type of suggestion—single-line replacements. The suggested fix properly narrows the restriction to insert-only cases.

Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>
@jonathan-factory
Copy link

btw @jonathan-factory, @lukealvoeiro was suggesting 250 lines might be too big. I guess most suggestions even if they had egregious white space issues should not be more than sub 100?

Yeah 250 was more of a relaxed upper bound to use as a failsafe against overly large comments, no concerns reducing to something like 100

Copy link

@jonathan-factory jonathan-factory left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LG after re-running evals

Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>
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