Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/openspec/changes/thunder-plugin-qa/design.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Design: Thunder Plugin QA System
# Design: Thunder Plugin QA System

## Architecture Overview

Expand All @@ -23,7 +23,7 @@ Plugin files in ThunderNanoServices/Dictionary/
Chat report: Issue Summary table, failures only
Reports/plugin/Dictionary_2026-06-05.md ← Markdown report with clickable issue navigation
Reports/plugin/Dictionary_2026-06-05.html <- HTML report with clickable issue navigation and syntax-highlighted code blocks
```

```
Expand Down
10 changes: 5 additions & 5 deletions .github/openspec/changes/thunder-plugin-qa/proposal.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Proposal: Thunder PluginQualityAdvisor System
# Proposal: Thunder PluginQualityAdvisor System

## Intent

Expand Down Expand Up @@ -54,8 +54,8 @@ automatically.

**Review reports** (Markdown, generated after each review run)
- Single `.md` file per review with Issue Summary table and Detailed Findings
- Plugin report: `Reports/plugin/{PluginName}_{YYYY-MM-DD}.md`
- Interface report: `Reports/interface/{InterfaceName}_{YYYY-MM-DD}.md`
- Plugin report: `Reports/plugin/{PluginName}_{YYYY-MM-DD}.html`
- Interface report: `Reports/interface/{InterfaceName}_{YYYY-MM-DD}.html`
- Issue Summary table with clickable `[rule_id - Name](#issue-N)` links navigating to detailed sections
- Each finding has: What's wrong (plain English), Code found, Fix
- PASS and SKIP rules excluded — only failures shown
Expand Down Expand Up @@ -102,7 +102,7 @@ ThunderTools/PluginQualityAdvisor/
│ └── thunder-interface-rules.yaml
└── Reports/
├── plugin/
│ └── {PluginName}_{YYYY-MM-DD}.md
│ └── {PluginName}_{YYYY-MM-DD}.html
└── interface/
└── {InterfaceName}_{YYYY-MM-DD}.md
└── {InterfaceName}_{YYYY-MM-DD}.html
```
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Delta for Interface Validation and Plugin Generation
# Delta for Interface Validation and Plugin Generation

## ADDED Requirements

Expand Down Expand Up @@ -27,7 +27,7 @@ a Thunder COM interface header against 19 rules (16 core + 3 advisory).
- THEN it applies all 19 rules loaded from `thunder-interface-rules.yaml` in order:
core_1_1 through core_16_1 (16 core), then advisory_m1_1 through advisory_m3_1 (3 advisory)
- AND outputs an Issue Summary table with columns: Issue No. | Status | Rule | File | Line | Issue
- AND generates a Markdown report with clickable navigation to Detailed Findings
- AND generates a self-contained HTML report with clickable navigation to Detailed Findings and syntax-highlighted code blocks

---

Expand Down
49 changes: 24 additions & 25 deletions .github/openspec/changes/thunder-plugin-qa/specs/reports/spec.md
Original file line number Diff line number Diff line change
@@ -1,37 +1,36 @@
# Spec: Thunder PluginQualityAdvisor Report Generation
# Spec: Thunder PluginQualityAdvisor Report Generation

## Purpose

After every `/thunder-plugin-review` or `/thunder-interface-review` run, the system generates a
Markdown report file with an Issue Summary table and Detailed Findings sections with clickable navigation.
After every `/thunder-plugin-review` or `/thunder-interface-review` run, the system generates a self-contained HTML report file with an Issue Summary table and Detailed Findings sections with clickable navigation and syntax-highlighted code blocks.

---

## Requirements

### REQ-R1 — Plugin review Markdown report
### REQ-R1 — Plugin review HTML report

**Scenario:** `/thunder-plugin-review` completes all 84 rules
- The system MUST generate a Markdown file at:
`ThunderTools/PluginQualityAdvisor/Reports/plugin/{PluginName}_{YYYY-MM-DD}.md`
- The system MUST generate an HTML file at:
`ThunderTools/PluginQualityAdvisor/Reports/plugin/{PluginName}_{YYYY-MM-DD}.html`
- If a file with that name already exists, append `_2`, `_3` etc. (never overwrite)
- The report MUST contain: header with totals, Issue Summary table, and Detailed Findings sections
- PASS and SKIP rules are NOT included — only VIOLATION, WARNING, and SUGGESTION

### REQ-R2 — Interface review Markdown report
### REQ-R2 — Interface review HTML report

**Scenario:** `/thunder-interface-review` completes all 19 rules
- The system MUST generate a Markdown file at:
`ThunderTools/PluginQualityAdvisor/Reports/interface/{InterfaceName}_{YYYY-MM-DD}.md`
- The system MUST generate an HTML file at:
`ThunderTools/PluginQualityAdvisor/Reports/interface/{InterfaceName}_{YYYY-MM-DD}.html`
- Same no-overwrite rule applies
- Same structure: header, Issue Summary table, Detailed Findings

### REQ-R3 — Report header

The report MUST start with:

```markdown
# Thunder Plugin Review - {PluginName}
```html
<!-- Thunder Plugin Review - {PluginName} -->

**Date:** {YYYY-MM-DD}
**Plugin:** {PluginName}
Expand All @@ -46,7 +45,7 @@ The report MUST contain an Issue Summary table with clickable navigation:
|--------|-------------|
| Issue No. | Sequential number |
| Status | ❌ VIOLATION / ⚠️ WARNING / 💡 SUGGESTION (Unicode emoji, never GitHub shortcodes) |
| Rule | Clickable link: `[rule_id - Name](#issue-N)` navigating to detailed section |
| Rule | Clickable link: `<a href="#issue-N">rule_id - Name</a>` navigating to detailed section |
| File | Source file name |
| Line | Exact line number |
| Issue | Short description |
Expand All @@ -55,12 +54,12 @@ The report MUST contain an Issue Summary table with clickable navigation:

Each issue MUST have a detailed section with:

- Heading: `### Issue N` (creates `#issue-n` anchor for navigation)
- Heading: `<h3 id="issue-N">Issue N</h3>` (creates `#issue-n` anchor for navigation)
- Rule ID and name as bold text: `**rule_XX - Rule Name**`
- Status line: `**Status:** ❌ VIOLATION | **File:** filename | **Line:** N`
- **What's wrong:** Plain-English explanation a junior developer can understand
- **Code found:** Actual code from the file with file:line comment in a fenced code block
- **Fix:** Corrected code in a fenced code block
- **Code found:** Actual code from the file with file:line comment in a `<pre><code class="language-cpp">` block (highlight.js syntax-highlighted)
- **Fix:** Corrected code in a `<pre><code class="language-cpp">` block
- If severity was downgraded: **Note:** paragraph explaining why

Issues MUST be ordered by severity: VIOLATIONS first, then WARNINGS, then SUGGESTIONS.
Expand All @@ -74,22 +73,22 @@ Issues MUST be ordered by severity: VIOLATIONS first, then WARNINGS, then SUGGES

- The report MUST be written via terminal (`[System.IO.File]::WriteAllText`) to avoid VS Code editor buffer conflicts
- After writing, the file size MUST be verified (non-zero)
- The report MUST be opened in Markdown Preview (`markdown.showPreview`), NOT in the editor
- The editor MUST NOT open the file directly (triggers notebook mode and creates `codebook-md/` folder)
- The report MUST be opened in a browser or VS Code Simple Browser (`simpleBrowser.show`), NOT in the editor
- The editor MUST NOT open the file directly (shows raw HTML)

Post-generation chat message:
```
📄 Full report saved:
PluginQualityAdvisor/Reports/plugin/{PluginName}_{YYYY-MM-DD}.md
PluginQualityAdvisor/Reports/plugin/{PluginName}_{YYYY-MM-DD}.html
{N} issue(s) - {violations} violations, {warnings} warnings, {suggestions} suggestions
```

### REQ-R8 — Empty report (all PASS)

If no issues were found, generate:

```markdown
# Thunder Plugin Review - {PluginName}
```html
<!-- Thunder Plugin Review - {PluginName} -->

**Date:** {YYYY-MM-DD}
**Plugin:** {PluginName}
Expand All @@ -106,18 +105,18 @@ If no issues were found, generate:
ThunderTools/PluginQualityAdvisor/
└── Reports/
├── plugin/
│ ├── Dictionary_2026-07-16.md
│ └── NetworkControl_2026-07-16.md
│ ├── Dictionary_2026-07-16.html
│ └── NetworkControl_2026-07-16.html
└── interface/
├── INetworkControl_2026-07-16.md
└── IDictionary_2026-07-16.md
├── INetworkControl_2026-07-16.html
└── IDictionary_2026-07-16.html
```

---

## Out of Scope

- CSV or Excel format (replaced by Markdown reports)
- CSV or Excel format
- Report viewer command (Markdown Preview is sufficient)
- Diff between two reports (future)
- Automatic email or CI upload (future)
16 changes: 8 additions & 8 deletions .github/openspec/changes/thunder-plugin-qa/tasks.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Tasks: Thunder Plugin QA System
# Tasks: Thunder Plugin QA System

## Phase 1: YAML rule definitions

Expand Down Expand Up @@ -255,7 +255,7 @@
- Your Task: 5 steps (identify file → load YAML → validate all 19 rules →
report with Issue Summary table (❌/⚠️/💡) → provide specific fixes)
- Step 4 — Validate Findings: eliminate false positives before reporting
- Step 6 Generate Markdown Report: file path format, Issue Summary table with
- Step 6 - Generate HTML Report: file path format, Issue Summary table with
clickable navigation, Detailed Findings sections, write via terminal, open in preview
- Post-generation action: write via terminal, verify non-empty, open in Markdown Preview
- Contextual Judgment: JUDGE step table with Status field mapping
Expand Down Expand Up @@ -413,9 +413,9 @@

## Phase 5: Report generation

- [x] 5.1 Add Step 6 (Markdown report) to `ThunderTools/PluginQualityAdvisor/Prompts/thunder-plugin-review.prompt.md`
- [x] 5.1 Add Step 6 (HTML report) to `ThunderTools/PluginQualityAdvisor/Prompts/thunder-plugin-review.prompt.md`
- Appended after Command Examples section
- File path: `ThunderTools/PluginQualityAdvisor/Reports/plugin/{PluginName}_{YYYY-MM-DD}.md`
- File path: `ThunderTools/PluginQualityAdvisor/Reports/plugin/{PluginName}_{YYYY-MM-DD}.html`
- Create folder if absent; never overwrite (append _2, _3 suffix)
- Report structure: header with totals, Issue Summary table, Detailed Findings sections
- Issue Summary table: Issue No. | Status | Rule (clickable link) | File | Line | Issue
Expand All @@ -425,14 +425,14 @@
- Verify non-empty after writing; open in Markdown Preview (not editor)
- Empty report (all pass): header + "✅ All rules passed"

- [x] 5.2 Add Step 6 (Markdown report) to `ThunderTools/PluginQualityAdvisor/Prompts/thunder-interface-review.prompt.md`
- [x] 5.2 Add Step 6 (HTML report) to `ThunderTools/PluginQualityAdvisor/Prompts/thunder-interface-review.prompt.md`
- Same format as plugin report
- File path: `ThunderTools/PluginQualityAdvisor/Reports/interface/{InterfaceName}_{YYYY-MM-DD}.md`
- File path: `ThunderTools/PluginQualityAdvisor/Reports/interface/{InterfaceName}_{YYYY-MM-DD}.html`
- Same no-overwrite rule, same report structure, same post-generation actions

- [x] 5.3 Create spec `ThunderTools/openspec/changes/thunder-plugin-qa/specs/reports/spec.md`
- REQ-R1: plugin Markdown report path + no-overwrite rule
- REQ-R2: interface Markdown report path + no-overwrite rule
- REQ-R1: plugin HTML report path + no-overwrite rule
- REQ-R2: interface HTML report path + no-overwrite rule
- REQ-R3: report header format with totals
- REQ-R4: Issue Summary table with clickable navigation
- REQ-R5: Detailed Findings sections format
Expand Down
63 changes: 48 additions & 15 deletions PluginQualityAdvisor/Prompts/thunder-interface-review.prompt.md
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ In chat, provide a **concise summary table** of all issues found. Do NOT output
| 1 | ❌ VIOLATION | core_10_1 - @json Tag | IHdmiCecSink.h | 45 | @json tag missing — ZERO JSON-RPC code generated |
| 2 | ⚠️ WARNING | core_13_1 - Explicit Integer Widths | IHdmiCecSink.h | 72 | int parameter — use uint32_t |

📄 Full report: `PluginQualityAdvisor/Reports/interface/IHdmiCecSink_2026-07-16.md`
📄 Full report: `PluginQualityAdvisor/Reports/interface/IHdmiCecSink_2026-07-16.html`
```

### Status Symbols
Expand All @@ -118,17 +118,17 @@ In chat, provide a **concise summary table** of all issues found. Do NOT output

End chat output with:
```
📄 Full report saved: PluginQualityAdvisor/Reports/interface/{InterfaceName}_{YYYY-MM-DD}.md
📄 Full report saved: PluginQualityAdvisor/Reports/interface/{InterfaceName}_{YYYY-MM-DD}.html
{N} issue(s) - {violations} violations, {warnings} warnings, {suggestions} suggestions
```

---

## Step 6 - Generate Markdown Report
## Step 6 - Generate HTML Report

After reporting results in chat, generate a Markdown report file with clickable navigation.
After reporting results in chat, generate an HTML report file with clickable navigation and syntax-highlighted code blocks.

**File path:** `PluginQualityAdvisor/Reports/interface/{InterfaceName}_{YYYY-MM-DD}.md`
**File path:** `PluginQualityAdvisor/Reports/interface/{InterfaceName}_{YYYY-MM-DD}.html`

- Create `PluginQualityAdvisor/Reports/interface/` if it does not exist
- Never overwrite an existing file - append `_2`, `_3` etc. if needed
Expand All @@ -138,6 +138,38 @@ Run the following command in the interface file's git root to get the repo URL:
- Repo URL: `git remote get-url origin`
If git is unavailable, use `unknown`.

**HTML shell (wrap the entire report content in this):**

```html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Thunder Interface Review - {InterfaceName}</title>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/styles/github.min.css">
<script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/highlight.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/languages/cmake.min.js"></script>
<script>hljs.highlightAll();</script>
<style>
body { font-family: sans-serif; max-width: 1100px; margin: 40px auto; padding: 0 20px; color: #24292f; line-height: 1.6; }
h1 { border-bottom: 2px solid #d0d7de; padding-bottom: 10px; }
h2 { border-bottom: 1px solid #d0d7de; padding-bottom: 6px; margin-top: 40px; }
h3 { margin-top: 30px; }
table { border-collapse: collapse; width: 100%; margin: 16px 0; }
th, td { border: 1px solid #d0d7de; padding: 8px 12px; text-align: left; }
th { background: #f6f8fa; font-weight: 600; }
tr:nth-child(even) { background: #f6f8fa; }
pre { background: #f6f8fa; border: 1px solid #d0d7de; border-radius: 6px; padding: 16px; overflow-x: auto; }
code { font-family: monospace; font-size: 13px; }
.back-link { font-size: 13px; color: #0969da; }
</style>
</head>
<body>
<!-- report content here -->
</body>
</html>
```

### Report Template

```markdown
Expand Down Expand Up @@ -210,10 +242,11 @@ virtual Core::hresult SetVolume(const uint32_t volume) = 0;

### Report Generation Rules

- Each issue in the summary table links to its detailed section via the Rule column using `[rule_id - Name](#issue-N)` anchors
- Each detailed section heading uses `### Issue N` (creates the `#issue-n` anchor automatically)
- Each detailed section must end with a back-link to the summary table: `[\u2B06 Back to Issue Summary](#issue-summary)` — this allows readers to click back to the table after reading a finding
- The rule ID and name appear as bold text on the first line under the heading
- Render the report as a complete, self-contained HTML file using the HTML shell above
- Use `<h1>` for the report title, `<h2>` for section headings, `<h3 id="issue-N">` for issue headings
- The issue summary is an HTML `<table>` — each rule name in the Rule column is an `<a href="#issue-N">` link
- Each detailed section must end with: `<p class="back-link"><a href="#issue-summary">⬆ Back to Issue Summary</a></p>`
- All code blocks use `<pre><code class="language-cpp">` (or `language-cmake` as appropriate) — highlight.js will syntax-highlight them automatically
- **"What's wrong"** must be a plain-English explanation a junior developer can understand
- **"Code found"** must show the actual code from the interface with file:line comment
- **"Fix"** must show the corrected code
Expand All @@ -238,7 +271,7 @@ virtual Core::hresult SetVolume(const uint32_t volume) = 0;
**Post-generation message in chat:**
```
📄 Full report saved:
PluginQualityAdvisor/Reports/interface/{InterfaceName}_{YYYY-MM-DD}.md
PluginQualityAdvisor/Reports/interface/{InterfaceName}_{YYYY-MM-DD}.html
{N} issue(s) - {violations} violations, {warnings} warnings, {suggestions} suggestions
```

Expand All @@ -249,20 +282,20 @@ virtual Core::hresult SetVolume(const uint32_t volume) = 0;
1. **Write the file using terminal** — do NOT use create_file or file editing tools for the report. Use:

```powershell
[System.IO.File]::WriteAllText("<full-path-to-report>.md", $content, [System.Text.UTF8Encoding]::new($false))
[System.IO.File]::WriteAllText("<full-path-to-report>.html", $content, [System.Text.UTF8Encoding]::new($false))
```

2. **Verify the file is not empty** — after writing, check the file size:

```powershell
(Get-Item "<full-path-to-report>.md").Length
(Get-Item "<full-path-to-report>.html").Length
```

If the size is 0, the write failed — retry once.

3. **Open in Markdown Preview** — run VS Code command `markdown.showPreview` on the generated report file so anchor links work.
3. **Open in browser** — run VS Code command `simpleBrowser.show` with the file URI, or open the `.html` file in a browser. highlight.js renders syntax highlighting and anchor links work natively.

4. **Do NOT open the report in the editor** — opening `.md` files in the editor triggers notebook mode which creates an unwanted `codebook-md/` folder. Always use preview-only.
4. **Do NOT open the report in the VS Code editor** — the editor shows raw HTML. Always open in browser or Simple Browser preview.

---

Expand Down Expand Up @@ -295,4 +328,4 @@ Severity is **never escalated** above the YAML-defined level.
- Thunder documentation: https://rdkcentral.github.io/Thunder/
- Validation priorities: @json tag first → Core::hresult returns → @restrict on vectors → type conventions → binary compatibility → advisory rules
- Load the YAML before every validation run - rules may have been updated since this prompt was created
- Interface headers may be anywhere in the workspace — search for the filename if not found in the common `interfaces/` folder
- Interface headers may be anywhere in the workspace — search for the filename if not found in the common `interfaces/` folder
Loading
Loading