@noyrax/documentation-system-plugin 1.0.4-beta.2 → 1.0.4-beta.4

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 (140) hide show
  1. package/out/cli/generate-cli.js +11 -0
  2. package/out/cli/generate-cli.js.map +1 -1
  3. package/out/cli/scan-cli.js +6 -0
  4. package/out/cli/scan-cli.js.map +1 -1
  5. package/out/core/scanner.js +1 -0
  6. package/out/core/scanner.js.map +1 -1
  7. package/out/generator/system-metadata.js +202 -0
  8. package/out/generator/system-metadata.js.map +1 -0
  9. package/out/index/index.js +14 -0
  10. package/out/index/index.js.map +1 -1
  11. package/out/parsers/ts-js.js +208 -7
  12. package/out/parsers/ts-js.js.map +1 -1
  13. package/package.json +9 -2
  14. package/.vscodeignore +0 -41
  15. package/MCP_SERVER_SETUP.md +0 -371
  16. package/assets/icon.svg +0 -27
  17. package/docs/LINKEDIN_ANTWORT_SEQUENZDIAGRAMME.md +0 -190
  18. package/docs/SEQUENZDIAGRAMM_BEWEIS.md +0 -469
  19. package/docs/SEQUENZDIAGRAMM_VALIDATE_FLOW.md +0 -282
  20. package/docs/adr/001-signatur-abweichung-fix.md +0 -54
  21. package/docs/adr/002-file-specific-validation-1.0.1.md +0 -45
  22. package/docs/adr/003-documentation-generation-bugs.md +0 -134
  23. package/docs/adr/004-validator-signature-matching-fix.md +0 -121
  24. package/docs/adr/005-validator-generic-simplification-tightening.md +0 -35
  25. package/docs/adr/006-parser-variable-type-extraction.md +0 -33
  26. package/docs/adr/007-ts-parser-load-libs-for-accurate-types.md +0 -31
  27. package/docs/adr/008-dependencies-cache-phase1.md +0 -133
  28. package/docs/adr/009-consolidation-union-logic-phase1-2.md +0 -147
  29. package/docs/adr/010-extension-union-integration-phase1-3-and-phase2.md +0 -179
  30. package/docs/adr/011-module-doc-change-tracking-phase3.md +0 -190
  31. package/docs/adr/012-git-deletions-change-report-phase4.md +0 -235
  32. package/docs/adr/013-system-functionality-fixes.md +0 -279
  33. package/docs/adr/014-rules-migration-und-mcp-integration.md +0 -113
  34. package/docs/adr/015-global-agent-package.md +0 -158
  35. package/docs/adr/016-produktisierung-docguard.md +0 -193
  36. package/docs/adr/017-signature-matching-optional-fields.md +0 -128
  37. package/docs/adr/018-rebranding-docguard-to-noyrax.md +0 -109
  38. package/docs/adr/019-system-schwachstellen-analyse-und-fixes.md +0 -204
  39. package/docs/adr/020-api-doc-tiefe-und-signatureformatter.md +0 -74
  40. package/docs/adr/021-semantic-api-docs-and-symbol-classifier.md +0 -125
  41. package/docs/adr/022-semantic-class-and-constants-rendering.md +0 -82
  42. package/docs/adr/023-adr-verknuepfung-modul-doku.md +0 -54
  43. package/docs/adr/024-cursor-rules-mehrdimensionaler-raum.md +0 -230
  44. package/docs/adr/025-mcp-tools-scan-validate-cli-bridge.md +0 -202
  45. package/docs/adr/026-reality-driven-development-system.md +0 -173
  46. package/docs/adr/027-scanner-excludes-and-union-logic-fix.md +0 -189
  47. package/docs/adr/028-src-coverage-union-resync.md +0 -124
  48. package/docs/adr/029-parser-flow-kopplung-und-sync-drift-modi.md +0 -102
  49. package/docs/adr/030-dependency-import-symbol-names-preservation.md +0 -123
  50. package/docs/adr/031-generate-cli-vollstaendige-dokumentation.md +0 -99
  51. package/docs/adr/032-windows-optimized-verification-scripts.md +0 -165
  52. package/docs/adr/036-enhanced-dependency-metadata.md +0 -190
  53. package/docs/adr/TEMPLATE.md +0 -76
  54. package/docs/index/symbols.jsonl +0 -40
  55. package/docs/modules/action__action.yml.md +0 -50
  56. package/docs/modules/documentation.config.schema.json.md +0 -37
  57. package/docs/modules/mcp__package.json.md +0 -130
  58. package/docs/modules/mcp__src__resources__docs.ts.md +0 -94
  59. package/docs/modules/mcp__src__server.ts.md +0 -15
  60. package/docs/modules/mcp__src__tools__drift.ts.md +0 -110
  61. package/docs/modules/mcp__src__tools__impact.ts.md +0 -127
  62. package/docs/modules/mcp__src__tools__scan.ts.md +0 -75
  63. package/docs/modules/mcp__src__tools__validate.ts.md +0 -116
  64. package/docs/modules/mcp__src__tools__verify-adrs.ts.md +0 -106
  65. package/docs/modules/mcp__tsconfig.json.md +0 -22
  66. package/docs/modules/package.json.md +0 -131
  67. package/docs/modules/packages__doc-system-agent__examples__basic-project__package.json.md +0 -43
  68. package/docs/modules/packages__doc-system-agent__examples__basic-project__src__calculator.ts.md +0 -81
  69. package/docs/modules/packages__doc-system-agent__package.json.md +0 -154
  70. package/docs/modules/packages__doc-system-agent__src__cli__index.ts.md +0 -8
  71. package/docs/modules/packages__doc-system-agent__src__cli__init.ts.md +0 -93
  72. package/docs/modules/packages__doc-system-agent__src__cli__update.ts.md +0 -113
  73. package/docs/modules/packages__doc-system-agent__src__constants.ts.md +0 -29
  74. package/docs/modules/packages__doc-system-agent__src__index.ts.md +0 -234
  75. package/docs/modules/packages__doc-system-agent__src__mcp__resources__docs.ts.md +0 -94
  76. package/docs/modules/packages__doc-system-agent__src__mcp__server.ts.md +0 -17
  77. package/docs/modules/packages__doc-system-agent__src__mcp__tools__drift.ts.md +0 -38
  78. package/docs/modules/packages__doc-system-agent__src__mcp__tools__impact.ts.md +0 -75
  79. package/docs/modules/packages__doc-system-agent__src__mcp__tools__scan.ts.md +0 -23
  80. package/docs/modules/packages__doc-system-agent__src__mcp__tools__validate.ts.md +0 -23
  81. package/docs/modules/packages__doc-system-agent__src__mcp__tools__verify-adrs.ts.md +0 -106
  82. package/docs/modules/packages__doc-system-agent__src__mcp__types.ts.md +0 -355
  83. package/docs/modules/packages__doc-system-agent__tsconfig.json.md +0 -22
  84. package/docs/modules/scripts__verify-adrs.js.md +0 -97
  85. package/docs/modules/scripts__verify-architecture.js.md +0 -93
  86. package/docs/modules/scripts__verify-imports.js.md +0 -114
  87. package/docs/modules/src____tests____setup.ts.md +0 -8
  88. package/docs/modules/src____tests____signature-formatter.test.ts.md +0 -16
  89. package/docs/modules/src____tests____snapshot-doc-generation.test.ts.md +0 -8
  90. package/docs/modules/src____tests____symbol-classifier.test.ts.md +0 -16
  91. package/docs/modules/src__cache__ast-cache.ts.md +0 -91
  92. package/docs/modules/src__cache__dependencies-cache.ts.md +0 -89
  93. package/docs/modules/src__cache__output-cache.ts.md +0 -91
  94. package/docs/modules/src__cache__signature-cache.ts.md +0 -76
  95. package/docs/modules/src__cli__generate-cli.ts.md +0 -130
  96. package/docs/modules/src__cli__scan-cli.ts.md +0 -99
  97. package/docs/modules/src__cli__validate-cli.ts.md +0 -144
  98. package/docs/modules/src__core__async.ts.md +0 -18
  99. package/docs/modules/src__core__consolidation.ts.md +0 -157
  100. package/docs/modules/src__core__git.ts.md +0 -35
  101. package/docs/modules/src__core__language-detection.ts.md +0 -31
  102. package/docs/modules/src__core__scanner.ts.md +0 -101
  103. package/docs/modules/src__core__signature-formatter.ts.md +0 -232
  104. package/docs/modules/src__core__symbol-classifier.ts.md +0 -178
  105. package/docs/modules/src__core__symbols.ts.md +0 -31
  106. package/docs/modules/src__drift__index.ts.md +0 -53
  107. package/docs/modules/src__extension.ts.md +0 -418
  108. package/docs/modules/src__generator__adr-linker.ts.md +0 -154
  109. package/docs/modules/src__generator__change-report.ts.md +0 -85
  110. package/docs/modules/src__generator__dependency-graph.ts.md +0 -63
  111. package/docs/modules/src__generator__index.ts.md +0 -40
  112. package/docs/modules/src__generator__module-doc.ts.md +0 -242
  113. package/docs/modules/src__index__index.ts.md +0 -141
  114. package/docs/modules/src__logging__index.ts.md +0 -87
  115. package/docs/modules/src__parsers__dependencies.ts.md +0 -69
  116. package/docs/modules/src__parsers__json-yaml.ts.md +0 -97
  117. package/docs/modules/src__parsers__python.ts.md +0 -73
  118. package/docs/modules/src__parsers__ts-js.ts.md +0 -48
  119. package/docs/modules/src__parsers__types.ts.md +0 -99
  120. package/docs/modules/src__ui__commands-provider.ts.md +0 -70
  121. package/docs/modules/src__ui__status-bar.ts.md +0 -79
  122. package/docs/modules/src__validator__index.ts.md +0 -211
  123. package/docs/modules/src__validator__signature-matching.ts.md +0 -209
  124. package/docs/modules/src__validator__status.ts.md +0 -72
  125. package/docs/modules/test-mcp-resources.js.md +0 -27
  126. package/docs/modules/tsconfig.json.md +0 -22
  127. package/docs/system/CHANGE_REPORT.md +0 -29
  128. package/docs/system/DEPENDENCIES.md +0 -403
  129. package/docs/system/DEPENDENCY_GRAPH.md +0 -336
  130. package/docs/system/NAVIGATION_SPACE_ANALYSIS.md +0 -244
  131. package/docs/system/NPX_CACHE_FIX.md +0 -85
  132. package/docs/system/NPX_LOCAL_USAGE.md +0 -66
  133. package/docs/system/PLUGIN_ECOSYSTEM_STATUS.md +0 -465
  134. package/docs/system/PLUGIN_UPDATE_GUIDE.md +0 -212
  135. package/docs/system/RULES_UPDATE_GUIDE.md +0 -182
  136. package/docs/system/SYSTEM_ANALYSIS.md +0 -947
  137. package/documentation.config.schema.json +0 -77
  138. package/noyrax-5d-database-plugin-0.1.8.tgz +0 -0
  139. package/noyrax-documentation-system-plugin-1.0.4-beta.2.tgz +0 -0
  140. package/publish.ps1 +0 -21
