Handles are keyed on the project NAME, not a project identity, so a handle replayed in another clone resolves "exact" against the wrong tree #151
Labels
No labels
code-review
correctness
dos
performance
security
severity/high
severity/low
severity/medium
tech-debt
Kind/Breaking
Kind/Bug
Kind/Documentation
Kind/Enhancement
Kind/Feature
Kind/Security
Kind/Testing
Priority
Critical
Priority
High
Priority
Low
Priority
Medium
Reviewed
Confirmed
Reviewed
Duplicate
Reviewed
Invalid
Reviewed
Won't Fix
Status
Abandoned
Status
Blocked
Status
Need More Info
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
h-dv/code-index#151
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Found by a production-readiness review.
crates/core/src/handle.rs:104encodes:{project}is the project name."primary"is"primary"in every workspace, every clone and every worktree.So a handle minted in one clone and replayed in another resolves
status: "exact"against a different tree. Two clones of the same repo satisfy all four remaining fields for essentially every symbol — and worktrees of the same repo are the normal case for this workflow, not an exotic one.The handle system's whole promise is that
exactmeans this is the same thing you were looking at. Across clones it currently means a thing with the same name exists here.Prior art in this repo
I031's review already caught the adjacent bug — a wrong-project handle stamp on auto-routed absolute paths. This is the same class one level down: the discriminator is a display name rather than an identity.
Care
Whatever identity is chosen must not be derived from
canonicalize().unwrap_or(raw)— a key derived that way moves when the disk moves, which this project has already been bitten by. It also must survive a legitimate move of the checkout, orexactdegrades tomissingfor every handle whenever someone relocates their repo.Related
🤖 Generated with Claude Code
https://claude.ai/code/session_01K1zj5VcFJvJt3pQxe9259K