fallow 2.104.0 → 3.0.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.
@@ -2,7 +2,7 @@
2
2
  * AUTOGENERATED FILE. DO NOT EDIT.
3
3
  *
4
4
  * Generated from `docs/output-schema.json` by
5
- * `editors/vscode/scripts/codegen-types.mjs`. The same file is written to
5
+ * `editors/vscode/scripts/codegen-contracts.mjs`. The same file is written to
6
6
  * `editors/vscode/src/generated/output-contract.d.ts` (extension internal) and
7
7
  * `npm/fallow/types/output-contract.d.ts` (published as `fallow/types`).
8
8
  *
@@ -10,15 +10,14 @@
10
10
  * 1. Edit the Rust struct in `crates/types/src/results.rs` (or the
11
11
  * duplicates crate at `crates/core/src/duplicates/types.rs`). The Rust
12
12
  * side is the runtime source of truth for the JSON output.
13
- * 2. Update `docs/output-schema.json` to match. The schema is
14
- * hand-maintained against the Rust structs; the drift-guard test in
15
- * `crates/cli/src/report/json.rs` enforces only a subset of the
16
- * contract (the `HealthFindingAction` enum). Field-level drift between
17
- * Rust and the schema is currently caught by code review.
18
- * 3. Run `pnpm --filter fallow-vscode codegen:types` from anywhere.
19
- * 4. Commit both regenerated files alongside the schema edit.
13
+ * 2. Regenerate `docs/output-schema.json` with
14
+ * `cargo run -p fallow-cli --features schema-emit --bin fallow-schema-emit`.
15
+ * The schema-emit drift tests compare the committed schema against the
16
+ * Rust-derived definitions.
17
+ * 3. Run `pnpm --filter fallow-vscode codegen:contracts` from anywhere.
18
+ * 4. Commit the regenerated schema and generated contract files together.
20
19
  *
21
- * CI runs `pnpm --filter fallow-vscode check:codegen` which fails when
20
+ * CI runs `pnpm --filter fallow-vscode check:contracts` which fails when
22
21
  * either committed file disagrees with what regen would produce.
23
22
  */
24
23
  /* eslint-disable */
@@ -252,7 +251,7 @@ export type ReExportCycleKind = ("multi-node" | "self-loop")
252
251
  /**
253
252
  * Which rule-pack rule kind produced a [`PolicyViolation`].
254
253
  */
255
- export type PolicyRuleKind = ("banned-call" | "banned-import" | "banned-effect")
254
+ export type PolicyRuleKind = ("banned-call" | "banned-import" | "banned-effect" | "banned-export")
256
255
  /**
257
256
  * Effective severity of a single [`PolicyViolation`]. Per-rule `severity`
258
257
  * overrides the `rules."policy-violation"` master; `off` rules emit nothing,
@@ -594,7 +593,7 @@ export type FrameworkHealthDetectorStatus = ("active" | "disabled_by_config" | "
594
593
  /**
595
594
  * Discriminant for [`CssCandidateAction::kind`].
596
595
  */
597
- export type CssCandidateActionType = ("verify-unused" | "verify-undefined" | "consolidate" | "replace-with-token" | "standardize")
596
+ export type CssCandidateActionType = ("verify-unused" | "verify-undefined" | "consolidate" | "replace-with-token" | "standardize" | "simplify-selector")
598
597
  /**
599
598
  * Discriminant for [`UnusedAtRule::kind`].
600
599
  */
