Skip to content

feat(worktree)!: keep worktree records beside git, drop the global store - #44

Merged
gold-silver-copper merged 2 commits into
mainfrom
feat/stateless-worktrees
Oct 26, 2026
Merged

gold-silver-copper merged 2 commits into
mainfrom
feat/stateless-worktrees

Conversation

@gold-silver-copper

Copy link
Copy Markdown
Contributor

Updates the meta-worktree skill: where records live, what remove/prune check, prune's scope, strict-mode rollback.

Part of gitkb/meta#126, which has the full description, the investigation and how it was verified. Merge together with it (same branch name, so CI builds them together).

Implements [[tasks/harmony-2765]]

@coderabbitai

coderabbitai Bot commented Oct 26, 2026 •

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: ASSERTIVE
  • Plan: Advanced
  • Run ID: eea5b5d8-937b-4d83-9a64-b99aadefa899
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Comment @coderabbitai help to get the list of available commands.

meta recorded every worktree set in ~/.meta/worktree.json behind
worktree.lock. Each linked worktree meta creates now gets a record in
git's own admin directory for it (<repo>/.git/worktrees/<id>/meta-worktree.json),
which git deletes with the worktree. remove and prune prove ownership
from those records; list reads TTL, ephemeral and custom metadata from
them; prune finds sets under the worktree root and through the records
in the workspace's repositories. The store, its lock and the lock module
are deleted.

Sets created by an older meta have no record: remove and prune refuse
them, as they refused unrecorded sets before.

Implements [[tasks/harmony-2765]]
… live record

- add, list and prune read records through one check (member_record),
  so a record outside <repo git dir>/worktrees is never copied or used
- a worktree git has locked blocks removal up front
- prune decides with the record the set's own worktrees hold and needs
  the removal check to see that same record; an orphaned-repos verdict is
  re-checked with every repo the full scan finds; records it cannot read
  are reported as kept (so --strict fails); forgetting a missing set
  deletes only the records prune read

Refs [[tasks/harmony-2765]]
@gold-silver-copper
gold-silver-copper merged commit 4e14f71 into main Oct 26, 2026
7 checks passed
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