v0.3.15-pre.006

This commit is contained in:
2026-09-13 11:30:56 +02:00
parent 9ee3cd4a53
commit 0a8ce6e5f9
23 changed files with 1298 additions and 112 deletions

View File

@@ -1,7 +1,7 @@
// file: crates/ksp-app-raw-transaction-ingest-desk/tests/dependency_boundary.rs
// version: 1
// version: 2
//! Dependency-boundary canaries for the Raw Transaction Ingest Desk scaffold.
//! Dependency-boundary canaries for Raw Transaction Ingest Desk Config-only route inventory.
#![forbid(unsafe_code)]
#![deny(unreachable_pub)]
@@ -21,13 +21,12 @@ fn read_text(path: &std::path::Path) -> String {
}
#[test]
fn pre_005_manifest_is_scaffold_only_and_backend_neutral() {
fn pre_006_manifest_opens_only_transport_for_typed_config_composability() {
let manifest = read_text(app_root().join("Cargo.toml").as_path());
for required in ["ksp-config-lib", "ksp-core-lib", "ksp-logging-lib", "tauri-plugin-tracing"] {
assert!(manifest.contains(required), "missing scaffold dependency {required}");
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 forbidden in [
"ksp-onchain-transport-lib",
"ksp-store-lib",
"ksp-store-api",
"ksp-store-postgres-lib",
@@ -39,12 +38,12 @@ fn pre_005_manifest_is_scaffold_only_and_backend_neutral() {
"tonic",
"yellowstone-grpc",
] {
assert!(!manifest.contains(forbidden), "scaffold opens forbidden dependency {forbidden}");
assert!(!manifest.contains(forbidden), "pre.006 opens forbidden dependency {forbidden}");
}
}
#[test]
fn pre_005_production_sources_do_not_construct_transport_store_or_worker_runtime() {
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());
@@ -57,11 +56,13 @@ fn pre_005_production_sources_do_not_construct_transport_store_or_worker_runtime
let source = read_text(path.as_path());
for forbidden in [
"HttpTransportPool",
"WsTransportSettings",
"WsProtocolSession",
"YellowstoneGrpcChannel",
"ksp_store_lib::Store",
"Store::open",
"RawTransactionIngestWorker",
"RawTransactionIngestRuntimeResources",
"start_with_runtime_resources",
"request_stop",
] {
assert!(!source.contains(forbidden), "{} contains premature runtime marker {forbidden}", path.display());
}

View File

@@ -1,5 +1,5 @@
// file: crates/ksp-app-raw-transaction-ingest-desk/tests/desktop_contract.rs
// version: 2
// version: 3
//! Desktop scaffold contract canaries for Raw Transaction Ingest Desk.
@@ -108,7 +108,7 @@ fn pre_005_splash_assets_match_existing_ksp_desk_template_byte_exact() {
}
#[test]
fn pre_005_route_foundation_is_backend_owned_and_has_exact_five_ids_and_seven_states() {
fn pre_006_route_inventory_is_backend_owned_and_keeps_exact_five_ids_and_seven_states() {
let dto = read_text(app_root().join("src/dto_route.rs").as_path());
for route in ["YellowstoneHydrated", "StandardLogsHydrated", "StandardBlockDirect", "HeliusTransactionHydrated", "HttpBlockPolling"] {
assert!(dto.contains(route));
@@ -118,7 +118,8 @@ fn pre_005_route_foundation_is_backend_owned_and_has_exact_five_ids_and_seven_st
}
let tauri = read_text(app_root().join("src/tauri.rs").as_path());
assert!(tauri.contains("get_route_foundation"));
for forbidden in ["start_worker", "stop_worker", "RawTransactionIngestWorker", "Store::open", "HttpTransportPool"] {
assert!(tauri.contains("get_route_inventory"));
for forbidden in ["start_worker", "stop_worker", "RawTransactionIngestWorker", "Store::open"] {
assert!(!tauri.contains(forbidden), "scaffold Tauri surface contains premature runtime marker {forbidden}");
}
}
@@ -153,3 +154,18 @@ fn pre_005_fix_002_shell_reuses_common_light_template_and_bounds_route_foundatio
assert!(styles.contains(required), "missing bounded layout marker: {required}");
}
}
#[test]
fn pre_006_frontend_projects_profile_network_generation_and_safe_route_reasons() {
let html = read_text(app_root().join("frontend/main.html").as_path());
for required in ["id=\"routeProfile\"", "id=\"routeNetwork\"", "id=\"routeInventoryGeneration\"", "id=\"routeFoundation\""] {
assert!(html.contains(required), "missing route inventory UI marker: {required}");
}
let main = read_text(app_root().join("frontend/ts/main.ts").as_path());
for required in ["get_route_inventory", "missing_ws_block_capability", "missing_required_secret", "Config route inventory"] {
assert!(main.contains(required), "missing route inventory frontend marker: {required}");
}
for forbidden in ["endpointUrl", "connectionUri", "apiKey", "sourceKey", "x-token"] {
assert!(!main.contains(forbidden), "frontend exposes forbidden physical marker: {forbidden}");
}
}

View File

@@ -1,5 +1,5 @@
// file: crates/ksp-app-raw-transaction-ingest-desk/tests/desktop_security.rs
// version: 1
// version: 2
//! Desktop security canaries for the Raw Transaction Ingest Desk scaffold.
@@ -58,15 +58,27 @@ fn pre_005_frontend_has_no_network_persistence_or_native_dialog_surface() {
}
#[test]
fn pre_005_frontend_tracing_is_control_and_command_oriented_only() {
fn pre_006_frontend_tracing_is_control_inventory_and_command_oriented_only() {
let main = read_text(app_root().join("frontend/ts/main.ts").as_path());
assert!(main.contains("frontend control clicked"));
assert!(main.contains("navigation tab clicked"));
assert!(main.contains("runtime status refresh requested"));
assert!(main.contains("route foundation refresh requested"));
assert!(main.contains("Config route inventory refresh requested"));
assert!(main.contains("logical profile selected"));
let invoke = read_text(app_root().join("frontend/ts/invoke.ts").as_path());
assert!(invoke.contains("Frontend IPC command requested"));
for forbidden in ["apiKey", "authorization", "connectionUri", "endpointUrl", "sourceKey", "rawTransaction", "transactionPayload"] {
for forbidden in ["apiKey", "authorization", "connectionUri", "endpointUrl", "sourceKey", "rawTransaction", "transactionPayload", "x-token"] {
assert!(!main.contains(forbidden), "frontend contains forbidden sensitive marker {forbidden}");
}
}
#[test]
fn pre_006_route_inventory_dto_surface_excludes_endpoint_secret_and_physical_store_fields() {
let dto = read_text(app_root().join("src/dto_route.rs").as_path());
for required in ["RawIngestRouteInventoryDto", "RawIngestProfileInventoryDto", "RawIngestRouteUnavailableReason"] {
assert!(dto.contains(required));
}
for forbidden in ["endpoint_name", "endpoint_url", "api_key", "connection_uri", "source_key", "secret_metadata", "worker_handle"] {
assert!(!dto.contains(forbidden), "route DTO contains forbidden field marker {forbidden}");
}
}

View File

@@ -1,7 +1,7 @@
// file: crates/ksp-app-raw-transaction-ingest-desk/tests/release_completeness.rs
// version: 2
// version: 3
//! Release-completeness canaries for the Raw Transaction Ingest Desk scaffold tranche.
//! Release-completeness canaries for Raw Transaction Ingest Desk Config-only route inventory.
#![forbid(unsafe_code)]
#![deny(unreachable_pub)]
@@ -21,7 +21,7 @@ fn read_text(path: &std::path::Path) -> String {
}
#[test]
fn pre_005_production_module_inventory_is_exact_and_scaffold_only() {
fn pre_006_production_module_inventory_adds_only_route_inventory_to_the_scaffold() {
let lib = read_text(app_root().join("src/lib.rs").as_path());
let expected = [
"mod app_state;",
@@ -32,6 +32,7 @@ fn pre_005_production_module_inventory_is_exact_and_scaffold_only() {
"mod errors;",
"mod frontend_logging;",
"mod logging_runtime;",
"mod route_inventory;",
"mod splash;",
"mod tauri;",
"mod tw_main;",
@@ -44,14 +45,14 @@ fn pre_005_production_module_inventory_is_exact_and_scaffold_only() {
}
#[test]
fn pre_005_public_surface_exposes_only_application_run_entry_point() {
fn pre_006_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_005_scaffold_keeps_start_stop_inventory_and_runtime_for_later_tranches() {
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 [
@@ -68,3 +69,22 @@ fn pre_005_scaffold_keeps_start_stop_inventory_and_runtime_for_later_tranches()
assert!(!tauri.contains(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());
for required in [
"WsSubscriptionKind::Logs",
"WsSubscriptionKind::Block",
"WsSubscriptionKind::HeliusTransaction",
"getTransaction",
"getBlocksWithLimit",
"MissingYellowstoneGrpc",
"MissingRequiredSecret",
] {
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}");
}
}