v0.3.7-pre.008-fix.001
This commit is contained in:
@@ -1,12 +1,12 @@
|
||||
# file: Cargo.toml
|
||||
# version: 427
|
||||
# version: 428
|
||||
|
||||
[workspace]
|
||||
resolver = "3"
|
||||
members = ["crates/ksp-app-backfill-desk", "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-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-store-api", "crates/ksp-store-lib", "crates/ksp-store-postgres-lib", "crates/ksp-wallet-lib"]
|
||||
|
||||
[workspace.package]
|
||||
version = "0.3.7-pre.8"
|
||||
version = "0.3.7-pre.8.fix.1"
|
||||
edition = "2024"
|
||||
license = "MIT"
|
||||
repository = "https://git.sasedev.com/Sasedev/khadhroony-solana-project"
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
// file: crates/ksp-job-backfill-lib/src/discovery.rs
|
||||
// version: 5
|
||||
// version: 6
|
||||
|
||||
/// Network-scoped identity of one discovered transaction candidate before canonical signature decoding.
|
||||
#[derive(Clone, Debug, Eq, Hash, PartialEq)]
|
||||
@@ -166,7 +166,8 @@ struct SignaturePageEntry {
|
||||
slot: u64,
|
||||
}
|
||||
|
||||
type SignaturePageFuture<'a> = std::pin::Pin<std::boxed::Box<dyn std::future::Future<Output = ksp_core_lib::Result<std::vec::Vec<SignaturePageEntry>>> + 'a>>;
|
||||
type SignaturePageFuture<'a> =
|
||||
std::pin::Pin<std::boxed::Box<dyn std::future::Future<Output = ksp_core_lib::Result<std::vec::Vec<SignaturePageEntry>>> + std::marker::Send + 'a>>;
|
||||
|
||||
trait SignaturePageSource {
|
||||
fn fetch_signature_page<'a>(
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
// file: crates/ksp-job-backfill-lib/src/execution.rs
|
||||
// version: 3
|
||||
// version: 4
|
||||
|
||||
use futures_util::StreamExt; // rust-rules: trait-import
|
||||
|
||||
@@ -266,7 +266,7 @@ pub(crate) async fn execute_backfill_discovery_cancellable(
|
||||
}
|
||||
|
||||
type CandidateProcessFuture<'a> =
|
||||
std::pin::Pin<std::boxed::Box<dyn std::future::Future<Output = ksp_core_lib::Result<crate::BackfillPersistenceOutcome>> + 'a>>;
|
||||
std::pin::Pin<std::boxed::Box<dyn std::future::Future<Output = ksp_core_lib::Result<crate::BackfillPersistenceOutcome>> + std::marker::Send + 'a>>;
|
||||
|
||||
trait CandidateProcessor {
|
||||
fn process<'a>(&'a self, candidate: &'a crate::BackfillCandidate) -> CandidateProcessFuture<'a>;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
// file: crates/ksp-job-backfill-lib/unit_tests/discovery.rs
|
||||
// version: 6
|
||||
// version: 7
|
||||
|
||||
#[derive(Clone, Debug, Eq, PartialEq)]
|
||||
struct PageCall {
|
||||
@@ -147,6 +147,18 @@ fn candidate_signatures(discovery: &crate::BackfillDiscovery) -> std::vec::Vec<s
|
||||
return signatures;
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn pre_008_fix_001_signature_page_future_contract_is_send() {
|
||||
fn require_send<T: std::marker::Send>(_value: T) {
|
||||
return;
|
||||
}
|
||||
let future: super::SignaturePageFuture<'static> = std::boxed::Box::pin(async {
|
||||
return std::result::Result::Ok(std::vec::Vec::new());
|
||||
});
|
||||
require_send(future);
|
||||
return;
|
||||
}
|
||||
|
||||
#[tokio::test]
|
||||
async fn pre_005_latest_paginates_newest_first_and_deduplicates_pages_stably() {
|
||||
let scope = crate::BackfillScope::latest_address(ksp_core_lib::Pubkey::new_from_array([1_u8; 32]));
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
// file: crates/ksp-job-backfill-lib/unit_tests/execution.rs
|
||||
// version: 3
|
||||
// version: 4
|
||||
|
||||
#[derive(Clone, Copy)]
|
||||
enum FakeDisposition {
|
||||
@@ -148,6 +148,18 @@ fn discovery(request: &crate::BackfillRequest, characters: &[char]) -> std::opti
|
||||
));
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn pre_008_fix_001_candidate_process_future_contract_is_send() {
|
||||
fn require_send<T: std::marker::Send>(_value: T) {
|
||||
return;
|
||||
}
|
||||
let future: super::CandidateProcessFuture<'static> = std::boxed::Box::pin(async {
|
||||
return std::result::Result::Err(super::execution_error("test.send"));
|
||||
});
|
||||
require_send(future);
|
||||
return;
|
||||
}
|
||||
|
||||
#[tokio::test]
|
||||
async fn pre_008_execution_is_bounded_and_reconciles_out_of_order_durable_completions() {
|
||||
let request = match explicit_request(&['1', '2', '3', '4'], 2) {
|
||||
|
||||
109
deltas/0.3.7/pre.008-fix.001.md
Normal file
109
deltas/0.3.7/pre.008-fix.001.md
Normal file
@@ -0,0 +1,109 @@
|
||||
<!-- file: deltas/0.3.7/pre.008-fix.001.md -->
|
||||
<!-- version: 1 -->
|
||||
|
||||
# Delta `0.3.7-pre.008-fix.001` — composabilité `Send` du runtime Job Backfill
|
||||
|
||||
## 1. Base requise
|
||||
|
||||
```text
|
||||
0.3.7-pre.008
|
||||
workspace.package.version = 0.3.7-pre.8
|
||||
```
|
||||
|
||||
## 2. Objectif
|
||||
|
||||
Corriger le blocage de compilation du Start réel Backfill Desk : `tauri::async_runtime::spawn` exige une future `Send + 'static`, mais deux alias privés de `ksp-job-backfill-lib` effaçaient `Send` dans les chaînes discovery et candidate-processing.
|
||||
|
||||
## 3. Cause
|
||||
|
||||
Les types privés suivants étaient déclarés sans `std::marker::Send` :
|
||||
|
||||
```text
|
||||
SignaturePageFuture
|
||||
CandidateProcessFuture
|
||||
```
|
||||
|
||||
Leurs implémentations concrètes utilisent des opérations async composables et le Store expose déjà `StoreApiFuture + Send`, mais l'effacement de type privé supprimait cette garantie avant que `BackfillJobRuntime::run` atteigne le spawn Tauri.
|
||||
|
||||
## 4. Correction
|
||||
|
||||
- ajouter `std::marker::Send` à `SignaturePageFuture` ;
|
||||
- ajouter `std::marker::Send` à `CandidateProcessFuture` ;
|
||||
- ajouter une canary compile-time `Send` pour chaque alias ;
|
||||
- ne modifier aucune API publique, politique de pagination/concurrency, logique Store/Transport, DTO, commande Tauri ou frontend.
|
||||
|
||||
Le correctif ne remplace pas le spawn Tauri par `spawn_local` et ne crée aucun thread ad hoc : le runtime Job reste composable sur un executor multithread standard.
|
||||
|
||||
## 5. Version
|
||||
|
||||
```text
|
||||
workspace.package.version = 0.3.7-pre.8.fix.1
|
||||
label = 0.3.7-pre.008-fix.001
|
||||
```
|
||||
|
||||
## 6. Fichiers ajoutés
|
||||
|
||||
```text
|
||||
deltas/0.3.7/pre.008-fix.001.md
|
||||
```
|
||||
|
||||
## 7. Fichiers modifiés
|
||||
|
||||
```text
|
||||
Cargo.toml
|
||||
crates/ksp-job-backfill-lib/src/discovery.rs
|
||||
crates/ksp-job-backfill-lib/src/execution.rs
|
||||
crates/ksp-job-backfill-lib/unit_tests/discovery.rs
|
||||
crates/ksp-job-backfill-lib/unit_tests/execution.rs
|
||||
docs/validation/024-V0_3_7_BACKFILL_DESK.md
|
||||
```
|
||||
|
||||
## 8. Fichiers supprimés
|
||||
|
||||
Aucun.
|
||||
|
||||
## 9. Gate opérateur ayant déclenché le fix
|
||||
|
||||
```text
|
||||
cargo fmt --all exécuté
|
||||
python3 scripts/audit_rust_workspace_rules.py PASS
|
||||
python3 scripts/audit_markdown_tables.py ... deltas/0.3.7 PASS
|
||||
cargo check --workspace FAIL — E0277, future Job Backfill non-Send au spawn Tauri
|
||||
cargo clippy --workspace --all-targets FAIL compile — même E0277
|
||||
cargo test -p ksp-job-backfill-lib PASS — 47 unitaires + suites d'intégration
|
||||
cargo test -p ksp-app-backfill-desk FAIL compile — même E0277
|
||||
```
|
||||
|
||||
## 10. 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/0.3.7
|
||||
```
|
||||
|
||||
Contrôles ciblés :
|
||||
|
||||
- les deux aliases privés imposent désormais `Future + Send` ;
|
||||
- deux canaries compile-time empêchent la régression ;
|
||||
- aucun fichier applicatif Backfill Desk de `pre.008` n'est modifié ;
|
||||
- aucune API publique de `ksp-job-backfill-lib` n'est modifiée.
|
||||
|
||||
## 11. Validations non exécutées dans l'environnement d'assemblage
|
||||
|
||||
`cargo` et `rustfmt` ne sont pas disponibles dans l'environnement d'assemblage. Gate opérateur :
|
||||
|
||||
```text
|
||||
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.7
|
||||
cargo check --workspace
|
||||
cargo clippy --workspace --all-targets
|
||||
cargo test -p ksp-job-backfill-lib
|
||||
cargo test -p ksp-app-backfill-desk
|
||||
cargo tree -p ksp-app-backfill-desk --edges normal
|
||||
cargo tree -p ksp-app-backfill-desk -e features
|
||||
```
|
||||
|
||||
## 12. Questions ouvertes
|
||||
|
||||
Aucune pour ce correctif.
|
||||
@@ -1,5 +1,5 @@
|
||||
<!-- file: docs/validation/024-V0_3_7_BACKFILL_DESK.md -->
|
||||
<!-- version: 11 -->
|
||||
<!-- version: 12 -->
|
||||
|
||||
# Validation v0.3.7 — Backfill Desk
|
||||
|
||||
@@ -364,3 +364,20 @@ La note UX ajoutée pendant cette tranche est reportée à `pre.012` : l'input a
|
||||
- [X] capabilities Tauri inchangées : `core:default + tracing:default` ;
|
||||
- [X] audits statiques Rust/Markdown propres dans l'environnement d'assemblage ;
|
||||
- [ ] `cargo fmt/check/clippy/test` de `pre.008` à rejouer par l'opérateur ; `cargo`/`rustfmt` restent absents du sandbox.
|
||||
|
||||
## 18. Correctif `pre.008-fix.001` — futures Job Backfill `Send`
|
||||
|
||||
Le gate opérateur de `pre.008` confirme que les audits Rust/Markdown sont propres, puis `cargo check --workspace` bloque l'intégration Tauri du Start : `tauri::async_runtime::spawn` exige une future `Send + 'static`, alors que deux alias privés de `ksp-job-backfill-lib` effaçaient la propriété `Send` des futures discovery et candidate-processing.
|
||||
|
||||
`StoreApiFuture` était déjà `Send`; le défaut se trouvait uniquement dans `SignaturePageFuture` et `CandidateProcessFuture`. Le correctif ajoute `std::marker::Send` à ces deux objets future privés et verrouille ce contrat par deux canaries compile-time dédiées.
|
||||
|
||||
### Gate du fix
|
||||
|
||||
- [X] `SignaturePageFuture` impose `Future + Send` ;
|
||||
- [X] `CandidateProcessFuture` impose `Future + Send` ;
|
||||
- [X] canary discovery compile-time `Send` ajoutée ;
|
||||
- [X] canary execution compile-time `Send` ajoutée ;
|
||||
- [X] aucune API publique Job, logique de requête, Start Desk, Store, Transport ou frontend n'est modifiée ;
|
||||
- [X] audits statiques Rust/Markdown rejoués dans l'environnement d'assemblage ;
|
||||
- [ ] replay opérateur `cargo fmt/check/clippy/test` de `pre.008-fix.001` à exécuter.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user