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) 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
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. - Empty
Catalog Group Finding - Wire-shape envelope for an
EmptyCatalogGroupfinding. Carries a straightforwardremove-empty-catalog-groupprimary plus a YAML-comment 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). - Private
Type Leak Finding - Wire-shape envelope for a
PrivateTypeLeakfinding. MirrorsUnusedFileFinding: flattens the bare finding and carries a typedactionsarray (export-typeprimary plussuppress-linesecondary). - Test
Only Dependency Finding - Wire-shape envelope for a
TestOnlyDependencyfinding. Carries amove-to-devprimary (different prose thanTypeOnlyDependencyFinding) plus the standardignoreDependenciesconfig suppress. - 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. - 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 plussuppress-linesecondary). - 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
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
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
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.