Files
khadhroony-solana-project/deltas/0.3.15/pre.014-fix.001.md

146 lines
6.1 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.15/pre.014-fix.001.md -->
<!-- version: 1 -->
# Delta v0.3.15-pre.014-fix.001 — troncature `logMessages` compatible non terminale
## Base requise
```text
ksp-general-0.3.15-pre.014.zip
SHA-256 : 73435098f6b8a7cfc5e3af4c04d2c7ffd3a39f6edb322ef79b21b16757f70b87
bytes : 124399
```
Le gate opérateur de `pre.014` est vert côté audits/check/Clippy/tests. Le live reproduit un unique `content_conflict` Yellowstone pendant l'exécution parallèle avec HTTP Block Polling.
Le diagnostic `pre.014` ferme la cause : au slot `447781296`, les deux routes voient la même identité de bloc et la même transaction. Seul `meta.logMessages` diffère. Le canonique déjà stocké contient `176` lignes sans troncature ; l'entrant contient `118` lignes et le marqueur exact `Log truncated` au premier point divergent. Toutes les lignes précédentes sont identiques.
## Objectif
Ne plus transformer ce cas précis en erreur terminale Worker lorsque la version complète est déjà canonique.
La règle `0.3.15` reste volontairement étroite :
```text
canonique complet
+ incoming avec même identité / slot / block_time / format
+ même transaction / version / transactionIndex
+ mêmes champs meta hors logMessages
+ exactement un marqueur "Log truncated" côté incoming
+ préfixe identique avant le marqueur
=> canonique inchangé
=> RawEntityWriteOutcome::AlreadyPresent
=> observation entrante persistée
=> aucun content_conflict
=> Worker continue
```
Le matériel situé après le marqueur de troncature n'est pas utilisé pour prouver la complétude. Le marqueur constitue la frontière informationnelle ; la preuve porte sur le préfixe antérieur et sur l'égalité de tous les autres champs.
Restent des conflits en `0.3.15` : préfixe différent avant le marqueur, autre champ `meta` différent, transaction/version/index différents, marqueur absent/non exact/multiple, ou sens inverse `canonique tronqué -> incoming plus complet`. Ce dernier cas exige une promotion canonique atomique et est réservé à `0.3.16`.
## Handoff `0.3.16``0.3.18`
La décision opérateur est consignée durablement :
```text
0.3.16 RAW resilience / variantes / conflits / résolutions / retry-reconnect / Store Desk
0.3.17 ksp-job-backfill-lib multi-route / multi-stratégie
0.3.18 ksp-app-backfill-desk adapté au Job multi-route
```
Le contrat détaillé est ajouté dans `docs/plans/037-V0_3_16_RAW_RESILIENCE_CONFLICT_HANDOFF.md`.
`0.3.16` devra notamment introduire les variantes RAW durables, la classification `Exact / CompatibleLessComplete / CompatibleMoreComplete / Conflict`, la promotion canonique réversible, la quarantaine des vrais conflits sans arrêt du Worker, l'historique de résolution, le retry Store sans perte silencieuse, la reconnexion Transport configurable/bornée et les vues de gestion correspondantes dans Store Desk.
## Fichiers ajoutés
```text
docs/plans/037-V0_3_16_RAW_RESILIENCE_CONFLICT_HANDOFF.md
deltas/0.3.15/pre.014-fix.001.md
```
## Fichiers modifiés
```text
Cargo.toml
ROADMAP.md
crates/ksp-store-postgres-lib/src/raw_transaction.rs
crates/ksp-store-postgres-lib/tests/hardening_completeness.rs
crates/ksp-store-postgres-lib/unit_tests/raw_transaction.rs
docs/architecture/004-COMPONENT_INVENTORY.md
docs/architecture/009-ACQUISITION_WORKERS_AND_JOBS.md
docs/architecture/011-RAW_TRANSACTION_ACQUISITION.md
docs/plans/002-FUNCTIONAL_RELEASE_SEQUENCE.md
docs/plans/031-V0_3_10_RAW_TRANSACTION_INGEST_PLAN.md
docs/plans/036-V0_3_15_RAW_TRANSACTION_INGEST_DESK_PLAN.md
docs/validation/032-V0_3_15_RAW_TRANSACTION_INGEST_DESK.md
```
## Fichiers supprimés
Aucun.
## Version
```text
workspace.package.version : 0.3.15-pre.14.fix.1
root Cargo header counter : 629
```
## Canaris ajoutés
```text
v0_3_15_pre_014_fix_001_incoming_truncated_logs_are_compatible_only_when_missing_middle_is_proven
v0_3_15_pre_014_fix_001_truncated_log_compatibility_rejects_unproven_or_reverse_changes
v0_3_15_pre_014_fix_001_truncated_log_compatibility_is_narrow_and_keeps_canonical_content
```
Les tests vérifient notamment que le préfixe divergent, un autre champ `meta`, un marqueur non exact et le sens inverse restent non compatibles. Le contenu situé après le marqueur n'est volontairement pas traité comme preuve de complétude.
## Validations exécutées dans l'environnement de préparation
```text
python3 scripts/audit_rust_workspace_rules.py
General Rust rule audit: clean
Rust export completeness audit: 0 candidate(s)
KSP workspace Rust rule audit: clean
python3 scripts/audit_markdown_tables.py README.md RULES.md ROADMAP.md CHANGELOG.md docs prompts crates deltas/0.3.15
Markdown table audit: clean (318 table(s), 224 file(s))
```
Scan statique du diff production : aucun nouvel `unwrap()`, `expect(`, `panic!(`, `unreachable!(`, `unsafe {`, `unbounded_channel` ou `tokio::spawn`.
## Validations non exécutées ici
`cargo` et `rustfmt` ne sont pas disponibles dans l'environnement de préparation. Ne pas considérer les gates suivants comme passés avant exécution opérateur :
```text
cargo fmt --all
cargo fmt --all -- --check
cargo check --workspace
cargo clippy --workspace --all-targets --all-features -- -D warnings
cargo test -p ksp-store-postgres-lib --all-targets --all-features
cargo test -p ksp-worker-raw-transaction-ingest-lib --all-targets --all-features
cargo test -p ksp-app-raw-transaction-ingest-desk --all-targets --all-features
cargo test --workspace --all-targets --all-features
```
## Gate live requis
Lancer Yellowstone + HTTP Block Polling Mainnet en `confirmed` suffisamment longtemps pour recroiser une transaction avec logs tronqués côté provider.
Attendus :
```text
aucun terminal content_conflict pour FULL déjà canonique + TRUNCATED compatible
Yellowstone reste Running
route non Unhealthy/Faulted pour ce cas
canonique complet inchangé
observation de la route tronquée enregistrée
pas de grpc_backpressure_overflow
```
Le cas inverse `TRUNCATED canonique puis FULL entrant` peut encore produire `content_conflict` en `0.3.15`; il est explicitement reporté à la promotion/variant machinery de `0.3.16` et ne doit pas être maquillé par un overwrite destructif dans ce fix.