Skip to content

perf(ci): linux/mac eslint baseline drift causes recurring PR friction #1287

@joelteply

Description

@joelteply

Problem

Recurring CI friction: PRs pass Mac local pre-push but fail Linux CI on ts-eslint-baseline-ratchet because the platform baselines drift independently and the Mac pre-push hook only verifies the active platform's baseline.

Recent occurrences

The pattern: any PR that touches a TS file in a way that changes the lint count fixes the Mac baseline locally (precommit catches it) but ships with a stale Linux baseline. CI surfaces the issue 80+ seconds into the GH Actions run, then the dev has to push another commit, wait again, etc.

Why the platforms differ

The Linux CI parser fails on parserOptions.project for several files (e.g. workers/continuum-core/bindings/test-{ffi,ipc,voice-loop}.ts, workspace/interpretability-pipeline/init.ts). These appear as "errors" in the count but only on Linux because of differences in how @typescript-eslint/parser resolves project paths there.

Two fix shapes:

Option A — Make pre-push verify BOTH baselines

scripts/ratchets/check-eslint-baseline.sh runs once per platform via PLATFORM_BASELINE_FILE. Add a second pass that also reads the OTHER platform's baseline (in addition to the active one) and warns if the delta from the active platform's count would also break that baseline. Doesn't catch cases where the actual lint count differs between platforms (the parserOptions.project issue), but catches the common case where a deletion is applied to one baseline but not the other.

Option B — Fix the platform skew

Add the missing files to the relevant tsconfig.json include arrays so parserOptions.project resolves them on Linux too. Then the actual count should match across platforms and a single baseline file is enough. Requires per-file investigation but unblocks Option A naturally because the platforms stop drifting.

Option C — Auto-mirror in precommit

When precommit verifies the Mac baseline, also update the Linux baseline to the same value (since the structural -delta is symmetric across platforms). Skip when files in src/eslint-baseline.linux.txt's "Linux only" set are touched. Lower-friction but adds magic.

Recommendation

Start with Option B (fix the underlying parser-options issue) since it's the root cause. If after that the platforms still drift, reach for Option A as the safety net.

Acceptance

  • After the fix, no PR should require a follow-up commit to ratchet a platform baseline that the local pre-push didn't catch.
  • Document any remaining platform-specific lint behavior in the baseline-files' headers.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions