0.0.4-alpha.2.fix.1

This commit is contained in:
2026-10-01 11:34:09 +02:00
parent 095ac37d08
commit a15fff86b8
6 changed files with 348 additions and 4 deletions

View File

@@ -17,7 +17,7 @@ members = [
]
[workspace.package]
version = "0.0.4-alpha.2"
version = "0.0.4-alpha.2.fix.1"
edition = "2024"
publish = false
repository = "https://git.sasedev.com/Sasedev/sasedev-knowledge"

View File

@@ -1 +1 @@
0.0.4-alpha.2
0.0.4-alpha.2.fix.1

View File

@@ -1,5 +1,7 @@
// file: crates/knowledge-store-postgres-lib/tests/postgres_migration.rs
// version: 1
// version: 2
//! Integration test for the initial PostgreSQL migration in an isolated schema.
fn test_schema_name() -> String {
let elapsed = match std::time::SystemTime::now().duration_since(std::time::UNIX_EPOCH) {

View File

@@ -0,0 +1,179 @@
<!-- file: deltas/0.0.4/alpha.2.fix.1.md -->
<!-- version: 1 -->
# 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.

View File

@@ -1,5 +1,5 @@
<!-- file: docs/plans/004-V0_0_4_POSTGRES_FOUNDATION_PLAN.md -->
<!-- version: 2 -->
<!-- version: 3 -->
# Plan 0.0.4 — fondation PostgreSQL partagée
@@ -133,6 +133,14 @@ Les gates Web/npm ne sont pas rejouées pour les alphas sans diff `Web/` ou cont
- prouver la migration sur PostgreSQL réel avec schéma de test isolé ;
- ne raccorder encore aucun launcher si aucun use case runtime ne l'exige.
### alpha.2.fix.1 — documentation de la crate de test PostgreSQL
- conserver `alpha.2` historisée `FAIL` à cause de Clippy strict ;
- ajouter uniquement la documentation de crate manquante dans `tests/postgres_migration.rs` ;
- ne modifier ni le code produit, ni le schéma, ni les dépendances, ni la façade publique ;
- rejouer Clippy strict, les tests Rust et la preuve PostgreSQL réelle ;
- autoriser `alpha.3` uniquement après `PASS` complet du fix.
### alpha.3 — persistance de source et état de synchronisation
- matérialiser les opérations minimales de création/mise à jour/lecture de configuration logique ;

View File

@@ -0,0 +1,155 @@
<!-- file: history/0.0.4/alpha.2.fix.1.md -->
<!-- version: 1 -->
# History 0.0.4-alpha.2.fix.1 — documentation de la crate de test PostgreSQL
## Statut
PASS
La gate opérateur de `0.0.4-alpha.2.fix.1` exécutée le `2026-10-01` est complète et propre. Le fix corrige uniquement le lint `missing_docs` observé sur la target d'intégration PostgreSQL de `alpha.2`, sans modifier le code produit, le schéma SQL, les dépendances ni la façade publique.
## Baseline opérateur
`alpha.2` historisée `FAIL` a été committée puis poussée avant application du fix :
```text
history/0.0.4/alpha.2.md FAIL
commit 095ac37
message 0.0.4-alpha.2
branch master
push origin/master PASS
```
La première tentative de `git push origin master` a été interrompue pendant la saisie d'identifiants. La seconde a réussi et a avancé `origin/master` de `b55eb23` à `095ac37`.
## Correction bornée
Les contrôles initiaux confirment :
```text
VERSION 0.0.4-alpha.2.fix.1
Cargo workspace version 0.0.4-alpha.2.fix.1
history/0.0.4/alpha.2.md présent, suivi, FAIL
history/0.0.4/alpha.2.fix.1.md avant gate absent
documentation de crate //! présente
git diff --check PASS
scope négatif PASS
```
Le plan actif conserve explicitement `alpha.2 = FAIL` et n'autorise `alpha.3` qu'après `PASS` complet du présent fix.
Aucun diff n'est observé sous :
```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/
```
## Markdown, formatage et audits Rust
```text
Markdown header audit clean (132 file(s))
Markdown link audit clean (86 local link(s), 132 file(s))
Markdown table audit clean (5 table(s), 132 file(s))
cargo fmt --all PASS
cargo fmt --all -- --check PASS
Rust test-layout audit clean (10 crate(s))
Rust blank-line audit clean (42 file(s))
Rust item-spacing audit clean (42 file(s))
Rust module-order audit clean (42 file(s))
Rust trait-import-block audit clean (42 file(s))
Rust re-export-block audit clean (42 file(s))
Rust crate-root facade audit clean (7 crate root(s))
Rust export completeness audit 0 candidate(s) across 10 package(s)
```
## Cargo, Clippy et tests
```text
cargo metadata --format-version 1 --no-deps PASS
cargo check --workspace PASS
cargo clippy --workspace --all-targets
--all-features -- -D warnings PASS
workspace_members 10
```
Le défaut `missing_docs` de `alpha.2` est donc fermé par Clippy strict.
Tests ciblés de la crate PostgreSQL :
```text
config unit tests 3 PASS
postgres_migration 1 ignored, gate explicite requise
doc-tests 0
```
Tests workspace :
```text
knowledge-app-lib 3 PASS
knowledge-domain-lib 3 PASS
knowledge-git-api 7 PASS
knowledge-git-lib 8 unit + 6 integration PASS
knowledge-sync-api 1 PASS
knowledge-web-lib 4 PASS
knowledge-store-postgres-lib 3 PASS + 1 intégration ignorée
launchers 0 test chacun
```
Aucun warning `missing_docs` n'est observé pendant ces commandes.
## Preuve PostgreSQL réelle
La précondition opérateur `KNOWLEDGE_POSTGRES_TEST_URL` est présente pendant la gate du fix.
La commande obligatoire :
```text
cargo test -p knowledge-store-postgres-lib --test postgres_migration -- --ignored --nocapture
```
produit :
```text
initial_migration_runs_in_isolated_schema PASS
1 passed; 0 failed
```
La migration initiale, le schéma temporaire isolé et son nettoyage restent donc prouvés sur PostgreSQL réel après la correction documentaire.
## Hygiène et lockfiles
```text
Knowledge 0.0.4-alpha.2.fix.1 text hygiene clean (187 file(s))
Cargo.lock présent localement, ignoré, non suivi
Web package-lock.json présent et inchangé
git diff --cached --check PASS
```
Le staging final observé avant ajout du présent history est exactement :
```text
M Cargo.toml
M VERSION
M crates/knowledge-store-postgres-lib/tests/postgres_migration.rs
A deltas/0.0.4/alpha.2.fix.1.md
M docs/plans/004-V0_0_4_POSTGRES_FOUNDATION_PLAN.md
```
## Décision
`0.0.4-alpha.2.fix.1` est `PASS`.
Le défaut de validation de `alpha.2` est fermé sans changement fonctionnel. `0.0.4-alpha.3` peut maintenant matérialiser la persistance minimale de configuration de source et d'état de synchronisation sur le schéma PostgreSQL déjà validé.