@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.
@@ -677,17 +677,25 @@ sous repo init --for-project --workflow --no-example --readme
677
677
 
678
678
  ### `sous repo release`
679
679
 
680
- Publishes new versions of the repository's recipes: raises their versions, regenerates the index, commits and
681
- tags. It plans first and asks once, and it needs a git commit identity (`user.name` and `user.email`) in the
682
- repository. `--check` only validates, and `--ci` is the setting for a merge job. A recipe the repository no
683
- longer lists keeps its published versions in the index, marked retired, with any replacements `sous.repo.yaml`
684
- names (see [Retire or move a recipe](repositories-authoring.md#retire-or-move-a-recipe)). It warns about every
685
- recipe that uses `recommends`, which needs sous 1.2.0 or later in every subscribing project (see
680
+ Publishes new versions of the repository's recipes: raises their versions, writes the published data where
681
+ `sous.repo.yaml` keeps it (embedded under `published:`, in an index file, or nowhere for `index: tags`), commits
682
+ what changed and tags each version. It plans first and asks once, and it needs a git commit identity
683
+ (`user.name` and `user.email`) in the repository. `--check` only validates, and `--ci` is the setting for a
684
+ merge job. A recipe the repository no longer lists keeps its published versions, marked retired, with any
685
+ replacements `sous.repo.yaml` names (see
686
+ [Retire or move a recipe](repositories-authoring.md#retire-or-move-a-recipe)). It warns about every recipe that
687
+ uses `recommends`, which needs sous 1.2.0 or later in every subscribing project (see
686
688
  [Recommend other recipes](repositories-authoring.md#recommend-other-recipes)).
687
689
 
690
+ `--create-manifest` creates `sous.repo.yaml` at the project root, listing the project's recipe paths, when there
691
+ is none, without asking. `--publish-dependencies` also publishes the project's own recipes that a published
692
+ recipe depends on, without asking. `--yes` answers neither question; see
693
+ [What a release writes for you](repositories-authoring.md#what-a-release-writes-for-you).
694
+
688
695
  ```bash
689
696
  sous repo release --recipe workflow/task-files --bump minor --push
690
- sous repo release --ci --yes --push
697
+ sous repo release --ci --push
698
+ sous repo release --create-manifest --publish-dependencies --yes
691
699
  ```
692
700
 
693
701
  ### `sous repo submit [REPO]`
@@ -44,7 +44,8 @@ sous build
44
44
  The skill is written to `.claude/skills/review-helpers/SKILL.md`, as a subscribed recipe's skill
45
45
  would be. There was nothing to subscribe to: every recipe the project's recipe paths cover is in
46
46
  use. The manifest needs no `namespace` and no `version`. The namespace, `tooling`, came from the
47
- folder holding the recipe (see [Namespaces](#namespaces)), and a version is needed only to publish.
47
+ folder holding the recipe (see [Namespaces](#namespaces)), and a version matters only once it is
48
+ published (see [Publishing](#publishing)).
48
49
 
49
50
  Sous lists project recipes under the reserved repository name `project`, so the full ref of this
50
51
  one is `project:tooling/review-helpers`:
@@ -181,9 +182,19 @@ character, so `.sous/recipes/*` watches all of `.sous/recipes/`.
181
182
 
182
183
  ## Publishing
183
184
 
184
- A project recipe is never published by being there. A project that is also a recipe repository
185
- publishes the recipes its own `sous.repo.yaml` lists, through `sous repo release`; see
186
- [Authoring a repository](repositories-authoring.md).
185
+ A project recipe is never published by being there. A project publishes the recipes its own
186
+ `sous.repo.yaml` lists (folders or glob patterns, such as `.sous/recipes/*`), through
187
+ `sous repo release`. Run in a project with no `sous.repo.yaml`, the release lists the project's
188
+ recipe paths and offers to create one listing them (`--create-manifest` answers yes).
189
+
190
+ A project recipe needs nothing more to be published. Its namespace is worked out the same way as for
191
+ a build (see [Namespaces](#namespaces)), and when it came from step 3 or later (the config, a
192
+ `package.json`, git or the folder's name), the release first writes a `sous.namespace.yaml` naming it
193
+ in the folder holding the recipe, so its published key never changes. A recipe with no `version` is
194
+ published as `1.0.0`, which the release writes into its manifest. A published recipe that depends on a
195
+ project recipe the manifest does not list makes the release ask whether to publish that one too
196
+ (`--publish-dependencies` answers yes). See
197
+ [What a release writes for you](repositories-authoring.md#what-a-release-writes-for-you).
187
198
 
188
199
  ## Where to go next
189
200
 
@@ -26,8 +26,8 @@ $ sous repo init ./my-recipes --name my-recipes --namespace workflow
26
26
  // then sous init sets the repository up as a sous project, and runs its first build
27
27
  ```
28
28
 
29
- `--name` is the repository's short name (default: the directory's own name), `--namespace` the one namespace to
30
- declare (default: the repository's name), and `--dry-run` lists the files without writing them. `--host` names the repository host whose release automation to add:
29
+ `--name` is the repository's short name (default: the directory's own name), `--namespace` the example recipe's
30
+ namespace, described in `sous.repo.yaml` (default: the repository's name), and `--dry-run` lists the files without writing them. `--host` names the repository host whose release automation to add:
31
31
  `github` writes `.github/workflows/sous-release.yml`, and `gitlab` writes `.gitlab-ci.yml`. Without it, the host is
32
32
  read from the directory's `origin` remote, and is `github` when there is none. Names are lowercase kebab-case, so `My-Recipes` yields `my-recipes`. Every
33
33
  file is read back through the schemas sous uses on published repositories, so the scaffold validates. The scaffold
@@ -90,12 +90,18 @@ recipes. `--workflow`, `--example` and `--readme` answer yes ahead of time; `--n
90
90
  README section sits between sous's marker comments, so the rest of the file is never touched. `--in-sous-directory`
91
91
  writes the manifest into `.sous/` instead, where sous also looks for it. `--for-project` does not run
92
92
  `sous init`; run it first if the project has no `.sous/` yet. A project with its own release pipeline adds one
93
- step to it, `sous repo release --ci --push`, instead of the workflow.
93
+ step to it, `sous repo release --ci --push --yes`, instead of the workflow.
94
+
95
+ `--for-project` is optional: `sous repo release`, run in a project with no `sous.repo.yaml`, lists the
96
+ project's recipe paths and offers to create one at the project root listing them (`--create-manifest` answers
97
+ yes; see [Cut a release](#cut-a-release)).
94
98
 
95
99
  ## Write a recipe
96
100
 
97
- Copy the example folder, edit its manifest, and add its path to the `recipes` list in `sous.repo.yaml`, which is a
98
- plain list of folder paths (`recipes:`, then `- recipes/workflow/task-files` under it):
101
+ Copy the example folder, edit its manifest, and make sure the `recipes` list in `sous.repo.yaml` covers its
102
+ folder: list the folder (`recipes:`, then `- recipes/workflow/task-files` under it), or a glob pattern that
103
+ matches it, such as `recipes/*/*`. A pattern is expanded the way a project expands its own recipe paths, so a
104
+ new folder under it is published with no edit to the list.
99
105
 
100
106
  ```yaml
101
107
  formatVersion: 1
@@ -115,7 +121,14 @@ relative to the recipe folder (and optional `exclude` patterns). Sous registers
115
121
  `prompts` and `config`, and a sous plugin may register more; the kind decides what happens to them in the subscriber's project, which the subscriber shapes with
116
122
  [`recipes`](repositories-file-formats.md#recipes-what-each-content-kind-does). Field tables are in the
117
123
  [recipe manifest](repositories-file-formats.md#sousrecipeyaml-the-recipe-manifest) reference, and recipe
118
- metadata is the source of truth for the version: never edit `sous.index.json` by hand.
124
+ metadata is the source of truth for the version: never edit the published data (the `published:` block of
125
+ `sous.repo.yaml`, or `sous.index.json`) by hand.
126
+
127
+ `namespace` and `version` may be left out. A recipe with no `namespace` gets one worked out from where it sits,
128
+ as a project's own recipe does (see [Namespaces](project-recipes.md#namespaces)): the nearest
129
+ `sous.namespace.yaml` above it that sets a `name`, then the first folder under the `recipes` path that found
130
+ it, then the project's names. A recipe with no `version` is released as `1.0.0` the first time, and the release
131
+ writes that version into its manifest.
119
132
 
120
133
  ?> To write a recipe for one project only, or to try one out before it is published, put it under that
121
134
  project's `.sous/recipes/` instead: every build uses it from the working tree, with no release. See
@@ -348,8 +361,8 @@ instructions so they still read correctly without it ("if the task-files skill i
348
361
 
349
362
  ## Cut a release
350
363
 
351
- `sous repo release` publishes new versions: one run raises versions, regenerates `sous.index.json`, commits both,
352
- and cuts the tags. Run it inside the repository, with your recipe changes committed.
364
+ `sous repo release` publishes new versions: one run raises versions, writes the published data, commits what
365
+ changed, and cuts the tags. Run it inside the repository, with your recipe changes committed.
353
366
 
354
367
  ```term
355
368
  $ sous repo release
@@ -363,9 +376,9 @@ $ sous repo release
363
376
 
364
377
  This run would:
365
378
  Raise the versions listed above, in the manifests that declare them.
366
- Regenerate sous.index.json, with each version's dependencies resolved.
367
- Commit the manifests and the index together.
368
- Cut one annotated tag per version, dependency-first.
379
+ Write the published data into sous.repo.yaml published, with each version's dependencies resolved.
380
+ Commit the changed files and the published data together.
381
+ Cut one annotated tag per version, dependency-first, each carrying its content hash.
369
382
  Push nothing; pass '--push' to push what it makes.
370
383
 
371
384
  Publish these versions? yes
@@ -373,7 +386,7 @@ Publish these versions? yes
373
386
  ▶ Publishing:
374
387
 
375
388
  workflow/qa-helper: 0.1.0 becomes 0.1.1.
376
- Wrote sous.index.json.
389
+ written sous.repo.yaml
377
390
  Committed: Release workflow/qa-helper@0.1.1
378
391
  Created the tag workflow/qa-helper@0.1.1.
379
392
  ```
@@ -384,13 +397,21 @@ stops. Three facts about each recipe decide that plan and nothing else does: whe
384
397
  files changed since the tag that last published it, and whether its version was already raised past that tag. The
385
398
  third case is what a merge looks like to continuous integration: the bump is done, so the run only publishes it.
386
399
 
400
+ Where the published data goes is the repository's choice: embedded in `sous.repo.yaml` under `published:`
401
+ (where a repository that has published nothing puts it), in `sous.index.json` or another `.json` file, or
402
+ nowhere but the release tags (`index: tags`). Each form, and what a release writes in it, is in
403
+ [Where the published data lives](repositories-file-formats.md#where-the-published-data-lives). Every annotated
404
+ release tag's message carries the version's content hash on a line of its own, `Sous-Hash: sha256-...`, in every
405
+ form.
406
+
387
407
  `--namespace <ns>` and `--recipe <ns/name>` narrow the run and both repeat; `--bump <level>` is `patch` (the
388
408
  default), `minor`, `major` or `prerelease`; `--no-bump` raises nothing; `--include-unchanged` releases every
389
409
  recipe in scope, changed or not; `--check` only reads, validating, failing on any problem the release would
390
410
  refuse and on a change to a recipe whose [`submissions`](repositories-file-formats.md#the-submissions-block)
391
- block says it takes no proposals, and reporting how merging would rewrite the committed index without failing
392
- on it, since that index is the release's output; and `--ci` is the merge preset: never bump, accept the plan, never ask, fail on anything unbumped. Every flag
393
- this command takes, `--tag`, `--push` and `--non-interactive` among them, is in the
411
+ block says it takes no proposals, and reporting how merging would rewrite the committed published data without
412
+ failing on it (`Merging rewrites <file>, because:`, then each reason), since that data is the release's output;
413
+ and `--ci` is the merge preset: never bump, accept the plan, never ask, fail on anything unbumped. Every flag
414
+ this command takes, `--tag`, `--push`, `--publish-dependencies` and `--create-manifest` among them, is in the
394
415
  [command reference](commands.md#sous-repo-release).
395
416
 
396
417
  `--bump` and `--no-bump` contradict each other, and so do `--check` and `--ci`; sous refuses the combination and
@@ -398,10 +419,53 @@ says which one to keep. `--ci` implies `--no-bump` and `--yes`, accepting the pl
398
419
  but it deliberately does not imply `--push`, so what a workflow pushes stays visible in the workflow file. Under
399
420
  either, a recipe whose files changed without a bump is an error naming its manifest and the colliding tag.
400
421
 
401
- `--push` pushes the branch to `origin`, plus every release tag that `sous.index.json` publishes, that this checkout
402
- holds and that `origin` lacks. That includes tags an earlier run cut without `--push`, so the pushed index never
403
- names a tag subscribers cannot fetch. The tags go first, then the branch. A `--push` run with nothing new to
404
- release still pushes them, which is how to send a release you made without `--push`.
422
+ `--push` pushes the branch to `origin`, plus every release tag that the published data names, that this checkout
423
+ holds and that `origin` lacks (with `index: tags`, every release tag the checkout holds that `origin` lacks).
424
+ That includes tags an earlier run cut without `--push`, so the pushed published data never names a tag
425
+ subscribers cannot fetch. The tags go first, then the branch. A `--push` run with nothing new to release still
426
+ pushes them, which is how to send a release you made without `--push`.
427
+
428
+ A run with no new version still rewrites the published data when it differs from what the repository publishes
429
+ (a recipe retired or moved, a namespace description changed, data written by an older sous), lists why, and
430
+ commits it as `Update the published data of <name>`. It asks first, unless `--yes` or `--ci` is given.
431
+
432
+ ### What a release writes for you
433
+
434
+ A release fills in what a repository left out, so the first release of a project's own recipes needs nothing
435
+ written by hand:
436
+
437
+ - **No `sous.repo.yaml`.** When there is none in the directory, its `.sous/` directory or any directory above,
438
+ the release lists the project's recipe paths (`projectRecipes.paths`, `.sous/recipes/*` by default) and asks
439
+ whether to create `sous.repo.yaml` at the project root, listing them. `--create-manifest` answers yes; without
440
+ a terminal and without it, the release fails naming the switch. The new manifest holds only `recipes`, so its
441
+ published data is embedded. `--check` and `--dry-run` never create it: their error says to run the release
442
+ without them, or to run `sous repo init --for-project`.
443
+ - **No `version`.** A recipe whose manifest names none is released as `1.0.0`, and the release writes
444
+ `version: 1.0.0` into the manifest, in place, keeping its comments. A recipe that already has release tags but
445
+ names no version is an error.
446
+ - **A namespace worked out from outside the recipe.** When a recipe's namespace came from the project's sous
447
+ config `name`, its `package.json`, its git `origin` or its folder's name, a later change to any of them would
448
+ change the recipe's published key. So before publishing it, the release writes a `sous.namespace.yaml` holding
449
+ `name: <namespace>` in the folder holding the recipe (or sets `name` in the one already there, in place). If
450
+ that file would change the key of another recipe, the release takes it back and stops, asking you to add
451
+ `namespace:` to the manifests instead.
452
+ - **A dependency the repository does not publish.** When a recipe it publishes depends, with no location, on one
453
+ of the project's own recipes that `sous.repo.yaml` does not list, subscribers could never install it. The
454
+ release lists those recipes and asks whether to publish them too; `--publish-dependencies` answers yes, and
455
+ declining stops the release. Yes adds their folders to `recipes` (and writes a `sous.namespace.yaml` for one
456
+ whose namespace came from its folder, so its key stays the same). Without a terminal and without the switch
457
+ the release fails naming it. `--check` and `--dry-run` report it as an error.
458
+
459
+ `--yes` answers neither of the two questions above; only their own switches do. A first release that should
460
+ ask nothing passes all three:
461
+
462
+ ```bash
463
+ sous repo release --create-manifest --publish-dependencies --yes
464
+ ```
465
+
466
+ The release commits every one of these changes before it cuts the tags. A repository that keeps its published
467
+ data in its tags alone (`index: tags`) is the exception under `--ci`, which changes no file there: each of these
468
+ changes is an error saying to commit it first, or to run the release on a machine.
405
469
 
406
470
  ### The branch rule
407
471
 
@@ -434,13 +498,16 @@ hash, its dependencies and its variable definitions are carried forward exactly
434
498
  disagreement is an error telling you to bump rather than republish
435
499
  ([what is checked](repositories-file-formats.md#sousindexjson)). A version counts
436
500
  as published once its tag exists, and the tags are the backstop, so a tagged version missing from the index is
437
- rebuilt from it, dependencies included, whenever the index is regenerated, which only happens on a run that
438
- publishes something. A bump edits the manifest in place, so comments, field order and layout survive; a folded
501
+ rebuilt from it, dependencies included, whenever the index is regenerated. A bump edits the manifest in place, so comments, field order and layout survive; a folded
439
502
  block of YAML prose may be re-wrapped and the space before a trailing comment collapsed to one.
440
503
 
441
- !> A release commits the version bumps and the index, and nothing else; the only other commit sous ever makes
442
- for you is `sous repo submit --commit`. It refuses to run while a recipe folder, `sous.repo.yaml` or the index has
443
- uncommitted changes, because a tag names one commit and the index records what each recipe folder holds right now.
504
+ !> A release commits the files it changed (version bumps, a first version, a namespace file, the repository
505
+ manifest, the published data), and nothing else; the only other commit sous ever makes for you is
506
+ `sous repo submit --commit`. It refuses to run while anything it publishes or writes has uncommitted changes:
507
+ every recipe folder it publishes, `sous.repo.yaml`, the index file when the published data is one, and any
508
+ `sous.namespace.yaml` it is about to write, because a tag names one commit and the published data records what
509
+ each recipe folder holds right now. A file the same run wrote earlier (a `sous.repo.yaml` it just created, for
510
+ example) does not count.
444
511
  Uncommitted changes to any other file (such as the project files a newer sous rewrites when it runs its
445
512
  migrations in a continuous integration checkout) do not stop it, and its commit leaves them out. It also
446
513
  refuses when git does not know who is committing: set `git config user.name` and `git config user.email` first, or
@@ -460,8 +527,8 @@ retired:
460
527
  - github://other/recipes/tools/widget # a recipe in another repository
461
528
  ```
462
529
 
463
- A recipe that moved to another repository is retired the same way, naming its new home. Like every index
464
- change, a retirement reaches the index with the next release that publishes a version. The fields and what
530
+ A recipe that moved to another repository is retired the same way, naming its new home. The next release
531
+ writes the retirement into the published data, even when it publishes no new version. The fields and what
465
532
  the release checks are in [Retired recipes](repositories-file-formats.md#retired-recipes); what a
466
533
  subscriber sees is in [Retired recipes](repositories-consuming.md#retired-recipes).
467
534
 
@@ -471,7 +538,7 @@ On GitHub, `sous repo init` writes `.github/workflows/sous-release.yml`, which r
471
538
  calling the CLI from npm so nothing is installed into the repository. On a **pull request** it runs
472
539
  `npx --yes @sous-io/sous repo release --check`, which only reads, so it is safe on an untrusted branch and
473
540
  fails the pull request when a manifest is wrong or a published version changed, and notes how the merge will
474
- rewrite the index. On a **push to `main`** it
541
+ rewrite the published data. On a **push to `main`** it
475
542
  runs `npx --yes @sous-io/sous repo release --ci --push --yes`; edit the workflow's `branches` list if your
476
543
  default branch has another name. `--ci` accepts the plan on its own, the redundant `--yes` keeping the file
477
544
  working with an older published sous. Both jobs check out with `fetch-depth: 0`, so existing tags are visible
@@ -623,9 +690,12 @@ It prints each step as it runs them:
623
690
  (`gh` or `glab`) is installed and signed in, and everything is committed. `--commit` lifts that last rule:
624
691
  sous lists what is uncommitted, asks once (`--yes` answers), checks git knows who is committing before
625
692
  writing anything, and commits it all with the proposal's title, description and changelog as the message.
626
- 2. **Validation.** The repository validates, and your change leaves `sous.index.json` as it found it, so a
627
- proposal never fails the maintainer's own checks and wastes their review. The index is written by the
628
- repository's own release after a merge; whether it agrees with the release tags is checked there, by
693
+ 2. **Validation.** The repository validates, and your change leaves the published data as it found it, so a
694
+ proposal never fails the maintainer's own checks and wastes their review. Where the repository keeps it in an
695
+ index file, the change may not edit that file; where it is embedded in `sous.repo.yaml`, only the
696
+ `published:` block is compared, so a proposal may edit the rest of the manifest (to list a new recipe, for
697
+ example); a repository that publishes through its tags alone has nothing to compare. The published data is
698
+ written by the repository's own release after a merge; whether it agrees with the release tags is checked there, by
629
699
  `sous repo release --check` on a full clone, not by `submit`. That is what lets `submit` run from the shallow
630
700
  checkout `sous repo link` makes, which holds almost none of the tags. The comparison is made against the
631
701
  copy of the default branch your checkout holds (`origin/main`, for example); when it holds none, `submit`
@@ -6,12 +6,13 @@ and [Repository file formats](repositories-file-formats.md) holds every schema.
6
6
  ## Add a repository
7
7
 
8
8
  Adding a repository is how you trust it, so it is the one step that asks a question, and what that
9
- decision covers is [Trust](repositories.md#trust). Exactly one file is fetched, its
10
- `sous.index.json`, which is all sous needs to resolve refs and list versions:
9
+ decision covers is [Trust](repositories.md#trust). Only what the repository publishes is read: its
10
+ `sous.repo.yaml`, then the index it leads to, which is all sous needs to resolve refs and list versions
11
+ ([How a project reads a repository](repositories-file-formats.md#how-a-project-reads-a-repository)):
11
12
 
12
13
  ```term
13
14
  $ sous repo add https://github.com/sous-io/sous-recipes
14
- // the trust question, then one small download
15
+ // the trust question, then a small download
15
16
  ▶ Adding a repository:
16
17
  Repository: sous-recipes
17
18
  Location : https://github.com/sous-io/sous-recipes
@@ -110,9 +110,11 @@ which runs the same update `unlink --update` runs; with `--dry-run` it only show
110
110
 
111
111
  ## What a contributor leaves alone
112
112
 
113
- **Releases are the maintainers' business.** A contributor never runs `sous repo release`, and never edits
114
- `sous.index.json`. The index is written by the repository's own release after a merge, from the manifests and the
115
- tags; `sous repo submit` refuses a change that edits it, and says how to put it back.
113
+ **Releases are the maintainers' business.** A contributor never runs `sous repo release`, and never edits the
114
+ published data: `sous.index.json`, or the `published:` block of `sous.repo.yaml`. It is written by the
115
+ repository's own release after a merge, from the manifests and the tags; `sous repo submit` refuses a change that
116
+ edits it, and says how to put it back. The rest of `sous.repo.yaml` is yours to edit, to list a new recipe, for
117
+ example.
116
118
 
117
119
  **Versions depend on how the repository releases.** The release workflow `sous repo init` scaffolds, which
118
120
  `sous-recipes` also runs, publishes on every merge to the default branch with `sous repo release --ci`, and that
@@ -43,15 +43,15 @@ one, the one at the root is used.
43
43
 
44
44
  ```yaml
45
45
  formatVersion: 1 # optional; 1 when given
46
- name: qa-recipes # suggested short name; a project records its own
47
- namespaces:
46
+ name: qa-recipes # optional suggested short name; a project records its own
47
+ namespaces: # optional: descriptions only
48
48
  workflow:
49
49
  description: Recipes about how work moves through a project.
50
50
  quality:
51
51
  description: Recipes that exercise the edges.
52
- recipes: # every recipe folder, relative to the repository root
52
+ recipes: # recipe folders or glob patterns, relative to the repository root
53
53
  - recipes/workflow/qa-variables
54
- - recipes/quality/qa-remote-dep
54
+ - recipes/quality/*
55
55
  retired: # optional: replacements for recipes no longer listed above
56
56
  quality/qa-old-dep:
57
57
  replacements:
@@ -59,19 +59,59 @@ retired: # optional: replacements for recipes no long
59
59
  - github://acme/recipes/quality/qa-remote-dep # in another repository
60
60
  ```
61
61
 
62
- Only `recipes` is required for the file to be valid. `sous repo release` needs more: a `name`, and every
63
- recipe's namespace under `namespaces`.
62
+ Only `recipes` is required, both for the file to be valid and for `sous repo release`.
64
63
 
65
64
  | Field | Required | Notes |
66
65
  |-------|----------|-------|
67
- | `recipes` | yes | One path, or a list of paths, relative to the repository root, each holding a recipe manifest; a single string is read as a list of one, and a path listed twice is an error. A path may be a glob pattern (`recipes/*`), but `sous repo release` refuses one: list each recipe folder |
68
- | `name` | to release | A suggestion only; `sous repo add --name` decides what a project calls it |
69
- | `namespaces` | to release | Keyed by namespace name; each entry takes an optional `description`. A release refuses a recipe whose namespace is not listed here |
66
+ | `recipes` | yes | One path, or a list of paths, relative to the repository root; a single string is read as a list of one, and a path listed twice is an error. A path is a recipe folder or a glob pattern (`recipes/*`), expanded the way a project expands its own [`projectRecipes.paths`](project-recipes.md), in a working tree and in the repository at a tag alike. A pattern that matches no recipe yet is a warning; a listed folder that is missing, or holds no recipe manifest, is an error |
67
+ | `name` | no | A suggestion only; `sous repo add --name` decides what a project calls it. When it is missing, the published data uses the name of the repository's root folder |
68
+ | `namespaces` | no | Descriptions only, keyed by namespace name; each entry takes an optional `description`. A namespace needs no entry here: it exists because a recipe is in it. Describing one namespace here and in a [`sous.namespace.yaml`](#sousnamespaceyaml-a-namespaces-name-and-description) too stops a release, naming both |
70
69
  | `description`, `contribute` | no | A summary for anyone reading the repository, and where to send a contribution when a provider cannot support `sous repo submit` |
71
- | `index`, `published` | no | Where the published data lives: `index` is `embedded`, `tags`, or the path of a `.json` file relative to the repository root, and `published` holds the same data as `sous.index.json` apart from `formatVersion` and `name`. A `published` block beside an `index` of `tags` or a path is an error. This version of sous accepts both and still publishes and reads `sous.index.json` |
70
+ | `index`, `published` | no | Where the published data lives: `index` is `embedded`, `tags`, or the path of a `.json` file relative to the repository root, and `published` holds the same data as `sous.index.json` apart from `formatVersion` and `name`. A `published` block beside an `index` of `tags` or a path is an error. See [Where the published data lives](#where-the-published-data-lives); a project reads every form ([How a project reads a repository](#how-a-project-reads-a-repository)) |
72
71
  | `submissions` | no | Whether the repository's recipes take proposed changes; see [The submissions block](#the-submissions-block) |
73
72
  | `retired` | no | Keyed `namespace/recipe`; see [Retired recipes](#retired-recipes) |
74
73
 
74
+ ### Where the published data lives
75
+
76
+ The published data is the catalog of every version the repository has published: what
77
+ [`sous.index.json`](#sousindexjson) holds. `sous repo release` writes it in one of three places, which
78
+ the `index` setting and the files beside the manifest decide:
79
+
80
+ - **Embedded**, in a `published:` block at the end of `sous.repo.yaml`. This is where a repository that
81
+ has published nothing (no `published:` block, and no `sous.index.json` beside the manifest) puts it on
82
+ its first release, so `index: embedded` is allowed but never needed. When a release writes the block, it
83
+ writes the whole manifest again, comments removed, in this layout:
84
+
85
+ ```yaml
86
+ # Note: Comments are systematically removed from this file.
87
+ formatVersion: 1
88
+ name: qa-recipes
89
+ recipes:
90
+ - recipes/quality/*
91
+ x-team: quality # extension keys come after the fields sous knows
92
+ # Everything below is written by Sous when it publishes recipes. Do not edit it by hand.
93
+ published: # what sous.index.json holds, less formatVersion and name
94
+ generatedAt: "2026-12-03T07:06:33.236Z"
95
+ generator: 1.1.13
96
+ recipes:
97
+ quality/qa-remote-dep:
98
+ path: recipes/quality/qa-remote-dep
99
+ versions: {} # each version, as in sous.index.json
100
+ ```
101
+
102
+ The fields you edit come first, in a fixed order (`formatVersion`, `name`, `description`,
103
+ `contribute`, `submissions`, `index`, `namespaces`, `recipes`, `retired`), then any `x-` extension
104
+ keys, then the marker line and `published:`. A manifest written as JSON is written back as JSON, in the
105
+ same order.
106
+ - **In a file**: `sous.index.json` beside the manifest (a repository that already has one keeps using
107
+ it), or the `.json` file `index: <path>` names, relative to the repository root.
108
+ - **Nowhere but the tags**, with `index: tags`. A release never writes an index; the release tags are the
109
+ record. Run on a machine, a release still commits the recipe files it has to change (a raised version,
110
+ a first `1.0.0`, a `sous.namespace.yaml`, a new `sous.repo.yaml`, a dependency added to `recipes`)
111
+ before it tags. With `--ci` it changes no file and makes no commit, and does not push the branch: it
112
+ only creates tags, and pushes them with `--push`. A recipe that would need one of those file changes is
113
+ then an error saying to commit the change first, or to run the release on a machine.
114
+
75
115
  ### Retired recipes
76
116
 
77
117
  A recipe is retired when the repository stops listing its folder under `recipes`. Nothing else is
@@ -117,8 +157,8 @@ contents: # what a subscriber actually receives
117
157
  | Field | Required | Notes |
118
158
  |-------|----------|-------|
119
159
  | `name` | yes | Unique within the recipe's namespace |
120
- | `namespace` | to release | The recipe's namespace; `sous repo release` refuses a recipe that names none, or one the repository manifest does not declare. A project's own recipe that names none gets one worked out from where it is ([Namespaces](project-recipes.md#namespaces)) |
121
- | `version` | to release | An exact semantic version; the manifest is the source of truth and the git tag follows it. `sous repo release` refuses a recipe that names none |
160
+ | `namespace` | no | The recipe's namespace. A recipe that names none gets one worked out from where it is, in a repository as in a project ([Namespaces](project-recipes.md#namespaces)); before publishing such a recipe for the first time, `sous repo release` may write a `sous.namespace.yaml` beside it so its key never changes (see [Cut a release](repositories-authoring.md#cut-a-release)) |
161
+ | `version` | no | An exact semantic version; the manifest is the source of truth and the git tag follows it. A recipe that names none is released as `1.0.0` the first time, and the release writes `version: 1.0.0` into its manifest. A recipe that has release tags but names no version is an error |
122
162
  | `description` | no | Copied into the index at release time; shown by `sous recipe list` and `sous repo search` |
123
163
  | `depends`, `subscribes` | no | Build dependencies and co-subscriptions; within either list, no entry may repeat |
124
164
  | `recommends` | no | Recipes or namespaces the subscriber is offered, and may decline; each entry is a ref, or `{ ref, reason }` with an optional `reason` shown when sous asks. Needs sous 1.2.0 or later; see [Recommendations](#recommendations) |
@@ -375,9 +415,12 @@ one of its options; `secret: true` with `scope: shared` is refused; the committe
375
415
 
376
416
  ## `sous.namespace.yaml`: a namespace's name and description
377
417
 
378
- Hand-written, in a folder among a project's own recipes (also `.yml`, `.json` or `.jsonc`). A recipe below it
379
- whose manifest names no namespace belongs to the namespace it names; see
380
- [Namespaces](project-recipes.md#namespaces).
418
+ Hand-written, in a folder among a project's own recipes or a repository's (also `.yml`, `.json` or
419
+ `.jsonc`); `sous repo release` also writes one holding only `name` to keep a published key fixed. A recipe
420
+ below it whose manifest names no namespace belongs to the namespace it names; see
421
+ [Namespaces](project-recipes.md#namespaces). Its `description` describes the namespace its `name` gives, or,
422
+ with no `name`, the namespace named after its folder. One namespace described in two places (two namespace
423
+ files, or a namespace file and `namespaces` in `sous.repo.yaml`) stops a release with an error naming both.
381
424
 
382
425
  ```yaml
383
426
  name: tooling # optional; lowercase kebab-case
@@ -386,8 +429,12 @@ description: Helpers for the team's own tools. # optional; shown by sous names
386
429
 
387
430
  ## `sous.index.json`
388
431
 
389
- Machine-written by `sous repo release` and committed beside the recipes it describes. Adding a repository
390
- fetches only this file; nothing more is downloaded until a project subscribes.
432
+ Machine-written by `sous repo release` and committed beside the recipes it describes, when the repository
433
+ keeps its published data in a file; the same data, less `formatVersion` and `name`, is what an embedded
434
+ `published:` block holds ([Where the published data lives](#where-the-published-data-lives)). Adding a
435
+ repository reads only the repository manifest and this file; nothing more is downloaded until a project
436
+ subscribes. The data may also be built from the release tags; see
437
+ [How a project reads a repository](#how-a-project-reads-a-repository).
391
438
 
392
439
  ```json
393
440
  {
@@ -419,9 +466,9 @@ fetches only this file; nothing more is downloaded until a project subscribes.
419
466
 
420
467
  | Field | Where | Notes |
421
468
  |-------|-------|-------|
422
- | `generatedAt`, `generator`, `name`, `namespaces` | top level | When the index was generated and by which sous version, then the name and namespaces copied from the repository manifest. `$comment` is free text, since JSON has no comments, and is ignored on a published index |
423
- | `recipes` | top level | Keyed `namespace/recipe`; a recipe whose namespace is not declared is an error. Each entry carries `path` (the recipe folder), `description`, and `versions`, keyed by exact version |
424
- | `hash`, `tag` | per version | The content hash verified after every fetch, and the tag, which must be exactly `namespace/recipe@version` so a version can never point at a branch |
469
+ | `generatedAt`, `generator`, `name`, `namespaces` | top level | When the index was generated and by which sous version, then the repository's name (the manifest's, else the root folder's) and every namespace a published recipe is in, each with its description when the repository manifest or a `sous.namespace.yaml` gives one. `$comment` is free text, since JSON has no comments, and is ignored on a published index |
470
+ | `recipes` | top level | Keyed `namespace/recipe`. Each entry carries `path` (the recipe folder), `description`, and `versions`, keyed by exact version |
471
+ | `hash`, `tag` | per version | The content hash verified after every fetch, and the tag, which must be exactly `namespace/recipe@version` so a version can never point at a branch. The tag is annotated, and its message carries the same hash on a line of its own, `Sous-Hash: sha256-...` |
425
472
  | `prerelease`, `releasedAt`, `seeded` | per version | Whether ranges skip it unless a subscription opts in, when it was released, and whether it is the copy sous folds in from its own package |
426
473
  | `dependencies` | per version | The range each dependency may take, keyed `namespace/recipe`; see below |
427
474
  | `variables` | per version | The version's variable definitions, exactly as its manifest publishes them (see [Variable definitions](#variable-definitions)), with `required`, `secret` and `scope` filled in; `[]` when it asks nothing |
@@ -480,8 +527,7 @@ one included. A project pinned to such a sous fails to read that index until it
480
527
  **Retired recipes.** A release keeps every version a retired recipe published: the entries the committed
481
528
  index held, and any version a tag carries that it lacks, rebuilt from the tag (the folder and description
482
529
  come from the newest tag when the index never recorded them). A retired version whose tag no longer exists
483
- is an error, as for a published one. A key is under `recipes` or under `retired`, never both, and a retired
484
- recipe's namespace need not be declared any more. Retired recipes sit outside `recipes`, so a namespace
530
+ is an error, as for a published one. A key is under `recipes` or under `retired`, never both. Retired recipes sit outside `recipes`, so a namespace
485
531
  never reaches one and a new subscription cannot find one; a subscription or a dependency that already names
486
532
  one still resolves to its versions.
487
533
 
@@ -495,6 +541,57 @@ any other, marked `seeded: true`; if the repository already publishes it, the pu
495
541
  never writes `seeded` onto a fetched index, and when it writes the placeholder into the index cache it
496
542
  stamps a fixed `$comment`, so a later run can tell its own placeholder from a real index and replace it.
497
543
 
544
+ ## How a project reads a repository
545
+
546
+ A project that adds a repository (the built-in ones included) reads what it publishes, the manifest
547
+ first. Sous looks for `sous.repo.yaml` at the repository root, then in `.sous/`, trying `.yaml`, `.yml`,
548
+ `.json` and `.jsonc` in each, and the first file found is the manifest. What it says decides what is
549
+ read next:
550
+
551
+ | The manifest has | Sous reads |
552
+ |------------------|------------|
553
+ | a `published` block, or `index: embedded` | nothing more: the index is in the manifest |
554
+ | `index: <path>.json` | the index file at that path, relative to the repository root. A missing file is an error naming the setting, for the repository's maintainers to fix |
555
+ | `index: tags` | the repository's tags, from which it builds the index; see [A repository that publishes through its tags](#a-repository-that-publishes-through-its-tags) |
556
+ | none of these | a `sous.index.json` beside the manifest; with none there, the repository has published nothing yet, and its index is empty |
557
+
558
+ Only when neither place holds a manifest is a `sous.index.json` at the repository root read. With none
559
+ there either, the read fails:
560
+
561
+ ```text
562
+ Error: https://github.com/acme/recipes has no 'sous.repo.yaml' (at its root or in '.sous/') and no
563
+ 'sous.index.json', so it is not a sous recipe repository, or nothing in it has been released yet.
564
+ ```
565
+
566
+ A [linked working copy](repositories-authoring.md#edit-a-repository-in-place) is read the same way, from
567
+ disk; a linked repository that publishes through its tags is read from upstream, like any other. How each
568
+ file travels from a host is in [Private repositories](repositories-providers.md#private-repositories).
569
+
570
+ ### A repository that publishes through its tags
571
+
572
+ With `index: tags`, a repository commits no index: a project builds it from the release tags
573
+ (`namespace/recipe@version`) with the same code `sous repo release` uses, so it gets the index a release
574
+ would write for the same repository.
575
+
576
+ - One `git ls-remote` lists the tags and `HEAD`.
577
+ - Only the commits and trees of tags not seen before are fetched, one commit deep and with no file
578
+ contents, then the repository manifests at them and then the recipe manifests, one fetch each. They
579
+ are kept in a bare repository under `$SOUS_HOME/cache/_tags/<repository identity>.git`.
580
+ - Each tag's entry is kept for good in `$SOUS_HOME/cache/_tags/<repository identity>.json`, checked against
581
+ the object the tag points at. A published tag never changes, so each version's manifest is read once;
582
+ a tag moved to another object is read again.
583
+ - A version's content hash is the `Sous-Hash: sha256-...` line of its annotated tag's message. A tag made
584
+ by hand without that line has its recipe folder fetched and hashed once, and the hash is kept.
585
+ - Each recipe's folder, description and namespace come from the manifests at `HEAD`. A recipe `HEAD` no
586
+ longer lists is retired, with the replacements its `sous.repo.yaml` names.
587
+ - A dependency that could be read more than one way is settled once, by reading the candidate
588
+ repositories' indexes, and kept in the same file.
589
+
590
+ A fresh machine that downloads a pinned recipe while the config is still being built reads the tags
591
+ without each version's dependencies; that read serves the download only and is never cached, and the
592
+ next read completes it from the local copy without fetching again. Measured with 50 recipes and 500
593
+ tags, a first read takes about 3 seconds and a read from the local copy about a tenth of a second.
594
+
498
595
  ## `.sous/sous.lock.json`
499
596
 
500
597
  Machine-written, committed, and the reason a fresh clone restores with no prompts and no drift.
@@ -550,13 +647,19 @@ lockfile's pins); every entry carries a `.sous.entry.json` marker. It sits under
550
647
  $SOUS_HOME/
551
648
  cache/<repository identity>/<namespace>/<name>/<version>/ .sous.entry.json, then the files
552
649
  cache/_indexes/<repository identity>.json the cached index
553
- cache/_indexes/<repository identity>.meta.json etag, fetchedAt, lastCheckedAt, ref
650
+ cache/_indexes/<repository identity>.meta.json etag, fetchedAt, lastCheckedAt, readFrom
651
+ cache/_tags/<repository identity>.git a tags-only repository's tags and manifests
652
+ cache/_tags/<repository identity>.json each tag's entry, and the dependencies settled
554
653
  cache/read-strategies.json per repository: the read strategy and clone URL that worked, and since when
555
654
  cache/gitlab-instances.json per GitLab host: the sub-path GitLab is installed under ("" at the root)
556
655
  repos/ checkouts cloned by 'sous repo link --global'
557
656
  sous.links.json the machine-wide links map
558
657
  ```
559
658
 
659
+ A cached index's `readFrom` names the file the copy was read from (`sous.repo.yaml`, `.sous/sous.repo.yaml`,
660
+ `sous.index.json`, or the path an `index` setting names), or `tags` for an index built from the tags; its
661
+ `etag` is sent only when that same file is read again.
662
+
560
663
  The marker makes an entry self-describing, so the store is sweepable without consulting a project:
561
664
 
562
665
  ```json