292 lines
9.5 KiB
Markdown
292 lines
9.5 KiB
Markdown
<!-- file: deltas/0.0.1/alpha.2.md -->
|
|
<!-- version: 1 -->
|
|
|
|
# Delta 0.0.1-alpha.2 — workspace Rust/Cargo et contrat auth/admin
|
|
|
|
## Base requise
|
|
|
|
État `0.0.1-alpha.1.fix.1` committé et poussé avec :
|
|
|
|
```text
|
|
history/0.0.1/alpha.1.md = FAIL
|
|
history/0.0.1/alpha.1.fix.1.md = PASS
|
|
```
|
|
|
|
La version devient :
|
|
|
|
```text
|
|
0.0.1-alpha.2
|
|
```
|
|
|
|
Le présent delta ne doit être appliqué qu'après matérialisation du history `alpha.1.fix.1` et commit/push de cette tranche.
|
|
|
|
## Objet
|
|
|
|
Composer le skeleton PGR `002-RUST_CARGO_WORKSPACE` au-dessus de la fondation validée et intégrer la clarification auth/admin issue de l'étude des deux corpus historiques fournis.
|
|
|
|
La tranche :
|
|
|
|
- instancie un workspace Rust 2024 à train de release unique ;
|
|
- crée uniquement la première crate réellement possédée, `knowledge-domain-lib` ;
|
|
- adopte les configurations PGR Rustfmt/Clippy adaptées au projet ;
|
|
- place les artefacts Cargo hors du dépôt sous `../builds/sasedev-knowledge/target/` ;
|
|
- décide explicitement de versionner `Cargo.lock` pour la reproductibilité du workspace applicatif déployable ;
|
|
- documente les capacités auth/admin réellement observées dans `actix-auth-app` et `amahil-project`, séparément de leurs structures préparatoires ou intentions incomplètes ;
|
|
- établit que chaque future application Web Knowledge conserve sa propre surface d'administration protégée ;
|
|
- laisse les URL, le modèle détaillé d'autorisation, OAuth2/OIDC, MFA et une éventuelle quatrième application admin en `DEFER`.
|
|
|
|
Aucun serveur Actix Web, aucune route HTTP, aucun schéma PostgreSQL, aucun adapter Git/forge et aucun frontend n'est implémenté dans cette tranche.
|
|
|
|
## Corpus auth/admin étudié
|
|
|
|
Les archives fournies ont été contrôlées comme corpus d'inspiration uniquement :
|
|
|
|
```text
|
|
actix-auth-app-master.zip
|
|
SHA-256 bcdf4c568c827b77c70ee476218c2b07ea0fca408ab87d2f044333309d19ab71
|
|
|
|
amahil-project-master.zip
|
|
SHA-256 b6a3d83c3c2911a7ff36eeb20e353801fefddaf1e5eb7afec1ff12c67067a359
|
|
```
|
|
|
|
L'étude détaillée appartient à [`../../docs/studies/001-AUTH_ADMIN_CORPUS_STUDY.md`](../../docs/studies/001-AUTH_ADMIN_CORPUS_STUDY.md).
|
|
|
|
Elle ne transforme pas les routes ou modèles historiques en contrat Knowledge.
|
|
|
|
## Fichiers ajoutés
|
|
|
|
```text
|
|
.cargo/config.toml
|
|
Cargo.toml
|
|
clippy.toml
|
|
crates/knowledge-domain-lib/Cargo.toml
|
|
crates/knowledge-domain-lib/src/lib.rs
|
|
docs/studies/001-AUTH_ADMIN_CORPUS_STUDY.md
|
|
rustfmt.toml
|
|
deltas/0.0.1/alpha.2.md
|
|
```
|
|
|
|
`Cargo.lock` n'est pas livré préfabriqué dans le delta. Il MUST être généré par la toolchain Cargo de l'opérateur pendant la gate puis versionné avec la tranche.
|
|
|
|
## Fichiers remplacés
|
|
|
|
```text
|
|
VERSION
|
|
README.md
|
|
RULES.md
|
|
ROADMAP.md
|
|
CHANGELOG.md
|
|
docs/000-README.md
|
|
docs/objectives/001-PROJECT_OBJECTIVES.md
|
|
docs/architecture/001-PROJECT_PROFILE.md
|
|
docs/architecture/002-KNOWLEDGE_ARCHITECTURE.md
|
|
docs/plans/001-V0_0_1_FOUNDATION_PLAN.md
|
|
docs/validation/001-VALIDATION_MATRIX.md
|
|
```
|
|
|
|
Aucun fichier n'est supprimé.
|
|
|
|
## Workspace Rust/Cargo
|
|
|
|
Le workspace matérialise uniquement :
|
|
|
|
```text
|
|
crates/knowledge-domain-lib
|
|
```
|
|
|
|
Les trois futurs exécutables restent des boundaries produit connues mais ne sont pas créés comme placeholders :
|
|
|
|
```text
|
|
knowledge-pgr-server
|
|
knowledge-howtos-server
|
|
knowledge-snippets-server
|
|
```
|
|
|
|
Ils seront introduits lorsqu'une composition Web réelle leur donnera un ownership exécutable.
|
|
|
|
## Politique `Cargo.lock`
|
|
|
|
Knowledge est un workspace applicatif déployable à train de release unique. Le lockfile généré par Cargo est donc versionné afin que les gates opérateur et les livraisons partagent la résolution réellement validée.
|
|
|
|
Le lockfile reste un artefact généré par Cargo : il ne doit pas être édité manuellement pour lui ajouter un header PGR.
|
|
|
|
## Contrat d'administration retenu
|
|
|
|
Chaque futur serveur :
|
|
|
|
```text
|
|
knowledge-pgr-server
|
|
knowledge-howtos-server
|
|
knowledge-snippets-server
|
|
```
|
|
|
|
MUST vérifier côté serveur l'autorisation de ses opérations privilégiées et MUST pouvoir posséder sa surface d'administration locale.
|
|
|
|
Aucune convention de chemin n'est adoptée dans cette tranche. En particulier, les exemples historiques :
|
|
|
|
```text
|
|
/admin
|
|
/adminapi
|
|
/login
|
|
```
|
|
|
|
ne deviennent pas des URLs Knowledge.
|
|
|
|
Une éventuelle quatrième application d'administration reste `DEFER`. Si elle apparaît plus tard, elle pourra agréger des fonctions transversales mais ne remplacera pas les contrôles locaux des trois applications.
|
|
|
|
## Validation attendue
|
|
|
|
Après application du history `alpha.1.fix.1`, commit/push de `alpha.1.fix.1`, puis extraction du présent delta depuis la racine du dépôt :
|
|
|
|
```bash
|
|
test "$(cat VERSION)" = "0.0.1-alpha.2"
|
|
|
|
git diff --check
|
|
|
|
python3 - <<'PY'
|
|
from pathlib import Path
|
|
import re
|
|
|
|
assert Path("Cargo.toml").is_file()
|
|
assert Path("rustfmt.toml").is_file()
|
|
assert Path("clippy.toml").is_file()
|
|
assert Path(".cargo/config.toml").is_file()
|
|
assert Path("crates/knowledge-domain-lib/Cargo.toml").is_file()
|
|
assert Path("crates/knowledge-domain-lib/src/lib.rs").is_file()
|
|
assert Path("docs/studies/001-AUTH_ADMIN_CORPUS_STUDY.md").is_file()
|
|
|
|
root_manifest = Path("Cargo.toml").read_text(encoding="utf-8")
|
|
member_manifest = Path("crates/knowledge-domain-lib/Cargo.toml").read_text(encoding="utf-8")
|
|
config = Path(".cargo/config.toml").read_text(encoding="utf-8")
|
|
study = Path("docs/studies/001-AUTH_ADMIN_CORPUS_STUDY.md").read_text(encoding="utf-8")
|
|
rules = Path("RULES.md").read_text(encoding="utf-8")
|
|
architecture = Path("docs/architecture/002-KNOWLEDGE_ARCHITECTURE.md").read_text(encoding="utf-8")
|
|
|
|
for placeholder in ("project-name", "project-core-lib"):
|
|
assert placeholder not in root_manifest
|
|
assert placeholder not in member_manifest
|
|
assert placeholder not in config
|
|
|
|
assert 'resolver = "3"' in root_manifest
|
|
assert 'version = "0.0.1-alpha.2"' in root_manifest
|
|
assert 'edition = "2024"' in root_manifest
|
|
assert 'members = ["crates/knowledge-domain-lib"]' in root_manifest
|
|
assert 'target-dir = "../builds/sasedev-knowledge/target"' in config
|
|
assert 'build-dir = "../builds/sasedev-knowledge/target"' in config
|
|
|
|
for server in (
|
|
"knowledge-pgr-server",
|
|
"knowledge-howtos-server",
|
|
"knowledge-snippets-server",
|
|
):
|
|
assert server in rules
|
|
assert server in architecture
|
|
|
|
for digest in (
|
|
"bcdf4c568c827b77c70ee476218c2b07ea0fca408ab87d2f044333309d19ab71",
|
|
"b6a3d83c3c2911a7ff36eeb20e353801fefddaf1e5eb7afec1ff12c67067a359",
|
|
):
|
|
assert digest in study
|
|
|
|
for phrase in (
|
|
"fonctionnalités effectivement câblées",
|
|
"structures préparatoires ou incomplètes",
|
|
"Les URL restent ouvertes",
|
|
"OAuth/OIDC et MFA restent hors scope",
|
|
):
|
|
assert phrase in study, phrase
|
|
|
|
for forbidden_path in (
|
|
"crates/knowledge-pgr-server",
|
|
"crates/knowledge-howtos-server",
|
|
"crates/knowledge-snippets-server",
|
|
"migrations",
|
|
"package.json",
|
|
"vite.config.ts",
|
|
):
|
|
assert not Path(forbidden_path).exists(), forbidden_path
|
|
|
|
for path in Path(".").rglob("*.md"):
|
|
if ".git" in path.parts:
|
|
continue
|
|
lines = path.read_text(encoding="utf-8").splitlines()
|
|
assert lines[0] == f"<!-- file: {path.as_posix()} -->", path
|
|
assert re.fullmatch(r"<!-- version: [1-9][0-9]* -->", lines[1]), path
|
|
|
|
print("Knowledge 0.0.1-alpha.2 structural audit: clean")
|
|
PY
|
|
|
|
cargo metadata --format-version 1 --no-deps > /tmp/sasedev-knowledge-cargo-metadata.json
|
|
cargo fmt --all
|
|
cargo fmt --all -- --check
|
|
cargo check --workspace
|
|
cargo clippy --workspace --all-targets --all-features -- -D warnings
|
|
cargo test --workspace --all-targets --all-features
|
|
|
|
test -f Cargo.lock
|
|
if git check-ignore -q Cargo.lock; then
|
|
echo 'Cargo.lock must be versioned for Knowledge' >&2
|
|
exit 1
|
|
fi
|
|
|
|
python3 - <<'PY'
|
|
import json
|
|
from pathlib import Path
|
|
|
|
metadata = json.loads(Path("/tmp/sasedev-knowledge-cargo-metadata.json").read_text(encoding="utf-8"))
|
|
packages = {package["name"] for package in metadata["packages"]}
|
|
assert packages == {"knowledge-domain-lib"}, packages
|
|
workspace_members = metadata["workspace_members"]
|
|
assert len(workspace_members) == 1, workspace_members
|
|
print("Knowledge 0.0.1-alpha.2 Cargo metadata audit: clean")
|
|
PY
|
|
|
|
test -d ../builds/sasedev-knowledge/target
|
|
|
|
git add -A
|
|
git diff --cached --check
|
|
git status --short
|
|
```
|
|
|
|
## Résultat attendu du staging
|
|
|
|
Le staging doit notamment montrer :
|
|
|
|
```text
|
|
A .cargo/config.toml
|
|
A Cargo.lock
|
|
A Cargo.toml
|
|
A clippy.toml
|
|
A crates/knowledge-domain-lib/Cargo.toml
|
|
A crates/knowledge-domain-lib/src/lib.rs
|
|
A deltas/0.0.1/alpha.2.md
|
|
A docs/studies/001-AUTH_ADMIN_CORPUS_STUDY.md
|
|
A rustfmt.toml
|
|
```
|
|
|
|
avec les documents vivants modifiés par la tranche.
|
|
|
|
`.project` doit rester ignoré. Aucun output Cargo ne doit apparaître dans le dépôt.
|
|
|
|
## Revue opérateur complémentaire
|
|
|
|
Vérifier notamment :
|
|
|
|
- que la crate `knowledge-domain-lib` possède une responsabilité réelle et n'est pas un placeholder de serveur ;
|
|
- que les trois exécutables ne sont pas encore matérialisés ;
|
|
- que `Cargo.lock` provient de Cargo et est bien versionné ;
|
|
- que les artefacts Cargo sont créés hors dépôt ;
|
|
- que les corpus historiques sont présentés comme inspiration et non comme baseline ;
|
|
- que chaque future application conserve une administration locale protégée ;
|
|
- qu'aucune URL admin/login, aucun enum de rôles, aucun OAuth/OIDC/MFA et aucune quatrième application admin ne sont figés prématurément.
|
|
|
|
## Transition
|
|
|
|
### PASS
|
|
|
|
Produire `history/0.0.1/alpha.2.md`, appliquer ce history, committer/pousser la tranche, puis seulement préparer `0.0.1-alpha.3`.
|
|
|
|
### FAIL / PARTIAL / BLOCKED
|
|
|
|
Conserver le résultat réel dans `history/0.0.1/alpha.2.md` et rester dans le scope `alpha.2` avec un éventuel `alpha.2.fix.1`.
|