Skip to content

T107 — Prove that the log bep serve writes is the log min box audit reads - #2789

Merged
norrietaylor merged 1 commit into
mainfrom
agent/2460-prove-that-the-log-bep-serve-writes-is-the-log-m
Oct 31, 2026
Merged

norrietaylor merged 1 commit into
mainfrom
agent/2460-prove-that-the-log-bep-serve-writes-is-the-log-m

Conversation

@minimal-foundry

Copy link
Copy Markdown
Contributor

T107 — Prove that the log bep serve writes is the log min box audit reads

slice: S15
kind: task
covers: BEP-068
size: S
est: 0 code, 60 tests
executor: agent
difficulty: routine
model: light
diagnostics: min box audit <box> lists the records that bep serve wrote to audit-<n>.jsonl under ~/.minimal/bep/audit
observability: the proxy's start line names the active segment, as today
layers:
- serve:
- crates/bep/src/main.rs: a test starts the audit log as bep serve does (start_audit_log over a directory), appends a record, and reads it back with LogReader::read_new over the same directory, under the audit-<n>.jsonl name (#2460)
test: cargo nextest run -p bep serve_writes_audit_segments_the_reader_reads
produces: none
consumes: none
proof: A record bep serve appends is read back by the reader min box audit uses, from audit-.jsonl in the same directory.
depends on:
- blocked by #2290

Original issue text

Residual of #2457 (T17, epic #1501). Named by minimal-arch condition C3(1) on 7c3c46a.

Nothing in the tree writes the audit log to the layout the reader expects. #2457 fixes that layout on the read side: segments named audit-<n>.jsonl (bep::audit::segment_name) under bep::audit::default_dir() (~/.minimal/bep/audit), read in order of n, the highest n the active segment, a segment never renamed. The T9 writer (#2262, merged in #2361) opens an append-only log at a caller-supplied path, and no proxy task names this directory or this segment name yet.

The proxy (T10 #2271, T18 #2275) must open its log under default_dir() as audit-0.jsonl, and the BEP-068 segment rotator (T33 #2290) must open each new segment as audit-<n+1>.jsonl in the same directory without renaming the old one, or min box audit reads nothing.

Done when: the proxy's production audit sink writes audit-<n>.jsonl under bep::audit::default_dir(), the BEP-068 rotator keeps that naming, and a test proves LogReader::read_new on default_dir() returns the records the proxy wrote.


Generated by Claude Code

Proof

The test serve_writes_audit_segments_the_reader_reads in crates/bep/src/main.rs starts the audit log with start_audit_log, as bep serve does. It appends a record. It then reads that same record back from audit-0.jsonl in the same directory with LogReader::read_new, the reader that min box audit uses.

Notes from the agent: Test-only change. cargo clippy -p bep --all-targets and cargo fmt --check are clean.

Tests

line exit tail
cargo nextest run -p bep serve_writes_audit_segments_the_reader_reads 0 Applying loadouts: default Running task runtime-implement-test-0 in session task-runtime-implement-test-0-6732... 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

Verify

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

Closes #2460

The test starts the audit log as bep serve does, appends a record, and
reads it back from audit-0.jsonl with the LogReader that min box audit
uses. Refs #2460.
@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: d92cb0ee-c831-499a-950e-2cf02cfc4f1f

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: no findings at f94d79f8c62d.

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.

@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. The new test proves that the record bep serve writes through start_audit_log is the record that LogReader::read_new returns. That reader is the one min box audit uses, over the same audit-<n>.jsonl layout. This agrees with architecture.md line 505: min box audit reads the helper's own hash-chained log. I found no condition.

Ruled at f94d79f against gominimal/arch@8640f85e193d 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).

@minimal-foundry minimal-foundry Bot added the review:approved minimal-review approved the current head label Oct 31, 2026

@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 f94d79f against T107's plan block. serve_writes_audit_segments_the_reader_reads starts the log through start_audit_log, the function bep serve uses. It appends one decision and reads it back with audit::LogReader::new(&dir).read_new(), the same reader min box audit uses (crates/minimal/src/cmd/box_audit.rs:32). It pins the segment name audit-0.jsonl, zero skipped lines, exactly that segment, and the record equal to the written one. That covers the plan's proof. It does not cover the box-id spelling mismatch (#2462, T103): the test uses the same box-serve string on both sides. That stays T103's. No findings.

@norrietaylor
norrietaylor added this pull request to the merge queue Oct 31, 2026
Merged via the queue into main with commit ca6d27d Oct 31, 2026
36 checks passed
@norrietaylor
norrietaylor deleted the agent/2460-prove-that-the-log-bep-serve-writes-is-the-log-m branch October 31, 2026 06:59
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.

T107 — Prove that the log bep serve writes is the log min box audit reads

1 participant