@turri-dev/cli 0.2.4-next.240620d → 0.2.4-next.359b847

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.
Files changed (134) hide show
  1. package/README.md +6 -7
  2. package/dist/bedrock-region.js +3 -3
  3. package/dist/chat-models.d.ts +1 -1
  4. package/dist/chat-models.js +1 -1
  5. package/dist/chat-scope.d.ts +1 -3
  6. package/dist/chat-skills.d.ts +1 -1
  7. package/dist/chat-skills.js +1 -1
  8. package/dist/chats.d.ts +44 -10
  9. package/dist/chats.js +125 -41
  10. package/dist/cli.js +10 -26
  11. package/dist/config-edit.d.ts +20 -8
  12. package/dist/config-edit.js +32 -24
  13. package/dist/config.d.ts +101 -58
  14. package/dist/config.js +265 -118
  15. package/dist/conform-cli.js +14 -3
  16. package/dist/conformance-switch.d.ts +7 -6
  17. package/dist/conformance-switch.js +19 -16
  18. package/dist/extension.d.ts +29 -3
  19. package/dist/extension.js +375 -351
  20. package/dist/genome.js +5 -1
  21. package/dist/host-session.d.ts +8 -7
  22. package/dist/host-session.js +4 -4
  23. package/dist/host.d.ts +3 -1
  24. package/dist/host.js +3 -3
  25. package/dist/identity.js +2 -2
  26. package/dist/init-config.d.ts +1 -1
  27. package/dist/init-config.js +8 -8
  28. package/dist/launch-agent.d.ts +51 -0
  29. package/dist/launch-agent.js +267 -0
  30. package/dist/{release-cli.js → launch-cli.js} +41 -24
  31. package/dist/launch-session.d.ts +68 -0
  32. package/dist/launch-session.js +217 -0
  33. package/dist/launch-tools.d.ts +28 -0
  34. package/dist/launch-tools.js +69 -0
  35. package/dist/launch-track.d.ts +125 -0
  36. package/dist/launch-track.js +320 -0
  37. package/dist/loop-cli.js +4 -4
  38. package/dist/loop-tools.d.ts +45 -21
  39. package/dist/loop-tools.js +152 -82
  40. package/dist/notice.d.ts +7 -6
  41. package/dist/parse-cli.js +2 -2
  42. package/dist/pi-launch.js +3 -0
  43. package/dist/pi-settings.d.ts +4 -0
  44. package/dist/pi-settings.js +39 -0
  45. package/dist/pi.js +6 -3
  46. package/dist/plain/check.d.ts +1 -1
  47. package/dist/plain/check.js +3 -1
  48. package/dist/plain-files.d.ts +2 -2
  49. package/dist/plain-files.js +7 -7
  50. package/dist/regenerate/agent-env.d.ts +1 -1
  51. package/dist/regenerate/agent-env.js +3 -3
  52. package/dist/regenerate/agent-shell.js +5 -3
  53. package/dist/regenerate/audit.js +9 -0
  54. package/dist/regenerate/base-folder.d.ts +2 -2
  55. package/dist/regenerate/base-folder.js +1 -1
  56. package/dist/regenerate/cases.js +7 -0
  57. package/dist/regenerate/chunk-plan.d.ts +5 -0
  58. package/dist/regenerate/chunk-plan.js +16 -1
  59. package/dist/regenerate/command-check.d.ts +7 -1
  60. package/dist/regenerate/command-check.js +43 -1
  61. package/dist/regenerate/delivery.d.ts +1 -1
  62. package/dist/regenerate/delivery.js +3 -3
  63. package/dist/regenerate/drift.d.ts +4 -0
  64. package/dist/regenerate/drift.js +26 -6
  65. package/dist/regenerate/job-panel.js +3 -1
  66. package/dist/regenerate/jobs.d.ts +2 -2
  67. package/dist/regenerate/jobs.js +10 -10
  68. package/dist/regenerate/launch.d.ts +154 -0
  69. package/dist/regenerate/{release.js → launch.js} +195 -51
  70. package/dist/regenerate/ledger.d.ts +33 -2
  71. package/dist/regenerate/lineage.d.ts +2 -0
  72. package/dist/regenerate/lineage.js +8 -0
  73. package/dist/regenerate/loop.d.ts +30 -10
  74. package/dist/regenerate/loop.js +166 -59
  75. package/dist/regenerate/model-names.d.ts +33 -0
  76. package/dist/regenerate/{engine.js → model-names.js} +2 -28
  77. package/dist/regenerate/paths.d.ts +3 -3
  78. package/dist/regenerate/paths.js +4 -4
  79. package/dist/regenerate/records.d.ts +11 -0
  80. package/dist/regenerate/records.js +15 -0
  81. package/dist/regenerate/regenerate.js +4 -1
  82. package/dist/regenerate/renames.js +4 -4
  83. package/dist/regenerate/requires.d.ts +7 -0
  84. package/dist/regenerate/requires.js +24 -18
  85. package/dist/regenerate/scripts-being-written.d.ts +4 -4
  86. package/dist/regenerate/scripts-being-written.js +3 -3
  87. package/dist/regenerate/spec-map.js +3 -3
  88. package/dist/regenerate/submit-work.d.ts +2 -0
  89. package/dist/regenerate/submit-work.js +8 -3
  90. package/dist/regenerate/test-scripts.d.ts +2 -1
  91. package/dist/regenerate/test-scripts.js +33 -23
  92. package/dist/regenerate/testing-steps.d.ts +6 -6
  93. package/dist/regenerate/testing-steps.js +8 -8
  94. package/dist/regenerate-cli.js +1 -1
  95. package/dist/self-invocation.d.ts +11 -0
  96. package/dist/self-invocation.js +36 -7
  97. package/dist/sentinel-check.d.ts +3 -3
  98. package/dist/sentinel-check.js +3 -3
  99. package/dist/sentinel.d.ts +18 -12
  100. package/dist/sentinel.js +72 -43
  101. package/dist/{config-command.d.ts → settings.d.ts} +13 -8
  102. package/dist/{config-command.js → settings.js} +155 -24
  103. package/dist/setup.d.ts +2 -2
  104. package/dist/setup.js +7 -7
  105. package/dist/turri-versions.js +2 -1
  106. package/docs/README.md +4 -4
  107. package/docs/chats.md +5 -6
  108. package/docs/claude-subscription.md +2 -2
  109. package/docs/config.md +58 -46
  110. package/docs/development.md +2 -2
  111. package/docs/headless.md +4 -4
  112. package/docs/hosting.md +20 -19
  113. package/docs/launch.md +67 -0
  114. package/docs/parser.md +2 -2
  115. package/docs/regenerating.md +21 -15
  116. package/docs/sandbox.md +3 -3
  117. package/docs/sentinel.md +26 -14
  118. package/docs/skills-and-gates.md +4 -4
  119. package/docs/using.md +19 -28
  120. package/genome/rules/project-model.md +2 -1
  121. package/genome/rules/turri-regeneration.md +5 -3
  122. package/genome/skills/implement-conformance-testing-script/SKILL.md +2 -2
  123. package/genome/skills/implement-unit-testing-script/SKILL.md +3 -3
  124. package/package.json +1 -1
  125. package/dist/regenerate/engine.d.ts +0 -52
  126. package/dist/regenerate/release.d.ts +0 -121
  127. package/dist/release-agent.d.ts +0 -43
  128. package/dist/release-agent.js +0 -130
  129. package/dist/release-tools.d.ts +0 -44
  130. package/dist/release-tools.js +0 -170
  131. package/dist/stacks.d.ts +0 -13
  132. package/dist/stacks.js +0 -96
  133. package/docs/deploy.md +0 -48
  134. /package/dist/{release-cli.d.ts → launch-cli.d.ts} +0 -0
@@ -1,5 +1,5 @@
1
1
  /**
2
- * `/turri-config`'s side of config.turri.yaml: every setting turri reads, what it takes - a yes or no, one of a few words, a
2
+ * `/settings`' and the chat's settings tool's side of config.turri.yaml: every setting turri reads, what it takes - a yes or no, one of a few words, a
3
3
  * number, a model, a list - and when a change to it takes effect, so the person knows whether to wait for the next
4
4
  * pulse or not at all. A change is written into the file line by line, its comments and the commented-out examples
5
5
  * kept; `models:` and `agent-env:`, which nest, are written again whole, their own comments lost.
@@ -20,14 +20,20 @@ export interface Setting {
20
20
  options?: string[];
21
21
  /** The least a number may be. */
22
22
  min?: number;
23
- /** Set in the project's config.turri.yaml only: a stack's file does not change it. */
23
+ /** Set in the project's config.turri.yaml only: a module's config.turri.<module>.yaml does not change it. */
24
24
  projectOnly?: boolean;
25
+ /**
26
+ * Changed by the person alone, with /settings: the chat's settings tool refuses it. What it decides is theirs - turning
27
+ * conformance tests on doubles each change - or it widens what the agents reach (credentials, folders past the
28
+ * sandbox), or it is a check on the chat's own work (the sentinel, the ***plain rules, the ledger).
29
+ */
30
+ personOnly?: boolean;
25
31
  }
26
32
  /** What each effect is, said to the person. */
27
33
  export declare const EFFECT_TEXT: Record<Effect, string>;
28
34
  /** Every setting, in the order the list shows them. */
29
35
  export declare function settings(rules?: string[]): Setting[];
30
- /** Every setting, as a host is given them: rules-off offering turri's own rules, as /turri-config offers them. */
36
+ /** Every setting, as a host is given them: rules-off offering turri's own rules, as /settings offers them. */
31
37
  export declare function configSettings(): Setting[];
32
38
  /** A setting by its key - `review`, `models.coding` - or nothing. */
33
39
  export declare function settingOf(key: string, rules?: string[]): Setting | undefined;
@@ -58,13 +64,19 @@ export declare function currentValue(text: string, key: string): unknown;
58
64
  export declare function shownValue(value: unknown): string;
59
65
  /** The project's config.turri.yaml - or the config.yaml it is read from until it has one - its text, empty when there is neither. */
60
66
  export declare function readConfigText(dir: string): string;
61
- /** What a change does beside setting the value: the files and settings that win over it, said to the person. */
62
- export declare function overriddenBy(dir: string, text: string, setting: Setting): string[];
63
67
  /**
64
- * Write a setting into the project's config.turri.yaml - made when it is not there, from config.yaml and each stack's
65
- * file in the old naming when they are what the project is read from - and give back the file as written.
68
+ * What a change does beside setting the value: the files and settings that win over it, said to the person. `module`:
69
+ * written into that module's own file - the project's file is the one it wins over, and nothing over it is said.
66
70
  */
67
- export declare function writeSetting(dir: string, key: string, value: unknown): string;
71
+ export declare function overriddenBy(dir: string, text: string, setting: Setting, module?: string): string[];
72
+ /**
73
+ * Write a setting into the project's config.turri.yaml - or, with `module`, that module's config.turri.<module>.yaml -
74
+ * made when it is not there, from config.yaml and each module's file in the old naming when they are what the project
75
+ * is read from - and give back the file as written.
76
+ */
77
+ export declare function writeSetting(dir: string, key: string, value: unknown, module?: string): string;
78
+ /** A module's own config.turri.<module>.yaml - or the config.<module>.yaml it is read from until the project has turri's files - its text, empty when there is none. */
79
+ export declare function readModuleConfigText(dir: string, module: string): string;
68
80
  /** The files a path setting is offered: the testing scripts in the root and test_scripts/, the .plain files of the folder, or - the test folder - its folders. */
69
81
  export declare function pathOptions(dir: string, key: string): string[];
70
82
  /** The dotenv files of the project root, for agent-env.files. */
@@ -3,7 +3,7 @@ import { join } from "node:path";
3
3
  import { dump as dumpYaml, load as loadYaml } from "js-yaml";
4
4
  import { PACKAGE_ROOT } from "./environment.js";
5
5
  import { loadRules } from "./rules.js";
6
- import { adoptLegacyConfig, AGENT_ROLES, CONFIG_FILE, chosenStack, projectConfigFile, stackConfigFileIn, stacksOf, splitModelSpec, THINKING_LEVELS } from "./config.js";
6
+ import { adoptLegacyConfig, AGENT_ROLES, CONFIG_FILE, moduleConfigFile, moduleConfigFileIn, moduleConfigsOf, projectConfigFile, splitModelSpec, THINKING_LEVELS } from "./config.js";
7
7
  /** What each effect is, said to the person. */
8
8
  export const EFFECT_TEXT = {
9
9
  now: "in effect now",
@@ -20,10 +20,10 @@ const SECONDS = ["0", "60", "120", "180", "300"];
20
20
  const ROLE_ABOUT = {
21
21
  default: "every role not named",
22
22
  chat: "the conversation - as harness-model, which it wins over",
23
- sentinel: "the sentinel: checks every finished pulse and tests the release",
23
+ sentinel: "the sentinel: checks every finished pulse and tests what is launched",
24
24
  planner: "cuts the work into pulses",
25
25
  diagnosis: "looks into a pulse that failed for good",
26
- release: "the release agent",
26
+ launch: "the launch agent",
27
27
  coding: "writes the code - as coding-model, which it wins over",
28
28
  conformance: "writes the conformance tests",
29
29
  explorer: "explores the code for a conformance run",
@@ -62,9 +62,9 @@ export function settings(rules = []) {
62
62
  { key: "review", about: "whether the code and its tests are reviewed once they pass", kind: "boolean", unset: "true", effect: "next-pulse" },
63
63
  { key: "mutation-testing", about: "whether the coding agent and the reviewer can put a bug in the code for one test run (can_it_fail)", kind: "boolean", unset: "true", effect: "next-pulse" },
64
64
  { key: "allow-to-stop-jobs", about: "whether turri stops a running pulse the ***plain has moved on from", kind: "boolean", unset: "true", effect: "now" },
65
- { key: "release-after-pulse", about: "whether every pulse that lands code releases it", kind: "boolean", unset: "false", effect: "next-landing" },
66
- { key: "sentinel", about: "whether a chat of its own checks every finished pulse, tests the release, and tells you what is wrong - ask: you are asked before it first opens", kind: "choice", options: ["ask", "true", "false"], unset: "ask", effect: "next-landing" },
67
- { key: "conformance-tests", about: "whether functional specs' scenarios are written and conformance tested - false: none, and the chat's conform refused", kind: "boolean", unset: "false", effect: "now" },
65
+ { key: "launch-after-pulse", about: "whether every pulse that lands code is launched, in the background", kind: "boolean", unset: "false", effect: "next-landing" },
66
+ { key: "sentinel", about: "whether a chat of its own checks every finished pulse, tests what is launched, and tells you what is wrong - ask: you are asked before it first opens", kind: "choice", options: ["ask", "true", "false"], unset: "ask", effect: "next-landing", personOnly: true },
67
+ { key: "conformance-tests", about: "whether functional specs' scenarios are written and conformance tested - false: none, and the chat's conform refused", kind: "boolean", unset: "false", effect: "now", personOnly: true },
68
68
  { key: "test-dir", about: "the folder of the test plain files, a folder per module in it, by path from the project root", kind: "path", unset: "tests", effect: "now" },
69
69
  { key: "base-folder", about: "a folder a codebase that requires no other module starts from, by path from the project root - code to build on, files to use, copied in once", kind: "path", unset: "none: it starts empty", effect: "next-pulse" },
70
70
  { key: "unittests-script", about: "the unit testing script, by path from the project root", kind: "path", unset: "the one run_unittests*.sh found", effect: "next-test-run" },
@@ -76,17 +76,17 @@ export function settings(rules = []) {
76
76
  { key: "max-lines-per-pulse", about: "the most lines of ***plain in one pulse before a group is split", kind: "number", options: ["60", "120", "200", "300"], min: 1, unset: "120", effect: "next-plan" },
77
77
  { key: "turn-limit", about: "seconds each agent turn has, for every role without its own - 0 for none", kind: "number", options: SECONDS, min: 0, unset: "120", effect: "next-pulse" },
78
78
  { key: "compact-at", about: "tokens of work an agent holds before it is compacted between turns", kind: "number", options: ["50000", "100000", "150000", "200000"], min: 1000, unset: "100000", effect: "next-pulse", projectOnly: true },
79
- { key: "rules-off", about: "***plain rules left out of the prompts of the agents that write ***plain", kind: "list", options: rules, unset: "none", effect: "next-message", projectOnly: true },
80
- { key: "agent-env.files", about: "dotenv files whose variables the agents' commands get", kind: "list", unset: "none", effect: "next-pulse", projectOnly: true },
81
- { key: "agent-env.vars", about: "variables from turri's environment the agents' commands get, by name", kind: "list", unset: "none", effect: "next-pulse", projectOnly: true },
82
- { key: "toolchains", about: "folders of this machine an agent's commands may read beside the usual ones", kind: "list", unset: "none", effect: "next-pulse", projectOnly: true },
79
+ { key: "rules-off", about: "***plain rules left out of the prompts of the agents that write ***plain", kind: "list", options: rules, unset: "none", effect: "next-message", projectOnly: true, personOnly: true },
80
+ { key: "agent-env.files", about: "dotenv files whose variables the agents' commands get", kind: "list", unset: "none", effect: "next-pulse", projectOnly: true, personOnly: true },
81
+ { key: "agent-env.vars", about: "variables from turri's environment the agents' commands get, by name", kind: "list", unset: "none", effect: "next-pulse", projectOnly: true, personOnly: true },
82
+ { key: "toolchains", about: "folders of this machine an agent's commands may read beside the usual ones", kind: "list", unset: "none", effect: "next-pulse", projectOnly: true, personOnly: true },
83
83
  { key: "debug", about: "whether turri keeps what it writes for debugging it - agents' logs and sessions, pulse logs, outputs", kind: "boolean", unset: "false", effect: "next-pulse", projectOnly: true },
84
84
  { key: "cache-keep", about: "megabytes of package caches the project keeps; 0 keeps none", kind: "number", options: ["0", "1024", "4096", "16384"], min: 0, unset: "4096", effect: "next-start", projectOnly: true },
85
- { key: "ledger-keep", about: "megabytes of the ledger - what turri did, as facts - the project keeps; 0 keeps none", kind: "number", options: ["0", "50", "100", "500"], min: 0, unset: "100", effect: "next-start", projectOnly: true },
85
+ { key: "ledger-keep", about: "megabytes of the ledger - what turri did, as facts - the project keeps; 0 keeps none", kind: "number", options: ["0", "50", "100", "500"], min: 0, unset: "100", effect: "next-start", projectOnly: true, personOnly: true },
86
86
  ...roles,
87
87
  ];
88
88
  }
89
- /** Every setting, as a host is given them: rules-off offering turri's own rules, as /turri-config offers them. */
89
+ /** Every setting, as a host is given them: rules-off offering turri's own rules, as /settings offers them. */
90
90
  export function configSettings() {
91
91
  return settings(loadRules(join(PACKAGE_ROOT, "genome", "rules")).map((rule) => rule.name));
92
92
  }
@@ -307,21 +307,24 @@ export function readConfigText(dir) {
307
307
  const path = join(dir, projectConfigFile(dir));
308
308
  return existsSync(path) ? readFileSync(path, "utf8") : "";
309
309
  }
310
- /** What a change does beside setting the value: the files and settings that win over it, said to the person. */
311
- export function overriddenBy(dir, text, setting) {
310
+ /**
311
+ * What a change does beside setting the value: the files and settings that win over it, said to the person. `module`:
312
+ * written into that module's own file - the project's file is the one it wins over, and nothing over it is said.
313
+ */
314
+ export function overriddenBy(dir, text, setting, module) {
312
315
  const notes = [];
313
316
  const wins = { "harness-model": "models.chat", "coding-model": "models.coding", "judge-model": "models.judge" };
314
317
  const over = wins[setting.key];
315
318
  if (over !== undefined && currentValue(text, over) !== undefined)
316
- notes.push(`${over} is set too, and wins over ${setting.key} - change it with /turri-config ${over}.`);
317
- if (setting.projectOnly === true)
319
+ notes.push(`${over} is set too, and wins over ${setting.key} - change it with /settings ${over}.`);
320
+ if (setting.projectOnly === true || module !== undefined)
318
321
  return notes;
319
322
  const top = setting.key.split(".")[0];
320
- for (const stack of stacksOf(dir)) {
321
- const file = stackConfigFileIn(dir, stack);
323
+ for (const each of moduleConfigsOf(dir)) {
324
+ const file = moduleConfigFileIn(dir, each);
322
325
  const own = loadMapping(safeRead(join(dir, file)))[top];
323
326
  if (own !== undefined)
324
- notes.push(`${file} sets ${top} too, and wins while the stack ${stack} is chosen${chosenStack() === stack ? " - as it is now" : ""}.`);
327
+ notes.push(`${file} sets ${top} too, and wins for ${each}.plain and the modules built on it.`);
325
328
  }
326
329
  return notes;
327
330
  }
@@ -334,15 +337,20 @@ function safeRead(path) {
334
337
  }
335
338
  }
336
339
  /**
337
- * Write a setting into the project's config.turri.yaml - made when it is not there, from config.yaml and each stack's
338
- * file in the old naming when they are what the project is read from - and give back the file as written.
340
+ * Write a setting into the project's config.turri.yaml - or, with `module`, that module's config.turri.<module>.yaml -
341
+ * made when it is not there, from config.yaml and each module's file in the old naming when they are what the project
342
+ * is read from - and give back the file as written.
339
343
  */
340
- export function writeSetting(dir, key, value) {
344
+ export function writeSetting(dir, key, value, module) {
341
345
  adoptLegacyConfig(dir);
342
- const text = withSetting(readConfigText(dir), key, value);
343
- writeFileSync(join(dir, CONFIG_FILE), text);
346
+ const text = withSetting(module !== undefined ? safeRead(join(dir, moduleConfigFile(module))) : readConfigText(dir), key, value);
347
+ writeFileSync(join(dir, module !== undefined ? moduleConfigFile(module) : CONFIG_FILE), text);
344
348
  return text;
345
349
  }
350
+ /** A module's own config.turri.<module>.yaml - or the config.<module>.yaml it is read from until the project has turri's files - its text, empty when there is none. */
351
+ export function readModuleConfigText(dir, module) {
352
+ return safeRead(join(dir, moduleConfigFileIn(dir, module)));
353
+ }
346
354
  /** The files a path setting is offered: the testing scripts in the root and test_scripts/, the .plain files of the folder, or - the test folder - its folders. */
347
355
  export function pathOptions(dir, key) {
348
356
  const list = (folder, test) => {
package/dist/config.d.ts CHANGED
@@ -19,8 +19,8 @@
19
19
  * review: false # review the code and its tests once they pass (default: true)
20
20
  * mutation-testing: false # give the coding agent and the reviewer can_it_fail (default: true)
21
21
  * allow-to-stop-jobs: false # stop a running job the spec moved on from (default: true)
22
- * release-after-pulse: true # release what each pulse lands, as its last stage, before the next pulse (default: false)
23
- * sentinel: true # a chat of its own every finished pulse goes to, which tests the release and tells you what is wrong: true, false, or ask - the person asked before it first opens in a session (default: ask)
22
+ * launch-after-pulse: true # launch what each pulse lands, in the background, the newest commit winning (default: false)
23
+ * sentinel: true # a chat of its own every finished pulse goes to, which tests what is launched and tells you what is wrong: true, false, or ask - the person asked before it first opens in a session (default: ask)
24
24
  * rules-off: [integrations] # ***plain rules to leave out of the prompts, by name (default: none)
25
25
  * unittests-script: test_scripts/run_unittests.sh # the testing scripts - see test-scripts.ts
26
26
  * conformance-tests-script: test_scripts/run_conformance_tests.sh
@@ -43,79 +43,93 @@
43
43
  * either of which may be left out; a bare string is the model alone. What a model leaves out it takes
44
44
  * from the one it inherits: judge-model from coding-model, coding-model from harness-model. They are
45
45
  * defaults: `--harness-model` / `--coding-model` / `--judge-model` on the command line win over them,
46
- * and so does a model chosen during the conversation (pi's /model, engine). `model:` is read
46
+ * and so does a model chosen during the conversation (pi's /model) or named on a call. `model:` is read
47
47
  * as `coding-model`, which it was before there were two.
48
48
  *
49
49
  * Keys are written with dashes; underscores are read the same (`conformance_tests`). Keys it
50
50
  * does not know - another tool's `config.yaml`, read while it is the old file, may carry several - are ignored, and so is a value of
51
51
  * the wrong type. Everything is optional, and what is given on the command line wins.
52
52
  *
53
- * A project whose parts do not share a stack - a Python backend and a React frontend beside each other - keeps a
54
- * stack's own settings in `config.turri.<stack>.yaml` beside `config.turri.yaml`: `config.turri.backend.yaml` for the
55
- * stack `backend` - its testing scripts, its toolchains. A stack is chosen, never worked out: `/stack` in the chat,
56
- * `--stack <name>` (or `TURRI_STACK`) on the command line. With one chosen, everything turri builds from then on is
57
- * built with `config.turri.yaml` and the stack's file over it, key by key - a model it names takes what it leaves out
58
- * from the project's - and a pulse already running keeps the stack it started with. With none, `config.turri.yaml`
59
- * alone. `module:` and `harness-model:` are the project's alone - there is one conversation - and are not read from a
60
- * stack's file.
53
+ * A module can have settings of its own in `config.turri.<module>.yaml` beside `config.turri.yaml`:
54
+ * `config.turri.backend.yaml` for `backend.plain` - its testing scripts, its toolchains, its models - laid over
55
+ * `config.turri.yaml` key by key, a model it names taking what it leaves out from the project's. A module with no file
56
+ * of its own takes the one of a module it requires - `config.turri.backend.yaml` builds `backend_auth.plain`, which
57
+ * requires `backend.plain` - and two among the modules it requires is an error (`configModuleFor`). Nobody chooses it:
58
+ * it is worked out from the module, and a pulse keeps the one it started with. `module:`, `harness-model:` and the
59
+ * other settings of the whole project are read from `config.turri.yaml` alone.
61
60
  */
62
61
  /** turri's settings for a project, in a file of its own: a `config.yaml` beside it may be another tool's. */
63
62
  export declare const CONFIG_FILE = "config.turri.yaml";
64
63
  /**
65
64
  * Where turri's settings were before they had a file of their own. A project with no `config.turri*.yaml` yet is read
66
- * from it - and a `config.<name>.yaml` beside it as the stack `<name>` - and turri never writes it: the first setting
65
+ * from it - and a `config.<name>.yaml` beside it as the module `<name>`'s - and turri never writes it: the first setting
67
66
  * turri writes copies them to the new names (`adoptLegacyConfig`), and from then on the old files are not read.
68
67
  */
69
68
  export declare const LEGACY_CONFIG_FILE = "config.yaml";
70
- /** A stack's config file's name: `config.turri.backend.yaml` for the stack `backend`. */
71
- export declare function stackConfigFile(stack: string): string;
72
- /** Whether a folder's settings are still in the old files: a config.yaml or a config.<stack>.yaml, and no config.turri*.yaml. */
69
+ /** A module's config file's name: `config.turri.backend.yaml` for `backend.plain`. */
70
+ export declare function moduleConfigFile(module: string): string;
71
+ /** Whether a folder's settings are still in the old files: a config.yaml or a config.<module>.yaml, and no config.turri*.yaml. */
73
72
  export declare function usesLegacyConfig(root: string): boolean;
74
73
  /** The file the project's settings are read from, by name: config.turri.yaml, or config.yaml while the folder has only the old files. */
75
74
  export declare function projectConfigFile(root: string): string;
76
- /** The file a stack's settings are read from, by name - the old name while the folder has only the old files. */
77
- export declare function stackConfigFileIn(root: string, stack: string): string;
78
- /** Whether a folder holds a project's settings: a config.turri.yaml, a stack's file, or the old files. */
75
+ /** The file a module's own settings are read from, by name - the old name while the folder has only the old files. */
76
+ export declare function moduleConfigFileIn(root: string, module: string): string;
77
+ /** Whether a folder holds a project's settings: a config.turri.yaml, a module's file, or the old files. */
79
78
  export declare function hasProjectConfig(root: string): boolean;
80
- /** The stacks a project folder has files for, by name. */
81
- export declare function stacksOf(root: string): string[];
79
+ /** The modules a project folder has config files for, by name. */
80
+ export declare function moduleConfigsOf(root: string): string[];
82
81
  /**
83
82
  * Before turri first writes a setting in a folder whose settings are still in the old files: config.yaml copied to
84
- * config.turri.yaml, and each config.<stack>.yaml to config.turri.<stack>.yaml, so nothing is lost when the old files
83
+ * config.turri.yaml, and each config.<module>.yaml to config.turri.<module>.yaml, so nothing is lost when the old files
85
84
  * stop being read. The old files are left as they are. Gives back the files written, by name.
86
85
  */
87
- export declare function adoptLegacyConfig(root: string, options?: {
88
- projectFile?: boolean;
89
- }): string[];
90
86
  /**
91
- * The stack chosen now - the chat's own (`/stack` in it), else `--stack` or `TURRI_STACK` - or, inside a pulse, the one
92
- * it started with.
87
+ * Keys turri has renamed, old to new - no alias: a project's config.turri.yaml or config.turri.<module>.yaml that still has
88
+ * the old one has it renamed as turri first reads or writes the project's config (`renameOldKeys`), its value and its
89
+ * comment kept. One that sets the new one too is left as it is, the old one said in the banner as doing nothing.
93
90
  */
94
- export declare function chosenStack(): string | undefined;
91
+ export declare const RENAMED_KEYS: Readonly<Record<string, string>>;
92
+ /** A key renamed in a config file. */
93
+ export interface RenamedKey {
94
+ file: string;
95
+ from: string;
96
+ to: string;
97
+ }
95
98
  /**
96
- * Choose the stack everything is built with from now on - or none, the project's config alone. In a chat, for that
97
- * chat alone; outside one, kept in TURRI_STACK.
99
+ * Rename the old keys of `RENAMED_KEYS` in the project's config.turri*.yaml files - once a process, or again with `again`
100
+ * (a file just copied from its old name). A top-level key alone, its line kept but for the key's name; a file that also
101
+ * sets the new key, one that does not parse, or one that cannot be written is left as it is. Returns every key renamed
102
+ * in the project this process.
98
103
  */
99
- export declare function chooseStack(stack: string | undefined): void;
100
- /** Run `work` with `stack` as the one chosen, whatever is chosen meanwhile: a pulse keeps the stack it started with. */
101
- export declare function withStack<T>(stack: string | undefined, work: () => T): T;
102
- /** Whether a stack is pinned here - named by the call that asked for the work, or kept by the pulse it runs in. */
103
- export declare function stackPinned(): boolean;
104
+ export declare function renameOldKeys(root: string, options?: {
105
+ again?: boolean;
106
+ }): RenamedKey[];
107
+ export declare function adoptLegacyConfig(root: string, options?: {
108
+ projectFile?: boolean;
109
+ }): string[];
110
+ /** Inside a pulse - or work pinned like one - the module whose config file it runs with; none outside. */
111
+ export declare function pinnedConfigModule(): string | undefined;
112
+ /** Run `work` with `module`'s config file over the project's, whatever the files say meanwhile: a pulse keeps the one it started with. */
113
+ export declare function withConfigModule<T>(module: string | undefined, work: () => T): T;
114
+ /** Whether a module's config file is pinned here - by the pulse it runs in, or the work that plans it. */
115
+ export declare function configModulePinned(): boolean;
104
116
  /**
105
- * The stack a module is built with: the one pinned - named by the call, or kept by the pulse - else the stack named
106
- * after the module, config.turri.backend.yaml for backend.plain, else the one chosen for the session; none, when none
107
- * of them is.
117
+ * The module whose config file builds a module - its `config.turri.<module>.yaml` laid over `config.turri.yaml` - or
118
+ * none, `config.turri.yaml` alone. The one pinned, inside a pulse; else the module's own file; else the one file among
119
+ * the modules it requires, all the way down - a module is built on their code, in one codebase, with their testing
120
+ * scripts. Two among them is an error: which one builds it cannot be told. Only `requires` counts, not imports.
108
121
  */
109
- export declare function stackForModule(plainFile: string): string | undefined;
110
- /** The words that choose no stack: the project's config alone. */
111
- export declare const NO_STACK: string[];
122
+ export declare function configModuleFor(plainFile: string): string | undefined;
123
+ /** Why a module's config cannot be told: two or more of the modules it requires have a config file of their own. */
124
+ export declare function moduleConfigClash(module: string, below: string[], root: string): string;
112
125
  /**
113
- * The stack `name` names for the project at `root` - undefined for none - refused when the project has no file for
114
- * it, with the stacks it has.
126
+ * Every module a module requires, all the way down, by name - read from each file's frontmatter alone, found as the
127
+ * parser finds them (the module's folder, its template/ folder, PLAIN_TEMPLATE_DIRS). One that is not there, or does
128
+ * not read, ends its branch: the parse says what is wrong with it.
115
129
  */
116
- export declare function stackNamed(root: string, name: string): string | undefined;
117
- /** The stack a project folder is built with now: the one chosen, when the folder has a file for it. */
118
- export declare function stackOf(root: string): string | undefined;
130
+ export declare function requiredModulesOf(plainFile: string): string[];
131
+ /** The module whose config file is pinned here, when the project folder has that file. */
132
+ export declare function configModuleOf(root: string): string | undefined;
119
133
  export declare const THINKING_LEVELS: readonly ["off", "minimal", "low", "medium", "high", "xhigh", "max"];
120
134
  export type ThinkingLevel = (typeof THINKING_LEVELS)[number];
121
135
  /** A model, and how hard it thinks - either may be left to the one it inherits from. */
@@ -129,11 +143,11 @@ export interface ModelChoice {
129
143
  * The code fixer of a conformance run and the repair agent are coding agents; the unit-test and conformance arbiters
130
144
  * are both `arbiter`.
131
145
  */
132
- export declare const AGENT_ROLES: readonly ["chat", "sentinel", "planner", "diagnosis", "release", "coding", "conformance", "explorer", "reviewer", "test-reviewer", "judge", "arbiter", "debugger"];
146
+ export declare const AGENT_ROLES: readonly ["chat", "sentinel", "planner", "diagnosis", "launch", "coding", "conformance", "explorer", "reviewer", "test-reviewer", "judge", "arbiter", "debugger"];
133
147
  export type AgentRole = (typeof AGENT_ROLES)[number];
134
148
  /**
135
149
  * How hard each role thinks when nothing names a level - not the config's `models:`, nor a `:level` on the model it is
136
- * given. The agents that do the work - write the code and the tests, explore, release - think little: they work from a
150
+ * given. The agents that do the work - write the code and the tests, explore, launch - think little: they work from a
137
151
  * spec that leaves little to guess, and every turn of theirs is many. The ones that judge - review, weigh, plan, find a
138
152
  * cause - think more: a wrong call there costs pulses. The conversation keeps its own level, pi's.
139
153
  */
@@ -213,12 +227,12 @@ export interface ProjectConfig {
213
227
  */
214
228
  allowToStopJobs?: boolean;
215
229
  /**
216
- * Whether every pulse that lands code releases it as its last stage, before the module's next pulse starts - an agent
217
- * looking for the project's release guidance as the chat does, and doing what it says. Unset: false.
230
+ * Whether every pulse that lands code is launched (docs/launch.md): in the background, on the launch track - the newest
231
+ * commit winning, no pulse waiting on it - by an agent that follows the project's launch guidance. Unset: false.
218
232
  */
219
- releaseAfterPulse?: boolean;
233
+ launchAfterPulse?: boolean;
220
234
  /**
221
- * Whether the session has a sentinel: a chat of its own that every finished pulse goes to - checked, a release tested,
235
+ * Whether the session has a sentinel: a chat of its own that every finished pulse goes to - checked, what is launched tested,
222
236
  * and what is wrong put to the person - instead of the chat that asked for it (docs/sentinel.md). `ask`: the person is
223
237
  * asked, before it first opens in a session, whether to start it. Unset: ask.
224
238
  */
@@ -263,7 +277,7 @@ export interface ProjectConfig {
263
277
  * session through a job is compacted between turns. The project's alone. Unset: 100k.
264
278
  */
265
279
  compactAt?: number;
266
- /** The most functional specs the planner puts in one pulse. Unset: 3. A stack's file wins. */
280
+ /** The most functional specs the planner puts in one pulse. Unset: 3. A module's own file wins. */
267
281
  maxSpecsPerPulse?: number;
268
282
  /** The most lines of spec - its functional specs and the definitions they bring - in one pulse; past it, split. Unset: 120. */
269
283
  maxLinesPerPulse?: number;
@@ -312,7 +326,7 @@ export declare const CONFIG_KEYS: {
312
326
  readonly review: "review";
313
327
  readonly mutationTesting: "mutation-testing";
314
328
  readonly allowToStopJobs: "allow-to-stop-jobs";
315
- readonly releaseAfterPulse: "release-after-pulse";
329
+ readonly launchAfterPulse: "launch-after-pulse";
316
330
  readonly sentinel: "sentinel";
317
331
  readonly testDir: "test-dir";
318
332
  readonly conformanceTests: "conformance-tests";
@@ -335,10 +349,10 @@ export declare const CONFIG_KEYS: {
335
349
  readonly turnLimit: "turn-limit";
336
350
  };
337
351
  /**
338
- * The project's config - with a stack's over it, when one is named - or nothing of it when there is no file or it does
352
+ * The project's config - with a module's own file over it, when one is named - or nothing of it when there is no file or it does
339
353
  * not parse.
340
354
  */
341
- export declare function readProjectConfig(root: string, stack?: string): ProjectConfig;
355
+ export declare function readProjectConfig(root: string, module?: string): ProjectConfig;
342
356
  /**
343
357
  * What a command's own options say of the config's keys - `turri regenerate --harness-model`, `--coding-model`,
344
358
  * `--judge-model`, `--review`, `--mutation-testing` - read as if the file had them: each takes its key's value, and
@@ -360,13 +374,42 @@ export declare function overrideConfig(overrides: RunOverrides): void;
360
374
  export declare function booleanOption(value: string): boolean | undefined;
361
375
  /** Where the test plain files are when `test-dir:` does not say. */
362
376
  export declare const DEFAULT_TEST_DIR = "tests";
363
- /** The folder of a module's project's test plain files: `test-dir:` - its stack's over the project's - from the project's folder. */
377
+ /** The folder of a module's project's test plain files: `test-dir:` - its own file's over the project's - from the project's folder. */
364
378
  export declare function testDirOf(plainFile: string): string;
365
- /** The config a spec is built with: its project's, with its module's stack over it (`stackForModule`). */
379
+ /** The config a spec is built with: its project's, with its module's own file over it - or a required module's (`configModuleFor`). */
366
380
  export declare function configForSpec(plainFile: string): ProjectConfig;
367
381
  /**
368
382
  * One config file, read, or nothing of it when it is not there or does not parse. Parsed again only once the file has
369
- * changed - its size or its modification time - and each caller given its own copy.
383
+ * changed - its size or its modification time - and each caller given its own copy. A file modified less than a second
384
+ * before it was read is read again each time, as git treats a racily clean file: written again within the same tick of
385
+ * the file system's clock - milliseconds on Linux - and to the same size, its stamp would not change.
370
386
  */
371
387
  export declare function readConfigFile(path: string): ProjectConfig;
388
+ /**
389
+ * The keys of the project's own config files - config.turri.yaml and each module's - that turri reads nothing of: a setting
390
+ * turri no longer has (`test-advisor`), or one misspelt. Said as turri starts, so a setting the person thinks is on is
391
+ * not silently ignored. config.yaml is left out: it may be another tool's, with keys of its own.
392
+ */
393
+ export declare function unknownConfigKeys(root: string): Array<{
394
+ file: string;
395
+ keys: string[];
396
+ }>;
397
+ /**
398
+ * What a line under the banner about a config file is, for a host that draws them without reading their text: `renamed`,
399
+ * a key turri renamed in the file - information, nothing to do; `old-beside-new`, an old name left beside its new one,
400
+ * doing nothing - take it out; `unknown`, keys turri does not read - take them out, or fix their spelling.
401
+ */
402
+ export type ConfigLineKind = "renamed" | "old-beside-new" | "unknown";
403
+ export interface ConfigLine {
404
+ kind: ConfigLineKind;
405
+ /** The file, from the project: `config.turri.yaml`, `config.turri.<module>.yaml`. */
406
+ file: string;
407
+ /** The line, as the terminal shows it. */
408
+ text: string;
409
+ }
410
+ /**
411
+ * The banner's lines for the project's config files: each key turri renamed in them this process, each old name left
412
+ * beside its new one - doing nothing - and each file with keys turri does not read.
413
+ */
414
+ export declare function configLines(root: string): ConfigLine[];
372
415
  export {};