@turri-dev/cli 0.2.4-next.8422d0f → 0.2.4-next.d779410

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 (175) hide show
  1. package/README.md +7 -8
  2. package/dist/bedrock-region.js +3 -3
  3. package/dist/chat-idle.d.ts +2 -2
  4. package/dist/chat-idle.js +2 -2
  5. package/dist/chat-models.d.ts +1 -1
  6. package/dist/chat-models.js +1 -1
  7. package/dist/chat-scope.d.ts +1 -3
  8. package/dist/chat-skills.d.ts +1 -1
  9. package/dist/chat-skills.js +1 -1
  10. package/dist/chats.d.ts +44 -20
  11. package/dist/chats.js +125 -64
  12. package/dist/cli.js +12 -31
  13. package/dist/config-edit.d.ts +20 -8
  14. package/dist/config-edit.js +32 -26
  15. package/dist/config.d.ts +106 -78
  16. package/dist/config.js +267 -133
  17. package/dist/conform-cli.js +14 -3
  18. package/dist/conformance-switch.d.ts +13 -22
  19. package/dist/conformance-switch.js +37 -59
  20. package/dist/drift-cli.js +1 -1
  21. package/dist/extension.d.ts +17 -10
  22. package/dist/extension.js +435 -532
  23. package/dist/genome.js +10 -49
  24. package/dist/graph.js +3 -5
  25. package/dist/host-session.d.ts +11 -21
  26. package/dist/host-session.js +6 -8
  27. package/dist/host.d.ts +4 -4
  28. package/dist/host.js +4 -7
  29. package/dist/identity.js +2 -3
  30. package/dist/init-config.d.ts +1 -2
  31. package/dist/init-config.js +10 -17
  32. package/dist/installed-providers.d.ts +1 -1
  33. package/dist/installed-providers.js +1 -1
  34. package/dist/launch-agent.d.ts +51 -0
  35. package/dist/launch-agent.js +267 -0
  36. package/dist/{release-cli.js → launch-cli.js} +41 -24
  37. package/dist/launch-session.d.ts +68 -0
  38. package/dist/launch-session.js +217 -0
  39. package/dist/launch-tools.d.ts +28 -0
  40. package/dist/launch-tools.js +69 -0
  41. package/dist/launch-track.d.ts +125 -0
  42. package/dist/launch-track.js +320 -0
  43. package/dist/loop-cli.d.ts +4 -3
  44. package/dist/loop-cli.js +17 -15
  45. package/dist/loop-tools.d.ts +45 -21
  46. package/dist/loop-tools.js +155 -90
  47. package/dist/new-project.js +2 -2
  48. package/dist/notice.d.ts +7 -6
  49. package/dist/parse-cli.js +2 -2
  50. package/dist/pi-launch.js +4 -1
  51. package/dist/pi-settings.d.ts +4 -0
  52. package/dist/pi-settings.js +39 -0
  53. package/dist/pi.js +12 -9
  54. package/dist/plain/check.d.ts +2 -9
  55. package/dist/plain/check.js +6 -39
  56. package/dist/plain-files.d.ts +2 -2
  57. package/dist/plain-files.js +7 -7
  58. package/dist/regenerate/activity.d.ts +0 -7
  59. package/dist/regenerate/activity.js +2 -20
  60. package/dist/regenerate/agent-env.d.ts +1 -1
  61. package/dist/regenerate/agent-env.js +3 -3
  62. package/dist/regenerate/agent-shell.js +5 -3
  63. package/dist/regenerate/audit.js +9 -0
  64. package/dist/regenerate/base-folder.d.ts +2 -2
  65. package/dist/regenerate/base-folder.js +1 -1
  66. package/dist/regenerate/cases.js +7 -0
  67. package/dist/regenerate/chunk-plan.d.ts +5 -0
  68. package/dist/regenerate/chunk-plan.js +16 -1
  69. package/dist/regenerate/command-check.d.ts +7 -1
  70. package/dist/regenerate/command-check.js +43 -1
  71. package/dist/regenerate/delivery.d.ts +1 -1
  72. package/dist/regenerate/delivery.js +3 -3
  73. package/dist/regenerate/drift.d.ts +4 -0
  74. package/dist/regenerate/drift.js +26 -6
  75. package/dist/regenerate/failure-reports.d.ts +28 -0
  76. package/dist/regenerate/failure-reports.js +79 -0
  77. package/dist/regenerate/job-panel.js +3 -1
  78. package/dist/regenerate/jobs-tree.js +1 -1
  79. package/dist/regenerate/jobs.d.ts +4 -2
  80. package/dist/regenerate/jobs.js +14 -10
  81. package/dist/regenerate/launch.d.ts +154 -0
  82. package/dist/regenerate/{release.js → launch.js} +195 -51
  83. package/dist/regenerate/ledger-view.d.ts +11 -24
  84. package/dist/regenerate/ledger-view.js +14 -60
  85. package/dist/regenerate/ledger.d.ts +34 -16
  86. package/dist/regenerate/ledger.js +1 -1
  87. package/dist/regenerate/lineage.d.ts +2 -0
  88. package/dist/regenerate/lineage.js +8 -0
  89. package/dist/regenerate/loop.d.ts +54 -67
  90. package/dist/regenerate/loop.js +312 -148
  91. package/dist/regenerate/model-names.d.ts +33 -0
  92. package/dist/regenerate/{engine.js → model-names.js} +2 -28
  93. package/dist/regenerate/paths.d.ts +3 -3
  94. package/dist/regenerate/paths.js +4 -4
  95. package/dist/regenerate/records.d.ts +11 -0
  96. package/dist/regenerate/records.js +15 -0
  97. package/dist/regenerate/regenerate.d.ts +0 -2
  98. package/dist/regenerate/regenerate.js +4 -15
  99. package/dist/regenerate/renames.js +4 -4
  100. package/dist/regenerate/requires.d.ts +7 -0
  101. package/dist/regenerate/requires.js +24 -18
  102. package/dist/regenerate/scripts-being-written.d.ts +4 -4
  103. package/dist/regenerate/scripts-being-written.js +3 -3
  104. package/dist/regenerate/spec-map.js +3 -3
  105. package/dist/regenerate/standing.js +1 -1
  106. package/dist/regenerate/submit-work.d.ts +2 -0
  107. package/dist/regenerate/submit-work.js +8 -3
  108. package/dist/regenerate/test-scripts.d.ts +2 -1
  109. package/dist/regenerate/test-scripts.js +33 -23
  110. package/dist/regenerate/testing-steps.d.ts +16 -5
  111. package/dist/regenerate/testing-steps.js +28 -9
  112. package/dist/regenerate-cli.js +18 -9
  113. package/dist/self-invocation.d.ts +11 -0
  114. package/dist/self-invocation.js +36 -10
  115. package/dist/sentinel-check.d.ts +3 -3
  116. package/dist/sentinel-check.js +3 -3
  117. package/dist/sentinel.d.ts +18 -12
  118. package/dist/sentinel.js +75 -46
  119. package/dist/{config-command.d.ts → settings.d.ts} +13 -8
  120. package/dist/{config-command.js → settings.js} +155 -24
  121. package/dist/setup.d.ts +2 -2
  122. package/dist/setup.js +7 -7
  123. package/dist/skill.d.ts +0 -11
  124. package/dist/skill.js +0 -9
  125. package/dist/tools.js +2 -3
  126. package/dist/turri-versions.js +2 -1
  127. package/docs/README.md +4 -6
  128. package/docs/authoring-plain.md +3 -3
  129. package/docs/chats.md +6 -9
  130. package/docs/claude-subscription.md +2 -2
  131. package/docs/config.md +61 -51
  132. package/docs/development.md +4 -5
  133. package/docs/headless.md +7 -6
  134. package/docs/hosting.md +25 -24
  135. package/docs/launch.md +67 -0
  136. package/docs/parser.md +3 -3
  137. package/docs/regenerating.md +30 -22
  138. package/docs/sandbox.md +3 -3
  139. package/docs/sentinel.md +28 -16
  140. package/docs/skills-and-gates.md +6 -11
  141. package/docs/using.md +25 -42
  142. package/genome/rules/project-model.md +2 -1
  143. package/genome/rules/test-plain-files.md +15 -7
  144. package/genome/rules/turri-regeneration.md +7 -10
  145. package/genome/skills/convert-old-syntax/SKILL.md +5 -5
  146. package/genome/skills/implement-conformance-testing-script/SKILL.md +2 -2
  147. package/genome/skills/implement-unit-testing-script/SKILL.md +3 -3
  148. package/package.json +1 -1
  149. package/dist/advisor-chat.d.ts +0 -63
  150. package/dist/advisor-chat.js +0 -290
  151. package/dist/change-plain-cli.js +0 -55
  152. package/dist/ledger-cli.d.ts +0 -1
  153. package/dist/ledger-cli.js +0 -50
  154. package/dist/ledger-tools.d.ts +0 -10
  155. package/dist/ledger-tools.js +0 -64
  156. package/dist/regenerate/advisor-records.d.ts +0 -93
  157. package/dist/regenerate/advisor-records.js +0 -110
  158. package/dist/regenerate/advisor-runs.d.ts +0 -87
  159. package/dist/regenerate/advisor-runs.js +0 -327
  160. package/dist/regenerate/engine.d.ts +0 -52
  161. package/dist/regenerate/release.d.ts +0 -121
  162. package/dist/regenerate/test-advisor.d.ts +0 -101
  163. package/dist/regenerate/test-advisor.js +0 -379
  164. package/dist/release-agent.d.ts +0 -43
  165. package/dist/release-agent.js +0 -130
  166. package/dist/release-cli.d.ts +0 -1
  167. package/dist/release-tools.d.ts +0 -44
  168. package/dist/release-tools.js +0 -170
  169. package/dist/spec-tools.d.ts +0 -36
  170. package/dist/spec-tools.js +0 -128
  171. package/dist/stacks.d.ts +0 -13
  172. package/dist/stacks.js +0 -96
  173. package/docs/deploy.md +0 -48
  174. package/docs/test-advisor.md +0 -110
  175. /package/dist/{change-plain-cli.d.ts → launch-cli.d.ts} +0 -0
