feat(skills): auto-provision bundled skills to managed dir on startup#2090
Merged
feat(skills): auto-provision bundled skills to managed dir on startup#2090
Conversation
…#2089) On every startup, bundled skills embedded at compile time via include_dir! are copied to ~/.config/zeph/skills/ if missing or if the embedded version differs from the previously provisioned version (.bundled marker file). - User-installed skills (no .bundled marker) are never overwritten - Atomic provisioning: writes to a temp dir, then renames into place so interrupted writes are treated as absent and re-provisioned on next startup - Version comparison uses != so binary rollback downgrades bundled skills - bundled-skills feature flag (default + full); packagers can opt out - build.rs guard emits a clear error if .zeph/skills/ is missing at compile time - DEBUG log when all bundled skills are already up to date - Non-skill entries (README.md) are filtered by requiring SKILL.md presence - 5 new unit tests: frontmatter parsing, marker state variants
- Replace Dir::dirs() with entries() filter on root Dir — dirs() returns empty on the embedded root in include_dir 0.7; entries() correctly yields all 24 skill subdirectories - Fix get_file() calls to use root-relative paths (e.g. "api-request/SKILL.md") instead of relative-to-dir paths, matching include_dir 0.7 lookup semantics - Replace draft self-contradicting comment in write_skill() with concise atomic-rename guarantee description (R1) - Add provision_to_empty_dir_installs_all_skills integration test (R2): provisions to a temp dir and asserts every skill has SKILL.md + .bundled
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #2089
Summary
.zeph/skills/into the binary at compile time viainclude_dir!(gated behindbundled-skillsfeature, enabled by default and infull)provision_bundled_skills()is called beforeSkillRegistry::load()— missing or outdated bundled skills are written to the managed dir (~/.config/zeph/skills/).bundledmarker) are never overwritten!=so rollback also downgrades skills to the older bundled versionKey fix found during review
include_dir 0.7dirs()returns empty at root level; onlyentries()works. Without this fix the entire feature would silently install 0 skills. Caught by the end-to-end integration test added in the fix-review cycle.Test plan
cargo nextest run -p zeph-skills— 6 unit tests pass (5 new for helpers + 1 integration for main flow)cargo nextest run --workspace --lib --bins— 5769 tests passcargo clippy --workspace -- -D warnings— cleancargo +nightly fmt --check— cleancargo check -p zeph-skills(nobundled-skills) compiles withoutinclude_dir