Skip to content

Add plugins key to lock file schema - #6303

Merged
samuv merged 1 commit into
mainfrom
plugins-lock/01-schema
Aug 13, 2026
Merged

Add plugins key to lock file schema#6303
samuv merged 1 commit into
mainfrom
plugins-lock/01-schema

Conversation

@samuv

@samuv samuv commented Aug 13, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Why: RFC THV-0080 reserved a sibling plugins: key on toolhive.lock.yaml but only owns version and skills:. Track: AI-plugin lock file + Sigstore signing #6300 ratifies that contract so project-scoped AI-plugin installs can be pinned in the same version-1 lock file as skills, without bumping the schema (a v2 bump would hard-fail mixed-version teams) and without mixing the two graphs.
  • What: Types Lockfile.Plugins []Entry, adds GetPlugin / UpsertPlugin / RemovePlugin (and file-locked UpsertPluginEntry / RemovePluginEntry), and validates plugins: as its own name/requiredBy graph. A skill and a plugin may share a name. Unknown top-level fields still round-trip via Extra; a handwritten plugins: key graduates out of Extra into the typed field.

Part of #6300 (AI-plugin lock + Sigstore). Stack 1/5 — schema → lock-service → install-hooks → sync → upgrade. This PR has no consuming callers; wiring into pluginsvc.Install lands in PR3.

Type of change

  • New feature

Test plan

  • Unit tests (task test./pkg/skills/lockfile with race detector; full task test also ran, with pre-existing failures on main in pluginsvc SSRF/git-ref tests and a streamable-proxy port clash, none in this package)
  • Linting (task lint-fix)

Table-driven tests cover plugin round-trip load/save, shared names across keys, independent requiredBy graphs, Extra round-trip of unknown top-level fields, and plugins: graduating from the inline Extra map.

Does this introduce a user-facing change?

No — this schema has no callers yet. Plugin lock recording stays behind TOOLHIVE_PLUGINS_LOCK_ENABLED in later PRs of the stack.

Implementation plan

Approved implementation plan (PR1 slice)

Same toolhive.lock.yaml, additive plugins: key, schema version stays 1. Reuse lockfile.Entry (including provenance/unsigned). Validate skills and plugins as separate graphs. Keep the package at pkg/skills/lockfile; do not extract. No feature-gate or install hooks in this PR.

Special notes for reviewers

  • Get / Upsert / Remove remain skills-only; the plugin variants are explicitly named so a later caller cannot accidentally pin a plugin into skills:.
  • requiredBy on plugin entries is validated but unused in v1 — plugin requires are not materialized yet (Track: AI-plugin lock file + Sigstore signing #6300 follow-up).
  • The whole plugin lock feature stays inert until Stack 2 PR10 removes TOOLHIVE_PLUGINS_LOCK_ENABLED.

Ratify the THV-0080 sibling plugins: key so project-scoped
AI-plugin pins can live in the same version-1 lock file as
skills, without stripping unknown fields or mixing graphs.

Co-authored-by: Cursor <cursoragent@cursor.com>
@samuv
samuv requested a review from JAORMX as a code owner August 13, 2026 11:05
@github-actions github-actions Bot added the size/M Medium PR: 300-599 lines changed label Aug 13, 2026
@codecov

codecov Bot commented Aug 13, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 72.88%. Comparing base (7854115) to head (c2af3e0).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #6303      +/-   ##
==========================================
+ Coverage   72.82%   72.88%   +0.05%     
==========================================
  Files         742      742              
  Lines       77762    77792      +30     
==========================================
+ Hits        56632    56696      +64     
+ Misses      17155    17104      -51     
- Partials     3975     3992      +17     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@github-actions github-actions Bot added size/M Medium PR: 300-599 lines changed and removed size/M Medium PR: 300-599 lines changed labels Aug 13, 2026
@samuv samuv self-assigned this Aug 13, 2026
@samuv
samuv merged commit 0302206 into main Aug 13, 2026
49 checks passed
@samuv
samuv deleted the plugins-lock/01-schema branch August 13, 2026 13:58
@github-actions github-actions Bot mentioned this pull request Aug 14, 2026
2 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/M Medium PR: 300-599 lines changed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants