Expand description
gen-cargo — Cargo adapter for the gen ecosystem.
Reads a Cargo workspace (or single-crate repo) + its lockfile and
emits a typed gen_types::Manifest. The cargo half of the
universal package-manager engine — one of N adapters that share a
single typed IR. See theory/GEN.md for the design.
use std::path::Path;
let manifest = gen_cargo::parse(Path::new("/path/to/workspace")).unwrap();
assert!(manifest.package_count() >= 1);Re-exports§
pub use adapter::ctx_for;pub use adapter::CargoAdapter;pub use error::CargoError;pub use error::Result;
Modules§
- adapter
CargoAdapter— gen-cargo’s implementation of the canonicalgen_types::Adaptertrait.- build_
spec Cargo.build-spec.json— the canonical complete typed build manifest.- convert
- Conversion: raw cargo TOML/lock shapes → typed
gen_typesIR. Keeps the deserialization layer incrate::rawdumb and pushes every Cargo-ism (workspace inheritance, dep-source shape, version quirks) here. New Cargo features land here, not inraw.rs. - diagnostics
- Typed gen-cargo diagnostics — non-fatal observations about a spec that the operator should address even though the spec is still well-formed cargo-wise.
- ecosystem_
impl - gen-cargo’s binding to the universal
gen_types::ecosystemtrait surface. Three trait impls bring Cargo into the cross-ecosystem intake pattern (seetheory/ECOSYSTEM-INTAKE.md). - error
- Typed errors emitted by the cargo adapter. Every parse failure goes through one variant — operators get a structured cause + filename + line where possible, never a stringly-typed message.
- features
- Cargo.features.json — vendored feature-resolution sidecar.
- fleet_
commit gen fleet-commit— typed multi-repo commit + push primitive.- fleet_
migrate gen fleet-migrate— DELTA-ONLY fleet migration engine.- fleet_
sweep gen fleet-sweep— algorithmic fleet rollout primitive.- fleet_
verify gen fleet-verify— typed read-only verification that a fleet of repos reached the DELTA-ONLY end state.- gen_
build_ job GenBuildJob— typed shigoto Job for “regenerate one repo’s BuildSpec.” The fourth shigoto-native Job kind in the fleet (after tend’spull-repo/status-repo/fetch-repo/sync-repo); first in the gen domain.- gen_
delta gen-cargoslim resolver-delta —Cargo.gen.lock.- git_
prefetcher GitPrefetcher— Rust-native git prefetch primitive.- invariants
- Algorithmic invariants every
BuildSpecmust satisfy. - lock_
lifecycle - Typed lock-lifecycle primitive for transient cargo locks.
- path_
resolver - Typed resolver for external path-deps.
- platform_
features - Typed
PlatformFeatureRegistry— the canonical knowledge of “which third-party upstream crates have platform-specific features in their default-feature set that can leak across cargo’s global feature unification.” - quirks
- Typed
CrateQuirkregistry — the canonical knowledge of “which third-party upstream crates need which buildRustCrate class-helper applied.” - raw
- Raw serde shapes that mirror Cargo’s on-disk TOML. These exist
only as the deserialization surface — they are converted to the
typed
gen_typesIR bycrate::convert. Keep this module straight serde with no business logic; bugs in the conversion belong inconvert.rs, not here.