Skip to main content

clawft_kernel/cog_ingest/
mod.rs

1//! Cog ingest bridge (mesh-placement-10; ADR-100 section 4 and the
2//! "Decision 5 resolved" amendment).
3//!
4//! A placed cog posts its feature vectors to `POST /api/v1/store/ingest`
5//! with its `COGNITUM_COG_TOKEN`. This module is where that request ends:
6//!
7//! - [`types`]: the request contract and its validation.
8//! - [`registry`]: per-instance tokens bound to the placing project, the
9//!   per-instance rate budget, and the [`StoreRouter`].
10//! - [`bridge`]: the node-local HTTP server.
11//! - [`forward`]: [`LocalForwarder`] and [`MeshForwarder`] to the store owner
12//!   as signed `MeshIpcEnvelope`s.
13//! - [`owner`]: the owner's [`StoreOwnerService`] and its policy.
14//! - [`store`]: the [`IngestStore`] a project's kernel owns.
15//! - [`udp`]: the optional ESP32 feed relay into a container.
16//!
17//! Ingested vectors belong to the project that placed the cog. Whatever the
18//! cog prints on stdout is evidence for logs only and never reaches a store.
19
20pub mod bridge;
21pub mod forward;
22pub mod hooks;
23pub mod owner;
24pub mod registry;
25pub mod store;
26pub mod store_log;
27pub mod types;
28pub mod udp;
29#[cfg(feature = "ecc")]
30pub mod vector_dir;
31
32#[cfg(test)]
33mod tests;
34#[cfg(test)]
35mod tests_forward;
36#[cfg(all(test, feature = "ecc"))]
37mod tests_persist;
38
39pub use bridge::{BridgeConfig, BridgeHandle, BridgeScope, BridgeStats, IngestBridge};
40pub use forward::{
41    ForwardRefusal, ForwardRequest, Forwarder, LocalForwarder, MeshForwarder, STORE_INGEST_METHOD,
42    STORE_SERVICE,
43};
44pub use hooks::{IngestHooks, IngestLease, ProjectDirectory};
45pub use owner::{ForwardPolicy, KeyPolicy, OwnerConnector, StoreOwnerService};
46pub use registry::{InstanceBinding, RateBudget, StaticRouter, StoreRouter, TokenRegistry};
47#[cfg(feature = "ecc")]
48pub use store::VectorBackendStore;
49#[cfg(feature = "ecc")]
50pub use vector_dir::VectorDirectory;
51pub use store::{
52    Hit, IngestOutcome, IngestStore, MemoryIngestStore, Provenance, StaticDirectory, StoreDirectory,
53    StoreError,
54};
55pub use types::{
56    DIMS, INGEST_PATH, IngestBatch, IngestError, IngestVector, parse_batch, valid_project_id,
57};
58pub use udp::{UdpForwardConfig, UdpForwarder};