Interfere's Landmines Catches AI Coding Agents Faking Test Passes
Landmines 0.2.0 quadruples its rule set, adding Oxlint checks that catch AI coding agents mocking tests, masking flakes, and faking implementations.
Takeaways
- Landmines 0.2.0 ships, quadrupling its Oxlint rule set from the initial 10.
- Hit 300k weekly downloads on npm within a week of launch.
- Testing rules ban mocks, fixed sleeps, unsignaled polls, test retries, and raised timeouts.
- Per-file allowlists let teams adopt strict rules in legacy codebases via a ratchet.
- New style, structure, and types plugins enforce human-like code conventions for better agent output.
- MIT licensed, requires Oxlint 1.81+ and Node 22.18+.
Coding agents can satisfy CI by mocking the code under test, raising a timeout, retrying a failure, or sleeping through a race condition. The resulting green check can conceal the original integration failure, timing bug, or incorrect behavior.
Interfere’s open-source Landmines plugin targets those shortcuts. The Oxlint plugin has reached 300,000 weekly npm downloads and shipped version 0.2.0, expanding its rule set to roughly four times the initial 10. Its diagnostics identify the rejected pattern and suggest a compliant fix that an agent can apply during the same editing loop.
The Shortcuts Now Fail Lint
The testing plugin targets five common ways a test can report success without exercising the intended behavior:
no-test-doublesrejects module mocks,vi.fn(impl), stubbed globals, patched prototypes, and fake responses. It directs network simulation to Mock Service Worker (MSW), which intercepts requests at the network boundary.strict-mswrequiresonUnhandledRequest: "error"when MSW starts, turning every unmatched request into a test error and preventing accidental live traffic.no-fixed-sleepforbids awaited, fixed-duration delays in tests and hooks. Tests must await the operation or a signal tied to its completion.no-unsignaled-pollcatchesexpect.pollandvi.waitForcalls that inspect request recorders or spy state. Those calls race a deadline and can preserve timing-dependent failures.no-flake-maskingrejects test retries and raised timeouts, exposing flakes that would otherwise pass on a later attempt.
Legacy Violations Become a Ratchet
Existing repositories can adopt selected rules through a per-file allowlist with exact violation counts. Each entry records the accepted baseline for one file. A new violation exceeds the allowance and fails lint; removing a violation makes the allowance stale and requires the configured count to fall. The baseline therefore cannot rise silently.
Three rules support this migration mechanism: no-fixed-sleep, strict-msw, and no-flake-masking. This configuration permits two existing no-flake-masking violations in one legacy test file:
{
"landmines-testing/no-flake-masking": [
"error",
{ "allow": { "src/legacy/slow.test.ts": 2 } }
]
}
The Rules Move Past Tests
Version 0.2.0 adds style, repository-structure, and TypeScript rules alongside the testing checks.
The style plugin includes no-comments, which bans prose comments while preserving functional directives such as oxlint-disable and @ts-expect-error, single-line // WARNING: comments, and TSDoc for exported public APIs. The policy keeps change rationale in pull requests while retaining comments that affect tooling, document public contracts, or flag hazards.
The structure plugin enforces predictable file placement and package boundaries:
colocated-testsflags tests separated from the implementation they import. Tests must sit beside their subject or inside a localtests/directory.test-file-namesrejects names such as.spec.ts,.tests.ts,helpers.ts, andmocks.ts. It standardizes test files as.test.ts, fixtures as.fixture.ts, and shared test helpers as.test-utils.ts.package-exportsblocks unrestricted source exports such as"./*": "./src/*.ts"and requires explicit package entry points.
The types plugin currently provides no-explicit-return-types, an opinionated rule that forbids return-type annotations on implementations. TypeScript infers the implementation’s return type, while satisfies can validate a required contract without replacing that inferred type.
Built for the Agent Edit Loop
Installation adds Oxlint and the MIT-licensed plugin as development dependencies:
bun add -d oxlint @interfere/landmines
| Component | Requirement |
|---|---|
| Oxlint | 1.81 or later |
| Node.js | 22.18 or later |
| License | MIT |
Oxlint is a Rust-based JavaScript and TypeScript linter designed as a faster alternative to ESLint. Lower lint latency matters when an agent runs checks after each edit. Projects can extend the recommended Landmines configuration in .oxlintrc.json or register individual plugins and rules for a staged rollout.
The Repository Shapes the Next Edit
Author Luke Shiels frames repository conventions as a form of prompt engineering. Models learn from human-written repositories, and consistent tests, file layouts, package boundaries, comments, and types provide stronger local examples for later edits.
Landmines enforces patterns that static analysis can identify; correctness still depends on meaningful tests, type checking, integration checks, and review. Several rules expose concrete flake and network risks, while rules such as no-comments and no-explicit-return-types encode conventions that teams may evaluate separately.
Teams using Claude Code, Cursor, or Codex to open pull requests with limited review have the clearest use case. Human-written repositories can also use the testing rules to expose common flake sources. Plugin-level configuration allows projects to adopt those checks while leaving the more opinionated style and type policies disabled.