Skip to content

T104 — Read each box's parent so min box audit --parent merges its children - #2800

Merged
norrietaylor merged 1 commit into
mainfrom
agent/2781-read-each-box-s-parent-so-min-box-audit-parent-m
Oct 31, 2026
Merged

norrietaylor merged 1 commit into
mainfrom
agent/2781-read-each-box-s-parent-so-min-box-audit-parent-m

Conversation

@minimal-foundry

Copy link
Copy Markdown
Contributor

T104 — Read each box's parent so min box audit --parent merges its children

slice: S15
kind: task
covers: BEP-042
size: M
est: 80 code, 120 tests
executor: agent
difficulty: routine
model: standard
diagnostics: min box audit --parent <box> lists each child box's records with the child's id at the start of each line; a box with no child prints "Box has no child boxes." on stderr; the refusal "min box audit --parent cannot run here: this host does not record which boxes are children of box . Run min box audit <box> for each child box." goes, pinned by box_audit_parent_reads_parents_from_the_box_records
observability: the existing debug line of each read names the child box ids it merged
layers:
- audit:
- crates/minimal/src/cmd/box_audit.rs: known_boxes reads each listed box's parent from its record (boxes::Record::parent, which the daemon stamps at creation since #2386), LISTING_RECORDS_PARENTS, refuse_parent_before_listing and the refusal text go, and the tests drive run with the parents known_boxes gives, the path min box audit takes, not with a hard-coded parents_recorded = true (BEP-042 --parent)
test: cargo nextest run -p minimal box_audit_parent_merges_children
test: cargo nextest run -p minimal box_audit_parent_reads_parents_from_the_box_records
produces: none
consumes: none
proof: min box audit --parent <box> merges the records of every child of that box, each line naming its child, on a host whose boxes carry a parent.
depends on:
- blocked by #2462

Proof

On a host whose boxes carry a parent, min box audit --parent <box> now merges the records of every child of that box onto one stream, and each line starts with the child's id. A box with no child prints "Box has no child boxes." on stderr. The refusal "min box audit --parent cannot run here ..." is gone.

Notes from the agent: The daemon listing (ListSessionsEntry) carries no parent field. So known_boxes sends one GetSessionRecord by id for each listed box and reads Record::parent. It does this only when --parent is given, so min box audit <name> still makes one listing call. A box whose record lookup returns no record has no known parent. A failed GetSessionRecord RPC fails the command. The new pure fn known_box(entry, record) does the mapping, and the test helper known builds every test box through it. The observability line already exists: the debug line in read_and_render logs box_ids (the merged child subjects), so it needed no change. The clippy::too_many_arguments expectation on run is removed, because run lost the parents_recorded argument and the lint no longer fires. I ran cargo nextest run -p minimal box_audit as one extra check: 11 passed. I did not run just clippy-strict.

Tests

