v0.2.12-pre.007

This commit is contained in:
2026-08-27 14:35:18 +02:00
parent 7d0fe8ac5f
commit 2042482592
13 changed files with 764 additions and 95 deletions

View File

@@ -1,5 +1,5 @@
// file: crates/ksp-app-solprices-desk/tests/desktop_contract.rs
// version: 6
// version: 7
//! Desktop scaffold, shared-template and Config packaging contract audits for SOL Prices Desk `0.2.12`.
@@ -246,3 +246,46 @@ fn pre_006_market_price_runtime_adds_selected_and_global_refresh_without_polling
assert!(!main_typescript.contains(forbidden), "pre.006 must not add consumer scheduling: {forbidden}");
}
}
#[test]
fn pre_007_prices_view_is_responsive_and_projects_generic_states_without_price_coercion() {
let root = app_root();
let main_html = read_text(root.join("frontend/main.html").as_path());
for required in [
r#"id="pricesSummaryProviders""#,
r#"id="pricesSummaryReady""#,
r#"id="pricesSummaryObserved""#,
r#"id="pricesSummaryAttention""#,
r#"id="pricesSummaryLoading""#,
r#"id="selectAllProviders""#,
r#"id="clearSelectionButton""#,
"Observation times",
"app-market-table-container",
"visually-hidden",
] {
assert!(main_html.contains(required), "pre.007 Prices UX is missing {required}");
}
let main_typescript = read_text(root.join("frontend/ts/main.ts").as_path());
for required in [
"availabilityPresentations",
"Authentication unavailable",
"Cooling down",
"Quota unavailable",
"Temporarily unavailable",
"formatUnixMillis",
"BigInt(value)",
"Not supplied",
"selectAllProviders",
"clearProviderSelection",
"pricesSummaryObserved",
"app-market-row-loading",
] {
assert!(main_typescript.contains(required), "pre.007 Prices UX is missing {required}");
}
assert!(!main_typescript.contains("parseFloat("));
assert!(!main_typescript.contains("Number(provider.price"));
let app_scss = read_text(root.join("frontend/sass/_app.scss").as_path());
for required in ["position: sticky", "font-variant-numeric: tabular-nums", "app-market-summary-card", "app-market-table-container"] {
assert!(app_scss.contains(required), "pre.007 responsive styling is missing {required}");
}
}

View File

@@ -1,5 +1,5 @@
// file: crates/ksp-app-solprices-desk/tests/desktop_security.rs
// version: 6
// version: 7
//! Security, ownership and frontend instrumentation canaries for SOL Prices Desk.
@@ -142,3 +142,47 @@ fn pre_006_frontend_batch_controls_are_logged_without_price_or_provider_payloads
assert!(!main.contains(forbidden), "batch frontend logging must not serialize price/provider/secret values: {forbidden}");
}
}
#[test]
fn pre_007_all_frontend_controls_and_backend_command_failures_are_instrumented_safely() {
let root = app_root();
let main = read_text(root.join("frontend/ts/main.ts").as_path());
for required in [
"SOL Prices Desk navigation control clicked",
"SOL Prices Desk market-price selection control changed",
"SOL Prices Desk select-all providers control changed",
"SOL Prices Desk clear provider selection control clicked",
"SOL Prices Desk market-price refresh control clicked",
"SOL Prices Desk selected market-price refresh control clicked",
"SOL Prices Desk global market-price refresh control clicked",
] {
assert!(main.contains(required), "pre.007 frontend control instrumentation is missing {required}");
}
for forbidden in [
"JSON.stringify(currentMarketPriceRows)",
"JSON.stringify(result)",
"price: provider.price",
"providerTimestampUnixMillis:",
"receivedAtUnixMillis:",
"retryAtUnixMillis:",
"apiKey",
"authorization",
] {
assert!(!main.contains(forbidden), "pre.007 frontend instrumentation must not log business/secret values: {forbidden}");
}
let tauri = read_text(root.join("src/tauri.rs").as_path());
assert!(tauri.contains("fn project_command_error"));
assert!(tauri.contains("error_domain = error.code().domain()"));
assert!(tauri.contains("error_code = error.code().code()"));
assert!(tauri.contains("SOL Prices Desk Tauri command failed"));
assert!(!tauri.contains("error_message = error"));
}
#[test]
fn pre_007_remains_manual_without_browser_persistence_or_price_scheduler() {
let root = app_root();
let main = read_text(root.join("frontend/ts/main.ts").as_path());
for forbidden in ["setInterval(", "setTimeout(", "requestAnimationFrame(", "localStorage", "sessionStorage", "fetch(", "XMLHttpRequest"] {
assert!(!main.contains(forbidden), "pre.007 must remain manual and backend-owned: {forbidden}");
}
}