Skip to content

Evaluate treehouse stable lease identities in place of path-comparison collision guard #48

Description

@atqamz

treehouse v2.1.0 added stable lease identities (kunchenguid/treehouse#68), surfaced through treehouse get --lease --json alongside the path hand already reads.

internal/worktree/worktree.go Get() currently discards everything in that payload except path, and CheckCollision then hand-rolls a guard by comparing the returned worktree path against every other active task's recorded path. That comparison exists to catch the stale-lease-after-crash bug (firstmate #947).

Worth evaluating whether a lease identity is a sounder key than a path string. A path is reused across leases by design: treehouse keeps the slot directory when a worktree is returned, so a path cannot distinguish a returned worktree from a leased one, which Return's own doc comment already spells out. A stable identity presumably can.

Not urgent, and not obviously a win until someone reads what the identity actually guarantees across a crash. Filing so it is not lost.

Context: #41 (comment)

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions