Documentation
¶
Overview ¶
Package harness names the coding agents culi integrates with (Claude Code, Codex CLI) and owns their identity: the typed enum, its validation, and the session-id encoding shared by the hook, learn, and serve layers.
This package is stdlib-only on purpose — it is imported by the hot path (hook, store), so the C2 dependency firewall applies. Do not add heavy deps.
Index ¶
Constants ¶
const Default = Claude
Default is assumed when no harness is recorded: legacy job files written before the field existed, and Claude hooks that omit the --harness flag.
Variables ¶
var All = []Harness{Claude, Codex}
All is the registry of known harnesses. Extend it (plus the typed switches in mine's parser routing and init's installer dispatch) to add a harness.
Functions ¶
This section is empty.
Types ¶
type Harness ¶
type Harness string
Harness identifies the coding-agent front end a session came from. It is a string-backed named type (not an int/iota enum) on purpose: the value is serialized verbatim to JSON job files (queue.Job.Source), embedded in session-id prefixes, and folded into the learn dedup sha256 key. Keeping the underlying type a string means the wire form stays exactly "claude"/"codex" with zero custom (un)marshaling, so on-disk and hash compatibility hold.
func Parse ¶
Parse converts an untrusted string to a Harness, reporting whether it names a known harness. Unknown input yields ("", false) — callers decide whether to fall back to Default or reject.
func SplitSession ¶
SplitSession is the inverse of PrefixSession: it recovers the harness and raw id from a namespaced session id. A missing or unrecognized prefix yields (Default, prefixed) — the whole string is preserved untouched.
func (Harness) PrefixSession ¶
PrefixSession namespaces a raw session id with the harness ("codex:<uuid>"), so two harnesses' ids never collide in the dedup/session tables. An empty id stays empty (the hook only prefixes non-empty ids).