# Delta 0.0.4-alpha.2.fix.1 — documentation de la crate de test PostgreSQL ## Baseline requise Partir de `0.0.4-alpha.2` après application, commit et push de son history `FAIL`. La version devient : ```text 0.0.4-alpha.2.fix.1 ``` Le history requis est : ```text history/0.0.4/alpha.2.md = FAIL ``` ## Objet Corriger uniquement le défaut Clippy observé pendant la gate `alpha.2` : la target d'intégration `tests/postgres_migration.rs` ne possède pas de documentation de crate alors que `missing_docs` est activé et promu en erreur par `-D warnings`. Le fix ajoute une documentation interne `//!` en tête de cette crate de test. Aucun code produit, contrat public, dépendance, configuration de pool, migration SQL ou comportement PostgreSQL n'est modifié. La preuve PostgreSQL réelle de `alpha.2` a déjà passé après fourniture explicite de `KNOWLEDGE_POSTGRES_TEST_URL`, mais elle est rejouée pour fermer complètement le fix. ## Scope des fichiers REPLACE : ```text VERSION Cargo.toml crates/knowledge-store-postgres-lib/tests/postgres_migration.rs docs/plans/004-V0_0_4_POSTGRES_FOUNDATION_PLAN.md ``` ADD : ```text deltas/0.0.4/alpha.2.fix.1.md ``` DELETE : aucun. Les fichiers suivants restent inchangés : ```text crates/knowledge-store-postgres-lib/src/ crates/knowledge-store-postgres-lib/unit_tests/ crates/knowledge-store-postgres-lib/migrations/ crates/knowledge-store-postgres-lib/Cargo.toml README.md RULES.md ROADMAP.md CHANGELOG.md docs/architecture/ docs/studies/ docs/validation/ Web/ prompts/ ``` Aucun history `alpha.2.fix.1` n'est inclus dans ce delta. ## Précondition PostgreSQL La gate requiert toujours une base PostgreSQL de test permettant de créer et supprimer un schéma. Avant la preuve PostgreSQL, définir explicitement dans le shell opérateur : ```bash export KNOWLEDGE_POSTGRES_TEST_URL='postgresql://knowledge:knowledge@localhost/knowledge' ``` Adapter l'URL si nécessaire. Ne jamais versionner cette valeur. Si PostgreSQL n'est pas disponible, classer la gate `BLOCKED` à cette étape ; ne pas convertir cette absence en `PASS`. ## Gate opérateur Exécuter depuis la racine du dépôt après application du delta. ### Version, history précédent et correction bornée ```bash test "$(cat VERSION)" = '0.0.4-alpha.2.fix.1' grep -F 'version = "0.0.4-alpha.2.fix.1"' Cargo.toml test -f history/0.0.4/alpha.2.md grep -A2 '^## Statut$' history/0.0.4/alpha.2.md | grep -Fx 'FAIL' git ls-files --error-unmatch history/0.0.4/alpha.2.md >/dev/null test -z "$(git status --short -- history/0.0.4/alpha.2.md)" grep -Fx '//! Integration test for the initial PostgreSQL migration in an isolated schema.' crates/knowledge-store-postgres-lib/tests/postgres_migration.rs grep -F '### alpha.2.fix.1 — documentation de la crate de test PostgreSQL' docs/plans/004-V0_0_4_POSTGRES_FOUNDATION_PLAN.md grep -F '`alpha.2` historisée `FAIL`' docs/plans/004-V0_0_4_POSTGRES_FOUNDATION_PLAN.md grep -F 'autoriser `alpha.3` uniquement après `PASS` complet du fix' docs/plans/004-V0_0_4_POSTGRES_FOUNDATION_PLAN.md test ! -e history/0.0.4/alpha.2.fix.1.md git diff --check ``` ### Scope négatif ```bash test -z "$(git diff --name-only -- crates/knowledge-store-postgres-lib/src crates/knowledge-store-postgres-lib/unit_tests crates/knowledge-store-postgres-lib/migrations crates/knowledge-store-postgres-lib/Cargo.toml README.md RULES.md ROADMAP.md CHANGELOG.md docs/architecture docs/studies docs/validation Web prompts)" ``` ### Markdown puis séquence Rust ```bash python3 -B scripts/audit_markdown_headers.py README.md RULES.md ROADMAP.md CHANGELOG.md docs prompts deltas history python3 -B scripts/audit_markdown_links.py README.md RULES.md ROADMAP.md CHANGELOG.md docs prompts deltas history python3 -B scripts/audit_markdown_tables.py README.md RULES.md ROADMAP.md CHANGELOG.md docs prompts deltas history cargo fmt --all cargo fmt --all -- --check python3 -B scripts/audit_rust_test_layout.py crates python3 -B scripts/audit_rust_blank_lines.py crates python3 -B scripts/audit_rust_item_spacing.py crates python3 -B scripts/audit_rust_module_order.py crates python3 -B scripts/audit_rust_trait_import_blocks.py crates python3 -B scripts/audit_rust_reexport_blocks.py crates python3 -B scripts/audit_rust_crate_root_facades.py crates python3 -B scripts/audit_rust_export_completeness.py --root . --summary-only cargo metadata --format-version 1 --no-deps > /tmp/sasedev-knowledge-0.0.4-alpha.2.fix.1-metadata.json cargo check --workspace cargo clippy --workspace --all-targets --all-features -- -D warnings cargo test -p knowledge-store-postgres-lib cargo test --workspace --all-targets --all-features ``` ### Composition workspace ```bash python3 -c 'import json; from pathlib import Path; m=json.loads(Path("/tmp/sasedev-knowledge-0.0.4-alpha.2.fix.1-metadata.json").read_text()); expected={"knowledge-app-lib","knowledge-domain-lib","knowledge-git-api","knowledge-git-lib","knowledge-sync-api","knowledge-web-lib","knowledge-pgr-server","knowledge-howtos-server","knowledge-snippets-server","knowledge-store-postgres-lib"}; assert len(m["workspace_members"]) == 10; assert {p["name"] for p in m["packages"]} == expected; print("Knowledge 0.0.4-alpha.2.fix.1 workspace audit: clean")' ``` ### PostgreSQL réel obligatoire ```bash test -n "${KNOWLEDGE_POSTGRES_TEST_URL:-}" cargo test -p knowledge-store-postgres-lib --test postgres_migration -- --ignored --nocapture ``` ### Hygiène, lockfiles et staging ```bash python3 -c 'from pathlib import Path; roots=[Path("README.md"),Path("RULES.md"),Path("ROADMAP.md"),Path("CHANGELOG.md"),Path("Cargo.toml"),Path("VERSION"),Path("docs"),Path("prompts"),Path("deltas"),Path("history"),Path("crates")]; allowed={".md",".rs",".toml",".sql"}; paths=[p for r in roots for p in ([r] if r.is_file() else r.rglob("*")) if p.is_file() and (p.name == "VERSION" or p.suffix in allowed)]; bad=[str(p) for p in paths if (lambda b: b"\r" in b or not b.endswith(b"\n") or b.endswith(b"\n\n") or any(line != line.rstrip(" \t") for line in b.decode("utf-8").splitlines()))(p.read_bytes())]; assert not bad, bad; print(f"Knowledge 0.0.4-alpha.2.fix.1 text hygiene: clean ({len(paths)} file(s))")' test -f Cargo.lock git check-ignore -q Cargo.lock if git ls-files --error-unmatch Cargo.lock >/dev/null 2>&1; then echo 'Cargo.lock must remain untracked for Knowledge' >&2; exit 1; fi test -f Web/knowledge-template-lab/package-lock.json git diff --quiet -- Web/knowledge-template-lab/package-lock.json git add -A git diff --cached --check git status --short ``` ## Transition ### PASS Produire `history/0.0.4/alpha.2.fix.1.md`, l'appliquer, commit/push `0.0.4-alpha.2.fix.1`, puis préparer `0.0.4-alpha.3` pour la persistance minimale de source et d'état de synchronisation. ### FAIL / PARTIAL / BLOCKED Conserver le résultat réel dans son history avant toute nouvelle correction. Un défaut borné supplémentaire utilise `alpha.2.fix.2`. Si le diagnostic invalide l'ownership PostgreSQL, les dépendances retenues, le schéma ou la stratégie d'isolation, effectuer un REPLAN avant de poursuivre.