fix(sync-state): drop per-skill content hash, use git ref for identity#389
Merged
Conversation
Reverts the per-skill content-hash machinery added in #382. For git-based plugins, identity is already given for free by `url + ref` — `git rev-parse HEAD` after each fetch returns the commit SHA, which is what `resolvedSha` already records on the source entry. Computing a per-file sha256 tree over every installed skill folder on every install adds CPU work and code complexity without giving us anything `resolvedSha` doesn't. - src/models/sync-state.ts: remove `SyncStateSkillSchema` and the `skills` map on `SyncStateSourceSchema`. Each lock entry is now just `{ pluginSpec, resolvedRef, resolvedSha, pinnedRef? }`. The top-level `lastSync` already records the timestamp. - src/core/sync-state.ts: drop `computeSkillFolderHash`, `upsertSyncStateSkill`, and the unused `crypto.createHash` / `readdir` / `relative` imports. The private `persistMergedSyncState` helper folds back into `upsertSyncStateSource`. - src/cli/commands/plugin-skills.ts: rename `recordContentProvenance` → `recordSourceProvenance` and drop the now-unused `skills` param + skill folder walk. The two callers (`--from <skill>` install and `--all`) no longer need to thread `skills` through. Verified end-to-end: `skill add brainstorming --from obra/superpowers --pin v3.1.0` writes a `sources["obra/superpowers"]` entry with `pluginSpec`, `resolvedRef`, `resolvedSha`, `pinnedRef` only — no `skills` map. `bun test`: 1209 pass / 0 fail. Closes #388
Deploying allagents with
|
| Latest commit: |
b91619d
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://0fbc8007.allagents.pages.dev |
| Branch Preview URL: | https://fix-388-revert-content-hash.allagents.pages.dev |
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
Reverts the per-skill content-hash machinery from #382. Identity for git-based plugins is already provided by
url + ref—git rev-parse HEADafter each fetch returns the commit SHA, whichresolvedShaalready records on the source entry. Hashing every installed skill folder on every install was CPU work for no win over whatresolvedShagives for free.Mapping the issue's naming to this codebase:
.allagents/sync-state.json'ssourcesblockSyncStateSourceSchemaSyncStateSkillSchema.contentHash(per-skill, removed)resolvedRef+resolvedShalastSync(already there)Changes
src/models/sync-state.ts— removeSyncStateSkillSchemaand theskillsmap onSyncStateSourceSchema. Each lock entry is now just{ pluginSpec, resolvedRef, resolvedSha, pinnedRef? }.src/core/sync-state.ts— dropcomputeSkillFolderHash,upsertSyncStateSkill, and the unusedcrypto.createHash/readdir/relativeimports. The privatepersistMergedSyncStatehelper folds back intoupsertSyncStateSource.src/cli/commands/plugin-skills.ts— renamerecordContentProvenance→recordSourceProvenanceand drop the now-unusedskillsparam + skill-folder walk. Both callers (--from <skill>install and--all) updated.There was no
needsSynchash-comparison logic in the codebase — the only consumer of the hash was theskill updatecommand, which was removed in #387.Test plan
bun run buildbun run typecheckbun test— 1209 pass / 0 failskill add brainstorming --from obra/superpowers --pin v3.1.0writes{ "obra/superpowers": { "pluginSpec": "obra/superpowers", "resolvedRef": "v3.1.0", "resolvedSha": "0bc5a5989d8cf140e9f671af14c76f6a6e6fae79", "pinnedRef": "v3.1.0" } }skillsmap.computeSkillFolderHash,upsertSyncStateSkill,SyncStateSkill,contentHash, orskillFolderHashanywhere insrc/ortests/.Closes #388