Allow network commands to select stored names
Leaving a configured network required copying its opaque id even when its name identified exactly one saved network. Resolve exact, case-sensitive names from the existing local state alongside full ids and unique id prefixes. Use the shared resolver for leave, stop, start, secret and broadcast so the same selector has the same meaning throughout the CLI. IPC and storage still operate on the resolved id; release and offline-removal behavior are unchanged. Refuse ambiguous names and name/id-prefix collisions before any mutation, listing matching names and full ids without secrets. Full ids take precedence to provide a definitive escape from ambiguity. Preserve copied id ellipses without stripping literal ellipses from network names. Update help and examples. Make administrator-friendly, predictable CLI behavior a core requirement in AGENTS.md, including actionable errors and no guessing which resource a destructive command should affect. Validation on Windows: cargo fmt --all -- --check and workspace/all-target Clippy with -D warnings passed. Release workspace/all-target tests: 318 passed, including real-process online/offline leave-by-name, preservation of other networks, ambiguous/unknown selectors, and consistent name selection across commands. Two existing Windows SQLite wipe failures were explicitly skipped (a_wipe_removes_everything_and_the_next_start_is_a_stranger and wiping_twice_is_as_ordinary_as_wiping_once). The public-DHT smoke test and forwarding benchmark remain ignored by default. Tests use isolated state; the user's running agent and configured networks were not changed.
This commit is contained in:
1 parent
c724981bfd
commit
db9015b26c
6 files changed
+261
-75
No files matched your search
@@ -108,6 +108,11 @@ with no secret invents one, prints it in full and prints a line the other
|
||||
side can paste unchanged; a bare name this device already knows resumes
|
||||
that network instead of inventing another of the same name; and a network
|
||||
can be stopped and started again with its secret and its place intact.
|
||||
Network selection accepts exact names consistently across commands. Leave-by-name
|
||||
is tested with a live agent and with offline state, preserving other networks;
|
||||
duplicate and unknown names change nothing and full ids resolve ambiguity.
|
||||
Selector unit tests cover case-sensitive names, Unicode/ellipsis names, copied
|
||||
id prefixes and collisions between names and ids without revealing secrets.
|
||||
|
||||
`crates/tsunagi-cli/tests/dns_service.rs` runs the real binary: the resolver
|
||||
comes up with no interface to attach it to, the listener is not rebuilt on
|
||||
|
||||
Reference in new issue
Block a user