Repository navigation
review: a non-blocking inline budget, and the collapsed tail names its best finding #380
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 1 commit
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
b2b8724
[agent/pra7-posting-surface] review: a non-blocking inline budget, an…
jwbron fcce9d8
[agent/pra7-posting-surface] review: address #380 feedback; nits-shed…
jwbron d965e56
[agent/pra7-posting-surface] review: second-round #380 feedback; the …
jwbron 2d8c3ed
[agent/pra7-posting-surface] review: third-round #380 nits; stale rat…
jwbron 0ecdf27
[agent/pra7-posting-surface] review: fix the spend-order test's surfa…
jwbron dafcf08
[agent/pra7-posting-surface] review: escape and truncate the named-to…
jwbron File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| --- | ||
| "review": minor | ||
| --- | ||
|
|
||
| The P1 non-blocking comment budget, plus a collapsed-tail disclosure that names its best finding. Four posting-surface changes, all deterministic (no model behavior changes): at most 3 non-blocking findings post inline per review (the ROUTING `non-blocking-budget` line tunes it; blocking findings are uncapped up to the engine's 20), `nitpick (non-blocking)` never posts inline, documentation-label findings are exempt from the budget (the documentation autofix selects its work by parsing that label off posted threads, so budgeting them would silently shrink a shipped feature's scope), and the collapsed section's summary line now names its top-ranked entry instead of a bare count. The motivating case for the disclosure: three 2026-08-24 approving re-reviews on this repo collapsed correctness findings behind "Non-blocking observations (N)", including Khan/actions#367's report that the acknowledgment feature's own reply guard never fires. Nothing is dropped and the verdict still counts every validated claim; a non-default budget shows in the version footer. | ||
|
khan-actions-bot marked this conversation as resolved.
Resolved
|
||
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
111 changes: 111 additions & 0 deletions
111
workflows/review/lib/router-non-blocking-budget.test.ts
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,111 @@ | ||
| import {describe, it, expect} from "vitest"; | ||
|
|
||
| import {runCli} from "./router"; | ||
| import {parseRoutingConfig, ROUTING_CONFIG_PATH} from "./routing-config"; | ||
|
|
||
| /** | ||
| * The `non-blocking-budget <n>` directive's parse and CLI wiring, split from | ||
| * router.test.ts for its max-lines budget (the router-rereview-blocking-only | ||
| * precedent). The posting-surface behavior the number drives lives in | ||
| * submission-trial-followups.test.ts; here we pin only that the ROUTING line | ||
| * parses and that `routing.json` carries the value to the submission CLI. | ||
| * The fs fixture is a small local copy of router.test.ts's. | ||
| */ | ||
|
|
||
| const fakeFs = (inputs: Record<string, string>) => { | ||
| const written: Record<string, string> = {}; | ||
| const fs = { | ||
| readFileSync: (p: string, _enc: "utf8"): string => { | ||
| const content = inputs[p]; | ||
| if (content === undefined) { | ||
| throw new Error(`unexpected read: ${p}`); | ||
| } | ||
| return content; | ||
| }, | ||
| writeFileSync: (p: string, data: string): void => { | ||
| written[p] = data; | ||
| }, | ||
| existsSync: (p: string): boolean => | ||
| p in inputs || | ||
| Object.keys(inputs).some((key) => key.startsWith(`${p}/`)), | ||
| mkdirSync: (_p: string, _opts: {recursive: boolean}): void => {}, | ||
| readdirSync: (p: string): string[] => { | ||
| if (p in inputs) { | ||
| throw new Error(`ENOTDIR: not a directory, scandir '${p}'`); | ||
| } | ||
| const prefix = p.endsWith("/") ? p : `${p}/`; | ||
| const names = new Set<string>(); | ||
| for (const key of Object.keys(inputs)) { | ||
| if (key.startsWith(prefix)) { | ||
| names.add(key.slice(prefix.length).split("/")[0]); | ||
| } | ||
| } | ||
| return [...names]; | ||
| }, | ||
| }; | ||
| return {fs, written}; | ||
| }; | ||
|
|
||
| describe("parseRoutingConfig: non-blocking-budget directive", () => { | ||
| it("defaults to 3", () => { | ||
| expect( | ||
| parseRoutingConfig("docs/** tier=trivial").nonBlockingInlineBudget, | ||
| ).toBe(3); | ||
| }); | ||
|
|
||
| it("parses a non-negative integer, zero included", () => { | ||
| expect( | ||
| parseRoutingConfig("non-blocking-budget 5").nonBlockingInlineBudget, | ||
| ).toBe(5); | ||
| expect( | ||
| parseRoutingConfig("non-blocking-budget 0").nonBlockingInlineBudget, | ||
| ).toBe(0); | ||
| }); | ||
|
|
||
| it("warns on a malformed value and keeps the default", () => { | ||
| for (const value of ["three", "-1", "2.5"]) { | ||
| const config = parseRoutingConfig(`non-blocking-budget ${value}`); | ||
| expect(config.nonBlockingInlineBudget).toBe(3); | ||
| expect(config.warnings.join("\n")).toContain( | ||
| "non-negative integer", | ||
| ); | ||
| } | ||
| }); | ||
|
|
||
| it("skips a line with the wrong arity", () => { | ||
| const config = parseRoutingConfig("non-blocking-budget 2 4"); | ||
| expect(config.nonBlockingInlineBudget).toBe(3); | ||
| expect(config.warnings.join("\n")).toContain("exactly one number"); | ||
| }); | ||
|
|
||
| it("lets the last of duplicate lines win, with a warning", () => { | ||
| const config = parseRoutingConfig( | ||
| "non-blocking-budget 5\nnon-blocking-budget 2", | ||
| ); | ||
| expect(config.nonBlockingInlineBudget).toBe(2); | ||
| expect(config.warnings.join("\n")).toContain( | ||
| "duplicate non-blocking-budget", | ||
| ); | ||
| }); | ||
| }); | ||
|
|
||
| describe("runCli: non-blocking budget", () => { | ||
| it("surfaces the configured budget in routing.json", () => { | ||
| const {fs} = fakeFs({ | ||
| ["/tmp/gh-aw/review/files.json"]: JSON.stringify([ | ||
| {path: "a.ts", status: "modified"}, | ||
| ]), | ||
| [ROUTING_CONFIG_PATH]: "non-blocking-budget 1", | ||
| }); | ||
| expect(runCli(fs).nonBlockingInlineBudget).toBe(1); | ||
| }); | ||
|
|
||
| it("defaults to 3 without a ROUTING config", () => { | ||
| const {fs} = fakeFs({ | ||
| ["/tmp/gh-aw/review/files.json"]: JSON.stringify([ | ||
| {path: "a.ts", status: "modified"}, | ||
| ]), | ||
| }); | ||
| expect(runCli(fs).nonBlockingInlineBudget).toBe(3); | ||
| }); | ||
| }); |
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
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
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
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.