Repository navigation
fix(harness): check the plugin folder when harness-check is given its manifest - #888
chrisknvidia wants to merge 6 commits into
Conversation
… manifest harness-check now treats a plugin's manifest file or manifest folder, such as .claude-plugin/plugin.json or .github/plugin/, as the plugin folder it belongs to, so the panel and the --json keys match a run on the plugin folder itself. The plugin entry is no longer passed to the Tier 1 schema check, which printed a false "No skills found" line for it. A folder that cannot be examined no longer stops the check. Signed-off-by: Christopher Kevin <christopherk@nvidia.com>
Signed-off-by: Christopher Kevin <christopherk@nvidia.com>
Signed-off-by: Christopher Kevin <christopherk@nvidia.com>
Signed-off-by: Christopher Kevin <christopherk@nvidia.com>
Resolve the CHANGELOG conflict: main released 1.2.1 and gained its own Unreleased > Fixed section, so this change's entry is appended there. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Signed-off-by: Narendran Raghavan <nraghavan@nvidia.com>
rng1995
left a comment
There was a problem hiding this comment.
[SkillEvaluator Review]
Thanks @chrisknvidia for this contribution.
Value and readiness: Delivers what it claims: harness-check now treats a manifest file or manifest folder (for example .claude-plugin/plugin.json) as the plugin folder it belongs to, keys the --json plugin entry by that folder, and no longer prints the false 'Tier 1 schema also fails ... No skills found' line. 21 of the 53 tests in tests/harness/test_plugin_compat.py fail against main's source (the PR text says 17) and all pass on this head. Ready for the maintainers and PIC after the P3s, a merge-order decision with #889, #890 and #891, and CI finishing (Tests 3.14 was still running; 3.12 and 3.13 passed).
Prior findings: 4 of 4 earlier threads (Devin) are fixed and already resolved.
Material findings: 3 inline: P3 src/skillevaluator/cli.py:3452 Plugin entry skipped by recomputing its key; can differ from run_harness_check's key (symlinked manifest folder gives the false schema line again); P3 CHANGELOG.md:40 CHANGELOG omits the no-permission-folder fix; P3 docs/harness-check.mdx:202 JSON output docs do not describe the plugin entry whose key changes.
PIC tradeoffs: Merge order across #888-#891: all four conflict textually in CHANGELOG.md, plugin.py and the test file; #888 and #889 each add an identical _is_file helper and all four add an identical _empty_home fixture, so the second to land should keep one copy. #889's new .exists() probes are unguarded, so whichever lands second must adopt this PR's guarded helpers or the crash this PR fixes returns (reproduced on #889's head).
Verification and gaps: Ran 20+ harness-check invocations (folder, manifest file, manifest folder, relative paths, other working directories, symlinks, unreadable subfolders); each matched the plugin-folder run. 228 tests across tests/harness, tests/cli/test_public_plugin_static.py and the cli_surface golden tests pass in a scrubbed environment; ruff is clean and DCO is green. CI is pending with no red job. I merged main into the branch to clear a CHANGELOG conflict (entry moved to Unreleased > Fixed).
Reviewed head: 2f9d73626a402efef5ff78f1d0b583c9283e3df4
| raise click.ClickException(f"No skills found in {target_path.resolve()}") | ||
| from skillevaluator.validators.schema import SchemaValidator | ||
|
|
||
| plugin_entry = plugin_key(target) |
There was a problem hiding this comment.
[P3] The plugin entry is skipped by recomputing its key, which can differ from the key run_harness_check used
harness_check builds plugin_entry = plugin_key(target) from its own plugin_root_for(target_path, resolve_path=True), but run_harness_check then normalises that path a second time (plugin_root_for(target), harness/report.py:260) and keys the plugin rows by the second result. The two agree in every case the tests cover, not for a symlinked manifest folder reached through its manifest file.
Repro on this head: mkdir -p real/.claude-plugin real/skills/demo, add a valid real/.claude-plugin/plugin.json and a clean real/skills/demo/SKILL.md, ln -s real/.claude-plugin link, then skillevaluator harness-check link/plugin.json --harness claude-code prints Tier 1 schema also fails for real (plugin): [SCHEMA-HIGH] No skills found in target directory ..., the line this PR removes. The first pass returns <abs>/real/.claude-plugin (root-manifest branch, folder.resolve()), the second maps it to <abs>/real, so the block key is <abs>/real (plugin) while the skipped key is <abs>/real/.claude-plugin (plugin). Checking link or real directly is fine.
The plugin entry is a label, not a folder, so the loop can skip by that fact instead of by string equality (then plugin_key is no longer imported here). I ran this change on a copy: the repro no longer prints the line and all 53 tests in tests/harness/test_plugin_compat.py pass, including the demo (plugin) skill-folder test, because that folder exists:
for skill in block:
if not Path(skill).is_dir(): # the plugin entry is a label, not a folder
continue| example `.claude-plugin/plugin.json`) as the plugin folder it belongs to. In | ||
| `--json` output the plugin entry for such a target is now keyed by the plugin | ||
| folder. A plugin run no longer prints a false "Tier 1 schema also fails ... | ||
| No skills found" line for the plugin entry. |
There was a problem hiding this comment.
[P3] CHANGELOG leaves out the no-permission fix
The PR description lists three user-visible fixes. The entry under ## Unreleased > ### Fixed covers the manifest target and the false schema line but not the third: a plugin with a subfolder that cannot be examined (for example a .github folder without permission) stopped harness-check with a PermissionError on Python 3.12 (on main, harness-check <plugin> with <plugin>/.github at mode 0 fails inside is_plugin_root; test_folder_that_cannot_be_examined_does_not_stop_the_check[.] fails on main source and passes here). Add one sentence, for example: "A plugin folder with a subfolder that cannot be read no longer stops the check."
| folder, a folder of skills, or a plugin folder. A plugin's manifest file or | ||
| manifest folder, such as `.claude-plugin/plugin.json`, is checked as the | ||
| plugin folder it belongs to. Use the plugin folder with SkillEvaluator | ||
| 1.2.1 or earlier. Its findings never change the exit code. |
There was a problem hiding this comment.
[P3] The --json plugin entry, whose key this PR changes, is not described in the docs
The CHANGELOG announces that the plugin entry for a manifest target is now keyed by the plugin folder, but the ## JSON output section of this page (line 341: "one entry per skill and harness", example with skill keys only) never mentions the <plugin folder> (plugin) entry that harness-check writes for a plugin, so the keying contract has no home in the docs. A script that reads the block cannot learn from the docs that the key is the plugin folder whatever you pass (plugin folder, manifest file or manifest folder), nor that the member skills are now listed for a manifest target.
Add a sentence to that section, for example: "For a plugin, the block also has an entry keyed <plugin folder> (plugin) for the plugin panel. The key is the plugin folder, however you named it: the folder, its manifest file or its manifest folder."
Signed-off-by: Christopher Kevin <christopherk@nvidia.com>
harness-checkgave a different answer for the same plugin depending on how you pointed at it. Given the manifest file (for example.claude-plugin/plugin.json) or the manifest folder, it checked the manifest folder as if it were a plugin of its own, so the plugin panel, the skills and the--jsonkeys did not match a run on the plugin folder. A plugin run also printed a false "Tier 1 schema also fails ... No skills found" line, because the plugin's own entry was handed to the schema check as if it were a skill folder. And a folder inside the plugin that could not be examined (no permission) stopped the check with an error.Now a plugin's manifest file or manifest folder is checked as the plugin folder it belongs to, and the
plugin.jsoninside a manifest folder no longer makes that folder count as a plugin. The plugin entry is skipped when the schema hint is printed, while member skills keep their hint. Paths that cannot be examined are read as absent. In--jsonoutput the plugin entry for a manifest target is now keyed by the plugin folder. Docs and changelog are updated.Validation:
python -m pytest tests/harness -p no:cacheprovider -q: 180 passedruff checkandruff format --checkon the touched Python files: cleanpluginor living under.github, relative paths, the schema hint for the plugin entry and for member skills, and a plugin folder with an unreadable subfolderThis is one of four independent pull requests that together fix wrong answers in the plugin panel of
harness-check. The others are #889 (broken manifests and the default layout), #890 (flat.mcp.jsonand the "adds nothing" note), #891 (untested component kinds). Each stands on its own and they can land in any order. They touch the same files, so after one lands the others need a rebase.