Repository navigation
chore(ratchet): one focus-read ratchet - #27426
Conversation
Fold the empty owner-routing baseline into the focus-read ratchet. The three deleted focus-routing helpers stay banned as a forbidden-name list.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
📝 Walkthrough
Priority: ⬇️ Low Merge Risk: ⚪ Minimal · up to This is lint tooling only, with no runtime or user-facing change. No merge-blocking risk was found. Pre-merge checks |
|
ELI5
We had two lint checks that guard against renderer code picking a host from the "Active Server" setting instead of from the resource itself. One of them had an empty allow-list and only existed to ban three helper functions that were already deleted. This folds it into the other check, so there is one check, one baseline file and one command.
What Changed
config/scripts/check-owner-routing-ratchet.mjsis renamed tocheck-focus-read-ratchet.mjs(and its test). It now runs one ratchet: the per-file count of Active Server reads inconfig/focus-setting-read-baseline.txt, which may only go down.getActiveRuntimeTarget,legacyRouteFromSettings,settingsForRuntimeOwner) stay banned as a forbidden-name list: any call or value use in the renderer fails, exactly as the empty baseline did before. The alias check (importing a reader under another name) is unchanged.config/owner-routing-baseline.txt(header only, no rows) is deleted.package.jsonscriptcheck:owner-routing-ratchetbecomescheck:focus-read-ratchet; thepr.ymlstep, the preflight step-order test and the CI shard timing key follow the rename.No user-facing change; this only touches lint tooling. Net lines: −13 production/config, −15 tests, −4 baseline (−32 total).
Why
The owner-routing half was a per-file baseline that could only ever be empty, so the baseline machinery around it (a second baseline file, a second prune pass, a
RATCHETSarray) was pure overhead. A plain ban says the same thing directly. Keeping the three names as a ban (rather than dropping them) means a reintroduced helper still fails lint even in a file whose focus-read count has room to swap one read for a helper call. A later change moves this and the other ratchets onto one shared baseline library.Linked Issue
N/A (maintainer cleanup, Phase 3.99 item 0.5)
Visual Proof
N/A — lint tooling only, no UI or runtime change.
Testing
node config/scripts/check-focus-read-ratchet.mjs→Focus-read ratchet OK — 1144 read(s).(same counts as main; baseline rows unchanged).Seeded
settingsForRuntimeOwner(1, 2)into a renderer file → the check fails with the forbidden-helper error (and the read-count growth), exit 1; reverted.pnpm test config/scripts/check-focus-read-ratchet.test.mjs config/scripts/pr-preflight-gates.test.mjspass.pnpm tc,pnpm lint(all ratchets at baseline),pnpm run check:code-quality:changedpass.rgforowner-routing-ratchet,owner-routing-baseline,countFocusRoutingCalls,RATCHETSacross the repo: no remaining references.I manually tested these changes locally
Automated tests added/updated, or explained why not below
AI Disclosure
Review
Agent skill upstream boundary
Notes
Lint tooling only: no effect on SSH, Windows, mobile or wire compatibility.
Checklist
N/Awith reasonpnpm lint,pnpm typecheck,pnpm test, andpnpm buildpass (or CI will cover; local preferred)