@turri-dev/cli 0.2.3 → 0.2.4-next.009bd0c
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.
- package/README.md +7 -8
- package/dist/bedrock-region.js +3 -3
- package/dist/chat-idle.d.ts +2 -2
- package/dist/chat-idle.js +2 -2
- package/dist/chat-models.d.ts +1 -1
- package/dist/chat-models.js +1 -1
- package/dist/chat-scope.d.ts +1 -3
- package/dist/chat-skills.d.ts +1 -1
- package/dist/chat-skills.js +1 -1
- package/dist/chats.d.ts +44 -20
- package/dist/chats.js +125 -64
- package/dist/cli.js +12 -31
- package/dist/config-edit.d.ts +20 -8
- package/dist/config-edit.js +32 -26
- package/dist/config.d.ts +106 -78
- package/dist/config.js +267 -133
- package/dist/conform-cli.js +14 -3
- package/dist/conformance-switch.d.ts +13 -22
- package/dist/conformance-switch.js +37 -59
- package/dist/drift-cli.js +1 -1
- package/dist/extension.d.ts +17 -10
- package/dist/extension.js +425 -531
- package/dist/genome.js +10 -49
- package/dist/graph.js +3 -5
- package/dist/host-session.d.ts +11 -21
- package/dist/host-session.js +6 -8
- package/dist/host.d.ts +4 -4
- package/dist/host.js +4 -7
- package/dist/identity.js +2 -3
- package/dist/init-config.d.ts +1 -2
- package/dist/init-config.js +10 -17
- package/dist/installed-providers.d.ts +1 -1
- package/dist/installed-providers.js +1 -1
- package/dist/launch-agent.d.ts +41 -0
- package/dist/launch-agent.js +219 -0
- package/dist/{release-cli.js → launch-cli.js} +41 -24
- package/dist/launch-session.d.ts +58 -0
- package/dist/launch-session.js +195 -0
- package/dist/launch-tools.d.ts +28 -0
- package/dist/launch-tools.js +69 -0
- package/dist/launch-track.d.ts +120 -0
- package/dist/launch-track.js +298 -0
- package/dist/loop-cli.d.ts +4 -3
- package/dist/loop-cli.js +17 -15
- package/dist/loop-tools.d.ts +45 -21
- package/dist/loop-tools.js +155 -90
- package/dist/new-project.js +2 -2
- package/dist/notice.d.ts +7 -6
- package/dist/parse-cli.js +2 -2
- package/dist/pi-launch.js +4 -1
- package/dist/pi-settings.d.ts +4 -0
- package/dist/pi-settings.js +39 -0
- package/dist/pi.js +12 -9
- package/dist/plain/check.d.ts +2 -9
- package/dist/plain/check.js +6 -39
- package/dist/plain-files.d.ts +2 -2
- package/dist/plain-files.js +7 -7
- package/dist/regenerate/activity.d.ts +0 -7
- package/dist/regenerate/activity.js +2 -20
- package/dist/regenerate/agent-env.d.ts +1 -1
- package/dist/regenerate/agent-env.js +3 -3
- package/dist/regenerate/agent-shell.js +5 -3
- package/dist/regenerate/audit.js +9 -0
- package/dist/regenerate/base-folder.d.ts +2 -2
- package/dist/regenerate/base-folder.js +1 -1
- package/dist/regenerate/cases.js +7 -0
- package/dist/regenerate/chunk-plan.d.ts +5 -0
- package/dist/regenerate/chunk-plan.js +16 -1
- package/dist/regenerate/command-check.d.ts +1 -1
- package/dist/regenerate/command-check.js +1 -1
- package/dist/regenerate/delivery.d.ts +1 -1
- package/dist/regenerate/delivery.js +3 -3
- package/dist/regenerate/drift.d.ts +4 -0
- package/dist/regenerate/drift.js +26 -6
- package/dist/regenerate/failure-reports.d.ts +28 -0
- package/dist/regenerate/failure-reports.js +79 -0
- package/dist/regenerate/job-panel.js +3 -1
- package/dist/regenerate/jobs-tree.js +1 -1
- package/dist/regenerate/jobs.d.ts +4 -2
- package/dist/regenerate/jobs.js +14 -10
- package/dist/regenerate/launch.d.ts +126 -0
- package/dist/regenerate/{release.js → launch.js} +60 -48
- package/dist/regenerate/ledger-view.d.ts +11 -24
- package/dist/regenerate/ledger-view.js +14 -60
- package/dist/regenerate/ledger.d.ts +26 -16
- package/dist/regenerate/ledger.js +1 -1
- package/dist/regenerate/lineage.d.ts +2 -0
- package/dist/regenerate/lineage.js +8 -0
- package/dist/regenerate/loop.d.ts +54 -67
- package/dist/regenerate/loop.js +312 -148
- package/dist/regenerate/model-names.d.ts +33 -0
- package/dist/regenerate/{engine.js → model-names.js} +2 -28
- package/dist/regenerate/paths.d.ts +3 -3
- package/dist/regenerate/paths.js +4 -4
- package/dist/regenerate/records.d.ts +11 -0
- package/dist/regenerate/records.js +15 -0
- package/dist/regenerate/regenerate.d.ts +0 -2
- package/dist/regenerate/regenerate.js +4 -15
- package/dist/regenerate/renames.js +4 -4
- package/dist/regenerate/requires.d.ts +7 -0
- package/dist/regenerate/requires.js +24 -18
- package/dist/regenerate/scripts-being-written.d.ts +4 -4
- package/dist/regenerate/scripts-being-written.js +3 -3
- package/dist/regenerate/spec-map.js +3 -3
- package/dist/regenerate/standing.js +1 -1
- package/dist/regenerate/submit-work.d.ts +2 -0
- package/dist/regenerate/submit-work.js +8 -3
- package/dist/regenerate/test-scripts.d.ts +2 -1
- package/dist/regenerate/test-scripts.js +33 -23
- package/dist/regenerate/testing-steps.d.ts +16 -5
- package/dist/regenerate/testing-steps.js +28 -9
- package/dist/regenerate-cli.js +18 -9
- package/dist/self-invocation.d.ts +11 -0
- package/dist/self-invocation.js +36 -10
- package/dist/sentinel-check.d.ts +3 -3
- package/dist/sentinel-check.js +3 -3
- package/dist/sentinel.d.ts +17 -12
- package/dist/sentinel.js +75 -46
- package/dist/{config-command.d.ts → settings.d.ts} +13 -8
- package/dist/{config-command.js → settings.js} +155 -24
- package/dist/setup.d.ts +2 -2
- package/dist/setup.js +7 -7
- package/dist/skill.d.ts +0 -11
- package/dist/skill.js +0 -9
- package/dist/tools.js +2 -3
- package/dist/turri-versions.js +2 -1
- package/docs/README.md +4 -6
- package/docs/authoring-plain.md +3 -3
- package/docs/chats.md +6 -9
- package/docs/claude-subscription.md +2 -2
- package/docs/config.md +61 -51
- package/docs/development.md +4 -5
- package/docs/headless.md +7 -6
- package/docs/hosting.md +24 -23
- package/docs/launch.md +63 -0
- package/docs/parser.md +3 -3
- package/docs/regenerating.md +30 -22
- package/docs/sandbox.md +3 -3
- package/docs/sentinel.md +27 -16
- package/docs/skills-and-gates.md +6 -11
- package/docs/using.md +25 -42
- package/genome/rules/project-model.md +2 -1
- package/genome/rules/test-plain-files.md +15 -7
- package/genome/rules/turri-regeneration.md +7 -10
- package/genome/skills/convert-old-syntax/SKILL.md +5 -5
- package/genome/skills/implement-conformance-testing-script/SKILL.md +2 -2
- package/genome/skills/implement-unit-testing-script/SKILL.md +3 -3
- package/package.json +1 -1
- package/dist/advisor-chat.d.ts +0 -63
- package/dist/advisor-chat.js +0 -290
- package/dist/change-plain-cli.js +0 -55
- package/dist/ledger-cli.d.ts +0 -1
- package/dist/ledger-cli.js +0 -50
- package/dist/ledger-tools.d.ts +0 -10
- package/dist/ledger-tools.js +0 -64
- package/dist/regenerate/advisor-records.d.ts +0 -93
- package/dist/regenerate/advisor-records.js +0 -110
- package/dist/regenerate/advisor-runs.d.ts +0 -87
- package/dist/regenerate/advisor-runs.js +0 -327
- package/dist/regenerate/engine.d.ts +0 -52
- package/dist/regenerate/release.d.ts +0 -121
- package/dist/regenerate/test-advisor.d.ts +0 -101
- package/dist/regenerate/test-advisor.js +0 -379
- package/dist/release-agent.d.ts +0 -43
- package/dist/release-agent.js +0 -130
- package/dist/release-cli.d.ts +0 -1
- package/dist/release-tools.d.ts +0 -44
- package/dist/release-tools.js +0 -170
- package/dist/spec-tools.d.ts +0 -36
- package/dist/spec-tools.js +0 -128
- package/dist/stacks.d.ts +0 -13
- package/dist/stacks.js +0 -96
- package/docs/deploy.md +0 -48
- package/docs/test-advisor.md +0 -110
- /package/dist/{change-plain-cli.d.ts → launch-cli.d.ts} +0 -0
package/dist/cli.js
CHANGED
|
@@ -73,14 +73,11 @@ function chat(args) {
|
|
|
73
73
|
}
|
|
74
74
|
const COMMANDS = {
|
|
75
75
|
regenerate: { module: "./regenerate-cli.ts", blurb: "regenerate a module and its chain from the spec as it is (with module:func-ids: regenerate those again)" },
|
|
76
|
-
glimpse: { module: "./regenerate-cli.ts", blurb: "plan the work and print the first job's prompt, starting nothing", args: ["--dry-run"] },
|
|
77
76
|
drift: { module: "./drift-cli.ts", blurb: "what is left to regenerate: how far the code has drifted from its spec" },
|
|
78
77
|
conform: { module: "./conform-cli.ts", blurb: "write and run a module's conformance tests" },
|
|
79
|
-
"change-plain": { module: "./change-plain-cli.ts", blurb: "apply a change to ***plain, given as a git diff, and regenerate it" },
|
|
80
78
|
parse: { module: "./parse-cli.ts", blurb: "parse ***plain - its syntax and structure, never its code or tests - regenerating nothing" },
|
|
81
79
|
lineage: { module: "./lineage-cli.ts", blurb: "a module's lineage: what was regenerated into it, and when" },
|
|
82
|
-
|
|
83
|
-
release: { module: "./release-cli.ts", blurb: "release what is regenerated to dist/<module> and activate it on this machine" },
|
|
80
|
+
launch: { module: "./launch-cli.ts", blurb: "launch what is regenerated from dist/<module> on this machine" },
|
|
84
81
|
cultivate: { module: "./cultivate-cli.ts", blurb: "run a gated skill" },
|
|
85
82
|
};
|
|
86
83
|
/** Getting the machine ready, and checking it is. */
|
|
@@ -112,8 +109,7 @@ const USAGE = [
|
|
|
112
109
|
" turri <command> [args]",
|
|
113
110
|
" turri --version turri's version, and pi's",
|
|
114
111
|
"",
|
|
115
|
-
` ${"options".padEnd(12)} --harness-model <m> the model you chat with --coding-model <m> the model
|
|
116
|
-
` ${"".padEnd(12)} --stack <name> build with config.turri.<name>.yaml over config.turri.yaml - here and in every command`,
|
|
112
|
+
` ${"options".padEnd(12)} --harness-model <m> the model you chat with --coding-model <m> the model that writes the code`,
|
|
117
113
|
` ${"".padEnd(12)} --debug keep what turri writes for debugging it - agents' logs and sessions - as debug: true does`,
|
|
118
114
|
` ${"".padEnd(12)} --use-theme <t> another theme than turri-dark - and every option of pi's own`,
|
|
119
115
|
"",
|
|
@@ -128,37 +124,22 @@ const USAGE = [
|
|
|
128
124
|
"specification, so that linked resources inside it resolve the way the parser expects.",
|
|
129
125
|
].join("\n");
|
|
130
126
|
dropNoise();
|
|
131
|
-
// --
|
|
132
|
-
//
|
|
133
|
-
const argv =
|
|
127
|
+
// --debug, for any command and for the conversation: TURRI_DEBUG for this run, and the pi it starts - taken out before
|
|
128
|
+
// the rest is read, so a command never sees it.
|
|
129
|
+
const argv = withoutDebug(process.argv.slice(2));
|
|
134
130
|
const [command, ...rest] = argv;
|
|
135
|
-
|
|
131
|
+
function withoutDebug(args) {
|
|
136
132
|
const kept = [];
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
const arg = args[at];
|
|
140
|
-
if (arg === "--stack")
|
|
141
|
-
stack = args[++at] ?? "";
|
|
142
|
-
else if (arg.startsWith("--stack="))
|
|
143
|
-
stack = arg.slice("--stack=".length);
|
|
144
|
-
else if (arg === "--debug")
|
|
133
|
+
for (const arg of args) {
|
|
134
|
+
if (arg === "--debug")
|
|
145
135
|
process.env.TURRI_DEBUG = "1";
|
|
146
136
|
else
|
|
147
137
|
kept.push(arg);
|
|
148
138
|
}
|
|
149
|
-
if (stack === undefined)
|
|
150
|
-
return kept;
|
|
151
|
-
const { switchStack } = await import("./stacks.js");
|
|
152
|
-
try {
|
|
153
|
-
switchStack(process.cwd(), stack);
|
|
154
|
-
}
|
|
155
|
-
catch (error) {
|
|
156
|
-
console.error(error instanceof Error ? error.message : String(error));
|
|
157
|
-
process.exit(1);
|
|
158
|
-
}
|
|
159
139
|
return kept;
|
|
160
140
|
}
|
|
161
|
-
|
|
141
|
+
// `turri help` too: the word people type first, which would otherwise be an unknown command.
|
|
142
|
+
if (command === "-h" || command === "--help" || command === "help") {
|
|
162
143
|
console.log(USAGE);
|
|
163
144
|
process.exit(0);
|
|
164
145
|
}
|
|
@@ -172,7 +153,7 @@ if (command === "-v" || command === "--version") {
|
|
|
172
153
|
// The AWS region the project's Bedrock models need, set before any model is called - here, and in the pi the chat starts,
|
|
173
154
|
// which inherits it - unless the person set one (bedrock-region.ts). The models named on the command line count too. A
|
|
174
155
|
// command that calls no model is left alone.
|
|
175
|
-
if (!["parse", "drift", "lineage", "
|
|
156
|
+
if (!["parse", "drift", "lineage", "init-config", ...Object.keys(PACKAGE_COMMANDS)].includes(command ?? "")) {
|
|
176
157
|
const { applyBedrockRegion } = await import("./bedrock-region.js");
|
|
177
158
|
const named = argv.flatMap((arg, at) => ["--harness-model", "--coding-model", "--model"].includes(arg) ? [argv[at + 1] ?? ""] : arg.startsWith("--harness-model=") || arg.startsWith("--coding-model=") || arg.startsWith("--model=") ? [arg.slice(arg.indexOf("=") + 1)] : []);
|
|
178
159
|
applyBedrockRegion(process.cwd(), { also: named.filter((model) => model !== "") });
|
|
@@ -215,7 +196,7 @@ process.argv = [
|
|
|
215
196
|
// A headless run is stopped by a signal - SIGTERM, SIGHUP, Ctrl-C - whatever else listens for it: it exits, and what
|
|
216
197
|
// its agents left running goes with it (shell.ts kills every process group on exit). Left to the libraries' own
|
|
217
198
|
// handlers, one ran on for minutes after it was told to stop, building in the same codebase as the run after it.
|
|
218
|
-
if (!["parse", "drift", "lineage"
|
|
199
|
+
if (!["parse", "drift", "lineage"].includes(command)) {
|
|
219
200
|
for (const [signal, code] of [["SIGTERM", 143], ["SIGHUP", 129], ["SIGINT", 130]]) {
|
|
220
201
|
process.on(signal, () => {
|
|
221
202
|
console.error(`\nstopped (${signal})`);
|
package/dist/config-edit.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* `/
|
|
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
|
|
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 /
|
|
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
|
-
*
|
|
65
|
-
*
|
|
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
|
|
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. */
|
package/dist/config-edit.js
CHANGED
|
@@ -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,
|
|
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
|
|
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
|
-
|
|
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",
|
|
@@ -32,7 +32,6 @@ const ROLE_ABOUT = {
|
|
|
32
32
|
judge: "judges a failing conformance run - as judge-model, which it wins over",
|
|
33
33
|
arbiter: "weighs a second review",
|
|
34
34
|
debugger: "a fresh look at unit tests that keep failing the same way",
|
|
35
|
-
advisor: "the test advisor: whether a new or changed functional spec needs scenarios",
|
|
36
35
|
};
|
|
37
36
|
/** Every setting, in the order the list shows them. */
|
|
38
37
|
export function settings(rules = []) {
|
|
@@ -63,10 +62,9 @@ export function settings(rules = []) {
|
|
|
63
62
|
{ key: "review", about: "whether the code and its tests are reviewed once they pass", kind: "boolean", unset: "true", effect: "next-pulse" },
|
|
64
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" },
|
|
65
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" },
|
|
66
|
-
{ key: "
|
|
67
|
-
{ key: "sentinel", about: "whether a chat of its own checks every finished pulse, tests
|
|
68
|
-
{ key: "
|
|
69
|
-
{ key: "conformance-tests", about: "whether functional specs' scenarios are written and conformance tested - false: none, the test advisor and conform off", 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 },
|
|
70
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" },
|
|
71
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" },
|
|
72
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" },
|
|
@@ -78,17 +76,17 @@ export function settings(rules = []) {
|
|
|
78
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" },
|
|
79
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" },
|
|
80
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 },
|
|
81
|
-
{ 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 },
|
|
82
|
-
{ key: "agent-env.files", about: "dotenv files whose variables the agents' commands get", kind: "list", unset: "none", effect: "next-pulse", projectOnly: true },
|
|
83
|
-
{ 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 },
|
|
84
|
-
{ 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 },
|
|
85
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 },
|
|
86
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 },
|
|
87
|
-
{ 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 },
|
|
88
86
|
...roles,
|
|
89
87
|
];
|
|
90
88
|
}
|
|
91
|
-
/** Every setting, as a host is given them: rules-off offering turri's own rules, as /
|
|
89
|
+
/** Every setting, as a host is given them: rules-off offering turri's own rules, as /settings offers them. */
|
|
92
90
|
export function configSettings() {
|
|
93
91
|
return settings(loadRules(join(PACKAGE_ROOT, "genome", "rules")).map((rule) => rule.name));
|
|
94
92
|
}
|
|
@@ -309,21 +307,24 @@ export function readConfigText(dir) {
|
|
|
309
307
|
const path = join(dir, projectConfigFile(dir));
|
|
310
308
|
return existsSync(path) ? readFileSync(path, "utf8") : "";
|
|
311
309
|
}
|
|
312
|
-
/**
|
|
313
|
-
|
|
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) {
|
|
314
315
|
const notes = [];
|
|
315
316
|
const wins = { "harness-model": "models.chat", "coding-model": "models.coding", "judge-model": "models.judge" };
|
|
316
317
|
const over = wins[setting.key];
|
|
317
318
|
if (over !== undefined && currentValue(text, over) !== undefined)
|
|
318
|
-
notes.push(`${over} is set too, and wins over ${setting.key} - change it with /
|
|
319
|
-
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)
|
|
320
321
|
return notes;
|
|
321
322
|
const top = setting.key.split(".")[0];
|
|
322
|
-
for (const
|
|
323
|
-
const file =
|
|
323
|
+
for (const each of moduleConfigsOf(dir)) {
|
|
324
|
+
const file = moduleConfigFileIn(dir, each);
|
|
324
325
|
const own = loadMapping(safeRead(join(dir, file)))[top];
|
|
325
326
|
if (own !== undefined)
|
|
326
|
-
notes.push(`${file} sets ${top} too, and wins
|
|
327
|
+
notes.push(`${file} sets ${top} too, and wins for ${each}.plain and the modules built on it.`);
|
|
327
328
|
}
|
|
328
329
|
return notes;
|
|
329
330
|
}
|
|
@@ -336,15 +337,20 @@ function safeRead(path) {
|
|
|
336
337
|
}
|
|
337
338
|
}
|
|
338
339
|
/**
|
|
339
|
-
* Write a setting into the project's config.turri.yaml -
|
|
340
|
-
* file in the old naming when they are what the project
|
|
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.
|
|
341
343
|
*/
|
|
342
|
-
export function writeSetting(dir, key, value) {
|
|
344
|
+
export function writeSetting(dir, key, value, module) {
|
|
343
345
|
adoptLegacyConfig(dir);
|
|
344
|
-
const text = withSetting(readConfigText(dir), key, value);
|
|
345
|
-
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);
|
|
346
348
|
return text;
|
|
347
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
|
+
}
|
|
348
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. */
|
|
349
355
|
export function pathOptions(dir, key) {
|
|
350
356
|
const list = (folder, test) => {
|
package/dist/config.d.ts
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
*
|
|
6
6
|
* ```yaml
|
|
7
7
|
* module: prism_cli.plain # what `turri regenerate` builds by default
|
|
8
|
-
* conformance-tests: false # whether scenarios are written and conformance tested - false: none
|
|
8
|
+
* conformance-tests: false # whether scenarios are written and conformance tested - false: none (default: false)
|
|
9
9
|
* test-dir: tests # where the test plain files are, a folder per module: tests/<module>/ (default: tests)
|
|
10
10
|
* base-folder: existing-app # a codebase that requires none starts as a copy of it - code to build on, assets to use
|
|
11
11
|
* harness-model: # the model you chat with in `turri`
|
|
@@ -19,9 +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
|
-
*
|
|
23
|
-
*
|
|
24
|
-
* 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)
|
|
25
24
|
* rules-off: [integrations] # ***plain rules to leave out of the prompts, by name (default: none)
|
|
26
25
|
* unittests-script: test_scripts/run_unittests.sh # the testing scripts - see test-scripts.ts
|
|
27
26
|
* conformance-tests-script: test_scripts/run_conformance_tests.sh
|
|
@@ -44,79 +43,93 @@
|
|
|
44
43
|
* either of which may be left out; a bare string is the model alone. What a model leaves out it takes
|
|
45
44
|
* from the one it inherits: judge-model from coding-model, coding-model from harness-model. They are
|
|
46
45
|
* defaults: `--harness-model` / `--coding-model` / `--judge-model` on the command line win over them,
|
|
47
|
-
* and so does a model chosen during the conversation (pi's /model
|
|
46
|
+
* and so does a model chosen during the conversation (pi's /model) or named on a call. `model:` is read
|
|
48
47
|
* as `coding-model`, which it was before there were two.
|
|
49
48
|
*
|
|
50
49
|
* Keys are written with dashes; underscores are read the same (`conformance_tests`). Keys it
|
|
51
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
|
|
52
51
|
* the wrong type. Everything is optional, and what is given on the command line wins.
|
|
53
52
|
*
|
|
54
|
-
* A
|
|
55
|
-
*
|
|
56
|
-
*
|
|
57
|
-
*
|
|
58
|
-
*
|
|
59
|
-
* from the
|
|
60
|
-
*
|
|
61
|
-
* 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.
|
|
62
60
|
*/
|
|
63
61
|
/** turri's settings for a project, in a file of its own: a `config.yaml` beside it may be another tool's. */
|
|
64
62
|
export declare const CONFIG_FILE = "config.turri.yaml";
|
|
65
63
|
/**
|
|
66
64
|
* Where turri's settings were before they had a file of their own. A project with no `config.turri*.yaml` yet is read
|
|
67
|
-
* from it - and a `config.<name>.yaml` beside it as the
|
|
65
|
+
* from it - and a `config.<name>.yaml` beside it as the module `<name>`'s - and turri never writes it: the first setting
|
|
68
66
|
* turri writes copies them to the new names (`adoptLegacyConfig`), and from then on the old files are not read.
|
|
69
67
|
*/
|
|
70
68
|
export declare const LEGACY_CONFIG_FILE = "config.yaml";
|
|
71
|
-
/** A
|
|
72
|
-
export declare function
|
|
73
|
-
/** Whether a folder's settings are still in the old files: a config.yaml or a config.<
|
|
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. */
|
|
74
72
|
export declare function usesLegacyConfig(root: string): boolean;
|
|
75
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. */
|
|
76
74
|
export declare function projectConfigFile(root: string): string;
|
|
77
|
-
/** The file a
|
|
78
|
-
export declare function
|
|
79
|
-
/** Whether a folder holds a project's settings: a config.turri.yaml, a
|
|
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. */
|
|
80
78
|
export declare function hasProjectConfig(root: string): boolean;
|
|
81
|
-
/** The
|
|
82
|
-
export declare function
|
|
79
|
+
/** The modules a project folder has config files for, by name. */
|
|
80
|
+
export declare function moduleConfigsOf(root: string): string[];
|
|
83
81
|
/**
|
|
84
82
|
* Before turri first writes a setting in a folder whose settings are still in the old files: config.yaml copied to
|
|
85
|
-
* config.turri.yaml, and each config.<
|
|
83
|
+
* config.turri.yaml, and each config.<module>.yaml to config.turri.<module>.yaml, so nothing is lost when the old files
|
|
86
84
|
* stop being read. The old files are left as they are. Gives back the files written, by name.
|
|
87
85
|
*/
|
|
88
|
-
export declare function adoptLegacyConfig(root: string, options?: {
|
|
89
|
-
projectFile?: boolean;
|
|
90
|
-
}): string[];
|
|
91
86
|
/**
|
|
92
|
-
*
|
|
93
|
-
* it
|
|
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.
|
|
94
90
|
*/
|
|
95
|
-
export declare
|
|
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
|
+
}
|
|
96
98
|
/**
|
|
97
|
-
*
|
|
98
|
-
*
|
|
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.
|
|
99
103
|
*/
|
|
100
|
-
export declare function
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
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;
|
|
105
116
|
/**
|
|
106
|
-
* The
|
|
107
|
-
*
|
|
108
|
-
*
|
|
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.
|
|
109
121
|
*/
|
|
110
|
-
export declare function
|
|
111
|
-
/**
|
|
112
|
-
export declare
|
|
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;
|
|
113
125
|
/**
|
|
114
|
-
*
|
|
115
|
-
*
|
|
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.
|
|
116
129
|
*/
|
|
117
|
-
export declare function
|
|
118
|
-
/** The
|
|
119
|
-
export declare function
|
|
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;
|
|
120
133
|
export declare const THINKING_LEVELS: readonly ["off", "minimal", "low", "medium", "high", "xhigh", "max"];
|
|
121
134
|
export type ThinkingLevel = (typeof THINKING_LEVELS)[number];
|
|
122
135
|
/** A model, and how hard it thinks - either may be left to the one it inherits from. */
|
|
@@ -128,14 +141,13 @@ export interface ModelChoice {
|
|
|
128
141
|
/**
|
|
129
142
|
* The agents turri starts, by what they do - each can be given its own model, thinking and turn limit (`models:`).
|
|
130
143
|
* The code fixer of a conformance run and the repair agent are coding agents; the unit-test and conformance arbiters
|
|
131
|
-
* are both `arbiter`.
|
|
132
|
-
* are `advisor`.
|
|
144
|
+
* are both `arbiter`.
|
|
133
145
|
*/
|
|
134
|
-
export declare const AGENT_ROLES: readonly ["chat", "sentinel", "planner", "diagnosis", "
|
|
146
|
+
export declare const AGENT_ROLES: readonly ["chat", "sentinel", "planner", "diagnosis", "launch", "coding", "conformance", "explorer", "reviewer", "test-reviewer", "judge", "arbiter", "debugger"];
|
|
135
147
|
export type AgentRole = (typeof AGENT_ROLES)[number];
|
|
136
148
|
/**
|
|
137
149
|
* How hard each role thinks when nothing names a level - not the config's `models:`, nor a `:level` on the model it is
|
|
138
|
-
* given. The agents that do the work - write the code and the tests, explore,
|
|
150
|
+
* given. The agents that do the work - write the code and the tests, explore, launch - think little: they work from a
|
|
139
151
|
* spec that leaves little to guess, and every turn of theirs is many. The ones that judge - review, weigh, plan, find a
|
|
140
152
|
* cause - think more: a wrong call there costs pulses. The conversation keeps its own level, pi's.
|
|
141
153
|
*/
|
|
@@ -181,11 +193,6 @@ export declare function skillModel(root: string, role?: "harness" | "coding"): s
|
|
|
181
193
|
* The coding role always runs on what it is given: its config is already in it (projectModels).
|
|
182
194
|
*/
|
|
183
195
|
export declare function roleModel(config: Pick<ProjectConfig, "harnessModel" | "judgeModel" | "models">, role: AgentRole): ModelChoice | undefined;
|
|
184
|
-
/**
|
|
185
|
-
* What the test advisor's calls run on: `models.advisor` - else `default` - and without either the coding
|
|
186
|
-
* model alone, thinking as the role has it (ROLE_THINKING). Undefined when the config names no model at all.
|
|
187
|
-
*/
|
|
188
|
-
export declare function advisorModel(config: ProjectConfig): string | undefined;
|
|
189
196
|
/** How long each turn of a role's agents may take, in milliseconds: its own, `default`'s, `turn-limit:`'s - or undefined, the harness's default. */
|
|
190
197
|
export declare function roleTurnLimitMs(config: Pick<ProjectConfig, "models" | "turnLimit">, role: AgentRole | undefined): number | undefined;
|
|
191
198
|
/** `sentinel:` - on, off, or `ask`: on once the person says so, asked before it first opens in a session. */
|
|
@@ -220,23 +227,16 @@ export interface ProjectConfig {
|
|
|
220
227
|
*/
|
|
221
228
|
allowToStopJobs?: boolean;
|
|
222
229
|
/**
|
|
223
|
-
* Whether every pulse that lands code
|
|
224
|
-
*
|
|
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.
|
|
225
232
|
*/
|
|
226
|
-
|
|
233
|
+
launchAfterPulse?: boolean;
|
|
227
234
|
/**
|
|
228
|
-
* Whether the session has a sentinel: a chat of its own that every finished pulse goes to - checked,
|
|
235
|
+
* Whether the session has a sentinel: a chat of its own that every finished pulse goes to - checked, what is launched tested,
|
|
229
236
|
* and what is wrong put to the person - instead of the chat that asked for it (docs/sentinel.md). `ask`: the person is
|
|
230
237
|
* asked, before it first opens in a session, whether to start it. Unset: ask.
|
|
231
238
|
*/
|
|
232
239
|
sentinel?: SentinelSetting;
|
|
233
|
-
/**
|
|
234
|
-
* Whether the test advisor starts by itself: in the chat and a host, each new or changed functional spec with no
|
|
235
|
-
* scenarios is classified in the background, and on a yes the chat writes its scenarios (docs/test-advisor.md). false
|
|
236
|
-
* turns off only that: the chat's evaluate_tests still works, and asked for scenarios, the chat writes them as before.
|
|
237
|
-
* Unset: true.
|
|
238
|
-
*/
|
|
239
|
-
testAdvisor?: boolean;
|
|
240
240
|
/**
|
|
241
241
|
* The folder of the test plain files, from the project's folder: a functional spec's scenarios are in its test plain
|
|
242
242
|
* file in `<test-dir>/<module>/`. Unset: `tests`.
|
|
@@ -244,9 +244,9 @@ export interface ProjectConfig {
|
|
|
244
244
|
testDir?: string;
|
|
245
245
|
/**
|
|
246
246
|
* Whether functional specs' scenarios are written and conformance tested (conformance-switch.ts). False: none - no
|
|
247
|
-
* conformance pulse, no conformance testing script, the
|
|
248
|
-
*
|
|
249
|
-
* on. Unset: false.
|
|
247
|
+
* conformance pulse, no conformance testing script, the chat's conform refused; the test plain
|
|
248
|
+
* files there are kept, and not tested. They make each change take about twice as long, so only the person turns them
|
|
249
|
+
* on - /conform, or this key. Unset: false.
|
|
250
250
|
*/
|
|
251
251
|
conformanceTests?: boolean;
|
|
252
252
|
/**
|
|
@@ -277,7 +277,7 @@ export interface ProjectConfig {
|
|
|
277
277
|
* session through a job is compacted between turns. The project's alone. Unset: 100k.
|
|
278
278
|
*/
|
|
279
279
|
compactAt?: number;
|
|
280
|
-
/** The most functional specs the planner puts in one pulse. Unset: 3. A
|
|
280
|
+
/** The most functional specs the planner puts in one pulse. Unset: 3. A module's own file wins. */
|
|
281
281
|
maxSpecsPerPulse?: number;
|
|
282
282
|
/** The most lines of spec - its functional specs and the definitions they bring - in one pulse; past it, split. Unset: 120. */
|
|
283
283
|
maxLinesPerPulse?: number;
|
|
@@ -326,9 +326,8 @@ export declare const CONFIG_KEYS: {
|
|
|
326
326
|
readonly review: "review";
|
|
327
327
|
readonly mutationTesting: "mutation-testing";
|
|
328
328
|
readonly allowToStopJobs: "allow-to-stop-jobs";
|
|
329
|
-
readonly
|
|
329
|
+
readonly launchAfterPulse: "launch-after-pulse";
|
|
330
330
|
readonly sentinel: "sentinel";
|
|
331
|
-
readonly testAdvisor: "test-advisor";
|
|
332
331
|
readonly testDir: "test-dir";
|
|
333
332
|
readonly conformanceTests: "conformance-tests";
|
|
334
333
|
readonly baseFolder: "base-folder";
|
|
@@ -350,10 +349,10 @@ export declare const CONFIG_KEYS: {
|
|
|
350
349
|
readonly turnLimit: "turn-limit";
|
|
351
350
|
};
|
|
352
351
|
/**
|
|
353
|
-
* The project's config - with a
|
|
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
|
|
354
353
|
* not parse.
|
|
355
354
|
*/
|
|
356
|
-
export declare function readProjectConfig(root: string,
|
|
355
|
+
export declare function readProjectConfig(root: string, module?: string): ProjectConfig;
|
|
357
356
|
/**
|
|
358
357
|
* What a command's own options say of the config's keys - `turri regenerate --harness-model`, `--coding-model`,
|
|
359
358
|
* `--judge-model`, `--review`, `--mutation-testing` - read as if the file had them: each takes its key's value, and
|
|
@@ -375,13 +374,42 @@ export declare function overrideConfig(overrides: RunOverrides): void;
|
|
|
375
374
|
export declare function booleanOption(value: string): boolean | undefined;
|
|
376
375
|
/** Where the test plain files are when `test-dir:` does not say. */
|
|
377
376
|
export declare const DEFAULT_TEST_DIR = "tests";
|
|
378
|
-
/** The folder of a module's project's test plain files: `test-dir:` - its
|
|
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. */
|
|
379
378
|
export declare function testDirOf(plainFile: string): string;
|
|
380
|
-
/** The config a spec is built with: its project's, with its module's
|
|
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`). */
|
|
381
380
|
export declare function configForSpec(plainFile: string): ProjectConfig;
|
|
382
381
|
/**
|
|
383
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
|
|
384
|
-
* 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.
|
|
385
386
|
*/
|
|
386
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[];
|
|
387
415
|
export {};
|