Skip to content

feat: --update mode with hash drift detection + decision matrix: https://github.com/riboseinc/claude-memory-files/issues/1 - #13

Merged
opoudjis merged 2 commits into
mainfrom
feat/update-mode
May 18, 2026
Merged

feat: --update mode with hash drift detection + decision matrix: https://github.com/riboseinc/claude-memory-files/issues/1#13
opoudjis merged 2 commits into
mainfrom
feat/update-mode

Conversation

@opoudjis

Copy link
Copy Markdown
Member

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 --upstream flag for personal-share entries.

    • Reads the manifest entry by slug (rather than a path).

    • Fetches upstream (via --repo-root or 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:

      Local edited? Bump Action
      no any silent overwrite; manifest history appended
      yes any abort; --force overrides
      forked: true (personal-share) any no-op; --upstream forces overwrite
    • 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. 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. All pass on this PR via CI.

  • CONTRIBUTING.md — "Updating an existing file" section now reflects that --update is 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-files deprecation scanner, auto-merge by trusted contributors — lands in a separate post-v1 PR series.

🤖 Generated with Claude Code

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>
@opoudjis opoudjis self-assigned this May 18, 2026
…re-and-assign)

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@opoudjis
opoudjis merged commit adbed87 into main May 18, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant