Skip to content

T7 — Show --network and --ingress with the new spellings and hint at the old ones - #1676

Merged
norrietaylor merged 4 commits into
mainfrom
agent/1614-show-network-and-ingress-with-the-new-spellings
Sep 25, 2026
Merged

norrietaylor merged 4 commits into
mainfrom
agent/1614-show-network-and-ingress-with-the-new-spellings

Conversation

@minimal-foundry

Copy link
Copy Markdown
Contributor

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 --help and the CLI reference show --network none|host_ip|own_ip and --ingress, and the old spellings still work with a hint naming the new one.

Proof

min session activate --help now 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-ip parse to the same modes as their current spellings and print note: --network no-net still works for one release; the current spelling is --network none on 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-ip spelling (they keep working, with the hint landing in captured stderr); a --network/--ingress ValueEnum-style value parser means shell completion no longer enumerates the modes.

Tests

line exit tail
cargo nextest run -p minimal activate_help_shows_network_flags 0 Applying loadouts: default Running task runtime-implement-test-0 in session task-runtime-implement-test-0-fe28... Compiling ot v0.0.1 (/home/runner/.local/state/minimal/sessions/a6161/tree/crates/ot) Compiling args v0.0.1 (/home/runner/.local/state/minimal/sessions/a6161/tree/crates/args) C
cargo nextest run -p minimal legacy_network_spellings_parse_with_hint 0 Applying loadouts: default Running task runtime-implement-test-1 in session task-runtime-implement-test-1-f632... Compiling stdlib v0.0.20 (/home/runner/.local/state/minimal/sessions/67be3/tree/crates/stdlib) Compiling version v0.6.0 (/home/runner/.local/state/minimal/sessions/67be3/tree/crate
cargo nextest run -p minimal cli_reference_documents_network_flags 0 Applying loadouts: default Running task runtime-implement-test-2 in session task-runtime-implement-test-2-219b... Compiling stdlib v0.0.20 (/home/runner/.local/state/minimal/sessions/964fe/tree/crates/stdlib) Compiling version v0.6.0 (/home/runner/.local/state/minimal/sessions/964fe/tree/crate

Verify

min task run agent-verify timed out after 600s, so this PR is a draft.

runner/.local/state/minimal/sessions/bb5b8/tree/crates/decode)
    Checking minimal-client v0.6.0 (/home/runner/.local/state/minimal/sessions/bb5b8/tree/crates/minimal-client)
    Checking minimal-tui v0.6.0 (/home/runner/.local/state/minimal/sessions/bb5b8/tree/crates/minimal-tui)
    Checking graph v0.0.1 (/home/runner/.local/state/minimal/sessions/bb5b8/tree/crates/graph)
    Checking lcache v0.0.1 (/home/runner/.local/state/minimal/sessions/bb5b8/tree/crates/lcache)
    Checking op v0.0.1 (/home/runner/.local/state/minimal/sessions/bb5b8/tree/crates/op)
    Checking rcache v0.0.1 (/home/runner/.local/state/minimal/sessions/bb5b8/tree/crates/rcache)
    Checking check v0.0.1 (/home/runner/.local/state/minimal/sessions/bb5b8/tree/crates/check)
    Checking orchestrator v0.0.1 (/home/runner/.local/state/minimal/sessions/bb5b8/tree/crates/orchestrator)
    Checking mctx v0.0.1 (/home/runner/.local/state/minimal/sessions/bb5b8/tree/crates/mctx)
    Checking remote-client v0.0.1 (/home/runner/.local/state/minimal/sessions/bb5b8/tree/crates/remote-client)
    Checking minimald v0.6.0 (/home/runner/.local/state/minimal/sessions/bb5b8/tree/crates/minimald)
    Checking minimal v0.6.0 (/home/runner/.local/state/minimal/sessions/bb5b8/tree/crates/minimal)
    Checking mip v0.6.0 (/home/runner/.local/state/minimal/sessions/bb5b8/tree/crates/mip)
    Finished `dev` profile [unoptimized] target(s) in 8m 55s
   Compiling stdlib v0.0.20 (/home/runner/.local/state/minimal/sessions/bb5b8/tree/crates/stdlib)
   Compiling version v0.6.0 (/home/runner/.local/state/minimal/sessions/bb5b8/tree/crates/version)
   Compiling mlog v0.0.1 (/home/runner/.local/state/minimal/sessions/bb5b8/tree/crates/mlog)
   Compiling minimal-client v0.6.0 (/home/runner/.local/state/minimal/sessions/bb5b8/tree/crates/minimal-client)
   Compiling decode v0.0.1 (/home/runner/.local/state/minimal/sessions/bb5b8/tree/crates/decode)
   Compiling minvmd v0.6.0 (/home/runner/.local/state/minimal/sessions/bb5b8/tree/crates/minvmd)
   Compiling minimal-tui v0.6.0 (/home/runner/.local/state/minimal/sessions/bb5b8/tree/crates/minimal-tui)
   Compiling graph v0.0.1 (/home/runner/.local/state/minimal/sessions/bb5b8/tree/crates/graph)
   Compiling lcache v0.0.1 (/home/runner/.local/state/minimal/sessions/bb5b8/tree/crates/lcache)
   Compiling op v0.0.1 (/home/runner/.local/state/minimal/sessions/bb5b8/tree/crates/op)
   Compiling rcache v0.0.1 (/home/runner/.local/state/minimal/sessions/bb5b8/tree/crates/rcache)
   Compiling check v0.0.1 (/home/runner/.local/state/minimal/sessions/bb5b8/tree/crates/check)
   Compiling orchestrator v0.0.1 (/home/runner/.local/state/minimal/sessions/bb5b8/tree/crates/orchestrator)
   Compiling mctx v0.0.1 (/home/runner/.local/state/minimal/sessions/bb5b8/tree/crates/mctx)
   Compiling minimald v0.6.0 (/home/runner/.local/state/minimal/sessions/bb5b8/tree/crates/minimald)
   Compiling minimal v0.6.0 (/home/runner/.local/state/minimal/sessions/bb5b8/tree/crates/minimal)

Closes #1614

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.
@coderabbitai

coderabbitai Bot commented Sep 24, 2026 •

Copy link
Copy Markdown
Contributor

Important

Review skipped

Bot user detected.

To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Advanced

Run ID: 8a230a01-f867-43ee-83a1-439b4fbe998f

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Comment @coderabbitai help to get the list of available commands.

@norrietaylor
norrietaylor marked this pull request as ready for review September 24, 2026 07:00
@norrietaylor
norrietaylor requested a review from a team as a code owner September 24, 2026 07:00
Copilot AI lite review requested due to automatic review settings September 24, 2026 07:00
@minimal-foundry

minimal-foundry Bot commented Sep 24, 2026 •

Copy link
Copy Markdown
Contributor Author

Reviewed: 1 finding, none blocking at 3354027eba69.

Address the comments on the diff.

Clobber: none: git log on cli.rs shows only the feature commits (8b377ae, f745290, b28b198) ahead of the merge base; no recent fix is reverted.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 Low severity

Open (2)
What changed in this PR

Updates session activate to expose modern network options while preserving legacy spellings with migration hints.

Changes:

  • Exposes --network and --ingress in 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.

Comment thread crates/minimal/src/cli.rs Resolved
Comment thread crates/minimal/src/tests.rs Resolved

@norrietaylor norrietaylor left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed against T7's plan block (NET-035, NET-036, NET-037).

  • cli.rs: --network and --ingress unhidden on ActivateArgs; the hand parser takes none|host_ip|own_ip and the three hyphenated spellings, printing the one-line hint only for the old ones; bogus is a clap error naming the accepted set. Matches the layer.
  • session.rs unchanged, with the reason in the PR body: the parser is the only point that sees the raw spelling, and the programmatic ActivateArgs constructors 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 real cli-min.md, so a docs regression fails the crate.
  • cli-min.md: both rows added under session 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.

@minimal-foundry minimal-foundry Bot left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@norrietaylor

Copy link
Copy Markdown
Member

/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.

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.

@minimal-foundry minimal-foundry Bot left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

minimal-review — advisory review

Verdict COMMENT — 1 finding, 1 inline.

Comment thread crates/minimal/src/cli.rs Resolved
@minimal-foundry

Copy link
Copy Markdown
Contributor Author

Round 1 of 10 on a /revise note, pushed as 3354027eba69.

line exit tail
cargo nextest run -p minimal activate_help_shows_network_flags 0 Applying loadouts: default Running task runtime-implement-test-0 in session task-runtime-implement-test-0-cc27... Updating crates.io index Downloading crates ... Downloaded bit-vec v0.8.0 Downloaded bit-set v0.8.0 Downloaded quick-error v1.2.3 Downloaded rand_xorshift v0.4.0 Downloade
cargo nextest run -p minimal legacy_network_spellings_parse_with_hint 0 Applying loadouts: default Running task runtime-implement-test-1 in session task-runtime-implement-test-1-4f68... Compiling stdlib v0.0.20 (/home/runner/.local/state/minimal/sessions/cc80a/tree/crates/stdlib) Compiling version v0.6.0 (/home/runner/.local/state/minimal/sessions/cc80a/tree/crate
cargo nextest run -p minimal cli_reference_documents_network_flags 0 Applying loadouts: default Running task runtime-implement-test-2 in session task-runtime-implement-test-2-a591... Compiling stdlib v0.0.20 (/home/runner/.local/state/minimal/sessions/8102f/tree/crates/stdlib) Compiling version v0.6.0 (/home/runner/.local/state/minimal/sessions/8102f/tree/crate

Verify min task run agent-verify passed.

Review threads the coder judged:

  • 👍 valid — crates/minimal/src/cli.rs:579: Fixed: the spelling test now captures the process's real stderr (fd 2 via a nix pipe + dup2) around the real clap parse and asserts each legacy spelling prints exactly the hint line and each current spelling (and the default) nothing. Verified a mutation that removes the eprintln! fails the test, th
  • 👍 valid — crates/minimal/src/tests.rs: Same gap as the cli.rs thread, closed by the same change: legacy_network_spellings_parse_with_hint now drives Cli::try_parse_from with stderr captured for every legacy and current spelling instead of calling legacy_network_hint alone, so a dropped or rerouted print fails the test.

min session activate --help and the CLI reference show --network <none|host_ip|own_ip> and --ingress, the legacy spellings still parse with a hint on stderr naming both the spelling typed and the one to use — and that hint is now asserted against the process's real stderr around the real clap parse, so a dropped print fails the suite instead of going missing for users.

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.

@norrietaylor
norrietaylor merged commit fc3b441 into main Sep 25, 2026
33 checks passed
@norrietaylor
norrietaylor deleted the agent/1614-show-network-and-ingress-with-the-new-spellings branch September 25, 2026 01:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

T7 — Show --network and --ingress with the new spellings and hint at the old ones

2 participants