@sous-io/sous 1.3.1 → 1.4.0

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.
@@ -89,3 +89,4 @@
89
89
  - [0043: Every command runs the waiting migrations first](adrs/0043-migrations-before-every-command.md)
90
90
  - [0044: A recipe can recommend other recipes, and sous asks before subscribing to them](adrs/0044-recipe-recommendations.md)
91
91
  - [0045: `core` comes from `sous`, and `the-pantry` replaces `sous-recipes`](adrs/0045-core-in-sous-and-the-pantry.md)
92
+ - [0046: A variable with a default is not asked at subscribe or update, unless its priority is high](adrs/0046-variable-priority.md)
@@ -33,14 +33,13 @@ finds by walking up from the working directory.
33
33
  command takes it.
34
34
  - `--non-interactive` never asks anything. A run that would have asked fails instead, naming the question and
35
35
  the flag that would have answered it.
36
- - `--dry-run` prints what the command would do, and writes, downloads and asks nothing.
36
+ - `--dry-run` prints what the command would do, and writes and downloads nothing. It asks nothing either,
37
+ except `sous vars ask --dry-run`, which asks its questions in a terminal to show what each answer would
38
+ write.
37
39
 
38
40
  Sous asks a question only when it can. Piping output, redirecting it to a file and running in CI therefore do
