Repository navigation
Description
User Story
As a team maintaining a project that consumes agent skills,
I want project-scope skill installs pinned in a committed lock file, cryptographically verified against the publisher's Sigstore identity, and safely upgradable,
So that every teammate and CI run restores the exact same reviewed skills, and tampered or re-signed artifacts are detected before they reach a developer's machine.
Context
RFC THV-0080 (stacklok/rfcs#80) proposes a project-level skills lock file. PR #5715 implements a feasibility POC covering the full vertical slice:
- Lock file —
toolhive.lock.yamlpinssource,resolvedReference,digest, and an on-diskcontentDigest, withthv skill sync(--check/--adopt/--prune) andthv skill upgrade(--preview/--allow-ref-change) - Sigstore v1 trust — verify on consume (install/sync/upgrade), sign on push (
--key,--no-sign), TOFU publisher identity pinned asprovenancein the lock (or an explicitunsigned: trueexception), offline bundle re-verification insync --check, and a signer-change guard on upgrade (--allow-signer-change)
The POC validated feasibility (~6.6k lines / 74 files) but is intentionally not mergeable as one PR. This story tracks landing the work for production as 14 stacked PRs across two dependency chains (plan detailed in PR #5715):
Stack 1 — Lock file (6 PRs): lockfile package → SkillLockService split + storage → install/uninstall hooks → sync → upgrade → API/CLI surface
Stack 2 — Sigstore v1 (8 PRs, after Stack 1): provenance schema → verifier package → signer package → bundle storage + git signature plumbing → install verification → sync offline verify → upgrade signer guard → push signing + CLI/API flags
Each PR is independently buildable and testable (task test, task lint); this is a rewrite-by-file of the POC branch, not a cherry-pick of its commits.
Acceptance Criteria
Stack 1 — Lock file
- AT: Project-scope
thv skill installwrites atoolhive.lock.yamlentry pinningsource,resolvedReference,digest, andcontentDigest;thv skill uninstallremoves it and cascade-removes orphaned dependencies (requiredBy/explicit) - AT:
thv skill sync --checkdetects drift between the lock file and installed skills (missing, digest mismatch, on-disk tampering viacontentDigest) and exits with code 2 on failure - AT:
thv skill sync --adoptrecords out-of-band installs into the lock;--pruneremoves lock entries for manually deleted skills - AT:
thv skill upgrade --previewshows the candidate change without applying; moving to a different resolved reference requires--allow-ref-change - AT: Sync and upgrade are exposed via
POST /skills/syncandPOST /skills/upgradewith typed exit codes for CI (0 success / 2 check failure / 3 partial failure / 4 policy rejection) - Unit:
toolhive.requiresdependencies are materialized as lock entries withrequiredBytracking
Stack 2 — Sigstore v1
- AT: Project-scope install verifies OCI artifacts via the Sigstore referrers API and git skills via gitsign; unsigned artifacts are rejected unless
--allow-unsignedis passed, which recordsunsigned: truein the lock - AT: First verified install pins the publisher identity (
provenance.signerIdentity+certIssuer, TOFU); subsequent installs/syncs fail withsigner-mismatchif the identity diverges - AT:
thv skill sync --checkre-verifies stored Sigstore bundles offline (no registry access) against the locked provenance - AT:
thv skill upgradeblocks candidates whose signer identity or cert issuer changed, with--allow-signer-changeas the explicit override - AT:
thv skill pushsigns by default with a cosign key (--key,COSIGN_PASSWORD), attaching the signature as the legacy cosign.sigtag (not an OCI 1.1 referrer — a deliberate interop choice, since that's whatcosign verify --keyand Sigstore-aware registry tooling discover today; see Enable keyless signing for CI skill pushes #6402 and the closing comment on this issue);--no-signopts out - Unit: Verified bundles are persisted alongside installed skills (SQLite) for offline re-verification
- Lock entries validate as exactly one of
provenanceorunsigned: true
Delivery
- Work lands as the 14-PR stacked chain described above, each PR within repo size guidelines and independently green
-
docs/arch/12-skills-system.mddocuments the v1 trust model (cryptographic verification / TOFU identity / human lock-file review)
Out of Scope (deferred from v1)
- Keyless OIDC push signing (E2E against Sigstore staging)
- Catalog-supplied expected identity (requires
Provenanceon toolhive-coreSkilltypes)
References
- RFC: RFC: Project-level skills lock file rfcs#80 (THV-0080)
- POC: Add project-level skills lock file (POC) #5715 (feasibility vertical slice + split plan)
Activity
samuv commentedon Aug 13, 2026
Status: delivered, with one acceptance criterion not met as written
Both stacks are merged and the feature is live on
main—TOOLHIVE_SKILLS_LOCK_ENABLEDand everyLockFileFeatureEnabled()call site are gone. Verified ungated:with a lock entry carrying real verified provenance from
stacklok/dockyard. Delivery tracker #5899 is closed and carries the full PR list.The exception
Signing by default,
--key,COSIGN_PASSWORDand--no-signall landed (#6139). The signature is attached as the legacy cosign.sigtag, not as an OCI 1.1 referrer. That was a deliberate interop choice — it is whatcosign verify --keyand Sigstore-aware registry tooling discover today — and it is recorded as a non-goal in the split plan. But it is not what this AC says, so flagging it rather than ticking it.Worth noting the asymmetry: the verify side does handle referrers, via toolhive-core's
RetrieveBundles. That is how the example repo verifies real dockyard artifacts, which cosign v3 publishes as referrers. Only the push side writes the legacy layout.If referrer-based push matters, it wants its own issue. If the
.sigtag is the right call, this AC should be amended to say so.Out-of-scope items now have homes
Both deferrals listed here, plus two more found during the work, were living only as bullets in a closed issue. They are now tracked:
pkg/skills/signerto toolhive-coreBeyond the original scope
Building
stacklok/toolhive-skills-lock-exampleagainst the real catalog surfaced four bugs, all released in v0.42.1: #6211, #6212, #6213, and thethv ai-plugincounterparts of the first two. Review of the core port caught three more before merge, including one that would have deleted other signers' signatures on re-sign. And the interop check this plan promised but never ran —cosign verify --keyaccepting our output — failed when finally run:--keycould not read any key fromcosign generate-key-pair. Fixed, and now covered by regression tests built with the same call cosign makes.Ready to close once the referrer AC is either amended or split out.
samuv commentedon Aug 21, 2026
Amended the one flagged AC: the push signature is attached as the legacy cosign `.sig` tag, not an OCI 1.1 referrer. Confirmed this was the deliberate interop choice (matches `cosign verify --key` and Sigstore-aware registry tooling) and not worth a follow-up issue on its own — no functional gap, just AC wording.
All four out-of-scope follow-ups spawned by this issue are also done now:
pkg/skills/signerto toolhive-core) — closed, shipped as Switch skill artifact signing to toolhive-core's signer #6383Provenanceto Skill typesClosing as delivered.