Skip to main content

Module conformance

Module conformance 

Source
Expand description

Conformance suites for kernel store backends (spec 3.2 §11, §13 Q8; feature conformance).

adk-core cannot depend on adk-kernel, so the kernel’s suites live here, in the form of adk_core::conformance: a harness trait that opens the backend, one public function per case, and a macro that generates one #[tokio::test] per case.

StoreHarnessTest macroCases
ProcessStoreProcessStoreHarnessprocess_store_conformance_tests!process_store
AgendaStoreAgendaStoreHarnessagenda_store_conformance_tests!agenda_store
AgentStore (spec 3.3 §10 K7)AgentStoreHarnessagent_store_conformance_tests!agent_store
drivers::DriverStore (feature drivers)DriverStoreHarnessdriver_store_conformance_tests!driver_store
proc::LedgerStore (feature proc)LedgerStoreHarnessledger_store_conformance_tests!ledger_store
DeviceStore (spec 3.3 §10 K2)DeviceStoreHarnessdevice_store_conformance_tests!device_store
channels::ChannelBindingStore (feature channels; spec 3.3 §10 K1)ChannelBindingStoreHarnesschannel_binding_store_conformance_tests!channel_binding_store
PartitionStorePartitionStoreHarnesspartition_store_conformance_tests!partition_store
ControlStore (spec 3.3 §10 K3, K4)ControlStoreHarnesscontrol_store_conformance_tests!control_store
CronWatermarkStoreCronWatermarkStoreHarnesscron_watermark_store_conformance_tests!cron_watermark_store
The charter, KPI, autonomy and signal stores (feature charter; spec 3.5 §7.10, §7.11)charter::*Harnesscharter_store_conformance_tests!, kpi_store_conformance_tests!, autonomy_store_conformance_tests!, signal_store_conformance_tests!charter

Chat channel adapters pass channel_contract (feature channels; spec 3.3 §10 K1): a ChannelAdapterHarness makes a fresh adapter per case and channel_contract_tests! generates the tests, which run the adapter under the kernel’s gateway and check what it put on the wire.

In-memory and SQLite run on the PR tier; PostgreSQL and Redis run in the CI postgres job, #[ignore]d elsewhere.

A harness opens the backend; each call to open returns a new handle over the same data, as a restarted or second process would see it. Each case writes under fresh process ids, so a harness may point every case at one shared database. The macros need tokio with the macros and rt-multi-thread features in the calling crate, and apply the attributes written before harness = to every generated test.

§Example

ⓘ
use std::sync::Arc;
use adk_kernel::conformance::ProcessStoreHarness;
use adk_kernel::{InMemoryProcessStore, ProcessStore};

struct InMemory;

#[async_trait::async_trait]
impl ProcessStoreHarness for InMemory {
    async fn open(&self) -> Arc<dyn ProcessStore> {
        Arc::new(InMemoryProcessStore::new())
    }

    fn is_durable(&self) -> bool {
        false
    }
}

adk_kernel::process_store_conformance_tests! { harness = InMemory }

Re-exports§

pub use agenda_store::AgendaStoreHarness;
pub use agent_store::AgentStoreHarness;
pub use channel_binding_store::ChannelBindingStoreHarness;
pub use channel_contract::ChannelAdapter;
pub use channel_contract::ChannelAdapterHarness;
pub use channel_contract::ContractHost;
pub use control_store::ControlStoreHarness;
pub use cron_watermark_store::CronWatermarkStoreHarness;
pub use device_store::DeviceStoreHarness;
pub use driver_store::DriverStoreHarness;
pub use ledger_store::LedgerStoreHarness;
pub use partition_store::PartitionStoreHarness;
pub use process_store::ProcessStoreHarness;

Modules§

agenda_store
Conformance cases for AgendaStore backends (spec 3.2 §7.5, §11, §13 Q8).
agent_store
Conformance cases for AgentStore backends (spec 3.3 §5.7, §10 K7, S-I14).
channel_binding_store
Conformance cases for ChannelBindingStore backends (spec 3.3 §10 K1; feature channels).
channel_contract
The contract every chat channel adapter passes (spec 3.3 §5.3, §7.2, §10 K1, §11 S-I2, S-I5, S-I6, S-I10; feature channels).
charter
Conformance suites for the charter module’s stores (spec 3.5 §7.10, §7.11, §11; features charter and conformance).
control_store
Conformance cases for ControlStore backends (spec 3.3 §10 K3, K4).
cron_watermark_store
Conformance cases for CronWatermarkStore backends (spec 3.2 §7.4, §11, §13 Q8).
device_store
Conformance cases for DeviceStore backends (spec 3.3 §10 K2, §11 S-I7).
driver_store
Conformance cases for DriverStore backends (spec 3.2 §7.7, §11, §13 Q8).
ledger_store
Conformance cases for LedgerStore backends (spec 3.2 §7.10, §11, §13 Q8; features conformance and proc).
partition_store
Conformance cases for PartitionStore backends (spec 3.2 §7.8, §11, §13 Q8).
process_store
Conformance cases for ProcessStore backends (spec 3.2 §11, §13 Q8).