8000 fix(minimal): min box events --parent --follow adds the stream of a child that is created after the by minimal-foundry[bot] · Pull Request #3391 · gominimal/minimal · GitHub
[go: up one dir, main page]

Skip to content

fix(minimal): min box events --parent --follow adds the stream of a child that is created after the - #3391

Merged
agent-137 merged 10 commits into
mainfrom
agent/3346-min-box-events-parent-follow-adds-the-stream-of
Nov 14, 2026
Merged

agent-137 merged 10 commits into
mainfrom
agent/3346-min-box-events-parent-follow-adds-the-stream-of

Conversation

@minimal-foundry
Copy link
Copy Markdown
Contributor

Defect

Fixes #3346

Task marker
### D3024 — min box events --parent --follow adds the stream of a child that is created after the follow starts
  kind: task
  size: S
  est: 70 code, 80 tests
  executor: agent
  defect: bug
  epic: 2879
  layers:
    - cli:
      - crates/minimal/src/cmd/boxes/events.rs: Under --parent --follow, re-list the parent's children on a bound and add a reader to the merge for each new child. Remove the interim comment that names issue 3024.
      - crates/minimal/src/tests.rs: Add events_parent_follow_picks_up_new_children: start a --parent --follow, make a new child of the parent, and read the child's events from the follow.
      test: cargo test -p minimal events_parent_follow_picks_up_new_children
  proof: A box that becomes a child of the parent after `min box events --parent <box> --follow` starts has its events in the output of the follow.

Proof

When a box becomes a child of the parent after min box events --parent <box> --follow starts, its events now appear in the output of that follow, within about one second.

Notes from the agent: Under --parent --follow, min lists the boxes again every second (CHILD_POLL) and opens a follow read for each new child of the parent. A failed open for a new child is tried again at the next poll. The follow now ends only when every followed child has ended and the parent is gone from the listing. Before, it ended when every child at the start was removed. A failed re-list ends the command with this error: 'Could not find the new child boxes of box

. Run min box show <address> to check that the box still exists.' Behaviour change: under --follow, a parent with no child yet is followed and prints nothing. The note 'Box has no child boxes on host .' is still printed without --follow. The interim comment that named issue 3024 is removed. The new test fails without the fix: it times out at the 30 s deadline. The other events_ tests pass, and clippy -p minimal --all-targets and fmt are clean.

Tests

line exit tail
cargo test -p minimal events_parent_follow_picks_up_new_children 0 running 1 test test tests::events_parent_follow_picks_up_new_children ... ok test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 953 filtered out; finished in 1.91s running 0 tests test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 34 filtered out; finished in 0.00s running 0

Verify

min task run agent-verify exited 100, so this PR is a draft.

 {
                "parent_span_id": "802ab1d7a40b8b16",
                "rpc": "minimald-v1-GetSessionRecord",
                "span_id": "e7dc1beb15e00ccf",
                "trace_id": "0af7651916cd43dd8448eb211c803111",
            },
            parent: None,
            closed: true,
        },
        LoggedSpan {
            name: "sessions.manager.message",
            fields: {
                "kind": "GetRecord",
                "parent_span_id": "e7dc1beb15e00ccf",
                "queued_behind": "0",
                "span_id": "1d447ba29c7ab143",
                "trace_id": "0af7651916cd43dd8448eb211c803111",
            },
            parent: None,
            closed: true,
        },
        LoggedSpan {
            name: "rpc",
            fields: {
                "parent_span_id": "802ab1d7a40b8b16",
                "rpc": "minimald-v1-DestroySession",
                "span_id": "9e93e0bf201fc33b",
                "trace_id": "0af7651916cd43dd8448eb211c803111",
            },
            parent: None,
            closed: true,
        },
        LoggedSpan {
            name: "sessions.manager.message",
            fields: {
                "kind": "GetRecord",
                "parent_span_id": "9e93e0bf201fc33b",
                "queued_behind": "0",
                "span_id": "200f8d7ecf8303a8",
                "trace_id": "0af7651916cd43dd8448eb211c803111",
            },
            parent: None,
            closed: true,
        },
        LoggedSpan {
            name: "sessions.manager.message",
            fields: {
                "kind": "DeleteSession",
                "parent_span_id": "9e93e0bf201fc33b",
                "queued_behind": "0",
                "span_id": "7ca70f77bf2d6841",
                "trace_id": "0af7651916cd43dd8448eb211c803111",
            },
            parent: None,
            closed: true,
        },
        LoggedSpan {
            name: "session.message",
            fields: {
                "kind": "Destroy",
                "parent_span_id": "7ca70f77bf2d6841",
                "span_id": "9121740562f17358",
                "trace_id": "0af7651916cd43dd8448eb211c803111",
            },
            parent: None,
            closed: true,
        },
        LoggedSpan {
            name: "sessions.manager.message",
            fields: {
                "kind": "HandOverName",
                "parent_span_id": "7ca70f77bf2d6841",
                "queued_behind": "0",
                "span_id": "0f465bbd2b538db9",
                "trace_id": "0af7651916cd43dd8448eb211c803111",
            },
            parent: None,
            closed: true,
        },
    ]
    note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

  Cancelling due to test failure: 
