Skip to content

fix(guard): stop suggesting meta git snapshot - #5

Merged
gold-silver-copper merged 3 commits into
mainfrom
fix/meta-git-safety
Oct 25, 2026
Merged

gold-silver-copper merged 3 commits into
mainfrom
fix/meta-git-safety

Conversation

@gold-silver-copper

@gold-silver-copper gold-silver-copper commented Oct 25, 2026 •

Copy link
Copy Markdown
Contributor

meta is removing meta git snapshot (owner's decision, 2026-10-25: nobody uses it; PR set linked below). The guard's built-in denial messages told agents to run it, which will fail.

What changed

  • .claude/agent-guard.toml (the embedded defaults): every "meta git snapshot create/restore" hint is replaced. git reset --hard now suggests committing or git stash push -u first and git reflog to go back to an earlier commit; force push suggests git fetch and a backup branch at origin/<branch> (the remote tip it would destroy); git branch -D suggests a backup branch; git clean, git checkout . suggest git stash; the two stash hints that claimed a snapshot "captures all stashes" are dropped. Byte-identical to the copy in the gitkb/meta root.
  • The unit test and bats test that asserted the reset --hard message mentions "snapshot" now assert it mentions git reflog; README table row updated.

Not changed, needs a decision: agent score still has a "snapshot safety" metric (25% of the overall score) that counts meta git snapshot create before destructive commands, and recommends it. With the command gone, that metric can only score 0 when destructive commands are present. Dropping or replacing it (e.g. with "commit or stash before destructive commands") changes the scoring, so I left it for you.

  • Also: two sort_by calls (guard.rs, score.rs) become sort_by_key(... Reverse ...), because the current toolchain's clippy (unnecessary_sort_by) fails CI on main's code; behavior is unchanged.

Verified: cargo test (126 tests) and tests/guard.bats pass.

Linked PRs (same branch fix/meta-git-safety)

Companions that don't depend on the code above (can merge on their own):

@coderabbitai

coderabbitai Bot commented Oct 25, 2026 •

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: ASSERTIVE
  • Plan: Advanced
  • Run ID: 57fd083b-73f1-4c3d-afed-3fdd7654235e
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Comment @coderabbitai help to get the list of available commands.

meta is removing `meta git snapshot`. The guard's denial messages now
say to commit, stash or branch first and use git reflog to recover
commits.

Refs [[tasks/harmony-2754]]
The current toolchain's clippy rejects two sort_by calls on main.

Refs [[tasks/harmony-2754]]
A backup branch keeps only commits, and `meta git commit` commits only
staged changes, so the guidance now stages with `meta git add -A` or
stashes first. The force-push hint backs up the remote tip.

Refs [[tasks/harmony-2754]]
@gold-silver-copper
gold-silver-copper merged commit e667002 into main Oct 25, 2026
6 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