v0.3.7-pre.003-fix.001

This commit is contained in:
2026-09-02 10:55:57 +02:00
parent 862f40ad26
commit 03a94f4fb6
8 changed files with 200 additions and 26 deletions

View File

@@ -1,20 +1,24 @@
// file: crates/ksp-app-backfill-desk/src/errors.rs
// version: 2
// version: 3
//! Application-local error codes for Backfill Desk composition and desktop runtime surfaces.
/// Backfill Desk composite configuration is missing or references an unexpected document.
pub(crate) const ERROR_CODE_CONFIG_COMPOSITE_INVALID: ksp_core_lib::ErrorCode = ksp_core_lib::ErrorCode::new("backfill_desk", "config_composite_invalid");
/// Shared Backfill Desk runtime state is internally inconsistent.
pub(crate) const ERROR_CODE_APP_STATE_INVALID: ksp_core_lib::ErrorCode = ksp_core_lib::ErrorCode::new("backfill_desk", "app_state_invalid");
/// Shared Backfill Desk runtime state cannot be locked safely.
pub(crate) const ERROR_CODE_APP_STATE_LOCK_FAILED: ksp_core_lib::ErrorCode = ksp_core_lib::ErrorCode::new("backfill_desk", "app_state_lock_failed");
/// Backfill Desk composite configuration is missing or references an unexpected document.
pub(crate) const ERROR_CODE_CONFIG_COMPOSITE_INVALID: ksp_core_lib::ErrorCode =
ksp_core_lib::ErrorCode::new("backfill_desk", "config_composite_invalid");
/// Frontend logging requested an unsupported level.
pub(crate) const ERROR_CODE_FRONTEND_LOG_LEVEL_INVALID: ksp_core_lib::ErrorCode = ksp_core_lib::ErrorCode::new("backfill_desk", "frontend_log_level_invalid");
pub(crate) const ERROR_CODE_FRONTEND_LOG_LEVEL_INVALID: ksp_core_lib::ErrorCode =
ksp_core_lib::ErrorCode::new("backfill_desk", "frontend_log_level_invalid");
/// Frontend logging requested a target outside the application whitelist.
pub(crate) const ERROR_CODE_FRONTEND_LOG_TARGET_INVALID: ksp_core_lib::ErrorCode = ksp_core_lib::ErrorCode::new("backfill_desk", "frontend_log_target_invalid");
pub(crate) const ERROR_CODE_FRONTEND_LOG_TARGET_INVALID: ksp_core_lib::ErrorCode =
ksp_core_lib::ErrorCode::new("backfill_desk", "frontend_log_target_invalid");
/// Backfill Desk could not install the managed Logging runtime or its safe fallback.
pub(crate) const ERROR_CODE_LOGGING_BOOTSTRAP_FAILED: ksp_core_lib::ErrorCode = ksp_core_lib::ErrorCode::new("backfill_desk", "logging_bootstrap_failed");
pub(crate) const ERROR_CODE_LOGGING_BOOTSTRAP_FAILED: ksp_core_lib::ErrorCode =
ksp_core_lib::ErrorCode::new("backfill_desk", "logging_bootstrap_failed");
/// Splash readiness was invoked from a window other than the splash window.
pub(crate) const ERROR_CODE_SPLASH_ORIGIN_INVALID: ksp_core_lib::ErrorCode = ksp_core_lib::ErrorCode::new("backfill_desk", "splash_origin_invalid");
/// A KSP desk splash environment duration is malformed or exceeds its safety bound.

View File

