Skip to main content

fallow_api/
output_contracts.rs

1//! Concrete output-contract aliases shared by schema and adapter crates.
2
3/// Concrete `fallow audit` envelope with this crate's verdict, summary, and
4/// attribution payloads filled into the generic output shell.
5pub type AuditOutput = fallow_output::AuditOutput<
6    crate::AuditVerdict,
7    crate::AuditSummary,
8    crate::AuditAttribution,
9    fallow_output::CheckOutput,
10    crate::DupesReportPayload,
11    fallow_output::HealthReport,
12>;
13
14/// Concrete combined check + dupes + health envelope for full analyses.
15pub type CombinedOutput = fallow_output::CombinedOutput<
16    fallow_output::CheckOutput,
17    crate::DupesReportPayload,
18    fallow_output::HealthReport,
19>;
20
21/// Concrete `fallow list boundaries` envelope with config-crate group and
22/// rule payloads.
23pub type ListBoundariesOutput = fallow_output::ListBoundariesOutput<
24    fallow_config::LogicalGroupStatus,
25    fallow_config::AuthoredRule,
26>;
27
28/// Concrete `fallow list workspaces` envelope with config-crate diagnostics.
29pub type WorkspacesOutput = fallow_output::WorkspacesOutput<fallow_config::WorkspaceDiagnostic>;
30
31/// Concrete boundaries listing body used inside list envelopes.
32pub type BoundariesListing = fallow_output::BoundariesListing<
33    fallow_config::LogicalGroupStatus,
34    fallow_config::AuthoredRule,
35>;
36
37/// Re-export of the boundaries zone row so adapters need only this crate.
38pub type BoundariesListZone = fallow_output::BoundariesListZone;
39
40/// Re-export of the boundaries rule row so adapters need only this crate.
41pub type BoundariesListRule = fallow_output::BoundariesListRule;
42
43/// Concrete logical-group row with config-crate status and rule payloads.
44pub type BoundariesListLogicalGroup = fallow_output::BoundariesListLogicalGroup<
45    fallow_config::LogicalGroupStatus,
46    fallow_config::AuthoredRule,
47>;
48
49/// Concrete `fallow list` body combining plugins, files, entry points,
50/// boundaries, and workspaces sections.
51pub type ListOutput =
52    fallow_output::ListOutput<BoundariesListing, fallow_config::WorkspaceDiagnostic>;
53
54/// Re-export of the entry-point row so adapters need only this crate.
55pub type ListEntryPointOutput = fallow_output::ListEntryPointOutput;
56
57/// Re-export of the plugin row so adapters need only this crate.
58pub type ListPluginOutput = fallow_output::ListPluginOutput;
59
60/// Concrete security gate with this crate's gate-mode payload.
61pub type SecurityGate = fallow_output::SecurityGate<crate::SecurityGateMode>;
62
63/// Concrete security output configuration with config-crate severities.
64pub type SecurityOutputConfig = fallow_output::SecurityOutputConfig<fallow_config::Severity>;
65
66/// Concrete `fallow security` summary envelope.
67pub type SecuritySummaryOutput =
68    fallow_output::SecuritySummaryOutput<SecurityOutputConfig, SecurityGate>;
69
70/// Concrete full `fallow security` envelope.
71pub type SecurityOutput = fallow_output::SecurityOutput<SecurityOutputConfig, SecurityGate>;
72
73/// Union of every `fallow trace` payload shape.
74///
75/// Serialized untagged: the JSON body is exactly one of the trace shapes with
76/// no discriminant field, so consumers dispatch on structure.
77#[derive(Debug, serde::Serialize)]
78#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
79#[serde(untagged)]
80pub enum TraceOutput {
81    /// Trace of a single export's usage.
82    Export(Box<fallow_types::trace::ExportTrace>),
83    /// Trace of a single class member's usage.
84    ClassMember(Box<fallow_types::trace::ClassMemberTrace>),
85    /// Trace of a file's reachability.
86    File(Box<fallow_types::trace::FileTrace>),
87    /// Trace of a dependency's usage.
88    Dependency(Box<fallow_types::trace::DependencyTrace>),
89    /// Trace of a clone group's instances.
90    Clone(Box<fallow_types::trace::CloneTrace>),
91    /// Transitive impact closure for a changed file set.
92    ImpactClosure(Box<fallow_types::trace::ImpactClosureTrace>),
93    /// Symbol-level call chain trace.
94    SymbolChain(Box<fallow_types::trace_chain::SymbolChainTrace>),
95    /// Type-aware semantic symbol trace.
96    SemanticSymbol(Box<fallow_types::semantic::SemanticSymbolTrace>),
97}
98
99/// Union of `fallow impact` payload shapes, serialized untagged like
100/// [`TraceOutput`].
101#[derive(Debug, Clone, serde::Serialize)]
102#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
103#[serde(untagged)]
104pub enum ImpactOutput {
105    /// Project-level impact report for a changed file set.
106    Project(Box<fallow_output::ImpactReport>),
107    /// Type-aware impact for a single semantic symbol.
108    SemanticSymbol(Box<fallow_types::semantic::SemanticSymbolImpact>),
109}
110
111/// Concrete review-brief wire envelope with every typed section filled in.
112#[allow(
113    clippy::type_complexity,
114    reason = "the concrete review brief contract names every typed wire section"
115)]
116pub type ReviewBriefWireOutput = fallow_output::ReviewBriefWireOutput<
117    fallow_output::FocusMap,
118    fallow_output::WeakeningSignal,
119    fallow_output::RoutingFacts,
120    fallow_output::DecisionSurface,
121    crate::AuditVerdict,
122    crate::AuditSummary,
123    crate::AuditAttribution,
124    fallow_output::CheckOutput,
125    crate::DupesReportPayload,
126    fallow_output::HealthReport,
127>;
128
129/// Raw opt-in semantic similar-code candidate envelope.
130pub type SimilarCodeOutput = fallow_output::SimilarCodeOutput;
131
132/// Bounded exact-candidate handoff for source-grounded inspection.
133pub type SimilarCodeCandidateSnapshot = fallow_output::SimilarCodeCandidateSnapshot;
134
135/// Bounded source-grounded packet for one semantic candidate.
136pub type SimilarCodeInspectOutput = fallow_output::SimilarCodeInspectOutput;
137
138/// Semantic candidates joined with a separate verdict document.
139pub type SimilarCodeReviewOutput = fallow_output::SimilarCodeReviewOutput;
140
141/// Local-provider and pinned-model readiness envelope.
142pub type SimilarCodeStatusOutput = fallow_output::SimilarCodeStatusOutput;
143
144/// Project-local vector-cache clear result.
145pub type SimilarCodeCacheClearOutput = fallow_output::SimilarCodeCacheClearOutput;
146
147/// Versioned verdict document accepted by similar-code review.
148pub type SimilarCodeVerdictInput = fallow_output::SimilarCodeVerdictInput;
149
150/// Concrete root output union covering every fallow command payload; this is
151/// the top-level shape the published JSON schema is generated from.
152#[allow(
153    clippy::type_complexity,
154    reason = "concrete root union intentionally fills every output payload slot"
155)]
156pub type FallowOutput = fallow_output::FallowOutput<
157    AuditOutput,
158    fallow_output::ExplainOutput,
159    fallow_output::InspectOutput,
160    TraceOutput,
161    fallow_output::ReviewEnvelopeOutput,
162    fallow_output::ReviewReconcileOutput,
163    fallow_output::CoverageSetupOutput,
164    fallow_output::CoverageAnalyzeOutput,
165    ListBoundariesOutput,
166    WorkspacesOutput,
167    fallow_output::HealthOutput<fallow_output::HealthReport, fallow_output::HealthGroup>,
168    fallow_output::DupesOutput<crate::DupesReportPayload, crate::DuplicationGroup>,
169    fallow_output::CheckGroupedOutput,
170    ImpactOutput,
171    fallow_output::CrossRepoImpactReport,
172    SecuritySummaryOutput,
173    SecurityOutput,
174    fallow_output::SecuritySurvivorsOutput,
175    fallow_output::SecurityBlindSpotsOutput,
176    fallow_output::CheckOutput,
177    CombinedOutput,
178    fallow_output::FeatureFlagsOutput,
179    ReviewBriefWireOutput,
180    fallow_output::DecisionSurfaceOutput,
181    fallow_output::StandardWalkthroughGuide,
182    fallow_output::WalkthroughValidation,
183    fallow_output::SuppressionInventoryOutput,
184    fallow_output::TypeAwareStatusOutput,
185    SimilarCodeOutput,
186    SimilarCodeInspectOutput,
187    SimilarCodeReviewOutput,
188    SimilarCodeStatusOutput,
189    SimilarCodeCacheClearOutput,
190>;