Skip to main content

Crate tatara_rust_survey

Crate tatara_rust_survey 

Source
Expand description

tatara-rust-survey — adoption multiplier for the macro farm.

Walks Rust source via syn::parse_file, visits every impl block, and classifies each method body against the catalog of published pleme-io derives. Reports a typed RefactorCandidate punch list the operator can act on — either by hand or via a future survey-apply mode that uses syn::visit_mut to rewrite the file.

This is the discovery half of the structured adoption pipeline:

survey  →  apply  →  validate
  │         │          │
  │         │          └── cargo test on the modified crate;
  │         │              landed only when green
  │         └── syn::visit_mut transform; produces a diff
  └── identify candidates; produce typed RefactorCandidate values

Today we ship the four densest patterns from the 2026-05-28 fleet survey: GetterAll, SetterAll, WithBuilder, IsVariant. Each one is a detector that inspects a syn::ImplItem::Fn and returns Some(MatchedPattern) if the body matches the canonical derive shape exactly. New detectors plug in as one more enum variant + one more pattern-matching function.

Re-exports§

pub use apply::apply_to_source;
pub use apply::ApplyError;
pub use cargo_deps::inject_deps;
pub use cargo_deps::CargoDepsError;
pub use cargo_deps::DepSource;
pub use cargo_deps::InjectOutcome;
pub use detector::detectors;
pub use detector::Detector;
pub use fleet::survey_fleet;
pub use fleet::survey_fleet_apply;
pub use fleet::survey_fleet_validate;
pub use fleet::CandidateValidation;
pub use fleet::CrateSurveyEntry;
pub use fleet::FleetApplyEntry;
pub use fleet::FleetApplyOpts;
pub use fleet::FleetApplyReport;
pub use fleet::FleetSurveyReport;
pub use fleet::FleetValidateReport;
pub use fleet::ValidateOutcome;
pub use pipeline::apply_all_to_source;
pub use pipeline::survey_apply_validate;
pub use pipeline::FileOutcome;
pub use pipeline::PipelineError;
pub use pipeline::PipelineOpts;
pub use pipeline::PipelineOutcome;
pub use returns::fleet_returns;
pub use returns::first_party_frontier_2026_06;
pub use returns::Decision;
pub use returns::FleetReturnsReport;
pub use returns::FleetVerdict;
pub use returns::FrontierEstimate;
pub use returns::LiftCostModel;
pub use returns::PatternEconomics;
pub use returns::Readiness;

Modules§

apply
apply — syn::visit_mut transform that lands a RefactorCandidate.
cargo_deps
cargo_deps — format-preserving Cargo.toml dep injection.
detector
detector — typed per-pattern classifier registry.
fleet
fleet — multi-crate survey aggregator.
pipeline
pipeline — survey → apply → validate, the structured-and-proven adoption flow over a whole Cargo crate.
returns
returns — diminishing-returns economics for the macro farm.

Structs§

RefactorCandidate
One opportunity to replace a hand-written impl with a farm derive. The current_impl and loc_saved fields let apply produce a precise diff; the derive_crate field tells the operator which git dep to add.

Enums§

MatchedPattern
SurveyError

Functions§

survey_file
Walk a single .rs file and return every refactor candidate found.
survey_tree
Walk every .rs file under root recursively. Skips target/, .git/, and hidden directories.