From 05cdb4e2abca0e46f340bc89ef02c6bbd3b713d6 Mon Sep 17 00:00:00 2001 From: SinuS Von SifriduS Date: Mon, 21 Sep 2026 08:40:18 +0200 Subject: [PATCH] v0.3.16-pre.002-fix.001 --- Cargo.toml | 4 +- crates/ksp-store-api/src/model/raw_outcome.rs | 6 +- .../src/model/raw_transaction.rs | 18 ++- .../tests/release_completeness.rs | 8 +- deltas/0.3.16/pre.002-fix.001.md | 134 ++++++++++++++++++ 5 files changed, 165 insertions(+), 5 deletions(-) create mode 100644 deltas/0.3.16/pre.002-fix.001.md diff --git a/Cargo.toml b/Cargo.toml index a4d52d9..e2c3cdc 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,12 +1,12 @@ # file: Cargo.toml -# version: 639 +# version: 640 [workspace] resolver = "3" members = ["crates/ksp-app-backfill-desk", "crates/ksp-app-config-desk", "crates/ksp-app-raw-transaction-ingest-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.16-pre.2" +version = "0.3.16-pre.2.fix.1" edition = "2024" license = "MIT" repository = "https://git.sasedev.com/Sasedev/khadhroony-solana-project" diff --git a/crates/ksp-store-api/src/model/raw_outcome.rs b/crates/ksp-store-api/src/model/raw_outcome.rs index b40ddb4..a838baf 100644 --- a/crates/ksp-store-api/src/model/raw_outcome.rs +++ b/crates/ksp-store-api/src/model/raw_outcome.rs @@ -1,5 +1,5 @@ // file: crates/ksp-store-api/src/model/raw_outcome.rs -// version: 2 +// version: 3 /// Outcome for one canonical RAW entity in an idempotent persistence operation. #[non_exhaustive] #[derive(Clone, Copy, Debug, Eq, Hash, PartialEq)] @@ -13,6 +13,7 @@ pub enum RawEntityWriteOutcome { /// Normal persistence skipped a durable purged tombstone. SkippedPurged, } + /// Outcome for one deterministic acquisition observation write. #[non_exhaustive] #[derive(Clone, Copy, Debug, Eq, Hash, PartialEq)] @@ -24,12 +25,14 @@ pub enum RawObservationWriteOutcome { /// No observation was recorded because the associated RAW entity was intentionally skipped. NotRecorded, } + /// Combined outcome of one atomic canonical RAW entity plus observation acquisition. #[derive(Clone, Copy, Debug, Eq, Hash, PartialEq)] pub struct RawAcquisitionWriteOutcome { entity: crate::RawEntityWriteOutcome, observation: crate::RawObservationWriteOutcome, } + impl RawAcquisitionWriteOutcome { /// Creates one backend-independent atomic acquisition outcome. #[must_use] @@ -42,6 +45,7 @@ impl RawAcquisitionWriteOutcome { pub const fn entity(&self) -> crate::RawEntityWriteOutcome { return self.entity; } + /// Returns the acquisition observation write outcome. #[must_use] pub const fn observation(&self) -> crate::RawObservationWriteOutcome { diff --git a/crates/ksp-store-api/src/model/raw_transaction.rs b/crates/ksp-store-api/src/model/raw_transaction.rs index 56c2122..ddb28f7 100644 --- a/crates/ksp-store-api/src/model/raw_transaction.rs +++ b/crates/ksp-store-api/src/model/raw_transaction.rs @@ -1,5 +1,5 @@ // file: crates/ksp-store-api/src/model/raw_transaction.rs -// version: 2 +// version: 3 /// Durable backend-independent identity of one canonical RAW transaction. #[derive(Clone, Debug, Eq, Hash, PartialEq)] @@ -7,6 +7,7 @@ pub struct RawTransactionReference { network: crate::RawNetworkId, signature: crate::RawTransactionSignature, } + impl RawTransactionReference { /// Creates one durable transaction identity from network and canonical Solana signature. #[must_use] @@ -19,6 +20,7 @@ impl RawTransactionReference { pub fn network(&self) -> &crate::RawNetworkId { return &self.network; } + /// Returns the canonical transaction signature. #[must_use] pub const fn signature(&self) -> crate::RawTransactionSignature { @@ -32,6 +34,7 @@ impl RawTransactionReference { /// `content_hash`, provider identity, canonicality or any physical database key layout. #[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)] pub struct RawTransactionVariantId(u64); + impl RawTransactionVariantId { /// Creates one non-zero stable variant identifier. pub fn try_new(value: u64) -> crate::Result { @@ -54,6 +57,7 @@ pub struct RawTransactionVariantReference { transaction: crate::RawTransactionReference, variant_id: crate::RawTransactionVariantId, } + impl RawTransactionVariantReference { /// Creates one durable variant reference from logical transaction identity and surrogate id. #[must_use] @@ -83,6 +87,7 @@ pub enum RawTransactionVariantOrigin { /// Explicitly synthesized canonical RAW representation derived from preserved parent variants. Synthetic, } + impl RawTransactionVariantOrigin { /// Returns the stable persistence code for this origin. #[must_use] @@ -109,6 +114,7 @@ pub enum RawTransactionVariantRelation { /// No contradiction must be asserted, but no safe dominance relation is proved. Incomparable, } + impl RawTransactionVariantRelation { /// Returns the stable persistence/diagnostic code for this relation. #[must_use] @@ -149,6 +155,7 @@ pub enum RawTransactionVariantRelationReason { /// Canonical representations differ but the current comparator cannot prove equality, dominance or contradiction safely. UnsupportedCanonicalDifference, } + impl RawTransactionVariantRelationReason { /// Returns the stable persistence/diagnostic code for this reason. #[must_use] @@ -173,6 +180,7 @@ pub struct RawTransactionVariantComparison { reason: crate::RawTransactionVariantRelationReason, relation: crate::RawTransactionVariantRelation, } + impl RawTransactionVariantComparison { /// Creates one relation/reason pair and rejects semantically inconsistent combinations. pub fn try_new(relation: crate::RawTransactionVariantRelation, reason: crate::RawTransactionVariantRelationReason) -> crate::Result { @@ -204,6 +212,7 @@ pub enum RawTransactionConflictStatus { /// The conflict currently has an explicit durable resolution while history remains preserved. Resolved, } + impl RawTransactionConflictStatus { /// Returns the stable persistence code for this status. #[must_use] @@ -228,12 +237,14 @@ pub struct RawTransaction { reference: crate::RawTransactionReference, slot: u64, } + impl RawTransaction { /// Creates one complete canonical RAW transaction. #[must_use] pub fn new(reference: crate::RawTransactionReference, slot: u64, block_time: std::option::Option, payload: crate::RawPayload) -> Self { return Self { block_time, payload, reference, slot }; } + /// Returns the optional canonical block timestamp. #[must_use] pub const fn block_time(&self) -> std::option::Option { @@ -245,6 +256,7 @@ impl RawTransaction { pub fn payload(&self) -> &crate::RawPayload { return &self.payload; } + /// Returns the durable backend-independent transaction identity. #[must_use] pub fn reference(&self) -> &crate::RawTransactionReference { @@ -257,6 +269,7 @@ impl RawTransaction { return self.slot; } } + /// Persistable acquisition observation linked to one canonical RAW transaction. #[derive(Clone, Debug, Eq, PartialEq)] pub struct RawTransactionObservation { @@ -264,12 +277,14 @@ pub struct RawTransactionObservation { provenance: crate::RawAcquisitionProvenance, transaction: crate::RawTransactionReference, } + impl RawTransactionObservation { /// Creates one successful observation of a complete canonical RAW transaction. #[must_use] pub fn new(observation_key: crate::RawObservationKey, transaction: crate::RawTransactionReference, provenance: crate::RawAcquisitionProvenance) -> Self { return Self { observation_key, provenance, transaction }; } + /// Returns the deterministic producer-owned observation idempotence key. #[must_use] pub const fn observation_key(&self) -> crate::RawObservationKey { @@ -281,6 +296,7 @@ impl RawTransactionObservation { pub fn provenance(&self) -> &crate::RawAcquisitionProvenance { return &self.provenance; } + /// Returns the durable transaction identity observed by this acquisition. #[must_use] pub fn transaction(&self) -> &crate::RawTransactionReference { diff --git a/crates/ksp-store-api/tests/release_completeness.rs b/crates/ksp-store-api/tests/release_completeness.rs index 9dbefe8..ef7634f 100644 --- a/crates/ksp-store-api/tests/release_completeness.rs +++ b/crates/ksp-store-api/tests/release_completeness.rs @@ -1,5 +1,5 @@ // file: crates/ksp-store-api/tests/release_completeness.rs -// version: 4 +// version: 5 //! Release-level boundary and completeness canaries for the backend-neutral Store API RAW surface. #[test] @@ -102,6 +102,7 @@ fn v0_3_8_pre_003_exact_crate_root_export_inventory_is_stable() { assert!(!crate_root.contains("pub mod ")); return; } + #[test] fn v0_3_8_pre_003_exact_production_module_inventory_is_raw_only() { let root = std::path::Path::new(env!("CARGO_MANIFEST_DIR")).join("src"); @@ -131,6 +132,7 @@ fn v0_3_8_pre_003_exact_production_module_inventory_is_raw_only() { assert_eq!(capability_names, std::vec!["raw_account.rs", "raw_retention.rs", "raw_transaction.rs"]); return; } + #[test] fn pre_007_public_evolutive_enums_remain_non_exhaustive() { let sources = [ @@ -158,6 +160,7 @@ fn pre_007_public_evolutive_enums_remain_non_exhaustive() { } return; } + #[test] fn pre_007_interface_store_ownership_and_negative_scope_remain_explicit() { let interface_root = include_str!("../../ksp-interface-lib/src/lib.rs"); @@ -199,6 +202,7 @@ fn pre_007_interface_store_ownership_and_negative_scope_remain_explicit() { } return; } + #[test] fn v0_3_8_pre_003_capability_inventory_stays_fine_grained_without_runtime_facade() { let sources = [ @@ -236,6 +240,7 @@ fn v0_3_8_pre_003_capability_inventory_stays_fine_grained_without_runtime_facade assert_eq!(traits, expected); return; } + fn assert_non_exhaustive(sources: &[&str], enum_name: &str) { let needle = "#[non_exhaustive]\n"; let declaration = std::format!("pub enum {enum_name}"); @@ -251,6 +256,7 @@ fn assert_non_exhaustive(sources: &[&str], enum_name: &str) { assert!(found, "public evolutive enum not found: {enum_name}"); return; } + fn rust_file_names(directory: &std::path::Path) -> std::io::Result> { let entries = match std::fs::read_dir(directory) { std::result::Result::Ok(value) => value, diff --git a/deltas/0.3.16/pre.002-fix.001.md b/deltas/0.3.16/pre.002-fix.001.md new file mode 100644 index 0000000..8a41a30 --- /dev/null +++ b/deltas/0.3.16/pre.002-fix.001.md @@ -0,0 +1,134 @@ + + + +# Delta `0.3.16-pre.002-fix.001` — conformité `RUST-FMT-111` + +## Base requise + +```text +0.3.16-pre.002 appliquée +workspace.package.version = 0.3.16-pre.2 +``` + +## Motif du fix + +Le gate manuel de `0.3.16-pre.002` confirme que le workspace compile, que Clippy passe et que les tests ciblés `ksp-store-api` passent, mais l'audit des règles Rust signale exactement 26 violations `RUST-FMT-111` : absence de l'unique ligne vide exigée entre certains items Rust. + +Aucune erreur fonctionnelle, de compilation, de Clippy, d'export ou de test n'a été observée dans ce gate. + +## Version workspace + +`Cargo.toml` : + +```text +header version : 639 -> 640 +workspace : 0.3.16-pre.2 -> 0.3.16-pre.2.fix.1 +``` + +Ce fix modifie des fichiers Rust ; il incrémente donc la version workspace conformément aux règles du projet. + +## Fichiers modifiés + +```text +Cargo.toml +crates/ksp-store-api/src/model/raw_outcome.rs +crates/ksp-store-api/src/model/raw_transaction.rs +crates/ksp-store-api/tests/release_completeness.rs +``` + +## Fichier ajouté + +```text +deltas/0.3.16/pre.002-fix.001.md +``` + +## Correction + +Le fix ajoute uniquement les 26 lignes vides requises par `RUST-FMT-111` aux emplacements signalés par l'audit : + +```text +raw_outcome.rs : 4 +raw_transaction.rs : 16 +release_completeness.rs : 6 + -- +total : 26 +``` + +Les séparations concernent des frontières entre items de module, `impl`, méthodes, tests et fonctions auxiliaires. + +Aucun type, enum, variant, champ, reason code, outcome, méthode, corps de fonction, assertion, export ou comportement introduit par `pre.002` n'est modifié. + +## Gate `pre.002` reçu avant correction + +```text +General Rust rule audit: 26 violation(s) +RUST-FMT-111: 26 +Rust export completeness audit: 0 candidate(s) +KSP workspace Rust rule audit: clean +Markdown table audit: clean (352 table(s), 943 file(s)) +cargo check --workspace: PASS +cargo clippy --workspace --all-targets --all-features -- -D warnings: PASS +cargo test -p ksp-store-api --all-targets --all-features: PASS +``` + +Tests `ksp-store-api` observés : + +```text +unit tests : 25 passed + dependency_boundary : 2 passed + external_backend : 1 passed + public_api : 8 passed + release_completeness : 5 passed + security_hardening : 5 passed +``` + +## Validation de l'assemblage + +L'environnement d'assemblage ne fournit ni `cargo`, ni `rustc`, ni `rustfmt`; aucun gate Rust n'est déclaré PASS localement. + +Ont été vérifiés localement : + +```text +diff fonctionnel nul hors whitespace et headers de version +26 séparations manquantes ajoutées exactement +workspace.package.version = 0.3.16-pre.2.fix.1 +headers file/version des trois fichiers Rust incrémentés +newline finale +inventaire exact du delta +absence de lockfile/cache/secret +archive ZIP valide +``` + +## Gate requis après application + +Comme le fix modifie du Rust et `Cargo.toml`, exécuter : + +```bash +cargo fmt --all +cargo fmt --all -- --check + +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-store-api --all-targets --all-features +``` + +Le résultat attendu est notamment : + +```text +General Rust rule audit: clean +Rust export completeness audit: 0 candidate(s) +KSP workspace Rust rule audit: clean +``` + +## Suite + +Après gate propre, poursuivre avec : + +```text +0.3.16-pre.003 +``` + +Le scope fonctionnel et architectural de `pre.002` reste inchangé.