88ecb8e00ef9
sweep only peek folders more than a day old, closing 3.0.18's codex review (3.0.34)
- time
- 2026-09-24 03:50 UTC · 2 weeks ago
- machine
- koh2
- agent
- claude-opus-5-5
- session
- koh 3 reliability campaign
- parent
- eee40896e5eb
↓ koh-88ecb8e0.tar.gzatlas at this save
files changed4 files
VERSION+1 −1src/cli/cmd_back_test.v+7 −0src/cli/cmd_doctor.v+7 −2v.mod+1 −1src/cli/cmd_back_test.v+7 −0
@@ -35,3 +35,10 @@3535 }3636 assert os.read_file(path)! == 'unsaved\n'3737 }38+39+fn test_a_peek_is_old_only_after_more_than_a_day() {40+ now := i64(1_000_000)41+ assert !peek_is_old(now, now)42+ assert !peek_is_old(now - peek_age, now)43+ assert peek_is_old(now - peek_age - 1, now)44+}src/cli/cmd_doctor.v+7 −2
@@ -74,15 +74,20 @@7474 mut removed := 07575 for name in os.ls(os.temp_dir()) or { return 0 } {7676 path := os.join_path(os.temp_dir(), name)77- // A peek from today may still be open in somebody's editor.7877 if !name.starts_with(peek_prefix)79- || os.file_last_mod_unix(path) > time.now().unix() - peek_age {78+ || !peek_is_old(os.file_last_mod_unix(path), time.now().unix()) {8079 continue8180 }8281 os.rmdir_all(path) or { continue }8382 removed++8483 }8584 return removed85+}86+87+// peek_is_old is true once a peek is more than a day old. A younger one may88+// still be open in somebody's editor.89+fn peek_is_old(modified i64, now i64) bool {90+ return modified < now - peek_age8691 }8792 8893 struct DoctorJson {v.mod+1 −1
@@ -1,6 +1,6 @@11 Module {22 name: 'koh3'3- version: '3.0.33'3+ version: '3.0.34'44 description: 'One SQLite file per repo, one line of history.'55 license: 'MIT'66 }