Demote static cfgsync helpers

This commit is contained in:
andrussal 2026-03-12 08:11:25 +01:00
parent 4d19570a71
commit ec4c42244a
4 changed files with 16 additions and 6 deletions

View File

@ -34,7 +34,7 @@ This crate is the application-facing integration layer. The main concepts are `R
The adapter answers one question: given the current registration snapshot, are artifacts ready yet, and if so, what should be served?
The crate also includes reusable wrappers such as `CachedSnapshotMaterializer`, `PersistingSnapshotMaterializer`, and `RegistrationConfigSource`. `DeploymentAdapter` still exists as a helper for static deployment-driven rendering, but it is a secondary API. The main cfgsync model is registration-backed materialization.
The crate also includes reusable wrappers such as `CachedSnapshotMaterializer`, `PersistingSnapshotMaterializer`, and `RegistrationConfigSource`. Static deployment-driven rendering still exists, but it lives under `cfgsync_adapter::static_deployment` as a secondary helper path. The main cfgsync model is registration-backed materialization.
### `cfgsync-runtime`
@ -64,7 +64,7 @@ Static bundle mode still exists because it is useful when artifacts are already
That is appropriate for fully precomputed topologies, deterministic fixtures, and test setups where no runtime coordination is needed. In that mode, cfgsync serves from `NodeArtifactsBundle` through `BundleConfigSource`.
Bundle mode is useful, but it is not the defining idea of the library anymore. The primary model is registration-backed materialization.
Bundle mode is useful, but it is not the defining idea of the library anymore. The primary model is registration-backed materialization, and the static helpers are intentionally kept off the main adapter surface.
## Example: typed registration metadata

View File

@ -5,10 +5,20 @@ mod registrations;
mod sources;
pub use artifacts::MaterializedArtifacts;
pub use deployment::{BuildCfgsyncNodesError, DeploymentAdapter, build_materialized_artifacts};
pub use materializer::{
CachedSnapshotMaterializer, DynCfgsyncError, MaterializationResult, MaterializedArtifactsSink,
PersistingSnapshotMaterializer, RegistrationSnapshotMaterializer,
};
pub use registrations::RegistrationSnapshot;
pub use sources::RegistrationConfigSource;
/// Static deployment helpers for precomputed cfgsync artifact generation.
///
/// This module is intentionally secondary to the registration-backed
/// materializer flow. Use it when artifacts are already determined by a
/// deployment plan and do not need runtime registration to become available.
pub mod static_deployment {
pub use super::deployment::{
BuildCfgsyncNodesError, DeploymentAdapter, build_materialized_artifacts,
};
}

View File

@ -1,5 +1,5 @@
use anyhow::Result;
use cfgsync_adapter::{DeploymentAdapter, build_materialized_artifacts};
use cfgsync_adapter::static_deployment::{DeploymentAdapter, build_materialized_artifacts};
pub(crate) use cfgsync_core::render::CfgsyncOutputPaths;
use cfgsync_core::{
NodeArtifactsBundle, NodeArtifactsBundleEntry,

View File

@ -1,5 +1,5 @@
pub use cfgsync_adapter::*;
#[doc(hidden)]
pub use cfgsync_adapter::{
pub use cfgsync_adapter::static_deployment::{
DeploymentAdapter as CfgsyncEnv, build_materialized_artifacts as build_cfgsync_node_catalog,
};
pub use cfgsync_adapter::*;