Artifact aec7ffeeeb572f36ed64a3efde47154e80758639f3c413b00dcb810784e8fa21:
- File
docs/needs.md
— part of check-in
[3598f9d78d]
at
2026-11-14 13:15:53
on branch trunk
— Phase 8a: needs are checked, listed, and shown until they are done
A need is a step a harness must do for itself, such as registering a slot in its own settings. suit never edits those settings; it says what is needed and can tell when it has been done.
The done test has two forms and nothing else: PATH exists, and PATH contains "TEXT". suit needs lists every need as done, not done or cannot tell, and changes nothing. suit need HARNESS NAME prints the prompt's exact bytes so it can be handed to the harness.
After each apply the attention file holds one item for each need not done and none for those that are. Other kinds of item are left alone and keep their order, and nothing is written when nothing changed. If that update fails, apply writes no stamp, so the next run tries again. A bad need stops apply before it places anything. suit off removes the items.
suit-run is untouched and the speed budget still passes.
An eighth fuzz target covers the done-test parser.
1355 unit checks, 479 shell cases, 669 store cases, 745 placement cases and 378 project cases, under clang, under gcc 16, with no user name set, and under a strict umask, in one run of make gate (34 minutes). 100% coverage in all 24 source files. No suite has fewer cases than at the last check-in. (user: dmestas, size: 3057) [annotate] [blame] [check-ins using]
# Needs A need is a step a harness must do for itself, written as a prompt with a test for whether it is done. Suit never edits a harness's own settings. A need is how you, or the harness's own agent, are told to do it, and how suit knows it has been done. ``` [need claude statusline] prompt = needs/claude-statusline.md done = ~/.claude/settings.json contains "slots/statusline" ``` `prompt` is a file in the wardrobe. `done` is a test of one of two forms, stated exactly in [conf-format.md](conf-format.md): `PATH exists` or `PATH contains "TEXT"`. ## Commands - `suit needs` lists every need, sorted by harness and then name, one line each: `HARNESS NAME: done`, `HARNESS NAME: not done` or `HARNESS NAME: cannot tell (REASON)`. It exits 0 when all are done or there are none, 1 when one is not done or cannot be told, and 2 on a config or test error. It changes nothing, and it is the live answer: it runs the tests now. - `suit need HARNESS NAME` prints the prompt file's bytes, exactly, to standard output and exits 0 whether or not the need is done, so you can pipe it to a harness. A need that is not in the config is exit 1. ## The attention file `suit apply`, and so `suit run` when it applies, brings the need items of `$SUIT_HOME/attention` up to date once the links are placed: one item `need HARNESS NAME: run suit need HARNESS NAME` for each need not done, none for a need that is done, and none for a need no longer in the config. Items of other kinds are not touched and keep their order. Nothing is written when nothing changed. `suit status` and `suit status --line` show and count these items like any other. `suit off` removes them. `suit run` applies only when the stamp says something changed, and `suit-run` is not told about needs. A need that becomes done between applies leaves its item until the next apply. Run `suit needs` for the answer now. A bad need (no `prompt` or `done`, a prompt outside the store or not a file, a test that is not one of the two forms) stops `suit apply` before it places anything. If the attention file cannot be updated, apply says so, exits 1 after the links are placed, and leaves no stamp, so the next run tries again. ## Example: a status line slot Suit links the script at a fixed path, `~/.claude/slots/statusline`, and the harness has to be told once to call it. The wardrobe holds `needs/claude-statusline.md`: ``` Open ~/.claude/settings.json and set "statusLine" to {"type": "command", "command": "~/.claude/slots/statusline"}. Keep every other setting as it is. ``` and the config says: ``` [need claude statusline] prompt = needs/claude-statusline.md done = ~/.claude/settings.json contains "slots/statusline" ``` After `suit apply`, `suit status` shows `need claude statusline: run suit need claude statusline` under `needs you:`. `suit need claude statusline | claude` hands the prompt to the harness, or you make the edit yourself. Once settings.json holds `slots/statusline`, `suit needs` says `claude statusline: done`, and the next apply drops the item.