Skip to content

chore(ratchet): one focus-read ratchet - #27426

Merged
OrcaWin merged 1 commit into
mainfrom
OrcaWin/p399-0-5
Oct 11, 2026
Merged

OrcaWin merged 1 commit into
mainfrom
OrcaWin/p399-0-5

Conversation

@OrcaWin

@OrcaWin OrcaWin commented Oct 11, 2026 •

Copy link
Copy Markdown
Collaborator
Files Added Deleted Net
Test 2 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​10 $\color{#cf222e}{\Huge{\mathbf{−}}}$​25 $\color{#cf222e}{\Huge{\mathbf{−}}}$​15
Prod 6 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​76 $\color{#cf222e}{\Huge{\mathbf{−}}}$​93 $\color{#cf222e}{\Huge{\mathbf{−}}}$​17

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.mjs is renamed to check-focus-read-ratchet.mjs (and its test). It now runs one ratchet: the per-file count of Active Server reads in config/focus-setting-read-baseline.txt, which may only go down.
  • The three deleted helpers (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.json script check:owner-routing-ratchet becomes check:focus-read-ratchet; the pr.yml step, 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 RATCHETS array) 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.mjs pass.

  • pnpm tc, pnpm lint (all ratchets at baseline), pnpm run check:code-quality:changed pass.

  • rg for owner-routing-ratchet, owner-routing-baseline, countFocusRoutingCalls, RATCHETS across 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

  • Not applicable, or this change copies or mechanically translates no upstream skill-installer source, tests, fixtures, registry entries, path tables, comments, or documentation.

Notes

Lint tooling only: no effect on SSH, Windows, mobile or wire compatibility.

Checklist

  • This PR is small and focused
  • I explained what changed and why (ELI5, the user-facing before/after, the mechanism, and why over the alternatives)
  • Before/after screenshots or videos attached for UI changes, or N/A with reason
  • Self-reviewed for correctness, security, and performance
  • Cross-platform, SSH/remote, and path/shortcut impact considered (or N/A)
  • pnpm lint, pnpm typecheck, pnpm test, and pnpm build pass (or CI will cover; local preferred)

Fold the empty owner-routing baseline into the focus-read ratchet. The three
deleted focus-routing helpers stay banned as a forbidden-name list.
@coderabbitai

coderabbitai Bot commented Oct 11, 2026

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 381f54da-879f-4698-bd63-f80480665c9b

📥 Commits

Reviewing files that changed from the base of the PR and between 3727780 and 520e359.


📒 Files selected for processing (8)
  • .github/workflows/pr.yml
  • config/focus-setting-read-baseline.txt
  • config/owner-routing-baseline.txt
  • config/scripts/check-focus-read-ratchet.mjs
  • config/scripts/check-focus-read-ratchet.test.mjs
  • config/scripts/ci-shard-timings.json
  • config/scripts/pr-preflight-gates.test.mjs
  • package.json

💤 Files with no reviewable changes (1)
  • config/owner-routing-baseline.txt

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 1 remain after this review.



📝 Walkthrough

Walkthrough

The pull request consolidates the owner-routing and focus-setting read checks into one focus-read ratchet. The ratchet checks read counts against a single baseline and rejects uses of specified routing helpers. The lint command and static-analysis preflight now run this check. Related baseline instructions, tests, and CI timing entries are updated.


Priority: ⬇️ Low

Merge Risk: ⚪ Minimal · up to 520e3

This is lint tooling only, with no runtime or user-facing change. No merge-blocking risk was found.

Pre-merge checks | Passed 4 | Failed 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 30.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 10 functions across 3 files. (4 skipped: … Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check Passed The title clearly and concisely describes the main change: consolidating the ratchets into one focus-read ratchet.
Description check Passed The description follows the required template and explains the change, rationale, testing, scope, and checklist status. The maintainer-specific issue exception is addressed with a cleanup reference, a…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.

Full details: Docstring Coverage

Explanation

Docstring coverage is 30.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 10 functions across 3 files. (4 skipped: 4 unsupported.)


  • Fix all pre-merge checks with AI
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Commit to this branch
  • Create a new PR

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@OrcaWin
OrcaWin merged commit 34d7884 into main Oct 11, 2026
36 checks passed
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