feat(acp): persist bounded turn audit trail - #5184
Conversation
Co-authored-by: TMC <tiago@sonargtm.com> Signed-off-by: TMC <tiago@sonargtm.com>
|
@block/buzz-oss-team Review requested. This critical turn-audit fix is mergeable; DCO, Semgrep, and zizmor are green, and the PR body records full ACP/Desktop validation plus independent review. |
|
I think the audit can record a publish attempt for a tool call that never tried to publish. Could this match the structured tool identity and parsed argv for the supported send shapes instead of searching arbitrary payload strings? A negative fixture where a non-shell tool reads documentation containing That distinction matters because this file is operator evidence: a false positive turns “the agent mentioned a command” into “the agent attempted a side effect.” |
Summary
Persist a bounded, content-free audit trail for inbound ACP turns so operators can distinguish receipt, rejection, queueing, ACP execution, completion, and reply publication failures.
Each inbound event keeps a stable correlation ID and stage timestamps for:
buzz messages sendattempts, publish failures, relay rejections, and relay-accepted reply event IDs.The audit is enabled by default with CLI/environment opt-out and retention controls. Writes use the existing cross-platform atomic-write abstraction, owner-only permissions on Unix, bounded records and gap markers, corruption preservation, and a shutdown drain. The persisted schema excludes message bodies, prompts, ACP/tool payloads, errors, credentials, session IDs, and relay URLs. When relay observation is disabled, the live observer feed does not retain raw ACP frames for replay.
Related work
This complements #5181 without duplicating its queued/in-flight restart recovery. Events filtered before they reach the harness remain outside this audit boundary.
Originating Buzz thread:
buzz://message?channel=4c0769da-da97-4e9d-bf12-152ddbaec0aa&id=78ce91d3e5ddb699e91bdb50ef777ff1957a559e31fc229ab1d77d490db4cb9eTesting
env -u BUZZ_ACP_LAZY_POOL -u BUZZ_ACP_MULTIPLE_EVENT_HANDLING -u BUZZ_ACP_DEDUP cargo test -p buzz-acp— 704 unit tests, 9 lifecycle integration tests, and doc tests passed.cargo test -p buzz-acp turn_audit::tests— 13 audit persistence/failure-path tests passed../bin/just desktop-ci— 4,480 frontend tests, production build, Tauri compilation, and the complete Tauri workspace tests passed.cargo clippy -p buzz-acp --all-targets -- -D warnings— passed.cargo fmt --all -- --check— passed.git diff --cached --check— passed before commit.The final diff also received an independent read-only review; all findings were addressed before publication.