Artifact 972b1dc7f7eb3b3b5722d1477e37315c49a2eb4a232f738ec533183f4b956bec:
- File
src/commands.h
— part of check-in
[71a8d2c4d3]
at
2026-11-16 00:33:58
on branch trunk
— Suit places from every wardrobe, merged into one set
Placing read one wardrobe, named mine. It now takes every folder under the store that holds a suit.conf, in byte order of name, at most 16. Each config is parsed as before and the results are merged: harness, outfit, need and upstream names are shared, so a private outfit can include a public one. Paths and asset names resolve in the store of the wardrobe that defines the section. No wardrobe beats another; scope and limit decide, as before.
The same section in two wardrobes is an error naming both places. The same destination from two wardrobes at one scope is a clash that names the wardrobes. Any error in any config stops plan and apply before anything is placed. A merge that is refused leaves the combined set as it was.
suit check with no file prints the combined dump. suit why names the wardrobe when more than one takes part. The ledger's format did not change: a link's source path already names its wardrobe. The stamp watches every wardrobe's folder and the store folder, so a wardrobe that appears or goes is noticed. Nothing special-cases the name mine.
This is the owner's decision of 2026-11-15, recorded in docs/decisions.md with the rejected alternative, one master config naming assets as wardrobe:path. It corrects the 2026-11-12 line that said wardrobes already stacked.
The message for no config is now STORE:0: no wardrobe with a suit.conf. Fault call numbers in 12 existing cases moved because the store folder is listed first; what each asserts is unchanged.
The no-change run with two wardrobes of 50 files each is 0.83 to 0.85 ms over an empty program, limit 1 ms. The cost is one stat per watched path: 100 files in each wardrobe measured 1.19 to 1.24 ms. The budget fixture watches 100 files in all, as before.
Not covered: suit status with two wardrobes, which needs two repositories in the fixture. A duplicate-section message can be cut short when both paths are very long.
1431 unit checks (was 1355), 612 shell cases (was 606), 669 store cases, 846 placement cases (was 756) 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 (28 minutes). 100% coverage in all 25 source files. No suite has fewer cases than at the last check-in. (user: dmestas, size: 1393) [annotate] [blame] [check-ins using]
#ifndef SUIT_COMMANDS_H #define SUIT_COMMANDS_H // Placing takes every wardrobe under $SUIT_HOME/store that holds a suit.conf, // merged into one set (src/wardrobes.h). // Each returns an exit code and reports on stdout and stderr. int cmd_plan(void); int cmd_apply(void); int cmd_status(void); // Every place that supplies the asset NAME for the current folder, and which one is in effect. int cmd_why(const char *name); int cmd_off(void); // `suit hooks`: what `suit-run hook EVENT` would run for each event, changing nothing. int cmd_hooks(void); // Say whether each need is done: 0 when all are, 1 when one is not or cannot be told, 2 on a config error. int cmd_needs(void); // Print the prompt of the need NAME of HARNESS. int cmd_need(const char *harness, const char *name); int cmd_run(void); // `suit check` with no file: the canonical dump of every wardrobe's config as one set, or the first error (exit 2). int cmd_check_set(void); // NAME is null to show the machine's name. int cmd_machine(const char *name); // VERB is null to list the roots, else "add" or "rm" with ARG the folder. ARG is changed. int cmd_roots(const char *verb, char *arg); // Show the list the last scan wrote, or with SCAN make it. int cmd_projects(bool scan); // Set (KEY given) or unset the remote key of the project at PATH by hand. PATH is changed. int cmd_project(char *path, const char *key); #endif