From 42326e7f025d568ee3c9656c92dff41e4a80a457 Mon Sep 17 00:00:00 2001 From: SinuS Von SifriduS Date: Fri, 21 Aug 2026 12:45:08 +0200 Subject: [PATCH] v0.2.6-pre.009-fix.001 --- Cargo.toml | 4 +- crates/ksp-app-wallet-desk/package.json | 2 +- crates/ksp-app-wallet-desk/src/app_state.rs | 9 +- .../ksp-app-wallet-desk/src/wallet_session.rs | 4 +- crates/ksp-app-wallet-desk/tauri.conf.json | 2 +- .../unit_tests/wallet_metadata.rs | 12 +- deltas/0.2.6/pre.009-fix.001.md | 111 ++++++++++++++++++ docs/plans/013-V0_2_6_WALLET_DESK_PLAN.md | 6 +- 8 files changed, 132 insertions(+), 18 deletions(-) create mode 100644 deltas/0.2.6/pre.009-fix.001.md diff --git a/Cargo.toml b/Cargo.toml index 0288e50..6720c0e 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,12 +1,12 @@ # file: Cargo.toml -# version: 177 +# version: 178 [workspace] resolver = "3" members = ["crates/ksp-app-config-desk", "crates/ksp-app-wallet-desk", "crates/ksp-config-lib", "crates/ksp-core-lib", "crates/ksp-logging-lib", "crates/ksp-onchain-transport-lib", "crates/ksp-wallet-lib"] [workspace.package] -version = "0.2.6-pre.9" +version = "0.2.6-pre.9.fix.1" edition = "2024" license = "MIT" repository = "https://git.sasedev.com/Sasedev/khadhroony-solana-project" diff --git a/crates/ksp-app-wallet-desk/package.json b/crates/ksp-app-wallet-desk/package.json index 68e5454..85b06c8 100644 --- a/crates/ksp-app-wallet-desk/package.json +++ b/crates/ksp-app-wallet-desk/package.json @@ -1,7 +1,7 @@ { "name": "ksp-app-wallet-desk", "private": true, - "version": "0.2.6-pre.9", + "version": "0.2.6-pre.9.fix.1", "type": "module", "scripts": { "dev": "vite", diff --git a/crates/ksp-app-wallet-desk/src/app_state.rs b/crates/ksp-app-wallet-desk/src/app_state.rs index 6e033a2..dc5a642 100644 --- a/crates/ksp-app-wallet-desk/src/app_state.rs +++ b/crates/ksp-app-wallet-desk/src/app_state.rs @@ -1,5 +1,5 @@ // file: crates/ksp-app-wallet-desk/src/app_state.rs -// version: 11 +// version: 12 //! Shared backend state owned by the Wallet Desk Tauri application. @@ -607,7 +607,7 @@ impl AppState { }, }; let dto = crate::view_projection(wallet_id.as_str(), view_enabled, configured_secret_candidate_count, &view); - *session = crate::WalletSession::View { wallet_id: wallet_id.clone(), path, view_enabled, wallet: std::boxed::Box::new(view) }; + *session = crate::WalletSession::View { wallet_id: wallet_id.clone(), path, wallet: std::boxed::Box::new(view) }; ksp_logging_lib::info!(target: crate::TRACING_TARGET, domain = crate::TRACING_DOMAIN_WALLET_SESSION, wallet_id = wallet_id.as_str(), capability = "view", "Wallet VIEW session opened"); return std::result::Result::Ok(dto); } @@ -829,7 +829,10 @@ impl AppState { } ksp_logging_lib::warn!(target: crate::TRACING_TARGET, domain = crate::TRACING_DOMAIN_WALLET_SESSION, wallet_id = wallet_id.as_str(), operation, "Wallet OWNER metadata state conflict purged the stale handle and forced reauthorization"); }, - other => *session = other, + other => { + *session = other; + return; + }, } } diff --git a/crates/ksp-app-wallet-desk/src/wallet_session.rs b/crates/ksp-app-wallet-desk/src/wallet_session.rs index e59feac..95bc557 100644 --- a/crates/ksp-app-wallet-desk/src/wallet_session.rs +++ b/crates/ksp-app-wallet-desk/src/wallet_session.rs @@ -1,5 +1,5 @@ // file: crates/ksp-app-wallet-desk/src/wallet_session.rs -// version: 4 +// version: 5 //! Durable root-scoped Wallet session lifecycle for Wallet Desk. @@ -149,8 +149,6 @@ pub(crate) enum WalletSession { path: std::path::PathBuf, /// Authorized VIEW handle retaining metadata capability only in Rust. wallet: std::boxed::Box, - /// Whether the authenticated Wallet currently exposes a VIEW slot. - view_enabled: bool, }, /// One Wallet kept open with OWNER capability. Owner { diff --git a/crates/ksp-app-wallet-desk/tauri.conf.json b/crates/ksp-app-wallet-desk/tauri.conf.json index 3e21558..dc31fa6 100644 --- a/crates/ksp-app-wallet-desk/tauri.conf.json +++ b/crates/ksp-app-wallet-desk/tauri.conf.json @@ -1,7 +1,7 @@ { "$schema": "https://schema.tauri.app/config/2", "productName": "KSP Wallet Desk", - "version": "0.2.6-pre.9", + "version": "0.2.6-pre.9.fix.1", "identifier": "com.sasedev.ksp-app-wallet-desk", "build": { "beforeDevCommand": "npm run dev", diff --git a/crates/ksp-app-wallet-desk/unit_tests/wallet_metadata.rs b/crates/ksp-app-wallet-desk/unit_tests/wallet_metadata.rs index ecc3d52..46c6fc8 100644 --- a/crates/ksp-app-wallet-desk/unit_tests/wallet_metadata.rs +++ b/crates/ksp-app-wallet-desk/unit_tests/wallet_metadata.rs @@ -1,18 +1,18 @@ // file: crates/ksp-app-wallet-desk/unit_tests/wallet_metadata.rs -// version: 1 +// version: 2 #[test] fn owner_metadata_requests_keep_protected_text_request_only() { - fn assert_deserializable() + fn assert_deserializable(_marker: std::marker::PhantomData) where T: serde::de::DeserializeOwned, { return; } - assert_deserializable::(); - assert_deserializable::(); - assert_deserializable::(); - assert_deserializable::(); + assert_deserializable(std::marker::PhantomData::); + assert_deserializable(std::marker::PhantomData::); + assert_deserializable(std::marker::PhantomData::); + assert_deserializable(std::marker::PhantomData::); } #[test] diff --git a/deltas/0.2.6/pre.009-fix.001.md b/deltas/0.2.6/pre.009-fix.001.md new file mode 100644 index 0000000..0ab5133 --- /dev/null +++ b/deltas/0.2.6/pre.009-fix.001.md @@ -0,0 +1,111 @@ + + + +# Delta `0.2.6-pre.009-fix.001` — hygiène Clippy metadata OWNER + +## Base requise + +```text +0.2.6-pre.009 appliquée +workspace.package.version = 0.2.6-pre.9 +``` + +Les validations opérateur de `pre.009` confirment que les tests Wallet Desk et le workspace complet sont fonctionnellement verts, et que les mutations OWNER alias/notes fonctionnent en runtime. Le gate Clippy révèle toutefois trois diagnostics locaux à corriger avant clôture de tranche. + +## Signal technique + +```text +workspace.package.version = 0.2.6-pre.9.fix.1 +commit = v0.2.6-pre.009-fix.001 +``` + +`ksp-app-wallet-desk/package.json` et `tauri.conf.json` suivent `0.2.6-pre.9.fix.1`. + +## Corrections + +### 1. `WalletSession::View.view_enabled` mort + +Le champ `view_enabled` de la variante runtime `WalletSession::View` n'est plus lu. Il n'est pas masqué par `#[cfg(test)]` ni par un `allow` : il est supprimé de la variante et de sa construction. + +La valeur `view_enabled` reste utilisée au moment de l'unlock pour construire la projection autorisée `WalletAuthorizedDto`; elle n'a simplement pas besoin d'être persistée dans l'état VIEW. Les variantes OWNER/OwnerOperation conservent leur champ car les mutations OWNER l'utilisent réellement pour préserver/revalider la projection et la réservation de session. + +### 2. `clippy::implicit_return` + +La branche terminale de recovery `wallet.state_conflict` restaure l'état concurrent puis termine explicitement la fonction : + +```rust +other => { + *session = other; + return; +}, +``` + +Cela respecte la politique workspace `-D clippy::implicit-return` sans modifier le comportement de recovery. + +### 3. `clippy::extra_unused_type_parameters` + +Le helper de canari `DeserializeOwned` utilise désormais son paramètre générique dans la signature avec `PhantomData` : + +```rust +fn assert_deserializable(_marker: std::marker::PhantomData) +where + T: serde::de::DeserializeOwned, +``` + +Le test continue de vérifier les quatre DTOs request-only metadata sans introduire de `Debug`, `Clone` ou valeur runtime artificielle. + +## Documentation + +Conformément à la politique documentaire corrigée pendant `pre.009` : + +- `ROADMAP.md` n'est pas modifié pour ce fix local ; +- `CHANGELOG.md` reste inchangé jusqu'à la clôture ; +- `docs/plans/002-FUNCTIONAL_RELEASE_SEQUENCE.md` n'est pas utilisé comme journal du fix ; +- seul le plan détaillé `013-V0_2_6_WALLET_DESK_PLAN.md` enregistre ce correctif de tranche. + +## Fichiers modifiés + +```text +Cargo.toml +crates/ksp-app-wallet-desk/package.json +crates/ksp-app-wallet-desk/src/app_state.rs +crates/ksp-app-wallet-desk/src/wallet_session.rs +crates/ksp-app-wallet-desk/tauri.conf.json +crates/ksp-app-wallet-desk/unit_tests/wallet_metadata.rs +docs/plans/013-V0_2_6_WALLET_DESK_PLAN.md +``` + +## Fichier ajouté + +```text +deltas/0.2.6/pre.009-fix.001.md +``` + +## Hors scope + +Aucun changement n'est apporté aux contrats IPC, aux mutations alias/notes, à `wallet.state_conflict`, au frontend, à Transport, Config, Logging, au format `.kspwallet` ou aux dépendances. + +## Contrôles assistant + +```text +General Rust rule audit clean +Rust export completeness audit 0 candidate(s) +KSP workspace Rust rule audit clean +TOML / JSON parse clean +ROADMAP / CHANGELOG / sequence inchangés +``` + +Cargo n'est pas disponible dans l'environnement de génération ; compilation, Clippy et tests restent autoritatifs côté opérateur. + +## Validation opérateur + +```bash +cargo fmt --all +python3 scripts/audit_rust_workspace_rules.py +cargo check --workspace +cargo clippy --workspace --all-targets +cargo test -p ksp-app-wallet-desk +cargo test --workspace +``` + +Un nouveau `cargo tauri dev` n'est pas requis pour ce fix purement hygiénique si ces gates sont verts. diff --git a/docs/plans/013-V0_2_6_WALLET_DESK_PLAN.md b/docs/plans/013-V0_2_6_WALLET_DESK_PLAN.md index 6a994dd..63d4bd6 100644 --- a/docs/plans/013-V0_2_6_WALLET_DESK_PLAN.md +++ b/docs/plans/013-V0_2_6_WALLET_DESK_PLAN.md @@ -1,5 +1,5 @@ - + # Plan `0.2.6` — Wallet Desk @@ -1487,7 +1487,7 @@ Aucun changement n’est apporté au picker natif, à `Zeroizing>`, aux ### `pre.009` — metadata OWNER -Statut : **implémenté dans `0.2.6-pre.009`, validations opérateur à exécuter**. +Statut : **implémenté dans `0.2.6-pre.009`; validations opérateur fonctionnelles vertes, correctif Clippy `0.2.6-pre.009-fix.001` requis avant clôture de tranche**. Objectifs matérialisés : @@ -1506,6 +1506,8 @@ Les mutations délèguent directement à `WalletOwner::{update_alias, add_note, Un `wallet.state_conflict` n'est jamais retenté avec le même handle : Wallet Desk détruit l'OWNER stale, réinspecte le fichier courant sans KDF, revient au plus à `Locked`, puis le frontend purge Pubkey/alias/notes/balance et impose une nouvelle autorisation OWNER. +Le correctif `pre.009-fix.001` est strictement hygiénique : suppression du champ runtime `view_enabled` devenu inutilisé dans la variante `WalletSession::View` (aucun `#[cfg(test)]` ni `allow`), `return` explicite exigé par la politique Clippy du workspace dans la recovery de conflit, et helper de canari `DeserializeOwned` rendu réellement générique via `PhantomData`. Aucun contrat IPC, comportement metadata, format Wallet ou frontend n'est modifié. + ### `pre.010` — rotations credentials Objectifs :