Repository navigation
Key picker previews by canonical row identity - #3926
Conversation
Detached worktrees at the same commit previously shared a preview cache entry. Add typed Git and picker row keys, and resolve each worktree identity once during list collection so picker rendering does not recanonicalize paths.
worktrunk-bot
left a comment
There was a problem hiding this comment.
Reviewed through 4c20fc3, which landed while I was reading — it's test-only, and it targets exactly the lines codecov/patch was red on at a4c2baa (98.11% vs a 98.14% target). Worth separating the two things that were tangled together there, because the number moving doesn't settle the substance.
The detached_commit family is unreachable from production, and 4c20fc3 covers it rather than removing it. BranchRef::key() has no caller outside its own unit test: every production site builds a BranchRefKey directly — BranchRefKey::worktree(...) in collect, local_branch/remote_branch in new_branch_with_scope, worktree in reclassify_as_worktree — which also strands the private BranchRefKey::full_ref constructor. And reclassify_as_branch's only production caller is build_morph_branch_row, reached solely through worktree_removal_keeps_branch(...) -> Some(branch) in AltXRemover::apply; a detached worktree has no branch to keep, so it takes the drop path and the (_, None) arm can't fire. The new tests reach those lines by constructing states production doesn't produce (item.branch = None immediately before reclassify_as_branch, a BranchRef with neither full_ref nor worktree_path), so the coverage gap closes while the dead code stays — and CLAUDE.md → Code Quality asks for deletion or a // TODO(topic): marker instead. This doesn't warn today only because BranchRef is pub in the lib, and the repo takes no library-compatibility constraints. Two ways out that both leave the tests honest: delete key() + full_ref and give reclassify_as_branch an explicit branch parameter (which drops detached_commit with it), or give BranchRef::key() a real production caller — collect/execution.rs already builds BranchRef::from(wt), so routing identity through it there would exercise the method and retire the hand-rolled BranchRefKey::worktree(&wt.path) in collect.
One docstring asserts an invariant the code doesn't establish — inline, with a suggestion.
Separately, collect() returns anyhow::Result and picks up two .expect()s. Both invariants genuinely hold (sorted_worktrees is a permutation of worktrees, main_worktree is cloned out of the same inventory), so this is convention rather than a live panic — but CLAUDE.md → Error Handling says "Never .expect() / .unwrap() in a function returning Result", and these are the only two inside collect. Suggestions inline.
Worth a line in the description: switching is_main / is_current / the current-worktree sort priority from raw-vs-canonicalized path comparison to canonical-key equality is a real behavior change on symlinked checkouts. The old is_current compared canonicalize(wt.path) against the uncanonicalized stored path, so it could never match where the two differ (a macOS /var → /private/var checkout). It reads as a fix and the list snapshots would catch a regression, but it isn't mentioned.
Not approving. codecov/patch hasn't reported on 4c20fc3 yet and CLAUDE.md → Coverage treats it as a merge gate; and .claude/skills/running-tend/references/review-pr.md → "Data-Loss Surface: Hold for Human Review" covers a diff that edits a file containing the force-delete path — build_morph_branch_row sits inside alt-x's removal-morph flow in src/commands/picker/mod.rs. The picker edits are mechanical and can't widen what gets deleted; I'm naming the hold, not claiming a risk.
The regression test itself is the right shape — two detached worktrees at one commit with different working-tree state, asserting distinct keys and distinct rendered previews, so it fails on the old branch-name keying rather than just on the key type.
worktrunk-bot
left a comment
There was a problem hiding this comment.
5afc0b7 addresses all five threads, and each holds up: BranchRef::key() and the private full_ref constructor are gone along with BranchRefKeyKind::DetachedCommit; reclassify_as_branch now takes the branch from the removal plan (worktree_removal_keeps_branch's Some(branch)) rather than from the cloned row's display state, which is the stronger source; and both .expect()s in collect() propagate. cargo check --all-targets is clean at this head, so nothing the deletions stranded is warning-visible.
One artifact the deletion left behind, inline: ListItem::key()'s docstring still promises a SHA-keyed variant that no longer exists.
Outside the diff, same class — PrEntry::output_token in src/commands/picker/prs.rs still documents itself as "the preview-cache key prefix — git forbids : in ref names, so it can never collide with a worktree row's branch-name key". Neither half survives this PR: the cache keys on PickerRowKey, and a worktree row has no branch-name key. PickerRow's own output_token field doc was rewritten to say precisely that ("a user-facing address token, distinct from the typed preview key"), so the two now contradict each other. Happy to push that fix if you'd rather not respin for it.
Minor: the BranchRefKey bullet list in src/git/mod.rs still ends its last item with ;, where the deleted third bullet used to continue.
Not approving, for the two reasons already on the thread rather than anything new: the hold in .claude/skills/running-tend/references/review-pr.md → "Data-Loss Surface: Hold for Human Review" (the diff edits src/commands/picker/mod.rs, which carries the alt-x removal path), and codecov/patch hasn't reported on 5afc0b7 yet.
|
Verification
|
worktrunk-bot
left a comment
There was a problem hiding this comment.
The description names two types this commit renamed. It reads "adds BranchRefKey as the canonical local Git item identity and a typed PickerRowKey for local and PR rows" — at 5e5f7ca those are GitItemId and PickerRowId, and git grep BranchRefKey now returns nothing.
row_id's agreement with local.item is load-bearing and no longer enforced. Dropping DemandRequest.row_key and PreviewSubject moved every producer onto a key it derives itself — PickerRowId::local(&req.item) in serve_demand, and the same shape in spawn_preview / spawn_summary / seed_summary_hints — while every consumer still reads through PickerRow::preview_key() → self.row_id. They agree today only because on_skeleton builds both from one item. A later PickerRow whose row_id doesn't match its local.item would put writes and reads on different cache keys and strand the tab on its loading placeholder, with nothing failing loudly; the old threading made that a compile-time impossibility. The field's doc still describes the old arrangement ("shared by every preview producer and consumer"). Suggestion inline.
Same pattern elsewhere, outside the diff — statusline.rs. current_worktree_item canonicalizes to find the inventory entry (canonicalize(&wt.path).map(|p| p == worktree_root)), then computes is_home two lines below with a raw wt.path == p against primary_worktree(). That second comparison is exactly what this PR moved onto canonical identity in collect (is_main / is_current) and in resolve_worktree's @ arm, so on a symlinked checkout wt list and wt list statusline can disagree about which row is primary — the case the description calls out as fixed. The find above it is also the hand-rolled shape resolve_worktree just retired in favour of wt.id() == WorktreeId::new(&path). Happy to push both if you'd rather not respin.
Not approving, on a different basis than last round rather than a restatement: src/commands/remove.rs is now in the diff with changed target-planning logic, not just the picker file that carries the alt-x path, so .claude/skills/running-tend/references/review-pr.md → "Data-Loss Surface: Hold for Human Review" applies squarely. For what it's worth the change there only narrows what a run removes — aliases for one registered worktree collapse to a single plan, and NoWorktreeAtPath returns None from ResolvedWorktree::id() so an unregistered path still errors once per argument — but the rule is that an agent doesn't authorize a merge on this surface.
worktrunk-bot
left a comment
There was a problem hiding this comment.
test (windows) is red at this head, on the new test this commit adds — details inline. Everything else in the suite passed (4315/4316), and the three points from my last review all check out: the description now names WorktreeId/GitItemId/PickerRowId and matches git grep; PickerRowSubject makes the row key a derivation of the subject, so preview_key() and the demand worker's PickerRowId::local(&req.item) can no longer disagree — that's the stronger form of the docstring I asked for; and current_worktree_item now runs both the inventory lookup and is_home through WorktreeId, so wt list statusline and wt list agree on a symlinked checkout.
Two leftovers from the refactor, both outside the diff hunks so I can't suggest them inline — happy to push a commit for both if you'd rather not respin:
src/commands/picker/items.rs—LocalCheckout's docstring still describes the field this commit deleted: "present for local worktree and branch-only rows. A listed--prsrow carriesNone". There is nolocal: Option<LocalCheckout>any more; a--prsrow is aPickerRowSubject::ChangeRequest. The struct doc above it (subject) and the module header were both rewritten, so this is the one site left describing the old shape.src/commands/picker/prs.rs— inlisted_pr_row, therow_idlocal now has exactly one use (thepreview_cache.remove(&(row_id.clone(), PreviewMode::Pr))invalidation), since the struct literal builds its subject fromentry.pr_ref()directly. The.clone()is dead; the local can be inlined into theremovecall.
Not approving: test (windows) is terminally red, and separately the hold in .claude/skills/running-tend/references/review-pr.md → "Data-Loss Surface: Hold for Human Review" still applies (src/commands/remove.rs is in the diff with changed target planning). Nothing new on that second one — it was on the thread already.
Verification
- Windows failure:
test (windows)job —FAIL … test_switch_already_at_deep_path_preserves_history,Summary [545.387s] 4316 tests run: 4315 passed, 1 failed.affected tests (windows, advisory)failed on the same test.test (linux),test (macos),lint,fast-checks,code-coverage,codecov/patchandcodecov/projectare all green at17178313. remove.rs's switch fromWorktreeId::new(path).into_path()back todunce::canonicalize(&path).unwrap_or(path)is behaviour-neutral: the only consumer isprepare_worktree_removal'scurrent_path, which compares throughworktrunk::path::paths_match, and that iscanonicalize_with_parents(a) == canonicalize_with_parents(b)— the same normalizationWorktreeId::newapplies.switch.rsis the site where the two spellings genuinely differ, and it now uses each for what it is:canonicalize(&path).unwrap_or(path)for the path handed to the switch pipeline (a real cd target),WorktreeIdfor thealready_atcomparison.
worktrunk-bot
left a comment
There was a problem hiding this comment.
Reviewed 2517c3c. Deleting ListItem::{branch, head} and WorktreeData::path in favour of accessors over the one BranchRef is the right shape, and the drift it rules out is real — layout.rs's old detached-row test set branch = None while branch_ref still carried Some("main"), which is exactly the split this removes. branch() round-trips correctly through local_ref/remote_ref for every constructor, including a branch literally named refs/heads/foo; PickerRowId's MR arm still prints mr:{N} via RefType::syntax(); and the PrRef wire format is pinned by the new {"number":3035,"sigil":"!"} round-trip.
Two leftovers, both outside the diff hunks so I can't suggest them inline — happy to push a commit for both:
src/commands/list/ci_status/mod.rs—populate_from_cache's docstring still opens its last paragraph with`item.branch` is the cache key for every row shape. Its own body now readsitem.branch(), and this commit deleted the field.ListItem::branch()is the accurate spelling.src/commands/list/json_v2.rs— inJsonItemV2::from_item, theis_default_branch_rowcomment contrasts the localbranchwith`item.branch`("Use the remote-strippedbranch(notitem.branch) …"). That local is now derived fromitem.branch(), so the contrast names a member that no longer exists. Those two lines are the onlyitem.branchhits left in the tree.
One thing worth a look, since it bears on the commit's own thesis. WorktreeRef exists to make a missing worktree path unrepresentable, but two accessors still assert that invariant at runtime rather than in the type:
WorktreeRef::id()matches on the wrappedGitItemIdKindand falls through tounreachable!("WorktreeRef always contains a worktree ID"). Storing theWorktreeIdbeside theBranchRef(struct WorktreeRef { id: WorktreeId, inner: BranchRef }) makesid()a field read —new()already computes it once.JsonItemV2::from_itemreaches foritem.worktree_path().expect("typed worktree rows always carry a worktree path")after already matchingItemKind::Worktree. A paired accessor onListItem—fn worktree(&self) -> Option<(&Path, &WorktreeData)>matching on(&self.kind, self.branch_ref.worktree_path())— hands the two out together and drops the panic. Your call whether a loud panic beats a silently-skipped object on an arm that can't fire; either way it's the only site left where the caller has to re-derive the pairing.
Not approving, on the basis already on this thread rather than anything new: .claude/skills/running-tend/references/review-pr.md → "Data-Loss Surface: Hold for Human Review" (src/commands/remove.rs and src/commands/picker/mod.rs are both in the diff). Nothing outstanding from my side beyond the two docstrings.
Verification
- Stale references:
git grep -n 'item\.branch\b'at2517c3creturnssrc/commands/list/ci_status/mod.rs:730,src/commands/list/json_v2.rs:630, andsrc/commands/picker/progressive_handler.rs:258(the accessor call). Neither doc line falls inside a diff hunk —ci_statushunks end at new line 753 starting from 741;json_v2's covering hunk ends at 628. branch()equivalence:WorktreeRef::newstoresfull_ref = branch.map(local_ref), andshort_name()stripsrefs/heads/before tryingrefs/remotes/, so a worktree onremotes/origin/fooreturnsremotes/origin/foorather than being re-stripped.is_main/is_current/ sort priority moving fromGitItemId::worktree_id()toWorktreeRef::id()is behaviour-neutral:worktree_subjectsholds only worktrees, so the oldOption<&WorktreeId> == Option<&WorktreeId>comparison never had aNone/Nonepair to match on.RemoveTarget::WorktreePath's spelling stays non-load-bearing —prepare_worktree_removalfinds the entry throughworktrunk::path::paths_match(&wt.path, &lookup_path), which canonicalizes both sides.finalize_worktreedoes recover a rebasing worktree's branch whiledetachedstaystrue, so the doc comment this commit moved ontoWorktreeData::detachedchecks out.- At this head
test (linux),lint,fast-checks,feature-check,code-coverage,codecov/patchandcodecov/projectare green;test (macos)andtest (windows)were still running when I looked.
worktrunk-bot
left a comment
There was a problem hiding this comment.
54316098 closes both docstring leftovers from the last round, and the ci_status one is exactly right — git grep 'item\.branch\b' now returns only accessor calls plus the two doc lines here.
The json_v2 rewrite picked up an editing artifact, though: "Use the remote-stripped the remote-stripped branch". Suggestion inline.
Verdict unchanged and for the reason already on this thread rather than anything new — the hold in .claude/skills/running-tend/references/review-pr.md → "Data-Loss Surface: Hold for Human Review", since src/commands/remove.rs and src/commands/picker/mod.rs are both in the diff. Nothing else is open from my side. test (linux|macos|windows), lint and code-coverage were all still running at this head when I looked.
Automated nightly regeneration of tend's workflow files. **tend version:** 0.1.18 → 0.1.19. The diff is the eight `.github/workflows/tend-*.yaml` files, each with its generation stamp and its `max-sixty/tend/claude@` action ref moved to the new release — no other workflow-body changes. **Notable changes** - **Sandbox setup gains the agent's GitHub context** (max-sixty/tend#1057, max-sixty/tend#1059) — `sandbox_setup` commands now see `GITHUB_WORKFLOW` and the same GitHub context the agent gets. This repo runs a `sandbox_setup` block in `.config/tend.yaml` (the `cargo-insta` / `cargo-nextest` / `pre-commit` install plus its five-tool probe), so the change lands here directly. Related sandbox guidance: the CI agent is now told it runs unprivileged and where root lives (max-sixty/tend#1041), what its PATH couldn't reach is named (max-sixty/tend#1047), and runner-home setup is explicit (max-sixty/tend#1048). - **Instruction-file pinning and checkout hygiene** (max-sixty/tend#1005, max-sixty/tend#1029) — every instruction file the CLIs read is pinned at any depth on both harnesses, and the harness's own `settings.local.json` is excluded from the adopter checkout. - **CI-monitoring scripts** (max-sixty/tend#999, max-sixty/tend#1046) — `poll-pr-checks.sh` pages the check rollup instead of refusing past 100 contexts, and rejects an unusable SHA before entering the poll loop. Headroom rather than a live fix here — the current `main` head carries 70 check runs and PR #3926's head 24, both under the old limit, but the count grows with every workflow job added. - **Skill behavior** — review stops at the review on PRs the bot itself authored (max-sixty/tend#1007) and scales depth to what checking the change requires; nightly leaves the `tend-outage` tracker for `review-runs` to drain (max-sixty/tend#1021) and confirms a resolved PR actually left the conflicted state before polling CI (max-sixty/tend#1032); ci-fix filters the outage-escalation query by title rather than label alone (max-sixty/tend#1015). - **Plain titles required from tend workflows** (max-sixty/tend#1022, max-sixty/tend#1060) — PRs and issues opened by tend workflows now use plain titles rather than a Conventional Commits prefix. This PR still carries the `chore:` prefix because the recipe that generated it ships with the currently-pinned 0.1.18 action; the next nightly, running 0.1.19, will use the new convention. Full upstream diff: max-sixty/tend@0.1.18...0.1.19 Co-authored-by: worktrunk-bot <[email protected]>
worktrunk 0.76.0 Created-by: HarmonybrewBot Commit-by: HarmonybrewBot Merged-by: HarmonybrewBot Description: Created by `brew bump` --- Created with `brew bump-formula-pr`.<details> <summary>release notes</summary> <pre>## Release Notes ### Improved - **`wt switch --execute` takes a program, not a shell string**: `-x` names one program, with everything after `--` passed as literal argv. Worktrunk spawns it as a child rather than running it in your interactive shell, so shell functions and its `cd` no longer reach you. `-x sh -- -c '…'` recovers shell syntax, not functions. (Breaking: existing `-x` strings, plus `WORKTRUNK_DIRECTIVE_EXEC_FILE` and `WORKTRUNK_SHELL`.) ([#3977](max-sixty/worktrunk#3977), closes [#2860](max-sixty/worktrunk#2860), fixes [#3944](max-sixty/worktrunk#3944), thanks @omgreenfield for testing the migration path) - **Worktrunk decides tracking for the branches it creates**: a new branch gets an upstream only when its name matches the remote branch it starts from, whatever `branch.autoSetupMerge` says: `--create release --base origin/release` tracks, `--create feature --base origin/release` does not. Under `autoSetupMerge = false` this previously exited 128 after creating the worktree. ([#3913](max-sixty/worktrunk#3913), [#3950](max-sixty/worktrunk#3950), fixes [#3937](max-sixty/worktrunk#3937), thanks @mjakl for reporting and diagnosing) - **Retired config keys are no longer read**: `commit.generation.template-file` and `squash-template-file` are gone — put the file's contents in `template` or `squash-template`. There is no migration: the key stays, warns as unknown on every load, and the prompt reverts to the built-in default. Setting both `template` and `template-file` used to fail the load; it now loads `template`. `switch.picker.timeout-ms` likewise warns rather than being stripped. (Breaking.) ([#3949](max-sixty/worktrunk#3949)) - **Project aliases and hooks can use `wt switch --execute`**: their bodies previously refused it. Worktrunk now starts the program itself instead of handing shell text to your shell, and the command-approval gate remains the control on project-defined commands. ([#3977](max-sixty/worktrunk#3977)) - **Established automation and LLM customization interfaces are now stable**: `wt step eval`, `wt step for-each`, `wt step prune`, LLM branch summaries, `wt config state vars`, and `commit.generation.template-append` are no longer marked experimental. ([#3949](max-sixty/worktrunk#3949)) - **`wt step prune` stages removals concurrently again**: only the `git worktree remove` teardowns serialize, so dirty checks, fsmonitor shutdown, and the trash rename overlap. The `prune_e2e/live` benchmark median went from 377 ms to 222 ms. ([#3954](max-sixty/worktrunk#3954)) - **`wt config approvals add` reads as a review rather than a warning**: it opens with a cyan `Review 1 command for repo:` instead of a yellow `▲ … needs approval to execute`. The execution-time gate is unchanged. ([#3953](max-sixty/worktrunk#3953)) ### Fixed - **The `wt switch` picker survives a preview longer than 65,535 lines**: skim keeps the pane's line count in a `u16`, so a larger diff aborted `wt` with exit 101 seconds after it painted — on screen the picker looked like it closed by itself. Panes now cap at 60,000 lines and say so. ([#3959](max-sixty/worktrunk#3959), fixes [#3958](max-sixty/worktrunk#3958), thanks @sandertammesoo for reporting and diagnosing) - **The nushell wrapper propagates exit codes without a POSIX shell**: it reported a failing `wt` by spawning `sh`, so on Windows every failing command printed a ``Command `sh` not found`` trace and exit 1 whatever the real code was. Nushell's wrapper is a static file, so rerun `wt config shell install` to pick this up. ([#3945](max-sixty/worktrunk#3945)) - **The picker no longer shows one detached worktree's diff for another**: previews were keyed by branch name, so every detached row shared the key `(detached)`. Rows now key by canonical identity, which also lets `wt remove feature ~/repo.feature` plan that worktree once instead of failing on the second. ([#3926](max-sixty/worktrunk#3926)) - **`wt switch pr:<n>` gives `pre-switch` hooks the real branch**: `branch` and `target` held the literal `pr:3933`, and `target_worktree_path` was unset even when that branch had a worktree. `pr_number` and `pr_url` are now set for same-repo PRs, not only forks. ([#3941](max-sixty/worktrunk#3941), fixes [#3934](max-sixty/worktrunk#3934), thanks @robsonpeixoto for reporting) - **`wt config shell install` no longer replaces an rc file created while it was checking**: the missing-file path refuses to clobber and fails with a rerun hint. A dangling rc symlink is preserved and rejected rather than overwritten. ([#3929](max-sixty/worktrunk#3929)) - **`wt switch --create X --base pr:<n>` works when the PR branch has no local branch**: the fetch writes only the remote-tracking ref, and git won't expand a bare name to one, so the command failed with `No branch, tag, or commit named …`. The base is now named under its remote. ([#3951](max-sixty/worktrunk#3951)) - **`wt switch --create` streams `git worktree add` instead of stalling**: where a sandbox denied the timed wait's pipe or `sigaction`, the command waited out git's entire run and then reported `Failed to wait for command` for work that had already succeeded. ([#3881](max-sixty/worktrunk#3881)) - **Claude Code activity markers stay on the session's launch worktree**: the plugin's marker hooks pass `-C "$CLAUDE_PROJECT_DIR"`, so a `cd` mid-session no longer marks another repository. A session launched outside a repository gets no marker. ([#3956](max-sixty/worktrunk#3956)) ### Documentation - **`--execute` documents how to get a variable into a shell body**: each position is substituted verbatim, so a variable spliced into `sh -c` text is re-parsed by that shell and splits on spaces. The help now shows passing it as a separate argument and referencing it positionally. ([#3977](max-sixty/worktrunk#3977)) - **The clone-local default-branch override is documented**: `wt config state default-branch set` writes `worktrunk.default-branch` to the clone's local git config — machine-local, never committed, and shared by every linked worktree. `set` warns when the branch isn't checked out locally, and `wt list` skips its comparisons until it is. ([#3947](max-sixty/worktrunk#3947), [#3948](max-sixty/worktrunk#3948), fixes [#3946](max-sixty/worktrunk#3946), thanks @danielo515 for the request) - **The docs site renders code with the CLI's own colors**: terminal examples reproduce each snapshot's exact ANSI roles, while command references and the homepage command comparison get clap and shell syntax color from paired light/dark themes. File excerpts gain a path tab, and code wraps instead of scrolling on mobile. ([#3936](max-sixty/worktrunk#3936), [#3938](max-sixty/worktrunk#3938), [#3939](max-sixty/worktrunk#3939), [#3942](max-sixty/worktrunk#3942)) - **The `pre-start` upstream example uses `--base`**: it showed `wt switch --create feature origin/feature`, which `wt switch` rejects. ([#3955](max-sixty/worktrunk#3955)) ### Internal - **Library API rework** (Breaking library API): `cargo-semver-checks` fails ten lints — `RemoteRefProvider` and its provider structs give way to `ForgeKind` dispatch, the `--execute` rework retires the fish and PowerShell `ShellEscapeMode` escapes and `WORKTRUNK_SHELL_ENV_VAR`, `BranchRef` swaps `full_ref`/`worktree_path` for `id`, and accessors including `Branch::unset_upstream` and `ProjectConfig::ci_platform` are gone. ([#3913](max-sixty/worktrunk#3913), [#3926](max-sixty/worktrunk#3926), [#3949](max-sixty/worktrunk#3949), [#3963](max-sixty/worktrunk#3963), [#3977](max-sixty/worktrunk#3977)) - **Hook pipelines and `wt list` collection lost two indirection layers**: the background pipeline carries `PreparedStep` directly, and 15 marker task types collapse into one exhaustive dispatch. The synthesized-`--force` submodule path keeps its dirty re-check and destructive command under one lock, so prune's narrower locking doesn't widen that window. ([#3964](max-sixty/worktrunk#3964), [#3954](max-sixty/worktrunk#3954)) ## Install worktrunk 0.76.0 ### Install prebuilt binaries via shell script ```sh curl --proto '=https' --tlsv1.2 -LsSf https://github.com/max-sixty/worktrunk/releases/download/v0.76.0/worktrunk-installer.sh | sh && wt config shell install ``` ### Install prebuilt binaries via powershell script ```sh powershell -ExecutionPolicy Bypass -c "irm https://github.com/max-sixty/worktrunk/releases/download/v0.76.0/worktrunk-installer.ps1 | iex"; git-wt config shell install ``` ### Install prebuilt binaries via Homebrew ```sh brew install worktrunk && wt config shell install ``` ## Download worktrunk 0.76.0 | File | Platform | Checksum | |--------|----------|----------| | [worktrunk-aarch64-apple-darwin.tar.xz](https://github.com/max-sixty/worktrunk/releases/download/v0.76.0/worktrunk-aarch64-apple-darwin.tar.xz) | Apple Silicon macOS | [checksum](https://github.com/max-sixty/worktrunk/releases/download/v0.76.0/worktrunk-aarch64-apple-darwin.tar.xz.sha256) | | [worktrunk-x86_64-ap See merge request: Harmonybrew/homebrew-core!18482
Detached worktrees at the same commit shared the
(detached)preview-cache key, so opening a clean worktree could make another worktree show the wrong diff.This creates canonical identity at the Git model boundary.
WorktreeIdowns canonical path equality; the typedWorktreeRefcaptures a registered worktree once and becomes the genericBranchRefpassed through task layers;GitItemIddistinguishes worktrees from fully qualified branch refs; andPickerRowIdextends that local identity to forge-only PR/MR rows.ListItemnow carries that subject as the source of truth for identity, HEAD, branch, and operational worktree path instead of mirroring those fields or reclassifying branch rows into worktrees.ResolvedWorktreecaptures identity when a selector resolves, so aliases deduplicate without downstream reinterpretation.PrReflikewise stores a structuralRefTypewhile preserving the existing cache wire format.Current and primary worktree classification, statusline lookup, switch no-op detection, picker caches, and multi-target removal all use the appropriate canonical identity. Git's registered path spelling remains separate for actual operations, including deep Windows paths where the comparison form is not a valid replacement command path.
Regression coverage verifies distinct previews for detached worktrees at one commit, full-ref separation for branch-only rows, branch/path alias deduplication during removal, symlink-equivalent worktree matching, cache compatibility, and deep Windows switch behavior.