@sous-io/sous 1.2.0 → 1.2.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -14,7 +14,10 @@ Every provider answers the **read path**, which is deliberately small:
14
14
 
15
15
  - recognize a repository URL as its own;
16
16
  - take that URL apart into a host, an owner and a name;
17
- - hand back the repository's `sous.index.json`;
17
+ - hand back one file of the repository at `HEAD`, which is how sous reads its `sous.repo.yaml` and the
18
+ index it leads to ([How a project reads a repository](repositories-file-formats.md#how-a-project-reads-a-repository));
19
+ - list the repository's tags and fetch what a reader asks for at them, for a repository that publishes
20
+ through its tags alone;
18
21
  - fetch **one** recipe's subtree at one tag.
19
22
 
20
23
  Nothing there clones a whole repository. A provider that can also carry a contribution answers
@@ -117,6 +120,7 @@ every machine-wide thing keys by:
117
120
  | the store entry | `~/.sous/cache/github.com/sous-io/sous-recipes/<namespace>/<recipe>/<version>/` |
118
121
  | the cached index | `~/.sous/cache/_indexes/github.com/sous-io/sous-recipes.json` |
119
122
  | the index sidecar | `~/.sous/cache/_indexes/github.com/sous-io/sous-recipes.meta.json` |
123
+ | the tags of a repository that publishes through them | `~/.sous/cache/_tags/github.com/sous-io/sous-recipes.git` and `.json` |
120
124
  | the lockfile's `identity` field | `github.com/sous-io/sous-recipes` |
121
125
 
122
126
  A repository's **short name** (`sous-recipes`) is something your project chose, and it keys
@@ -143,12 +147,13 @@ because a path on your disk is not a published location. Every form is in
143
147
 
144
148
  Sous reads a repository in two very different ways, and they authenticate differently.
145
149
 
146
- **The index** is read by trying three ways in order, so reading works with whatever access you have.
150
+ **What a repository publishes** (its `sous.repo.yaml`, then the index it leads to) is read by trying three
151
+ ways in order, so reading works with whatever access you have.
147
152
  Neither `gh` nor `glab` is ever required to read a repository; they are needed only for
148
153
  `sous repo contribute` and `sous repo submit`.
149
154
 
150
155
  ```text
151
- Reading sous.index.json from a repository
156
+ Reading a file a repository publishes
152
157
  1. HTTP with a token if a token is found (see below)
153
158
  2. HTTP with no token public repositories
154
159
  3. git a shallow, sparse fetch of the one file, using your own git
@@ -159,14 +164,23 @@ For GitLab, the HTTP requests use the API address, with the whole project path e
159
164
  group's `/` becomes `%2F`:
160
165
 
161
166
  ```text
162
- https://raw.githubusercontent.com/<owner>/<name>/HEAD/sous.index.json
163
- https://<gitlab host>/api/v4/projects/<owner>%2F<name>/repository/files/sous.index.json/raw?ref=HEAD
167
+ https://raw.githubusercontent.com/<owner>/<name>/HEAD/sous.repo.yaml
168
+ https://<gitlab host>/api/v4/projects/<owner>%2F<name>/repository/files/sous.repo.yaml/raw?ref=HEAD
164
169
  ```
165
170
 
171
+ The first file read walks those ways in order. A way that reached the repository and found a file missing
172
+ (a `404`, or git's "does not exist") reads the rest of the files for that read, and the other places a
173
+ manifest may be are read together, so a repository whose manifest is in `.sous/` costs a few small extra
174
+ requests. A file is missing, which is an answer rather than a failure, when git (or, for a local
175
+ repository, its working tree) reached the repository and found no such file, or when a way answered `404`
176
+ and no other failed to connect or was refused (a `404` alone may also mean a private repository). Sous then
177
+ moves on to the next file, and the error, if any, is the one under
178
+ [How a project reads a repository](repositories-file-formats.md#how-a-project-reads-a-repository).
179
+
166
180
  GitHub's raw host can answer with a copy it cached for up to five minutes. When sous must see the
167
181
  current index (a `--latest` read, or a recipe missing from its cached copy, which is how a recipe
168
182
  released moments ago looks), it reads GitHub's contents API without a token instead
169
- (`https://api.github.com/repos/<owner>/<name>/contents/sous.index.json`), and tries the raw host only
183
+ (`https://api.github.com/repos/<owner>/<name>/contents/<path>`), and tries the raw host only
170
184
  if nothing else answers. GitHub allows 60 such requests an hour from one address, so ordinary reads
171
185
  never use it. GitLab's API always answers with the current file.
172
186
 
@@ -197,7 +211,7 @@ first for the next seven days, counted from when it became first. After that, th
197
211
  tried first again, so a repository read through git while its token was broken goes back to HTTP once the
198
212
  token works. `store.strategyMemorySeconds` sets the time (`604800`, seven days, by default; `0` always
199
213
  tries the usual order first). After a failure sous forgets the remembered way and walks the whole list
200
- again. When every way fails, one error lists each attempt and why it failed, then names the fixes:
214
+ again; a missing file is not a failure, so it keeps the way that found it missing. When every way fails, one error lists each attempt and why it failed, then names the fixes:
201
215
 
202
216
  ```text
203
217
  Error: could not read gitlab.com/acme/private-recipes.
@@ -213,8 +227,8 @@ The fixes depend on what the attempts said:
213
227
 
214
228
  - Every attempt could not connect (DNS, a refused connection, a timeout): the only fix is to check
215
229
  that the machine can reach the host, or to set `HTTPS_PROXY`. No token is offered.
216
- - git reached the repository and said it has no `sous.index.json`: the fix is to check the URL. No
217
- token is offered, since the repository is not private.
230
+ - git reached the repository and said the file is not there: the fix is to check the URL. No token is
231
+ offered, since the repository is not private.
218
232
  - A token was found and refused: the attempt and the fix name where it came from (`GITLAB_TOKEN`,
219
233
  `git credential fill`, `glab`) instead of asking you to set it.
220
234
  - `gh` or `glab` is installed but printed no token: the fixes include `gh auth login` or
@@ -226,11 +240,17 @@ once, and the error is told once, naming every recipe it stopped.
226
240
  The HTTP reads honor `HTTPS_PROXY`, `HTTP_PROXY` and `NO_PROXY` (or their lowercase spellings), as
227
241
  git does.
228
242
 
229
- A cached index is checked again once its freshness window lapses. GitHub answers that check with
230
- "not modified" through the index's `ETag`. GitLab sends no `ETag` for a file, so sous keeps the
243
+ A cached index is checked again once its freshness window lapses, by reading the manifest again and the
244
+ file the copy came from. GitHub answers that check with "not modified" through the file's `ETag`, which
245
+ sous sends only when it reads the same file the copy came from. GitLab sends no `ETag` for a file, so sous keeps the
231
246
  `X-Gitlab-Content-Sha256` header GitLab sends instead, asks for that header alone with one `HEAD`
232
247
  request, and downloads the index again only when the hash changed.
233
248
 
249
+ **A repository that publishes through its tags** (`index: tags`) is read with git too: `git ls-remote`
250
+ lists the tags, and fetches bring only the commits, trees and manifests a reader needs, as
251
+ [A repository that publishes through its tags](repositories-file-formats.md#a-repository-that-publishes-through-its-tags)
252
+ describes. These commands use the same credentials, clone URLs and token as a recipe's files, below.
253
+
234
254
  **A recipe's files** come from git itself: a shallow, blobless, sparse clone at the version's
235
255
  tag, fetching only the blobs inside that one recipe folder. That means git's own credentials
236
256
  apply, exactly as they would for a manual clone: credential helpers, the SSH agent, proxies and
@@ -378,8 +398,10 @@ It exists for local development and for tests: authoring a repository, trying a
378
398
  publishing it, or running a whole workflow with no network at all. Two details make it behave
379
399
  like a host rather than like a shortcut.
380
400
 
381
- - The index is read from the **working tree** when `sous.index.json` is there, so an index you are
382
- still writing is picked up without a commit, and from `git show HEAD:sous.index.json` otherwise.
401
+ - Each file sous reads (the manifest, then the index it leads to) is read from the **working tree** when
402
+ it is there, so an index you are still writing is picked up without a commit, and from
403
+ `git show HEAD:<path>` otherwise. A repository that publishes through its tags has them read through
404
+ its `file://` URL, the way git reads any remote.
383
405
  - A recipe's files come from a clone of the local repository at the version's **tag**, exactly as
384
406
  a hosted repository would be fetched, so a version really is the version its tag points at. A
385
407
  directory that is not a git repository, or one missing that tag, has no versions to honor, so
@@ -182,7 +182,7 @@ On GitLab (an `origin` remote on GitLab, or `--host gitlab`) the scaffold writes
182
182
  `SOUS_RELEASE_TOKEN`; see [the scaffolded workflow](repositories-authoring.md#the-scaffolded-workflow). The
183
183
  output goes on with what `sous init` writes and with its first build, which compiles the
184
184
  memories file. The scaffold validates as written, and never replaces a file that already exists
185
- (`--overwrite` does). `sous.repo.yaml` declares the namespaces and lists every recipe folder; each folder's
185
+ (`--overwrite` does). `sous.repo.yaml` describes the namespaces and lists the recipe folders; each folder's
186
186
  `sous.recipe.yaml` is one recipe, with its own version, and is heavily commented. To publish recipes from a
187
187
  project you already have instead, run `sous repo init --for-project` in it; see
188
188
  [Publish a project's own recipes](repositories-authoring.md#publish-a-projects-own-recipes).
@@ -211,8 +211,9 @@ second recipe; its path goes in the `recipes` list at the root.
211
211
 
212
212
  ## 8. Release it
213
213
 
214
- Releasing reads versions from the recipe manifests, regenerates the index, commits and tags, so
215
- the repository has to be a git repository with your work committed:
214
+ Releasing reads versions from the recipe manifests, writes the published data (the catalog of
215
+ versions projects read), commits and tags, so the repository has to be a git repository with your
216
+ work committed:
216
217
 
217
218
  ```bash
218
219
  cd ~/projects/my-recipes
@@ -228,15 +229,18 @@ the run would do, and asks once.
228
229
  ...
229
230
  ▶ Publishing:
230
231
  workflow/example: publishing version 0.1.0.
231
- Wrote sous.index.json.
232
+ written sous.repo.yaml
232
233
  Committed: Release workflow/example@0.1.0
233
234
  Created the tag workflow/example@0.1.0.
234
235
  ```
235
236
 
236
- Add `--push` to push the commit and the tags in the same run, and `--yes` to accept the plan
237
- without being asked, which is what the scaffolded workflow does. Never edit `sous.index.json` by
238
- hand; the recipe manifests are the source of truth for versions, and this command regenerates the
239
- catalog from them. `sous repo release --check` validates without publishing, and runs on a pull
237
+ The published data goes into a `published:` block at the end of `sous.repo.yaml`, because the
238
+ repository has published nothing before; see
239
+ [Where the published data lives](repositories-file-formats.md#where-the-published-data-lives) for
240
+ the other places it can go. Add `--push` to push the commit and the tags in the same run, and
241
+ `--yes` to accept the plan without being asked, which is what the scaffolded workflow does. Never
242
+ edit the `published:` block by hand; the recipe manifests are the source of truth for versions, and
243
+ this command writes the catalog from them. `sous repo release --check` validates without publishing, and runs on a pull
240
244
  request.
241
245
 
242
246
  ## 9. Add your repository to the project
@@ -262,7 +266,7 @@ One repository has to be trusted before this can continue.
262
266
  This project now trusts 'my-recipes'. Nothing from it has been installed.
263
267
  ```
264
268
 
265
- One file is fetched, the repository's `sous.index.json`, and nothing is installed. The entry lands
269
+ Sous reads the repository's `sous.repo.yaml` and the index it leads to, and nothing is installed. The entry lands
266
270
  in `.sous/conf.d/500-repos.jsonc`, which is committed, so a colleague inherits the repository and
267
271
  the trust decision together.
268
272
 
@@ -352,7 +352,7 @@ Fix one of these:
352
352
  set up git access to gitlab.com (an SSH key, or a credential helper)
353
353
  ```
354
354
 
355
- Sous tried every way it has to read the repository's index, and each line says why that one failed. Any
355
+ Sous tried every way it has to read the repository, and each line says why that one failed. Any
356
356
  one fix lets sous read the index and download recipe files: sous hands the token it found to git for an
357
357
  HTTPS download, so a token alone is enough to build. `gh` and `glab` are not needed to read.
358
358
 
@@ -365,7 +365,27 @@ The order sous tries, and where it finds a token, are under
365
365
  The fixes follow from what the attempts said. When every attempt could not connect, the one fix is to
366
366
  check that this machine can reach the host, or to set `HTTPS_PROXY` on a network that needs a proxy;
367
367
  sous's HTTP reads honor `HTTPS_PROXY`, `HTTP_PROXY` and `NO_PROXY`. When git reached the repository and
368
- said it has no `sous.index.json`, the fix is to check the URL, and no token is offered.
368
+ said the file is not there, the fix is to check the URL, and no token is offered.
369
+
370
+ ## A repository with nothing to read
371
+
372
+ ```text
373
+ Error: https://github.com/acme/recipes has no 'sous.repo.yaml' (at its root or in '.sous/') and no
374
+ 'sous.index.json', so it is not a sous recipe repository, or nothing in it has been released yet.
375
+ ```
376
+
377
+ Sous reached the repository and found neither a manifest nor an index. Check the URL first. If the
378
+ repository is meant to publish recipes, its maintainers commit a `sous.repo.yaml` and release.
379
+
380
+ ```text
381
+ Error: https://github.com/acme/recipes/sous.repo.yaml says its index is at 'published/index.json', and
382
+ https://github.com/acme/recipes has no file there.
383
+ The repository's maintainers fix this: release again, or correct 'index' in the manifest.
384
+ ```
385
+
386
+ The manifest's `index` setting names a file the repository does not hold. Only the repository's
387
+ maintainers can fix it. Where sous looks, in order, is under
388
+ [How a project reads a repository](repositories-file-formats.md#how-a-project-reads-a-repository).
369
389
 
370
390
  ## A recipe that requires a plugin
371
391
 
@@ -187,7 +187,7 @@ Trusting a repository trusts every namespace and recipe in it, including recipes
187
187
  and it is the only security boundary sous draws. Trust authorizes those recipes to run code on your
188
188
  machine with your own permissions, whether sous runs it during a build or your agent runs it (a
189
189
  skill's scripts, a hook), and sous sandboxes neither. Before a repository is trusted nothing from it
190
- runs, and the question itself reads only its index. Sous cannot tell you whether a repository
190
+ runs, and the question itself reads only its manifest and its index. Sous cannot tell you whether a repository
191
191
  deserves that, and says so rather than implying otherwise. Where there is no terminal to ask on, the
192
192
  run fails and names the repositories and the exact command that grants the trust:
193
193
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sous-io/sous",
3
- "version": "1.2.0",
3
+ "version": "1.2.2",
4
4
  "description": "Compiles AI coding agent configuration (CLAUDE.md, skills, memories) from LiquidJS templates",
5
5
  "type": "module",
6
6
  "license": "Apache-2.0",
@@ -39,49 +39,49 @@
39
39
  "sous.config.schema.json"
40
40
  ],
41
41
  "dependencies": {
42
- "@sous-io/sous-plugin-api": "1.2.0"
42
+ "@sous-io/sous-plugin-api": "1.2.2"
43
43
  },
44
44
  "devDependencies": {
45
45
  "esbuild": "^0.27.4",
46
46
  "jsonc-parser": "^3.3.1",
47
47
  "yaml": "^2.9.0",
48
48
  "zod": "^4.4.3",
49
- "@sous-io/sous-lib-documents": "1.2.0",
50
- "@sous-io/sous-lib-core": "1.2.0",
51
- "@sous-io/sous-plugin-authoring": "1.2.0",
52
- "@sous-io/sous-plugin-build": "1.2.0",
53
- "@sous-io/sous-plugin-claude-code": "1.2.0",
54
- "@sous-io/sous-plugin-cli": "1.2.0",
55
- "@sous-io/sous-plugin-compiler": "1.2.0",
56
- "@sous-io/sous-plugin-confd": "1.2.0",
57
- "@sous-io/sous-plugin-expressions": "1.2.0",
58
- "@sous-io/sous-plugin-formats": "1.2.0",
59
- "@sous-io/sous-plugin-git": "1.2.0",
60
- "@sous-io/sous-plugin-config-files": "1.2.0",
61
- "@sous-io/sous-plugin-github": "1.2.0",
62
- "@sous-io/sous-plugin-gitlab": "1.2.0",
63
- "@sous-io/sous-plugin-harnesses": "1.2.0",
64
- "@sous-io/sous-plugin-host": "1.2.0",
65
- "@sous-io/sous-plugin-init": "1.2.0",
66
- "@sous-io/sous-plugin-inspect": "1.2.0",
67
- "@sous-io/sous-plugin-liquid": "1.2.0",
68
- "@sous-io/sous-plugin-local": "1.2.0",
69
- "@sous-io/sous-plugin-mcp": "1.2.0",
70
- "@sous-io/sous-plugin-memories": "1.2.0",
71
- "@sous-io/sous-plugin-npm": "1.2.0",
72
- "@sous-io/sous-plugin-pnpm": "1.2.0",
73
- "@sous-io/sous-plugin-recipe-answers": "1.2.0",
74
- "@sous-io/sous-plugin-recipes": "1.2.0",
75
- "@sous-io/sous-plugin-refs": "1.2.0",
76
- "@sous-io/sous-plugin-update": "1.2.0",
77
- "@sous-io/sous-plugin-variables": "1.2.0",
78
- "@sous-io/sous-plugin-skills": "1.2.0",
79
- "@sous-io/sous-plugin-yarn": "1.2.0",
80
- "@sous-io/sous-plugin-handlers": "1.2.0",
81
- "@sous-io/sous-plugin-editor": "1.2.0",
82
- "@sous-io/sous-plugin-doctor": "1.2.0",
83
- "@sous-io/sous-plugin-migrations": "1.2.0",
84
- "@sous-io/sous-plugin-codex": "1.2.0"
49
+ "@sous-io/sous-lib-core": "1.2.2",
50
+ "@sous-io/sous-plugin-authoring": "1.2.2",
51
+ "@sous-io/sous-plugin-build": "1.2.2",
52
+ "@sous-io/sous-plugin-claude-code": "1.2.2",
53
+ "@sous-io/sous-lib-documents": "1.2.2",
54
+ "@sous-io/sous-plugin-cli": "1.2.2",
55
+ "@sous-io/sous-plugin-compiler": "1.2.2",
56
+ "@sous-io/sous-plugin-config-files": "1.2.2",
57
+ "@sous-io/sous-plugin-expressions": "1.2.2",
58
+ "@sous-io/sous-plugin-confd": "1.2.2",
59
+ "@sous-io/sous-plugin-formats": "1.2.2",
60
+ "@sous-io/sous-plugin-git": "1.2.2",
61
+ "@sous-io/sous-plugin-github": "1.2.2",
62
+ "@sous-io/sous-plugin-gitlab": "1.2.2",
63
+ "@sous-io/sous-plugin-harnesses": "1.2.2",
64
+ "@sous-io/sous-plugin-host": "1.2.2",
65
+ "@sous-io/sous-plugin-inspect": "1.2.2",
66
+ "@sous-io/sous-plugin-init": "1.2.2",
67
+ "@sous-io/sous-plugin-liquid": "1.2.2",
68
+ "@sous-io/sous-plugin-local": "1.2.2",
69
+ "@sous-io/sous-plugin-mcp": "1.2.2",
70
+ "@sous-io/sous-plugin-memories": "1.2.2",
71
+ "@sous-io/sous-plugin-npm": "1.2.2",
72
+ "@sous-io/sous-plugin-refs": "1.2.2",
73
+ "@sous-io/sous-plugin-recipes": "1.2.2",
74
+ "@sous-io/sous-plugin-pnpm": "1.2.2",
75
+ "@sous-io/sous-plugin-skills": "1.2.2",
76
+ "@sous-io/sous-plugin-update": "1.2.2",
77
+ "@sous-io/sous-plugin-variables": "1.2.2",
78
+ "@sous-io/sous-plugin-editor": "1.2.2",
79
+ "@sous-io/sous-plugin-yarn": "1.2.2",
80
+ "@sous-io/sous-plugin-doctor": "1.2.2",
81
+ "@sous-io/sous-plugin-recipe-answers": "1.2.2",
82
+ "@sous-io/sous-plugin-migrations": "1.2.2",
83
+ "@sous-io/sous-plugin-codex": "1.2.2",
84
+ "@sous-io/sous-plugin-handlers": "1.2.2"
85
85
  },
86
86
  "engines": {
87
87
  "node": ">=22"
@@ -43,9 +43,13 @@ contents:
43
43
  The fields in that example:
44
44
 
45
45
  - `formatVersion` is always `1`.
46
- - `namespace` MUST be declared in the repo manifest, and `name` is unique inside it. Both are
47
- lowercase kebab-case, and together (`review/checklist`) they are the recipe's identity.
48
- - `version` is an exact semantic version (see "Raising the Version").
46
+ - `namespace` is optional; one left out is worked out as for a project's own recipe (below), and
47
+ the first release may write a `sous.namespace.yaml` to keep it fixed (`about-sous-repos`). `name`
48
+ is unique inside the namespace. Both are lowercase kebab-case, and together (`review/checklist`)
49
+ they are the recipe's identity.
50
+ - `version` is an exact semantic version (see "Raising the Version"). It is optional until the
51
+ recipe is published: a recipe with none is released as `1.0.0`, which the release writes into
52
+ the manifest. A recipe with release tags but no version is an error.
49
53
  - `description` is optional; it is copied into the index, and shown by `sous recipe list` and
50
54
  `sous repo search`.
51
55
  - `contents` is what a subscriber receives: one group per kind (`skills`, `memories`, `prompts` or
@@ -84,8 +88,9 @@ subscription, release, version raise or lockfile entry, under the reserved repos
84
88
  them in the lockfile with the project recipe as their holder. A bare `namespace/recipe` means a
85
89
  project recipe first.
86
90
  - Its plugin and handlers run with no trust question.
87
- - It is published only when the project's own `sous.repo.yaml` lists it, through
88
- `sous repo release`.
91
+ - It is published only when the project's own `sous.repo.yaml` lists it (a folder or a glob
92
+ such as `.sous/recipes/*`), through `sous repo release`, which offers to create that file when
93
+ there is none (`--create-manifest`).
89
94
 
90
95
  The rest of this skill applies to it as to any recipe, except "Raising the Version", which applies
91
96
  only once it is published.
@@ -107,9 +112,9 @@ A contributor proposing a change edits `version` by hand. A maintainer releasing
107
112
  repository itself may instead commit the change and run
108
113
  `sous repo release --recipe <namespace>/<recipe> --bump <level>` (`patch` by default, `minor`,
109
114
  `major` or `prerelease`), which raises every changed recipe in scope whose version still equals its
110
- last tag and commits the raise together with the regenerated index. A proposal MUST NOT carry that
111
- index change, because `sous repo submit` refuses one that edits `sous.index.json`;
112
- `about-sous-repos` describes the rest of that run.
115
+ last tag and commits the raise together with the published data. A proposal MUST NOT carry that
116
+ published data change, because `sous repo submit` refuses one that edits it (`sous.index.json`, or
117
+ the `published:` block of `sous.repo.yaml`); `about-sous-repos` describes the rest of that run.
113
118
 
114
119
  Example: `review/checklist` is at `1.2.0`, its last tag. One pull request fixes a typo (a patch) and
115
120
  adds a command (a minor). The manifest goes to `1.3.0`, once.
@@ -35,15 +35,34 @@ For one recipe (its manifest, version, variables, contents and dependencies), YO
35
35
  A recipe repository holds three kinds of file that sous reads:
36
36
 
37
37
  - `sous.repo.yaml`, the **repo manifest**, written by hand, at the repository root or in its
38
- `.sous/` directory (the root's wins when both exist): the repository's suggested short name, an
39
- optional description, its namespaces, and the list of recipe folders it publishes. A folder
40
- is a recipe because this list names it; a new recipe folder MUST be added to the list, or it is
41
- not published. Only `recipes` is required for the file to be valid, but `sous repo release`
42
- needs a `name`, a plain folder path per recipe (it refuses a glob pattern), and every recipe's
43
- namespace declared here.
38
+ `.sous/` directory (the root's wins when both exist): the repository's optional suggested short
39
+ name (the root folder's name when missing), an optional description, optional namespace
40
+ descriptions, and `recipes`, the recipe folders or glob patterns it publishes (expanded the way a
41
+ project expands `projectRecipes.paths`). A folder is a recipe because this list covers it; a new
42
+ recipe folder no pattern matches MUST be added to the list, or it is not published. Only
43
+ `recipes` is required, for the file and for a release. A pattern matching no recipe yet is a
44
+ warning; a listed folder that is missing or holds no recipe is an error.
44
45
  - `sous.recipe.yaml`, one **recipe manifest** in each recipe folder; see `about-sous-recipes`.
45
- - `sous.index.json`, the **index**: the catalog projects read, written only by `sous repo release`.
46
- NEVER edit it by hand.
46
+ - `sous.namespace.yaml`, optional, in a folder above recipes: names the namespace of the recipes
47
+ below it that name none, and may describe it. One namespace described in two places (here and
48
+ `namespaces` in `sous.repo.yaml`, or two namespace files) stops a release, naming both.
49
+ - The **published data**: the catalog projects read, written only by `sous repo release`. NEVER
50
+ edit it by hand. It lives where `index` in `sous.repo.yaml` says:
51
+ - embedded, in a `published:` block at the end of `sous.repo.yaml`: the default for a repository
52
+ that has published nothing (no `published:` block and no `sous.index.json` beside the
53
+ manifest). A release then rewrites `sous.repo.yaml` whole, comments removed, hand-edited fields
54
+ first, then a marker line, then `published:`;
55
+ - a file: `sous.index.json` beside the manifest (an existing one keeps being used), or
56
+ `index: <path>.json`;
57
+ - the release tags alone: `index: tags`; no index is written.
58
+
59
+ A project reads `sous.repo.yaml` first (the root's, then `.sous/`'s) and follows its `index` setting:
60
+ a `published` block or `index: embedded` holds the index in the manifest; `index: <path>.json` names
61
+ an index file; `index: tags` has projects build the index from the release tags; with none of these,
62
+ the index is the `sous.index.json` beside the manifest, and without one nothing is published yet. A
63
+ root `sous.index.json` is read only when there is no manifest. `sous repo release` writes the
64
+ root `sous.index.json`. The full rules, and what a tags-only repository costs to read:
65
+ https://sous.io/markdown/#/repositories-file-formats?id=how-a-project-reads-a-repository
47
66
 
48
67
  Manifests are YAML (`.yaml`, `.yml`) or JSON (`.json`, `.jsonc`, both allowing comments and
49
68
  trailing commas), never JavaScript: sous reads them before anyone has trusted the repository, so
@@ -61,7 +80,7 @@ namespaces:
61
80
  review:
62
81
  description: Recipes about reviewing code.
63
82
  recipes:
64
- - recipes/review/checklist
83
+ - recipes/review/*
65
84
  contribute: https://github.com/harbor-labs/team-recipes/blob/main/CONTRIBUTING.md
66
85
  ```
67
86
 
@@ -73,7 +92,7 @@ contribute: https://github.com/harbor-labs/team-recipes/blob/main/CONTRIBUTING.m
73
92
  A recipe's version lives in its manifest, which is the source of truth. A version is **published**
74
93
  once a git tag shaped `namespace/recipe@version` exists for it (for example
75
94
  `review/checklist@1.2.0`). The index records each published version with its content hash, its
76
- tag, the range each of its dependencies may take (the declared range, or `^<version at release>`
95
+ tag (an annotated tag whose message carries the same hash as a `Sous-Hash: sha256-...` line), the range each of its dependencies may take (the declared range, or `^<version at release>`
77
96
  for a sibling named with no range; each with the manifest entry that brought it in and whether it
78
97
  is a co-subscription or a build dependency), its `recommends` list (settled the same way, each
79
98
  `reason` included) and the variable definitions it publishes, which is how a project lists what a recipe installs and asks before
@@ -100,25 +119,43 @@ retired:
100
119
  Zero or more replacements, each a recipe ref as `depends` takes one. A recipe that **moved** to another
101
120
  repository is retired here, naming its new home as a replacement. A `retired` entry for a recipe still
102
121
  listed under `recipes` is a release error. Subscribers' builds warn about the retired recipe, name the
103
- replacements and, in a terminal, offer to swap the subscription. The retirement reaches the index with
104
- the next release that publishes a version.
122
+ replacements and, in a terminal, offer to swap the subscription. The next release writes the retirement
123
+ into the published data, even one that publishes no new version.
105
124
 
106
125
  ## Releasing
107
126
 
108
- `sous repo release` publishes. It refuses to run while a recipe folder, the repository manifest or
109
- the index has uncommitted changes, or while git cannot say who is committing. Uncommitted changes
110
- to other files (a project file a sous migration rewrote, for example) do not stop it, and its
111
- commit leaves them out. In one run it:
127
+ `sous repo release` publishes. It refuses to run while anything it publishes or writes has
128
+ uncommitted changes (every recipe folder it publishes, the repository manifest, the index file when
129
+ the published data is one, and any `sous.namespace.yaml` it is about to write; files the same run
130
+ wrote earlier do not count), or while git cannot say who is committing. Uncommitted changes to
131
+ other files (a project file a sous migration rewrote, for example) do not stop it, and its commit
132
+ leaves them out. In one run it:
112
133
 
113
134
  1. validates every manifest, warning about each recipe that uses `recommends` (subscribers need
114
135
  sous 1.2.0 or later to read it);
115
136
  2. finds the recipes whose files changed since the tag that last published them (a recipe never
116
- tagged is released at the version its manifest declares);
137
+ tagged is released at the version its manifest declares, or at `1.0.0`, written into the
138
+ manifest, when it declares none);
117
139
  3. raises the version of each changed recipe whose version still equals that tag (a patch step by
118
140
  default; `--bump minor` or `--bump major` for more);
119
- 4. regenerates `sous.index.json`;
120
- 5. commits the manifests and the index together;
121
- 6. cuts one annotated tag per new version, dependencies first.
141
+ 4. writes a `sous.namespace.yaml` (`name: <namespace>`) in the folder holding each recipe it
142
+ publishes whose namespace came from the config's `name`, a `package.json`, the git `origin` or
143
+ the project folder, so the published key never changes; if that would change another recipe's
144
+ key, it takes the file back and stops, asking for `namespace:` in the manifests;
145
+ 5. writes the published data;
146
+ 6. commits what changed;
147
+ 7. cuts one annotated tag per new version, dependencies first.
148
+
149
+ A run with no new version still rewrites and commits the published data when it differs (a retired
150
+ or moved recipe, a namespace description, data an older sous wrote), as
151
+ `Update the published data of <name>`, asking first unless `--yes` or `--ci`.
152
+
153
+ With no `sous.repo.yaml` anywhere above, it lists the project's recipe paths and offers to create
154
+ one at the project root (`--create-manifest` answers yes). When a recipe it publishes depends, with
155
+ no location, on a project recipe `sous.repo.yaml` does not list, it asks whether to publish that one
156
+ too (`--publish-dependencies` answers yes; declining stops the release). `--yes` answers neither;
157
+ without a terminal and without the switch, each fails naming the switch. With `index: tags`, `--ci`
158
+ changes no file and makes no commit, so anything that needs a file written is an error there.
122
159
 
123
160
  It prints that plan and asks once. `--yes` answers ahead, `--dry-run` stops after the plan, and
124
161
  `--push` pushes the commit and the tags. `--namespace` and `--recipe` narrow the scope, and
@@ -126,8 +163,8 @@ It prints that plan and asks once. `--yes` answers ahead, `--dry-run` stops afte
126
163
  raises and commits but cuts no tags, because tags are cut after the merge; `--tag` overrides that.
127
164
  Two presets matter most:
128
165
 
129
- - `--check` only reads. It validates every manifest, reports how a merge would rewrite the index
130
- (as information, never as a failure), lists the versions that publish on merge, and fails a
166
+ - `--check` only reads. It validates every manifest, reports how a merge would rewrite the
167
+ published data (as information, never as a failure), lists the versions that publish on merge, and fails a
131
168
  change to a recipe whose `submissions` block refuses proposals.
132
169
  - `--ci` is for automation after a merge. It raises no versions, accepts the plan without asking,
133
170
  and fails on any changed recipe whose version still equals its last tag. It does NOT push; pass
@@ -141,17 +178,19 @@ A repository made by `sous repo init` carries `.github/workflows/sous-release.ym
141
178
 
142
179
  - on every pull or merge request, `sous repo release --check`;
143
180
  - on every push to the default branch, `sous repo release --ci --push --yes`, which tags every
144
- version that has no tag yet, commits the regenerated index when it changed, and pushes both.
181
+ version that has no tag yet, commits the published data when it changed, and pushes both.
182
+
183
+ A project with its own release pipeline adds that one step, `sous repo release --ci --push --yes`.
145
184
 
146
185
  So a change to a recipe MUST raise that recipe's version in the pull request itself, by editing
147
186
  `version` in its `sous.recipe.yaml`: after the merge, `--ci` refuses a recipe whose files changed
148
187
  while its version stayed the same. A contributor NEVER runs `sous repo release` on a proposal
149
- branch (`--check` and `--dry-run` excepted), because it commits a regenerated index and
150
- `sous repo submit` refuses a change that edits the index.
188
+ branch (`--check` and `--dry-run` excepted), because it commits the published data and
189
+ `sous repo submit` refuses a change that edits it.
151
190
 
152
191
  Example: a contributor fixes a typo in `review/checklist`, which is at `1.2.0`, its last tag. The
153
192
  pull request changes the skill file and sets `version: 1.2.1`; `--check` passes and lists
154
- `review/checklist@1.2.1` as publishing on merge; after the merge, `--ci` regenerates the index,
193
+ `review/checklist@1.2.1` as publishing on merge; after the merge, `--ci` writes the published data,
155
194
  commits it and cuts the tag `review/checklist@1.2.1`.
156
195
 
157
196
  ## Proposing a Change
@@ -165,8 +204,10 @@ submit <repo>`). Run on the default branch, it first creates a branch named
165
204
 
166
205
  Before sending anything it checks that everything is committed (`--commit` commits it, after
167
206
  listing the changes and asking once), validates the repository, and confirms the change leaves
168
- `sous.index.json` alone. It pushes through a fork on the contributor's own account when the
169
- contributor cannot push to the repository, and NEVER forces a push. The title and the description
207
+ the published data alone: an index file may not be edited; for embedded data only the
208
+ `published:` block is compared, so the rest of `sous.repo.yaml` may change (to list a new recipe);
209
+ with `index: tags` there is nothing to check. It pushes through a fork on the contributor's own
210
+ account when the contributor cannot push to the repository, and NEVER forces a push. The title and the description
170
211
  come from the user (`--title` and `--body`, or asked); sous never borrows a commit message, and
171
212
  adds a changelog it builds by comparing the manifests with the default branch.
172
213
 
@@ -208,8 +249,8 @@ file is left as it is and named in a note, and `.gitignore` gains a block betwee
208
249
  comments. `--overwrite` replaces existing files; `--force` is `--yes`, not overwrite.
209
250
  `sous-io/sous-recipes` is the model a scaffold follows: a new repository is as complete as it, minus
210
251
  its recipes. It does not run git: run `git init`, commit, and add a remote before the first release,
211
- because `sous repo release` reads and writes tags. Every new recipe folder is then listed under
212
- `recipes` in `sous.repo.yaml`.
252
+ because `sous repo release` reads and writes tags. Every new recipe folder is then covered by
253
+ `recipes` in `sous.repo.yaml`, by its own path or by a glob pattern.
213
254
 
214
255
  After the scaffold it runs `sous init` in the same directory, so the repository is also a sous
215
256
  project. Init imports any `CLAUDE.md`, `AGENTS.md` or `.claude/skills/` already there; with nothing
@@ -11,7 +11,7 @@ formatVersion: 1
11
11
 
12
12
  namespace: core
13
13
  name: sous-skills
14
- version: 1.2.0
14
+ version: 1.2.2
15
15
 
16
16
  description: >-
17
17
  The skills that teach an agent what sous is and how it works: which files sous