line exit tail
cargo nextest run -p minimal box_audit_parent_merges_children 0 Applying loadouts: default Running task runtime-implement-test-0 in session task-runtime-implement-test-0-bf8e... Compiling paths v0.0.1 (/workbench/crates/paths) Compiling args v0.0.1 (/workbench/crates/args) Compiling ot v0.0.1 (/workbench/crates/ot) Compiling client-config v0.0.1 (/wo
cargo nextest run -p minimal box_audit_parent_reads_parents_from_the_box_records 0 Applying loadouts: default Running task runtime-implement-test-1 in session task-runtime-implement-test-1-5a66... Compiling stdlib v0.0.22 (/workbench/crates/stdlib) Compiling version v0.8.0 (/workbench/crates/version) Compiling decode v0.0.1 (/workbench/crates/decode) Compiling mlog v0.

Verify

min task run agent-verify exited 100 under rustc 1.99.0, which the repository does not pin (1.99.1 in rust-toolchain.toml); the PR is not a draft on that alone — CI, which honours the pin, is the gate.

            closed: true,
        },
        LoggedSpan {
            name: "session.message",
            fields: {
                "kind": "GetRecord",
                "parent_span_id": "7380b3243610c5c2",
                "span_id": "4a64a4c4b9079d2c",
                "trace_id": "0af7651916cd43dd8448eb211c803111",
            },
            parent: None,
            closed: true,
        },
        LoggedSpan {
            name: "session.message",
            fields: {
                "kind": "GetNetSwitch",
                "parent_span_id": "7380b3243610c5c2",
                "span_id": "bad72c31a833970d",
                "trace_id": "0af7651916cd43dd8448eb211c803111",
            },
            parent: None,
            closed: true,
        },
        LoggedSpan {
            name: "session.message",
            fields: {
                "kind": "GetDenyAllOptOut",
                "parent_span_id": "7380b3243610c5c2",
                "span_id": "b0a7be19617647b3",
                "trace_id": "0af7651916cd43dd8448eb211c803111",
            },
            parent: None,
            closed: true,
        },
        LoggedSpan {
            name: "session.message",
            fields: {
                "kind": "GetPaths",
                "parent_span_id": "7380b3243610c5c2",
                "span_id": "3488c75a3fdfec03",
                "trace_id": "0af7651916cd43dd8448eb211c803111",
            },
            parent: None,
            closed: true,
        },
        LoggedSpan {
            name: "sessions.manager.message",
            fields: {
                "kind": "GetRecord",
                "parent_span_id": "7380b3243610c5c2",
                "queued_behind": "0",
                "span_id": "37f77c5638c8661d",
                "trace_id": "0af7651916cd43dd8448eb211c803111",
            },
            parent: None,
            closed: true,
        },
        LoggedSpan {
            name: "sessions.manager.message",
            fields: {
                "kind": "DeleteSession",
                "parent_span_id": "7380b3243610c5c2",
                "queued_behind": "0",
                "span_id": "83b972d0493e41a7",
                "trace_id": "0af7651916cd43dd8448eb211c803111",
            },
            parent: None,
            closed: true,
        },
        LoggedSpan {
            name: "session.message",
            fields: {
                "kind": "Destroy",
                "parent_span_id": "83b972d0493e41a7",
                "span_id": "9ef93db2b5401825",
                "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 [  31.636s] 813 tests run: 812 passed, 1 failed, 1 skipped
        FAIL [   2.736s] (813/813) minimal::otel_cli exec_run_attach_and_task_run_share_the_commands_trace
error: test run failed

Closes #2781

known_boxes reads each listed box's parent from its record, which the
daemon stamps at creation. The interim refusal of --parent on a host
without parents, and its LISTING_RECORDS_PARENTS gate, are removed. The
tests drive run with the boxes known_box builds from a listing entry and
a record.
@coderabbitai

coderabbitai Bot commented Oct 31, 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: 1707c1a9-d811-4bba-b808-d6a4923c2fc8

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-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. min box audit --parent now reads each box's parent from the daemon-stamped Box Record, as architecture.md lines 503 and 505 require. The interim refusal is removed, and its flip condition (#2386) is met. The code stays in box_audit.rs, and the tests use the production known_box mapping. No condition is necessary.

Ruled at b914a9b against gominimal/arch@8640f85e193d by claude-opus-5-5.

@minimal-foundry

minimal-foundry Bot commented Oct 31, 2026 •

Copy link
Copy Markdown
Contributor Author

Approved: no findings at b914a9b4a698.

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.

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

@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 at b914a9b against T104's plan block.

  • known_boxes now reads each box's parent from its record (GetSessionRecord), and only when --parent is given. A record that is missing gives no parent rather than an error.
  • LISTING_RECORDS_PARENTS, refuse_parent_before_listing and the "cannot run here" refusal are gone. No doc or script quotes that text.
  • The tests drive run with the parents known_box builds from records, not a hard-coded flag. box_audit_parent_merges_children and box_audit_parent_reads_parents_from_the_box_records cover a stamped child, a box whose record was not read, and a parent with no children.

No findings.

@norrietaylor
norrietaylor added this pull request to the merge queue Oct 31, 2026
Merged via the queue into main with commit 79c5030 Oct 31, 2026
36 checks passed
@norrietaylor
norrietaylor deleted the agent/2781-read-each-box-s-parent-so-min-box-audit-parent-m branch October 31, 2026 08:25
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.

T104 — Read each box's parent so min box audit --parent merges its children

1 participant