Expand description
gen-types — typed IR for the universal package-manager → build- system engine.
Foundation crate. Every adapter (gen-cargo, gen-npm, gen-bundler, gen-pip, gen-gomod, gen-helm, …) emits this shape; every renderer (gen-nix-incremental, gen-nix-bulk, gen-bazel, …) consumes it; every cache backend (gen-cache-attic, gen-cache-cachix, …) keys on it.
See theory/GEN.md for the full design — why universal lifting,
the 80/20 split, the trait architecture, the milestone plan.
§Shape
Manifest (1)
└─ packages: Vec<Package> (one per crate / gem / wheel / etc.)
├─ source: PackageSource (Registry | Git | Path | Local)
├─ dependencies: Vec<Dependency>
│ ├─ constraint: VersionConstraint
│ ├─ kind: DependencyKind (Direct | Build | Dev | Optional | Peer)
│ ├─ features_enabled: Vec<String>
│ └─ target_predicate: Option<TargetPredicate>
├─ features: Vec<Feature>
└─ build_steps: Vec<BuildStep>
└─ lockfile: Option<Lockfile>Every adapter is a thin Manifest-producer; every renderer is a thin Manifest-to-Derivation translator. The trait surface stays narrow.
Re-exports§
pub use adapter::adapter_by_name;pub use adapter::registered_adapter_names;pub use adapter::registered_adapters;pub use adapter::Adapter;pub use adapter::AdapterCtx;pub use adapter::AdapterError;pub use adapter::AdapterQuirkEntry;pub use adapter::AdapterRegistration;pub use adapter::AdapterResult;pub use adapter::BuildSpec as AdapterBuildSpec;pub use adapter::ConfirmReport;pub use adapter::DepChange;pub use adapter::DepEdge;pub use adapter::DependencyBump;pub use adapter::DispatcherVariant;pub use adapter::DiffRef;pub use adapter::DiffReport;pub use adapter::InvariantBreak;pub use adapter::LockOutcome;pub use adapter::Plan;pub use adapter::PlanIntent;pub use adapter::PlanWarning;pub use adapter::PlanWarningSeverity;pub use adapter::Sbom;pub use adapter::SbomFormat;pub use dispatcher::TypedDispatcher;pub use lock_lifecycle::LockError;pub use lock_lifecycle::LockLifecyclePrimitive;pub use ecosystem::Invariants;pub use ecosystem::QuirkRegistry;pub use ecosystem::Spec;pub use constraint::Combinator;pub use constraint::CompoundConstraint;pub use constraint::ConstraintSpec;pub use constraint::VersionConstraint;pub use dependency::Dependency;pub use dependency::DependencyKind;pub use derivation::BuildCommand;pub use derivation::BuildScript;pub use derivation::BuildStep;pub use derivation::BuildStepKind;pub use derivation::Derivation;pub use derivation::DerivationRef;pub use feature::Feature;pub use feature::FeatureRef;pub use lockfile::ContentHash;pub use lockfile::Lockfile;pub use lockfile::ResolvedPackage;pub use manifest::Manifest;pub use package::Package;pub use package::PackageId;pub use registry::Registry;pub use source::PackageSource;pub use target::CompoundTargetPredicate;pub use target::PredicateCombinator;pub use target::Target;pub use target::TargetPredicate;pub use version::Version;pub use workspace::Workspace;
Modules§
- adapter
- Canonical Adapter trait — the cross-ecosystem SDLC interface.
- constraint
- Typed
VersionConstraint— what versions a dependency accepts. - dependency
- Typed
Dependency— one edge in the package graph. - derivation
- Typed
Derivation— the renderer-side output. - dispatcher
TypedDispatcher— introspection trait every typed-variant enum implements via#[derive(TypedDispatcher)]in gen-macros.- ecosystem
- Cross-ecosystem trait surface.
- feature
- Typed
Feature— named compose-vector of optional capabilities. - lock_
lifecycle - Substrate-wide
LockLifecyclePrimitivetrait. - lockfile
- Typed
Lockfile— resolved, content-addressed dependency tree. - manifest
- Typed
Manifest— top-level adapter output. - package
- Typed
Package— one node in the dependency graph. - registry
- Typed
Registry— where a package was fetched from. - source
- Typed
PackageSource— where a package’s bits come from. - target
- Typed
TargetPredicate— conditional-dependency activation. - version
- Typed
Version— SemVer-compatible. Adapters convert their native version type (cargo’s [semver::Version], npm’s loose pre-release variants, RubyGems’ four-segment versions, PEP-440, …) into this canonical shape during parse. - workspace
- Typed
Workspace— multi-package project root.