v0.3.11-pre.004

This commit is contained in:
2026-09-08 10:11:07 +02:00
parent ec64be340e
commit a4061ee1e1
10 changed files with 602 additions and 23 deletions

View File

@@ -1,5 +1,5 @@
// file: crates/ksp-worker-raw-transaction-ingest-lib/tests/dependency_boundary.rs
// version: 2
// version: 3
//! Dependency firewall canaries for the RAW transaction ingest Worker foundation.
@@ -52,20 +52,30 @@ fn pre_002_manifest_keeps_forbidden_layers_and_live_sources_out() {
}
#[test]
fn pre_003_source_surface_opens_identity_and_settings_without_runtime_behavior() {
fn pre_004_source_surface_opens_lifecycle_without_supervisor_admission_or_live_sources() {
let root = include_str!("../src/lib.rs");
let runtime = include_str!("../src/runtime.rs");
for required in [
"mod error;",
"mod identity;",
"mod settings;",
"pub use self::error::ERROR_CODE_RAW_TRANSACTION_INGEST_SETTINGS_INVALID;",
"pub use self::identity::RAW_TRANSACTION_INGEST_WORKER_KIND_CODE;",
"pub use self::settings::RawTransactionIngestSettings;",
"mod runtime;",
"pub use self::runtime::RawTransactionIngestHandle;",
"pub use self::runtime::RawTransactionIngestTerminalFuture;",
"pub use self::runtime::RawTransactionIngestWorker;",
"pub fn start(",
"pub fn request_stop(&self) -> bool",
"pub fn wait_terminal(&self)",
] {
assert!(root.contains(required), "required pre.003 crate-root contract missing: {required}");
assert!(root.contains(required) || runtime.contains(required), "required pre.004 runtime contract missing: {required}");
}
for forbidden in ["pub mod ", "tokio::", "start(", "spawn(", "JoinHandle", "JoinSet", "mpsc::", "watch::", "ksp_onchain_transport_lib::"] {
assert!(!root.contains(forbidden), "pre.003 opened runtime behavior too early: {forbidden}");
for forbidden in [
"JoinSet",
"mpsc::",
"canonicalize_raw_transaction",
"persist_raw_transaction",
"ksp_onchain_transport_lib::",
"RawTransactionIngestSnapshot",
"WorkerSnapshotSource",
] {
assert!(!root.contains(forbidden) && !runtime.contains(forbidden), "pre.004 opened later runtime scope too early: {forbidden}");
}
return;
}

View File

@@ -1,5 +1,5 @@
// file: crates/ksp-worker-raw-transaction-ingest-lib/tests/public_api.rs
// version: 4
// version: 5
//! External public-surface proofs for the RAW transaction ingest Worker identity and settings foundation.
@@ -72,3 +72,22 @@ fn pre_003_runtime_bound_errors_are_stable_and_do_not_echo_values() {
assert!(!std::format!("{error:?}").contains("raw-ingest-mainnet-001"));
return;
}
#[test]
fn pre_004_start_handle_and_terminal_future_are_consumable_without_public_join_handle() {
let _start: fn(
ksp_worker_raw_transaction_ingest_lib::RawTransactionIngestSettings,
std::sync::Arc<ksp_store_lib::Store>,
) -> ksp_core_lib::Result<ksp_worker_raw_transaction_ingest_lib::RawTransactionIngestHandle> =
ksp_worker_raw_transaction_ingest_lib::RawTransactionIngestWorker::start;
let _request_stop: fn(&ksp_worker_raw_transaction_ingest_lib::RawTransactionIngestHandle) -> bool =
ksp_worker_raw_transaction_ingest_lib::RawTransactionIngestHandle::request_stop;
let _wait_terminal: for<'a> fn(
&'a ksp_worker_raw_transaction_ingest_lib::RawTransactionIngestHandle,
) -> ksp_worker_raw_transaction_ingest_lib::RawTransactionIngestTerminalFuture<'a> =
ksp_worker_raw_transaction_ingest_lib::RawTransactionIngestHandle::wait_terminal;
let root = include_str!("../src/lib.rs");
assert!(!root.contains("JoinHandle"));
assert!(!root.contains("JoinSet"));
return;
}