slop worktrees experiment... don't review... or look at... - #14789
Draft
Caleb-T-Owens wants to merge 20 commits into
Draft
slop worktrees experiment... don't review... or look at...#14789Caleb-T-Owens wants to merge 20 commits into
Caleb-T-Owens wants to merge 20 commits into
Conversation
- FeatureFlags.worktree_manipulation (settings.json-only, like tui_file_browser) - worktree_meta DB table keyed by git worktree name (BLOB, stable across 'git worktree move' unlike paths) with an archived flag - regenerated SDK types Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
- init::Options.worktree_tips: caller-resolved (ref, fallback id) pairs, re-resolved through the ref-store overlay on every (re)traversal, appended after all other initial work and deduped by commit id - but-ctx: Context::active_worktrees() enumerates linked worktrees, reconciles the worktree_meta table (first-ever read archives pre-existing worktrees), and workspace_from_head seeds the graph when worktreeManipulation is on Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Checkout::Worktree entries are recorded at editor creation for every branch checked out in a worktree named by the graph's worktree_tips - so the gating and archived-filtering decided at graph-seeding time (worktreeManipulation flag) carries over to checkouts with no per-call-site threading. Worktree checkouts run before the Head checkout, never allow conflicted trees into plain worktrees, and degrade to a warning (stale checkout, today's behavior) when a worktree is broken. WorktreeTip gained the worktree name to carry the allowlist on the graph. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Editor::create records every ref carrying a not-owned-by-repo worktree annotation (independent of the feature flag), and the rebase ref-deletion pass skips them - mirroring git's own refusal to delete a checked-out branch. This centrally covers upstream integration's integrated-ref cleanup and its review-hints Step::None path, plus every other editor op. Also: clarify worktree-tip ref-resolution docs and make the detached-HEAD fallback explicit in append_worktree_tips (review findings). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
but-workspace::worktrees: list_worktrees splits active (slim WorktreeStack with first-parent commits vs target via local_commits_for_branch) from archived (minimal DTO); set_worktree_archived; worktree_changes_by_name. but-api::worktrees (CLI-only): worktrees_list, worktree_set_archived, linked_worktree_changes - all gated on the worktreeManipulation flag. Review fixes in but-ctx reconciliation: - adopt ALL on-disk worktrees at first read, not just the usable subset - an adoption sentinel row persists the marker for zero-worktree projects - deleted checkout dirs (prunable) are reconciled but never active - zero-worktree repos skip the cwd-dependent realpath machinery - flag-off no-side-effects and flag-on seeding are now tested Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
- CliId::Worktree minted after all existing allocations (id stability), in both IdMap construction paths, sorted by name; parseable by chip or worktree name; explicit eq/same-entity arms (wildcard sites the compiler can't force) - status renders active worktrees as branch-style groups after stacks with the path relativized to the main workdir; JSON gains a worktrees field (absent when the flag is off - byte-identical output) - but worktree archive|unarchive <id|name>, resolved via IdMap, calling the new but-api; legacy worktree subcommands untouched - flag-off regression gate: all 493 CLI integration tests unchanged Also fix a clippy filter_map_bool_then deny from the Stage 4 commit. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
but worktree amend <name> <commit> [--changes paths]: reads DiffSpecs from the worktree's own repository (objects land in the shared ODB, so the editor's in-memory repo sees them), amends via the factored commit_amend engine, and keys the resulting merge-base override to that worktree's Checkout::Worktree so the consumed hunk cancels out of its checkout instead of duplicating. When the worktree's tip doesn't move (target lives elsewhere), a post-materialize discard_workspace_changes on the worktree removes the now-committed hunk - only after commit and refs are durable, gated on tip-unchanged, with unmatched specs warn-logged rather than clobbered. Worktree branches are made mutable via extra_mutable_refs from the graph's worktree tips; without this the branch ref would silently never move. Oplog snapshotting deferred (documented on the command). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
- worktree matches no longer make priority-less or branch-name resolution ambiguous when a worktree shares its branch's name (the canonical state): try_resolve_cli_id and push/land/unapply/squash drop worktree matches when anything else matched; a sole worktree match keeps its kind error - worktree chips are derived from the worktree name (like branch short ids) and names are reserved in the allocator - chips no longer shift with the uncommitted-file set (silent wrong-target archive) and a worktree named like a chip can't shadow allocated ids - same_entity_for_reload got its Worktree arm: TUI cursor survives reloads and jump-to-worktree works on worktree rows - the per-worktree commit walk is capped at 25 and decode failures truncate that worktree's list with a warning instead of failing status Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Caleb-T-Owens
force-pushed
the
claude/worktree-implementation-c6db3f
branch
from
July 15, 2026 19:09
4b604f6 to
52444ef
Compare
- amending into an immutable commit fails fast instead of silently no-opping - previously the worktree discard fallback then DELETED the changes it believed were committed (data loss) - the whole-file discard fallback content-verifies each file against its pre-amend hash and leaves mid-operation edits in place (warn + skip), making the never-loss invariant hold for whole-file specs - amends whose rebase would leave a worktree tip conflict-encoded are refused before materializing (plain git worktrees have no conflict UI) - materialize_without_checkout now runs worktree checkouts too - its contract only exempts the editor's own worktree - but worktree amend resolves worktree-only commits via rev-parse - worktree chips never collide with change-id chips and the no-window fallback is a deterministic name-seeded probe (no more migration when the uncommitted-file set changes) Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Caleb-T-Owens
force-pushed
the
claude/worktree-implementation-c6db3f
branch
from
July 15, 2026 19:28
52444ef to
b00bdb6
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
The commits say "Caleb and claude"... that is a lie. It's all claude...