v0.3.15-pre.007

This commit is contained in:
2026-09-13 17:36:06 +02:00
parent 487bcbf0c1
commit 0d9ec5c490
20 changed files with 1071 additions and 109 deletions

View File

@@ -1,7 +1,7 @@
// file: crates/ksp-app-raw-transaction-ingest-desk/tests/dependency_boundary.rs
// version: 2
// version: 3
//! Dependency-boundary canaries for Raw Transaction Ingest Desk Config-only route inventory.
//! Dependency-boundary canaries for Raw Transaction Ingest Desk Start-resource reconstruction.
#![forbid(unsafe_code)]
#![deny(unreachable_pub)]
@@ -21,51 +21,56 @@ fn read_text(path: &std::path::Path) -> String {
}
#[test]
fn pre_006_manifest_opens_only_transport_for_typed_config_composability() {
fn pre_007_manifest_adds_only_worker_vertical_to_existing_config_transport_boundary() {
let manifest = read_text(app_root().join("Cargo.toml").as_path());
for required in ["ksp-config-lib", "ksp-core-lib", "ksp-logging-lib", "ksp-onchain-transport-lib", "tauri-plugin-tracing"] {
assert!(manifest.contains(required), "missing pre.006 dependency {required}");
for required in [
"ksp-config-lib",
"ksp-core-lib",
"ksp-logging-lib",
"ksp-onchain-transport-lib",
"ksp-worker-raw-transaction-ingest-lib",
"tauri-plugin-tracing",
] {
assert!(manifest.contains(required), "missing pre.007 dependency {required}");
}
for forbidden in [
"ksp-store-lib",
"ksp-store-api",
"ksp-store-postgres-lib",
"ksp-worker-api",
"ksp-worker-raw-transaction-ingest-lib",
"ksp-job-backfill-lib",
"reqwest",
"tokio-postgres",
"tonic",
"yellowstone-grpc",
] {
assert!(!manifest.contains(forbidden), "pre.006 opens forbidden dependency {forbidden}");
assert!(!manifest.contains(forbidden), "pre.007 opens forbidden direct dependency {forbidden}");
}
}
#[test]
fn pre_006_production_sources_use_transport_settings_only_without_runtime_io_or_store_open() {
let root = app_root().join("src");
let entries = std::fs::read_dir(root.as_path());
assert!(entries.is_ok());
if let std::result::Result::Ok(entries) = entries {
for entry in entries.flatten() {
let path = entry.path();
if path.extension().and_then(std::ffi::OsStr::to_str) != std::option::Option::Some("rs") {
continue;
}
let source = read_text(path.as_path());
for forbidden in [
"HttpTransportPool",
"WsProtocolSession",
"YellowstoneGrpcChannel",
"Store::open",
"RawTransactionIngestWorker",
"RawTransactionIngestRuntimeResources",
"start_with_runtime_resources",
"request_stop",
] {
assert!(!source.contains(forbidden), "{} contains premature runtime marker {forbidden}", path.display());
}
}
fn pre_007_route_start_reconstructs_exact_worker_sources_without_network_store_or_worker_launch() {
let source = read_text(app_root().join("src/route_start.rs").as_path());
for required in [
"HttpTransportPool::new",
"YellowstoneGrpcChannel::prepare",
"RawTransactionIngestYellowstoneSource::new",
"RawTransactionIngestStandardLogsSource::new",
"RawTransactionIngestStandardBlockSource::new",
"RawTransactionIngestHeliusTransactionSource::new",
"RawTransactionIngestHttpBlockPollingSource::new",
] {
assert!(source.contains(required), "missing exact resource constructor {required}");
}
for forbidden in [
"YellowstoneGrpcChannel::connect",
"SolanaStandardWsSession::connect",
"HeliusWsSession::connect",
"Store::open",
"RawTransactionIngestWorker::",
"start_with_runtime_resources",
"request_stop",
] {
assert!(!source.contains(forbidden), "pre.007 performs premature runtime operation {forbidden}");
}
}

View File

@@ -1,5 +1,5 @@
// file: crates/ksp-app-raw-transaction-ingest-desk/tests/desktop_contract.rs
// version: 3
// version: 4
//! Desktop scaffold contract canaries for Raw Transaction Ingest Desk.
@@ -169,3 +169,18 @@ fn pre_006_frontend_projects_profile_network_generation_and_safe_route_reasons()
assert!(!main.contains(forbidden), "frontend exposes forbidden physical marker: {forbidden}");
}
}
#[test]
fn pre_007_start_preflight_is_backend_owned_generation_bound_and_does_not_launch_worker() {
let dto = read_text(app_root().join("src/dto_route.rs").as_path());
for required in
["RawIngestCommitment", "RawIngestRouteStartRequestDto", "inventory_generation", "profile_id", "route_id", "RawIngestRouteStartValidationDto"]
{
assert!(dto.contains(required), "missing pre.007 Start DTO marker: {required}");
}
let tauri = read_text(app_root().join("src/tauri.rs").as_path());
assert!(tauri.contains("validate_route_start"));
for forbidden in ["start_worker", "stop_worker", "start_with_runtime_resources", "Store::open"] {
assert!(!tauri.contains(forbidden), "pre.007 Tauri surface contains premature runtime marker {forbidden}");
}
}

View File

@@ -1,5 +1,5 @@
// file: crates/ksp-app-raw-transaction-ingest-desk/tests/desktop_security.rs
// version: 3
// version: 4
//! Desktop security canaries for the Raw Transaction Ingest Desk scaffold.
@@ -82,3 +82,31 @@ fn pre_006_route_inventory_dto_surface_excludes_endpoint_secret_and_physical_sto
assert!(!dto.contains(forbidden), "route DTO contains forbidden field marker {forbidden}");
}
}
#[test]
fn pre_007_start_request_and_acknowledgement_are_logical_only_and_resource_free() {
let dto = read_text(app_root().join("src/dto_route.rs").as_path());
for required in ["profile_id", "route_id", "inventory_generation", "commitment", "network"] {
assert!(dto.contains(required), "missing safe Start field marker {required}");
}
for forbidden in [
"endpoint_name",
"endpoint_url",
"api_key",
"connection_uri",
"source_key",
"secret_metadata",
"worker_handle",
"http_pool",
"ws_endpoint",
"yellowstone_channel",
] {
assert!(!dto.contains(forbidden), "Start DTO exposes forbidden physical marker {forbidden}");
}
let route_start = read_text(app_root().join("src/route_start.rs").as_path());
assert!(route_start.contains("ERROR_CODE_ROUTE_START_STALE_INVENTORY"));
assert!(route_start.contains("build_route_inventory_with_environment"));
assert!(route_start.contains("resolve_store_config_profile"));
assert!(!route_start.contains("with_context("endpoint"));
assert!(!route_start.contains("with_context("provider"));
}

View File

@@ -1,7 +1,7 @@
// file: crates/ksp-app-raw-transaction-ingest-desk/tests/release_completeness.rs
// version: 3
// version: 4
//! Release-completeness canaries for Raw Transaction Ingest Desk Config-only route inventory.
//! Release-completeness canaries for Raw Transaction Ingest Desk Start-resource reconstruction.
#![forbid(unsafe_code)]
#![deny(unreachable_pub)]
@@ -21,7 +21,7 @@ fn read_text(path: &std::path::Path) -> String {
}
#[test]
fn pre_006_production_module_inventory_adds_only_route_inventory_to_the_scaffold() {
fn pre_007_production_module_inventory_adds_only_route_start_to_pre_006_surface() {
let lib = read_text(app_root().join("src/lib.rs").as_path());
let expected = [
"mod app_state;",
@@ -33,6 +33,7 @@ fn pre_006_production_module_inventory_adds_only_route_inventory_to_the_scaffold
"mod frontend_logging;",
"mod logging_runtime;",
"mod route_inventory;",
"mod route_start;",
"mod splash;",
"mod tauri;",
"mod tw_main;",
@@ -45,46 +46,44 @@ fn pre_006_production_module_inventory_adds_only_route_inventory_to_the_scaffold
}
#[test]
fn pre_006_public_surface_still_exposes_only_application_run_entry_point() {
fn pre_007_public_surface_still_exposes_only_application_run_entry_point() {
let lib = read_text(app_root().join("src/lib.rs").as_path());
let public_reexports = lib.lines().filter(|line| return line.starts_with("pub use ")).collect::<std::vec::Vec<_>>();
assert_eq!(public_reexports, vec!["pub use self::tauri::run;"]);
}
#[test]
fn pre_006_config_inventory_keeps_start_stop_and_runtime_resources_for_later_tranches() {
let app = read_text(app_root().join("src/app_state.rs").as_path());
let tauri = read_text(app_root().join("src/tauri.rs").as_path());
for forbidden in [
"RawTransactionIngestWorker",
"RawTransactionIngestRuntimeResources",
"request_stop",
"start_with_runtime_resources",
"Store::open",
"HttpTransportPool",
"WsProtocolSession",
"YellowstoneGrpcChannel",
fn pre_007_reconstructs_all_five_worker_source_contracts_without_advancing_store_or_worker_lifecycle() {
let route_start = read_text(app_root().join("src/route_start.rs").as_path());
for required in [
"RawTransactionIngestYellowstoneSource::new",
"RawTransactionIngestStandardLogsSource::new",
"RawTransactionIngestStandardBlockSource::new",
"RawTransactionIngestHeliusTransactionSource::new",
"RawTransactionIngestHttpBlockPollingSource::new",
"SolanaLogsSubscribeFilter::AllWithVotes",
"SolanaBlockSubscribeFilter::All",
"YellowstoneSubscribeTransactionFilter::new",
] {
assert!(!app.contains(forbidden));
assert!(!tauri.contains(forbidden));
assert!(route_start.contains(required), "missing pre.007 exact Worker resource marker {required}");
}
for forbidden in ["Store::open", "start_with_runtime_resources", "request_stop", "RawTransactionIngestRuntimeResources::new"] {
assert!(!route_start.contains(forbidden), "pre.007 advanced premature lifecycle marker {forbidden}");
}
}
#[test]
fn pre_006_inventory_source_is_config_only_and_contains_all_five_capability_requirements() {
let inventory = read_text(app_root().join("src/route_inventory.rs").as_path());
fn pre_007_start_revalidation_reuses_inventory_and_requires_profile_network_identity() {
let route_start = read_text(app_root().join("src/route_start.rs").as_path());
for required in [
"WsSubscriptionKind::Logs",
"WsSubscriptionKind::Block",
"WsSubscriptionKind::HeliusTransaction",
"getTransaction",
"getBlocksWithLimit",
"MissingYellowstoneGrpc",
"MissingRequiredSecret",
"current_generation == 0",
"request.inventory_generation != current_generation",
"build_route_inventory_with_environment",
"request.profile_id",
"resolve_store_config_profile",
"store.settings().network().as_str() != network",
"transport_matches_network",
] {
assert!(inventory.contains(required), "missing pre.006 inventory requirement {required}");
}
for forbidden in ["connect(", "Store::open", "start_with_runtime_resources", "request_stop"] {
assert!(!inventory.contains(forbidden), "pre.006 inventory performs premature runtime operation {forbidden}");
assert!(route_start.contains(required), "missing pre.007 revalidation marker {required}");
}
}