GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — fix(pm-git-sync): move empty rebuild markers aside instead of stalling by dezren39 · Pull Request #12515 · developing-today/code

Conversation

@dezren39

@dezren39 dezren39 commented Nov 22, 2026 •
edited by coderabbitai Bot
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member

Why

On 2026-11-22 the laptop's checkout stopped following main for two hours: 28 merges were not deployed, and nothing said so. A system rebuild had left an empty marker commit (amd 569) on the clone's main; origin/main had moved as well, so the clone was ahead and behind at once, and pm-git-sync only ever fast-forwards. It was unstuck by hand (the marker kept under a tag, main moved to origin/main), the same repair as #2496.

Every rebuild leaves such a marker (lib/rebuild-*.sh), and with merges landing all day the clone is almost always behind by the time it does. So this recurs.

What changes

pm-git-sync now does that repair itself, only in the case where nothing can be lost:

  • If the clone is ahead and behind, and every commit only it has is empty and not a merge, each is kept under a tag rebuild-marker/<subject> (its own short hash if that name is taken by another commit) and main is moved to origin/main with git reset --keep.
  • A local commit that changes a file, or a merge, still fails loudly. The check runs over all local commits before the first tag is written, so a refusal moves and tags nothing.
  • A marker that blocks nothing (origin has not moved) is left where it is; the hourly keeper pushes it, as before.

Checks

  • New suite pm-git-sync-markers.test.sh (added to pm-stack-tests.yml): ahead only; two markers with origin moved; a name already taken; a subject that is not a valid ref name; a commit with a file change beside an empty one; a local merge.
  • Seven planted faults in the new branch (empty check dropped, merge check dropped, tag overwritten, moved when only ahead, no tag written, main not moved, refusal after tagging): each caught.
  • The existing quarantine suite still passes. shfmt, shellcheck clean.

Takes effect

At the next system rebuild: the unit runs the packaged copy (pkgs/pm-git-sync, now 0.3.0). That rebuild's own marker is the first one the new copy will meet.


Generated by Claude Code


Proof this PR
Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.

Summary by CodeRabbit

  • New Features
    • Git sync now handles local, empty rebuild-marker commits when the remote branch has advanced, preserving them as markers while bringing the branch up to date.
  • Bug Fixes
    • Sync stops without changing repository state when local-only commits contain file changes or are merge commits, rather than treating them as rebuild markers.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

chatgpt-codex-connector[bot] reacted with thumbs up emoji
All reactions
  • 👍 1 reaction
@claude
fix(pm-git-sync): move empty rebuild markers aside instead of stalling
c37256b
A system rebuild leaves an empty "<host> <generation>" commit on the
laptop clone's main and does not push it. Once origin has moved too,
main is ahead and behind at once and the fast-forward-only sync can
never pull again: on 2026-11-22 the laptop sat two hours and 28 merges
behind with nothing deployed.

When every commit only the clone has is empty and not a merge, each is
kept under a tag rebuild-marker/<subject> and main is moved to
origin/main. A local commit that changes a file, or a merge, still
fails loudly and nothing is tagged or moved. A marker that blocks
nothing (origin unmoved) is left for the hourly keeper to push.

Seven planted faults in the new branch are each caught by the new
suite. Takes effect at the next system rebuild: the unit runs the
packaged copy.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
Claude-Session: https://claude.ai/code/session_01YLT5K1QVuzZjfWGFhXSSNF
@dezren39
dezren39 requested a review from a team as a code owner November 22, 2026 11:52
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 22, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-22T11:59:26.122416Z 4ec6de7 New commits
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@coderabbitai

coderabbitai Bot commented Nov 22, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown

Explain Change →

Caution

Review failed

The pull request is closed.

Walkthrough

When main has diverged from origin/main, the sync script checks local-only commits. It tags commits that are single-parent and have unchanged trees, then moves main to origin/main. A Bash test suite covers this behavior and runs in the workflow.

Changes: Git sync rebuild markers

Layer / File(s) Summary
Validate and preserve rebuild markers
pm-stack/scripts/pm-git-sync.sh, pkgs/pm-git-sync/package.nix
The script validates local-only commits before creating tags. It refuses merges and commits that change files. For eligible commits, it creates rebuild-marker/ tags and resets main to origin/main. The package version changes from 0.2.0 to 0.3.0.
Test and run marker handling
pm-stack/scripts/pm-git-sync-markers.test.sh, .github/workflows/pm-stack-tests.yml
The test suite checks marker handling, tag collisions, unusual subjects, refusal cases, and repository state. The workflow runs the suite.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Change: Bug fix

Sequence Diagram(s)

sequenceDiagram
  participant Sync as pm-git-sync.sh
  participant Local as Local Git repository
  participant Origin as origin/main
  Sync->>Local: Inspect local-only commits
  Local-->>Sync: Commit parents and tree state
  Sync->>Local: Create tags for eligible commits
  Sync->>Local: Reset main to origin/main
  Origin-->>Local: Provide origin/main target
Loading

Suggested reviewers: claude

Merge Risk: Low · up to c3725

The change lets pm-git-sync move empty rebuild-marker commits aside under tags instead of stalling when main has diverged from origin/main. In a narrow case, where a fallback tag name is already taken by a different commit, the script overwrites that tag and the earlier marker loses its preservation reference. The loss is limited to empty marker commits, so the change is mergeable with owner awareness. A small guard before writing the fallback tag would remove the gap.

- [ ] Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

  • X
  • Mastodon
  • Reddit
  • LinkedIn
All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

chatgpt-codex-connector[bot]
chatgpt-codex-connector Bot reviewed Nov 22, 2026
View reviewed changes

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: c37256b495

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread pm-stack/scripts/pm-git-sync.sh
echo "pm-git-sync: kept empty commit $(git log -1 --format='%h "%s"' "$commit") under tag $tag"
done < <(git rev-list --reverse origin/main..HEAD)
# --keep refuses to touch a file with local changes; there are none.
if ! git reset --quiet --keep origin/main || [ "$(git rev-parse HEAD)" != "$remote" ]; then

@chatgpt-codex-connector chatgpt-codex-connector Bot Nov 22, 2026

Copy link
Copy Markdown

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Guard the reset against a concurrently changed HEAD

If a rebuild commits to this checkout after the validation and tagging snapshots, this reset removes the new commit from main without checking or preserving it. This can overlap with normal operation: nixos/services/pm-stack/default.nix:597–602 schedules sync every 30 seconds, while lib/rebuild-simple-script.sh:31 commits in the checkout without coordination. A completed commit leaves clean files, so --keep does not protect it (git reset -h describes it as “reset HEAD but keep local changes”); the previous pull --ff-only would instead refuse the divergence. Coordinate with writers or atomically ensure that the branch being replaced still points to the validated commit before moving it.

Useful? React with 👍 / 👎.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@dezren39 dezren39 Nov 22, 2026

Copy link
Copy Markdown
Member Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Real, and worth closing even though the window is short. Fixed in the next commit: main is moved only if it is still where it was when its commits were examined (otherwise nothing is moved and the next run looks again), and a commit that lands between that look and the move is kept under rebuild-marker/unexpected-<hash> with a loud failure, so it is never left reachable only from the reflog. Both windows are tested with a stand-in git that commits mid-run; three planted faults in the guard are each caught.


Generated by Claude Code

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@claude
fix(pm-git-sync): never lose a commit that lands while main is moved
4ec6de7
A rebuild commits in the checkout without coordinating with the sync.
Main is now moved only if it is still where it was when its commits
were examined, and a commit that lands in the instant between that look
and the move is kept under a tag and reported, instead of being left
reachable only from the reflog.

Both windows are tested with a stand-in git that commits mid-run.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
Claude-Session: https://claude.ai/code/session_01YLT5K1QVuzZjfWGFhXSSNF
@dezren39
dezren39 merged commit fe428de into main Nov 22, 2026
@dezren39
dezren39 deleted the claude/pm-git-sync-markers branch November 22, 2026 11:58
This was referenced Nov 22, 2026
pm-console edge: do queue and GitHub operations from Cloudflare while the laptop is away #12518
Open
pm-console: a phone linked on one side is unknown to the other after an edge on/off change #12519
Closed
Rebuild commits that change files still leave the laptop's main ahead and behind at once #12520
Open
pm-console edge: limit the report endpoint, keep the Android build at the edge, deploy by the repo's cf flow #12521
Closed
docs(planning): record the console's move to the edge and what is left #12522
Merged
feat(pm-stack): serve the PM app from the edge; the laptop becomes a worker behind it #12505
Merged
plan: results first — priorities and order of work (2026-11-21) #12238
Open
@dezren39 dezren39 added the audit:no-issue No spawning issue; judged on stated intent label Nov 24, 2026
@dezren39 dezren39 mentioned this pull request Nov 24, 2026
AUDIT-7 Lane 4 — MERGED-PR-AUDIT: merged PRs since 2026-10-23 vs their spawning issues #13879
Open
@developing-today-fleet developing-today-fleet Bot mentioned this pull request Nov 27, 2026
Stray work audit: PRs and issues not tied to a design or roadmap item #13874
Open
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@chatgpt-codex-connector chatgpt-codex-connector[bot] chatgpt-codex-connector[bot] left review comments

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

audit:no-issue No spawning issue; judged on stated intent

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

2 participants

@dezren39 @claude
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.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.