Repository navigation
Conversation
jflowers
left a comment
There was a problem hiding this comment.
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).
| } | ||
|
|
||
| nameLimit := len(summary.SkippedTestNames) | ||
| if nameLimit > summary.SkippedTests { |
There was a problem hiding this comment.
[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.
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]>
24d717e to
61c8736
Compare
Summary
Fixes #261
Adds self-contained HTML output to
gaze quality,gaze crap, andgaze 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=htmlrenders natively and does not require an AI adapter.How to Test
Generate each report:
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
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).