Skip to content

feat: add HTML output for quality, CRAP, and combined report - #298

Merged
jflowers merged 11 commits into
unbound-force:mainfrom
yvonnedevlinrh:opsx/add-html-output-quality-crap-report
Oct 2, 2026
Merged

jflowers merged 11 commits into
unbound-force:mainfrom
yvonnedevlinrh:opsx/add-html-output-quality-crap-report

Conversation

@yvonnedevlinrh

@yvonnedevlinrh yvonnedevlinrh commented Oct 2, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Fixes #261

Adds self-contained HTML output to gaze quality, gaze crap, and gaze report. The reports work offline, escape analyzed content, preserve unavailable and degraded states, and leave existing text, JSON, scoring, and quality-gate behavior unchanged.

gaze report --format=html renders natively and does not require an AI adapter.

How to Test

go build ./...
go test -race -count=1 -short -timeout 15m ./...
go test -race -count=1 -run 'TestRunSelfCheck' -timeout 30m ./cmd/gaze/...
golangci-lint run ./...

Generate each report:

gaze quality --format=html ./... > quality.html
gaze crap --format=html ./... > crap.html
gaze report --format=html ./... > report.html

How to Demo

Run the three commands above and show the quality diagnostics, CRAP scores, baseline comparison, and combined pipeline sections. Demonstrate that the combined report works without --ai.

Key Files Changed

  • internal/quality/: quality HTML formatter, template, and tests
  • internal/crap/: CRAP HTML formatter, template, and tests
  • internal/aireport/: combined formatter and runner integration
  • cmd/gaze/: validation, dispatch, help, and command tests
  • docs/ and README.md: usage documentation
  • openspec/changes/add-html-output-quality-crap-report/: approved artifacts

Known Issues

LOW: Skipped-test omission counting assumes the existing summary invariant.

Documentation

Website issue to document changes unbound-force/website#294

This PR was generated by /uf.finale (AI-assisted).

@yvonnedevlinrh
yvonnedevlinrh requested a review from a team October 2, 2026 15:13
@yvonnedevlinrh yvonnedevlinrh self-assigned this Oct 2, 2026
jflowers
jflowers previously approved these changes Oct 2, 2026

@jflowers jflowers left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PR Review: #298 — feat: add HTML output for quality, CRAP, and combined report

Adds self-contained HTML output to gaze quality, gaze crap, and gaze report via Go's html/template with contextual escaping. Well-structured, security-conscious, fully aligned with the OpenSpec spec (9 requirements covered), and thoroughly tested with dedicated adversarial-XSS tests per formatter. Existing text/JSON behavior is untouched.

Security

No issues. All three formatters use html/template; zero uses of template.HTML/JS/URL/HTMLAttr; templates embed no external resources.

Alignment

No issues.

Constitution Compliance

1 LOW finding (see inline comment).

This review was generated by /uf.review-pr (AI-assisted).

Comment thread internal/quality/html.go
}

nameLimit := len(summary.SkippedTestNames)
if nameLimit > summary.SkippedTests {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[LOW] Skipped-test name capping couples two sources of truth. nameLimit is initialized to len(summary.SkippedTestNames) then clamped to summary.SkippedTests (lines 195-196), assuming the invariant len(SkippedTestNames) >= SkippedTests. If that invariant is ever violated (e.g., names under-counted), the clamp silently drops names and SkippedTestsRemaining (lines 202-203) over-reports. No panic is possible, and this is documented as a known issue, so this is a defensive-coding observation only. Consider deriving the remaining count from the actual sliced length rather than the raw SkippedTests field, or assert the invariant explicitly.

yvonnedevlinrh and others added 11 commits October 2, 2026 13:27
The rebase dropped the PR's merge commit (24d717e), which contained
manual conflict resolutions against upstream/main. Restore them:

- internal/quality/html.go and html_test.go: import the /v2 module path
  for internal/taxonomy (required by the module-major validator).
- cmd/gaze/main_test.go: pass the ChangeGateResult arg and trailing
  zeroes to writeCrapOutputAndSummary, whose signature gained a
  *crap.ChangeGateResult parameter on main.

Assisted-by: deepseek-v4-pro
Signed-off-by: Jay Flowers <[email protected]>
@jflowers
jflowers force-pushed the opsx/add-html-output-quality-crap-report branch from 24d717e to 61c8736 Compare October 2, 2026 17:49
@jflowers
jflowers merged commit c3b7d8d into unbound-force:main Oct 2, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat: add HTML output for quality, crap, and combined reports

2 participants