Documentation
¶
Overview ¶
Package codexscan discovers Codex rollout transcripts from Codex's local state databases. The databases are opened read-only and query-only: Culi never migrates, locks for writing, or otherwise owns Codex state.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrScanLocked = errors.New("codexscan: scan already running")
ErrScanLocked means another process is already discovering Codex rollouts. The automatic path treats it as a benign skip; an explicit manual scan surfaces it so two operators never race telemetry or queue writes.
Functions ¶
func SaveHealth ¶
SaveHealth atomically replaces the scanner breadcrumb.
Types ¶
type Health ¶
type Health struct {
LastAttempt time.Time `json:"last_attempt"`
LastSuccess time.Time `json:"last_success,omitempty"`
Mode string `json:"mode,omitempty"`
Discovered int `json:"discovered"`
Queued int `json:"queued"`
Skipped int `json:"skipped"`
DurationMS int64 `json:"duration_ms"`
Error string `json:"error,omitempty"`
}
Health is the durable, content-free scanner breadcrumb consumed by doctor. It deliberately records counts and timing only—never rollout paths, prompts, repository names, or session IDs.
func LoadHealth ¶
LoadHealth reads the latest scanner breadcrumb. Missing state means the scanner has not run yet; malformed state is reported to doctor rather than silently presented as "never".
type Lease ¶
type Lease struct {
// contains filtered or unexported fields
}
Lease serializes discovery across Stop/SessionEnd workers. Release is idempotent so callers can defer it immediately after acquisition.
type Session ¶
Session is one rollout-backed Codex thread ready for the neutral learning queue. SessionID is raw here; the queue boundary adds the harness prefix.
func Discover ¶
Discover reads every state_*.sqlite database newest-schema-first. Results are de-duplicated by rollout path because an upgrade may copy threads into a newer state database while retaining the older file. skipped counts rollouts dropped by the containment guard (safeRollout) so the caller can surface an otherwise-silent drop — e.g. a Codex build that relocates rollouts outside $CODEX_HOME would return sessions=0, skipped>0 instead of a mute empty scan.