Task · CAOT-0040

Bound memory during a full-tree sweep

Description

Separate defect from the CAOT-0002 identity collision, and fixing identity does not fix this. Source.RunOnce walks every file in one call and appends every new record from every changed file into one slice before returning (internal/source/source.go:278 and :321), and cmd/codingagent2otel/main.go calls it unchunked. On a first sweep every file starts at offset 0, so tailCompleteLines reads each file whole and copies a []byte per line. Against the live tree that reached a 23.7 GiB peak and the run had to be stopped.

Nothing in internal/source or internal/config expresses a record, byte or batch bound. The wave-1 resume boundary said to re-run the sweep ‘with a bounded memory ceiling’ as though one existed; it does not, and must be built.

Acceptance Criteria

Definition of Done

References

View the source file on GitHub