@@ -7,23 +7,33 @@ as module:func-id, or every one with scenarios - on the code as it is built, as
7
7
  exactly their conformance and acceptance scenarios, following the spec's test reqs, with the whole suite
8
8
  the module inherits, a failure fixed in the test or the code, whichever is wrong. A functional spec with
9
9
  no scenarios is refused: write them first. So is a module with no test reqs, or no conformance testing
10
- script for its stack: the refusal names the next step. Every functional spec tested goes in one pulse,
11
- as far as the size guardrail lets.
10
+ script: the refusal names the next step. Every functional spec tested goes in one pulse,
11
+ as far as the size guardrail lets. A functional spec named whose tests are written has them written
12
+ again: deleted and written anew from its scenarios, its code untouched.
12
13
 
13
14
  --one-by-one a pulse a functional spec instead
15
+ --from-scratch take out the tests folder where the module's code lives - the tip of its chain - (its
16
+ lineage keeps it) and write the tests again, starting from a copy of the tests of the
17
+ module the tip requires; the code untouched
18
+ --from-scratch-chain the same, starting from nothing: every functional spec of the chain's tests written again
14
19
  --harness-model <p/id> config.turri.yaml's harness-model for this run: the planner, a diagnosis
15
20
  --coding-model <p/id> its coding-model, --model too: the agents that build
16
21
  --judge-model <p/id> its judge-model: the judge and the test review
17
22
  --review <true|false> its review: whether the code and its tests are reviewed once they pass
18
23
  --build-dir <dir> as the run ends, export the code there (see turri regenerate --help)
19
24
  --report <file.json> write a report of the run there (see turri regenerate --help)`;
20
- const { positional, options } = parseArgs(process.argv.slice(2), ["--one-by-one"], USAGE, ["--build-dir", "--report", "--harness-model", "--judge-model", "--review"]);
25
+ const { positional, options } = parseArgs(process.argv.slice(2), ["--one-by-one", "--from-scratch", "--from-scratch-chain"], USAGE, ["--build-dir", "--report", "--harness-model", "--judge-model", "--review"]);
21
26
  const { report, buildDir } = headlessOptions(options);
22
27
  const [plainFile, ...funcIds] = positional;
23
28
  if (plainFile === undefined) {
24
29
  console.error(USAGE);
25
30
  process.exit(1);
26
31
  }
32
+ const scratch = options["from-scratch-chain"] !== undefined ? "chain" : options["from-scratch"] !== undefined ? "module" : undefined;
33
+ if (scratch !== undefined && funcIds.length > 0) {
34
+ console.error(`Name functional specs or --from-scratch${scratch === "chain" ? "-chain" : ""}, not both: from scratch writes every one of them again.`);
35
+ process.exit(1);
36
+ }
27
37
  runLoop({
28
38
  plainFile,
29
39
  ...(buildDir !== undefined ? { buildDir } : {}),
@@ -32,6 +42,7 @@ runLoop({
32
42
  ask: (loop) => loop.conformance(plainFile, {
33
43
  ...(funcIds.length > 0 ? { funcIds } : {}),
34
44
  ...(options["one-by-one"] !== undefined ? { separately: true } : {}),
45
+ ...(scratch !== undefined ? { fromScratch: scratch } : {}),
35
46
  }),
36
47
  }).catch((error) => {
37
48
  console.error(error instanceof Error ? error.message : error);
@@ -1,22 +1,21 @@
1
- import { type ToolDefinition } from "@earendil-works/pi-coding-agent";
2
1
  /**
3
- * Whether a project's functional specs are conformance tested: `conformance-tests:` in its config, a stack's own over the
4
- * project's, false when unset. Off, nothing of conformance testing runs - no conformance pulse, no conformance testing
5
- * script, the test advisor and the chat's conform and evaluate_tests off; the test plain files there are kept, and not
6
- * tested. The chat always knows it, and how they are turned on: the person asking for tests, or agreeing to the chat's
7
- * offer of them, turns them on - for this session and the next, written into the config.
2
+ * Whether a project's functional specs are conformance tested: `conformance-tests:` in its config, a module's own file's
3
+ * over the project's, false when unset. Conformance testing is a validation step that makes each change take about twice as long,
4
+ * so it is off until the person turns it on - with /conform, or the setting - and they keep it off to iterate fast. Off,
5
+ * nothing of conformance testing runs - no conformance pulse, no conformance testing script, the
6
+ * chat's conform refused; the test plain files there are kept, and not tested. The chat never turns them on: it says why
7
+ * it wants them, and the person decides.
8
8
  */
9
- /** The chat's tools that run conformance testing: there while the tests are on. */
10
- export declare const CONFORMANCE_TOOLS: string[];
11
- /** The chat's tool that turns them on: there while they are off. */
12
- export declare const TURN_ON_TOOL = "turn_on_conformance_tests";
13
- /** Whether a module's functional specs are conformance tested: its stack's `conformance-tests:` over the project's. */
9
+ /** Why the chat's conform, or a skill that writes the conformance testing script, is refused while they are off. */
10
+ export declare const CONFORMANCE_OFF_REFUSAL: string;
11
+ /** Whether a module's functional specs are conformance tested: its own file's `conformance-tests:` over the project's. */
14
12
  export declare function conformanceTestsOn(plainFile: string): boolean;
15
- /** Whether the project conformance tests anything: its own config, or a stack's - for the chat's tools, which are the project's. */
13
+ /** Whether the project conformance tests anything: its own config, or a module's own file - for the chat's tools, which are the project's. */
16
14
  export declare function conformanceTestsOnIn(project: string): boolean;
17
15
  /**
18
- * Turn conformance testing on: `conformance-tests: true` written where the module's value comes from - its stack's file
19
- * when that names the key, else config.turri.yaml - and in effect at once. Says which file.
16
+ * Turn conformance testing on: `conformance-tests: true` written where the module's value comes from - its config
17
+ * file, its own or one of a module it requires, when that names the key, else config.turri.yaml - and in effect at once.
18
+ * Says which file.
20
19
  */
21
20
  export declare function turnOnConformanceTests(project: string, plainFile?: string): string;
22
21
  /**
@@ -24,11 +23,3 @@ export declare function turnOnConformanceTests(project: string, plainFile?: stri
24
23
  * turned on, and that it may offer it.
25
24
  */
26
25
  export declare function conformanceBlock(on: boolean): string;
27
- /**
28
- * turn_on_conformance_tests: the chat turns conformance testing on, the person having asked for it or agreed to it.
29
- * `turnOn` is the session's (extension.ts `turnOnConformance`): the setting written, every chat's tools switched - the
30
- * file written, from the project.
31
- */
32
- export declare function turnOnConformanceTestsTool(options: {
33
- turnOn: (plainFile?: string) => string;
34
- }): ToolDefinition;
@@ -1,21 +1,21 @@
1
1
  import { existsSync, readFileSync, writeFileSync } from "node:fs";
2
2
  import { join, resolve } from "node:path";
3
- import { defineTool } from "@earendil-works/pi-coding-agent";
4
- import { Type } from "typebox";
5
- import { adoptLegacyConfig, CONFIG_FILE, CONFIG_KEYS, configForSpec, readConfigFile, readProjectConfig, stackConfigFileIn, stackForModule, stackOf, stacksOf } from "./config.js";
3
+ import { adoptLegacyConfig, CONFIG_FILE, CONFIG_KEYS, configForSpec, readConfigFile, readProjectConfig, moduleConfigFileIn, configModuleFor, moduleConfigsOf } from "./config.js";
6
4
  import { withSetting, writeSetting } from "./config-edit.js";
7
5
  /**
8
- * Whether a project's functional specs are conformance tested: `conformance-tests:` in its config, a stack's own over the
9
- * project's, false when unset. Off, nothing of conformance testing runs - no conformance pulse, no conformance testing
10
- * script, the test advisor and the chat's conform and evaluate_tests off; the test plain files there are kept, and not
11
- * tested. The chat always knows it, and how they are turned on: the person asking for tests, or agreeing to the chat's
12
- * offer of them, turns them on - for this session and the next, written into the config.
6
+ * Whether a project's functional specs are conformance tested: `conformance-tests:` in its config, a module's own file's
7
+ * over the project's, false when unset. Conformance testing is a validation step that makes each change take about twice as long,
8
+ * so it is off until the person turns it on - with /conform, or the setting - and they keep it off to iterate fast. Off,
9
+ * nothing of conformance testing runs - no conformance pulse, no conformance testing script, the
10
+ * chat's conform refused; the test plain files there are kept, and not tested. The chat never turns them on: it says why
11
+ * it wants them, and the person decides.
13
12
  */
14
- /** The chat's tools that run conformance testing: there while the tests are on. */
15
- export const CONFORMANCE_TOOLS = ["conform", "evaluate_tests"];
16
- /** The chat's tool that turns them on: there while they are off. */
17
- export const TURN_ON_TOOL = "turn_on_conformance_tests";
18
- /** Whether a module's functional specs are conformance tested: its stack's `conformance-tests:` over the project's. */
13
+ /** Why the chat's conform, or a skill that writes the conformance testing script, is refused while they are off. */
14
+ export const CONFORMANCE_OFF_REFUSAL = "Conformance tests are off for this project (conformance-tests: false, or unset), and turning them on is the person's " +
15
+ "decision: they make each change take about twice as long, and the person keeps them off to iterate fast. Tell the " +
16
+ "person, in a line or two, why you want conformance tests here; they decide, and turn them on with /conform - which " +
17
+ "also starts them - or /settings conformance-tests true. Nothing was started.";
18
+ /** Whether a module's functional specs are conformance tested: its own file's `conformance-tests:` over the project's. */
19
19
  export function conformanceTestsOn(plainFile) {
20
20
  try {
21
21
  return configForSpec(resolve(plainFile)).conformanceTests === true;
@@ -24,29 +24,29 @@ export function conformanceTestsOn(plainFile) {
24
24
  return false;
25
25
  }
26
26
  }
27
- /** Whether the project conformance tests anything: its own config, or a stack's - for the chat's tools, which are the project's. */
27
+ /** Whether the project conformance tests anything: its own config, or a module's own file - for the chat's tools, which are the project's. */
28
28
  export function conformanceTestsOnIn(project) {
29
29
  try {
30
- const stacks = [stackOf(project), ...stacksOf(project)].filter((stack) => stack !== undefined);
31
- return readProjectConfig(project).conformanceTests === true || stacks.some((stack) => readProjectConfig(project, stack).conformanceTests === true);
30
+ return readProjectConfig(project).conformanceTests === true || moduleConfigsOf(project).some((module) => readProjectConfig(project, module).conformanceTests === true);
32
31
  }
33
32
  catch {
34
33
  return false;
35
34
  }
36
35
  }
37
36
  /**
38
- * Turn conformance testing on: `conformance-tests: true` written where the module's value comes from - its stack's file
39
- * when that names the key, else config.turri.yaml - and in effect at once. Says which file.
37
+ * Turn conformance testing on: `conformance-tests: true` written where the module's value comes from - its config
38
+ * file, its own or one of a module it requires, when that names the key, else config.turri.yaml - and in effect at once.
39
+ * Says which file.
40
40
  */
41
41
  export function turnOnConformanceTests(project, plainFile) {
42
- const stack = plainFile !== undefined ? stackForModule(resolve(plainFile)) : stackOf(project);
43
- if (stack !== undefined) {
44
- const file = join(project, stackConfigFileIn(project, stack));
42
+ const module = plainFile !== undefined ? configModuleFor(resolve(plainFile)) : undefined;
43
+ if (module !== undefined) {
44
+ const file = join(project, moduleConfigFileIn(project, module));
45
45
  if (existsSync(file) && readConfigFile(file).conformanceTests !== undefined) {
46
46
  adoptLegacyConfig(project);
47
- const own = join(project, stackConfigFileIn(project, stack));
47
+ const own = join(project, moduleConfigFileIn(project, module));
48
48
  writeFileSync(own, withSetting(readFileSync(own, "utf8"), CONFIG_KEYS.conformanceTests, true));
49
- return stackConfigFileIn(project, stack);
49
+ return moduleConfigFileIn(project, module);
50
50
  }
51
51
  }
52
52
  writeSetting(project, CONFIG_KEYS.conformanceTests, true);
@@ -65,44 +65,22 @@ export function conformanceBlock(on) {
65
65
  "<conformance-tests>",
66
66
  what,
67
67
  on
68
- ? "They are on here (conformance-tests: true): functional specs with scenarios are conformance tested, and the test advisor checks new ones in the background."
68
+ ? [
69
+ "They are on here (conformance-tests: true): functional specs with scenarios are conformance tested once their code is",
70
+ "built. As you write or change a functional spec, judge whether it needs scenarios, as the rules on test plain files say,",
71
+ "and write them when it does - in the same change, a visible ***plain change the person reviews like any other.",
72
+ "Scenarios are tested only once their module has test reqs and the project a conformance testing script: when you",
73
+ "write scenarios and one of those is missing, write it first, in that order - the test reqs, then the script with",
74
+ "implement-conformance-testing-script - asking nothing: conformance tests on is the person's yes to them.",
75
+ ].join("\n")
69
76
  : [
70
- "They are off here (conformance-tests: false, or unset): no scenarios are written or tested, no conformance testing script, the test",
71
- "advisor is off, and conform and evaluate_tests are not among your tools. Test plain files already there are kept, and not tested.",
72
- `When the person asks for conformance tests, or testing scenarios, call ${TURN_ON_TOOL} - their asking is their yes - then`,
73
- "go on with what they asked: the test reqs, the conformance testing script, the scenarios.",
74
- "You may offer them yourself, once and in a line, never turning them on unasked: when a functional spec could go wrong",
75
- "silently, or the coding agent keeps failing at one - say what they would add, and ask. A yes, and you call the tool.",
76
- "Asked how they are turned on: by asking you, /conform - which turns them on and tests what is built - or /turri-config conformance-tests true.",
77
+ "They are off here (conformance-tests: false, or unset). They make each change take about twice as long, so the person",
78
+ "keeps them off to iterate fast, and turning them on is theirs alone. While off, no conformance tests are written or run,",
79
+ "no conformance testing script either, and conform is refused. Test plain files already there are",
80
+ "kept, and not tested. When you think conformance tests are worth it here - the person asks for tests, a functional spec",
81
+ "could go wrong silently, or the coding agent keeps failing at one - tell them in a line or two why, and what it costs.",
82
+ "They decide, and turn them on with /conform - which also tests what is built - or /settings conformance-tests true.",
77
83
  ].join("\n"),
78
84
  "</conformance-tests>",
79
85
  ].join("\n");
80
86
  }
81
- /**
82
- * turn_on_conformance_tests: the chat turns conformance testing on, the person having asked for it or agreed to it.
83
- * `turnOn` is the session's (extension.ts `turnOnConformance`): the setting written, every chat's tools switched - the
84
- * file written, from the project.
85
- */
86
- export function turnOnConformanceTestsTool(options) {
87
- return defineTool({
88
- name: TURN_ON_TOOL,
89
- label: "Turn on conformance tests",
90
- description: "Turn conformance tests on for this project - conformance-tests: true in its config, for this session and the next - " +
91
- "once the person asked for conformance tests or testing scenarios, or agreed when you offered them. conform and " +
92
- "evaluate_tests become your tools, the test advisor starts checking new functional specs, and the work loop writes " +
93
- "and runs the conformance tests of every functional spec with scenarios once its code is built. Never call it unasked.",
94
- promptSnippet: `${TURN_ON_TOOL}: turn conformance tests on, the person having asked for them or agreed`,
95
- parameters: Type.Object({
96
- plain_file: Type.Optional(Type.String({ description: "The module the tests are for: its stack's config is written when that names the key. Omitted: config.turri.yaml." })),
97
- }),
98
- async execute(_id, params) {
99
- const file = options.turnOn(params.plain_file);
100
- const text = `Conformance tests are on for this project now - conformance-tests: true, written in ${file}. Say so to the person in a line. ` +
101
- "conform and evaluate_tests are your tools from your next turn, and the test advisor checks new functional specs. Go on " +
102
- "with what they asked: the test reqs, the conformance testing script, the scenarios - in that order, only what is missing. " +
103
- "Functional specs with scenarios written already, their code built, are tested once the module is next regenerated: " +
104
- "call conform for them to have their tests written now.";
105
- return { content: [{ type: "text", text }], details: { file } };
106
- },
107
- });
108
- }
package/dist/drift-cli.js CHANGED
@@ -18,7 +18,7 @@ if (named === undefined) {
18
18
  }
19
19
  try {
20
20
  refuseTestPlainFile(named);
21
- const loop = createWorkLoop({ registry: createJobRegistry(), cwd: process.cwd(), planner: false, dryRun: true });
21
+ const loop = createWorkLoop({ registry: createJobRegistry(), cwd: process.cwd(), planner: false });
22
22
  console.log(describeDrift(loop.drift(named)));
23
23
  }
24
24
  catch (error) {
@@ -4,9 +4,9 @@ import { stackOnMachine } from "./stack.ts";
4
4
  import { createAskUserTool } from "./tools.ts";
5
5
  import { fromWorkingDir } from "./loop-tools.ts";
6
6
  import { type WorkLoop } from "./regenerate/loop.ts";
7
- import { type TestAdvisor } from "./regenerate/advisor-runs.ts";
8
7
  import { type AskUser, type AskUserIO } from "./ask.ts";
9
8
  import { type TurriCore, type TurriHost } from "./chats.ts";
9
+ import { type Job } from "./regenerate/jobs.ts";
10
10
  /**
11
11
  * Puts a skill step's question to the person, when there is one to ask.
12
12
  *
@@ -15,6 +15,12 @@ import { type TurriCore, type TurriHost } from "./chats.ts";
15
15
  * exchange is therefore reported back, so the interview is visible while it happens and
16
16
  * survives in the tool's result afterwards.
17
17
  */
18
+ /**
19
+ * What a question gets with nobody to answer it - print, json and rpc modes. What is the agent's to decide it decides; the
20
+ * person's own files it leaves as they are, as it would have without their yes - a testing script it finds wrong is said,
21
+ * not rewritten.
22
+ */
23
+ export declare const NO_USER_ANSWER: string;
18
24
  export declare function askUserVia(ctx: ExtensionContext, onExchange: (question: string, answer: string, said?: string) => void,
19
25
  /** Given, "/btw ..." typed as an answer is a side question: answered with this, and the question asked again. */
20
26
  aside?: (question: string) => Promise<string>,
@@ -39,11 +45,6 @@ export type { TurriHost } from "./chats.ts";
39
45
  export declare function createTurriCore(host?: TurriHost, options?: {
40
46
  persist?: boolean;
41
47
  dialogs?: (chat: string) => AskUserIO | undefined;
42
- /**
43
- * Whether the session has a test advisor (docs/test-advisor.md): the terminal's chat and a host - never pi's print,
44
- * json and rpc modes, which end when the answer is printed, nor a headless command, which builds its own loop.
45
- */
46
- advisor?: boolean;
47
48
  }): TurriCore;
48
49
  /** The session of this process: pi-launch.ts's, or one made as pi first builds the extension (`pi -e src/extension.ts`). */
49
50
  export declare function processSession(make?: () => TurriCore): TurriCore;
@@ -137,14 +138,20 @@ export declare function machineNeeds(cwd: string, work?: (cwd: string) => Return
137
138
  export declare function projectConfigBlock(root: string): string;
138
139
  /**
139
140
  * Conformance tests turned on, for the session: `conformance-tests: true` written where the module's value comes from
140
- * (conformance-switch.ts), and every open chat's tools switched to match - what the chat's turn_on_conformance_tests and a
141
- * host's turnOnConformanceTests both do. `plainFile`, absolute or from the project, picks the module whose stack's file
141
+ * (conformance-switch.ts) - what /conform does when they are off, and a host's turnOnConformance. Every chat is told at
142
+ * its next turn. `plainFile`, absolute or from the project, picks the module whose own file
142
143
  * is written when that names the key. Returns the file written, from the project. Starts no conformance pulse.
143
144
  */
144
145
  export declare function turnOnConformance(core: TurriCore, plainFile?: string): string;
145
- /** The session's test advisor, when it has one: the chat's and a host's - never pi's print, json and rpc modes'. */
146
- export declare function sessionAdvisor(session: TurriCore): TestAdvisor | undefined;
147
146
  export { fromWorkingDir };
147
+ /**
148
+ * What a chat's agent is told of a pulse it asked for that ended, with the sentinel off. One that landed under
149
+ * launch-after-pulse is being launched as it is told: it says so, and offers nothing else for it - it is told once the
150
+ * launch ends.
151
+ */
152
+ export declare function pulseEndNote(job: Job, options?: {
153
+ launching?: boolean;
154
+ }): string;
148
155
  /**
149
156
  * What the agent is to do with a job that just ended, unasked: what the project's guidance says to do then, or else say
150
157
  * in a line or two what ended - the person saw it end already, in the transcript.