Expand description
Typed envelope wrappers for the simple 1:1 dead-code findings
(UnusedFile, PrivateTypeLeak, UnresolvedImport, CircularDependency,
BoundaryViolation). Each wrapper flattens the bare finding via
#[serde(flatten)] and carries a typed actions array populated at
construction time, replacing the per-finding post-pass injection that
previously grafted actions[] and introduced onto the schema. The
introduced field is set by the audit pass via JSON map insertion and
is None when serialized directly from Rust. The schemars::JsonSchema
derive is gated per-struct on the schema feature.
Typed envelope wrappers for the simple 1:1 dead-code findings whose
actions are entirely determined by the wrapper type (no per-instance
discriminants beyond what the bare finding already exposes).
Each wrapper flattens the bare finding via #[serde(flatten)] so the
wire shape matches the previous actions-grafted output byte-for-byte.
actions is populated at construction time via each wrapper’s
with_actions constructor and replaces the per-finding inject_actions
post-pass in crates/cli/src/report/json.rs. introduced carries the optional audit
breadcrumb that crates/cli/src/audit.rs::annotate_issue_array inserts
into the JSON object via map.insert; the wrapper-level field stays
None when serialized directly from Rust and is set by the audit pass
only when the issue was introduced relative to the merge-base.
All nine wrappers ship with IssueAction arrays today; they pay the
serde_json dependency cost because IssueAction transitively
references AddToConfigValue::RuleObject(serde_json::Map<...>). The
variants the wrappers actually emit (Fix, SuppressLine,
SuppressFile, AddToConfig) are small, but reusing the existing enum
keeps the wire-shape contract identical to the legacy post-pass.
introduced is typed as Option<AuditIntroduced> (transparent newtype
over bool) so the regenerated schema renders the field via
$ref: #/definitions/AuditIntroduced, matching the reference the prior
post-pass augmentation graft used. The audit pass continues to inject a
bare bool via map.insert("introduced", ...); serde reads it back into
AuditIntroduced transparently. The field stays absent at the wire when
None (skip_serializing_if).
Structs§
- Boundary
Call Violation Finding - Wire-shape envelope for a
BoundaryCallViolationfinding. Carries actions for refactoring the forbidden call out of the zone or suppressing it with the sharedboundary-violationtoken. - Boundary
Coverage Violation Finding - Wire-shape envelope for a
BoundaryCoverageViolationfinding. Carries actions for assigning the file to a zone or explicitly allowing it to stay unmatched. - Boundary
Violation Finding - Wire-shape envelope for a
BoundaryViolationfinding. MirrorsUnusedFileFinding: flattens the bare finding and carries a typedactionsarray (refactor-boundaryprimary plussuppress-linesecondary). - Circular
Dependency Finding - Wire-shape envelope for a
CircularDependencyfinding. MirrorsUnusedFileFinding: flattens the bare finding and carries a typedactionsarray (refactor-cycleprimary plussuppress-linesecondary). - Duplicate
Export Finding - Wire-shape envelope for a
DuplicateExportfinding. Carries up to three actions in position-locked order: anadd-to-configignoreExportssnippet (only whenlocations[]carries at least one path) followed by theremove-duplicatefix and the multi-location suppress. - Duplicate
Prop Shape Finding - Wire-shape envelope for a
DuplicatePropShapefinding. There is no safe auto-fix: extracting a sharedPropstype or a base component for a group of same-shaped components is a design decision. The actions are manual guidance (extract the shared shape) plus a line-level suppress at the component definition and a file-level suppress escape hatch (mirroring the route-collision multi-file model). The rule defaults tooff(opt-in health signal), so this finding is dormant by default. - Dynamic
Segment Name Conflict Finding - Wire-shape envelope for a
DynamicSegmentNameConflictfinding. The conflict is a Next.js dev / runtime error (next builddoes NOT catch it), so the primary action is manual guidance (rename the dynamic segments to a single consistent slug name), with a file-level suppress as escape hatch. - Empty
Catalog Group Finding - Wire-shape envelope for an
EmptyCatalogGroupfinding. Carries a straightforwardremove-empty-catalog-groupprimary plus a YAML-comment suppress. - Invalid
Client Export Finding - Wire-shape envelope for an
InvalidClientExportfinding. There is no safe auto-fix: the export itself may be a legitimate client-component value export that happens to collide with a Next.js server-only name, so removing it could break the component. Actions are a manualmove-to-server-modulefix (the real remediation) plus a line-level suppress. - Misconfigured
Dependency Override Finding - Wire-shape envelope for a
MisconfiguredDependencyOverridefinding. Carries afix-dependency-overrideprimary plus the conditionaladd-to-configignoreDependencyOverridessuppress (skipped when bothtarget_packageandraw_keyare empty, since the rule matcher keys on a non-empty package name). - Misplaced
Directive Finding - Wire-shape envelope for a
MisplacedDirectivefinding. There is no safe auto-fix: moving a directive to the leading prologue is a small but judgement-bearing edit (the author may have intended the file to be a server module after all). Actions are a manualhoist-directivefix (the real remediation) plus a line-level suppress. - Mixed
Client Server Barrel Finding - Wire-shape envelope for a
MixedClientServerBarrelfinding. There is no safe auto-fix: splitting a barrel into separate client and server modules is a human decision (the barrel may intentionally aggregate both surfaces). Actions are a manualsplit-mixed-barrelfix (the real remediation) plus a line-level suppress. - Policy
Violation Finding - Wire-shape envelope for a
PolicyViolationfinding. Carries actions for replacing the banned call or import, or suppressing it with a scopedpolicy-violation:<pack>/<rule-id>token. - Private
Type Leak Finding - Wire-shape envelope for a
PrivateTypeLeakfinding. MirrorsUnusedFileFinding: flattens the bare finding and carries a typedactionsarray (export-typeprimary plussuppress-linesecondary). - Prop
Drilling Chain Finding - Wire-shape envelope for a
PropDrillingChainfinding. There is no safe auto-fix: collapsing a drilling chain (colocate the consumer, lift to a context, or compose the component) is a design decision. The only action is a line-level suppress at the source hop’s prop declaration. The rule defaults tooff(opt-in health signal), so this finding is dormant by default. - ReExport
Cycle Finding - Wire-shape envelope for a
ReExportCyclefinding. MirrorsCircularDependencyFinding: flattens the bare finding and carries a typedactionsarray (refactor-re-export-cycleinformational primary plussuppress-filesecondary; cycles are file-scoped so a single file-level suppression on the alphabetically-first member breaks the cycle, and no// fallow-ignore-next-lineform makes sense because the diagnostic is anchored at line 1 col 0 of each member). - Route
Collision Finding - Wire-shape envelope for a
RouteCollisionfinding. A route collision is a guaranteednext buildfailure, so the PRIMARY action is manual guidance (move or merge one of the colliding files), NOT a suppress: suppressing a build error never makes the build pass. A file-level suppress is offered as an escape hatch only. - Test
Only Dependency Finding - Wire-shape envelope for a
TestOnlyDependencyfinding. Carries amove-to-devprimary (different prose thanTypeOnlyDependencyFinding) plus the standardignoreDependenciesconfig suppress. - Thin
Wrapper Finding - Wire-shape envelope for a
ThinWrapperfinding. There is no safe auto-fix: inlining a thin wrapper at its call sites (or deleting it) is a design decision. The only action is a line-level suppress at the wrapper’s definition. The rule defaults tooff(opt-in health signal), so this finding is dormant by default. - Type
Only Dependency Finding - Wire-shape envelope for a
TypeOnlyDependencyfinding. Carries amove-to-devprimary plus the standardignoreDependenciesconfig suppress. - Unlisted
Dependency Finding - Wire-shape envelope for an
UnlistedDependencyfinding. Carries aninstall-dependencyprimary (non-auto-fixable) plus the standardignoreDependenciesconfig suppress. - Unprovided
Inject Finding - Wire-shape envelope for an
UnprovidedInjectfinding. There is no safe auto-fix: the fix is binary but judgement-bearing (add aprovidefor the key, or delete the dead inject). The only action is a line-level suppress. - Unrendered
Component Finding - Wire-shape envelope for an
UnrenderedComponentfinding. There is no safe auto-fix: the fix is binary but judgement-bearing (render the component somewhere, or delete the dead component). The only action is a line-level suppress. - Unresolved
Catalog Reference Finding - Wire-shape envelope for an
UnresolvedCatalogReferencefinding. The primary action at position 0 discriminates onavailable_in_catalogs:add-catalog-entrywhen the array is empty (no other catalog declares the package), orupdate-catalog-referencewhen at least one alternative exists. When exactly one alternative exists, the action also carriessuggested_targetso deterministic agents can land the edit without picking from a list. - Unresolved
Import Finding - Wire-shape envelope for an
UnresolvedImportfinding. MirrorsUnusedFileFinding: flattens the bare finding and carries a typedactionsarray (resolve-importprimary plus config and inline suppression actions). - Unused
Catalog Entry Finding - Wire-shape envelope for an
UnusedCatalogEntryfinding. Per-instanceauto_fixableflips tofalsewhenhardcoded_consumersis non-empty: the entry cannot be removed safely while a workspace package still pins the same package via a hardcoded version range. - Unused
Class Member Finding - Wire-shape envelope for an
UnusedMemberfinding consumed under theunused_class_memberskey. Same Rust struct asUnusedEnumMemberFinding; the fix action and suppress comment carry the class-member kebab-case identifier instead. - Unused
Component Emit Finding - Wire-shape envelope for an
UnusedComponentEmitfinding. There is no safe auto-fix: removing a declared emit is judgement-bearing (the event may be part of a deliberately-stable public component API). The only action is a line-level suppress at the emit declaration. - Unused
Component Prop Finding - Wire-shape envelope for an
UnusedComponentPropfinding. There is no safe auto-fix: removing a declared prop is judgement-bearing (the prop may be part of a deliberately-stable public component API). The only action is a line-level suppress at the prop declaration. - Unused
Dependency Finding - Wire-shape envelope for an
UnusedDependencyfinding consumed under theunused_dependencieskey (production deps). Flattens the bare finding; the typedactionsarray carries either aremove-dependencyormove-dependencyprimary depending oninner.used_in_workspaces. - Unused
Dependency Override Finding - Wire-shape envelope for an
UnusedDependencyOverridefinding. Carries aremove-dependency-overrideprimary plus anadd-to-configignoreDependencyOverridessuppress scoped to the target package and declaration source. - Unused
DevDependency Finding - Wire-shape envelope for an
UnusedDependencyfinding consumed under theunused_dev_dependencieskey. Same bare struct asUnusedDependencyFinding; the fix description points atdevDependenciesand the suppress comment usesunused-dev-dependency. - Unused
Enum Member Finding - Wire-shape envelope for an
UnusedMemberfinding consumed under theunused_enum_memberskey. - Unused
Export Finding - Wire-shape envelope for an
UnusedExportfinding consumed under theunused_exportskey. Same Rust struct asUnusedTypeFinding, with a different fix description so consumers can tell value-export from type-export removal at the action level. - Unused
File Finding - Wire-shape envelope for an
UnusedFilefinding. The bare finding flattens in via#[serde(flatten)], with a typedactionsarray populated at construction time and the audit-passintroducedflag attached as an optional sibling. - Unused
Load Data KeyFinding - Wire-shape envelope for an
UnusedLoadDataKeyfinding. There is no safe auto-fix: aload()fetch can have side effects, so deleting the key is a human call. The only action is a line-level suppress. - Unused
Optional Dependency Finding - Wire-shape envelope for an
UnusedDependencyfinding consumed under theunused_optional_dependencieskey. Same bare struct asUnusedDependencyFinding; the fix description points atoptionalDependencies. Reuses theunused-dependencysuppressIssueKindbecause there is no dedicated variant for optional deps. - Unused
Server Action Finding - Wire-shape envelope for an
UnusedServerActionfinding. There is no safe auto-fix: the fix is binary but judgement-bearing (wire the action up to a consumer, or delete it). The only action is a line-level suppress. - Unused
Store Member Finding - Wire-shape envelope for an
UnusedMemberfinding consumed under theunused_store_memberskey (a Piniastate/getters/actionskey, or a setup-store returned key, declared but never accessed by any consumer project-wide). Same Rust struct asUnusedClassMemberFinding. Emits only a line-level suppress action: there is no safe auto-fix because a store member can be accessed reflectively (a Pinia plugin,store.$onAction, or dynamic dispatch) in ways syntactic analysis cannot see, so removal is a behavioral change the user must own. - Unused
Type Finding - Wire-shape envelope for an
UnusedExportfinding consumed under theunused_typeskey. Wraps the same bareUnusedExportstruct asUnusedExportFindingbut emits a fix action targeted at type-only declarations, with the sameis_re_export-aware note swap.
Constants§
- NAMESPACE_
BARREL_ HINT - Shared note for the
duplicate-exportsfix action. Mirrors the const used by the human report (seecrates/cli/src/report/shared.rs); kept here so the wire-format builder reads from the same source of truth.