────────────
     Summary [  77.561s] 1114 tests run: 1113 passed, 1 failed, 2 skipped
        FAIL [   3.296s] (1114/1114) minimal::otel_cli exec_run_attach_and_task_run_share_the_commands_trace
error: test run failed

Base

The base branch moved while the coder worked; it was merged in before the tests ran.

Under --parent --follow, min lists the parent's children again each
second and adds the stream of each new child to the follow. The follow
ends when every followed box and the parent are removed. A parent with
no child yet is followed too, in place of the no-children note.
@coderabbitai
coderabbitai Bot commented Nov 13, 2026 •
Copy link
Copy Markdown
Contributor

Important

Review skipped

Bot user detected.

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

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 99380093-dfb5-45b6-b73a-e900f903fa29

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
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

@minimal-foundry
minimal-foundry Bot commented Nov 13, 2026 •
Copy link
Copy Markdown
Contributor Author

Approved: no findings at 3d4f76f03b3e.

Nothing to do.

Verdict APPROVE, posted as a comment: the App cannot review its own pull request; the check and the label carry it.

Clobber: none seen in git log for events.rs.

@minimal-arch minimal-arch 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.

arch-review: PASS · the full ruling

The change conforms to the design. Line 504 of architecture.md says min box events --parent self --follow merges all children into one stream. The follow now finds a new child each second and adds its replay-then-tail read to the merge, so no event is lost (line 502). The follow ends only when the parent is removed and every reader ended. Children of an exited parent therefore stay followed. The interim for issue 3024 is removed because the fix lands.

Ruled at 12ef362 against gominimal/arch@15b603e6afb8 by claude-opus-5-5.

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

Panel: 2 of 3 personas ran (correctness, security); did not complete: supply-chain.

Comment thread crates/minimal/src/cmd/boxes/events.rs Resolved
A new child that each listing shows but whose events read fails to
open ends the follow with the open error after five tries, in place
of a silent gap.
@minimal-foundry
Copy link
Copy Markdown
Contributor Author

Round 1 of 10 on the runtime's review findings, pushed as 210b60944c21.

line exit tail
cargo test -p minimal events_parent_follow_picks_up_new_children 0 running 1 test test tests::events_parent_follow_picks_up_new_children ... ok test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 958 filtered out; finished in 1.74s running 0 tests test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 34 filtered out; finished in 0.00s running 0

Verify min task run agent-verify exited 100.

 {
                "parent_span_id": "b79d8db45ec31352",
                "rpc": "minimald-v1-GetSessionRecord",
                "span_id": "768cf4d4b8be57ff",
                "trace_id": "0af7651916cd43dd8448eb211c803111",
            },
            parent: None,
            closed: true,
        },
        LoggedSpan {
            name: "sessions.manager.message",
            fields: {
                "kind": "GetRecord",
                "parent_span_id": "768cf4d4b8be57ff",
                "queued_behind": "0",
                "span_id": "8ccdf65430d1722d",
                "trace_id": "0af7651916cd43dd8448eb211c803111",
            },
            parent: None,
            closed: true,
        },
        LoggedSpan {
            name: "rpc",
            fields: {
                "parent_span_id": "b79d8db45ec31352",
                "rpc": "minimald-v1-DestroySession",
                "span_id": "390af463898f168b",
                "trace_id": "0af7651916cd43dd8448eb211c803111",
            },
            parent: None,
            closed: true,
        },
        LoggedSpan {
            name: "sessions.manager.message",
            fields: {
                "kind": "GetRecord",
                "parent_span_id": "390af463898f168b",
                "queued_behind": "0",
                "span_id": "46dccf62d46a4a86",
                "trace_id": "0af7651916cd43dd8448eb211c803111",
            },
            parent: None,
            closed: true,
        },
        LoggedSpan {
            name: "sessions.manager.message",
            fields: {
                "kind": "DeleteSession",
                "parent_span_id": "390af463898f168b",
                "queued_behind": "0",
                "span_id": "6316005a65ace9c6",
                "trace_id": "0af7651916cd43dd8448eb211c803111",
            },
            parent: None,
            closed: true,
        },
        LoggedSpan {
            name: "session.message",
            fields: {
                "kind": "Destroy",
                "parent_span_id": "6316005a65ace9c6",
                "span_id": "f2db3d4510b1647b",
                "trace_id": "0af7651916cd43dd8448eb211c803111",
            },
            parent: None,
            closed: true,
        },
        LoggedSpan {
            name: "sessions.manager.message",
            fields: {
                "kind": "HandOverName",
                "parent_span_id": "6316005a65ace9c6",
                "queued_behind": "0",
                "span_id": "9a130ba1b8335a85",
                "trace_id": "0af7651916cd43dd8448eb211c803111",
            },
            parent: None,
            closed: true,
        },
    ]
    note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

  Cancelling due to test failure: 
