Commit Graph
1 Commits
Author SHA1 Message Date
sam a7f33fcb03 feat(logging): add a per-task log sink
Part of #452 (task-observability epic #450). A task's real work
happens in an ephemeral archie-agent container; currently nothing
persists what it logs once the container exits (AutoRemove: true).

Adds TaskSink: a per-task, per-attempt JSONL log destination sharing
the exact on-disk format the daemon-wide logger already writes (see
Entry/Tail/Query/Components in reader.go), so a task's history is
readable with the same reader rather than a second format to keep in
sync. Backed by the existing rotatingFile, so it gets the same
size-based rotation and retention as the daemon-wide log for free.

Deliberately does not fall back to stderr on open failure the way the
daemon-wide New does: that fallback exists because losing the daemon
over a broken log path is worse than losing the durable copy, and
there is no equivalent daemon-level fallback for one task's log.

This lands only the sink primitive and its own tests. Wiring an
agent-side publisher and a daemon-side NATS consumer into it is
tracked separately in #453 and #454.
2026-08-09 16:32:52 +10:00