Found during cdidx code-search audit. Evidence: src/CodeIndex/Cli/ReportCommandRunner.cs writes directly to outputPath via new FileStream(outputPath, FileMode.Create, ...) before the gzip/tar payload is complete. Impact: an interrupted or failed report run can truncate an existing report and leave a partial archive at the requested path. Suggested fix: write to a same-directory temporary file, flush and close it, then atomically replace or move it into place with cleanup on failure.
Found during cdidx code-search audit. Evidence:
src/CodeIndex/Cli/ReportCommandRunner.cswrites directly tooutputPathvianew FileStream(outputPath, FileMode.Create, ...)before the gzip/tar payload is complete. Impact: an interrupted or failed report run can truncate an existing report and leave a partial archive at the requested path. Suggested fix: write to a same-directory temporary file, flush and close it, then atomically replace or move it into place with cleanup on failure.