Skip to content

docs(spec-networking-gaps): networking test plan: gaps G-N1–G-N7 and host→PTask forward defect - #638

Closed
gominimal-aw-bot[bot] wants to merge 1 commit into
mainfrom
spec/networking-gaps-b64461cd9f00f657
Closed

docs(spec-networking-gaps): networking test plan: gaps G-N1–G-N7 and host→PTask forward defect#638
gominimal-aw-bot[bot] wants to merge 1 commit into
mainfrom
spec/networking-gaps-b64461cd9f00f657

Conversation

@gominimal-aw-bot

@gominimal-aw-bot gominimal-aw-bot Bot commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

Spec for the eight blockers that prevent full DM1–DM5 networking test coverage, tracked in #626.

📝 Read the spec

What

This PR adds docs/specs/08-spec-networking-gaps/08-spec-networking-gaps.md, closing the eight gaps enumerated in the test-plan gap register (#625):

Gap Blocks Unit
G-N1 TC15; TC3/TC7 on DM4 Unit 1: proxy port configurability
defect TC3/TC4/TC7/TC8 on DM1 Unit 1: host→PTask RST fix
G-N2 TC16, all of DM5 Unit 2: minimald --server
G-N3 TC12 (UC5/R2.5) Unit 3: vm_egress config surface
G-N4 TC13 (UC3/R2.1–R2.2) Unit 3: per-PTask egress wiring
G-N5 TC14 (R2.4) Unit 3: dynamic port-map handler
G-N6 TC17 (UC7/R4.1–R4.3) Unit 4: mesh enrolment daemon wiring
G-N7 multi-VM DM1/DM3 Unit 5: multi-VM supervision in minvmd

Demoable units

  • Unit 1 — Proxy port configurability (--egress-proxy-port flag, auto-select recovery, port reporting in status RPC) and TCP RST defect fix (serialise DHCP lease before forwarder expose).
  • Unit 2minimald --server <addr:port>: mTLS TCP listener reusing existing CertAuthority; all RPCs available over TCP.
  • Unit 3 — Wire vm_egress from minvmd config → gvproxy ACL API; wire per-PTask egress section through session launch; add dynamic port-map RPC handler with DynamicPortOutOfRange error. Enforcement at the relay layer pending Unit 2 follow-up: R2.2 egress enforcement (relay-layer frame inspection) + R2.4 dynamic port-mapping #553.
  • Unit 4 — Call wg::start at daemon startup from a mesh config file; wire tunnel_sink into the gvproxy switch; minimal mesh join sends JoinMeshPeer RPC.
  • Unit 5 — Refactor minvmd state from single vmm_pid to a named-fleet map; per-VM lifecycle locks; minvmd run/stop/status --name <name>; vsock CID dispatch routing.

Next step

Please review and merge the spec PR to advance the tracking issue #626 from the spec phase into triage. Merging this PR will close the spec sub-issue (Closes #<spec-sub-issue> is added to the PR body by sdd-pr-sanitize).

References #626

Generated by sdd-spec for issue #626 ·

Closes #637

Summary by CodeRabbit

  • Documentation
    • Added a new networking test-plan spec outlining current gaps, proposed work units, verification steps, and demo requirements.
    • Clarified key blockers and expected outcomes for upcoming networking improvements.

…st→PTask forward defect (#626)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Jul 3, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

This PR adds a single new documentation spec file describing a networking test plan that addresses eight blocking gaps (G-N1–G-N7 and a host→PTask forwarding defect) via five demoable units of work with functional requirements, proof artifacts, non-goals, considerations, and a verification checklist.

Changes

Networking gaps spec document

Layer / File(s) Summary
Spec metadata, baselines, and goals
docs/specs/08-spec-networking-gaps/08-spec-networking-gaps.md
Establishes spec metadata, enumerates current baseline blockers (G-N1–G-N7, forwarding defect), and lists goals/user stories the spec addresses.
Units 1-5 functional requirements
docs/specs/08-spec-networking-gaps/08-spec-networking-gaps.md
Details Unit 1 (proxy port config/RST defect), Unit 2 (--server mTLS control plane), Unit 3 (egress + dynamic port-map RPC), Unit 4 (WireGuard mesh join wiring), and Unit 5 (multi-VM supervision) with requirements and proof artifacts.
Non-goals, considerations, and verification checklist
docs/specs/08-spec-networking-gaps/08-spec-networking-gaps.md
Covers non-goals, design/repository standards, open questions, technical/security considerations, and a cargo-based verification checklist.

Estimated code review effort: 1 (Trivial) | ~5 minutes

Possibly related PRs

  • gominimal/minimal#484: Targets the same minimald networking architecture (gvproxy switch, dynamic port-mapping RPCs, WireGuard mesh, minvmd supervision) referenced by this spec's gaps.

Suggested reviewers: norrietaylor

Poem

A rabbit hops through docs so new,
Eight gaps closed, units one through five,
No code was touched, just plans so true,
To keep the mesh and ports alive.
🐇📄✨

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the networking gaps spec and its main blockers.
Linked Issues check ✅ Passed The new spec maps the listed networking gaps to units of work and acceptance criteria, matching the tracking issue's scope.
Out of Scope Changes check ✅ Passed The PR only adds the requested networking spec document and does not introduce unrelated code or docs.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

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

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@docs/specs/08-spec-networking-gaps/08-spec-networking-gaps.md`:
- Around line 117-124: The current R1.2 wording still allows the proxy surface
to be lost on bind failure, so tighten the requirement around the proxy startup
path in proxy.rs by making the recovery behavior mandatory rather than optional.
Update the spec language for the DNS/egress/HTTPS proxy bind flow to require
either deterministic auto-selection of a non-conflicting OS-assigned port or an
explicit fail-fast with a logged remedy, and ensure the status/info RPC exposes
the final bound ports so a second daemon can discover them reliably.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 1ac9b64b-7bc2-4fce-86b5-c124059f7d46

📥 Commits

Reviewing files that changed from the base of the PR and between 3a6f564 and e347582.

📒 Files selected for processing (1)
  • docs/specs/08-spec-networking-gaps/08-spec-networking-gaps.md

Comment on lines +117 to +124
- **R1.2**: When a port is already in use at startup, `minimald` shall log a `tracing::error!`
with `component = "dns-proxy"` identifying the conflicting port and either select an OS-assigned
alternative port (auto-select) or fail the proxy subsystem with a logged remedy. The silent
warn-only best-effort bind of `proxy.rs:154–172` shall be replaced; a failed proxy bind is
always observable.
- **R1.3**: `minimald` shall expose the actual bound egress-proxy and HTTPS-proxy ports in its
status or info RPC so a second daemon on the same host can discover the effective port without
guessing.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

Don't allow a proxy-surface failure path here.

This still permits a daemon to lose its proxy surface, which conflicts with the unit goal of keeping two DM4 instances working on the same host. The requirement should mandate a deterministic recovery path or explicit non-conflicting configuration, not a branch that can leave the surface down.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@docs/specs/08-spec-networking-gaps/08-spec-networking-gaps.md` around lines
117 - 124, The current R1.2 wording still allows the proxy surface to be lost on
bind failure, so tighten the requirement around the proxy startup path in
proxy.rs by making the recovery behavior mandatory rather than optional. Update
the spec language for the DNS/egress/HTTPS proxy bind flow to require either
deterministic auto-selection of a non-conflicting OS-assigned port or an
explicit fail-fast with a logged remedy, and ensure the status/info RPC exposes
the final bound ports so a second daemon can discover them reliably.

@gominimal-aw-bot

Copy link
Copy Markdown
Contributor Author

sdd-validate — spec boundary findings

Boundary resolved: Spec (docs/specs/08-spec-networking-gaps/08-spec-networking-gaps.md)
Gate set applied: Spec gates (acceptance criteria testable · no implementation leakage · assumptions explicit · proof artifacts present and behavioral)


Gate 1 — Acceptance criteria testable ✅ PASS

All 16 functional requirements across the five units (R1.1–R1.4, R2.1–R2.4, R3.1–R3.3, R4.1–R4.3, R5.1–R5.4) are stated as observable, verifiable conditions: CLI flag acceptance confirmed by RPC output, TCP connection success/rejection, process lifecycle state, and policy round-trip query responses. No vague aspirational criteria found.


Gate 2 — No implementation leakage ⚠️ WARNING (4 findings)

Several functional requirements name specific Rust types, functions, or file paths where a behavioral statement would suffice. These are warnings — the spec can proceed, but the implementation author should read these as "the current baseline" context rather than as locked design decisions.

Finding 2a — R1.2 (docs/specs/08-spec-networking-gaps/08-spec-networking-gaps.md line ~121):

"The silent warn-only best-effort bind of proxy.rs:154–172 shall be replaced"

Prescribes a file name and line range inside a functional requirement. The behavioral statement ("a failed proxy bind is always observable") is present but the file:line citation belongs in a baseline note, not in the "shall" body.

Finding 2b — R3.2 (line ~208):

"The sessions::EgressPolicy struct shall be populated from the request and passed to the existing (or new) apply_egress call site in minimald"

Names a specific Rust struct and a call site where the behavioral statement ("a PTask launched with an egress spec has its egress rules applied") would suffice.

Finding 2c — R4.1 (line ~259):

"shall call wg::start with the loaded MeshConfig and keep the resulting MeshHandle alive"

Names three specific Rust identifiers in a functional requirement. The behavioral intent ("when a mesh config file exists, the daemon enters mesh mode at startup and stays there") is inferable but not the primary framing.

Finding 2d — R5.1 (line ~300):

"shall be refactored from a single vmm_pid: Option<u32> to a map <vm-name> → VmState { lifecycle, vmm_pid, started_at }"

Prescribes a specific Rust data structure shape (field names and types) in a functional requirement. The behavioral statement ("minvmd tracks a named fleet of VMs concurrently") is the operative requirement; the struct layout is implementation.

Note: The "Affected areas" and "Baseline:" sub-notes throughout the spec also reference specific crate paths and type names. These are contextual annotations, not criteria, so they are not findings. Only the cases above appear in "shall" requirement text.


Gate 3 — Assumptions explicit ✅ PASS

All material assumptions are stated:

  • Open Questions 1–3 explicitly flag the three unresolved design choices (RST defect root cause, gvproxy injection framing, vsock CID stability) and identify which requirements depend on them.
  • The relay-layer egress enforcement boundary (Unit 2 follow-up: R2.2 egress enforcement (relay-layer frame inspection) + R2.4 dynamic port-mapping #553) is declared a Non-Goal and reinforced in R3.1 and R3.2 notes.
  • The /dev/kvm hardware gate and MINIMALD_INTEGRATION_MESH env-var gate are explicit in proof artifacts that require them.
  • DM5 production certificate management is deferred and documented.

Gate 4 — Proof artifacts present and behavioral ✅ PASS

All five demoable units carry behavioral proof artifacts (1–2 per unit; all within the 1–3 bound). Each would fail against an empty PR, confirming they verify the feature rather than trivially passing.

Unit Artifacts Behavioral? Passes empty-PR rule?
Unit 1 (G-N1 + defect) 2 (Test + CLI)
Unit 2 (--server) 2 (CLI + Test)
Unit 3 (policy + dyn portmap) 3 (Test + CLI + CLI)
Unit 4 (WireGuard wiring) 2 (Test + CLI)
Unit 5 (multi-VM) 2 (Test + CLI)

Observation (not a finding): R4.3 (minimal mesh join sends JoinMeshPeer RPC and persists config) does not have a dedicated proof artifact — the Unit 4 test uses wg::start_with_socket (the existing unit-test socket path) and the CLI proof covers startup enrolment, not the join-then-persist round-trip. Unit 4 has two behavioral proofs so Gate 4 is satisfied, but the implementation author should consider a CLI proof of the form minimal mesh join <addr> && minimal mesh status showing the new peer if the join RPC is non-trivial.


Summary

Gate Result
1 — Acceptance criteria testable ✅ PASS
2 — No implementation leakage ⚠️ WARNING (4 findings, no Blocker)
3 — Assumptions explicit ✅ PASS
4 — Proof artifacts present and behavioral ✅ PASS

No Blockers. The spec may proceed to merge and advance to triage. The four Gate 2 warnings are advisory: the implementation leakage does not invalidate the requirements, and a knowledgeable implementer will read the named types as baseline context rather than locked design. The behavioral intent is recoverable in each case.


Generated by sdd-validate · spec boundary · PR #638

Generated by sdd-validate for issue #638 ·

@norrietaylor

norrietaylor commented Jul 6, 2026

Copy link
Copy Markdown
Member

Closing for now. We can attempt to run spectacles again once improvements have been made in that framework.

@norrietaylor
norrietaylor deleted the spec/networking-gaps-b64461cd9f00f657 branch July 6, 2026 19:53
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.

spec: networking test plan: gaps G-N1–G-N7 and host→PTask forward defect

1 participant