secrets/test
Brian Majewski dd6a025fa0 fix: surface store sync failures + add secrets sync (EGB-1230, EGB-1231)
EGB-1230: `cmd_pull` synced the store with `git pull >/dev/null 2>&1` under
`set -euo pipefail`. A store that couldn't fast-forward killed the script at
that line with git's exit 128 and nothing on stdout or stderr — a banner, no
restored files, no reason, and invisible in a pipeline. The sync now routes
through `_store_sync_pull`, which guards the pull, captures git's output as
the diagnosis, and dies naming the store path and `secrets sync`. It is now
`--ff-only` to match the push path, so a plain pull can no longer manufacture
a merge commit in the store.

EGB-1231: once a store diverged there was no way out — push demanded a
fast-forward and pointed at pull, which couldn't fast-forward either, so the
advice looped and recovery meant hand-running git next to encrypted blobs.
Adds `secrets sync`: fetch, stash, rebase onto the remote, restore the stash,
then a confirmation-gated push of local commits (`--yes` to skip the prompt,
`--dry-run` to report only). Non-destructive by construction — no merge, no
force-push, no `reset --hard`, no `stash drop`; a rebase conflict names the
conflicting files and leaves the store exactly as found. `secrets which` gains
a `remote:` line reporting ahead/behind/dirty, and push's dead-end message now
points at `sync`.

test/sync.bats: 25 new tests. Full suite 353/353 green.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BrUoYuUMoTj91rzV4vxGPB
2026-09-08 14:20:20 -07:00
..
install.bats feat: thin install.sh onboarding bootstrap (EGB-671) 2026-06-08 16:23:50 -07:00
join.bats feat: secrets join + init --remote + verified onboarding (EGB-671) 2026-06-08 16:23:50 -07:00
manifest.bats refactor: dedup external extractor + read guards, warn on legacy-pull nested blobs (EGB-701) 2026-06-18 10:08:13 -07:00
migrate.bats feat: secrets migrate --status surfaces v2-only externals (coverage, EGB-712) 2026-06-08 10:44:34 -07:00
recipients.bats fix: validate-before-mutate in recipients add/rm + verify messaging + doc/UX polish (EGB-283) 2026-06-24 13:37:56 -07:00
run-security.sh chore: security review policy + operator runner, doc updates (EGB-677 stage 1) 2026-06-07 13:12:39 -07:00
secrets.bats feat: secrets join + init --remote + verified onboarding (EGB-671) 2026-06-08 16:23:50 -07:00
sync.bats fix: surface store sync failures + add secrets sync (EGB-1230, EGB-1231) 2026-09-08 14:20:20 -07:00
test_helper.bash feat: multi-recipient encrypt core + recipients.txt (EGB-283) 2026-06-24 12:33:05 -07:00
upgrade.bats feat: secrets upgrade verb — self-update + re-check version skew (EGB-716) 2026-06-18 11:01:17 -07:00
version.bats feat: version-skew nudge — stamp store writer-version, warn when behind (EGB-713) 2026-06-08 12:07:50 -07:00