Documentation
¶
Overview ¶
Package state persists the per-task watermark sidecars that give the `da service` background tasks restart safety (R3 design decision D3).
Each task owns exactly one human-readable YAML sidecar at .agents/active/service-state/<task-name>.watermark.yaml. On startup a task reads its watermark; absent means "start from scratch". Writes are atomic (temp+rename via fsops.WriteFileAtomic, the same primitive the scoring sidecar writers use) so a crash never leaves a partial watermark behind.
The package is deliberately shape-agnostic: each task defines its own watermark struct (e.g. the iter-log ingester's {last_iter_processed, last_mtime, rubric_version}) and hands it to Load/Save as an opaque value.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Load ¶
Load reads the watermark at path into v. A missing file is not an error: it returns found=false with a nil error, leaving v untouched, which is the D3 "absent means start from scratch" contract. A blocked parent (ENOTDIR: a path component is a regular file) is also treated as absent — Windows already reports that case as not-exist, and the subsequent Save surfaces the broken hierarchy loudly. Read or parse failures are returned as errors so a corrupt watermark is surfaced instead of silently reprocessing from zero.
Types ¶
This section is empty.