cmd_mv renamed the ticket into its new directory and only then wrote the updated content, so a write that failed left the ticket in the target directory still claiming the old status. Reproduced with a read-only ticket file: the move reported a bare "Permission denied" and left the file in committed/ carrying "Status: backlog". move_ticket_file now stages the content in a temp file, renames it over the source, and only then renames the file into the target directory. Two atomic steps, so a partial write is discarded and the original is untouched. The other obvious order, writing to the target and deleting the source afterwards, was rejected because it has the ticket in two directories at once. The worst case left is a ticket still in its old directory with a Status one move ahead, which the next mv corrects since the directory is what decides the current status. Tested, including the retry. The temp file is staged under .worklane/ rather than beside the ticket, so a leftover from a hard kill is invisible to ticket lookup and to the listing instead of appearing as a stray untitled ticket. IO errors now name the ticket and the path rather than propagating bare. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
17 lines
316 B
TOML
17 lines
316 B
TOML
[package]
|
|
name = "worklane"
|
|
version = "0.3.3"
|
|
edition = "2024"
|
|
|
|
[dependencies]
|
|
clap = { version = "4", features = ["derive"] }
|
|
anyhow = "1"
|
|
uuid = { version = "1", features = ["v4"] }
|
|
chrono = { version = "0.4", features = ["serde"] }
|
|
libc = "0.2"
|
|
|
|
[dev-dependencies]
|
|
assert_cmd = "2"
|
|
assert_fs = "1"
|
|
tempfile = "3"
|