v0.3.11-pre.008

This commit is contained in:
2026-09-08 12:28:51 +02:00
parent ed6c0ac10c
commit 22c88c449d
13 changed files with 1241 additions and 88 deletions

View File

@@ -1,5 +1,5 @@
// file: crates/ksp-worker-raw-transaction-ingest-lib/tests/dependency_boundary.rs
// version: 6
// version: 7
//! Dependency firewall canaries for the RAW transaction ingest Worker foundation.
@@ -52,25 +52,31 @@ fn pre_002_manifest_keeps_forbidden_layers_and_live_sources_out() {
}
#[test]
fn pre_007_source_surface_adds_private_normal_store_persistence_without_backend_or_live_source() {
fn pre_008_source_surface_adds_one_latest_value_snapshot_watch_without_backend_or_live_source() {
let root = include_str!("../src/lib.rs");
let runtime = include_str!("../src/runtime.rs");
let admission = include_str!("../src/admission.rs");
let persistence = include_str!("../src/persistence.rs");
let snapshot = include_str!("../src/snapshot.rs");
for required in [
"tokio::sync::mpsc::channel",
"canonicalize_raw_transaction",
"assemble_raw_transaction_acquisition",
"RawTransactionIngestPersistencePort",
"persist_raw_transaction_acquisition",
"RawTransactionAcquisitionMode::Normal",
"persistence_concurrency()",
"ERROR_CODE_RAW_TRANSACTION_INGEST_CONTENT_CONFLICT",
"ERROR_CODE_RAW_TRANSACTION_INGEST_STORE_FAILED",
"RawTransactionIngestSnapshot",
"RawTransactionIngestSnapshotSource",
"WorkerSnapshotSource",
"tokio::sync::watch::channel",
"ERROR_CODE_RAW_TRANSACTION_INGEST_COUNTER_EXHAUSTED",
] {
assert!(
root.contains(required) || runtime.contains(required) || admission.contains(required) || persistence.contains(required),
"required pre.007 persistence contract missing: {required}"
root.contains(required)
|| runtime.contains(required)
|| admission.contains(required)
|| persistence.contains(required)
|| snapshot.contains(required),
"required pre.008 snapshot contract missing: {required}"
);
}
for forbidden in [
@@ -80,15 +86,21 @@ fn pre_007_source_surface_adds_private_normal_store_persistence_without_backend_
"unbounded_channel",
"ksp_store_postgres_lib::",
"ksp_onchain_transport_lib::",
"RawTransactionIngestSnapshot",
"WorkerSnapshotSource",
"ForceRehydrate",
"source_failed",
"drain_timeout",
] {
assert!(
!root.contains(forbidden) && !runtime.contains(forbidden) && !admission.contains(forbidden) && !persistence.contains(forbidden),
"pre.007 crossed a forbidden runtime boundary: {forbidden}"
!root.contains(forbidden)
&& !runtime.contains(forbidden)
&& !admission.contains(forbidden)
&& !persistence.contains(forbidden)
&& !snapshot.contains(forbidden),
"pre.008 crossed a forbidden runtime boundary: {forbidden}"
);
}
assert_eq!(runtime.matches("tokio::sync::watch::channel").count(), 2, "runtime retains only the external-control and private-source stop watches");
assert_eq!(snapshot.matches("tokio::sync::watch::channel").count(), 1, "exactly one shared concrete snapshot watch is allowed");
return;
}