From bf6ef5b4265cbb3d77e423216d4b123f29d3396a Mon Sep 17 00:00:00 2001 From: SinuS Von SifriduS Date: Tue, 8 Sep 2026 16:48:22 +0200 Subject: [PATCH] v0.3.11-pre.009-fix.001 --- Cargo.toml | 2 +- .../unit_tests/admission.rs | 10 +- .../unit_tests/runtime.rs | 17 +-- deltas/0.3.11/pre.009-fix.001.md | 100 ++++++++++++++++++ 4 files changed, 117 insertions(+), 12 deletions(-) create mode 100644 deltas/0.3.11/pre.009-fix.001.md diff --git a/Cargo.toml b/Cargo.toml index 90a4d37..152cd95 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -6,7 +6,7 @@ resolver = "3" members = ["crates/ksp-app-backfill-desk", "crates/ksp-app-config-desk", "crates/ksp-app-solprices-desk", "crates/ksp-app-store-desk", "crates/ksp-app-wallet-desk", "crates/ksp-config-lib", "crates/ksp-core-lib", "crates/ksp-interface-lib", "crates/ksp-job-api", "crates/ksp-job-backfill-lib", "crates/ksp-logging-lib", "crates/ksp-offchain-transport-lib", "crates/ksp-onchain-transport-lib", "crates/ksp-program-api", "crates/ksp-raw-transaction-lib", "crates/ksp-store-api", "crates/ksp-store-lib", "crates/ksp-store-postgres-lib", "crates/ksp-wallet-lib", "crates/ksp-worker-api", "crates/ksp-worker-raw-transaction-ingest-lib"] [workspace.package] -version = "0.3.11-pre.9" +version = "0.3.11-pre.9.fix.1" edition = "2024" license = "MIT" repository = "https://git.sasedev.com/Sasedev/khadhroony-solana-project" diff --git a/crates/ksp-worker-raw-transaction-ingest-lib/unit_tests/admission.rs b/crates/ksp-worker-raw-transaction-ingest-lib/unit_tests/admission.rs index d2304c2..efa60b2 100644 --- a/crates/ksp-worker-raw-transaction-ingest-lib/unit_tests/admission.rs +++ b/crates/ksp-worker-raw-transaction-ingest-lib/unit_tests/admission.rs @@ -1,5 +1,5 @@ // file: crates/ksp-worker-raw-transaction-ingest-lib/unit_tests/admission.rs -// version: 3 +// version: 4 fn material( network: &str, @@ -251,12 +251,14 @@ async fn pre_009_full_queue_dequeue_marks_source_neutral_backpressure_observatio std::option::Option::None => return, }; let (mut admission, sender) = crate::RawTransactionAdmission::new(1); - let ingress = crate::RawTransactionIngress { material, network, provenance, source_key: [13; 32] }; + let ingress = crate::RawTransactionIngress { material, network: network.clone(), provenance, source_key: [13; 32] }; assert!(sender.send(ingress).await.is_ok()); - assert!(admission.receive().await.is_some()); + let first = admission.receive(&network).await; + assert!(matches!(first, std::result::Result::Ok(std::option::Option::Some(_)))); assert!(admission.take_backpressure_wait_observed()); admission.close(); - assert!(admission.receive().await.is_none()); + let second = admission.receive(&network).await; + assert!(matches!(second, std::result::Result::Ok(std::option::Option::None))); assert!(!admission.take_backpressure_wait_observed()); return; } diff --git a/crates/ksp-worker-raw-transaction-ingest-lib/unit_tests/runtime.rs b/crates/ksp-worker-raw-transaction-ingest-lib/unit_tests/runtime.rs index 6df90e4..e0df1df 100644 --- a/crates/ksp-worker-raw-transaction-ingest-lib/unit_tests/runtime.rs +++ b/crates/ksp-worker-raw-transaction-ingest-lib/unit_tests/runtime.rs @@ -1,5 +1,5 @@ // file: crates/ksp-worker-raw-transaction-ingest-lib/unit_tests/runtime.rs -// version: 6 +// version: 7 struct ActiveTaskGuard { active: std::sync::Arc, @@ -678,13 +678,16 @@ async fn pre_009_source_failure_is_counted_and_late_stop_cannot_replace_terminal std::option::Option::Some(value) => value, std::option::Option::None => return, }; - let handle = - match super::start_foundation_with_source_spawner(settings, tokio::runtime::Handle::current(), move |children, _stop_receiver, _admission_sender| { + let handle = match super::start_foundation_with_source_spawner( + settings, + tokio::runtime::Handle::current(), + move |children: &mut tokio::task::JoinSet>, _stop_receiver, _admission_sender| { let _abort_handle = children.spawn(async move { std::result::Result::Err(crate::runtime_error("test.source_failed")) }); - }) { - std::result::Result::Ok(value) => value, - std::result::Result::Err(_) => return, - }; + }, + ) { + std::result::Result::Ok(value) => value, + std::result::Result::Err(_) => return, + }; let source = handle.snapshot_source(); let terminal = match handle.wait_terminal().await { std::result::Result::Ok(value) => value, diff --git a/deltas/0.3.11/pre.009-fix.001.md b/deltas/0.3.11/pre.009-fix.001.md new file mode 100644 index 0000000..7cba440 --- /dev/null +++ b/deltas/0.3.11/pre.009-fix.001.md @@ -0,0 +1,100 @@ + + + +# Delta `0.3.11-pre.009-fix.001` — correction de compilation des tests de hardening + +## Base requise + +```text +0.3.11-pre.009 +workspace.package.version = 0.3.11-pre.9 +``` + +## Défaut opérateur constaté + +Le gate opérateur du 8 septembre 2026 confirme que `cargo fmt --all`, les audits Rust/Markdown et `cargo check --workspace` passent, mais que `cargo clippy --workspace --all-targets --all-features -- -D warnings` et `cargo test -p ksp-worker-raw-transaction-ingest-lib` ne peuvent compiler deux tests ajoutés par `pre.009`. + +Diagnostics exacts : + +```text +unit_tests/admission.rs : appel à RawTransactionAdmission::receive sans expected_network et traitement Option au lieu de Result> +unit_tests/runtime.rs : type du paramètre children non inférable dans le closure source-failure +``` + +Le code de production compile ; les défauts sont strictement localisés dans les tests de `pre.009`. + +## Objectif + +Corriger uniquement les tests de hardening de `pre.009`, sans modifier le runtime de production, l'admission, la persistence, les snapshots, les terminaux, les compteurs, les dépendances ou les features. + +## Version + +Le correctif touche des fichiers Rust de test. Conformément aux règles de version applicables aux corrections code/build : + +```text +identifiant de livraison : 0.3.11-pre.009-fix.001 +workspace.package.version : 0.3.11-pre.9.fix.1 +``` + +## Modifications + +Le test `pre_009_full_queue_dequeue_marks_source_neutral_backpressure_observation` conserve désormais une copie du `RawNetworkId`, appelle explicitement `receive(&network)` et vérifie la forme `Result>` avec `matches!`, sans `unwrap`, `expect` ni `?`. + +Le test `pre_009_source_failure_is_counted_and_late_stop_cannot_replace_terminal_fault` annote explicitement le paramètre `children` du closure avec le type privé attendu par le harness : + +```text +&mut tokio::task::JoinSet> +``` + +Aucun fichier Rust de production n'est modifié. + +## Fichiers ajoutés + +```text +deltas/0.3.11/pre.009-fix.001.md +``` + +## Fichiers modifiés + +```text +Cargo.toml +crates/ksp-worker-raw-transaction-ingest-lib/unit_tests/admission.rs +crates/ksp-worker-raw-transaction-ingest-lib/unit_tests/runtime.rs +``` + +## Fichiers supprimés + +Aucun. + +## Validations exécutées dans l'environnement d'assemblage + +```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 +scan statique : les deux appels receive utilisent expected_network et traitent Result> +scan statique : le closure source-failure annote explicitement JoinSet> +scan statique : aucun fichier src/ de production ni manifest de crate Worker modifié +``` + +L'environnement d'assemblage ne fournit ni `cargo`, ni `rustc`, ni `rustfmt`. Aucun gate Cargo du fix n'est déclaré PASS localement. + +## Gate opérateur demandé + +Aucune dépendance ni feature n'étant modifiée, aucun `cargo tree` n'est requis pour ce fix. + +```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 +cargo check --workspace +cargo clippy --workspace --all-targets --all-features -- -D warnings +cargo test -p ksp-worker-raw-transaction-ingest-lib +``` + +## Décision + +`pre.010` reste bloquée jusqu'à validation opérateur verte de ce fix. Le périmètre fonctionnel de `pre.009` n'est pas redéfini. + +## Questions ouvertes + +Aucune.