Skip to content

feat(bin): add safe identical-squash reconciliation - #1321

Open
homestills wants to merge 6 commits into
kunchenguid:mainfrom
homestills:fm/fleet-sync-narrow-identical-squash-recovery
Open

homestills wants to merge 6 commits into
kunchenguid:mainfrom
homestills:fm/fleet-sync-narrow-identical-squash-recovery

Conversation

@homestills

@homestills homestills commented Jul 30, 2026 •

Copy link
Copy Markdown

Intent

Add an explicit operator-invoked helper for reconciling one clean, quiesced Git repository when its checked-out default branch and source-backed origin default branch genuinely diverge but have identical root trees.

Changed files

  • bin/fm-reconcile-identical-squash.sh
  • tests/fm-reconcile-identical-squash.test.sh
  • docs/scripts.md

Safety behavior

The helper refuses dirty, detached, off-default, multi-worktree, active-operation, symbolic-ref, incomplete-history, ambiguous-history, unequal-tree, fetch-failure, and raced states. Source acquisition leaves FETCH_HEAD, configured remote-tracking refs, tags, submodules, and unrelated refs unchanged. A single no-dereference ref transaction preserves the complete old local commit under a deterministic direct ref and moves only the local default branch. Post-commit evidence changes are reported without rolling back through a new claimant. Ordinary fleet synchronization is unchanged.

Compatibility

The fetch and ref-transaction command surface is compatible with Git 2.40, with executable verification on Git 2.40 and a current Git release.

Validation

Executable-interface regression coverage passed, including success, idempotence, refusal paths, fetch invariants, symbolic-ref and expected-old races, bounded source advancement, and post-commit claimant retention. All 10 required CI checks pass, including shell lint, stock macOS Bash compatibility, behavior suites, coverage, and repository invariants.

Risk

High. The helper intentionally moves a local branch, but only after strict predicates are proven. Explicit operator quiescence plus pre- and post-transaction evidence remains the concurrency boundary.

Updates from git push no-mistakes

@homestills
homestills force-pushed the fm/fleet-sync-narrow-identical-squash-recovery branch from 94a6274 to 018b4f7 Compare July 30, 2026 20:26
@homestills
homestills force-pushed the fm/fleet-sync-narrow-identical-squash-recovery branch 2 times, most recently from b34e7c8 to 2113f70 Compare July 30, 2026 22:31
@homestills

Copy link
Copy Markdown
Author

Hi @kunchenguid — the latest version of this PR is awaiting maintainer approval to run the Require no-mistakes and CI workflows. When you have a chance, could you approve those workflow runs and review the PR? Thank you!

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