39
41
  what `--non-interactive` does; see [When sous cannot ask](repositories-consuming.md#when-sous-cannot-ask).
40
42
 
41
- !> `sous clear` is the exception: without `-f` it asks even under `--non-interactive` or in CI, so pass `-f`
42
- whenever you script it.
43
-
44
43
  ?> `sous repo init --force` used to overwrite a repository that already existed. It is now the same flag as
45
44
  `--yes`, as on every other command, and `sous repo init` never replaces a file unless `--overwrite` is given.
46
45
 
@@ -685,7 +684,9 @@ merge job. A recipe the repository no longer lists keeps its published versions,
685
684
  replacements `sous.repo.yaml` names (see
686
685
  [Retire or move a recipe](repositories-authoring.md#retire-or-move-a-recipe)). It warns about every recipe that
687
686
  uses `recommends`, which needs sous 1.2.0 or later in every subscribing project (see
688
- [Recommend other recipes](repositories-authoring.md#recommend-other-recipes)).
687
+ [Recommend other recipes](repositories-authoring.md#recommend-other-recipes)), and about every recipe that gives
688
+ a variable a `priority`, which only sous 1.4.0 or later reads (see
689
+ [Declare the variables a recipe needs](repositories-authoring.md#declare-the-variables-a-recipe-needs)).
689
690
 
690
691
  `--create-manifest` creates `sous.repo.yaml` at the project root, listing the project's recipe paths, when there
691
692
  is none, without asking. `--publish-dependencies` also publishes the project's own recipes that a published
@@ -717,7 +718,8 @@ Manages which recipes the project subscribes to. `REF` is `namespace` or `namesp
717
718
  recipe's questions ahead of time with `--answer <name>=<value>` or `--answers-file <path>`, and let it install
718
719
  the sous plugins it requires with `--install-plugins`. It checks everything before it writes anything: a
719
720
  repository it has to trust is trusted in memory only, every recipe it installs is downloaded, and the recipes'
720
- questions are asked (without a terminal, a required question nothing answers fails it). Only then are the
721
+ questions are asked (a question a default answers is not asked unless the variable's priority is `high`;
722
+ without a terminal, a required question nothing answers fails it). Only then are the
721
723
  trust, the subscription, the lockfile and the answers written, so a failed subscription, a declined question
722
724
  or Ctrl-C leaves the project as it was. Without `@<range>` the subscription accepts any version,
723
725
  so an update may move it to a new major version; the plan shown before the question, and the result, name
@@ -287,14 +287,20 @@ variables:
287
287
  `GITLAB_TOKEN`, `NPM_TOKEN`, or anything starting `AWS_` or `SOUS_`, except the `SOUS_VAR_` names sous
288
288
  derives itself). Two definitions of the same name share one variable; two of **different** names
289
289
  claiming the same one is an error.
290
+ - **`priority: high`** asks the variable at `sous subscription add` and `sous update` even though it has a
291
+ default, offering that default, and even when it is optional. Without it (`standard`), a default that fits
292
+ answers the variable and nothing is asked. Mark a variable `high` when the subscriber should confirm its
293
+ default, for example a placeholder such as `my-team` that every project is expected to replace. Only
294
+ sous 1.4.0 or later reads it: `sous repo release` warns about each recipe that uses it, because sous 1.2.0
295
+ or later but older than 1.4.0 ignores it, and a sous older than 1.2.0 cannot read the manifest at all.
290
296
  - **`secret: true`** hides the value everywhere sous prints it, and **`scope`** picks the file the answer is
291
297
  written to: `shared` for the committed `.sous/.env`, `local` for the gitignored `.sous/.env.local`. A secret
292
298
  is always stored locally, so a secret declared `shared` is rejected.
293
299
  - **`validate`** carries `pattern`, `minLength`, `maxLength`, `min`, `max` and `enum`. A published `pattern` runs on
294
300
  a worker under a time budget, so one that backtracks forever fails validation rather than hanging the person
295
301
  answering, and the message names your pattern. Within a major version a schema may only LOOSEN: tightening a
296
- constraint is a major bump, and an upgrade re-validates stored answers, re-prompting only where an old one no
297
- longer fits.
302
+ constraint is a major bump, because an answer a project already stored may stop fitting, and `sous vars ask`
303
+ then asks it again.
298
304
  - **Reading another recipe's variable** needs no definition: list that recipe under `depends` and use the name in
299
305
  your templates. Redefining it makes a second definition, which sous combines with the first; see
300
306
  [Two recipes, one name](repositories-variables.md#two-recipes-one-name).
@@ -92,6 +92,12 @@ $ sous recipe show omakase/house
92
92
  answered : no, and this recipe requires an answer
93
93
  ```
94
94
 
95
+ The `answered` fact says what subscribing does with each question nothing answers yet: `no, so its default
96
+ is used: .sous/notes`, `no, so it is asked, offering its default: my-team`, `no, so it is asked, though an
97
+ answer is optional`, `no, and an answer is optional` (not asked), or `no, and this recipe requires an
98
+ answer` (asked). Which questions are asked is described under
99
+ [Which questions subscribing and updating ask](repositories-variables.md#which-questions-subscribing-and-updating-ask).
100
+
95
101
  ?> A recipe released before sous recorded questions in the index is described from its files
96
102
  instead, so its questions are listed once it is installed, and named as unknown until then.
97
103
 
@@ -113,8 +119,9 @@ recorded in its canonical form, `namespace/recipe`.
113
119
  The whole dependency closure resolves before anything is written, and so is everything else that
114
120
  could make the subscription fail: a repository you agree to trust along the way is trusted in memory
115
121
  only, every recipe the subscription installs is downloaded into this machine's store, and the
116
- recipes' questions are asked (without a terminal, a required question nothing answers, with no
117
- `--answer`, no value in scope and no default, is an error). Only then are the trust, the
122
+ recipes' questions are asked (a question a default answers is not asked unless the variable's priority
123
+ is `high`; without a terminal, a required question nothing answers, with no `--answer`, no value in scope
124
+ and no default, is an error). Only then are the trust, the
118
125
  subscription, the lockfile and the answers written; an install is whole or not at all, and a failed
119
126
  one, a declined question or Ctrl-C leaves the project as it was.
120
127
 
@@ -163,9 +170,10 @@ $ sous subscription add workflow/qa-variables
163
170
  into this project's agent directories.
164
171
  • Any scripts it ships can be run on this machine when an agent uses them. Sous does not
165
172
  run them itself, and it cannot vouch for what they do.
166
- // two more bullets: the variables it publishes that require an answer and have none yet are
167
- // asked about before anything is written, and the answers are written into this project's env
168
- // files with the subscription; and its dependencies are pinned in the lockfile
173
+ // two more bullets: the variables it publishes that have no answer yet are asked about before
174
+ // anything is written, unless the recipe lets their default answer them, and the answers are
175
+ // written into this project's env files with the subscription; and its dependencies are pinned
176
+ // in the lockfile
169
177
  • If a dependency turns out to live in a repository this project does not trust, sous stops
170
178
  and asks about that repository by name before fetching anything from it.
171
179
  ? Proceed? (y/N) y
@@ -297,11 +305,11 @@ When a target in your own config writes the same file, your target wins and the
297
305
 
298
306
  ## Answer the questions
299
307
 
300
- A recipe publishes variable definitions; you supply answers. Subscribing asks whatever is
301
- unanswered, reports whatever it inherited from an answer already in scope, and never re-asks
302
- something that already fits. [Recipe variables](repositories-variables.md#answer-the-questions)
303
- covers the question screen, the advanced view and the ladder; what follows is what a subscribe
304
- needs.
308
+ A recipe publishes variable definitions; you supply answers. Subscribing asks what nothing answers
309
+ yet, except a variable whose default answers it (unless its priority is `high`), lists the defaults
310
+ it used, reports whatever it inherited from an answer already in scope, and never re-asks something
311
+ that already fits. [Recipe variables](repositories-variables.md#answer-the-questions) covers which
312
+ questions are asked, the question screen and the ladder; what follows is what a subscribe needs.
305
313
 
306
314
  ### Answering questions ahead of time
307
315
 
@@ -390,7 +398,11 @@ What it will and will not do:
390
398
  - It prints the plan and asks once; `--yes` accepts it, and a run with no terminal and no `--yes`
391
399
  fails naming the flag. With nothing to update it says so and asks nothing.
392
400
  - A repository a newer version needs that the project does not trust goes through the usual trust
393
- question, and new questions the newer versions ask are asked the way subscribing asks them.
401
+ question, and new questions the newer versions ask are asked the way subscribing asks them: a
402
+ default answers a variable unless its priority is `high`, and the run lists the defaults it used.
403
+ The plan's list "Questions the new versions ask that nothing answers yet" holds only the questions
404
+ the update will ask: it leaves out the ones a default answers, and optional ones of standard
405
+ priority.
394
406
  - Every recommendation the project has not answered yet is offered, as subscribing offers it
395
407
  ([Recommended recipes](#recommended-recipes)): one a newer version brings, and one an earlier run
396
408
  left pending. A declined one is not. The plan lists them, marking the ones a new version brings.
@@ -602,8 +614,8 @@ megabytes) overrides it for one run, and `--dry-run` reports what would go.
602
614
  Sous treats a run as non-interactive, and asks nothing at all, when any of these is true:
603
615
 
604
616
  - `--non-interactive` is passed (every command that works on a project accepts it);
605
- - the `CI` environment variable is set to anything but an empty value, `0`, `false`, `no` or `off`
606
- (case and surrounding spaces are ignored);
617
+ - the `CI` environment variable is set to anything but an empty value, `0` or `false` (case and
618
+ surrounding spaces are ignored);
607
619
  - stdin or stdout is not a terminal, which is what piping or scripting looks like.
608
620
 
609
621
  Such a run fails rather than guessing, naming both the question and the flag that answers it:
@@ -617,7 +629,9 @@ $ CI=true sous subscription add quality/qa-pattern
617
629
  accept the plan above without being asked.
618
630
  ```
619
631
 
620
- An unanswered variable fails the same way, naming every environment variable that answers it:
632
+ A default that fits answers a variable in such a run, and an optional variable with no default is left
633
+ unanswered. A required variable with no answer and no default fails the run the same way, naming every
634
+ environment variable that answers it:
621
635
 
622
636
  ```text
623
637
  Error: One variable still needs an answer, and there is no terminal to ask on.
@@ -407,6 +407,7 @@ variables:
407
407
  | `env` | no | The environment variable an answer binds to; omitted, it is `SOUS_VAR_` plus the upper snake case form of the variable's own name, so `qaScratchDir` binds to `SOUS_VAR_QA_SCRATCH_DIR` |
408
408
  | `required`, `secret` | no | Default to `true` and `false`; a secret is always written to the gitignored `.sous/.env.local` |
409
409
  | `scope` | no | `shared` (the committed `.sous/.env`) or `local` (the gitignored `.sous/.env.local`); defaults to `shared` |
410
+ | `priority` | no | When `sous subscription add` and `sous update` ask it: `standard` (the default) asks only when no default that fits answers it and it is required; `high` asks even when it has a default, offering it, and even when it is optional. `sous vars ask` ignores it; see [Which questions subscribing and updating ask](repositories-variables.md#which-questions-subscribing-and-updating-ask). Sous 1.4.0 or later reads it |
410
411
  | `validate` | no | `pattern`, `minLength`, `maxLength`, `min`, `max`, `enum` |
411
412
 
412
413
  At publish time: a `type: enum` variable must list its options under `validate.enum`; `minLength` cannot
@@ -110,32 +110,32 @@ sous subscription add workflow/task-files
110
110
  ```
111
111
 
112
112
  Sous states what subscribing does, asks once, resolves the whole dependency closure, downloads it,
113
- then asks the questions the recipe requires that have no answer yet. Answering the confirmation and the
114
- two questions:
113
+ then asks the questions nothing answers yet. Every variable this recipe publishes has a default and none
114
+ asks to be confirmed (`priority: high`), so each takes its default and nothing more is asked:
115
115
 
116
116
  ```text
117
- ➔ What was installed:
117
+ ▶ What was installed:
118
118
  Recipe Version Repository Why
119
119
  ----------------------------- ------- ------------ --------------------------
120
120
  workflow/sub-agent-delegation 1.0.0 the-pantry needed by workflow/task-files
121
121
  workflow/task-files 1.0.2 the-pantry you subscribed to it
122
122
 
123
- ➔ Answers stored:
124
- taskFileRoot : .sous/tasks TASK_FILE_ROOT in .env
125
- ticketIdExample : PROJ-1234 TICKET_ID_EXAMPLE in .env
126
-
127
- ➔ Left unanswered:
128
- ticketPrefix : no answer yet, and this variable is optional
129
- To answer an optional variable, run 'sous vars ask <name>'. 'sous vars ask --all' asks every
130
- variable, including the ones already answered.
123
+ ▶ Defaults used:
124
+ taskFileRoot : .sous/tasks
125
+ ticketIdExample: PROJ-1234
126
+ ticketPrefix : PROJ-
127
+ A default is not stored as an answer, so a later version of its recipe may change it. To choose
128
+ your own value, run 'sous vars ask <name>'.
131
129
  ```
132
130
 
133
- A script, a pipeline or a coding agent has no terminal to answer on, so it passes the answers in:
131
+ To choose your own values, run `sous vars ask workflow/task-files`, which asks every question the recipe
132
+ publishes. A script, a pipeline or a coding agent has no terminal to answer on; the defaults answer there
133
+ too, and it passes in any value of its own:
134
134
 
135
135
  ```bash
136
136
  sous subscription add workflow/task-files --yes \
137
- --answer taskFileRoot=.sous/tasks \
138
- --answer ticketIdExample=PROJ-1234
137
+ --answer taskFileRoot=docs/tasks \
138
+ --answer ticketIdExample=ACME-1234
139
139
  ```
140
140
 
141
141
  The answers land in `.sous/.env`, which is committed; a definition marked secret goes to the
@@ -64,8 +64,40 @@ name in its templates, does not define it, so it adds nothing to the combination
64
64
 
65
65
  ## Answer the questions
66
66
 
67
- Subscribing asks whatever is unanswered, so in normal use you rarely run `sous vars ask` yourself; reach for
68
- it after editing an env file by hand, after an upgrade tightened a constraint, or to re-answer with `--all`.
67
+ Subscribing and updating ask what a recipe needs, so in normal use you rarely run `sous vars ask` yourself;
68
+ reach for it to choose your own value for a variable a default answered, after editing an env file by hand,
69
+ after an upgrade tightened a constraint, or to re-answer with `--all`.
70
+
71
+ ### Which questions subscribing and updating ask
72
+
73
+ `sous subscription add` and `sous update` ask a variable only when nothing answers it yet and its
74
+ definition's `priority` says to:
75
+
76
+ | The variable | `priority: standard` (or none) | `priority: high` |
77
+ |--------------|--------------------------------|------------------|
78
+ | Has a default that fits | Not asked; the default is used | Asked, offering the default |
79
+ | Has no default, and is required | Asked | Asked |
80
+ | Has no default, and is optional (`required: false`) | Not asked; left unanswered | Asked; an empty answer is accepted |
81
+
82
+ A default used this way is not stored as an answer: the build reads the definition's default, so a later
83
+ version of the recipe may change it. The run lists every default it used, and how to choose your own value:
84
+
85
+ ```text
86
+ ▶ Defaults used:
87
+ taskDir : docs/tasks
88
+ reviewDir: docs/reviews
89
+ A default is not stored as an answer, so a later version of its recipe may change it. To choose your own value, run 'sous vars ask <name>'.
90
+ ```
91
+
92
+ Under `--json`, and through MCP, the same list is `defaulted: [{ variable, value }]`. When several recipes
93
+ define one name, the variable is `high` when any of their definitions says so.
94
+
95
+ `sous vars ask` itself ignores `priority`: run with no name it asks every required variable nothing answers,
96
+ offering its default, and every variable whose answer no longer fits; with a name or `--all` it asks every
97
+ variable it covers. Without a terminal,
98
+ see [Answer without a terminal](#answer-without-a-terminal).
99
+
100
+ ### What a question looks like
69
101
 
70
102
  Every trust decision is settled first: a subscribe resolves the dependency closure and runs the trust
71
103
  ceremony for each new repository before the first question prints. Questions then run one recipe at a time,
@@ -77,82 +109,55 @@ workflow/task-files needs 4 answers, and workflow/sub-agent-delegation, which it
77
109
  workflow/task-files needs 4 answers before it can be used.
78
110
  ```
79
111
 
80
- Each question prints its header, the publisher's description wrapped to your terminal, and four labeled facts:
112
+ Each question prints its header, the publisher's description wrapped to your terminal, and the facts about
113
+ the answer: the example, the recipe that asks it, the file the answer is stored in and the environment
114
+ variable it is stored as. The prompt shows the value Enter alone accepts in parentheses: the definition's
115
+ default, or the value already in scope.
81
116
 
82
117
  ```text
83
- Question 1 of 4: taskFileRoot
118
+ Question 1 of 4: taskFileRoot
84
119
 
85
- This recipe mandates the creation of task files that are stored locally and, in
86
- general, should not be committed. The default stores them in the project's .sous
87
- directory; any local path works, relative to the project root or absolute.
120
+ This recipe mandates the creation of task files that are stored locally and, in
121
+ general, should not be committed. The default stores them in the project's .sous
122
+ directory; any local path works, relative to the project root or absolute.
88
123
 
89
- default : .sous/tasks
90
- example : ~/my-task-files
91
- stored-as : SOUS_VAR_TASK_FILE_ROOT
92
- storage-path: /home/you/project/.sous/.env
124
+ Example : ~/my-task-files
125
+ Recipe : workflow/task-files
126
+ Stored in: /home/you/project/.sous/.env
127
+ Stored as: SOUS_VAR_TASK_FILE_ROOT
93
128
 
94
- ? Where should task files be stored? (.sous/tasks):
95
- ⏎ accept default • ⇥ advanced
129
+ Where should task files be stored? (.sous/tasks)
96
130
  ```
97
131
 
98
- The legend under the input line names the keys that do anything: Enter accepts what is typed, or the default
99
- when there is one; a list question names the arrow keys instead, and a yes-or-no question the two letters.
132
+ An `enum` question lists its options by number and takes the number of the one you pick; a `boolean`
133
+ question takes yes or no, with the default capitalized in `[Y/n]` or `[y/N]`. An answer that does not fit
134
+ the definition is refused with the reason, and the question is asked again.
100
135
 
101
- ### Tab opens the advanced view
102
-
103
- Tab works at every kind of question. The advanced view repeats the header and description, prints every fact
104
- about the variable through the renderer `sous vars show` uses, and offers a menu:
136
+ An answer goes to the file its definition's `scope` names: `.sous/.env`, or `.sous/.env.local` for a
137
+ machine-specific variable or a secret. `--save-locally` and `--save-shared` send every answer of a run to
138
+ one file instead. Sending a secret, or a variable the publisher declared machine-specific, to the committed
139
+ file is allowed; sous says what that means and asks you to confirm, which is informed consent rather than a
140
+ locked door:
105
141
 
106
142
  ```text
107
- [Advanced Variable Settings]
108
-
109
- Question 1 of 4: taskFileRoot
110
-
111
- default : .sous/tasks
112
- example : ~/my-task-files
113
- required-by : workflow/task-files https://example.com/owner/recipes/workflow/task-files
114
- defined-by : workflow/task-files https://example.com/owner/recipes/workflow/task-files
115
- storage-path: /home/you/project/.sous/.env
116
- stored-as : SOUS_VAR_TASK_FILE_ROOT
117
- constraints : • must be a value of the type path (type: path)
118
-
119
- ? What would you like to do?
120
- Return to value entry
121
- Change the storage file
122
- Change the stored variable name
123
- ```
124
-
125
- `required-by` names the recipe whose closure pulled this variable in, and spells out the chain when it
126
- arrived through a dependency; `defined-by` names the recipe that declares it. Both carry the location beside
127
- the recipe key, in muted grey: a repository URL, or a filesystem path for a repository on this machine.
128
-
129
- **Changing the stored variable name** offers every rung the ladder looks up, sous's choice preselected, plus
130
- a name you type; one the ladder never looks at is bound with a [mapping record](#when-names-collide-mapping-records).
131
-
132
- **Changing the storage file** offers the committed `.sous/.env` and the gitignored `.sous/.env.local`.
133
- Pointing a secret, or a variable the publisher declared machine-specific, at the committed file is allowed;
134
- sous says what that means and asks you to confirm, which is informed consent rather than a locked door:
143
+ workflow/task-files declared this variable a secret, and .sous/.env is committed to git. An answer
144
+ stored there enters your project's git history, is pushed with every clone, and is visible to everyone
145
+ who can read the repository.
135
146
 
136
- ```text
137
- workflow/task-files declared this variable a secret, and .env is committed to git. An answer stored
138
- there enters your project's git history, is pushed with every clone, and is visible to everyone who
139
- can read the repository.
140
-
141
- ? Store this answer in .env anyway? (y/N)
147
+ Store this answer in .sous/.env anyway? [y/N]
142
148
  ```
143
149
 
144
- Once anything has changed, the first menu item becomes "Save changes and return to value entry" and a
145
- "Discard changes and return to value entry" item joins it; returning prints the question again with the
146
- updated facts. When an answer is entered, two lines say what was stored and where; a secret is never printed:
150
+ When an answer is entered, two lines say what was stored and where; a secret is never printed:
147
151
 
148
152
  ```text
149
153
  Answer : SOUS_VAR_TASK_FILE_ROOT=.sous/tasks
150
154
  Saved to: /home/you/project/.sous/.env
151
155
  ```
152
156
 
153
- Every run ends with a three-part report: `Answers already in scope:`, `Answers stored:`, `Left unanswered:`.
154
- A name several recipes share is reported once, naming the recipes. When optional variables are left
155
- unanswered, the report ends with how to answer them: `sous vars ask <name>`, or `sous vars ask --all`.
157
+ Every run ends with a report in up to four parts: `Answers already in scope:`, `Answers stored:`,
158
+ `Left unanswered:` and `Defaults used:`. A name several recipes share is reported once, naming the recipes.
159
+ When optional variables are left unanswered, the report ends with how to answer them: `sous vars ask <name>`,
160
+ or `sous vars ask --all`.
156
161
 
157
162
  ## Where answers are stored
158
163
 
@@ -253,8 +258,8 @@ source `its default; no answer is stored`, because a build uses the default. `(u
253
258
  no answer and no default.
254
259
 
255
260
  `sous vars show <name>` prints one variable in full: the question, the publisher's description and example,
256
- the recipe and version that published it, the value in scope and whether it fits, the labeled facts the
257
- advanced view draws, and the ladder table above. `Stored in` names the file the value in scope came from (or
261
+ the recipe and version that published it, the value in scope and whether it fits, its default, the recipes
262
+ that require and define it, the name it is stored as and its constraints, and the ladder table above. `Stored in` names the file the value in scope came from (or
258
263
  the shell environment), and `Saved to` names the file a new answer goes to; the two differ when, say, a
259
264
  machine-specific answer was put in `.sous/.env` by hand. A default in use shows as `Value: PROJ- (default)`.
260
265
  The name may be bare, the full `namespace/recipe.name`, or an environment variable name that answers it,
@@ -276,7 +281,7 @@ lists them and asks which one, and `--accept-first` takes the first.
276
281
  | `sous vars ask --save-locally` | Stores every answer of the run in `.sous/.env.local` (gitignored, this machine only) |
277
282
  | `sous vars ask --save-shared` | Stores every answer of the run in `.sous/.env` (committed); a secret or machine-specific variable sent there needs a yes (`--yes`). It cannot be used with `--save-locally` |
278
283
  | `sous vars ask --answer <name>=<value>` | Answers one question ahead of time; repeat it for each answer |
279
- | `sous vars ask --answers-file <path>` | Reads answers from a YAML or JSON file of `name: value` pairs |
284
+ | `sous vars ask --answers-file <path>` | Reads answers from a YAML, JSON, JSONC or `.env` file of `name: value` pairs |
280
285
  | `sous vars ask --dry-run` | Reports what would be asked and written, without writing anything; with no terminal, it lists the questions it would ask instead of failing |
281
286
  | `sous vars ask --non-interactive` | Never asks; fails instead, naming the environment variable or flag that would answer each question |
282
287
 
@@ -311,7 +316,7 @@ the long way: `sous vars show ask`.
311
316
  ### Answering ahead of the questions
312
317
 
313
318
  `--answer <name>=<value>` answers a question before it is asked and repeats as often as needed, and
314
- `--answers-file <path>` reads the same pairs from YAML or JSON; an `--answer` wins over the same name in the
319
+ `--answers-file <path>` reads the same pairs from a YAML, JSON, JSONC or `.env` file; an `--answer` wins over the same name in the
315
320
  file. Pair either with `--dry-run` first, as in
316
321
  `sous vars ask --var qaScratchDir --answer qaScratchDir=/var/tmp/qa-review --dry-run`. Both work the same way
317
322
  on `sous subscription add`; see [Answer the questions](repositories-consuming.md#answer-the-questions).
@@ -331,8 +336,16 @@ one is written where that answer lives, and a value the shell supplies is never
331
336
  ## Answer without a terminal
332
337
 
333
338
  Sous never hangs waiting on a prompt it cannot show; what counts as "no terminal" is listed under
334
- [Run sous in CI, or from an agent](repositories-consuming.md#run-sous-in-ci-or-from-an-agent). Such a run
335
- fails on the unanswered required variables, naming every environment variable that would satisfy each one:
339
+ [Run sous in CI, or from an agent](repositories-consuming.md#run-sous-in-ci-or-from-an-agent). In such a run,
340
+ an unanswered variable is settled without a question:
341
+
342
+ - one with a default that fits takes that default, whatever its `priority`, as a build does, and the run
343
+ lists it under `Defaults used:`;
344
+ - an optional one with no default is left unanswered;
345
+ - a required one with no default fails the run.
346
+
347
+ A variable named on the command line, or covered by `--all`, needs an answer of its own, so its default does
348
+ not answer it. The failure names every environment variable that would satisfy each variable:
336
349
 
337
350
  ```text
338
351
  Error: 1 variable still needs an answer, and there is no terminal to ask on.
@@ -311,8 +311,9 @@ $ sous subscription add workflow/task-files
311
311
  ```
312
312
 
313
313
  **Answer the questions** the recipe publishes. A question is asked only when a subscribed recipe
314
- needs a variable and no valid answer is already in scope, and the answers land in this project's
315
- env files. See [Recipe variables](repositories-variables.md).
314
+ needs a variable, no valid answer is already in scope, and no default answers it (a recipe can mark a
315
+ variable `priority: high` to have its default confirmed), and the answers land in this project's env
316
+ files. See [Recipe variables](repositories-variables.md).
316
317
 
317
318
  **Build.** Every later build reads the pins, restores anything missing from the store, then
318
319
  compiles the recipe's files into your project's agent directories alongside your own templates:
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sous-io/sous",
3
- "version": "1.3.1",
3
+ "version": "1.4.0",
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.3.1"
42
+ "@sous-io/sous-plugin-api": "1.4.0"
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.3.1",
50
- "@sous-io/sous-plugin-authoring": "1.3.1",
51
- "@sous-io/sous-lib-core": "1.3.1",
52
- "@sous-io/sous-plugin-claude-code": "1.3.1",
53
- "@sous-io/sous-plugin-build": "1.3.1",
54
- "@sous-io/sous-plugin-cli": "1.3.1",
55
- "@sous-io/sous-plugin-config-files": "1.3.1",
56
- "@sous-io/sous-plugin-confd": "1.3.1",
57
- "@sous-io/sous-plugin-compiler": "1.3.1",
58
- "@sous-io/sous-plugin-expressions": "1.3.1",
59
- "@sous-io/sous-plugin-formats": "1.3.1",
60
- "@sous-io/sous-plugin-github": "1.3.1",
61
- "@sous-io/sous-plugin-git": "1.3.1",
62
- "@sous-io/sous-plugin-gitlab": "1.3.1",
63
- "@sous-io/sous-plugin-harnesses": "1.3.1",
64
- "@sous-io/sous-plugin-host": "1.3.1",
65
- "@sous-io/sous-plugin-init": "1.3.1",
66
- "@sous-io/sous-plugin-inspect": "1.3.1",
67
- "@sous-io/sous-plugin-local": "1.3.1",
68
- "@sous-io/sous-plugin-liquid": "1.3.1",
69
- "@sous-io/sous-plugin-mcp": "1.3.1",
70
- "@sous-io/sous-plugin-npm": "1.3.1",
71
- "@sous-io/sous-plugin-memories": "1.3.1",
72
- "@sous-io/sous-plugin-recipe-answers": "1.3.1",
73
- "@sous-io/sous-plugin-pnpm": "1.3.1",
74
- "@sous-io/sous-plugin-recipes": "1.3.1",
75
- "@sous-io/sous-plugin-refs": "1.3.1",
76
- "@sous-io/sous-plugin-update": "1.3.1",
77
- "@sous-io/sous-plugin-skills": "1.3.1",
78
- "@sous-io/sous-plugin-yarn": "1.3.1",
79
- "@sous-io/sous-plugin-variables": "1.3.1",
80
- "@sous-io/sous-plugin-handlers": "1.3.1",
81
- "@sous-io/sous-plugin-migrations": "1.3.1",
82
- "@sous-io/sous-plugin-doctor": "1.3.1",
83
- "@sous-io/sous-plugin-codex": "1.3.1",
84
- "@sous-io/sous-plugin-editor": "1.3.1"
49
+ "@sous-io/sous-lib-core": "1.4.0",
50
+ "@sous-io/sous-plugin-build": "1.4.0",
51
+ "@sous-io/sous-plugin-authoring": "1.4.0",
52
+ "@sous-io/sous-plugin-claude-code": "1.4.0",
53
+ "@sous-io/sous-lib-documents": "1.4.0",
54
+ "@sous-io/sous-plugin-cli": "1.4.0",
55
+ "@sous-io/sous-plugin-compiler": "1.4.0",
56
+ "@sous-io/sous-plugin-confd": "1.4.0",
57
+ "@sous-io/sous-plugin-config-files": "1.4.0",
58
+ "@sous-io/sous-plugin-expressions": "1.4.0",
59
+ "@sous-io/sous-plugin-formats": "1.4.0",
60
+ "@sous-io/sous-plugin-git": "1.4.0",
61
+ "@sous-io/sous-plugin-github": "1.4.0",
62
+ "@sous-io/sous-plugin-gitlab": "1.4.0",
63
+ "@sous-io/sous-plugin-harnesses": "1.4.0",
64
+ "@sous-io/sous-plugin-host": "1.4.0",
65
+ "@sous-io/sous-plugin-init": "1.4.0",
66
+ "@sous-io/sous-plugin-inspect": "1.4.0",
67
+ "@sous-io/sous-plugin-liquid": "1.4.0",
68
+ "@sous-io/sous-plugin-mcp": "1.4.0",
69
+ "@sous-io/sous-plugin-memories": "1.4.0",
70
+ "@sous-io/sous-plugin-npm": "1.4.0",
71
+ "@sous-io/sous-plugin-pnpm": "1.4.0",
72
+ "@sous-io/sous-plugin-recipe-answers": "1.4.0",
73
+ "@sous-io/sous-plugin-refs": "1.4.0",
74
+ "@sous-io/sous-plugin-skills": "1.4.0",
75
+ "@sous-io/sous-plugin-variables": "1.4.0",
76
+ "@sous-io/sous-plugin-update": "1.4.0",
77
+ "@sous-io/sous-plugin-yarn": "1.4.0",
78
+ "@sous-io/sous-plugin-local": "1.4.0",
79
+ "@sous-io/sous-plugin-handlers": "1.4.0",
80
+ "@sous-io/sous-plugin-editor": "1.4.0",
81
+ "@sous-io/sous-plugin-recipes": "1.4.0",
82
+ "@sous-io/sous-plugin-doctor": "1.4.0",
83
+ "@sous-io/sous-plugin-migrations": "1.4.0",
84
+ "@sous-io/sous-plugin-codex": "1.4.0"
85
85
  },
86
86
  "engines": {
87
87
  "node": ">=22"
@@ -154,6 +154,14 @@ The fields in that example, and the ones it leaves out:
154
154
  - Every variable MUST provide a conservative default: the answer that does the least harm when the
155
155
  project never chose one. For example, a setting for whether the agent may merge pull requests on
156
156
  its own defaults to "only when asked", never to "always".
157
+ - `priority` (`standard` when absent, or `high`) decides whether `sous subscription add` and
158
+ `sous update` ask the variable. A `standard` variable whose default fits is not asked: its default
159
+ is used, not stored, and listed under "Defaults used". A `high` variable is asked even when it has
160
+ a default (offering it) and even when it is optional. Mark a variable `high` when the subscriber
161
+ should confirm its default, for example a placeholder such as `my-team` that every project is
162
+ expected to replace. Only sous 1.4.0 or later reads `priority`, and `sous repo release` warns
163
+ about every recipe that uses it. When several recipes define one name, it is `high` if any
164
+ definition is.
157
165
  - `scope: local` stores the answer in the gitignored `.sous/.env.local`; use it for anything that
158
166
  belongs to one person or one machine. `scope: shared`, the default, stores it in the committed
159
167
  `.sous/.env`.
@@ -164,15 +172,15 @@ The fields in that example, and the ones it leaves out:
164
172
  (`reviewNotesDir` becomes `SOUS_VAR_REVIEW_NOTES_DIR`). Two definitions of different names MUST
165
173
  NOT claim the same environment variable.
166
174
  - `validate` takes `pattern`, `minLength`, `maxLength`, `min`, `max` and `enum`. Within a major
167
- version a definition MAY only loosen; tightening is a major bump, because an upgrade re-checks the
168
- answers already stored.
175
+ version a definition MAY only loosen; tightening is a major bump, because an answer a project
176
+ already stored may stop fitting, and `sous vars ask` then asks it again.
169
177
 
170
178
  A template may also read a variable another recipe defines. List that recipe under `depends`, so
171
179
  the variable is there wherever this recipe is, and MUST NOT redefine it; branch on it in the
172
180
  template rather than telling the agent to look the setting up (`about-liquid-templates` shows how).
173
181
 
174
182
  When two recipes do define one name, the project is asked one question built from the strictest
175
- combination: secret, `local` or required if any definition is, and only the values every definition
183
+ combination: secret, `local`, required or `high` priority if any definition is, and only the values every definition
176
184
  accepts. When no value can satisfy both (different types, no shared `enum` option), each recipe is
177
185
  asked separately under its recipe-scoped name.
178
186
 
@@ -12,7 +12,7 @@ formatVersion: 1
12
12
 
13
13
  namespace: core
14
14
  name: sous-skills
15
- version: 1.3.1
15
+ version: 1.4.0
16
16
 
17
17
  description: >-
18
18
  The skills that teach an agent what sous is and how it works: which files sous