Skip to content

pm-git-sync stalled 2026-11-08→10: queue lanes worked directly in the primary clone and a stale worktree squatted the main branch #8170

Closed

Description

@dezren39

What happened

pm-git-sync.service (user unit, 30s timer) failed every run from 2026-11-08 until fixed 2026-11-10 ~09:00 CST. The service itself was healthy and behaving exactly as designed — it refuses to pull unless ~/git/code is on a clean main. The clone was neither:

  1. A queue lane worked directly in the primary clone. ~/git/code sat on branch queue/13790-5954-deploy-smoke-fixture (checked out 2026-11-08 16:43 CST, one commit 9d7f54f, also pushed to origin under the same branch name) with uncommitted WIP edits across 9 tracked files (claimant, fleet-paperwork, mcpx; all stamped 2026-11-09 21:31:21) plus untracked files (incl. a whole nested checkout base-agg/). Because the sync was stalled, merged config had to be written into the live OpenCode config by hand during the 2026-11-10 deploy (PRs routes: workhorse-weighted Luna #xhigh seat switches to Terra #low #8162/routes: workhorse-weighted Gemini 3.8 Flash seat drops #high to #medium #8164).
  2. A stale lane worktree squatted main. ~/git/fleet/12652-main held the main branch checked out (same commit as ~/git/fleet/12652 and 12652-3939-quota-uninstrumented), so even after cleaning, git checkout main in the primary clone was refused. Its apparent dirt was stale-base drift (Nov 8 base), not unique work.

Fix applied (2026-11-10)

  • All dirt preserved first: ~/git/code-dirt-rescue-2026-11-10/ on the laptop (tracked patch, two copies of every untracked file, 12652-main full diff + status, README). The opencode.jsonc edit was already byte-identical to origin/main; the remaining edits are stale-base versions of files that moved substantially on main since — recoverable from the rescue dir if any lane still needs them.
  • Clone restored to clean main; stale worktree removed; sync restarted. Proof: one full cycle pulled 436 commits (1e46b89 → 68dda49), restarted pm-projector + pm-dispatch, exit 0; follow-up timer run: ok clean main, up to date. HEAD == origin/main == 68dda49; live config byte-identical to main.

Prevention gap (the ask)

Lane/worker setup must never check out a branch or edit files in the primary clone (~/git/code), and must not create worktrees that hold main. Options: lane launcher refuses to start when its working dir resolves to the primary clone; a periodic check that no registered worktree holds main; pm-git-sync could also page louder than a journal FAIL when stalled >1h. Acceptance: a lane attempting to work in ~/git/code is stopped or redirected to a worktree, and a main-holding worktree raises a visible alert within one sync cycle.

Activity

  1. developing-today commented on Nov 10, 2026

    @developing-today
    Contributor
  2. added this to the PM stack coherence milestone on Nov 12, 2026
  3. dezren39 commented on Nov 14, 2026

    @dezren39
    MemberAuthor

    🤖 Agent note · state

  4. dezren39 commented on Nov 14, 2026

    @dezren39
    MemberAuthor

    Dirt cleared under Drew's order — full accounting (2026-11-14)

    Drew's ruling (2026-11-14 02:52 CT, main chat): "commit or something" — the fleet was authorized to preserve the primary clone's foreign dirt and restore a clean main. This is the second occurrence of the #8170 pattern (first: 2026-11-08→10).

    Preservation (before anything was touched)

    • Full patch (git status + staged diff + unstaged diff): ~/git/primary-dirt-2026-11-14.patch on the laptop — 175,224 bytes, sha256 1eb64b0e55295a65b051779dffb4c2a6b0a73160c2dc670930a5376015147746.
    • Untracked files copied to ~/git/primary-dirt-2026-11-14-untracked/ (4 files: pm-stack/aggregator/playwright.config.ts, test/browser/mobile-work-view.spec.ts, test/latest-comments-9781.test.ts, test/program-prime-5082.test.ts). Nothing was discarded silently; the whole pre-reset state is recoverable from the patch + copies.

    What the dirt was (primary sat at 7535eba, 174 commits behind origin/main)

    1. pm-stack/aggregator — 31 modified tracked + 4 untracked. A lane session's work done in the primary against the stale base. Per-file hash comparison against origin/main: 28 modified files and all 4 untracked files are byte-identical to origin/main — the work already landed through proper PRs. The remaining 3 (scripts/collect-fleet-feed.ts, src/render.ts, src/sources/live.ts) are older stale-base versions; origin/main carries newer versions of the same work (the default-paths refactor, the "Repo file" badge, the pm dashboard /roadmap: integrate the repos' own roadmap files (ROADMAP.md, planning/roadmaps/*.md) alongside the Grist table #1738 repo-roadmap merge, latest-comments pm-aggregator: /program + /board stall ~8.2s and /program 503s when the projector is slow — briefs latest-comments fan-out is uncached with an 8s abort cliff #9781). Nothing unique to the worktree.
    2. Nix wiring — staged only (lib/default.nix, nixos/home/laptop-backups.nix, + laptop-state-backup.sh/.test.sh added). The staged state contained unresolved merge-conflict markers from refs/tmp/pr7188 — a conflicted merge state staged into the primary's index. The two staged scripts are byte-identical to the copies that landed cleanly on origin/main; the conflicted wiring was superseded by that clean landing. The worktree had already reverted these files to HEAD content, so the net worktree state equalled HEAD — index noise only.
    3. Committed separately: nothing. No coherent unlanded work existed in the dirt — every hunk was already on main, superseded by main, or conflict-marker garbage of work that landed cleanly. "Commit or something" resolved to the "or something": full preservation, then reset.

    Restore + verification

    • Primary hard-reset to origin/main: HEAD == origin/main == 28955acdf867df227cc36df0af63897fc417f711; git status = 0 lines, working tree clean.
    • pm-git-sync verified healthy and self-running: the 02:54:21 CST cycle raced the reset and failed on the last untracked files; the 02:54:55 and 02:55:24 cycles both report pm-git-sync: ok clean main, up to date at 28955acd..., Result=success, timer firing on its ~30s cadence. The aggregator deploy path (clean main → subtree-change redeploy) is unblocked.

    Closing note

    Closing on the deploy-path criterion: the clone is clean, current, and syncing. Recorded for honesty: the prevention acceptance in this issue's body (a lane attempting to work in ~/git/code is stopped or redirected; a main-holding worktree raises a visible alert) is not implemented — this recurrence happened under the same conditions as the first. If that guard is still wanted, it deserves its own tracked issue rather than dying inside this close.

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

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions