Files
pgr/deltas/0.0.3/alpha.2.md
2026-09-24 06:51:16 +02:00

124 lines
4.7 KiB
Markdown

<!-- file: deltas/0.0.3/alpha.2.md -->
<!-- version: 1 -->
# Delta 0.0.3-alpha.2 — outillage Rust/Cargo partagé
## Baseline et version
Baseline : `0.0.3-alpha.1.fix.1` avec `history/0.0.3/alpha.1.fix.1.md` appliqué et committé. Ce delta MUST NOT être appliqué avant ce commit.
Version avant application :
```text
0.0.3-alpha.1.fix.1
```
Version après application :
```text
0.0.3-alpha.2
```
## Objet
Matérialiser trois configurations Rust/Cargo directement issues des pratiques éprouvées dans KSP et Games, avec des instructions explicites d'adaptation. L'opérateur a précisé après le gate de `alpha.1.fix.1` que la sortie Cargo est généralement déportée vers `../builds/<projet>/target/` et que Rustfmt/Clippy constituent des conventions de départ qu'il réutilise avec des adaptations mineures.
Le `clippy.toml` livré conserve les réglages communs utiles aux deux corpus, sans copier leurs listes d'identifiants propres ni leurs entrées vides. Les niveaux des lints appartiendront aux templates `Cargo.toml` de `alpha.3`, conformément au profil `510`.
## Scope
REPLACE :
```text
VERSION
docs/000-README.md
docs/plans/003-V0_0_3_TEMPLATES_AUDITS_PLAN.md
```
ADD :
```text
templates/rust-cargo/rustfmt.toml
templates/rust-cargo/clippy.toml
templates/rust-cargo/.cargo/config.toml
docs/templates/001-RUST_CARGO_TOOLING.md
deltas/0.0.3/alpha.2.md
```
DELETE : aucun.
Les fichiers complets sont livrés dans l'archive delta. Aucun history `alpha.2`, manifest de suppression, crate PGR ou script d'audit nouveau n'y est inclus.
## Validation opérateur
Depuis la racine du dépôt après application du delta :
```bash
test "$(cat VERSION)" = '0.0.3-alpha.2'
git cat-file -e HEAD:history/0.0.3/alpha.1.fix.1.md
test ! -e history/0.0.3/alpha.2.md
python3 -B - <<'PY'
from pathlib import Path
import tomllib
root = Path('templates/rust-cargo')
rustfmt = tomllib.loads((root / 'rustfmt.toml').read_text(encoding='utf-8'))
clippy = tomllib.loads((root / 'clippy.toml').read_text(encoding='utf-8'))
cargo = tomllib.loads((root / '.cargo/config.toml').read_text(encoding='utf-8'))
assert rustfmt['edition'] == '2024'
assert rustfmt['max_width'] == 160
assert clippy['allow-unwrap-in-tests'] is True
assert clippy['allowed-idents-below-min-chars'] == ['id']
assert cargo['build']['target-dir'] == '../builds/project-name/target'
assert cargo['build']['build-dir'] == cargo['build']['target-dir']
for path in (root / 'rustfmt.toml', root / 'clippy.toml', root / '.cargo/config.toml'):
lines = path.read_text(encoding='utf-8').splitlines()
assert lines[0] == f'# file: {path.as_posix()}', path
assert lines[1] == '# version: 1', path
print('Rust/Cargo template TOML audit: clean (3 file(s))')
PY
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
files = [Path(name) for name in ('README.md', 'RULES.md', 'ROADMAP.md', 'CHANGELOG.md')]
for directory in ('docs', 'deltas', 'history', 'prompts'):
files.extend(Path(directory).rglob('*.md'))
files = sorted(set(files))
for path in files:
lines = path.read_text(encoding='utf-8').splitlines()
assert len(lines) >= 2 and lines[0] == f'<!-- file: {path.as_posix()} -->', path
assert re.fullmatch(r'<!-- version: [1-9][0-9]* -->', lines[1]), path
print(f'Markdown header audit: clean ({len(files)} file(s))')
PY
git diff --check
git add VERSION docs/000-README.md docs/plans/003-V0_0_3_TEMPLATES_AUDITS_PLAN.md \
docs/templates/001-RUST_CARGO_TOOLING.md deltas/0.0.3/alpha.2.md \
templates/rust-cargo/rustfmt.toml templates/rust-cargo/clippy.toml \
templates/rust-cargo/.cargo/config.toml
git diff --cached --check
git status --short
```
Scope attendu avant ajout du history : les trois `REPLACE` et les cinq `ADD` énumérés ci-dessus, sans modification des deltas ou histories précédents.
Revue opérateur : confirmer que la convention de sortie Cargo vers un dossier frère est expliquée avec son chemin relatif réel, que `project-name` est à remplacer avant copie et que les lints de niveau Cargo et les manifests restent bien au scope de `alpha.3`. La gate de cette tranche reste documentaire/TOML : PGR ne contient aucun workspace Rust à compiler.
## Transition
### PASS
Produire séparément `history/0.0.3/alpha.2.md` avec les sorties réellement observées, l'appliquer et committer avant de préparer `alpha.3` consacré aux manifests Cargo.
### FAIL
Enregistrer la défaillance réelle puis corriger ces seuls templates ou instructions dans `alpha.2.fix.1`, sauf besoin de REPLAN justifié.