Skip to content

Display recorded trust state to the user - #6137

Merged
samuv merged 2 commits into
mainfrom
skills-sig/13b-provenance-display
Aug 12, 2026
Merged

Display recorded trust state to the user#6137
samuv merged 2 commits into
mainfrom
skills-sig/13b-provenance-display

Conversation

@samuv

@samuv samuv commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

Note

Stack 2 of RFC THV-0080 (tracking issue #5899) — part of stack #6128, on top of #6132. This is the display follow-up promised in #6129's review.

Summary

RFC THV-0080 requires the identity pinned at trust-on-first-use to be "displayed prominently" — today the user first meets it weeks later inside a signer-mismatch 403. This PR surfaces the recorded trust state everywhere it's decided or queried:

  • ProvenanceInfo becomes API-visible (signer_identity, cert_issuer, repository_uri, sigstore_url, provisional) instead of json:"-" end to end.
  • Install results carry the decision just recorded: the response includes provenance or unsigned, and the CLI prints it — Installed <name> (signed by <identity>), the provisional variant, or the explicit-unsigned variant.
  • thv skill info shows the lock file's recorded trust state for project-scoped, lock-managed skills (Signed by: / Cert issuer: / unsigned-exception lines, JSON included).

Type of change

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

Test plan

  • Unit tests pass locally
  • Linting passes (task lint-fix, 0 issues)
  • Existing verification tests cover the decision plumbing the display reads (installAndRegister now surfaces it on the result); task docs regenerated (swagger for the new response fields).

Does this introduce a user-facing change?

Yes, behind the experimental gate: successful project-scoped installs print the recorded trust state, and thv skill info shows the pinned signer identity.

Special notes for reviewers

  • The install success line is a deliberate exception to the CLI "silent success" rule (.claude/rules/cli-commands.md): a freshly pinned trust anchor is security-relevant information the RFC requires to be visible, not progress chatter. Happy to gate it differently if you disagree.

Generated with Claude Code

@github-actions github-actions Bot added size/S Small PR: 100-299 lines changed and removed size/S Small PR: 100-299 lines changed labels Jul 29, 2026
@codecov

codecov Bot commented Jul 29, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 72.81%. Comparing base (c86cb8a) to head (b391771).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #6137      +/-   ##
==========================================
- Coverage   72.84%   72.81%   -0.03%     
==========================================
  Files         743      743              
  Lines       77649    77674      +25     
==========================================
- Hits        56563    56558       -5     
- Misses      17119    17146      +27     
- Partials     3967     3970       +3     

☔ 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 self-assigned this Jul 29, 2026
@samuv
samuv force-pushed the skills-sig/13b-provenance-display branch from baa3b8a to 7359ebd Compare August 3, 2026 08:28
@github-actions github-actions Bot added size/S Small PR: 100-299 lines changed and removed size/S Small PR: 100-299 lines changed labels Aug 3, 2026
@samuv
samuv force-pushed the skills-sig/13b-provenance-display branch from 7359ebd to a1ed13c Compare August 3, 2026 09:07
@github-actions github-actions Bot added size/S Small PR: 100-299 lines changed and removed size/S Small PR: 100-299 lines changed labels Aug 3, 2026
@samuv
samuv force-pushed the skills-sig/13b-provenance-display branch from a1ed13c to e5e22bf Compare August 3, 2026 13:41
@github-actions github-actions Bot added size/S Small PR: 100-299 lines changed and removed size/S Small PR: 100-299 lines changed labels Aug 3, 2026
@samuv
samuv force-pushed the skills-sig/13b-provenance-display branch from e5e22bf to 683b7df Compare August 3, 2026 14:11
@github-actions github-actions Bot added size/S Small PR: 100-299 lines changed and removed size/S Small PR: 100-299 lines changed labels Aug 3, 2026
@samuv
samuv force-pushed the skills-sig/13b-provenance-display branch from d14b72f to 6a65d43 Compare August 3, 2026 15:16
@github-actions github-actions Bot added size/S Small PR: 100-299 lines changed and removed size/S Small PR: 100-299 lines changed labels Aug 3, 2026
Base automatically changed from skills-sig/13-upgrade-guard to main August 4, 2026 08:34
@samuv
samuv force-pushed the skills-sig/13b-provenance-display branch from 6a65d43 to 15cea4b Compare August 4, 2026 08:34
@github-actions github-actions Bot added size/S Small PR: 100-299 lines changed and removed size/S Small PR: 100-299 lines changed labels Aug 4, 2026
@samuv
samuv force-pushed the skills-sig/13b-provenance-display branch from 15cea4b to c6569e6 Compare August 4, 2026 08:35
@github-actions github-actions Bot added size/S Small PR: 100-299 lines changed and removed size/S Small PR: 100-299 lines changed labels Aug 4, 2026
samuv and others added 2 commits August 12, 2026 11:46
RFC THV-0080 wants the identity pinned at trust-on-first-use displayed
prominently, not discovered weeks later inside a signer-mismatch
error. ProvenanceInfo becomes part of API responses: install results
carry the provenance or unsigned exception that was just recorded (the
CLI prints it — a deliberate exception to silent success, since a
recorded trust anchor is security-relevant information, not progress
chatter), and skill info surfaces the lock file's recorded trust state
for project-scoped skills, provisional markers included.

Part of #5899.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
The CLI is a pure HTTP client, so a field the service records but the
install response omits can never reach the user. Provenance and the
unsigned exception were set on InstallResult server-side and dropped at
the wire, leaving printInstallTrust to report every install as untracked
regardless of what was verified.

Add both to the install response and the client DTO, and map them back.
The round-trip test fails without the mapping — a direct test of the
printer passes either way, which is how the gap survived.
@samuv
samuv marked this pull request as ready for review August 12, 2026 09:52
@samuv
samuv force-pushed the skills-sig/13b-provenance-display branch from c6569e6 to b391771 Compare August 12, 2026 09:52
@samuv

samuv commented Aug 12, 2026

Copy link
Copy Markdown
Contributor Author

Rebased onto main and marked ready. Two things changed since this was drafted.

Conflict resolution. The conflict in cmd/thv/app/skill_install.go came from #6223, which added an absProjectRoot call to the same function. Both changes are kept.

A defect this PR shipped with, now fixed. The install half of this feature never worked. InstallResult.Provenance / .Unsigned were populated server-side, but neither installSkillResponse nor the client's installResponse carried them, and Client.Install returned &skills.InstallResult{Skill: resp.Skill} — dropping both. Since the CLI is a pure HTTP client, printInstallTrust always fell through to the bare Installed <name> no matter what was verified.

The skill info path was fine — it decodes straight into skills.SkillInfo, which is fully tagged.

Fixed by wiring both fields across all four hops, plus TestInstallCarriesTrustStateBackToCaller, a table over signed / provisional / unsigned / neither. I verified it actually catches the regression by reverting the client mapping and watching it fail, rather than assuming:

--- FAIL: TestInstallCarriesTrustStateBackToCaller/signed_install_reports_the_pinned_identity
    Messages: provenance must survive the HTTP boundary — the CLI has no other source for it

Worth noting the failure mode, since it is the same shape as the --allow-unsigned gap fixed earlier in this stack: a unit test of the printer passes either way, so only a round-trip test over the wire catches it.

task test, task lint-fix, and task docs all green at the branch tip.

@github-actions github-actions Bot added size/M Medium PR: 300-599 lines changed and removed size/S Small PR: 100-299 lines changed labels Aug 12, 2026
@samuv
samuv merged commit 52ad293 into main Aug 12, 2026
48 checks passed
@samuv
samuv deleted the skills-sig/13b-provenance-display branch August 12, 2026 12:47
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