progress generators can overwrite reports through output aliases #12055
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from boykopovar/AnyPS5. Originally posted by malekaifa on 2026-10-27T17:48:49Z.
What happens
The progress generators write several named reports into the same output directory without checking whether two of those paths already refer to the same filesystem object.
On current
main, if (for example)progress.jsonandprogress.htmlare hardlinks to the same file,tools/progress.py::write_site()writes each path in sequence and the later HTML write silently overwrites the JSON through the alias. The same behavior exists intools/progress_history.pyforhistory.json/history.svg/history.html.I reproduced both cases on current main with real hardlinks: after generation, the aliased JSON path contains the HTML payload instead of JSON.
Expected behavior
Before writing any generated report, reject an output set in which two report paths already refer to the same existing filesystem object. Preserve all existing report bytes unchanged on that failure.
The existing
progress_history --cacheguard is outside this bug and should retain its current behavior.Proposed fix
samefile()catches existing filesystem aliases/hardlinks.Pathequality normally case-folds them.I can take this. Candidate branch:
malekaifa/AnyPS5:fix/progress-history-output-aliases, being qualified against currentmainbefore PR submission.Overlap check: AnyPS5's
tools/pr_overlap.pyreported no overlap with open pull requests for this branch at reservation time.AI-assisted: yes (OpenAI Codex).