Artifact aeb5ea02468db935ef7d6f393f890ab06219656503aaf99e645527aa73409472:
- File
test/make_fixture.sh
— part of check-in
[cbd57cce10]
at
2026-11-12 22:50:34
on branch trunk
— 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. (user: dmestas, size: 1883) [annotate] [blame] [check-ins using]
#!/bin/sh # Rebuilds test/fixtures/wardrobe.fossil with stock fossil: two check-ins on # trunk made by user "fixture". The fixture is checked in, so the store tests # run on machines without fossil; this script only exists to remake it. set -eu out=$(cd "$(dirname "${1:-test/fixtures/wardrobe.fossil}")" && pwd)/$(basename "${1:-test/fixtures/wardrobe.fossil}") work=$(mktemp -d "${TMPDIR:-/tmp}/suit-fixture.XXXXXX") trap 'rm -rf "$work"' EXIT INT TERM rm -f "$out" fossil new --admin-user fixture "$out" >/dev/null mkdir "$work/co" && cd "$work/co" fossil open "$out" >/dev/null mkdir -p skills/alpha skills/beta agents printf 'alpha v1\n' > skills/alpha/SKILL.md printf 'beta v1\n' > skills/beta/SKILL.md printf 'reviewer v1\n' > agents/reviewer.md printf '#!/bin/sh\necho hello\n' > run.sh chmod +x run.sh fossil add . >/dev/null fossil commit --user fixture -m "first" >/dev/null sleep 1 printf 'alpha v2\n' > skills/alpha/SKILL.md printf 'gamma v2\n' > skills/gamma.md printf '#!/bin/sh\necho hello again\n' > run.sh rm skills/beta/SKILL.md fossil add skills/gamma.md >/dev/null fossil rm skills/beta/SKILL.md >/dev/null fossil commit --user fixture -m "second" >/dev/null # A second wardrobe for the symlink refusals: one check-in without a link, and # the same repository after one more check-in that adds a symlink. link=$(dirname "$out")/wardrobe-link.fossil linkv1=$(dirname "$out")/wardrobe-link-v1.fossil rm -f "$link" "$linkv1" cd "$work" && mkdir co2 && cd co2 fossil new --admin-user fixture "$link" >/dev/null fossil open "$link" >/dev/null fossil settings allow-symlinks on >/dev/null mkdir skills printf 'alpha\n' > skills/alpha.md fossil add . >/dev/null fossil commit --user fixture -m "no link yet" >/dev/null cp "$link" "$linkv1" sleep 1 ln -s skills/alpha.md link.md fossil add link.md >/dev/null fossil commit --user fixture -m "adds a symlink" >/dev/null