Added Plugin and Interface rules for Thunder QA#286
Added Plugin and Interface rules for Thunder QA#286workkavint-ship-it wants to merge 17 commits into
Conversation
There was a problem hiding this comment.
Pull request overview
This PR introduces an OpenSpec change bundle for a proposed “Thunder PluginQA” system, adding specification and planning documents for plugin/interface rule validation and CSV report generation.
Changes:
- Added OpenSpec configuration plus a new change package (
openspec/changes/thunder-plugin-qa/) containing proposal, design, tasks, and specs. - Added detailed rule reference documents for Thunder plugin rules (v3.3.0) and Thunder interface validation rules.
- Added a report-generation spec describing CSV output formats for plugin and interface validation runs.
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 16 comments.
Show a summary per file
| File | Description |
|---|---|
| openspec/config.yaml | Adds baseline OpenSpec configuration stub (schema + optional context/rules sections). |
| openspec/changes/thunder-plugin-qa/tasks.md | Adds a comprehensive implementation task breakdown for the PluginQA system. |
| openspec/changes/thunder-plugin-qa/specs/reports/spec.md | Defines CSV report requirements/formatting for plugin & interface review outputs. |
| openspec/changes/thunder-plugin-qa/specs/plugin/Thunder-plugin-rules.md | Adds the plugin rules reference document (v3.3.0) with 79 rules and examples. |
| openspec/changes/thunder-plugin-qa/specs/plugin/spec.md | Adds the plugin validation delta/spec (folder structure, setup script behavior, rule loading). |
| openspec/changes/thunder-plugin-qa/specs/interface/Thunder-interface-rules.md | Adds the interface validation rules reference document (core + advisory rules). |
| openspec/changes/thunder-plugin-qa/specs/interface/spec.md | Adds the interface validation + plugin generation delta/spec (commands, setup, rule updates). |
| openspec/changes/thunder-plugin-qa/proposal.md | Adds the PluginQA proposal and delivery structure overview. |
| openspec/changes/thunder-plugin-qa/design.md | Adds the architecture/design document describing prompts, rule loading, reporting, and setup. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
fee8994
|
b'## Copyright scan failure |
| title: "Thunder Interface Validation Rules" | ||
| description: | | ||
| Rules for validating Thunder COM interface headers in ThunderInterfaces/interfaces/. |
| }; | ||
|
|
||
| // Correct: pure declarations only | ||
| struct EXTERNAL IDictionary : virtual public Core::/t { |
| class IDictionary : public Core::IUnknown { | ||
| enum { ID = 0x100 }; // ← raw value, not RPC::ID_* | ||
| virtual void Get(const string& key) { } // ← not pure virtual | ||
|
|
| @@ -0,0 +1,199 @@ | |||
| ## Purpose | |||
| This prompt manages rules in `ThunderTools/PluginQualityAdvisor/rules/thunder-interface-rules.yaml` and keeps all related files in sync atomically: | ||
|
|
||
| 1. `ThunderTools/PluginQualityAdvisor/rules/thunder-interface-rules.yaml` — rule data | ||
| 2. `ThunderTools/PluginQualityAdvisor/Prompts/thunder-interface-review.prompt.md` — Quick Reference table + rule detail blocks | ||
| 3. `ThunderTools/.github/openspec/changes/thunder-plugin-qa/specs/interface/spec.md` — spec requirements |
| ### Requirement: Setup script modifies VS Code settings.json to register prompt location | ||
| The `setup-prompts.py` script MUST modify the user-level VS Code `settings.json` to add `"ThunderTools/PluginQualityAdvisor/Prompts": true` under `chat.promptFilesLocations`. |
| 1. Verify the primary interface struct name matches the file name (e.g. IDictionary in IDictionary.h) | ||
| - Exception: multi-interface files or platform-specific groupings may have different naming | ||
| 2. Verify there is no implementation code — only forward declarations, typedefs, struct/enum declarations | ||
| 3. If issues are found → WARNING |
|
b'## Copyright scan failure |
| def read_settings(settings_path): | ||
| """Read and parse settings.json, returning {} if missing or empty.""" | ||
| if not os.path.isfile(settings_path): | ||
| return {} | ||
| with open(settings_path, "r", encoding="utf-8") as f: | ||
| content = f.read().strip() | ||
| if not content: | ||
| return {} | ||
| try: | ||
| return json.loads(content) | ||
| except (json.JSONDecodeError, ValueError): | ||
| print("WARNING: Could not parse settings.json as JSON. Starting with empty settings.") | ||
| return {} |
| Use this table to pick the right template. Both follow the same semantic-review methodology. | ||
|
|
||
| | Question | Template A | Template B | | ||
| |---|---|---| | ||
|
|
|
|
||
| --- | ||
|
|
||
| ### `### Description` *(required for Add; optional for Update)* |
|
|
||
| --- | ||
|
|
||
| ### `### How to Find It (Extraction Logic)` *(required for Add; optional for Update)* |
|
|
||
| --- | ||
|
|
||
| ### `### How to Verify It (Verification Logic)` *(required for Add; optional for Update)* |
| PluginQualityAdvisor/Reports/plugin/{PluginName}_{YYYY-MM-DD}.csv | ||
| {N} issue(s) logged - {violations} violations, {warnings} warnings, {suggestions} suggestions | ||
|
|
||
| To open in Excel (Windows): | ||
| Start-Process "PluginQualityAdvisor\Reports\plugin\{PluginName}_{YYYY-MM-DD}.csv" |
| **File path:** `PluginQualityAdvisor/Reports/interface/{InterfaceName}_{YYYY-MM-DD}.csv` | ||
|
|
||
| - Create `PluginQualityAdvisor/Reports/interface/` if it does not exist | ||
| - Never overwrite an existing file - append `_2`, `_3` etc. if needed |
| ,,,,,,,,,,All rules passed - no issues found,, | ||
| ``` |
| PluginQualityAdvisor/Reports/interface/{InterfaceName}_{YYYY-MM-DD}.csv | ||
| {N} issue(s) logged - {violations} violations, {warnings} warnings, {suggestions} suggestions | ||
|
|
||
| To open in Excel (Windows): | ||
| Start-Process "PluginQualityAdvisor\Reports\interface\{InterfaceName}_{YYYY-MM-DD}.csv" |
| # Proposal: Thunder PluginQualityAdvisor System | ||
|
|
||
| ## Intent | ||
|
|
||
| Thunder plugin development lacks automated validation. Developers ship plugins |
All changes requested by Marcel are addressed in subsequent changesets.
|
b'## Copyright scan failure |
|
b'## Copyright scan failure |
| try: | ||
| return json.loads(content) | ||
| except (json.JSONDecodeError, ValueError): | ||
| print("WARNING: Could not parse settings.json as JSON. Starting with empty settings.") | ||
| return {} |
| No,Plugin,Date,Phase,Rule_ID,Rule_Name,Status,Severity,File,Line,Citation,Issue_Description,Fix_Summary,Reasoning | ||
| ,,,,,,,,,,,,All checkpoints passed - no issues found, |
| @@ -0,0 +1,658 @@ | |||
| version: 3.2.2 | |||
| 2. Verify inheritance is 'virtual public Core::IUnknown' | ||
| 3. Verify a nested enum contains ID = RPC::ID_* | ||
| 4. Verify all methods are pure virtual (= 0) | ||
| 5. If any fails → VIOLATION |
| 2. No method may have a body (even {}) | ||
| 3. No static methods allowed in interfaces | ||
| 4. No non-virtual methods (constructors, operators excepted) | ||
| 5. If any violation → VIOLATION |
| 1. If the interface is intended to generate JSON-RPC code: verify // @json N.N.N appears immediately above the struct declaration | ||
| 2. No blank lines between the @json tag and the struct line | ||
| 3. If the interface is intentionally JSON-RPC-free (pure COM) → acceptable, note as design choice | ||
| 4. If @json is missing from an interface that should have it → VIOLATION |
| **Verification Logic:** | ||
|
|
||
| 1. Reason about the interface's overall purpose from its name and method set | ||
| 2. If methods clearly belong to two or more distinct responsibilities → VIOLATION |
| ### Fix | ||
| // WRONG: | ||
|
|
||
| // CORRECT: | ||
|
|
| - **Yes/No Question** - single binary question; Yes = PASS, No = VIOLATION | ||
| - **Verification Steps** - 3-8 numbered steps using semantic reasoning (never regex) | ||
| - **Violation Pattern** - one-line citation summary, under 10 words | ||
| - **Fix** - `// WRONG:` and `// CORRECT:` code snippets |
| | Question | Template A | Template B | | ||
| |---|---|---| | ||
|
|
|
b'## Copyright scan failure |
PR Summary
This PR adds the rule reference documents that will be used as the basis for the automated Thunder QA checks:
If you think a rule should be added, removed, reworded, or have its severity changed, please edit the relevant .md file and push to this branch.