Skip to content

v3.53.0: baselines config section, strict agent gate, and 2.8x faster monorepo runs

Latest

Choose a tag to compare

@BartWaardenburg BartWaardenburg released this 03 Dec 08:45
· 78 commits to main since this release
Immutable release. Only release title and notes can be modified.
v3.53.0
b4b9ebb

Features

  • A top-level baselines config section sets the baseline file of each analysis for every command. baselines.deadCode, baselines.health and baselines.dupes hold paths relative to the project root. When you pass no baseline flag, fallow dead-code, fallow architecture, fallow health, fallow dupes, the bare fallow run, fallow audit and fallow baselines prune read the matching file. A baseline flag overrides the key for one run, and a run that saves a baseline ignores that key. The new global --no-baseline flag turns config baselines off for one run. A missing file exits with code 2 and prints the --save-baseline command that creates it. The typed API runners and the typed route of the MCP tools do not apply the section yet; the API returns FALLOW_CONFIG_BASELINE_UNSUPPORTED, and the MCP tools run the CLI instead. Older fallow versions reject the key, so set "minimumVersion": "3.53.0" with it. (#5695) Thanks @cloud-walker for the proposal.
  • The agent gate can block when it cannot run the audit. Set FALLOW_GATE_STRICT=1, or run fallow agent install --strict and commit the gate script for the whole team. The gate then blocks a git commit or push (exit 2) when it finds no fallow binary, no JSON reader or no usable audit result. The block message names the fix. In strict mode, the gate also blocks a commit in a fresh clone without an install, and the first commit of a new repository. --no-strict turns strict mode off, and FALLOW_GATE_STRICT=0 skips the audit for one session. The default stays fail open, and each fail-open notice now names FALLOW_GATE_STRICT=1. (#5611, #5613)
  • fallow audit reports facts about each complexity finding that a change cleared. A split into helpers always lowers the score of a function, so the score cannot show how a finding was cleared. The audit JSON, the review brief, the MCP audit tool and the Node audit binding now have a cleared_complexity object. It gives the cognitive total on the base and on the head, with single-use helpers read inline. It also gives the data coupling of each new helper. flat_total is true when the head total is 90% or more of the base total. coupled_helper is true when a new helper has 4 or more parameters or a coupling fact. Neither flag changes the verdict or the exit code, and the SARIF and CodeClimate output do not include them. (#5731)
  • A static survivor of fallow mutation names the test files of its export. A survived static mutant in a value export declaration now has a test_reach object. Its tests list gives the test files that reference the export, so you can see where an assertion belongs. fallow mutation tasks, fallow mutation inspect and the human output show the same files. A direct reach on a no_coverage mutant now also lists its tests; before, tests was present only for mocked-only. Read reach before you read tests. A test_reach object no longer means that the mutant is no_coverage. Read status for the status. (#5607)
  • fallow mutation marks a run that the watchdog stopped. An entry of the attempts array now has watchdog: true when the watchdog stopped that run before the runner gave a result. When the watchdog stopped a timeout mutant in each run, the human output gives a Watchdog: line. A hang or high host load can cause this, so the line tells you to run again with a lower --concurrency. The score does not change. (#5561)
  • Telemetry shows which entry point of fallow audit ran. The opt-in audit workflow event has a new audit_mode field with a fixed value, for example gate or brief. It never holds a path, a flag value or a command line. (#5698)

Changed

  • fallow audit grades clone instances in CodeClimate and GitHub annotations. The codeclimate and github-annotations formats now use the same grade as the audit SARIF output. Under introduced-clone-group: error, the new copy of a group that counts for the verdict is a major issue and an ::error annotation. The old copies, and each group that does not count, are an info issue and a ::notice annotation. Before, each clone instance was a minor issue and a ::warning annotation. A group with the rule off, and a saved audit of an older version, keep those grades. fallow report --from gives the same levels from a saved audit. GitLab Code Quality keeps each issue, because the fingerprints do not change. (#5563)
  • The refactor advice of a complexity finding names readability as the goal. The refactor-function action now asks for a function that a new reader can follow. Examples are guard clauses, a named predicate or a lookup table. Its note puts tests of the current behavior first and warns against a helper that exists only to pass the threshold. fallow explain and the GitHub annotations give the same advice. The JSON shape does not change. (#5246)
  • The test advice of a CRAP finding names the commands that find the gaps. The add-tests note and fallow explain high-crap-score now point to fallow health --coverage-gaps and fallow mutation. The increase-coverage note points to fallow mutation.

Performance

  • fallow dead-code is about 2.8 times faster on monorepos with many workspaces. Plugin detection runs beside the parse and reads the workspace config and manifest files in parallel. The analyze, entry point and import resolution stages also do less work for each workspace. On a public monorepo with 205 workspaces and 2,813 source files, a cold run fell from 1.61 s to 0.58 s (median of 9 release-build runs on Apple Silicon). The findings do not change. (#5624)
  • Follow-up monorepo work trims another ~55 ms from fallow dead-code. Fallow now reads each workspace manifest and shared tsconfig.json once per pass and shares one peer-dependency lookup cache across workspaces. It also overlaps entry-point discovery with import resolution, runs script analysis beside plugin detection, resolves root plugin configs in one parallel pool job, and stops manifest walks at visited directories. On the same 205-workspace monorepo, this cut about 55 ms of wall time, including about 37 ms in plugin detection across 20 interleaved rounds. (#5699, #5701, #5710)
  • Shared plugin glob sets cut monorepo peak heap by more than half. Workspaces with identical plugin globs now share one compiled glob set. Matched rules test only excludes instead of compiling a second include regex. On a public monorepo with 205 workspaces and 2,813 source files, regex and glob state fell from 109.3 MB to 10.2 MB (dhat). Peak heap dropped from 169.3 MB to 96.6 MB (down from 197.4 MB before #5678 and #5679 together), and peak RSS dropped from 298.3 MB to 229.6 MB (down from 328.5 MB). (#5676, #5679)
  • A run without a security rule does not keep security facts in memory. On a large public monorepo, the peak heap of fallow dead-code dropped from 204 MB to 125 MB, and peak resident memory dropped by about one fifth. A later fallow security run parses only the files whose cache entry lacks the facts. (#5675)
  • The first health run on a blobless partial clone no longer stalls in the git churn step. Fallow now fetches the missing file contents of the churn window in one batch request. On a fresh blobless clone of a public library, the churn step dropped from 102.7 s to about 1.0 s across three fresh clones, and the full run dropped from 103.0 s to 1.6 to 1.8 s. A full clone runs no extra git process. (#5623)
  • fallow mutation does not retry a surviving static mutant that ran each covering test. Its first run already ran each test of the files that load the module. When the runner dropped a covering test, the survivor keeps its retry. On a large Vitest monorepo, one such retry took 16 s of a 43 s mutation step. (#5607)

Bug fixes

Detection

  • fallow dead-code no longer reports the files that a tsc -p <project> script type-checks. Fallow reads the project argument of tsc and tsgo. The files of a type-check project in a subdirectory become entry points. A config that builds output, a config in a named package, and a project that includes a path outside its config folder add no entry points. (#5627, #5672, #5673)
  • A nested project with its own lockfile gets its framework plugins. A folder can have its own package.json and lockfile, up to two levels below the root. When no root workspace pattern declares it, the folder is now an independent project. For example, a documentation site in docs/ with its own yarn.lock no longer gives unused-file for its pages. To leave such a project out, add it to ignorePatterns. (#5625)
  • A sub-path package with its own package.json keeps its public API. A root exports target can be the main or module file of a nested package.json. When that manifest has a source field, Fallow now uses the source file as the public entry. (#5626)
  • A scoped usedClassMembers rule also matches a class through its project ancestors. { "extends": "WorkerHost", "members": ["process"] } now also matches a subclass of a project base class that extends WorkerHost. The built-in framework rules get the same match. (#5576) Thanks @PedroMartpico for the report, and @1abdala for the first fix in #5712.
  • --unused-class-members credits methods called on a new instance through a namespace import. Examples are new ns.Class().method() and const w = new ns.Class(); w.method(), also through export * barrels. (#5619) Thanks @Suneeth12 for the fix.
  • unused-class-member reports a class with a named and a default export once. A use through one name now also credits the other name. (#5618)
  • fallow dead-code no longer reports a root-absolute stylesheet link in a Vue, Svelte, Astro or HTML script block. A server serves a URL such as /custom.css at runtime. A relative href and a script src must still resolve. (#5598)
  • --trace-dependency agrees with the report on credited names in dependencies. The tooling of an active plugin and an implicit dependency such as an @types/ package now trace as "is_used": true with a tooling_credit. (#5250)
  • Fallow reads the command that nub exec, nubx and nub run start. For example, nub exec --node tsc -p types/ now gives the entry points of types/tsconfig.json. (#5628)
  • unlisted-dependencies reports a real @docusaurus/ package that a file imports. Only the client aliases of @docusaurus/core and the @theme-init/ prefix are virtual modules now. (#5683)
  • An overrides entry for coverage-gaps or a css-* rule now applies to the files that it matches. Before, the override did nothing and gave no message. When the top-level rule is off, Fallow reports an override of warn or error as override-rule-ineffective. (#5664, #5665) Thanks @michaelevans-carwow for the report of #5664.

Type-aware analysis

  • A type-aware run no longer reports a test-only-export when production code uses the export. The type-aware pass now checks test-only-export findings too, and --test-only-exports starts the pass. (#5689) Thanks @Smrtnyk for the report.
  • A type-aware --trace now credits a use that only the checker finds. The trace then gives is_used: true, and the reason says that type-aware analysis found the use. (#5690) Thanks @Smrtnyk for the report.
  • The type-aware sidecar no longer writes "context canceled" to stderr at exit. (#4325)

Security candidates

  • fallow security reports a sink that the code calls through an aliased import. import { redirect as go } from "react-router" and a call go(next) now give a react-router-open-redirect candidate. (#5597)
  • fallow security reports a server-only module that client code reaches through a re-export or an import(). A type-only re-export stays clear, and so does an import() that only a React Router loader or action runs. (#5716) Thanks @cr101 for the report.
  • A same-origin path helper with a try block or an href() fallback is no longer an open-redirect candidate. The catch block must return a fixed path or throw. (#5714) Thanks @cr101 for the report.

Mutation testing

  • A change of a JSON file that a test imports, or of the default snapshot file of the test, now invalidates the stored mutation results. Before, a run after such a change reused each stored result, also when the change made the test fail. A file that a test reads through fs, and a snapshot path from resolveSnapshotPath, snapshotResolver or toMatchFileSnapshot, are still not in the key. (#5612, #5666)
  • fallow mutation no longer runs stale code through the compile cache of @babel/register. Before, a warm cache gave each test no covered mutant, and Fallow reported the mutants as no coverage with no error. Fallow now sets BABEL_DISABLE_CACHE=1 for the mutation companion and each process that it starts. (#5549)
  • Mutation reach selection keeps the returned call of an expression-bodied arrow. A framework such as Elysia reads and awaits the call that an arrow handler returns. The reach probe no longer hides that call. (#5605) Thanks @avidianity for the patch in #5606.
  • Mutation reach selection keeps Bun and Node test setup and cleanup probes with their test file. (#5605) Thanks @avidianity for the patch in #5608.
  • Mutation reach selection keeps a test file that reaches a function only through a Node child process outside a test. (#5610)

Runs and integrations

  • fallow audit and the combined run no longer hang with one or two threads. A waiting pool worker now runs pending pool work until its helper thread finishes. (#5668) Thanks @tris203 for the report and the patch in #5670.
  • The agent gate no longer exits with the jq exit code when jq cannot read the hook input. The gate now prints a notice and exits 0. When the input can hold a git commit or push, strict mode blocks it. A failed mktemp call follows the same rules. (#5616)
  • The VS Code extension uses minimatch 11.0.9 and glob 14.0.6. These versions fix GHSA-cf2h-pxjq-68xw and GHSA-qxr8-q827-836c.
  • The help text of the version input of the GitHub Action links to a README section that exists.
  • The lockfiles use pin-project-lite 0.2.19. Version 0.2.17 was yanked from crates.io.

Upgrade notes

  • audit.deadCodeBaseline, audit.healthBaseline and audit.dupesBaseline are deprecated in favor of the baselines section. fallow audit and fallow baselines prune still read them when the matching baselines key is not set, until the next major version. When both keys name different files, Fallow uses the baselines key and prints a warning.
  • The extraction cache, the parse cache and the mutation cache formats change. The first run after the upgrade parses each file again, and the first fallow mutation run runs each mutant again.
  • Run fallow agent install again to get the new gate script.

Full Changelog: v3.52.0...v3.53.0