v0.3.1-pre.007-fix.001

This commit is contained in:
2026-08-29 09:54:55 +02:00
parent 47b12e14e6
commit ad02b6f13c
4 changed files with 80 additions and 13 deletions

View File

@@ -6,7 +6,7 @@ resolver = "3"
members = ["crates/ksp-app-config-desk", "crates/ksp-app-solprices-desk", "crates/ksp-app-wallet-desk", "crates/ksp-config-lib", "crates/ksp-core-lib", "crates/ksp-interface-lib", "crates/ksp-logging-lib", "crates/ksp-offchain-transport-lib", "crates/ksp-onchain-transport-lib", "crates/ksp-program-api", "crates/ksp-store-api", "crates/ksp-wallet-lib"] members = ["crates/ksp-app-config-desk", "crates/ksp-app-solprices-desk", "crates/ksp-app-wallet-desk", "crates/ksp-config-lib", "crates/ksp-core-lib", "crates/ksp-interface-lib", "crates/ksp-logging-lib", "crates/ksp-offchain-transport-lib", "crates/ksp-onchain-transport-lib", "crates/ksp-program-api", "crates/ksp-store-api", "crates/ksp-wallet-lib"]
[workspace.package] [workspace.package]
version = "0.3.1-pre.7" version = "0.3.1-pre.7-fix.1"
edition = "2024" edition = "2024"
license = "MIT" license = "MIT"
repository = "https://git.sasedev.com/Sasedev/khadhroony-solana-project" repository = "https://git.sasedev.com/Sasedev/khadhroony-solana-project"

View File

