Documentation
¶
Overview ¶
Package queue manages the learn inbox: job files written by the SessionEnd hook, a lockfile so only one worker mines at a time, and per-transcript byte cursors. Deletion is parse-gated (ecosystem lesson): a job is removed only after a successfully processed mine — crashes and retries never lose observations. Three failures move the job to inbox/failed/ (circuit break).
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrLocked = errors.New("queue: another learn worker is running")
ErrLocked reports another live worker holds the lock — the caller should simply exit; the queue drains on the next run.
Functions ¶
func Done ¶
Done removes a successfully processed job (parse-gated: call only after the mine result was parsed and persisted).
Types ¶
type Cursor ¶
Cursor is one transcript's mining progress: everything before Offset has been mined once (plan §learning A — each region mined exactly once).
type Cursors ¶
type Cursors struct {
// contains filtered or unexported fields
}
Cursors is the persistent transcript_path → Cursor map.
func LoadCursors ¶
LoadCursors reads state/learn_cursors.json; a missing or corrupt file yields an empty map (worst case: some regions are mined twice — the dedup stage absorbs that).
type Job ¶
type Job struct {
SessionID string `json:"session_id"`
TranscriptPath string `json:"transcript_path"`
CWD string `json:"cwd"`
EnqueuedAt string `json:"enqueued_at"`
// contains filtered or unexported fields
}
Job is one queued transcript, as enqueued by the SessionEnd hook.