@noyrax/documentation-system-plugin 1.0.4-beta.3 → 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.
- package/out/cache/ast-cache.js +69 -0
- package/out/cache/ast-cache.js.map +1 -0
- package/out/cache/dependencies-cache.js +73 -0
- package/out/cache/dependencies-cache.js.map +1 -0
- package/out/cache/output-cache.js +69 -0
- package/out/cache/output-cache.js.map +1 -0
- package/out/cache/signature-cache.js +60 -0
- package/out/cache/signature-cache.js.map +1 -0
- package/out/cli/generate-cli.js +341 -0
- package/out/cli/generate-cli.js.map +1 -0
- package/out/cli/scan-cli.js +157 -0
- package/out/cli/scan-cli.js.map +1 -0
- package/out/cli/validate-cli.js +258 -0
- package/out/cli/validate-cli.js.map +1 -0
- package/out/core/async.js +38 -0
- package/out/core/async.js.map +1 -0
- package/out/core/consolidation.js +230 -0
- package/out/core/consolidation.js.map +1 -0
- package/out/core/git.js +48 -0
- package/out/core/git.js.map +1 -0
- package/out/core/language-detection.js +29 -0
- package/out/core/language-detection.js.map +1 -0
- package/out/core/scanner.js +180 -0
- package/out/core/scanner.js.map +1 -0
- package/out/core/signature-formatter.js +162 -0
- package/out/core/signature-formatter.js.map +1 -0
- package/out/core/symbol-classifier.js +96 -0
- package/out/core/symbol-classifier.js.map +1 -0
- package/out/core/symbols.js +24 -0
- package/out/core/symbols.js.map +1 -0
- package/out/drift/index.js +28 -0
- package/out/drift/index.js.map +1 -0
- package/out/extension.js +984 -0
- package/out/extension.js.map +1 -0
- package/out/generator/adr-linker.js +216 -0
- package/out/generator/adr-linker.js.map +1 -0
- package/out/generator/change-report.js +124 -0
- package/out/generator/change-report.js.map +1 -0
- package/out/generator/dependency-graph.js +98 -0
- package/out/generator/dependency-graph.js.map +1 -0
- package/out/generator/index.js +117 -0
- package/out/generator/index.js.map +1 -0
- package/out/generator/module-doc.js +438 -0
- package/out/generator/module-doc.js.map +1 -0
- package/out/generator/system-metadata.js +202 -0
- package/out/generator/system-metadata.js.map +1 -0
- package/out/index/index.js +161 -0
- package/out/index/index.js.map +1 -0
- package/out/logging/index.js +24 -0
- package/out/logging/index.js.map +1 -0
- package/out/parsers/dependencies.js +126 -0
- package/out/parsers/dependencies.js.map +1 -0
- package/out/parsers/json-yaml.js +121 -0
- package/out/parsers/json-yaml.js.map +1 -0
- package/out/parsers/python.js +160 -0
- package/out/parsers/python.js.map +1 -0
- package/out/parsers/ts-js.js +598 -0
- package/out/parsers/ts-js.js.map +1 -0
- package/out/parsers/types.js +3 -0
- package/out/parsers/types.js.map +1 -0
- package/out/ui/commands-provider.js +91 -0
- package/out/ui/commands-provider.js.map +1 -0
- package/out/ui/status-bar.js +85 -0
- package/out/ui/status-bar.js.map +1 -0
- package/out/validator/index.js +185 -0
- package/out/validator/index.js.map +1 -0
- package/out/validator/signature-matching.js +261 -0
- package/out/validator/signature-matching.js.map +1 -0
- package/out/validator/status.js +38 -0
- package/out/validator/status.js.map +1 -0
- package/package.json +9 -1
- package/.vscodeignore +0 -41
- package/MCP_SERVER_SETUP.md +0 -371
- package/assets/icon.svg +0 -27
- package/docs/LINKEDIN_ANTWORT_SEQUENZDIAGRAMME.md +0 -190
- package/docs/SEQUENZDIAGRAMM_BEWEIS.md +0 -469
- package/docs/SEQUENZDIAGRAMM_VALIDATE_FLOW.md +0 -282
- package/docs/adr/001-signatur-abweichung-fix.md +0 -54
- package/docs/adr/002-file-specific-validation-1.0.1.md +0 -45
- package/docs/adr/003-documentation-generation-bugs.md +0 -134
- package/docs/adr/004-validator-signature-matching-fix.md +0 -121
- package/docs/adr/005-validator-generic-simplification-tightening.md +0 -35
- package/docs/adr/006-parser-variable-type-extraction.md +0 -33
- package/docs/adr/007-ts-parser-load-libs-for-accurate-types.md +0 -31
- package/docs/adr/008-dependencies-cache-phase1.md +0 -133
- package/docs/adr/009-consolidation-union-logic-phase1-2.md +0 -147
- package/docs/adr/010-extension-union-integration-phase1-3-and-phase2.md +0 -179
- package/docs/adr/011-module-doc-change-tracking-phase3.md +0 -190
- package/docs/adr/012-git-deletions-change-report-phase4.md +0 -235
- package/docs/adr/013-system-functionality-fixes.md +0 -279
- package/docs/adr/014-rules-migration-und-mcp-integration.md +0 -113
- package/docs/adr/015-global-agent-package.md +0 -158
- package/docs/adr/016-produktisierung-docguard.md +0 -193
- package/docs/adr/017-signature-matching-optional-fields.md +0 -128
- package/docs/adr/018-rebranding-docguard-to-noyrax.md +0 -109
- package/docs/adr/019-system-schwachstellen-analyse-und-fixes.md +0 -204
- package/docs/adr/020-api-doc-tiefe-und-signatureformatter.md +0 -74
- package/docs/adr/021-semantic-api-docs-and-symbol-classifier.md +0 -125
- package/docs/adr/022-semantic-class-and-constants-rendering.md +0 -82
- package/docs/adr/023-adr-verknuepfung-modul-doku.md +0 -54
- package/docs/adr/024-cursor-rules-mehrdimensionaler-raum.md +0 -230
- package/docs/adr/025-mcp-tools-scan-validate-cli-bridge.md +0 -202
- package/docs/adr/026-reality-driven-development-system.md +0 -173
- package/docs/adr/027-scanner-excludes-and-union-logic-fix.md +0 -189
- package/docs/adr/028-src-coverage-union-resync.md +0 -124
- package/docs/adr/029-parser-flow-kopplung-und-sync-drift-modi.md +0 -102
- package/docs/adr/030-dependency-import-symbol-names-preservation.md +0 -123
- package/docs/adr/031-generate-cli-vollstaendige-dokumentation.md +0 -99
- package/docs/adr/032-windows-optimized-verification-scripts.md +0 -165
- package/docs/adr/036-enhanced-dependency-metadata.md +0 -190
- package/docs/adr/TEMPLATE.md +0 -76
- package/docs/index/symbols.jsonl +0 -78
- package/docs/modules/action__action.yml.md +0 -50
- package/docs/modules/documentation.config.schema.json.md +0 -37
- package/docs/modules/mcp__package.json.md +0 -130
- package/docs/modules/mcp__src__resources__docs.ts.md +0 -94
- package/docs/modules/mcp__src__server.ts.md +0 -15
- package/docs/modules/mcp__src__tools__drift.ts.md +0 -114
- package/docs/modules/mcp__src__tools__impact.ts.md +0 -130
- package/docs/modules/mcp__src__tools__scan.ts.md +0 -75
- package/docs/modules/mcp__src__tools__validate.ts.md +0 -116
- package/docs/modules/mcp__src__tools__verify-adrs.ts.md +0 -106
- package/docs/modules/mcp__tsconfig.json.md +0 -22
- package/docs/modules/package.json.md +0 -130
- package/docs/modules/packages__doc-system-agent__examples__basic-project__package.json.md +0 -43
- package/docs/modules/packages__doc-system-agent__examples__basic-project__src__calculator.ts.md +0 -81
- package/docs/modules/packages__doc-system-agent__package.json.md +0 -154
- package/docs/modules/packages__doc-system-agent__src__cli__index.ts.md +0 -8
- package/docs/modules/packages__doc-system-agent__src__cli__init.ts.md +0 -93
- package/docs/modules/packages__doc-system-agent__src__cli__update.ts.md +0 -113
- package/docs/modules/packages__doc-system-agent__src__constants.ts.md +0 -29
- package/docs/modules/packages__doc-system-agent__src__index.ts.md +0 -234
- package/docs/modules/packages__doc-system-agent__src__mcp__resources__docs.ts.md +0 -94
- package/docs/modules/packages__doc-system-agent__src__mcp__server.ts.md +0 -17
- package/docs/modules/packages__doc-system-agent__src__mcp__tools__drift.ts.md +0 -38
- package/docs/modules/packages__doc-system-agent__src__mcp__tools__impact.ts.md +0 -75
- package/docs/modules/packages__doc-system-agent__src__mcp__tools__scan.ts.md +0 -23
- package/docs/modules/packages__doc-system-agent__src__mcp__tools__validate.ts.md +0 -23
- package/docs/modules/packages__doc-system-agent__src__mcp__tools__verify-adrs.ts.md +0 -106
- package/docs/modules/packages__doc-system-agent__src__mcp__types.ts.md +0 -355
- package/docs/modules/packages__doc-system-agent__tsconfig.json.md +0 -22
- package/docs/modules/scripts__verify-adrs.js.md +0 -97
- package/docs/modules/scripts__verify-architecture.js.md +0 -93
- package/docs/modules/scripts__verify-imports.js.md +0 -114
- package/docs/modules/src____tests____setup.ts.md +0 -8
- package/docs/modules/src____tests____signature-formatter.test.ts.md +0 -16
- package/docs/modules/src____tests____snapshot-doc-generation.test.ts.md +0 -8
- package/docs/modules/src____tests____symbol-classifier.test.ts.md +0 -16
- package/docs/modules/src__cache__ast-cache.ts.md +0 -91
- package/docs/modules/src__cache__dependencies-cache.ts.md +0 -89
- package/docs/modules/src__cache__output-cache.ts.md +0 -91
- package/docs/modules/src__cache__signature-cache.ts.md +0 -76
- package/docs/modules/src__cli__generate-cli.ts.md +0 -130
- package/docs/modules/src__cli__scan-cli.ts.md +0 -99
- package/docs/modules/src__cli__validate-cli.ts.md +0 -144
- package/docs/modules/src__core__async.ts.md +0 -18
- package/docs/modules/src__core__consolidation.ts.md +0 -157
- package/docs/modules/src__core__git.ts.md +0 -35
- package/docs/modules/src__core__language-detection.ts.md +0 -31
- package/docs/modules/src__core__scanner.ts.md +0 -100
- package/docs/modules/src__core__signature-formatter.ts.md +0 -232
- package/docs/modules/src__core__symbol-classifier.ts.md +0 -178
- package/docs/modules/src__core__symbols.ts.md +0 -31
- package/docs/modules/src__drift__index.ts.md +0 -53
- package/docs/modules/src__extension.ts.md +0 -418
- package/docs/modules/src__generator__adr-linker.ts.md +0 -154
- package/docs/modules/src__generator__change-report.ts.md +0 -85
- package/docs/modules/src__generator__dependency-graph.ts.md +0 -63
- package/docs/modules/src__generator__index.ts.md +0 -40
- package/docs/modules/src__generator__module-doc.ts.md +0 -242
- package/docs/modules/src__index__index.ts.md +0 -159
- package/docs/modules/src__logging__index.ts.md +0 -87
- package/docs/modules/src__parsers__dependencies.ts.md +0 -69
- package/docs/modules/src__parsers__json-yaml.ts.md +0 -96
- package/docs/modules/src__parsers__python.ts.md +0 -73
- package/docs/modules/src__parsers__ts-js.ts.md +0 -48
- package/docs/modules/src__parsers__types.ts.md +0 -117
- package/docs/modules/src__ui__commands-provider.ts.md +0 -70
- package/docs/modules/src__ui__status-bar.ts.md +0 -79
- package/docs/modules/src__validator__index.ts.md +0 -211
- package/docs/modules/src__validator__signature-matching.ts.md +0 -209
- package/docs/modules/src__validator__status.ts.md +0 -72
- package/docs/modules/test-mcp-resources.js.md +0 -27
- package/docs/modules/tsconfig.json.md +0 -22
- package/docs/system/CHANGE_REPORT.md +0 -26
- package/docs/system/DEPENDENCIES.md +0 -403
- package/docs/system/DEPENDENCY_GRAPH.md +0 -336
- package/docs/system/NAVIGATION_SPACE_ANALYSIS.md +0 -244
- package/docs/system/NPX_CACHE_FIX.md +0 -85
- package/docs/system/NPX_LOCAL_USAGE.md +0 -66
- package/docs/system/PLUGIN_ECOSYSTEM_STATUS.md +0 -465
- package/docs/system/PLUGIN_UPDATE_GUIDE.md +0 -212
- package/docs/system/RULES_UPDATE_GUIDE.md +0 -182
- package/docs/system/SYSTEM_ANALYSIS.md +0 -947
- package/docs/system/SYSTEM_METADATA.json +0 -37
- package/documentation.config.schema.json +0 -77
- package/publish.ps1 +0 -21
|
@@ -1,202 +0,0 @@
|
|
|
1
|
-
# ADR-025: MCP-Server Tools Scan/Validate – CLI-Bridge-Pattern
|
|
2
|
-
|
|
3
|
-
**Status:** Implementiert
|
|
4
|
-
**Datum:** 2025-12-12
|
|
5
|
-
|
|
6
|
-
## Kontext
|
|
7
|
-
|
|
8
|
-
Die MCP-Server Tools `validation/runScan` und `validation/runValidate` versuchten, nicht-existierende npm-Scripts (`npm run scan` und `npm run validate`) aufzurufen. Dies führte zu Fehlern:
|
|
9
|
-
|
|
10
|
-
```
|
|
11
|
-
Command failed: npm run scan
|
|
12
|
-
npm error Missing script: "scan"
|
|
13
|
-
```
|
|
14
|
-
|
|
15
|
-
**Architektur-Konflikt:**
|
|
16
|
-
- `mcp/` ist separates ESM-Package (`"type": "module"`, `"module": "NodeNext`)
|
|
17
|
-
- `src/` ist Teil der Extension (CommonJS, VS Code APIs)
|
|
18
|
-
- Direkte Imports von `mcp/` nach `src/` funktionieren nicht:
|
|
19
|
-
- TypeScript kann `../../src/` nicht auflösen (außerhalb von `mcp/tsconfig.json` include)
|
|
20
|
-
- Module-System-Mismatch (CommonJS vs ESM)
|
|
21
|
-
- VS Code API-Abhängigkeiten in Extension-Funktionen
|
|
22
|
-
|
|
23
|
-
**Bestehende Lösung:**
|
|
24
|
-
- `runDriftCheck` verwendet `git` CLI-Tool (externes Tool)
|
|
25
|
-
- Keine direkten Imports von `src/`
|
|
26
|
-
- Konsistentes Pattern: MCP-Tools rufen externe CLI-Tools auf
|
|
27
|
-
|
|
28
|
-
## Entscheidung
|
|
29
|
-
|
|
30
|
-
### CLI-Bridge-Pattern implementieren
|
|
31
|
-
|
|
32
|
-
**Strategie:** CLI-Tools im Root-Projekt erstellen, die von MCP-Tools via npm-Scripts aufgerufen werden.
|
|
33
|
-
|
|
34
|
-
### 1. CLI-Tools erstellt
|
|
35
|
-
|
|
36
|
-
**Dateien:**
|
|
37
|
-
- `src/cli/scan-cli.ts` - Scan-Tool ohne VS Code APIs
|
|
38
|
-
- `src/cli/validate-cli.ts` - Validate-Tool ohne VS Code APIs
|
|
39
|
-
|
|
40
|
-
**Implementierung:**
|
|
41
|
-
- Importieren Kern-Funktionen aus `src/core/scanner.ts` und `src/validator/index.ts`
|
|
42
|
-
- Keine VS Code API-Abhängigkeiten
|
|
43
|
-
- JSON-Output für einfaches Parsing
|
|
44
|
-
- CLI-Argument-Parsing für Optionen
|
|
45
|
-
|
|
46
|
-
**Funktionalität:**
|
|
47
|
-
- `scan-cli.ts`:
|
|
48
|
-
- Ruft `scanWorkspace()` auf
|
|
49
|
-
- Parst Dateien mit Parsern (TsJsParser, JsonYamlParser, PythonParser)
|
|
50
|
-
- Extrahiert Symbole
|
|
51
|
-
- Gibt strukturiertes JSON zurück
|
|
52
|
-
|
|
53
|
-
- `validate-cli.ts`:
|
|
54
|
-
- Ruft `scanWorkspace()` und Parser auf
|
|
55
|
-
- Ruft `computeCoverage()` und `validateMarkdownDir()` auf
|
|
56
|
-
- Berechnet Coverage-Metriken
|
|
57
|
-
- Gibt strukturierte Fehler/Warnungen zurück
|
|
58
|
-
|
|
59
|
-
### 2. npm-Scripts hinzugefügt
|
|
60
|
-
|
|
61
|
-
**Datei:** `package.json`
|
|
62
|
-
|
|
63
|
-
**Scripts:**
|
|
64
|
-
```json
|
|
65
|
-
"scan:cli": "node out/cli/scan-cli.js",
|
|
66
|
-
"validate:cli": "node out/cli/validate-cli.js"
|
|
67
|
-
```
|
|
68
|
-
|
|
69
|
-
**Hinweis:** Verwenden kompilierte Versionen (`out/cli/`) statt TypeScript direkt, da `ts-node` nicht als Dependency vorhanden ist.
|
|
70
|
-
|
|
71
|
-
### 3. MCP-Tools aktualisiert
|
|
72
|
-
|
|
73
|
-
**Dateien:**
|
|
74
|
-
- `mcp/src/tools/scan.ts` - Ruft `npm run scan:cli` auf, parst JSON-Output
|
|
75
|
-
- `mcp/src/tools/validate.ts` - Ruft `npm run validate:cli` auf, parst JSON-Output
|
|
76
|
-
|
|
77
|
-
**Änderungen:**
|
|
78
|
-
- Ersetzen `npm run scan` → `npm run scan:cli`
|
|
79
|
-
- Ersetzen `npm run validate` → `npm run validate:cli`
|
|
80
|
-
- JSON-Parsing statt Text-Parsing (strukturierte Daten)
|
|
81
|
-
- Fallback auf Text-Parsing für Rückwärtskompatibilität
|
|
82
|
-
|
|
83
|
-
## Konsequenzen
|
|
84
|
-
|
|
85
|
-
### Positive
|
|
86
|
-
|
|
87
|
-
- **Konsistentes Pattern:** Gleiche Strategie wie `runDriftCheck` (externe Tools)
|
|
88
|
-
- **Keine Import-Probleme:** CLI-Tools können von `src/` importieren (gleiches Projekt)
|
|
89
|
-
- **Strukturierte Daten:** JSON-Output statt Freitext-Parsing
|
|
90
|
-
- **Wiederverwendbar:** CLI-Tools können auch direkt verwendet werden
|
|
91
|
-
- **Keine VS Code Abhängigkeiten:** CLI-Tools funktionieren außerhalb von VS Code
|
|
92
|
-
- **Einfache Wartung:** Logik zentralisiert in CLI-Tools
|
|
93
|
-
|
|
94
|
-
### Negative
|
|
95
|
-
|
|
96
|
-
- **Zusätzliche Dateien:** 2 neue CLI-Tools zu pflegen
|
|
97
|
-
- **Build-Schritt erforderlich:** CLI-Tools müssen kompiliert werden (`npm run compile`)
|
|
98
|
-
- **npm-Script-Abhängigkeit:** MCP-Tools benötigen npm im PATH
|
|
99
|
-
- **Performance:** Child-Process-Overhead (aber akzeptabel)
|
|
100
|
-
|
|
101
|
-
### Technische Details
|
|
102
|
-
|
|
103
|
-
**Import-Pfade:**
|
|
104
|
-
- CLI-Tools verwenden relative Imports: `../core/scanner`, `../validator/index`
|
|
105
|
-
- Funktioniert, da CLI-Tools Teil von `src/` sind
|
|
106
|
-
- Kompiliert zu `out/cli/` mit korrekten relativen Pfaden
|
|
107
|
-
|
|
108
|
-
**Module-System:**
|
|
109
|
-
- CLI-Tools kompilieren zu CommonJS (`tsconfig.json`: `"module": "commonjs"`)
|
|
110
|
-
- Werden von Node.js direkt ausgeführt
|
|
111
|
-
- Keine ESM/CommonJS-Konflikte
|
|
112
|
-
|
|
113
|
-
**Output-Format:**
|
|
114
|
-
- JSON für strukturierte Daten
|
|
115
|
-
- Einfaches Parsing in MCP-Tools
|
|
116
|
-
- Fallback auf Text-Parsing für Fehlerfälle
|
|
117
|
-
|
|
118
|
-
## Alternativen
|
|
119
|
-
|
|
120
|
-
### Alternative 1: Direkte Imports von mcp/ nach src/
|
|
121
|
-
|
|
122
|
-
**Verworfen:**
|
|
123
|
-
- TypeScript kann `../../src/` nicht auflösen
|
|
124
|
-
- Module-System-Mismatch (ESM vs CommonJS)
|
|
125
|
-
- VS Code API-Abhängigkeiten würden Probleme verursachen
|
|
126
|
-
|
|
127
|
-
### Alternative 2: Gemeinsames Package erstellen
|
|
128
|
-
|
|
129
|
-
**Verworfen:**
|
|
130
|
-
- Zu komplex für diese Aufgabe
|
|
131
|
-
- Würde große Refactoring-Erfordernis bedeuten
|
|
132
|
-
- Nicht notwendig für diese Lösung
|
|
133
|
-
|
|
134
|
-
### Alternative 3: CLI-Tool in packages/doc-system-agent/
|
|
135
|
-
|
|
136
|
-
**Verworfen:**
|
|
137
|
-
- `packages/doc-system-agent/` kann auch nicht direkt von `src/` importieren
|
|
138
|
-
- Gleiche Import-Probleme wie bei mcp/
|
|
139
|
-
- Root-Projekt ist besserer Ort für CLI-Tools
|
|
140
|
-
|
|
141
|
-
### Alternative 4: TypeScript-Paths in mcp/tsconfig.json
|
|
142
|
-
|
|
143
|
-
**Verworfen:**
|
|
144
|
-
- Würde Module-System-Mismatch nicht lösen
|
|
145
|
-
- Komplexe Konfiguration erforderlich
|
|
146
|
-
- CLI-Bridge-Pattern ist einfacher und konsistenter
|
|
147
|
-
|
|
148
|
-
## Implementierung
|
|
149
|
-
|
|
150
|
-
### Geänderte Dateien
|
|
151
|
-
|
|
152
|
-
**NEU:**
|
|
153
|
-
- `src/cli/scan-cli.ts` - Scan-CLI-Tool
|
|
154
|
-
- `src/cli/validate-cli.ts` - Validate-CLI-Tool
|
|
155
|
-
|
|
156
|
-
**AKTUALISIERT:**
|
|
157
|
-
- `package.json` - Scripts `scan:cli` und `validate:cli` hinzugefügt
|
|
158
|
-
- `mcp/src/tools/scan.ts` - Ruft `npm run scan:cli` auf (bereits aktualisiert)
|
|
159
|
-
- `mcp/src/tools/validate.ts` - Ruft `npm run validate:cli` auf (bereits aktualisiert)
|
|
160
|
-
|
|
161
|
-
### Test-Ergebnisse
|
|
162
|
-
|
|
163
|
-
**CLI-Tools:**
|
|
164
|
-
- ✅ `scan-cli.ts` kompiliert erfolgreich
|
|
165
|
-
- ✅ `validate-cli.ts` kompiliert erfolgreich
|
|
166
|
-
- ✅ `npm run scan:cli` funktioniert: 99 Dateien verarbeitet, 406 Symbole extrahiert
|
|
167
|
-
- ✅ `npm run validate:cli` funktioniert: Gibt strukturierte Fehler/Warnungen zurück
|
|
168
|
-
|
|
169
|
-
**MCP-Tools:**
|
|
170
|
-
- ✅ `mcp/src/tools/scan.ts` ruft korrekt `npm run scan:cli` auf
|
|
171
|
-
- ✅ `mcp/src/tools/validate.ts` ruft korrekt `npm run validate:cli` auf
|
|
172
|
-
- ✅ JSON-Parsing implementiert
|
|
173
|
-
- ✅ MCP-Server kompiliert erfolgreich
|
|
174
|
-
|
|
175
|
-
### Validierung
|
|
176
|
-
|
|
177
|
-
- ✅ Build-Tests: CLI-Tools kompilieren erfolgreich
|
|
178
|
-
- ✅ Funktions-Tests: CLI-Tools geben korrektes JSON zurück
|
|
179
|
-
- ✅ MCP-Integration: Tools können CLI-Tools aufrufen
|
|
180
|
-
- ✅ Konsistenz: Gleiches Pattern wie `runDriftCheck`
|
|
181
|
-
|
|
182
|
-
## Verweise
|
|
183
|
-
|
|
184
|
-
- **ADR-014:** Rules-Migration und MCP-Integration (MCP-Server Einführung)
|
|
185
|
-
- **ADR-024:** Cursor Rules Überarbeitung (MCP-Server Resource-Definitionen)
|
|
186
|
-
- `.cursor/ARCHITECTURE_ANALYSIS.md` - Architektur-Analyse
|
|
187
|
-
- `.cursor/MCP_TOOLS_TEST_RESULTS.md` - Test-Ergebnisse
|
|
188
|
-
|
|
189
|
-
## Nächste Schritte
|
|
190
|
-
|
|
191
|
-
1. **Performance-Optimierung:** Bei Bedarf Caching für wiederholte Scans
|
|
192
|
-
2. **Erweiterte Optionen:** Weitere CLI-Argumente für spezifische Use-Cases
|
|
193
|
-
3. **Dokumentation:** CLI-Tools in README dokumentieren
|
|
194
|
-
4. **Integrationstest:** MCP-Tools mit Cursor testen
|
|
195
|
-
|
|
196
|
-
## Lessons Learned
|
|
197
|
-
|
|
198
|
-
- **CLI-Bridge-Pattern:** Effektive Lösung für Module-System-Konflikte
|
|
199
|
-
- **Konsistenz:** Gleiche Patterns wie bestehende Tools verwenden (`runDriftCheck`)
|
|
200
|
-
- **Architektur-Analyse:** Systematische Analyse vor Implementierung verhindert Fehler
|
|
201
|
-
- **Import-Probleme:** Relative Pfade zwischen separaten Packages funktionieren nicht ohne Konfiguration
|
|
202
|
-
|
|
@@ -1,173 +0,0 @@
|
|
|
1
|
-
# ADR-026: Reality-Driven Development System
|
|
2
|
-
|
|
3
|
-
**Status:** Implementiert
|
|
4
|
-
**Datum:** 2025-12-12
|
|
5
|
-
|
|
6
|
-
## Kontext
|
|
7
|
-
|
|
8
|
-
Cursor (und andere AI-Agenten) halluzinieren manchmal, indem sie:
|
|
9
|
-
- Dokumentation lesen
|
|
10
|
-
- Annehmen, dass sie stimmt
|
|
11
|
-
- Code basierend auf Annahmen generieren
|
|
12
|
-
- "Fertig!" sagen ohne Verification
|
|
13
|
-
|
|
14
|
-
**Problem:** Es gab keine systematische Verification-Loop, die Agenten daran hindert, Code zu implementieren ohne Reality-Checks.
|
|
15
|
-
|
|
16
|
-
**Beispiel:**
|
|
17
|
-
- ADR sagt "X ist implementiert"
|
|
18
|
-
- Agent nimmt es an
|
|
19
|
-
- Code generiert basierend auf Annahme
|
|
20
|
-
- Fehler entstehen, weil X tatsächlich nicht existiert
|
|
21
|
-
|
|
22
|
-
## Entscheidung
|
|
23
|
-
|
|
24
|
-
### Reality-Driven Development System implementieren
|
|
25
|
-
|
|
26
|
-
**Grundprinzip:** Code ist die einzige Wahrheitsquelle. Dokumentation und ADRs können veraltet sein oder Pläne beschreiben, nicht die Realität.
|
|
27
|
-
|
|
28
|
-
**Strategie:** System-enforced Verification-Loops, die Agenten zwingen, Reality-Checks durchzuführen bevor, während und nach der Implementierung.
|
|
29
|
-
|
|
30
|
-
### 1. Neue Cursor Rule: `026-reality-driven-verification.mdc`
|
|
31
|
-
|
|
32
|
-
**Zweck:** Explizite Verification-Loop vor/nach Implementierung
|
|
33
|
-
|
|
34
|
-
**Inhalt:**
|
|
35
|
-
- **BEFORE Implementation:** Reality-Checks (grep, ls, cat, compile)
|
|
36
|
-
- **DURING Implementation:** Incremental Verification (compile sofort, test sofort)
|
|
37
|
-
- **AFTER Implementation:** End-to-End Verification (vollständiger Workflow-Test)
|
|
38
|
-
- **Evidence-basierte Claims:** Nie "Ich habe X implementiert" ohne Beweis
|
|
39
|
-
|
|
40
|
-
**Integration:**
|
|
41
|
-
- Ergänzt `001-pre-check.mdc` mit expliziten Verification-Schritten
|
|
42
|
-
- Ergänzt `023-pre-planning.mdc` mit Verification-Commands zu jeder Checkliste
|
|
43
|
-
|
|
44
|
-
### 2. Verification-Scripts
|
|
45
|
-
|
|
46
|
-
**Dateien:**
|
|
47
|
-
- `scripts/verify-architecture.js` - Architektur-Regeln prüfen (Imports, Zyklen)
|
|
48
|
-
- `scripts/verify-adrs.js` - ADR-Claims gegen Code prüfen (Dateien, Funktionen)
|
|
49
|
-
- `scripts/verify-imports.js` - Import-Verfügbarkeit prüfen (Exports, Pfade)
|
|
50
|
-
|
|
51
|
-
**Funktionalität:**
|
|
52
|
-
- Automatische Prüfung von Architektur-Regeln
|
|
53
|
-
- ADR-Claim-Verification gegen tatsächlichen Code
|
|
54
|
-
- Import-Verfügbarkeit-Checks
|
|
55
|
-
|
|
56
|
-
### 3. Automation
|
|
57
|
-
|
|
58
|
-
**Pre-Commit Hook (`.husky/pre-commit`):**
|
|
59
|
-
- Architektur-Verification
|
|
60
|
-
- ADR-Verification (non-blocking)
|
|
61
|
-
- Compile-Check
|
|
62
|
-
|
|
63
|
-
**GitHub Actions (`.github/workflows/verification.yml`):**
|
|
64
|
-
- CI/CD Reality-Checks
|
|
65
|
-
- Architektur-Verification
|
|
66
|
-
- ADR-Verification
|
|
67
|
-
- Build-Verification
|
|
68
|
-
- CLI-Tools-Test
|
|
69
|
-
- MCP-Server-Test
|
|
70
|
-
|
|
71
|
-
**VS Code Tasks (`.vscode/tasks.json`):**
|
|
72
|
-
- "Verify Before Commit" (Default Build Task)
|
|
73
|
-
- "Quick Verification"
|
|
74
|
-
- "Verify ADR Claims"
|
|
75
|
-
- "Verify Architecture"
|
|
76
|
-
- "Verify Imports"
|
|
77
|
-
|
|
78
|
-
### 4. Documentation
|
|
79
|
-
|
|
80
|
-
**`.cursorrules` Datei:**
|
|
81
|
-
- Cursor-spezifische Reality-Driven Instructions
|
|
82
|
-
- Verification-Commands für PowerShell und Bash
|
|
83
|
-
- Evidence-basierte Claims-Patterns
|
|
84
|
-
|
|
85
|
-
**ADR-Template erweitert (`docs/adr/TEMPLATE.md`):**
|
|
86
|
-
- "Implementation Claims" Sektion (verifizierbare Claims)
|
|
87
|
-
- "Verification Report" Sektion (nach Implementierung ausfüllen)
|
|
88
|
-
- Verification-Commands-Beispiele
|
|
89
|
-
|
|
90
|
-
**package.json Scripts erweitert:**
|
|
91
|
-
- `verify:all` - Alle Verification-Checks
|
|
92
|
-
- `verify:architecture` - Architektur-Checks
|
|
93
|
-
- `verify:adrs` - ADR-Checks
|
|
94
|
-
- `verify:imports` - Import-Checks
|
|
95
|
-
|
|
96
|
-
## Auswirkungen
|
|
97
|
-
|
|
98
|
-
### Positive Auswirkungen
|
|
99
|
-
|
|
100
|
-
- **Verhindert Halluzinationen:** Agenten können nicht mehr Code implementieren ohne Reality-Checks
|
|
101
|
-
- **System-enforced Verification:** Pre-Commit Hooks und CI/CD erzwingen Verification
|
|
102
|
-
- **Evidence-basierte Claims:** Agenten müssen Beweise für ihre Claims bereitstellen
|
|
103
|
-
- **ADR-Verification:** ADR-Claims werden automatisch gegen Code geprüft
|
|
104
|
-
- **Konsistenz:** Verification-Patterns sind überall gleich (Rules, Scripts, Automation)
|
|
105
|
-
|
|
106
|
-
### Technische Auswirkungen
|
|
107
|
-
|
|
108
|
-
- **3 Verification-Scripts:** `verify-architecture.js`, `verify-adrs.js`, `verify-imports.js`
|
|
109
|
-
- **Pre-Commit Hook:** Automatische Verification vor jedem Commit
|
|
110
|
-
- **GitHub Actions:** CI/CD Reality-Checks
|
|
111
|
-
- **VS Code Tasks:** Development-Workflow Verification
|
|
112
|
-
- **`.cursorrules`:** Cursor-spezifische Instructions
|
|
113
|
-
|
|
114
|
-
### Wartbarkeit
|
|
115
|
-
|
|
116
|
-
- **Zentrale Rules:** Verification-Patterns in `026-reality-driven-verification.mdc`
|
|
117
|
-
- **Automatisierte Checks:** Scripts können erweitert werden
|
|
118
|
-
- **CI/CD Integration:** Verification läuft automatisch bei jedem Push/PR
|
|
119
|
-
|
|
120
|
-
## Implementierung
|
|
121
|
-
|
|
122
|
-
### Geänderte Dateien
|
|
123
|
-
|
|
124
|
-
1. **Cursor Rules:**
|
|
125
|
-
- `.cursor/rules/026-reality-driven-verification.mdc` - **NEU**
|
|
126
|
-
- `.cursor/rules/001-pre-check.mdc` - **ERWEITERT**
|
|
127
|
-
- `.cursor/rules/023-pre-planning.mdc` - **ERWEITERT**
|
|
128
|
-
|
|
129
|
-
2. **Verification-Scripts:**
|
|
130
|
-
- `scripts/verify-architecture.js` - **NEU**
|
|
131
|
-
- `scripts/verify-adrs.js` - **NEU**
|
|
132
|
-
- `scripts/verify-imports.js` - **NEU**
|
|
133
|
-
|
|
134
|
-
3. **Automation:**
|
|
135
|
-
- `.husky/pre-commit` - **NEU**
|
|
136
|
-
- `.github/workflows/verification.yml` - **NEU**
|
|
137
|
-
- `.vscode/tasks.json` - **NEU**
|
|
138
|
-
|
|
139
|
-
4. **Documentation:**
|
|
140
|
-
- `.cursorrules` - **NEU**
|
|
141
|
-
- `docs/adr/TEMPLATE.md` - **ERWEITERT**
|
|
142
|
-
- `package.json` - Scripts erweitert
|
|
143
|
-
|
|
144
|
-
### Test-Ergebnisse
|
|
145
|
-
|
|
146
|
-
- ✅ Verification-Scripts funktionieren
|
|
147
|
-
- ✅ Pre-Commit Hook erkannt (muss noch initialisiert werden: `npx husky install`)
|
|
148
|
-
- ✅ GitHub Actions Workflow erstellt
|
|
149
|
-
- ✅ VS Code Tasks erstellt
|
|
150
|
-
- ✅ `.cursorrules` erstellt
|
|
151
|
-
- ✅ ADR-Template erweitert
|
|
152
|
-
|
|
153
|
-
## Verweise
|
|
154
|
-
|
|
155
|
-
- **ADR-024:** Cursor Rules Überarbeitung (Vorläufer)
|
|
156
|
-
- **ADR-025:** MCP-Server Tools CLI-Bridge-Pattern (Verification-Pattern)
|
|
157
|
-
- `.cursor/REALITY_DRIVEN_PLAN.md` - Implementierungsplan
|
|
158
|
-
|
|
159
|
-
## Nächste Schritte
|
|
160
|
-
|
|
161
|
-
1. **Husky initialisieren:** `npx husky install` (für Pre-Commit Hook)
|
|
162
|
-
2. **System testen:** Intentionale Fehler einbauen, Verification-Checks prüfen
|
|
163
|
-
3. **Monitoring:** Prüfen, ob Agenten die neuen Rules korrekt nutzen
|
|
164
|
-
4. **Performance:** Bei Bedarf Verification-Scripts optimieren
|
|
165
|
-
5. **Dokumentation:** Verification-Workflow in README dokumentieren
|
|
166
|
-
|
|
167
|
-
## Lessons Learned
|
|
168
|
-
|
|
169
|
-
- **Verification-Loops sind kritisch:** Agenten müssen systematisch Reality-Checks durchführen
|
|
170
|
-
- **System-enforced ist besser:** Automation erzwingt Verification besser als nur Rules
|
|
171
|
-
- **Evidence-basierte Claims:** Agenten müssen Beweise für ihre Claims bereitstellen
|
|
172
|
-
- **ADR-Verification:** ADR-Claims sollten automatisch gegen Code geprüft werden
|
|
173
|
-
|
|
@@ -1,189 +0,0 @@
|
|
|
1
|
-
# ADR-027: Scanner-Excludes und Union-Logik Fix
|
|
2
|
-
|
|
3
|
-
**Status:** Implementiert
|
|
4
|
-
**Datum:** 2025-12-12
|
|
5
|
-
|
|
6
|
-
## Kontext
|
|
7
|
-
|
|
8
|
-
**Problem:** Der Symbol-Index enthielt 444 Symbole, aber es wurden nur 434 beim Scan gefunden. Die Differenz kam von alten Symbolen aus Verzeichnissen, die nicht mehr gescannt werden sollten:
|
|
9
|
-
|
|
10
|
-
- `demo/` - Demo-Projekt (laut `.gitignore` ausgeschlossen)
|
|
11
|
-
- `website/` - Website-Projekt (laut `.gitignore` ausgeschlossen)
|
|
12
|
-
- `mcp/` - MCP-Server (laut `tsconfig.json` exclude)
|
|
13
|
-
- `packages/` - Packages (laut `tsconfig.json` exclude)
|
|
14
|
-
- `action/` - GitHub Action (laut `tsconfig.json` exclude)
|
|
15
|
-
|
|
16
|
-
**Ursache:**
|
|
17
|
-
1. Der Scanner (`src/core/scanner.ts`) scannte diese Verzeichnisse trotz `.gitignore`, weil die `ignore`-Bibliothek nur Dateien filtert, nicht Verzeichnisse beim Walken
|
|
18
|
-
2. Die Union-Logik (`buildSymbolsUnion`) behielt alte Symbole von Dateien, die nicht mehr gescannt wurden, weil sie nicht als "gelöscht" markiert waren
|
|
19
|
-
|
|
20
|
-
**Symptom:**
|
|
21
|
-
- Index enthielt Symbole aus `demo/package.json`, `website/package.json`, etc.
|
|
22
|
-
- Diese Symbole wurden nicht mehr beim Scan gefunden
|
|
23
|
-
- Union-Logik behielt sie trotzdem, weil die Dateien noch existierten (nur nicht mehr gescannt)
|
|
24
|
-
|
|
25
|
-
## Entscheidung
|
|
26
|
-
|
|
27
|
-
### 1. Scanner-Excludes erweitert
|
|
28
|
-
|
|
29
|
-
**Datei:** `src/core/scanner.ts`
|
|
30
|
-
|
|
31
|
-
**Änderung:** `DEFAULT_EXCLUDES` erweitert um:
|
|
32
|
-
- `demo` - Demo-Projekt (laut .gitignore)
|
|
33
|
-
- `website` - Website-Projekt (laut .gitignore)
|
|
34
|
-
- `mcp` - MCP-Server (laut tsconfig.json exclude)
|
|
35
|
-
- `packages` - Packages (laut tsconfig.json exclude)
|
|
36
|
-
- `action` - GitHub Action (laut tsconfig.json exclude)
|
|
37
|
-
|
|
38
|
-
**Grund:** Diese Verzeichnisse werden explizit beim Walken ausgeschlossen, bevor die `ignore`-Bibliothek sie filtert. Dadurch werden sie gar nicht erst gescannt.
|
|
39
|
-
|
|
40
|
-
### 2. Union-Logik angepasst
|
|
41
|
-
|
|
42
|
-
**Datei:** `src/core/consolidation.ts`
|
|
43
|
-
|
|
44
|
-
**Änderung:** `buildSymbolsUnion()` erhält optionalen Parameter `scannedFiles?: Set<string>`
|
|
45
|
-
|
|
46
|
-
**Logik:**
|
|
47
|
-
- Behält nur Symbole von Dateien, die beim aktuellen Scan gefunden wurden
|
|
48
|
-
- Entfernt automatisch Symbole aus Dateien, die nicht mehr gescannt werden (z.B. ausgeschlossene Verzeichnisse)
|
|
49
|
-
- Prüft: `if (scannedFiles && !scannedFiles.has(sym.filePath)) continue;`
|
|
50
|
-
|
|
51
|
-
**Grund:** Die Union-Logik sollte nur Symbole von Dateien behalten, die beim aktuellen Scan gefunden wurden. Dateien, die nicht mehr gescannt werden (z.B. wegen Excludes), sollten als "gelöscht" behandelt werden.
|
|
52
|
-
|
|
53
|
-
### 3. Extension angepasst
|
|
54
|
-
|
|
55
|
-
**Datei:** `src/extension.ts`
|
|
56
|
-
|
|
57
|
-
**Änderung:** Übergibt `scannedFilesSet` an `buildSymbolsUnion()`:
|
|
58
|
-
```typescript
|
|
59
|
-
const scannedFilesSet = new Set<string>(scanned.map(f => f.repositoryRelativePath));
|
|
60
|
-
const symbolsUnion = buildSymbolsUnion(
|
|
61
|
-
allSymbols,
|
|
62
|
-
symbolsPrev,
|
|
63
|
-
parsedFiles,
|
|
64
|
-
deletedFilesFromGit,
|
|
65
|
-
scannedFilesSet
|
|
66
|
-
);
|
|
67
|
-
```
|
|
68
|
-
|
|
69
|
-
**Grund:** Stellt sicher, dass die Union-Logik weiß, welche Dateien beim aktuellen Scan gefunden wurden.
|
|
70
|
-
|
|
71
|
-
## Implementation Claims
|
|
72
|
-
|
|
73
|
-
### Files Modified
|
|
74
|
-
- [x] `src/core/scanner.ts` - DEFAULT_EXCLUDES erweitert
|
|
75
|
-
- [x] `src/core/consolidation.ts` - buildSymbolsUnion() angepasst
|
|
76
|
-
- [x] `src/extension.ts` - scannedFilesSet übergeben
|
|
77
|
-
|
|
78
|
-
### Functions Modified
|
|
79
|
-
- [x] `buildSymbolsUnion()` in `src/core/consolidation.ts` - Optionaler Parameter `scannedFiles` hinzugefügt
|
|
80
|
-
- [x] `generateDocumentationTs()` in `src/extension.ts` - scannedFilesSet erstellt und übergeben
|
|
81
|
-
|
|
82
|
-
### Verification Commands
|
|
83
|
-
```bash
|
|
84
|
-
# Verify DEFAULT_EXCLUDES erweitert
|
|
85
|
-
Select-String -Path src/core/scanner.ts -Pattern "demo|website|mcp|packages|action" # PowerShell
|
|
86
|
-
grep "demo\|website\|mcp\|packages\|action" src/core/scanner.ts # Bash
|
|
87
|
-
|
|
88
|
-
# Verify buildSymbolsUnion angepasst
|
|
89
|
-
Select-String -Path src/core/consolidation.ts -Pattern "scannedFiles" # PowerShell
|
|
90
|
-
grep "scannedFiles" src/core/consolidation.ts # Bash
|
|
91
|
-
|
|
92
|
-
# Verify extension angepasst
|
|
93
|
-
Select-String -Path src/extension.ts -Pattern "scannedFilesSet" # PowerShell
|
|
94
|
-
grep "scannedFilesSet" src/extension.ts # Bash
|
|
95
|
-
|
|
96
|
-
# Verify it compiles
|
|
97
|
-
npm run compile
|
|
98
|
-
|
|
99
|
-
# Verify scan funktioniert
|
|
100
|
-
npm run scan:cli
|
|
101
|
-
```
|
|
102
|
-
|
|
103
|
-
## Verification Report
|
|
104
|
-
|
|
105
|
-
**Verification Date:** 2025-12-12
|
|
106
|
-
|
|
107
|
-
**Results:**
|
|
108
|
-
- [x] All files modified: YES
|
|
109
|
-
- [x] All functions modified: YES
|
|
110
|
-
- [x] Compiles without errors: YES
|
|
111
|
-
- [x] Scan funktioniert: YES
|
|
112
|
-
- [x] VSIX neu erstellt: YES
|
|
113
|
-
|
|
114
|
-
**Evidence:**
|
|
115
|
-
```
|
|
116
|
-
✅ DEFAULT_EXCLUDES erweitert:
|
|
117
|
-
Select-String -Path src/core/scanner.ts -Pattern "demo|website|mcp|packages|action"
|
|
118
|
-
→ Gefunden: 'demo', 'website', 'mcp', 'packages', 'action' in DEFAULT_EXCLUDES
|
|
119
|
-
|
|
120
|
-
✅ buildSymbolsUnion angepasst:
|
|
121
|
-
Select-String -Path src/core/consolidation.ts -Pattern "scannedFiles"
|
|
122
|
-
→ Gefunden: Parameter und Logik für scannedFiles
|
|
123
|
-
|
|
124
|
-
✅ Extension angepasst:
|
|
125
|
-
Select-String -Path src/extension.ts -Pattern "scannedFilesSet"
|
|
126
|
-
→ Gefunden: scannedFilesSet wird erstellt und übergeben
|
|
127
|
-
|
|
128
|
-
✅ Compiles: npm run compile → Success
|
|
129
|
-
|
|
130
|
-
✅ Scan funktioniert: npm run scan:cli → {"status":"success","filesProcessed":80,"symbolsExtracted":281}
|
|
131
|
-
|
|
132
|
-
✅ VSIX neu erstellt: npm run package → noyrax-1.0.4.vsix (4.68 MB)
|
|
133
|
-
```
|
|
134
|
-
|
|
135
|
-
**Vorher/Nachher Vergleich:**
|
|
136
|
-
- **Vorher:** 123 Dateien gescannt, 448 Symbole gefunden, 444 im Index (inkl. alte Symbole aus demo/, website/, etc.)
|
|
137
|
-
- **Nachher:** 80 Dateien gescannt, 281 Symbole gefunden, Index wird beim nächsten Lauf korrekt neu generiert
|
|
138
|
-
|
|
139
|
-
## Auswirkungen
|
|
140
|
-
|
|
141
|
-
### Positive Auswirkungen
|
|
142
|
-
|
|
143
|
-
- **Korrekte Symbol-Anzahl:** Index enthält nur noch Symbole aus tatsächlich gescannten Dateien
|
|
144
|
-
- **Konsistenz:** Scanner-Excludes sind konsistent mit `.gitignore` und `tsconfig.json`
|
|
145
|
-
- **Automatische Bereinigung:** Union-Logik entfernt automatisch Symbole aus nicht mehr gescannten Verzeichnissen
|
|
146
|
-
- **Wartbarkeit:** Neue ausgeschlossene Verzeichnisse werden automatisch aus dem Index entfernt
|
|
147
|
-
|
|
148
|
-
### Technische Auswirkungen
|
|
149
|
-
|
|
150
|
-
- **Scanner:** Verarbeitet weniger Dateien (80 statt 123), schneller
|
|
151
|
-
- **Union-Logik:** Prüft jetzt explizit, ob Dateien beim Scan gefunden wurden
|
|
152
|
-
- **Index:** Wird beim nächsten Lauf automatisch bereinigt (alte Symbole entfernt)
|
|
153
|
-
|
|
154
|
-
### Wartbarkeit
|
|
155
|
-
|
|
156
|
-
- **Neue Excludes:** Einfach zu `DEFAULT_EXCLUDES` hinzufügen
|
|
157
|
-
- **Union-Logik:** Funktioniert automatisch für alle ausgeschlossenen Verzeichnisse
|
|
158
|
-
- **Konsistenz:** Scanner-Excludes sollten mit `.gitignore` und `tsconfig.json` synchronisiert bleiben
|
|
159
|
-
|
|
160
|
-
## Konsequenzen
|
|
161
|
-
|
|
162
|
-
### Was einfacher wird
|
|
163
|
-
|
|
164
|
-
- **Index-Bereinigung:** Automatisch, keine manuelle Bereinigung nötig
|
|
165
|
-
- **Konsistenz:** Scanner-Excludes sind explizit dokumentiert
|
|
166
|
-
- **Performance:** Weniger Dateien zu scannen
|
|
167
|
-
|
|
168
|
-
### Was zu beachten ist
|
|
169
|
-
|
|
170
|
-
- **Neue Verzeichnisse:** Wenn neue Verzeichnisse ausgeschlossen werden sollen, müssen sie zu `DEFAULT_EXCLUDES` hinzugefügt werden
|
|
171
|
-
- **Index-Regenerierung:** Beim ersten Lauf nach dieser Änderung wird der Index neu generiert (alte Symbole entfernt)
|
|
172
|
-
- **VSIX:** Muss neu erstellt werden, um die Änderungen zu enthalten
|
|
173
|
-
|
|
174
|
-
## Verweise
|
|
175
|
-
|
|
176
|
-
- **Verwandte ADRs:**
|
|
177
|
-
- ADR-009: Consolidation Union-Logic (Phase 1.2) - Union-Logik eingeführt
|
|
178
|
-
- ADR-010: Extension Union-Integration (Phase 1.3 + Phase 2) - Union-Logik in Extension integriert
|
|
179
|
-
- ADR-026: Reality-Driven Development System - Verification-Loops
|
|
180
|
-
|
|
181
|
-
- **Code-Referenzen:**
|
|
182
|
-
- `src/core/scanner.ts` - Scanner-Implementierung
|
|
183
|
-
- `src/core/consolidation.ts` - Union-Logik
|
|
184
|
-
- `src/extension.ts` - Extension-Hauptlogik
|
|
185
|
-
|
|
186
|
-
- **Dokumentation:**
|
|
187
|
-
- `.gitignore` - Ausgeschlossene Verzeichnisse
|
|
188
|
-
- `tsconfig.json` - TypeScript-Excludes
|
|
189
|
-
|
|
@@ -1,124 +0,0 @@
|
|
|
1
|
-
# ADR-028: Vollständige `src`-Abdeckung, Union-Logik & Resync-Strategie
|
|
2
|
-
|
|
3
|
-
## Status
|
|
4
|
-
|
|
5
|
-
- Status: Accepted
|
|
6
|
-
- Datum: 2025-12-15
|
|
7
|
-
|
|
8
|
-
## Kontext
|
|
9
|
-
|
|
10
|
-
Das Documentation-System-Plugin generiert mehrere Artefakte aus dem Code:
|
|
11
|
-
|
|
12
|
-
- `docs/modules/*.md` – Modul-Dokumentation pro Datei
|
|
13
|
-
- `docs/index/symbols.jsonl` – Symbol-Index (eine Zeile pro Symbol)
|
|
14
|
-
- `docs/system/DEPENDENCIES.md` & `docs/system/DEPENDENCY_GRAPH.md` – Abhängigkeitsübersicht und -Graph
|
|
15
|
-
- `docs/system/CHANGE_REPORT.md` – Änderungsreport
|
|
16
|
-
- `docs/.cache/*` – Caches für AST-Hashes, Signaturen, Output-Hashes, Dependencies
|
|
17
|
-
|
|
18
|
-
Der Scan-Scope wird durch `scanWorkspace` in `src/core/scanner.ts` definiert. Der Validator bewertet die Qualität der generierten Doku mit:
|
|
19
|
-
|
|
20
|
-
- Coverage-Schwellen aus `package.json` (`noyrax.coverageThresholds.*`)
|
|
21
|
-
- Signatur-Matching (`src/validator/signature-matching.ts`)
|
|
22
|
-
- Status-Berechnung (`computeValidationStatus` in `src/validator/status.ts`)
|
|
23
|
-
|
|
24
|
-
Die Generate-Pipeline (`generateDocumentationTs` in `src/extension.ts`) arbeitet **inkrementell**:
|
|
25
|
-
|
|
26
|
-
1. `scanWorkspace` → Liste aller scannbaren Dateien (`scannedAll`)
|
|
27
|
-
2. Optionaler Git-Diff → gefilterte Teilmenge (`scanned`)
|
|
28
|
-
3. AST-Cache (`loadAstHashCache`) → „unchanged“ Dateien werden nicht neu geparst
|
|
29
|
-
4. Parser (`TsJsParser`, `JsonYamlParser`, `PythonParser`) → neue Symbole & Dependencies (`allSymbols`, `allDependencies`)
|
|
30
|
-
5. Union-Bildung (`buildDependenciesUnionWithDebug`, `buildSymbolsUnion`)
|
|
31
|
-
6. Generierung von:
|
|
32
|
-
- `docs/modules/*` via `generatePerFileDocs`
|
|
33
|
-
- `docs/index/symbols.jsonl` via `buildIndexFromSymbols` / `writeJsonlIndex`
|
|
34
|
-
- `DEPENDENCIES.md` & `DEPENDENCY_GRAPH.md` via `generateDependencyOverview` / `generateMermaidGraph`
|
|
35
|
-
|
|
36
|
-
Im ursprünglichen Zustand wurde für `buildSymbolsUnion` die Menge `scannedFiles` aus der Git-/Cache-gefilterten Teilmenge `scanned` abgeleitet – nicht aus dem vollen Scan-Scope `scannedAll`.
|
|
37
|
-
|
|
38
|
-
## Problem
|
|
39
|
-
|
|
40
|
-
1. **Symbole verschwinden inkrementell aus dem Index**, obwohl Dateien noch existieren:
|
|
41
|
-
- In Läufen mit sehr kleinem `scanned` (z. B. 14 Dateien, alle „unchanged“) wurden keine neuen Symbole erzeugt (`allSymbols.length === 0`).
|
|
42
|
-
- `scannedFilesSet` wurde aus `scanned` gebaut.
|
|
43
|
-
- `buildSymbolsUnion` entfernt alle alten Symbole aus Dateien, die nicht in `scannedFilesSet` liegen – sie gelten wie „nicht mehr gescannt“ bzw. „deleted“.
|
|
44
|
-
- Ergebnis: Von zuvor 267 Symbolen im Index blieben nur noch ~92 übrig, obwohl der Workspace in Wirklichkeit 400+ Symbole enthielt.
|
|
45
|
-
|
|
46
|
-
2. **Scope-Erweiterung auf weitere produktive Verzeichnisse**:
|
|
47
|
-
- Der Scanner schließt standardmäßig mehrere Top-Level-Verzeichnisse aus (`demo`, `website`, `mcp`, `packages`, `action`, `docs`, `out`, `dist` etc.).
|
|
48
|
-
- Für das tatsächliche Produktivsystem (`src/` + `packages/` + `mcp` + `action`) bedeutet das:
|
|
49
|
-
- Wenn diese Verzeichnisse ausgeschlossen sind, fehlen Symbole im Index, in den Modul-Dokus und im Dependency-Graph.
|
|
50
|
-
|
|
51
|
-
3. **Veraltete Artefakte und Caches**:
|
|
52
|
-
- In `docs/modules`, `docs/index/symbols.jsonl`, `docs/system/*` und `.cache` lagen ältere Stände.
|
|
53
|
-
- Neue Läufe auf Basis eines geänderten Scopes (z. B. geöffnete Verzeichnisse) kombinierten alte und neue Informationen → Coverage- und Status-Anzeigen wurden „schief“.
|
|
54
|
-
|
|
55
|
-
4. **Validator-Status ROT bei reinen Coverage-Problemen**:
|
|
56
|
-
- `computeCoverage` generiert Fehlerstrings, wenn Coverage-Schwellen (`classes`, `interfaces`, `methods`, `functions`) unterschritten werden.
|
|
57
|
-
- `computeValidationStatus` behandelt diese Coverage-Errors wie echte Fehler und setzt den Gesamtstatus auf „red“, auch wenn:
|
|
58
|
-
- keine Signatur-Abweichungen existieren und
|
|
59
|
-
- keine Markdown-Fehler vorliegen.
|
|
60
|
-
|
|
61
|
-
## Entscheidung
|
|
62
|
-
|
|
63
|
-
1. **Scanner-Scope für produktiven Code**
|
|
64
|
-
|
|
65
|
-
- `scanWorkspace` bleibt der zentrale Mechanismus, um produktiven Code zu bestimmen:
|
|
66
|
-
- `src/` inklusive `core`, `cli`, `cache`, `drift`, `index`, `logging`, `parsers`, `ui`, `validator` wird vollständig gescannt.
|
|
67
|
-
- Zusätzlich werden `packages/`, `mcp/` und `action/` als produktive Quellverzeichnisse verstanden und in den Scan einbezogen.
|
|
68
|
-
- Sensible oder irrelevante Bereiche (z. B. `node_modules`, `.git`, `docs`, `out`, `dist`, Backups, `.ai-agent-context`, `.env`-Dateien) bleiben explizit ausgeschlossen.
|
|
69
|
-
|
|
70
|
-
2. **Union-Logik an den vollen Scan-Scope binden**
|
|
71
|
-
|
|
72
|
-
- Für `buildSymbolsUnion` wird `scannedFiles` aus **`scannedAll`** abgeleitet – nicht aus der ggf. per Git/Cache gefilterten Teilmenge `scanned`.
|
|
73
|
-
- Symbole werden nur noch entfernt, wenn:
|
|
74
|
-
- die Datei im aktuellen `scanWorkspace`-Ergebnis nicht mehr existiert (z. B. durch neue Excludes), oder
|
|
75
|
-
- Git sie als gelöscht meldet (`deletedFilesFromGit`).
|
|
76
|
-
- Inkrementelle Läufe (mit Git-Diff + AST-Cache) dürfen Symbole aus produktiven Dateien nicht als „deleted“ behandeln, solange diese Dateien weiterhin im `scannedAll`-Scope liegen.
|
|
77
|
-
|
|
78
|
-
3. **Resync-/Recovery-Strategie etablieren**
|
|
79
|
-
|
|
80
|
-
- Bei größeren Änderungen am Scan-Scope oder bei offensichtlich inkonsistenten Zahlen (z. B. niedrige Index-Symbolzahl vs. hoher `scan:cli`-Wert) wird ein expliziter **Resync** als Best Practice definiert:
|
|
81
|
-
- Löschen von:
|
|
82
|
-
- `docs/modules`
|
|
83
|
-
- `docs/index`
|
|
84
|
-
- `docs/system`
|
|
85
|
-
- `docs/.cache`
|
|
86
|
-
- Danach einen vollständigen Lauf (Full Cycle: Scan → Generate → Validate) ausführen.
|
|
87
|
-
- Dieser Prozess stellt sicher, dass alle Artefakte (Module-Doku, Symbol-Index, Dependencies, Change-Report, Caches) konsistent mit dem aktuellen Codezustand sind.
|
|
88
|
-
|
|
89
|
-
4. **Interpretation des Validierungsstatus**
|
|
90
|
-
|
|
91
|
-
- Die Implementierung von `computeValidationStatus` bleibt bewusst unverändert:
|
|
92
|
-
- Coverage-Unterschreitungen gelten weiterhin als **Fehler**, die den Gesamtstatus auf „red“ setzen.
|
|
93
|
-
- Für die Praxis wird festgehalten:
|
|
94
|
-
- Wenn Signatur-Abweichungen (`signatureMismatches`) und Markdown-Probleme (`markdownErrors`) 0 sind, deutet ein roter Status ausschließlich auf unzureichende Coverage hin – nicht auf inkonsistente oder fehlerhafte Dokumentation.
|
|
95
|
-
- Coverage ist damit ein Qualitätsgrad, kein reiner Funktions-Health-Indikator.
|
|
96
|
-
|
|
97
|
-
## Konsequenzen
|
|
98
|
-
|
|
99
|
-
### Positiv
|
|
100
|
-
|
|
101
|
-
- Symbole, Modul-Dokus und Dependency-Artefakte bleiben **stabil**, solange Dateien existieren und im Scan-Scope von `scanWorkspace` liegen.
|
|
102
|
-
- Die Symbolanzahl in `docs/index/symbols.jsonl` reflektiert den **gesamten produktiven Code** (inkl. `src/`, `packages/`, `mcp`, `action`) und nicht nur einen Git-Diff-Ausschnitt.
|
|
103
|
-
- Inkrementelle Läufe profitieren weiter von AST-/Output-/Dependencies-Caches, ohne versehentlich produktive Symbole zu „verlieren“.
|
|
104
|
-
- Der Resync-Mechanismus (gezieltes Löschen der Generierungsartefakte + Full Cycle) ist als offizielles Recovery-Pattern dokumentiert.
|
|
105
|
-
|
|
106
|
-
### Negativ / Trade-offs
|
|
107
|
-
|
|
108
|
-
- Die Union-Logik berücksichtigt für die Entscheidung „Symbol behalten oder verwerfen“ nun den vollen Scan-Scope:
|
|
109
|
-
- Git-Diff kann weiterhin die Parsing-Arbeit reduzieren, aber nicht mehr die Semantik, welche Dateien als „noch gültig“ gelten.
|
|
110
|
-
- Durch den größeren Symbol-Scope (mehr produktive Dateien) wird Coverage **strenger** wahrgenommen:
|
|
111
|
-
- Dokumentationslücken werden sichtbarer, was häufiger zu ROT führen kann, auch wenn technisch alles funktioniert.
|
|
112
|
-
|
|
113
|
-
## Auswirkungen auf zukünftige Arbeit
|
|
114
|
-
|
|
115
|
-
- Bei neuen Repos oder nach größeren Refactorings sollte früh ein Full Cycle laufen, um `docs/` und `.cache` in einen konsistenten Grundzustand zu bringen.
|
|
116
|
-
- Bei Änderungen an `DEFAULT_EXCLUDES` oder am produktiven Scope (z. B. Hinzunahme weiterer Packages) ist ein einmaliger Resync-Lauf empfehlenswert.
|
|
117
|
-
- Bei rotem Status ohne Signatur-/Markdown-Probleme:
|
|
118
|
-
- Entscheidungspunkt:
|
|
119
|
-
- Entweder Coverage durch zusätzliche Dokumentation anheben, oder
|
|
120
|
-
- Coverage-Schwellen in `noyrax.coverageThresholds.*` bewusst an das Projekt anpassen.
|
|
121
|
-
|
|
122
|
-
Diese ADR dient als Referenz für alle zukünftigen Änderungen an Scanner-Scope, Union-Logik und Resync-Mechanismen im Dokumentationssystem.
|
|
123
|
-
|
|
124
|
-
|