Skip to content
suit Artifact [4e1d061a25]
Login

Artifact [4e1d061a25]

Artifact 4e1d061a25f4b5ec56c712e48c62e67a34492f249056d7646ec9dd4cc6cf48d2:


# Decisions

Settled on 2026-11-12. Each has a short reason. A change to one of these
gets its own dated entry below the table, with what changed and why.

| Question | Decision | Why |
|---|---|---|
| Language | C23, one binary | No runtime to install. The compiler on macOS builds it today. |
| Dependencies | None to install. SQLite, libfossil, zlib and TLS are compiled in. | Version control inside the tool is worth more than the smallest binary. |
| TLS | OpenSSL first, behind an interface of connect, read, write, close | A client written from the RFCs can replace it later without touching the rest. |
| Version control | Fossil, through libfossil's C API. Remote on zeitforge. Worked on with zit. | Merge keeps a local edit through an upstream update. Tested. |
| Name | suit for the tool, wardrobe for the repository | Reuses the first version's name, content and design record. |
| Harnesses | Described as data in the wardrobe. No harness code in suit. | Every other tool has a fixed list of harnesses. |
| Anything a harness must do itself | A need: a prompt its own agent follows, with a test | Keeps suit ignorant of harness formats. |
| Scopes | Enterprise, User, Project shared, Project personal, with machine and harness limits | See vocabulary.md. |
| Editing | In place, in the store. Suit checks edits in and syncs them hourly. | Editing where you find it is what people and agents already do. |
| Files a harness rewrites | Recorded into the wardrobe when they change, per machine | The harness stays in charge and there is still history. |
| Status lines and hooks | In the wardrobe. Registered once to a slot, then changed by linking. `suit hook` dispatches hooks. | One registration, no later edits to a harness's settings. |
| Upstream updates | Wait for review by default. `trust = auto` per upstream. | A skill is instructions to an agent, so a change from elsewhere is untrusted input. |
| When suit runs | Two timers: every minute `suit-run`, every hour `suit tend` (see 2026-11-13). | Nothing installed in a harness. No agent waits on it. |
| Speed | The no-change run costs at most 1 ms more than an empty program built the same way, writes nothing and opens no database. The build fails otherwise. | Starting a process costs about 6 ms under load, so the budget is relative. |
| First harnesses | Claude Code, Codex, pi | Proven in a scratch home folder before any real folder is touched. |
| One binary or two | One | A 3 MB binary starts about 1 ms slower than a 33 KB one. Not worth a second program. |

## 2026-11-12: the speed baseline is an empty program, not /usr/bin/true

The speed budget was measured against `/usr/bin/true` with a limit of 1 ms.
It is now measured against `build/empty`, a program whose `main` returns 0,
built with the same compiler and flags as `suit`, with a limit of 1 ms.
`/usr/bin/true` is still printed, for information only. Reason: a system
binary starts 0.6 to 1.5 ms faster than any binary we build on macOS (a
byte-for-byte copy of `/usr/bin/true` is already 0.4 to 1.0 ms slower than
the original), so the old baseline measured macOS and not suit. The test
compares within the same round and takes the median of the per-round
differences, because run-to-run noise at this machine's load is large.

Measured in phase 1: 0.92 ms quiet and 0.94 ms loaded over the empty
program (0.65 to 0.76 ms in earlier runs). About 0.28 ms of that is binding 47 libc symbols at launch, so the
cost grows with what is linked in. The one-binary decision is to be
re-measured in phase 2, when SQLite, libfossil, zlib and TLS are linked. If
the no-change run then exceeds 1 ms, the fix is a small front program for
the timer and the hook dispatcher, not a looser budget.

## 2026-11-12: the wardrobe is two repositories

Your config is split into a public wardrobe (skills, agents, commands,
outfits) and a private one (instructions, files recorded from each
machine, anything personal). The lint that rejects token-shaped values
does not catch account ids, names or local paths, which the instruction
file and recorded settings contain. Wardrobes already stack, so this adds
no mechanism. (Corrected on 2026-11-15, below: that sentence was not true of
the code.)

## 2026-11-12: libfossil is used through its C API, with suit's own file writer

Pinned to trunk check-in f2983dcd78, with SQLite 3.55.0. Three facts from
reading libfossil's source decided this:

- libfossil writes working-copy files in place: it truncates, then
  writes. A reader could see an empty or half-written file. Suit installs
  its own storage through fsl_cx_ckout_fs() and writes beside the file,
  then renames. Only the C API offers that.
- An update merges into a file that has local edits and writes conflict
  markers into it. Suit therefore checks local edits in first, runs the
  update as a dry run, and applies it only when the dry run reports no
  conflict.
