mirror of
https://github.com/usestrix/strix.git
synced 2026-11-05 07:37:19 +00:00
`write_executive_report` was the only artifact writer in `writer.py` not
routed through the module's own `_atomic_write_text` helper. It opened the
destination with `path.open("w")`, truncating `penetration_test_report.md`
in place before writing any new bytes.
Every sibling writer is already atomic: `write_run_record`, the
per-vulnerability markdown, `vulnerabilities.csv` and `vulnerabilities.json`
all go through `_atomic_write_text`, which writes a temp file in the same
directory and `Path.replace()`s it into place.
So a failure between the `open("w")` and the last `write` (ENOSPC, a
disconnected mount, SIGINT, an OOM kill) left the primary human-readable
deliverable truncated or empty, with the previous complete report already
gone.
Build the payload first, then hand it to `_atomic_write_text`, so a failed
render leaves the previous report intact.
Adds a regression test that fails on main: write a report, make the
timestamp render raise, and assert the first report survives.
|
||
|---|---|---|
| .. | ||
| __init__.py | ||
| test_agent_factory_shell.py | ||
| test_agent_tool_registration.py | ||
| test_cli_target_list.py | ||
| test_config_loader.py | ||
| test_cost_tracking.py | ||
| test_docker_client_delete.py | ||
| test_execution.py | ||
| test_hooks.py | ||
| test_inputs.py | ||
| test_local_dir_staging.py | ||
| test_local_sources.py | ||
| test_model_retry.py | ||
| test_models.py | ||
| test_notes.py | ||
| test_optional_deps.py | ||
| test_provider_hints.py | ||
| test_proxy_client.py | ||
| test_proxy_renderer.py | ||
| test_report_pdf.py | ||
| test_report_writer.py | ||
| test_reporting_fields.py | ||
| test_runner_rate_limit.py | ||
| test_runner_root_prompt.py | ||
| test_sarif.py | ||
| test_sarif_stride.py | ||
| test_session_entries.py | ||
| test_skill_dir_extension.py | ||
| test_state_repo_context.py | ||
| test_viewer.py | ||
| test_viewer_auth.py | ||
| test_viewer_runs_gating.py | ||