Repository navigation
v3.43.0: constant-parameter rule, fallow audit --staged, and mutation replay
Features
- The new opt-in rule
constant-parameterreports a parameter that each call passes in one way. The finding gives the reasonidentical-argumentwhen each visible call passes the same value. It givesnever-passedwhen no call passes an optional parameter. For a destructured options parameter such as{ retries = 3, signal },option_keynames each key that no call sets, or that each call sets to the same value. Turn the rule on withfallow dead-code --constant-parametersorrules.constant-parameters. The default isoff, and the rule has no automatic fix. The rule reports only when it sees each caller. It skips public API and entry-point exports, dynamic imports, CommonJS and functions with fewer than 2 calls. With--type-aware, the rule also reports the reasonunused-defaultand reads the methods of exported classes. These findings haveevidence: "type-aware". (#4491, #4516) fallow audit --stagedaudits the staged index, not the working tree. The changed files are the staged changes against HEAD, and the analysis reads each file from the index. Unstaged edits and untracked files do not change the result of the audit. When Git gives the hook another index file (git commit -a,git commit <path>), the audit reads that index.--stageddoes not take--baseor--changed-since.fallow mutation inspect <id> --replaycalls the mutated function on the original code and on the mutant. Pass the arguments with--args '[2, 3]'. The replay calls the export three times on each side and shows the results side by side. A difference that each call repeats is awitness. A test with this input can kill the mutant. Equal results areno_witness_found, neverequivalent. The Vitest andnode:testrunners replay, and the JSON output adds thereplayobject.fallow mutation --record-args valuesrecords the arguments of the changed exported functions.--replaywithout--argsthen replays up to 3 recorded inputs and stops at the first witness. Recording is off by default and runs after the mutant runs, so it never changes a result. The inputs stay in the gitignored cache directory for 7 days. Fallow does not keep an input with a secret.--record-args shapeskeeps only the argument types.fallow mutation tasksgives a ready test input for a survivor. After a--record-args valuesrun,fallow mutation tasksreplays the recorded inputs of up to 20 open tasks. A task then gets awitnesswith the result of the current code, the result of the changed code and the--replaycommand. A test with that input that asserts the current result kills the mutant. The MCP toolmutation_tasksgives the same field.- The new opt-in mutation operator
nullish-fallbackremoves the fallback ofa ?? b. Name it in--operatorsormutation.operators. A survivor shows that no test gives a nullish left operand. With--typecheck, a survivor gets the hinttype-non-nullishwhen the declared type ofaexcludesnullandundefined. Anegate-conditionsurvivor can now also getequivalence_hint: "constant-parameter"when the condition is a parameterp,!por!!p, and each visible call passes the same literal forp. The status stayssurvived, and the score does not change. (#4502) - The focus map of the review brief ranks changed files also by churn, complexity growth, test reach and surviving mutants. The
scoreof a focus unit can have the new componentschurn,worsened,test_reachandmutation. The newfallow audit --mutation-report <file>flag reads a savedfallow mutation --format jsonreport for themutationcomponent. These components can changetotal, the label and the rank order of a unit.triage.risk_classdoes not change. (#4505) - The agent task matrix and the
fallowskill now namefallow mutation. The matrix has the row "improve or check the tests of a change" withfallow mutation --plan --base <ref>. The row is infallow --help,fallow schema, thefallow://task-matrixMCP resource and theAGENTS.mdblock offallow init --agentsandfallow hooks install --target agent. The skill has a short workflow for the tests of a change. fallow architecture --shared-statelists direct writes through imported values and custom global read and write sites. The observations have human, JSON and Markdown output. They are not in the finding totals and gates. They make no claim about runtime identity or execution order.health.tailwindIgnorePatternsexcludes intentional Tailwind arbitrary values. Each regular expression matches a normalizedprefix-[value]token, so-mt-[7px]andmt-[7px]both match asmt-[7px]. Fallow removes matching classes from the token-drift findings and analytics, also in CVA variants. The default excludes nothing. Thanks @DrJKL for the patch in #4421.fallow securitysays whenclient-server-leakchecked nothing. The rule starts only from files with a top-level"use client"directive. When no such file exists, the run records theclient-server-leak-no-client-rootsworkspace diagnostic. The human output prints a blind-spot line, and MCP adds awarningssentence. Thanks @cr101 for the report. (#4430)- A stored security verdict now survives an edit that moves the sink to another line. Each
fallow securityfinding has a newstable_finding_idof the formsec1:<16 hex digits>. Whitespace, comments, line breaks and an edit above the sink do not change it.fallow security survivorsaccepts this id orfinding_idin a verdict. The location-basedfinding_idand the SARIF fingerprint do not change. A sink in Vue, Svelte or Angular template markup has nostable_finding_id. Thanks @cr101 for the report. (#4429) fallow auditprints a note when it compared no changed file. The note goes to stderr, also under--quiet. The GitHub Action prints the same fact as a::warning::, and the GitLab template as aWARNING:line. The usual cause is a push to the default branch. The warning names the base ref and tells how to give a base. The job result does not change.
Changed
npm install fallowno longer installs the type-aware companion and TypeScript 7. The install is about 30 MB smaller on every platform. Default analysis does not use the companion. If you use--type-aware, read the upgrade notes.npm install fallowon Linux installs one platform binary, not two. The Linux platform packages now declarelibc, so npm, pnpm, Yarn Berry and Bun install only the glibc or the musl package. The install is 56 to 59 MB smaller on linux-arm64 and 65 to 71 MB smaller on linux-x64. Yarn 1 does not readlibcand still installs both.- The
@fallow-cliplatform packages no longer contain the similar-code companion. Each platform package is 7 to 12.5 MB smaller. The release archives on GitHub keep the companion next to the CLI binaries. - The install hint for a missing companion uses the package manager of the project. The hint shows
pnpm add -D,yarn add -Dorbun add -dfor a project that uses pnpm, Yarn or Bun. At the root of a Yarn 1 workspace project, Fallow adds-Wto its suggested Yarn commands. The-Wflag also goes into thefallow doctorfix commands and the sidecar install offallow coverage setup. (#4519) - The MCP server refuses a response over 1,000,000 bytes. The refusal body has a new
narrowarray with the parameter names that make the output smaller, for exampleissue_types,fileandworkspaceonanalyze. On a large public monorepo, an unfilteredanalyzereturned 5.6 MB andfind_dupesreturned 9.2 MB. Both now get a valid refusal withcode: FALLOW_MCP_SUBPROCESS_OUTPUT_LIMIT. - The generated pre-commit hook runs
fallow audit --staged.fallow hooks install --target git,fallow init --hooksand the Lefthook hint now audit the commit that Git is about to make. Before, an untracked file could block a clean commit. Before the first commit of a repository, the hook skips the audit and prints one line on stderr. fallow audit --gate new-onlyreports the unused files and unused exports that a change creates outside the changed files. A change can remove the last import of a file, or a config change can remove an entry point. The audit now marks such a findingintroduced: trueand counts it inattribution.dead_code_introduced. A finding that the base also reports stays out of the report. When the change touches the config file, the audit runs one more dead-code pass on the base commit, with the config of the base commit.fallow mutation --kill-matrix-forgivesbaseline-failureonly to the targets that the failure can affect. Before, one broken test anywhere in the suite made every targetincomplete. A target can now becompletein a run with baseline failures. The top-levelstatus,reasonsandcompletiondo not change. The human report names the baseline failures of each target. (#4469)- The
fail-on-issuescount of the GitHub Action andFALLOW_FAIL_ON_ISSUESof the GitLab template follow rule severity for dead code. Ondead-code,check,architectureand the dead-code part of the combined run, onlyerrorfindings fail the job. This is the same rule as the CLI exit code. Before, awarnfinding also failed the job while the comment and the CLI said that the run passed. See the upgrade notes for older fallow versions. - The human
fallow healthoutput says when CRAP scores are a static estimate. Without a coverage file, one note above the complexity findings tells you to pass--coverage <coverage-final.json>for measured scores, or to raisehealth.maxCrap. The--file-scoresfooter and the--coveragehelp use the same terms. The CRAP formula and the JSON output do not change. --type-awaredoes less checker work. The symbol scan keeps only the aliases that can lead to a checked target. The semantic pass skips files belownode_modulesand declaration files by their name. On a large public repository, the scan uses about 30% less CPU, and a request transfers 4,006 files instead of 10,130. The results do not change.
Bug fixes
fallow mutationruns more test suites without a false baseline failure.- A Vitest test that uses a
test.extendfixture no longer fails withFixtureParseError. Thanks @andrius-kr for the report. (#4423) - The dry run gives each test three times the test timeout of the project, so a test that is close to its timeout no longer becomes a baseline failure. (#4409)
- A test that runs a source function in another realm, such as a
node:vmcontext, no longer fails withReferenceError. Thanks @cr101 for the report. (#4438) - With Vitest, code that reads
import.meta.envnow sees avi.stubEnvvalue. (#4470)
- A Vitest test that uses a
fallow mutationhandles more run shapes correctly.--kill-matrix-forno longer stops the run for one target that selects no test. That target gets the statusincompleteand the reasonunmatched-target. Thanks @cr101 for the report. (#4439)- Build-tool code that no test can reach gets the prune reason
framework-configorbuild-tool-only, so it no longer lowers the coverage. (#4471) --recheckwithout--mutantnow keeps the earlier results withcarried: trueand replaces the--reportfile. (#4477)--planandfallow doctorreport an unsupported Vitest version before a run starts. Doctor has a newmutation-runnercheck. (#4465)
fallow dead-codecredits more packages, members and files.- A package that the inline tool config of a workspace
package.jsonnames, such as"prettier": "@acme/config-prettier". Thanks @stanlrt for the report and the patch in #4527. (#4530) - A package that a stylesheet
url()names, for example a font package in an@font-facerule. Thanks @stanlrt for the patch in #4528. - The modules that a Stylelint config names in
extends,pluginsandcustomSyntax, in every config form. Thanks @stanlrt for the patch in #4526. - The shared config packages that
extendsinbiome.jsonorbiome.jsoncnames. - A binary that a script runs through its
node_modules/.binpath, for example./node_modules/.bin/<name>. - The packages that agent hook commands in
.claude/settings.jsonand.codex/hooks.jsonrun. - A class member that code reads through
Pick,Omit,Partial,Required,ReadonlyorNonNullableof the class. - A Durable Object method that a Worker calls through an RPC stub.
- A hand-written declaration file such as
lib.d.mts, through an import of its JS sibling./lib.mjs. - The pattern branch of a conditional
import()source.
- A package that the inline tool config of a workspace
fallow dead-codereports fewer false unused files and dependencies.- The arguments of
cp,mvand other file utilities in package scripts no longer become entry points. (#4455) - A quoted
jqfilter in a CIrunstep no longer becomes an entry pattern. Thanks @rezamuliawijaya for the patch in #4418 and @deniskern for the report. (#4380) - A
vite.config.*file in a workspace package is an entry point when only the root manifest listsviteorvite-plus. - A dependency that only a framework or build config file imports, such as
astro.config.mjs, is no longer test-only. - An alias import of a gitignored generated path, such as
@/.next/types/routes, is no longer unresolved. - A Nuxt
#layers/<name>/import resolves to the named local layer first. It resolves to the project root when the rootnuxt.configsets$meta.name. A missing target through a named layer alias now reports as an unresolved import.
- The arguments of
- A
fallow-ignore-next-lineorfallow-ignore-filemarker in a JSDoc comment now takes effect. A block comment accepts a marker at the start of any of its lines. A next-line marker applies to the line after the closing*/. This applies to every analysis and to Vue, Svelte, Astro, MDX, HTML and CSS files. - The Git hook and the agent gate find a working fallow. The hook now looks in
PATH, then./node_modules/.bin/fallow, thenyarn exec fallow, thennpx --no-install fallow. Before, the hook accepted every commit with no message whenPATHhad nofallow. Both now use an install only when--versionprints a fallow version. When a launcher exists but no install works, both block the commit and name the launcher. When no install exists, the hook still accepts the commit and printsfallow-hook: fallow not found (...), skipping the pre-commit audit.on stderr. --type-awaregives more correct results. A read no longer confirms a setter as used, and a write no longer confirms a getter. A strict-mode name error under// @ts-ignoreor// @ts-expect-errorno longer blocks the type evidence of the whole program.fallow securitygives fewer false findings and clearer errors.- A
spawnorspawnSynccall that runs no shell now uses theexecFilegate. A program path from a file of the repository or from an environment variable is now clean. --gate newno longer says that it reports on the whole project when it cannot resolve--changed-since. The run prints only the gate error and exits 2. Thanks @cr101 for the report. (#4431)
- A
fallow auditreports fewer false introduced findings. Askip-onlyweakened test no longer appears for a skip marker that the base already had. A one-line edit in one copy of a clone splits the clone group into smaller groups. Such a group is now inherited when each instance lies inside a different instance of one base clone group.- Each run of a multi-analysis SARIF document has its own category. Before, GitHub code scanning rejected the upload, because the dead-code run and the health run had the same category. Bare
fallow --format sarifnow gives the idsfallow/dead-code/,fallow/dupes/andfallow/health/.fallow audit --format sarifgives ids that start withfallow/audit/. The SARIF of a single command does not change. - The pull-request comment says "Quality gate failed" when an enforced gate failed. Before, the heading said "Quality gate passed" when the diff filter dropped every finding of a failed run.
- The GitHub Action installs the fallow version of a pnpm or Bun catalog. Before, a
"fallow": "catalog:"dependency made the Action install the latest release. - The GitLab CI template no longer fails the job when the installed fallow has no
fallow report. For a pin older than 3.4.2, the template runs the analysis again with--format codeclimate. (#4481) - After
git fetch --unshalloworgit fetch --deepen, the next run reads the full history again. Before, hotspots and change coupling still showed the shallow history. - The setup hint of a bare
fallowrun namesnpx fallowwhennpxstarted fallow. Before, the hint saidfallow init, which usually fails afternpxwithfallow: command not found. fallow migratetells you when it skips a TypeScript source config. It names the.tsfile and tells you to convert it to JSON first. The exit code stays 2.- Fallow Impact no longer records a run on a project in a system temp folder. Test fixtures and throwaway clones made
fallow impact --alland the MCP toolimpact_allslow. (#4555) - Fallow keeps the parse errors of embedded scripts. Fallow also keeps the note that it cut an object at the property-depth limit, and it discards stale parse caches. The inventories and the parse-error gates then report the source that Fallow could not read.
- A
cache.dirin a config file must be inside the project. A committed.fallowrc.jsonwith an absolutecache.dir, such as/home/user, made fallow write its cache files and a.gitignorewith*in that directory. See the upgrade notes.
Upgrade notes
-
A project that uses the type-aware companion must install it. This applies to
--type-aware,mutation --typecheckandtypeAwarein the config. Install the companion at the same version asfallow:- project:
npm install --save-dev fallow-type-aware@<fallow version>; - global:
npm install --global fallow-type-aware@<fallow version>; - npx:
npx -p fallow@<version> -p fallow-type-aware@<version> fallow.
The GitHub Action and the GitLab template install the companion themselves. Without the companion,
--type-awarekeeps the syntactic findings and its warning names the install command. - project:
-
A project that uses
fallow similar-codemust install its companion. This also applies to the MCPfind_similar_codeandinspect_similar_codetools. Runnpm install --save-dev fallow-similar-code@<fallow version>. -
A Linux image build can need a
--libcflag. A cross-target install from macOS or Windows must pass--os=linux --cpu=<arch> --libc=<glibc|musl>. A build that installsnode_moduleson glibc and runs it on musl must install with--libc=musl. -
The MCP response cap is now 1,000,000 bytes. Before, the default cap was 16 MiB. To use a different cap, up to 16 MiB, set
FALLOW_MCP_MAX_OUTPUT_BYTESin the server environment. Themax_output_bytesparameter of a call still only lowers the cap. -
Code scanning alerts of multi-analysis SARIF documents move to new categories once. The
category:input ofupload-sarifdoes not apply to a run that already has an id. GitHub can show the alerts of the old category as closed after the first upload. Thefallow/dupesandfallow/audit/diff-riskids also change, tofallow/dupes/andfallow/audit/diff-risk/. -
Update an installed hook to get the new pre-commit behavior. Run
fallow hooks install --target git --force. For the agent gate, also runfallow hooks install --target agent --force.--branchhas no effect now and prints a note. -
Fallow ignores a
cache.diroutside the project. This includes a path that leaves the root with.., the root itself, and a path in.git. The run prints a warning and uses.fallow. To put the cache outside the project, for example a shared CI cache, setFALLOW_CACHE_DIR. -
The
fail-on-issuesgate of the GitHub Action and the GitLab template counts onlyerrorfindings for dead code. The count comes fromgate_outcomes["error-severity-findings"].observed. With fallow 3.29.0 to 3.31.x, apassstatus counts as 0 and afailstatus lets every finding count. With a fallow older than 3.29.0, every finding still counts. Duplication, health and security counts do not change. -
The first run after the upgrade parses each file again. The cache format changed.
Full Changelog: v3.42.0...v3.43.0