fallow 3.9.1 → 3.11.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +22 -1
- package/capabilities.json +99 -3
- package/package.json +10 -9
- package/schema.json +169 -0
- package/scripts/run-binary.js +29 -1
- package/scripts/run-binary.test.js +16 -0
- package/skills/fallow/SKILL.md +25 -2
- package/skills/fallow/references/cli-reference.md +21 -2
- package/skills/fallow/references/mcp.md +2 -0
- package/skills/fallow/references/patterns.md +4 -1
- package/types/output-contract.d.ts +1333 -68
|
@@ -50,6 +50,7 @@ Analyzes the project for unused files, exports, dependencies, types, members, an
|
|
|
50
50
|
| `--trace-file` | `string` | - | Show all edges for a file |
|
|
51
51
|
| `--trace-dependency` | `string` | - | Trace where a dependency is used |
|
|
52
52
|
| `--impact-closure` | `string` | - | Compute the impact closure for a file (the transitive affected-but-not-in-diff set + coordination gap). Walks reverse-deps and re-export chains; powers the `inspect_target` MCP tool |
|
|
53
|
+
| `--symbol-impact` | `string` | - | Compute exact-symbol consumers, affected files, and targeted tests |
|
|
53
54
|
| `--top` | `string` | - | Show only the top N items per category |
|
|
54
55
|
| `--file` | `string` | - | Scope output to specific files. Only issues in the specified files are reported. Project-wide dependency issues are suppressed. Warns on non-existent paths. Useful for lint-staged |
|
|
55
56
|
|
|
@@ -401,6 +402,7 @@ Angular templates contribute synthetic `<template>` complexity findings whenever
|
|
|
401
402
|
| `--ownership` | `bool` | `false` | Attach ownership signals to hotspot entries: bus factor (Avelino truck factor), contributor count, top contributor with stale-days, recent contributors (top-3), `suggested_reviewers`, declared CODEOWNERS owner, `ownership_state`, ownership drift, unowned-hotspot detection. Human output gains a project-level summary line. JSON adds `low-bus-factor`, `unowned-hotspot`, `ownership-drift` action types. Test files get a `[test]` tag. Implies `--hotspots`. Requires git. |
|
|
402
403
|
| `--ownership-emails` | `raw\|handle\|anonymized\|hash` | - | Privacy mode for author emails. `handle` shows the local-part only (default, with GitHub noreply unwrap and deterministic same-handle disambiguation). `anonymized` emits stable `xxh3:` pseudonyms; `hash` remains accepted as the legacy spelling. `raw` shows full addresses. Use `anonymized` in regulated environments. Implies `--ownership`. Configure default via `health.ownership.emailMode`. |
|
|
403
404
|
| `--targets` | `bool` | `false` | Show only refactoring targets: ranked recommendations based on complexity, coupling, churn, and dead code signals. Categories: churn+complexity, circular dep, high impact, dead code, complexity, coupling. When no section flags are set, all sections are shown by default. Each target's JSON can include `direct_callers[]` (direct importers with the symbols they import) and `clone_siblings[]` (duplicate-code siblings with stable `dup:<8hex>` fingerprints for `fallow dupes --trace`); both omitted when empty. Human output adds `importers:` / `clones:` lines only when that evidence is present. |
|
|
405
|
+
| `--type-coupling` | `bool` | `false` | Show advisory project-local public-signature type coupling. Requires type-aware analysis and does not change the health score |
|
|
404
406
|
| `--css` | `bool` | `false` | Add structural CSS analytics: specificity hotspots, !important density, over-complex selectors, deep nesting, and conservative cleanup candidates. Standard CSS is parsed structurally; preprocessor sources are scanned only where fallow can avoid expanding Sass/Less semantics. Also derives `styling_health`, a descriptive A-F grade for CSS quality scored separately from the code `health_score` (never gates); it weights design-token drift (hardcoded value sprawl) over byte-identical repetition. |
|
|
405
407
|
| `--effort` | `low\|medium\|high` | - | Filter refactoring targets by effort level. Implies `--targets`. |
|
|
406
408
|
| `--score` | `bool` | `false` | Show only the project health score (0-100) with letter grade (A/B/C/D/F). The score is included by default when no section flags are set. JSON includes `health_score` object with `score`, `grade`, and `penalties` breakdown. As of v2.55.0, plain `--score` skips the churn-backed hotspot penalty so it does not run a `git log` shell-out per invocation; pass `--hotspots` (or `--targets` with `--score`) to include the hotspot penalty. Snapshot (`--save-snapshot`) and trend (`--trend`) flows still trigger hotspot vital signs so saved data stays complete. |
|
|
@@ -418,7 +420,7 @@ Angular templates contribute synthetic `<template>` complexity findings whenever
|
|
|
418
420
|
| `--min-observation-volume` | `string` | - | Minimum total trace volume before the sidecar may emit high-confidence `safe_to_delete` / `review_required` verdicts. Below this, confidence is capped at `medium`. |
|
|
419
421
|
| `--low-traffic-threshold` | `string` | - | Fraction of total trace count below which an invoked function is classified `low_traffic` rather than `active`. Expressed as a decimal (0.001 = 0.1%). |
|
|
420
422
|
|
|
421
|
-
Common global flags for this command: [`--format`](#global-flags), [`--quiet`](#global-flags), [`--changed-since`](#global-flags), [`--churn-file`](#global-flags), [`--workspace`](#global-flags), [`--group-by`](#global-flags), [`--baseline`](#global-flags), [`--save-baseline`](#global-flags), [`--production`](#global-flags), [`--no-production`](#global-flags), [`--explain`](#global-flags).
|
|
423
|
+
Common global flags for this command: [`--format`](#global-flags), [`--quiet`](#global-flags), [`--changed-since`](#global-flags), [`--churn-file`](#global-flags), [`--workspace`](#global-flags), [`--group-by`](#global-flags), [`--baseline`](#global-flags), [`--baseline-mode`](#global-flags), [`--save-baseline`](#global-flags), [`--production`](#global-flags), [`--no-production`](#global-flags), [`--explain`](#global-flags).
|
|
422
424
|
<!-- generated:flags:health:end -->
|
|
423
425
|
### Exit Codes
|
|
424
426
|
|
|
@@ -471,6 +473,10 @@ fallow health --format json --quiet --workspace my-package
|
|
|
471
473
|
fallow health --format json --quiet --save-baseline fallow-baselines/health.json
|
|
472
474
|
fallow health --format json --quiet --baseline fallow-baselines/health.json
|
|
473
475
|
|
|
476
|
+
# Strict adoption: a hotspot that replaces a baselined hotspot is reported
|
|
477
|
+
fallow health --format json --quiet --save-baseline fallow-baselines/health.json --baseline-mode identity
|
|
478
|
+
fallow health --format json --quiet --baseline fallow-baselines/health.json --baseline-mode identity
|
|
479
|
+
|
|
474
480
|
# CI: fail if any function is too complex
|
|
475
481
|
fallow health --max-cyclomatic 25 --max-cognitive 20 --quiet
|
|
476
482
|
|
|
@@ -1322,7 +1328,7 @@ Top-level blocks:
|
|
|
1322
1328
|
- `manifest_version`: manifest shape discriminator (currently `"1"`).
|
|
1323
1329
|
- `commands` + `global_flags`: every CLI command and flag, derived live from the CLI definition.
|
|
1324
1330
|
- `issue_types`: one row per reportable issue type across ALL analyses (dead-code, health, dupes, flags, security). Each row carries `id` (the bare rule id; several rows share one suppression token, e.g. all complexity rules suppress via `complexity`), `rule_id` (SARIF id), `command`, `category`, `filter_flag` (null when none), `fixable`, `suppressible`, `suppress_comment` (copy-pasteable, null when not suppressible), `note`, `license` (`free` | `freemium`), and `docs_url`. Nullable fields are always present (null, never absent).
|
|
1325
|
-
- `mcp_tools`: all MCP server tools with `kind` grouping (analysis/trace/fix/introspection/runtime-coverage/composition), one-line description, `cli_command` nearest CLI fallback, `key_params` (curated subset; live MCP `list_tools` schemas are authoritative), `license` + `license_note` (the 5 runtime-coverage tools are `freemium`: a single local capture is free, continuous monitoring is paid), and `read_only`.
|
|
1331
|
+
- `mcp_tools`: all MCP server tools with `kind` grouping (analysis/trace/impact/fix/introspection/runtime-coverage/composition), one-line description, `cli_command` nearest CLI fallback, `key_params` (curated subset; live MCP `list_tools` schemas are authoritative), `license` + `license_note` (the 5 runtime-coverage tools are `freemium`: a single local capture is free, continuous monitoring is paid), and `read_only`.
|
|
1326
1332
|
- `plugins`: built-in framework plugin count + names, derived live from the registry.
|
|
1327
1333
|
- `environment_variables`: every user-facing `FALLOW_*` variable (internal plumbing excluded).
|
|
1328
1334
|
- `output_formats`, `exit_codes`, `severity_levels`, `suppression_comments`.
|
|
@@ -1675,6 +1681,7 @@ Available on all commands:
|
|
|
1675
1681
|
| `--churn-file` | `string` | - | Import change history from a `fallow-churn/v1` JSON file instead of `git log`, powering hotspots, ownership, and bus-factor on projects with no git repository (Yandex Arc, Mercurial, Perforce). A small wrapper translates your VCS log into the contract. Resolved relative to `--root`. Affects `health --hotspots` / `--ownership` / `--targets` only; `audit`, `impact`, and `--changed-since` still require git |
|
|
1676
1682
|
| `--max-file-size` | `string` | - | Skip source files larger than this many megabytes (default 5) instead of parsing them, guarding against the out-of-memory blowup a single multi-MB generated/vendored/bundled file causes on large repos. Use `0` for no limit. Declaration files (`.d.ts`) are always analyzed. Skipped files are reported and excluded from every analysis. Also settable via `FALLOW_MAX_FILE_SIZE` |
|
|
1677
1683
|
| `--baseline` | `string` | - | Compare to baseline |
|
|
1684
|
+
| `--baseline-mode` | `count\|identity` | `count` | How `--baseline` matches health findings: per file and category (`count`, the default) or per function identity (`identity`, strict, and only against a baseline saved with `--baseline-mode identity`; such a baseline still reads in count mode). Identity is file path plus function name, so renaming or moving a function that is still in the baseline reports it as new; re-save after that kind of refactor. |
|
|
1678
1685
|
| `--parent-run` | `string` | - | Correlate this run with a previous telemetry analysis run |
|
|
1679
1686
|
| `--save-baseline` | `string` | - | Save results as baseline |
|
|
1680
1687
|
| `--production` | `bool` | `false` | Exclude test/dev files, only start/build scripts (applies to every analysis) |
|
|
@@ -1715,8 +1722,20 @@ Available on all commands:
|
|
|
1715
1722
|
| `--coverage` | `string` | - | Path to Istanbul coverage data for exact CRAP scores in combined mode. Also settable via `FALLOW_COVERAGE` or `health.coverage` |
|
|
1716
1723
|
| `--coverage-root` | `string` | - | Absolute prefix to strip from Istanbul file paths in combined mode. Also settable via `FALLOW_COVERAGE_ROOT` or `health.coverageRoot` |
|
|
1717
1724
|
| `--include-entry-exports` | `bool` | `false` | Report unused exports in entry files instead of auto-marking them as used |
|
|
1725
|
+
| `--type-aware` | `bool` | `false` | Opt in to TypeScript semantic analysis for project-wide symbol evidence. This does not emit compiler diagnostics or typed lint findings |
|
|
1726
|
+
| `--type-aware-project` | `string` | - | TypeScript project config to use for type-aware analysis (repeatable) |
|
|
1727
|
+
| `--type-aware-require` | `best-effort\|complete` | - | Decide whether incomplete type-aware analysis is advisory or gating |
|
|
1718
1728
|
<!-- generated:flags:global:end -->
|
|
1719
1729
|
|
|
1730
|
+
Type-aware candidate decisions are `confirmed-used`, `contract-preserved`,
|
|
1731
|
+
`confirmed-no-static-references`, `retained-abstained`, or
|
|
1732
|
+
`retained-unresolved`. The first two remove a syntactic false positive.
|
|
1733
|
+
Complete negative evidence keeps the finding and only makes a class member
|
|
1734
|
+
automatically fixable when every owning project is complete, no contract or
|
|
1735
|
+
dynamic gap exists, and the exact declaration hash still matches.
|
|
1736
|
+
`fallow fix --type-aware --dry-run --format json --quiet` previews these
|
|
1737
|
+
guarded edits.
|
|
1738
|
+
|
|
1720
1739
|
### Combined Mode Flags
|
|
1721
1740
|
|
|
1722
1741
|
<!-- generated:flags:fallow-combined:start -->
|
|
@@ -38,6 +38,8 @@ When using fallow via MCP (`fallow-mcp`), the following tools are available:
|
|
|
38
38
|
| `impact` | introspection | free | `fallow impact --format json --quiet` | `root` | Read the local, opt-in Fallow Impact value report (`fallow impact --format json`). Runs no analysis: current surfacing counts, trend since the last recorded run, pre-commit gate containment, and (on impact v1.5+) resolved/suppressed attribution. History is read from a per-project file in the user's private config dir (never inside the repo). Read-only and `root`-only; the mutating `enable` / `disable` / `default` lifecycle is not exposed. A never-enabled project returns a populated `{"enabled": false, ...}` report (never `{}`); branch on `enabled` and `enabled_source` (`project` / `user` / `default`) then `record_count`, recommending `fallow impact enable` only when `explicit_decision` is `false` (never asked) and staying silent when `true` (deliberately disabled here). Local-developer signal: fallow never records in CI, so empty there and not a CI metric |
|
|
39
39
|
| `impact_all` | introspection | free | `fallow impact --all --format json --quiet` | `sort`, `limit` | Roll every tracked fallow project on this machine into one cross-repo value report (hashed keys plus basename labels, never paths; local-dev only) |
|
|
40
40
|
| `trace_export` | trace | free | `fallow dead-code --trace <file:export> --format json --quiet` | `file`, `export_name` | Trace why an export is used or unused (`fallow dead-code --trace FILE:EXPORT_NAME --format json`). Required `file` and `export_name`. Returns file reachability, entry-point status, direct references, re-export chains, and a reason string. If `export_name` is a class / enum / store MEMBER, returns a member trace instead (`member_name`, `member_kind`, `owner_export`, `owner_is_used`) plus a `--unused-<kind>-members` pointer; branch on field presence. Use before deleting a supposedly-unused export or debugging an unused-class-member finding |
|
|
41
|
+
| `trace_symbol` | trace | free | `fallow dead-code --type-aware --trace <file:export> --format json --quiet` | `file`, `export_name`, `type_aware_projects`, `type_aware_require` | Trace an exact TypeScript symbol with checker-backed references, namespace identity, aliases, and re-export hops. Root trace fields preserve syntactic context; treat `semantic.references`, `semantic.status`, and `semantic.identity` as the authoritative exact evidence. This is project-wide evidence for Fallow decisions, not a compiler-diagnostic or lint-rule surface. |
|
|
42
|
+
| `symbol_impact` | impact | free | `fallow dead-code --type-aware --symbol-impact <file:export-or-class.member> --format json --quiet` | `file`, `export_name`, `class_name`, `member_name`, `type_aware_projects`, `type_aware_require` | Return exact-symbol consumers, affected files, and targeted tests for a TypeScript export or exported class method. Select either `export_name`, or both `class_name` and `member_name`. Advisory change-impact evidence, not a substitute for `tsc` or Oxlint |
|
|
41
43
|
| `trace_file` | trace | free | `fallow dead-code --trace-file <file> --format json --quiet` | `file` | Trace all graph edges for a file (`fallow dead-code --trace-file PATH --format json`). Required `file`. Returns reachability, exports, imports-from, imported-by, and re-exports. Use to decide whether a file is isolated, barrel-only, or imported by live entry points |
|
|
42
44
|
| `impact_closure` | trace | free | `fallow dead-code --impact-closure <path> --format json --quiet` | `path` | Trace the transitive affected-but-not-in-diff set and coordination gaps for one file. Supports `root`, `config`, `production`, `workspace`, `no_cache`, and `threads`. Use as review-planning evidence for a file contract, not proof that affected files are wrong |
|
|
43
45
|
| `trace_dependency` | trace | free | `fallow dead-code --trace-dependency <package> --format json --quiet` | `package_name` | Trace where a dependency is imported (`fallow dead-code --trace-dependency PACKAGE --format json`). Required `package_name`. Returns importing files, type-only importers, total import count, `used_in_scripts` (true when invoked from package.json scripts or CI configs), and `is_used` (combined import + script signal; mirrors the unused-deps detector so build tools like `microbundle` or `vitest` are not falsely flagged as unused). Use before removing a dependency or moving between `dependencies` and `devDependencies` |
|
|
@@ -442,7 +442,10 @@ fallow migrate
|
|
|
442
442
|
|
|
443
443
|
Creates `.fallowrc.json` with mapped settings:
|
|
444
444
|
- knip `rules`/`exclude`/`include` → fallow `rules` (error/warn/off)
|
|
445
|
-
- knip `ignore` → fallow `
|
|
445
|
+
- knip `ignore` → fallow `ignoreFindings` (matching dead-code findings are
|
|
446
|
+
hidden, but matching files remain in the module graph; leading `!` exceptions
|
|
447
|
+
are preserved; multi-source findings stay visible unless every source owner
|
|
448
|
+
matches)
|
|
446
449
|
- knip `ignoreDependencies` → fallow `ignoreDependencies`
|
|
447
450
|
- knip `ignoreExportsUsedInFile` → fallow `ignoreExportsUsedInFile` (boolean and `{ type, interface }` object form both supported; fallow groups type aliases and interfaces under one issue, so the two type-kind fields behave identically)
|
|
448
451
|
- Unmappable fields generate warnings with suggestions
|