@agent-surface/cli 0.12.0 → 0.13.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (35) hide show
  1. package/README.md +45 -7
  2. package/dist/bin.js +15 -7
  3. package/dist/bin.js.map +1 -1
  4. package/dist/check-TJIX7NDE.js +241 -0
  5. package/dist/check-TJIX7NDE.js.map +1 -0
  6. package/dist/{chunk-QIVOZAWX.js → chunk-3AJ343NA.js} +12 -3
  7. package/dist/{chunk-QIVOZAWX.js.map → chunk-3AJ343NA.js.map} +1 -1
  8. package/dist/chunk-IALBMW3R.js +278 -0
  9. package/dist/chunk-IALBMW3R.js.map +1 -0
  10. package/dist/chunk-L7GHSC2Z.js +465 -0
  11. package/dist/chunk-L7GHSC2Z.js.map +1 -0
  12. package/dist/{chunk-Q5WOLWEW.js → chunk-UGCLJ5JX.js} +26 -286
  13. package/dist/chunk-UGCLJ5JX.js.map +1 -0
  14. package/dist/chunk-VX6GBEP3.js +539 -0
  15. package/dist/chunk-VX6GBEP3.js.map +1 -0
  16. package/dist/{init-LFQ5R3G7.js → init-6XV64LK2.js} +9 -8
  17. package/dist/{init-LFQ5R3G7.js.map → init-6XV64LK2.js.map} +1 -1
  18. package/dist/{ink-P23VKP4H.js → ink-QR7X7TAC.js} +99 -25
  19. package/dist/ink-QR7X7TAC.js.map +1 -0
  20. package/dist/inspect-NJ4J3MPP.js +242 -0
  21. package/dist/inspect-NJ4J3MPP.js.map +1 -0
  22. package/dist/{snapshot-3E7MVMVG.js → snapshot-ZGTAF2Y5.js} +28 -12
  23. package/dist/snapshot-ZGTAF2Y5.js.map +1 -0
  24. package/package.json +4 -4
  25. package/dist/check-CS4Z3ZK3.js +0 -169
  26. package/dist/check-CS4Z3ZK3.js.map +0 -1
  27. package/dist/chunk-DYDSJM7R.js +0 -170
  28. package/dist/chunk-DYDSJM7R.js.map +0 -1
  29. package/dist/chunk-Q5WOLWEW.js.map +0 -1
  30. package/dist/chunk-TPWRSFK7.js +0 -380
  31. package/dist/chunk-TPWRSFK7.js.map +0 -1
  32. package/dist/ink-P23VKP4H.js.map +0 -1
  33. package/dist/inspect-ELUQ73MZ.js +0 -119
  34. package/dist/inspect-ELUQ73MZ.js.map +0 -1
  35. package/dist/snapshot-3E7MVMVG.js.map +0 -1
