v0.3.15-pre.008
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
// file: crates/ksp-app-raw-transaction-ingest-desk/tests/dependency_boundary.rs
|
||||
// version: 3
|
||||
// version: 4
|
||||
|
||||
//! Dependency-boundary canaries for Raw Transaction Ingest Desk Start-resource reconstruction.
|
||||
|
||||
@@ -21,30 +21,22 @@ fn read_text(path: &std::path::Path) -> String {
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn pre_007_manifest_adds_only_worker_vertical_to_existing_config_transport_boundary() {
|
||||
fn pre_008_manifest_adds_store_facade_and_worker_api_without_physical_backend_edge() {
|
||||
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",
|
||||
"ksp-store-lib",
|
||||
"ksp-worker-api",
|
||||
"ksp-worker-raw-transaction-ingest-lib",
|
||||
"tauri-plugin-tracing",
|
||||
] {
|
||||
assert!(manifest.contains(required), "missing pre.007 dependency {required}");
|
||||
assert!(manifest.contains(required), "missing pre.008 dependency {required}");
|
||||
}
|
||||
for forbidden in [
|
||||
"ksp-store-lib",
|
||||
"ksp-store-api",
|
||||
"ksp-store-postgres-lib",
|
||||
"ksp-worker-api",
|
||||
"ksp-job-backfill-lib",
|
||||
"reqwest",
|
||||
"tokio-postgres",
|
||||
"tonic",
|
||||
"yellowstone-grpc",
|
||||
] {
|
||||
assert!(!manifest.contains(forbidden), "pre.007 opens forbidden direct dependency {forbidden}");
|
||||
for forbidden in ["ksp-store-api", "ksp-store-postgres-lib", "ksp-job-backfill-lib", "reqwest", "tokio-postgres", "tonic", "yellowstone-grpc"] {
|
||||
assert!(!manifest.contains(forbidden), "pre.008 opens forbidden direct dependency {forbidden}");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -74,3 +66,22 @@ fn pre_007_route_start_reconstructs_exact_worker_sources_without_network_store_o
|
||||
assert!(!source.contains(forbidden), "pre.007 performs premature runtime operation {forbidden}");
|
||||
}
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn pre_008_route_runtime_owns_real_store_worker_start_stop_without_physical_backend_types() {
|
||||
let source = read_text(app_root().join("src/route_runtime.rs").as_path());
|
||||
for required in [
|
||||
"Store::open",
|
||||
"StoreHealthState::Ready",
|
||||
"RawTransactionIngestWorker::start_with_runtime_resources",
|
||||
"request_stop",
|
||||
"wait_terminal",
|
||||
".close().await",
|
||||
"Arc::try_unwrap",
|
||||
] {
|
||||
assert!(source.contains(required), "missing mono-route runtime operation {required}");
|
||||
}
|
||||
for forbidden in ["tokio_postgres", "ksp_store_postgres_lib", "PostgresStore", "connection_uri", "endpoint_url"] {
|
||||
assert!(!source.contains(forbidden), "pre.008 crosses physical or secret boundary {forbidden}");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
// file: crates/ksp-app-raw-transaction-ingest-desk/tests/desktop_contract.rs
|
||||
// version: 4
|
||||
// version: 5
|
||||
|
||||
//! Desktop scaffold contract canaries for Raw Transaction Ingest Desk.
|
||||
|
||||
@@ -184,3 +184,19 @@ fn pre_007_start_preflight_is_backend_owned_generation_bound_and_does_not_launch
|
||||
assert!(!tauri.contains(forbidden), "pre.007 Tauri surface contains premature runtime marker {forbidden}");
|
||||
}
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn pre_008_start_stop_commands_and_frontend_controls_are_mono_route_and_backend_owned() {
|
||||
let tauri = read_text(app_root().join("src/tauri.rs").as_path());
|
||||
for required in ["start_route", "stop_route", "launch.monitor().await"] {
|
||||
assert!(tauri.contains(required), "missing pre.008 Tauri runtime marker {required}");
|
||||
}
|
||||
let html = read_text(app_root().join("frontend/main.html").as_path());
|
||||
for required in ["id=\"routeCommitment\"", "id=\"routeRuntimeState\"", "id=\"routeRuntimeIdentity\"", "id=\"stopRoute\""] {
|
||||
assert!(html.contains(required), "missing pre.008 frontend runtime marker {required}");
|
||||
}
|
||||
let main = read_text(app_root().join("frontend/ts/main.ts").as_path());
|
||||
for required in ["mono-route Start requested", "mono-route Stop requested", "start_route", "stop_route"] {
|
||||
assert!(main.contains(required), "missing pre.008 frontend control marker {required}");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -110,3 +110,19 @@ fn pre_007_start_request_and_acknowledgement_are_logical_only_and_resource_free(
|
||||
assert!(!route_start.contains("with_context(\"endpoint\""));
|
||||
assert!(!route_start.contains("with_context(\"provider\""));
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn pre_008_runtime_acknowledgement_and_frontend_tracing_remain_secret_and_handle_free() {
|
||||
let dto = read_text(app_root().join("src/dto_route.rs").as_path());
|
||||
assert!(dto.contains("RawIngestRouteRuntimeDto"));
|
||||
for forbidden in ["worker_id", "worker_handle", "endpoint_url", "connection_uri", "api_key", "source_key"] {
|
||||
assert!(!dto.contains(forbidden), "runtime DTO exposes forbidden marker {forbidden}");
|
||||
}
|
||||
let main = read_text(app_root().join("frontend/ts/main.ts").as_path());
|
||||
for required in ["profileId", "routeId", "commitment", "state"] {
|
||||
assert!(main.contains(required), "missing safe runtime trace marker {required}");
|
||||
}
|
||||
for forbidden in ["endpointUrl", "connectionUri", "workerId", "sourceKey", "x-token", "rawTransaction"] {
|
||||
assert!(!main.contains(forbidden), "frontend runtime trace exposes forbidden marker {forbidden}");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
// file: crates/ksp-app-raw-transaction-ingest-desk/tests/release_completeness.rs
|
||||
// version: 4
|
||||
// version: 5
|
||||
|
||||
//! Release-completeness canaries for Raw Transaction Ingest Desk Start-resource reconstruction.
|
||||
|
||||
@@ -21,7 +21,7 @@ fn read_text(path: &std::path::Path) -> String {
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn pre_007_production_module_inventory_adds_only_route_start_to_pre_006_surface() {
|
||||
fn pre_008_production_module_inventory_adds_only_route_runtime_to_pre_007_surface() {
|
||||
let lib = read_text(app_root().join("src/lib.rs").as_path());
|
||||
let expected = [
|
||||
"mod app_state;",
|
||||
@@ -33,6 +33,7 @@ fn pre_007_production_module_inventory_adds_only_route_start_to_pre_006_surface(
|
||||
"mod frontend_logging;",
|
||||
"mod logging_runtime;",
|
||||
"mod route_inventory;",
|
||||
"mod route_runtime;",
|
||||
"mod route_start;",
|
||||
"mod splash;",
|
||||
"mod tauri;",
|
||||
@@ -46,14 +47,14 @@ fn pre_007_production_module_inventory_adds_only_route_start_to_pre_006_surface(
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn pre_007_public_surface_still_exposes_only_application_run_entry_point() {
|
||||
fn pre_008_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_007_reconstructs_all_five_worker_source_contracts_without_advancing_store_or_worker_lifecycle() {
|
||||
fn pre_008_keeps_five_exact_source_reconstructions_separate_from_store_worker_lifecycle() {
|
||||
let route_start = read_text(app_root().join("src/route_start.rs").as_path());
|
||||
for required in [
|
||||
"RawTransactionIngestYellowstoneSource::new",
|
||||
@@ -61,14 +62,16 @@ fn pre_007_reconstructs_all_five_worker_source_contracts_without_advancing_store
|
||||
"RawTransactionIngestStandardBlockSource::new",
|
||||
"RawTransactionIngestHeliusTransactionSource::new",
|
||||
"RawTransactionIngestHttpBlockPollingSource::new",
|
||||
"SolanaLogsSubscribeFilter::AllWithVotes",
|
||||
"SolanaBlockSubscribeFilter::All",
|
||||
"YellowstoneSubscribeTransactionFilter::new",
|
||||
"RawTransactionIngestRuntimeResources",
|
||||
] {
|
||||
assert!(route_start.contains(required), "missing pre.007 exact Worker resource marker {required}");
|
||||
assert!(route_start.contains(required), "missing pre.008 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}");
|
||||
for forbidden in ["Store::open", "start_with_runtime_resources", "request_stop", "wait_terminal"] {
|
||||
assert!(!route_start.contains(forbidden), "route preparation owns runtime lifecycle marker {forbidden}");
|
||||
}
|
||||
let runtime = read_text(app_root().join("src/route_runtime.rs").as_path());
|
||||
for required in ["Store::open", "start_with_runtime_resources", "request_stop", "wait_terminal", "StoreHealthState::Ready", "close_store_arc"] {
|
||||
assert!(runtime.contains(required), "missing pre.008 lifecycle marker {required}");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -87,3 +90,17 @@ fn pre_007_start_revalidation_reuses_inventory_and_requires_profile_network_iden
|
||||
assert!(route_start.contains(required), "missing pre.007 revalidation marker {required}");
|
||||
}
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn pre_008_mono_route_slot_blocks_second_start_until_terminal_store_cleanup() {
|
||||
let runtime = read_text(app_root().join("src/route_runtime.rs").as_path());
|
||||
for required in [
|
||||
"RouteRuntimeSlot::Starting",
|
||||
"RouteRuntimeSlot::Active",
|
||||
"ERROR_CODE_ROUTE_RUNTIME_ACTIVE",
|
||||
"runtime_state.finish(self.token)",
|
||||
"Arc::try_unwrap",
|
||||
] {
|
||||
assert!(runtime.contains(required), "missing mono-route ownership marker {required}");
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user