@@ -602,12 +601,12 @@ export type UnusedAtRuleKind = ("property-registration" | "layer")
602
601
  /**
603
602
  * The surface through which a design token is consumed. The `theme-var` /
604
603
  * `css-var` / `utility` / `apply` kinds are Tailwind v4 `@theme` consumption; the
605
- * `js-member` kind is CSS-in-JS consumption (a cross-module member access on an
606
- * imported StyleX/vanilla-extract token binding). The kind is the disjoint origin
607
- * signal that distinguishes a Tailwind token entry from a CSS-in-JS token entry in
608
- * the shared `token_consumers` list.
604
+ * `js-member` / `js-call` kinds are CSS-in-JS consumption (member access on an
605
+ * imported StyleX/vanilla-extract token binding, or a PandaCSS `token('...')`
606
+ * call). The kind is the disjoint origin signal that distinguishes a Tailwind
607
+ * token entry from a CSS-in-JS token entry in the shared `token_consumers` list.
609
608
  */
610
- export type ConsumerKind = ("theme-var" | "css-var" | "utility" | "apply" | "js-member")
609
+ export type ConsumerKind = ("theme-var" | "css-var" | "utility" | "apply" | "js-member" | "js-call")
611
610
  /**
612
611
  * Trust level for a [`StylingHealth`] grade. TWO variants (not the three-tier
613
612
  * `high`/`medium`/`low` of [`crate::Confidence`] / `FeatureFlagConfidence`) ON
@@ -617,6 +616,18 @@ export type ConsumerKind = ("theme-var" | "css-var" | "utility" | "apply" | "js-
617
616
  * `"low"`), matching the sibling confidence enums' vocabulary.
618
617
  */
619
618
  export type StylingHealthConfidence = ("high" | "low")
