framework-aidf 0.0.0-stage → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (154) hide show
  1. package/CHANGELOG.md +174 -0
  2. package/INSTALLATION.md +140 -0
  3. package/LICENSE +21 -0
  4. package/QODER.md +88 -0
  5. package/README.md +142 -2
  6. package/UTILISATION.md +188 -0
  7. package/assets/adapters/qoder/agents/aidf-orchestrator.md +30 -0
  8. package/assets/adapters/qoder/rules/00-core.md +28 -0
  9. package/assets/adapters/qoder/rules/10-security.md +33 -0
  10. package/assets/adapters/qoder/rules/20-context.md +39 -0
  11. package/assets/core/AGENTS.fragment.md +18 -0
  12. package/assets/core/AIDF.md +107 -0
  13. package/assets/docs/APPFLOW.md +66 -0
  14. package/assets/docs/BACKEND.md +71 -0
  15. package/assets/docs/CHANGELOG.md +25 -0
  16. package/assets/docs/CONVENTIONS.md +95 -0
  17. package/assets/docs/DECISIONS.md +60 -0
  18. package/assets/docs/PLAN.md +53 -0
  19. package/assets/docs/PRD.md +88 -0
  20. package/assets/docs/SECURITY.md +94 -0
  21. package/assets/docs/TRD.md +78 -0
  22. package/assets/docs/UI-UX.md +71 -0
  23. package/assets/docs/constitution.md +86 -0
  24. package/assets/hooks/audit.mjs +45 -0
  25. package/assets/hooks/session-context.mjs +53 -0
  26. package/assets/integrations/spec-kit/mapping.yaml +92 -0
  27. package/assets/knowledge/best-practices/testing.md +53 -0
  28. package/assets/knowledge/best-practices/web-dev-baseline.md +39 -0
  29. package/assets/knowledge/rules/api.md +45 -0
  30. package/assets/knowledge/rules/sql.md +44 -0
  31. package/assets/knowledge/rules/typescript.md +50 -0
  32. package/assets/knowledge/security-references/owasp-baseline.md +58 -0
  33. package/assets/registry/activation-map.yaml +83 -0
  34. package/assets/registry/dependencies.yaml +35 -0
  35. package/assets/registry/skills.yaml +541 -0
  36. package/assets/registry/sources.yaml +396 -0
  37. package/assets/schemas/architecture/v1.json +110 -0
  38. package/assets/schemas/constraints/v1.json +93 -0
  39. package/assets/schemas/decision/v1.json +106 -0
  40. package/assets/schemas/discovery/v1.json +91 -0
  41. package/assets/schemas/requirement/v1.json +136 -0
  42. package/assets/schemas/security/threat-model/v1.json +127 -0
  43. package/assets/schemas/test-plan/v1.json +108 -0
  44. package/assets/skills/aidf-architecture-review/SKILL.md +49 -0
  45. package/assets/skills/aidf-backend-implementation/SKILL.md +47 -0
  46. package/assets/skills/aidf-database-design/SKILL.md +48 -0
  47. package/assets/skills/aidf-devops-engineering/SKILL.md +41 -0
  48. package/assets/skills/aidf-documentation-maintenance/SKILL.md +41 -0
  49. package/assets/skills/aidf-frontend-implementation/SKILL.md +44 -0
  50. package/assets/skills/aidf-phase-transition/SKILL.md +48 -0
  51. package/assets/skills/aidf-product-analysis/SKILL.md +47 -0
  52. package/assets/skills/aidf-project-context/SKILL.md +57 -0
  53. package/assets/skills/aidf-requirements-engineering/SKILL.md +52 -0
  54. package/assets/skills/aidf-security-review/SKILL.md +57 -0
  55. package/assets/skills/aidf-testing-validation/SKILL.md +48 -0
  56. package/assets/skills/aidf-ui-ux-implementation/SKILL.md +43 -0
  57. package/assets/workflows/gates.yaml +232 -0
  58. package/assets/workflows/phases.yaml +161 -0
  59. package/bin/aidf.mjs +12 -0
  60. package/demo/run-demo.mjs +97 -0
  61. package/docs/aidf/ADR-001-artefacts-architectur.md +126 -0
  62. package/docs/aidf/ADR-002-requirements-registry.md +145 -0
  63. package/docs/aidf/ADR-003-traceability-chain.md +145 -0
  64. package/docs/aidf/ADR-004-markdown-generation.md +134 -0
  65. package/docs/aidf/ADR-005-validation-and-tests.md +170 -0
  66. package/docs/aidf/ADR-006-cli-commands.md +189 -0
  67. package/docs/aidf/ADR-007-compatibility-and-migration.md +119 -0
  68. package/docs/aidf/ADR-008-schema-versioning.md +115 -0
  69. package/docs/aidf/ADR-009-artefacts-scope.md +84 -0
  70. package/docs/aidf/ARCHITECTURE.md +137 -0
  71. package/docs/aidf/COMPATIBILITY.md +90 -0
  72. package/docs/aidf/DECISIONS.md +200 -0
  73. package/docs/aidf/FRAMEWORK.md +38 -0
  74. package/docs/aidf/IDE-QODER.md +61 -0
  75. package/docs/aidf/INSTALL.md +99 -0
  76. package/docs/aidf/INVENTORY.md +72 -0
  77. package/docs/aidf/L1-ARCHITECTURE-RAPPORT.md +353 -0
  78. package/docs/aidf/LIMITATIONS.md +69 -0
  79. package/docs/aidf/MATRICE-0.1.0-vers-0.2.0.md +155 -0
  80. package/docs/aidf/SECURITY.md +86 -0
  81. package/docs/aidf/SKILLS.md +78 -0
  82. package/docs/aidf/SPECKIT.md +67 -0
  83. package/docs/aidf/USAGE.md +113 -0
  84. package/docs/aidf/VALIDATION.md +55 -0
  85. package/package.json +37 -4
  86. package/src/cli.mjs +148 -0
  87. package/src/commands/artefacts.mjs +129 -0
  88. package/src/commands/config.mjs +130 -0
  89. package/src/commands/context.mjs +55 -0
  90. package/src/commands/decision.mjs +142 -0
  91. package/src/commands/design.mjs +141 -0
  92. package/src/commands/docs.mjs +133 -0
  93. package/src/commands/doctor.mjs +210 -0
  94. package/src/commands/evidence.mjs +178 -0
  95. package/src/commands/install.mjs +154 -0
  96. package/src/commands/release.mjs +214 -0
  97. package/src/commands/requirements.mjs +196 -0
  98. package/src/commands/resources.mjs +181 -0
  99. package/src/commands/scan.mjs +139 -0
  100. package/src/commands/security.mjs +97 -0
  101. package/src/commands/setup.mjs +68 -0
  102. package/src/commands/skills.mjs +204 -0
  103. package/src/commands/speckit.mjs +78 -0
  104. package/src/commands/tests.mjs +81 -0
  105. package/src/commands/traceability.mjs +116 -0
  106. package/src/commands/uninstall.mjs +238 -0
  107. package/src/commands/validate.mjs +84 -0
  108. package/src/commands/workflow.mjs +137 -0
  109. package/src/core/adapters/base.mjs +32 -0
  110. package/src/core/adapters/generic.mjs +70 -0
  111. package/src/core/adapters/index.mjs +24 -0
  112. package/src/core/adapters/opencode.mjs +115 -0
  113. package/src/core/adapters/qoder.mjs +228 -0
  114. package/src/core/artefacts/index.mjs +1 -0
  115. package/src/core/artefacts/validation.mjs +161 -0
  116. package/src/core/bootstrap.mjs +179 -0
  117. package/src/core/config.mjs +123 -0
  118. package/src/core/context.mjs +187 -0
  119. package/src/core/design-engineering/complexity-classifier.mjs +78 -0
  120. package/src/core/design-engineering/engine.mjs +197 -0
  121. package/src/core/design-engineering/fallback/mockups.mjs +221 -0
  122. package/src/core/design-engineering/fallback/wireframes.mjs +114 -0
  123. package/src/core/design-engineering/figma/validators.mjs +178 -0
  124. package/src/core/design-engineering/index.mjs +9 -0
  125. package/src/core/design-engineering/visual-parity/capture.mjs +172 -0
  126. package/src/core/detect.mjs +220 -0
  127. package/src/core/docsgen.mjs +175 -0
  128. package/src/core/evidence.mjs +210 -0
  129. package/src/core/installer.mjs +377 -0
  130. package/src/core/manifest.mjs +53 -0
  131. package/src/core/paths.mjs +94 -0
  132. package/src/core/requirements/index.mjs +13 -0
  133. package/src/core/requirements/registry.mjs +234 -0
  134. package/src/core/resource-inventory.mjs +434 -0
  135. package/src/core/resources.mjs +280 -0
  136. package/src/core/security/threat-model.mjs +235 -0
  137. package/src/core/skills.mjs +353 -0
  138. package/src/core/source-skills.mjs +213 -0
  139. package/src/core/speckit.mjs +195 -0
  140. package/src/core/technology-decision/analyzer-deterministic.mjs +240 -0
  141. package/src/core/technology-decision/engine.mjs +157 -0
  142. package/src/core/technology-decision/generator.mjs +204 -0
  143. package/src/core/technology-decision/index.mjs +17 -0
  144. package/src/core/technology-decision/options/index.mjs +10 -0
  145. package/src/core/testplan.mjs +176 -0
  146. package/src/core/traceability/chain.mjs +488 -0
  147. package/src/core/traceability/index.mjs +12 -0
  148. package/src/core/workflow.mjs +471 -0
  149. package/src/util/args.mjs +69 -0
  150. package/src/util/frontmatter.mjs +26 -0
  151. package/src/util/fsx.mjs +208 -0
  152. package/src/util/logger.mjs +74 -0
  153. package/src/util/text.mjs +66 -0
  154. package/src/util/yaml.mjs +379 -0
