8000 T29 — Hostnames recover, and two daemons share a machine, end to end by minimal-foundry[bot] · Pull Request #1721 · gominimal/minimal · GitHub
[go: up one dir, main page]

Skip to content

T29 — Hostnames recover, and two daemons share a machine, end to end - #1721

Merged
norrietaylor merged 6 commits into
mainfrom
agent/1637-hostnames-recover-and-two-daemons-share-a-machin
Sep 26, 2026
Merged

norrietaylor merged 6 commits into
mainfrom
agent/1637-hostnames-recover-and-two-daemons-share-a-machin

Conversation

@minimal-foundry
Copy link
Copy Markdown
Contributor

T29 — Hostnames recover, and two daemons share a machine, end to end

slice: S6
kind: integration
covers: none
size: M
est: 60 code, 160 tests
executor: agent
difficulty: routine
model: standard
diagnostics: each daemon log from the run shows its bind failures, retries and recovery
observability: the case prints each activate and ls with the warning text it showed
layers:
- e2e:
- scripts/session-e2e.sh: adds the case hostnames_recover_and_two_daemons_route
test: ./scripts/session-e2e.sh hostnames_recover_and_two_daemons_route
produces: none
consumes: none
proof: occupy the proxy port and activate to see the reason and the remedy; free it and ls clears without a restart; a lost switch datapath warns within a minute; two daemons on one machine both route names on ports min discovers.
depends on:
- blocked by #1627
- blocked by #1620
- blocked by #1621
- blocked by #1622

Proof

The new hostnames_recover_and_two_daemons_route case in scripts/session-e2e.sh now shows, on a real run: hold the proxy port, activate, and both activate and min ls print the bind failure's reason, its remedy (the lsof line) and the recovery sentence naming the command; free the port and min ls clears the warning and reports the listening line on the pinned port with the same daemon pid — no restart — while the daemon log shows the unavailable warns with their next-retry schedule and the recovered/serving infos; move the switch socket away and minvmd warns 'switch datapath lost' within its monitor period (VM lanes); a second daemon under its own state dir relocates off its busy default, min ls discovers both ports, and each box's name routes through its own daemon while the other refuses it.

Notes from the agent: Only scripts/session-e2e.sh touched. Ran the test line three times, final run after the last commit (exit 0). Lane realities on this box: (1) the in-box routing matrix of beat D skipped through the honest exec gate — this host's sandbox cannot spawn a session program ('sandbox supervisor has no child process'), the same gate the proxy proof already carries, failing instead on CI/VM lanes; the per-daemon 200/502 matrix therefore has not been observed locally, only the rest of beat D. (2) Daemon 2's relocation and selected-serving log records were verified against real daemon output in a manual probe (the exec gate skips before those greps run in a degraded run). (3) Beat C needs a VM lane (E2E_VM + MINVMD_GVPROXY_BIN + artifacts) — not runnable here; its native-lane skip prints and names that. (4) The test line needs the min/minimald pair resolvable: this workspace builds into $CARGO_TARGET_DIR (/work/build-cache/target), which the script's min resolution honors, as CI's native lane does via PATH; a runner sandbox re-running the raw line without a build will hit the script's own binary gate with a message naming the fix. Fixes made while…[truncated]

Tests

line exit tail
./scripts/session-e2e.sh hostnames_recover_and_two_daemons_route 0 ::group::hostnames recover, and two daemons share a machine (NET-020..NET-027) beat A: pinning the daemon to 127.0.0.1:18754 and holding it port holder: python3 holding 127.0.0.1:18754 (pid 61) activate warned: Applying loadouts: default warning: session hostnames will not route: the daemon coul

Verify

min task run agent-verify passed ([tasks.verify]).

Base

The base branch moved while the coder worked and was merged in before the tests ran. These files changed on BOTH sides since the branch point — read them first, because a rewrite from a stale reading can undo a merge without a conflict:

  • scripts/session-e2e.sh

Closes #1637

Add the hostnames_recover_and_two_daemons_route case to
scripts/session-e2e.sh (NET-020..NET-027), driving the shipped surfaces
the way a person does — activate, min ls, and a request from inside a
box:

