Skip to content

Add provenance and unsigned fields to the skills lock schema - #6015

Merged
samuv merged 1 commit into
mainfrom
skills-sig/07-provenance-schema
Jul 27, 2026
Merged

Add provenance and unsigned fields to the skills lock schema#6015
samuv merged 1 commit into
mainfrom
skills-sig/07-provenance-schema

Conversation

@samuv

@samuv samuv commented Jul 27, 2026

Copy link
Copy Markdown
Contributor

Summary

Stack 2: 1/8 · next: verifier wrapper (blocks on stacklok/toolhive-core#192)

  • First PR of the Sigstore signing/verification stack (RFC THV-0080 Stack 2, tracked in Track: Skills lock file + Sigstore signing (RFC THV-0080) #5899). The lock file gains a typed provenance: block recording the verified signer identity — the trust-on-first-use anchor that later installs, syncs, and upgrades will be checked against — and an unsigned: true flag recording an explicit --allow-unsigned trust decision. The two are mutually exclusive.
  • Provenance fields are validated with the same syntactic constraints as resolvedReference (graphic characters only, bounded length): the lock file is hand-editable and these values feed the identity policy future verifications enforce.
  • The fields graduate from the Extra inline round-trip map into typed schema under version 1 — exactly the path the forward-compat design (from the Stack-1 review) reserved for them. A dedicated test proves old files carrying a provenance: block parse into the typed field with no key duplication; the existing forward-compat test's fixture moves to a still-unknown field (attestations:).
  • InstallOptions gains AllowUnsigned plus internal ProvenanceInfo/SigstoreBundle carriers that the verification step (a later PR in this stack) will populate.

No behavior changes: nothing produces or consumes these fields until the verifier lands. The whole feature remains gated behind TOOLHIVE_SKILLS_LOCK_ENABLED.

Type of change

  • New feature (non-breaking change which adds functionality)

Test plan

  • Provenance/unsigned round-trip through Save → Load; typed field does not leak into Extra
  • Extra-map graduation: a pre-existing lock with a provenance: block loads into the typed field, no duplicate keys on re-save
  • Validation matrix: valid provenance, mutual-exclusion with unsigned, required identity/issuer, control-character and length rejection
  • task test + task lint-fix green; no swagger drift (API wiring comes with the verification PR)

🤖 Generated with Claude Code

First PR of the Sigstore stack (RFC THV-0080 Stack 2, tracked in
#5899): the lock file gains a typed provenance block recording the
verified signer identity — the trust-on-first-use anchor later
installs, syncs, and upgrades are checked against — and an unsigned
flag recording an explicit --allow-unsigned trust decision. The two
are mutually exclusive and validated with the same syntactic
constraints as resolvedReference (graphic characters, bounded
length), since the lock file is hand-editable and these values feed
the identity policy future verifications enforce.

The fields graduate from the Extra inline round-trip map into typed
schema under version 1, exactly the path the forward-compat design
reserved for them; that test's fixture moves to a still-unknown
field. InstallOptions gains the AllowUnsigned option and the internal
ProvenanceInfo/SigstoreBundle carriers the verification step (a later
PR) will populate. No behavior changes yet — nothing produces or
consumes these fields until the verifier lands.
@samuv
samuv requested a review from JAORMX as a code owner July 27, 2026 13:23
@github-actions github-actions Bot added the size/S Small PR: 100-299 lines changed label Jul 27, 2026
@codecov

codecov Bot commented Jul 27, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 92.59259% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 72.12%. Comparing base (f1dae94) to head (580459f).

Files with missing lines Patch % Lines
pkg/skills/lockfile/validation.go 92.59% 1 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #6015      +/-   ##
==========================================
+ Coverage   72.10%   72.12%   +0.01%     
==========================================
  Files         720      720              
  Lines       74745    74772      +27     
==========================================
+ Hits        53898    53927      +29     
+ Misses      16991    16985       -6     
- Partials     3856     3860       +4     

☔ 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.

@samuv
samuv merged commit 6ef7820 into main Jul 27, 2026
48 checks passed
@samuv
samuv deleted the skills-sig/07-provenance-schema branch July 27, 2026 13:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/S Small PR: 100-299 lines changed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants