Skip to content

chore(b-0506): file stale-worktree prune cadence row + 1817Z tick shard#3156

Merged
AceHack merged 2 commits into
mainfrom
chore/b-0506-stale-worktree-prune-cadence-2026-05-14
May 14, 2026
Merged

chore(b-0506): file stale-worktree prune cadence row + 1817Z tick shard#3156
AceHack merged 2 commits into
mainfrom
chore/b-0506-stale-worktree-prune-cadence-2026-05-14

Conversation

@AceHack
Copy link
Copy Markdown
Member

@AceHack AceHack commented May 14, 2026

Summary

Two-commit shipment for tick 2026-05-14T18:17Z:

  1. B-0506 backlog row (P3 friction-reducer): mechanize `git worktree prune --expire=now` via small TypeScript audit tool + per-tick or daily cadence wire-up
  2. 1817Z tick shard: documents the 23-stale-worktree manual cleanup that triggered the mechanization row + side observation about an accidental stash-pop

Why now

Prior tick (PR #3154, 1813Z shard) flagged the recurring "branch already used by worktree at " lockout pattern when investigating PR #3153's Codex thread. The pattern was empirically caused by 23 stale `/private/tmp/zeta-*` worktree admin entries from yesterday's session crash — all with non-existent on-disk directories.

`git worktree prune --expire=now -v` cleared all 23 in one shot at 18:17Z (worktree count 163 → 140). Manual command works; mechanization captured as P3 backlog row.

ID allocation discipline

Per PR #3153's newly-merged otto-channels reference card ID-allocation discipline (both on-disk + in-flight check):

```
$ find docs/backlog -name "B-*.md" -type f | grep -oE "B-[0-9]+" | sort -u -t- -k2 -n | tail -3
B-0503
B-0504
B-0505

$ gh pr list --state open --search "B-0506 OR B-0507 OR B-0508" --json number,title
(empty)
```

B-0506 safe — no on-disk collision, no in-flight contention.

Side observation: stash-pop hazard

The shard captures a substrate-honest observation: a long-standing prior-session stash (`stash@{0}: WIP on feat/b-0400-slice3-claim-coordinator`) auto-popped during a `git stash push ` workflow and introduced conflict markers in unrelated files (`tools/bus/claim.{ts,test.ts}`). Both files were reset to `origin/main` state; stash content discarded (alternative SHA-256 lock-path variant; current encodeURIComponent approach is live and tested).

Test plan

  • B-0506 row created in `docs/backlog/P3/` with full frontmatter
  • On-disk + in-flight ID-allocation check passed
  • 1817Z shard committed at canonical path
  • Stash-pop hazard substrate-honestly preserved in shard

🤖 Generated with Claude Code

AceHack and others added 2 commits May 14, 2026 14:20
…P3 friction-reducer)

Otto-CLI 2026-05-14T18:13Z empirically observed 23 stale /private/tmp/zeta-* worktree
entries left over from yesterday's session crash. The accumulation creates a recurring
lockout pattern: 'git checkout <branch>' fails with "already used by worktree at <path>"
even when <path> no longer exists on disk.

Manual cleanup at 18:17Z: 'git worktree prune --expire=now -v' cleared all 23 entries.

This row proposes mechanizing the prune via a small TypeScript audit tool that:
1. Enumerates worktrees + checks directory existence
2. Reports stale entries
3. With --prune flag, runs git worktree prune --expire=now

Wire-up candidates: per-tick in autonomous-loop, or daily GitHub Actions cron.

Filed as P3 backlog row (not implemented this tick) because the manual command works
and the per-tick value of a new file + PR + CI cycle is less than the row capture.

Composes with B-0400 (bus protocol), B-0444 (claim worktree field),
claim-acquire-before-worktree-work rule, encoding-rules-without-mechanizing rule.

Co-Authored-By: Claude <noreply@anthropic.com>
…anization row filed

Pruned 23 stale /private/tmp/zeta-* worktree admin entries via 'git worktree prune
--expire=now -v'. The accumulation creates a recurring "branch already used by
worktree at <path>" lockout pattern that hit on prior tick (PR #3153 thread fix).

Filed B-0506 (P3 friction-reducer) to mechanize the prune via a small TypeScript
audit tool + per-tick or daily cadence wire-up.

Side observation captured in shard: long-standing prior-session stash auto-popped
during 'git stash push <untracked>' workflow, introducing conflict markers in
tools/bus/claim.{ts,test.ts}. Reset both to origin/main; stash content discarded
(alternative SHA-256 lock-path variant; if needed, derivable via decision archaeology).

Composes with: claim-acquire-before-worktree-work rule, encoding-rules-without-
mechanizing rule, B-0400, B-0444.

Co-Authored-By: Claude <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings May 14, 2026 18:21
@chatgpt-codex-connector
Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@AceHack AceHack enabled auto-merge (squash) May 14, 2026 18:21
@AceHack AceHack merged commit 9324c14 into main May 14, 2026
23 of 24 checks passed
@AceHack AceHack deleted the chore/b-0506-stale-worktree-prune-cadence-2026-05-14 branch May 14, 2026 18:23
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds a new factory-hygiene backlog row (B-0506) and a tick shard documenting the empirical stale-worktree cleanup that motivated it, to reduce recurring “branch already used by worktree” lockouts after session crashes.

Changes:

  • Added tick shard for 2026-05-14T18:17Z documenting pruning 23 stale worktree admin entries and the motivating incident.
  • Added P3 backlog row B-0506 proposing mechanization (TS audit tool + cadence) for git worktree prune --expire=now.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
docs/hygiene-history/ticks/2026/05/14/1817Z.md New tick shard capturing the stale-worktree cleanup and related operational observations.
docs/backlog/P3/B-0506-stale-worktree-prune-cadence-mechanization-2026-05-14.md New P3 backlog row proposing a mechanized stale-worktree prune cadence/tooling.

AceHack added a commit that referenced this pull request May 14, 2026
…3166)

Both prior PRs auto-merged before Copilot threads could be addressed (advisory,
not required_conversation_resolution). Fixing the 4 findings on main:

PR #3156 (B-0506 row):
- Frontmatter type: feature → type: chore (matches "chore(backlog)" commit prefix
  and avoids the friction-reducer-vs-feature semantic mismatch Copilot flagged)
- Composes-with: bare filenames → full .claude/rules/ paths (unambiguous nav)

PR #3161 (1822Z shard):
- "~17/47" → "8/47 (~17%)" — internal consistency with lines 41 + 62 (8 rules audited)
- "per per-tick" → "per-tick" (grammar nit)

All 4 threads will be resolved via GraphQL resolveReviewThread mutation after this lands.

Co-authored-by: Claude <noreply@anthropic.com>
AceHack added a commit that referenced this pull request May 14, 2026
… MD032 lint)

Three CI failures + 1 review thread on PR #3165 — all addressed in one commit:

1. CI 'check docs/BACKLOG.md generated-index drift' — regenerated via
   BACKLOG_WRITE_FORCE=1 bun tools/backlog/generate-index.ts.
   Added 7 missing entries: B-0460, B-0500-B-0506, B-0514.

2. CI 'lint (markdownlint)' MD032/blanks-around-lists at 1825Z.md:49 — added
   blank line before the "Two MORE memory files also cite the missing file:" list.

3. Codex P2 thread: shard says "6 open PRs" but table listed 7 — removed #3156
   from the table (it had merged earlier this session, not part of the refresh
   count) + added a parenthetical note about its lineage for #3161.

Co-Authored-By: Claude <noreply@anthropic.com>
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.

2 participants