# Package: dirigent_codex

Pure-Rust parser for OpenAI Codex JSONL session files.

## Scope

- `parse_file(path)` — reads one `*.jsonl` session file on disk and
  returns a `ParsedSession`.
- `discover_sessions(dir)` — scans a directory (e.g.
  `~/.codex/sessions/`) for session files.
- Types: `ParsedSession`, `ParsedMessage`.

No dirigent-specific types. `dirigent_archivist::import::sources::codex`
consumes this crate and maps into the archivist's internal types.

## Example

```rust
let sessions = dirigent_codex::discover_sessions(dir)?;
for s in sessions {
    println!("{}: {} messages", s.id, s.messages.len());
}
```

## Failure modes

- Individual malformed JSONL lines are skipped where possible.
- Truly broken files return `ParseError::Json`.
- Unknown message shapes are preserved as best-effort text so no user
  data is silently lost.