- HTTPS is compiled in only with OpenSSL, and no test in libfossil's tree
  exercises it. A clone from zeitforge over HTTPS worked by hand. HTTPS
  under Fil-C is untested and is a named risk for the sync phase.

## 2026-11-12: where each gate runs

The forge's Linux runner has gcc and no clang. On every push it runs the
suite under gcc's ASan and UBSan and then under Fil-C (`make ci`).
Coverage, static analysis, live fuzzing and the speed budget need clang
and run on the development machine before a check-in (`make all`).

## 2026-11-12: the no-change run is its own program

Phase 2 linked SQLite, libfossil and zlib into `suit` and measured the
no-change run both ways (docs/evidence.md, "Phase 2"). The one binary costs
0.82 ms over an empty program on a quiet machine and 0.98 to 1.38 ms under
`loadgen 30 8`, over the 1 ms budget. A front program built only from the
no-change path costs 0.40 to 0.42 ms quiet and 0.52 to 0.72 ms loaded. So:

- `suit-run` is shipped beside `suit`. The timer starts `suit-run`. It reads
  the stamp, compares, and exits 0 when nothing changed. When something
  differs it replaces itself with `suit run`, which does the work.
- The budget test runs on `suit-run`. The budget is not loosened.
- It still holds that the build is two programs: this settles the "One
  binary or two" row for as long as anything heavy is linked into `suit`.


## 2026-11-12: the ledger is a text file

The ledger, `$SUIT_HOME/ledger`, is a plain text file: one `link DEST SOURCE`
line per symlink suit made, and one `dir DEST` line per folder it made to
hold one, and one `file PATH` line per joined instruction file it wrote
(docs/store.md). It is rewritten whole, beside and renamed, so a reader sees the old
ledger or the new one. Reason: `status` and `off` must work with nothing but
the file, no database and no store, so they still work when the store is
damaged, the config is wrong or SQLite cannot open. The parser is strict
(absolute paths with no space, no duplicates, at most 4096 entries, 1 MiB,
8192 bytes a line, a final newline) and has its own fuzz target. Before
placing anything, suit writes a ledger that lists everything about to exist
and everything about to go; after, one that lists what is on disk. So a crash
leaves the ledger a superset of the disk, never a subset, and `off` never
misses a link suit made. The `dir` lines are an addition to the first design
(links only): without them `off` could not leave the home folder as it found
it.

## 2026-11-12: `suit run` applies, and exit code 10 is the compare's alone

`suit run` was the no-change compare and exited 10 when something differed.
It now does the work: it compares, and when something differs it runs
`apply` and exits 0. Exit 10 and the `changed: PATH` lines belong to
`suit compare`, which is the compare alone, with the same exit codes as the
old `suit run` (0 unchanged, 10 changed, 11 no stamp, 12 bad stamp). The
timer's program, `suit-run`, still does the compare itself and replaces
itself with `suit run` on a difference. What the stamp covers is the entry
"2026-11-17: the stamp watches what apply acts on" below.

## 2026-11-13: personal links are hidden with each project's own exclude file

The links of the Project personal scope sit inside a project and must not be
committed by accident. Suit hides them with the project's local exclude file
(`info/exclude` of the main repository, found through `commondir` for a
linked worktree), in a marked block that `suit off` removes, and not with
the global ignore file. A global entry would hide same-named files in every
project, including a file another project commits on purpose. A Fossil or
zit project has no local exclude file, so its links are placed and `suit
status` says they are visible. A destination that already holds something
that is not suit's link is a clash and stays untouched, so what a project
commits always wins; suit never runs git.

## 2026-11-13: how sync pulls, merges and pushes

`suit sync` uses `fsl_sync_client` (pull, then push) and `fsl_ckout_merge`. The
password reaches libfossil only through its password callback, with the user
name in the address, so it is in no address string or message. A fork is
another open trunk leaf besides the working copy's version. It is tried as a
dry run first and merged only if no file conflicts, because a merge writes
conflict markers into files. libfossil's merge silently drops a file the other
side deleted and silently skips one this side deleted, so suit compares the
common ancestor's files with each side's and counts those as conflicts. A merge
that changes no file cannot be checked in (`fsl_checkin_commit` answers
`FSL_RC_NOOP`), so the files go back and the fork stays. A conflict does not
stop the push: a fork on the remote loses nothing. `file://` runs stock
`fossil test-http`, which can leave fossil's own background process running;
the tests turn it off with `backoffice-disable`.

## 2026-11-13: how clone gets a wardrobe onto a second machine