@@ -1,279 +0,0 @@
1
- # ADR 013: System-Funktionalitäts-Fixes (Generate-Twice, Drift-Validierung, Optionale Felder)
2
-
3
- **Status:** Implementiert
4
- **Datum:** 2025-10-06
5
- **Kontext:** System-Funktionalitäts-Analyse und Fixes (system.plan.md)
6
-
7
- ## Kontext und Problemstellung
8
-
9
- Nach Implementierung der additiven Dokumentations-Generierung (ADR 008-012) wurden drei kritische Probleme identifiziert:
10
-
11
- 1. **"Generate twice" Problem:** Beim ersten Lauf werden nicht alle Dateien erkannt, es muss zweimal `generate` ausgeführt werden
12
- 2. **Drift-Erkennung nicht sichtbar:** Drift wird erkannt, aber nicht in der Validierungs-UI angezeigt
13
- 3. **Signatur-Validierung zu strikt:** Optionale Felder (`?`) werden als Inkompatibilität erkannt
14
-
15
- **Bisheriger Ablauf:**
16
- 1. Beim ersten Lauf: AST-Cache ist leer, aber Git-Filter und komplexe Fallback-Logik führen dazu, dass nicht alle Dateien geparst werden
17
- 2. Drift wird in `generateDocumentationTs` erkannt, aber nur als Warnung angezeigt, nicht in Validierung integriert
18
- 3. Signatur-Validierung vergleicht Signaturen exakt, erkennt aber nicht, dass `symbols: string[]` und `symbols?: string[]` kompatibel sind
19
-
20
- **Gewünschter Ablauf:**
21
- 1. Beim ersten Lauf: IMMER Vollscan, keine Git-Filter, alle Dateien parsen
22
- 2. Drift-Erkennung in Validierung integrieren: Drift-Warnungen zu Validierungs-Warnungen hinzufügen, Status auf "gelb" setzen
23
- 3. Signatur-Validierung erkennt optionale Felder als kompatibel
24
-
25
- ## Entscheidung
26
-
27
- ### Fix 1: "Generate twice" Problem beheben
28
-
29
- **Datei:** `src/extension.ts` (generateDocumentationTs)
30
-
31
- **Änderungen:**
32
- 1. **AST-Cache-Check vor Git-Filter:**
33
- - Prüfe `isFirstRun` ZUERST
34
- - Beim ersten Lauf: IMMER Vollscan, kein Git-Filter
35
- - Git-Filter nur bei nachfolgenden Läufen
36
-
37
- 2. **Parse-Logik vereinfachen:**
38
- - Beim ersten Lauf: IMMER parsen (kein AST-Cache-Check)
39
- - Bei nachfolgenden Läufen: AST-Cache-Check für unveränderte Dateien
40
-
41
- 3. **Fallback-Logik entfernen:**
42
- - Komplexe Fallbacks (Zeilen 199-268) entfernt
43
- - Nur noch Warnung bei Problemen beim ersten Lauf
44
-
45
- **Code-Änderungen:**
46
- ```typescript
47
- // Zeilen 120-150: Vereinfachte Logik
48
- const isFirstRun = !prevAst || prevAst.entries.length === 0;
49
-
50
- // BEIM ERSTEN LAUF: IMMER VOLLSCAN, KEIN GIT-FILTER
51
- if (isFirstRun) {
52
- globalOutput.appendLine(`[cache] Erster Lauf erkannt, verwende Vollscan (${scannedAll.length} Dateien)`);
53
- scanned = scannedAll;
54
- } else if (useGit) {
55
- // ... Git-Filter-Logik
56
- }
57
-
58
- // Zeilen 159-194: Parse-Logik
59
- // BEIM ERSTEN LAUF: IMMER PARSEN
60
- if (!isFirstRun) {
61
- const unchanged = astMap.get(f.repositoryRelativePath) === fileHash;
62
- if (unchanged) {
63
- // Überspringen
64
- }
65
- }
66
- ```
67
-
68
- ### Fix 2: Drift-Erkennung in Validierung integrieren
69
-
70
- **Datei:** `src/extension.ts` (validateDocumentationTs)
71
-
72
- **Änderungen:**
73
- 1. **Drift-Erkennung hinzufügen:**
74
- - Signatur-Cache laden
75
- - Aktuelle Cache-Entries berechnen
76
- - Drift erkennen via `detectDrift()`
77
-
78
- 2. **Drift-Warnungen integrieren:**
79
- - Drift-Warnungen zu Validierungs-Warnungen hinzufügen
80
- - Status-Report aktualisieren (Drift erhöht `signatureMismatches`)
81
-
82
- 3. **UI-Integration:**
83
- - Drift-Details werden in Validierungs-UI angezeigt
84
- - Status wird auf "gelb" gesetzt, wenn Drift erkannt wird
85
-
86
- **Code-Änderungen:**
87
- ```typescript
88
- // Drift-Erkennung: Signatur-Cache mit aktuellen Symbolen vergleichen
89
- const currentEntries = computeCacheEntries(allSymbols);
90
- const drift = detectDrift(prev, currentEntries);
91
-
92
- // Drift-Warnungen zu Validierungs-Warnungen hinzufügen
93
- const driftWarnings: string[] = [];
94
- if (drift.staleSymbols.length > 0) {
95
- driftWarnings.push(`Drift erkannt: ${drift.staleSymbols.length} Symbole mit geänderter Signatur`);
96
- drift.staleSymbols.slice(0, 10).forEach(id => {
97
- driftWarnings.push(` - Signatur-Abweichung: ${id}`);
98
- });
99
- }
100
-
101
- // Status-Klassifizierung (inkl. Drift)
102
- const totalSignatureMismatches = signatureMismatches + drift.staleSymbols.length;
103
- const statusReport = computeValidationStatus(
104
- [...mdReport.errors, ...coverage.errors],
105
- [...mdReport.warnings, ...driftWarnings],
106
- coverage.errors,
107
- totalSignatureMismatches,
108
- mdReport.errors
109
- );
110
- ```
111
-
112
- ### Fix 3: Signatur-Validierung für optionale Felder
113
-
114
- **Datei:** `src/validator/signature-matching.ts`
115
-
116
- **Änderungen:**
117
- 1. **Formatierung erweitern:**
118
- - `formatSignatureForDoc` berücksichtigt jetzt `p.optional` bei Interfaces und Funktionen
119
- - Optionale Felder werden als `field?: type` formatiert
120
-
121
- 2. **Kompatibilitätsprüfung:**
122
- - Neue Funktion `isOptionalFieldCompatible()` prüft, ob Signaturen nur durch optionale Felder unterschiedlich sind
123
- - `symbols: string[]` und `symbols?: string[]` werden als kompatibel erkannt
124
-
125
- **Code-Änderungen:**
126
- ```typescript
127
- // formatSignatureForDoc: Optionale Felder berücksichtigen
128
- case 'interface':
129
- const props = symbol.signature.parameters.map(p =>
130
- ` ${p.name}${p.optional ? '?' : ''}${p.type ? `: ${p.type}` : ''};`
131
- ).join('\n');
132
-
133
- // Neue Funktion: isOptionalFieldCompatible
134
- function isOptionalFieldCompatible(expected: string, documented: string): boolean {
135
- // Entferne optionale Felder und vergleiche
136
- const removeOptional = (s: string) => s.replace(/(\w+)\?(\s*:)/g, '$1$2');
137
- const expectedWithoutOptional = removeOptional(expected);
138
- const documentedWithoutOptional = removeOptional(documented);
139
-
140
- if (expectedWithoutOptional === documentedWithoutOptional) {
141
- return true; // Nur optionale Felder unterschiedlich → kompatibel
142
- }
143
- return false;
144
- }
145
-
146
- // In validateSignatureMatching:
147
- if (expectedSig !== documentedSig &&
148
- !isArchitecturallyValid(expectedSig, documentedSig) &&
149
- !isOptionalFieldCompatible(expectedSig, documentedSig)) {
150
- // Mismatch
151
- }
152
- ```
153
-
154
- ## Gelesene Abhängigkeiten aus Dokumentation
155
-
156
- **docs/modules/src__extension.ts.md:**
157
- - `generateDocumentationTs()` - Hauptfunktion für Generierung
158
- - `validateDocumentationTs()` - Validierungsfunktion
159
-
160
- **docs/modules/src__drift__index.ts.md:**
161
- - `detectDrift(previous, current): DriftResult` - Drift-Erkennung
162
- - `computeCacheEntries(symbols): CacheEntry[]` - Cache-Entries berechnen
163
-
164
- **docs/modules/src__validator__signature-matching.ts.md:**
165
- - `validateSignatureMatching(symbols, modulesDir): SignatureMismatch[]` - Signatur-Validierung
166
- - `formatSignatureForDoc(symbol): string` - Signatur-Formatierung
167
-
168
- **docs/modules/src__parsers__types.ts.md:**
169
- - `interface SymbolParameter { optional?: boolean; ... }` - Optionale Felder in Parametern
170
-
171
- ## Auswirkungen
172
-
173
- ### Positiv
174
- - ✅ **"Generate twice" Problem behoben:** Beim ersten Lauf werden jetzt alle Dateien korrekt erkannt
175
- - ✅ **Drift-Erkennung sichtbar:** Drift wird in Validierungs-UI angezeigt, Status wird auf "gelb" gesetzt
176
- - ✅ **Signatur-Validierung verbessert:** Optionale Felder werden als kompatibel erkannt
177
- - ✅ **Vereinfachte Logik:** Komplexe Fallbacks entfernt, Code ist wartbarer
178
- - ✅ **Besseres Logging:** Klarere Log-Meldungen für Debugging
179
-
180
- ### Neutral
181
- - ~50 Zeilen Code geändert in `src/extension.ts`
182
- - ~30 Zeilen Code geändert in `src/validator/signature-matching.ts`
183
- - Neue Funktion `isOptionalFieldCompatible()` (~25 Zeilen)
184
-
185
- ### Trade-offs
186
-
187
- - **Vereinfachte Fallback-Logik:**
188
- - Komplexe Fallbacks entfernt (könnten in Edge-Cases nützlich sein)
189
- - **Mitigation:** Logik oben ist robuster; Fallbacks waren Workaround für fehlerhafte Hauptlogik
190
- - **Zukünftige Verbesserung:** Bei Problemen können Fallbacks wieder hinzugefügt werden (mit besserem Logging)
191
-
192
- - **Drift-Erkennung in Validierung:**
193
- - Drift wird jetzt doppelt erkannt (in generate und validate)
194
- - **Mitigation:** Konsistent; beide Stellen nutzen gleiche Cache-Daten
195
- - **Zukünftige Verbesserung:** Drift-Erkennung könnte zentralisiert werden
196
-
197
- - **Optionale Felder-Kompatibilität:**
198
- - Regex-basierte Normalisierung könnte Edge-Cases übersehen
199
- - **Mitigation:** Einfache Fälle (nur `?` Unterschied) werden korrekt erkannt
200
- - **Zukünftige Verbesserung:** Vollständige TypeScript-Typ-Kompatibilitätsprüfung
201
-
202
- ## Risiken und Mitigation
203
-
204
- - **Risiko:** Beim ersten Lauf werden immer noch nicht alle Dateien erkannt
205
- - **Mitigation:** Logik ist vereinfacht und explizit; `isFirstRun` wird ZUERST geprüft
206
- - **Test:** Manueller Test: Cache löschen, Generate einmal ausführen, prüfen ob alle Dateien erkannt werden
207
-
208
- - **Risiko:** Drift-Erkennung zeigt falsche Ergebnisse
209
- - **Mitigation:** Nutzt gleiche Cache-Daten wie in `generateDocumentationTs`
210
- - **Test:** Code-Signatur ändern, Generate + Validate ausführen, prüfen ob Drift angezeigt wird
211
-
212
- - **Risiko:** Optionale Felder-Kompatibilität erkennt nicht alle Fälle
213
- - **Mitigation:** Einfache Regex-Normalisierung für häufige Fälle
214
- - **Test:** Interfaces mit optionalen Feldern testen, prüfen ob keine falschen Mismatches erkannt werden
215
-
216
- ## Design-Entscheidungen
217
-
218
- ### Alternative 1: Fallback-Logik behalten, aber verbessern
219
- - **Verworfen:** Fallbacks waren Workaround für fehlerhafte Hauptlogik
220
- - **Gewählt:** Hauptlogik korrigieren, Fallbacks entfernen
221
-
222
- ### Alternative 2: Drift-Erkennung nur in generate, nicht in validate
223
- - **Verworfen:** Drift sollte in Validierung sichtbar sein
224
- - **Gewählt:** Drift-Erkennung in beide Funktionen integrieren (konsistent)
225
-
226
- ### Alternative 3: Vollständige TypeScript-Typ-Kompatibilitätsprüfung
227
- - **Verworfen:** Zu komplex für MVP; würde TypeScript-Compiler erfordern
228
- - **Gewählt:** Einfache Regex-basierte Normalisierung für häufige Fälle (optionale Felder)
229
-
230
- ### Alternative 4: Optionale Felder in formatSignatureForDoc ignorieren
231
- - **Verworfen:** Optionale Felder sind Teil der Signatur und sollten dokumentiert werden
232
- - **Gewählt:** Optionale Felder formatieren und als kompatibel erkennen
233
-
234
- ## Nächste Schritte
235
-
236
- 1. ✅ **Fix 1 abgeschlossen:** "Generate twice" Problem behoben
237
- 2. ✅ **Fix 2 abgeschlossen:** Drift-Erkennung in Validierung integriert
238
- 3. ✅ **Fix 3 abgeschlossen:** Signatur-Validierung für optionale Felder verbessert
239
- 4. ⏭️ **Manuelle Tests:** Alle drei Fixes manuell testen
240
- 5. ⏭️ **README aktualisiert:** Fixes dokumentiert
241
-
242
- ## Referenzen
243
-
244
- - **Plan:** `system.plan.md` (System-Funktionalitäts-Analyse und Fixes)
245
- - **ADR 011:** Modul-Dokumente mit Änderungs-Kommentaren (Phase 3)
246
- - **ADR 012:** Git-Deletions und CHANGE_REPORT (Phase 4)
247
- - **Dokumentation:**
248
- - `docs/modules/src__extension.ts.md`
249
- - `docs/modules/src__drift__index.ts.md`
250
- - `docs/modules/src__validator__signature-matching.ts.md`
251
- - `docs/modules/src__parsers__types.ts.md`
252
-
253
- ## Implementierung
254
-
255
- **Dateien:**
256
- - `src/extension.ts` (geändert, ~50 Zeilen)
257
- - `generateDocumentationTs()`: Vereinfachte Logik für ersten Lauf
258
- - `validateDocumentationTs()`: Drift-Erkennung integriert
259
- - `src/validator/signature-matching.ts` (geändert, ~30 Zeilen)
260
- - `formatSignatureForDoc()`: Optionale Felder berücksichtigen
261
- - `isOptionalFieldCompatible()`: Neue Funktion für Kompatibilitätsprüfung
262
- - `README.md` (aktualisiert): Fixes dokumentiert
263
-
264
- **Geänderte Zeilen:** ~80 Zeilen
265
- **Neue Funktionen:** 1 (`isOptionalFieldCompatible`)
266
- **Entfernte Funktionen:** Komplexe Fallback-Logik (Zeilen 199-268)
267
-
268
- **Qualität:**
269
- - ✅ TypeScript kompiliert ohne Fehler
270
- - ✅ Rückwärtskompatibel (keine Breaking Changes)
271
- - ✅ Deterministisch (gleiche Eingabe → gleiche Ausgabe)
272
- - ✅ Keine zirkulären Abhängigkeiten
273
- - ✅ Besseres Logging für Debugging
274
-
275
- **Erwartete Verbesserungen:**
276
- - Beim ersten Lauf werden alle Dateien erkannt (kein "generate twice" mehr)
277
- - Drift wird in Validierungs-UI angezeigt (Status gelb bei Drift)
278
- - Optionale Felder werden als kompatibel erkannt (weniger falsche Mismatches)
279
-
@@ -1,113 +0,0 @@
1
- # ADR-014: Rules-Migration und MCP-Integration
2
-
3
- ## Status
4
-
5
- Accepted
6
-
7
- ## Kontext
8
-
9
- Das Projekt nutzte bisher zwei Always-Apply Rules (`mvp-plan.mdc` und `architecture-guardrails.mdc`), die:
10
- - Fest auf `MVP_PLAN.md` und `ADDITIVE_DOCUMENTATION_PLAN.md` verwiesen
11
- - Keine kontextspezifische Aktivierung unterstützten
12
- - Keine Agent-Requested Workflows definierten
13
- - Keine Memory-Guidelines enthielten
14
-
15
- Mit Abschluss des MVP war eine Neustrukturierung erforderlich, um:
16
- 1. Veraltete MVP-Referenzen zu entfernen
17
- 2. Kontextsensitive Rules (Auto-Attached) einzuführen
18
- 3. Agent-Requested Workflows für explizite Anfragen zu definieren
19
- 4. Dynamische Plan-Erkennung zu implementieren
20
- 5. MCP-Server für strukturierte Tool-Integration vorzubereiten
21
-
22
- ## Entscheidung
23
-
24
- ### 1. Neue Rule-Struktur
25
-
26
- ```
27
- .cursor/rules/
28
- ├── 000-orchestrator.mdc # Always – Zentrale Steuerung
29
- ├── 001-pre-check.mdc # Always – Pflichtschritte vor Änderungen
30
- ├── 010-parsers.mdc # Auto-Attached: src/parsers/**
31
- ├── 011-validators.mdc # Auto-Attached: src/validator/**
32
- ├── 012-cache.mdc # Auto-Attached: src/cache/**
33
- ├── 013-generator.mdc # Auto-Attached: src/generator/**
34
- ├── 020-validate-workflow.mdc # Agent-Requested: "validiere", "prüfe"
35
- ├── 021-impact-analysis.mdc # Agent-Requested: "Auswirkungen", "Dependencies"
36
- ├── 022-adr-workflow.mdc # Agent-Requested: "ADR schreiben"
37
- └── 030-constraints.mdc # Always – Architektur-Constraints
38
- ```
39
-
40
- ### 2. Dynamische Plan-Erkennung
41
-
42
- Statt fest auf `MVP_PLAN.md` zu verweisen:
43
- - Suche nach `*.plan.md` im Projekt-Root
44
- - Priorisierung: Spezifische Pläne vor allgemeinen
45
- - Fallback auf Standard-Constraints bei fehlendem Plan
46
- - Plan-Abweichungen müssen als ADR dokumentiert werden
47
-
48
- ### 3. MCP-Server für Validierungs-Tools
49
-
50
- Neuer MCP-Server in `mcp/` mit:
51
- - `validation/runScan` – Dokumentations-Scan
52
- - `validation/runValidate` – Validierung
53
- - `validation/runDriftCheck` – Drift-Detection
54
- - `validation/analyzeImpact` – Impact-Analyse
55
-
56
- Vorteile:
57
- - Strukturierte JSON-Responses statt Freitext
58
- - Teilvalidierung einzelner Dateien
59
- - Bessere Integration mit Agent-Workflows
60
-
61
- ### 4. Memory-Guidelines
62
-
63
- In `000-orchestrator.mdc` definiert:
64
- - **Speichern**: ADR-Entscheidungen, Arbeitsmuster, Konventionen
65
- - **Nicht speichern**: Temporäre Fehler, experimentelle Ideen
66
- - **Widerspruchs-Handling**: Bei Repo-Widerspruch Memory prüfen/löschen
67
-
68
- ## Konsequenzen
69
-
70
- ### Positive
71
-
72
- - **Reduzierter Token-Verbrauch**: Auto-Attached Rules laden nur bei Bedarf
73
- - **Klarere Struktur**: Trennung von Always/Auto-Attached/Agent-Requested
74
- - **Flexibilität**: Dynamische Plan-Erkennung statt statischer Referenzen
75
- - **Bessere Tool-Integration**: MCP-Server für strukturierte Validierung
76
- - **Persistentes Lernen**: Memory-Guidelines für konsistentes Verhalten
77
-
78
- ### Negative
79
-
80
- - **Initiale Komplexität**: Mehr Rule-Dateien zu pflegen
81
- - **MCP-Server-Wartung**: Zusätzlicher Code in `mcp/`
82
- - **Migration**: Alte Rules müssen entfernt/archiviert werden
83
-
84
- ## Alternativen
85
-
86
- ### Alternative A: Bestehende Rules beibehalten
87
-
88
- Abgelehnt, weil:
89
- - Veraltete MVP-Referenzen verwirrend
90
- - Keine kontextsensitive Aktivierung
91
- - Keine Agent-Requested Workflows
92
-
93
- ### Alternative B: Nur Always-Apply Rules
94
-
95
- Abgelehnt, weil:
96
- - Höherer Token-Verbrauch
97
- - Keine modul-spezifischen Leitplanken
98
- - Keine expliziten Workflow-Trigger
99
-
100
- ### Alternative C: MCP-Server in separatem Repo
101
-
102
- Abgelehnt, weil:
103
- - Engere Integration mit Projekt-Tooling gewünscht
104
- - Einfachere Wartung im selben Repo
105
- - Direkter Zugriff auf `docs/` und CLI-Kommandos
106
-
107
- ## Referenzen
108
-
109
- - `000-orchestrator.mdc` – Zentrale Workflow-Steuerung
110
- - `001-pre-check.mdc` – Pre-Check Checkliste
111
- - `020-validate-workflow.mdc` – MCP-Server Integration
112
- - `mcp/README.md` – MCP-Server Dokumentation
113
-
@@ -1,158 +0,0 @@
1
- # ADR-015: Globales Agent-Package @benni/doc-system-agent
2
-
3
- ## Status
4
-
5
- Accepted
6
-
7
- ## Kontext
8
-
9
- Das Projekt hat eine funktionierende Dokumentations-Engine (VS Code Extension) und
10
- einen MCP-Server für strukturierte Validierung entwickelt. Zusätzlich wurden
11
- `.cursor/rules/` für AI-Agent-Workflows erstellt.
12
-
13
- Diese Komponenten waren bisher nur in diesem einen Repo verfügbar. Um dieselbe
14
- Arbeitsweise in neuen Projekten nutzen zu können, war eine Lösung erforderlich,
15
- die:
16
-
17
- 1. Die Rules und den MCP-Server portabel macht
18
- 2. Einfache Installation in neuen Projekten ermöglicht
19
- 3. Versionierung und Updates unterstützt
20
- 4. Sowohl mit Cursor (AI-Agent) als auch VS Code (Extension) funktioniert
21
-
22
- ## Entscheidung
23
-
24
- ### Neues npm-Package: @benni/doc-system-agent
25
-
26
- Ein eigenständiges npm-Package, das alle Agent-relevanten Komponenten bündelt:
27
-
28
- ```
29
- packages/doc-system-agent/
30
- ├── src/
31
- │ ├── cli/ # CLI-Kommandos (init, update, info)
32
- │ ├── mcp/ # MCP-Server + Tools
33
- │ └── index.ts # Public API
34
- ├── templates/
35
- │ └── cursor-rules/ # Rule-Templates (.mdc)
36
- ├── examples/
37
- │ └── basic-project/ # Beispielprojekt
38
- ├── package.json
39
- └── README.md
40
- ```
41
-
42
- ### CLI-Kommandos
43
-
44
- ```bash
45
- # Projekt initialisieren
46
- npx doc-agent init [--force] [--merge] [--verbose]
47
-
48
- # Rules aktualisieren
49
- npx doc-agent update [--safe] [--verbose]
50
-
51
- # Info anzeigen
52
- npx doc-agent info
53
-
54
- # MCP-Server starten
55
- npx doc-mcp-server start
56
- ```
57
-
58
- ### Programmatic API
59
-
60
- ```typescript
61
- import { initProject, updateRules, startMcpServer } from '@benni/doc-system-agent';
62
-
63
- await initProject({ targetDir: './my-project', merge: true });
64
- await updateRules({ safe: true });
65
- await startMcpServer();
66
- ```
67
-
68
- ### Rules-Versionierung
69
-
70
- ```json
71
- // .cursor/rules/.rules-version.json
72
- {
73
- "version": 1,
74
- "updatedAt": "2024-12-01"
75
- }
76
- ```
77
-
78
- - Bei `init`: Version wird gesetzt
79
- - Bei `update`: Alte Version → Neue Version, mit Backup
80
- - Bei `update --safe`: Neue Dateien als `.new` ablegen
81
-
82
- ## Konsequenzen
83
-
84
- ### Positive
85
-
86
- - **Portabilität**: Dieselbe Arbeitsweise in jedem Projekt
87
- - **Einfache Installation**: Ein `npx`-Befehl genügt
88
- - **Versionierung**: Kontrollierte Updates ohne Datenverlust
89
- - **Separation of Concerns**: Agent-Tooling getrennt von Extension
90
- - **Wiederverwendbarkeit**: Rules und MCP-Server als wiederverwendbare Assets
91
-
92
- ### Negative
93
-
94
- - **Zusätzliche Wartung**: Ein weiteres Package zu pflegen
95
- - **Synchronisation**: Rules müssen zwischen Repos synchron gehalten werden
96
- - **Abhängigkeit**: Neue Projekte hängen vom Package ab
97
-
98
- ## Alternativen
99
-
100
- ### Alternative A: Template-Repository
101
-
102
- Ein GitHub-Template-Repo, das geklont wird.
103
-
104
- Abgelehnt, weil:
105
- - Keine einfachen Updates möglich
106
- - Keine Versionierung
107
- - Schwieriger in bestehende Projekte zu integrieren
108
-
109
- ### Alternative B: Nur .cursor/rules kopieren
110
-
111
- Manuelles Kopieren der Rule-Dateien.
112
-
113
- Abgelehnt, weil:
114
- - Fehleranfällig
115
- - Keine Versionierung
116
- - MCP-Server-Setup nicht enthalten
117
-
118
- ### Alternative C: Monorepo mit Workspaces
119
-
120
- Alles in einem Monorepo mit npm/yarn workspaces.
121
-
122
- Teilweise umgesetzt (Package liegt in `packages/`), aber:
123
- - Package ist eigenständig publishbar
124
- - Kann unabhängig versioniert werden
125
-
126
- ## Verwendung
127
-
128
- ### Neues Projekt starten
129
-
130
- ```bash
131
- mkdir my-new-project && cd my-new-project
132
- npm init -y
133
- npm install -D @benni/doc-system-agent
134
- npx doc-agent init --verbose
135
- ```
136
-
137
- ### Bestehendes Projekt erweitern
138
-
139
- ```bash
140
- cd existing-project
141
- npm install -D @benni/doc-system-agent
142
- npx doc-agent init --merge # Nur fehlende Rules ergänzen
143
- ```
144
-
145
- ### Rules aktualisieren
146
-
147
- ```bash
148
- npx doc-agent update --safe # Neue Versionen als .new-Dateien
149
- # Manuell prüfen und mergen
150
- npx doc-agent update # Direkt überschreiben (mit Backup)
151
- ```
152
-
153
- ## Referenzen
154
-
155
- - [Package README](../../packages/doc-system-agent/README.md)
156
- - [VS Code Integration](../../packages/doc-system-agent/VSCODE_INTEGRATION.md)
157
- - [ADR-014: Rules-Migration](./014-rules-migration-und-mcp-integration.md)
158
-