Artifact f57f108c874ee32c4f108bfb870d175df3081daef9acfe7f26e12bd6d07ca6e7:
- File
docs/phases.md
— part of check-in
[38c2e6220a]
at
2026-11-16 21:25:35
on branch trunk
— Suit counts how often each skill, agent and command is used
The counts come from the records a harness already keeps of its own work, read afterwards. What those records look like is data in the wardrobe's harness section: where the files are, where a record's time and folder are, and rules that say what an invocation looks like. No harness is named in suit's code. docs/harnesses.md has the rules for the first harness, checked against real records.
A streaming reader walks each JSON line against the rules in 64 KiB chunks, keeps at most the first 512 bytes of any string and stops at 64 levels, so a line of any length cannot grow its memory. It has its own fuzz target.
Suit keeps its own tally per machine under usage/ in its home folder, outside any wardrobe: one line per invocation with time, harness, kind, name, project and call id. A call copied into a resumed or forked record is counted once, by its id. The tally outlives the harness's own clean-up and drops what is older than 400 days.
suit usage scan reads what is new; a first scan reads files changed in the last 45 days and later scans read only new bytes. suit usage prints the table for a window, default 30 days, and --tsv gives the same rows for other tools. suit tend with no name runs the scan after tending; a failed scan is reported and changes nothing else. suit-run is untouched and the speed budget passes as before.
Measured: a generated tree of 200 files and 200 MiB scans in about half a second and a second scan opens no record file. On a real tree of 2547 files, read-only into a scratch home: 3756 invocations in 60 seconds, 10 MiB at peak.
A new suite, test/usage.sh, with 236 cases, is part of the gate.
2855 unit checks (was 1473), 620 shell cases, 1153 store cases, 846 placement cases, 378 project cases and 236 usage cases, under clang, under gcc 16, with no user name set, and under a strict umask, in one run of make gate (41 minutes). 100% coverage in all 28 source files. One existing unit line changed: a table of fault points gained entries. (user: dmestas, size: 4476) [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:// and http://, 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: https://, 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), waiting on HTTPS; 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. Parts two and three, the page that shows each asset beside its use, are not started. |
| 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.