Watch
0
0
Fork
You've already forked hyperhive
0

review-classifier: say the 25-line context shows a gate only when it's within 25 lines

This commit is contained in:
atlas 2026-10-15 10:24:26 +02:00 • committed by mara
commit 276545fb45
2 changed files with 7 additions and 6 deletions

View file

@ -289,9 +289,10 @@ lets the runtime's prompt cache reuse it across questions.
The controller builds the diff itself, from each changed file at the PR's The controller builds the diff itself, from each changed file at the PR's
merge base and at its head, with 25 lines of context around each change merge base and at its head, with 25 lines of context around each change
rather than the 3 of the forge's `.diff`. That keeps a moved block's rather than the 3 of the forge's `.diff`. An enclosing gate, such as a
enclosing gate in view, such as a `config = lib.mkIf …` or an option's `config = lib.mkIf …` or an option's `default`, is in view when it is within
`default`, so a move that restates the gate doesn't read as adding one. The 25 lines of the change, so a move that restates it doesn't read as adding one.
A gate further away is still out of view. The
controller sends the forge's `.diff` instead when the PR changes more than controller sends the forge's `.diff` instead when the PR changes more than
100 files, when the forge names no merge base, when reading a changed file 100 files, when the forge names no merge base, when reading a changed file
fails, or when the wide diff is over 256 KiB. The review then says so, with fails, or when the wide diff is over 256 KiB. The review then says so, with

View file

@ -1,8 +1,8 @@
//! The diff the review classifier reads, built from both sides of each //! The diff the review classifier reads, built from both sides of each
//! changed file rather than taken from the forge's `.diff`, whose context is //! changed file rather than taken from the forge's `.diff`, whose context is
//! fixed at 3 lines. With [`CONTEXT_LINES`] of context a moved block keeps //! fixed at 3 lines. [`CONTEXT_LINES`] of context shows an enclosing gate (a
//! its enclosing gate (a `config = lib.mkIf …`, an option's `default`) in //! `config = lib.mkIf …`, an option's `default`) only when it is within that
//! view, so a move that restates that gate does not read as adding one. //! many lines of the change; a gate further away is still out of view.
use std::fmt::{self, Write as _}; use std::fmt::{self, Write as _};