Repository navigation
T107 — Prove that the log bep serve writes is the log min box audit reads - #2789
norrietaylor merged 1 commit into
Conversation
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.
|
Important Review skippedBot user detected. To trigger a single review, invoke the
|
|
Approved: no findings at 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. |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
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 thatbep servewrote toaudit-<n>.jsonlunder~/.minimal/bep/auditobservability: 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 servedoes (start_audit_logover a directory), appends a record, and reads it back withLogReader::read_newover the same directory, under theaudit-<n>.jsonlname (#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) underbep::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()asaudit-0.jsonl, and the BEP-068 segment rotator (T33 #2290) must open each new segment asaudit-<n+1>.jsonlin the same directory without renaming the old one, ormin box auditreads nothing.Done when: the proxy's production audit sink writes
audit-<n>.jsonlunderbep::audit::default_dir(), the BEP-068 rotator keeps that naming, and a test provesLogReader::read_newondefault_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 th 8000 at 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
cargo nextest run -p bep serve_writes_audit_segments_the_reader_readsVerify
min task run agent-verifypassed ([tasks.verify]).Closes #2460