feat: --update mode with hash drift detection + decision matrix: https://github.com/riboseinc/claude-memory-files/issues/1 - #13
Merged
Conversation
Implements ticket #1 (#1) and bridges into ticket #2's update-regulation design (#2). PR 9 of the delivery sequence. Lands the v1 update flow: - tools/install.sh: new --update <slug> mode plus --upstream flag for personal-share entries. Reads the manifest, fetches upstream (via --repo-root or curl), compares hashes, computes the semver bump category, detects local edits via body-hash comparison, and applies the decision matrix: clean local + any bump → overwrite + history append edited local + any bump → abort, --force overrides forked (personal-share) entry → no-op, --upstream overrides For settings-fragment updates, subtracts the manifest-recorded fragment first, then merges the new upstream fragment — preserving hand-added entries while picking up upstream removals. - tools/plugin/commands/update-memory-file.md: new slash command /update-memory-file <slug> [--force] [--upstream] [--ref <sha>] that surfaces the decision matrix to the user, then invokes install.sh --update with the right flags. - tools/test-install.sh: extended with five new --update scenarios (clean local + bump → overwrite; edited local → abort; --force overrides; personal-share no-op; --upstream forces overwrite). All pass locally and via CI on this PR. - CONTRIBUTING.md: "Updating an existing file" section now reflects that --update is live (was "shipping with PR 9"). This is the v1 bridge into ticket #2. The full ticket #2 work (CODEOWNERS branch protection, deprecation tombstones, full semver validator enforcement, /check-memory-files deprecation scanner, auto-merge by trusted contributors) lands separately as a post-v1 PR series. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…re-and-assign) Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.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.
Implements ticket #1 and bridges into ticket #2's update-regulation design.
PR 9 of the delivery sequence — the v1 update flow.
What this adds
tools/install.sh— new--update <slug>mode plus--upstreamflag forpersonal-shareentries.Reads the manifest entry by slug (rather than a path).
Fetches upstream (via
--repo-rootor curl).Compares hashes: installed-hash (manifest), upstream-hash (newly computed from upstream body), and local-hash (body of the on-disk file).
Computes the semver bump category (
patch/minor/major/none/unknown).Applies the decision matrix:
--forceoverridesforked: true(personal-share)--upstreamforces overwriteFor
settings-fragmentupdates, subtracts the manifest-recorded fragment first, then merges the new upstream fragment — preserving hand-added entries while picking up upstream removals.tools/plugin/commands/update-memory-file.md— new slash command. Surfaces the decision matrix to the user, then invokesinstall.sh --updatewith the right flags.tools/test-install.sh— extended with five new--updatescenarios. All pass on this PR via CI.CONTRIBUTING.md— "Updating an existing file" section now reflects that--updateis live.v1.1 / ticket #2 not yet shipped
This PR is the v1 bridge into ticket #2. The full ticket #2 work — CODEOWNERS branch protection, deprecation tombstones, full validator-enforced semver,
/check-memory-filesdeprecation scanner, auto-merge by trusted contributors — lands in a separate post-v1 PR series.🤖 Generated with Claude Code