fix: simplify skills sync to stamp-based approach#1008
Conversation
Change-Id: Ic95e8a74a0d6fc7f89782dccde867fd794cfcf46
📝 WalkthroughWalkthroughThe PR migrates skills version tracking from a complex ChangesSkills stamp infrastructure and drift detection
Update command skills integration and reporting
Integration and install script updates
Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 minutes Possibly related PRs
Suggested labels
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 ESLint
ESLint skipped: no ESLint configuration detected in root package.json. To enable, add Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
🚀 PR Preview Install Guide🧰 CLI updatenpm i -g https://pkg.pr.new/larksuite/cli/@larksuite/cli@35bcd4a25eea7393c55242ecef42b76357957c17🧩 Skill updatenpx skills add larksuite/cli#fix/simplify-skills-sync -y -g |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@cmd/update/update.go`:
- Around line 191-196: The in_sync boolean currently compares stamp == cur raw;
change it to compare normalized versions to match runSkillsAndStamp's dedup
logic: call normalizeVersion on both stamp and cur (e.g.,
normalizeVersion(stamp) == normalizeVersion(cur)) when setting
out["skills_status"]["in_sync"]; locate the ReadStamp use and the map
construction around skillscheck.ReadStamp(), and update the in_sync expression
accordingly so normalization is applied to both sides.
- Around line 370-375: In reportAlreadyUpToDate, the comparison uses raw stamp
and cur which can differ in format; call normalizeVersion on both stamp and cur
before setting out["skills_status"] so "current" and "target" use
normalizedVersion values and "in_sync" compares normalizedStamp ==
normalizedCur; reference normalizeVersion, stamp, cur, reportAlreadyUpToDate,
and the out["skills_status"] map to locate and update the code.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: af8a6a56-2f10-445c-af50-d9c09377d397
📒 Files selected for processing (15)
cmd/root_integration_test.gocmd/update/update.gocmd/update/update_test.gointernal/selfupdate/updater.gointernal/selfupdate/updater_test.gointernal/skillscheck/check.gointernal/skillscheck/check_test.gointernal/skillscheck/notice.gointernal/skillscheck/stamp.gointernal/skillscheck/stamp_test.gointernal/skillscheck/state.gointernal/skillscheck/state_test.gointernal/skillscheck/sync.gointernal/skillscheck/sync_test.goscripts/install-wizard.js
💤 Files with no reviewable changes (5)
- internal/skillscheck/state_test.go
- internal/skillscheck/sync_test.go
- internal/skillscheck/state.go
- internal/skillscheck/sync.go
- internal/selfupdate/updater_test.go
Change-Id: Ic95e8a74a0d6fc7f89782dccde867fd794cfcf46
Summary
Remove the incremental skills sync mechanism and restore the simpler stamp-based approach. The incremental sync added complexity (state.json, per-skill install, plan/diff logic) without sufficient benefit over the straightforward full sync via
npx skills add.Changes
internal/skillscheck/stamp.go— simple version stamp read/writeinternal/skillscheck/state.go,sync.goand their tests — incremental sync logicinternal/skillscheck/check.goto use stamp-based drift detectioncmd/update/update.goto userunSkillsAndStampinstead ofrunSkillsAndStateinternal/selfupdate/updater.goscripts/install-wizard.jsto full sync instead of incremental planTest Plan
Related Issues
N/A
Summary by CodeRabbit
New Features
Improvements
Tests