284 lines
9.6 KiB
Markdown
284 lines
9.6 KiB
Markdown
<!-- file: deltas/0.0.2/alpha.4.md -->
|
|
<!-- version: 1 -->
|
|
|
|
# Delta 0.0.2-alpha.4 — autonomie normative et façades de crates
|
|
|
|
## Base requise
|
|
|
|
Partir de `0.0.2-alpha.3.fix.1` après application de son history `PASS`, commit et push :
|
|
|
|
```text
|
|
history/0.0.2/alpha.3.fix.1.md PASS
|
|
```
|
|
|
|
La version devient :
|
|
|
|
```text
|
|
0.0.2-alpha.4
|
|
```
|
|
|
|
Les deltas, histories et prompts historiques ne doivent pas être réécrits.
|
|
|
|
## Mission
|
|
|
|
Fermer l'adoption PGR `v0.1.3` comme migration ponctuelle : Knowledge doit désormais posséder localement les règles, patterns et audits réellement nécessaires à son développement quotidien et ne plus devoir charger PGR au début d'une version, d'une session ou d'une tranche.
|
|
|
|
La même tranche normalise les crate-roots bibliothèque comme façades sans changer les APIs publiques ni la sémantique Git validée en `alpha.3`.
|
|
|
|
## Scope documentaire et gouvernance
|
|
|
|
Créer les owners locaux :
|
|
|
|
```text
|
|
docs/rules/000-README.md
|
|
docs/rules/200-GOVERNANCE.md
|
|
docs/rules/210-WORKFLOW.md
|
|
docs/rules/300-DOCUMENTATION.md
|
|
docs/rules/400-VALIDATION.md
|
|
docs/rules/510-RUST_CARGO.md
|
|
docs/rules/530-WEB_FRONTEND.md
|
|
```
|
|
|
|
Créer le mapping de provenance :
|
|
|
|
```text
|
|
docs/architecture/003-PGR_ADOPTION_MAP.md
|
|
```
|
|
|
|
Le mapping sélectionne et adapte uniquement ce qui est utile : gouvernance, workflow, documentation, validation, Rust/Cargo et contrats Web. Les owners locaux doivent être suffisamment complets pour retrouver sans PGR le lifecycle/versioning, les fixes/REPLAN, les contrats delta/history/handoff, les rôles documentaires et les catégories de preuve. Les meta-owners de skeleton/framework restent historiques ou locaux lorsqu'un document séparé n'apporte pas de valeur.
|
|
|
|
PGR `v0.1.3` reste mentionné uniquement comme source d'adoption. Une future version PGR n'a aucun effet automatique.
|
|
|
|
## Templates locaux
|
|
|
|
Créer :
|
|
|
|
```text
|
|
docs/templates/001-NEW_SESSION_PROMPT.md
|
|
docs/templates/002-RELEASE_PLAN.md
|
|
docs/templates/003-OPERATOR_HANDOFF.md
|
|
docs/templates/004-RUST_LIBRARY_CRATE.md
|
|
```
|
|
|
|
Le template de nouvelle session doit partir de la stable Knowledge et ne doit pas demander de rechercher une stable PGR, sauf adoption externe explicitement inscrite au scope.
|
|
|
|
## Audits localement possédés
|
|
|
|
Adopter et adapter les audits Markdown génériques nécessaires :
|
|
|
|
```text
|
|
scripts/audit_markdown_headers.py
|
|
scripts/audit_markdown_links.py
|
|
scripts/audit_markdown_tables.py
|
|
```
|
|
|
|
Ils ignorent les arbres générés usuels, y compris `builds`, `node_modules`, `target` et `.git`.
|
|
|
|
Ajouter :
|
|
|
|
```text
|
|
scripts/audit_rust_crate_root_facades.py
|
|
```
|
|
|
|
Cet audit read-only vérifie que les `src/lib.rs` des crates bibliothèque ne contiennent pas de définitions top-level de production.
|
|
|
|
## Structure des crates
|
|
|
|
`knowledge-git-api` devient :
|
|
|
|
```text
|
|
src/lib.rs
|
|
src/reference.rs
|
|
src/repository.rs
|
|
src/revision.rs
|
|
src/snapshot.rs
|
|
```
|
|
|
|
`knowledge-sync-api` devient :
|
|
|
|
```text
|
|
src/lib.rs
|
|
src/event_source.rs
|
|
src/signal.rs
|
|
```
|
|
|
|
Les noms publics crate-root restent strictement les mêmes. Aucun consommateur ne doit dépendre des modules propriétaires privés.
|
|
|
|
Les autres crates bibliothèque sont auditées. `knowledge-domain-lib`, `knowledge-git-lib` et `knowledge-web-lib` respectent déjà le contrat et ne sont pas découpées davantage sans besoin réel.
|
|
|
|
## Hors scope
|
|
|
|
Cette tranche ne doit pas :
|
|
|
|
- charger ou adopter une version PGR postérieure à `v0.1.3` ;
|
|
- recopier toute l'arborescence PGR ;
|
|
- modifier le comportement de `knowledge-git-lib` ;
|
|
- changer l'API publique crate-root des contrats Git/sync ;
|
|
- modifier `Web/` ;
|
|
- ajouter `knowledge-app-lib`, PostgreSQL, forge, auth/admin ou scheduler ;
|
|
- implémenter le cas d'usage `Changed` / `Unchanged`, réservé à `alpha.5`.
|
|
|
|
## Gate opérateur
|
|
|
|
Exécuter depuis la racine après application du delta :
|
|
|
|
```bash
|
|
test "$(cat VERSION)" = '0.0.2-alpha.4'
|
|
grep -F 'version = "0.0.2-alpha.4"' Cargo.toml
|
|
grep -A2 '^## Statut$' history/0.0.2/alpha.3.fix.1.md | grep -Fx 'PASS'
|
|
|
|
git diff --check
|
|
|
|
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
|
|
|
|
python3 - <<'PY'
|
|
from pathlib import Path
|
|
import tomllib
|
|
|
|
required = (
|
|
"docs/rules/200-GOVERNANCE.md",
|
|
"docs/rules/210-WORKFLOW.md",
|
|
"docs/rules/300-DOCUMENTATION.md",
|
|
"docs/rules/400-VALIDATION.md",
|
|
"docs/rules/510-RUST_CARGO.md",
|
|
"docs/rules/530-WEB_FRONTEND.md",
|
|
"docs/architecture/003-PGR_ADOPTION_MAP.md",
|
|
"docs/templates/001-NEW_SESSION_PROMPT.md",
|
|
"docs/templates/002-RELEASE_PLAN.md",
|
|
"docs/templates/003-OPERATOR_HANDOFF.md",
|
|
"docs/templates/004-RUST_LIBRARY_CRATE.md",
|
|
"scripts/audit_markdown_headers.py",
|
|
"scripts/audit_markdown_links.py",
|
|
"scripts/audit_markdown_tables.py",
|
|
"scripts/audit_rust_crate_root_facades.py",
|
|
)
|
|
for value in required:
|
|
assert Path(value).is_file(), value
|
|
|
|
rules = Path("RULES.md").read_text(encoding="utf-8")
|
|
assert "Owners normatifs locaux" in rules
|
|
assert "Une future version de PGR n'a aucun effet automatique sur Knowledge" in rules
|
|
assert "baseline PGR courante" not in rules
|
|
|
|
owner_contracts = {
|
|
"docs/rules/200-GOVERNANCE.md": (
|
|
"X.Y.Z-alpha.N.fix.M",
|
|
"CONTINUE-NEXT-SESSION",
|
|
"rel.1 FAIL / PARTIAL / BLOCKED",
|
|
),
|
|
"docs/rules/210-WORKFLOW.md": (
|
|
"sasedev-knowledge-<X.Y.Z>-<tranche>.delta.zip",
|
|
"Le delta suivant ne doit pas être appliqué avant matérialisation Git du history précédent.",
|
|
"rapport post-tag",
|
|
),
|
|
"docs/rules/300-DOCUMENTATION.md": (
|
|
"`ROADMAP.md` décrit les objectifs",
|
|
"Documents vivants et historiques",
|
|
"Revue d'horizon",
|
|
),
|
|
"docs/rules/400-VALIDATION.md": (
|
|
"FORMAT",
|
|
"PUBLISH",
|
|
"Une commande qui échoue dans la gate reste un `FAIL`",
|
|
),
|
|
}
|
|
for path, phrases in owner_contracts.items():
|
|
text = Path(path).read_text(encoding="utf-8")
|
|
for phrase in phrases:
|
|
assert phrase in text, (path, phrase)
|
|
|
|
mapping = Path("docs/architecture/003-PGR_ADOPTION_MAP.md").read_text(encoding="utf-8")
|
|
for phrase in (
|
|
"PGR tag v0.1.3",
|
|
"Décisions ADOPT",
|
|
"Décisions KEEP-LOCAL",
|
|
"Décisions DEFER / non applicables",
|
|
"Après `PASS` d'`alpha.4`",
|
|
):
|
|
assert phrase in mapping, phrase
|
|
|
|
session_template = Path("docs/templates/001-NEW_SESSION_PROMPT.md").read_text(encoding="utf-8")
|
|
assert "Une session normale Knowledge ne consulte pas PGR" in session_template
|
|
assert "<NEXT_RELEASE>-alpha.1" in session_template
|
|
assert "stable PGR courante" not in session_template
|
|
|
|
git_api_root = Path("crates/knowledge-git-api/src/lib.rs").read_text(encoding="utf-8")
|
|
for module in ("mod reference;", "mod repository;", "mod revision;", "mod snapshot;"):
|
|
assert module in git_api_root, module
|
|
for item in ("GitReference", "GitRepository", "GitRevision", "GitSnapshot"):
|
|
assert f"::{item};" in git_api_root, item
|
|
|
|
sync_root = Path("crates/knowledge-sync-api/src/lib.rs").read_text(encoding="utf-8")
|
|
for module in ("mod event_source;", "mod signal;"):
|
|
assert module in sync_root, module
|
|
for item in ("RepositoryEventSource", "RepositorySyncCause", "RepositorySyncSignal"):
|
|
assert item in sync_root, item
|
|
|
|
root = tomllib.loads(Path("Cargo.toml").read_text(encoding="utf-8"))
|
|
assert len(root["workspace"]["members"]) == 8
|
|
print("Knowledge 0.0.2-alpha.4 autonomy/structure audit: clean")
|
|
PY
|
|
|
|
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 fmt --all -- --check
|
|
cargo metadata --format-version 1 --no-deps > /tmp/sasedev-knowledge-0.0.2-alpha.4-metadata.json
|
|
cargo check --workspace
|
|
cargo clippy --workspace --all-targets --all-features -- -D warnings
|
|
cargo test -p knowledge-git-api --all-targets --all-features
|
|
cargo test -p knowledge-sync-api --all-targets --all-features
|
|
cargo test -p knowledge-git-lib --all-targets --all-features
|
|
cargo test --workspace --all-targets --all-features
|
|
|
|
python3 - <<'PY'
|
|
import json
|
|
from pathlib import Path
|
|
|
|
metadata = json.loads(Path("/tmp/sasedev-knowledge-0.0.2-alpha.4-metadata.json").read_text(encoding="utf-8"))
|
|
expected = {
|
|
"knowledge-domain-lib",
|
|
"knowledge-git-api",
|
|
"knowledge-git-lib",
|
|
"knowledge-sync-api",
|
|
"knowledge-web-lib",
|
|
"knowledge-pgr-server",
|
|
"knowledge-howtos-server",
|
|
"knowledge-snippets-server",
|
|
}
|
|
assert {package["name"] for package in metadata["packages"]} == expected
|
|
assert len(metadata["workspace_members"]) == 8
|
|
print("Knowledge 0.0.2-alpha.4 Cargo metadata audit: clean")
|
|
PY
|
|
|
|
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 -z "$(git diff --name-only -- Web)"
|
|
test -z "$(git diff --name-only -- crates/knowledge-git-lib/src)"
|
|
test ! -e crates/knowledge-app-lib
|
|
test ! -e crates/knowledge-forge-gitea-lib
|
|
test ! -e crates/knowledge-store-postgres-lib
|
|
test ! -e history/0.0.2/alpha.4.md
|
|
|
|
git add -A
|
|
git diff --cached --check
|
|
git status --short
|
|
```
|
|
|
|
## Transition attendue
|
|
|
|
Si toute la gate est `PASS`, produire `history/0.0.2/alpha.4.md`, appliquer/committer/pousser ce history puis préparer seulement ensuite `0.0.2-alpha.5`.
|