Skip to main content

Crate gen_cargo

Crate gen_cargo 

Source
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 canonical gen_types::Adapter trait.
build_spec
Cargo.build-spec.json — the canonical complete typed build manifest.
convert
Conversion: raw cargo TOML/lock shapes → typed gen_types IR. Keeps the deserialization layer in crate::raw dumb and pushes every Cargo-ism (workspace inheritance, dep-source shape, version quirks) here. New Cargo features land here, not in raw.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::ecosystem trait surface. Three trait impls bring Cargo into the cross-ecosystem intake pattern (see theory/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’s pull-repo / status-repo / fetch-repo / sync-repo); first in the gen domain.
gen_delta
gen-cargo slim resolver-delta — Cargo.gen.lock.
git_prefetcher
GitPrefetcher — Rust-native git prefetch primitive.
invariants
Algorithmic invariants every BuildSpec must 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 CrateQuirk registry — 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_types IR by crate::convert. Keep this module straight serde with no business logic; bugs in the conversion belong in convert.rs, not here.

Functions§

parse
Parse the Cargo workspace (or single-crate repo) rooted at root into a typed Manifest. Reads <root>/Cargo.toml, every member crate’s Cargo.toml, and (if present) <root>/Cargo.lock.