@@ -0,0 +1,465 @@
1
+ import {
2
+ buildView,
3
+ coverageSections,
4
+ flatRows,
5
+ neverCallable,
6
+ neverCallableSection,
7
+ riskClause,
8
+ runContextRows,
9
+ scenarioTable,
10
+ surfaceSummaryRows,
11
+ unreadSection
12
+ } from "./chunk-VX6GBEP3.js";
13
+ import {
14
+ formatValue,
15
+ normalize
16
+ } from "./chunk-IALBMW3R.js";
17
+ import {
18
+ unreadKey,
19
+ unresolved
20
+ } from "./chunk-UGCLJ5JX.js";
21
+
22
+ // src/render/plain.ts
23
+ var MARK = { expose: "+", disable: "~", hide: "-" };
24
+ var STATE = { expose: "callable", disable: "disabled", hide: "hidden" };
25
+ var NONE = "\u2014";
26
+ var REPORT_WIDTH = 100;
27
+ var LABEL_WIDTH = 12;
28
+ var STATUS_WIDTH = 7;
29
+ function wrapText(text, width) {
30
+ const words = text.split(/\s+/).filter(Boolean);
31
+ const lines = [];
32
+ let line = "";
33
+ for (const word of words) {
34
+ if (line && line.length + 1 + word.length > width) {
35
+ lines.push(line);
36
+ line = word;
37
+ } else {
38
+ line = line ? `${line} ${word}` : word;
39
+ }
40
+ }
41
+ if (line) lines.push(line);
42
+ return lines.length > 0 ? lines : [""];
43
+ }
44
+ function renderTable(headers, rows) {
45
+ const widths = headers.map(
46
+ (header, column) => Math.max(header.length, ...rows.map((row) => (row.cells[column] ?? "").length))
47
+ );
48
+ const line = (cells) => cells.map((cell, column) => column === headers.length - 1 ? cell : cell.padEnd(widths[column])).join(" ").trimEnd();
49
+ const lines = [line(headers)];
50
+ for (const row of rows) {
51
+ lines.push(line(row.cells));
52
+ if (row.note) {
53
+ for (const [index, note] of wrapText(row.note, REPORT_WIDTH - 6).entries()) {
54
+ lines.push(` ${index === 0 ? "\u2937 " : " "}${note}`);
55
+ }
56
+ }
57
+ }
58
+ return lines;
59
+ }
60
+ function renderTablePlain(headers, rows) {
61
+ return renderTable(headers, rows).join("\n");
62
+ }
63
+ function section(title, gloss, count) {
64
+ return `${title} \u2014 ${gloss} (${count})`;
65
+ }
66
+ function renderReportPlain(blocks) {
67
+ const width = Math.max(
68
+ LABEL_WIDTH,
69
+ ...blocks.flatMap((block) => block.rows.map((row) => row.label.length + 2))
70
+ );
71
+ const statuses = blocks.some((block) => block.rows.some((row) => row.status));
72
+ const renderRow = (row) => `${row.label.padEnd(width)}${statuses ? (row.status ?? "").padEnd(STATUS_WIDTH) : ""}${row.text}`.trimEnd();
73
+ return blocks.filter((block) => block.title || block.rows.length > 0).map((block) => [...block.title ? [block.title] : [], ...block.rows.map(renderRow)].join("\n")).join("\n\n");
74
+ }
75
+ function renderSectionsPlain(sections) {
76
+ return sections.map((entry) => {
77
+ const lines = [
78
+ entry.count > 0 ? section(entry.title, entry.gloss, entry.count) : `${entry.title} \u2014 ${entry.gloss}`
79
+ ];
80
+ if (entry.headers && entry.rows) lines.push(...renderTable(entry.headers, entry.rows));
81
+ if (entry.lines) lines.push(...entry.lines.map((line) => ` ${line}`.trimEnd()));
82
+ if (entry.hint) {
83
+ lines.push(
84
+ ...wrapText(entry.hint, REPORT_WIDTH - 4).map(
85
+ (line, index) => ` ${index === 0 ? "\u2192" : " "} ${line}`
86
+ )
87
+ );
88
+ }
89
+ return lines.join("\n");
90
+ }).join("\n\n");
91
+ }
92
+ function renderDetailRow(row, lines) {
93
+ const tags = row.tags.length > 0 ? ` [${row.tags.join(", ")}]` : "";
94
+ lines.push(` ${MARK[row.outcome]} ${row.name}${tags}`);
95
+ lines.push(` ${row.description}`);
96
+ if (row.reason) lines.push(` reason: ${row.reason}`);
97
+ if (row.policies) {
98
+ if (row.policies.length === 0) {
99
+ lines.push(" policies: none");
100
+ } else {
101
+ for (const policy of row.policies) {
102
+ const vote = policy.discovery ? policy.discovery.decision === "disable" ? `disable \u2014 ${policy.discovery.reason}` : policy.discovery.decision : "no discovery hook";
103
+ const phases = policy.phases.length > 0 ? policy.phases.join("/") : NONE;
104
+ const flags = [
105
+ policy.threw ? "THREW" : "",
106
+ policy.confirmationEscalation ? "escalates-confirmation" : ""
107
+ ].filter(Boolean).join(", ");
108
+ lines.push(
109
+ ` policy ${policy.name} (${policy.scope}, ${phases}): ${vote}${flags ? ` [${flags}]` : ""}`
110
+ );
111
+ }
112
+ }
113
+ if (row.availability && !row.availability.available) {
114
+ lines.push(
115
+ ` availability: unavailable${row.availability.reason ? ` \u2014 ${row.availability.reason}` : ""}`
116
+ );
117
+ }
118
+ }
119
+ if (row.schemas) {
120
+ if (row.schemas.input !== void 0) {
121
+ lines.push(` input: ${JSON.stringify(row.schemas.input)}`);
122
+ }
123
+ if (row.schemas.output !== void 0) {
124
+ lines.push(` output: ${JSON.stringify(row.schemas.output)}`);
125
+ }
126
+ }
127
+ }
128
+ function renderCountsPlain(view) {
129
+ const risk = riskClause(flatRows(view));
130
+ return `${view.counts.callable} callable, ${view.counts.disabled} visible-disabled, ${view.counts.hidden} hidden` + (view.rejections.length > 0 ? `, ${view.rejections.length} registration${view.rejections.length === 1 ? "" : "s"} rejected` : "") + (risk ? ` \xB7 ${risk}` : "");
131
+ }
132
+ function renderHeader(view, lines) {
133
+ lines.push(
134
+ `scenario ${view.scenario}${view.route ? ` route ${view.route}` : ""}${view.scope && view.scope.length > 0 ? ` scope ${view.scope.join(" ")}` : ""}`
135
+ );
136
+ lines.push(renderCountsPlain(view));
137
+ }
138
+ function renderRejections(view, lines) {
139
+ if (view.rejections.length === 0) return;
140
+ lines.push("");
141
+ lines.push(
142
+ section("REJECTED", "the registry refused these during the mount", view.rejections.length)
143
+ );
144
+ for (const rejection of view.rejections) {
145
+ const why = rejection.reason === "duplicate" ? "duplicate \u2014 an earlier registration holds this key" : "guard \u2014 onRegister rejected this registration";
146
+ lines.push(` ! ${rejection.componentType} (${rejection.instanceId}) ${why}`);
147
+ }
148
+ }
149
+ function renderEmpty(view, lines) {
150
+ lines.push("");
151
+ if (view.counts.hidden > 0) {
152
+ lines.push(
153
+ `Nothing is callable here \u2014 all ${view.counts.hidden} registered capabilities were hidden by policy.`
154
+ );
155
+ if (!view.explained) lines.push("Re-run with --explain to see which policy hid them.");
156
+ } else {
157
+ lines.push("Nothing is registered for this scenario \u2014 the agent has no surface here.");
158
+ if (!view.explained) lines.push("Re-run with --explain to see whether a policy hid it.");
159
+ }
160
+ }
161
+ function renderSurfacePlain(view, options = {}) {
162
+ const lines = [];
163
+ renderHeader(view, lines);
164
+ renderRejections(view, lines);
165
+ const rows = flatRows(view);
166
+ if (rows.length === 0) {
167
+ renderEmpty(view, lines);
168
+ return lines.join("\n");
169
+ }
170
+ if (options.detail) {
171
+ for (const group of view.groups.filter((group2) => group2.rows.length > 0)) {
172
+ lines.push("");
173
+ lines.push(`${group.heading} (${group.rows.length})`);
174
+ for (const row of group.rows) renderDetailRow(row, lines);
175
+ }
176
+ return lines.join("\n");
177
+ }
178
+ lines.push("");
179
+ lines.push(
180
+ ...renderTable(
181
+ ["CAPABILITY", "KIND", "EFFECT", "STATE", "FLAGS"],
182
+ rows.map((row) => ({
183
+ cells: [
184
+ row.path,
185
+ row.kind,
186
+ row.effect ?? NONE,
187
+ STATE[row.outcome],
188
+ row.flags.length > 0 ? row.flags.join(" \xB7 ") : NONE
189
+ ],
190
+ ...row.reason ? { note: row.reason } : {}
191
+ }))
192
+ )
193
+ );
194
+ return lines.join("\n");
195
+ }
196
+ function componentOf(capabilityId) {
197
+ const path = capabilityId.replace(/^(view|domain):/, "");
198
+ const dot = path.lastIndexOf(".");
199
+ return dot === -1 ? path : path.slice(0, dot);
200
+ }
201
+ function renderCatalogDetailPlain(inventory, options = {}) {
202
+ const lines = [];
203
+ const resolved = inventory.capabilities.filter((c) => c.resolution !== "unresolved");
204
+ const unreadEntries = unresolved(inventory);
205
+ const components = /* @__PURE__ */ new Map();
206
+ for (const capability of resolved) {
207
+ const component = componentOf(capability.capabilityId);
208
+ const current = components.get(component) ?? { ids: /* @__PURE__ */ new Set(), sites: 0, partial: 0 };
209
+ current.ids.add(capability.capabilityId);
210
+ current.sites += 1;
211
+ if (capability.resolution === "partial") current.partial += 1;
212
+ components.set(component, current);
213
+ }
214
+ if (components.size > 0) {
215
+ lines.push(`COMPONENTS (${components.size})`);
216
+ lines.push(
217
+ ...renderTable(
218
+ ["COMPONENT", "CAPABILITIES", "CALL SITES", "DYNAMIC META"],
219
+ [...components.entries()].sort(([a], [b]) => a.localeCompare(b)).map(([component, data]) => ({
220
+ cells: [
221
+ `view:${component}`,
222
+ String(data.ids.size),
223
+ String(data.sites),
224
+ data.partial > 0 ? String(data.partial) : NONE
225
+ ],
226
+ note: [...data.ids].sort().join(" \xB7 ")
227
+ }))
228
+ )
229
+ );
230
+ }
231
+ if (unreadEntries.length > 0) {
232
+ const groups = /* @__PURE__ */ new Map();
233
+ for (const entry of unreadEntries) {
234
+ const key = `${entry.origin.file}\0${entry.reason ?? "unknown"}`;
235
+ groups.set(key, (groups.get(key) ?? 0) + 1);
236
+ }
237
+ if (lines.length > 0) lines.push("");
238
+ lines.push(`UNREAD SITES (${unreadEntries.length})`);
239
+ lines.push("Counts above are a floor until these sites are resolved or explicitly accepted.");
240
+ lines.push(
241
+ ...renderTable(
242
+ ["FILE", "REASON", "SITES"],
243
+ [...groups.entries()].sort(([a], [b]) => a.localeCompare(b)).map(([key, count]) => {
244
+ const [file, reason] = key.split("\0");
245
+ return { cells: [file ?? "?", reason ?? "unknown", String(count)] };
246
+ })
247
+ )
248
+ );
249
+ lines.push("", "ALLOWLIST KEYS");
250
+ for (const entry of unreadEntries) lines.push(` allowlist key: ${unreadKey(entry)}`);
251
+ }
252
+ if (options.detail) {
253
+ const byId = [...resolved].sort((a, b) => a.capabilityId.localeCompare(b.capabilityId));
254
+ if (byId.length > 0) {
255
+ if (lines.length > 0) lines.push("");
256
+ lines.push(`CAPABILITY DETAILS (${byId.length} call sites)`);
257
+ lines.push(
258
+ ...renderTable(
259
+ ["CAPABILITY", "KIND", "ORIGIN", "READ"],
260
+ byId.map((capability) => ({
261
+ cells: [
262
+ capability.capabilityId,
263
+ capability.kind,
264
+ `${capability.origin.file}:${capability.origin.line}`,
265
+ capability.resolution
266
+ ],
267
+ ...capability.note ? { note: capability.note } : {}
268
+ }))
269
+ )
270
+ );
271
+ }
272
+ if (unreadEntries.length > 0) {
273
+ if (lines.length > 0) lines.push("");
274
+ lines.push(renderSectionsPlain([unreadSection(unreadEntries)]));
275
+ }
276
+ } else if (unreadEntries.length > 0 || resolved.length > 0) {
277
+ if (lines.length > 0) lines.push("");
278
+ lines.push(
279
+ "Details: re-run with --detail for origins, metadata diagnostics, and allowlist keys."
280
+ );
281
+ }
282
+ return lines.join("\n");
283
+ }
284
+ function renderCoveragePlain(report, options = {}) {
285
+ const sections = coverageSections(report, options);
286
+ return sections.length > 0 ? renderSectionsPlain(sections) : "";
287
+ }
288
+ function renderSurfaceSummaryPlain(input) {
289
+ const dark = neverCallable(input.reach);
290
+ const mounted = input.scenarios.filter((entry) => !entry.failed).length;
291
+ const sections = [
292
+ ...input.coverage ? coverageSections(input.coverage) : [],
293
+ ...dark.length > 0 && mounted > 1 ? [neverCallableSection(dark)] : []
294
+ ];
295
+ const summary = renderReportPlain([{ title: "SURFACE SUMMARY", rows: surfaceSummaryRows(input) }]);
296
+ return sections.length > 0 ? `${renderSectionsPlain(sections)}
297
+
298
+ ${summary}` : summary;
299
+ }
300
+ function wrappedList(items) {
301
+ const prefix = " ";
302
+ return wrapText(items.join(", "), REPORT_WIDTH - prefix.length).map((line) => `${prefix}${line}`);
303
+ }
304
+ function checkMatrixRows(input) {
305
+ const rows = [];
306
+ const coverage = input.coverage;
307
+ if (coverage) {
308
+ rows.push({
309
+ label: "Coverage",
310
+ status: coverage.unreached.length > 0 || coverage.staleAllowlist.length > 0 ? "FAIL" : coverage.allowed.length > 0 ? "WARN" : "PASS",
311
+ text: `${coverage.reached}/${coverage.authored} authored capabilities reached` + (coverage.unreached.length > 0 ? ` \xB7 ${coverage.unreached.length} unreached` : "") + (coverage.allowed.length > 0 ? ` \xB7 ${coverage.allowed.length} unreached allowlisted` : "") + (coverage.staleAllowlist.length > 0 ? ` \xB7 ${coverage.staleAllowlist.length} stale allowlist entr${coverage.staleAllowlist.length === 1 ? "y" : "ies"}` : "")
312
+ });
313
+ const unread = coverage.unresolved.length;
314
+ const accepted = coverage.allowedUnread.length;
315
+ rows.push({
316
+ label: "Catalog",
317
+ status: coverage.staleUnreadAllowlist.length > 0 || unread > 0 && !input.unresolvedAllowed ? "FAIL" : unread > 0 || accepted > 0 ? "WARN" : "PASS",
318
+ text: coverage.staleUnreadAllowlist.length > 0 ? `${coverage.staleUnreadAllowlist.length} stale unread allowlist entr${coverage.staleUnreadAllowlist.length === 1 ? "y" : "ies"}` : unread > 0 ? `${unread} unread static site${unread === 1 ? "" : "s"}${input.unresolvedAllowed ? " accepted by --allow-unresolved" : ""}` : accepted > 0 ? `${accepted} unread static site${accepted === 1 ? "" : "s"} allowlisted` : "all static sites resolved"
319
+ });
320
+ rows.push({
321
+ label: "Domain",
322
+ status: coverage.unmanifestedDomain.length > 0 ? "FAIL" : coverage.domainAuthoritative ? "PASS" : "WARN",
323
+ text: coverage.unmanifestedDomain.length > 0 ? `${coverage.unmanifestedDomain.length} mounted capabilit${coverage.unmanifestedDomain.length === 1 ? "y" : "ies"} absent from manifest` : coverage.domainAuthoritative ? `${coverage.domainReached.length} manifest capabilit${coverage.domainReached.length === 1 ? "y" : "ies"} reached` : "authoritative manifest not configured"
324
+ });
325
+ } else {
326
+ rows.push({
327
+ label: "Coverage",
328
+ status: input.status === "ERROR" ? "ERROR" : "WARN",
329
+ text: input.status === "ERROR" ? "no verdict; runtime analysis incomplete" : "not evaluated \u2014 statement about these scenarios only; re-run with --depth full"
330
+ });
331
+ }
332
+ const baselineOk = input.baselineCurrent === input.baselineTotal && input.scenarioManifestOk;
333
+ rows.push({
334
+ label: "Baselines",
335
+ status: baselineOk ? "PASS" : "FAIL",
336
+ text: `${input.baselineCurrent}/${input.baselineTotal} scenario baselines current` + (input.scenarioManifestOk ? "" : " \xB7 scenario manifest differs")
337
+ });
338
+ rows.push({
339
+ label: "Runtime",
340
+ status: input.mountFailures > 0 ? "ERROR" : input.rejected > 0 ? "FAIL" : "PASS",
341
+ text: input.mountFailures > 0 ? `${input.mountFailures} scenario${input.mountFailures === 1 ? "" : "s"} did not mount` : input.rejected > 0 ? `${input.rejected} registration${input.rejected === 1 ? "" : "s"} rejected` : `${input.scenarios.length} scenario${input.scenarios.length === 1 ? "" : "s"} mounted`
342
+ });
343
+ return rows;
344
+ }
345
+ function renderCheckOverviewPlain(input) {
346
+ const blocks = [
347
+ {
348
+ title: `SURFACE CHECK ${input.status}`,
349
+ rows: input.context ? runContextRows(input.context) : []
350
+ },
351
+ { rows: checkMatrixRows(input) }
352
+ ];
353
+ const table = input.stats ? scenarioTable(input.stats, { baselines: true }) : void 0;
354
+ const scenarios = input.stats && table ? [`SCENARIOS (${input.stats.length})`, ...renderTable(table.headers, table.rows)] : [`SCENARIOS (${input.scenarios.length})`, ...wrappedList(input.scenarios)];
355
+ return `${renderReportPlain(blocks)}
356
+
357
+ ${scenarios.join("\n")}`;
358
+ }
359
+ function renderNextStepsPlain(steps) {
360
+ return [
361
+ "NEXT STEPS",
362
+ ...steps.flatMap(
363
+ (step, index) => wrapText(step, REPORT_WIDTH - 5).map(
364
+ (line, wrapped) => ` ${wrapped === 0 ? `${index + 1}.` : " "} ${line}`
365
+ )
366
+ )
367
+ ].join("\n");
368
+ }
369
+ function renderNoVerdictPlain(failures) {
370
+ return [
371
+ section(
372
+ "NO COVERAGE VERDICT",
373
+ "a scenario did not mount, so nothing reached anything",
374
+ failures.length
375
+ ),
376
+ " Every capability those scenarios would have surfaced would be reported unreached,",
377
+ " so no verdict is printed at all. Fix the mount, or name a scenario that works."
378
+ ].join("\n");
379
+ }
380
+ function renderFailuresPlain(failures) {
381
+ return [
382
+ section("DID NOT MOUNT", "these scenarios threw, and were skipped", failures.length),
383
+ ...failures.flatMap((failure) => [` ${failure.scenario}`, ` ${failure.message}`])
384
+ ].join("\n");
385
+ }
386
+ function renderDriftPlain(scenario, entries) {
387
+ const lines = [`${scenario}: ${entries.length} change${entries.length === 1 ? "" : "s"}`];
388
+ for (const entry of entries) {
389
+ const where = entry.subject ? `${entry.subject} (${entry.path})` : entry.path;
390
+ if (entry.kind === "added") lines.push(` + ${where} ${formatValue(entry.after)}`);
391
+ else if (entry.kind === "removed") lines.push(` - ${where} ${formatValue(entry.before)}`);
392
+ else {
393
+ lines.push(` ~ ${where}`);
394
+ lines.push(` before: ${formatValue(entry.before)}`);
395
+ lines.push(` after: ${formatValue(entry.after)}`);
396
+ }
397
+ }
398
+ return lines;
399
+ }
400
+
401
+ // src/report.ts
402
+ import { basename, relative } from "path";
403
+ function scenarioReport(result, options = {}) {
404
+ const view = buildView(result, {
405
+ ...options.attribution ? { explain: true } : {},
406
+ ...options.schemas ? { schemas: true } : {}
407
+ });
408
+ const capabilities = flatRows(view);
409
+ return {
410
+ scenario: result.scenario,
411
+ ...result.scope ? { scope: result.scope } : {},
412
+ snapshot: normalize(result.snapshot),
413
+ // Includes expose, disable and hide. Rows never contain runtime ids.
414
+ capabilities,
415
+ rejections: [...result.rejections].sort(
416
+ (a, b) => a.componentType.localeCompare(b.componentType) || a.instanceId.localeCompare(b.instanceId) || a.reason.localeCompare(b.reason)
417
+ ),
418
+ ...options.attribution ? { explanation: { capabilities } } : {}
419
+ };
420
+ }
421
+ function scenarioBaseline(result) {
422
+ const report = scenarioReport(result);
423
+ return {
424
+ ...report.snapshot,
425
+ capabilities: report.capabilities,
426
+ rejections: report.rejections
427
+ };
428
+ }
429
+ function inventoryReport(inventory, domainCapabilities) {
430
+ if (!inventory) return null;
431
+ return {
432
+ ...inventory,
433
+ root: ".",
434
+ tsconfig: relative(inventory.root, inventory.tsconfig) || "tsconfig.json",
435
+ ...domainCapabilities ? { domain: { source: "manifest", capabilities: [...domainCapabilities].sort() } } : {}
436
+ };
437
+ }
438
+ function coverageReport(report) {
439
+ if (!report) return null;
440
+ return {
441
+ ...report,
442
+ allowlistPath: basename(report.allowlistPath),
443
+ unreadAllowlistPath: basename(report.unreadAllowlistPath)
444
+ };
445
+ }
446
+
447
+ export {
448
+ renderTablePlain,
449
+ renderReportPlain,
450
+ renderSectionsPlain,
451
+ renderSurfacePlain,
452
+ renderCatalogDetailPlain,
453
+ renderCoveragePlain,
454
+ renderSurfaceSummaryPlain,
455
+ renderCheckOverviewPlain,
456
+ renderNextStepsPlain,
457
+ renderNoVerdictPlain,
458
+ renderFailuresPlain,
459
+ renderDriftPlain,
460
+ scenarioReport,
461
+ scenarioBaseline,
462
+ inventoryReport,
463
+ coverageReport
464
+ };
465
+ //# sourceMappingURL=chunk-L7GHSC2Z.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/render/plain.ts","../src/report.ts"],"sourcesContent":["import type { CapabilityRow, SurfaceView } from \"./model.js\";\nimport { flatRows } from \"./model.js\";\nimport {\n coverageSections,\n neverCallable,\n neverCallableSection,\n riskClause,\n runContextRows,\n runHeaderBlocks,\n scenarioTable,\n surfaceSummaryRows,\n unreadSection,\n type FindingSection,\n type ReportBlock,\n type ReportRow,\n type RunContext,\n type ScenarioStats,\n type SurfaceSummaryInput,\n} from \"./summary.js\";\nimport type { DiffEntry } from \"../baseline.js\";\nimport { formatValue } from \"../baseline.js\";\nimport type { ScenarioFailure } from \"../analysis.js\";\nimport { unresolved, type CapabilityInventory } from \"../extract.js\";\nimport { unreadKey, type CoverageReport } from \"../coverage.js\";\n\n/**\n * The no-colour, no-cursor rendering used when stdout is piped or when\n * `--plain`, `CI` or `NO_COLOR` is set. Same view model as the Ink UI, so the\n * two cannot disagree about what the surface contains.\n */\n\nconst MARK = { expose: \"+\", disable: \"~\", hide: \"-\" } as const;\nconst STATE = { expose: \"callable\", disable: \"disabled\", hide: \"hidden\" } as const;\nconst NONE = \"—\";\nconst REPORT_WIDTH = 100;\n\n/**\n * Where a report's text column starts. Fixed rather than derived, so the\n * `Coverage`/`Baselines` matrix in `check` and the `Config`/`Depth` header\n * above it line up as one grid — a block that indents itself differently reads\n * as a different kind of thing.\n */\nconst LABEL_WIDTH = 12;\nconst STATUS_WIDTH = 7;\n\n/** Deterministic wrapping: readable in logs, independent of terminal width. */\nfunction wrapText(text: string, width: number): string[] {\n const words = text.split(/\\s+/).filter(Boolean);\n const lines: string[] = [];\n let line = \"\";\n for (const word of words) {\n if (line && line.length + 1 + word.length > width) {\n lines.push(line);\n line = word;\n } else {\n line = line ? `${line} ${word}` : word;\n }\n }\n if (line) lines.push(line);\n return lines.length > 0 ? lines : [\"\"];\n}\n\n/**\n * Column widths come from the *content*, never from `process.stdout.columns`.\n *\n * `AS-CLI-003` requires plain output to be byte-stable across runs, and a table\n * laid out against the terminal it happened to run in is stable only until two\n * people diff the same CI log from different windows. Same rows in, same bytes\n * out, everywhere.\n *\n * The last column is not padded, so no line ever carries trailing whitespace —\n * which some diff tools render and others strip, i.e. another way for identical\n * output to look different.\n */\nfunction renderTable(headers: string[], rows: Array<{ cells: string[]; note?: string }>): string[] {\n const widths = headers.map((header, column) =>\n Math.max(header.length, ...rows.map((row) => (row.cells[column] ?? \"\").length)),\n );\n const line = (cells: string[]): string =>\n cells\n .map((cell, column) => (column === headers.length - 1 ? cell : cell.padEnd(widths[column]!)))\n .join(\" \")\n .trimEnd();\n\n const lines = [line(headers)];\n for (const row of rows) {\n lines.push(line(row.cells));\n // The unavailability reason is prose of unbounded length. A column for it\n // would set the table's width by its longest sentence; a continuation line\n // keeps the grid aligned and puts the reason directly under its capability.\n if (row.note) {\n for (const [index, note] of wrapText(row.note, REPORT_WIDTH - 6).entries()) {\n lines.push(` ${index === 0 ? \"⤷ \" : \" \"}${note}`);\n }\n }\n }\n return lines;\n}\n\n/** The same grid, for a caller that owns its own heading. */\nexport function renderTablePlain(\n headers: string[],\n rows: Array<{ cells: string[]; note?: string }>,\n): string {\n return renderTable(headers, rows).join(\"\\n\");\n}\n\n/** `UNREACHED — authored, and no scenario mounts it (1)` */\nfunction section(title: string, gloss: string, count: number): string {\n return `${title} — ${gloss} (${count})`;\n}\n\n/**\n * A labelled block: an optional title, then `label STATUS text` rows.\n *\n * The label column is wide enough for the longest label in the report, never\n * narrower than `LABEL_WIDTH`, so every block in one report shares a grid.\n */\nexport function renderReportPlain(blocks: ReportBlock[]): string {\n const width = Math.max(\n LABEL_WIDTH,\n ...blocks.flatMap((block) => block.rows.map((row) => row.label.length + 2)),\n );\n const statuses = blocks.some((block) => block.rows.some((row) => row.status));\n const renderRow = (row: ReportRow): string =>\n `${row.label.padEnd(width)}${\n statuses ? (row.status ?? \"\").padEnd(STATUS_WIDTH) : \"\"\n }${row.text}`.trimEnd();\n\n return blocks\n .filter((block) => block.title || block.rows.length > 0)\n .map((block) => [...(block.title ? [block.title] : []), ...block.rows.map(renderRow)].join(\"\\n\"))\n .join(\"\\n\\n\");\n}\n\n/** Findings, in the order they were built. Tables unindented, lists indented. */\nexport function renderSectionsPlain(sections: FindingSection[]): string {\n return sections\n .map((entry) => {\n const lines = [\n entry.count > 0\n ? section(entry.title, entry.gloss, entry.count)\n : `${entry.title} — ${entry.gloss}`,\n ];\n if (entry.headers && entry.rows) lines.push(...renderTable(entry.headers, entry.rows));\n if (entry.lines) lines.push(...entry.lines.map((line) => ` ${line}`.trimEnd()));\n if (entry.hint) {\n lines.push(\n ...wrapText(entry.hint, REPORT_WIDTH - 4).map(\n (line, index) => ` ${index === 0 ? \"→\" : \" \"} ${line}`,\n ),\n );\n }\n return lines.join(\"\\n\");\n })\n .join(\"\\n\\n\");\n}\n\nfunction renderDetailRow(row: CapabilityRow, lines: string[]): void {\n const tags = row.tags.length > 0 ? ` [${row.tags.join(\", \")}]` : \"\";\n lines.push(` ${MARK[row.outcome]} ${row.name}${tags}`);\n lines.push(` ${row.description}`);\n if (row.reason) lines.push(` reason: ${row.reason}`);\n\n if (row.policies) {\n if (row.policies.length === 0) {\n lines.push(\" policies: none\");\n } else {\n for (const policy of row.policies) {\n const vote = policy.discovery\n ? policy.discovery.decision === \"disable\"\n ? `disable — ${policy.discovery.reason}`\n : policy.discovery.decision\n : \"no discovery hook\";\n const phases = policy.phases.length > 0 ? policy.phases.join(\"/\") : NONE;\n const flags = [\n policy.threw ? \"THREW\" : \"\",\n policy.confirmationEscalation ? \"escalates-confirmation\" : \"\",\n ]\n .filter(Boolean)\n .join(\", \");\n lines.push(\n ` policy ${policy.name} (${policy.scope}, ${phases}): ${vote}${\n flags ? ` [${flags}]` : \"\"\n }`,\n );\n }\n }\n if (row.availability && !row.availability.available) {\n lines.push(\n ` availability: unavailable${\n row.availability.reason ? ` — ${row.availability.reason}` : \"\"\n }`,\n );\n }\n }\n\n if (row.schemas) {\n if (row.schemas.input !== undefined) {\n lines.push(` input: ${JSON.stringify(row.schemas.input)}`);\n }\n if (row.schemas.output !== undefined) {\n lines.push(` output: ${JSON.stringify(row.schemas.output)}`);\n }\n }\n}\n\n/**\n * The counts line, and everything it is relative to (`AS-CLI-007`).\n *\n * `hidden` is printed unconditionally. It is computed on every run — the\n * explanation is always collected — and suppressing it outside `--explain`\n * meant a surface with a policy-hidden half rendered as a complete one. The\n * *attribution* still needs `--explain`; the count and the rows do not.\n *\n * The risk clause is the same argument one level up: `9 callable` says how much\n * surface there is and nothing about what it can do, and \"one of these deletes\n * a device\" is the part a reader needs before they read anything else.\n */\nexport function renderCountsPlain(view: SurfaceView): string {\n const risk = riskClause(flatRows(view));\n return (\n `${view.counts.callable} callable, ${view.counts.disabled} visible-disabled, ` +\n `${view.counts.hidden} hidden` +\n (view.rejections.length > 0\n ? `, ${view.rejections.length} registration${view.rejections.length === 1 ? \"\" : \"s\"} rejected`\n : \"\") +\n (risk ? ` · ${risk}` : \"\")\n );\n}\n\nfunction renderHeader(view: SurfaceView, lines: string[]): void {\n lines.push(\n `scenario ${view.scenario}${view.route ? ` route ${view.route}` : \"\"}${\n view.scope && view.scope.length > 0 ? ` scope ${view.scope.join(\" \")}` : \"\"\n }`,\n );\n lines.push(renderCountsPlain(view));\n}\n\nfunction renderRejections(view: SurfaceView, lines: string[]): void {\n if (view.rejections.length === 0) return;\n lines.push(\"\");\n lines.push(\n section(\"REJECTED\", \"the registry refused these during the mount\", view.rejections.length),\n );\n for (const rejection of view.rejections) {\n const why =\n rejection.reason === \"duplicate\"\n ? \"duplicate — an earlier registration holds this key\"\n : \"guard — onRegister rejected this registration\";\n lines.push(` ! ${rejection.componentType} (${rejection.instanceId}) ${why}`);\n }\n}\n\nfunction renderEmpty(view: SurfaceView, lines: string[]): void {\n lines.push(\"\");\n // \"Nothing is registered\" is only true when nothing was hidden. Saying it\n // over a surface a policy emptied sends the reader to the wrong file.\n if (view.counts.hidden > 0) {\n lines.push(\n `Nothing is callable here — all ${view.counts.hidden} registered capabilities were hidden by policy.`,\n );\n if (!view.explained) lines.push(\"Re-run with --explain to see which policy hid them.\");\n } else {\n lines.push(\"Nothing is registered for this scenario — the agent has no surface here.\");\n if (!view.explained) lines.push(\"Re-run with --explain to see whether a policy hid it.\");\n }\n}\n\nexport interface SurfaceRenderOptions {\n /** The grouped, one-capability-per-paragraph view. Implied by --explain/--schemas. */\n detail?: boolean;\n}\n\n/**\n * One capability per line, aligned. The default, because the question `inspect`\n * is usually asked is *what is on this surface* — which is a scanning question,\n * and prose does not scan.\n *\n * Policy chains and JSON Schemas are multi-line by nature and cannot live in a\n * cell, so `--explain` and `--schemas` fall back to the detail view rather than\n * producing a table with most of the answer missing.\n */\nexport function renderSurfacePlain(view: SurfaceView, options: SurfaceRenderOptions = {}): string {\n const lines: string[] = [];\n renderHeader(view, lines);\n renderRejections(view, lines);\n\n const rows = flatRows(view);\n if (rows.length === 0) {\n renderEmpty(view, lines);\n return lines.join(\"\\n\");\n }\n\n if (options.detail) {\n for (const group of view.groups.filter((group) => group.rows.length > 0)) {\n lines.push(\"\");\n lines.push(`${group.heading} (${group.rows.length})`);\n for (const row of group.rows) renderDetailRow(row, lines);\n }\n return lines.join(\"\\n\");\n }\n\n lines.push(\"\");\n lines.push(\n ...renderTable(\n [\"CAPABILITY\", \"KIND\", \"EFFECT\", \"STATE\", \"FLAGS\"],\n rows.map((row) => ({\n cells: [\n row.path,\n row.kind,\n row.effect ?? NONE,\n STATE[row.outcome],\n row.flags.length > 0 ? row.flags.join(\" · \") : NONE,\n ],\n ...(row.reason ? { note: row.reason } : {}),\n })),\n ),\n );\n return lines.join(\"\\n\");\n}\n\n/**\n * The run header: the command, what it was pointed at, and what every number\n * below is relative to. Printed before anything is mounted, because a reader\n * watching a slow mount should already know what is being measured.\n */\nexport function renderRunHeaderPlain(\n title: string,\n context: RunContext,\n inventory?: CapabilityInventory,\n domainCapabilities?: number,\n): string {\n return renderReportPlain(runHeaderBlocks(title, context, inventory, domainCapabilities));\n}\n\nfunction componentOf(capabilityId: string): string {\n const path = capabilityId.replace(/^(view|domain):/, \"\");\n const dot = path.lastIndexOf(\".\");\n return dot === -1 ? path : path.slice(0, dot);\n}\n\nexport interface CatalogDetailOptions {\n /** Show the raw call-site table, origins, notes and diagnostic prose. */\n detail?: boolean;\n}\n\n/**\n * The catalog *below* its summary: which component authors what, and every call\n * site the extractor could not read.\n *\n * Only `--depth static` prints this. At `--depth full` the scenario tables name\n * every capability a scenario reached, the `UNREACHED` section names the ones it\n * did not, and the verdict carries the unread call sites — so printing it here\n * would be the same information a second time, above the answer instead of in it.\n */\nexport function renderCatalogDetailPlain(\n inventory: CapabilityInventory,\n options: CatalogDetailOptions = {},\n): string {\n const lines: string[] = [];\n const resolved = inventory.capabilities.filter((c) => c.resolution !== \"unresolved\");\n const unreadEntries = unresolved(inventory);\n\n const components = new Map<string, { ids: Set<string>; sites: number; partial: number }>();\n for (const capability of resolved) {\n const component = componentOf(capability.capabilityId);\n const current = components.get(component) ?? { ids: new Set<string>(), sites: 0, partial: 0 };\n current.ids.add(capability.capabilityId);\n current.sites += 1;\n if (capability.resolution === \"partial\") current.partial += 1;\n components.set(component, current);\n }\n\n if (components.size > 0) {\n lines.push(`COMPONENTS (${components.size})`);\n lines.push(\n ...renderTable(\n [\"COMPONENT\", \"CAPABILITIES\", \"CALL SITES\", \"DYNAMIC META\"],\n [...components.entries()]\n .sort(([a], [b]) => a.localeCompare(b))\n .map(([component, data]) => ({\n cells: [\n `view:${component}`,\n String(data.ids.size),\n String(data.sites),\n data.partial > 0 ? String(data.partial) : NONE,\n ],\n note: [...data.ids].sort().join(\" · \"),\n })),\n ),\n );\n }\n\n if (unreadEntries.length > 0) {\n const groups = new Map<string, number>();\n for (const entry of unreadEntries) {\n const key = `${entry.origin.file}\\0${entry.reason ?? \"unknown\"}`;\n groups.set(key, (groups.get(key) ?? 0) + 1);\n }\n if (lines.length > 0) lines.push(\"\");\n lines.push(`UNREAD SITES (${unreadEntries.length})`);\n lines.push(\"Counts above are a floor until these sites are resolved or explicitly accepted.\");\n lines.push(\n ...renderTable(\n [\"FILE\", \"REASON\", \"SITES\"],\n [...groups.entries()]\n .sort(([a], [b]) => a.localeCompare(b))\n .map(([key, count]) => {\n const [file, reason] = key.split(\"\\0\");\n return { cells: [file ?? \"?\", reason ?? \"unknown\", String(count)] };\n }),\n ),\n );\n lines.push(\"\", \"ALLOWLIST KEYS\");\n for (const entry of unreadEntries) lines.push(` allowlist key: ${unreadKey(entry)}`);\n }\n\n if (options.detail) {\n const byId = [...resolved].sort((a, b) => a.capabilityId.localeCompare(b.capabilityId));\n if (byId.length > 0) {\n if (lines.length > 0) lines.push(\"\");\n lines.push(`CAPABILITY DETAILS (${byId.length} call sites)`);\n lines.push(\n ...renderTable(\n [\"CAPABILITY\", \"KIND\", \"ORIGIN\", \"READ\"],\n byId.map((capability) => ({\n cells: [\n capability.capabilityId,\n capability.kind,\n `${capability.origin.file}:${capability.origin.line}`,\n capability.resolution,\n ],\n ...(capability.note ? { note: capability.note } : {}),\n })),\n ),\n );\n }\n if (unreadEntries.length > 0) {\n if (lines.length > 0) lines.push(\"\");\n lines.push(renderSectionsPlain([unreadSection(unreadEntries)]));\n }\n } else if (unreadEntries.length > 0 || resolved.length > 0) {\n if (lines.length > 0) lines.push(\"\");\n lines.push(\n \"Details: re-run with --detail for origins, metadata diagnostics, and allowlist keys.\",\n );\n }\n return lines.join(\"\\n\");\n}\n\nexport interface CoverageRenderOptions {\n /** Check already prints an executive summary; render findings only. */\n compact?: boolean;\n /** Include non-gating inventories such as undeclared runtime ids. */\n detail?: boolean;\n}\n\n/**\n * The verdict: authored minus reached (`AS-COVER-004…005`).\n *\n * This is the finding the command surface used to hide behind a fifth command,\n * so it is the last thing printed and the thing a reader stops on.\n */\nexport function renderCoveragePlain(\n report: CoverageReport,\n options: CoverageRenderOptions = {},\n): string {\n const sections = coverageSections(report, options);\n return sections.length > 0 ? renderSectionsPlain(sections) : \"\";\n}\n\n/** The closing block, and the findings that belong with it. */\nexport function renderSurfaceSummaryPlain(input: SurfaceSummaryInput): string {\n const dark = neverCallable(input.reach);\n // Over one scenario, \"never callable\" repeats that scenario's own table row\n // for row — see neverCallableSection().\n const mounted = input.scenarios.filter((entry) => !entry.failed).length;\n const sections = [\n ...(input.coverage ? coverageSections(input.coverage) : []),\n ...(dark.length > 0 && mounted > 1 ? [neverCallableSection(dark)] : []),\n ];\n const summary = renderReportPlain([{ title: \"SURFACE SUMMARY\", rows: surfaceSummaryRows(input) }]);\n return sections.length > 0 ? `${renderSectionsPlain(sections)}\\n\\n${summary}` : summary;\n}\n\nexport interface CheckOverview {\n status: \"PASS\" | \"FAIL\" | \"ERROR\";\n coverage?: CoverageReport;\n unresolvedAllowed: boolean;\n baselineCurrent: number;\n baselineTotal: number;\n scenarioManifestOk: boolean;\n rejected: number;\n mountFailures: number;\n scenarios: string[];\n /** What the run was pointed at. Printed above the matrix (`AS-CLI-007`). */\n context?: RunContext;\n /** Per-scenario totals. Replaces the bare name list when available. */\n stats?: ScenarioStats[];\n}\n\nfunction wrappedList(items: string[]): string[] {\n const prefix = \" \";\n return wrapText(items.join(\", \"), REPORT_WIDTH - prefix.length).map((line) => `${prefix}${line}`);\n}\n\n/** The health matrix: one row per class of finding, whether or not it fired. */\nfunction checkMatrixRows(input: CheckOverview): ReportRow[] {\n const rows: ReportRow[] = [];\n const coverage = input.coverage;\n\n if (coverage) {\n rows.push({\n label: \"Coverage\",\n status:\n coverage.unreached.length > 0 || coverage.staleAllowlist.length > 0\n ? \"FAIL\"\n : coverage.allowed.length > 0\n ? \"WARN\"\n : \"PASS\",\n text:\n `${coverage.reached}/${coverage.authored} authored capabilities reached` +\n (coverage.unreached.length > 0 ? ` · ${coverage.unreached.length} unreached` : \"\") +\n (coverage.allowed.length > 0 ? ` · ${coverage.allowed.length} unreached allowlisted` : \"\") +\n (coverage.staleAllowlist.length > 0\n ? ` · ${coverage.staleAllowlist.length} stale allowlist entr${\n coverage.staleAllowlist.length === 1 ? \"y\" : \"ies\"\n }`\n : \"\"),\n });\n\n const unread = coverage.unresolved.length;\n const accepted = coverage.allowedUnread.length;\n rows.push({\n label: \"Catalog\",\n status:\n coverage.staleUnreadAllowlist.length > 0 || (unread > 0 && !input.unresolvedAllowed)\n ? \"FAIL\"\n : unread > 0 || accepted > 0\n ? \"WARN\"\n : \"PASS\",\n text:\n coverage.staleUnreadAllowlist.length > 0\n ? `${coverage.staleUnreadAllowlist.length} stale unread allowlist entr${\n coverage.staleUnreadAllowlist.length === 1 ? \"y\" : \"ies\"\n }`\n : unread > 0\n ? `${unread} unread static site${unread === 1 ? \"\" : \"s\"}${\n input.unresolvedAllowed ? \" accepted by --allow-unresolved\" : \"\"\n }`\n : accepted > 0\n ? `${accepted} unread static site${accepted === 1 ? \"\" : \"s\"} allowlisted`\n : \"all static sites resolved\",\n });\n\n rows.push({\n label: \"Domain\",\n status:\n coverage.unmanifestedDomain.length > 0\n ? \"FAIL\"\n : coverage.domainAuthoritative\n ? \"PASS\"\n : \"WARN\",\n text:\n coverage.unmanifestedDomain.length > 0\n ? `${coverage.unmanifestedDomain.length} mounted capabilit${\n coverage.unmanifestedDomain.length === 1 ? \"y\" : \"ies\"\n } absent from manifest`\n : coverage.domainAuthoritative\n ? `${coverage.domainReached.length} manifest capabilit${\n coverage.domainReached.length === 1 ? \"y\" : \"ies\"\n } reached`\n : \"authoritative manifest not configured\",\n });\n } else {\n rows.push({\n label: \"Coverage\",\n status: input.status === \"ERROR\" ? \"ERROR\" : \"WARN\",\n text:\n input.status === \"ERROR\"\n ? \"no verdict; runtime analysis incomplete\"\n : \"not evaluated — statement about these scenarios only; re-run with --depth full\",\n });\n }\n\n const baselineOk = input.baselineCurrent === input.baselineTotal && input.scenarioManifestOk;\n rows.push({\n label: \"Baselines\",\n status: baselineOk ? \"PASS\" : \"FAIL\",\n text:\n `${input.baselineCurrent}/${input.baselineTotal} scenario baselines current` +\n (input.scenarioManifestOk ? \"\" : \" · scenario manifest differs\"),\n });\n\n rows.push({\n label: \"Runtime\",\n status: input.mountFailures > 0 ? \"ERROR\" : input.rejected > 0 ? \"FAIL\" : \"PASS\",\n text:\n input.mountFailures > 0\n ? `${input.mountFailures} scenario${input.mountFailures === 1 ? \"\" : \"s\"} did not mount`\n : input.rejected > 0\n ? `${input.rejected} registration${input.rejected === 1 ? \"\" : \"s\"} rejected`\n : `${input.scenarios.length} scenario${input.scenarios.length === 1 ? \"\" : \"s\"} mounted`,\n });\n\n return rows;\n}\n\n/** First-screen answer for `check`: verdict, context, health, then scenarios. */\nexport function renderCheckOverviewPlain(input: CheckOverview): string {\n const blocks: ReportBlock[] = [\n {\n title: `SURFACE CHECK ${input.status}`,\n rows: input.context ? runContextRows(input.context) : [],\n },\n { rows: checkMatrixRows(input) },\n ];\n\n const table = input.stats ? scenarioTable(input.stats, { baselines: true }) : undefined;\n const scenarios =\n input.stats && table\n ? [`SCENARIOS (${input.stats.length})`, ...renderTable(table.headers, table.rows)]\n : [`SCENARIOS (${input.scenarios.length})`, ...wrappedList(input.scenarios)];\n\n return `${renderReportPlain(blocks)}\\n\\n${scenarios.join(\"\\n\")}`;\n}\n\n/** The commands that clear this report, in the order worth running them. */\nexport function renderNextStepsPlain(steps: string[]): string {\n return [\n \"NEXT STEPS\",\n ...steps.flatMap((step, index) =>\n wrapText(step, REPORT_WIDTH - 5).map(\n (line, wrapped) => ` ${wrapped === 0 ? `${index + 1}.` : \" \"} ${line}`,\n ),\n ),\n ].join(\"\\n\");\n}\n\n/**\n * Why there is no coverage verdict. Never silence: a reader who asked for the\n * complete answer and got a partial one has to be told which part is missing,\n * or the partial one reads as the complete one.\n */\nexport function renderNoVerdictPlain(failures: ScenarioFailure[]): string {\n // The failures themselves are listed directly above, by DID NOT MOUNT. This\n // says what their absence costs the rest of the report, and nothing else.\n return [\n section(\n \"NO COVERAGE VERDICT\",\n \"a scenario did not mount, so nothing reached anything\",\n failures.length,\n ),\n \" Every capability those scenarios would have surfaced would be reported unreached,\",\n \" so no verdict is printed at all. Fix the mount, or name a scenario that works.\",\n ].join(\"\\n\");\n}\n\nexport function renderFailuresPlain(failures: ScenarioFailure[]): string {\n return [\n section(\"DID NOT MOUNT\", \"these scenarios threw, and were skipped\", failures.length),\n ...failures.flatMap((failure) => [` ${failure.scenario}`, ` ${failure.message}`]),\n ].join(\"\\n\");\n}\n\n/** One scenario's drift, unindented — the section renderer owns the indent. */\nexport function renderDriftPlain(scenario: string, entries: DiffEntry[]): string[] {\n const lines = [`${scenario}: ${entries.length} change${entries.length === 1 ? \"\" : \"s\"}`];\n for (const entry of entries) {\n const where = entry.subject ? `${entry.subject} (${entry.path})` : entry.path;\n if (entry.kind === \"added\") lines.push(` + ${where} ${formatValue(entry.after)}`);\n else if (entry.kind === \"removed\") lines.push(` - ${where} ${formatValue(entry.before)}`);\n else {\n lines.push(` ~ ${where}`);\n lines.push(` before: ${formatValue(entry.before)}`);\n lines.push(` after: ${formatValue(entry.after)}`);\n }\n }\n return lines;\n}\n","import { basename, relative } from \"node:path\";\nimport type { CollectResult } from \"./collect.js\";\nimport type { CoverageReport } from \"./coverage.js\";\nimport type { CapabilityInventory } from \"./extract.js\";\nimport { normalize } from \"./baseline.js\";\nimport { buildView, flatRows, type CapabilityRow } from \"./render/model.js\";\n\n/** Stable, complete per-scenario document shared by JSON, baselines and check. */\nexport interface ScenarioReport {\n scenario: string;\n scope?: string[];\n snapshot: unknown;\n capabilities: CapabilityRow[];\n rejections: CollectResult[\"rejections\"];\n explanation?: { capabilities: CapabilityRow[] };\n}\n\nexport function scenarioReport(\n result: CollectResult,\n options: { attribution?: boolean; schemas?: boolean } = {},\n): ScenarioReport {\n const view = buildView(result, {\n ...(options.attribution ? { explain: true } : {}),\n ...(options.schemas ? { schemas: true } : {}),\n });\n const capabilities = flatRows(view);\n return {\n scenario: result.scenario,\n ...(result.scope ? { scope: result.scope } : {}),\n snapshot: normalize(result.snapshot),\n // Includes expose, disable and hide. Rows never contain runtime ids.\n capabilities,\n rejections: [...result.rejections].sort(\n (a, b) =>\n a.componentType.localeCompare(b.componentType) ||\n a.instanceId.localeCompare(b.instanceId) ||\n a.reason.localeCompare(b.reason),\n ),\n ...(options.attribution ? { explanation: { capabilities } } : {}),\n };\n}\n\n/** Baseline payload: same semantic document, without invocation-only labels. */\nexport function scenarioBaseline(result: CollectResult): Record<string, unknown> {\n const report = scenarioReport(result);\n return {\n ...(report.snapshot as Record<string, unknown>),\n capabilities: report.capabilities,\n rejections: report.rejections,\n };\n}\n\n/** Machine output must not contain checkout-specific absolute paths. */\nexport function inventoryReport(\n inventory: CapabilityInventory | undefined,\n domainCapabilities?: string[],\n): unknown {\n if (!inventory) return null;\n return {\n ...inventory,\n root: \".\",\n tsconfig: relative(inventory.root, inventory.tsconfig) || \"tsconfig.json\",\n ...(domainCapabilities\n ? { domain: { source: \"manifest\", capabilities: [...domainCapabilities].sort() } }\n : {}),\n };\n}\n\nexport function coverageReport(report: CoverageReport | undefined): unknown {\n if (!report) return null;\n return {\n ...report,\n allowlistPath: basename(report.allowlistPath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