Documentation
¶
Overview ¶
Package spool persists capture payloads that could not be uploaded (network failure, offline) so they can be retried on the next SessionStart reconcile or `sync status`. Each entry is fully self-contained — it stores the RESOLVED target (workspace, directory, mode, payload, hash) so a later reconcile works even if the manifest changed (DX-7).
Files are 0600 in a 0700 per-user dir, never repo-relative or world-readable (SEC-7). Entries are capped, TTL-bounded, and capped on attempts; flushed entries are removed.
Index ¶
Constants ¶
const ( // MaxEntries caps the spool so a persistent outage can't grow unbounded. MaxEntries = 200 // TTL bounds how long an un-flushed entry survives. TTL = 14 * 24 * time.Hour // MaxAttempts bounds retries before an entry is dropped as poison. MaxAttempts = 8 )
const LedgerMax = 2000
LedgerMax bounds the captured-session ledger so it cannot grow without limit.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Entry ¶
type Entry struct {
ClaudeSessionID string `json:"claudeSessionId"`
WorkspaceID string `json:"workspaceId"`
DirectoryID string `json:"directoryId,omitempty"`
CaptureMode capture.Mode `json:"captureMode"`
RepoURL string `json:"repoUrl,omitempty"`
ContentHash string `json:"contentHash"`
Payload *capture.IngestRequest `json:"payload"`
CreatedAt time.Time `json:"createdAt"`
Attempts int `json:"attempts"`
// contains filtered or unexported fields
}
Entry is one spooled capture, self-contained for reconcile (DX-7).
func List ¶
List returns all live spool entries, pruning expired or poison entries from disk as a side effect. Entries are returned oldest-first.
func (*Entry) MarkAttempt ¶
MarkAttempt increments the attempt counter and rewrites the entry to disk so poison entries eventually age out via MaxAttempts.
type Ledger ¶
type Ledger struct {
Captured map[string]time.Time `json:"captured"`
// contains filtered or unexported fields
}
Ledger records which claude_session_ids have already been captured, so the SessionStart reconcile (which is transcript-driven, HOOK-1) can skip sessions already uploaded and only flush genuinely-missing ones.
func LoadLedger ¶
LoadLedger reads the ledger, returning an empty one if absent.