`suit clone NAME URL` uses `fsl_clone` (protocol 3) with `fsl_repo_create`'s
options, into `NAME.fossil.clone` beside the destination, then renames it into
place: a clone that fails or is killed leaves no repository file under the
name a reader looks for. `fsl_clone` makes its own libfossil context, so none of
its file calls go through suit's wrappers and the fault tests cover suit's steps
around it; a remote that cannot be used is covered by really using one that
cannot. After the rename, `store open` and the remotes line follow; a failure of
either removes the store and the repository file again, so the clone is whole or
absent. The remotes line is written last, through `suit remote`'s own code, so
the address passes the same check. `suit tend` with no name lists the wardrobes
folder and calls the one-wardrobe tend for each, because a timer should not need
to know the names. The failing-sync count is one tiny file per wardrobe rather
than a list file, so a parse error concerns one wardrobe and the rewrite is a
whole-file replace of a few bytes. Exit 20 is new, for a name already taken.

## 2026-11-13: two timers, not one timer with a detached hourly child

`suit install` sets up two timers: every minute `suit-run`, every hour
`suit tend`. The first design had one timer and the minute program starting a
detached child once an hour. Two timers keep the minute run inside its speed
budget (it does the compare and nothing else, with no clock check and no child to
start) and make each job visible and stoppable by itself in launchd or systemd:
a tend that hangs or fails shows under its own name, and it can be stopped without
stopping the minute run. The text of the files comes from pure functions that
build on both platforms and are unit-tested on both; only which set is written,
and the loader, depends on the platform. The loader's path can be overridden by
SUIT_LOADER only in the builds with fault injection, so no test can reach the
real `launchctl` or `systemctl` and the release build has no such code.

## 2026-11-14: a failed load is left where the person will see it, and install again retries

When the loader failed, install exited 3 and left the files; a second install
found them identical, said `already installed` and never loaded again, so the
timers stayed unloaded with nothing to say so. For a tool meant to run hands-off
that was wrong. Now a failed load leaves one item in the attention file
(`timers load: written but not loaded (LOADER exit N)`), which `suit status`
already counts and shows, and an install that finds the files identical and the
item there loads again instead of saying `already installed`. Success, by any
path, and uninstall remove the item. The item uses the attention file's own
`KIND NAME` form, so it is replaced, not repeated, and no other item is touched.
A failure to write the item is said but never hides the load failure: exit 3.

## 2026-11-14: how a need is judged, and what a failed attention update does

Decided while building needs, where the brief did not say:

- `contains` on a folder, a pipe or a device is `cannot tell (not a regular
  file)`, not `not done`: a test that names something that cannot hold text is
  a mistake worth showing. A link to a file is read through, since a harness's
  settings file may itself be a link into the store. `exists` uses lstat, so a
  link whose target is gone still exists.
- A file is read whole, up to 4 MiB plus one byte, rather than in blocks; one
  more byte than the limit is `cannot tell (file is over 4 MiB)`, so a file that
  grows while being read is judged the same as one that was already big.
- An `exists` test whose lstat fails for a reason other than the file being
  absent is `cannot tell`, as `contains` is.
- A need that is wrong in the config (no `prompt` or `done`, a prompt outside
  the store or not a file, a bad test) stops `suit apply` before it places
  anything, as a missing source does, and is exit 2 in `suit needs` and
  `suit need`.
- Needs are judged after the links are placed, so a test that asks about a
  link apply just made sees it.
- When the attention file cannot be updated, apply exits 1 after the links are
  placed and does not write the stamp, so the next `suit run` applies again and
  retries. `suit off` reports the same failure after it has removed the links.

## 2026-11-15: the hook dispatcher

- The dispatcher is `suit-run hook EVENT`, in the small front program, because a
  hook can run on every tool call and the big `suit` is too slow to start for
  that. `suit hook EVENT` calls the same code.
- Exit 2 from a program stops the rest and is the dispatcher's exit status: 2
  means "block" in the harnesses that have blocking hooks, and nothing after a
  block should run.
- Otherwise every program runs and the dispatcher exits with the first non-zero
  status, so a failure is never hidden by a later success.
- Standard input is spooled once to an unlinked file, so every program gets the
  same bytes from the start, whatever the harness sends and however many
  programs there are. Cap 16 MiB.

## 2026-11-15: hook input is read-only

- Hook programs get the spooled input read-only, so one program cannot change
  what the next reads.

## 2026-11-15: suit places from every wardrobe

The sentence "Wardrobes already stack, so this adds no mechanism" in the entry
of 2026-11-12 was not true of the code: placing read one fixed wardrobe, `mine`.
Only the store side (`suit clone`, `suit tend`) was plural. Now placing takes
every folder under `$SUIT_HOME/store` that holds a `suit.conf` and merges the
files into one set. The rules are in [conf-format.md](conf-format.md), "More than
one wardrobe". In short: one namespace for harness, outfit, need and upstream
names; no order between wardrobes; the same section in two is an error; each
path resolves in the store of the wardrobe whose config wrote it; a clash across
wardrobes names both; an error anywhere rejects the whole set.

Rejected: one master config that names assets as `wardrobe:path`. It adds
syntax, and the public wardrobe could not then be used alone.

The ledger needed no change: it already records the full source path, which
holds the wardrobe's name. `suit why` names the wardrobe when more than one
takes part.


## 2026-11-15: upstreams, taken from a folder first

Settled by the owner for phase 8c:

- Each upstream has its own branch, `upstream-NAME`, in the repository of the
  wardrobe whose `suit.conf` defines it.
- Updates merge into trunk, after a dry run, with the discipline of the fork
  merge in `suit sync`.
- An update waits for review unless the upstream says `trust = auto`.
- A new key `into` says where an upstream's files land in the wardrobe. It is a
  relative path of names, at most 256 bytes, with no `..` part, and defaults to
  `skills`. `trust` defaults to `review` and `path` to the folder's top.
- Part one (8c-1) takes from a folder on disk. Part two (8c-2), later, fetches an
  archive over HTTPS and waits on the same transport as `suit sync` to an
  `https://` remote.

Decided while building part one, within those:

- The branch's first check-in has trunk's first check-in as its parent, so
  trunk and the branch share an ancestor and a later merge is three-way. A take
  builds its check-in from a deck with libfossil's own calls and no checkout, so
  the working copy and its local changes are never touched; the first take is
  one check-in, not a branch plus a check-in.
- One attention item for each upstream. A take writes `update waiting for
  review` inside the transaction that records it, so a failed write records
  nothing.
- An upstream is at most 4096 files and 64 MiB, a path at most 512 bytes inside
  `into` and folders at most 32 levels, so a wrong path cannot check in a whole
  disk. Names that start with a dot are skipped and symlinks are refused.
- `accept` is made at trunk's tip only, so that its check-in never forks trunk.
- `suit back` cannot undo an accept: libfossil's undo record for a merge ends
  when the merge is checked in. That is the same as after any check-in
  (store.md, `suit back`), and is a limit of the library. `suit upstream NAME
  undo` does it (2026-11-16, below).
- Every accept writes the tracked file `upstreams/NAME` (the accepted tip's full
  hash, a space, the pin) into its merge check-in. It decides `current` against
  `waiting`, and it means a merge that changes no file still checks in.
- `diff` prints only the list of files, not a unified diff.

See [upstreams.md](upstreams.md).

## 2026-11-16: undo of an accept is a new check-in

`suit upstream NAME undo` reverses the newest accept not yet undone by a new
check-in on trunk. It restores each file the accept changed to its content
before the accept, as long as the file has not changed since, and puts the
upstream back to `waiting for review`, with the item a take leaves. It does not
rewrite history and never moves a branch. A file changed since the accept is a
conflict and nothing changes. An undo is never followed by an automatic accept,
`trust = auto` included.

Rejected: making `suit back` work after a check-in. libfossil's undo record
for a merge ends when the merge is checked in, so that needs a change in the
library.

Found while building it: libfossil refuses to merge a tip that is already an
ancestor of the version it merges into, and the accept's merge check-in made
the branch's tip such an ancestor for good. So an undone update cannot be
accepted again, and `accept` and `diff` said so (exit 1) and changed nothing.
Fixed the same day by the entry below.

## 2026-11-16: the merge base of an upstream is the check-in the record names

`accept` and `diff` merge the branch's tip into trunk against the check-in of
`upstream-NAME` that trunk's `upstreams/NAME` names, or trunk's first check-in
when there is no record, through libfossil's `baselineRid` (fossil's
`merge --baseline`). Not against the newest common ancestor. The record is
suit's own account of which take trunk holds; history is not. After an undo the
undone tip stays an ancestor of trunk for good, so the library refused the same
tip as a no-op merge and would have merged a newer one against files trunk no
longer has. After `--mine` the check-in has no merge parent, so the next take
was merged against an older take and conflicted again on lines already settled.
With the base named, re-accepting after an undo, a newer take after an undo,
and a take after `--mine` all merge what changed upstream since the files
trunk holds. The check-in still has the tip as its second parent, so fossil and
zit show the merge as before. A take's check for a file of your own also looks
at the check-in the record names, since an undo can bring back a file a later
take removed.

Rejected: a cherry-pick of the range from the record to the tip. libfossil
refuses `baselineRid` with a cherry-pick, and its cherry-pick takes the tip's
own parent as base, which is the record's check-in only when one take lies
between. Rejected: suit's own merge; the library does it once the base is given.
`suit sync`'s fork merge keeps libfossil's choice: trunk has no record to name.

## 2026-11-16: usage counts come from the harnesses' own records, read afterwards

Suit counts how often each skill, agent and command is invoked. Decided by the
owner on 2026-11-16:

- **From the harnesses' own session records, read afterwards, not from a
  hook.** Nothing is installed in a harness and nothing runs while a session
  does. A hook would count only what ran after it was installed and would be one
  more thing a harness update can break.
- **What a record looks like is data in the wardrobe's harness section** (the
  keys `sessions`, `session time`, `session project` and `use KIND`), with no
  harness code in suit, as for the harness paths themselves (the first table
  above). Only a harness whose records are described is counted.
- **Suit keeps its own tally, per machine, under `$SUIT_HOME/usage/`,** because
  harnesses delete old records (Claude Code after 30 days by default). It is
  never in a wardrobe: it is this machine's history.

Choices made while building it, each open to change: the identity of a call is
its id, held as a 64-bit hash while a scan runs (so a memory bound holds with
500000 events, and a wrong match needs two equal hashes); a scan writes nothing
if anything fails, the events before the offsets, so a repeat finds the events
already there; a file's first 256 bytes are hashed to tell a replaced file from
a grown one; the first scan reads only files modified in the last 45 days and
notes the rest as unread; an event needs a time in ISO 8601, else it is skipped
and counted; the reader's two limits that bound memory (a string kept to 512
bytes, nesting to 64) are constants named in `src/usage.h`. The test build can
pin the date and lower the limits (`SUIT_NOW`, `SUIT_USAGE_LIMITS`); the release
binary has neither. [usage.md](usage.md) has the model, the language and the
limits; `docs/vocabulary.md` is unchanged ("use" and "session record" are plain
words).

## 2026-11-16: curation is a generated local page and a separate apply step

Deciding what to keep, limit to a project or retire is done on one HTML page that
`suit curate` writes to a local file ([curate.md](curate.md)), and its result is a
short text file. A later step, `suit` reading that file and showing its plan
before it changes anything, applies it (part three: `suit curate apply`, see 2026-11-17 below). Decided by the
owner on 2026-11-16, after a working mock-up:

- **Not a server inside suit.** A program that listens on a port is a different
  program from one that a timer starts every minute and that must start in a
  millisecond over an empty process; it has a lifetime to manage, a port to pick,
  and a local address that any page in the browser can try to reach. A file opened
  from disk needs none of that and works with no network.
- **Not a terminal screen.** The job is a hundred or more decisions, each wanting
  a description, four weekly bars, the projects it is used in and the reason for
  its suggestion, with filters and bulk actions. A terminal screen would need its
  own drawing and key handling in C, under every sanitizer and under Fil-C, to show
  less. The page's script is tested without a browser, against a stub of the
  document.
- **The page applies nothing.** It cannot: it is a file the browser opened. What it
  makes is plain text, in a format that is stable and that a person can read, keep
  and diff (`# suit choices 1`, one line per asset). Applying is suit's own step,
  with a plan shown first, as `plan` comes before `apply`.
- **Retire will mean the unworn `attic` outfit, not deletion.** Harnesses keep
  their records for a month and suit's tally starts at its first scan, so an asset
  used twice a year looks unused. A retired asset stays in the wardrobe, and
  moving one line brings it back. `attic` is the name of an outfit, not a new word:
  the vocabulary stays frozen.

Choices made while building it, each open to change: the page is written with mode
0600 because it names the owner's projects; it loads nothing and holds no handler,
and every value in its data is escaped (`<`, `>`, `&`, U+2028, U+2029) and valid
UTF-8; the template is compiled into the binary by a step of the Makefile that uses
only `od` and `awk`; an asset's origin is decided by the top-level entries under the
upstream's `into` in the check-in its record `upstreams/NAME` names, read from the
repository (an unreadable repository stops the command, naming the wardrobe); with no usage recorded at all,
nothing is suggested for retirement; the node test of the page's script runs when
node is on PATH and is reported as skipped when it is not. The test build can lower
the bounds (`SUIT_CURATE_LIMITS`); the release binary cannot.

## 2026-11-17: the stamp watches what apply acts on

This replaces the rule that the stamp covers every file and folder in the
store, so that an edit anywhere in the store is a reason to apply. The compare
costs one stat for each path the stamp lists, about 4 us a path: on two
wardrobes of 300 skills of 5 files each, 40 agents and 20 commands, the old
stamp listed 1890 paths and cost 7.1 to 7.6 ms over the empty program quiet and
12.6 to 13.4 ms loaded, against a budget of 1 ms that is not loosened. And most
of those stats bought nothing: suit places a skill as a link to its folder, an
agent or a command as a link to its file, a slot or a file as a link to its
source. An edit to a linked file, or a file added, removed or renamed inside a
linked skill folder, shows through the link at once, and apply would place the
same links.

So the stamp lists what apply reads that can change what it places or the
content of a file it writes, and an edit apply would not act on may go
unnoticed. Read from apply's whole path (`cmd_apply` in `src/commands.c`, which
lists the same in a comment over the watch code):

| Input | Watched |
|---|---|
| `$SUIT_HOME/store` and each folder in it (which wardrobes take part) | yes: a wardrobe, or a `suit.conf` in a folder, appearing or going changes the folder's time |
| each taking-part wardrobe's `suit.conf` | yes |
| each wardrobe's folder | yes |
| its `skills`, `agents` and `commands` folders, listed | yes: the folder itself (an entry added, removed or renamed changes its time), and each entry that is a symbolic link, whose target can appear, go or change kind without the folder changing |
| an entry's kind (a skill is a folder, an agent or a command a file) | through the listing folder: a folder replaced by a file of its name is an entry removed and one added |
| each `instructions`, `file` and `slot` path of every outfit, worn or not, whether it exists or not | yes: a source appearing or going changes the plan, and the two sources of a joined file are read and copied into it |
| each need's `prompt` (it must exist and be a file) | yes |
| the ledger, the machine's name, `projects` | yes; and `roots` and `projects.set`, which a rescan reads, as before |
| the files inside a skill folder; an agent's, a command's, a slot's or a file's content | no: linked, never read |
| each need's `done` test, a file in the home folder | no: a need that becomes done keeps its item until the next apply ([needs.md](needs.md)), as before |
| the destinations in the home folder, the joined files | no: a link or a joined file changed by hand is put right when apply next runs, as before |
| `$SUIT_HOME/NAME.journal` | no: an apply it stops has changed nothing, and the last apply's stamp still holds |
| the attention file, the `upstreams/NAME` records | no: apply rewrites only the attention file's need items and does not read the records |

Nothing is placed by copy; the joined file is the one file whose content comes
from the store. The number of paths grows with the wardrobes, the linked entries
of their listing folders and the paths their configs name, never with the files
in a skill: 24 on that fixture, where the compare costs 0.26 to 0.28 ms quiet
and 0.46 to 0.48 ms loaded. It is bounded at
128, which at about 4 us a path keeps the compare near half its budget; over it,
apply stops before the stamp with `suit: more than 128 paths for the no-change
run to watch` and leaves the old stamp. The walk of the store and its limits
(8192 paths, 64 folders deep) are gone.

Things checked one by one:

- An agent or a command saved by an editor that writes a new file and renames it
  over the old one changes the listing folder's time: a harmless apply, which
  places the same link. A save by rename inside a skill folder changes only the
  skill's folder, which is not watched: no apply, and none is needed.
- A skill folder replaced by a file of the same name changes `skills`: apply
  drops the skill. With `skills = *` a new skill folder changes `skills` and
  apply places it.
- A file inside a skill folder that is a link to elsewhere: an edit to its target
  shows through the skill's link, no apply.
- The hourly `suit tend` and `suit sync` write the working copy through suit's
  file writer (`src/store_fs.c`: beside, then renamed). A sync that brings a new
  skill adds an entry to `skills`; a changed `suit.conf` or instruction source
  is a watched path whose time changes; both are noticed
  by the next compare. A sync that changes only files inside an existing skill
  folder is not acted on, which is right: the link to the folder already shows
  the new files.
- Resolution. The stamp compares size, seconds and nanoseconds of the
  modification time; not the inode. APFS keeps nanoseconds. Linux ext4 (with
  256-byte inodes) and xfs keep nanoseconds too, but the kernel stamps a change
  with its coarse clock, which moves once a tick (1 to 10 ms), unless the
  kernel uses fine-grained timestamps (Linux 6.13 and later). So on Linux a
  change in the same tick as the stamp's own stat, after apply wrote it, can
  leave the time as recorded; size makes up for it on a file that grew or shrank
  and on a folder whose size changed, and nothing does on a folder whose size
  did not. The old stamp had the same window, and so does any change made
  between apply reading an input and stamping it; the next change to a watched
  path, or `suit apply`, picks it up.
