Skip to main content

stoa_capture/
lib.rs

1//! Stoa capture worker (transcript drain + PII redaction).
2//!
3//! See [ARCHITECTURE.md §7 "Capture pipeline (the hot path)"] for the
4//! worker semantics and [ARCHITECTURE.md §10 "Redaction filter"] for the
5//! pattern catalogue.
6//!
7//! The capture worker:
8//! 1. Claims one row from `.stoa/queue.db` with a lease.
9//! 2. Reads the source session `JSONL` referenced by the payload.
10//! 3. Runs the [`Redactor`] line-by-line.
11//! 4. Writes the redacted output to `sessions/<session_id>.jsonl`.
12//! 5. Appends an entry to `.stoa/audit.log`.
13//! 6. Marks the queue row done.
14
15mod audit;
16mod error;
17mod patterns;
18mod redactor;
19mod worker;
20
21pub use error::{Error, Result};
22pub use redactor::Redactor;
23pub use worker::{DrainResult, WorkerConfig, drain_once, drain_once_with};