redline: past two request-changes rounds a head is read only with an approving local review on record #266
All Vouch review confidence checks passed
Residual risk 0.38 = Change Risk (0.64) × (1 − Review Confidence (0.40)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.64 · 650 lines diff across 8 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.02 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 10%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.388
Shallow Review Depth
shallow_review_depth
0.344
No Reviewer Assigned
no_reviewer_assigned
0.120
Real PR Conversation Timeline
1 comments
"Review active on #266"
general
weight: 0.35
askalf
Where a host sets
REDLINE_LOCAL_READSto a directory, the review holds a first-party pullrequest after two request-changes rounds: a new head is read only when an approving local review
of that very commit is on record in the directory. With the setting unset there is no hold.
With the setting unset nothing else changes: the round count, verdict.json and the cap notice
are as they are on main.
WHY
Of 54 reviews here that asked for changes on 19 merged pull requests of this organisation in five
days, 30 were on three pull requests.
local.mjs readruns the same review, on the same modelsand prompt, before a push, and its rounds cost no round in CI. Nothing made a push wait for it.
WHAT CHANGES
review.mjs-
holdApplies: the hold is asked of a head when a directory is set, the pull request'sauthor_associationis OWNER, MEMBER or COLLABORATOR, it has hadHOLD_AFTER_ROUNDS(2)rounds or more, and the round cap has not been reached.
-
approvedLocally: the record is<directory>/<full sha>.json, a regular file of at most4,096 bytes holding
{"version":1,"head_sha":"<this sha>","verdict":"APPROVE",...}. It isopened with a link refused at open (O_NOFOLLOW) and without blocking, and what was opened is
what is measured and read. A system with no such flag takes no record at all: every head
past two rounds is held there, and the log says why. A file that is there and is not a
record is not taken; the log names the file and why, never its content. No file is no
record and logs nothing.
- Rounds are counted as for the round cap (
roundsAsked, unchanged): the larger of the headsthe history shows and the count a notice there states. Its limits come with it, and the
README lists them: (1) after enough held pushes for a pull request's first requests to
leave the 40 verdicts a run reads, the count the round cap is compared with can come out
lower than the rounds there were (the notices still state two or more, so a pushed head is
still held without a record); (2) a run's verdict stands at the time its run was made, and
a run GitHub runs again keeps that time; (3) a dispatch with reread reads a head whatever is
on record.
- A verdict standing at a head the branch moved back to is reused, and the run writes it to
its own verdict.json with
standing_since, the time it was first given (verdictRecord,checked by
verdictProblem);verdictAsReviewreads it back at that time (standsFrom).Dated by its own run, a reused approval cleared the requests made since it was given (the
next head was read without a record), and a reused notice carried its count past an
approval given since (the next head was held with no round asked).
- A held head gets the round cap's notice at two rounds with no model call.
renderCapBodyadds one sentence to the notice's first paragraph: what the cap is without a record and
with one, and that the next commit should be reviewed before its push. The paragraph still
opens as every cap notice does and the rule line is
rule:round-cap, so what reads a capnotice (
isCapNotice,capNoticeRounds,capNoticeQuotehere, and a caller's own readers)reads this one as one. The result carries
held: trueand the run's last line says "the holdfor a local review".
- A dispatch with reread reads a held head. At the round cap the cap's own notice is given,
with or without a record. A round cap of 2 or less is the cap, not the hold. A round cap of
0 turns the cap off and not the hold: a first-party head with no record is still held after
two rounds, and the notice says there is no cap for a head with a record.
-
withModelsFiletakesREDLINE_LOCAL_READSfrom the models file over the env file's, aswritten. Each reader judges the value left after that (
localReadsDir): when it is set andis not an absolute path,
mainends a review in CI, andlocal.mjs reviewgoes on andleaves the approval off the record.
local.mjs-
review(the host side) puts an approval on record:recordLocalApprovewrites the recordunder another name, gives it to the directory's group and sets mode 0640 past the umask, both
on the open file and never by its name, and moves it into place. The move, and the removal
after a failed step, are by name. A request for changes writes
nothing. A directory that is missing or cannot be written, a group the writer may not give
a file to, or a setting that is not an absolute path, leaves the review and its exit status
as they are; stderr says the approval is not on record. stdout stays the review alone.
UNTRUSTED INPUT AND WHERE IT GOES
author_association: GitHub computes it; a pull request's author cannot set it. A value thatis not one of the three, or missing, means no hold (the round cap still applies).
request's head;
approvedLocallytakes only 40 lowercase hex characters, so the file namecannot leave the directory.
local.mjs reviewor by hand. Its content is read as JSON of at most 4,096 bytes and compared field by field;
nothing in it is run, printed or sent to the model. A false record buys one thing: the head is
read, by the same review as any head. A record that cannot be read fails closed: the head is
held, and a dispatch with reread reads it.
local.mjs review: the pack's own word, checked to be a full sha(
checkChange). The host does not compare the packed tree with it. Whoever can run the reviewon the host can therefore put any sha on record, which is the same power as writing the
directory.
directory's path) and the file names read and written.
with no access to it) is held after two rounds until someone with the host reviews a commit
or dispatches a reread. That is the rule's intent, and it is why the hold is off until a host
turns it on.
TESTS
Counts are from the last run on Linux; on a Windows checkout review.test.mjs has the same 2
failures as main and the Linux-only checks (links, modes, groups) are skipped.
association; no directory; one round; a re-read (read, and the record not opened); dry run;
no reviewer token; at the round cap with and without a record; a round cap of 2 and of 0;
the notice compared whole up to the quoted request and read back by
isCapNotice,capNoticeRounds,capNoticeQuoteand the two patterns a caller reads a cap notice by;approvedLocallyone file at a time (another verdict, sha, version, null, a list, not JSON,empty, one byte past the size, exactly the size, a directory, a link, the flags it opens
with, a system without the flag: nothing taken and nothing opened); a hold notice counted as
a cap notice is; a window of hold notices with two heads read after it (the stated limit); a
window of nothing but copies of one notice; a notice standing at its head reused and written
with the time it was first given; the branch moved back to an approved head after two
requests and to a held head after an approval, each with and without that time;
standsFrom,verdictRecordandverdictProblem; the modelsfile and the env file settings, and a run ended by a relative path in either. On a system
without the flag the tests give it as one that asks for nothing, so the rest run there.
post.test.mjs and fix.test.mjs pass unchanged.
recordLocalApproveand its round trip throughapprovedLocally; mode 0640under a umask of 077; the record given to the directory's group; a refused group change
(injected) leaves nothing; a name another writer holds is left alone; a link put under the
other name between the write and the group and mode changes does not reach its target; the
review command against a stub model: request changes writes nothing, an approval is recorded
where the env file, the models file or the environment says, and a missing directory or a
relative path leaves the review standing.
to its end (run on Linux): the count the hold starts at, who is first-party, each condition
of the hold, each field and limit of a record, the flags it is opened with, a system without
the flag, a re-read (read, and the record not opened), the notice's sentence, the time a
reused verdict stands at, the settings from each source, and each step of writing a record
(the group and the mode on the open file, the move into place, the cleanup).
AFTER THE GATE'S FIRST TWO REVIEWS
another writer of the directory could put a link there and have a root writer change a file
of its choosing. Both are now changed on the open file. The test puts a link under the name
between the write and the changes and checks that its target keeps its group and mode.
time went wrong (a run made early and run again later; a verdict reused at its head and
written into a later run). Each fix drew another case of the same ordering, which main has
as well. By the operator's choice the count is now main's, unchanged, and the window limit
above is stated instead. The cap notice is as on main. One piece of the earlier version came
back after a read before the push: a verdict reused at a head the branch moved back to keeps
the time it was first given (
standing_since), so a reused approval or notice keeps itsplace; with the count as on main nothing else reads that time.
file is laid over the env file.