619
+ /**
620
+ * Effective configured severity for a styling finding.
621
+ */
622
+ export type StylingFindingSeverity = ("warn" | "error")
623
+ /**
624
+ * Confidence hint for a [`StylingFinding`].
625
+ */
626
+ export type StylingFindingConfidence = ("high" | "low")
627
+ /**
628
+ * Agent handling hint for a [`StylingFinding`].
629
+ */
630
+ export type StylingAgentDisposition = ("fix-confidently" | "verify-first")
620
631
  export type InspectTargetDescriptor = ({
621
632
  file: string
622
633
  type: "file"
@@ -2506,7 +2517,8 @@ kind: PolicyRuleKind
2506
2517
  /**
2507
2518
  * What matched: the written callee path for `banned-call` (e.g.
2508
2519
  * `cp.exec`), the raw import specifier for `banned-import` (e.g.
2509
- * `moment/locale/nl`), or `<effect>: <callee>` for `banned-effect`.
2520
+ * `moment/locale/nl`), `<effect>: <callee>` for `banned-effect`, or the
2521
+ * exported name for `banned-export`.
2510
2522
  */
2511
2523
  matched: string
2512
2524
  severity: PolicyViolationSeverity
@@ -4043,6 +4055,15 @@ css_analytics?: (CssAnalyticsReport | null)
4043
4055
  * code score is never affected by this field.
4044
4056
  */
4045
4057
  styling_health?: (StylingHealth | null)
4058
+ /**
4059
+ * Advisory STYLING FINDINGS: the graduation of the descriptive css
4060
+ * candidates into first-class, severity-aware, suppressible findings
4061
+ * surfaced in `fallow audit`. Verdict-neutral by default (the rule defaults
4062
+ * to `warn`); the styling domain's OWN findings collection, not the dead-code
4063
+ * `AnalysisResults`. Present only with `--css`; empty is skipped so a plain
4064
+ * run is byte-unchanged.
4065
+ */
4066
+ styling_findings?: StylingFinding[]
4046
4067
  }
4047
4068
  /**
4048
4069
  * Wire envelope for a single complexity finding.
@@ -5852,6 +5873,19 @@ undefined_keyframes?: UndefinedKeyframes[]
5852
5873
  * descending.
5853
5874
  */
5854
5875
  duplicate_declaration_blocks?: CssDuplicateBlock[]
5876
+ /**
5877
+ * CVA / shadcn variant class strings that repeat the same normalized class
5878
+ * block in several variant values. Kept separate from CSS declaration-block
5879
+ * duplication because the source is JS config, not parsed CSS rules.
5880
+ */
5881
+ cva_duplicate_variant_blocks?: CvaDuplicateVariantBlock[]
5882
+ /**
5883
+ * CVA / shadcn variant class strings that hardcode a Tailwind arbitrary
5884
+ * value even though an existing token has the same or nearest comparable
5885
+ * value. Advisory: variants often encode product semantics, so agents
5886
+ * should verify intent before replacing.
5887
+ */
5888
+ cva_variant_token_drifts?: CvaVariantTokenDrift[]
5855
5889
  /**
5856
5890
  * Tailwind arbitrary-value utilities (`w-[13px]`, `bg-[#abc]`) found in
5857
5891
  * markup, which hardcode a one-off value instead of a configured scale
@@ -5860,6 +5894,13 @@ duplicate_declaration_blocks?: CssDuplicateBlock[]
5860
5894
  * value is sometimes the right call.
5861
5895
  */
5862
5896
  tailwind_arbitrary_values?: TailwindArbitraryValue[]
5897
+ /**
5898
+ * Located raw CSS declaration values that bypass token surfaces (`var()`,
5899
+ * `token()`, `theme()`) on scale-sensitive axes such as color, font-size,
5900
+ * line-height, radius, and shadow. Conservative candidates: a raw value can
5901
+ * be intentional, but introduced raw values are useful audit feedback.
5902
+ */
5903
+ raw_style_values?: RawStyleValue[]
5863
5904
  /**
5864
5905
  * Unused CSS at-rule entities: an `@property` registered but never read via
5865
5906
  * `var()` in any stylesheet, or an `@layer` declared but never populated by
@@ -5908,6 +5949,12 @@ unused_font_faces?: UnusedFontFace[]
5908
5949
  * downstream repo. Sorted by `(path, line, token)`.
5909
5950
  */
5910
5951
  unused_theme_tokens?: UnusedThemeToken[]
5952
+ /**
5953
+ * Tailwind v4 theme tokens whose comparable values are close to another
5954
+ * token in the same theme dictionary. These are opt-in `--css-deep`
5955
+ * candidates because they need whole-project token context.
5956
+ */
5957
+ near_duplicate_theme_tokens?: NearDuplicateThemeToken[]
5911
5958
  /**
5912
5959
  * A location-aware reverse index of Tailwind v4 `@theme` token consumers:
5913
5960
  * per token, where it is consumed (`var()` reads, `@apply` bodies, generated
@@ -6227,6 +6274,22 @@ tailwind_arbitrary_values: number
6227
6274
  * Total Tailwind arbitrary-value occurrences across markup.
6228
6275
  */
6229
6276
  tailwind_arbitrary_value_uses: number
6277
+ /**
6278
+ * Preprocessor stylesheets (`.scss`, `.sass`, `.less`) seen by the styling
6279
+ * scan. These are parsed textually for local candidates, not compiled.
6280
+ */
6281
+ preprocessor_stylesheets: number
6282
+ /**
6283
+ * True when project-wide class reachability was skipped because
6284
+ * preprocessor stylesheets outnumber plain CSS, making generated classes
6285
+ * invisible without a Sass/Less compiler.
6286
+ */
6287
+ preprocessor_reachability_abstained: boolean
6288
+ /**
6289
+ * Located raw CSS declaration values that bypass token surfaces on
6290
+ * scale-sensitive axes. Located in `raw_style_values`.
6291
+ */
6292
+ raw_style_values: number
6230
6293
  /**
6231
6294
  * `@property` registrations never referenced via `var()` in any stylesheet
6232
6295
  * (located in `unused_at_rules`). Cleanup candidates.
@@ -6262,6 +6325,12 @@ unused_font_faces: number
6262
6325
  * partial-scope run gated the scan out.
6263
6326
  */
6264
6327
  unused_theme_tokens: number
6328
+ /**
6329
+ * Tailwind v4 theme tokens whose comparable values are close to another
6330
+ * token in the same theme dictionary. Located in
6331
+ * `near_duplicate_theme_tokens`.
6332
+ */
6333
+ near_duplicate_theme_tokens: number
6265
6334
  /**
6266
6335
  * Number of distinct `font-size` units (`px` / `rem` / `em` / `%`) authored
6267
6336
  * across the codebase. Mixing units is a type-scale consistency smell,
@@ -6411,6 +6480,85 @@ path: string
6411
6480
  */
6412
6481
  line: number
6413
6482
  }
