Skip to content

Rebuild commits that change files still leave the laptop's main ahead and behind at once #12520

Open

Description

@dezren39

pm-git-sync now moves empty rebuild marker commits aside when they block the pull (code#12515). It deliberately refuses when a commit only the clone has changes a file, and lib/rebuild-full.sh and lib/rebuild-simple-script.sh do git add flake.lock before the marker commit, so a rebuild that updates inputs leaves exactly such a commit. With merges landing all day, origin/main has nearly always moved by then, the clone is ahead and behind at once, and merged changes stop being deployed until someone repairs it by hand.

Also: when that happens nothing tells anyone. On 2026-11-22 the clone sat two hours and 28 merges behind. pm-git-sync.service was failing every 30 seconds and it showed only in the journal.

Wanted:

  1. A rebuild's flake.lock change reaches main without diverging the clone: the rebuild commits it on a branch and opens a pull request, or the hourly keeper (nixos/home/laptop-repo-keeper.sh) does that for a commit it finds on a diverged main. The marker itself can stay a tag.
  2. A pm-git-sync that has failed for more than a few minutes raises the console's "A unit failed" notification (check that the unit is in the console's service list, and that a oneshot that fails on every run counts as failed there).

Filed from the session that put the console on the edge (code#12505, #12511, #12515, #12517).

Activity

  1. developing-today commented on Nov 22, 2026

    @developing-today
    Contributor
  2. dezren39 commented on Nov 22, 2026

    @dezren39
    MemberAuthor

    agent-note:v1
    state: picked_up
    task: 21031
    lane: oc-code-04
    stage: claimed

    Claimed queue task 21031 and revalidated the issue as OPEN with no hold labels. Related PRs #12505, #12511, #12515 and #12517 are MERGED; none satisfies the remaining requested behavior. I am triaging scope and routing it as real follow-up work.

  3. dezren39 commented on Nov 22, 2026

    @dezren39
    MemberAuthor

    agent-note:v1
    state: triaged
    task: 21031
    lane: oc-code-04
    stage: verified

    Triage verdict: real and current; not fully satisfied by merged work. The requested outcomes are two separable workstreams: (1) preserve rebuild-generated flake.lock changes without leaving laptop main diverged, by moving the commit to a branch/PR (including keeper handling of already-diverged main); (2) surface sustained pm-git-sync failures through the PM console notification path, verifying service-list coverage and oneshot failure semantics. These are not a safe small fix under this triage lease. Return #12520 for real work sized to split/sequence these tracks. Related PRs #12505, #12511, #12515, #12517 are merged; none implements these remaining outcomes.

  4. added
    triage/real-and-currentTriage verdict: issue is real and current; returned to queue for real work
    status/triagedTriaged and routed (see agent note)
    status/readyTriaged and ready for queued implementation work
    and removed
    queue/claimedQueue worker lifecycle state
    work/assignedQueue worker lifecycle state
    on Nov 22, 2026
  5. dezren39 commented on Nov 22, 2026

    @dezren39
    MemberAuthor

    agent-note:v1
    state: done
    task: 21031
    lane: oc-code-04
    stage: triaged

    Queue triage task completed as triaged. The issue remains OPEN with status/ready and triage/real-and-current so the distinct implementation tracks can be sized and queued. Follow-on queue task: 21034.

  6. dezren39 commented on Nov 22, 2026

    @dezren39
    MemberAuthor

    agent-note:v1
    state: blocked
    task: 21034
    lane: oc-code-04
    stage: packet_defect

    Follow-on task 21034 was generated from triage task 21031 but is materially unusable as an implementation packet: it is labeled small_fix while its problem and acceptance still only request triage (“either do it or return it to the queue”), and #12520 contains two separate, multi-surface outcomes (rebuild/keeper divergence handling and sustained pm-git-sync failure notification). No single bounded change, concrete implementation scope, or targeted test oracle is specified. I am not improvising an implementation. Repair the packet by splitting/scoping those tracks, or enqueue the appropriate sized work with explicit acceptance and tests. Issue remains OPEN; no code changes.

  7. added
    queue/blockedQueue or user escalation state
    status/blockedQueue or user escalation state
    and removed
    queue/claimedQueue worker lifecycle state
    work/assignedQueue worker lifecycle state
    on Nov 22, 2026
  8. dezren39 commented on Nov 23, 2026

    @dezren39
    MemberAuthor

    Status, and the issue narrowed to the one part that is left.

    Done: the failure is no longer silent (#12719). A unit that runs on a timer, pm-git-sync included, is reported once it has failed run after run for five minutes ("A unit keeps failing", with what the unit is for), and again when it mends. The edge counts too, so the report arrives when the app is served from Cloudflare. Also #12715: /console/health on the Worker now gives hostVersion, the commit the laptop's console runs, so a laptop that has stopped taking merges can be seen from anywhere.

    Left: one outcome. A rebuild that changes flake.lock commits it on the laptop clone's main (lib/rebuild-full.sh, lib/rebuild-simple-script.sh). When origin/main has moved, the clone is ahead and behind at once and pm-git-sync rightly refuses to move a commit that changes a file.

    Suggested shape, chosen so the laptop's tree never loses the lock it was built from:

    • nixos/home/laptop-repo-keeper.sh, when the deploy clone is clean, ahead and behind: push the local commits to rebuild/<host>-<short hash> on origin (same credentials it already pushes main with; the name makes a second push a no-op). Do not move local main.
    • A workflow on pushes to rebuild/**: open a pull request to main; if the diff is flake.lock alone, merge it with a merge commit.
    • Once merged, the local commit is an ancestor of origin/main, so pm-git-sync fast-forwards by itself. Nothing is reset and nothing is tagged.

    Acceptance: in laptop-repo-keeper.test.sh, a clone with one commit changing flake.lock and an origin that has moved ends the run with that commit on rebuild/<host>-<hash> at origin and local main untouched; a second run pushes nothing new; a dirty tree pushes nothing. Then, on the laptop, one real rebuild with a lock change reaches main without a hand.

    Why it was not done with the rest: the keeper runs from the Nix store and takes effect at a rebuild, and the session that did the other parts could no longer run anything on the laptop to try it.


    Generated by Claude Code

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    queue/blockedQueue or user escalation statestatus/blockedQueue or user escalation statestatus/readyTriaged and ready for queued implementation workstatus/triagedTriaged and routed (see agent note)triage/real-and-currentTriage verdict: issue is real and current; returned to queue for real work

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions