Artifact 64fdfe378c936527a7b4ba37a228ed733700b18dbc7ad011601641fb9cfbee67:
- File
docs/phases.md
— part of check-in
[27d847f693]
at
2026-11-18 16:19:19
on branch trunk
— suit syncs and clones over https
suit sync, suit clone and suit tend now work with https:// remotes. http:// and file:// keep libfossil's built-in channel.
libfossil is the private byot build 2f20f44ba4 in place of trunk f2983dcd78, approved while suit is being proven; only libfossil.c and libfossil.h differ from trunk's files. Its stream channel does all of the HTTP: request headers, Content-Length, chunked and close-delimited replies (the last only after a clean close), the reply-size limit and the timeout. suit supplies the transport: src/tls.c, over non-blocking TCP and BearSSL 0.6, now vendored.
- TLS 1.2 only, ECDHE key exchange, AES-GCM or ChaCha20-Poly1305. A server offering only TLS 1.3, RSA key exchange or CBC is refused. - The chain is verified against trust anchors and the host name against the certificate. Anchors come from the system's PEM bundle read at run time (SSL_CERT_FILE, then the usual macOS and Linux paths), or from a per-wardrobe CA file set with --ca, which replaces the bundle. No roots are compiled in and there is no way to trust anything. - A certificate file must be a regular file owned by the user or root, writable by no one else, in a folder that passes the same check; --ca refuses a symlink, and a FIFO is refused at once. - Redirects are refused, never followed, and the message names the new address. No proxy support. - Nothing is sent before the handshake has verified. The login goes out only as libfossil's login card. Commands that read the sync secret turn core files off first. - Every connect, read, write and name lookup waits in poll with a 30 s idle limit, and a whole command stops after 10 minutes. getaddrinfo has no deadline, so it runs in a forked child that is killed and reaped. - BearSSL makes no system call of its own: it is built without its own randomness or clock, and suit seeds it and gives it the time through its fault wrappers. - Exit 18 now means the secure connection failed (handshake, certificate, host name). 17 stays the network and 19 a refused login.
A per-wardrobe CA file is kept in cafiles in suit's home folder, one NAME PATH line each. suit-run is built without the network code and is unchanged at 35496 bytes; the speed budget passes. Release suit went from 2291288 to 2490024 bytes.
An independent security review found no critical or high issues. Its one medium finding, a CA file trusted without checking its owner, mode or type, is fixed here, as are its low ones: separate storage for each set of anchors, core files off, and the release check now covering every test-only switch.
Checked against a real server: an anonymous clone of this repository over https from its forge, 8.4 s, verified with stock fossil.
A new suite, test/https.sh, with 170 cases, runs local servers with test certificates made at test time, including servers that misbehave on purpose. It prints skip lines where openssl or nc is missing. A new fuzz target covers the bundle reader.
3788 unit checks (was 3669), 625 shell cases, 1153 store cases, 985 placement cases, 378 project cases, 236 usage cases, 288 curate cases, 376 curate-apply cases and 170 https cases, under clang, under gcc 16, with no user name set, and under a strict umask, in one run of make gate (76 minutes, on a loaded machine). 100% coverage in all 34 source files. Three store cases that expected "cannot use https yet" now expect the refusal for a missing certificate bundle. (user: dmestas, size: 5047) [annotate] [blame] [check-ins using]
Phases
Each phase ends with a proof. All four scopes and both limits are in the config format from the first day and are switched on in this order.
| # | Phase | Done when |
|---|---|---|
| 1 | Skeleton and the speed test: the build, the config parser and its fuzzer, the no-change compare, suit bench |
The budget test passes under load. |
| 2 | Store: open a wardrobe, keep a working copy, update it file by file, go back | The store is byte-identical to a Fossil checkout, an update never leaves a half-written file, and suit back restores the previous state. |
| 3 | User scope: links and the ledger for Claude Code, Codex and pi in a scratch home folder. plan, status, off. |
One edit to the instruction file shows in every harness, a real file is never replaced, and off leaves the folder as it found it. |
| 4 | Limits and Project personal: machine names, project discovery, the ignore block, worktrees, the winning order, joined instructions, why |
A personal skill for a project appears in it and its worktrees, in no other project and in no git status, and a clash with a committed file is reported and left alone. |
| 5 | Content: import the sx vault, hand-made skills, agents and commands. Join the instruction files after review. | The scratch home folder matches today's, minus duplicates. |
| 6 | Cut over: snapshot the real folders, apply, remove the other installers | Done after the full asset list has been reviewed. The only destructive phase. |
| 7 | The hourly pass: suit install, the timer, checking in edits, recording per machine, push and pull, repair, the status line |
An edit to a linked skill on one machine reaches another with no command run, and a conflicting edit leaves no markers in a live file. |
| 8 | Upstreams, needs and slots: fetching pinned archives, upstream branches, merge, the review gate, the status line slot, the hook dispatcher | A local fix survives an upstream update, a conflicting update waits for review, and a hook limited to one machine runs there and nowhere else. |
| 9 | Enterprise and publishing to Project shared | An Enterprise asset beats a User one of the same name, and a teammate's edit to a published file is reported and not overwritten. |
| 10 | Linux and suit upgrade |
The Linux build passes the same tests. |
State
| # | State |
|---|---|
| 1, 2, 3, 4 | Built. Proven on macOS and on Linux under gcc sanitizers and Fil-C. |
| 7 | Part built. Proven on both: the lint, the hourly check-in, held deletions, the attention file. Built: sync over file://, http:// and https:// (BearSSL, libfossil's stream channel; tested against local servers and one clone from zeitforge), suit clone, suit tend for every wardrobe, the failing-sync line. Built (7c-2): suit install and uninstall (the run and tend timers on macOS and Linux) and suit status --line; proven with a fake loader in a scratch home, the Linux files only as text on this Mac. Not started: recording. |
| 8 | Part built (8a): needs. suit needs, suit need, and the need items in the attention file. Proven in a scratch home. Built (8b): the hook dispatcher suit-run hook EVENT, hook slots, suit hooks. Built (8c-1): upstreams taken from a folder, suit upstream NAME take\|diff\|accept\|undo and suit upstreams (the branch, the review gate, the merge into trunk, and undo, a new check-in that reverses the newest accept, after which the update can be accepted again, since each merge is made against the check-in the record names; upstreams.md). Not started: fetching an upstream (8c-2), which can now use the https transport; the other slots. |
| Stacking | Built: placing takes every wardrobe under the store, merged into one set (decisions.md, 2026-11-15). It unblocks phase 5, which imports content into a public and a private wardrobe. |
| Usage counts | Part one built: three harness keys that describe a harness's session records as data, a streaming bounded-memory reader with its own fuzz target, the per-machine tally in $SUIT_HOME/usage, suit usage scan, suit usage, and the scan in the hourly suit tend (usage.md). Proven on macOS under ASan and UBSan, on a scratch tree of made-up records and on the real Claude Code records read-only. Part two built: suit curate writes one local page of every asset beside its use, with keep, limit and retire choices and a text file of them (curate.md); it applies nothing. Part three built: suit curate apply FILE [--yes] reads the choices file, prints a plan (the outfits it edits, the placements that would change, the wears affected) and with --yes edits the wardrobes' suit.conf files as text and checks each in; it never applies (curate.md). Proven in scratch wardrobes that are real repositories. |
| 5, 6, 9 | Not started. |
| 10 | The Linux build already passes the same tests on every push. suit upgrade is not started. |
Phase 7 was started before 5 and 6 so that the cut-over lands on a tool that already keeps itself in sync.