6483
+ /**
6484
+ * A duplicated CVA / shadcn variant class block.
6485
+ */
6486
+ export interface CvaDuplicateVariantBlock {
6487
+ /**
6488
+ * Normalized class block shared by several variant values.
6489
+ */
6490
+ value: string
6491
+ /**
6492
+ * Number of variant values with this class block.
6493
+ */
6494
+ occurrence_count: number
6495
+ /**
6496
+ * First locations of the duplicate values, sorted by path and line.
6497
+ */
6498
+ occurrences: CssBlockOccurrence[]
6499
+ /**
6500
+ * Read-only guidance step(s), so consumers can iterate `actions`
6501
+ * uniformly across every candidate type.
6502
+ */
6503
+ actions: CssCandidateAction[]
6504
+ }
6505
+ /**
6506
+ * A CVA / shadcn variant class value that can reuse an existing styling token.
6507
+ */
6508
+ export interface CvaVariantTokenDrift {
6509
+ /**
6510
+ * Tailwind arbitrary-value utility inside the variant class string.
6511
+ */
6512
+ class_token: string
6513
+ /**
6514
+ * Normalized value inside the arbitrary utility.
6515
+ */
6516
+ value: string
6517
+ /**
6518
+ * Full normalized variant class block containing the token.
6519
+ */
6520
+ variant_classes: string
6521
+ /**
6522
+ * Project-root-relative, forward-slash path to the variant definition.
6523
+ */
6524
+ path: string
6525
+ /**
6526
+ * 1-based line of the variant class string.
6527
+ */
6528
+ line: number
6529
+ nearest_token: NearestStylingToken
6530
+ /**
6531
+ * Read-only guidance step(s), so consumers can iterate `actions`
6532
+ * uniformly across every candidate type.
6533
+ */
6534
+ actions: CssCandidateAction[]
6535
+ }
6536
+ /**
6537
+ * A styling token candidate that can replace or explain a finding.
6538
+ */
6539
+ export interface NearestStylingToken {
6540
+ /**
6541
+ * Token name, e.g. `--color-brand`.
6542
+ */
6543
+ name: string
6544
+ /**
6545
+ * Normalized token value.
6546
+ */
6547
+ value: string
6548
+ /**
6549
+ * Project-root-relative, forward-slash definition path.
6550
+ */
6551
+ path: string
6552
+ /**
6553
+ * 1-based definition line.
6554
+ */
6555
+ line: number
6556
+ /**
6557
+ * Distance from the finding value. Lower is closer; units depend on the
6558
+ * comparable token namespace.
6559
+ */
6560
+ distance: number
6561
+ }
6414
6562
  /**
6415
6563
  * A distinct Tailwind arbitrary-value utility token used in markup, with its
6416
6564
  * total use count and first location (a design-token-bypass candidate).
@@ -6440,6 +6588,39 @@ line: number
6440
6588
  */
6441
6589
  actions: CssCandidateAction[]
6442
6590
  }
