@akjamie/agentic-sdlc 1.9.3 → 1.11.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/README.md +24 -21
- package/assets/commands/asdlc-apply.md +1 -1
- package/assets/commands/asdlc-new.md +1 -1
- package/assets/skills/asdlc-intake/SKILL.md +30 -0
- package/assets/skills/asdlc-new/SKILL.md +13 -9
- package/package.json +1 -1
- package/src/assess/semantics.js +22 -3
- package/src/commands/apply.js +77 -0
- package/src/commands/approve.js +24 -12
- package/src/commands/archive.js +7 -0
- package/src/commands/init.js +100 -0
- package/src/commands/lint.js +95 -5
- package/src/commands/new.js +104 -25
- package/src/commands/pr.js +1 -0
- package/src/commands/status.js +19 -1
- package/src/commands/test.js +5 -0
- package/src/commands/verify.js +151 -9
- package/src/lib/intake.js +441 -0
- package/src/lib/schema.js +12 -4
- package/src/lib/telemetry.js +363 -0
- package/src/lib/triage.js +433 -0
package/src/lib/schema.js
CHANGED
|
@@ -35,10 +35,18 @@ export function installSchema(opts = {}) {
|
|
|
35
35
|
const installed = readInstalledVersion(opts);
|
|
36
36
|
if (installed) return dest;
|
|
37
37
|
}
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
38
|
+
try {
|
|
39
|
+
removeDir(dest); // always replace -> no stale half-copies
|
|
40
|
+
ensureDir(globalSchemasDir(opts));
|
|
41
|
+
copyTree(schemaAssetDir, dest);
|
|
42
|
+
return dest;
|
|
43
|
+
} catch (err) {
|
|
44
|
+
if (err && (err.code === 'EPERM' || err.code === 'EACCES')) {
|
|
45
|
+
const xdgBase = ensureRuntimeSchemaXdgDir();
|
|
46
|
+
return path.join(xdgBase, 'openspec', 'schemas', SCHEMA_NAME);
|
|
47
|
+
}
|
|
48
|
+
throw err;
|
|
49
|
+
}
|
|
42
50
|
}
|
|
43
51
|
|
|
44
52
|
export function readInstalledVersion(opts = {}) {
|
|
@@ -0,0 +1,363 @@
|
|
|
1
|
+
import fs from 'node:fs';
|
|
2
|
+
import path from 'node:path';
|
|
3
|
+
import { git } from './git.js';
|
|
4
|
+
import { readYaml } from './yaml.js';
|
|
5
|
+
import { readText, exists } from './fs.js';
|
|
6
|
+
import { openspecDir } from './paths.js';
|
|
7
|
+
|
|
8
|
+
const GITIGNORE_CONTENT = `# Autogenerated by asdlc telemetry: ignore local friction logs; keep policy.yaml
|
|
9
|
+
events.jsonl
|
|
10
|
+
*.log
|
|
11
|
+
`;
|
|
12
|
+
|
|
13
|
+
const MAX_EVENTS_FILE_BYTES = 5 * 1024 * 1024; // 5 MB
|
|
14
|
+
const RETAIN_EVENT_LINES = 2000;
|
|
15
|
+
|
|
16
|
+
function trimEventsFileIfNeeded(targetFile) {
|
|
17
|
+
try {
|
|
18
|
+
const st = fs.statSync(targetFile);
|
|
19
|
+
if (st.size > MAX_EVENTS_FILE_BYTES) {
|
|
20
|
+
const content = fs.readFileSync(targetFile, 'utf8');
|
|
21
|
+
const lines = content.split(/\r?\n/).filter(Boolean);
|
|
22
|
+
if (lines.length > RETAIN_EVENT_LINES) {
|
|
23
|
+
const retained = lines.slice(-RETAIN_EVENT_LINES);
|
|
24
|
+
fs.writeFileSync(targetFile, retained.join('\n') + '\n', 'utf8');
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
} catch {
|
|
28
|
+
// fail-silent
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* Records an immutable lifecycle/gate telemetry event into .sdlc/events.jsonl.
|
|
34
|
+
* Fail-silent contract: Any I/O error is swallowed; never throws and never affects command execution.
|
|
35
|
+
*/
|
|
36
|
+
export function recordEvent(type, payload = {}, { repoRoot = process.cwd() } = {}) {
|
|
37
|
+
try {
|
|
38
|
+
if (!repoRoot || typeof repoRoot !== 'string') return;
|
|
39
|
+
const sdlcDir = path.join(repoRoot, '.sdlc');
|
|
40
|
+
if (!fs.existsSync(sdlcDir)) {
|
|
41
|
+
fs.mkdirSync(sdlcDir, { recursive: true });
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
// Physical anti-leak defense: automatically ensure .sdlc/.gitignore exists
|
|
45
|
+
const gitignorePath = path.join(sdlcDir, '.gitignore');
|
|
46
|
+
if (!fs.existsSync(gitignorePath)) {
|
|
47
|
+
try {
|
|
48
|
+
fs.writeFileSync(gitignorePath, GITIGNORE_CONTENT, 'utf8');
|
|
49
|
+
} catch { /* fail-silent */ }
|
|
50
|
+
} else {
|
|
51
|
+
try {
|
|
52
|
+
const existing = fs.readFileSync(gitignorePath, 'utf8');
|
|
53
|
+
if (!existing.includes('events.jsonl')) {
|
|
54
|
+
fs.appendFileSync(gitignorePath, '\nevents.jsonl\n*.log\n', 'utf8');
|
|
55
|
+
}
|
|
56
|
+
} catch { /* fail-silent */ }
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
const event = {
|
|
60
|
+
v: 1,
|
|
61
|
+
ts: new Date().toISOString(),
|
|
62
|
+
stage: payload.stage || 'unknown',
|
|
63
|
+
type,
|
|
64
|
+
change: payload.change || null,
|
|
65
|
+
...payload,
|
|
66
|
+
};
|
|
67
|
+
|
|
68
|
+
const targetFile = path.join(sdlcDir, 'events.jsonl');
|
|
69
|
+
fs.appendFileSync(targetFile, JSON.stringify(event) + '\n', 'utf8');
|
|
70
|
+
trimEventsFileIfNeeded(targetFile);
|
|
71
|
+
} catch {
|
|
72
|
+
// Fail-silent contract: Telemetry failures must never break core workflow
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
/**
|
|
77
|
+
* Safely reads local telemetry events from .sdlc/events.jsonl with optional filters.
|
|
78
|
+
*/
|
|
79
|
+
export function readLocalEvents(repoRoot, { change = null, stage = null, type = null } = {}) {
|
|
80
|
+
try {
|
|
81
|
+
const targetFile = path.join(repoRoot, '.sdlc', 'events.jsonl');
|
|
82
|
+
if (!fs.existsSync(targetFile)) return [];
|
|
83
|
+
const content = fs.readFileSync(targetFile, 'utf8');
|
|
84
|
+
const lines = content.split(/\r?\n/).filter(Boolean);
|
|
85
|
+
const events = [];
|
|
86
|
+
for (const line of lines) {
|
|
87
|
+
try {
|
|
88
|
+
const ev = JSON.parse(line);
|
|
89
|
+
if (change && ev.change !== change) continue;
|
|
90
|
+
if (stage && ev.stage !== stage) continue;
|
|
91
|
+
if (type && ev.type !== type) continue;
|
|
92
|
+
events.push(ev);
|
|
93
|
+
} catch {
|
|
94
|
+
// skip corrupt lines
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
return events;
|
|
98
|
+
} catch {
|
|
99
|
+
return [];
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
/**
|
|
104
|
+
* Derives current verification or lint iteration for a change by scanning local events.
|
|
105
|
+
*/
|
|
106
|
+
export function getChangeIteration(repoRoot, changeId, stage = 'verify') {
|
|
107
|
+
try {
|
|
108
|
+
const events = readLocalEvents(repoRoot, { change: changeId, stage });
|
|
109
|
+
const verifySummaries = events.filter((e) => e.type === 'gate.verified');
|
|
110
|
+
return verifySummaries.length + 1;
|
|
111
|
+
} catch {
|
|
112
|
+
return 1;
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
/**
|
|
117
|
+
* Appends Markdown summary to GitHub Actions step summary if running in CI.
|
|
118
|
+
*/
|
|
119
|
+
export function writeGitHubStepSummary(markdownText) {
|
|
120
|
+
try {
|
|
121
|
+
const summaryFile = process.env.GITHUB_STEP_SUMMARY;
|
|
122
|
+
if (summaryFile && typeof summaryFile === 'string') {
|
|
123
|
+
fs.appendFileSync(summaryFile, `\n${markdownText.trim()}\n`, 'utf8');
|
|
124
|
+
}
|
|
125
|
+
} catch {
|
|
126
|
+
// fail-silent
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
function parseChangeDirTimestamp(dirName) {
|
|
131
|
+
const m = String(dirName).match(/^(\d{4})-?(\d{2})-?(\d{2})/);
|
|
132
|
+
if (m) {
|
|
133
|
+
return new Date(`${m[1]}-${m[2]}-${m[3]}T00:00:00Z`).getTime();
|
|
134
|
+
}
|
|
135
|
+
return null;
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
function getChangeGitTimestamps(repoRoot, cdirRel) {
|
|
139
|
+
try {
|
|
140
|
+
const out = git(['log', '--follow', '--format=%aI', '--', cdirRel], repoRoot, { allowFail: true });
|
|
141
|
+
if (!out) return null;
|
|
142
|
+
const lines = out.split(/\r?\n/).map((l) => l.trim()).filter(Boolean);
|
|
143
|
+
if (lines.length === 0) return null;
|
|
144
|
+
const latestMs = new Date(lines[0]).getTime();
|
|
145
|
+
const earliestMs = new Date(lines[lines.length - 1]).getTime();
|
|
146
|
+
return { earliestMs, latestMs };
|
|
147
|
+
} catch {
|
|
148
|
+
return null;
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
function calculatePercentile(numbers, p) {
|
|
153
|
+
if (!numbers || numbers.length === 0) return 0;
|
|
154
|
+
const sorted = [...numbers].sort((a, b) => a - b);
|
|
155
|
+
const idx = Math.min(sorted.length - 1, Math.floor((p / 100) * sorted.length));
|
|
156
|
+
return sorted[idx];
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
/**
|
|
160
|
+
* Aggregates 30-day team metrics from permanent Git archives and local friction logs.
|
|
161
|
+
* Zero-extra-server: Works immediately on any clone or CI runner.
|
|
162
|
+
*/
|
|
163
|
+
export function computeTeamMetrics(repoRoot, { days = 30 } = {}) {
|
|
164
|
+
const cutoffMs = Date.now() - (Number(days) * 24 * 60 * 60 * 1000);
|
|
165
|
+
const archiveBase = path.join(openspecDir(repoRoot), 'changes', 'archive');
|
|
166
|
+
|
|
167
|
+
const trackedChanges = [];
|
|
168
|
+
const riskLevels = { L0: 0, L1: 0, L2: 0, L3: 0, unlevelled: 0 };
|
|
169
|
+
const specLeadTimesMin = [];
|
|
170
|
+
const implLeadTimesMin = [];
|
|
171
|
+
const convergenceRounds = { r1: 0, r2: 0, r3: 0, escalated: 0 };
|
|
172
|
+
|
|
173
|
+
if (fs.existsSync(archiveBase)) {
|
|
174
|
+
let entries = [];
|
|
175
|
+
try {
|
|
176
|
+
entries = fs.readdirSync(archiveBase, { withFileTypes: true });
|
|
177
|
+
} catch { entries = []; }
|
|
178
|
+
|
|
179
|
+
for (const ent of entries) {
|
|
180
|
+
if (!ent.isDirectory()) continue;
|
|
181
|
+
const cdir = path.join(archiveBase, ent.name);
|
|
182
|
+
const cdirRel = path.relative(repoRoot, cdir).replace(/\\/g, '/');
|
|
183
|
+
const gitTimes = getChangeGitTimestamps(repoRoot, cdirRel);
|
|
184
|
+
const stampMs = parseChangeDirTimestamp(ent.name);
|
|
185
|
+
|
|
186
|
+
let dirTime = stampMs || gitTimes?.latestMs;
|
|
187
|
+
if (!dirTime) {
|
|
188
|
+
try {
|
|
189
|
+
const st = fs.statSync(cdir);
|
|
190
|
+
dirTime = Math.max(st.mtimeMs, st.birthtimeMs);
|
|
191
|
+
} catch { dirTime = 0; }
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
if (dirTime && dirTime < cutoffMs) continue;
|
|
195
|
+
|
|
196
|
+
trackedChanges.push(ent.name);
|
|
197
|
+
|
|
198
|
+
// 1. Risk Tier breakdown
|
|
199
|
+
const metaPath = path.join(cdir, '.openspec.yaml');
|
|
200
|
+
let lvl = 'unlevelled';
|
|
201
|
+
if (exists(metaPath)) {
|
|
202
|
+
try {
|
|
203
|
+
const meta = readYaml(metaPath) ?? {};
|
|
204
|
+
if (meta.level) {
|
|
205
|
+
lvl = String(meta.level).toUpperCase();
|
|
206
|
+
}
|
|
207
|
+
} catch {}
|
|
208
|
+
}
|
|
209
|
+
if (riskLevels[lvl] !== undefined) riskLevels[lvl] += 1;
|
|
210
|
+
else riskLevels.unlevelled += 1;
|
|
211
|
+
|
|
212
|
+
// 2. Lead Time Calculation
|
|
213
|
+
let tStart = null;
|
|
214
|
+
let tApprove = null;
|
|
215
|
+
let tArchive = gitTimes?.latestMs || dirTime;
|
|
216
|
+
|
|
217
|
+
// Check intake index for start timestamp
|
|
218
|
+
const intakePath = path.join(cdir, 'intake', 'index.yaml');
|
|
219
|
+
if (exists(intakePath)) {
|
|
220
|
+
try {
|
|
221
|
+
const intake = readYaml(intakePath);
|
|
222
|
+
if (intake?.capturedAt) tStart = new Date(intake.capturedAt).getTime();
|
|
223
|
+
} catch {}
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
// Check review.md for approval timestamp
|
|
227
|
+
const reviewPath = path.join(cdir, 'review.md');
|
|
228
|
+
let reviewText = '';
|
|
229
|
+
if (exists(reviewPath)) {
|
|
230
|
+
try {
|
|
231
|
+
reviewText = readText(reviewPath);
|
|
232
|
+
const m = reviewText.match(/-\s*approvedAt\s*:\s*['"]?([^\s'"]+)['"]?/i);
|
|
233
|
+
if (m) tApprove = new Date(m[1]).getTime();
|
|
234
|
+
} catch {}
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
if (!tStart) {
|
|
238
|
+
if (gitTimes?.earliestMs) {
|
|
239
|
+
tStart = gitTimes.earliestMs;
|
|
240
|
+
} else if (exists(path.join(cdir, 'proposal.md'))) {
|
|
241
|
+
try {
|
|
242
|
+
const st = fs.statSync(path.join(cdir, 'proposal.md'));
|
|
243
|
+
tStart = st.birthtimeMs || st.mtimeMs;
|
|
244
|
+
} catch {}
|
|
245
|
+
}
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
if (tStart && tApprove && tApprove >= tStart) {
|
|
249
|
+
specLeadTimesMin.push(Math.round((tApprove - tStart) / 60000));
|
|
250
|
+
}
|
|
251
|
+
if (tApprove && tArchive && tArchive >= tApprove) {
|
|
252
|
+
implLeadTimesMin.push(Math.round((tArchive - tApprove) / 60000));
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
// 3. Autonomous PR convergence estimation
|
|
256
|
+
if (/asdlc:needs-human-arbitration/i.test(reviewText)) {
|
|
257
|
+
convergenceRounds.escalated += 1;
|
|
258
|
+
} else {
|
|
259
|
+
let trailerCount = (reviewText.match(/\(ref:\s*#PRRT_[^)]+\)/g) || []).length;
|
|
260
|
+
try {
|
|
261
|
+
const logOut = git(['log', '--grep=ref: #PRRT_', '--format=%B', '--', cdirRel], repoRoot, { allowFail: true }) || '';
|
|
262
|
+
const commitMatches = (logOut.match(/\(ref:\s*#PRRT_[^)]+\)/g) || []).length;
|
|
263
|
+
trailerCount = Math.max(trailerCount, commitMatches);
|
|
264
|
+
} catch {}
|
|
265
|
+
|
|
266
|
+
if (trailerCount === 0) convergenceRounds.r1 += 1;
|
|
267
|
+
else if (trailerCount === 1) convergenceRounds.r2 += 1;
|
|
268
|
+
else convergenceRounds.r3 += 1;
|
|
269
|
+
}
|
|
270
|
+
}
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
// 4. Local Friction Ranking from .sdlc/events.jsonl
|
|
274
|
+
const localEvents = readLocalEvents(repoRoot, { stage: 'verify' });
|
|
275
|
+
const lintEvents = readLocalEvents(repoRoot, { stage: 'lint' });
|
|
276
|
+
const allFails = [...localEvents, ...lintEvents].filter((e) => e.type === 'gate.evaluated' && e.status === 'fail');
|
|
277
|
+
|
|
278
|
+
const gateFailMap = new Map();
|
|
279
|
+
for (const ev of allFails) {
|
|
280
|
+
const key = `${ev.gate || 'unknown'}|${ev.stage || 'verify'}`;
|
|
281
|
+
const curr = gateFailMap.get(key) || { gate: ev.gate || 'unknown', stage: ev.stage || 'verify', count: 0, sampleDetail: ev.detail || '' };
|
|
282
|
+
curr.count += 1;
|
|
283
|
+
if (ev.detail && ev.detail.length > 5) curr.sampleDetail = ev.detail;
|
|
284
|
+
gateFailMap.set(key, curr);
|
|
285
|
+
}
|
|
286
|
+
|
|
287
|
+
const frictionLeaderboard = [...gateFailMap.values()].sort((a, b) => b.count - a.count).slice(0, 5);
|
|
288
|
+
|
|
289
|
+
const total = trackedChanges.length;
|
|
290
|
+
const r1Pct = total > 0 ? Math.round((convergenceRounds.r1 / total) * 100) : 0;
|
|
291
|
+
const r2Pct = total > 0 ? Math.round((convergenceRounds.r2 / total) * 100) : 0;
|
|
292
|
+
const r3Pct = total > 0 ? Math.round((convergenceRounds.r3 / total) * 100) : 0;
|
|
293
|
+
const escPct = total > 0 ? Math.round((convergenceRounds.escalated / total) * 100) : 0;
|
|
294
|
+
|
|
295
|
+
return {
|
|
296
|
+
days,
|
|
297
|
+
totalTrackedChanges: total,
|
|
298
|
+
riskLevels,
|
|
299
|
+
leadTime: {
|
|
300
|
+
specP50Min: calculatePercentile(specLeadTimesMin, 50),
|
|
301
|
+
specP90Min: calculatePercentile(specLeadTimesMin, 90),
|
|
302
|
+
implP50Min: calculatePercentile(implLeadTimesMin, 50),
|
|
303
|
+
implP90Min: calculatePercentile(implLeadTimesMin, 90),
|
|
304
|
+
},
|
|
305
|
+
convergence: {
|
|
306
|
+
r1Pct,
|
|
307
|
+
r2Pct,
|
|
308
|
+
r3Pct,
|
|
309
|
+
escPct,
|
|
310
|
+
counts: convergenceRounds,
|
|
311
|
+
},
|
|
312
|
+
frictionLeaderboard,
|
|
313
|
+
};
|
|
314
|
+
}
|
|
315
|
+
|
|
316
|
+
/**
|
|
317
|
+
* Formats team metrics into clean ANSI ASCII tables matching Section 7.1.
|
|
318
|
+
*/
|
|
319
|
+
export function renderMetricsDashboard(metrics) {
|
|
320
|
+
const lines = [];
|
|
321
|
+
lines.push('======================= 🏛️ ASDLC HARNESS OBSERVABILITY =======================');
|
|
322
|
+
lines.push(`📅 Data Source: Git Archive History (Last ${metrics.days} Days, ${metrics.totalTrackedChanges} changes tracked)`);
|
|
323
|
+
lines.push('');
|
|
324
|
+
|
|
325
|
+
lines.push('1. 🚦 Gate Friction Leaderboard (Local .sdlc/ Retries)');
|
|
326
|
+
lines.push(' Rank | Gate | Stage | Fails | Top Failure Pattern');
|
|
327
|
+
lines.push(' --------------------------------------------------------------------------');
|
|
328
|
+
if (metrics.frictionLeaderboard.length === 0) {
|
|
329
|
+
lines.push(' (No local gate failures recorded)');
|
|
330
|
+
} else {
|
|
331
|
+
metrics.frictionLeaderboard.forEach((item, idx) => {
|
|
332
|
+
const rank = `#${idx + 1}`.padEnd(4, ' ');
|
|
333
|
+
const gate = item.gate.padEnd(21, ' ').slice(0, 21);
|
|
334
|
+
const stage = item.stage.padEnd(6, ' ');
|
|
335
|
+
const fails = String(item.count).padEnd(5, ' ');
|
|
336
|
+
const sample = String(item.sampleDetail || 'check failed').slice(0, 32);
|
|
337
|
+
lines.push(` ${rank} | ${gate} | ${stage} | ${fails} | ${sample}`);
|
|
338
|
+
});
|
|
339
|
+
}
|
|
340
|
+
lines.push('');
|
|
341
|
+
|
|
342
|
+
lines.push('2. 🔄 Autonomous PR Convergence (3-Round Cap)');
|
|
343
|
+
lines.push(` • Round 1 Pass (Zero rework) : ${metrics.convergence.r1Pct}% (${metrics.convergence.counts.r1} PRs)`);
|
|
344
|
+
lines.push(` • Round 2 Pass (Converged Rd 2) : ${metrics.convergence.r2Pct}% (${metrics.convergence.counts.r2} PRs)`);
|
|
345
|
+
lines.push(` • Round 3 Pass (Converged Rd 3) : ${metrics.convergence.r3Pct}% (${metrics.convergence.counts.r3} PRs)`);
|
|
346
|
+
lines.push(` • Human Escalated (>3 rounds) : ${metrics.convergence.escPct}% (${metrics.convergence.counts.escalated} PRs)`);
|
|
347
|
+
lines.push('');
|
|
348
|
+
|
|
349
|
+
lines.push('3. ⏱️ Stage Lead Time (P50 / P90 via Git Provenance)');
|
|
350
|
+
lines.push(` • Stage new -> approve (Spec Phase): ${metrics.leadTime.specP50Min}m / ${metrics.leadTime.specP90Min}m`);
|
|
351
|
+
lines.push(` • Stage apply -> verify (TDD Phase): ${metrics.leadTime.implP50Min}m / ${metrics.leadTime.implP90Min}m`);
|
|
352
|
+
lines.push('');
|
|
353
|
+
|
|
354
|
+
const l0 = metrics.riskLevels.L0 || 0;
|
|
355
|
+
const l1 = metrics.riskLevels.L1 || 0;
|
|
356
|
+
const l2 = metrics.riskLevels.L2 || 0;
|
|
357
|
+
const l3 = metrics.riskLevels.L3 || 0;
|
|
358
|
+
lines.push('4. 🛡️ Risk Tier Breakdown');
|
|
359
|
+
lines.push(` • L0 (Docs/Internal): ${l0} | L1 (Normal): ${l1} | L2 (High): ${l2} | L3 (Critical): ${l3}`);
|
|
360
|
+
lines.push('=============================================================================');
|
|
361
|
+
|
|
362
|
+
return lines.join('\n');
|
|
363
|
+
}
|