v0.3.2-pre.003-fix.001
This commit is contained in:
@@ -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-store-lib", "crates/ksp-store-postgres-lib", "crates/ksp-wallet-lib"]
|
||||
|
||||
[workspace.package]
|
||||
version = "0.3.2-pre.3"
|
||||
version = "0.3.2-pre.3.fix.1"
|
||||
edition = "2024"
|
||||
license = "MIT"
|
||||
repository = "https://git.sasedev.com/Sasedev/khadhroony-solana-project"
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
// file: crates/ksp-store-lib/tests/dependency_boundary.rs
|
||||
// version: 3
|
||||
// version: 4
|
||||
|
||||
#![warn(missing_docs)]
|
||||
#![deny(unreachable_pub)]
|
||||
@@ -39,7 +39,17 @@ fn pre_003_facade_adds_only_backend_neutral_settings_lifecycle_and_api_reexports
|
||||
assert!(crate_root.contains("pub use self::store::Store;"));
|
||||
assert!(crate_root.contains("pub use ksp_store_api::RawTransaction;"));
|
||||
assert!(crate_root.contains("const _: &str = crate::TRACING_TARGET;"));
|
||||
for forbidden in ["pub mod ", "pub use ksp_store_postgres_lib", "tokio_postgres", "deadpool_postgres", "rustls::", "Pool", "Client", "Row", "Statement"] {
|
||||
for forbidden in [
|
||||
"pub mod ",
|
||||
"pub use ksp_store_postgres_lib",
|
||||
"tokio_postgres",
|
||||
"deadpool_postgres",
|
||||
"rustls::",
|
||||
"deadpool::managed::Pool",
|
||||
"tokio_postgres::Client",
|
||||
"tokio_postgres::Row",
|
||||
"tokio_postgres::Statement",
|
||||
] {
|
||||
assert!(!crate_root.contains(forbidden), "forbidden physical backend facade surface detected: {forbidden}");
|
||||
}
|
||||
let production = format!("{}\n{}", include_str!("../src/settings.rs"), include_str!("../src/store.rs"));
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
// file: crates/ksp-store-lib/tests/feature_mismatch.rs
|
||||
// version: 1
|
||||
// version: 2
|
||||
|
||||
#![warn(missing_docs)]
|
||||
#![deny(unreachable_pub)]
|
||||
@@ -32,7 +32,7 @@ fn settings() -> ksp_store_lib::StoreSettings {
|
||||
fn pre_003_known_postgres_without_feature_returns_stable_error_before_io() {
|
||||
let result = poll_ready(ksp_store_lib::Store::open(settings()));
|
||||
let error = result.err();
|
||||
assert_eq!(error.map(|value| value.code()), std::option::Option::Some(ksp_store_lib::ERROR_CODE_BACKEND_NOT_COMPILED));
|
||||
assert_eq!(error.map(|value| return value.code()), std::option::Option::Some(ksp_store_lib::ERROR_CODE_BACKEND_NOT_COMPILED));
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -41,6 +41,6 @@ fn pre_003_known_postgres_without_feature_returns_stable_error_before_io() {
|
||||
fn pre_003_compiled_postgres_path_refuses_to_fake_readiness_before_pre_005() {
|
||||
let result = poll_ready(ksp_store_lib::Store::open(settings()));
|
||||
let error = result.err();
|
||||
assert_eq!(error.map(|value| value.code()), std::option::Option::Some(ksp_store_lib::ERROR_CODE_BACKEND_OPEN_FAILED));
|
||||
assert_eq!(error.map(|value| return value.code()), std::option::Option::Some(ksp_store_lib::ERROR_CODE_BACKEND_OPEN_FAILED));
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
// file: crates/ksp-store-lib/unit_tests/settings.rs
|
||||
// version: 1
|
||||
// version: 2
|
||||
|
||||
fn valid_postgres_settings() -> crate::PostgresStoreSettings {
|
||||
return crate::PostgresStoreSettings::new(
|
||||
@@ -113,7 +113,7 @@ fn store_shutdown_bound_is_independent_from_backend_and_rejects_outside_values()
|
||||
assert!(valid.validate().is_ok());
|
||||
let invalid = crate::StoreSettings::new(crate::StoreBackendSettings::Postgres(valid_postgres_settings()), std::time::Duration::from_millis(30_001));
|
||||
let error = invalid.validate().err();
|
||||
assert_eq!(error.map(|value| value.code()), std::option::Option::Some(crate::ERROR_CODE_SETTINGS_INVALID));
|
||||
assert_eq!(error.map(|value| return value.code()), std::option::Option::Some(crate::ERROR_CODE_SETTINGS_INVALID));
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -133,7 +133,7 @@ fn connection_uri_is_required_but_never_rendered_by_debug_or_validation_error()
|
||||
crate::PostgresBootstrapSettings::default(),
|
||||
);
|
||||
let error = empty.validate().err();
|
||||
assert_eq!(error.as_ref().map(|value| value.code()), std::option::Option::Some(crate::ERROR_CODE_SETTINGS_INVALID));
|
||||
assert_eq!(error.as_ref().map(|value| return value.code()), std::option::Option::Some(crate::ERROR_CODE_SETTINGS_INVALID));
|
||||
assert!(!format!("{:?}", error).contains(secret));
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
// file: crates/ksp-store-lib/unit_tests/store.rs
|
||||
// version: 1
|
||||
// version: 2
|
||||
|
||||
fn poll_ready<T>(future: impl std::future::Future<Output = T>) -> T {
|
||||
let mut future = std::boxed::Box::pin(future);
|
||||
@@ -32,7 +32,7 @@ fn invalid_settings_are_rejected_before_backend_dispatch() {
|
||||
let settings = crate::StoreSettings::with_default_shutdown(crate::StoreBackendSettings::Postgres(postgres));
|
||||
let result = poll_ready(crate::Store::open(settings));
|
||||
let error = result.err();
|
||||
assert_eq!(error.map(|value| value.code()), std::option::Option::Some(crate::ERROR_CODE_SETTINGS_INVALID));
|
||||
assert_eq!(error.map(|value| return value.code()), std::option::Option::Some(crate::ERROR_CODE_SETTINGS_INVALID));
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -41,7 +41,7 @@ fn invalid_settings_are_rejected_before_backend_dispatch() {
|
||||
fn compiled_postgres_dispatch_does_not_fake_readiness_before_connection_materialization() {
|
||||
let result = poll_ready(crate::Store::open(valid_store_settings()));
|
||||
let error = result.err();
|
||||
assert_eq!(error.map(|value| value.code()), std::option::Option::Some(crate::ERROR_CODE_BACKEND_OPEN_FAILED));
|
||||
assert_eq!(error.map(|value| return value.code()), std::option::Option::Some(crate::ERROR_CODE_BACKEND_OPEN_FAILED));
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -50,6 +50,6 @@ fn compiled_postgres_dispatch_does_not_fake_readiness_before_connection_material
|
||||
fn known_postgres_without_feature_is_rejected_before_io() {
|
||||
let result = poll_ready(crate::Store::open(valid_store_settings()));
|
||||
let error = result.err();
|
||||
assert_eq!(error.map(|value| value.code()), std::option::Option::Some(crate::ERROR_CODE_BACKEND_NOT_COMPILED));
|
||||
assert_eq!(error.map(|value| return value.code()), std::option::Option::Some(crate::ERROR_CODE_BACKEND_NOT_COMPILED));
|
||||
return;
|
||||
}
|
||||
|
||||
143
deltas/0.3.2/pre.003-fix.001.md
Normal file
143
deltas/0.3.2/pre.003-fix.001.md
Normal file
@@ -0,0 +1,143 @@
|
||||
<!-- file: deltas/0.3.2/pre.003-fix.001.md -->
|
||||
<!-- version: 1 -->
|
||||
|
||||
# Delta `0.3.2-pre.003-fix.001` — conformité Clippy et canari de frontière Store
|
||||
|
||||
## 1. Base requise
|
||||
|
||||
Base exacte :
|
||||
|
||||
```text
|
||||
0.3.2-pre.003
|
||||
workspace.package.version = 0.3.2-pre.3
|
||||
```
|
||||
|
||||
Le gate opérateur fourni le 29 août 2026 confirme :
|
||||
|
||||
```text
|
||||
cargo fmt --all PASS
|
||||
audit Rust général / exports / workspace PASS
|
||||
audit Markdown PASS — 186 tables / 127 files
|
||||
cargo check --workspace PASS
|
||||
cargo clippy --workspace --all-targets FAIL — 5 implicit_return observés dans les tests Store
|
||||
cargo test -p ksp-store-api PASS
|
||||
cargo test -p ksp-store-lib FAIL — faux positif dependency_boundary sur PostgresPoolSettings
|
||||
cargo test -p ksp-store-lib --no-default-features FAIL — même faux positif dependency_boundary
|
||||
cargo test -p ksp-store-postgres-lib PASS
|
||||
cargo check -p ksp-store-lib --no-default-features PASS
|
||||
```
|
||||
|
||||
Aucun défaut de production/runtime n'est observé : les 6 tests unitaires Store passent dans les deux configurations de feature. Le correctif reste strictement dans le couloir `pre.003`.
|
||||
|
||||
## 2. Objet
|
||||
|
||||
Corriger exclusivement :
|
||||
|
||||
```text
|
||||
les closures de tests non conformes à clippy::implicit_return
|
||||
le canari dependency_boundary trop large qui interdit le mot générique Pool
|
||||
```
|
||||
|
||||
Aucune surface API, borne, erreur, lifecycle, feature, dépendance ou comportement Store n'est modifié.
|
||||
|
||||
## 3. Clippy `implicit_return`
|
||||
|
||||
Les closures de projection de code d'erreur utilisent désormais la forme explicite requise par `RUST-ERR-003` :
|
||||
|
||||
```rust
|
||||
|value| return value.code()
|
||||
```
|
||||
|
||||
La correction couvre toutes les occurrences de la tranche, y compris les branches compilées uniquement avec `--no-default-features`.
|
||||
|
||||
## 4. Canari de frontière physique
|
||||
|
||||
Le test `pre_003_facade_adds_only_backend_neutral_settings_lifecycle_and_api_reexports` interdisait le token nu :
|
||||
|
||||
```text
|
||||
Pool
|
||||
```
|
||||
|
||||
Cette condition est incorrecte car `PostgresPoolSettings` est une surface de configuration backend-neutral explicitement prévue par `pre.003`. Elle provoquait donc un faux positif tout en ne prouvant pas mieux l'absence de fuite physique.
|
||||
|
||||
Le canari interdit désormais les chemins/types physiques ciblés :
|
||||
|
||||
```text
|
||||
pub use ksp_store_postgres_lib
|
||||
tokio_postgres
|
||||
deadpool_postgres
|
||||
rustls::
|
||||
deadpool::managed::Pool
|
||||
tokio_postgres::Client
|
||||
tokio_postgres::Row
|
||||
tokio_postgres::Statement
|
||||
```
|
||||
|
||||
Les protections existantes sur le manifeste et les production sources restent inchangées.
|
||||
|
||||
## 5. Version Cargo
|
||||
|
||||
Le correctif modifie des fichiers Rust de tests consommés par le build. Conformément à `VER-ID-007` et `VER-ID-010` :
|
||||
|
||||
```text
|
||||
workspace.package.version = 0.3.2-pre.3.fix.1
|
||||
```
|
||||
|
||||
Livraison :
|
||||
|
||||
```text
|
||||
0.3.2-pre.003-fix.001
|
||||
```
|
||||
|
||||
## 6. Fichiers modifiés
|
||||
|
||||
```text
|
||||
Cargo.toml
|
||||
crates/ksp-store-lib/tests/dependency_boundary.rs
|
||||
crates/ksp-store-lib/tests/feature_mismatch.rs
|
||||
crates/ksp-store-lib/unit_tests/settings.rs
|
||||
crates/ksp-store-lib/unit_tests/store.rs
|
||||
```
|
||||
|
||||
Chaque fichier Rust réellement modifié incrémente son header de version une seule fois. Aucun autre fichier source n'est touché.
|
||||
|
||||
## 7. Fichier ajouté
|
||||
|
||||
```text
|
||||
deltas/0.3.2/pre.003-fix.001.md
|
||||
```
|
||||
|
||||
## 8. Fichiers supprimés
|
||||
|
||||
```text
|
||||
aucun
|
||||
```
|
||||
|
||||
## 9. Validations exécutées dans l'environnement de génération
|
||||
|
||||
```text
|
||||
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.2
|
||||
```
|
||||
|
||||
`cargo`, `rustc` et `rustfmt` ne sont pas disponibles dans l'environnement de génération. Aucun gate Cargo n'est donc déclaré PASS ici.
|
||||
|
||||
## 10. Gate opérateur requis
|
||||
|
||||
```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.2
|
||||
cargo check --workspace
|
||||
cargo clippy --workspace --all-targets
|
||||
cargo test -p ksp-store-lib
|
||||
cargo test -p ksp-store-lib --no-default-features
|
||||
cargo test -p ksp-store-postgres-lib
|
||||
cargo check -p ksp-store-lib --no-default-features
|
||||
```
|
||||
|
||||
## 11. Décisions et questions ouvertes
|
||||
|
||||
Décision : un canari de fuite backend doit cibler des symboles/chemins physiques, pas interdire des mots génériques faisant partie de settings publics légitimes.
|
||||
|
||||
Question ouverte : aucune. Si le gate est vert, la suite reste `0.3.2-pre.004` — Config `std.store`.
|
||||
Reference in New Issue
Block a user