0.3.15-pre.010-fix.001

This commit is contained in:
2026-09-15 05:53:36 +02:00
parent 9fd51c5a41
commit e919945d1e
20 changed files with 1013 additions and 28 deletions

View File

@@ -1,5 +1,5 @@
// file: crates/ksp-app-raw-transaction-ingest-desk/tests/dependency_boundary.rs
// version: 4
// version: 5
//! Dependency-boundary canaries for Raw Transaction Ingest Desk Start-resource reconstruction.
@@ -85,3 +85,14 @@ fn pre_008_route_runtime_owns_real_store_worker_start_stop_without_physical_back
assert!(!source.contains(forbidden), "pre.008 crosses physical or secret boundary {forbidden}");
}
}
#[test]
fn pre_010_monitoring_projects_existing_worker_snapshot_facade_without_new_backend_edges() {
let source = read_text(app_root().join("src/route_monitoring.rs").as_path());
for required in ["RawTransactionIngestSnapshot", "worker_snapshot()", "source_reconnect_total()", "source_replay_attempt_total()", "gaps()"] {
assert!(source.contains(required), "missing Worker snapshot facade marker {required}");
}
for forbidden in ["tokio_postgres", "ksp_store_postgres_lib", "reqwest", "tonic", "yellowstone_grpc_client"] {
assert!(!source.contains(forbidden), "monitoring opens forbidden backend edge {forbidden}");
}
}

View File

@@ -1,5 +1,5 @@
// file: crates/ksp-app-raw-transaction-ingest-desk/tests/desktop_contract.rs
// version: 6
// version: 7
//! Desktop scaffold contract canaries for Raw Transaction Ingest Desk.
@@ -201,3 +201,19 @@ fn pre_009_start_stop_controls_are_multi_route_targeted_and_backend_owned() {
assert!(main.contains(required), "missing pre.009 frontend control marker {required}");
}
}
#[test]
fn pre_010_runtime_monitoring_is_backend_owned_event_driven_and_resynchronizable() {
let tauri = read_text(app_root().join("src/tauri.rs").as_path());
for required in [
"get_route_monitoring",
"monitor_route_status",
"window.emit(crate::RAW_INGEST_ROUTE_STATUS_EVENT_NAME, status)",
"source.wait_for_change(observed).await",
] {
assert!(tauri.contains(required), "missing pre.010 monitoring bridge marker {required}");
}
let state = read_text(app_root().join("src/app_state.rs").as_path());
assert!(state.contains("route_monitoring(&self)"));
assert!(state.contains("pre.010-runtime-monitoring"));
}

View File

@@ -1,5 +1,5 @@
// file: crates/ksp-app-raw-transaction-ingest-desk/tests/desktop_security.rs
// version: 5
// version: 7
//! Desktop security canaries for the Raw Transaction Ingest Desk scaffold.
@@ -126,3 +126,37 @@ fn pre_008_runtime_acknowledgement_and_frontend_tracing_remain_secret_and_handle
assert!(!main.contains(forbidden), "frontend runtime trace exposes forbidden marker {forbidden}");
}
}
#[test]
fn pre_010_monitoring_projection_is_source_neutral_payload_free_and_javascript_exact() {
let monitoring = read_text(app_root().join("src/route_monitoring.rs").as_path());
for required in [
"sequence: String",
"processing_frontier_slot: std::option::Option<String>",
"continuity_frontier_slot: std::option::Option<String>",
"fault_domain",
"fault_code",
"gaps: std::vec::Vec<crate::RawIngestRouteGapDto>",
] {
assert!(monitoring.contains(required), "missing pre.010 safe monitoring marker {required}");
}
for forbidden in ["endpoint_url", "connection_uri", "api_key", "source_key", "worker_id", "x-token"] {
assert!(!monitoring.contains(forbidden), "monitoring projection exposes forbidden physical marker {forbidden}");
}
let dto_start = monitoring.find("pub(crate) struct RawIngestRouteMonitoringDto");
assert!(dto_start.is_some(), "monitoring DTO declaration is missing");
let dto_start = match dto_start {
std::option::Option::Some(value) => value,
std::option::Option::None => return,
};
let dto_end = monitoring[dto_start..].find("/// Projects one complete concrete Worker snapshot");
assert!(dto_end.is_some(), "monitoring DTO declaration boundary is missing");
let dto_end = match dto_end {
std::option::Option::Some(value) => dto_start + value,
std::option::Option::None => return,
};
let dto_surface = &monitoring[dto_start..dto_end];
for forbidden in ["raw_transaction", "signature", "payload", "canonical_bytes", "wire_bytes", "transaction_bytes"] {
assert!(!dto_surface.contains(forbidden), "monitoring DTO exposes forbidden RAW marker {forbidden}");
}
}

View File

@@ -1,5 +1,5 @@
// file: crates/ksp-app-raw-transaction-ingest-desk/tests/release_completeness.rs
// version: 8
// version: 9
//! 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_008_production_module_inventory_adds_only_route_runtime_to_pre_007_surface() {
fn pre_010_production_module_inventory_adds_only_route_monitoring_to_pre_009_surface() {
let lib = read_text(app_root().join("src/lib.rs").as_path());
let expected = [
"mod app_state;",
@@ -33,6 +33,7 @@ fn pre_008_production_module_inventory_adds_only_route_runtime_to_pre_007_surfac
"mod frontend_logging;",
"mod logging_runtime;",
"mod route_inventory;",
"mod route_monitoring;",
"mod route_runtime;",
"mod route_start;",
"mod splash;",
@@ -100,7 +101,7 @@ fn pre_009_multi_route_runtime_keeps_independent_workers_on_one_same_network_sto
"ERROR_CODE_ROUTE_RUNTIME_NETWORK_MISMATCH",
"already owns one Worker for the selected logical route",
"shared_store(prepared.network.as_str())",
"self.runtime_state.finish(self.token, terminal)",
"self.runtime_state.finish(self.token, terminal, monitoring)",
"Arc::try_unwrap",
] {
assert!(runtime.contains(required), "missing pre.009 shared-Store marker {required}");
@@ -141,3 +142,28 @@ fn pre_009_yellowstone_uses_block_subscription_and_one_get_block_path_instead_of
assert!(workspace.contains("RAW_TRANSACTION_INGEST_YELLOWSTONE_BLOCK_RECONCILIATION_ATTEMPTS"));
assert!(workspace.contains("stop_receiver.changed()"));
}
#[test]
fn pre_010_latest_value_monitoring_reuses_worker_snapshot_source_and_tauri_event_bridge() {
let monitoring = read_text(app_root().join("src/route_monitoring.rs").as_path());
for required in [
"RawIngestRouteMonitoringDto",
"RawIngestRouteGapDto",
"project_route_monitoring",
"continuity_frontier_slot",
"future_target_coverage",
"source_reconnect_total",
"source_replay_attempt_total",
"repaired_gap_total",
"backpressure_wait_total",
] {
assert!(monitoring.contains(required), "missing pre.010 monitoring marker {required}");
}
let tauri = read_text(app_root().join("src/tauri.rs").as_path());
for required in ["get_route_monitoring", "RAW_INGEST_ROUTE_STATUS_EVENT_NAME", "monitor_route_status", "source.wait_for_change(observed).await"] {
assert!(tauri.contains(required), "missing pre.010 event/resync marker {required}");
}
let runtime = read_text(app_root().join("src/route_runtime.rs").as_path());
assert!(runtime.contains("monitoring_statuses"));
assert!(runtime.contains("last_monitoring"));
}