1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
//! Codex attribution.
//!
//! Codex writes no PID-indexed session file, so there is nothing to look up by
//! PID the way [`crate::attribution::claude`] does. Identity is recovered from
//! the rollout JSONL a live `codex` process holds open, which makes every
//! Codex lookup indirect: find the open file, read its `session_meta` row,
//! and decide whether that session is ours.
//!
//! * [`session`] — the `session_meta` row's shape, its reader, and
//! [`session::rollout_id`], which reads off the request itself which rollout
//! a turn belongs to.
//! * [`request`] — everything else a Codex request states about its own
//! identity: thread, immediate parent, turn, sub-thread kind, the two
//! sources those arrive from and the contradiction check between them, and
//! the envelope that identity implies (including the sub-thread re-key onto
//! the root session).
//! * [`process`] — which `.jsonl` files a given PID currently holds open, via
//! per-OS process-file APIs.
//! * [`watcher`] — polls the rollout directory and publishes recently-modified
//! sessions as a wait-free snapshot, the way the Claude watcher does for its
//! sessions directory.
//! * [`select`] — the ladder that turns all of the above into one chosen
//! rollout, its bounded wait, and the record of why it chose.
//!
//! Two consequences run through the whole lane. Rollout files linger for hours
//! after a session ends, so every candidate is filtered by a recency window;
//! and one `codex` process running subagents holds the parent rollout and every
//! child rollout open at once, so neither the PID nor a launch marker
//! identifies a *thread*. Only the request does. Where that evidence is absent
//! and several live sessions remain, the ladder refuses rather than guesses.
pub use open_jsonl_sessions_by_pid;
pub use CodexRequestIdentity;
pub use ;
pub use ;
pub use ;