0.1.2-alpha.2.fix.1

This commit is contained in:
2026-09-27 23:12:36 +02:00
parent 17b7ef23a1
commit 8de2daa716
10 changed files with 472 additions and 746 deletions

View File

@@ -1,184 +0,0 @@
<!-- file: deltas/0.0.1/alpha.3.fix.2.md -->
<!-- version: 1 -->
# Delta 0.0.1-alpha.3.fix.2 — documentation publique `ContentFamily`
## Base requise
État `0.0.1-alpha.3.fix.1` committé et poussé après application du history :
```text
history/0.0.1/alpha.3.fix.1.md = FAIL
```
La version devient :
```text
0.0.1-alpha.3.fix.2
```
## Cause du second fix
Le premier fix a corrigé l'erreur `E0423` :
- `cargo check --workspace` termine ;
- les trois suites ciblées passent ;
- `SourceId::new("pgr")` est couvert par régression.
La gate reste néanmoins `FAIL` parce que Clippy est exécuté avec :
```text
-D warnings
```
et transforme en erreurs quatre warnings `missing_docs` sur les variantes publiques :
```text
ContentFamily::Pgr
ContentFamily::Howto
ContentFamily::Snippet
ContentFamily::ProjectLocal
```
La politique `missing_docs` est intentionnelle. Le correctif ne doit donc ni la réduire ni introduire `#[allow(missing_docs)]`.
## Correctif
Le fichier :
```text
crates/knowledge-domain-lib/src/content_family.rs
```
documente explicitement chacune des quatre variantes publiques.
Aucun variant, contrat, type, trait, dépendance ou comportement n'est modifié.
## Scope
Le fix reste strictement correctif.
Il ne modifie pas :
- `GitRepository` ;
- `RepositoryEventSource` ;
- `RepositorySyncSignal` ;
- le modèle de sources ;
- la trajectoire Web/Maud/Vite ;
- les décisions PostgreSQL/forge ;
- les frontières des trois applications Web.
Aucun frontend, serveur Actix, adapter Gitea, schéma PostgreSQL ou nouvelle crate n'est ajouté.
## Fichiers remplacés
```text
VERSION
Cargo.toml
crates/knowledge-domain-lib/src/content_family.rs
docs/plans/001-V0_0_1_FOUNDATION_PLAN.md
docs/validation/001-VALIDATION_MATRIX.md
```
## Fichier ajouté
```text
deltas/0.0.1/alpha.3.fix.2.md
```
Aucun fichier n'est supprimé.
## `Cargo.lock`
Le delta ne livre pas de lockfile préfabriqué. Les packages héritent de la version workspace `0.0.1-alpha.3.fix.2`; Cargo peut donc mettre à jour `Cargo.lock` dans l'environnement opérateur. Toute modification réelle du lockfile reste versionnée.
## Validation attendue
Après application du history `alpha.3.fix.1 FAIL`, commit/push de `alpha.3.fix.1`, puis extraction du présent delta :
```bash
test "$(cat VERSION)" = "0.0.1-alpha.3.fix.2"
git diff --check
python3 - <<'PY'
from pathlib import Path
import tomllib
with Path("Cargo.toml").open("rb") as handle:
root_manifest = tomllib.load(handle)
assert root_manifest["workspace"]["package"]["version"] == "0.0.1-alpha.3.fix.2"
content = Path(
"crates/knowledge-domain-lib/src/content_family.rs"
).read_text(encoding="utf-8")
for variant in ("Pgr", "Howto", "Snippet", "ProjectLocal"):
marker = f" {variant},"
index = content.index(marker)
prefix = content[:index].rstrip().splitlines()
assert prefix[-1].lstrip().startswith("///"), variant
assert "allow(missing_docs)" not in content
assert "missing_docs = \"warn\"" in Path("Cargo.toml").read_text(encoding="utf-8")
print("Knowledge 0.0.1-alpha.3.fix.2 structural audit: clean")
PY
cargo metadata --format-version 1 --no-deps > /tmp/sasedev-knowledge-alpha3-fix2-metadata.json
cargo fmt --all
cargo fmt --all -- --check
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_export_completeness.py --root .
cargo check --workspace
cargo clippy --workspace --all-targets --all-features -- -D warnings
cargo test -p knowledge-domain-lib --all-targets --all-features
cargo test -p knowledge-git-api --all-targets --all-features
cargo test -p knowledge-sync-api --all-targets --all-features
test -f Cargo.lock
if git check-ignore -q Cargo.lock; then
echo 'Cargo.lock must remain versioned' >&2
exit 1
fi
python3 - <<'PY'
import json
from pathlib import Path
metadata = json.loads(
Path("/tmp/sasedev-knowledge-alpha3-fix2-metadata.json").read_text(encoding="utf-8")
)
packages = {package["name"] for package in metadata["packages"]}
assert packages == {
"knowledge-domain-lib",
"knowledge-git-api",
"knowledge-sync-api",
}, packages
for package in metadata["packages"]:
assert package["version"] == "0.0.1-alpha.3.fix.2", (
package["name"],
package["version"],
)
print("Knowledge 0.0.1-alpha.3.fix.2 Cargo metadata audit: clean")
PY
git add -A
git diff --cached --check
git status --short
```
Ne pas committe `alpha.3.fix.2` avant production de son history à partir des résultats opérateur.

