Mirrored from Linear AI-2146 (parent: AI-2145 — "Bug hunter 自动提交 PR 闭环演示").
Summary
Fix scripts/init_task_record.py so it can no longer silently leave a task folder with mismatched task.json / notes.md, and so it stops crashing with a raw traceback when --root points at a read-only directory.
Changes
- Refuse to create a task artifact in an existing folder unless
--force is passed (exit code 2, clear stderr).
--force reuses the folder and rewrites both task.json and notes.md atomically.
PermissionError / generic OSError from mkdir are caught and turned into a clean non-zero exit with an actionable message.
Tests
tests/test_init_task_record.py covers: first-run creation, repeat-run refusal, --force refresh, permission-error handling.
PR
#7
Linear
- AI-2146 (this issue)
- AI-2145 (parent)
Mirrored from Linear AI-2146 (parent: AI-2145 — "Bug hunter 自动提交 PR 闭环演示").
Summary
Fix
scripts/init_task_record.pyso it can no longer silently leave a task folder with mismatchedtask.json/notes.md, and so it stops crashing with a raw traceback when--rootpoints at a read-only directory.Changes
--forceis passed (exit code 2, clear stderr).--forcereuses the folder and rewrites bothtask.jsonandnotes.mdatomically.PermissionError/ genericOSErrorfrommkdirare caught and turned into a clean non-zero exit with an actionable message.Tests
tests/test_init_task_record.pycovers: first-run creation, repeat-run refusal,--forcerefresh, permission-error handling.PR
#7
Linear