6 Commits

Author SHA1 Message Date
Cursor Agent
b44ceb32e6 Drop redundant safecsv WriteRow helper
WriteRow was a variadic alias for Write(SanitizeRecord(...))
with no extra safety or column checks. Export call sites already
use []string headers; matching encoding/csv keeps one API surface.

Signed-off-by: Cursor Agent <cursoragent@cursor.com>

Co-authored-by: Bryan FRIMIN <bryan@frimin.fr>
2026-07-30 10:13:17 +00:00
Cursor Agent
010fdcd51e Write log export CSV rows with safecsv WriteRow
Document that Write and WriteRow sanitize fields; export
streaming uses WriteRow at call sites instead of Write([]string).

Signed-off-by: Cursor Agent <cursoragent@cursor.com>

Co-authored-by: Bryan FRIMIN <bryan@frimin.fr>
2026-07-30 10:13:17 +00:00
Cursor Agent
71c6726281 Move safecsv package doc onto writer.go
Drop the doc-only source file; keep export guidance on the
main Writer entry point.

Signed-off-by: Cursor Agent <cursoragent@cursor.com>

Co-authored-by: Bryan FRIMIN <bryan@frimin.fr>
2026-07-30 10:13:17 +00:00
Cursor Agent
b1e6949fe4 Escape CSV cells that start with tab or carriage return
Trim-based formula detection skipped the old rule for
leading control characters; check those bytes before trim.

Signed-off-by: Cursor Agent <cursoragent@cursor.com>

Co-authored-by: Bryan FRIMIN <bryan@frimin.fr>
2026-07-30 10:13:17 +00:00
Cursor Agent
90b3258f32 Harden safecsv against whitespace formula tricks
Ignore leading Unicode space when detecting formula cells,
extend starter runes, and document export usage in package
doc.

Signed-off-by: Cursor Agent <cursoragent@cursor.com>

Co-authored-by: Bryan FRIMIN <bryan@frimin.fr>
2026-07-30 10:13:17 +00:00
Cursor Agent
fc54faa263 Extract safecsv writer for spreadsheet-safe exports
Wrap encoding/csv with formula-safe cell sanitization and
use it from log export streaming.

Signed-off-by: Cursor Agent <cursoragent@cursor.com>

Co-authored-by: Bryan FRIMIN <bryan@frimin.fr>
2026-07-30 10:12:47 +00:00