- beat A: a python3 holder occupies the pinned proxy port before the
  daemon starts, so both activate and min ls warn with the daemon's
  bind report — reason, remedy and the recovery sentence naming the
  command it rode on — and the daemon log carries the unavailable
  record with its next-retry schedule
- beat B: freeing the port clears the warning and restores the
  listening line on the same pid (pgrep continuity), with the
  recovered and serving records in the daemon log
- beat C (VM lanes): moving the gvproxy switch socket aside makes
  minvmd warn 'switch datapath lost' within its monitor period
- beat D: a second daemon under its own state dir relocates off its
  busy default to a selected port, min ls discovers both ports, and
  each box's name routes through its own daemon while the other
  refuses it

Lanes gate by observed fact: the VM branch proves only beat C (the
guest pid-1 pins no port), the native lane prints beat C's skip, and
the in-box half degrades only off-CI when a host cannot exec.
The file log renders its JSON fields alphabetically, so next_retry
sorts before status and addr before status — a single ordered glob
pattern could never match a real record; assert each substring in its
own check.

Read the pinned daemon's pid off /proc instead of pgrep -f: slim and
musl images ship no procps, and the /proc scan needs no tool at all
(the 2>/dev/null goes before the file redirect so pids that vanish
mid-scan print no noise).
…recover-and-two-daemons-share-a-machin

# Conflicts:
#	scripts/session-e2e.sh
@coderabbitai
coderabbitai Bot commented Sep 25, 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: 6207e2d1-5f90-4de0-862d-822b45387fb9

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.

@minimal-foundry
minimal-foundry Bot commented Sep 25, 2026 •
Copy link
Copy Markdown
Contributor Author

Approved: no findings at d9374c3c3df8.

Nothing to do.

Clobber: none: git log on the file shows the merge of origin/main plus this branch's own commits; nothing recent reverted.

@norrietaylor
Copy link
Copy Markdown
Member

Babysitter review against T29's plan block (one layer, scripts/session-e2e.sh; test line ./scripts/session-e2e.sh hostnames_recover_and_two_daemons_route; passed in the coder sandbox, exit 0).

  • The four beats of the proof are all present: A occupies the proxy port and asserts the reason and the remedy at activate and on min ls (NET-020); B frees it and asserts the warning clears with the same daemon pid, so no restart (NET-021, NET-022); C moves the minvmd switch socket and asserts the datapath-lost warning within a minute, then restores and checks the socket is back (NET-023); D brings up a second daemon under its own state dir and asserts both route names on distinct discovered ports (NET-024 to NET-027).
  • Diagnostics field met: the daemon log's bind-failure record with its status and retry schedule, and the recovered and serving records, are asserted, which is what the bundle tails. Observability met: each activate and ls warning text is printed.
  • Lane split is honest: the VM branch proves only C (the daemon is pid-1 with no pin-able port, and a second daemon would be another VM), and prints what it skipped; native proves A, B, D and says C has no switch to lose. The second daemon and the moved socket are both restored in teardown.
  • Ordering: the case is placed before min_internal_names_through_proxy in the whole-lane run. T6 — Retired surfaces gone, end to end #1717 (T6) places its case last and touches the same dispatch list, so whichever of the two merges second needs a base merge; I handle that.

No findings. Merge after the lanes, minimal-review and CodeRabbit conclude.

@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 scripts/session-e2e.sh Resolved
@norrietaylor
Copy link
Copy Markdown
Member

Native lane failure on d879883 (run for native-daemon-e2e), for round 1: beats A, B and the two-daemon discovery in D all passed, then the script died under set -u:

./scripts/session-e2e.sh: line 2344: RECOVER_BOX_PORT: unbound variable

