v0.3.12-pre.002

This commit is contained in:
2026-09-09 07:12:37 +02:00
parent 08e9a34183
commit 91438e8214
12 changed files with 937 additions and 40 deletions

View File

@@ -1,5 +1,5 @@
// file: crates/ksp-worker-raw-transaction-ingest-lib/tests/dependency_boundary.rs
// version: 8
// version: 9
//! Dependency firewall canaries for the RAW transaction ingest Worker foundation.
@@ -8,10 +8,23 @@ fn pre_002_manifest_dependency_surface_is_exact() {
let manifest = include_str!("../Cargo.toml");
let dependencies = dependency_section(manifest);
let names = manifest_dependency_names(dependencies);
assert_eq!(names, vec!["ksp-core-lib", "ksp-logging-lib", "ksp-raw-transaction-lib", "ksp-store-lib", "ksp-worker-api", "sha2", "tokio",],);
assert_eq!(
names,
vec![
"ksp-core-lib",
"ksp-logging-lib",
"ksp-onchain-transport-lib",
"ksp-raw-transaction-lib",
"ksp-store-lib",
"ksp-worker-api",
"sha2",
"tokio",
],
);
for required in [
"ksp-core-lib = { path = \"../ksp-core-lib\" }",
"ksp-logging-lib = { path = \"../ksp-logging-lib\" }",
"ksp-onchain-transport-lib = { path = \"../ksp-onchain-transport-lib\" }",
"ksp-raw-transaction-lib = { path = \"../ksp-raw-transaction-lib\" }",
"ksp-store-lib = { path = \"../ksp-store-lib\", default-features = false }",
"ksp-worker-api = { path = \"../ksp-worker-api\" }",
@@ -24,7 +37,7 @@ fn pre_002_manifest_dependency_surface_is_exact() {
}
#[test]
fn pre_002_manifest_keeps_forbidden_layers_and_live_sources_out() {
fn v0_3_12_pre_002_manifest_opens_only_the_onchain_transport_live_source_edge() {
let manifest = include_str!("../Cargo.toml");
let dependencies = dependency_section(manifest);
for forbidden in [
@@ -33,7 +46,6 @@ fn pre_002_manifest_keeps_forbidden_layers_and_live_sources_out() {
"ksp-interface-lib",
"ksp-job-api",
"ksp-job-backfill-lib",
"ksp-onchain-transport-lib",
"ksp-program-api",
"ksp-store-api",
"ksp-store-postgres-lib",
@@ -52,12 +64,13 @@ fn pre_002_manifest_keeps_forbidden_layers_and_live_sources_out() {
}
#[test]
fn pre_009_source_surface_hardens_shutdown_and_faults_without_backend_or_live_source() {
fn v0_3_12_pre_002_source_surface_hardens_shutdown_and_faults_without_backend_or_premature_live_io() {
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");
let runtime_resources = include_str!("../src/runtime_resources.rs");
for required in [
"tokio::sync::mpsc::channel",
"canonicalize_raw_transaction",
@@ -81,7 +94,8 @@ fn pre_009_source_surface_hardens_shutdown_and_faults_without_backend_or_live_so
|| runtime.contains(required)
|| admission.contains(required)
|| persistence.contains(required)
|| snapshot.contains(required),
|| snapshot.contains(required)
|| runtime_resources.contains(required),
"required pre.009 hardening contract missing: {required}"
);
}
@@ -91,7 +105,6 @@ fn pre_009_source_surface_hardens_shutdown_and_faults_without_backend_or_live_so
"pub use self::persistence::RawTransactionIngestPersistencePort",
"unbounded_channel",
"ksp_store_postgres_lib::",
"ksp_onchain_transport_lib::",
"ForceRehydrate",
"ksp_config_lib::",
"reqwest::",
@@ -101,7 +114,8 @@ fn pre_009_source_surface_hardens_shutdown_and_faults_without_backend_or_live_so
&& !runtime.contains(forbidden)
&& !admission.contains(forbidden)
&& !persistence.contains(forbidden)
&& !snapshot.contains(forbidden),
&& !snapshot.contains(forbidden)
&& !runtime_resources.contains(forbidden),
"pre.009 crossed a forbidden runtime boundary: {forbidden}"
);
}