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::CombinedDupesSection,
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    /// Shortest import path between two modules.
94    ImportPath(Box<fallow_types::trace::ImportPathTrace>),
95    /// Symbol-level call chain trace.
96    SymbolChain(Box<fallow_types::trace_chain::SymbolChainTrace>),
97    /// Type-aware semantic symbol trace.
98    SemanticSymbol(Box<fallow_types::semantic::SemanticSymbolTrace>),
99}
100
101/// Union of `fallow impact` payload shapes, serialized untagged like
102/// [`TraceOutput`].
103#[derive(Debug, Clone, serde::Serialize)]
104#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
105#[serde(untagged)]
106pub enum ImpactOutput {
107    /// Project-level impact report for a changed file set.
108    Project(Box<fallow_output::ImpactReport>),
109    /// Type-aware impact for a single semantic symbol.
110    SemanticSymbol(Box<fallow_types::semantic::SemanticSymbolImpact>),
111}
112
113/// Concrete review-brief wire envelope with every typed section filled in.
114pub type ReviewBriefWireOutput = fallow_output::ReviewBriefWireOutput<
115    fallow_output::FocusMap,
116    fallow_output::WeakeningSignal,
117    fallow_output::RoutingFacts,
118    fallow_output::DecisionSurface,
119    crate::AuditVerdict,
120    crate::AuditSummary,
121    crate::AuditAttribution,
122    fallow_output::CheckOutput,
123    crate::DupesReportPayload,
124    fallow_output::HealthReport,
125>;
126
127/// Raw opt-in semantic similar-code candidate envelope.
128pub type SimilarCodeOutput = fallow_output::SimilarCodeOutput;
129
130/// Bounded exact-candidate handoff for source-grounded inspection.
131pub type SimilarCodeCandidateSnapshot = fallow_output::SimilarCodeCandidateSnapshot;
132
133/// Bounded source-grounded packet for one semantic candidate.
134pub type SimilarCodeInspectOutput = fallow_output::SimilarCodeInspectOutput;
135
136/// Semantic candidates joined with a separate verdict document.
137pub type SimilarCodeReviewOutput = fallow_output::SimilarCodeReviewOutput;
138
139/// Local-provider and pinned-model readiness envelope.
140pub type SimilarCodeStatusOutput = fallow_output::SimilarCodeStatusOutput;
141
142/// Project-local vector-cache clear result.
143pub type SimilarCodeCacheClearOutput = fallow_output::SimilarCodeCacheClearOutput;
144
145/// Versioned verdict document accepted by similar-code review.
146pub type SimilarCodeVerdictInput = fallow_output::SimilarCodeVerdictInput;
147
148/// Concrete root output union covering every fallow command payload; this is
149/// the top-level shape the published JSON schema is generated from.
150pub type FallowOutput = fallow_output::FallowOutput<
151    AuditOutput,
152    fallow_output::ExplainOutput,
153    fallow_output::InspectOutput,
154    TraceOutput,
155    fallow_types::trace_error::ErrorTrace,
156    fallow_output::ReviewEnvelopeOutput,
157    fallow_output::ReviewReconcileOutput,
158    fallow_output::CoverageSetupOutput,
159    fallow_output::CoverageAnalyzeOutput,
160    ListBoundariesOutput,
161    WorkspacesOutput,
162    fallow_output::HealthOutput<fallow_output::HealthReport, fallow_output::HealthGroup>,
163    fallow_output::DupesOutput<crate::DupesReportPayload, crate::DuplicationGroup>,
164    fallow_output::CheckGroupedOutput,
165    fallow_output::CheckGroupedOutput,
166    ImpactOutput,
167    fallow_output::CrossRepoImpactReport,
168    SecuritySummaryOutput,
169    SecurityOutput,
170    fallow_output::SecuritySurvivorsOutput,
171    fallow_output::SecurityBlindSpotsOutput,
172    fallow_output::CheckOutput,
173    fallow_output::CheckOutput,
174    CombinedOutput,
175    fallow_output::FeatureFlagsOutput,
176    ReviewBriefWireOutput,
177    fallow_output::DecisionSurfaceOutput,
178    fallow_output::StandardWalkthroughGuide,
179    fallow_output::WalkthroughValidation,
180    fallow_output::SuppressionInventoryOutput,
181    fallow_output::DoctorOutput,
182    fallow_output::TypeAwareStatusOutput,
183    SimilarCodeOutput,
184    SimilarCodeInspectOutput,
185    SimilarCodeReviewOutput,
186    SimilarCodeStatusOutput,
187    SimilarCodeCacheClearOutput,
188    fallow_output::MutationReport,
189    fallow_output::MutationPlanOutput,
190    fallow_output::MutationInspectOutput,
191    fallow_output::MutationTasksOutput,
192>;