Repository navigation
fix(lint): clear the four ratchet drifts, and give pnpm lint a known-red verdict - #172
Merged
Merged
Conversation
A repo id can be published by two execution hosts, so looking a row up by bare id rewrote whichever row came first — with one id registered on two hosts, a primary-checkout relocation moved a path that belongs to one machine. relocateRepoPath now takes RepoHostTarget and resolves the row through findRepoRowForHostScopedWrite, the gate updateRepo already uses (it also reports a host mismatch instead of the silent null a deleted row returns). RelocationDependencies.setRepoPath drops its repoId argument: the plan's own row is in scope at the only call site. Clears the check:id-only-store-write-ratchet drift in #161.
A row may name its host only as executionHostId 'ssh:<target>', which a raw repo.connectionId read answers as local. The catalog gate already refused those rows a line later on the execution host, so no listing was served from the wrong machine — the raw read was the bug waiting to happen, excluded only by field order. It now goes through isRepoOnCatalogHost, the same strict gate the orcad migration paths use. The relocation plan passed the raw connectionId to getRepoDefaultBranchName, so an ssh:-only row spawned a local git against a path this machine cannot read; the plan refuses a remote row before the name is used, but the lookup was one ordering change away from naming a project folder from the wrong checkout. It now passes getRepoRoutingConnectionId(repo). Clears the check:repo-host-read-ratchet drift in #161.
Hidden hosts are the ones ~/.ssh/config keeps re-importing, so this section grows with the config and was the only host list on the screen drawn outside a window: one card per host, at any count. It now draws a bounded page through boundHostList from components/host-picker. The hook useBoundedHostRows is not used here because this section has no query of its own — SshPane's filter above already narrows the targets, and a second box inside the section would AND with it — and because a bound is only computed while the section is open. Clears the check:host-list-render-ratchet drift in #161.
check:workspace-record-read-ratchet was red behind the three drifts #161 names, so pnpm lint never reached it. Two readers now go through workspace-record-selectors.ts; the two store slices that compute a next slice stay in the baseline with their reason; the row for a deleted file is pruned.
pnpm lint is one && chain: it stops at the first failing step and reports nothing about the rest. That is how a fourth ratchet drift stayed invisible in #161 and why reds on the base branch have had to be hand-verified as pre-existing in an unrelated PR. local/gate-lint.mjs runs every step of the chain on its own, exactly as pnpm lint would, and classifies each failure against local/lint-known-red.json — the shape local/gate-unit.mjs gives the unit suite. A recorded failure is reported with its class and owner; a failure outside the list fails the gate; a recorded failure that stops reproducing is stale and prunable; and only a whole-step entry can cover a step whose output could not be split into lines. Steps are read from package.json rather than restated, so an added step runs and a removed one turns its entries stale.
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.
pnpm lintwas red onnplez1/main. This fixes the drift, and adds the piece #161 says is worthfixing regardless: a lint verdict that reports a known red instead of stopping at the first step.
Fixes #161.
What was wrong
The chain is one
&&sequence, so the first failing step hid the rest — which is why #161 lists threeratchets and there were four.
Attribution, corrected. #161 reads the three as "code this fork did not write … arrived with a
sync". Checked against
upstream/main: the ratchets and their baselines are upstream's, but everyoffending call site is this fork's own code — upstream has no
relocateRepoPath, noproject-folder-relocation.ts, no hidden-host section inSshTargetList.tsxand no cached-listing hostgate. That distinction is the one that decides fix-versus-allowlist, so it is recorded in
LOCAL-PATCHES.md: there was no upstream copy to wait for, and fixing here costs no sync.check:id-only-store-write-ratchet—relocateRepoPath(id, newPath)resolved the row withrepos.find((c) => c.id === id). A repo id can be published by two execution hosts, so aprimary-checkout relocation rewrote whichever row came first — a path that belongs to one machine.
It now takes
RepoHostTargetand resolves throughfindRepoRowForHostScopedWrite, the gateupdateRepoalready uses.RelocationDependencies.setRepoPathdrops its now-redundantrepoId.check:repo-host-read-ratchet— two rawrepo.connectionIdhost decisions. Both arehardening rather than a behaviour change and the evidence says so: the catalog gate already refused
those rows on their execution host one line later, and the relocation plan refuses a remote row
before the branch name is used. The raw read was redundant in the first case and a wasted local
gitspawn against an unreadable path in the second; both now resolve the host first(
isRepoOnCatalogHost,getRepoRoutingConnectionId).check:host-list-render-ratchet— the hidden-host section in Settings → Servers drew a cardper host, and hidden hosts are exactly the ones
~/.ssh/configkeeps re-importing. It now draws abounded page via
boundHostList, with the pane's own filter passed down as the ranking query (asecond search box inside the section would AND with it), and computes nothing while collapsed.
check:workspace-record-read-ratchet— the fourth drift, hidden behind the other three: tworenderer readers now go through
workspace-record-selectors.ts, two store slices are added to thebaseline under its existing
# store writerconvention, and the row for a deleted file is pruned.Prevention
local/gate-lint.mjs+local/lint-known-red.jsongive the lint chain the shapelocal/gate-unit.mjsgives the unit suite: the steps are read out of
package.json(never restated, so an added step runsand a removed one turns its entries stale), each is run separately in the order
pnpm lintuses, andevery failure is classified against the known-red list — recorded ones are reported with class and
owner, unrecorded ones fail the gate, and one that stops reproducing is stale and prunable. Entries can
carry a
matchregex so an entry names one offending file rather than the whole step; a step whoseoutput cannot be split into lines, or one killed by the timeout, can only be covered by a whole-step
entry.
tests/tools/lint-gate.test.mjscovers the chain reader, the failure split and theclassification.
Verification
Run from
a730bcda6f, clean tree:pnpm tcpnpm lintcheck:compat-boundary-importsnode local/gate-lint.mjsnode config/scripts/check-changed-code-quality.mjsFocused suites:
SshTargetList*(offered + 13,692-host hidden section),repo-update-host-guard,project-folder-relocation(+ integration),runtime-repository-relocation-controller,runtime-repository-relocation-host-routing(new),worktree-pr-comment-inline,jira-issue-workspace-open,execution-host,tests/tools/lint-gate(new).The full
pnpm testsuite was not run: it has a known runtime trap on this machine (see the repoAGENTS.mdandlocal/unit-known-red.json). Nothing here changes a unit-tested path beyond the fileslisted above.
Review
claude/opus), high reasoning, tool-enabled over the full diff vsnplez1/main: 0 BLOCKER, 3 SHOULD-FIX, 3 MINOR, 7 NIT. All addressed: the gate's::error file=X::parsing and
--onlystale-step handling, the false attribution above, the evidence overstatement foritem 2, dropped arguments on direct
nodesteps, the duplicate search field, a test that also passedon the old code, and the 13k re-map while collapsed.
::error file=X::signatures, so two files could collapse into one line and onematchcould coverboth — fixed, with a test each for per-file signatures, timeout handling and ranking), 1 new MINOR
(a host reachable only through its HostName still depended on input order — the pane filter is now
the ranking query, with a test), 2 NITs (wording). Commit series confirmed one topic per commit.
AGENTS.md, and what remains is what round 2asked for, verified by the tests above.
Notes
local/gate-lint.mjshas no per-revision cache, unlikelocal/gate-unit.mjs— the whole chain is~100–160 s and a cached verdict would outlive the edit it was computed against.
SshPanenow passes its filter intoSshTargetListfor ranking only; one search box, unchangedbehaviour when it is empty.