Files
khadhroony-solana-project/deltas/0.3.6/pre.006-fix.001.md

129 lines
4.6 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<!-- file: deltas/0.3.6/pre.006-fix.001.md -->
<!-- version: 1 -->
# Delta `0.3.6-pre.006-fix.001` — indirection privée de lacquisition RAW
## Base requise
```text
0.3.6-pre.006 appliquée
workspace.package.version = 0.3.6-pre.6
```
Le gate opérateur fourni pour `pre.006` confirme :
```text
cargo fmt --all PASS
python3 scripts/audit_rust_workspace_rules.py PASS / clean
python3 scripts/audit_markdown_tables.py ... PASS / clean (264 tables / 149 fichiers)
cargo check --workspace PASS
cargo clippy --workspace --all-targets PASS avec warning clippy::large_enum_variant
cargo test -p ksp-job-backfill-lib PASS
unitaires 19 PASS
dependency_boundary 2 PASS
public_api 3 PASS
release_completeness 2 PASS
cargo tree -p ksp-job-backfill-lib --edges normal exécuté
cargo tree -p ksp-job-backfill-lib -e features exécuté
```
## Objectif
Supprimer le warning `clippy::large_enum_variant` sans masquer le lint et sans changer la forme publique de `BackfillHydrationOutcome`.
## Cause exacte
`BackfillHydrationOutcome` expose deux variantes :
```rust
Available(BackfillRawAcquisition),
Missing(ksp_store_lib::RawTransactionReference),
```
Le gate mesure au moins environ 560 octets pour `Available` contre environ 88 octets pour `Missing`. La différence provient de lembarquement direct de la transaction RAW et de son observation dans `BackfillRawAcquisition`.
## Correctif
La structure publique `BackfillRawAcquisition` conserve ses méthodes et reste la charge utile directe de `Available`, mais ses deux champs privés sont regroupés dans un état privé détenu par une unique `Box`.
Ainsi :
- lAPI publique `Available(BackfillRawAcquisition)` ne change pas ;
- aucun `Box` napparaît dans la signature publique de lenum ;
- `transaction()`, `observation()` et `into_parts()` gardent leurs signatures ;
- une seule allocation est introduite par acquisition disponible ;
- `Missing(reference)` reste sans allocation et sans provenance fabriquée ;
- aucun `#[allow(clippy::large_enum_variant)]` nest ajouté.
Une canarie unitaire vérifie que `BackfillRawAcquisition` conserve la taille dun pointeur, ce qui verrouille lindirection privée destinée à empêcher la régression de taille.
## Version
Le fix modifie du Rust :
```text
workspace.package.version = 0.3.6-pre.6.fix.1
delivery = 0.3.6-pre.006-fix.001
commit = v0.3.6-pre.006-fix.001
```
Aucun tag prerelease.
## Fichiers ajoutés
```text
deltas/0.3.6/pre.006-fix.001.md
```
## Fichiers modifiés
```text
Cargo.toml
crates/ksp-job-backfill-lib/src/conversion.rs
crates/ksp-job-backfill-lib/unit_tests/conversion.rs
docs/plans/027-V0_3_6_JOB_API_BACKFILL_PLAN.md
docs/validation/023-V0_3_6_JOB_API_BACKFILL.md
```
## Versions den-tête
```text
Cargo.toml 402 -> 403
crates/ksp-job-backfill-lib/src/conversion.rs 1 -> 2
crates/ksp-job-backfill-lib/unit_tests/conversion.rs 1 -> 2
docs/plans/027-V0_3_6_JOB_API_BACKFILL_PLAN.md 10 -> 11
docs/validation/023-V0_3_6_JOB_API_BACKFILL.md 10 -> 11
```
Le présent delta commence à `version: 1`.
## Invariants préservés
- identité logique transactionnelle toujours `(RawNetworkId, signature)` ;
- provider/endpoint/protocole restent uniquement de la provenance dacquisition ;
- format RAW v1, canonicalisation JSON, SHA-256 et block time inchangés ;
- chemin observé `getTransaction` et paramètres Transport inchangés ;
- `Missing` reste structurellement sans provenance ;
- aucune persistance Store, checkpoint, concurrence ou snapshot ajoutés ;
- aucune nouvelle dépendance, feature, crate ou API publique ;
- README, USAGE, CHANGELOG, ROADMAP et prompt restent fermés.
## Gate opérateur demandé
```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.6
cargo check --workspace
cargo clippy --workspace --all-targets
cargo test -p ksp-job-backfill-lib
cargo tree -p ksp-job-backfill-lib --edges normal
cargo tree -p ksp-job-backfill-lib -e features
```
Résultat attendu : **20 tests unitaires + 7 canaries dintégration**, aucun warning `large_enum_variant`, et graphe de dépendances inchangé.
## Questions ouvertes
Aucune. `pre.007` reste interdit tant que le gate de ce fix nest pas warning-free.