6591
+ /**
6592
+ * A located raw CSS declaration value on a scale-sensitive styling axis.
6593
+ */
6594
+ export interface RawStyleValue {
6595
+ /**
6596
+ * Value axis, e.g. `color`, `font-size`, `line-height`, `radius`, or `shadow`.
6597
+ */
6598
+ axis: string
6599
+ /**
6600
+ * CSS property where the raw value appears.
6601
+ */
6602
+ property: string
6603
+ /**
6604
+ * Rendered declaration value.
6605
+ */
6606
+ value: string
6607
+ /**
6608
+ * Project-root-relative, forward-slash path to the stylesheet.
6609
+ */
6610
+ path: string
6611
+ /**
6612
+ * 1-based line of the containing style rule.
6613
+ */
6614
+ line: number
6615
+ /**
6616
+ * Concrete token with the same or nearest comparable value, when resolved.
6617
+ */
6618
+ nearest_token?: (NearestStylingToken | null)
6619
+ /**
6620
+ * Read-only guidance step(s). Never auto-fixable.
6621
+ */
6622
+ actions: CssCandidateAction[]
6623
+ }
6443
6624
  /**
6444
6625
  * An unused CSS at-rule entity (an `@property` registration with no `var()`
6445
6626
  * reference, or an `@layer` declaration never populated), located by its first
@@ -6569,6 +6750,34 @@ line: number
6569
6750
  */
6570
6751
  actions: CssCandidateAction[]
6571
6752
  }
6753
+ /**
6754
+ * A Tailwind v4 `@theme` token that appears to duplicate an existing token by
6755
+ * value. Emitted conservatively for comparable token namespaces, with the
6756
+ * nearest existing token named so an agent has a concrete reuse target.
6757
+ */
6758
+ export interface NearDuplicateThemeToken {
6759
+ /**
6760
+ * The full custom property as authored, including the `--` prefix.
6761
+ */
6762
+ token: string
6763
+ /**
6764
+ * The normalized authored token value.
6765
+ */
6766
+ value: string
6767
+ /**
6768
+ * Project-root-relative, forward-slash path to the token definition.
6769
+ */
6770
+ path: string
6771
+ /**
6772
+ * 1-based line of the token definition inside the `@theme` block.
6773
+ */
6774
+ line: number
6775
+ nearest_token: NearestStylingToken
6776
+ /**
6777
+ * Read-only guidance step(s) before replacing the token reference.
6778
+ */
6779
+ actions: CssCandidateAction[]
6780
+ }
6572
6781
  /**
6573
6782
  * A location-aware reverse index of where one design token is consumed, so an
6574
6783
  * agent editing the token can see its blast radius before changing or removing
@@ -6584,12 +6793,13 @@ actions: CssCandidateAction[]
6584
6793
  * `apply`), built from the same gated candidate set as `unused_theme_tokens`
6585
6794
  * (v4 + non-plugin + non-published + whole-scope), so a `consumer_count: 0`
6586
6795
  * corroborates the `unused_theme_tokens` "nothing consumes this" finding.
6587
- * - CSS-in-JS tokens (kind `js-member`) from StyleX `defineVars` /
6588
- * vanilla-extract `createTheme` family definitions, consumed via cross-module
6589
- * member access. NOTE: CSS-in-JS has NO corroborating dead-token finding (there
6590
- * is no `unused_theme_tokens` analogue), so a CSS-in-JS `consumer_count: 0` is a
6591
- * weaker signal than the Tailwind case (and the cross-file scan is relative-import
6592
- * only, so alias / bare-package imports are not counted).
6796
+ * - CSS-in-JS tokens (kind `js-member` / `js-call`) from StyleX `defineVars`,
6797
+ * vanilla-extract `createTheme` family definitions, and PandaCSS `defineTokens`,
6798
+ * consumed via cross-module member access or PandaCSS `token('...')` calls. NOTE:
6799
+ * CSS-in-JS has NO corroborating dead-token finding (there is no
6800
+ * `unused_theme_tokens` analogue), so a CSS-in-JS `consumer_count: 0` is a weaker
6801
+ * signal than the Tailwind case (and the cross-file scan is relative-import or
6802
+ * generated-token-helper only, so alias / bare-package imports are not counted).
6593
6803
  *
6594
6804
  * This is DESCRIPTIVE context (a blast-radius lookup), not a finding, so it
6595
6805
  * deliberately carries no `actions` array (unlike the cleanup-candidate types in
@@ -6762,6 +6972,66 @@ token_erosion: number
6762
6972
  */
