Skip to content

feat: add HTML/Markdown reporting and failure diagnostics to verifier (#87)#94

Open
AbiramiR-27 wants to merge 3 commits into
AOSSIE-Org:mainfrom
AbiramiR-27:feature-87-diagnostic-reporting
Open

feat: add HTML/Markdown reporting and failure diagnostics to verifier (#87)#94
AbiramiR-27 wants to merge 3 commits into
AOSSIE-Org:mainfrom
AbiramiR-27:feature-87-diagnostic-reporting

Conversation

@AbiramiR-27

@AbiramiR-27 AbiramiR-27 commented Jul 8, 2026

Copy link
Copy Markdown

feat: add HTML/Markdown reporting and failure diagnostics to verifier (#87)

Addressed Issues:

Fixes #87

Screenshots/Recordings:

A Markdown report (report.md) and an HTML report (report.html) are generated under the output directory when run with the formatting flags:

  • Markdown Output Example:

    Status Check Name Expected Actual Details
    ✅ PASS resolve_reference - - .../dist/gpt10m-shakespeare
    ✅ PASS manifest_json - - .../dist/gpt10m-shakespeare/ovllm_manifest.json
    ✅ PASS artifact_sha256 a952... a952... raw bytes of gpt10m_shakespeare_fp32_deton_s99.safetensors
  • HTML Output Preview:
    Generates a dark-themed single-page report with responsive layout grids, check status badges (PASS/FAIL/SKIP), and expected vs actual code block comparisons.

Additional Notes:

This PR implements format selection (text, markdown, and html) and file output capabilities for ovllm verify.

Core changes include:

  1. Added --format (choices: text, markdown, html) and --output <filepath> arguments to the verifier CLI in src/ovllm.py.
  2. Implemented get_system_diagnostics() in src/verifier.py to retrieve active operating system details, Python/PyTorch versions, and hardware accelerators (CUDA/XPU/CPU).
  3. Added Markdown and HTML report generation formats inside src/verifier.py.
  4. Hardened test_sigstore_verify_ignores_signature_file in tests/test_verifier.py by mocking the model_signing dependency search so tests remain independent of local environment packages.
  5. Added report formatting tests ReportFormattingTests testing custom markdown/html files and CLI integration.

AI Usage Disclosure:

We encourage contributors to use AI tools responsibly when creating Pull Requests. While AI can be a valuable aid, it is essential to ensure that your contributions meet the task requirements, build successfully, include relevant tests, and pass all linters. Submissions that do not meet these standards may be closed without warning to maintain the quality and integrity of the project. Please take the time to understand the changes you are proposing and their impact. AI slop is strongly discouraged and may lead to banning and blocking. Do not spam our repos with AI slop.

Check one of the checkboxes below:

  • This PR does not contain AI-generated code at all.
  • This PR contains AI-generated code. I have read the AI Usage Policy and this PR complies with this policy. I have tested the code locally and I am responsible for it.

I have used the following AI models and tools: Agentic Coding IDE Assistant

Checklist

  • My PR addresses a single issue, fixes a single bug or makes a single improvement.
  • My code follows the project's code style and conventions
  • If applicable, I have made corresponding changes or additions to the documentation
  • If applicable, I have made corresponding changes or additions to tests
  • My changes generate no new warnings or errors
  • I have joined the Discord server and I will share a link to this PR with the project maintainers there
  • I have read the Contribution Guidelines
  • Once I submit my PR, CodeRabbit AI will automatically review it and I will address CodeRabbit's comments.
  • I have filled this PR template completely and carefully, and I understand that my PR may be closed without review otherwise.

Summary by CodeRabbit

  • New Features
    • Verification reports can be generated as text, Markdown, or HTML.
    • Optionally write the report to a file via a new output path setting.
    • Reports now include system diagnostics and a timestamp.
  • Bug Fixes
    • Improved how verification results determine the CLI exit code.
  • Tests
    • Added coverage for Markdown/HTML report generation (including escaping) and invalid format handling.
    • Strengthened a sigstore verification test to mock external checks more comprehensively.

@coderabbitai

coderabbitai Bot commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Warning

Review limit reached

@AbiramiR-27, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 48 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 04417219-20e9-4b8d-9d7d-c5b6b6c52dad

📥 Commits

Reviewing files that changed from the base of the PR and between 28bce35 and e74a379.

📒 Files selected for processing (1)
  • tests/test_verifier.py
📝 Walkthrough

Walkthrough

This PR adds configurable verification report formatting, diagnostics collection, and report file output for the verify flow. It updates the CLI, report rendering, and tests to cover text, Markdown, and HTML output.

Changes

Verification Report Formatting

Layer / File(s) Summary
Diagnostics and timestamps
src/verifier.py
Adds platform import, get_system_diagnostics() for OS/Python/PyTorch details, and time_ref() for report timestamps.
Markdown and HTML renderers
src/verifier.py
Adds generate_markdown_report() and generate_html_report() to format verdicts, per-check rows, model reference, and diagnostics.
Report output and CLI wiring
src/verifier.py, src/ovllm.py
Reworks print_report() for text/markdown/html output and optional file writing, and threads --format and --output through the verify command.
Report formatting tests
tests/test_verifier.py
Adds coverage for Markdown/HTML output, escaping, invalid formats, CLI report file generation, and the sigstore patch setup.

Estimated code review effort: 3 (Moderate) | ~25 minutes

Suggested reviewers: Archit381

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed Looks spot on; it names the main verifier reporting change.
Linked Issues check ✅ Passed Fair dinkum — it adds HTML/Markdown reports, file output, and system diagnostics, matching #87's main goals.
Out of Scope Changes check ✅ Passed No obvious unrelated churn; the edits stay focused on verifier reporting and tests.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 3

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@src/verifier.py`:
- Around line 634-673: print_report currently falls through silently when
format_type is not text, markdown, or html, so add an explicit else branch that
raises ValueError for unknown formats. Keep the fix inside print_report and make
sure the error is raised after the existing text/markdown/html handling so
direct calls and tests fail fast instead of producing no output.
- Around line 342-364: The Markdown table in generate_markdown_report can break
when any cell value contains a pipe character, especially the Details field from
r.detail. Update the table row generation in generate_markdown_report to escape
or sanitize pipes in all cell values before appending them, including detail_val
and any other dynamically inserted fields like expected_val, actual_val, and
r.name, so the report table stays structurally valid.
- Around line 367-627: The HTML report builder in generate_html_report is
inserting unescaped user-controlled values, creating an XSS risk in shared
reports. Add the html module import and escape every interpolated field before
rendering, including ref, each CheckResult field used in rows (name, expected,
actual, detail), and diagnostic keys/values in the diag section. Keep the
formatting logic in generate_html_report unchanged aside from applying escaping
at the insertion points.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: ab286735-ba72-4b7c-96a3-4a429bcfe7fe

📥 Commits

Reviewing files that changed from the base of the PR and between 02c76b4 and 46f707b.

📒 Files selected for processing (3)
  • src/ovllm.py
  • src/verifier.py
  • tests/test_verifier.py

Comment thread src/verifier.py
Comment thread src/verifier.py
Comment thread src/verifier.py

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🧹 Nitpick comments (1)
tests/test_verifier.py (1)

224-284: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Ripper test coverage for the report formatting — XSS and pipe escaping checks are spot on.

The test method name test_text_markdown_html_report_generation mentions "text" but doesn't directly assert text-format output. The text path is exercised indirectly through the invalid-format test (which builds the text string before raising), but an explicit assertion on text output would make the name fully accurate. Not blocking — just a heads-up for future polish.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@tests/test_verifier.py` around lines 224 - 284, The report-formatting test
name suggests text output, but `test_text_markdown_html_report_generation` never
explicitly verifies the text formatter. Add a direct text-format assertion in
`ReportFormattingTests` by calling `print_report` with `format_type="text"` and
checking the generated output contains the expected report header/content, using
the existing `print_report` helper to keep coverage aligned with the test name.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In `@tests/test_verifier.py`:
- Around line 224-284: The report-formatting test name suggests text output, but
`test_text_markdown_html_report_generation` never explicitly verifies the text
formatter. Add a direct text-format assertion in `ReportFormattingTests` by
calling `print_report` with `format_type="text"` and checking the generated
output contains the expected report header/content, using the existing
`print_report` helper to keep coverage aligned with the test name.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 508d5714-a53a-47a5-94c0-914161ea85e2

📥 Commits

Reviewing files that changed from the base of the PR and between 46f707b and 28bce35.

📒 Files selected for processing (2)
  • src/verifier.py
  • tests/test_verifier.py
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/verifier.py

@AbiramiR-27

AbiramiR-27 commented Jul 14, 2026

Copy link
Copy Markdown
Author

Hi @Archit381 The implementation is complete, all tests have been updated, and CodeRabbit's review feedback has been fully addressed. All CI checks are passing. Waiting for your review and merge!

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.

[FEATURE]: Add Diagnostic Verification Reporting (HTML, Markdown, and detailed failure diagnostics)

1 participant