Artifact ac328ea59497e0d009b66837c443ffd6c28211b47da748c0b12556e319d7b9e0:
- File
docs/evidence.md
— part of check-in
[0c65a50c7f]
at
2026-11-14 00:48:47
on branch trunk
— Phase 7c-1: a wardrobe can be cloned onto a second machine, and one call tends them all
suit clone NAME URL makes a wardrobe on this machine from a remote. It clones into a temporary file, renames it into place, opens the store at the tip of trunk and records the remote last. A failure at any step removes what it made: no partial repository file, no store folder, no remotes line. A name already in use is refused with exit 20 and nothing is overwritten. A login saved beforehand is used, so a private wardrobe can be cloned.
suit tend with no name tends every wardrobe in name order. One wardrobe's failure does not stop the others; the exit code is the highest any of them returned, with one line for each that did not end clean.
After three failed syncs in a row the attention file names the wardrobe and the host. A sync that reaches the remote clears the count and the line.
A limit: libfossil's clone builds its own context, so fault injection cannot reach the system calls made inside the clone. The tests cover every step suit takes around it, and a bad remote covers a failure inside it.
One existing case changed: tend-usage expected suit tend with no name to be an error, which is now the behaviour above. It tests suit tend with two names instead.
1204 unit checks, 227 shell cases, 669 store cases, 612 placement cases and 378 project cases, under clang, under gcc 16, with no user name set, and under a strict umask. 100% coverage in all 22 source files. No suite has fewer cases than at the last check-in. (user: dmestas, size: 12944) [annotate] [blame] [check-ins using]
# Evidence Measured on 2026-11-12 on an Apple silicon Mac, against the libfossil build in `~/libfossil` (debug, check-in 3d8f959f). ## Extracting a version gives an exact tree A wardrobe of 602 files, including one executable script and one symlink, with one file deleted in the second check-in. - Extracted in 392 ms. - The executable bit and the symlink were kept. - The deleted file was absent. - The skills tree was identical to the source. ## A local edit survives an upstream update Replayed with a skill file: an upstream branch, a local edit on trunk that rewrites one line, then two upstream updates. | Upstream change | Result | |---|---| | A different line | Merged. Both the local edit and the upstream change are in the file. | | The same line | Reported as a conflict, with three-way markers. The local edit is not overwritten. | ## What one run costs 400 runs each, at load average 65. | What ran | Median | 95th percentile | |---|---|---| | Starting any process (`/usr/bin/true`) | 6.4 ms | 19.5 ms | | 33 KB C23 binary: read a stamp, compare, exit | 6.8 ms | 11.2 ms | | 3 MB binary with libfossil linked in | 7.8 ms | 13.1 ms | | Plain SQLite query on the repository | 12.0 ms | 19.8 ms | | Load libfossil, open the repository, resolve trunk | 15.7 ms | 24.2 ms | Starting a process is the cost. A large binary adds about 1 ms. Opening the repository adds 5 to 9 ms, so the no-change run never opens it. ## From ctx, which is built the same way - Capture a real payload from a harness before writing a parser for it. - Time under load. Two regressions were invisible on a quiet machine. - Log a start and an end line for every run, so a run killed at its deadline leaves a trace. - Never write into a folder from something an agent is waiting on. ## Phase 1 bench Measured on 2026-11-12 by `make check-budget`: 600 rounds of three programs (order rotated each round), a stamp over 100 files, load average 22 to 30 on a 14-core machine. The budget is judged on the median of per-round differences, suit over empty. | Run | Program | Median | p95 | Max | Peak resident (median) | |---|---|---|---|---|---| | Quiet | `/usr/bin/true` (info only) | 3.168 ms | 12.601 ms | 25.369 ms | 1232 KiB | | Quiet | empty | 3.825 ms | 14.008 ms | 23.375 ms | 1408 KiB | | Quiet | `suit run` | 4.926 ms | 16.049 ms | 25.539 ms | 1440 KiB | | Loaded (`loadgen 30 8`) | `/usr/bin/true` (info only) | 4.195 ms | 9.456 ms | 23.113 ms | 1232 KiB | | Loaded (`loadgen 30 8`) | empty | 5.372 ms | 10.481 ms | 24.658 ms | 1408 KiB | | Loaded (`loadgen 30 8`) | `suit run` | 6.214 ms | 11.579 ms | 36.684 ms | 1440 KiB | | Run | Suit over empty, per-round median | Suit over `/usr/bin/true` | Resident over empty | |---|---|---|---| | Quiet | 0.917 ms | 1.502 ms | +32 KiB | | Loaded | 0.935 ms | 1.811 ms | +32 KiB | Both pass the 1 ms and 1 MiB budgets. Earlier runs the same day measured 0.65 to 0.76 ms over empty, so run-to-run spread is about 0.3 ms. Two causes, measured separately on the same machine: - Binding about 50 libc symbols at launch costs about 0.28 ms (5 to 6 us each) against an empty program. `suit` binds 47. - Statting 100 files costs about 0.3 ms more than statting one. Paths in the same folder are now statted through one open handle on that folder. Also: a byte-for-byte copy of `/usr/bin/true` starts 0.4 to 1.0 ms slower than the original, and an empty built program 0.6 to 1.5 ms slower, which is why the baseline is an empty built program. ## Phase 2 Measured on 2026-11-12 on the same Apple silicon Mac, load average 40 to 80 from other work. Release builds (`-O2 -flto`, stripped), a stamp over 100 files, 600 rounds each, per-round median of the difference to an empty program built the same way, as in "Phase 1 bench". The question: does the no-change run stay within 1 ms once SQLite, libfossil and zlib are linked in? | Program | Size | Symbols bound at launch | Quiet | Under `loadgen 30 8` | |---|---|---|---|---| | (a) `suit`, everything linked | 1,843,480 bytes | 129 | 0.82 and 0.83 ms | 0.98, 1.08, 1.11 and 1.38 ms | | (b) `suit-run`, the no-change path only | 34,760 bytes | 23 | 0.40 and 0.42 ms | 0.52, 0.55 and 0.72 ms | The one binary is over the budget under load, so the budget test runs on `suit-run` and `suit run` is what `suit-run` starts when something differs. Both programs link only `libSystem` (`otool -L`): SQLite, libfossil and zlib are compiled in. The store, on `test/fixtures/wardrobe.fossil` and, where stock fossil is installed, on a 600-file wardrobe made with it: - Byte for byte, with executable bits, the store equals `fossil open`'s checkout at the first version, after an update to the second, and after `suit back`. - A reader hashing 150 files while an update rewrote them, each rename delayed by 20 ms, saw 61 old and 89 new contents and none half written. - An update that fails on any of open, write, fsync, close or rename leaves every file at its old bytes and no temporary file. - A check-in made by suit shows in `fossil timeline`, `fossil cat` reads its files, and `fossil test-integrity` passes. What libfossil could not do: - Symlinks. `fsl_repo_ckout()` writes every file with one `fsl__cfs_write()` call (`libfossil.c` 40022 to 40033, in `fsl_repo_extract_f_ckout`) and never asks whether the entry is a link, so a symlink in a wardrobe comes out as a regular file holding the target path. The change scan then reports it as edited, for ever. The link hook (`xSymlinkCreate`) is used only by rename, stash and undo (lines 42789, 42953 and 43970). `fsl_ckout_manage()` also skips symlinks (`fsl_dircrawl_f_add`, 39150 to 39170), so a new link is never checked in. So suit refuses them, explicitly and with tests (docs/store.md): `open` and `update` refuse a version that has one and `commit` refuses to check one in. - Putting files back after a failed update is suit's own: an update that fails and whose put-back fails leaves a journal, and `suit store repair` restores the files (docs/store.md). - Undoing a check-in. `fsl_undo()` covers update, merge, revert and stash; after a commit it answers `FSL_RC_CONFLICT` (`undo.h`: "Undo refuses if the checkout is no longer on the version the operation left it on (e.g. after a commit)"). `suit back` undoes the last update only. - A dry run leaves the version it went to in the context after the database is rolled back, and a real update in the same context then undoes the wrong thing. `suit store update` runs the dry run in one libfossil context and the update in a fresh one. - The change scan trusts size and mtime, so an edit made in the same second as the file was written, to the same length, is missed. Suit scans with `FSL_VFILE_CKSIG_HASH`. ## Phase 4a The machine's name, the machine limit, and joined instructions. `make all` passes: unit 420 checks, `run.sh` 227 cases, `store.sh` 146, `place.sh` 612 (163 new, covering `suit machine`, the limit, the winner, joined files and the failures of each), all with no failure; coverage is 100% of functions, lines, regions and branches in 16 files. The ledger parser has seven new fuzz seeds for the `file` record. The no-change budget is unchanged at 1.000 ms over an empty program and 1024 KiB resident. The stamp now watches 129 paths (the machine file is one). Per-round medians over empty: 0.457, 0.456 and 0.467 ms quiet; 0.664, 0.747 and 0.786 ms under load; resident 0.0 KiB in every round. One consequence for reading the code: the machine file is read in `prepare` before the ledger, so the fault-injection call numbers for the ledger's `open` moved up by one in `test/place.sh`. ## Phase 4b-1 Finding projects, with no placement yet. Measured on the development machine. - 993 unit checks, 227 shell cases, 146 store cases, 612 placement cases and 118 project cases, all passing under ASan and UBSan. - 100% of functions, lines, regions and branches in all 18 source files. - A remote address written as `https://User:[email protected]:8443/x/y.git/` gives the key `example.com/x/y`, and the word "secret" appears nowhere in suit's output or files. - A zit project gets no key from a scan; one is set by hand. - A key set by hand is applied by the next scan, not at once. ## Phase 4b-2 The Project personal scope: your own assets linked inside each project that has the key, hidden from git by that project's own exclude file. Measured on the development machine. - 1006 unit checks, 227 shell cases, 146 store cases, 612 placement cases and 310 project cases, all passing under ASan and UBSan. - 100% of functions, lines, regions and branches in all 19 source files. - A fault sweep fails the Nth call of `open`, `write`, `rename`, `mkdir`, `fsync` and `unlink` in an apply, in an apply that changes things and in an off, and after each one `suit off` puts the projects, the scratch home and the joined files back exactly as they were, with no entry left in the ledger. - A linked worktree and its main repository share one block in the main repository's exclude file, found through `commondir` and tidied of `..`, so the same file is never named two ways. - The no-change budget still passes with three more files watched (roots, projects, projects.set): about 0.43 ms against a limit of 1 ms. ## Phase 4c `suit why NAME`: every place that supplies an asset, and which one is in effect, for the current folder. It reads and changes nothing. - `why` asks resolve, so it cannot disagree with `apply`: resolve records each place that supplies the name, and after it settles a destination each place is marked placed, joined or dropped by comparing its source with the one that won. Sections that did not apply are recorded the same way. - `suit status` now says a machine-limited `[wear personal ...]` section that did not apply, as it already did for `[wear user ...]`. - The current folder is read through a new fault wrapper, `getcwd`. - 1011 unit checks, 227 shell cases, 146 store cases, 612 placement cases and 376 project cases, all passing under ASan and UBSan. - 100% of functions, lines, regions and branches in all 19 source files. ## Phase 7a - The lint (`suit lint`, and the first step of `suit commit` and `suit tend`) reads the new and edited files of the working copy and reports `PATH:LINE: what`: token-shaped values, attribution text, symlinks, skill folders without a `SKILL.md` or its `---` header, files over 4 MiB and lines over 64 KiB. `suit.lint` allows a file or forbids a literal. Exit 3. - `suit tend` checks in with `Edits on MACHINE: N files` when the lint is clean, and otherwise leaves `lint NAME` and its problems in `$SUIT_HOME/attention` and exits 3. A check-in that deletes more than 5 files and more than a fifth of the tracked ones is held (exit 4) unless `suit commit ... --confirm-deletions`. `suit status` prints the file under `needs you:`. - The lint runs in a transaction that is rolled back, so a refused check-in leaves the repository and every file of the working copy byte for byte as they were. The checkout database `.fslckout` is rewritten by any scan, with the same rows, and is not part of that claim (`suit store status` does the same). - A file replaced by a symlink is reported once, through the lint. The symlink refusal of `commit` is now exit 3 and `PATH: symlink, not supported`, not exit 16. - A tracked file already unmanaged by a failed check-in still counts as a deletion for the hold. ## Phase 7b-1 Remote, login and `suit sync` without TLS. Two machines and a `file://` remote in a scratch folder reach each other's working copies byte for byte through two syncs; edits to different files merge; edits to the same lines, an edit against a deletion and a binary edited on both sides stop with exit 13, every working-copy file byte-identical and the local check-ins pushed. Where `fossil` is installed, a loopback `fossil server` covers `http://`, a login and a wrong password (exit 19). The suite found three bugs on the way: a secret with a trailing word was truncated by the parser, a merge of a deletion lost the other side's edit, and a merge changing no file failed after writing the journal. ## Phase 7c-1 `suit clone` over `file://` gives a store byte-identical to the first machine's, and an edit made on the clone reaches the first machine through a tend and a sync. Against a loopback `fossil server` made private, a clone without the login or with a wrong one exits 19 and leaves nothing; with the login it succeeds and the secret appears only in the credentials file. Failing each system call in turn leaves either a whole clone or nothing. `suit tend` with no name over zero, one and three wardrobes, the middle one failing its lint, tends the others and exits with the highest code. The failing-sync line appears at the third failure, grows, and is removed by the next sync that reaches the remote.