Files
devvm/docs/content/docs/cli
w3cjandClaude Opus 5.5 9454d3b2c5 fix(group): refuse a join whose member's name is the joiner's own hostname, and take turns on a lock so all or none holds
A VM whose folder part is another member's name (its folder part or the
name it joined with) would reach itself at that name, so devvm group join
now refuses it whatever --as it gives (group_name_hostname), naming the
fix: the member leaves and joins again with another --as NAME, or the
project uses a folder with another name. It replaces the
group_link_name_host warning, which is gone; groupLinks still makes no
link by the client's own hostname or localhost.

Joins, leaves, publish and unpublish's group sync and devvm rm's group
part hold a host-side flock, ~/.local/share/devvm/groups.lock
(platform.LockFileWaiting, saying group_waiting after 200 ms), from
reading the members' states to writing them. A join checks before it asks
to widen a parent folder's VM and again under the lock with its state read
again, so two VMs joining at once, one with network policy and one
without, can't both get in.

- vm: checkJoinName (pure: localhost, the joiner's hostname, taken names),
  checkJoin returns the members, Join split into rejoin and join,
  lockGroups, Groups.lock, syncOthers, Groups.forget; groupClash lost Own.
- Messages: group_name_hostname, group_waiting; group_link_name_host gone.
- Docs: links.md Names in a group and Groups and network policy; the
  design note's names rule, a Joins take turns rule, the Not covered
  bullet now only link add/rm racing a group change (those don't take the
  lock), the threat check rows; groups.lock in the state tables; the
  --as example; the CLI reference.

Tests: TestCheckJoinName, TestLockGroups (waits, says so, gets it once
let go; a context that ends first doesn't), TestGroupJoinsAtOnce (ten
rounds of two joins at once, one with policy and one without: exactly one
gets in; it fails without the lock), TestGroupLinks updated; group.txtar:
the refused join with and without --as, the fix, a folder named as a
member's --as, and two joins at once with one getting in; e2e
gp_hostname.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-01 23:28:21 -07:00
..