@@ -1,5 +1,5 @@
// file: crates/ksp-app-backfill-desk/tests/desktop_contract.rs
// version: 2
// version: 3
//! Structural desktop contract checks for the Backfill Desk scaffold.
@@ -99,7 +99,13 @@ fn pre_002_package_dependencies_match_desk_baseline() {
fn pre_002_splash_assets_and_styles_match_existing_desk_template() {
let root = app_root();
let reference = workspace_root().join("crates/ksp-app-solprices-desk");
for relative in ["frontend/fonts/DOS_Amazigh.ttf", "frontend/imgs/logo.png", "frontend/imgs/splash.png", "icons/favicon.png", "icons/favicon.ico"] {
for relative in [
"frontend/fonts/DOS_Amazigh.ttf",
"frontend/imgs/logo.png",
"frontend/imgs/splash.png",
"icons/favicon.png",
"icons/favicon.ico",
] {
assert_eq!(read_bytes(root.join(relative).as_path()), read_bytes(reference.join(relative).as_path()), "Desk asset differs: {relative}");
}
let splash = read_text(root.join("frontend/splash.html").as_path());
@@ -107,7 +113,9 @@ fn pre_002_splash_assets_and_styles_match_existing_desk_template() {
assert!(splash.contains("Backfill Desk"));
let splash_style = read_text(root.join("frontend/sass/splash.scss").as_path());
let reference_style = read_text(reference.join("frontend/sass/splash.scss").as_path());
let normalized = splash_style.replace("crates/ksp-app-backfill-desk", "crates/ksp-app-solprices-desk").replace("// version: 1", "// version: 2");
let normalized = splash_style
.replace("crates/ksp-app-backfill-desk", "crates/ksp-app-solprices-desk")
.replace("// version: 1", "// version: 2");
assert_eq!(normalized, reference_style);
}
@@ -134,7 +142,12 @@ fn pre_002_shell_and_splash_use_shared_frontend_tooling() {
fn pre_003_composite_packaging_follows_atomic_config_registry_contract() {
let root = app_root();
let config = read_json(root.join("tauri.conf.json").as_path());
let resources = config.get("bundle").and_then(|value| value.get("resources")).and_then(serde_json::Value::as_object);
let resources = config
.get("bundle")
.and_then(|value| {
return value.get("resources");
})
.and_then(serde_json::Value::as_object);
assert!(resources.is_some());
let resources = match resources {
std::option::Option::Some(value) => value,

View File

@@ -1,5 +1,5 @@
// file: crates/ksp-app-backfill-desk/tests/desktop_security.rs
// version: 2
// version: 3
//! Security and dependency-boundary checks for the Backfill Desk scaffold.
@@ -53,9 +53,15 @@ 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"));
for forbidden in
["ksp-job-backfill-lib", "ksp-onchain-transport-lib", "ksp-store-lib", "ksp-store-api", "ksp-store-postgres-lib", "reqwest", "tokio-postgres"]
{
for forbidden in [
"ksp-job-backfill-lib",
"ksp-onchain-transport-lib",
"ksp-store-lib",
"ksp-store-api",
"ksp-store-postgres-lib",
"reqwest",
"tokio-postgres",
] {
assert!(!manifest.contains(forbidden), "pre.002 opens a later-layer dependency: {forbidden}");
}
}
@@ -118,7 +124,7 @@ fn pre_002_frontend_instrumentation_avoids_business_or_secret_payloads() {
fn pre_003_keeps_config_only_composition_boundary() {
let root = app_root();
let manifest = read_text(root.join("Cargo.toml").as_path());
assert!(manifest.contains("ksp-config-lib.workspace = true"));
assert!(manifest.contains("ksp-config-lib = { path = \"../ksp-config-lib\" }"));
for forbidden in ["ksp-job-backfill-lib", "ksp-onchain-transport-lib", "ksp-store-lib", "ksp-store-api", "ksp-store-postgres-lib"] {
assert!(!manifest.contains(forbidden), "pre.003 opens a later-layer dependency: {forbidden}");
}

View File

@@ -8,12 +8,12 @@
{
"component_id": "logging",
"file_id": "cfg.std.logging",
"profile_id": "supertrace"
"profile_id": "local_dev"
},
{
"component_id": "transport",
"file_id": "cfg.std.transport",
"profile_id": "devnet_public"
"profile_id": "secret_test"
},
{
"component_id": "store",
@@ -28,12 +28,12 @@
{
"component_id": "logging",
"file_id": "cfg.std.logging",
"profile_id": "console_info"
"profile_id": "local_dev"
},
{
"component_id": "transport",
"file_id": "cfg.std.transport",
"profile_id": "mainnet_public"
"profile_id": "secret_test"
},
{
"component_id": "store",
@@ -48,12 +48,12 @@
{
"component_id": "logging",
"file_id": "cfg.std.logging",
"profile_id": "console_info"
"profile_id": "local_dev"
},
{
"component_id": "transport",
"file_id": "cfg.std.transport",
"profile_id": "publicnode_testnet"
"profile_id": "secret_test"
},
{
"component_id": "store",