Skip to content

fix(lint): clear #267's fork-comment and focus-read reds - #271

Merged
nplez1 merged 3 commits into
nplez1/mainfrom
nplez1/Gate-Lint-Issue
Nov 1, 2026
Merged

nplez1 merged 3 commits into
nplez1/mainfrom
nplez1/Gate-Lint-Issue

Conversation

@nplez1

@nplez1 nplez1 commented Nov 1, 2026

Copy link
Copy Markdown
Owner

Why

The lint gate was 42/44 on this branch, and both reds came in with #267 (bc4afd97). Both were entirely inside src/renderer/src/components/right-sidebar/**, and both reproduce at bc4afd97 and 2c6b888.

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 marked fork-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.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 count because they call the hook. Recorded as three rows 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. 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 single suppressedGitHubPR tombstone, 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 or retractStalePRRefreshError for a pick. Neither useChecksPanelContextState nor useChecksPanelEntryRefreshAndTitleActions is rendered by any test under right-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

  • R1 (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).
  • R2 — the R1..R2 delta 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.
  • NITs from round 1, all corrected in R2 rather than deferred: the line-count and baseline figures (now stated as the ratchet's 118 vs the diff's 120, and 6062→6180), the two separate reasons for omitting suppressedGitHubPR rather than sending null, and the overlay rows naming use-workspace-review-selection.ts instead of pointing at "the cache key below".
  • Rebase note. The branch was rebased onto nplez1/main @ 9f8e248 after feat(usage): track the DeepInfra credit balance in the status bar #270 landed, because the head must descend from the base. git range-diff shows 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.
  • Reviewer's own coverage note: it did not run either ratchet, and read resolveChecksPanelShownReview only through its callers.

Verification

All of the below is on the rebased head 3aad65f9:

  • Gate 1 — Unit gate @3aad65f97e (clean): PASS — 142104 passed; 2 failed, both flaky re-runs passed; 0 unexpected; 562 s. Required because the diff touches config/**.
  • Lint gate — lint gate @3aad65f97e6: PASS — 44 green, 0 failing: 0 known red, 0 new; 44 steps; 78.9 s.
  • Typecheck — pnpm tc:web clean.
  • Tests — the 10 files covering the touched hooks and components, all passing: 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).
  • Changed-code quality gate — reports nothing to check: the code change adds no source lines.
  • Full suite — the full unit suite ran as gate 1 above; the nightly fork-main-tests.yml lane and the release gate cover it beyond this PR.

…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.
@nplez1
nplez1 merged commit 01eac17 into nplez1/main Nov 1, 2026
9 checks passed
@nplez1
nplez1 deleted the nplez1/Gate-Lint-Issue branch November 1, 2026 21:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant