@esthernandez/vibe-doc 0.1.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.
- package/dist/checker/index.d.ts +34 -0
- package/dist/checker/index.d.ts.map +1 -0
- package/dist/checker/index.js +154 -0
- package/dist/checker/staleness.d.ts +26 -0
- package/dist/checker/staleness.d.ts.map +1 -0
- package/dist/checker/staleness.js +56 -0
- package/dist/classifier/index.d.ts +26 -0
- package/dist/classifier/index.d.ts.map +1 -0
- package/dist/classifier/index.js +146 -0
- package/dist/classifier/llm-prompt.d.ts +12 -0
- package/dist/classifier/llm-prompt.d.ts.map +1 -0
- package/dist/classifier/llm-prompt.js +123 -0
- package/dist/classifier/scoring-engine.d.ts +41 -0
- package/dist/classifier/scoring-engine.d.ts.map +1 -0
- package/dist/classifier/scoring-engine.js +197 -0
- package/dist/classifier/signals.d.ts +16 -0
- package/dist/classifier/signals.d.ts.map +1 -0
- package/dist/classifier/signals.js +305 -0
- package/dist/gap-analyzer/breadcrumbs.d.ts +18 -0
- package/dist/gap-analyzer/breadcrumbs.d.ts.map +1 -0
- package/dist/gap-analyzer/breadcrumbs.js +314 -0
- package/dist/gap-analyzer/index.d.ts +13 -0
- package/dist/gap-analyzer/index.d.ts.map +1 -0
- package/dist/gap-analyzer/index.js +88 -0
- package/dist/gap-analyzer/matrix.d.ts +29 -0
- package/dist/gap-analyzer/matrix.d.ts.map +1 -0
- package/dist/gap-analyzer/matrix.js +137 -0
- package/dist/gap-analyzer/tier-assigner.d.ts +22 -0
- package/dist/gap-analyzer/tier-assigner.d.ts.map +1 -0
- package/dist/gap-analyzer/tier-assigner.js +112 -0
- package/dist/generator/docx-writer.d.ts +15 -0
- package/dist/generator/docx-writer.d.ts.map +1 -0
- package/dist/generator/docx-writer.js +271 -0
- package/dist/generator/extractor.d.ts +11 -0
- package/dist/generator/extractor.d.ts.map +1 -0
- package/dist/generator/extractor.js +459 -0
- package/dist/generator/index.d.ts +25 -0
- package/dist/generator/index.d.ts.map +1 -0
- package/dist/generator/index.js +106 -0
- package/dist/generator/markdown-writer.d.ts +27 -0
- package/dist/generator/markdown-writer.d.ts.map +1 -0
- package/dist/generator/markdown-writer.js +85 -0
- package/dist/index.d.ts +7 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +372 -0
- package/dist/scanner/artifact-scanner.d.ts +16 -0
- package/dist/scanner/artifact-scanner.d.ts.map +1 -0
- package/dist/scanner/artifact-scanner.js +189 -0
- package/dist/scanner/code-scanner.d.ts +17 -0
- package/dist/scanner/code-scanner.d.ts.map +1 -0
- package/dist/scanner/code-scanner.js +69 -0
- package/dist/scanner/file-scanner.d.ts +16 -0
- package/dist/scanner/file-scanner.d.ts.map +1 -0
- package/dist/scanner/file-scanner.js +119 -0
- package/dist/scanner/git-scanner.d.ts +10 -0
- package/dist/scanner/git-scanner.d.ts.map +1 -0
- package/dist/scanner/git-scanner.js +120 -0
- package/dist/scanner/index.d.ts +15 -0
- package/dist/scanner/index.d.ts.map +1 -0
- package/dist/scanner/index.js +106 -0
- package/dist/state/index.d.ts +20 -0
- package/dist/state/index.d.ts.map +1 -0
- package/dist/state/index.js +141 -0
- package/dist/state/schema.d.ts +101 -0
- package/dist/state/schema.d.ts.map +1 -0
- package/dist/state/schema.js +6 -0
- package/dist/templates/embedded/adr.md +45 -0
- package/dist/templates/embedded/api-spec.md +55 -0
- package/dist/templates/embedded/data-model.md +55 -0
- package/dist/templates/embedded/deployment-procedure.md +63 -0
- package/dist/templates/embedded/runbook.md +55 -0
- package/dist/templates/embedded/test-plan.md +55 -0
- package/dist/templates/embedded/threat-model.md +47 -0
- package/dist/templates/index.d.ts +20 -0
- package/dist/templates/index.d.ts.map +1 -0
- package/dist/templates/index.js +106 -0
- package/dist/templates/registry.d.ts +31 -0
- package/dist/templates/registry.d.ts.map +1 -0
- package/dist/templates/registry.js +172 -0
- package/dist/templates/renderer.d.ts +26 -0
- package/dist/templates/renderer.d.ts.map +1 -0
- package/dist/templates/renderer.js +145 -0
- package/dist/utils/language-detect.d.ts +14 -0
- package/dist/utils/language-detect.d.ts.map +1 -0
- package/dist/utils/language-detect.js +58 -0
- package/dist/utils/logger.d.ts +16 -0
- package/dist/utils/logger.d.ts.map +1 -0
- package/dist/utils/logger.js +35 -0
- package/dist/versioning/differ.d.ts +20 -0
- package/dist/versioning/differ.d.ts.map +1 -0
- package/dist/versioning/differ.js +160 -0
- package/dist/versioning/index.d.ts +44 -0
- package/dist/versioning/index.d.ts.map +1 -0
- package/dist/versioning/index.js +165 -0
- package/package.json +40 -0
|
@@ -0,0 +1,314 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Breadcrumbs Module
|
|
4
|
+
* Search heuristics for finding evidence of documentation in artifacts
|
|
5
|
+
*/
|
|
6
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
+
exports.getBreadcrumbs = getBreadcrumbs;
|
|
8
|
+
const logger_1 = require("../utils/logger");
|
|
9
|
+
/**
|
|
10
|
+
* Get breadcrumbs for a specific doc type
|
|
11
|
+
*/
|
|
12
|
+
function getBreadcrumbs(docType) {
|
|
13
|
+
const breadcrumbs = {
|
|
14
|
+
adr: {
|
|
15
|
+
docType: 'adr',
|
|
16
|
+
keywords: [
|
|
17
|
+
'decision',
|
|
18
|
+
'architecture',
|
|
19
|
+
'trade-off',
|
|
20
|
+
'rationale',
|
|
21
|
+
'consequence',
|
|
22
|
+
'alternative',
|
|
23
|
+
'context',
|
|
24
|
+
'status',
|
|
25
|
+
],
|
|
26
|
+
filePatterns: ['**/docs/adr/**', '**/adr/**', '**/decisions/**', '**/ADR*.md'],
|
|
27
|
+
gitPatterns: ['adr:', 'arch:', 'decision:'],
|
|
28
|
+
codePatterns: ['ADR', 'architecture decision', 'trade-off', 'rationale'],
|
|
29
|
+
requiredSections: [
|
|
30
|
+
'status',
|
|
31
|
+
'context',
|
|
32
|
+
'decision',
|
|
33
|
+
'consequences',
|
|
34
|
+
'alternatives',
|
|
35
|
+
],
|
|
36
|
+
gapQuestions: [
|
|
37
|
+
'What major architectural decisions have you made?',
|
|
38
|
+
'What trade-offs did you consider and reject?',
|
|
39
|
+
'What were the alternatives to your current architecture?',
|
|
40
|
+
],
|
|
41
|
+
},
|
|
42
|
+
runbook: {
|
|
43
|
+
docType: 'runbook',
|
|
44
|
+
keywords: [
|
|
45
|
+
'restart',
|
|
46
|
+
'rollback',
|
|
47
|
+
'deploy',
|
|
48
|
+
'monitor',
|
|
49
|
+
'health check',
|
|
50
|
+
'incident',
|
|
51
|
+
'on-call',
|
|
52
|
+
'procedure',
|
|
53
|
+
'emergency',
|
|
54
|
+
'escalation',
|
|
55
|
+
],
|
|
56
|
+
filePatterns: [
|
|
57
|
+
'**/docs/runbooks/**',
|
|
58
|
+
'**/runbook/**',
|
|
59
|
+
'**/ops/**',
|
|
60
|
+
'**/RUNBOOK*.md',
|
|
61
|
+
],
|
|
62
|
+
gitPatterns: ['fix:', 'hotfix:', 'revert:', 'ops:'],
|
|
63
|
+
codePatterns: [
|
|
64
|
+
'healthCheck',
|
|
65
|
+
'gracefulShutdown',
|
|
66
|
+
'process.exit',
|
|
67
|
+
'retry',
|
|
68
|
+
'circuitBreaker',
|
|
69
|
+
'liveness',
|
|
70
|
+
],
|
|
71
|
+
requiredSections: [
|
|
72
|
+
'service-overview',
|
|
73
|
+
'startup-procedure',
|
|
74
|
+
'health-checks',
|
|
75
|
+
'common-issues',
|
|
76
|
+
'rollback-procedure',
|
|
77
|
+
'escalation-path',
|
|
78
|
+
],
|
|
79
|
+
gapQuestions: [
|
|
80
|
+
'What is the process for restarting the service?',
|
|
81
|
+
'Who gets paged when something breaks?',
|
|
82
|
+
'What is your rollback procedure?',
|
|
83
|
+
'What are the most common issues and fixes?',
|
|
84
|
+
],
|
|
85
|
+
},
|
|
86
|
+
'threat-model': {
|
|
87
|
+
docType: 'threat-model',
|
|
88
|
+
keywords: [
|
|
89
|
+
'threat',
|
|
90
|
+
'risk',
|
|
91
|
+
'vulnerability',
|
|
92
|
+
'attack',
|
|
93
|
+
'security',
|
|
94
|
+
'mitigation',
|
|
95
|
+
'trust boundary',
|
|
96
|
+
'adversary',
|
|
97
|
+
'exploit',
|
|
98
|
+
],
|
|
99
|
+
filePatterns: ['**/docs/security/**', '**/threat/**', '**/THREAT*.md'],
|
|
100
|
+
gitPatterns: ['security:', 'vuln:', 'risk:'],
|
|
101
|
+
codePatterns: [
|
|
102
|
+
'authenticate',
|
|
103
|
+
'authorize',
|
|
104
|
+
'encrypt',
|
|
105
|
+
'sanitize',
|
|
106
|
+
'validate',
|
|
107
|
+
'csrf',
|
|
108
|
+
'xss',
|
|
109
|
+
],
|
|
110
|
+
requiredSections: [
|
|
111
|
+
'asset-scope',
|
|
112
|
+
'threat-actors',
|
|
113
|
+
'threat-scenarios',
|
|
114
|
+
'mitigations',
|
|
115
|
+
'residual-risks',
|
|
116
|
+
],
|
|
117
|
+
gapQuestions: [
|
|
118
|
+
'What are your most valuable assets that need protection?',
|
|
119
|
+
'What types of attacks are you most concerned about?',
|
|
120
|
+
'How do you authenticate users and services?',
|
|
121
|
+
'What encryption and secrets management do you use?',
|
|
122
|
+
],
|
|
123
|
+
},
|
|
124
|
+
'api-spec': {
|
|
125
|
+
docType: 'api-spec',
|
|
126
|
+
keywords: [
|
|
127
|
+
'endpoint',
|
|
128
|
+
'request',
|
|
129
|
+
'response',
|
|
130
|
+
'parameter',
|
|
131
|
+
'authentication',
|
|
132
|
+
'error',
|
|
133
|
+
'status code',
|
|
134
|
+
'schema',
|
|
135
|
+
],
|
|
136
|
+
filePatterns: [
|
|
137
|
+
'**/swagger.json',
|
|
138
|
+
'**/openapi.yaml',
|
|
139
|
+
'**/docs/api/**',
|
|
140
|
+
'**/API*.md',
|
|
141
|
+
],
|
|
142
|
+
gitPatterns: ['api:', 'endpoint:'],
|
|
143
|
+
codePatterns: [
|
|
144
|
+
'@route',
|
|
145
|
+
'@get',
|
|
146
|
+
'@post',
|
|
147
|
+
'@put',
|
|
148
|
+
'@delete',
|
|
149
|
+
'router.get',
|
|
150
|
+
'app.post',
|
|
151
|
+
],
|
|
152
|
+
requiredSections: [
|
|
153
|
+
'base-url',
|
|
154
|
+
'endpoints',
|
|
155
|
+
'request-format',
|
|
156
|
+
'response-format',
|
|
157
|
+
'error-handling',
|
|
158
|
+
'authentication',
|
|
159
|
+
],
|
|
160
|
+
gapQuestions: [
|
|
161
|
+
'What are your primary API endpoints?',
|
|
162
|
+
'What request/response formats do you use?',
|
|
163
|
+
'How do you handle authentication and authorization?',
|
|
164
|
+
'What error codes and messages do you return?',
|
|
165
|
+
],
|
|
166
|
+
},
|
|
167
|
+
'deployment-procedure': {
|
|
168
|
+
docType: 'deployment-procedure',
|
|
169
|
+
keywords: [
|
|
170
|
+
'deploy',
|
|
171
|
+
'release',
|
|
172
|
+
'build',
|
|
173
|
+
'pipeline',
|
|
174
|
+
'ci/cd',
|
|
175
|
+
'environment',
|
|
176
|
+
'staging',
|
|
177
|
+
'production',
|
|
178
|
+
'rollback',
|
|
179
|
+
],
|
|
180
|
+
filePatterns: [
|
|
181
|
+
'**/.github/workflows/**',
|
|
182
|
+
'**/deploy/**',
|
|
183
|
+
'**/docs/deployment/**',
|
|
184
|
+
'**/DEPLOY*.md',
|
|
185
|
+
],
|
|
186
|
+
gitPatterns: ['deploy:', 'release:', 'ci:'],
|
|
187
|
+
codePatterns: [
|
|
188
|
+
'docker build',
|
|
189
|
+
'kubectl apply',
|
|
190
|
+
'terraform apply',
|
|
191
|
+
'database migration',
|
|
192
|
+
],
|
|
193
|
+
requiredSections: [
|
|
194
|
+
'prerequisites',
|
|
195
|
+
'build-process',
|
|
196
|
+
'environment-setup',
|
|
197
|
+
'testing-before-deploy',
|
|
198
|
+
'deployment-steps',
|
|
199
|
+
'post-deployment-checks',
|
|
200
|
+
'rollback-procedure',
|
|
201
|
+
],
|
|
202
|
+
gapQuestions: [
|
|
203
|
+
'What is your build process?',
|
|
204
|
+
'How do you deploy to different environments?',
|
|
205
|
+
'What tests run before deployment?',
|
|
206
|
+
'How do you handle database migrations?',
|
|
207
|
+
'What is your rollback procedure?',
|
|
208
|
+
],
|
|
209
|
+
},
|
|
210
|
+
'test-plan': {
|
|
211
|
+
docType: 'test-plan',
|
|
212
|
+
keywords: [
|
|
213
|
+
'test',
|
|
214
|
+
'unit',
|
|
215
|
+
'integration',
|
|
216
|
+
'e2e',
|
|
217
|
+
'coverage',
|
|
218
|
+
'quality',
|
|
219
|
+
'testing strategy',
|
|
220
|
+
'acceptance criteria',
|
|
221
|
+
],
|
|
222
|
+
filePatterns: [
|
|
223
|
+
'**/*.test.ts',
|
|
224
|
+
'**/*.spec.ts',
|
|
225
|
+
'**/test/**',
|
|
226
|
+
'**/tests/**',
|
|
227
|
+
'**/TEST*.md',
|
|
228
|
+
],
|
|
229
|
+
gitPatterns: ['test:', 'fix:', 'test-fix:'],
|
|
230
|
+
codePatterns: [
|
|
231
|
+
'describe',
|
|
232
|
+
'it(',
|
|
233
|
+
'test(',
|
|
234
|
+
'expect',
|
|
235
|
+
'assert',
|
|
236
|
+
'mock',
|
|
237
|
+
'stub',
|
|
238
|
+
],
|
|
239
|
+
requiredSections: [
|
|
240
|
+
'test-strategy',
|
|
241
|
+
'unit-tests',
|
|
242
|
+
'integration-tests',
|
|
243
|
+
'e2e-tests',
|
|
244
|
+
'performance-tests',
|
|
245
|
+
'coverage-targets',
|
|
246
|
+
],
|
|
247
|
+
gapQuestions: [
|
|
248
|
+
'What is your testing strategy?',
|
|
249
|
+
'What is your code coverage target?',
|
|
250
|
+
'What critical paths do you test end-to-end?',
|
|
251
|
+
'How do you test performance?',
|
|
252
|
+
'How do you test third-party integrations?',
|
|
253
|
+
],
|
|
254
|
+
},
|
|
255
|
+
'data-model': {
|
|
256
|
+
docType: 'data-model',
|
|
257
|
+
keywords: [
|
|
258
|
+
'schema',
|
|
259
|
+
'table',
|
|
260
|
+
'column',
|
|
261
|
+
'entity',
|
|
262
|
+
'relationship',
|
|
263
|
+
'constraint',
|
|
264
|
+
'index',
|
|
265
|
+
'type',
|
|
266
|
+
'field',
|
|
267
|
+
],
|
|
268
|
+
filePatterns: [
|
|
269
|
+
'**/migrations/**',
|
|
270
|
+
'**/schema/**',
|
|
271
|
+
'**/models/**',
|
|
272
|
+
'**/DATA*.md',
|
|
273
|
+
],
|
|
274
|
+
gitPatterns: ['schema:', 'model:', 'migrate:'],
|
|
275
|
+
codePatterns: [
|
|
276
|
+
'CREATE TABLE',
|
|
277
|
+
'ALTER TABLE',
|
|
278
|
+
'interface',
|
|
279
|
+
'type',
|
|
280
|
+
'@entity',
|
|
281
|
+
'@model',
|
|
282
|
+
],
|
|
283
|
+
requiredSections: [
|
|
284
|
+
'entity-overview',
|
|
285
|
+
'table-schemas',
|
|
286
|
+
'relationships',
|
|
287
|
+
'constraints',
|
|
288
|
+
'indexes',
|
|
289
|
+
'migration-strategy',
|
|
290
|
+
],
|
|
291
|
+
gapQuestions: [
|
|
292
|
+
'What are your main entities/tables?',
|
|
293
|
+
'What are the relationships between them?',
|
|
294
|
+
'What constraints and validation rules exist?',
|
|
295
|
+
'How do you handle schema migrations?',
|
|
296
|
+
'What indexing strategy do you use?',
|
|
297
|
+
],
|
|
298
|
+
},
|
|
299
|
+
};
|
|
300
|
+
const breadcrumb = breadcrumbs[docType];
|
|
301
|
+
if (!breadcrumb) {
|
|
302
|
+
logger_1.logger.warn('Unknown doc type for breadcrumbs', { docType });
|
|
303
|
+
return {
|
|
304
|
+
docType,
|
|
305
|
+
keywords: [],
|
|
306
|
+
filePatterns: [],
|
|
307
|
+
gitPatterns: [],
|
|
308
|
+
codePatterns: [],
|
|
309
|
+
requiredSections: [],
|
|
310
|
+
gapQuestions: [],
|
|
311
|
+
};
|
|
312
|
+
}
|
|
313
|
+
return breadcrumb;
|
|
314
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Gap Analyzer Orchestrator
|
|
3
|
+
* Main entry point for documentation gap analysis
|
|
4
|
+
*/
|
|
5
|
+
import { ArtifactInventory, Classification, GapReport } from '../state/schema';
|
|
6
|
+
/**
|
|
7
|
+
* Analyze documentation gaps based on classification
|
|
8
|
+
*/
|
|
9
|
+
export declare function analyzeGaps(classification: Classification, inventory: ArtifactInventory): GapReport;
|
|
10
|
+
export { getRequiredDocs } from './matrix';
|
|
11
|
+
export { getBreadcrumbs } from './breadcrumbs';
|
|
12
|
+
export { assessGaps } from './tier-assigner';
|
|
13
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/gap-analyzer/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,iBAAiB,EAAE,cAAc,EAAE,SAAS,EAAW,MAAM,iBAAiB,CAAC;AAMxF;;GAEG;AACH,wBAAgB,WAAW,CACzB,cAAc,EAAE,cAAc,EAC9B,SAAS,EAAE,iBAAiB,GAC3B,SAAS,CA0CX;AAwCD,OAAO,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAC3C,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAC/C,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC"}
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Gap Analyzer Orchestrator
|
|
4
|
+
* Main entry point for documentation gap analysis
|
|
5
|
+
*/
|
|
6
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
+
exports.assessGaps = exports.getBreadcrumbs = exports.getRequiredDocs = void 0;
|
|
8
|
+
exports.analyzeGaps = analyzeGaps;
|
|
9
|
+
const logger_1 = require("../utils/logger");
|
|
10
|
+
const matrix_1 = require("./matrix");
|
|
11
|
+
const breadcrumbs_1 = require("./breadcrumbs");
|
|
12
|
+
const tier_assigner_1 = require("./tier-assigner");
|
|
13
|
+
/**
|
|
14
|
+
* Analyze documentation gaps based on classification
|
|
15
|
+
*/
|
|
16
|
+
function analyzeGaps(classification, inventory) {
|
|
17
|
+
logger_1.logger.info('Starting gap analysis', {
|
|
18
|
+
category: classification.primaryCategory,
|
|
19
|
+
contexts: classification.contextModifiers,
|
|
20
|
+
});
|
|
21
|
+
// Step 1: Get required docs for this classification
|
|
22
|
+
const contexts = classification.contextModifiers;
|
|
23
|
+
const requirements = (0, matrix_1.getRequiredDocs)(classification.primaryCategory, contexts);
|
|
24
|
+
// Step 2: Get breadcrumbs for all doc types
|
|
25
|
+
const breadcrumbsMap = new Map();
|
|
26
|
+
const docTypes = new Set(requirements.map((r) => r.docType));
|
|
27
|
+
for (const docType of docTypes) {
|
|
28
|
+
breadcrumbsMap.set(docType, (0, breadcrumbs_1.getBreadcrumbs)(docType));
|
|
29
|
+
}
|
|
30
|
+
// Step 3: Run tier assigner to assess gaps
|
|
31
|
+
const gaps = (0, tier_assigner_1.assessGaps)(requirements, inventory, breadcrumbsMap);
|
|
32
|
+
// Step 4: Calculate summary statistics
|
|
33
|
+
const summary = calculateSummary(gaps, inventory);
|
|
34
|
+
logger_1.logger.info('Gap analysis complete', {
|
|
35
|
+
totalGaps: gaps.length,
|
|
36
|
+
coveragePercent: summary.coveragePercent,
|
|
37
|
+
docsMissing: summary.docsMissing,
|
|
38
|
+
});
|
|
39
|
+
return {
|
|
40
|
+
summary,
|
|
41
|
+
gaps: gaps.map((gap) => ({
|
|
42
|
+
docType: gap.docType,
|
|
43
|
+
tier: gap.tier,
|
|
44
|
+
domain: classification.primaryCategory,
|
|
45
|
+
artifactsScanned: gap.artifactsScanned,
|
|
46
|
+
found: gap.found,
|
|
47
|
+
missing: gap.missing,
|
|
48
|
+
rationale: gap.rationale,
|
|
49
|
+
})),
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* Calculate summary statistics from gaps
|
|
54
|
+
*/
|
|
55
|
+
function calculateSummary(gaps, inventory) {
|
|
56
|
+
const totalArtifacts = inventory.totalArtifacts;
|
|
57
|
+
let docsCovered = 0; // Docs with all sections found
|
|
58
|
+
let docsPartial = 0; // Docs with some sections found
|
|
59
|
+
let docsMissing = 0; // Docs with no sections found
|
|
60
|
+
for (const gap of gaps) {
|
|
61
|
+
if (gap.found === 0) {
|
|
62
|
+
docsMissing++;
|
|
63
|
+
}
|
|
64
|
+
else if (gap.missing === 0) {
|
|
65
|
+
docsCovered++;
|
|
66
|
+
}
|
|
67
|
+
else {
|
|
68
|
+
docsPartial++;
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
const totalRequiredDocs = gaps.length;
|
|
72
|
+
const coveragePercent = totalRequiredDocs > 0
|
|
73
|
+
? Math.round(((docsCovered + docsPartial * 0.5) / totalRequiredDocs) * 100)
|
|
74
|
+
: 0;
|
|
75
|
+
return {
|
|
76
|
+
totalArtifacts,
|
|
77
|
+
docsCovered,
|
|
78
|
+
docsPartial,
|
|
79
|
+
docsMissing,
|
|
80
|
+
coveragePercent,
|
|
81
|
+
};
|
|
82
|
+
}
|
|
83
|
+
var matrix_2 = require("./matrix");
|
|
84
|
+
Object.defineProperty(exports, "getRequiredDocs", { enumerable: true, get: function () { return matrix_2.getRequiredDocs; } });
|
|
85
|
+
var breadcrumbs_2 = require("./breadcrumbs");
|
|
86
|
+
Object.defineProperty(exports, "getBreadcrumbs", { enumerable: true, get: function () { return breadcrumbs_2.getBreadcrumbs; } });
|
|
87
|
+
var tier_assigner_2 = require("./tier-assigner");
|
|
88
|
+
Object.defineProperty(exports, "assessGaps", { enumerable: true, get: function () { return tier_assigner_2.assessGaps; } });
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Documentation Matrix
|
|
3
|
+
* Defines required documentation types per category x context
|
|
4
|
+
*/
|
|
5
|
+
export declare enum DocType {
|
|
6
|
+
ADR = "adr",
|
|
7
|
+
Runbook = "runbook",
|
|
8
|
+
ThreatModel = "threat-model",
|
|
9
|
+
APISpec = "api-spec",
|
|
10
|
+
DeploymentProcedure = "deployment-procedure",
|
|
11
|
+
TestPlan = "test-plan",
|
|
12
|
+
DataModel = "data-model"
|
|
13
|
+
}
|
|
14
|
+
export declare enum Tier {
|
|
15
|
+
Required = "required",
|
|
16
|
+
Recommended = "recommended",
|
|
17
|
+
Optional = "optional"
|
|
18
|
+
}
|
|
19
|
+
export interface DocRequirement {
|
|
20
|
+
docType: DocType;
|
|
21
|
+
tier: Tier;
|
|
22
|
+
category: string;
|
|
23
|
+
contexts: string[];
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Get required documentation types for a category and contexts
|
|
27
|
+
*/
|
|
28
|
+
export declare function getRequiredDocs(category: string, contexts: string[]): DocRequirement[];
|
|
29
|
+
//# sourceMappingURL=matrix.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"matrix.d.ts","sourceRoot":"","sources":["../../src/gap-analyzer/matrix.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,oBAAY,OAAO;IACjB,GAAG,QAAQ;IACX,OAAO,YAAY;IACnB,WAAW,iBAAiB;IAC5B,OAAO,aAAa;IACpB,mBAAmB,yBAAyB;IAC5C,QAAQ,cAAc;IACtB,SAAS,eAAe;CACzB;AAED,oBAAY,IAAI;IACd,QAAQ,aAAa;IACrB,WAAW,gBAAgB;IAC3B,QAAQ,aAAa;CACtB;AAED,MAAM,WAAW,cAAc;IAC7B,OAAO,EAAE,OAAO,CAAC;IACjB,IAAI,EAAE,IAAI,CAAC;IACX,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,EAAE,CAAC;CACpB;AAuED;;GAEG;AACH,wBAAgB,eAAe,CAC7B,QAAQ,EAAE,MAAM,EAChB,QAAQ,EAAE,MAAM,EAAE,GACjB,cAAc,EAAE,CAmDlB"}
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Documentation Matrix
|
|
4
|
+
* Defines required documentation types per category x context
|
|
5
|
+
*/
|
|
6
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
+
exports.Tier = exports.DocType = void 0;
|
|
8
|
+
exports.getRequiredDocs = getRequiredDocs;
|
|
9
|
+
const logger_1 = require("../utils/logger");
|
|
10
|
+
var DocType;
|
|
11
|
+
(function (DocType) {
|
|
12
|
+
DocType["ADR"] = "adr";
|
|
13
|
+
DocType["Runbook"] = "runbook";
|
|
14
|
+
DocType["ThreatModel"] = "threat-model";
|
|
15
|
+
DocType["APISpec"] = "api-spec";
|
|
16
|
+
DocType["DeploymentProcedure"] = "deployment-procedure";
|
|
17
|
+
DocType["TestPlan"] = "test-plan";
|
|
18
|
+
DocType["DataModel"] = "data-model";
|
|
19
|
+
})(DocType || (exports.DocType = DocType = {}));
|
|
20
|
+
var Tier;
|
|
21
|
+
(function (Tier) {
|
|
22
|
+
Tier["Required"] = "required";
|
|
23
|
+
Tier["Recommended"] = "recommended";
|
|
24
|
+
Tier["Optional"] = "optional";
|
|
25
|
+
})(Tier || (exports.Tier = Tier = {}));
|
|
26
|
+
/**
|
|
27
|
+
* Base tier assignments per category
|
|
28
|
+
*/
|
|
29
|
+
const BASE_MATRIX = {
|
|
30
|
+
[DocType.ADR]: {
|
|
31
|
+
WebApplication: Tier.Recommended,
|
|
32
|
+
APIMicroservice: Tier.Recommended,
|
|
33
|
+
DataPipeline: Tier.Recommended,
|
|
34
|
+
InfrastructurePlatform: Tier.Recommended,
|
|
35
|
+
MobileApplication: Tier.Recommended,
|
|
36
|
+
AIMLSystem: Tier.Recommended,
|
|
37
|
+
IntegrationConnector: Tier.Recommended,
|
|
38
|
+
},
|
|
39
|
+
[DocType.Runbook]: {
|
|
40
|
+
WebApplication: Tier.Required,
|
|
41
|
+
APIMicroservice: Tier.Required,
|
|
42
|
+
DataPipeline: Tier.Required,
|
|
43
|
+
InfrastructurePlatform: Tier.Required,
|
|
44
|
+
MobileApplication: Tier.Required,
|
|
45
|
+
AIMLSystem: Tier.Required,
|
|
46
|
+
IntegrationConnector: Tier.Recommended,
|
|
47
|
+
},
|
|
48
|
+
[DocType.ThreatModel]: {
|
|
49
|
+
WebApplication: Tier.Recommended,
|
|
50
|
+
APIMicroservice: Tier.Required,
|
|
51
|
+
DataPipeline: Tier.Recommended,
|
|
52
|
+
InfrastructurePlatform: Tier.Recommended,
|
|
53
|
+
MobileApplication: Tier.Required,
|
|
54
|
+
AIMLSystem: Tier.Required,
|
|
55
|
+
IntegrationConnector: Tier.Recommended,
|
|
56
|
+
},
|
|
57
|
+
[DocType.APISpec]: {
|
|
58
|
+
WebApplication: Tier.Required,
|
|
59
|
+
APIMicroservice: Tier.Required,
|
|
60
|
+
DataPipeline: Tier.Optional,
|
|
61
|
+
InfrastructurePlatform: Tier.Optional,
|
|
62
|
+
MobileApplication: Tier.Recommended,
|
|
63
|
+
AIMLSystem: Tier.Recommended,
|
|
64
|
+
IntegrationConnector: Tier.Required,
|
|
65
|
+
},
|
|
66
|
+
[DocType.DeploymentProcedure]: {
|
|
67
|
+
WebApplication: Tier.Required,
|
|
68
|
+
APIMicroservice: Tier.Required,
|
|
69
|
+
DataPipeline: Tier.Required,
|
|
70
|
+
InfrastructurePlatform: Tier.Required,
|
|
71
|
+
MobileApplication: Tier.Required,
|
|
72
|
+
AIMLSystem: Tier.Required,
|
|
73
|
+
IntegrationConnector: Tier.Recommended,
|
|
74
|
+
},
|
|
75
|
+
[DocType.TestPlan]: {
|
|
76
|
+
WebApplication: Tier.Recommended,
|
|
77
|
+
APIMicroservice: Tier.Recommended,
|
|
78
|
+
DataPipeline: Tier.Required,
|
|
79
|
+
InfrastructurePlatform: Tier.Recommended,
|
|
80
|
+
MobileApplication: Tier.Required,
|
|
81
|
+
AIMLSystem: Tier.Required,
|
|
82
|
+
IntegrationConnector: Tier.Recommended,
|
|
83
|
+
},
|
|
84
|
+
[DocType.DataModel]: {
|
|
85
|
+
WebApplication: Tier.Required,
|
|
86
|
+
APIMicroservice: Tier.Recommended,
|
|
87
|
+
DataPipeline: Tier.Required,
|
|
88
|
+
InfrastructurePlatform: Tier.Optional,
|
|
89
|
+
MobileApplication: Tier.Recommended,
|
|
90
|
+
AIMLSystem: Tier.Required,
|
|
91
|
+
IntegrationConnector: Tier.Optional,
|
|
92
|
+
},
|
|
93
|
+
};
|
|
94
|
+
/**
|
|
95
|
+
* Get required documentation types for a category and contexts
|
|
96
|
+
*/
|
|
97
|
+
function getRequiredDocs(category, contexts) {
|
|
98
|
+
const requirements = [];
|
|
99
|
+
for (const docType of Object.values(DocType)) {
|
|
100
|
+
let tier = BASE_MATRIX[docType][category] || Tier.Optional;
|
|
101
|
+
// Apply context modifiers
|
|
102
|
+
if (contexts.includes('Regulated')) {
|
|
103
|
+
// Security-related docs to Required for regulated
|
|
104
|
+
if (docType === DocType.ThreatModel ||
|
|
105
|
+
docType === DocType.DeploymentProcedure ||
|
|
106
|
+
docType === DocType.ADR) {
|
|
107
|
+
tier = Tier.Required;
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
if (contexts.includes('CustomerFacing')) {
|
|
111
|
+
// Customer-facing requires ops and quality docs
|
|
112
|
+
if (docType === DocType.Runbook ||
|
|
113
|
+
docType === DocType.APISpec ||
|
|
114
|
+
docType === DocType.TestPlan) {
|
|
115
|
+
tier = Tier.Required;
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
if (contexts.includes('MultiTenant')) {
|
|
119
|
+
// MultiTenant requires security and data model docs
|
|
120
|
+
if (docType === DocType.ThreatModel || docType === DocType.DataModel) {
|
|
121
|
+
tier = Tier.Required;
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
requirements.push({
|
|
125
|
+
docType,
|
|
126
|
+
tier,
|
|
127
|
+
category,
|
|
128
|
+
contexts,
|
|
129
|
+
});
|
|
130
|
+
}
|
|
131
|
+
logger_1.logger.info('Required docs retrieved', {
|
|
132
|
+
category,
|
|
133
|
+
contextCount: contexts.length,
|
|
134
|
+
docCount: requirements.length,
|
|
135
|
+
});
|
|
136
|
+
return requirements;
|
|
137
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Tier Assigner Module
|
|
3
|
+
* Assesses gaps based on breadcrumb searches and requirement analysis
|
|
4
|
+
*/
|
|
5
|
+
import { ArtifactInventory } from '../state/schema';
|
|
6
|
+
import { DocRequirement, Tier } from './matrix';
|
|
7
|
+
import { Breadcrumb } from './breadcrumbs';
|
|
8
|
+
export interface Gap {
|
|
9
|
+
docType: string;
|
|
10
|
+
tier: Tier;
|
|
11
|
+
category: string;
|
|
12
|
+
artifactsScanned: number;
|
|
13
|
+
found: number;
|
|
14
|
+
missing: number;
|
|
15
|
+
rationale: string;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Assess documentation gaps based on artifact inventory
|
|
19
|
+
*/
|
|
20
|
+
export declare function assessGaps(requirements: DocRequirement[], inventory: ArtifactInventory, breadcrumbs: Map<string, Breadcrumb>): Gap[];
|
|
21
|
+
export { getBreadcrumbs } from './breadcrumbs';
|
|
22
|
+
//# sourceMappingURL=tier-assigner.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tier-assigner.d.ts","sourceRoot":"","sources":["../../src/gap-analyzer/tier-assigner.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AAEpD,OAAO,EAAE,cAAc,EAAE,IAAI,EAAE,MAAM,UAAU,CAAC;AAChD,OAAO,EAAkB,UAAU,EAAE,MAAM,eAAe,CAAC;AAE3D,MAAM,WAAW,GAAG;IAClB,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,IAAI,CAAC;IACX,QAAQ,EAAE,MAAM,CAAC;IACjB,gBAAgB,EAAE,MAAM,CAAC;IACzB,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC;CACnB;AAED;;GAEG;AACH,wBAAgB,UAAU,CACxB,YAAY,EAAE,cAAc,EAAE,EAC9B,SAAS,EAAE,iBAAiB,EAC5B,WAAW,EAAE,GAAG,CAAC,MAAM,EAAE,UAAU,CAAC,GACnC,GAAG,EAAE,CA+BP;AAmGD,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC"}
|