Problem
src/CodeIndex/Cli/MetricsSink.cs opens the metrics JSONL file with FileMode.Append after creating the directory, but it does not force owner-only file permissions and does not enforce a maximum size or rotation policy.
Impact
Metrics can include command, path, timing, and failure details. On shared POSIX systems a permissive umask can expose the file, and long-running usage can grow it without bound.
Expected
Create metrics files with private permissions where supported, and add bounded rotation or a maximum-size policy similar to other long-lived logs.
Problem
src/CodeIndex/Cli/MetricsSink.csopens the metrics JSONL file withFileMode.Appendafter creating the directory, but it does not force owner-only file permissions and does not enforce a maximum size or rotation policy.Impact
Metrics can include command, path, timing, and failure details. On shared POSIX systems a permissive umask can expose the file, and long-running usage can grow it without bound.
Expected
Create metrics files with private permissions where supported, and add bounded rotation or a maximum-size policy similar to other long-lived logs.