Skip to content

fix: retain action safety warnings in HTML reports - #70

Merged
alexshapalov merged 1 commit into
pgrundev:mainfrom
DivyamTalwar:fix/preserve-report-action-guards
Sep 22, 2026
Merged

alexshapalov merged 1 commit into
pgrundev:mainfrom
DivyamTalwar:fix/preserve-report-action-guards

Conversation

@DivyamTalwar

Copy link
Copy Markdown
Contributor

What and why

Closes #68.

The HTML report displayed remediation but omitted Finding.Safety.BlockingCaveats. Render every guard's action, explanation and verification condition so the exported report carries the operational qualifications already present in other outputs. Prohibitions say "Do not run"; conditional cautions retain their "Only after" verification text.

All guard text remains HTML-escaped. Warnings also remain visible for suppressed findings; missing safety metadata does not create fabricated warnings.

Verification

Verified commit: aea46b69d19026cc87f84617c2c2a8216c4465d2.

  • The actual renderer regression fails on base a1e6561e366455756c45a16a46647f882b3b6a1c: remediation is present but required guard text is absent.
  • go test -race ./internal/report -run 'TestRenderReportCarries|TestReportGuards|TestReportWithoutSafety' -count=20: passed.
  • Full affected report, render and CLI package race tests: passed.
  • bash scripts/gate.sh: passed on the committed HEAD, including build, vet, pinned lint, tests and all six release-target builds.
  • go test -race ./...: passed. Formatting and git diff --check are clean.
  • Controls cover multiple guards, prohibition/precondition wording, HTML-sensitive text, suppressed findings and nil/empty safety metadata.

Scope and risk

Only the HTML presentation and its tests change. No database queries, dependencies, migrations, finding semantics or JSON contract changes are introduced. Testing exercises the real renderer with synthetic finding fixtures; no browser visual or PostgreSQL integration claim is made. Reverting this commit restores the prior rendering.

Checklist

  • Committed-HEAD gate and full race suite pass.
  • Read-only, privacy and deterministic-finding invariants are unchanged.
  • No new finding or JSON field; catalog/schema unchanged.

The HTML report displayed remediation but omitted the structured blocking caveats carried by other output formats. Render each guard's action, explanation and verification condition, making prohibitions explicit and preserving HTML escaping.

Tests cover a real renderer regression, multiple guards, prohibitions, suppressed findings, untrusted display characters and absent safety metadata. The regression fails before the fix; report, render and CLI race tests pass. No execution or JSON contract changes are introduced.

Closes pgrundev#68
@alexshapalov
alexshapalov merged commit 9e41414 into pgrundev:main Sep 22, 2026
19 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.

HTML reports omit destructive-action preconditions and prohibitions

2 participants