────────────
     Summary [  73.174s] 1119 tests run: 1118 passed, 1 failed, 2 skipped
        FAIL [   3.144s] (1119/1119) minimal::otel_cli exec_run_attach_and_task_run_share_the_commands_trace
error: test run failed

Converted to a draft: something above needs a person before review.

Review threads the coder judged:

  • 👍 valid — crates/minimal/src/cmd/boxes/events.rs:332: Bounded the retries: after 5 listings in a row that show a new child whose events read fails to open, the follow ends with the open error that names the child.

A box that becomes a child of the parent after min box events --parent <box> --follow starts has its events in the output of the follow. A new child whose events read never opens now ends the follow with an error that names the child, in place of a silent gap.

Notes from the agent: Revise round 1: ChildWatch counts failed opens per new child. After 5 listings in a row that show the child and fail to open it, the follow ends with the existing open error ("Could not read the events of box . Run min box show <label> to check that the box still exists."). A child gone from the listing loses its count. No new test pins the bound, because the test harness has no way to make an open fail for a listed child.

@minimal-foundry
minimal-foundry Bot marked this pull request as draft November 13, 2026 15:44
@minimal-arch minimal-arch 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.

arch-review: PASS · the full ruling

The compare adds one change. A new child whose events read fails to open at five polls in a row now ends the follow with the open error. Before, the merged stream left out that child silently. Lines 502 and 504 of architecture.md say the follow merges all children and misses nothing. This change keeps the follow closer to that. The earlier PASS on 12ef3626 stands for the rest of the PR.

Ruled at 210b609 against gominimal/arch@15b603e6afb8 by claude-opus-5-5.

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

Panel: 3 of 3 personas ran (correctness, security, supply-chain).

Comment thread crates/minimal/src/cmd/boxes/events.rs Resolved
A failed re-list of the parent's children no longer ends the follow at once. Five failed listings in a row end it with the list error.
@minimal-foundry
Copy link
Copy Markdown
Contributor Author

Round 2 of 10 on the runtime's review findings, pushed as 14e31d61e9d3.

line exit tail
cargo test -p minimal events_parent_follow_picks_up_new_children 0 running 1 test test tests::events_parent_follow_picks_up_new_children ... ok test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 958 filtered out; finished in 1.50s running 0 tests test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 34 filtered out; finished in 0.00s running 0

Verify min task run agent-verify exited 100.

 {
                "parent_span_id": "0ee816a1161823fc",
                "rpc": "minimald-v1-GetSessionRecord",
                "span_id": "7bb2b7f853d4cdec",
                "trace_id": "0af7651916cd43dd8448eb211c803111",
            },
            parent: None,
            closed: true,
        },
        LoggedSpan {
            name: "sessions.manager.message",
            fields: {
                "kind": "GetRecord",
                "parent_span_id": "7bb2b7f853d4cdec",
                "queued_behind": "0",
                "span_id": "87bbe50e235f3771",
                "trace_id": "0af7651916cd43dd8448eb211c803111",
            },
            parent: None,
            closed: true,
        },
        LoggedSpan {
            name: "rpc",
            fields: {
                "parent_span_id": "0ee816a1161823fc",
                "rpc": "minimald-v1-DestroySession",
                "span_id": "b786a595d6af7cc6",
                "trace_id": "0af7651916cd43dd8448eb211c803111",
            },
            parent: None,
            closed: true,
        },
        LoggedSpan {
            name: "sessions.manager.message",
            fields: {
                "kind": "GetRecord",
                "parent_span_id": "b786a595d6af7cc6",
                "queued_behind": "0",
                "span_id": "f52713f37610958e",
                "trace_id": "0af7651916cd43dd8448eb211c803111",
            },
            parent: None,
            closed: true,
        },
        LoggedSpan {
            name: "sessions.manager.message",
            fields: {
                "kind": "DeleteSession",
                "parent_span_id": "b786a595d6af7cc6",
                "queued_behind": "0",
                "span_id": "d7cbb162c9eee691",
                "trace_id": "0af7651916cd43dd8448eb211c803111",
            },
            parent: None,
            closed: true,
        },
        LoggedSpan {
            name: "session.message",
            fields: {
                "kind": "Destroy",
                "parent_span_id": "d7cbb162c9eee691",
                "span_id": "8b99fdb1569eb066",
                "trace_id": "0af7651916cd43dd8448eb211c803111",
            },
            parent: None,
            closed: true,
        },
        LoggedSpan {
            name: "sessions.manager.message",
            fields: {
                "kind": "HandOverName",
                "parent_span_id": "d7cbb162c9eee691",
                "queued_behind": "0",
                "span_id": "a0f98ccfa710cd4a",
                "trace_id": "0af7651916cd43dd8448eb211c803111",
            },
            parent: None,
            closed: true,
        },
    ]
    note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

  Cancelling due to test failure: 