@@ -83,15 +83,33 @@ fn pre_007_exact_crate_root_export_inventory_is_stable() {
} }
#[test] #[test]
fn pre_007_exact_production_module_inventory_is_raw_only() -> std::io::Result<()> { fn pre_007_exact_production_module_inventory_is_raw_only() {
let root = std::path::Path::new(env!("CARGO_MANIFEST_DIR")).join("src"); let root = std::path::Path::new(env!("CARGO_MANIFEST_DIR")).join("src");
assert_eq!(rust_file_names(root.as_path())?, std::vec!["capability.rs", "error.rs", "lib.rs", "model.rs"]); let root_names = rust_file_names(root.as_path());
assert!(root_names.is_ok());
let root_names = match root_names {
std::result::Result::Ok(value) => value,
std::result::Result::Err(_) => return,
};
assert_eq!(root_names, std::vec!["capability.rs", "error.rs", "lib.rs", "model.rs"]);
let model_names = rust_file_names(root.join("model").as_path());
assert!(model_names.is_ok());
let model_names = match model_names {
std::result::Result::Ok(value) => value,
std::result::Result::Err(_) => return,
};
assert_eq!( assert_eq!(
rust_file_names(root.join("model").as_path())?, model_names,
std::vec!["raw_account.rs", "raw_outcome.rs", "raw_pagination.rs", "raw_primitives.rs", "raw_retention.rs", "raw_transaction.rs"] std::vec!["raw_account.rs", "raw_outcome.rs", "raw_pagination.rs", "raw_primitives.rs", "raw_retention.rs", "raw_transaction.rs"]
); );
assert_eq!(rust_file_names(root.join("capability").as_path())?, std::vec!["raw_account.rs", "raw_retention.rs", "raw_transaction.rs"]); let capability_names = rust_file_names(root.join("capability").as_path());
return std::result::Result::Ok(()); assert!(capability_names.is_ok());
let capability_names = match capability_names {
std::result::Result::Ok(value) => value,
std::result::Result::Err(_) => return,
};
assert_eq!(capability_names, std::vec!["raw_account.rs", "raw_retention.rs", "raw_transaction.rs"]);
return;
} }
#[test] #[test]
@@ -208,11 +226,21 @@ fn assert_non_exhaustive(sources: &[&str], enum_name: &str) {
} }
fn rust_file_names(directory: &std::path::Path) -> std::io::Result<std::vec::Vec<std::string::String>> { fn rust_file_names(directory: &std::path::Path) -> std::io::Result<std::vec::Vec<std::string::String>> {
let entries = std::fs::read_dir(directory)?; let entries = match std::fs::read_dir(directory) {
std::result::Result::Ok(value) => value,
std::result::Result::Err(error) => return std::result::Result::Err(error),
};
let mut names = std::vec::Vec::new(); let mut names = std::vec::Vec::new();
for entry in entries { for entry in entries {
let entry = entry?; let entry = match entry {
if !entry.file_type()?.is_file() { std::result::Result::Ok(value) => value,
std::result::Result::Err(error) => return std::result::Result::Err(error),
};
let file_type = match entry.file_type() {
std::result::Result::Ok(value) => value,
std::result::Result::Err(error) => return std::result::Result::Err(error),
};
if !file_type.is_file() {
continue; continue;
} }
let name = match entry.file_name().into_string() { let name = match entry.file_name().into_string() {

View File

@@ -14,7 +14,7 @@ fn pre_007_hostile_model_query_and_provenance_errors_never_echo_input_material()
std::result::Result::Err(value) => value, std::result::Result::Err(value) => value,
std::result::Result::Ok(_) => return, std::result::Result::Ok(_) => return,
}; };
assert_eq!(network_error.code(), &ksp_store_api::ERROR_CODE_RAW_MODEL_INVALID); assert_eq!(network_error.code(), ksp_store_api::ERROR_CODE_RAW_MODEL_INVALID);
assert!(!std::format!("{network_error}").contains(HOSTILE_MARKER)); assert!(!std::format!("{network_error}").contains(HOSTILE_MARKER));
assert!(!std::format!("{network_error:?}").contains(HOSTILE_MARKER)); assert!(!std::format!("{network_error:?}").contains(HOSTILE_MARKER));
let provenance = ksp_store_api::RawProvenanceCode::new(hostile_code.clone()); let provenance = ksp_store_api::RawProvenanceCode::new(hostile_code.clone());
@@ -23,7 +23,7 @@ fn pre_007_hostile_model_query_and_provenance_errors_never_echo_input_material()
std::result::Result::Err(value) => value, std::result::Result::Err(value) => value,
std::result::Result::Ok(_) => return, std::result::Result::Ok(_) => return,
}; };
assert_eq!(provenance_error.code(), &ksp_store_api::ERROR_CODE_RAW_PROVENANCE_INVALID); assert_eq!(provenance_error.code(), ksp_store_api::ERROR_CODE_RAW_PROVENANCE_INVALID);
assert!(!std::format!("{provenance_error}").contains(HOSTILE_MARKER)); assert!(!std::format!("{provenance_error}").contains(HOSTILE_MARKER));
assert!(!std::format!("{provenance_error:?}").contains(HOSTILE_MARKER)); assert!(!std::format!("{provenance_error:?}").contains(HOSTILE_MARKER));
let format = ksp_store_api::RawFormatId::new(hostile_code); let format = ksp_store_api::RawFormatId::new(hostile_code);
@@ -32,7 +32,7 @@ fn pre_007_hostile_model_query_and_provenance_errors_never_echo_input_material()
std::result::Result::Err(value) => value, std::result::Result::Err(value) => value,
std::result::Result::Ok(_) => return, std::result::Result::Ok(_) => return,
}; };
assert_eq!(format_error.code(), &ksp_store_api::ERROR_CODE_RAW_PAYLOAD_INVALID); assert_eq!(format_error.code(), ksp_store_api::ERROR_CODE_RAW_PAYLOAD_INVALID);
assert!(!std::format!("{format_error}").contains(HOSTILE_MARKER)); assert!(!std::format!("{format_error}").contains(HOSTILE_MARKER));
assert!(!std::format!("{format_error:?}").contains(HOSTILE_MARKER)); assert!(!std::format!("{format_error:?}").contains(HOSTILE_MARKER));
let cursor = ksp_store_api::RawPageCursor::try_new(std::vec![0x41_u8; ksp_store_api::MAX_RAW_PAGE_CURSOR_BYTES + 1].into_boxed_slice()); let cursor = ksp_store_api::RawPageCursor::try_new(std::vec![0x41_u8; ksp_store_api::MAX_RAW_PAGE_CURSOR_BYTES + 1].into_boxed_slice());
@@ -41,7 +41,7 @@ fn pre_007_hostile_model_query_and_provenance_errors_never_echo_input_material()
std::result::Result::Err(value) => value, std::result::Result::Err(value) => value,
std::result::Result::Ok(_) => return, std::result::Result::Ok(_) => return,
}; };
assert_eq!(cursor_error.code(), &ksp_store_api::ERROR_CODE_RAW_QUERY_INVALID); assert_eq!(cursor_error.code(), ksp_store_api::ERROR_CODE_RAW_QUERY_INVALID);
assert!(!std::format!("{cursor_error}").contains(HOSTILE_MARKER)); assert!(!std::format!("{cursor_error}").contains(HOSTILE_MARKER));
assert!(!std::format!("{cursor_error:?}").contains(HOSTILE_MARKER)); assert!(!std::format!("{cursor_error:?}").contains(HOSTILE_MARKER));
return; return;

View File

@@ -0,0 +1,39 @@
# Delta `0.3.1-pre.007-fix.001`
## Objet
Corriger exclusivement les erreurs de compilation et Clippy des nouveaux canaris de hardening/completeness introduits par `0.3.1-pre.007`.
## Version
```text
0.3.1-pre.7-fix.1
```
Le changement de version est requis car ce fix modifie du code Rust/tests exécutables ; il fournit également une identité Cargo distincte pour le rebuild.
## Corrections
- retire quatre emprunts `&ErrorCode` erronés dans `tests/security_hardening.rs` ; `Error::code()` retourne déjà `ErrorCode` par valeur ;
- remplace les six usages de `?` interdits par `clippy::question-mark-used` dans `tests/release_completeness.rs` par des branches `Result` explicites ;
- ne modifie aucun contrat public, modèle RAW, capability, outcome, règle de rétention ou comportement fonctionnel.
## Payload
```text
Cargo.toml
crates/ksp-store-api/tests/release_completeness.rs
crates/ksp-store-api/tests/security_hardening.rs
deltas/0.3.1/pre.007-fix.001.md
```
## Gate opérateur
```bash
cargo fmt --all
python3 scripts/audit_rust_workspace_rules.py
python3 scripts/audit_markdown_tables.py README.md RULES.md ROADMAP.md CHANGELOG.md docs prompts crates deltas/0.3.1
cargo check --workspace
cargo clippy --workspace --all-targets
cargo test -p ksp-store-api
```