View File

@@ -0,0 +1,213 @@
<!-- file: deltas/0.1.2/alpha.2.fix.1.md -->
<!-- version: 1 -->
# Delta 0.1.2-alpha.2.fix.1 — récupération de contamination inter-projet
## Baseline et diagnostic
Baseline Git observée et déjà publiée sur `origin/master` :
```text
17b7ef23a18c913f986c7d57caf958d33479363d
```
Le commit précédent observé est :
```text
6e978bfed8c1ad10d1888cd3da92aeaf70338b7e
```
La gate opérateur de `0.1.2-alpha.2` avait été exécutée avec succès avant cette chaîne de commits : tests Python, audits Markdown, gate Java/Gradle et contrôles de scope étaient `PASS`. `history/0.1.2/alpha.2.md` conserve donc ce résultat réel.
La publication de la tranche a ensuite été contaminée par des fichiers provenant d'un autre projet. Les preuves Git montrent notamment :
- `6e978bf` porte les vraies modifications PGR de `alpha.2`, mais ajoute aussi `history/0.0.1/alpha.3.fix.1.md` et utilise un message de commit étranger ;
- `17b7ef2` ajoute `Cargo.toml`, `crates/knowledge-domain-lib/src/content_family.rs` et `deltas/0.0.1/alpha.3.fix.2.md` ;
- `17b7ef2` remplace `docs/plans/001-V0_0_1_FOUNDATION_PLAN.md` et `docs/validation/001-VALIDATION_MATRIX.md` par du contenu Knowledge ;
- `git diff --check 17b7ef2^ 17b7ef2` signale en plus une ligne vide finale parasite dans la matrice de validation ;
- les commits étant déjà poussés, le présent fix restaure l'état PGR par un nouveau commit et ne réécrit pas l'historique distant.
Version avant correction au niveau Git publié : état contaminé après `0.1.2-alpha.2`.
Version après application :
```text
0.1.2-alpha.2.fix.1
```
## Objet
Ramener la branche publiée à l'état PGR attendu après `alpha.2`, tout en préservant les vraies modifications Java/Maven/Gradle et leur history `PASS`.
Ce fix est exclusivement un correctif de provenance et d'hygiène Git. Il ne change aucune décision normative de `alpha.2` et n'absorbe ni le REPLAN Java/Maven/Gradle préparé pour la tranche suivante ni le scope Android réservé à `0.1.3`.
## Scope
REPLACE :
```text
VERSION
docs/plans/001-V0_0_1_FOUNDATION_PLAN.md
docs/validation/001-VALIDATION_MATRIX.md
```
ADD :
```text
deltas/0.1.2/alpha.2.fix.1.md
manifests/0.1.2/alpha.2.fix.1.delete.txt
```
DELETE :
```text
Cargo.toml
crates/knowledge-domain-lib/src/content_family.rs
deltas/0.0.1/alpha.3.fix.2.md
history/0.0.1/alpha.3.fix.1.md
```
Le manifest de suppression doit contenir exactement ces quatre chemins.
Les fichiers suivants de `alpha.2` MUST rester inchangés par le fix :
```text
deltas/0.1.2/alpha.2.md
docs/plans/008-V0_1_2_JAVA_GRADLE_REEVALUATION_PLAN.md
docs/rules/520-JAVA_MAVEN_GRADLE.md
history/0.1.2/alpha.2.md
```
`docs/rules/610-ANDROID.md` reste également inchangé.
## Restauration autoritaire
`docs/plans/001-V0_0_1_FOUNDATION_PLAN.md` et `docs/validation/001-VALIDATION_MATRIX.md` n'étaient modifiés ni par `alpha.1` ni par `alpha.2`. Leur contenu attendu est donc exactement celui de la stable `v0.1.1`.
Le fix restaure ces deux fichiers depuis cette baseline au lieu de tenter de corriger manuellement le contenu Knowledge injecté.
## Application du manifest
Après extraction du delta, appliquer explicitement le manifest de suppression :
```bash
while IFS= read -r path; do
case "$path" in
''|'#'*) continue ;;
esac
rm -f -- "$path"
done < manifests/0.1.2/alpha.2.fix.1.delete.txt
```
Les éventuels répertoires devenus vides ne sont pas des chemins suivis par Git et n'affectent pas le contenu publié.
## Validation opérateur
Le stash `pgr-0.1.2-alpha.3-before-alpha.2-recovery` doit rester intact pendant toute cette gate. Ne pas exécuter `stash pop` avant fermeture du fix.
```bash
test "$(git rev-parse HEAD)" = '17b7ef23a18c913f986c7d57caf958d33479363d'
test "$(git rev-parse origin/master)" = '17b7ef23a18c913f986c7d57caf958d33479363d'
test "$(cat VERSION)" = '0.1.2-alpha.2.fix.1'
test -f history/0.1.2/alpha.2.md
grep -A2 '^## Statut$' history/0.1.2/alpha.2.md | grep -Fx 'PASS'
test -f deltas/0.1.2/alpha.2.fix.1.md
test ! -e history/0.1.2/alpha.2.fix.1.md
test ! -e Cargo.toml
test ! -e crates/knowledge-domain-lib/src/content_family.rs
test ! -e deltas/0.0.1/alpha.3.fix.2.md
test ! -e history/0.0.1/alpha.3.fix.1.md
git diff --exit-code v0.1.1 -- \
docs/plans/001-V0_0_1_FOUNDATION_PLAN.md \
docs/validation/001-VALIDATION_MATRIX.md
grep -Fx '<!-- version: 2 -->' docs/plans/008-V0_1_2_JAVA_GRADLE_REEVALUATION_PLAN.md
grep -Fx '<!-- version: 3 -->' docs/rules/520-JAVA_MAVEN_GRADLE.md
grep -Fx '<!-- version: 2 -->' docs/rules/610-ANDROID.md
python3 -B -m unittest discover -s tests -v
python3 -B scripts/audit_markdown_headers.py \
README.md RULES.md ROADMAP.md CHANGELOG.md docs deltas history prompts
python3 -B scripts/audit_markdown_tables.py \
README.md RULES.md ROADMAP.md CHANGELOG.md docs deltas history prompts
python3 -B scripts/audit_markdown_links.py \
README.md RULES.md ROADMAP.md CHANGELOG.md docs deltas history prompts
python3 -B - <<'PYGATE'
from pathlib import Path
import re
manifest = Path('manifests/0.1.2/alpha.2.fix.1.delete.txt')
paths = [line.strip() for line in manifest.read_text(encoding='utf-8').splitlines() if line.strip() and not line.lstrip().startswith('#')]
expected = [
'Cargo.toml',
'crates/knowledge-domain-lib/src/content_family.rs',
'deltas/0.0.1/alpha.3.fix.2.md',
'history/0.0.1/alpha.3.fix.1.md',
]
assert paths == expected, (paths, expected)
for path in expected:
assert not Path(path).exists(), path
history = Path('history/0.1.2/alpha.2.md').read_text(encoding='utf-8')
assert re.search(r'## Statut\s+PASS\s', history)
alpha2 = Path('deltas/0.1.2/alpha.2.md').read_text(encoding='utf-8')
assert '# Delta 0.1.2-alpha.2 — révision ciblée Java / Gradle' in alpha2
plan = Path('docs/plans/008-V0_1_2_JAVA_GRADLE_REEVALUATION_PLAN.md').read_text(encoding='utf-8')
assert plan.startswith('<!-- file: docs/plans/008-V0_1_2_JAVA_GRADLE_REEVALUATION_PLAN.md -->\n<!-- version: 2 -->')
profile = Path('docs/rules/520-JAVA_MAVEN_GRADLE.md').read_text(encoding='utf-8')
assert profile.startswith('<!-- file: docs/rules/520-JAVA_MAVEN_GRADLE.md -->\n<!-- version: 3 -->')
android = Path('docs/rules/610-ANDROID.md').read_text(encoding='utf-8')
assert android.startswith('<!-- file: docs/rules/610-ANDROID.md -->\n<!-- version: 2 -->')
for forbidden in (
'knowledge-domain-lib',
'# Matrice de validation Knowledge',
'knowledge-pgr-server',
):
assert forbidden not in Path('docs/validation/001-VALIDATION_MATRIX.md').read_text(encoding='utf-8'), forbidden
print('0.1.2 alpha.2.fix.1 recovery audit: clean (foreign Knowledge paths removed, PGR baseline restored, alpha.2 preserved)')
PYGATE
git diff --check
git add -A
git diff --cached --check
git status --short
```
Le scope indexé attendu est :
```text
D Cargo.toml
M VERSION
D crates/knowledge-domain-lib/src/content_family.rs
D deltas/0.0.1/alpha.3.fix.2.md
A deltas/0.1.2/alpha.2.fix.1.md
M docs/plans/001-V0_0_1_FOUNDATION_PLAN.md
M docs/validation/001-VALIDATION_MATRIX.md
D history/0.0.1/alpha.3.fix.1.md
A manifests/0.1.2/alpha.2.fix.1.delete.txt
```
L'ordre exact peut varier ; l'ensemble des chemins doit être identique.
## Transition
### PASS
Produire `history/0.1.2/alpha.2.fix.1.md`, commit/push sous l'identité `0.1.2-alpha.2.fix.1`, puis abandonner le stash préparé à partir de l'ancien HEAD contaminé et réémettre la tranche `alpha.3` sur la baseline corrigée.
La tranche `alpha.3` devra être régénérée ; le stash actuel sert uniquement de sauvegarde de sécurité et ne doit pas devenir la source autoritaire du nouveau delta.
### FAIL
Conserver les résultats réels dans `history/0.1.2/alpha.2.fix.1.md` et poursuivre sous `alpha.2.fix.N`. Ne pas restaurer `alpha.3` tant que l'état PGR publié n'est pas propre.