────────────
     Summary [  67.061s] 1119 tests run: 1118 passed, 1 failed, 2 skipped
        FAIL [   2.887s] (1119/1119) minimal::otel_cli exec_run_attach_and_task_run_share_the_commands_trace
error: test run failed

Converted to a draft: something above needs a person before review.

Review threads the coder judged:

  • 👍 valid — crates/minimal/src/cmd/boxes/events.rs: new_children now counts failed listings in a row and ends the follow only after CHILD_LIST_TRIES (5). A success resets the count.

A box that becomes a child of the parent after min box events --parent <box> --follow starts has its events in the output of the follow. A short failure to list the boxes no longer ends that follow.

Notes from the agent: Revise round 2: a failed re-list of the children now keeps the follow. Five failed listings in a row (CHILD_LIST_TRIES) end it with the same error text as before. A successful listing rese 8BD0 ts the count. No new test pins the retry bound. cargo clippy -p minimal --all-targets is clean.

@norrietaylor
norrietaylor marked this pull request as ready for review November 13, 2026 17:07
@minimal-arch minimal-arch 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.

arch-review: PASS · the full ruling

The compare conforms, and the PASS on 210b6094 stands. Commit 1cab2c0e keeps --parent --follow open through four failed listings of the children. The fifth failure in a row ends the command with the same error. Line 502 says --follow replays, so a child found after the outage loses no events. Nothing more is necessary.

Ruled at 14e31d6 against gominimal/arch@15b603e6afb8 by claude-opus-5-5.

@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 — minimal-foundry[bot] crates/minimal/src/cmd/boxes/events.rs:349, minimal-foundry[bot] crates/minimal/src/cmd/boxes/events.rs. No findings.

Panel: 3 of 3 personas ran (correctness, security, supply-chain).

@bryan-minimal bryan-minimal 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.

Read at 14e31d6 against #3346, the daemon's events channel and the client's reader. The main change is
right: a new child is found by listing the host once a second (one manager message, no disk walk) and
joins the follow with a replay-then-tail read, so no event is lost; plain --follow without --parent is
untouched (no watch, the poll branch disabled). Two things before it merges, both in the code the last two
commits added:

  • A child removed right after a listing ends the whole follow. The daemon answers the subsystem request
    before it reads anything about the box (crates/minimald/src/rpc.rs:3630, handed to the events handler at
    3717), and looks the id up only inside the stream (rpc.rs:2490-2497); an unknown id is written as extended
    data and the channel closed (2481). The client's read_box_events (crates/minimal-client/src/lib.rs:1129
    via 1103 and 1058) returns Ok on the channel's success message and never waits for a first line, so for a
    child that is already gone the open succeeds. The refusal then arrives in the line reader (lib.rs:1387),
    becomes "Could not read the events of box X" (events.rs:393), travels through the merge channel and the
    next? at events.rs:493 ends the command, parent and other children healthy. So the retry at
    events.rs:331-350 and its comment ("a failed open is tried again") cover only a channel refused outright or
    a dropped connection; the case the comment names never reaches the counter. A reader the watch added should
    treat a refusal before its first event as "not opened yet": retry it, or drop it if the next listing no
    longer shows the child (or read the first line in new_children before adding the reader). Then test it.
  • Discovery runs inside the output loop, so a slow list stops all output (events.rs:500). A ListBoxes that
    hangs behind a busy manager waits up to the 60 s RPC timeout per try, and healthy streams print nothing
    meanwhile; the "short outage" allowance is about four seconds when calls fail fast and about five minutes of
    silence when they time out. The open has no timeout at all, so one wedged open freezes the follow. Run
    discovery in its own task that sends new reads over a channel, with a short timeout on both the list and
    the open.

Also, the second and third commits (stop on a child that never opens; survive a short list outage) have no
test: nothing drives the five-try bounds, the reset after a success, or the ending when the parent is
removed, and the existing test cancels the follow rather than letting it stop. One test per behaviour.

Smaller, no ask: finished readers stay in the JoinSet and the seen set only grows (events.rs:465), so a
parent that churns children grows without bound; collect finished readers on each poll. A parent with no
children prints "has no child boxes" without --follow and nothing with it, which reads as a hang; one stderr
line ("no child boxes yet; waiting") would do. Once-a-second polling emits a daemon list span and an info
line per poll, about 86k of each per day per follower; debug level for this path. A child created just
before the parent is removed is never added, since the watch returns before scanning the last listing
(events.rs:324); fine, but say so in the docs.

Checked and fine: every error return drops the reader set, which aborts the readers; when the parent is
removed the watch and sender drop and the loop ends after the last reader; each child is opened once and a
reaped child never reopened; a joining child replays by arrival, as the initial children do; open-failure
counts leave when the box leaves the listing; Ctrl-C is unchanged. The commitlint check is red only on
merge-commit headlines, which a squash drops.

