Skip to content
suit Check-in [2f274ce15b]
Login

Check-in [2f274ce15b]

Overview
Comment:Phase 2: the store, a working copy that is never half written

The store is a working copy of a wardrobe, kept through libfossil's C API with suit's own file writer: every file is written beside itself and renamed, so a reader sees the old file or the new one.

suit store open, status and update, suit commit and suit back. An update refuses when there are local changes, runs as a dry run first, and changes nothing if any file would conflict.

Proven here: the store is byte-identical to fossil's own checkout of a 600-file wardrobe at each version; a reader hashing files during a slowed update saw only old or new contents; an update that fails at any call leaves the old bytes and no temporary file. 100% of functions, lines, regions and branches in all ten source files.

Vendored, unedited: libfossil trunk f2983dcd78, SQLite 3.55.0, zlib 1.3.1. The release binary links only the system library.

Speed: with everything linked, suit costs 0.82 ms over an empty program quiet and up to 1.38 ms under load, which is over budget. The timer's entry point is now suit-run, a 35 KB program built from the no-change path alone, at 0.40 ms quiet and about 0.5 ms loaded. It runs suit only when something changed. The budget test is on suit-run.

Known limits, recorded in docs/decisions.md: libfossil's checkout writes symlinks as regular files, so wardrobes may not hold them; suit back undoes an update and not a check-in; and a store left half updated by a double failure has no repair command yet.

Not yet run: Fil-C and the Linux build of this phase.

Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: 2f274ce15b0c3ff3f107c16bfaecedcbc362f9f199447955c32ec7b23be5568a
User & Date: dmestas on 2026-11-12 22:28:09.627
Other Links: manifest | tags
Context
2026-11-12
22:50
A store interrupted mid-update can be repaired, and symlinks are refused

An update now writes a journal before it changes anything and removes it only when the update, or the put-back after a failure, has finished. If the journal is still there, every store command refuses and names the fix. suit store repair restores each file to the version the store was leaving. Tested with a double failure and by killing suit in the middle of a slowed 100-file update: repair restored every byte.

libfossil's checkout writes symlinks as regular files, so suit refuses them outright: store open and update refuse a version that holds one, and commit refuses to check one in. Each names the path.

The fuzz corpus libFuzzer grew is minimized and checked in (300 inputs for the config parser, 83 for the stamp reader), so every push replays it under the sanitizers and Fil-C.

The budget test takes the best of three runs. It measured 0.43 to 0.59 ms quiet and 0.72 to 0.88 ms at a load average of 130 to 170.

243 unit checks, 220 shell cases, 146 store cases. 100% coverage in all ten source files. check-in: cbd57cce10 user: dmestas tags: trunk

22:28
Phase 2: the store, a working copy that is never half written

The store is a working copy of a wardrobe, kept through libfossil's C API with suit's own file writer: every file is written beside itself and renamed, so a reader sees the old file or the new one.

suit store open, status and update, suit commit and suit back. An update refuses when there are local changes, runs as a dry run first, and changes nothing if any file would conflict.

Proven here: the store is byte-identical to fossil's own checkout of a 600-file wardrobe at each version; a reader hashing files during a slowed update saw only old or new contents; an update that fails at any call leaves the old bytes and no temporary file. 100% of functions, lines, regions and branches in all ten source files.

Vendored, unedited: libfossil trunk f2983dcd78, SQLite 3.55.0, zlib 1.3.1. The release binary links only the system library.

Speed: with everything linked, suit costs 0.82 ms over an empty program quiet and up to 1.38 ms under load, which is over budget. The timer's entry point is now suit-run, a 35 KB program built from the no-change path alone, at 0.40 ms quiet and about 0.5 ms loaded. It runs suit only when something changed. The budget test is on suit-run.

Known limits, recorded in docs/decisions.md: libfossil's checkout writes symlinks as regular files, so wardrobes may not hold them; suit back undoes an update and not a check-in; and a store left half updated by a double failure has no repair command yet.

Not yet run: Fil-C and the Linux build of this phase. check-in: 2f274ce15b user: dmestas tags: trunk

21:31
The shell suite asks the binary how its C library words an I/O error

Under Fil-C on the forge all 210 unit checks passed and 201 of 214 shell cases did. The 13 failures were one cause: the cases expected glibc's wording for errno 5, and Fil-C's C library words it differently. The suite now learns the wording from the binary under test. check-in: 143986639c user: dmestas tags: trunk

Changes
Added src/run_main.c version [217121a956].
Added src/store.c version [cecffc135d].
Added src/store.h version [212e750deb].
Added src/store_fs.c version [2cea17e9f1].
Added src/store_fs.h version [7e609685b4].
Added test/store.sh version [cfa9afd3e4].