v0.2.6-pre.016-fix.002
This commit is contained in:
@@ -6,7 +6,7 @@ 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.16.fix.1"
|
||||
version = "0.2.6-pre.16.fix.2"
|
||||
edition = "2024"
|
||||
license = "MIT"
|
||||
repository = "https://git.sasedev.com/Sasedev/khadhroony-solana-project"
|
||||
|
||||
@@ -914,23 +914,23 @@ impl AppState {
|
||||
std::result::Result::Err(_) => return std::result::Result::Err(session_lock_error()),
|
||||
};
|
||||
let previous = std::mem::replace(&mut *session, crate::WalletSession::no_selection());
|
||||
match previous {
|
||||
return match previous {
|
||||
crate::WalletSession::ViewOperation { wallet_id: reserved_wallet_id, path: reserved_path, pubkey: reserved_pubkey }
|
||||
if reserved_wallet_id == wallet_id && reserved_path == path && reserved_pubkey == pubkey =>
|
||||
{
|
||||
*session = crate::WalletSession::View { wallet_id: wallet_id.clone(), path, wallet: view };
|
||||
ksp_logging_lib::info!(target: crate::TRACING_TARGET, domain = crate::TRACING_DOMAIN_WALLET_SESSION, wallet_id = wallet_id.as_str(), operation, "Wallet VIEW privileged operation completed");
|
||||
return std::result::Result::Ok(dto);
|
||||
std::result::Result::Ok(dto)
|
||||
},
|
||||
other => {
|
||||
*session = other;
|
||||
drop(view);
|
||||
return std::result::Result::Err(ksp_core_lib::Error::new(
|
||||
std::result::Result::Err(ksp_core_lib::Error::new(
|
||||
crate::ERROR_CODE_WALLET_SESSION_INVALID,
|
||||
"Wallet VIEW operation completion no longer owns the selected session",
|
||||
));
|
||||
))
|
||||
},
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
fn restore_view_after_operation_failure(&self, context: ViewOperationContext) {
|
||||
@@ -1039,7 +1039,7 @@ impl AppState {
|
||||
std::result::Result::Err(_) => return std::result::Result::Err(session_lock_error()),
|
||||
};
|
||||
let previous = std::mem::replace(&mut *session, crate::WalletSession::no_selection());
|
||||
match previous {
|
||||
return match previous {
|
||||
crate::WalletSession::OwnerOperation {
|
||||
wallet_id: reserved_wallet_id,
|
||||
path: reserved_path,
|
||||
@@ -1048,17 +1048,17 @@ impl AppState {
|
||||
} if reserved_wallet_id == wallet_id && reserved_path == path && reserved_pubkey == pubkey && reserved_view_enabled == view_enabled => {
|
||||
*session = crate::WalletSession::Owner { wallet_id: wallet_id.clone(), path, view_enabled: result_view_enabled, wallet: owner };
|
||||
ksp_logging_lib::info!(target: crate::TRACING_TARGET, domain = crate::TRACING_DOMAIN_WALLET_SESSION, wallet_id = wallet_id.as_str(), operation, "Wallet OWNER privileged operation completed");
|
||||
return std::result::Result::Ok(dto);
|
||||
std::result::Result::Ok(dto)
|
||||
},
|
||||
other => {
|
||||
*session = other;
|
||||
drop(owner);
|
||||
return std::result::Result::Err(ksp_core_lib::Error::new(
|
||||
std::result::Result::Err(ksp_core_lib::Error::new(
|
||||
crate::ERROR_CODE_WALLET_SESSION_INVALID,
|
||||
"Wallet OWNER operation completion no longer owns the selected session",
|
||||
));
|
||||
))
|
||||
},
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
fn restore_owner_after_operation_failure(&self, context: OwnerOperationContext) {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
// file: crates/ksp-app-wallet-desk/tests/desktop_contract.rs
|
||||
// version: 17
|
||||
// version: 18
|
||||
|
||||
//! Desktop build, shell and Config-status contract audits for Wallet Desk.
|
||||
|
||||
@@ -16,6 +16,11 @@ fn read_text(path: &std::path::Path) -> String {
|
||||
};
|
||||
}
|
||||
|
||||
fn read_source(relative_path: &str) -> String {
|
||||
let root = app_root();
|
||||
return read_text(root.join(relative_path).as_path());
|
||||
}
|
||||
|
||||
fn read_json(path: &std::path::Path) -> serde_json::Value {
|
||||
let source = read_text(path);
|
||||
let parsed = serde_json::from_str::<serde_json::Value>(source.as_str());
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
// file: crates/ksp-wallet-lib/src/runtime.rs
|
||||
// version: 1
|
||||
// version: 2
|
||||
|
||||
//! Version-neutral unlocked Wallet state dispatch used by stable OWNER/VIEW handles.
|
||||
|
||||
@@ -16,14 +16,6 @@ pub(crate) enum OwnerState {
|
||||
}
|
||||
|
||||
impl OwnerState {
|
||||
/// Returns the native format version owned by this OWNER state.
|
||||
pub(crate) const fn format_version(&self) -> u32 {
|
||||
return match self {
|
||||
Self::V1(_) => crate::KSPWALLET_FORMAT_VERSION_V1,
|
||||
Self::V2(_) => crate::KSPWALLET_FORMAT_VERSION_V2,
|
||||
};
|
||||
}
|
||||
|
||||
/// Exports the Solana identity through the requested external transfer format.
|
||||
pub(crate) fn export_transfer(&self, format: crate::WalletTransferFormat) -> ksp_core_lib::Result<std::vec::Vec<u8>> {
|
||||
return match self {
|
||||
@@ -43,8 +35,8 @@ impl OwnerState {
|
||||
/// Stages an authenticated metadata replacement without publishing it.
|
||||
pub(crate) fn stage_metadata_payload(&self, payload: crate::MetadataPayloadV1) -> ksp_core_lib::Result<(StagedEnvelope, crate::WalletInfo)> {
|
||||
return match self {
|
||||
Self::V1(state) => state.stage_metadata_payload(payload).map(|(envelope, info)| (StagedEnvelope::V1(envelope), info)),
|
||||
Self::V2(state) => state.stage_metadata_payload(payload).map(|(envelope, info)| (StagedEnvelope::V2(envelope), info)),
|
||||
Self::V1(state) => state.stage_metadata_payload(payload).map(|(envelope, info)| return (StagedEnvelope::V1(envelope), info)),
|
||||
Self::V2(state) => state.stage_metadata_payload(payload).map(|(envelope, info)| return (StagedEnvelope::V2(envelope), info)),
|
||||
};
|
||||
}
|
||||
|
||||
@@ -67,16 +59,16 @@ impl OwnerState {
|
||||
/// Stages strong VIEW disable while retaining OWNER authority.
|
||||
pub(crate) fn stage_disable_view(&self) -> ksp_core_lib::Result<(StagedEnvelope, crate::SecretKeyV1)> {
|
||||
return match self {
|
||||
Self::V1(state) => state.stage_disable_view().map(|(envelope, key)| (StagedEnvelope::V1(envelope), key)),
|
||||
Self::V2(state) => state.stage_disable_view().map(|(envelope, key)| (StagedEnvelope::V2(envelope), key)),
|
||||
Self::V1(state) => state.stage_disable_view().map(|(envelope, key)| return (StagedEnvelope::V1(envelope), key)),
|
||||
Self::V2(state) => state.stage_disable_view().map(|(envelope, key)| return (StagedEnvelope::V2(envelope), key)),
|
||||
};
|
||||
}
|
||||
|
||||
/// Stages strong VIEW recreation under a new credential.
|
||||
pub(crate) async fn stage_recreate_view(&self, password: crate::ViewPassword) -> ksp_core_lib::Result<(StagedEnvelope, crate::SecretKeyV1)> {
|
||||
return match self {
|
||||
Self::V1(state) => state.stage_recreate_view(password).await.map(|(envelope, key)| (StagedEnvelope::V1(envelope), key)),
|
||||
Self::V2(state) => state.stage_recreate_view(password).await.map(|(envelope, key)| (StagedEnvelope::V2(envelope), key)),
|
||||
Self::V1(state) => state.stage_recreate_view(password).await.map(|(envelope, key)| return (StagedEnvelope::V1(envelope), key)),
|
||||
Self::V2(state) => state.stage_recreate_view(password).await.map(|(envelope, key)| return (StagedEnvelope::V2(envelope), key)),
|
||||
};
|
||||
}
|
||||
|
||||
@@ -155,14 +147,6 @@ pub(crate) enum ViewState {
|
||||
}
|
||||
|
||||
impl ViewState {
|
||||
/// Returns the native format version owned by this VIEW state.
|
||||
pub(crate) const fn format_version(&self) -> u32 {
|
||||
return match self {
|
||||
Self::V1(_) => crate::KSPWALLET_FORMAT_VERSION_V1,
|
||||
Self::V2(_) => crate::KSPWALLET_FORMAT_VERSION_V2,
|
||||
};
|
||||
}
|
||||
|
||||
/// Stages a VIEW credential rotation in the state native format.
|
||||
pub(crate) async fn stage_view_password_rotation(&self, password: crate::ViewPassword) -> ksp_core_lib::Result<StagedEnvelope> {
|
||||
return match self {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
// file: crates/ksp-wallet-lib/unit_tests/format.rs
|
||||
// version: 1
|
||||
// version: 2
|
||||
|
||||
#[test]
|
||||
fn default_and_latest_are_explicit_and_currently_v2() {
|
||||
@@ -12,7 +12,15 @@ fn default_and_latest_are_explicit_and_currently_v2() {
|
||||
fn detector_distinguishes_v1_json_and_v2_binary_without_crypto() -> ksp_core_lib::Result<()> {
|
||||
let v1 = include_bytes!("../tests/fixtures/kspwallet_v1_wire_only.json");
|
||||
let v2 = include_bytes!("../tests/fixtures/kspwallet_v2_wire_only.bin");
|
||||
assert_eq!(crate::detect_wallet_format(v1)?, crate::WalletFormat::V1);
|
||||
assert_eq!(crate::detect_wallet_format(v2)?, crate::WalletFormat::V2);
|
||||
let detected_v1 = match crate::detect_wallet_format(v1) {
|
||||
std::result::Result::Ok(value) => value,
|
||||
std::result::Result::Err(error) => return std::result::Result::Err(error),
|
||||
};
|
||||
let detected_v2 = match crate::detect_wallet_format(v2) {
|
||||
std::result::Result::Ok(value) => value,
|
||||
std::result::Result::Err(error) => return std::result::Result::Err(error),
|
||||
};
|
||||
assert_eq!(detected_v1, crate::WalletFormat::V1);
|
||||
assert_eq!(detected_v2, crate::WalletFormat::V2);
|
||||
return std::result::Result::Ok(());
|
||||
}
|
||||
|
||||
50
deltas/0.2.6/pre.016-fix.002.md
Normal file
50
deltas/0.2.6/pre.016-fix.002.md
Normal file
@@ -0,0 +1,50 @@
|
||||
<!-- file: deltas/0.2.6/pre.016-fix.002.md -->
|
||||
<!-- version: 1 -->
|
||||
|
||||
# Delta `0.2.6-pre.016-fix.002` — nettoyage compile/Clippy des dispatchs V1/V2
|
||||
|
||||
## Base requise
|
||||
|
||||
```text
|
||||
0.2.6-pre.016-fix.001 appliquée
|
||||
workspace.package.version = 0.2.6-pre.16.fix.1
|
||||
```
|
||||
|
||||
Le checkpoint opérateur confirme que le correctif AAD de `fix.001` élimine les erreurs `E0308`, mais expose quatre défauts résiduels de `pre.016` :
|
||||
|
||||
- deux méthodes internes `OwnerState::format_version` / `ViewState::format_version` inutilisées ;
|
||||
- six closures de mapping dans `runtime.rs` incompatibles avec `clippy::implicit-return = deny` ;
|
||||
- deux usages de `?` dans `unit_tests/format.rs`, incompatibles avec `clippy::question-mark-used = deny` ;
|
||||
- le canari Desktop `pre_016_wallet_desk_uses_version_neutral_wallet_dispatch` utilise un helper `read_source` non défini.
|
||||
|
||||
## Signal technique
|
||||
|
||||
```text
|
||||
workspace.package.version = 0.2.6-pre.16.fix.2
|
||||
commit = v0.2.6-pre.016-fix.002
|
||||
```
|
||||
|
||||
Aucun tag prerelease. Aucun changement npm/Tauri.
|
||||
|
||||
## Corrections
|
||||
|
||||
- suppression des deux méthodes internes mortes `format_version`; les projections publiques restent basées sur `WalletInfo` ;
|
||||
- `return` explicites dans les closures de mapping V1/V2 ;
|
||||
- remplacement des deux `?` de test par des `match` explicites ;
|
||||
- ajout du helper local `read_source(relative_path)` dans le canari Wallet Desk.
|
||||
|
||||
Aucun changement du wire V1/V2, des transcripts/AAD, des fixtures, des APIs publiques, du dispatch fonctionnel ou de la politique `DEFAULT_WALLET_FORMAT` / `LATEST_SUPPORTED_WALLET_FORMAT`.
|
||||
|
||||
## Validation opérateur requise
|
||||
|
||||
```bash
|
||||
cargo fmt --all
|
||||
python3 scripts/audit_rust_workspace_rules.py
|
||||
cargo check --workspace
|
||||
cargo clippy --workspace --all-targets
|
||||
cargo test -p ksp-wallet-lib
|
||||
cargo test -p ksp-app-wallet-desk
|
||||
cargo test --workspace
|
||||
```
|
||||
|
||||
Si ce checkpoint est vert, `0.2.6-pre.016-fix.002` peut être commitée et la suite reste `0.2.6-pre.017`. Ne pas exécuter `cargo tauri build` avant `pre.018`.
|
||||
@@ -17,42 +17,42 @@ Ce document maintient l'inventaire synthétique des composants retenus ou presse
|
||||
|
||||
## Inventaire synthétique
|
||||
|
||||
| Domaine | Composant | Type | Statut | Première cible actuelle | Mission |
|
||||
|-------------------------|------------------------------------------|--------------------|--------------|---------------------------------|-------------------------------------------------------------|
|
||||
| Core | `ksp-core-lib` | lib | Stable | `0.1.1` | Error/Result, Program IDs et primitives fondamentales |
|
||||
| Logging | `ksp-logging-lib` | lib | Stable | `0.1.2` | façade unique tracing KSP |
|
||||
| Config | `ksp-config-lib` | lib | Stable | `0.1.3` | documents, profils, env et persistence Config |
|
||||
| Config Desk | `ksp-app-config-desk` | app | Stable | `0.1.4` | validation/management Config |
|
||||
| On-chain HTTP | `ksp-onchain-transport-lib` | lib | Stable | `0.2.1`–`0.2.4` | HTTP standard complet : 52/52 current + 14/14 historical |
|
||||
| Wallet | `ksp-wallet-lib` | lib | Stable | `0.2.5` | `.kspwallet`, VIEW/OWNER, secrets, signature, import/export |
|
||||
| Wallet Desk | `ksp-app-wallet-desk` | app | Retenu | `0.2.6` | Wallet + Config composite + HTTP/balance |
|
||||
| Wallet V2 | `ksp-wallet-lib` | lib | En cours | `0.2.6` | wire/runtime V2 + API default/versionnée ; migration pre.017 |
|
||||
| Standard WS | `ksp-onchain-transport-lib` | lib | Retenu | `0.2.7` | WebSocket Solana complet, sessions/subscriptions |
|
||||
| Helius WS | `ksp-onchain-transport-lib` | lib | Retenu | `0.2.8` | LaserStream WebSocket comme extension du moteur standard |
|
||||
| Yellowstone | `ksp-onchain-transport-lib` | lib | Pressenti | `0.2.9` | client gRPC standard/provider-neutral |
|
||||
| Off-chain price | `ksp-offchain-transport-lib` | lib | Retenu | `0.2.10` | première abstraction/provider de prix SOL/USD, SOL/EUR |
|
||||
| Price Desk | nom à fixer | app | Retenu | `0.2.11` | visualisation/validation des prix + intégration Wallet Desk |
|
||||
| Wire | `ksp-interface-lib` | lib | Retenu | `0.2.12` | façade wire officielle + API publique wire |
|
||||
| Program API | `ksp-program-api` | API | Retenu | `0.2.13` | contrats extensibles Program |
|
||||
| Program impl. | `ksp-program-lib` | lib | Retenu | vertical slices ultérieurs | implementations Program officielles |
|
||||
| Program extension | `ksp-program-<name>-lib` | lib externe | À la demande | dès besoin | implementation externe de `ksp-program-api` |
|
||||
| Store API | `ksp-store-api` | API | Retenu | `0.3.1` | contrats persistence backend-agnostic, RAW d'abord |
|
||||
| Store PostgreSQL | `ksp-store-lib` | lib | Retenu | `0.3.1` | backend PostgreSQL officiel, RAW d'abord |
|
||||
| Job lifecycle | `ksp-job-api` | API | Retenu | `0.3.3` | lifecycle des jobs terminables |
|
||||
| Backfill | `ksp-job-backfill` | job/lib à préciser | Retenu | `0.3.3` | acquisition historique vers RAW |
|
||||
| Backfill Desk | nom à fixer | app | Retenu | `0.3.4` | contrôle/inspection du backfill RAW |
|
||||
| Worker lifecycle | `ksp-worker-api` | API | Retenu | fin couche RAW | lifecycle des services continus |
|
||||
| RAW worker | `ksp-worker-raw-retriever` ou nom révisé | worker | Retenu | fin couche RAW | acquisition live vers RAW |
|
||||
| CORE processor | nom à fixer | processor/lib | Retenu | couche CORE | normalisation Solana générique RAW -> CORE |
|
||||
| CORE worker | nom à fixer | worker | Retenu | fin couche CORE | backlog RAW -> CORE continu |
|
||||
| Materializer API | `ksp-materializer-api` | API | Retenu | premier groupe DECODE | contrats extensibles matérialisation |
|
||||
| Materializer impl. | `ksp-materializer-lib` | lib | Retenu | premier groupe DECODE | implementations officielles communes |
|
||||
| Execution policy | `ksp-execution-policy-api` | API | Retenu | premier vrai besoin execution | décision/safety multi-contexte |
|
||||
| Execution orchestration | `ksp-execution-lib` | lib | Retenu | premier vrai cycle execution | Program + policy + Wallet + transport |
|
||||
| Scenarios | `ksp-scenario-<domain>-lib` | lib | Retenu | vertical slices | validation métier/devnet par groupe |
|
||||
| Scenario API | `ksp-scenario-api` | API | Non retenu | — | norme souple avant trait commun |
|
||||
| Market Desk | `ksp-app-market-desk` | app | Pressenti | après Meteora/Raydium/Pump/Orca | tokens, pools, trades, liquidity, price, OHLC |
|
||||
| Trading Intelligence | noms à définir | libs/jobs | Futur | après données stables | features/signaux/anomalies/ML |
|
||||
| Domaine | Composant | Type | Statut | Première cible actuelle | Mission |
|
||||
|-------------------------|------------------------------------------|--------------------|--------------|---------------------------------|--------------------------------------------------------------|
|
||||
| Core | `ksp-core-lib` | lib | Stable | `0.1.1` | Error/Result, Program IDs et primitives fondamentales |
|
||||
| Logging | `ksp-logging-lib` | lib | Stable | `0.1.2` | façade unique tracing KSP |
|
||||
| Config | `ksp-config-lib` | lib | Stable | `0.1.3` | documents, profils, env et persistence Config |
|
||||
| Config Desk | `ksp-app-config-desk` | app | Stable | `0.1.4` | validation/management Config |
|
||||
| On-chain HTTP | `ksp-onchain-transport-lib` | lib | Stable | `0.2.1`–`0.2.4` | HTTP standard complet : 52/52 current + 14/14 historical |
|
||||
| Wallet | `ksp-wallet-lib` | lib | Stable | `0.2.5` | `.kspwallet`, VIEW/OWNER, secrets, signature, import/export |
|
||||
| Wallet Desk | `ksp-app-wallet-desk` | app | Retenu | `0.2.6` | Wallet + Config composite + HTTP/balance |
|
||||
| Wallet V2 | `ksp-wallet-lib` | lib | En cours | `0.2.6` | wire/runtime V2 + API default/versionnée ; migration pre.017 |
|
||||
| Standard WS | `ksp-onchain-transport-lib` | lib | Retenu | `0.2.7` | WebSocket Solana complet, sessions/subscriptions |
|
||||
| Helius WS | `ksp-onchain-transport-lib` | lib | Retenu | `0.2.8` | LaserStream WebSocket comme extension du moteur standard |
|
||||
| Yellowstone | `ksp-onchain-transport-lib` | lib | Pressenti | `0.2.9` | client gRPC standard/provider-neutral |
|
||||
| Off-chain price | `ksp-offchain-transport-lib` | lib | Retenu | `0.2.10` | première abstraction/provider de prix SOL/USD, SOL/EUR |
|
||||
| Price Desk | nom à fixer | app | Retenu | `0.2.11` | visualisation/validation des prix + intégration Wallet Desk |
|
||||
| Wire | `ksp-interface-lib` | lib | Retenu | `0.2.12` | façade wire officielle + API publique wire |
|
||||
| Program API | `ksp-program-api` | API | Retenu | `0.2.13` | contrats extensibles Program |
|
||||
| Program impl. | `ksp-program-lib` | lib | Retenu | vertical slices ultérieurs | implementations Program officielles |
|
||||
| Program extension | `ksp-program-<name>-lib` | lib externe | À la demande | dès besoin | implementation externe de `ksp-program-api` |
|
||||
| Store API | `ksp-store-api` | API | Retenu | `0.3.1` | contrats persistence backend-agnostic, RAW d'abord |
|
||||
| Store PostgreSQL | `ksp-store-lib` | lib | Retenu | `0.3.1` | backend PostgreSQL officiel, RAW d'abord |
|
||||
| Job lifecycle | `ksp-job-api` | API | Retenu | `0.3.3` | lifecycle des jobs terminables |
|
||||
| Backfill | `ksp-job-backfill` | job/lib à préciser | Retenu | `0.3.3` | acquisition historique vers RAW |
|
||||
| Backfill Desk | nom à fixer | app | Retenu | `0.3.4` | contrôle/inspection du backfill RAW |
|
||||
| Worker lifecycle | `ksp-worker-api` | API | Retenu | fin couche RAW | lifecycle des services continus |
|
||||
| RAW worker | `ksp-worker-raw-retriever` ou nom révisé | worker | Retenu | fin couche RAW | acquisition live vers RAW |
|
||||
| CORE processor | nom à fixer | processor/lib | Retenu | couche CORE | normalisation Solana générique RAW -> CORE |
|
||||
| CORE worker | nom à fixer | worker | Retenu | fin couche CORE | backlog RAW -> CORE continu |
|
||||
| Materializer API | `ksp-materializer-api` | API | Retenu | premier groupe DECODE | contrats extensibles matérialisation |
|
||||
| Materializer impl. | `ksp-materializer-lib` | lib | Retenu | premier groupe DECODE | implementations officielles communes |
|
||||
| Execution policy | `ksp-execution-policy-api` | API | Retenu | premier vrai besoin execution | décision/safety multi-contexte |
|
||||
| Execution orchestration | `ksp-execution-lib` | lib | Retenu | premier vrai cycle execution | Program + policy + Wallet + transport |
|
||||
| Scenarios | `ksp-scenario-<domain>-lib` | lib | Retenu | vertical slices | validation métier/devnet par groupe |
|
||||
| Scenario API | `ksp-scenario-api` | API | Non retenu | — | norme souple avant trait commun |
|
||||
| Market Desk | `ksp-app-market-desk` | app | Pressenti | après Meteora/Raydium/Pump/Orca | tokens, pools, trades, liquidity, price, OHLC |
|
||||
| Trading Intelligence | noms à définir | libs/jobs | Futur | après données stables | features/signaux/anomalies/ML |
|
||||
|
||||
## Contrats séparés retenus
|
||||
|
||||
|
||||
@@ -104,14 +104,14 @@ Une implémentation conforme doit vérifier les bornes **avant** toute allocatio
|
||||
|
||||
Le début de fichier est strictement :
|
||||
|
||||
| Ordre | Champ | Taille | Valeur / règle |
|
||||
|---:|---|---:|---|
|
||||
| 1 | `magic` | 9 | ASCII exact `KSPWALLET` |
|
||||
| 2 | `format_version` | 2 | `0x0002` |
|
||||
| 3 | `document_length` | 4 | longueur totale exacte du fichier |
|
||||
| 4 | `flags` | 2 | bit 0 = VIEW activé ; tous les autres bits = 0 |
|
||||
| 5 | `owner_auth_public_key` | 32 | clé publique Ed25519 OWNER |
|
||||
| 6 | `view_descriptor.slot_id` | 16 conditionnels | présent uniquement si `flags & 0x0001 != 0` |
|
||||
| Ordre | Champ | Taille | Valeur / règle |
|
||||
|------:|---------------------------|-----------------:|------------------------------------------------|
|
||||
| 1 | `magic` | 9 | ASCII exact `KSPWALLET` |
|
||||
| 2 | `format_version` | 2 | `0x0002` |
|
||||
| 3 | `document_length` | 4 | longueur totale exacte du fichier |
|
||||
| 4 | `flags` | 2 | bit 0 = VIEW activé ; tous les autres bits = 0 |
|
||||
| 5 | `owner_auth_public_key` | 32 | clé publique Ed25519 OWNER |
|
||||
| 6 | `view_descriptor.slot_id` | 16 conditionnels | présent uniquement si `flags & 0x0001 != 0` |
|
||||
|
||||
Offsets fixes avant le descripteur conditionnel :
|
||||
|
||||
@@ -154,21 +154,21 @@ Aucun compteur de slots ou de compartiments n'est nécessaire : leur cardinalit
|
||||
|
||||
Chaque key slot est encodé ainsi :
|
||||
|
||||
| Champ | Taille | Valeur / règle |
|
||||
|---|---:|---|
|
||||
| `role` | 1 | `0x01` OWNER, `0x02` VIEW |
|
||||
| `slot_id` | 16 | identifiant binaire exact |
|
||||
| `kdf_algorithm` | 1 | `0x01` Argon2id |
|
||||
| `kdf_version` | 4 | `19` |
|
||||
| `memory_kib` | 4 | `1..1 048 576`, et `>= parallelism * 8` |
|
||||
| `iterations` | 4 | `1..64` |
|
||||
| `parallelism` | 4 | `1..64` |
|
||||
| `salt_length` | 1 | `16..64` |
|
||||
| `salt` | variable | exactement `salt_length` octets |
|
||||
| `wrap_algorithm` | 1 | `0x01` XChaCha20-Poly1305 |
|
||||
| `wrap_nonce` | 24 | nonce exact |
|
||||
| `wrap_ciphertext_length` | 2 | `16..4096` |
|
||||
| `wrap_ciphertext` | variable | exactement la longueur déclarée |
|
||||
| Champ | Taille | Valeur / règle |
|
||||
|--------------------------|---------:|-----------------------------------------|
|
||||
| `role` | 1 | `0x01` OWNER, `0x02` VIEW |
|
||||
| `slot_id` | 16 | identifiant binaire exact |
|
||||
| `kdf_algorithm` | 1 | `0x01` Argon2id |
|
||||
| `kdf_version` | 4 | `19` |
|
||||
| `memory_kib` | 4 | `1..1 048 576`, et `>= parallelism * 8` |
|
||||
| `iterations` | 4 | `1..64` |
|
||||
| `parallelism` | 4 | `1..64` |
|
||||
| `salt_length` | 1 | `16..64` |
|
||||
| `salt` | variable | exactement `salt_length` octets |
|
||||
| `wrap_algorithm` | 1 | `0x01` XChaCha20-Poly1305 |
|
||||
| `wrap_nonce` | 24 | nonce exact |
|
||||
| `wrap_ciphertext_length` | 2 | `16..4096` |
|
||||
| `wrap_ciphertext` | variable | exactement la longueur déclarée |
|
||||
|
||||
Ordre obligatoire :
|
||||
|
||||
@@ -189,14 +189,14 @@ Toute divergence est invalide avant KDF/déchiffrement.
|
||||
|
||||
Chaque compartiment est encodé :
|
||||
|
||||
| Champ | Taille | Valeur / règle |
|
||||
|---|---:|---|
|
||||
| `kind` | 1 | `0x01` OWNER-CONTROL, `0x02` METADATA, `0x03` SECRET |
|
||||
| `payload_version` | 4 | `1` pour le profil initial V2 |
|
||||
| `algorithm` | 1 | `0x01` XChaCha20-Poly1305 |
|
||||
| `nonce` | 24 | nonce exact |
|
||||
| `ciphertext_length` | 4 | longueur exacte |
|
||||
| `ciphertext` | variable | ciphertext + tag Poly1305 |
|
||||
| Champ | Taille | Valeur / règle |
|
||||
|---------------------|---------:|------------------------------------------------------|
|
||||
| `kind` | 1 | `0x01` OWNER-CONTROL, `0x02` METADATA, `0x03` SECRET |
|
||||
| `payload_version` | 4 | `1` pour le profil initial V2 |
|
||||
| `algorithm` | 1 | `0x01` XChaCha20-Poly1305 |
|
||||
| `nonce` | 24 | nonce exact |
|
||||
| `ciphertext_length` | 4 | longueur exacte |
|
||||
| `ciphertext` | variable | ciphertext + tag Poly1305 |
|
||||
|
||||
Bornes initiales :
|
||||
|
||||
@@ -214,10 +214,10 @@ Les payloads plaintext V2 conservent le modèle fonctionnel établi en V1 pour c
|
||||
|
||||
La fin du document est :
|
||||
|
||||
| Champ | Taille | Valeur / règle |
|
||||
|---|---:|---|
|
||||
| `state_signature.algorithm` | 1 | `0x01` Ed25519 |
|
||||
| `state_signature.signature` | 64 | signature detached exacte |
|
||||
| Champ | Taille | Valeur / règle |
|
||||
|-----------------------------|-------:|---------------------------|
|
||||
| `state_signature.algorithm` | 1 | `0x01` Ed25519 |
|
||||
| `state_signature.signature` | 64 | signature detached exacte |
|
||||
|
||||
Aucun octet ne peut suivre ces 65 octets.
|
||||
|
||||
@@ -377,17 +377,17 @@ Le nonce/ciphertext n'est pas inclus dans son propre AAD.
|
||||
|
||||
V1 et V2 sont deux formats explicites :
|
||||
|
||||
| Propriété | V1 | V2 |
|
||||
|---|---|---|
|
||||
| enveloppe | JSON UTF-8 | binaire KSP |
|
||||
| champs binaires | Base64url no-pad | bytes directs |
|
||||
| version | `1` | `2` |
|
||||
| canonicalité | sémantique JSON + Base64 canonique | byte-exact |
|
||||
| taille fixture wire-only | 2037 octets | 628 octets |
|
||||
| Argon2id | oui | oui |
|
||||
| XChaCha20-Poly1305 | oui | oui |
|
||||
| Ed25519 OWNER state | oui | oui |
|
||||
| VIEW/OWNER | oui | oui |
|
||||
| Propriété | V1 | V2 |
|
||||
|--------------------------|------------------------------------|---------------|
|
||||
| enveloppe | JSON UTF-8 | binaire KSP |
|
||||
| champs binaires | Base64url no-pad | bytes directs |
|
||||
| version | `1` | `2` |
|
||||
| canonicalité | sémantique JSON + Base64 canonique | byte-exact |
|
||||
| taille fixture wire-only | 2037 octets | 628 octets |
|
||||
| Argon2id | oui | oui |
|
||||
| XChaCha20-Poly1305 | oui | oui |
|
||||
| Ed25519 OWNER state | oui | oui |
|
||||
| VIEW/OWNER | oui | oui |
|
||||
|
||||
La réduction mesurée sur le fixture structurel de référence est :
|
||||
|
||||
|
||||
@@ -770,32 +770,32 @@ outil de logging contrôlé
|
||||
|
||||
## 12. Command map
|
||||
|
||||
| Command | Entrée frontend | Sortie sûre | Délégation |
|
||||
|----------------------------------------------|--------------------|-------------------------------------|---------------------------------|
|
||||
| `get_runtime_status` | — | `WalletRuntimeStatusDto` | Config/app state |
|
||||
| `list_wallets` | — | `Vec<WalletInventoryEntryDto>` | app filesystem + Wallet inspect |
|
||||
| `refresh_wallets` | — | inventory DTO | app filesystem + Wallet inspect |
|
||||
| `select_wallet` | wallet id | `LockedWalletDto` | app resolver + Wallet inspect |
|
||||
| `deselect_wallet` | — | session DTO | app state |
|
||||
| `create_wallet` | create request | `WalletAuthorizedDto` OWNER | Wallet create file |
|
||||
| `unlock_wallet_view` | password | authorized VIEW | Wallet open VIEW |
|
||||
| `unlock_wallet_owner` | password | authorized OWNER | Wallet open OWNER |
|
||||
| `unlock_wallet_view_with_configured_secret` | — | authorized VIEW / operation result | Config env + Wallet open VIEW |
|
||||
| `unlock_wallet_owner_with_configured_secret` | — | authorized OWNER / operation result | Config env + Wallet open OWNER |
|
||||
| `lock_wallet` | — | `LockedWalletDto` | drop handle + inspect |
|
||||
| `refresh_wallet_balance` | — | `WalletBalanceDto` | Transport getBalance |
|
||||
| `inspect_import_source` | format only | transfer inspection DTO / cancel | Rust native picker + Wallet inspect |
|
||||
| `import_wallet` | import request | authorized OWNER | staged bytes + Wallet import |
|
||||
| `update_wallet_alias` | alias mutation | authorized DTO | WalletOwner |
|
||||
| `add_wallet_note` | note create | authorized DTO | WalletOwner |
|
||||
| `update_wallet_note` | note update | authorized DTO | WalletOwner |
|
||||
| `delete_wallet_note` | note id | authorized DTO | WalletOwner |
|
||||
| `rotate_owner_password` | rotation request | operation result | WalletOwner |
|
||||
| `rotate_view_password` | rotation request | operation result | WalletOwner |
|
||||
| `disable_view` | confirmation | authorized DTO | WalletOwner |
|
||||
| `recreate_view` | new VIEW password | authorized DTO | WalletOwner |
|
||||
| `export_wallet_owner` | format + save path | operation result | Wallet export file |
|
||||
| `emit_frontend_log` | redacted payload | `()` | Logging facade |
|
||||
| Command | Entrée frontend | Sortie sûre | Délégation |
|
||||
|----------------------------------------------|--------------------|-------------------------------------|-------------------------------------|
|
||||
| `get_runtime_status` | — | `WalletRuntimeStatusDto` | Config/app state |
|
||||
| `list_wallets` | — | `Vec<WalletInventoryEntryDto>` | app filesystem + Wallet inspect |
|
||||
| `refresh_wallets` | — | inventory DTO | app filesystem + Wallet inspect |
|
||||
| `select_wallet` | wallet id | `LockedWalletDto` | app resolver + Wallet inspect |
|
||||
| `deselect_wallet` | — | session DTO | app state |
|
||||
| `create_wallet` | create request | `WalletAuthorizedDto` OWNER | Wallet create file |
|
||||
| `unlock_wallet_view` | password | authorized VIEW | Wallet open VIEW |
|
||||
| `unlock_wallet_owner` | password | authorized OWNER | Wallet open OWNER |
|
||||
| `unlock_wallet_view_with_configured_secret` | — | authorized VIEW / operation result | Config env + Wallet open VIEW |
|
||||
| `unlock_wallet_owner_with_configured_secret` | — | authorized OWNER / operation result | Config env + Wallet open OWNER |
|
||||
| `lock_wallet` | — | `LockedWalletDto` | drop handle + inspect |
|
||||
| `refresh_wallet_balance` | — | `WalletBalanceDto` | Transport getBalance |
|
||||
| `inspect_import_source` | format only | transfer inspection DTO / cancel | Rust native picker + Wallet inspect |
|
||||
| `import_wallet` | import request | authorized OWNER | staged bytes + Wallet import |
|
||||
| `update_wallet_alias` | alias mutation | authorized DTO | WalletOwner |
|
||||
| `add_wallet_note` | note create | authorized DTO | WalletOwner |
|
||||
| `update_wallet_note` | note update | authorized DTO | WalletOwner |
|
||||
| `delete_wallet_note` | note id | authorized DTO | WalletOwner |
|
||||
| `rotate_owner_password` | rotation request | operation result | WalletOwner |
|
||||
| `rotate_view_password` | rotation request | operation result | WalletOwner |
|
||||
| `disable_view` | confirmation | authorized DTO | WalletOwner |
|
||||
| `recreate_view` | new VIEW password | authorized DTO | WalletOwner |
|
||||
| `export_wallet_owner` | format + save path | operation result | Wallet export file |
|
||||
| `emit_frontend_log` | redacted payload | `()` | Logging facade |
|
||||
|
||||
Aucune commande de signature arbitraire n'est ajoutée dans cette release.
|
||||
|
||||
|
||||
@@ -51,19 +51,19 @@ Le checkpoint opérateur `pre.012` du 21 août 2026 est vert : `cargo fmt`, audi
|
||||
|
||||
## 3. Matrice de frontières
|
||||
|
||||
| Frontière | Contrat `0.2.6` | Preuve durable |
|
||||
|---|---|---|
|
||||
| Frontend -> Config | aucun accès direct env/.env | `release_compliance::backend_keeps_config_wallet_transport_and_logging_ownership_boundaries` + ownership Config |
|
||||
| Frontend -> Wallet secret | passwords uniquement request-only ; jamais de keypair en IPC | `desktop_security` + `release_compliance::response_dtos_keep_secret_key_material_out_of_ipc` |
|
||||
| Frontend -> filesystem | aucun path arbitraire ; picker natif Rust | tests import/export + capability audit |
|
||||
| Frontend -> réseau Solana | aucun `fetch`/WebSocket/RPC direct | `release_compliance::frontend_has_no_direct_filesystem_network_or_secret_persistence_surface` |
|
||||
| Wallet Desk -> Solana crates | aucune dépendance protocole directe | `release_compliance::wallet_desk_dependency_firewall_and_tauri_capabilities_are_minimal` |
|
||||
| Wallet Desk -> HTTP | `ksp-onchain-transport-lib` uniquement | manifest + smoke Devnet |
|
||||
| Wallet Desk -> Wallet crypto | `ksp-wallet-lib` uniquement | manifest + feature canaries |
|
||||
| Wallet Desk -> logging | façade `ksp-logging-lib` + adapter `tauri-plugin-tracing` | source audit + workspace logging canary |
|
||||
| locked -> frontend | format/version/VIEW enabled seulement | `desktop_security` |
|
||||
| VIEW/OWNER handles | Rust-only `AppState` | session/security tests |
|
||||
| export | OWNER-only, file direct, no-clobber | `desktop_security` + runtime `pre.012` |
|
||||
| Frontière | Contrat `0.2.6` | Preuve durable |
|
||||
|------------------------------|--------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------|
|
||||
| Frontend -> Config | aucun accès direct env/.env | `release_compliance::backend_keeps_config_wallet_transport_and_logging_ownership_boundaries` + ownership Config |
|
||||
| Frontend -> Wallet secret | passwords uniquement request-only ; jamais de keypair en IPC | `desktop_security` + `release_compliance::response_dtos_keep_secret_key_material_out_of_ipc` |
|
||||
| Frontend -> filesystem | aucun path arbitraire ; picker natif Rust | tests import/export + capability audit |
|
||||
| Frontend -> réseau Solana | aucun `fetch`/WebSocket/RPC direct | `release_compliance::frontend_has_no_direct_filesystem_network_or_secret_persistence_surface` |
|
||||
| Wallet Desk -> Solana crates | aucune dépendance protocole directe | `release_compliance::wallet_desk_dependency_firewall_and_tauri_capabilities_are_minimal` |
|
||||
| Wallet Desk -> HTTP | `ksp-onchain-transport-lib` uniquement | manifest + smoke Devnet |
|
||||
| Wallet Desk -> Wallet crypto | `ksp-wallet-lib` uniquement | manifest + feature canaries |
|
||||
| Wallet Desk -> logging | façade `ksp-logging-lib` + adapter `tauri-plugin-tracing` | source audit + workspace logging canary |
|
||||
| locked -> frontend | format/version/VIEW enabled seulement | `desktop_security` |
|
||||
| VIEW/OWNER handles | Rust-only `AppState` | session/security tests |
|
||||
| export | OWNER-only, file direct, no-clobber | `desktop_security` + runtime `pre.012` |
|
||||
|
||||
## 4. Inventory / path adversarial
|
||||
|
||||
|
||||
Reference in New Issue
Block a user