M1.2: Trace logger #4

Merged
archeious merged 1 commit from feat/trace-logger into main 2026-04-08 20:25:59 +00:00
Collaborator

Summary

  • TraceLogger — JSONL audit logs per research() call, one file per trace_id
  • Lazy file handle, flush after each write, context manager support
  • read_entries() for replay and testing
  • 15 tests

Refs: #1

## Summary - `TraceLogger` — JSONL audit logs per research() call, one file per trace_id - Lazy file handle, flush after each write, context manager support - `read_entries()` for replay and testing - 15 tests Refs: #1
claude-code added 1 commit 2026-04-08 20:25:52 +00:00
TraceLogger produces JSONL audit logs per research() call:
- One file per trace_id at ~/.marchwarden/traces/{trace_id}.jsonl
- Each line is a self-contained JSON object (step, action, timestamp, decision)
- Supports arbitrary kwargs (url, content_hash, query, etc.)
- Lazy file handle, flush after each write, context manager support
- read_entries() for replay and testing

15 tests: file creation, step counting, JSONL validity, kwargs,
timestamps, flush behavior, multiple independent traces.

Refs: archeious/marchwarden#1

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
archeious merged commit 21c8191b81 into main 2026-04-08 20:25:59 +00:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: archeious/marchwarden#4
No description provided.