Repository navigation
fix(skills): harden v0.21 skills store, archives, git sync, and control installs - #379
Merged
Merged
Conversation
…ontrol installs Signed-off-by: kombuchapunk <35040017+kombuchapunk@users.noreply.github.com>
…dings Signed-off-by: kombuchapunk <35040017+kombuchapunk@users.noreply.github.com>
… git, and store Signed-off-by: kombuchapunk <35040017+kombuchapunk@users.noreply.github.com>
…ive canonical slots, and managed links Signed-off-by: kombuchapunk <35040017+kombuchapunk@users.noreply.github.com>
…ude synced dir Signed-off-by: kombuchapunk <35040017+kombuchapunk@users.noreply.github.com>
…tion, and dangling synced alias Signed-off-by: kombuchapunk <35040017+kombuchapunk@users.noreply.github.com>
Signed-off-by: kombuchapunk <35040017+kombuchapunk@users.noreply.github.com>
Signed-off-by: kombuchapunk <35040017+kombuchapunk@users.noreply.github.com>
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.
Summary
Hardens the newly shipped
v0.21.0skills stack (packages/skills+packages/cli/src/control/skills.ts) across security, data-loss prevention, DoS protection, cross-platform correctness, and atomicity after five rounds of multi-model adversarial QA (Claude Opus 5.5, Gemini 4 Neon, and Codex).Key Fixes
format.ts,archive.ts):MAX_WALK_DIRS = 1024) to stop exponential symlink diamond-DAG DoS (20-level diamond drops from >135 s to ~170 ms), detects case-variant symlink cycles viarealpathSync.native, rejects non-regular files (FIFOs/sockets/devices, direct or symlinked) and Windows NTFS ADS (:) paths, and refuses to pack unsafe/truncated skill scans.splitUstarPath), NFC + case-insensitive duplicate/ignored-segment validation, and linear-time frontmatter parsing (splitMappingLine, zero polynomial ReDoS).replacePathAtomicwith backup-and-restore rollback on failure and best-effort post-commit backup cleanup (tolerant of WindowsEPERM).store.ts):walkPathToTargetviareadlinkSync, platform-aware/vs[\\/]splitting, 40-hop cap) to closelinkOnlyself-deletion /ELOOPcycles across symlinked parents, aliases, raw..targets, and multi-hop chains...-containingsourceDirforlinkOnlyinstalls without lexicalpath.resolvedrift so the exact validated target is linked.isSameDirEntry) whenskillsDir === harnessDir(including case-variants, symlinked parents,linkOnlysymlinks, and broken symlinks)."synced"directory acrossdiscoverSkills,adoptSkill,removeSkill,assertAllowedHarnessSlug, andsyncGitCollection— including when another harness'sskillsDiraliases.claude/skills(even as a dangling symlink).!hasUnsafeScanProblem(scanned.problems)inisUnmodifiedManagedCopyso unreadable local files inside a managed copy cannot be silently deleted without--force, while byte-identical managed copies with benign frontmatter warnings still unlink cleanly.adoptSkillbefore mutating source files or state.git.ts,control/skills.ts):collectionIdvalidation beforegit clone, rejects duplicate/unsafe/conflicting skills before writing anything, and separates canonical overwrite from harness force (forceHarnesses = !!opts?.overwrite) so ordinary git resyncs never overwrite user-edited harness copies.Verification
diststress probes.npm run lint,npm run typecheck,npm run build,npm run schemas -- --check,npm run conformance, and full monoreponpm run test:coverage(100% Stmts / Branch / Funcs / Lines across all 183 test files / 4,878 tests).