diff --git a/VERSION b/VERSION index d411fbc..f1805e0 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -0.0.4-alpha.4 +0.0.4-alpha.4.fix.1 diff --git a/deltas/0.0.4/alpha.4.fix.1.md b/deltas/0.0.4/alpha.4.fix.1.md new file mode 100644 index 0000000..4d37377 --- /dev/null +++ b/deltas/0.0.4/alpha.4.fix.1.md @@ -0,0 +1,231 @@ + + + +# Delta 0.0.4-alpha.4.fix.1 — correction du smoke Rust/Cargo + +## Baseline + +Version attendue avant application : + +```text +0.0.4-alpha.4 +``` + +Le history `history/0.0.4/alpha.4.md` avec statut `FAIL` MUST avoir été appliqué et committé avant ce correctif. + +Version après application : + +```text +0.0.4-alpha.4.fix.1 +``` + +## Objet + +Corriger uniquement la procédure de smoke Rust/Cargo qui a échoué pendant la gate opérateur de `alpha.4`. + +Le workspace temporaire était fonctionnel et les commandes Cargo ont réussi, mais l'adaptation de `.cargo/config.toml` remplaçait les chemins contenant `project-name` sans adapter le commentaire de guidance qui contenait encore ce placeholder. L'assertion d'absence de placeholders échouait donc avant le smoke Cargo. + +Ce fix adapte explicitement ce commentaire dans la fixture temporaire avant de vérifier l'absence de placeholders. + +Aucune règle, aucun skeleton, aucun template et aucun script PGR n'est ajouté ou modifié. + +## Scope + +REPLACE : + +```text +VERSION +``` + +ADD : + +```text +deltas/0.0.4/alpha.4.fix.1.md +``` + +DELETE : aucun. + +Les snapshots suivants restent inchangés : + +```text +deltas/0.0.4/alpha.4.md +docs/skeletons/002-RUST_CARGO_WORKSPACE.md +templates/rust-cargo/rustfmt.toml +templates/rust-cargo/clippy.toml +templates/rust-cargo/.cargo/config.toml +templates/rust-cargo/Cargo.toml +templates/rust-cargo/crates/project-core-lib/Cargo.toml +``` + +## Validation opérateur + +```bash +test "$(cat VERSION)" = '0.0.4-alpha.4.fix.1' +test -f history/0.0.4/alpha.4.md +test -f deltas/0.0.4/alpha.4.md +test -f deltas/0.0.4/alpha.4.fix.1.md +test -f docs/skeletons/002-RUST_CARGO_WORKSPACE.md +test ! -e history/0.0.4/alpha.4.fix.1.md + +grep -A2 '^## Statut$' history/0.0.4/alpha.4.md | grep -Fx 'FAIL' + +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 - <<'PY' +from pathlib import Path +import re +import tomllib + +expected = { + 'alpha.1.md': 'PASS', + 'alpha.2.md': 'PASS', + 'alpha.3.md': 'PASS', + 'alpha.4.md': 'FAIL', +} +histories = {path.name for path in Path('history/0.0.4').glob('*.md')} +assert histories == set(expected), histories +for name, status in expected.items(): + text = Path('history/0.0.4', name).read_text(encoding='utf-8') + assert re.search(rf'## Statut\s+{status}\s', text), (name, status) + +skeletons = sorted(path.name for path in Path('docs/skeletons').glob('*.md')) +assert skeletons == [ + '000-README.md', + '001-PROJECT_GOVERNANCE_FOUNDATION.md', + '002-RUST_CARGO_WORKSPACE.md', +], skeletons + +for path in ( + Path('templates/rust-cargo/rustfmt.toml'), + Path('templates/rust-cargo/clippy.toml'), + Path('templates/rust-cargo/.cargo/config.toml'), + Path('templates/rust-cargo/Cargo.toml'), + Path('templates/rust-cargo/crates/project-core-lib/Cargo.toml'), +): + with path.open('rb') as stream: + tomllib.load(stream) + +print('Rust/Cargo fix audit: clean (alpha.4 FAIL recorded, skeleton/templates unchanged)') +PY + +command -v cargo +command -v rustfmt +cargo --version +rustc --version +rustfmt --version +cargo clippy --version + +tmp="$(mktemp -d)" +trap 'rm -rf "$tmp"' EXIT +mkdir -p "$tmp/.cargo" "$tmp/crates/smoke-core-lib/src" +cp templates/rust-cargo/Cargo.toml "$tmp/Cargo.toml" +cp templates/rust-cargo/rustfmt.toml "$tmp/rustfmt.toml" +cp templates/rust-cargo/clippy.toml "$tmp/clippy.toml" +cp templates/rust-cargo/.cargo/config.toml "$tmp/.cargo/config.toml" +cp templates/rust-cargo/crates/project-core-lib/Cargo.toml "$tmp/crates/smoke-core-lib/Cargo.toml" +printf '1.2.3\n' > "$tmp/VERSION" + +python3 -B - "$tmp" <<'PY' +from pathlib import Path +import sys + +root = Path(sys.argv[1]) + +replacements = { + root / 'Cargo.toml': ( + ('# file: templates/rust-cargo/Cargo.toml', '# file: Cargo.toml'), + ('members = ["crates/project-core-lib"]', 'members = ["crates/smoke-core-lib"]'), + ('version = "0.1.0"', 'version = "1.2.3"'), + ), + root / 'rustfmt.toml': ( + ('# file: templates/rust-cargo/rustfmt.toml', '# file: rustfmt.toml'), + ), + root / 'clippy.toml': ( + ('# file: templates/rust-cargo/clippy.toml', '# file: clippy.toml'), + ), + root / '.cargo/config.toml': ( + ('# file: templates/rust-cargo/.cargo/config.toml', '# file: .cargo/config.toml'), + ( + '# Replace project-name with a unique name before using this configuration.', + '# Smoke fixture: project-specific build directory already selected.', + ), + ('../builds/project-name/target', 'target-smoke'), + ), + root / 'crates/smoke-core-lib/Cargo.toml': ( + ( + '# file: templates/rust-cargo/crates/project-core-lib/Cargo.toml', + '# file: crates/smoke-core-lib/Cargo.toml', + ), + ('name = "project-core-lib"', 'name = "smoke-core-lib"'), + ), +} + +for path, pairs in replacements.items(): + text = path.read_text(encoding='utf-8') + for old, new in pairs: + assert old in text, (path, old) + text = text.replace(old, new) + path.write_text(text, encoding='utf-8') + +for path in root.rglob('*'): + if path.is_file() and path.name != 'Cargo.lock': + text = path.read_text(encoding='utf-8') + assert 'project-name' not in text, path + assert 'project-core-lib' not in text, path + +print('Temporary Rust/Cargo template adaptation: clean') +PY + +cat > "$tmp/crates/smoke-core-lib/src/lib.rs" <<'RS' +//! Minimal crate used to validate the PGR Rust/Cargo templates. + +/// Returns the deterministic smoke value. +pub fn smoke_value() -> u8 { + return 1; +} +RS + +( + cd "$tmp" + cargo metadata --format-version 1 --no-deps >/dev/null + cargo fmt --all -- --check + cargo check --workspace + cargo clippy --workspace --all-targets --all-features -- -D warnings +) + +rm -rf "$tmp" +trap - EXIT + +git diff --check + +git add VERSION deltas/0.0.4/alpha.4.fix.1.md + +git diff --cached --check +git status --short +``` + +La sortie Git attendue avant ajout du history du fix est exactement : + +```text +M VERSION +A deltas/0.0.4/alpha.4.fix.1.md +``` + +## Transition + +### PASS + +Créer et appliquer séparément `history/0.0.4/alpha.4.fix.1.md`, committer et pousser le correctif, puis reprendre le plan `0.0.4` à la tranche suivante prévue. + +Le history `alpha.4.fix.1` et le delta de la tranche suivante MAY être livrés ensemble sous forme de deux archives séparées après observation de la gate opérateur. + +### FAIL + +Rester dans `0.0.4-alpha.4.fix.M`. Le scope MUST rester limité au smoke Rust/Cargo de cette tranche tant qu'aucun défaut plus large ne justifie un REPLAN. diff --git a/history/0.0.4/alpha.4.fix.1.md b/history/0.0.4/alpha.4.fix.1.md new file mode 100644 index 0000000..bfbacba --- /dev/null +++ b/history/0.0.4/alpha.4.fix.1.md @@ -0,0 +1,117 @@ + + + +# History 0.0.4-alpha.4.fix.1 — correction du smoke Rust/Cargo + +## Statut + +PASS + +La gate de `0.0.4-alpha.4.fix.1` exécutée par l'opérateur le `2026-09-24` valide la correction locale du smoke d'instanciation Rust/Cargo. Le `FAIL` historique de `alpha.4` reste inchangé ; le fix prouve que l'adaptation temporaire élimine désormais les placeholders avant l'exécution de la toolchain. + +## Baseline et version + +La tranche `0.0.4-alpha.4` a été committée et poussée sous le commit observé : + +```text +c0735d1 +``` + +Ce commit contient `history/0.0.4/alpha.4.md` avec statut `FAIL`. + +La version contrôlée après application du correctif est : + +```text +0.0.4-alpha.4.fix.1 +``` + +Les deltas `alpha.4.md` et `alpha.4.fix.1.md`, le history `alpha.4.md` et le skeleton `docs/skeletons/002-RUST_CARGO_WORKSPACE.md` sont présents. `history/0.0.4/alpha.4.fix.1.md` était absent pendant la gate. + +## Validation opérateur observée + +La suite Python globale a exécuté `15` tests, tous réussis : + +```text +Ran 15 tests in 0.225s + +OK +``` + +Les trois audits Markdown ont réussi : + +```text +Markdown header audit: clean (113 file(s)) +Markdown table audit: clean (3 table(s), 113 file(s)) +Markdown link audit: clean (113 local link(s), 113 file(s)) +``` + +Le contrôle structurel du correctif a affiché : + +```text +Rust/Cargo fix audit: clean (alpha.4 FAIL recorded, skeleton/templates unchanged) +``` + +Il confirme les histories `alpha.1`, `alpha.2` et `alpha.3` en `PASS`, `alpha.4` en `FAIL`, les trois fichiers de skeleton attendus et le parsing TOML des cinq templates Rust/Cargo sans modification de ces artefacts. + +La toolchain opérateur observée est : + +```text +cargo 1.94.1 (29ea6fb6a 2026-03-24) +rustc 1.94.1 (e408947bf 2026-03-25) +rustfmt 1.8.0-stable (e408947bfd 2026-03-25) +clippy 0.1.94 (e408947bfd 2026-03-25) +``` + +La procédure temporaire corrigée a remplacé le commentaire de guidance de `.cargo/config.toml` en plus des chemins et autres placeholders, puis a affiché : + +```text +Temporary Rust/Cargo template adaptation: clean +``` + +Aucun `project-name` ni `project-core-lib` ne subsiste donc dans les fichiers adoptés de la fixture temporaire avant la validation Cargo. + +La séquence suivante a ensuite été exécutée dans le workspace temporaire : + +```text +cargo metadata --format-version 1 --no-deps +cargo fmt --all -- --check +cargo check --workspace +cargo clippy --workspace --all-targets --all-features -- -D warnings +``` + +Aucun diagnostic d'échec n'a été transmis pour `cargo metadata` ou `cargo fmt`. `cargo check` et `cargo clippy` ont tous deux terminé avec succès pour : + +```text +smoke-core-lib v1.2.3 +``` + +Le workspace temporaire a ensuite été supprimé et le trap désarmé. + +`git diff --check` et `git diff --cached --check` n'ont produit aucun diagnostic. Le scope Git observé avant le présent history est exactement : + +```text +M VERSION +A deltas/0.0.4/alpha.4.fix.1.md +``` + +La transcription du terminal contient quelques fragments de heredoc intercalés avec la sortie des tests ; les résultats finaux des commandes, audits, contrôles structurels et du scope Git restent toutefois identifiables et cohérents. + +## Résultat du correctif + +Le défaut de `alpha.4` appartenait uniquement à la fixture de validation et non aux règles, au skeleton `002` ou aux cinq templates distribués. `alpha.4.fix.1` corrige ce défaut sans modifier ces artefacts. + +La preuve d'instanciation est désormais complète pour le scope prévu : adaptation des placeholders, parsing/metadata Cargo, formatage, compilation de vérification et Clippy avec `-D warnings` sur une crate minimale. + +Aucun REPLAN n'est requis. + +## Transition + +Appliquer le présent history puis committer et pousser `0.0.4-alpha.4.fix.1` avant d'appliquer le delta suivant. + +La tranche suivante prévue par le plan est : + +```text +0.0.4-beta.1 +``` + +Elle doit rester une réconciliation interne : ownership, liens/index, absence de duplication normative, non-universalisation des valeurs d'exemple, limites des audits et confirmation des spécialisations différées. Elle ne doit pas créer de nouveau skeleton ou template sans défaut réel découvert pendant cette revue.