(06f15bf) Stop comments overwriting each other, and bump to 0.1.1

Comment filenames were stamped to the second, so two comments added in
the same second produced the same name and fs::write truncated the first.
Agents post in bursts, so this was routine data loss: five comments added
back to back left one file.

Stamp microseconds instead, and create the file with create_new rather
than fs::write, so a name that already exists is taken as a collision and
the next zero-padded suffix is used instead of overwriting. The suffix
sorts after the bare stem, so read_comments still orders comments the way
they were written.

The collision branch cannot be reached from the CLI, since two processes
will not share a microsecond, so it has a unit test of its own.

Patch bump: existing second-resolution comment files still read and still
sort ahead of new ones written in the same second, so no migration.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
Ansho Rei
2026-08-20 15:00:23 +02:00
co-authored by Claude Opus 5
parent 54569b2c85
commit 8563218ab5
5 changed files with 117 additions and 6 deletions
+1 -1
View File
@@ -1,6 +1,6 @@
[package]
name = "worklane"
version = "0.1.0"
version = "0.1.1"
edition = "2024"
[dependencies]