Skip to content

v3.52.0: test-run facts for mutation, stale duplication suppressions and a config-gated LSP

Latest

Choose a tag to compare

@BartWaardenburg BartWaardenburg released this 01 Dec 15:48
· 90 commits to main since this release
Immutable release. Only release title and notes can be modified.
v3.52.0
45a4d53

Features

  • With Vitest, fallow mutation can take its dry-run facts from the test step of the project. A CI job no longer has to run the tests of a change two times. To set it up, follow these steps:

    1. Add fallow to the devDependencies.
    2. Add plugins: [fallowMutation()] from fallow/vitest to the Vitest config.
    3. Run the test step as fallow mutation test-run <scope flags> -- <test command>.
    4. Run fallow mutation with the same scope in the same CI job.

    The mutation run uses the facts of each test file whose dry-run key is equal, and dry-runs the other files. A file with a failed or retried test falls back. A test run with an option that changes the facts gives no facts, for example isolate: false, a test name filter or --shard. A test step with coverage on gives no facts unless you set fallowMutation({ coverage: true }). The wrapper always exits with the exit code of the test command.

    The new cache.test_run object of the JSON report gives the used files and the reason of each fallback. We measured a public monorepo with about 8,000 unit tests in November 2026, in a container with 4 cores. In two measurements, the dry run of the mutation step fell from 77 s to 2 s and from 146 s to 5 s. Each mutant kept the same status. (#5535)

  • The test step also gives the facts of a run with reach selection. fallow mutation test-run now records the reach probes of each test file when --reach-selection is on or check. The first run of a pull request then needs no full dry run. A test file gets no record when it cannot prove that it has each of its probes, or when it has a skipped or todo test. The next dry run keeps such a file. (#5556)

  • The GitHub Action and the GitLab template can run the test command with the test-run facts. Set the mutation-test-command input of the Action, or the FALLOW_MUTATION_TEST_COMMAND variable of the template, for example to npx vitest run. The Vitest config must load fallowMutation() from fallow/vitest. The job then runs the tests one time. A failed command fails the job with its exit code. The Action job summary and the template job log show a Test run: line. (#5555)

  • fallow mutation caps the test time of one mutant. A mutant with thousands of covering tests could cost minutes when it survived. --mutant-time-cap (config key mutation.mutantTimeCap, default 3m, off turns it off) caps the test time of one mutant. A kill inside the cap is killed. A capped mutant with no kill is pending with pending_reason: "mutant-time-cap", never survived.

    The JSON report gives the cap in time_cap_ms. summary.mutant_time_capped counts these mutants. The run completion is partial. A --kill-matrix run has no default cap. The cap compares the measured test time, so a mutant gets the same status in each run of the same change. The mutants with the lowest estimated test time now run first, also without --time-budget. (#5501, #5538)

  • fallow mutation --retry-scope covering makes the confirmation of survivors cheaper. The default retry runs each passing test of the test files of a survivor. That retry can cost many times the first run. With --retry-scope covering (config key mutation.retryScope), a survivor runs again with the tests of its first run only. The report marks such a survivor with retry_scope: "covering", because it is weaker evidence. The default stays file.

    The new timings.retry_wide_worker_ms field gives the time of the wide retries, summed over the workers. It is not a wall time, so it can be larger than retry_ms. (#5488)

  • The fallow mutation report names why it kept a test file, and which mutants got no retry. The kept_by list of cache.reach_selection names the changed item that kept each test file. The human report of --reach-selection on says why the run left out no test file. A survived or timeout mutant that got no retry before the time budget ended has unretried: true. runner.worker_modes.checks gives the number and time of the worker checks. (#5524, #5533, #5542, #5526)

  • fallow dupes reports a code-duplication suppression that hides no clone as stale. Before, such a marker stayed after the duplicated code changed, and it could then hide a new copy without notice. Now fallow dupes, the bare fallow run and fallow audit list it in stale_suppressions, with the severity of the stale-suppressions rule. At error, or with --fail-on-issues, the dupes command and the bare run fail. (#5406) Thanks @neumaennl for the report.

  • fallow audit marks the new copy of an introduced clone group. In the JSON output, each instance of an introduced clone group has added, and each audit clone group has effective_severity. A tool that reads the JSON can now point a finding at the new copy, not at the old copy that comes first in path order. The GitHub Action audit summary now points each clone row at the new copy. (#5016) Thanks @cr101 for the report.

  • The language server can run only in projects with a Fallow config file. Set the requireConfigFile initialization option to true. The server then publishes no diagnostics while the workspace has no config file that the CLI finds and no configPath. A new config file starts the diagnostics, and a removed config file clears them. In Zed, set lsp.fallow.initialization_options.requireConfigFile. The option is off by default. (#3036) Thanks @cloud-walker for the report.

  • A server-only-import candidate names the imported server-only module. fallow security --format json now sets candidate.sink.callee to the specifier, for example "node:fs", "server-only" or "next/headers". The evidence text names the same specifier. (#5586) Thanks @cr101 for the report.

  • fallow security reports open redirects for react-router-dom and Remix 3 imports. When the project declares react-router-dom, the react-router-open-redirect category also matches redirect, redirectDocument and replace from it. The new remix-open-redirect category (CWE-601) reports a non-literal target of redirect and createRedirectResponse from remix/response/redirect or @remix-run/response/redirect. That category is active when the project declares remix or @remix-run/response. (#5594) Thanks @cr101 for the report and the reproduction.

Changed

  • fallow mutation uses each core of a small CI runner by default. Without --concurrency or mutation.concurrency, a run starts one runner process for each usable core up to 4 cores. Above 4 cores it keeps half the cores, with a minimum of 4. The CPU and memory limits of the container cap the count. Without a memory limit, the physical memory caps it. On a 4-core, 16 GB Linux runner, the dry run of a pull request in a large monorepo took 84 s instead of 158 s. The human output shows a new Workers: line. (#5529)
  • The dry run and the mutant phase of fallow mutation take less time.
    • The dry run companions take test files in batches from one queue, so no companion waits for another with slow files. (#5503)
    • The Vitest companions share their module transforms through a cache in the run directory. (#5503)
    • A mutant first runs up to 3 tests that killed other mutants of the same function. On a project with 40 slow test files, one such mutant went from 22 seconds to 2 seconds. With more than one killing test, killed_by can name another test than before, and with more than one worker it can differ between two runs. (#5500)
    • fallow mutation skips a worker check that costs more time than it can save. On a project with 40 slow test files, the mutant phase took 41% less time. (#5526)
    • --time-budget runs the cheapest retries first. (#5488)
    • --reach-selection keeps fewer test files for a changed export, for a type-only runner config import, and for code that holds a module object. The dry-run cache format goes to version 7. (#5502, #5524)
  • fallow audit --format sarif grades clone results by the introduced-clone-group rule. Before, each clone instance result had the level warning. Now a group that counts for the audit verdict takes the level of the rule, and a group that does not count takes note. Under the new-only gate, the new copy takes the rule level and the old copies take note. Each result lists the other copies in relatedLocations. Locations and fingerprints do not change, so code scanning keeps each alert. Under introduced-clone-group: error, the code scanning check of a pull request can now fail on a new copy. fallow dupes --format sarif does not change.
  • fallow audit keeps its base snapshots in a private directory on Unix. The snapshots are now in fallow-audit-snapshots-<uid> inside the temp dir, with mode 0700. Fallow refuses that path when it is a link, is not a directory, belongs to another user, or gives access to other users. The audit then prints a warning and exits with code 2. Module resolution and project discovery in a snapshot stop at the snapshot root.
  • A walk inside a repository applies no .ignore file from above the repository top level. Git treats .gitignore the same way. A root inside a nested repository no longer gets the .ignore files of the outer repository.
  • A named export of vite.config.* needs an importer in a project that lists only vite-plus. Vite and Vite+ read only the default export of the config. Remove such an export, or import it from the module that needs it. (#5565)
  • Entry point discovery reads the commands of package scripts with about 13% fewer instructions. The entry points stay the same. (#5493)

Bug fixes

Detection

  • fallow dead-code reports the unused exports of a helper below __tests__/ when Vitest defines inline projects. Inline test.projects now replace the static entry patterns, as a root test.include does. (#5554) Thanks @neumaennl for the report.
  • fallow dead-code no longer reports the setup file or the test files of a Vitest project behind a spread in test.projects. Fallow now reads a spread of an array literal in a config array, also in a conditional spread. (#5566)
  • A local in a class static block or in a switch case no longer hides a namespace import after that scope. A later read such as e.usedError() now counts, so usedError is no longer an unused export. (#5317)
  • unresolved-import no longer reports a root-absolute stylesheet link that no file holds. An example is <link rel="stylesheet" href="/custom.css"> in a SvelteKit src/app.html, where a server route serves the URL. A relative stylesheet href and a module script src must still resolve. (#5395)
  • A dependency finding points at the entry in its own package.json section. Before, a package that was also in, for example, peerDependencies or overrides could get the line of that other entry. (#5450) Thanks @aloneangel45 for the patch in #5459.
  • fallow dupes tokenizes the type annotation of a variable declaration. let value: Alpha<One>; and let value: Beta<Two>; no longer give the same tokens. The duplication token cache is rebuilt once. (#5435) Thanks @aloneangel45 for the patch in #5485.
  • A fallow-ignore-next-line stale-suppression comment now hides the stale suppression below it. Each stale-suppression finding offers this comment as its suppress-line action, and before it had no effect. (#5580)
  • fallow audit --base keeps an old Tailwind arbitrary value inherited when another file also uses it. The audit base snapshot cache is rebuilt once. (#5537) Thanks @aloneangel45 for the first fix in #5546, and @kanpai-coder for the report.

Type-aware analysis

  • --type-aware keeps the type-aware pass for a class that implements two framework lifecycle interfaces. The companion now relates a lifecycle hook only to the interface that declares it, so Fallow no longer rejects the answer. (#5552) Thanks @PedroMartpico for the report and the first patch.
  • --type-aware keeps a class member that a library calls, also when only a test file calls it. An example is process of a WorkerHost subclass from @nestjs/bullmq under --production. Such a member is now contract-preserved. (#5567) Thanks @PedroMartpico for the report.
  • fallow health --type-coupling no longer reports complete evidence when no public API entry point resolves. Each such project adds a no-api-entry-point omission, so the report is partial and --type-aware-require complete fails. The coupling summary has a new api_entry_point_count field. The companion protocol is now version 12. If you installed the companion with fallow type-aware setup, run that command again. (#5506) Thanks @Smrtnyk for the report.
  • The JSON output of a type-aware fallow run with health now has the type-aware data of health. The data is at _meta.health.type_aware. With --type-aware-require complete, an --only health run now fails on an incomplete coupling query, as fallow health does. (#5585) Thanks @PedroMartpico for the report.
  • The type-aware config hash no longer times out or fails on shared tsconfig extends and references entries. A very large config graph gets a new hash once. When a run then reports an incompatible analysis identity, save the type-aware baseline again.

Security candidates

  • A redirect to a path that a same-origin check validated is no longer an open-redirect candidate. Fallow accepts a new URL(value, origin) check that rejects another origin and a // path, inline or in a local helper. (#5541) Thanks @cr101 for the report.
  • A type-only import of a server-only module no longer gives a server-only-import candidate. This covers import type and an inline import { type Stats }. (#5588)

Mutation testing

  • fallow mutation --runner-project no longer reports the test files of the other Vitest projects as undiscovered. (#5507) Thanks @Smrtnyk for the report.
  • fallow mutation with bun test or node:test runs the test files in the order of the request. The file that kills a mutant can now run before a slow file whose name sorts first. (#5315) Thanks @yamatakeru for the report.
  • fallow mutation gives fewer timeout statuses that come from host load. (#5528)
  • A worker check of fallow mutation no longer runs past the time budget. A shared Vitest worker now runs the test file order that its check proved. (#5542)
  • fallow mutation --reach-selection keeps a test file that can read a changed export through this. Before, the selection could leave out such a file and give a false survivor. (#5524)
  • fallow mutation --reach-selection on keeps a test file when a new or removed export can clash between two export * statements. (#5530)
  • fallow mutation no longer writes its results into the journal of another run. (#5515)
  • fallow mutation --resume no longer runs a mutant again that no target killed in the target-first mode.
  • An edit of the root package.json that no test run reads keeps the mutation result cache and the dry-run cache. The cache key now holds only the fields that a test run can read, so an edit of scripts, keywords or license keeps the stored results. The CI cache key of the GitHub Action and the GitLab template no longer holds package.json. The first run after the update stores new results. (#5581)

Output and CI

  • fallow coverage upload-inventory sends churn only for the files of the inventory. On a large repository, the extra entries pushed the request over the 25 MiB limit, and the upload failed with HTTP 413. (#5522) Thanks @chbert for the report.
  • fallow fix applies the scope flags. --workspace, --changed-workspaces, --changed-since, the package baselines and diff input now narrow the fixes, not only the report. An unknown workspace exits with code 2. This also applies to the workspace parameter of the MCP fix_preview and fix_apply tools, and to the Action with command: fix.
  • fallow fix skips a file with a bare CR line ending. The file gets skip_reason: "mixed_line_endings", and the run exits with code 2.
  • fallow fix --type-aware removes more unused class methods.
  • fallow audit no longer compares against a wrong base commit when another audit holds the base snapshot.
  • fallow audit no longer reuses a base snapshot that a cache removal left half deleted.
  • The LSP server no longer queues one analysis per save behind a long run. (#5512)
  • The LSP server no longer shows old diagnostics on a file that was closed, opened again and edited during a run. (#5513)
  • fallow watch runs again after the kernel drops file events, and when a nested .gitignore or .git/info/exclude changes. It also no longer follows directory links when it sets up the watch.
  • fallow telemetry status no longer reports a mixed state while another process changes the setting. (#5508)
  • Two MCP servers no longer ask for telemetry consent at the same time, and an event is no longer sent twice. (#5514)
  • A baseline save no longer leaves a partial file.
  • Ctrl-C during fallow fix no longer leaves temp files in the project.

Hardening

These fixes stop a file in a cloned repository, or another local user, from making Fallow read or write outside the project or run too long:

  • A small source file with repeated or nested references no longer makes a run use all memory or run without end. The extraction and duplication cache versions change, so the first run after an upgrade parses all files again.
  • A long comparison chain or nested lists in JSX text, a template or a script block no longer make the parse use gigabytes of memory. A file past the budget gets the source-nesting-too-deep diagnostic. The parse cache and the duplication token cache are rebuilt once.
  • A dense group of circular imports no longer makes the cycle check run for minutes. The check stops after 500,000 imports per group and marks the group as capped.
  • A V8 coverage source map that points past its script no longer slows fallow health.
  • A cloud answer with more than 48 million JSON values now gives a clear error.
  • A code_execute snippet of the MCP server now always ends near its timeout_ms. The MCP server also ends the CLI process tree of each call that it drops.
  • Fallow no longer follows a shell helper path, a tsconfig reference, a lockfile or a pnpm-workspace.yaml that leaves the project.
  • fallow agent install keeps a normal indent in an MCP config file with a very wide indent.
  • The audit cache reads its .sha and .last-used files only when the user owns them.
  • The commit gate of fallow hooks install follows cd steps the way the shell does.

Upgrade notes

  • The type-aware companion protocol is now version 12. If you installed the companion with fallow type-aware setup, run that command again.
  • fallow mutation caps the test time of one mutant at 3m by default. A mutant over the cap with no kill is pending, not survived. Set --mutant-time-cap off to keep the old result.
  • A stale code-duplication suppression is now a finding. At error, or with --fail-on-issues, fallow dupes and the bare run fail on it.
  • Under introduced-clone-group: error, fallow audit --format sarif gives the new copy of a clone group the level error.
  • fallow fix exits with code 2 when it skips a file with a bare CR line ending.
  • The extraction, parse and duplication caches, the dry-run cache and the cache of fallow audit base snapshots are rebuilt once.

Full Changelog: v3.51.0...v3.52.0