101 lines
3.1 KiB
Markdown
101 lines
3.1 KiB
Markdown
<!-- file: deltas/0.3.3/pre.009-fix.001.md -->
|
|
<!-- version: 1 -->
|
|
|
|
# Delta `0.3.3-pre.009-fix.001` — correction borrow du live cancellation
|
|
|
|
## 1. Base et constat
|
|
|
|
Base opérateur :
|
|
|
|
```text
|
|
0.3.3-pre.9
|
|
```
|
|
|
|
Le gate standard fourni le 2026-08-30 est propre sur les audits Rust/Markdown, `ksp-store-api`, `ksp-store-lib`, `ksp-config-lib` et `ksp-store-lib --no-default-features`, mais `ksp-store-postgres-lib` ne compile pas son nouveau test live :
|
|
|
|
```text
|
|
E0502: cannot borrow `*admin` as immutable because it is also borrowed as mutable
|
|
```
|
|
|
|
Le scénario cancellation stockait le résultat de `admin.transaction().await` dans `lock_transaction_result`. Ce `Result<Transaction<'_>>` pouvait conserver l'emprunt mutable de `admin` jusqu'à sa destruction en fin de fonction, alors que le probe final `transaction_exists(admin, ...)` demande ensuite un emprunt immuable.
|
|
|
|
## 2. Version
|
|
|
|
```text
|
|
workspace.package.version = 0.3.3-pre.9.fix.1
|
|
```
|
|
|
|
## 3. Correction
|
|
|
|
Le test live matche désormais directement :
|
|
|
|
```rust
|
|
let lock_transaction = match admin.transaction().await {
|
|
...
|
|
};
|
|
```
|
|
|
|
Le binding intermédiaire `lock_transaction_result` est supprimé. Après `lock_transaction.rollback().await`, la transaction est consommée et l'emprunt mutable de `admin` peut se terminer avant le probe final.
|
|
|
|
Aucune logique de preuve n'est modifiée : le test conserve le verrou observation réel, le blocage de l'acquisition concurrente, `JoinHandle::abort()`, le rollback du lock administrateur puis la vérification d'absence du canonical annulé.
|
|
|
|
## 4. Scope strict
|
|
|
|
Aucun changement dans :
|
|
|
|
```text
|
|
crates/ksp-store-postgres-lib/src/**
|
|
crates/ksp-store-lib/src/**
|
|
crates/ksp-store-api/src/**
|
|
crates/ksp-store-postgres-lib/migrations/**
|
|
```
|
|
|
|
Aucun SQL, capability, cursor, contrat de rétention, mapping d'erreur, Config ou comportement runtime n'est modifié.
|
|
|
|
## 5. Migrations
|
|
|
|
Checksums inchangés :
|
|
|
|
```text
|
|
V000 d29068b8c13b9dc0cc9ef6aaadd0fa12d41e0fe4c56541a1118c4bfc846a1450
|
|
V001 31488cda2f08f3f46c4cdbdbb6c18c243662fada02eac4487040c8735d72cc51
|
|
```
|
|
|
|
## 6. Fichiers modifiés
|
|
|
|
```text
|
|
Cargo.toml
|
|
crates/ksp-store-postgres-lib/tests/postgres_raw_transaction_live.rs
|
|
docs/validation/020-V0_3_3_STORE_POSTGRES_RAW_TRANSACTION.md
|
|
deltas/0.3.3/pre.009-fix.001.md
|
|
```
|
|
|
|
Aucune suppression de fichier.
|
|
|
|
## 7. Gate opérateur
|
|
|
|
```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.3
|
|
cargo check --workspace
|
|
cargo clippy --workspace --all-targets
|
|
cargo test -p ksp-store-api
|
|
cargo test -p ksp-store-lib
|
|
cargo test -p ksp-store-postgres-lib
|
|
cargo test -p ksp-config-lib
|
|
cargo check -p ksp-store-lib --no-default-features
|
|
```
|
|
|
|
Après gate standard vert, exécuter le live opt-in sur une base PostgreSQL dédiée et vide de toute table KSP gérée :
|
|
|
|
```bash
|
|
printf '%s\n' '<URI_POSTGRES_DEDIEE>' | cargo test -p ksp-store-postgres-lib --test postgres_raw_transaction_live -- --ignored --nocapture
|
|
```
|
|
|
|
## 8. Suite si les deux gates sont verts
|
|
|
|
```text
|
|
0.3.3-pre.010 — hardening/completeness
|
|
```
|