Skip to content

fix(gates): give review-gate the same report rows the guard and the queue read - #2875

Open
HugoXK wants to merge 1 commit into
ThinkFlowLab:mainfrom
HugoXK:dev/5-review-gate-rows
Open

HugoXK wants to merge 1 commit into
ThinkFlowLab:mainfrom
HugoXK:dev/5-review-gate-rows

Conversation

@HugoXK

@HugoXK HugoXK commented Nov 11, 2026 •

Copy link
Copy Markdown
Contributor

Fixes #2870

Owner: Dev-5
Reviewer: Birfy
Written-by: Dev-5
Bot: FlyBot Dev-5
Claim-Id: 9b6bdf22f96041bb8c08334b5d1f7310
Tier: T3 (.github/scripts/enqueue-rules.mjs, .github/scripts/review-gate.mjs, .github/scripts/review-gate.test.mjs — all in policy/gates.json)
Base: d3fccee
Pushed head: 1c107ec
Tree: cf5f17bb3073e71331985a7b6edeeb8a38865c0c
Verified at: 1c107ec (TZ=UTC npm run verify in a worktree at this commit)

What was wrong

The reports rows were built in three places. #2092 added the diff-line comment
face and #2120 kept the review's state and the empty-body review — both only in
enqueue-guard.mjs and merge-gate.mjs. The copy in review-gate.mjs kept the
older shape, so one decision got two answers: this report could say PASS at a tip
while the queue gate held the same tip for a standing request. The gate is
report-only (continue-on-error), so nothing merged around it; the defect is that
two readers of one decision disagreed, and the drift was invisible without a diff.

