Repository navigation
feat(update): flag and protect skills edited since install - #622
Conversation
A skill installed from a repository and then edited by hand looked exactly like an untouched one: check said up to date, and update either reported it current or silently reinstalled it over the edit (#621). Install already records each file's hash, so check now compares a remote skill's files with those hashes and reports "modified", and update skips such a skill until --force (CLI single, --all/--group, dashboard). --force, the dashboard's Force Retry on the skipped row, or the confirmation on the skill page discards the edit and reinstalls. Two hash paths had to be made reliable for this to be trusted: the dashboard's folder-wide target edit refreshed hashes by basename, so a nested skill looked edited after skillshare's own change, and a skill whose files cannot be hashed now counts as modified instead of being overwritten.
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 17724eadf2
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
…KILL.md Changing a skill's targets in the dashboard rewrites its SKILL.md, and both the folder-wide and the single-skill handler then re-hashed the whole directory as the new baseline. An edit the user had already made to any file in the skill was absorbed into that baseline, so the skill stopped counting as modified and the next update overwrote the edit without --force. Both handlers now move only SKILL.md's recorded hash, and only when the file still matched it before the rewrite. skillshare's own target edit no longer reads as a local change, and an earlier edit still does. The whole-directory refresh helpers lost their last callers and are removed.
|
@codex review |
|
Codex Review: Didn't find any major issues. Keep it up! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
…hanges # Conflicts: # ui/src/pages/DashboardPage.tsx
* feat(check): show what changed in a skill since install #622 made a hand-edited skill visible as modified and kept update from overwriting it, but there was still no way to see the edits before deciding to keep or discard them (#621). LocalChanges compares the skill's files with the hashes recorded at install, fetches the source at the recorded commit only when a recorded file changed, and diffs each file against it, so the diff shows the user's edits even after upstream moves on. A skill without a recorded commit is refused rather than diffed against HEAD, which would show upstream changes as the user's. It backs `check <name> --diff`, GET /api/resources/{name}/local-changes, and the dashboard: the Modified locally dialog on the skill page lists the diffs, and the Updates tab links a modified skill to it. update's skip hints now point at --diff. The route looks up the exact record and refuses non-local names, so a nested or ../ path cannot borrow a top-level skill's record or read outside the source. The file diff helper moved to textdiff so the CLI and server share it. * fix(install): diff local changes against the full installed commit entry.Version holds the short SHA from `rev-parse --short`. A targeted fetch needs the full SHA, so checkoutCommit fell back to fetching every branch and tag with --unshallow: viewing one edited skill could download the repository's whole history, and fail when the commit is only reachable by its full SHA. Use entry.Commit, the full SHA install records, when it is the same commit as Version; a Commit left from an older install, or a legacy record without one, falls back to Version. * test(install): keep checkout line endings when editing in LocalChanges test On Windows git checks the installed copy out with CRLF, so overwriting SKILL.md with LF content made every line differ and the expected diff failed. Edit the installed file in place, as an editor would, and compare the diff without carriage returns.
Type
proposals/only — see CONTRIBUTING.md)None ticked: this is a maintainer-authored feature from issue #621, not a proposal.
Linked Issue
Closes #621 (phase 1: indicator and revert via update; the diff view is left for a follow-up)
Summary
check remote skill compare HEAD / tree hash → up_to_date | update_available | stale + files ≠ recorded file_hashes → modified ("local changes since install") update <name> | --all | --group | dashboard + modified && !force → skip ("local changes since install") + named skill → exit 1 + `update <name> --force` hint + --all / --group / batch → counted skipped, "Modified locally" section + --dry-run → "would skip" reinstall from sourceMetadataEntry.LocallyModified(internal/install) is the one check, used bycheck, the CLI and the server. Tracked repos, local-path installs and entries without recorded hashes are never flagged; a skill that cannot be hashed is, so update does not overwrite it.POST /api/resources/batch/targets) refreshed hashes by basename, so nested skills would have shown as modified after skillshare's own edit; it now uses the relative path.Evidence
skillshare checkreports it up to date, andskillshare update <name>reinstalls over the edit without a word.After:
TestMetadataEntry_LocallyModified,TestResolution_EditedRemoteSkillIsModified,TestUpdateRegularSkill_LocallyModifiedIsSkippedWithoutForce,TestHandleBatchSetTargets_RefreshesNestedSkillHashes, and integration tests intests/integration/update_local_changes_test.go(check/update/--force, fetch failure counts, dry-run, single-target--all).Merge Danger
Door: two-way
Blast Radius: update
update <name>used to reinstall unconditionally; for an edited remote skill it now needs--force. Scripts that relied onupdateoverwriting local edits must add--force.check --jsongains amodifiedstatus that takes precedence overupdate_availableandstalefor edited skills.Checks run
make checkin the devcontainer (docs-check, fmt-check, lint, unit + integration tests): passtsc --noEmit,vitest run(782 tests),pnpm run build: passpython3 scripts/ai-context.py check: okNot covered
list,statusordoctor; the Updates tab hero still says all current when the only finding is a modified skill (same as dirty tracked repos today).errorrather thanmodified.forcealso overrides the audit gate (existing semantics); the new confirmation says so.Checklist
make check) — for code changes