You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 4c9fda1
Browse filesBrowse the repository at this point in the historyBrowse files
feat(report): add vg report --format html with severity summary (#406)
vg report --format html renders the local scan artifact (default
.vibgrate/scan_result.json) as one self-contained HTML page:
- A summary at the top shows severity counts for vulnerability and
security findings, with links to the full tables below.
- A missing score renders as n/a; a measured 0 stays 0.
- A fix-available count appears when findings carry details.fixedVersions.
- The page is deterministic, HTML-escaped and fully local: no network
calls and no external assets.
html is added to the accepted report formats. Text, JSON and Markdown
output are unchanged, and any other --format value still exits 5 with
error: unknown --format "<value>" (expected md, text, json, html).
DOCS.md, the bundled vg skill text and installer content describe the
HTML page.
Closes#235
The comparison is exact. `HTML`, `sarif`, and `md ` are unknown. Omitting
485
485
`--format` stays on `text`.
486
486
487
+
`md`, `text`, and `json` are unchanged. `html` writes one self-contained page
488
+
from that same artifact. It does not call the network and does not load
489
+
external files. The page opens with a summary:
490
+
491
+
- DriftScore and the four component scores. A missing score is `n/a`. A measured `0` stays `0`.
492
+
- Counts by severity for vulnerability findings and for security findings. A check that did not run stays "Not scanned" rather than a row of zeros. A check that finished with nothing to report shows zeros.
493
+
- When a finding carries `details.fixedVersions`, how many of those findings name a fix.
494
+
- Links to the full tables under the summary: vulnerabilities, security findings, and the other findings.
495
+
496
+
The same artifact always produces the same page. Save it with a shell redirect:
497
+
498
+
```bash
499
+
vg report --format html > report.html
500
+
```
501
+
487
502
#### Report format coverage
488
503
489
504
`--format md` is `formatMarkdown` (`src/reporting/formatters/markdown.ts`).
490
-
`--format text` is `formatText` (`src/reporting/formatters/text.ts`). Both read
491
-
the same artifact. A section below is omitted when its guard is false. Lists
492
-
follow artifact order except where a sort is named. Colours in the text report
493
-
are terminal styling; under `NO_COLOR` the same words are plain. A null score
494
-
is `n/a` in both formats. A measured `0` stays `0`.
505
+
`--format text` is `formatText` (`src/reporting/formatters/text.ts`).
506
+
`--format html` is `formatHtmlReport` (`src/reporting/formatters/html.ts`).
507
+
All three read the same artifact. A section below is omitted when its guard is
508
+
false. Lists follow artifact order except where a sort is named. Colours in the
509
+
text report are terminal styling; under `NO_COLOR` the same words are plain. A
510
+
null score is `n/a` in the human formats. A measured `0` stays `0`.
vg report --in .vibgrate/scan_result.json --format html
502
519
```
503
520
504
521
##### Markdown (`formatMarkdown`)
@@ -566,7 +583,11 @@ When set:
566
583
| Architecture Layers |`extended.architecture`. `archetype`, `archetypeConfidence`, `totalClassified`, `unclassified`. **Folders** — the first 12 of `folders`: `path`, `layer`, `confidence`, `fileCount`. **Coverage**, when set — `ratio`, `classified`, `unclassified`, and `bySource` counts sorted by count descending then source name. **Unclassified source** — `unclassifiedFiles.length` when that list is non-empty. **Unclassified by folder** — the first 8 of `unclassifiedFolders`: `count`, `path`. **Layers** with `fileCount` greater than 0: `layer`, `fileCount`, `driftScore`, `riskLevel`. **Boundary violations** — violations whose `rule` does not start with `graph-conflict:`, first 8: `fromFile`, `toFile`, `rule`. **Layer conflicts** — the `graph-conflict:` violations, first 8, same three fields. A capped violation list is marked when `violationsCapped` is set |
567
584
| Solution Drift Summary |`solutions` is non-empty. `name`, `projectPaths.length`, and `drift.score` or `n/a`|
568
585
569
-
`relationshipDiagram` is not rendered. The text formatter leaves that diagram in the JSON artifact.
586
+
`relationshipDiagram` is not rendered. Markdown, text, and HTML leave that diagram in the JSON artifact.
587
+
588
+
##### HTML (`formatHtmlReport`)
589
+
590
+
`vg report --format html` writes one self-contained page from the same artifact. It does not call the network and does not load external files. The page opens with the summary listed above (DriftScore, severity counts, a fix-available count when a finding carries `details.fixedVersions`, and links to the tables), then the full vulnerability, security, and other-finding tables. A check that did not run stays "Not scanned". A missing score is `n/a`. The same artifact always produces the same page.
570
591
571
592
##### Differences
572
593
@@ -579,10 +600,11 @@ When set:
579
600
- DriftScore: Markdown puts the lower-is-better gloss in the opening cell. Text puts the score in **DriftScore Summary** without that gloss.
580
601
- VCS: Markdown uses separate VCS, Branch, and Commit rows, and Commit requires `vcs.sha`. Text uses one line and can show `shortSha` without requiring `sha`.
581
602
- Runtime wording: Markdown always says `major(s)`. Text says `major` or `majors`.
603
+
- HTML is the browser page: the summary above, then the vulnerability, security, and other-finding tables. It does not print Markdown's recommended-standards section or the text inventory.
582
604
583
605
##### JSON
584
606
585
-
`--format json` prints `JSON.stringify` of the loaded artifact with a two-space indent. Keys, values, and omissions are unchanged. Parse this when a script needs a field. Markdownand text drop fields, cap lists, and add derived lines; they are not a stable contract.
607
+
`--format json` prints `JSON.stringify` of the loaded artifact with a two-space indent. Keys, values, and omissions are unchanged. Parse this when a script needs a field. Markdown, text, and HTML drop fields, cap lists, and add derived lines; they are not a stable contract.
0 commit comments