fix(skills): key skill_manage telemetry by the canonical name #136136
All Vouch review confidence checks passed
Residual risk 0.30 = Change Risk (0.55) × (1 − Review Confidence (0.45)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.55 · 524 lines diff across 6 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.02 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.375
Shallow Review Depth
shallow_review_depth
0.344
Real PR Conversation Timeline
1 comments
"Review active on #136136"
general
weight: 0.35
PRATHAMESH75
What does this PR do?
skill_managetelemetry keyed.usage.jsonby the name exactly as passed, whileskill_viewkeys by the canonical frontmattername:. A skill in a category subdirectory addressed ascategory/slug(the form the skills prompt advertises, and the form the curator's consolidation pass uses) therefore split into two sidecar records: one canonical, one path-qualified. The qualified duplicate is invisible to the curator's own management logic (is_curator_managed/curated_reportread the canonical key only), so usage and provenance stop reconciling.This PR makes
_record_successkey all telemetry (record_created/bump_patch/forget) on the canonical frontmatter name, resolved with the existing_read_frontmatter_namehelper:create/patch/edit/write_file/remove_file) resolve from the post-mutation copy — a patch may rename the skill, and the post-patch name is the one the nextskill_viewbump will use;deleteresolves from a pre-mutation capture taken in the existing ledger pre-capture block, because the SKILL.md is already gone by the time telemetry runs. This also fixesforgetmissing the canonical record on a qualified delete, which used to orphan it.Everything stays best-effort: resolution failure falls back to the name as passed, i.e. today's behavior.
Related Issue
Fixes #136130
Type of Change
Changes Made
tools/skill_manager_tool.py—skill_managecaptures the canonical frontmatter name during the existing ledger pre-capture and passes it to_record_success;_record_successkeysrecord_created/bump_patch/forgeton the canonical name (post-mutation resolution for writers, pre-mutation capture for delete).tests/tools/test_skill_manage_usage_keying.py— new: qualified-name patch/write_file bump only the canonical record; qualified-name delete forgets the canonical record; a skill whose directory equals its frontmatter name keeps a single unchanged key.How to Test
1. Seed a category-nested skill:
~/.hermes/skills/homelab/homelab-kb/SKILL.mdwith frontmattername: homelab-kb.2.
skill_manage(action="patch", name="homelab/homelab-kb", old_string=..., new_string=...).3. Observed result on
main:.usage.jsongains a"homelab/homelab-kb"key alongside"homelab-kb". With this PR: only"homelab-kb"is present, withpatch_countincremented there.4.
pytest tests/tools/test_skill_manage_usage_keying.py -q— 4 passed.5.
pytest tests/tools/ -k skill -q(hub suite aside) — no new failures vs. a cleanupstream/maincheckout (3 pre-existing inter-test flakes intest_skill_bundle_provenance.pyreproduce identically on the clean base).Checklist
Code
fix(scope):,feat(scope):, etc.)pytest tests/ -qand all tests passpython scripts/checkpasses (the blocking lint and code-health checks CI runs)Documentation & Housekeeping
docs/, docstrings) — or N/Acli-config.yaml.exampleif I added/changed config keys — or N/ACONTRIBUTING.mdorAGENTS.mdif I changed architecture or workflows — or N/A