6763
6973
  structural: number
6764
6974
  }
6975
+ /**
6976
+ * One advisory STYLING FINDING: the graduation of a descriptive css candidate
6977
+ * into a first-class, severity-aware, suppressible finding surfaced in
6978
+ * `fallow audit`. The styling domain's OWN finding type (not borrowed into the
6979
+ * dead-code `AnalysisResults`, and not glued in the CLI). `code` is the kebab
6980
+ * IssueKind code (e.g. `css-token-drift`), so severity / inline suppression /
6981
+ * SARIF / MCP all resolve via the shared `issue_meta` contract through
6982
+ * `IssueKind::parse(code)`. One `Vec<StylingFinding>` carries every styling
6983
+ * family; the `code` discriminates.
6984
+ */
6985
+ export interface StylingFinding {
6986
+ /**
6987
+ * The kebab IssueKind code, e.g. `css-token-drift`.
6988
+ */
6989
+ code: string
6990
+ /**
6991
+ * The specific sub-kind within the family, e.g. `tailwind-arbitrary-value`.
6992
+ */
6993
+ sub_kind: string
6994
+ /**
6995
+ * Workspace-relative path of the finding.
6996
+ */
6997
+ path: string
6998
+ /**
6999
+ * 1-based line of the finding.
7000
+ */
7001
+ line: number
7002
+ /**
7003
+ * The offending literal value, e.g. `w-[13px]`.
7004
+ */
7005
+ value: string
7006
+ effective_severity: StylingFindingSeverity
7007
+ /**
7008
+ * Optional static lower-bound blast radius. For a dead design token this is
7009
+ * `0`; for other styling findings it is omitted.
7010
+ */
7011
+ blast_radius?: (number | null)
7012
+ /**
7013
+ * Confidence hint for agents and review UIs. Structural findings are high,
7014
+ * reachability findings are low because dynamic consumers may exist.
7015
+ */
7016
+ confidence?: (StylingFindingConfidence | null)
7017
+ /**
7018
+ * Suggested handling posture for agents. This is advisory data, fallow
7019
+ * still never applies styling changes automatically.
7020
+ */
7021
+ agent_disposition?: (StylingAgentDisposition | null)
7022
+ /**
7023
+ * Concrete reuse target for token-drift findings, when one can be resolved.
7024
+ */
7025
+ nearest_token?: (NearestStylingToken | null)
7026
+ /**
7027
+ * One concise machine-readable edit hint for agent consumers.
7028
+ */
7029
+ fix_hint?: (string | null)
7030
+ /**
7031
+ * Suggested next steps (verify / suppress; never an auto-fix).
7032
+ */
7033
+ actions: CssCandidateAction[]
7034
+ }
6765
7035
  /**
6766
7036
  * Envelope emitted by `fallow explain <issue-type> --format json`.
6767
7037
  *
@@ -7197,6 +7467,15 @@ css_analytics?: (CssAnalyticsReport | null)
7197
7467
  * code score is never affected by this field.
7198
7468
  */
7199
7469
  styling_health?: (StylingHealth | null)
7470
+ /**
7471
+ * Advisory STYLING FINDINGS: the graduation of the descriptive css
7472
+ * candidates into first-class, severity-aware, suppressible findings
7473
+ * surfaced in `fallow audit`. Verdict-neutral by default (the rule defaults
7474
+ * to `warn`); the styling domain's OWN findings collection, not the dead-code
7475
+ * `AnalysisResults`. Present only with `--css`; empty is skipped so a plain
7476
+ * run is byte-unchanged.
7477
+ */
7478
+ styling_findings?: StylingFinding[]
7200
7479
  grouped_by?: (GroupByMode | null)
7201
7480
  groups?: (HealthGroup[] | null)
7202
7481
  _meta?: (Meta | null)