RECOVER_BOX_PORT is read in beat D before anything assigns it. Define it with the other beat constants (the in-box responder's listen port) before the second-daemon session is exercised. Nothing else in the case failed before that line.

Beat D's routing half dereferenced RECOVER_BOX_PORT, RECOVER_BOX_MARKER
and SECOND_BOX_PORT without ever assigning them: under `set -u` the
first bare reference aborted the run with an unbound-variable error
instead of reaching a graceful fail. It escaped the author's runs
because those hosts cannot exec a session sandbox, so beat D degraded
at the exec gate before the references; on a lane whose sandbox can
exec (ci-linux-native) the case aborted.

Define the three at the top of the proof. The ports are fixed low
ports, deliberately out of reach of the daemons' own port picks (a
relocating daemon asks the OS, which only serves the ephemeral range),
and the marker matches the proxy proof's one-marker-per-run pattern:
the URL's port, not the body, is what names the box.
@minimal-foundry
Copy link
Copy Markdown
Contributor Author

Round 1 of 10 on the runtime's review findings, pushed as 30963f65979c.

line exit tail
./scripts/session-e2e.sh hostnames_recover_and_two_daemons_route 0 ::group::hostnames recover, and two daemons share a machine (NET-020..NET-027) beat A: pinning the daemon to 127.0.0.1:18754 and holding it port holder: python3 holding 127.0.0.1:18754 (pid 61) activate warned: Applying loadouts: default warning: session hostnames will not route: the daemon coul

Verify min task run agent-verify passed.

Review threads the coder judged:

  • 👍 valid — scripts/session-e2e.sh:2377: Defined the three constants at the top of the proof (RECOVER_BOX_PORT=18080, SECOND_BOX_PORT=18081, RECOVER_BOX_MARKER='RECOVER_ROUTED_OK'); the set -u abort at the first bare reference is gone, and the case runs to 'session e2e OK'.

Occupy the daemon's hostname-proxy port and min session activate and min ls both warn with the bind failure's reason and remedy (observed); free the port and min ls clears the warning with the daemon pid unchanged — no restart (observed, 2-4 one-second polls); on a VM lane a lost switch socket warns within a minute (native lane here: skipped honestly as designed); two daemons on one machine come up on distinct ports min ls discovers (observed). Beat D's in-box routing matrix no longer aborts the run with an unbound variable on lanes whose sandbox can exec.

Notes from the agent: Revise round 1 — addressed thread PRRT_kwDOPdfcxM6mJpQ0: defined RECOVER_BOX_PORT=18080, SECOND_BOX_PORT=18081 and RECOVER_BOX_MARKER at the top of proof_hostnames_recover_and_two_daemons_route, with the rationale that a relocating daemon always lands in the OS ephemeral range so it can never take these ports. This host's sandbox cannot exec a session program ('sandbox supervisor has no child process'), so the routing half degraded at the exec gate exactly as on the author's host; the previously-aborting references therefore ran only up to the gate here, but every reference sits below an unconditional assignment at function entry, so the set -u abort is gone by construction — ci-linux-native (gate passes) is where they execute, and the runner re-runs the line there. Second run on this box failed at beat A staging: the scan judged 18754 free and the holder's bind milliseconds later lost it to residue of the immediately preceding run (its dying daemon); a fresh third run passed exit 0 — pre-existing back-to-back flake, unrelated to the finding. No files touched outside the layer.

@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 — approved

Verdict APPROVE — No findings.

@minimal-foundry minimal-foundry Bot added the review:approved minimal-review approved the current head label Sep 25, 2026
@norrietaylor
norrietaylor enabled auto-merge (squash) September 26, 2026 05:34
@norrietaylor
norrietaylor merged commit 973f507 into main Sep 26, 2026
33 checks passed
@norrietaylor
norrietaylor deleted the agent/1637-hostnames-recover-and-two-daemons-share-a-machin branch September 26, 2026 05:34
@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.

Babysitter approval: reviewed against T29's plan block, minimal-review approved on 30963f6 and on the base merge d9374c3, CodeRabbit posted, no open threads, all five lane aggregators green.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

review:approved minimal-review approved the current head

Projects

None yet

Development

Successfully merging this pull request may close these issues.

T29 — Hostnames recover, and two daemons share a machine, end to end

1 participant

35CA @norrietaylor
0