@agent-137
Copy link
Copy Markdown
Member

/revise

Head 14e31d61. @bryan-minimal's CHANGES_REQUESTED review. Do his three asks. Change nothing else.

1. A refusal before a reader's first event is "not opened yet", not an error.
For a child that is already gone, the daemon writes the refusal as extended data and closes the channel. read_box_events (crates/minimal-client/src/lib.rs, about lines 1058–1129) returns Ok on the channel's success message and never waits for a first line. So the open "succeeds", the refusal arrives in the line reader (lib.rs:1387), becomes "Could not read the events of box X" (events.rs:393), and the next? at events.rs:493 ends the whole command while the parent and the other children are healthy. The retry at events.rs:331–350 therefore never sees the case its comment names.

Fix: a reader the watch added treats a refusal before its first event as not opened yet. Either retry it, or drop it when the next listing no longer shows the child. Alternatively, read the first line in new_children before adding the reader. Add a test.

2. Discovery runs in its own task, with timeouts.
Discovery runs inside the output loop (events.rs:500), so a ListBoxes that hangs behind a busy manager blocks all output, for up to the 60 s RPC timeout per try. The open has no timeout at all. Move discovery into its own task that sends new readers over a channel. Put a short timeout on both the list and the open, so healthy streams keep printing while discovery waits.

3. One test per behaviour of the second and third commits.
Add a test for each:

  • the five-try bound on a child that never opens;
  • the reset after a success;
  • the bound on consecutive list failures;
  • the follow ending when the parent is removed, as a stop, not a cancel.

His "smaller, no ask" items are optional. If you take any, keep them small: reap finished readers each poll, print a one-line "no child boxes yet; waiting" on stderr, and log the per-poll lines at debug level. crates/minimal-client/src/lib.rs is outside layers:, but the change needs it.

Reply on his review and on threads PRRT_kwDOPdfcxM63J7_f and PRRT_kwDOPdfcxM63K1ec with the commit. Run the whole minimal and minimal-client suites.

@minimal-foundry
Copy link
Copy Markdown
Contributor Author

That /revise is held, not dropped. A coder is already running on #3346. Your note is kept and goes into the next round here, which starts when that coder finishes.

Nothing to type again: the command gets a rocket when its round starts, or a refusal that names the reason. No round was counted for it yet.

Under `min box events --parent --follow`, the child watch now runs in its
own task and sends new reads to the output loop. A slow listing or open no
longer stops the output of the streams already in the follow. Each listing
and each open has a 5 s timeout and counts as a failure after it.

A new child whose read the daemon refuses before its first event is not
in the follow yet. The next listing that shows it opens it again, and a
child gone from the listing is dropped. Finished readers leave the set on
each poll, and the seen set keeps only listed children.

A follow of a parent with no child yet prints one line on stderr. Tests
drive the retry, the drop, the open and list try bounds, a hung listing,
and the end when the parent is removed.
@minimal-foundry
Copy link
Copy Markdown
Contributor Author

Round 3 of 10 on a review requesting changes, pushed as 7cde2e460e2f.

line exit tail
cargo test -p minimal events_parent_follow_picks_up_new_children 0 running 1 test test tests::events_parent_follow_picks_up_new_children ... ok test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 967 filtered out; finished in 1.56s running 0 tests test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 34 filtered out; finished in 0.00s running 0

Verify min task run agent-verify exited 100.

 {
                "parent_span_id": "e76ad6ee057a2e2b",
                "rpc": "minimald-v1-GetSessionRecord",
                "span_id": "9604037accf5536e",
                "trace_id": "0af7651916cd43dd8448eb211c803111",
            },
            parent: None,
            closed: true,
        },
        LoggedSpan {
            name: "sessions.manager.message",
            fields: {
                "kind": "GetRecord",
                "parent_span_id": "9604037accf5536e",
                "queued_behind": "0",
                "span_id": "70cb66d09e9e2d87",
                "trace_id": "0af7651916cd43dd8448eb211c803111",
            },
            parent: None,
            closed: true,
        },
        LoggedSpan {
            name: "rpc",
            fields: {
                "parent_span_id": "e76ad6ee057a2e2b",
                "rpc": "minimald-v1-DestroySession",
                "span_id": "fe203d9fb0c5756a",
                "trace_id": "0af7651916cd43dd8448eb211c803111",
            },
            parent: None,
            closed: true,
        },
        LoggedSpan {
            name: "sessions.manager.message",
            fields: {
                "kind": "GetRecord",
                "parent_span_id": "fe203d9fb0c5756a",
                "queued_behind": "0",
                "span_id": "7da5859323c20aab",
                "trace_id": "0af7651916cd43dd8448eb211c803111",
            },
            parent: None,
            closed: true,
        },
        LoggedSpan {
            name: "sessions.manager.message",
            fields: {
                "kind": "DeleteSession",
                "parent_span_id": "fe203d9fb0c5756a",
                "queued_behind": "0",
                "span_id": "6aea101be1f0186c",
                "trace_id": "0af7651916cd43dd8448eb211c803111",
            },
            parent: None,
            closed: true,
        },
        LoggedSpan {
            name: "session.message",
            fields: {
                "kind": "Destroy",
                "parent_span_id": "6aea101be1f0186c",
                "span_id": "dd033ea024f23a3f",
                "trace_id": "0af7651916cd43dd8448eb211c803111",
            },
            parent: None,
            closed: true,
        },
        LoggedSpan {
            name: "sessions.manager.message",
            fields: {
                "kind": "HandOverName",
                "parent_span_id": "6aea101be1f0186c",
                "queued_behind": "0",
                "span_id": "ba4ace0f00f1cd56",
                "trace_id": "0af7651916cd43dd8448eb211c803111",
            },
            parent: None,
            closed: true,
        },
    ]
    note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

  Cancelling due to test failure: 
