Skip to content

Resolve locally-built artifacts during skill install#4018

Merged
JAORMX merged 2 commits intomainfrom
fix/skill-install-resolve-local-store
Mar 6, 2026
Merged

Resolve locally-built artifacts during skill install#4018
JAORMX merged 2 commits intomainfrom
fix/skill-install-resolve-local-store

Conversation

@JAORMX
Copy link
Copy Markdown
Collaborator

@JAORMX JAORMX commented Mar 5, 2026

Summary

  • Adds resolveFromLocalStore method to check the local OCI store for a tag matching the skill name before creating a pending record during thv skill install <name>
  • Enables the build → install local dev workflow: thv skill build ./my-skill then thv skill install my-skill now produces an "installed" (not "pending") skill
  • Includes supply-chain defense: artifact's embedded name must match the install name
  • Phase 1 of Skill install needs reference resolution (matching thv run pattern) #4015 — registry index lookup and git references are out of scope

Changes

File Change
pkg/skills/skillsvc/skillsvc.go New resolveFromLocalStore method; modified Install to check local store before pending fallback
pkg/skills/skillsvc/skillsvc_test.go New TestInstallFromLocalStore — 5 table-driven cases (happy path, name mismatch, tag not found, nil store, corrupt manifest)
test/e2e/api_skills_test.go New "Build then install from local store" E2E tests

Test plan

  • task lint-fix — 0 issues
  • task test — all unit tests pass
  • task test-e2e — E2E tests (new build-then-install cases)
  • Manually verify thv skill build ./skill-dir && thv skill install <name> produces status "installed"

Closes #4015

🤖 Generated with Claude Code

@github-actions github-actions bot added the size/S Small PR: 100-299 lines changed label Mar 5, 2026
@codecov
Copy link
Copy Markdown

codecov bot commented Mar 5, 2026

Codecov Report

❌ Patch coverage is 87.17949% with 5 lines in your changes missing coverage. Please review.
✅ Project coverage is 68.55%. Comparing base (f0f55c1) to head (463ae01).
⚠️ Report is 3 commits behind head on main.

Files with missing lines Patch % Lines
pkg/skills/skillsvc/skillsvc.go 87.17% 4 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4018      +/-   ##
==========================================
- Coverage   68.60%   68.55%   -0.06%     
==========================================
  Files         444      444              
  Lines       45184    45219      +35     
==========================================
  Hits        31000    31000              
- Misses      11783    11822      +39     
+ Partials     2401     2397       -4     

☔ View full report in Codecov by Sentry.
📢 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.

reyortiz3
reyortiz3 previously approved these changes Mar 5, 2026
@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 Mar 5, 2026
When a user runs `thv skill build` followed by `thv skill install <name>`,
the install now checks the local OCI store for a tag matching the skill
name before falling back to a pending record. This unblocks the local
dev workflow (build → install) where the artifact is already available
locally.

The new resolveFromLocalStore method validates the artifact's embedded
name matches the install name (supply-chain defense), extracts layer
data and metadata, and hydrates the install options so the existing
installWithExtraction flow handles the rest.

Closes #4015

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@JAORMX JAORMX force-pushed the fix/skill-install-resolve-local-store branch from 39ca570 to c81435a Compare March 6, 2026 08:09
@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 Mar 6, 2026
@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 Mar 6, 2026
@JAORMX JAORMX merged commit 7471a84 into main Mar 6, 2026
57 of 58 checks passed
@JAORMX JAORMX deleted the fix/skill-install-resolve-local-store branch March 6, 2026 11:32
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.

Skill install needs reference resolution (matching thv run pattern)

3 participants