worktree-all-nvrs-option #21
Loading…
Reference in a new issue
No description provided.
Delete branch "worktree-all-nvrs-option"
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?
Three problems, all mine, all found by someone trying to follow it. **Three words for one thing.** The code said "enroll" in places, "claim" in others, and I said "pairing" out loud. Everything is now "pair": PairingStore, new_code(), pair(), is_paired(), T_PAIR, CLOSE_NOT_PAIRED, tests/test_pairing.py. **A whole second handshake that earned nothing.** An unknown box used to be told to reconnect to a separate /enroll endpoint and repeat its id and public key — which it had already sent in the auth frame it just made. 107 lines and three protocol messages to ask the same question twice. Gone: the relay now answers the connection it already has with a code instead of a welcome, and closes. One path, one handshake, two outcomes. **A code that changed while you were typing it.** Running the flow properly — waiting a realistic amount of time before typing — showed the code on screen was already dead. An unpaired box retries every 15 seconds and every retry minted a fresh code. The old rule ("reconnecting replaces the outstanding code") was aimed at a real worry, a trail of codes that all still work, but it fixed that by breaking the feature. Reconnecting now returns the same live code, which gives one working code per box AND one that survives long enough to type. Verified by waiting through several reconnects before pairing. The test double in test_relay_handshake.py became a real PairingStore on a temp dir. It needed a new method every time the store grew one; the real thing is less code and cannot drift from what the relay actually calls. Net: 957 -> 894 lines with more of the flow covered, 338 tests pass, ruff and bandit clean. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Ag1iD139Ec63dPLTNATX3s