────────────
     Summary [  66.584s] 1128 tests run: 1127 passed, 1 failed, 2 skipped
        FAIL [   2.865s] (1128/1128) minimal::otel_cli exec_run_attach_and_task_run_share_the_commands_trace
error: test run failed

Converted to a draft: something above needs a person before review.

A box that becomes a child of the parent after min box events --parent <box> --follow starts now has its events in the output of the follow. A child that the daemon refuses before its first event is opened again on the next listing, or dropped if the listing no longer shows it. A slow listing or open does not stop the output of the streams already in the follow.

Notes from the agent: Review round 3. (1) Refusal before the first event: the reader of a new child sends its first update back to the watch. An error there removes the child from the seen set and counts one failure. The next listing that shows the child opens it again. A child gone from the listing is dropped. After CHILD_OPEN_TRIES failures in a row while the child is still listed, the follow ends with the error. (2) Discovery now runs in its own task (watch_children). That task sends events and errors over the output channel. Each listing and each open has a 5 s timeout (CHILD_CALL_TIMEOUT), and a timeout counts as a failure. (3) There is now one test per behaviour, run on a paused clock against a fake host (ChildSource and EventLines traits): retry after a refusal, drop of a gone child, the open try bound, the list try bound with its reset after a working listing, output while a listing hangs, and the end when the parent is removed. Smaller points: finished readers leave the JoinSet on each poll, and the seen set keeps only the children the last listing showed. A follow of a parent with no child yet prints one stderr line: 'Box has no child boxes on host yet. The events of each new child box print here. Press Ctrl-C to stop.' No per-poll log line is left in events.rs on the healthy path. The info-level 'client.rpc' span in crates/minimal-client and the daemon's ListBoxes span still fire once per poll. Both are outside this task's layers (minimal-client/src/lib.rs, minimald/src/rpc.rs). The limit about a child created just before the parent is removed is documented in the rustdo…[truncated]

Split the list outage test of `min box events --parent --follow` in
two: one for the reset of the count after a listing works, one for
the end after five failed listings in a row. Add a test for a new
child whose read opens on its last try.
@agent-137
agent-137 marked this pull request as ready for review November 13, 2026 18:15
@agent-137 agent-137 removed the needs-human An agent handed off; a human must act, then clear this label. Set by defer and handoffs. label Nov 13, 2026
@agent-137
Copy link
Copy Markdown
Member

/revise

Head 7cde2e46. needs-human was removed with the owner's OK (2026-11-13). This repeats the held /revise above so a round starts. f25a2dc already moved discovery into its own task (ask 2), so keep that. Still to do, as the held note says:

  • Ask 1: a refusal before a reader's first event counts as not opened yet. Retry it, or drop it when the next listing no longer shows the child, so a child that is already gone does not end the command. Add a test.
  • Ask 3: add one test for each of these: the five-try bound on a child that never opens; the reset after a success; the bound on consecutive list failures; the follow ending when the parent is removed, as a stop, not a cancel.

Also put a short timeout on the open and the list in the discovery task, if f25a2dc has none. Reply on Bryan's review with the commit.

@minimal-foundry
Copy link
Copy Markdown
Contributor Author

That /revise is held, not dropped. A coder is already running on #3346. Your note is kept and goes into the next round here, which starts when that coder finishes.

Nothing to type again: the command gets a rocket when its round starts, or a refusal that names the reason. No round was counted for it yet.

