Repository navigation
Conversation
|
Too many files changed for review (110 files, 100 file limit). Bypass the limit by tagging |
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes
- Rule flipped to
error—config/oxlint-anti-slop.jsonturnsanti-slop/no-shape-in-symbol-nameson; the audit is expected to stay green against the renames that follow. - Repo-wide identifier renames — 689 violations across 109 files renamed to domain roles (
assertValidGitPushTarget,isUsableSkillsCliAgentKey,GhGraphqlError,discardDeletesEntryFile,FieldEncoding, etc.), with no logic edits. - Suppressions, correctly scoped —
-next-linedisables for zod'sZodRawShape/.shape, lucide'sShapes, and the persistedshapedSidebar; the only file-wide disables are the 12 inbrowser-pane/annotate/, where "shape" is the drawn geometry. - Benchmark JSON key renames + one test fixture key — the only non-identifier output changes; verified to have no consumer.
I independently ran the boundary audit rather than trusting the PR body: I extracted all 58 unique removed *shape* tokens from the diff's removed lines and grepped the tree for each. The only survivors are ZodRawShape (zod-owned, deliberately suppressed) and _shape (coincidental match against the unrelated 'current_shape_invalid' string literal). The --shape=symlink|copy workflow flag is untouched — only the local variable changed. Benchmark output keys are read by nothing programmatic (compare-benchmark-artifacts.mjs keys on summary*/headlineMs; ci-shard-timings.json keys are file paths; no workflow invokes these scripts). Remaining shape identifiers outside annotate/ are member accesses (exempt by the rule) or explicitly suppressed, and every suppression comment sits directly above its offending line.
One environment caveat: pnpm run audit:anti-slop cannot run in this container (fails at plugin load resolving @oxlint/plugins), so the zero-violation claim is confirmed by manual enumeration rather than the linter itself. That does not change the disposition — the rename surface is exhaustively covered.
DeepSeek Flash (free via Pullfrog for OSS) | 𝕏
31e52ab to
c765a54
Compare
6cf5b99 to
b9f5906
Compare
c765a54 to
63d5be6
Compare
There was a problem hiding this comment.
Important
The rework that pins oxlint-plugin-anti-slop instead of vendoring it moved the plugin behind a postinstall-generated, gitignored .anti-slop-plugin/ dir — but nothing in CI generates it, and pr.yml has no audit:anti-slop step at all. As of c765a548f3 the lint-parity gate fails and the audit would fail to load its plugin even if the step were added.
Reviewed changes
- Plugin is now pinned, not vendored — the
config/oxlint-plugins/anti-slop/**tree is deleted in favour of theoxlint-plugin-anti-slopgit dependency pinned todmmulroy/anti-slop#c44ef22; the two deslop-only rules (no-call-only-assertions,no-pass-through-type-alias) are dropped from the config. - Generated-dir sync script —
config/scripts/sync-anti-slop-plugin.mjscopies the pinned package'ssrcinto gitignored.anti-slop-plugin/, deletes the unusedeffect/dir, and is wired intopostinstall; the audit config's jsPlugin specifier is repointed at it. - Scripts and ignores —
sync:anti-slop-pluginandaudit:anti-slopscripts,.anti-slop-plugin/in.gitignore/oxfmt ignores, and--no-error-on-unmatched-patternon thelint-stagedcommands.
I verified the pin against upstream at the pinned SHA: src/index.ts, src/rules/*, src/shared/* and the root LICENSE all exist where the sync script expects them, src/index.ts does not import effect (so deleting it is safe), and upstream's no-shape-in-symbol-names.ts is byte-identical to the previously vendored copy — the 689 renames remain valid. A planted userShape probe still fires, and after a manual sync the audit is green (0 errors over 24,762 files). The generated dir is also correctly invisible to root oxlint and to typecheck.
⚠️ CI cannot run the anti-slop audit
The audit now loads a repo-root .anti-slop-plugin/index.ts that exists only after postinstall runs the sync script, but PR CI installs with --ignore-scripts and never invokes sync:anti-slop-plugin. pr.yml also has no audit:anti-slop step, so config/scripts/pr-workflow-lint-parity.test.mjs fails on this branch today. Both need wiring before the audit can run in CI.
Technical details
# CI cannot load the pinned anti-slop plugin
## Affected sites
- `config/oxlint-anti-slop.json:7` — specifier resolves to repo-root `.anti-slop-plugin/index.ts`, produced only by `postinstall`.
- `package.json:98` — `postinstall` runs `sync-anti-slop-plugin.mjs`, but CI installs script-free.
- `.github/actions/install-node-dependencies/action.yml:93` — `pnpm install --frozen-lockfile --ignore-scripts`.
- `.github/workflows/pr.yml` — no step runs `audit:anti-slop` or `sync:anti-slop-plugin`; `.github/` has zero `anti-slop` references.
## Evidence
- `pnpm exec vitest run config/scripts/pr-workflow-lint-parity.test.mjs` fails: `pr.yml is missing lint steps: oxlint --config config/oxlint-anti-slop.json src config tests mobile --deny-warnings`.
- Simulating the CI state (dependency installed, `.anti-slop-plugin/` absent): `pnpm run audit:anti-slop` exits 1 with `Failed to load JS plugin: ../.anti-slop-plugin/index.ts` / `Cannot find module`.
- After manually running `node config/scripts/sync-anti-slop-plugin.mjs`, the same command is green (0 errors, 24,762 files).
## Required outcome
- PR CI must materialize `.anti-slop-plugin/` (e.g. run `pnpm run sync:anti-slop-plugin` before the audit step) despite the script-free install.
- Add the `audit:anti-slop` step to `pr.yml` so `pr-workflow-lint-parity.test.mjs` passes.
## Open questions for the human
- Is the `pr.yml` step (and the sync) intentionally deferred to the stacked #20726, or does it belong here? As the branch stands it is red.DeepSeek Flash (free via Pullfrog for OSS) | 𝕏
There was a problem hiding this comment.
Important
The new commit rebases this PR onto an updated nwparker/2x-lint, which now owns the anti-slop plugin wiring — and that wiring is still not connected to CI. package.json puts audit:anti-slop in the pnpm lint chain and runs sync-anti-slop-plugin.mjs from postinstall, but .github/ has no audit:anti-slop step and the composite install uses --ignore-scripts. Re-verified at 63d5be67: pr-workflow-lint-parity.test.mjs still fails, and the audit still cannot resolve .anti-slop-plugin/index.ts under the script-free install. That fix now has to land on the base branch (#20726) rather than in this PR.
Reviewed changes
- Rebased onto the updated base — the plugin pin,
sync-anti-slop-plugin.mjs,.anti-slop-plugin/ignores,package.jsonscripts, and lockfile entries are no longer part of this PR's diff; they now live onnwparker/2x-lint. - This PR is now the rule flip plus the renames —
config/oxlint-anti-slop.jsonflipsanti-slop/no-shape-in-symbol-namesfromofftoerror, with the 109-file*shape*→ domain-role rename set unchanged from the prior review.
No new reviewable surface was introduced by the rebase: the rule flip and the rename set are byte-for-byte what earlier reviews covered, and the previous threads are empty (the prior finding was posted as review body text, not an inline thread). The only outstanding item is the base-owned CI wiring above.
DeepSeek Flash (free via Pullfrog for OSS) | 𝕏
b9f5906 to
70c8f73
Compare
63d5be6 to
2d1e873
Compare
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes
- Wiring moved to the base branch — the plugin pin,
sync-anti-slop-plugin.mjs,.anti-slop-plugin/ignores,package.jsonscripts, and lockfile entries are gone from this PR's diff; they now live onnwparker/2x-lint. - This PR is now the rule flip plus the renames —
config/oxlint-anti-slop.jsonflipsanti-slop/no-shape-in-symbol-namesfromofftoerror, with the 109-file*shape*→ domain-role rename set byte-for-byte the same set earlier reviews covered.
The base-owned CI blocker from the previous review is resolved: pr.yml now runs pnpm run audit:anti-slop, and the audit:anti-slop script itself syncs the plugin before linting, so the script-free CI install no longer leaves .anti-slop-plugin/ missing. Re-verified on this head — pr-workflow-lint-parity.test.mjs passes, and pnpm run audit:anti-slop is green (0 warnings / 0 errors over 24,797 files).
DeepSeek Flash (free via Pullfrog for OSS) | 𝕏
70c8f73 to
bfad0be
Compare
Flip `anti-slop/no-shape-in-symbol-names` from "off" to "error" and clear
every violation under src, config, tests and mobile.
What the rule bans
------------------
The case-insensitive substring "shape" in any JS/TS identifier: variables,
functions, parameters, types, type parameters, class members, private names,
object-literal keys and JSX identifiers. The one exemption is a statically
accessed member read owned by another value (`zodObject.shape` is fine), so
third-party APIs stay readable without a suppression.
"Shape" names a value's structure rather than its domain role. `UserShape`,
`validateArgShape` and `errorShape` all tell you the symbol is "an object
with some fields" -- which is already what a type says -- while saying
nothing about what the value is for or who owns it. The rule forces the
name to carry the domain instead.
Violations fixed
----------------
689 violations across 109 files at baseline (verified by re-running the
audit against the pre-change tree with the rule set to "error").
Fix pattern
-----------
Rename for the domain role, not the structure:
-type FieldShape = 'list' | 'map' | 'whole'
-const FIELD_SHAPES = { ... } satisfies Record<keyof Observation, FieldShape>
+type FieldEncoding = 'list' | 'map' | 'whole'
+const FIELD_ENCODINGS = { ... } satisfies Record<keyof Observation, FieldEncoding>
-function assertGitPushTargetShape(target: unknown): void
+function assertValidGitPushTarget(target: unknown): void
-function describeReadDirPathShape(p: string): ReadDirPathKind
+function classifyReadDirPath(p: string): ReadDirPathKind
Predicates became statements about the value (`isDeltaShapedProviderFrameKind`
-> `isDeltaProviderFrameKind`, `isDeleteShapedDiscardEntry` ->
`discardDeletesEntryFile`, `isSkillsCliAgentKeyShaped` ->
`isUsableSkillsCliAgentKey`). Type aliases dropped the suffix where the
remaining name was already unambiguous (`GhGraphqlErrorShape` ->
`GhGraphqlError`).
No wire-visible name was renamed: no IPC or RPC channel, stream opcode,
request/response param, persisted field, or i18n key. The `--shape=symlink|copy`
CLI flag read by .github/workflows/skill-update-roundtrip.yml is unchanged --
only the local variable holding it was renamed.
Suppressions added
------------------
* src/renderer/src/components/browser-pane/annotate/ (12 files, file-wide):
in the screenshot annotator a "shape" is the drawn geometry -- pen, arrow,
rect, ellipse, highlight. That is a genuine domain noun, and it pervades
every symbol in the module, so file-wide scope is the honest granularity.
* repo-icon.tsx, repo-header-project-actions.tsx, mobile MobileRepoIcon.tsx:
lucide-react exports the icon component as `Shapes`. The name is theirs,
and the matching REPO_LUCIDE_ICONS key is the persisted icon name shared
with the desktop picker -- renaming it would orphan saved repo icons.
* src/shared/onboarding-state-types.ts, src/shared/constants.ts:
`shapedSidebar` is a persisted onboarding-checklist field and a telemetry
enum member; renaming it would orphan saved state.
* telemetry-event-classification.ts, rpc-send-params.ts, repo-update-params.ts,
ui-update-value-tolerance-params.ts: zod's own `shape` property and its
exported `ZodRawShape` type. In rpc-send-params.ts, matching the literal
`shape` property is what selects the ZodObject branch of the conditional type.
No suppression was added merely to avoid a rename. Eight symbols initially
suppressed as "a cross-module refactor outside this change" were proven to
have zero non-TypeScript references repo-wide and renamed instead.
Verified
--------
* Audit reports zero violations; confirmed the rule genuinely fires by
planting a probe violation.
* node config/scripts/run-typecheck-projects-in-parallel.mjs exits 0.
* 54 test files covering the changed sources: 1010 passed, 2 skipped.
* All 66 removed "shape" identifiers grepped repo-wide across every file
type; the only survivor is `ZodRawShape`, which is zod's.
* node --check on every changed .mjs; project oxlint clean on all changed
files; oxfmt is a no-op.
Not machine-verified: the 3 mobile/ files (separate pnpm workspace, its
node_modules is not installed in this worktree), and the electron-, WSL- and
Playwright-gated specs. All are rename-only hunks, read in full.
2d1e873 to
aaa1a33
Compare

Stacked on #20726 — review/merge that first. This PR's base is
nwparker/2x-lint, so the diff shown here is only the rule flip plus the fixes.What the rule rejects
anti-slop/no-shape-in-symbol-namesbans the case-insensitive substring "shape" in any JS/TS identifier: variables, functions, parameters, types, type parameters, class members, private names, object-literal keys and JSX identifiers. The single exemption is a statically accessed member read owned by another value, sozodObject.shapeneeds no suppression.Why it matters. "Shape" names a value's structure rather than its domain role.
UserShape,validateArgShape,errorShapeandFIELD_SHAPESall say "this is an object with some fields" — which is exactly what the type already says — while telling you nothing about what the value is for or who owns it. The name ends up carrying zero information, and the suffix spreads: once one type isFooShape, its validator becomesvalidateFooShapeand its predicateisFooShaped. Forcing a domain name makes the symbol describe the concept instead of restating that it has properties.Violations fixed
689 violations across 109 files, now zero. I verified the baseline count directly rather than trusting it: checked out the pre-change tree into a scratch worktree, flipped the rule to
error, and counted — exactly 689 across 109 files, which lines up with the 110 files this PR touches (109 sources + the config flip).Fix pattern
Rename for the domain role, not the structure:
Predicates became statements about the value:
isDeltaShapedProviderFrameKind→isDeltaProviderFrameKind,isDeleteShapedDiscardEntry→discardDeletesEntryFile,isSkillsCliAgentKeyShaped→isUsableSkillsCliAgentKey. Type aliases dropped the suffix where the remaining name was already unambiguous:GhGraphqlErrorShape→GhGraphqlError.No wire-visible name was renamed — no IPC or RPC channel, stream opcode, request/response param, persisted field, or i18n key. The
--shape=symlink|copyCLI flag that.github/workflows/skill-update-roundtrip.ymlpasses is unchanged; only the local variable holding it was renamed.Suppressions
Four groups, all justified inline:
browser-pane/annotate/(12 files, file-wide)repo-icon.tsx,repo-header-project-actions.tsx,mobile/MobileRepoIcon.tsxShapes— the name is theirs. The matchingREPO_LUCIDE_ICONSkey is the persisted icon name shared with the desktop picker; renaming it would orphan saved repo icons.onboarding-state-types.ts,constants.tsshapedSidebaris a persisted onboarding-checklist field and a telemetry enum member. Renaming orphans saved state.telemetry-event-classification.ts,rpc-send-params.ts,repo-update-params.ts,ui-update-value-tolerance-params.tsshapeproperty and its exportedZodRawShapetype. Inrpc-send-params.ts, matching the literalshapeproperty is what selects theZodObjectbranch of the conditional type.No suppression was added merely to avoid a rename. Eight symbols were initially suppressed with the boilerplate excuse "renaming it is a cross-module refactor outside this change." Each was proven to have zero non-TypeScript references repo-wide and renamed instead — including all three blanket file-wide disables outside
annotate/, which would have silently exempted any future violation in those files.What a reviewer should scrutinise
--shapeflag inverify-skill-update-roundtrip.mjsvs. the workflow matrix, theShapesREPO_LUCIDE_ICONSkey, andshapedSidebar.shape→topology/label/variant/inputCase/caseName/lineLayout,guestProcessShape→guestProcessChain). I found no programmatic consumer — they're reachable only viapackage.jsonbench scripts and the output is human-read — but if you know of an external dashboard parsing these, say so.discardDeletesEntryFile/deletesFilein the source-control toast path, the one rename where I also made a public option name consistent with its private helper. Positional call intoentryFailureTitlewas already correct, so there is no behavior change either way.annotate/are the right call versus per-line. I think the domain-noun argument holds there and nowhere else.How it was verified
pnpm run audit:anti-slop(the CI script). I confirmed the rule genuinely fires by planting a probe violation — it reported 3 errors and exited 1.node config/scripts/run-typecheck-projects-in-parallel.mjsexits 0, before and after the rebase, with no.js/.d.ts/.tsbuildinfoartifacts left behind.shape-containing identifiers from the diff and grepped the entire repo for each — every file type, not just TS. The only survivor isZodRawShape, which is zod's own and intentionally suppressed. Zero orphans.node --checkon every changed.mjs(not covered by tsc); projectoxlintclean on all 109 changed source files;oxfmtis a no-op.Not verified
Stated plainly rather than papered over:
mobile/files (MobileRepoIcon.tsx,golden-value-pool.ts,use-mobile-tasks-provider-view-projection.test.tsx).mobile/is a separate pnpm workspace and itsnode_modulesis not installed in this worktree, so its tsc and vitest could not run — I tried, and expo is unresolvable. They lint clean and I read all three diffs in full; they are pure renames, andgolden-value-pool.tsrenames only the type alias and const binding, not the serialized field names (sender,payloads,settlements,state,effectsare untouched), so no golden file is invalidated.browser-cookie-samesite.electron.test.ts(electron-gated),wsl-unc-delete.wsl.test.ts(real-WSL gated), andtests/e2e/terminal-cjk-ime-committed-text.spec.ts(Playwright) are unrunnable here by construction. All three are rename-only hunks read line by line. In the e2e spec only an array variable was renamed — test titles and screenshot slugs are unchanged.