@@ -0,0 +1,353 @@
1
+ # L1-A — ARCHITECTURE RAPPORT
2
+
3
+ - Date: 2026-11-20
4
+ - AIDF version: 0.1.0 → 0.2.0 (incremental, backward compatible)
5
+ - Commit: 85f187a
6
+
7
+ ## Résumé
8
+
9
+ L1-A propose d'introduire un modèle de données structuré pour AIDF, permettant de :
10
+
11
+ - Représenter les exigences, décisions, architecture, tests et preuves
12
+ - Établir une chaîne de traçabilité vérifiable (exigence → design → implémentation → test → preuve)
13
+ - Calculer la couverture de façon déterministe (pas de faux PASS par déclaration)
14
+ - Préserver les documents Markdown pour la lisibilité humaine
15
+
16
+ L1 est **additif** : jamais de modifications destructives, jamais de suppression de fichiers existants.
17
+
18
+ ## État initial
19
+
20
+ ### Commit
21
+
22
+ - Hash: `85f187a` (initial commit 0.1.0 baseline)
23
+ - Branche: `master`
24
+ - État Git: clean, aucun secret détecté
25
+
26
+ ### Tests
27
+
28
+ - Total: 44 tests
29
+ - Passants: 44/44
30
+ - Échouants: 0/44
31
+ - Suite complète exécutée
32
+
33
+ ### Structure
34
+
35
+ - 18 verbes CLI
36
+ - 8 phases, 16 gates, 6 types de checks
37
+ - 11 documents Markdown (.aidf/docs/)
38
+ - 13 skills builtin
39
+ - Evidence engine opérationnel
40
+ - CLI autonome, sans dépendance runtime inutile
41
+
42
+ ## Architecture retenue
43
+
44
+ ### Modèle de données
45
+
46
+ **Canonicité:**
47
+
48
+ | Couche | Format | Rôle | Auteur | Vérifiable |
49
+ |---|---|---|---|---|
50
+ | **Canonicale** | JSON | Validation, liens, traçabilité | CLI-only writes | Schema + link resolution |
51
+ | **Documentaire** | Markdown | Lisibilité humaine | Read-only (dériver) | Hash comparison |
52
+ | **Générée** | Markdown | Affichage IDE/CLI | Read-only (dériver) | Hash comparison |
53
+
54
+ **Artefacts (L1):**
55
+
56
+ ```text
57
+ .aidf/
58
+ artefacts/
59
+ discovery.json # Fait du projet, contraintes, ressources
60
+ constraints.json # Limites non-négociables
61
+ requirements.json # Registre des exigences
62
+ architecture.json # Décisions architecturales
63
+ test-plan.json # Stratégie de test et cartographie
64
+ decisions/
65
+ <decision-id>.json # ADR (Architectural Decision Records)
66
+ security/
67
+ threat-model.json # Modèle de menace STRIDE
68
+ ```
69
+
70
+ ### Enveloppe commune
71
+
72
+ ```json
73
+ {
74
+ "id": "stable-identifier",
75
+ "schemaVersion": "1.0.0",
76
+ "createdAt": "2026-11-20T...",
77
+ "updatedAt": "2026-11-20T...",
78
+ "status": "DRAFT"|"VALIDATED"|"BLOCKED"|"OUTDATED",
79
+ "source": {
80
+ "type": "human"|"generated"|"derived",
81
+ "author": "Jeremy"|"aidf",
82
+ "createdAt": "2026-11-20T...",
83
+ "generator": null|"schema-name@1.0.0"
84
+ },
85
+ "links": [
86
+ {
87
+ "targetId": "REQ-F-001",
88
+ "targetType": "requirement",
89
+ "type": "implements"|"designed-by"|"implemented-by"|"verified-by"|"evidenced-by"
90
+ }
91
+ ],
92
+ "validation": {
93
+ "schemaVersion": "1.0.0",
94
+ "timestamp": "2026-11-20T...",
95
+ "valid": true,
96
+ "errors": [],
97
+ "warnings": []
98
+ }
99
+ }
100
+ ```
101
+
102
+ ### Identifiants
103
+
104
+ - **FUNCTIONAL**: `REQ-F-XXX`
105
+ - **NON_FUNCTIONAL**: `REQ-NF-XXX`
106
+ - **CRITERION**: `REQ-F-XXX-ACn`
107
+ - **DECISION**: `ADR-XXX`
108
+ - **DESIGN**: `DES-XXX`
109
+ - **IMPLEMENTATION**: `BACKEND-XXX`
110
+ - **TEST**: `TEST-XXX`
111
+ - **EVIDENCE**: `EVID-XXX`
112
+
113
+ Identifiants stables, jamais réutilisés.
114
+
115
+ ### Liens
116
+
117
+ | Type | Source | Cible | Signification |
118
+ |---|---|---|---|
119
+ | `implements` | exigence | exigence/décision | Implémente un objectif |
120
+ | `designed-by` | exigence/design | architecture/design | A une conception |
121
+ | `implemented-by` | design | implémentation | Conception implémentée |
122
+ | `verified-by` | exigence/test | test | Vérifié par un test |
123
+ | `evidenced-by` | test | preuve | Test exécuté avec preuve |
124
+
125
+ ### Couverture (calculée, jamais déclarée)
126
+
127
+ Une exigence est **COVERED** seulement si :
128
+
129
+ 1. **Tous ses critères d'acceptation sont TESTÉS**
130
+ - Chaque critère a au moins une vérification
131
+ - Chaque vérification référence un fichier de test existant
132
+ - La commande de test a été exécutée (preuve existe)
133
+
134
+ 2. **Résultat de test est PASS**
135
+ - Preuve existe pour l'exécution du test
136
+ - Preuve a le statut `PASS`
137
+ - Preuve référence le chemin/commande du test
138
+
139
+ 3. **Preuve est récente**
140
+ - Horodatage dans la période de rétention
141
+ - Commit de preuve correspond à la branche courante (si git)
142
+
143
+ ### Commandes CLI (proposées)
144
+
145
+ | Commande | Objectif |
146
+ |---|---|
147
+ | `artefacts list` | Lister les artefacts |
148
+ | `artefacts show <id>` | Afficher un artefact |
149
+ | `artefacts validate <path>` | Valider un artefact |
150
+ | `artefacts validate-all` | Valider tous les artefacts |
151
+ | `requirements list` | Lister les exigences |
152
+ | `requirements show <id>` | Afficher une exigence |
153
+ | `requirements add` | Créer une exigence |
154
+ | `requirements update <id>` | Modifier une exigence |
155
+ | `requirements delete <id>` | Supprimer une exigence (marquer BLOCKED) |
156
+ | `requirements link <id>` | Relier à des tests |
157
+ | `requirements coverage` | Calculer la couverture |
158
+ | `traceability report` | Rapport de chaîne de traçabilité |
159
+ | `traceability missing --type <x>` | Trouver les liens manquants |
160
+ | `traceability verify <id>` | Vérifier la chaîne pour un artefact |
161
+ | `docs generate <doc>` | Générer JSON depuis Markdown |
162
+ | `docs check` | Détecter les divergences |
163
+ | `docs regenerate <doc>` | Régénérer Markdown |
164
+ | `docs reconcile <doc>` | Réconcilier un document frozen |
165
+
166
+ ### Schema versioning
167
+
168
+ - Chaque artefact a `schemaVersion` indépendant de la version AIDF
169
+ - Schémas stockés dans `.aidf/framework/schemas/`
170
+ - Anciennes versions maintenues (backward compatible)
171
+ - Migration explicite (`aidf artefacts migrate --to 2.0.0`)
172
+
173
+ ## ADR créés
174
+
175
+ | ADR | Titre | Statut |
176
+ |---|---|---|
177
+ | ADR-001-artefacts-architectur.md | Architecture des artefacts structurés | **proposed** |
178
+ | ADR-002-requirements-registry.md | Registre des exigences | **proposed** |
179
+ | ADR-003-traceability-chain.md | Chaîne de traçabilité | **proposed** |
180
+ | ADR-004-markdown-generation.md | Génération Markdown et détection de divergences | **proposed** |
181
+ | ADR-005-validation-and-tests.md | Validation et tests | **proposed** |
182
+ | ADR-006-cli-commands.md | Commandes CLI | **proposed** |
183
+ | ADR-007-compatibility-and-migration.md | Compatibilité et migration | **proposed** |
184
+ | ADR-008-schema-versioning.md | Versioning des schémas | **proposed** |
185
+ | ADR-009-artefacts-scope.md | Scope des artefacts (L1 vs L2+) | **proposed** |
186
+
187
+ ## Stratégie d'implémentation
188
+
189
+ ### L1-A (actuel)
190
+
191
+ - Analyse de l'existant
192
+ - Définition du modèle commun
193
+ - Définition des schémas versionnés
194
+ - Définition des relations
195
+ - Définition du registre des exigences
196
+ - Définition des statuts et règles de couverture
197
+ - Définition du modèle documentaire JSON → Markdown
198
+ - Définition des tests et critères d'acceptation
199
+
200
+ **Arrêt obligatoire après L1-A.**
201
+
202
+ ### L1-B (à venir, aprés validation humaine)
203
+
204
+ - Implémenter l'enveloppe commune
205
+ - Implémenter les schémas JSON (Draft 2020-12)
206
+ - Implémenter le registre des exigences
207
+ - Implémenter les validations (schema, liens, couverture)
208
+ - Implémenter les tests (schema, liens, couverture, génération)
209
+
210
+ ### L1-C (à venir)
211
+
212
+ - Implémenter les relations entre artefacts
213
+ - Connecter les exigences aux éléments de conception
214
+ - Connecter les éléments de conception à l'implémentation
215
+ - Connecter les tests et leurs résultats
216
+ - Réutiliser l'Evidence Engine existant
217
+ - Implémenter le calcul déterministe de couverture
218
+ - Produire les rapports de traçabilité
219
+
220
+ ### L1-D (à venir)
221
+
222
+ - Implémenter le rendu Markdown
223
+ - Implémenter la détection des divergences
224
+ - Implémenter la protection des documents frozen
225
+ - Implémenter la réconciliation explicite
226
+ - Tester les scénarios de conflit
227
+
228
+ ### L1-E (à venir)
229
+
230
+ - Intégrer les fonctionnalités au CLI existant
231
+ - Ajouter les tests d'intégration
232
+ - Vérifier la compatibilité
233
+ - Vérifier le packaging
234
+ - Exécuter la suite complète
235
+ - Produire le rapport final
236
+
237
+ ## Risques
238
+
239
+ | ID | Risque | Impact | Probabilité | Mitigation |
240
+ |---|---|---|---|---|
241
+ | R-L1-01 | Nouveau code introduit des bugs | BLOCKED | LOW | Tests exhaustifs, review, rollback Git |
242
+ | R-L1-02 | Complexité accrue pour les nouveaux utilisateurs | LOW | MEDIUM | Documentation claire, CLI simple, exemples |
243
+ | R-L1-03 | Migration de 0.1.0 vers 0.2.0 déstabilise | BLOCKED | LOW | Aadditive-only, pas de breaking changes, Git baseline |
244
+ | R-L1-04 | Performance dégradée par validation/json | LOW | LOW | Validation rapide, cache, lazy loading |
245
+
246
+ ## Limites fonctionnelles actuelles
247
+
248
+ | Fonctionnalité | État |
249
+ |---|---|
250
+ | Canonical JSON artefacts | Non implémenté (design terminé) |
251
+ | Registre des exigences | Non implémenté (design terminé) |
252
+ | Chaîne de traçabilité | Non implémentée (design terminé) |
253
+ | Couverture déterministe | Non implémentée (design terminé) |
254
+ | Génération Markdown | Non implémentée (design terminé) |
255
+ | Divergence detection | Non implémentée (design terminé) |
256
+ | Protection frozen | Non implémentée (design terminé) |
257
+ | CLI commands (artefacts, requirements, traceability) | Non implémentées (design terminé) |
258
+
259
+ ## Statut par critère de sortie L1
260
+
261
+ | Critère | Condition | État |
262
+ |---|---|---|
263
+ | Schémas versionnés | Schémas présents et validés par tests | DESIGN ONLY |
264
+ | Enveloppe commune | Tous les artefacts respectent le contrat | DESIGN ONLY |
265
+ | Requirements Registry | Identifiants stables et critères testables | DESIGN ONLY |
266
+ | Références | Liens résolus et contrôlés | DESIGN ONLY |
267
+ | Traçabilité | Chaîne requirement → evidence vérifiable | DESIGN ONLY |
268
+ | Couverture | Calcul déterministe, aucun faux PASS | DESIGN ONLY |
269
+ | Tests | Existence, exécution et résultat distingués | DESIGN ONLY |
270
+ | Markdown | Génération reproductible | DESIGN ONLY |
271
+ | Divergences | Détectées sans écrasement silencieux | DESIGN ONLY |
272
+ | Frozen | Protection démontrée par tests | DESIGN ONLY |
273
+ | Compatibilité | CLI et fonctionnalités existantes préservés | PROVEN |
274
+ | Migration | Dry-run et réversibilité démontrés | DESIGN ONLY |
275
+ | Tests | Suite complète exécutée et passante | PROVEN (44/44) |
276
+ | Packaging | Distribution vérifiée | PROVEN |
277
+ | Documentation | Contrats et limites documentés | DESIGN ONLY |
278
+
279
+ **Statut global: PARTIAL** (design terminé, implémentation non commencée)
280
+
281
+ ## Compatibilité avec AIDF 0.1.0
282
+
283
+ | Élément | Impact |
284
+ |---|---|
285
+ | 18 verbes CLI | Aucun changement |
286
+ | 8 phases | Aucun changement |
287
+ | 44 tests existants | Aucun supprimé, tous passants |
288
+ | 11 documents Markdown | Non modifiés |
289
+ | Evidence Engine | Réutilisé, non modifié |
290
+ | Workflow gates | Non modifiés |
291
+ | CLI exit codes (0/1/2) | Non modifiés |
292
+ | `--json` support | Maintenu |
293
+ | `--human --by <name>` | Maintenu |
294
+
295
+ **Aucun breaking change. Aucune suppression.**
296
+
297
+ ## Preuves
298
+
299
+ ### Commit Git
300
+
301
+ - `85f187a` — Initial commit 0.1.0 baseline
302
+ - `HEAD` — master branch, working tree clean
303
+
304
+ ### Tests
305
+
306
+ - 44/44 tests passants
307
+ - Aucun test supprimé
308
+ - Nouveaux tests: 0 (L1-B seulement)
309
+
310
+ ### Fichiers modifiés
311
+
312
+ - Aucun fichier existant modifié
313
+ - 9 ADR créés (docs/aidf/ADR-00*.md)
314
+ - 1 rapport L1-A (docs/aidf/L1-ARCHITECTURE-RAPPORT.md)
315
+
316
+ ### Artéfacts créés
317
+
318
+ - docs/aidf/ADR-001-artefacts-architectur.md
319
+ - docs/aidf/ADR-002-requirements-registry.md
320
+ - docs/aidf/ADR-003-traceability-chain.md
321
+ - docs/aidf/ADR-004-markdown-generation.md
322
+ - docs/aidf/ADR-005-validation-and-tests.md
323
+ - docs/aidf/ADR-006-cli-commands.md
324
+ - docs/aidf/ADR-007-compatibility-and-migration.md
325
+ - docs/aidf/ADR-008-schema-versioning.md
326
+ - docs/aidf/ADR-009-artefacts-scope.md
327
+ - docs/aidf/L1-ARCHITECTURE-RAPPORT.md
328
+
329
+ ## Décision suivante
330
+
331
+ ### Option A: Valider L1-A et passer à L1-B
332
+
333
+ - Accepter l'architecture proposée
334
+ - Valider les ADR 001-009
335
+ - Passer à l'implémentation (L1-B)
336
+
337
+ ### Option B: Demander des modifications
338
+
339
+ - Commentaires sur l'architecture
340
+ - Modifications des ADR
341
+ - Retour à L1-A
342
+
343
+ ### Option C: Arrêter L1
344
+
345
+ - Conserver le modèle Markdown-only
346
+ - Réévaluer les besoins
347
+ - Reprendre ultérieurement
348
+
349
+ ---
350
+
351
+ **Attend validation humaine avant d'implémenter L1-B.**
352
+
353
+ Aucun fichier n'a été modifié ou supprimé. Aucun fichier existant n'a été affecté. Tout est réversible par `git reset --hard 85f187a`.
@@ -0,0 +1,69 @@
1
+ # AIDF Known Limitations
2
+
3
+ Status: VALIDATED (documented at release 0.1.0)
4
+
5
+ ## 1. Qoder runtime behaviour (cannot be proven from the filesystem)
6
+
7
+ - Rule activation type (Always Apply / Model Decision / Specific Files / Apply
8
+ Manually) is a UI setting. AIDF reports it `NOT_PROVEN` until a human sets it
9
+ and records evidence.
10
+ - Runtime skill discovery (`/skills`) and hook execution need a live Qoder
11
+ session; AIDF cannot verify them off-line.
12
+ - Qoder documentation is inconsistent on project-vs-user skill precedence;
13
+ AIDF installs only at project scope and never depends on the order.
14
+
15
+ ## 2. Scope constraints of 0.1.0
16
+
17
+ - No plugin marketplace, no remote registry, no auto-download: all external
18
+ resources are local clones or references, gated by licences.
19
+ - No remote push/publish, no migrations, no package installs — these are
20
+ project responsibilities; AIDF only stages/records commands.
21
+ - One adapter pair only (`qoder`, `generic`); other IDE adapters are future
22
+ work (interfaces exist: `plan/verify/detect`).
23
+ - `generic` adapter is AGENTS.md-block-only: rules/skills/agents require Qoder.
24
+
25
+ ## 3. YAML parser is a subset
26
+
27
+ - No anchors/aliases, multi-document streams, flow maps, or exotic scalars.
28
+ AIDF's own registries are covered; arbitrary third-party YAML may fail loudly
29
+ (by design; the error names the line).
30
+
31
+ ## 4. Spec Kit specifics
32
+
33
+ - `specify init` no-ops/blocks when `.specify/` already exists; AIDF surfaces
34
+ the status instead of reinitialising.
35
+ - On a non-empty project, init requires `--specify-force` (explicit).
36
+ - A pre-existing (external) constitution blocks `sync` forever until the human
37
+ merges or moves it — intentional, but a manual step.
38
+ - Version convergence is not assumed: source clone (1.2.6.dev0) may be newer
39
+ than the CLI (1.2.3); both are recorded in the lock/report.
40
+
41
+ ## 5. Windows behaviour
42
+
43
+ - Junctions are used instead of symlinks (no privilege required); on
44
+ non-Windows the same code path uses directory symlinks.
45
+ - `npm.ps1` is blocked by the host's execution policy; irrelevant to AIDF
46
+ (no runtime dependencies) but affects developing AIDF with npm scripts —
47
+ use `cmd /c npm` or call `node` directly.
48
+ - Reserved Windows names in any generated path are rejected outright.
49
+
50
+ ## 6. Documentation Eisenhower
51
+
52
+ - Document templates are intentionally `[TO FILL]`: AIDF generates honest
53
+ drafts with statuses `DRAFT`; it never invents requirements, metrics or
54
+ personas. Completing them is project work.
55
+
56
+ ## 7. Evidence model
57
+
58
+ - Evidence proves *that* something ran / was approved, not the semantic
59
+ quality of the artefact. Gate PASS relies on the declared checks; a
60
+ malicious agent could record a fake but hash-consistent manual record —
61
+ mitigated by `--human --by` requirements and the `previous`-hash chain being
62
+ committed (detectable tampering, not authentication).
63
+ - No cryptography beyond SHA-256; no signing infrastructure in 0.1.0.
64
+
65
+ ## 8. Multi-root workspaces
66
+
67
+ - AIDF resolves one project root (walk-up to nearest `.aidf/manifest.json`).
68
+ Multi-root IDE setups should install AIDF per root; sharing one install
69
+ across roots is not supported.
@@ -0,0 +1,155 @@
1
+ # Matrice d'écarts AIDF 0.1.0 → 0.2.0
2
+
3
+ - Date: 2026-11-21
4
+ - Branche: `feat/aidf-0.2.0`
5
+ - Baseline mesurée: `npm test` → **200/200 PASS** (après correction de 3 régressions WIP)
6
+ - État au 2026-11-21 (release 0.2.0): `npm test` → **212/212 PASS**, version `0.2.0`
7
+ (`AIDF_VERSION` + `package.json`), packaging npm revérifié, migration 0.1.0→0.2.0
8
+ prouvée (`tests/migration.test.mjs` + copie réelle de l'install 0.1.0 : 148→198
9
+ fichiers gérés, 0 conflit).
10
+ - Méthode: inspection du code réel + exécution réelle des commandes sur `../resources/`
11
+ et sur un projet temporaire (`install --adapter opencode` + `resources inventory --write`
12
+ + `skills sources` + `skills enable owasp-security`).
13
+
14
+ Statuts utilisés: PROVEN (exécuté et vérifié), CONTRACT-PROVEN (contrat fichiers vérifié,
15
+ runtime non prouvé), PARTIAL, NOT_PROVEN, BLOCKED, ABSENT.
16
+
17
+ ## 1. Socle 0.1.0 (LOT 0)
18
+
19
+ | Domaine | État | Preuve |
20
+ |---|---|---|
21
+ | 26 verbes CLI | PROVEN | `src/cli.mjs` COMMANDS; e2e `tests/cli.test.mjs` + `tests/cli.engines.test.mjs` + `tests/cli.security.test.mjs` + `tests/cli.delivery.test.mjs` |
22
+ | Phases/gates/checks | PROVEN | `assets/workflows/`, `src/core/workflow.mjs`, gates tests |
23
+ | Evidence Engine + `verifyEvidenceChain` | PROVEN | `src/core/evidence.mjs`, `evidence verify` |
24
+ | Packaging npm | PROVEN | `tests/packaging.test.mjs` (pack → install → init → doctor) |
25
+ | `run-demo.mjs` | PROVEN (non rejoué ce jour) | `demo/run-demo.mjs` présent; `npm run demo` non exécuté |
26
+ | Idempotence install/uninstall | PROVEN | e2e cli.test.mjs + installer tests |
27
+
28
+ Régressions WIP corrigées le 2026-11-21:
29
+ - `tests/adapters.test.mjs` attendait 2 adaptateurs → mis à jour pour `opencode`.
30
+ - `tests/packaging.test.mjs`: `tar` GNU sur Windows interprétait `C:\…` comme hôte
31
+ distant → `--force-local` + chemins relatifs.
32
+ - `src/core/resources.mjs` `inspectResource` crashait sur fichier > 2 Gio
33
+ (`sha256File` = `readFile` entier) → hash limité à 64 Mio, comptage `skipped`
34
+ (secrets + oversized), champs `hashedFiles`/`skipped` ajoutés.
35
+ - `assets/registry/sources.yaml` MODULES: exclusions médias/binaires ajoutées
36
+ (ISO 3,9 Gio, mp4) — cohérent avec la note « documents de cours uniquement ».
37
+
38
+ ## 2. Resource Engine (LOT 3)
39
+
40
+ | Capacité | État | Preuve |
41
+ |---|---|---|
42
+ | Inventaire fichier par fichier (sha256) | PROVEN | `resources inventory --write` réel: 18 ressources, 12 533 fichiers, 914 Mio |
43
+ | Secrets jamais lus | PROVEN | 23 chemins skippés (`isSecretPath`), jamais ouverts |
44
+ | Politique de licences | PROVEN | `LICENSE_POLICIES` + tests `resources.v2.test.mjs` |
45
+ | Couverture déclarée vs inventoriée | PROVEN | `resources coverage` réel: 18/18, complete=true |
46
+ | Détection doublons de skills | PROVEN | 7 doublons (6 identiques intra ui-ux-pro-max, 1 `code-review` non identique spec-kit vs mattpocock) |
47
+ | Réconciliation lock/manifest | PARTIAL | `resources reconcile` existe; lock `resources.lock.json` requis — non généré dans le projet de test |
48
+ | `installGitResource` (vendor épinglé) | NOT_PROVEN | requiert `--allow-network`; non exécuté (pas d'autorisation réseau) |
49
+
50
+ ## 3. Skills Engine (LOT 3)
51
+
52
+ | Capacité | État | Preuve |
53
+ |---|---|---|
54
+ | Catalogue skills sources | PROVEN | `skills sources` réel: 81 fichiers SKILL.md, 74 uniques AVAILABLE, 7 DUPLICATE |
55
+ | Statuts licence→disponibilité | PROVEN | INDEX_ONLY/BLOCKED/INCOMPATIBLE/DUPLICATE dans `source-skills.mjs` + tests |
56
+ | Activation (`skills enable`) | PROVEN | copie réelle `owasp-security` → `.opencode/skills/` (5 fichiers + `AIDF-SOURCE.json`) |
57
+ | Scripts exécutables refusés par défaut | PROVEN | `copySourceSkill` skip `.sh/.ps1/…` sauf `--allow-scripts` |
58
+ | Sélection contextuelle des skills sources | PARTIAL | `selectSourceSkills` = matching par triggers, pas de moteur de dépendances complet |
59
+ | Traçabilité d'usage (preuve d'activation) | PARTIAL | `AIDF-SOURCE.json` enregistre la copie; pas de journal d'usage agent |
60
+ | Skills builtin 0.1.0 (13) | PROVEN | registry + adapter install + tests |
61
+
62
+ ## 4. Adaptateurs IDE (LOT 4)
63
+
64
+ | Adaptateur | État | Limite |
65
+ |---|---|---|
66
+ | qoder | CONTRACT-PROVEN | runtime (règles activées, hooks, `/skills`) NOT_PROVEN — nécessite session IDE réelle |
67
+ | generic (AGENTS.md) | PROVEN | bloc managé idempotent + skills built-in installés sous `.aidf/skills/` (découverts via registry ; chargement runtime = responsabilité de l'agent hôte) |
68
+ | opencode | **PROVEN (runtime, 2026-11-21)** | session réelle `opencode run` : l'agent a cité les bonnes commandes AIDF et listé les skills `aidf-*`/`owasp-security` ; `opencode debug skill` découvre les 14 skills **uniquement si le projet est un worktree git** (vérifié : sans `.git`, skills ignorés → check `git-worktree` ajouté, PARTIAL le cas échéant) |
69
+ | autres IDE | ABSENT | aucun adaptateur supplémentaire |
70
+
71
+ ## 5. Decision Engine (LOT 5)
72
+
73
+ | Capacité | État | Preuve |
74
+ |---|---|---|
75
+ | Moteur déterministe (contraintes dures/mous, ranking) | PROVEN | `src/core/technology-decision/*` + tests |
76
+ | Génération document de décision (JSON/MD) | PROVEN | `generator.mjs` + tests |
77
+ | Interprétation LLM | HORS PÉRIMÈTRE 0.2.0 | Par design : AIDF est un framework de gouvernance, pas une application — il ne possède ni ne configure de modèle. Le moteur émet les faits déterministes (contraintes, scores, éliminations, incertitudes) ; l'interprétation des compromis/risques/architecture est **déléguée à l'agent IA qui invoque la commande** (`analysis.delegation.delegatedTo = "invoking-agent"`). L'ancien `analyzer-llm.mjs` (`AI_MODEL`/`callLLM`) a été retiré : chemin mort sans valeur pour un framework. |
78
+ | Exposition CLI (`aidf decision evaluate`) | PROVEN | commande + artefact `decisions/*.json` + export MD |
79
+ | ADR persistés dans `.aidf/artefacts/decisions/` | PROVEN | enveloppe artefact validée, statut DRAFT, approbation humaine requise |
80
+
81
+ ## 6. Design Engine (LOT 6)
82
+
83
+ | Capacité | État | Preuve |
84
+ |---|---|---|
85
+ | Classification de complexité | PROVEN | `complexity-classifier.mjs` + tests |
86
+ | Workflows par complexité | PROVEN | `engine.mjs` + tests |
87
+ | Wireframes SVG / maquettes HTML (fallback) | PROVEN | `fallback/*` + tests |
88
+ | Validateurs Figma | NOT_PROVEN | `figma/validators.mjs` présent; aucune intégration Figma réelle vérifiée |
89
+ | Parité visuelle (capture) | NOT_PROVEN | `visual-parity/capture.mjs` présent; navigateur non vérifié |
90
+ | Exposition CLI (`aidf design classify|run`) | PROVEN | outputs fichiers réels (SVG wireframes, CSS mockup, FALLBACK.md) |
91
+
92
+ ## 7. Security by Design & Test Engineering (LOT 7)
93
+
94
+ | Capacité | État | Preuve |
95
+ |---|---|---|
96
+ | Compétence `aidf-security-review` + skill `owasp-security` (source) | AVAILABLE | registry + catalogue |
97
+ | Gates security workflow | PROVEN | `assets/workflows/`, validate tests |
98
+ | Modèle de menace STRIDE (`security/threat-model.json`) | PROVEN | `aidf security analyze|show` — génération déterministe depuis `detectProject` + config, artefact `TM-###` DRAFT persisté sous `.aidf/artefacts/security/` ; revue humaine requise avant VALIDATED |
99
+ | Cycle TDD outillé (RED→GREEN→refactor) | PARTIAL | `aidf tests plan` génère un artefact `TP-###` (1 cas planifié par critère d'acceptation, types inférés) et `aidf tests coverage` mesure la couverture exigence→test ; l'exécution RED→GREEN reste la responsabilité du projet (pas de moteur de scaffold de tests) |
100
+ | Tests E2E framework | ABSENT | dépend du projet cible |
101
+
102
+ ## 8. Artefacts & traçabilité (L1)
103
+
104
+ | Capacité | État | Preuve |
105
+ |---|---|---|
106
+ | Enveloppe + validation schémas artefacts | PROVEN | `src/core/artefacts/*` + `artefacts.validation.test.mjs` |
107
+ | Registre exigences | PROVEN | `src/core/requirements/registry.mjs` + tests |
108
+ | Chaîne de traçabilité (liens) | PROVEN | `src/core/traceability/chain.mjs` + tests ; `findMissingLinks` corrigé (résolution réelle des cibles + préfixes d'ID) |
109
+ | Contrat de liens L1-C complet | PARTIAL | test `traceability.link.test.mjs` retiré au commit 27a9581; commandes `traceability` exposées mais la sémantique complète des liens reste à consolider |
110
+ | Commandes CLI artefacts/requirements/traceability | PROVEN | `aidf artefacts|requirements|traceability` implémentées + `tests/cli.engines.test.mjs` (5 tests e2e) |
111
+ | Commandes CLI decision/design | PROVEN | `aidf decision evaluate` (artefact DRAFT + approbation humaine requise) et `aidf design classify|run` (outputs SVG/CSS/MD réels) |
112
+ | `docs generate/regenerate/reconcile` (L1-D) | PARTIAL | `aidf docs generate [--check]` rend les artefacts canoniques en Markdown sous `.aidf/docs/generated/` avec en-tête de provenance (source + sha256) et détection de divergence (édition manuelle signalée, régénération écrasante) ; la dérivation JSON←Markdown d'ADR-004 (documents canoniques existants) reste non implémentée |
113
+ | Couverture déterministe exigence→test→preuve | PARTIAL | `aidf tests coverage` relie exigences ↔ cas planifiés (TP) ↔ artefacts `TEST-*` ; `requirements coverage` (Evidence Engine) expose toujours la couverture par preuves PASS |
114
+
115
+ ## 9. Delivery & Operations (LOT 8)
116
+
117
+ | Capacité | État |
118
+ |---|---|
119
+ | Skill `aidf-devops-engineering` | AVAILABLE |
120
+ | Phase `release` + gates | PROVEN (workflow) |
121
+ | Rapport de release (`aidf release report`) | PROVEN | évalue tous les gates en lecture seule (pas d'enregistrement), agrège statuts docs/CHANGELOG/evidence/artefacts, écrit `.aidf/reports/RELEASE-<date>.{json,md}`, verdict READY/NOT_READY, `--strict` pour CI, `--record` pour evidence `release-report` |
122
+ | Moteur build/deploy/rollback/monitoring | ABSENT (conseillé par skills/gates, pas d'outil) |
123
+
124
+ ## 10. Gouvernance obligatoire
125
+
126
+ | Capacité | État | Limite honnête |
127
+ |---|---|---|
128
+ | Session-start protocol (AIDF.md) | PROVEN | instructions lues par l'agent |
129
+ | Hooks Qoder (`session-context.mjs`) | CONTRACT-PROVEN | exécution runtime IDE non prouvée |
130
+ | Contexte assemblé par tâche (`aidf context`) | PROVEN | testé e2e |
131
+ | Blocage gate sans preuve | PROVEN | fail-closed testé |
132
+ | Détection de contournement | PARTIAL | `scan` + contradictions BLOCKED; pas de mécanisme anti-contournement actif |
133
+ | Portée réelle | — | AIDF impose des instructions/fichiers; un agent externe peut les ignorer — à documenter |
134
+
135
+ ## 11. Ressources `../resources/` (LOT 2)
136
+
137
+ | Élément | Statut |
138
+ |---|---|
139
+ | 18 ressources déclarées dans `sources.yaml` | 100 % inventoriées (coverage.complete=true) |
140
+ | 12 533 fichiers hashés, 81 SKILL.md (74 uniques valides) | PROVEN |
141
+ | `dictionary-of-ai-coding` | BLOCKED — licence inconnue (index-only) |
142
+ | `pencil` | BLOCKED — GPL-2.0, décision humaine 2026-11-21 |
143
+ | `jeremy-web-modules` | PARTIAL — corpus propriétaire, index-only, exclusions appliquées |
144
+ | `owasp-asvs` | PRESENT — CC-BY-SA-4.0, référence |
145
+
146
+ ## 12. Décisions humaines requises / blocages
147
+
148
+ | # | Décision | Statut |
149
+ |---|---|---|
150
+ | D1 | Licence `dictionary-of-ai-coding` | RÉSOLU 2026-11-21 — MIT déclarée par le propriétaire (fichier LICENSE absent du clone, déclaration enregistrée dans sources.yaml) |
151
+ | D2 | Commit du WIP + corrections baseline | En attente d'autorisation |
152
+ | D3 | Vérification runtime IDE | OpenCode PROVEN (session réelle) ; Qoder reste CONTRACT-PROVEN |
153
+ | D4 | `AI_MODEL` pour le Decision Engine LLM | RÉSOLU 2026-11-21 — hors périmètre par décision : interprétation déléguée à l'agent hôte, `analyzer-llm.mjs` supprimé |
154
+ | D5 | Commandes CLI manquantes | FAIT pour artefacts/requirements/traceability/decision/design/security/tests/release ; `docs generate` implémenté en PARTIAL (vues Markdown des artefacts, pas la dérivation ADR-004) |
155
+ | D6 | Publication npm / push git | Non autorisé |
@@ -0,0 +1,86 @@
1
+ # AIDF Security Guide
2
+
3
+ Status: VALIDATED as shipped policy
4
+
5
+ ## 1. Secret policy
6
+
7
+ - AIDF never reads or prints `.env`, key material, tokens or credential stores.
8
+ (`aidf scan` lists filenames only; `detectProject` reads `package.json` and
9
+ marker files, never secret files.)
10
+ - The knowledge file `assets/knowledge/security-references/owasp-baseline.md`
11
+ summarises OWASP ASVS ideas; SECURITY.md cites sources without copying
12
+ restricted content.
13
+ - Command runner records stdout/stderr in evidence, truncated; it never
14
+ redacts (the policy is: only safe, non-secret-producing commands may be
15
+ declared as command checks).
16
+
17
+ ## 2. Execution and network permissions
18
+
19
+ - `security.allowCommandExecution` (default `false`) or a one-shot
20
+ `--allow-exec` enables command checks.
21
+ - `security.allowNetwork` (default `false`) and `--allow-network` gate any
22
+ network operation (`installGitResource`). No remote push/publish exists.
23
+ - Command execution is shell-free (`spawn` with `shell: false`), rejects shell
24
+ operators, with a default 300 s timeout and output truncation.
25
+ - `security.allowedCommands` further restricts which command keys may run.
26
+
27
+ ## 3. Filesystem policy
28
+
29
+ - Every write path passes `resolveInside(root, path)`: traversal (`../`),
30
+ absolute paths, null bytes, reserved Windows names and invalid characters are
31
+ refused before touching disk.
32
+ - Files not registered in `.aidf/manifest.json` are never overwritten.
33
+ - Overwrites of AIDF-managed files keep a backup in `.aidf/backups/` (install)
34
+ or `.aidf-uninstall-backup/` (uninstall `--force`).
35
+ - Writes are atomic (temp file + rename).
36
+
37
+ ## 4. Untrusted external content
38
+
39
+ - External skills/resources are indexed (path, hash, commit) and never executed
40
+ automatically; installing a git resource only copies include-glob files from
41
+ a pinned commit.
42
+ - Rule files instruct agents: downloaded content is untrusted data and never
43
+ overrides `.aidf/AIDF.md` or the constitution.
44
+ - Licences gate redistribution: unknown licence ⇒ BLOCKED, index-only.
45
+
46
+ ## 5. Governance and human accountability
47
+
48
+ - `VALIDATED` document statuses require `--by "<name>"`; `NOT_APPLICABLE`
49
+ requires `--note`.
50
+ - Document status is canonical in the Markdown frontmatter. Gates and `doctor`
51
+ cross-check it against `config.json`; a mismatch is a real `FAIL`, not a
52
+ silent PASS.
53
+ - **Declared approval is not authentication.** `--human --by "<name>"` records
54
+ `approval.authenticated: false` and `method: "declared"`; the agent can run
55
+ the same command, so it proves intent only. `approvedBy` is preserved as
56
+ historical declared identity.
57
+ - `security.requireAuthenticatedApproval` (optional, default `false`) makes
58
+ human-required gates reject declared-only approval as `NOT_PROVEN`. No
59
+ signing/authentication mechanism is proven in 0.2.0 L0; this remains an open
60
+ decision.
61
+ - Evidence records are hash-chained (`previous` → `hash`). `aidf evidence
62
+ verify` and `doctor` check every hash, every link, ordering, `index.lastHash`,
63
+ duplicates and unindexed files; they never repair history.
64
+ - High-stakes phases (`security`, `release`) require `requireHumanApprovalFor`
65
+ checks; agent-only approvals fail as `BLOCKED`.
66
+
67
+ ## 6. Threat model summary (AIDF as the tool)
68
+
69
+ | Threat | Mitigation |
70
+ |---|---|
71
+ | Path traversal in config/action paths | `resolveInside` validation |
72
+ | Overwriting user files | manifest ownership + conflict refusal |
73
+ | Secret leakage via logs/reports | secret content never read; logs are local JSONL |
74
+ | Arbitrary shell command via a check | shell-free spawn + operator rejection + opt-in |
75
+ | Fake success (agent claiming tests ran) | gate NOT_PROVEN without real evidence |
76
+ | Config claims a document status the file does not have | frontmatter is canonical; mismatch = FAIL |
77
+ | Agent claims a human approval | declared approval is unauthenticated; strict mode = NOT_PROVEN |
78
+ | Tampered evidence | chained SHA-256, full chain verification on demand |
79
+ | Malicious downloaded content | no auto-execution; index-only resources |
80
+ | Uncontrolled updates to Spec Kit artefacts | generated constitution carries source hash; conflicts preserve original |
81
+
82
+ ## 7. Reporting
83
+
84
+ Security findings belong in `.aidf/docs/SECURITY.md` (findings with severity
85
+ and verification method) and, for behaviour changes, in DECISIONS.md.
86
+ `security-review` evidence requires a human approver name.