← Back to Pull requests

fix(skills): key skill_manage telemetry by the canonical name #136136

Open
unknown opened this pull request with 524 lines diff across 6 files
View on GitHub
unknown unknown commented on Oct 10, 2026 13:27 UTC
Author

What does this PR do?

skill_manage telemetry keyed .usage.json by the name exactly as passed, while skill_view keys by the canonical frontmatter name:. A skill in a category subdirectory addressed as category/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_report read the canonical key only), so usage and provenance stop reconciling.

This PR makes _record_success key all telemetry (record_created / bump_patch / forget) on the canonical frontmatter name, resolved with the existing _read_frontmatter_name helper:

  • write actions (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 next skill_view bump will use;

  • delete resolves 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 fixes forget missing 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

  • 🐛 Bug fix (non-breaking change that fixes an issue)
  • Changes Made

  • tools/skill_manager_tool.py — skill_manage captures the canonical frontmatter name during the existing ledger pre-capture and passes it to _record_success; _record_success keys record_created/bump_patch/forget on 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.md with frontmatter name: homelab-kb.
    2. skill_manage(action="patch", name="homelab/homelab-kb", old_string=..., new_string=...).
    3. Observed result on main: .usage.json gains a "homelab/homelab-kb" key alongside "homelab-kb". With this PR: only "homelab-kb" is present, with patch_count incremented 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 clean upstream/main checkout (3 pre-existing inter-test flakes in test_skill_bundle_provenance.py reproduce identically on the clean base).

    Checklist

    Code

  • I've read the Contributing Guide

  • My commit messages follow Conventional Commits (fix(scope):, feat(scope):, etc.)

  • I searched for existing PRs to make sure this isn't a duplicate

  • My PR contains only changes related to this fix/feature (no unrelated commits)

  • I've run pytest tests/ -q and all tests pass

  • python scripts/check passes (the blocking lint and code-health checks CI runs)

  • I've added tests for my changes (required for bug fixes, strongly encouraged for features)

  • I've tested on my platform: macOS 15 (arm64)
  • Documentation & Housekeeping

  • I've updated relevant documentation (README, docs/, docstrings) — or N/A

  • I've updated cli-config.yaml.example if I added/changed config keys — or N/A

  • I've updated CONTRIBUTING.md or AGENTS.md if I changed architecture or workflows — or N/A

  • I've considered cross-platform impact (Windows, macOS) per the compatibility guide — or N/A (pure-Python path handling, no platform-specific behavior touched)

  • I've updated tool descriptions/schemas if I changed tool behavior — or N/A
  • Diff: 524 lines (+393 / -131) across 6 files Reviewer: PRATHAMESH75 Review duration: 78429m
    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
    0.55
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.02 · 1 substantive comment(s)
    0.02
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 35%
    44%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    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
    Reviewers
    Assignees
    Unassigned
    Labels
    risk: low confidence: 44.7% reviewed
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 54.8% (MEDIUM) · Higher = larger blast radius
    54.8%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 44.7% · Lower = rushed or shallow review
    44.7%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 30.3% · Safe to merge
    30.3%