Skip to content

[codex] Add session-correlated audit for embedded runs - #140

Merged
jamiesun merged 1 commit into
mainfrom
codex/audit-session-correlation
Jun 26, 2026
Merged

[codex] Add session-correlated audit for embedded runs#140
jamiesun merged 1 commit into
mainfrom
codex/audit-session-correlation

Conversation

@jamiesun

Copy link
Copy Markdown
Collaborator

Summary

Fixes #132.

  • add optional session_id / run_id context to audit JSONL events
  • wire CLI, REPL, schedule, daemon, and embedded API audit loggers to set session_id
  • make scoot.run() use a per-run scratch arena while keeping returned replies valid until stop()
  • add an embedded API regression test for multiple runs, correlated audit events, and session JSONL output
  • update the English and Chinese session/audit docs with the new audit schema

Root Cause

Audit events were written as a global stream with only seq, ts, kind, and msg, so app-server style consumers could not slice audit history by session. The embedded API also did not attach an audit logger and reused the runtime arena for per-run session, skill, and agent scratch state.

Validation

  • zig test src/audit.zig
  • zig build test --summary all (517/517 tests passed)
  • zig build && ./zig-out/bin/scoot --version
  • pre-push local CI passed: zig fmt --check, zig build, zig build test, zig build -Doptimize=ReleaseSafe, CLI smoke

@jamiesun
jamiesun marked this pull request as ready for review June 26, 2026 09:41
@jamiesun
jamiesun merged commit 60f529d into main Jun 26, 2026
7 checks passed
@jamiesun
jamiesun deleted the codex/audit-session-correlation branch June 26, 2026 09:41
@jamiesun jamiesun mentioned this pull request Jun 26, 2026
jamiesun added a commit that referenced this pull request Jun 26, 2026
- Add session-correlated audit for embedded runs (#140)
- Add session and audit read commands (#141)
- Add stdio NDJSON serve protocol (#142)
- Harden serve and daemon lifecycle (#143)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[api] app-server L0:审计事件缺 session 关联键且嵌入路径不产审计,常驻复用下 runtime arena 累积

1 participant