Conversation
The evidence index is a file manifest with timestamps. A screen now also writes fetch_log.json with sanitized params and cache flags so an operator can see what this run actually fetched, without bodies or keys. Co-authored-by: Cursor <cursoragent@cursor.com>
|
| Filename | Overview |
|---|---|
| src/coldscreen/casedir.py | Adds fetch-log serialization and owned-path preflight, but an unwritable non-symlink log path can fail after evidence has already been replaced. |
| src/coldscreen/pipeline.py | Integrates group preflight before overwrite cleanup, though the subsequent multi-file write remains partially destructive if the new log write fails. |
| tests/test_casedir.py | Covers log contents and symlink refusal but does not cover a directory or other unwritable non-symlink at fetch_log.json. |
| tests/test_cli.py | Verifies normal screen, no-write, rerun, cache-hit, and evidence-index behavior for the new log. |
| tests/test_mcp_server.py | Extends MCP persistence and overwrite symlink coverage for fetch_log.json. |
Flowchart
%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[Screen gathers NamedRecord entries] --> B{no_write?}
B -->|Yes| C[Return result without case writes]
B -->|No| D[Preflight owned paths]
D --> E{overwrite existing evidence?}
E -->|Yes| F[Remove old evidence directory]
E -->|No| G[Write evidence records]
F --> G
G --> H[Write evidence index]
H --> I[Write fetch_log.json]
I --> J[Write casefile.json]
J --> K[Write memo.md]
Prompt To Fix All With AI
### Issue 1
src/coldscreen/casedir.py:193-196
**Partial overwrite corrupts audit pack**
When an overwrite encounters a directory or other unwritable non-symlink at `fetch_log.json`, the symlink-only preflight accepts it and the log write fails after the new evidence and index have been persisted, leaving them alongside the previous `casefile.json` and `memo.md`.
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.Reviews (1): Last reviewed commit: "Write a per-run fetch log beside the evi..." | Re-trigger Greptile
| write_case_text( | ||
| case_dir / "fetch_log.json", | ||
| json.dumps([fetch_log_row(named) for named in records], indent=2) + "\n", | ||
| ) |
There was a problem hiding this comment.
Partial overwrite corrupts audit pack
When an overwrite encounters a directory or other unwritable non-symlink at fetch_log.json, the symlink-only preflight accepts it and the log write fails after the new evidence and index have been persisted, leaving them alongside the previous casefile.json and memo.md.
Prompt To Fix With AI
This is a comment left during a code review.
Path: src/coldscreen/casedir.py
Line: 193-196
Comment:
**Partial overwrite corrupts audit pack**
When an overwrite encounters a directory or other unwritable non-symlink at `fetch_log.json`, the symlink-only preflight accepts it and the log write fails after the new evidence and index have been persisted, leaving them alongside the previous `casefile.json` and `memo.md`.
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.
Summary
fetch_log.jsonat the case-directory root: one row per persisted fetch, with sanitized params andfrom_cache.--no-writeandrerundo not touch the log.fetch_log.jsonis refused before any other owned file moves.Test plan