Repository navigation
T7 — Show --network and --ingress with the new spellings and hint at the old ones - #1676
Conversation
Unhide --network and --ingress on 'min session activate': the own_ip network mode works from an install now, so the flags no longer need to hide behind it (#980). The current spellings are none|host_ip|own_ip (underscores, as the spec names them). The hyphenated no-net, host-net, and own-ip predate the rename and still parse to the same modes, each printing a one-line stderr hint naming the current spelling, so scripts and muscle memory keep working through the rename window; they go away after one release. Restore the --network and --ingress rows in the session activate table of docs/reference/cli-min.md to match the help.
|
Important Review skippedBot user detected. To trigger a single review, invoke the ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Advanced Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Comment |
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
Preserve completion metadata and add coverage for the user-visible stderr hints.
Get a fresh assessment by requesting another Copilot review.
Review effort: Lite
Findings: 2
Open (2)
What changed in this PR
Updates session activate to expose modern network options while preserving legacy spellings with migration hints.
Changes:
- Exposes
--networkand--ingressin help and documentation. - Adds current and legacy network-mode parsing.
- Adds CLI, parsing, and documentation tests.
| File | Summary |
|---|---|
docs/reference/cli-min.md |
Documents the network flags. |
crates/minimal/src/tests.rs |
Adds help, parsing, and documentation tests; stderr behavior coverage remains requested. |
crates/minimal/src/cli.rs |
Adds network parsing and legacy hints; current-value completion metadata should be preserved, and stderr should be tested through the real CLI path. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
norrietaylor
left a comment
There was a problem hiding this comment.
Reviewed against T7's plan block (NET-035, NET-036, NET-037).
cli.rs:--networkand--ingressunhidden onActivateArgs; the hand parser takesnone|host_ip|own_ipand the three hyphenated spellings, printing the one-line hint only for the old ones;bogusis a clap error naming the accepted set. Matches the layer.session.rsunchanged, with the reason in the PR body: the parser is the only point that sees the raw spelling, and the programmaticActivateArgsconstructors carry the default. Accepted.tests.rs: the three named test lines exist and passed in the run table (activate_help_shows_network_flags,legacy_network_spellings_parse_with_hint,cli_reference_documents_network_flags). The reference test reads the realcli-min.md, so a docs regression fails the crate.cli-min.md: both rows added undersession activate.
Two things for follow-ups, not blockers: the "daemon log names the network mode" half of the diagnostics line is outside this task's layers (the body says so), and scripts/session-e2e.sh / the justfile still use --network own-ip, which now prints the hint into captured stderr.
The draft flag came only from agent-verify timing out on a cold clippy (600 s), not from a failing check; taken out of draft per the walk's rule. Merge waits for minimal-review and CodeRabbit to conclude and any revise round they raise.
There was a problem hiding this comment.
minimal-review — approval withheld
Verdict COMMENT — APPROVE withheld: 2 unresolved threads — copilot-pull-request-reviewer[bot] crates/minimal/src/cli.rs:579, copilot-pull-request-reviewer[bot] crates/minimal/src/tests.rs:1456. No findings.
|
/revise Judge the two open Copilot threads at crates/minimal/src/cli.rs:579 and crates/minimal/src/tests.rs:1456 (the legacy-spelling stderr hint is asserted by no test): fix each if it is right, otherwise answer it with the reason so the thread can be resolved. |
…rk-and-ingress-with-the-new-spellings
The spelling test read the hint through legacy_network_hint directly and never observed parse_network_mode's eprintln!, so a future change could drop the print while the test stayed green. Capture the real fd 2 around the real clap parse and assert each legacy spelling emits exactly the hint line and each current spelling (and the default) emits nothing.
…rk-and-ingress-with-the-new-spellings
|
Round 1 of 10 on a /revise note, pushed as
Verify Review threads the coder judged:
Notes from the agent: Revise round: addressed the two Copilot threads (same finding from two angles, judged valid — the spelling test called legacy_network_hint directly and never observed parse_network_mode's eprintln!). Fix is tests.rs only: added capture_stderr (nix pipe + dup2_stderr around the real Cli::try_parse_from, RAII restore, process-wide lock for plain cargo test; under nextest each test owns its process) and extended legacy_network_spellings_parse_with_hint to assert each legacy spelling emits exactly 'hint\n' on stderr and each current spelling plus the default emit nothing. Verified by mutation: temporarily removing the eprintln! in cli.rs fails the test; restored byte-identical afterwards (cli.rs is untouched in this round's commit). cmd/session.rs needed no change: the layer note said 'prints the hint where the network mode is read', but the print must happen at parse time to name the spelling typed, and the raw spelling is not preserved past the value parser — it stays in parse_network_mode (cli.rs, unchanged). Gap left undone, planning defect to record: the diagnostics clause's second half ('the daemon log names the network mode each session started with') cannot be met inside this task's layers — the daemon is minimald, which no layer names, and today only the OwnIp attach path logs its mode (net/mod.rs 'attached OwnIp PTask to gvproxy switch') while HostNet/NoNet launches log nothing naming the mode; a daemon-touching task (e.g. the NET-038/NET-039 enforcement slice) should own that line. cargo fmt -p minimal and cargo clippy -p minimal --all-targets both clean. |

T7 — Show --network and --ingress with the new spellings and hint at the old ones
slice: S2
kind: task
covers: NET-035, NET-036, NET-037
size: M
est: 160 code, 180 tests
executor: agent
difficulty: routine
model: standard
diagnostics: the hint on stderr names the spelling typed and the one to use, and the daemon log names the network mode each session started with
observability: one line on stderr per old spelling naming the new one
layers:
- cli:
- crates/minimal/src/cli.rs: unhides network and ingress on ActivateArgs; CliNetworkMode accepts none, host_ip and own_ip, and a custom parser accepts no-net, host-net and own-ip with a hint
- crates/minimal/src/cmd/session.rs: prints the hint where the network mode is read
- crates/minimal/src/tests.rs: adds the help and spelling tests
test: cargo nextest run -p minimal activate_help_shows_network_flags
test: cargo nextest run -p minimal legacy_network_spellings_parse_with_hint
- docs:
- docs/reference/cli-min.md: adds --network and --ingress rows to session activate
test: cargo nextest run -p minimal cli_reference_documents_network_flags
produces: none
consumes: none
proof:
min session activate --helpand the CLI reference show--network none|host_ip|own_ipand--ingress, and the old spellings still work with a hint naming the new one.Proof
min session activate --helpnow shows--network <none|host_ip|own_ip>and--ingress <EXT:INT[/PROTO]>, the session activate table in docs/reference/cli-min.md documents both flags, and the old spellings still work:--network no-net/host-net/own-ipparse to the same modes as their current spellings and printnote: --network no-net still works for one release; the current spelling is --network noneon stderr.Notes from the agent: session.rs (a named layer file) needed no change: the hint prints from the custom value parser in cli.rs, the only point that sees the raw spelling — session.rs reads args.network as an already-parsed mode, and the bare-min paths (bare_activate_args, activate_new_for_attach) construct ActivateArgs programmatically with the default, so they can never carry a legacy spelling. Diagnostics half-delivered: the stderr hint names the spelling typed and the one to use, but 'the daemon log names the network mode each session started with' is not done — minimald's 'session created' log (crates/minimald/src/rpc.rs) carries only id and name, and adding the mode means touching minimald, outside this task's layers. For a later task: scripts/session-e2e.sh and the justfile own-IP demo still invoke the legacy
--network own-ipspelling (they keep working, with the hint landing in captured stderr); a--network/--ingressValueEnum-style value parser means shell completion no longer enumerates the modes.Tests
cargo nextest run -p minimal activate_help_shows_network_flagscargo nextest run -p minimal legacy_network_spellings_parse_with_hintcargo nextest run -p minimal cli_reference_documents_network_flagsVerify
min task run agent-verifytimed out after 600s, so this PR is a draft.Closes #1614