@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 D3024 at 7cde2e46. Under --parent --follow, ChildWatch lists the boxes again every CHILD_POLL (1 s) and opens a read for each new child of the parent, which joins the merged follow. A child gone from the listing is dropped. Both retry bounds from the LOW threads are in: CHILD_OPEN_TRIES (5 failed opens in a row of one child end the follow with that child's error) and CHILD_LIST_TRIES (5 failed listings in a row end it). A success resets each count, and every call is bounded by CHILD_CALL_TIMEOUT. events_parent_follow_picks_up_new_children proves the plan's claim, and the gone-child and never-opens cases are tested. Nit, no ask: after five failed listings the person sees a generic message; the underlying error is only in the warn log. Arch: PASS on head.

@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 — every review thread is resolved; @norrietaylor closed the last one. The review of 7cde2e460e2f withheld this approval on the threads open then. Posted as a comment: the App cannot approve its own pull request; the check and the label carry it.

@minimal-foundry minimal-foundry Bot added the review:approved minimal-review approved the current head label Nov 13, 2026
@minimal-foundry
Copy link
Copy Markdown
Contributor Author

Round 4 of 10 on a /revise note, pushed as 3d4f76f03b3e.

line exit tail
cargo test -p minimal events_parent_follow_picks_up_new_children 0 running 1 test test tests::events_parent_follow_picks_up_new_children ... ok test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 969 filtered out; finished in 1.74s running 0 tests test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 34 filtered out; finished in 0.00s running 0

Verify min task run agent-verify exited 100.

 {
                "parent_span_id": "dda2ea04210ad984",
                "rpc": "minimald-v1-GetSessionRecord",
                "span_id": "e18dcf2d2753561a",
                "trace_id": "0af7651916cd43dd8448eb211c803111",
            },
            parent: None,
            closed: true,
        },
        LoggedSpan {
            name: "sessions.manager.message",
            fields: {
                "kind": "GetRecord",
                "parent_span_id": "e18dcf2d2753561a",
                "queued_behind": "0",
                "span_id": "a59b1e161acb16fc",
                "trace_id": "0af7651916cd43dd8448eb211c803111",
            },
            parent: None,
            closed: true,
        },
        LoggedSpan {
            name: "rpc",
            fields: {
                "parent_span_id": "dda2ea04210ad984",
                "rpc": "minimald-v1-DestroySession",
                "span_id": "700d032ec610b2c9",
                "trace_id": "0af7651916cd43dd8448eb211c803111",
            },
            parent: None,
            closed: true,
        },
        LoggedSpan {
            name: "sessions.manager.message",
            fields: {
                "kind": "GetRecord",
                "parent_span_id": "700d032ec610b2c9",
                "queued_behind": "0",
                "span_id": "f5894f6609b0e751",
                "trace_id": "0af7651916cd43dd8448eb211c803111",
            },
            parent: None,
            closed: true,
        },
        LoggedSpan {
            name: "sessions.manager.message",
            fields: {
                "kind": "DeleteSession",
                "parent_span_id": "700d032ec610b2c9",
                "queued_behind": "0",
                "span_id": "86c4e9fab8cc0bc9",
                "trace_id": "0af7651916cd43dd8448eb211c803111",
            },
            parent: None,
            closed: true,
        },
        LoggedSpan {
            name: "session.message",
            fields: {
                "kind": "Destroy",
                "parent_span_id": "86c4e9fab8cc0bc9",
                "span_id": "21fb943e4cf94101",
                "trace_id": "0af7651916cd43dd8448eb211c803111",
            },
            parent: None,
            closed: true,
        },
        LoggedSpan {
            name: "sessions.manager.message",
            fields: {
                "kind": "HandOverName",
                "parent_span_id": "86c4e9fab8cc0bc9",
                "queued_behind": "0",
                "span_id": "a39a6ee2f7a52902",
                "trace_id": "0af7651916cd43dd8448eb211c803111",
            },
            parent: None,
            closed: true,
        },
    ]
    note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

  Cancelling due to test failure: 
────────────
     Summary [  86.443s] 1130 tests run: 1129 passed, 1 failed, 2 skipped
        FAIL [   3.533s] (1130/1130) minimal::otel_cli exec_run_attach_and_task_run_share_the_commands_trace
error: test run failed

Converted to a draft: something above needs a person before review.

If a box becomes a child of the parent after min box events --parent <box> --follow starts, its events show in the output of the follow. Each try bound now has a test of its own.

Notes from the agent: Revise round 4. Commit f25a2dc in the previous round already did asks 1 and 2. A refusal before the first event is now 'not opened yet': the read opens again, or the watch drops it when the listing no longer shows the child. Discovery runs in its own task with a 5 s timeout on each list and each open. Ask 3 was partly done. This round split the list outage test into events_parent_follow_resets_the_list_count_after_a_listing_works and events_parent_follow_stops_after_the_list_tries. It also added events_parent_follow_adds_a_child_that_opens_on_its_last_try. The five-try bound, the hung listing and the removed parent already had tests. No product code changed this round. I did not reply on the review or the threads because I have no gh credential. The runtime posts verdicts. Whole-suite runs: cargo test -p minimal with no filter timed out at 30 minutes because colliding_box_id_refuses_creation hangs. Without that test, 34 tests fail in the full run but pass alone. All of them fail on the same panic: resolve_socket_path sees a named VM that some other test leaves in process state. This branch adds no set_var or remove_var, so I think the leak is in code outside this branch. I did not confirm this on main. The minimal-client doctests did not run because rustdoc is missing on this box. Clippy on the minimal crate (--all-targets) is clean.

