Repository navigation
Conversation
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes — flipped anti-slop/no-reflect-get to error and cleared the repo to zero unsuppressed violations across 68 files.
- Rule enablement —
config/oxlint-anti-slop.jsonnow setsanti-slop/no-reflect-gettoerror; the audit config is a leaf of the rootpnpm lintchain and includesmobile. in-narrowed property reads —Reflect.get(x, k)became'k' in x ? x.k : nullinmanaged-hook-detection-commands.ts,daemon-client-rpc-request.ts,managed-hook-installer.ts,worktree-name-retirement.ts,versioned-agent-session-wire.ts, and the e2e specs.- Named reader / accessor / bracket rewrites —
settingsFieldboxing helper inmobile/.../settings-read-operations.ts;readRecordStringreuse incodex-prompt-registry.ts; newCodexSubagentExecutions.retentionSizes()andSearchSubprocessLineAccumulator.retainedCapacityBytes(); bracket access for private class fields in tests. - Suppressions — 42
Proxyget-trap default forwards (the only construct that forwards correctreceiversemantics), plusconsistent-type-definitions/no-vardisables for the e2eWindowdeclaration-merge blocks.
I verified the author's flagged items rather than taking them on faith: every Reflect.get( under src config tests mobile is rewritten or has a suppression on the preceding line; the undefined→null swap is unobservable at each consumer (Array.isArray/typeof/== null); the typeof prop === 'string' narrowing in the useIpcEvents proxies only affects unreachable symbol keys; the two dropped-receiver traps target getter-free objects; and the mobile mutation anchor still resolves exactly once. Locally I got audit:anti-slop → 0 errors, root oxlint over all 68 changed files → 0, tc:node/tc:web → 0, and the changed tests green via pnpm test.
Note the author-documented gap stands: mobile/ tests and tsc were not executable in this worktree, so mobile CI is the real gate for those three files.
DeepSeek Flash (free via Pullfrog for OSS) | 𝕏
633f3e0 to
9860077
Compare
6cf5b99 to
b9f5906
Compare
9860077 to
885f2d0
Compare
There was a problem hiding this comment.
Important
The pinned anti-slop plugin is provisioned by postinstall, but the repo's CI install action runs pnpm install --ignore-scripts, and .github/workflows/pr.yml has no audit:anti-slop step. The pnpm lint parity test fails on this branch (reproduced locally) and adding the step alone would still fail the plugin load — so the rule this PR enables is not actually gated on PRs.
Reviewed changes — re-reviewed the delta since the prior Pullfrog review. The branch was rebased so the anti-slop machinery now matches the (stacked) base: the plugin moved from vendored source to a SHA-pinned dependency plus a generated copy step, while the no-reflect-get commit content is unchanged.
- Pinned dependency instead of vendoring —
oxlint-plugin-anti-slopis nowgithub:dmmulroy/anti-slop#c44ef22;config/scripts/sync-anti-slop-plugin.mjs, run frompostinstall, copies its source to the gitignored.anti-slop-plugin/, andconfig/oxlint-anti-slop.jsonloads../.anti-slop-plugin/index.ts. - Deslop rules dropped —
no-call-only-assertionsandno-pass-through-type-aliasare removed from the config. - Ignore plumbing retargeted —
.oxfmtrc.jsonignores.anti-slop-plugin/**, andaudit:anti-slopdrops its--ignore-patternbecause the generated directory sits outside the linted paths.
I verified the rule still loads and fires after the sync (pnpm run audit:anti-slop → 0 errors, 1 rules), and that with .anti-slop-plugin/ removed oxlint hard-fails with Failed to load JS plugin: ../.anti-slop-plugin/index.ts.
⚠️ The anti-slop gate cannot run under the repo's script-free CI install
pnpm lint now lists audit:anti-slop, and config/scripts/pr-workflow-lint-parity.test.mjs enforces that .github/workflows/pr.yml mirrors every lint step. That test fails on this branch: pr.yml has no audit:anti-slop step. Even after adding one, the command would fail to load the plugin, because the pinned source is a postinstall-generated artifact and the CI install action deliberately runs --ignore-scripts.
Technical details
# Pinned plugin is absent under the repo's script-free CI install
## Affected sites
- `package.json:166` — `audit:anti-slop` loads `../.anti-slop-plugin/index.ts`, which only exists after the sync script runs.
- `package.json:98` — `postinstall` chains `sync-anti-slop-plugin.mjs`; skipped by `--ignore-scripts`.
- `.github/actions/install-node-dependencies/action.yml:93` — `pnpm install --frozen-lockfile --ignore-scripts`, used by every `pr.yml` job.
- `.github/workflows/pr.yml` — no `audit:anti-slop` step (`pnpm exec oxlint --format github` at line 134 is the root config, which does not load anti-slop).
- `config/scripts/pr-workflow-lint-parity.test.mjs:84` — fails with `.github/workflows/pr.yml is missing lint steps: oxlint --config config/oxlint-anti-slop.json src config tests mobile --deny-warnings`.
## Required outcome
- `config/scripts/pr-workflow-lint-parity.test.mjs` passes (the missing step is added to `pr.yml`).
- The generated plugin directory exists in the job that runs the audit despite the script-free install.
## Suggested approach
Add a `pnpm run sync:anti-slop-plugin` step (or another bootstrap) before an added `pnpm run audit:anti-slop` step in the `static analysis` job.
## Open questions for the human
These files are identical on the stacked base (`nwparker/2x-lint`), which lacks the `pr.yml` step too — is the fix intended to land in #20726? Confirming the landing PR avoids a duplicate fix.DeepSeek Flash (free via Pullfrog for OSS) | 𝕏
b9f5906 to
70c8f73
Compare
885f2d0 to
6556ff1
Compare
70c8f73 to
bfad0be
Compare
There was a problem hiding this comment.
Important
The top commit is a clean rebase with the same rewrite set as before, but the stacked base (#20726) now chains sync-anti-slop-plugin.mjs onto postinstall, and that breaks config/scripts/package-electron-runtime-contract.test.mjs, which the sharded unit job in this PR's test run collects.
Reviewed changes — re-reviewed the delta since the prior Pullfrog review: the no-reflect-get commit was rebased onto an updated nwparker/2x-lint, moving the anti-slop provisioning machinery onto the base and resolving the prior CI-gating concern.
- Rebased onto the updated stack base — the plugin pin,
config/scripts/sync-anti-slop-plugin.mjs, the.gitignore/.oxfmtrc.jsonentries, thepackage.jsonscripts, and thepr.ymlstep are now base-owned and no longer part of this diff, leaving the rule flip plus the unchanged 68-file rewrite/suppression set. - Resolved the prior CI-provisioning concern in the base —
audit:anti-slopnow runs the sync itself (node config/scripts/sync-anti-slop-plugin.mjs && oxlint ...) andpr.yml:137runs it, so the gate provisions its plugin despitepnpm install --ignore-scripts. Verified locally:pnpm run audit:anti-slop→ 0 warnings, 0 errors,1 rules. - Introduced a base-side unit-test failure — chaining the sync onto
postinstallno longer matches the exact string pinned by the Electron-runtime contract test (details below).
⚠️ The base's chained postinstall fails the Electron-runtime contract test
postinstall is now node config/scripts/rebuild-native-deps.mjs && node config/scripts/sync-anti-slop-plugin.mjs, but config/scripts/package-electron-runtime-contract.test.mjs:28 asserts postinstall equals the exact pre-chain string node config/scripts/rebuild-native-deps.mjs. The test job in pr.yml calls the sharded unit-tests.yml, whose run includes config/scripts/**/*.test.mjs, so this is a red unit test on the branch this PR merges into. The chain is also redundant: audit:anti-slop is the only consumer of config/oxlint-anti-slop.json and already syncs the plugin itself, so dropping it restores the assertion without weakening the gate.
Technical details
# Chained postinstall breaks the pinned postinstall contract
## Affected sites
- `package.json:100` — `postinstall` is `node config/scripts/rebuild-native-deps.mjs && node config/scripts/sync-anti-slop-plugin.mjs`.
- `config/scripts/package-electron-runtime-contract.test.mjs:28` — `expect(packageJson.scripts.postinstall).toBe('node config/scripts/rebuild-native-deps.mjs')` fails: received `... && node config/scripts/sync-anti-slop-plugin.mjs`.
- `.github/workflows/pr.yml:622` — the `test` job calls `unit-tests.yml`, whose run collects `config/scripts/**/*.test.mjs` (`config/vitest.config.ts:34`), so this fails PR CI.
- `package.json:168` — `audit:anti-slop` already runs `sync-anti-slop-plugin.mjs` before oxlint.
## Required outcome
- `config/scripts/package-electron-runtime-contract.test.mjs` passes on the branch this PR merges into, and the anti-slop gate still provisions its generated plugin.
## Suggested approach
Remove the `sync-anti-slop-plugin.mjs` chain from `postinstall` — the only consumer, `audit:anti-slop`, self-syncs — or relax the assertion to a prefix check. `package.json` is base-owned (#20726), so the fix belongs there.
## Open questions for the human
Was chaining the sync onto `postinstall` intentional (e.g. for editor-time linting), or can it be dropped now that `audit:anti-slop` self-provisions?DeepSeek Flash (free via Pullfrog for OSS) | 𝕏
`anti-slop/no-reflect-get` rejects every call to `Reflect.get`. The
reflective read bypasses ordinary property access and throws away the
type evidence the compiler would otherwise give you: the result is
`any`/`unknown` with no narrowing, so a typo in the key or a shape drift
in the source object is invisible until runtime. The rule's remedy is to
parse dynamic input into a named domain type (or narrow it with `in`)
and then read the field normally.
Baseline: 86 violations across 67 files. Now zero unsuppressed
violations under
`npx oxlint --config config/oxlint-anti-slop.json --ignore-pattern 'config/oxlint-plugins/anti-slop/**' src config tests mobile`.
Fix pattern
-----------
44 of the 86 were rewritten. The dominant shape was an `unknown` value
read through `Reflect.get` right after a `typeof === 'object'` guard;
those became `in`-narrowed property access, which TypeScript checks:
- Reflect.get(value, 'agents')
+ 'agents' in value ? value.agents : null
Two further shapes:
- `Reflect.get(Object(x), 'k')` on a possibly-primitive envelope became a
small named reader that boxes once and indexes a
`Record<string, unknown>` (`settingsField` in
mobile/src/transport/settings-read-operations.ts).
- Tests reaching into private state moved to TypeScript's checked
bracket-index escape hatch (`runtime['layoutQueues']`), or to a
documented read-only accessor on the owning class
(`SearchSubprocessLineAccumulator.retainedCapacityBytes()`,
`CodexSubagentExecutions.retentionSizes()`).
No type assertion was added anywhere: the diff contains zero net-new
`as` casts, `as any`, `as unknown as`, `@ts-ignore`, or
`@ts-expect-error`, so nothing was laundered into the sibling
assertion rules.
Suppressions
------------
42x `// oxlint-disable-next-line anti-slop/no-reflect-get` across 38
files. Every one is the default-forward branch of a `Proxy` `get` trap:
get(target, property, receiver) {
...
return Reflect.get(target, property, receiver)
}
`Reflect.get(target, property, receiver)` is the only construct that
forwards with correct `receiver` semantics; `target[property]` invokes
an accessor with the wrong `this` and silently breaks getters that read
sibling state. There is no typed alternative, so these are suppressed
rather than rewritten.
3x `// oxlint-disable-next-line typescript-eslint/consistent-type-definitions
-- declaration merging requires interface` in
tests/e2e/github-url-smart-input-transition.spec.ts,
tests/e2e/linear-url-workspace-entry.spec.ts, and
tests/e2e/worktree-active-delete-scroll-position.spec.ts. Replacing
`Reflect.get(window, 'x')` with typed `window.x` requires a
`declare global { interface Window }` block, and `interface` is
mandatory for declaration merging. Matches the existing convention at
tests/e2e/helpers/runtime-types.ts:63.
1x `// eslint-disable-next-line no-var -- main-process gate handle for
this spec` in tests/e2e/project-group-creation-visibility.spec.ts, for
the same reason a `var` global is needed to type the handle. Matches
tests/e2e/agent-session-log-tail-stability.spec.ts:24.
Also updates two source-text anchors in mobile's rpc-recording mutation
harness (mobile/src/test-support/rpc-recording/operation-mutations.ts
and recording-runner.test.ts), which pin the exact text of the rewritten
line in settings-read-operations.ts and would otherwise fail with
"Mutant anchor matched 0 sites, expected 1".
6556ff1 to
e37b93a
Compare

Stacked on #20726 (
nwparker/2x-lint). Review only the top commit; base that PR first.Flips
anti-slop/no-reflect-getfromofftoerrorinconfig/oxlint-anti-slop.jsonand clears the repo to zero.What the rule rejects, and why it matters
Every call to
Reflect.get. The reflective read bypasses ordinary property access and throws away the type evidence the compiler would otherwise give you: the result isany/unknownwith no narrowing, so a typo in the key or a shape drift in the source object is invisible until runtime. The remedy the rule pushes you toward is to narrow (or parse) dynamic input into a real type and then read the field normally, so the key is checked.The one construct the rule cannot replace is a
Proxygettrap's default forward — see Suppressions.Violations fixed
86 at baseline across 67 files. 44 rewritten, 42 suppressed. Audit is now clean:
Fix pattern
The dominant shape was an
unknownread throughReflect.getright after atypeof === 'object'guard. Those becamein-narrowed property access, which TypeScript actually checks:Two further shapes:
Reflect.get(Object(x), 'k')on a possibly-primitive envelope became a small named reader that boxes once and indexes aRecord<string, unknown>(settingsFieldinmobile/src/transport/settings-read-operations.ts).runtime['layoutQueues']), or to a documented read-only accessor on the owning class (SearchSubprocessLineAccumulator.retainedCapacityBytes(),CodexSubagentExecutions.retentionSizes()).No type assertion was added anywhere. The diff contains zero net-new
ascasts,as any,as unknown as,@ts-ignore, or@ts-expect-error, so nothing was laundered into the sibling assertion rules to make this one go green.Suppressions
42x
// oxlint-disable-next-line anti-slop/no-reflect-getacross 38 files. Every one is the default-forward branch of aProxygettrap:Reflect.get(target, property, receiver)is the only construct that forwards with correctreceiversemantics.target[property]invokes an accessor with the wrongthisand silently breaks getters that read sibling state through the proxy. There is no typed alternative, so these are suppressed rather than rewritten. "Zero violations" here means zero unsuppressed violations.3x
// oxlint-disable-next-line typescript-eslint/consistent-type-definitions -- declaration merging requires interfaceintests/e2e/github-url-smart-input-transition.spec.ts,tests/e2e/linear-url-workspace-entry.spec.ts,tests/e2e/worktree-active-delete-scroll-position.spec.ts. ReplacingReflect.get(window, 'x')with typedwindow.xrequires adeclare global { interface Window }block, andinterfaceis mandatory for declaration merging. Matches the existing convention attests/e2e/helpers/runtime-types.ts:63. (The anti-slop audit config does not include that rule, so a clean audit hid a red main lint gate until the whole changed set was run under the main.oxlintrc.json.)1x
// eslint-disable-next-line no-var -- main-process gate handle for this specintests/e2e/project-group-creation-visibility.spec.ts, for the same typed-global reason. Matchestests/e2e/agent-session-log-tail-stability.spec.ts:24.What a reviewer should scrutinise
undefined->nullswaps.Reflect.get(x, 'k')yieldsundefinedfor a missing key; the'k' in x ? x.k : nullrewrite yieldsnull. Each site was checked against its consumer — all of them guard withArray.isArray/typeof/== null, so the swap is unobservable. Worth a second pair of eyes if you know a consumer that distinguishes the two.receiver(src/main/runtime/missing-worktree-terminal-reconciliation.ts:28,src/main/updater-test-harness.ts:150). Both target getter-free plain objects, soreceiverwas inert, but that is an invariant of the target, not of the trap.typeof prop === 'string' &&added beforeprop in namespaceinuseIpcEvents-zoom-routing.test.tsanduseIpcEvents-rate-limit-hydration.test.ts. This is a real semantic narrowing: symbol-keyed lookups now land on the fallback path. It is unreachable here (everymakeEvents()target is an{}-rooted object literal with no own symbol keys, andObject.prototypecarries noSymbol.iterator/toPrimitive/toStringTag), but it is a narrowing.CodexSubagentExecutions.retentionSizes(),SearchSubprocessLineAccumulator.retainedCapacityBytes()). Both read-only and documented, but they do widen API surface where three sibling sites in this same diff instead used bracket access. Say the word and they become bracket access too.mobile/src/test-support/rpc-recording/mutation anchors. That harness pins the exact source text of a line insettings-read-operations.tsand hard-fails withMutant anchor matched 0 sites, expected 1if the text drifts. Two anchors had to move with the rewrite: thebot-overrides-envelopeentry inoperation-mutations.tsand the synthetic-duplicate fixture inrecording-runner.test.ts.How this was verified
Ran and green:
pnpm audit:anti-slop— exit 0. Confirmed the rule is genuinely firing (not silently disabled) by planting aReflect.getprobe, seeing it reported, and removing it.oxlintunder the main.oxlintrc.jsonon all 68 changed files — exit 0. The pre-commit hook re-ranoxlint,oxlint --config config/oxlint-react-doctor.json, andoxfmt --writeover the staged set.node config/scripts/run-typecheck-projects-in-parallel.mjs— exit 0, before and after the rebase onto the corrected base.orca-runtime.test.ts, which is the entry point for the changedorca-runtime-tests/terminal-listing.spec.tshelper). 1,839 tests passed, 3 skipped, 0 failed.operation-mutations.ts: each resolves to a file that contains itsbeforetext exactly once.git diff --name-only <base> --diff-filter=Ais empty; no.js,.d.ts, or.tsbuildinfoanywhere in the diff; working tree clean.Could not verify:
mobile/is a separate pnpm workspace and its dependencies are not installed in this worktree (mobile/node_modulesis empty;vitestfails atCannot find module 'expo/tsconfig.base.json'). Somobile's tests andtsc --noEmitnever ran, and the root typecheck script does not covermobile. The three mobile files in this diff were verified by lint (oxlintundermobile/.oxlintrc), byoxfmt, and by the static anchor check above — not by execution. Mobile CI is the gate here.tests/e2e/*.spec.tsare Playwright specs and were not executed. They were typechecked and linted. Notetsc -p config/tsconfig.e2e.jsonhas 219 pre-existing errors on this branch; none are in the four spec files touched here.