Skip to main content

running_process/
daemon_registration.rs

1//! Frozen v1 manifest and service-definition registration substrate.
2//!
3//! The public modules here are the canonical owner of persisted registration.
4//! Legacy client-only `broker` paths re-export these exact items for source and
5//! type identity compatibility. Endpoint names, connection policy, client
6//! transport, and daemon runtime deliberately stay elsewhere.
7
8/// Narrow set of generated v1 messages needed to construct, persist, and
9/// inspect daemon registration records.
10pub mod protocol {
11    pub use running_process_protocol::broker::v1::{
12        BrokerIsolation, CacheManifest, CacheRoot, CacheRootKind, CleanupPolicy, DaemonProcess,
13        Endpoint, HostIdentity, ManifestRef, ObservabilityInfo, Operation, OperationKind,
14        Ownership, Quota, ServiceDefinition, StorageDisposition, TeardownHook, TeardownKind,
15    };
16}
17
18/// Name/version validation shared by registration and the legacy v1 broker.
19pub mod validation {
20    pub use crate::daemon_registration_common::validation::*;
21}
22
23/// Host facts stamped into a newly-built manifest.
24pub mod host_identity {
25    pub use crate::daemon_host_identity::{current, current_for_path};
26}
27
28pub(crate) use crate::daemon_registration_common::secure_dir;
29
30/// SHA-256 sealed v1 manifest persistence, default paths, and scanning.
31#[path = "broker/manifest.rs"]
32pub mod manifest;
33
34/// Validated v1 `.servicedef` persistence and loading.
35#[path = "broker/server/service_def_loader.rs"]
36pub mod service_def_loader;
37
38/// Fluent builders for the frozen v1 registration messages.
39#[path = "broker/builders.rs"]
40pub mod builders;
41
42#[cfg(all(test, feature = "client"))]
43mod compatibility_tests {
44    use std::any::TypeId;
45
46    #[test]
47    fn legacy_client_registration_paths_reexport_canonical_types() {
48        assert_eq!(
49            TypeId::of::<crate::daemon_registration::protocol::CacheManifest>(),
50            TypeId::of::<crate::broker::protocol::CacheManifest>(),
51        );
52        assert_eq!(
53            TypeId::of::<crate::daemon_registration::protocol::ServiceDefinition>(),
54            TypeId::of::<crate::broker::protocol::ServiceDefinition>(),
55        );
56        assert_eq!(
57            TypeId::of::<crate::daemon_registration::protocol::HostIdentity>(),
58            TypeId::of::<crate::broker::protocol::HostIdentity>(),
59        );
60        assert_eq!(
61            TypeId::of::<crate::daemon_registration::builders::CacheManifestBuilder>(),
62            TypeId::of::<crate::broker::builders::CacheManifestBuilder>(),
63        );
64        assert_eq!(
65            TypeId::of::<crate::daemon_registration::builders::ServiceDefinitionBuilder>(),
66            TypeId::of::<crate::broker::builders::ServiceDefinitionBuilder>(),
67        );
68        assert_eq!(
69            TypeId::of::<crate::daemon_registration::manifest::ManifestError>(),
70            TypeId::of::<crate::broker::manifest::ManifestError>(),
71        );
72        assert_eq!(
73            TypeId::of::<crate::daemon_registration::service_def_loader::ServiceDefinitionError>(),
74            TypeId::of::<crate::broker::server::service_def_loader::ServiceDefinitionError>(),
75        );
76    }
77}