Repository navigation
test(server): report a catalog's moved ctime instead of making one with chmod - #4140
Conversation
…th chmod Two chmods in a row land in the same ctime tick on a coarse kernel clock (Linux 6.12 on HostHatch), so the test that #4122 added failed there every time. It now reports the moved ctime through a statSync spy, as claude-images.test.ts does, and still fails if ctime is left out of the catalog version.
|
No actionable comments were generated in the recent review. Summary
Merge Risk:
|
|
|
|
Merged through |
What
The test #4122 added in
server/pi-models.test.ts("versions a catalog by its permissions too") failed onevery run on the HostHatch CI host: it did
chmod 000thenchmod 644back to back and expectedcatalogVersionto change. On Linux 6.12 there the change time is coarse, and both chmods land in thesame tick, so ctime (and mtime and size) stay equal.
The test now reports a moved ctime through a
statSyncspy, the wayclaude-images.test.ts(
holdTimes) already does, instead of making one with chmod. It uses no sleeps and does not depend onthe clock's granularity, and it still fails if ctime is left out of the catalog version (checked by
removing it).
Test-only change.
Not a product bug
A live transcript turn is refreshed by size, not by timestamps:
incrementalLiveTurnparses from theoffset it already read to the stream's length (the file size), checks the 64 bytes before that offset and
a SHA-256 of the bytes it already parsed, and starts over when the stream id (device, inode, pi branch)
changes. ctime appears only in the catalog version (
mtime:ctime:size) as one signal next to mtime andsize.
Measured on HostHatch (kernel 6.12.0-124.52.2.el10_1), 500 tries each:
So on that host a timestamp-only change check would miss most appends, and the size the live-turn refresh
reads to never does.
Validation
server/pi-models.test.ts50 / 50 runs, 17 pass 0 fail each;server/native-incremental.test.ts+server/conversation-metadata.test.ts5 / 5 runs, 55 pass 0 fail.catalogVersion.bun run check fastat 85d953e on old-desktop: all steps ok; unit: 18721 pass, 0 fail, 61 skip in 992 files.A HostHatch
check fastrun is queued; its result goes in a comment.