v0.2.12-pre.004

This commit is contained in:
2026-08-27 10:02:46 +02:00
parent afc50c1e48
commit e7c3379f44
17 changed files with 914 additions and 70 deletions

View File

@@ -1,5 +1,5 @@
// file: crates/ksp-app-solprices-desk/tests/desktop_security.rs
// version: 2
// version: 3
//! Security, ownership and frontend instrumentation canaries for SOL Prices Desk.
@@ -50,7 +50,7 @@ fn pre_002_capability_surface_is_core_plus_tracing_only() {
let manifest = read_text(root.join("Cargo.toml").as_path());
assert!(manifest.contains("tauri-plugin-tracing.workspace = true"));
assert!(!manifest.contains("tauri-plugin-dialog"));
assert!(!manifest.contains("ksp-offchain-transport-lib"));
assert!(manifest.contains("ksp-offchain-transport-lib"));
assert!(!manifest.contains("reqwest"));
}
@@ -69,7 +69,7 @@ fn pre_002_frontend_has_no_network_persistence_or_native_dialog_surface() {
}
#[test]
fn pre_003_tauri_commands_remain_centralized_and_refresh_runtime_is_absent() {
fn pre_004_tauri_commands_remain_centralized_and_refresh_is_absent() {
let root = app_root();
let mut rust_files = std::vec::Vec::new();
collect_files(root.join("src").as_path(), "rs", &mut rust_files);
@@ -82,14 +82,13 @@ fn pre_003_tauri_commands_remain_centralized_and_refresh_runtime_is_absent() {
} else {
assert_eq!(count, 0, "{} declares a Tauri command outside tauri.rs", path.display());
}
assert!(!source.contains("MarketPriceRuntime"), "{} advances application price-state runtime before pre.004", path.display());
assert!(!source.contains("refresh_market_price"), "{} advances refresh commands before their planned tranche", path.display());
}
assert_eq!(command_count, 3);
assert_eq!(command_count, 4);
}
#[test]
fn pre_003_frontend_control_interactions_are_logged_without_business_values() {
fn pre_004_frontend_registry_loading_is_logged_without_business_values() {
let root = app_root();
let main = read_text(root.join("frontend/ts/main.ts").as_path());
let invoke = read_text(root.join("frontend/ts/invoke.ts").as_path());
@@ -100,6 +99,8 @@ fn pre_003_frontend_control_interactions_are_logged_without_business_values() {
assert!(invoke.contains("Frontend IPC command requested"));
assert!(invoke.contains("Frontend IPC command completed"));
assert!(invoke.contains("frontendTrace"));
assert!(main.contains("SOL Prices Desk provider registry load started"));
assert!(main.contains("SOL Prices Desk market-price registry rows rendered"));
for forbidden in ["JSON.stringify(status)", "JSON.stringify(payload)", "apiKey", "authorization"] {
assert!(!main.contains(forbidden), "main frontend logging must not serialize business/secret values: {forbidden}");
}