What changed

  • reportsFrom({ comments, reviews, reviewComments }) is exported from
    review-gate.mjs and builds one shape for all three faces: id on every row,
    the review's state, an empty-body review kept (A review asking for changes stops nothing: the review state is dropped and an empty body matches no stop #2119 — "Request changes" is
    the one refusal a person writes without typing), kind: 'review-comment' for a
    comment written on one line of the diff (Read a stop request written on a review comment line #2091), and no url field the other
    two readers do not carry.
  • decide() receives only the two faces a Verifier block is written in
    (reports.filter(isConclusionSource)); adminsFor() still reads every row,
    because a login is a login wherever it wrote.
  • isConclusionSource moved to review-gate.mjs and enqueue-rules.mjs
    re-exports it (export { isConclusionSource }): one definition, no import
    cycle (enqueue-rules.mjs already imports parseReport from this file), and
    merge-gate.mjs keeps its import from enqueue-rules.mjs.

A line comment is a request, never a conclusion: a Verifier block is written in
an issue comment or a review body, whose first line is the Verdict: header; a
comment attached to a diff line has no such header, can be outdated by a later
push, and reading it as a conclusion would add a second way to record a PASS.
stopRequestAt() still reads all three faces, so a request written on a line is
a stop for the queue.

Red first, then green

  1. New tests against the base review-gate.mjs: SyntaxError: The requested module './review-gate.mjs' does not provide an export named 'isConclusionSource'; # tests 1 / # pass 0 / # fail 1, twice. Normalised
    output (durations, worktree paths and hex addresses masked) sha256
    c6bed35fdcd23cb9646b9f7601ab0530ec047742136fc9052152acddb2619219.

  2. The fixed builder mutated back to the base shape (no id, no state, empty
    reviews dropped, no review-comment rows):

    not ok 69 - #2870: a review with no body still arrives as a row, with its id and state
    not ok 70 - #2870: the same rows answer the queue gate's stop request for a review that asked for changes
    not ok 71 - #2870: an APPROVED review with no body keeps its row and changes no conclusion
    not ok 72 - #2870: a comment written on one line of the diff arrives as the third face
    not ok 73 - #2870: a Verdict written in a line comment is not a conclusion
    

    # tests 73 / # pass 68 / # fail 5, twice. Normalised sha256
    36b683868647b1aca92cadd3e9972b79ac80dfc830e713736645790a4ada01ff.

  3. Builder restored: # tests 73 / # pass 73 / # fail 0; neighbours enqueue-guard
    155/155, merge-gate 52/52, review-verdict 11/11. The branch carries no
    throwaway edit.

Verify

TZ=UTC npm run verify at this tip, with the host-local .cache worktrees set
aside for the run (#749) and restored afterwards: core lint 0 errors, plugin lint
0 errors, 10 patches apply cleanly, core/ equals ds-bot/ + patches/ds-bot/,
canonical no-op; suites 3245 / 672 / 149 / 172 / 535 / 147 / 683 / 37 / 34, 0
fail; arch-docs: OK (3 changed file(s)) with ARCH_DOCS_BASE=d3fccee8.

Not run: the smoke test (no change under core/index.js or core/src/host/).
Not run: the CI package job's pack check, typecheck and actionlint (not part of npm run verify).

No changelog fragment: gate plumbing, nothing a user sees.

This T3 gate change still needs a Policy-sign from someone other than the author.

Where the old head went

This is the same change re-cut and amended, not a different job. The earlier head
60ca9e9cb19e3ad3c1f00cd6b138c1df8c0352d3 (commit date 2026-11-13T00:59:57Z, base
965d17f5, same title) touched the same three files, +112/−12: enqueue-rules.mjs
+5/−4, review-gate.mjs +40/−7, review-gate.test.mjs +67/−1. It was rebuilt on the
live base d3fccee8 and pushed as 1c107ec55ac32d4f97247850821bf725293a9b53 at
2026-11-14T05:23:04Z (commit date 2026-11-14T05:22:53Z), +119/−12; the seven
extra added lines are in review-gate.test.mjs, 67 → 74.

It was cut again for the review's one objection: only one allowed way to write the
predicate. isConclusionSource is defined once, at review-gate.mjs:134 beside
reportsFrom(), and enqueue-rules.mjs re-exports that definition; merge-gate.mjs
did not change a line.

Nothing of the old head lives anywhere else and no other pull request absorbed it:
the only pull request that names #2870 is this one, no branch head on either
repository points at 60ca9e9c (the branch dev/5-review-gate-rows heads
1c107ec5), and it never landed on main. It is no longer a head — GitHub still serves
the loose object by sha, and 1c107ec5 is the only head that counts.

{
"pr": 2875,
"claim": "Dev-5",
"issue": 2870,
"summary": "review-gate built its reports rows in a third copy that had drifted from the guard and the queue gate: no id, no review state, dropped empty-body reviews, no diff-line comment face, an extra url. reportsFrom now builds one shape for all three faces, and the conclusion readers skip the review-comment kind through one predicate that lives in review-gate.mjs and is re-exported by enqueue-rules.mjs. A CHANGES_REQUESTED review with an empty body is now a stop request in the report as it already was in the queue. The three row builders stay separate on purpose; collapsing them is its own change.",
"files": [
".github/scripts/enqueue-rules.mjs",
".github/scripts/review-gate.mjs",
".github/scripts/review-gate.test.mjs"
],
"checks": {
"ran": "TZ=UTC npm run verify at this tip (3245/672/149/172/535/147/683/37/34, 0 fail); node --test review-gate/enqueue-guard/merge-gate/review-verdict (73/155/52/11, 0 fail); ARCH_DOCS_BASE=d3fccee8 node core/scripts/check-arch-docs.mjs",
"result": "green",
"at": "1c107ec55ac32d4f97247850821bf725293a9b53"
},
"next": "T3: needs a PASS at this tip and a human Policy-sign; the three-builder merge is a separate issue (B)."
}

@HugoXK

HugoXK commented Nov 11, 2026

Copy link
Copy Markdown
Contributor Author

@Birfy review request — tip 763e15078270c128dd5302f76a932c2eecf91e15. T3 (three gate files), so this asks for the Verdict at this tip; one request for this tip only.

  • 15 checks at that tip: 11 success + 1 skipped / 3 failure. The three reds are the T3 verdict gate (enqueue-guard: "no Verifier report names the tip 763e15078270"), policy-sign (gate files changed, no signature yet) and tests-ok (collateral — the aggregate job reads SIGN=failure; test is skipped behind it, plugins and package are success).
  • Signing note, so this does not cost a round trip: a signature only has to be a comment written by a non-author type: User account whose text names this tip. A verdict that names the tip is exactly that shape — fix(gate): a review asking for changes stops the queue entry #2120 was signed by the Reviewer's own PASS comment (Policy-sign: 6603688549). Once a verdict names this tip I put Policy-sign: <that comment id> in the body and ask for a full re-run of this run, because a body edit alone does not re-trigger pull_request; then policy-sign and tests-ok go green without moving the tip, so the verdict stays valid.
  • maintainer_can_modify: true; base 0b77addc077c3604e3fd16e2309a25721f3a9ed8; branch dev/5-review-gate-rows; 3 files +112/−12.
  • What changed: review-gate.mjs built its reports rows in a third copy of a shape enqueue-guard.mjs and merge-gate.mjs were already fixed in (Read a stop request written on a review comment line #2092, fix(gate): a review asking for changes stops the queue entry #2120) — no id, no review state, empty-body reviews filtered out, and no inline-comment face. The three faces are now built once, the inline comments arrive as kind: 'review-comment', and conclusions still come only from isConclusionSource.

@github-actions github-actions Bot added the risk:T3 Risk tier T3 (needs a human approval), set by the controller from the diff label Nov 11, 2026
@HugoXK
HugoXK force-pushed the dev/5-review-gate-rows branch from 763e150 to 60ca9e9 Compare November 13, 2026 00:59
@HugoXK

HugoXK commented Nov 13, 2026

Copy link
Copy Markdown
Contributor Author

@Birfy review request — tip 60ca9e9cb19e3ad3c1f00cd6b138c1df8c0352d3.

T3 (three gate files: .github/scripts/review-gate.mjs, .github/scripts/enqueue-rules.mjs, .github/scripts/review-gate.test.mjs), so this asks for a Verdict: PASS that names that 40-character tip.

The tip is the same change rebased onto live main 965d17f5; the earlier request (comment 6794443347) named 763e150707, which is superseded — do not spend a verdict on it.

A second thing rides on the same tip: this PR changes gate files, so policy-sign wants a Policy-sign: line in the body, and policy-sign.mjs accepts only a comment written by someone other than the author that names the tip it signs (12 hex characters or more). Please leave one comment on this PR naming 60ca9e9c… — a Verdict: PASS comment naming the tip serves both purposes, and the body will then carry Policy-sign: <that comment id>.

State at this tip (read, not asserted): enqueue-guard is red only for "no Verifier report names the tip 60ca9e9", policy-sign red only for the missing signature line; the rest of the checks are running. The body is being updated to this base/tip; no further commits will be pushed here.

…ueue read

`.github/scripts/review-gate.mjs` built its `reports` rows in a third copy that
had drifted from `enqueue-guard.mjs` and `merge-gate.mjs`: the review row
carried no `id` (the handle a decision names), no `state` (`stopRequestAt` reads
CHANGES_REQUESTED from it — the whole of a refusal a person writes without
typing), a review whose body was empty was dropped, and a comment written on one
line of the diff never reached the report at all. So this report could say PASS
while the queue gate refused the same tip for a standing request.

`reportsFrom` now builds all three faces once, and the conclusion readers skip
`kind: 'review-comment'` through the one predicate `isConclusionSource`, which
moves to `review-gate.mjs` (the module that owns what a conclusion is) and is
re-exported by `enqueue-rules.mjs`, so both readers keep one definition and no
import cycle is introduced. The three row builders are deliberately left in
three places; merging them is a separate change.
@HugoXK
HugoXK force-pushed the dev/5-review-gate-rows branch from 60ca9e9 to 1c107ec Compare November 14, 2026 05:22
@HugoXK

HugoXK commented Nov 14, 2026

Copy link
Copy Markdown
Contributor Author

@Birfy review request — tip 1c107ec55ac32d4f97247850821bf725293a9b53 (T3)

Fixes #2870. What changed at this tip: review-gate.mjs built its own copy of the reports rows, and that copy had drifted from the queue side — no id, no review state, an empty-body review dropped, no diff-line comment face, an extra url. One decision therefore got two answers. reportsFrom() is now exported from review-gate.mjs and builds one shape for all three faces; isConclusionSource has a single definition there, enqueue-rules.mjs re-exports it, merge-gate.mjs is unchanged. Five tests in review-gate.test.mjs fail on the old builder (73 / 68 pass / 5 fail) and pass here (73 / 73).

Gate state at this exact tip: policy-sign is red because this PR touches gate files and its body carries no Policy-sign: line yet — that red skips the test job, so tests-ok shows a false red. enqueue-guard is red because it still needs a Verdict naming this tip. Every other check is green.

Local at this tip: TZ=UTC npm run verify exit 0 (3245 / 672 / 149 / 172 / 535 / 147 / 683 / 37 / 34, 0 fail, arch-docs: OK (3 changed file(s))); gate suites review-gate 73/73, enqueue-guard 155/155, merge-gate 52/52, review-verdict 11/11.

A T3 Verdict: PASS naming 1c107ec55ac32d4f97247850821bf725293a9b53 is what the queue needs next. The Policy-sign: line has to come from a non-author account after that.

This is the only review request on this tip.

@HugoXK

HugoXK commented Nov 16, 2026

Copy link
Copy Markdown
Contributor Author

Signature gap — tip 1c107ec55ac32d4f97247850821bf725293a9b53

policy-sign is red on this tip because the PR body needs one line: Policy-sign: <comment id>.

  • the cited id must be a comment on this PR written by a real GitHub User account,
  • that account must not be the author (HugoXK) and must not be a Bot,
  • the comment must name this tip (1c107ec55ac3).

On file right now: none. Comments from our side cannot serve as the signature.
Nothing else is missing from us; the branch stays at this tip.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

risk:T3 Risk tier T3 (needs a human approval), set by the controller from the diff

Projects

None yet

Development

Successfully merging this pull request may close these issues.

gate: review-gate's report rows drop a review's state, id and an empty body

1 participant