chore(web): format-gate the ungated first-party TS/JS (server/, vite.config.ts, scripts/)#1788
Conversation
Prettier only covered core/ and each client's src/, leaving the web Node
backend (clients/web/server/**), web top-level configs (vite.config.ts,
tsup.runner.config.ts, eslint.config.js, ...), and the root build/verify
tooling (scripts/**/*.mjs) ungated — so their formatting was never checked
by validate/CI. eslint already reached these via `eslint .`, so this is a
prettier-only gap.
- clients/web format/format:check now cover src, server, and top-level
*.{ts,js}, not just src.
- New root format:scripts / format:check:scripts for scripts/**/*.mjs,
folded into the root format and into validate:core.
- Normalized the newly-covered files with prettier --write (pure
formatting; no runtime change).
Closes #1778
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01XNdjEPKLG637X8YmhDiEk5
|
@claude review |
|
Claude finished @cliffhall's task in 3m 52s —— View job Review: PR #1788 — format-gate the ungated first-party TS/JS
Verdict: LGTM — approve. The wiring is correct, the reformat is provably semantics-free, and the docs match the behavior. Two follow-up observations below (neither blocking). ✅ "Pure formatting" — mechanically verifiedI didn't take this on faith. For each reformatted file I compared
✅ The gate itself is correctly wiredI ran the repo's pinned prettier ( So
🟡 1. The gap isn't fully closed — 11 first-party TS/JS files remain unformatted and ungatedThe PR title is "format-gate the ungated first-party TS/JS", but what ships covers web + These are the exact same class of file this PR just fixed for web:
This is out of the letter of #1778's scope (the issue enumerates exactly the three things this PR fixed), so it's not a change-request. But the recurring lesson from #1769/#1777 that motivated the issue — "the ungated set silently grows, and style has to be matched by hand" — applies verbatim to these 11. Worth a follow-up issue on board #28 rather than leaving the title implying completeness. 🟡 2.
|
Widen format:scripts / format:check:scripts from "scripts/**/*.mjs" to
"scripts/**/*.{mjs,js,cjs,ts}" so a future non-.mjs file under scripts/
is auto-gated, matching the future-proof glob style clients/web now uses.
A brace glob is a single pattern, so prettier does not error on the
unmatched branches. Addresses observation #2 from the PR #1788 review.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01XNdjEPKLG637X8YmhDiEk5
|
Thanks for the thorough review — especially the mechanical semantics-free verification per file. Responses to the three points: 🟡 2 — extension-narrow 🟡 1 — the gap isn't fully closed (11 remaining files): Agreed, and as you note this is outside #1778's enumerated scope, so rather than expand this PR I filed #1789 (on board #28, Todo) to cover the rest: cli/tui/launcher top-level configs, Nit — |
|
@claude review |
|
Claude finished @cliffhall's task in 3m 13s —— View job Review: PR #1788 — format-gate the ungated first-party TS/JS (round 2)
Verdict: LGTM — approve. d86d8f7 correctly addresses observation #2, and this round I upgraded the "pure formatting" check from a heuristic to a proof (below). One small doc straggler from the follow-up commit, and one small addition to suggest for #1789. Neither is blocking. ✅ "Pure formatting" — now proven, not just heuristically checkedLast round I compared whitespace-stripped/quote-normalized text. That's a good heuristic but it can't rule out a hand edit hidden inside a 511-line reformat. This round I ran the stronger check: for each reformatted file, is All six. So the diff is exactly the output of ✅ d86d8f7 — the widened glob is correct and safe
That second line is the useful one: a brace glob errors only when the whole pattern matches zero files, not per-branch. So the widened glob is safe today (9 ✅ The gate is real and greenRan the three scopes verbatim as the scripts define them, on the repo's pinned Also confirmed: no Worth noting for the record: 🟡 1.
|
d86d8f7 widened the scripts glob to {mjs,js,cjs,ts} and updated the validate:core bullet, but the format bullet at AGENTS.md:217 still said scripts/**/*.mjs. Bring it in line so the two mentions agree. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01XNdjEPKLG637X8YmhDiEk5
|
Thanks — and appreciate the upgrade from heuristic to byte-for-byte 🟡 1 — stale 🟡 2 — #1789 misses repo-root Nits (JSON/MD ungated as a consistent project choice; |
|
@claude review |
|
Claude finished @cliffhall's task in 4m 1s —— View job Review: PR #1788 — format-gate the ungated first-party TS/JS (round 3)
Verdict: LGTM — approve. Both r2 items are correctly addressed, and this round I re-ran the verification against the prettier version CI actually resolves (3.8.4) rather than the caret floor (3.8.1) the earlier rounds used. Still green. One new latent observation below, which is pre-existing and not introduced by this PR — flagging it precisely because this round's version check is what surfaced it. ✅ e7fe2b1 — the doc straggler is fixed, and there are no others
Clean. README's ✅ "Pure formatting" — proof re-run on the final treeRe-ran the strong check (
✅ New this round: verified on the locked prettier (3.8.4), not just 3.8.1Rounds 1–2 pinned Green on the version that matters. Also confirmed idempotency: running the root ✅ Glob safety and scope disjointness
🟡 Pre-existing (not this PR): the
|
|
Thanks — and appreciate the round-3 rigor: re-running the byte-for-byte proof on the three-commit tip, verifying on the locked 3.8.4 (not just the caret floor), and the idempotency check. 🟡 prettier Nits (trailing newline on That's three consecutive clean approvals with the only remaining observations pre-existing and now tracked (#1789, #1790), so I'll consider the review converged. Thanks for the thorough passes. |
…1790 #1767) (#1792) * chore: close a batch of quality-gate & tidy gaps (#1785 #1787 #1789 #1790 #1767) Bundles five small, related tidy/gate items into one PR: - #1785: delete the dead src/types/navigation.ts InspectorTab (0 importers; duplicated/drifted from utils/inspectorTabs InspectorTabId). src/types/ now holds only ambient .d.ts stubs. - #1787: add src/hooks/** to the web coverage `include` (it was silently outside the ≥90 gate) and add tests for the two untested hooks, useServerJsonImport and useImportClientConfig, bringing every hook to ≥90 on lines/statements/functions/branches. - #1789: widen clients/{cli,tui,launcher} format/format:check to their top-level configs; add root format:shared / format:check:shared covering test-servers/src/**, vitest.shared.mts, and the repo-root eslint.config.js. - #1790: pin prettier to an exact version (3.8.4, dropping the ^3.8.1 caret) in all five package.json files so the format gate's verdict can't shift with an in-range patch bump; lockfiles synced. - #1767: its root-file format+lint gap is closed here (format:shared + a new lint:shared via a second files block in the root eslint.config.js; web/server/ was already gated in #1788). Its larger cli/tui __tests__ typecheck piece (76 type errors) is split out to #1791. Prettier-normalized the newly-covered files (pure formatting). No runtime behavior change. `npm run ci` green. Closes #1785 Closes #1787 Closes #1789 Closes #1790 Closes #1767 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01XNdjEPKLG637X8YmhDiEk5 * chore: address PR #1792 review findings - #1789 gap: widen clients/web format to include .storybook and clients/ launcher format to include scripts/; reformat the 3 .storybook files (were non-conforming under the pinned prettier 3.8.4). Audited all 885 tracked source files — now fully prettier-clean. - Export VALIDATE_DEBOUNCE_MS / COLLAPSE_DELAY_MS / HIGHLIGHT_DURATION_MS from useServerJsonImport and use them in the test instead of hardcoded 300/1000/250 (so a tuned constant can't silently desync the test). - Assert the symmetric renameErrors["alpha"] alongside ["beta"] so a one-directional collision-check regression fails. - Comment the blank-rename test as exercising a UI-unreachable defensive branch (canImport gates submit). - Un-stale the two specification/v2_ux_interfaces_plan.md references to the now-removed navigation.ts InspectorTab. npm run ci green. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01XNdjEPKLG637X8YmhDiEk5 * docs: sync AGENTS.md format-surface description with the widened globs (#1792 review r2) 1ce3b64 added .storybook to clients/web's format glob and scripts/ to clients/launcher's, but AGENTS.md:222 still described the pre-fix scope. Bring it in line and note the non-recursive top-level glob is why nested dirs are named explicitly. Docs only. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01XNdjEPKLG637X8YmhDiEk5 * chore: handle PR #1792 round-3 follow-ups in-place (format-coverage guard, uniform globs, theme gate) Rather than defer these to tickets, fold them into this PR: - Obs 2: widen every client + root format glob to a uniform *.{ts,tsx,mts,cts,js,jsx,mjs,cjs} so a future .mts/.cjs/.tsx top-level file can't silently slip the gate. - Obs 1: add scripts/verify-format-coverage.mjs (wired into `validate`) — it parses the format:check globs out of every package.json, enumerates all tracked source files, and fails listing any not covered by a glob. The durable, standing version of #1789's one-shot audit; negative-tested. - Obs 3: bring src/theme/** under the coverage gate (21/23 files were already ≥90 transitively; add Paper.test.tsx for the one laggard, Paper.ts). src/App.tsx (~4.5k lines, ~42% branches) is converted from a silent omission into an explicit, documented exclusion (comment on the coverage `include` + AGENTS.md) — gating it is a dedicated effort, not a whitelist tweak. npm run ci green (the new guard reports 885/885 tracked source files gated). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01XNdjEPKLG637X8YmhDiEk5 * chore: address PR #1792 round-4 findings (guard hardening, docs, exclusion list) - Harden verify-format-coverage: only harvest format:check globs from scripts transitively reachable from `validate` (via npm run refs), so an unwired/renamed format:check no longer counts as coverage. Negative-tested — renaming clients/web format:check to an unreferenced name now fails the guard (627 files flagged) instead of passing. - Name src/main.tsx and src/index.ts (browser + bin bootstraps) alongside src/App.tsx in the coverage-include comment and AGENTS.md, so the documented exclusion list is complete rather than claiming App.tsx is the only one. - Doc sync: document verify:format-coverage (AGENTS.md + README script table + scripts/ layout line), fix the `validate` ordering (verify:format- coverage now runs before validate:core) in AGENTS.md and README, and update the quoted globs to the uniform *.{ts,tsx,mts,cts,js,jsx,mjs,cjs} / test-servers *.{ts,tsx,mts,cts}. npm run ci green. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01XNdjEPKLG637X8YmhDiEk5 * chore: address PR #1792 round-5 findings (airtight guard + doc/config sync) - verify-format-coverage: assert the root `validate` chain invokes each client's `validate` (cd <dir> && npm run validate), closing the last reachability edge — a client dropped from the root chain now fails the guard even though its own globs still exist. Negative-tested. - eslint.config.js: widen the shared `files` block to test-servers/src/**/*.{ts,tsx,mts,cts} to match the widened lint:shared glob, so a future .mts/.cts there is lint-gated, not just prettier-gated. - AGENTS.md: scope the "uniform extension set" claim to client globs (core stays {ts,tsx}, shared {ts,tsx,mts,cts}), with verify:format-coverage as the backstop — removing the self-contradiction with the line below. npm run ci green. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01XNdjEPKLG637X8YmhDiEk5 --------- Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Closes #1778
Problem
Prettier coverage had a gap:
clients/web'sformat:checkwas scoped tosrc/only, and the rootformat/validate:corecoveredcore/plus each client's own scope. Nothing prettier-checked:clients/web/server/**— the Node dev/prod backend + Vite config helpersclients/web/vite.config.tsand the other web top-level configs (tsup.runner.config.ts,eslint.config.js,vitest.shims.d.ts)scripts/**/*.mjs— the root build/verify toolingSo formatting in those files was not gated by
validate/ CI.eslintalready reached them (eslint ., plus rootlint:core), so this is specifically a prettier gap. Confirmed live:vite.config.ts,scripts/pack-and-verify.mjs, andscripts/verify-build-gate.mjsall had un-normalized formatting before this change.Changes
format/format:checknow coversrc,server, and top-level*.{ts,js}(a glob, so future top-level configs are auto-included), not justsrc.format:scripts/format:check:scripts(prettier … "scripts/**/*.mjs"), folded into the rootformatand intovalidate:core(the root-owned gate). Prettier-only — the root has no eslint config for.mjs.prettier --writeonce to normalize the newly-covered files. Pure formatting — no runtime behavior change.AGENTS.md/README.mdto describe the widened scope.Verification
npm run cipasses green locally (validate → coverage → verify:build-gate → smoke → Storybook).🤖 Generated with Claude Code