8000 T35 — Audit segments rotate and the chain is checked, end to end by minimal-foundry[bot] · Pull Request #2773 · gominimal/minimal · GitHub
[go: up one dir, main page]

Skip to content

T35 — Audit segments rotate and the chain is checked, end to end - #2773

Merged
norrietaylor merged 14 commits into
mainfrom
agent/2295-audit-segments-rotate-and-the-chain-is-checked-e
Oct 31, 2026
Merged

norrietaylor merged 14 commits into
mainfrom
agent/2295-audit-segments-rotate-and-the-chain-is-checked-e

Conversation

@minimal-foundry
@minimal-foundry minimal-foundry Bot commented Oct 31, 2026 •
Copy link
Copy Markdown
Contributor

T35 — Audit segments rotate and the chain is checked, end to end

slice: S5
kind: integration
covers: none
size: M
est: 120 code, 180 tests
executor: agent
difficulty: routine
model: standard
diagnostics: the case's last step prints the chain verified across the rotated segments
observability: the rotation log lines of the run, and one info line at bep serve start naming the segment bound when the test override sets it
layers:
- bound:
- crates/bep/src/main.rs: open_audit_log takes the segment bound from BEP_AUDIT_SEGMENT_BYTES when it is set to a positive integer, else audit::SEGMENT_BYTES; the variable is a test surface, read only by bep serve, which minvmd spawns with its own environment (widened 2026-10-31, owner, #2295 noop: no runtime knob)
test: cargo nextest run -p bep audit_segment_bound_follows_the_test_override
- e2e:
- scripts/session-e2e.sh: one case: set BEP_AUDIT_SEGMENT_BYTES for the restarted host daemon, drive requests past the bound, read the trail, edit a record, run min doctor
test: ./scripts/session-e2e.sh bep_audit_rotation_and_doctor_end_to_end
produces: none
consumes: none
proof: The audit log rotates with its chain carried across, min box audit reads every segment, and min doctor reports an edited chain.
depends on:
- blocked by #2290
- blocked by #2293

Proof

Set BEP_AUDIT_SEGMENT_BYTES to a positive integer, and bep serve rotates its audit log at that size and logs the bound at start. The new e2e case bep_audit_rotation_and_doctor_end_to_end rotates the log twice and checks that min box audit shows the box's records from every segment. Then it edits one record and checks that min doctor prints the break and exits 6. It restores the record and checks that min doctor prints 'Audit log: chain verified.'. The unit test proves the override and the rotation with the chain intact. The e2e evidence still comes from the macOS lane, because the case is NOT RUN on Linux.

Notes from the agent: The e2e case needs macOS, gvproxy and a GitHub sign-in (bep_live_gate). On this Linux box it reports NOT RUN, so its steps have not yet run against a live proxy. The case moves the real audit log under $HOME/.minimal/bep/audit aside for the run and puts it back afterwards. It stops the proxy first, so no writer races the edit. The case cleanup and the script teardown both restore the segment. With a 4096-byte bound, the run opens at least two segments, so on a host that already keeps 16 segments it can prune the oldest ones. At the end the case unsets the variable and stops the daemon pair, so no later case gets a proxy with the small bound. I added the case to the whole-lane run after bep_round_two_conditions_closed, to the dispatch arm, and to the usage list. clippy -p bep --all-targets and cargo fmt --check are clean. shellcheck -S warning is clean on the script.

Tests

line exit tail
cargo nextest run -p bep audit_segment_bound_follows_the_test_override 0 Applying loadouts: default Running task runtime-implement-test-0 in session task-runtime-implement-test-0-142b... Compiling paths v0.0.1 (/workbench/crates/paths) Compiling client-config v0.0.1 (/workbench/crates/client-config) Compiling bep v0.0.1 (/workbench/crates/bep) Finished 'test
./scripts/session-e2e.sh bep_audit_rotation_and_doctor_end_to_end (macOS 26.7 arm64, live, at ad359f3 with RUST_LOG=…,bep=info, the fix dc7bc11 now makes) 1 bep serve started with the audit segment bound 4096 · the audit log rotated: 2 new segment(s) after 21 request(s), the active one is audit-2.jsonl · rotation lines carry authority="api.github.com:443" upstream_tls="valid" substitution="substituted" · ::error::'min box audit e2e-bep-audit-rotation': the records of box 01a1907a-a9db-7434-80c7-3a25af0bc901 are in 0 segment(s), not 2 or more · gave back the real audit log in ~/.minimal/bep/audit, as it was before the rotation case

Residual: the live run at ad359f3 stopped at step 3 for two reasons, both now fixed. The case's own check compared subject with the hyphenated id; 9d940d0 compares the proxy's 32-hex form (box_id_text). min box audit matched only the hyphenated id; #2462 fixed that and merged in #2793. No live run has yet reached min box audit, min doctor and Audit rotation OK. By the owner's decision of 2026-10-31 this PR merges with that run open on #2798; the steps stay hard. Rotation, the bound, substitution and the real log's restore are shown live above. The run used a debug bep with one local, uncommitted change that keeps an exportable keychain key (#2436, T111 #2785); it does not touch the audit code. On Linux the case still reports NOT RUN (the proxy runs on macOS only).

Verify

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

Closes #2295

A test surface for the end-to-end suite: bep serve reads the variable
and uses a positive integer as the segment bound, so the audit log
rotates after a few requests. Any other value keeps the 8 MiB default.
One case restarts the daemon pair with BEP_AUDIT_SEGMENT_BYTES set,
drives requests until the audit log rotates twice, checks that
min box audit shows the box's records from every segment, edits one
record and checks that min doctor exits 6, then restores it and checks
that the chain verifies again.
@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: 461ee0ba-58be-4261-bbbd-f5e147dc6350

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 Oct 31, 2026 •
Copy link
Copy Markdown
Contributor Author

Approved: every review thread resolved at 4a14c96110c5.

@norrietaylor resolved the last thread, which releases the approval this review had withheld.

Nothing to do.

@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 — 2 findings, 2 inline.

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

Comment thread crates/bep/src/main.rs Resolved
Comment thread crates/bep/src/main.rs Resolved
@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_WITH_CONDITIONS · 1 condition · the full ruling

The change conforms to the design. bep serve alone reads the test override, and the override defaults to the designed segment bound. The e2e case checks the two rules in architecture.md line 505: min box audit reads the box's records, and min doctor verifies the whole chain. That case is NOT RUN at this head, so the proof is open. C1 asks for one real run on a macOS host with gvproxy and a GitHub sign-in, with the result in the PR. Then the change is complete.

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

Comment thread scripts/session-e2e.sh Resolved
A stray value made the audit log rotate fast and prune its history.
The e2e and the dev stack run debug builds, so they keep the override.
@minimal-foundry
Copy link
Copy Markdown
Contributor Author

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

line exit tail
cargo nextest run -p bep audit_segment_bound_follows_the_test_override 0 Applying loadouts: default Running task runtime-implement-test-0 in session task-runtime-implement-test-0-6663... Compiling paths v0.0.1 (/workbench/crates/paths) Compiling client-config v0.0.1 (/workbench/crates/client-config) Compiling bep v0.0.1 (/workbench/crates/bep) Finished 'test
./scripts/session-e2e.sh bep_audit_rotation_and_doctor_end_to_end 0 ::group::audit log rotation: the chain carries across segments, min box audit reads them all, min doctor reports an edit bep_audit_rotation_and_doctor_end_to_end: NOT RUN (the Box Egress Proxy runs on macOS only) ::endgroup:: session e2e: 1 case(s) NOT RUN: bep_audit_rotation_and_doctor_end_to_end s

Verify min task run agent-verify passed.

Review threads the coder judged:

  • 👍 valid — crates/bep/src/main.rs:1291: bep serve now reads BEP_AUDIT_SEGMENT_BYTES only in a debug build. A release build ignores it, keeps the 8 MiB bound and logs a warning. The e2e uses debug builds, so it keeps the override.
  • 👍 valid — crates/bep/src/main.rs: Same fix as the other thread: release builds ignore the variable. A minimum bound did not help, because any bound small enough for the e2e to rotate also prunes history fast.

With BEP_AUDIT_SEGMENT_BYTES set on a debug build, bep serve rotates its audit log at the small bound with the chain carried across segments. The e2e case then shows min box audit reads every segment and min doctor reports an edited record. A release build of bep ignores the variable and logs a warning.

Notes from the agent: Revise round 1: audit_rotation now reads BEP_AUDIT_SEGMENT_BYTES only when cfg!(debug_assertions) is true. A release build ignores it and logs a warning. The e2e and the dev stack build bep in debug (justfile minvmd-build), so the e2e case keeps its override. The e2e case did not execute on this box: it needs macOS, where the Box Egress Proxy runs. The script reported NOT RUN and exited 0. The macOS lane owes that evidence. cargo clippy -p bep --release --bins is clean, so the release path has no dead code.

@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 scripts/session-e2e.sh Resolved
@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_WITH_CONDITIONS · 1 condition · the full ruling

The change conforms to the audit design in architecture line 505 and Gatehouse §6.10. The new commit makes the segment override a debug-build switch, so a release build keeps the default bound. That is the safe default. One condition stays open. The e2e case is NOT RUN on this head, and a NOT RUN leg is not a pass. Run the case on the macOS lane against this head, as C1 says.

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

Comment thread scripts/session-e2e.sh Resolved
The 4096-byte bound can prune old segments of the real log. The case
now copies the segments aside with no proxy up, and puts them back on
every exit and in the teardown.
@minimal-foundry
Copy link
Copy Markdown
Contributor Author

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

line exit tail
cargo nextest run -p bep audit_segment_bound_follows_the_test_override 0 Applying loadouts: default Running task runtime-implement-test-0 in session task-runtime-implement-test-0-010a... Compiling paths v0.0.1 (/workbench/crates/paths) Compiling client-config v0.0.1 (/workbench/crates/client-config) Compiling bep v0.0.1 (/workbench/crates/bep) Finished 'test
./scripts/session-e2e.sh bep_audit_rotation_and_doctor_end_to_end 0 ::group::audit log rotation: the chain carries across segments, min box audit reads them all, min doctor reports an edit bep_audit_rotation_and_doctor_end_to_end: NOT RUN (the Box Egress Proxy runs on macOS only) ::endgroup:: session e2e: 1 case(s) NOT RUN: bep_audit_rotation_and_doctor_end_to_end s

Verify min task run agent-verify passed.

Review threads the coder judged:

  • 👎 invalid — scripts/session-e2e.sh:15498: The finding is correct that the case has no passing run yet. But no code change can fix that. This coder runs on Linux, and the gate correctly returns NOT RUN here because the Box Egress Proxy runs on macOS only. The run, its exit and the 'Audit rotation OK' line must come from the macOS lane or fro
  • 👍 valid — scripts/session-e2e.sh: Before the restart, with no proxy up, the case copies every real audit segment aside. ar_cleanup and the teardown put the segments back after the proxy stops. This removes the case's segments and restores any segment that the 4096-byte bound pruned.

On a macOS host with gvproxy and a GitHub sign-in, the case shows the audit log rotating with its chain carried across, min box audit reading every segment, and min doctor reporting the edited record. After the case, the real audit log under $HOME/.minimal/bep/audit holds the same segments as before it. This box did not show any of that, because the case is NOT RUN on Linux.

Notes from the agent: This round fixes the pruning finding in scripts/session-e2e.sh only. The case first runs the live gate to check that a proxy can run on the host. Then it stops the daemon pair, checks that no bep serve is left, and copies every audit-*.jsonl segment to a mktemp directory under /tmp. Then it restarts the pair with the small bound. ar_cleanup and the teardown call ar_restore_audit after the daemons stop. It removes the segments the case made and copies the old ones back. If a bep serve of this run still runs, it changes nothing and prints the path of the copy. The case now does one more daemon stop and start than before. On this Linux box the e2e case is NOT RUN (macOS only), so nothing tested the new code beyond bash -n and shellcheck -S warning, which are both clean. The macOS lane still owes the run of this case.

@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: 3 unresolved threads — minimal-arch[bot] scripts/session-e2e.sh:15498, minimal-foundry[bot] scripts/session-e2e.sh, minimal-arch[bot] scripts/session-e2e.sh:15498. No findings.

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

@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_WITH_CONDITIONS · 1 condition · the full ruling

The compare changes only the e2e case. The case now copies the real audit segments aside with no proxy up, and puts them back on every exit and in the teardown. That keeps the helper's hash-chained log as the case found it (architecture.md line 505). The bep change from the earlier head stands: a release build ignores BEP_AUDIT_SEGMENT_BYTES. One condition stays open. The e2e case is NOT RUN on Linux, so run it on the macOS lane at this head and record the result in the PR body (C1).

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

Comment thread scripts/session-e2e.sh Resolved
@norrietaylor
Copy link
Copy Markdown
Member

/revise

One defect from review at a3e57f3, thread PRRT_kwDOPdfcxM6yN0Ln:

  • scripts/session-e2e.sh, proof_bep_audit_rotation_and_doctor_end_to_end (around line 15391): the case runs the host proxy with a 4096-byte segment bound against the developer's real audit log under $HOME/.minimal/bep/audit. Rotation then prunes segments past the 16 retained, and pruned history cannot be restored. The case comment and the PR body both admit this. An e2e run must not destroy a host's audit history. Make the case leave the real log untouched: point the proxy at an isolated audit directory for the case, or show that no prune can happen. If bep has no way to move its audit directory, say so in the PR body and stop the case before it rotates a log that holds older segments.

Do not change anything else. The release-build gate on BEP_AUDIT_SEGMENT_BYTES (a855d7e) resolves the two bot-resolved threads, and I re-checked them on this head.

bep has no setting that moves its audit directory, so the case renames
the real one aside before the restart and back on every exit. No proxy
opens the real log while the case runs, so rotation prunes none of it.
@minimal-foundry
Copy link
Copy Markdown
Contributor Author

Round 3 of 10 on a /revise note, pushed as 6a432a00ffaa.

line exit tail
cargo nextest run -p bep audit_segment_bound_follows_the_test_override 0 Applying loadouts: default Running task runtime-implement-test-0 in session task-runtime-implement-test-0-7bb2... Compiling paths v0.0.1 (/workbench/crates/paths) Compiling client-config v0.0.1 (/workbench/crates/client-config) Compiling bep v0.0.1 (/workbench/crates/bep) Finished 'test
./scripts/session-e2e.sh bep_audit_rotation_and_doctor_end_to_end 0 ::group::audit log rotation: the chain carries across segments, min box audit reads them all, min doctor reports an edit bep_audit_rotation_and_doctor_end_to_end: NOT RUN (the Box Egress Proxy runs on macOS only) ::endgroup:: session e2e: 1 case(s) NOT RUN: bep_audit_rotation_and_doctor_end_to_end s

Verify min task run agent-verify passed.

Review threads the coder judged:

  • 👎 invalid — scripts/session-e2e.sh:15520: No code change can fix this. The finding asks for a run on the macOS lane, and this session runs on a Linux box, where the gate correctly reports NOT RUN because the proxy runs on macOS only. The macOS lane must run the case at the new head and record Audit rotation OK. This round changed only how
  • 👎 invalid — scripts/session-e2e.sh:15450: This session runs on Linux and cannot run the macOS lane, so it has no exit status or Audit rotation OK lines to put in the Tests table. The Linux run here is NOT RUN, and the result reports it as NOT RUN, not as a pass. The macOS lane run at the new head is still owed.

On a macOS host with a live proxy, the rotation case rotates the audit log with its chain carried across, min box audit reads every segment, and min doctor reports the edited chain. The case does this in an audit directory of its own: the real log under ~/.minimal/bep/audit is renamed aside and renamed back, and no process writes or prunes it while the case runs. This box did not run the case, because it is Linux.

Notes from the agent: For the PR body: bep has no setting that moves its audit directory. audit::default_dir() is always $HOME/.minimal/bep/audit, and min doctor and min box audit read that path. A new setting would need crates outside this task's layers. So the case now stops the daemon pair and renames the real directory to audit.e2e-saved beside it. The proxy then creates a new, empty directory of the case's own at the default path. On every exit and in the teardown, the case waits until no bep serve runs, removes its own directory and renames the real one back. If a bep serve still runs, it names where the real log is and what to do. When the real directory did not exist, the case removes its own at the end. A leftover audit.e2e-saved from a killed run stops the case before anything can overwrite it. The rename keeps the real log byte-for-byte, so the copy-and-restore code is gone. One side effect: while the case runs, the proxy restores no revocations from the real log, and the revocation records the case writes go when its directory is removed. The revocations in the real log apply again at the next proxy start. The e2e case reported NOT RUN here (Linux, no macOS proxy). The macOS lane still owes its run and the Audit rotation OK line. shellcheck on the script reports nothing.

@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_WITH_CONDITIONS · 1 condition · the full ruling

The bep override and the e2e case conform to architecture.md line 505 and Gatehouse §6.10 line 836. The new script no longer rewrites the real audit log. It renames the real directory aside and gives it back after the case. The e2e case still reports NOT RUN on Linux, so the proof is open. C1 asks for a passing macOS-lane run of the case at this head.

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

Comment thread scripts/session-e2e.sh Resolved
@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/bep/src/main.rs Resolved
The rotation case now stops with an error that asks for a debug build of
bep when bep.log shows that a release build ignored the override.
@minimal-foundry
Copy link
Copy Markdown
Contributor Author

Round 4 of 10 on the runtime's review findings, pushed as ad359f343f78.

line exit tail
cargo nextest run -p bep audit_segment_bound_follows_the_test_override 0 Applying loadouts: default Running task runtime-implement-test-0 in session task-runtime-implement-test-0-744b... Compiling paths v0.0.1 (/workbench/crates/paths) Compiling client-config v0.0.1 (/workbench/crates/client-config) Compiling bep v0.0.1 (/workbench/crates/bep) Finished 'test
./scripts/session-e2e.sh bep_audit_rotation_and_doctor_end_to_end 0 ::group::audit log rotation: the chain carries across segments, min box audit reads them all, min doctor reports an edit bep_audit_rotation_and_doctor_end_to_end: NOT RUN (the Box Egress Proxy runs on macOS only) ::endgroup:: session e2e: 1 case(s) NOT RUN: bep_audit_rotation_and_doctor_end_to_end s

Verify min task run agent-verify passed.

Review threads the coder judged:

  • 👎 invalid — scripts/session-e2e.sh:15485: This asks for a run, not a code change. This coder box is Linux, and the case reports NOT RUN here because the Box Egress Proxy runs on macOS only. The coder has no access to the macOS lane. The macOS CI lane runs scripts/session-e2e.sh, and its run at this head is the evidence.
  • 👍 valid — crates/bep/src/main.rs:1291: The e2e case now checks bep.log for 'ignored the audit segment test override' and fails with a message that asks for a debug build of bep through MINVMD_BEP_BIN. The release gate stays on purpose.

On a macOS host with a live proxy, the e2e case drives the audit log past a small segment bound. It checks that the chain carries across the rotated segments, that min box audit reads every segment, and that min doctor reports an edited record. If the bep is a release build, the case now says that it needs a debug build of bep. This box did not run the case to a pass. It reported NOT RUN because the proxy runs on macOS only.

Notes from the agent: Round 10BC8 4. The e2e case now looks for the release-build warning in bep.log and fails with a message that asks for a debug build of bep through MINVMD_BEP_BIN. The debug_assertions gate in crates/bep/src/main.rs stays. An earlier round added it on purpose, so a stray value in a release build cannot make the log rotate fast and prune its history. The e2e case was NOT RUN here (Linux, no macOS proxy). The macOS lane still owes a passing run.

@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_WITH_CONDITIONS · 1 condition · the full ruling

The change conforms to architecture.md line 505 and Gatehouse §6.10 line 836. The new step 1a fails closed when a release bep ignores the override. One item stays open. The e2e case is NOT RUN at this head, and NOT RUN is not a pass. Run it on the macOS lane with a debug bep and put the result in the PR body, as C1 says.

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

Comment thread scripts/session-e2e.sh Resolved
@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: 6 unresolved threads — minimal-arch[bot] scripts/session-e2e.sh:15520, minimal-arch[bot] scripts/session-e2e.sh:15520, minimal-arch[bot] scripts/session-e2e.sh:15450, minimal-arch[bot] scripts/session-e2e.sh:15485, minimal-foundry[bot] crates/bep/src/main.rs:1291, …. No findings.

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

@norrietaylor
Copy link
Copy Markdown
Member

/revise

I ran bep_audit_rotation_and_doctor_end_to_end live on a Mac (macOS 26.7, arm64) at ad359f3. The bep was a debug build with one local, uncommitted change: it keeps an exportable keychain key instead of refusing, because the macOS login keychain makes every key exportable (#2436). That change has no effect on the audit code. The run found two things for this round.

  1. Defect: the bound line is filtered out on every lane. session-e2e.sh exports RUST_LOG="${RUST_LOG:-warn,minimald::exec=info}" (around line 679). minvmd passes that to bep serve, so bep's INFO line "audit segment bound set by the test override" never reaches bep.log. The case then always fails with bep.log has no line that names the audit segment bound 4096. I reproduced that failure first. With RUST_LOG="warn,minimald::exec=info,bep=info" the line appears. Make the case pass bep=info to the proxy it starts (for example, append ,bep=info to RUST_LOG for the restart, and restore it in ar_cleanup). Do not lower the default filter for the whole lane.

  2. Evidence for the PR body (C1 threads): with that filter, the case ran up to its min box audit step:

    moved the real audit log aside to ~/.minimal/bep/audit.e2e-saved, with 1 segment(s)
    bep serve started with the audit segment bound 4096
    the audit log rotated: 2 new segment(s) after 21 request(s), the active one is audit-2.jsonl
    ... bep::audit: rotated the audit log (authority="api.github.com:443" upstream_tls="valid" substitution="substituted")
    ::error::'min box audit e2e-bep-audit-rotation': the records of box 01a1907a-a9db-7434-80c7-3a25af0bc901 are in 0 segment(s), not 2 or more
    gave back the real audit log in ~/.minimal/bep/audit, as it was before the rotation case
    

    The min box audit step fails because of the known id-spelling defect, T103 — Match min box audit on the box id spelling the proxy writes #2462 (BEP-042). min box audit matches the hyphenated id, but the proxy records the 32-hex id. So the min doctor steps after it did not run, and Audit rotation OK cannot print until T103 — Match min box audit on the box id spelling the proxy writes #2462 is fixed. Keep the step hard. In the PR body's Tests table, replace the NOT RUN row with this run: the exit, these lines, the debug-build note, and T103 — Match min box audit on the box id spelling the proxy writes #2462 as the residual that blocks the remaining steps.

The release-build check that thread PRRT_kwDOPdfcxM6yOFd3 asks for is already at this head. I re-checked it. Change nothing else.

The lane's RUST_LOG filter drops bep's INFO records, so the bound line
never reached bep.log. The case appends bep=info for its own restart
and restores the lane's filter in ar_cleanup.
@minimal-foundry
Copy link
Copy Markdown
Contributor Author

Round 5 of 10 on a /revise note, pushed as dc7bc116e7c1.

line exit tail
cargo nextest run -p bep audit_segment_bound_follows_the_test_override 0 Applying loadouts: default Running task runtime-implement-test-0 in session task-runtime-implement-test-0-3e42... Compiling paths v0.0.1 (/workbench/crates/paths) Compiling client-config v0.0.1 (/workbench/crates/client-config) Compiling bep v0.0.1 (/workbench/crates/bep) Finished 'test
./scripts/session-e2e.sh bep_audit_rotation_and_doctor_end_to_end 0 ::group::audit log rotation: the chain carries across segments, min box audit reads them all, min doctor reports an edit bep_audit_rotation_and_doctor_end_to_end: NOT RUN (the Box Egress Proxy runs on macOS only) ::endgroup:: session e2e: 1 case(s) NOT RUN: bep_audit_rotation_and_doctor_end_to_end s

Verify min task run agent-verify passed.

Review threads the coder judged:

  • 👍 valid — scripts/session-e2e.sh:15531: The case ran live on the macOS lane with a debug bep (ad359f3 plus the bep=info filter that this round commits). It rotated into 2 new segments and then failed at min box audit because of T103 — Match min box audit on the box id spelling the proxy writes #2462 (32-hex vs hyphenated box id). That run, its exit and its lines replace the NOT RUN row in the Tests tabl

On a Mac with a debug bep, the rotation case now finds the bound line in bep.log, sees the audit log rotate into new segments with the chain carried across, and reads the rotation lines. The min box audit step still fails because of #2462 (the proxy records the 32-hex box id, and min box audit matches the hyphenated id). So the min doctor steps and 'Audit rotation OK' cannot run until #2462 is fixed.

Notes from the agent: Revise round 5. Item 1 is fixed: before the second live gate, the case saves RUST_LOG and appends ',bep=info', so minvmd passes the filter to bep serve. ar_cleanup restores the saved filter, or unsets RUST_LOG if it was not set. The default filter of the lane does not change. Item 2, evidence for the PR body Tests table, in place of the NOT RUN row: the owner ran the case live on macOS 26.7 arm64 at ad359f3. The bep was a debug build with one local, uncommitted change for #2436 (keep an exportable keychain key), which does not affect the audit code. RUST_LOG was 'warn,minimald::exec=info,bep=info', the same filter this commit sets. The case exited non-zero at the min box audit step. Its lines: 'moved the real audit log aside to ~/.minimal/bep/audit.e2e-saved, with 1 segment(s)' / 'bep serve started with the audit segment bound 4096' / 'the audit log rotated: 2 new segment(s) after 21 request(s), the active one is audit-2.jsonl' / '... bep::audit: rotated the audit log (authority="api.github.com:443" upstream_tls="valid" substitution="substituted")' / '::error::'min box audit e2e-bep-audit-rotation': the records of box 01a1907a-a9db-7434-80c7-3a25af0bc901 are in 0 segment(s), not 2 or more' / 'gave back the real audit log in ~/.minimal/bep/audit, as it was before the rotation case'. Residual: #2462 (BEP-042, id spelling) blocks the min box audit step, the min doctor steps and 'Audit rotation OK'. The step stays hard. I did not run the case live at the new head: this box is Linux, and the gate reports NOT RUN.

@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-reviewed at 8ccb050. That head only merges main (#2765, #2768, #2788, #2789) into the branch. No line this PR owns changed since 9d940d0, which I approved.

… parses it

macOS /bin/bash 3.2 mis-parses a quoted heredoc inside $(...) whose body
holds an apostrophe and backticks: bash -n failed with a syntax error near
unexpected token '(' and every macOS e2e case failed (CI job 124474093151).
Reword the Python comment so it carries neither.
@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-reviewed at ed5362e. That commit only rewords the step-3 Python comment inside the heredoc. It drops the apostrophe and the backticks that broke the parse under the macOS runner's /bin/bash 3.2 (job 124474093151), and it corrects proxy.rs to listener.rs. /bin/bash -n scripts/session-e2e.sh exits 0. The rest is unchanged from 8ccb050.

@minimal-arch minimal-arch Bot left a comment
Copy link
8 10BC8 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_WITH_CONDITIONS · 1 condition · the full ruling

The compare changes only a comment in the step-3 heredoc. The comment no longer has quotes, so macOS bash can parse the heredoc in $( ). It also cites box_id_text in listener.rs correctly. The earlier ruling stands. The change conforms to architecture.md line 505 and Gatehouse §6.10 line 836. The live macOS run of the rotation case is still open. C1 keeps that run open on #2798 with every assert hard.

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

Comment thread scripts/session-e2e.sh Resolved
@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/bep/src/main.rs Resolved
@minimal-foundry
Copy link
Copy Markdown
Contributor Author

Round 9 of 10 on the runtime's review findings, pushed as 7bf1bb63438e.

line exit tail
cargo nextest run -p bep audit_segment_bound_follows_the_test_override 0 Applying loadouts: default Running task runtime-implement-test-0 in session task-runtime-implement-test-0-f21b... Compiling paths v0.0.1 (/workbench/crates/paths) Compiling client-config v0.0.1 (/workbench/crates/client-config) Compiling bep v0.0.1 (/workbench/crates/bep) Finished 'test
./scripts/session-e2e.sh bep_audit_rotation_and_doctor_end_to_end 0 ::group::audit log rotation: the chain carries across segments, min box audit reads them all, min doctor reports an edit bep_audit_rotation_and_doctor_end_to_end: NOT RUN (the Box Egress Proxy runs on macOS only) ::endgroup:: session e2e: 1 case(s) NOT RUN: bep_audit_rotation_and_doctor_end_to_end s

Verify min task run agent-verify passed.

Review threads the coder judged:

  • 👍 valid — scripts/session-e2e.sh:15613: Still true: this round ran the case on a Linux box without KVM, and it printed NOT RUN (macOS only). No assert changed. The live macOS run and the record on Run bep_audit_rotation_and_doctor_end_to_end live on macOS after #2773 #2798 are still owed by the macOS lane.
  • 👍 valid — crates/bep/src/main.rs:1301: audit_rotation now logs the info line only when the value parses to a positive integer. Otherwise it warns that it ignored the value. The unit test pins audit_segment_override.

At this branch, a debug bep serve with BEP_AUDIT_SEGMENT_BYTES set to a positive integer rotates its audit log at that bound, and the unit test shows the chain carried across the segments. The e2e case drives rotation, min box audit and min doctor on an edited record. That case still owes a live macOS run before a person can see Audit rotation OK.

Notes from the agent: Round 9. bep: bep serve now logs the info line only when the override parses to a positive integer. A set value that is zero, empty or unparsable gives a warn line that says the value was ignored. The new helper audit_segment_override is pinned in the existing test. The e2e case printed NOT RUN here, because this box is Linux with no /dev/kvm and the case runs on macOS only. The live macOS run that thread C1 asks for (to record on #2798) is still owed. I did not relax any assert in the case.

@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_WITH_CONDITIONS · 1 condition · the full ruling

The compare is a clean merge of main and one small fix in crates/bep/src/main.rs. The fix logs the test override only when it applies. A bad value still keeps the default bound, which is the safe side. The audit design in architecture.md line 505 and Gatehouse §6.10 line 836 is met. One item stays open: no live run of the rotation case reached min box audit, min doctor and Audit rotation OK. C1 records that run on #2798, and the steps stay hard.

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

Comment thread scripts/session-e2e.sh Resolved
@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/bep/src/main.rs Resolved
@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 Oct 31, 2026
@minimal-foundry
Copy link
Copy Markdown
Contributor Author

The runtime will not revise this pull request again on its own: round 11 would exceed the cap of 10; 1 base merge was not counted (the last trigger was a failed check suite). A person decides now. Remove needs-human from this pull request to let /revise <note> or the automatic rounds resume, or finish #2295 by hand.

@minimal-foundry
Copy link
Copy Markdown
Contributor Author

Round 10 of 10 on the runtime's review findings, pushed as 32c9be0459bd.

line exit tail
cargo nextest run -p bep audit_segment_bound_follows_the_test_override 0 Applying loadouts: default Running task runtime-implement-test-0 in session task-runtime-implement-test-0-cf61... Compiling paths v0.0.1 (/workbench/crates/paths) Compiling client-config v0.0.1 (/workbench/crates/client-config) Compiling bep v0.0.1 (/workbench/crates/bep) Finished 'test
./scripts/session-e2e.sh bep_audit_rotation_and_doctor_end_to_end 0 ::group::audit log rotation: the chain carries across segments, min box audit reads them all, min doctor reports an edit bep_audit_rotation_and_doctor_end_to_end: NOT RUN (the Box Egress Proxy runs on macOS only) ::endgroup:: session e2e: 1 case(s) NOT RUN: bep_audit_rotation_and_doctor_end_to_end s

Verify min task run agent-verify passed.

Review threads the coder judged:

  • 👎 invalid — scripts/session-e2e.sh:15681: No code change can satisfy this. The case needs a live macOS run, and this session runs on Linux without KVM, where the case reports NOT RUN. No step is relaxed and the leg is not marked known_gap. The macOS lane still owes the run that prints 'Audit rotation OK' on Run bep_audit_rotation_and_doctor_end_to_end live on macOS after #2773 #2798.
  • 👍 valid — crates/bep/src/main.rs: Split the gate into audit_rotation_for(set, debug). The T35 unit test now proves that a debug build takes the override and a release build keeps audit::SEGMENT_BYTES. The debug-only rule stays, because it is deliberate (a855d7e).

With BEP_AUDIT_SEGMENT_BYTES set on a debug bep serve, the audit log rotates and carries its chain across segments, min box audit reads every segment, and min doctor reports an edited chain. The unit test now also proves that a release build keeps the default bound. The e2e case that shows this end to end still needs a live macOS run.

Notes from the agent: This round: audit_rotation now delegates to audit_rotation_for(set, debug), and the T35 unit test pins the debug and release gate. The e2e case reports NOT RUN on this Linux box, because the Box Egress Proxy runs on macOS only. A macOS lane run that prints 'Audit rotation OK' is still owed on #2798. The debug-only rule is deliberate from an earlier round (a855d7e), and it is wider than the task text says.

@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_WITH_CONDITIONS · 1 condition · the full ruling

The new commit moves the release gate of BEP_AUDIT_SEGMENT_BYTES into audit_rotation_for and pins it with a unit test. The behaviour does not change, and the proof is stronger. The ruling on the earlier head stands. The design (architecture.md line 505, Gatehouse §6.10 line 836) puts the chain check over the whole log in min doctor, and the change follows it. The live e2e leg did not yet reach min box audit, min doctor and Audit rotation OK. That leg stays open on #2798 as C1.

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

Comment thread scripts/session-e2e.sh Resolved
@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.

APPROVE withheld: 5 unresolved threads — minimal-arch[bot] scripts/session-e2e.sh:15613, minimal-foundry[bot] crates/bep/src/main.rs, minimal-arch[bot] scripts/session-e2e.sh:15681, minimal-foundry[bot] crates/bep/src/main.rs, minimal-arch[bot] scripts/session-e2e.sh:15448.

minimal-review — advisory review

Verdict COMMENT — No findings.

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

A zero or unparsable BEP_AUDIT_SEGMENT_BYTES keeps the default bound.
bep serve now warns that it ignored the value, in place of the info
line that said the override applied.
audit_rotation_for takes the build, so the test proves a release build
keeps the default bound when BEP_AUDIT_SEGMENT_BYTES is set.
@norrietaylor
norrietaylor force-pushed the agent/2295-audit-segments-rotate-and-the-chain-is-checked-e branch from 32c9be0 to 4a14c96 Compare October 31, 2026 17:07
@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.

Approving at 4a14c96. Above ed5362e, the branch has a merge of main (fbdcfd8) and two commits from rounds 9-10 that touch only crates/bep/src/main.rs:

  • audit_segment_override splits out the parse.
  • bep serve now warns when a debug build ignores a zero or unparsable BEP_AUDIT_SEGMENT_BYTES, where before it logged an info line saying the override applied.
  • audit_rotation_for takes the build, so a test pins that a release build keeps the default bound.

A local worker rewrapped the two commit bodies for commitlint (body-max-line-length). The tree is unchanged from 32c9be0.

@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_WITH_CONDITIONS · 1 condition · the full ruling

The tree is identical to 32c9be04, so the earlier ruling stands. The segment bound is debug-only and in bep, which owns the helper's log. The e2e case verifies the chain with min doctor, as architecture.md line 505 and Gatehouse §6.10 line 836 require. The live run of the case did not reach steps 3 to 5. C1 keeps that leg open, and #2798 owns it.

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

Comment thread scripts/session-e2e.sh Resolved
@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: 6 unresolved threads — minimal-arch[bot] scripts/session-e2e.sh:15613, minimal-foundry[bot] crates/bep/src/main.rs, minimal-arch[bot] scripts/session-e2e.sh:15681, minimal-foundry[bot] crates/bep/src/main.rs, minimal-arch[bot] scripts/session-e2e.sh:15448, …. No findings.

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

@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 4a14c96110c5 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 Oct 31, 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 Oct 31, 2026
@norrietaylor
norrietaylor added this pull request to the merge queue Oct 31, 2026
Merged via the queue into main with commit 1eb6ec1 Oct 31, 2026
36 checks passed
@norrietaylor
norrietaylor deleted the agent/2295-audit-segments-rotate-and-the-chain-is-checked-e branch October 31, 2026 18:11
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.

T35 — Audit segments rotate and the chain is checked, end to end

1 participant

0