@sous-io/sous 1.1.8 → 1.1.10

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.
@@ -74,7 +74,7 @@ manager that installed it, so you never need to remember which one that was or i
74
74
  no `node_modules`, counts as installing sous when its `package.json` declares it and a `.pnp.cjs`
75
75
  sits beside it or above it; the installed version is read from `yarn.lock`.
76
76
  - **After a project upgrade**, the newly installed copy runs the migrations its version brings (see
77
- [`sous doctor`](commands.md#sous-doctor)), then builds the project, so
77
+ [`sous migrate`](commands.md#sous-migrate)), then builds the project, so
78
78
  `.sous/sous.lock.json` pins the core recipe at the new version. Under Yarn Plug'n'Play, Yarn
79
79
  runs that build (`yarn run --binaries-only sous build`). `--no-build` skips it.
80
80
 
@@ -85,6 +85,9 @@ it fails with `EBADF: bad file descriptor`. Unpack it in `package.json`, then ru
85
85
  "dependenciesMeta": { "@sous-io/sous": { "unplugged": true } }
86
86
  ```
87
87
 
88
+ A copy upgraded any other way (a pull that changed `package.json`, say) runs its migrations before the first
89
+ command you give it, asking first when it can; see [`sous migrate`](commands.md#sous-migrate).
90
+
88
91
  `upgrade` always runs in the copy you invoked, never handed off to the project's own; a project copy
89
92
  may be too old to have the command. A project config this copy cannot load (one written for a newer
90
93
  sous, say) is a warning rather than a stop, since installing a newer copy may be the fix.
@@ -84,3 +84,4 @@
84
84
  - [0040: One config build per harness](adrs/0040-one-config-build-per-harness.md)
85
85
  - [0041: A target one harness's build holds reaches that harness](adrs/0041-harness-only-targets.md)
86
86
  - [0042: Retired recipes stay in the index and name their replacements](adrs/0042-retired-recipes.md)
87
+ - [0043: Every command runs the waiting migrations first](adrs/0043-migrations-before-every-command.md)
@@ -21,8 +21,12 @@ finds by walking up from the working directory.
21
21
 
22
22
  ## Flags that answer questions
23
23
 
24
- - `-y, --yes` answers yes to every confirmation the command would ask. `-f`, `--force` and, on the commands that
25
- trust a repository, `--trust` are the same flag.
24
+ - `-y, --yes` answers yes to every confirmation the command would ask, and runs any
25
+ [waiting migrations](#sous-migrate) without asking, taking each question's default. Every command takes it.
26
+ `-f`, `--force` and, on the commands that trust a repository, `--trust` are the same flag.
27
+ - `--skip-failed-migrations` skips a waiting migration that fails, or asks a question nothing answers, and runs
28
+ the command anyway. The skipped migration is not recorded as run: the next command tries it again. Every
29
+ command takes it.
26
30
  - `--non-interactive` never asks anything. A run that would have asked fails instead, naming the question and
27
31
  the flag that would have answered it.
28
32
  - `--dry-run` prints what the command would do, and writes, downloads and asks nothing.
@@ -32,7 +36,7 @@ what `--non-interactive` does; see [When sous cannot ask](repositories-consuming
32
36
 
33
37
  !> `sous clear` is the exception: without `-f` it asks even under `--non-interactive` or in CI, so pass `-f`
34
38
  whenever you script it. And `sous repo init --force` is not a confirmation; it overwrites a repository that
35
- already exists.
39
+ already exists. Its `--yes` still runs waiting migrations without asking.
36
40
 
37
41
  ## Flags that control output
38
42
 
@@ -477,14 +481,47 @@ migrations run in order and none runs until every question is answered. They do
477
481
  the last line says they wait: "Nothing failed, but 3 migrations are waiting for an answer."
478
482
 
479
483
  A migration brings a project's files in line with a newer version of sous. Each runs once for the project: the
480
- lockfile records the version of sous whose migrations the project last ran. While one is waiting, every other
481
- command prints one line saying so, and carries on.
484
+ lockfile records the version of sous whose migrations the project last ran. Every other command runs the
485
+ waiting ones first; see [`sous migrate`](#sous-migrate).
482
486
 
483
487
  ```bash
484
488
  sous doctor --dry-run
485
489
  sous doctor --yes
486
490
  ```
487
491
 
492
+ ### `sous migrate`
493
+
494
+ Runs the migrations a newer version of sous brought that this project has not run yet. Each migration's
495
+ questions are asked before any of them runs; `--answer <name>=<value>` answers one ahead of time, `--yes` takes
496
+ each question's default, and `--dry-run` lists what would run, with which answers, and changes nothing. Without
497
+ a terminal, a question nothing answers leaves every migration waiting: the command lists each question and the
498
+ `--answer` for it, and does not fail. `--skip-failed-migrations` stops without failing at a migration that fails
499
+ or cannot be answered: the migrations before it are recorded as run, and it and every one after it stay waiting,
500
+ so the next command tries them again. `sous migrations run`, its earlier name, still works.
501
+
502
+ Every other command runs the waiting migrations first, except `sous doctor` and `sous upgrade` (which run them
503
+ themselves), and `sous help`, `sous --version`, `sous completion`, `sous mcp` and `sous timings show`:
504
+
505
+ - With a terminal, it lists them and asks whether to run them, even when they ask nothing; their own questions
506
+ follow. Answering no stops the command.
507
+ - Without a terminal, they run when nothing is left to ask. When a question is left, the command stops with
508
+ "Sous was upgraded without running migrations, please run 'sous migrate' or 'sous doctor', first", with each
509
+ question and its `--answer` under it.
510
+ - With `--yes`, they run without asking, each question taking its default. A question with no default stops the
511
+ command, as above.
512
+ - A migration that fails stops the command. With `--skip-failed-migrations`, it and the migrations after it are
513
+ left waiting, with a warning, and the command runs; the next command tries them again, by these same rules.
514
+
515
+ What ran, and what was skipped, goes to standard error, so `--json` output stays clean. A tool call through
516
+ `sous mcp` has no terminal, so it follows the rules for no terminal.
517
+
518
+ ```bash
519
+ sous migrate --dry-run
520
+ sous migrate --answer claude-code.memories=keep
521
+ sous build --yes
522
+ sous build --skip-failed-migrations
523
+ ```
524
+
488
525
  ### `sous mcp`
489
526
 
490
527
  Starts an MCP server for the project, for any agent tool that speaks MCP. Its tools are the same commands the
@@ -91,8 +91,9 @@ A file Sous did not write that is already at `memoriesOutputPath` is backed up t
91
91
  with a warning, and replaced.
92
92
 
93
93
  ?> Before version 1.1.0 the recipes' memories went into the root `CLAUDE.md`. A project upgraded
94
- from then is asked once, by `sous doctor` or `sous upgrade`, whether to move them to the new file
95
- (the default) or keep them in `CLAUDE.md` (`--answer claude-code.memories=keep`).
94
+ from then is asked once, by the first command it runs (or by `sous migrate`, `sous doctor` or `sous upgrade`),
95
+ whether to move them to the new file (the default) or keep them in `CLAUDE.md`
96
+ (`sous migrate --answer claude-code.memories=keep`).
96
97
 
97
98
  A JSON config may set `"$schema"` to bind the `sous.config.schema.json` artifact shipped with
98
99
  sous for editor autocompletion; sous accepts and ignores the key.
@@ -145,7 +146,7 @@ rebuilds the config when it sees one.
145
146
 
146
147
  To write an output only under a condition, put a [config expression](#config-expressions) on the output
147
148
  itself. The output setting `_if` was removed; a config that still uses it is refused with the `$if` to write
148
- instead. `sous doctor` (and `sous upgrade`) runs a migration that rewrites it for you in a `.json`, `.jsonc` or
149
+ instead. `sous migrate` (and `sous doctor` and `sous upgrade`) runs a migration that rewrites it for you in a `.json`, `.jsonc` or
149
150
  `.yaml` config file, changing only that output; for a config written as JavaScript or TypeScript it lists each
150
151
  `_if` with its line and the expression to write. An `_if` on a variable named `env` or `host` is left for you,
151
152
  since an expression reads those names as sous's own values:
@@ -372,8 +372,10 @@ publishes something. A bump edits the manifest in place, so comments, field orde
372
372
  block of YAML prose may be re-wrapped and the space before a trailing comment collapsed to one.
373
373
 
374
374
  !> A release commits the version bumps and the index, and nothing else; the only other commit sous ever makes
375
- for you is `sous repo submit --commit`. It refuses to run while anything else is
376
- uncommitted, because a tag names one commit and the index records what each recipe folder holds right now. It also
375
+ for you is `sous repo submit --commit`. It refuses to run while a recipe folder, `sous.repo.yaml` or the index has
376
+ uncommitted changes, because a tag names one commit and the index records what each recipe folder holds right now.
377
+ Uncommitted changes to any other file (such as the project files a newer sous rewrites when it runs its
378
+ migrations in a continuous integration checkout) do not stop it, and its commit leaves them out. It also
377
379
  refuses when git does not know who is committing: set `git config user.name` and `git config user.email` first, or
378
380
  give that identity to the account a continuous integration job runs as (the scaffolded workflow already does).
379
381
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sous-io/sous",
3
- "version": "1.1.8",
3
+ "version": "1.1.10",
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.1.8"
42
+ "@sous-io/sous-plugin-api": "1.1.10"
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-core": "1.1.8",
50
- "@sous-io/sous-lib-documents": "1.1.8",
51
- "@sous-io/sous-plugin-build": "1.1.8",
52
- "@sous-io/sous-plugin-claude-code": "1.1.8",
53
- "@sous-io/sous-plugin-authoring": "1.1.8",
54
- "@sous-io/sous-plugin-cli": "1.1.8",
55
- "@sous-io/sous-plugin-config-files": "1.1.8",
56
- "@sous-io/sous-plugin-compiler": "1.1.8",
57
- "@sous-io/sous-plugin-confd": "1.1.8",
58
- "@sous-io/sous-plugin-expressions": "1.1.8",
59
- "@sous-io/sous-plugin-formats": "1.1.8",
60
- "@sous-io/sous-plugin-github": "1.1.8",
61
- "@sous-io/sous-plugin-git": "1.1.8",
62
- "@sous-io/sous-plugin-gitlab": "1.1.8",
63
- "@sous-io/sous-plugin-host": "1.1.8",
64
- "@sous-io/sous-plugin-init": "1.1.8",
65
- "@sous-io/sous-plugin-harnesses": "1.1.8",
66
- "@sous-io/sous-plugin-inspect": "1.1.8",
67
- "@sous-io/sous-plugin-liquid": "1.1.8",
68
- "@sous-io/sous-plugin-local": "1.1.8",
69
- "@sous-io/sous-plugin-mcp": "1.1.8",
70
- "@sous-io/sous-plugin-memories": "1.1.8",
71
- "@sous-io/sous-plugin-npm": "1.1.8",
72
- "@sous-io/sous-plugin-pnpm": "1.1.8",
73
- "@sous-io/sous-plugin-recipe-answers": "1.1.8",
74
- "@sous-io/sous-plugin-refs": "1.1.8",
75
- "@sous-io/sous-plugin-skills": "1.1.8",
76
- "@sous-io/sous-plugin-update": "1.1.8",
77
- "@sous-io/sous-plugin-recipes": "1.1.8",
78
- "@sous-io/sous-plugin-variables": "1.1.8",
79
- "@sous-io/sous-plugin-handlers": "1.1.8",
80
- "@sous-io/sous-plugin-yarn": "1.1.8",
81
- "@sous-io/sous-plugin-editor": "1.1.8",
82
- "@sous-io/sous-plugin-doctor": "1.1.8",
83
- "@sous-io/sous-plugin-migrations": "1.1.8",
84
- "@sous-io/sous-plugin-codex": "1.1.8"
49
+ "@sous-io/sous-lib-core": "1.1.10",
50
+ "@sous-io/sous-lib-documents": "1.1.10",
51
+ "@sous-io/sous-plugin-authoring": "1.1.10",
52
+ "@sous-io/sous-plugin-claude-code": "1.1.10",
53
+ "@sous-io/sous-plugin-build": "1.1.10",
54
+ "@sous-io/sous-plugin-cli": "1.1.10",
55
+ "@sous-io/sous-plugin-confd": "1.1.10",
56
+ "@sous-io/sous-plugin-compiler": "1.1.10",
57
+ "@sous-io/sous-plugin-config-files": "1.1.10",
58
+ "@sous-io/sous-plugin-expressions": "1.1.10",
59
+ "@sous-io/sous-plugin-git": "1.1.10",
60
+ "@sous-io/sous-plugin-formats": "1.1.10",
61
+ "@sous-io/sous-plugin-gitlab": "1.1.10",
62
+ "@sous-io/sous-plugin-init": "1.1.10",
63
+ "@sous-io/sous-plugin-github": "1.1.10",
64
+ "@sous-io/sous-plugin-inspect": "1.1.10",
65
+ "@sous-io/sous-plugin-local": "1.1.10",
66
+ "@sous-io/sous-plugin-mcp": "1.1.10",
67
+ "@sous-io/sous-plugin-harnesses": "1.1.10",
68
+ "@sous-io/sous-plugin-memories": "1.1.10",
69
+ "@sous-io/sous-plugin-liquid": "1.1.10",
70
+ "@sous-io/sous-plugin-host": "1.1.10",
71
+ "@sous-io/sous-plugin-recipe-answers": "1.1.10",
72
+ "@sous-io/sous-plugin-npm": "1.1.10",
73
+ "@sous-io/sous-plugin-recipes": "1.1.10",
74
+ "@sous-io/sous-plugin-refs": "1.1.10",
75
+ "@sous-io/sous-plugin-pnpm": "1.1.10",
76
+ "@sous-io/sous-plugin-variables": "1.1.10",
77
+ "@sous-io/sous-plugin-yarn": "1.1.10",
78
+ "@sous-io/sous-plugin-skills": "1.1.10",
79
+ "@sous-io/sous-plugin-update": "1.1.10",
80
+ "@sous-io/sous-plugin-doctor": "1.1.10",
81
+ "@sous-io/sous-plugin-handlers": "1.1.10",
82
+ "@sous-io/sous-plugin-codex": "1.1.10",
83
+ "@sous-io/sous-plugin-editor": "1.1.10",
84
+ "@sous-io/sous-plugin-migrations": "1.1.10"
85
85
  },
86
86
  "engines": {
87
87
  "node": ">=22"
@@ -3,8 +3,9 @@ name: about-sous
3
3
  description: >
4
4
  YOU MUST load this skill when you cannot edit a file in this project, are asked why
5
5
  a file keeps reverting, want to change a skill, memory or other file that came from a
6
- recipe, need to know where the source of truth for any managed file lives, or need to
7
- understand what this project's configuration system is.
6
+ recipe, need to know where the source of truth for any managed file lives, need to
7
+ understand what this project's configuration system is, or a sous command fails because
8
+ migrations have not run.
8
9
  user-invocable: false
9
10
  ---
10
11
 
@@ -125,6 +126,16 @@ require plugins from npm; `sous subscription add` refuses it while one is missin
125
126
  its version range, and offers to install it. Run `sous plugins show` to list every loaded plugin
126
127
  and what it added.
127
128
 
129
+ ## Migrations After an Upgrade
130
+
131
+ A newer sous may bring migrations: steps that bring the project's files in line with it. Every
132
+ command runs the waiting ones first. Without a terminal (as when an agent runs sous), a
133
+ migration that asks a question stops the command with "Sous was upgraded without running
134
+ migrations, please run 'sous migrate' or 'sous doctor', first", listing each question. Run
135
+ `sous migrate --dry-run` to see what would run, ask the user each listed question, then run
136
+ `sous migrate --answer <name>=<value>` with their answers. `--yes` takes every default without
137
+ asking the user; use it only when the user agrees to the defaults.
138
+
128
139
  ## Sous's Own Documentation
129
140
 
130
141
  Sous's full documentation ships inside the installed package as plain markdown
@@ -103,8 +103,10 @@ the next release that publishes a version.
103
103
 
104
104
  ## Releasing
105
105
 
106
- `sous repo release` publishes. It refuses to run while anything is uncommitted, or while git
107
- cannot say who is committing. In one run it:
106
+ `sous repo release` publishes. It refuses to run while a recipe folder, the repository manifest or
107
+ the index has uncommitted changes, or while git cannot say who is committing. Uncommitted changes
108
+ to other files (a project file a sous migration rewrote, for example) do not stop it, and its
109
+ commit leaves them out. In one run it:
108
110
 
109
111
  1. validates every manifest;
110
112
  2. finds the recipes whose files changed since the tag that last published them (a recipe never
@@ -11,7 +11,7 @@ formatVersion: 1
11
11
 
12
12
  namespace: core
13
13
  name: sous-skills
14
- version: 1.1.8
14
+ version: 1.1.10
15
15
 
16
16
  description: >-
17
17
  The skills that teach an agent what sous is and how it works: which files sous