Repository navigation
fix(lint): clear #267's fork-comment and focus-read reds - #271
Merged
Merged
Conversation
…s reads The lint gate was 42/44 on this branch, both reds from #267 and both entirely inside src/renderer/src/components/right-sidebar/**: - check-upstream-file-comments: 6180 against a 6051 baseline. #267 added 118 comment lines across 12 files upstream owns. All 118 are removed rather than marked `fork-comment-ok`: each was prose above upstream's code explaining a fork decision, and the fork's own modules (workspace-review-selection.ts, use-workspace-review-selection.ts, WorkspaceReviewSwitcher.tsx) already state the same design without a hunk to resolve on every sync. Total is back to exactly 6051 with 0 stale entries, so no re-baseline was needed. - check:focus-read-ratchet: three files at 1 read each. They are one transitive read, not three routing decisions: use-workspace-review-selection.ts builds its hosted-review cache key through getWorkspaceReferenceRuntimeVersion, which folds getProviderRuntimeContextKey(null) in — null is this app, not the focused host — and it reuses the sidebar card's key on purpose so a switch does not overwrite the branch's entry. The two panes then count because they call the hook. Recorded in config/focus-setting-read-baseline.fork.txt with the reason, the same shape as the 2026-10-16 use-linked-issue-pane-actions.ts row, rather than restructuring reviewed code to dodge a regex. The invariants those comments guarded (display-only pick, the one suppressedGitHubPR tombstone, row-not-slot unlink, renderable rows, the store as the refresh switch test, no branch argument for a picked review) now live in LOCAL-PATCHES.md § local(lint), next to #266's marker note. Verified: check-upstream-file-comments and check:focus-read-ratchet green; tc:web clean; the 9 test files covering the touched hooks and components pass.
Round 1 of the gate-2 review (Opus 5.5, high) returned BLOCKING against the ledger entry, not the code: the deletion and the overlay rows were clean, but the entry stated one invariant wrongly and left two recorded nowhere. - The pick is display-only in Source Control only. In the Checks pane it is operational: HostedReviewActions gets the shown review and a mutation's refresh goes to the pick first. Scoped the bullet and stated the other half. - Added the two invariants that lost their only guard: the shown-review switch effect (fires on a change rather than on mount, clears the previous review's rows, raises loading flags only for a pick) and the pick-first tab-entry and post-mutation refresh. Neither hook is rendered by any test under right-sidebar/**, which is why the ledger has to carry them. - Corrected the refresh bullet's reason: refreshRequestKeyRef is per-request, so a switch never changes it and isCurrentRequest cannot see one — it is the result key that cannot tell a switch from this review's own head moving. Added the two test-pinned clauses (re-check the pick after the await and before claiming asyncResultKeyRef; compare pickedRequestKey as a local because isCurrentAsyncResult reads the ref). - Added "a pick's read must not retractStalePRRefreshError", pinned at use-checks-panel-polling.test.tsx. - Fixed the figures: the ratchet counts 118 of the deleted lines (the diff deletes 120; two are JSX comment continuation lines the line rule skips), and the baseline measured 6062 at #267's parent, not 6051 — #268's 11 were already in the tree and #266 removed them afterwards, which is the 6169 this branch carried. - The two overlay rows named the cache key by position; they name use-workspace-review-selection.ts instead, so a prune or reorder cannot break the pointer. Both ratchets still green (6051/6051, 0 stale; 664 focus reads). No code changed, so the unit-gate verdict for e88b0f0 still stands and the review is not voided by this commit (LOCAL-PATCHES.md only).
Round 2 (the R1..R2 delta re-check, Opus 5.5 high) resolved all seven round-1 findings and reported two MINOR wording errors in the bullet R2 added. Both are one-hunk text fixes, so they are fixed here rather than listed in the PR body: - The bullet title said the switch effect and the tab-entry refresh "are a pick's only re-reads". They are not: the switch effect reads nothing (it clears rows and sets flags), and a manual refresh and polling both read a pick. The title now names what the bullet actually guards, which is that neither hook is rendered by a test. - The mount-guard reason was wrong. In an ordinary single-review workspace shownReviewKey is '' and the unguarded effect would clear rows that are already empty and raise no flags. The guard earns its place on a remount where the pick's cache entry is already warm: showsPickedReview resolves true on the first render, so the unguarded effect would clear rows and raise loading flags with no switch and no read in flight, and setChecksLoading/setCommentsLoading are otherwise written only by a manual refresh, so nothing would clear them. Both ratchets still green. LOCAL-PATCHES.md only: no code changed, so the unit gate verdict for e88b0f0 still stands for that revision, and this commit does not void the review. No third review round: AGENTS.md requires the user's approval for one, and these are the reviewer's own suggested fixes.
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Why
The lint gate was 42/44 on this branch, and both reds came in with #267 (
bc4afd97). Both were entirely insidesrc/renderer/src/components/right-sidebar/**, and both reproduce atbc4afd97and2c6b888.The two reds
check-upstream-file-comments— 6180 against a 6051 baseline. #267 added fork comments to 12 files upstream owns. All of them are removed rather than markedfork-comment-ok: every one was prose above upstream's code explaining a fork decision, and the fork's own modules (workspace-review-selection.ts,use-workspace-review-selection.ts,WorkspaceReviewSwitcher.tsx) state the same design without a hunk to resolve on every sync. The ratchet counts 118 of those lines (the diff deletes 120; two are JSX comment continuation lines its line rule skips). It measured 6062 at #267's parent, not 6051 — #268's 11 were already in the tree and #266 removed them afterwards, which is the 6169 this branch carried. The total is back to exactly 6051/6051 with 0 stale entries: no--prune, no--accept, no re-baseline.check:focus-read-ratchet— three files at 1 read, baseline 0. One transitive read, not three routing decisions:use-workspace-review-selection.tsbuilds its hosted-review cache key throughgetWorkspaceReferenceRuntimeVersion, which foldsgetProviderRuntimeContextKey(null)in —nullis this app, not the focused host — and it reuses the sidebar card's key on purpose so a switch does not overwrite the branch's entry. The two panes count because they call the hook. Recorded as three rows inconfig/focus-setting-read-baseline.fork.txtwith the reason, the same shape as the 2026-10-16use-linked-issue-pane-actions.tsrow, rather than restructuring reviewed code to dodge a regex.getProviderRuntimeContextKey(null)never reads the setting; it is counted because its definition's body does.Where the invariants went
The comments guarded real traps, so they live in
LOCAL-PATCHES.md§local(lint)instead of above upstream's code: display-only pick in Source Control but operational in Checks, the singlesuppressedGitHubPRtombstone, row-not-slot unlink, renderable rows, the shown-review switch effect, the pick-first tab-entry and post-mutation refresh, the store as a refresh's switch test, and no branch argument orretractStalePRRefreshErrorfor a pick. NeitheruseChecksPanelContextStatenoruseChecksPanelEntryRefreshAndTitleActionsis rendered by any test underright-sidebar/**, which is why the ledger has to carry them.Review
Reviewed by Opus 5.5, high: R1 (2 blocking fixed), R2 delta no blocking, 2 MINOR fixed
d6b27879) —BLOCKING, all of it in the ledger entry, none in the code. Two SHOULD-FIX: the "pick is display-only" bullet was true of Source Control only, and two invariants (the shown-review switch effect, the pick-first tab-entry and post-mutation refresh) had lost their only guard. Fixed in R2 (624c5aa1).R1..R2delta re-check: all seven round-1 findings RESOLVED, plus two MINOR wording errors in the bullet R2 added (a title claiming the hooks were "a pick's only re-reads", and a mount-guard reason that only holds on a remount with a warm pick cache). Both fixed in R3 (3aad65f9). No third round was run: AGENTS.md requires the user's approval for one, and these are the reviewer's own suggested fixes.suppressedGitHubPRrather than sendingnull, and the overlay rows naminguse-workspace-review-selection.tsinstead of pointing at "the cache key below".nplez1/main@9f8e248after feat(usage): track the DeepInfra credit balance in the status bar #270 landed, because the head must descend from the base.git range-diffshows all three patches byte-identical (=), and feat(usage): track the DeepInfra credit balance in the status bar #270 touches none of this diff, so the review stands for the rebased revisions.resolveChecksPanelShownReviewonly through its callers.Verification
All of the below is on the rebased head
3aad65f9:Unit gate @3aad65f97e (clean): PASS — 142104 passed; 2 failed, both flaky re-runs passed; 0 unexpected; 562 s. Required because the diff touchesconfig/**.lint gate @3aad65f97e6: PASS — 44 green, 0 failing: 0 known red, 0 new; 44 steps; 78.9 s.pnpm tc:webclean.use-checks-panel-manual-refresh(6),use-checks-panel-polling(23),use-checks-panel-check-and-review-actions(14),use-workspace-review-selection(7),WorkspaceReviewSwitcher(4),source-control-header-toolbar-identity(10),review-header(1),panel-content-rendering(5),shown-review(6),workspace-review-selection(16).fork-main-tests.ymllane and the release gate cover it beyond this PR.