- Upgrading. The stamp now starts with the line `suit stamp 2`. A stamp without
  it whose first line is a path line was written by the previous suit: the
  compare reports `changed: STAMP` (the stamp's own path) and exits 10, so
  `suit-run` applies and the apply writes the new stamp. An empty stamp still
  watches nothing, and a first line that is neither is a bad stamp (exit 12),
  as before. An older `suit-run` given the new stamp calls it bad (exit 12)
  rather than applying, so `suit-run` and `suit` are upgraded together, as they
  ship.

## 2026-11-17: what the choices of the curation page mean, and how apply changes a config

`suit curate apply FILE [--yes]` ([curate.md](curate.md), "Applying the choices")
is part three of the curation work. Decided with the brief for it, each open to
change:

- **Keep means worn at user scope.** An asset already worn at user scope, or only at
  personal scope, stays as it is; one that is loose or in the attic goes in the outfit
  `kept`, which the one `[wear user]` wears.
- **Retire means the unworn outfit `attic.WARDROBE`.** Nothing is deleted; an asset in the
  attic state (listed, and no wear reaches it) is already retired. If a wear reaches
  `attic` the apply is refused.
- **Limit means the outfit `personal.WARDROBE.SLUG`**, worn by `[wear personal PROJECT]`, and
  the asset leaves its user outfits. `kept`, `attic` and `personal...` are names of
  outfits, not words of the [vocabulary](vocabulary.md), which stays frozen.
- **Removing one name from `*` expands it** into the explicit, byte-ordered list of
  the names it reaches today, less that one. Rejected: an exclusion syntax in the
  config format, which every reader of a config would then have to know. The cost is
  that names added to the store later are not worn by that outfit until listed, and
  the plan says so for each outfit.
- **Apply checks in each changed wardrobe and leaves placing to the next run.** It
  edits the text of each `suit.conf` in memory, checks the whole set again after every
  step, and only then writes. A check-in that fails puts its file back; the earlier
  ones stay.

Outfit names are one set for all wardrobes and an outfit lists only its own
wardrobe's assets, so one `kept` or `attic` cannot serve two wardrobes. Decided by the
owner on the same day: the outfits apply makes are per wardrobe, `kept.WARDROBE`,
`attic.WARDROBE` and `personal.WARDROBE.SLUG`, made in and listing only WARDROBE (a
dot is allowed in a name); a plain `attic` or `kept` made by hand is used as it is
for its own wardrobe's assets; the page treats `attic` and any `attic.` name as the
attic, and apply refuses if a wear reaches one. Check-ins go in dependency order: a
wardrobe that makes an outfit before any whose wear sections name it, byte order
otherwise, so a failure part way never leaves a dangling reference. A cycle can
arise (a `kept` for an asset of `side` worn in `main`, and a project outfit for an
asset of `main` worn in `side`); it is refused before anything changes.

## 2026-11-19: libfossil from the public branch sql-ext-int

libfossil moves from the private build 2f20f44ba4 to a88df0d594 on the public
branch `sql-ext-int`: trunk 7408b4185c plus anypipe (the stream channel, the
same API suit already used), cowoco, onefile and backlinks. The private
`byot` branch became the public anypipe and its check-in was purged, so the
old pin named a hash that no longer exists. No suit code changes. The new
build records the merge parent of a merge that ends in a conflict settled
with `--mine`; the old one did not, so suit's common ancestor after such an
accept was too old and could miss a real conflict. One store case relied on
that and was corrected. Still back to trunk when anypipe lands there.

## 2026-11-17: https with BearSSL, through libfossil's stream channel

Replaces the table's "OpenSSL first" for TLS. Decided by the owner:

- libfossil is pinned to the private build 2f20f44ba4 (branch `byot`, approved
  for vendoring while suit is being proven) in place of trunk f2983dcd78. It
  adds the stream channel: suit supplies connect, read, write and close over a
  byte stream and libfossil does all of the HTTP. Back to trunk when the
  stream channel lands there.
- TLS is BearSSL 0.6, vendored and compiled in: no OpenSSL to find or link.
- Trusted certificates are the system's PEM bundle read at run time
  (`SSL_CERT_FILE`, then the usual paths of macOS and the Linux
  distributions); none are compiled into suit. A remote may have a CA file of
  its own for a self-hosted server, used in place of the bundle.

Decided for the build, with the reasons:

- Redirects are refused, never followed: a redirect can send the login to
  another host. The message names the new address and says to set it as the
  remote.
- TLS 1.2 only (BearSSL has no 1.3), ECDHE key exchange and AEAD ciphers only,
  configured suite by suite rather than with `br_ssl_client_init_full`: no
  RSA key exchange (no forward secrecy) and no CBC (padding oracles). A server
  that offers only TLS 1.3 cannot be reached; it answers with alert 70 and the
  message says what that probably means.
- Exit 18 now means "the secure connection failed" (no usable certificates,
  the handshake, an untrusted or expired certificate, a host name mismatch, a
  TLS protocol error), not "this build cannot use https". 17 stays the
  network, 19 a refused login.
- No proxy support.
- The name lookup has a time limit: `getaddrinfo` has none, so it runs in a
  forked child that sends the addresses down a socket pair; the parent waits
  with `poll` and the transfer's timeout, then kills and reaps the child.
- A whole command is bounded by 10 minutes on the network, on top of the
  30 seconds a single read, write, connect or lookup may make no progress: the
  hourly tend must never run into the next one, and a wardrobe's clone takes
  seconds.
- BearSSL makes no system call of its own. It is compiled with
  `BR_RDRAND=0 BR_USE_URANDOM=0 BR_USE_UNIX_TIME=0` (and the Win32 ones off),
  which leaves its system seeder empty and its X.509 clock unset; `nm` on the
  archive lists no undefined symbol but `memcmp`, `strlen` and the compiler's
  own. Suit seeds it with `br_ssl_engine_inject_entropy` from its wrapped
  `getentropy` and sets the date with `br_x509_minimal_set_time` from its
  wrapped clock, so fault injection reaches both, and `SUIT_NOW` moves the
  date certificates are checked against.
- A certificate file is trusted only if nobody else could have changed it:
  a regular file owned by you or root, not writable by group or others, in a
  folder that passes the same test; a remote's CA file may not be a symbolic
  link (the system's bundles may: distributions ship them as links). It is
  opened without waiting, so a FIFO is refused at once. Otherwise anyone who
  could write it could add a CA and read the sync, the login and the private
  files. Found by a security review.
- Commands that read a secret first set `RLIMIT_CORE` to 0, so an aborted run
  leaves no core file holding it.
- A remote's CA file is a path in a new file, `$SUIT_HOME/cafiles`
  (`NAME PATH`), not a third field of `remotes`: a field there would not fit
  the 1280-byte line limit next to a 1024-byte address, and the remotes
  format and its tests stay as they were.

## 2026-11-18: instructions are joined from four ranks, and a harness can have an extra

Until now a harness's instruction file was joined only from an unlimited wear and
one limited to this machine, and an outfit with `only = HARNESS` that also
supplied `instructions` clashed with the shared one. The owner needs every
harness to read a shared file and Claude to read an extra after it. At User scope
the suppliers are now ranked: shared (no `only`), the harness's own (`only`),
this machine's, this machine's own; each rank has at most one, and when more than
one supplies the file is the join of them in that order, each exactly as in the
store with a blank line between. One supplier still links straight to the store.
`join.c` takes up to four sources (`JOIN_SOURCES_MAX`) of 512 KiB each.

The Personal scope uses the same rule: the join is made where the winner of each
destination is chosen, which is shared by both scopes, so it cost nothing and a
second rule for personal files would have been the exception. The no-change
stamp already lists every `instructions` path the config names (2026-11-17), so
the new sources are watched. A case that asserted that an `only` outfit's
instructions clash with the shared ones did not exist; the clash that remains is
two suppliers of one rank. Rejected: letting `only` override the shared file; the
owner wants both.

## 2026-11-18: a local upstream is re-taken by the hourly pass

An upstream whose `url` is `file://` and an absolute path is a local upstream.
This is how the owner's own repositories supply skills without copies in a
wardrobe: the repository is the one source, the upstream's branch records what
was taken, and `trust = auto` accepts it. `suit tend` with no name takes every
local upstream whose folder changed since its last take, after the wardrobes and
before the usage scan. "Changed" is a stamp of the folder (path, size, time,
inode and executable bit of each file and folder a take would read), kept in
`$SUIT_HOME/upstream-NAME.stamp`, so an hour with no change costs one walk of
`lstat` calls and no read of any file; the take, which reads and compares
content, runs only when the stamp differs. Rejected: comparing the content every
hour (reads the whole repository 24 times a day), and watching with a daemon
(one more process to keep alive). A missing folder is an attention item, not an
error, so a repository on a disk that is not mounted does not fail the hourly
tend. The folder's own version is not read for the comment: `from FOLDER` is
enough, and reading a git, fossil or zit checkout would need a child process or
another repository reader. Nothing else changes: branch, review, accept, undo,
the record and the merge base are as before.

## 2026-11-22: libfossil 8aa1823ae1, copied before it was pushed

Suit moves to sql-ext-int 8aa1823ae1: trunk b5a08d2b94, which now holds
push-unclustered (a check-in pushed to one peer reaches a second) and
autosync-settings, plus anypipe, cowoco with its write-lock fix (a second
writer waits on SQLite's busy handler instead of failing with "database is
locked"), and onefile. The check-in was still local to the libfossil
repository when it was copied, so until it is pushed it cannot be traced from
outside this machine. It was pushed the same day, so the rule from 2026-11-19
holds again: vendor from the public branch.