@minimal-foundry
minimal-foundry Bot marked this pull request as draft November 13, 2026 19:54
@minimal-foundry minimal-foundry Bot added the needs-human An agent handed off; a human must act, then clear this label. Set by defer and handoffs. label Nov 13, 2026
@minimal-foundry
Copy link
Copy Markdown
Contributor Author

The runtime will not revise this pull request again on its own: the diff is +863/-45 (908 lines), past 3x the plan's estimate of 150 lines (est: 70 code, 80 tests, as #3346 reads now), at round 4 (the last trigger was a /revise note). A person decides now. Remove needs-human from this pull request to let /revise <note> or the automatic rounds resume, or finish #3346 by hand.

@minimal-arch minimal-arch 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.

arch-review: PASS · the full ruling

The compare from 7cde2e46 changes only tests. The new tests pin the list bound, the reset of the list count and the open bound that events.rs sets. No test relaxes a gate. The PASS on 7cde2e46 stands for the follow under architecture.md line 504.

Ruled at 3d4f76f against gominimal/arch@15b603e6afb8 by claude-opus-5-5.

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

Panel: 3 of 3 personas ran (correctness, security, supply-chain).

@agent-137
agent-137 marked this pull request as ready for review November 13, 2026 20:15
@agent-137
Copy link
Copy Markdown
Member

@bryan-minimal your three asks are in at 3d4f76f:

  1. A refusal before a child's first event goes to the watch, not the output, so a child that is already gone no longer ends the follow.
  2. Discovery runs in a task of its own (f25a2dc).
  3. One test per try bound, and for the stop when the parent is removed (3d4f76f).

Could you re-review once CI is green?

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

Re-read at 3d4f76f0. The one commit since 7cde2e46 splits the outage test into three, one per try bound: a child that opens on its last try joins the follow, a working listing resets the failed-list count, and CHILD_LIST_TRIES failures in a row end the follow (one fewer does not). That is ask 3 of the review requesting changes; asks 1 and 2 are in events.rs (the refusal before a first event goes to the watch, discovery in its own task). Required CI is green; agent-verify fails only on #3398.

@bryan-minimal bryan-minimal 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.

I re-read the change at 3d4f76f, mainly the two new commits: the child watch in a task of its own, and the tests of the try bounds.

Both earlier requests are resolved. A new child's read that the daemon refuses before its first event now goes back to the watch, not to the output. The next listing opens it again if the child is still listed and drops it if it is gone. Open failures and early refusals share the five-try bound, and a first update that arrives clears it. Discovery runs in its own task, and the list and each open now have a 5 s timeout. A slow or hung listing no longer holds back the streams already in the follow, and the hung-listing test shows that. Each call runs on its own channel, so a timed-out call leaves nothing behind. Dropping the task set on any return stops the watch and every reader.

The tests now cover each bound by letting the follow stop on its own: five failed opens, five failed listings, a reset after a listing that works, a child that opens on its last try, a hung listing, and the end once the parent is removed. They run on paused time against a fake host, so I do not expect them to be timing-sensitive.

The smaller notes about readers and the seen set growing, and the stderr line for a parent with no children yet, are both taken. Thanks.

One thing left, not blocking: the children in the first listing still take the old path. They are spawned without the first-update channel, so a child removed between the startup listing and its first line ends the whole follow, the same way a new child did before. The window is short. Sending the initial children through the same first-update handling under --parent --follow would close it; a follow-up is fine.

Smaller still: polling logs at info level once a second, and the limit on a child created just before the parent is removed is only in a code comment. The watch task is never joined, so a panic in it would be silent; I found no panic site on that path. None of these needs to hold this up.

The commitlint check is red only on merge-commit headlines, which a squash drops.

@bryan-minimal
Copy link
Copy Markdown
Member

A correction to my review above: the red commitlint check is not about merge-commit headlines. It is one commit, "fix(minimal): keep box events --follow through a short list outage", whose body has a line over 100 columns. The conclusion stands: commitlint is not a required check, and the squash keeps none of the commit bodies, so it does not need a fix before merge.

@agent-137
agent-137 added this pull request to the merge queue Nov 13, 2026
@norrietaylor norrietaylor removed the needs-human An agent handed off; a human must act, then clear this label. Set by defer and handoffs. label Nov 13, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Nov 13, 2026
@agent-137
agent-137 added this pull request to the merge queue Nov 13, 2026
Merged via the queue into main with commit 1b8d7e5 Nov 14, 2026
39 of 40 checks passed
@agent-137
agent-137 deleted the agent/3346-min-box-events-parent-follow-adds-the-stream-of branch November 14, 2026 00:23
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.

D3024 — min box events --parent --follow adds the stream of a child that is created after the follow starts

4 participants

0