@turri-dev/cli 0.2.4-next.efe96fe → 0.2.4-next.f26a225
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 +2 -2
- package/dist/chat-skills.d.ts +1 -1
- package/dist/chat-skills.js +1 -1
- package/dist/chats.d.ts +42 -8
- package/dist/chats.js +122 -38
- package/dist/cli.js +1 -1
- package/dist/config-edit.js +4 -4
- package/dist/config.d.ts +48 -11
- package/dist/config.js +102 -13
- package/dist/extension.d.ts +9 -0
- package/dist/extension.js +184 -109
- package/dist/genome.js +1 -1
- package/dist/host-session.d.ts +6 -5
- package/dist/host-session.js +2 -2
- package/dist/host.d.ts +2 -0
- package/dist/identity.js +2 -2
- package/dist/init-config.d.ts +1 -1
- package/dist/init-config.js +7 -7
- package/dist/launch-agent.d.ts +51 -0
- package/dist/launch-agent.js +267 -0
- package/dist/{release-cli.js → launch-cli.js} +41 -24
- package/dist/launch-session.d.ts +68 -0
- package/dist/launch-session.js +217 -0
- package/dist/launch-tools.d.ts +28 -0
- package/dist/launch-tools.js +69 -0
- package/dist/launch-track.d.ts +125 -0
- package/dist/launch-track.js +320 -0
- package/dist/loop-cli.js +4 -4
- package/dist/loop-tools.d.ts +8 -3
- package/dist/loop-tools.js +37 -32
- package/dist/notice.d.ts +7 -6
- package/dist/plain-files.d.ts +2 -2
- package/dist/plain-files.js +3 -3
- package/dist/regenerate/command-check.d.ts +7 -1
- package/dist/regenerate/command-check.js +43 -1
- package/dist/regenerate/delivery.d.ts +1 -1
- package/dist/regenerate/delivery.js +3 -3
- package/dist/regenerate/launch.d.ts +154 -0
- package/dist/regenerate/{release.js → launch.js} +195 -51
- package/dist/regenerate/ledger.d.ts +32 -1
- package/dist/regenerate/lineage.d.ts +2 -0
- package/dist/regenerate/lineage.js +8 -0
- package/dist/regenerate/loop.d.ts +6 -5
- package/dist/regenerate/loop.js +16 -17
- package/dist/regenerate/paths.d.ts +2 -2
- package/dist/regenerate/paths.js +2 -2
- package/dist/self-invocation.js +7 -7
- package/dist/sentinel-check.d.ts +3 -3
- package/dist/sentinel-check.js +3 -3
- package/dist/sentinel.d.ts +18 -12
- package/dist/sentinel.js +68 -42
- package/docs/README.md +2 -2
- package/docs/chats.md +2 -2
- package/docs/config.md +9 -9
- package/docs/development.md +1 -1
- package/docs/headless.md +1 -1
- package/docs/hosting.md +14 -13
- package/docs/launch.md +67 -0
- package/docs/parser.md +1 -1
- package/docs/regenerating.md +3 -3
- package/docs/sandbox.md +3 -3
- package/docs/sentinel.md +24 -12
- package/docs/skills-and-gates.md +3 -3
- package/docs/using.md +7 -7
- package/genome/rules/turri-regeneration.md +1 -1
- package/package.json +1 -1
- package/dist/regenerate/release.d.ts +0 -121
- package/dist/release-agent.d.ts +0 -43
- package/dist/release-agent.js +0 -130
- package/dist/release-tools.d.ts +0 -44
- package/dist/release-tools.js +0 -170
- package/docs/deploy.md +0 -48
- /package/dist/{release-cli.d.ts → launch-cli.d.ts} +0 -0
package/dist/regenerate/loop.js
CHANGED
|
@@ -6,7 +6,7 @@ import { ACCEPTANCE_TESTS, CONFORMANCE_TESTS, FUNCTIONAL_REQUIREMENTS, REQUIRED_
|
|
|
6
6
|
import { testPlainFilesOf } from "../test-plain-files.js";
|
|
7
7
|
import { reportActivity, reportStage } from "./activity.js";
|
|
8
8
|
import { llmChunkAgents, MAX_LINES_PER_JOB, MAX_SPECS_PER_JOB, planChunks, stepsOf } from "./chunk-plan.js";
|
|
9
|
-
import { commitNotes, landWork, recordHistory, resetToLastCommit } from "./lineage.js";
|
|
9
|
+
import { commitNotes, landWork, lastCommit, recordHistory, resetToLastCommit } from "./lineage.js";
|
|
10
10
|
import { firstLine, record } from "./ledger.js";
|
|
11
11
|
import { NOTES_FILE, recordPulse } from "./notes.js";
|
|
12
12
|
import { formatDuration } from "./jobs.js";
|
|
@@ -642,26 +642,11 @@ export function createWorkLoop(options) {
|
|
|
642
642
|
cwd: options.cwd,
|
|
643
643
|
...(steering !== undefined ? { steering } : {}),
|
|
644
644
|
}, onDelta);
|
|
645
|
-
const report = result.report;
|
|
646
|
-
// Released as its last stage, when the config says so: the module's next pulse starts on what is released.
|
|
647
|
-
let released;
|
|
648
|
-
if (result.landed && options.release !== undefined && configForSpec(tip.plainFile).releaseAfterPulse === true) {
|
|
649
|
-
reportStage(`module ${tip.moduleName}: releasing what this pulse landed (release-after-pulse)`);
|
|
650
|
-
try {
|
|
651
|
-
released = `Released after the pulse: ${(await options.release({ plainFile: tip.plainFile, moduleName: tip.moduleName, title: planned.title, onDelta })).trim()}`;
|
|
652
|
-
}
|
|
653
|
-
catch (error) {
|
|
654
|
-
// What landed stays landed: a release that fails is said, and the next pulse goes on.
|
|
655
|
-
released = `The release after the pulse failed: ${error instanceof Error ? error.message : String(error)}`;
|
|
656
|
-
}
|
|
657
|
-
reportActivity(` ${released.split("\n")[0]}`);
|
|
658
|
-
}
|
|
659
645
|
return {
|
|
660
|
-
report:
|
|
646
|
+
report: result.report,
|
|
661
647
|
details: {
|
|
662
648
|
passed: result.landed,
|
|
663
649
|
landed: result.landed,
|
|
664
|
-
...(released !== undefined ? { released: true } : {}),
|
|
665
650
|
...(result.story !== undefined ? { story: result.story } : {}),
|
|
666
651
|
// The spec gaps its agents met, for a headless run to say - in the chat the report puts them to the person.
|
|
667
652
|
...(result.specGaps !== undefined && result.specGaps.length > 0 ? { specGaps: result.specGaps } : {}),
|
|
@@ -769,6 +754,20 @@ export function createWorkLoop(options) {
|
|
|
769
754
|
// What it did, in the notes every agent after reads - once anything it did not land is rolled back, so the line stays.
|
|
770
755
|
if (running !== undefined)
|
|
771
756
|
notePulse(state, running, settled, landed);
|
|
757
|
+
// Landed: the commit it ends on, its line in the notes amended in - told before the codebase's next pulse starts.
|
|
758
|
+
if (running !== undefined && settled !== undefined && landed) {
|
|
759
|
+
const tip = tipEntry(state);
|
|
760
|
+
const commit = lastCommit(tip.buildDir);
|
|
761
|
+
if (commit !== undefined) {
|
|
762
|
+
settled.details = { ...settled.details, commit };
|
|
763
|
+
try {
|
|
764
|
+
options.landed?.({ job: settled, plainFile: tip.plainFile, moduleName: tip.moduleName, commit, title: running.planned.title });
|
|
765
|
+
}
|
|
766
|
+
catch {
|
|
767
|
+
/* what is done with a landing is not the loop's to fail on */
|
|
768
|
+
}
|
|
769
|
+
}
|
|
770
|
+
}
|
|
772
771
|
void tick();
|
|
773
772
|
};
|
|
774
773
|
/**
|
|
@@ -56,11 +56,11 @@ export declare function modulesRootOf(dir: string): string;
|
|
|
56
56
|
export declare function modulesScratchDir(dir: string): string;
|
|
57
57
|
/** Make `path` inside the modules' scratch, which ignores itself. Returns `path`. */
|
|
58
58
|
export declare function ensureInModulesScratch(dir: string, path: string): string;
|
|
59
|
-
/** Where the project keeps what
|
|
59
|
+
/** Where the project keeps what a launch puts out: `dist/`, beside `plain_modules`. */
|
|
60
60
|
export declare const DIST_DIR = "dist";
|
|
61
61
|
/**
|
|
62
62
|
* Where a person tries a module: `<project>/dist/<module>`, the module's code as its last commit has
|
|
63
|
-
* it. Outside `plain_modules`, so no agent can reach it, and replaced whole by every
|
|
63
|
+
* it. Outside `plain_modules`, so no agent can reach it, and replaced whole by every launch.
|
|
64
64
|
*/
|
|
65
65
|
export declare function distDirFor(projectDir: string, moduleName: string): string;
|
|
66
66
|
/**
|
package/dist/regenerate/paths.js
CHANGED
|
@@ -96,11 +96,11 @@ export function modulesScratchDir(dir) {
|
|
|
96
96
|
export function ensureInModulesScratch(dir, path) {
|
|
97
97
|
return ensureInScratch(modulesScratchDir(dir), path);
|
|
98
98
|
}
|
|
99
|
-
/** Where the project keeps what
|
|
99
|
+
/** Where the project keeps what a launch puts out: `dist/`, beside `plain_modules`. */
|
|
100
100
|
export const DIST_DIR = "dist";
|
|
101
101
|
/**
|
|
102
102
|
* Where a person tries a module: `<project>/dist/<module>`, the module's code as its last commit has
|
|
103
|
-
* it. Outside `plain_modules`, so no agent can reach it, and replaced whole by every
|
|
103
|
+
* it. Outside `plain_modules`, so no agent can reach it, and replaced whole by every launch.
|
|
104
104
|
*/
|
|
105
105
|
export function distDirFor(projectDir, moduleName) {
|
|
106
106
|
return join(projectDir, DIST_DIR, moduleName);
|
package/dist/self-invocation.js
CHANGED
|
@@ -15,7 +15,7 @@ const TOOL_FOR = {
|
|
|
15
15
|
regenerate: "regenerate",
|
|
16
16
|
conform: "conform",
|
|
17
17
|
cultivate: "cultivate",
|
|
18
|
-
|
|
18
|
+
launch: "launch",
|
|
19
19
|
chat: "nothing - you are the conversation already",
|
|
20
20
|
ask: "nothing - you are the conversation already",
|
|
21
21
|
};
|
|
@@ -32,7 +32,7 @@ const ENTRY = {
|
|
|
32
32
|
"regenerate-cli": "regenerate",
|
|
33
33
|
"conform-cli": "conform",
|
|
34
34
|
"cultivate-cli": "cultivate",
|
|
35
|
-
"
|
|
35
|
+
"launch-cli": "launch",
|
|
36
36
|
};
|
|
37
37
|
/** Where a command starts: the start of the string, or after a separator. */
|
|
38
38
|
const AT_COMMAND = String.raw `(?:^|[\s;&|()\x60$])`;
|
|
@@ -42,10 +42,10 @@ const AT_COMMAND = String.raw `(?:^|[\s;&|()\x60$])`;
|
|
|
42
42
|
* agent - and neither are setup and doctor.
|
|
43
43
|
*/
|
|
44
44
|
export function selfInvocation(command) {
|
|
45
|
-
const cli = new RegExp(`${AT_COMMAND}(?:npx\\s+)?turri\\s+(regenerate|conform|cultivate|
|
|
45
|
+
const cli = new RegExp(`${AT_COMMAND}(?:npx\\s+)?turri\\s+(regenerate|conform|cultivate|launch)\\b`).exec(command);
|
|
46
46
|
if (cli)
|
|
47
47
|
return cli[1];
|
|
48
|
-
const launcher = new RegExp(`(?:bin/turri\\.mjs|src/cli\\.ts)\\s+(regenerate|conform|cultivate|
|
|
48
|
+
const launcher = new RegExp(`(?:bin/turri\\.mjs|src/cli\\.ts)\\s+(regenerate|conform|cultivate|launch)\\b`).exec(command);
|
|
49
49
|
if (launcher)
|
|
50
50
|
return launcher[1];
|
|
51
51
|
// turri alone, or with options, is the conversation - where a command starts, not a word an argument names (`which turri`).
|
|
@@ -82,7 +82,7 @@ const PI_CONFIGURES = new Set([
|
|
|
82
82
|
export function askedForCommandLine(message) {
|
|
83
83
|
const text = message.toLowerCase();
|
|
84
84
|
return (/\b(headless|command[ -]line|cli|terminal|shell|in bash|via bash|through bash|npm run|nohup)\b/.test(text) ||
|
|
85
|
-
/\bturri\s+(regenerate|conform|cultivate|
|
|
85
|
+
/\bturri\s+(regenerate|conform|cultivate|launch)\b/.test(text) ||
|
|
86
86
|
/(^|\s)turri\s+-p\b/.test(text) ||
|
|
87
87
|
/(^|\s)pi\s+-p\b/.test(text));
|
|
88
88
|
}
|
|
@@ -100,8 +100,8 @@ export function refusal(what, surface) {
|
|
|
100
100
|
export const TOOLS_NOT_CLI = [
|
|
101
101
|
"<turri-tools>",
|
|
102
102
|
"In this conversation, you do your work with your tools - regenerate, conform, cultivate and the rest - which run as",
|
|
103
|
-
"background jobs the user can watch and halt. To try what is regenerated,
|
|
104
|
-
"run your own command line (turri regenerate, conform, cultivate,
|
|
103
|
+
"background jobs the user can watch and halt. To try what is regenerated, launch it - never by hand in plain_modules. Never",
|
|
104
|
+
"run your own command line (turri regenerate, conform, cultivate, launch, turri itself; npm run",
|
|
105
105
|
"regenerate and the like) or start another pi through bash:",
|
|
106
106
|
"that is a separate headless run the user cannot see or stop. Only when the user explicitly asks for the",
|
|
107
107
|
"command line, run it. Configuring pi itself - turri install, update, remove, list; pi install, update, list, config, auth; or its settings files -",
|
package/dist/sentinel-check.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { SentinelCheck } from "./notice.ts";
|
|
2
2
|
/**
|
|
3
|
-
* A check a host asks the sentinel for (docs/sentinel.md): functional specs of one module, tested in
|
|
4
|
-
* its own codebase's
|
|
3
|
+
* A check a host asks the sentinel for (docs/sentinel.md): functional specs of one module, tested in what is launched of
|
|
4
|
+
* it - its own codebase's code, which holds the code of every module its requires chain builds on. Refused before it is
|
|
5
5
|
* queued when there is nothing to test: a module that is not there or does not parse, a func-id it does not have, one
|
|
6
6
|
* not built in its codebase as its ***plain has it now.
|
|
7
7
|
*/
|
|
@@ -10,7 +10,7 @@ export interface CheckRequest {
|
|
|
10
10
|
module: string;
|
|
11
11
|
/**
|
|
12
12
|
* The functional specs to test, each `module:func-id` - of the module, or of any module its requires chain builds on,
|
|
13
|
-
* whose code its
|
|
13
|
+
* whose code its codebase holds. A bare func-id is the module's own.
|
|
14
14
|
*/
|
|
15
15
|
funcIds: string[];
|
|
16
16
|
}
|
package/dist/sentinel-check.js
CHANGED
|
@@ -12,7 +12,7 @@ export function prepareCheck(project, request) {
|
|
|
12
12
|
if (name === "" || file === undefined)
|
|
13
13
|
return { refused: `There is no module ${name === "" ? "named" : name} in the project: no .plain file of its folder is ${name || "<module>"}.plain.` };
|
|
14
14
|
if (isImportModule(file))
|
|
15
|
-
return { refused: `${name} is an import module: it has no codebase of its own to
|
|
15
|
+
return { refused: `${name} is an import module: it has no codebase of its own to launch. Check a module that imports it.` };
|
|
16
16
|
let chain;
|
|
17
17
|
try {
|
|
18
18
|
chain = resolveRequiresChain(file, [], undefined, { allowNoFunctionalities: true });
|
|
@@ -31,13 +31,13 @@ export function prepareCheck(project, request) {
|
|
|
31
31
|
const id = colon === -1 ? funcId : funcId.slice(colon + 1).trim();
|
|
32
32
|
return { module, id, label: `${module}:${id}` };
|
|
33
33
|
});
|
|
34
|
-
// Only what its
|
|
34
|
+
// Only what its codebase holds: the module and the modules its requires chain builds on.
|
|
35
35
|
const inChain = new Map(chain.map((entry) => [entry.moduleName, entry]));
|
|
36
36
|
const outside = named.filter(({ module }) => !inChain.has(module));
|
|
37
37
|
if (outside.length > 0) {
|
|
38
38
|
const below = chain.slice(0, -1).map((entry) => entry.moduleName);
|
|
39
39
|
return {
|
|
40
|
-
refused: `Not in ${whose(name)}
|
|
40
|
+
refused: `Not in ${whose(name)} codebase: ${outside.map((spec) => spec.label).join(", ")} - ${[...new Set(outside.map((spec) => spec.module))].join(", ")} ${new Set(outside.map((spec) => spec.module)).size === 1 ? "is" : "are"} not ${name} or a module its requires chain builds on` +
|
|
41
41
|
`${below.length > 0 ? ` (${below.join(", ")})` : ` - it builds on none`}.`,
|
|
42
42
|
};
|
|
43
43
|
}
|
package/dist/sentinel.d.ts
CHANGED
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
import { type ToolDefinition } from "@earendil-works/pi-coding-agent";
|
|
2
2
|
import { type SentinelSetting } from "./config.ts";
|
|
3
3
|
import { type Job } from "./regenerate/jobs.ts";
|
|
4
|
-
import type {
|
|
4
|
+
import type { LaunchedProcess } from "./regenerate/launch.ts";
|
|
5
|
+
import { type PulseLaunch } from "./launch-session.ts";
|
|
5
6
|
import { type Conclusion, type Notice, type NoticeInput, type SentinelCheck } from "./notice.ts";
|
|
6
7
|
import type { CheckedSpec } from "./sentinel-check.ts";
|
|
7
8
|
export * from "./notice.ts";
|
|
8
9
|
/**
|
|
9
10
|
* The sentinel: a chat of the session's own that every finished pulse goes to (docs/sentinel.md). It checks how each
|
|
10
|
-
* pulse went - and, with `
|
|
11
|
+
* pulse went - and, with `launch-after-pulse` on, tests what was launched - finds out why when something is wrong, and
|
|
11
12
|
* puts it to the person as a notice in the chat they look at, with what they can do about it. It changes nothing: its
|
|
12
13
|
* file tools only read, its shell runs with the project read only, and it has none of the tools that change ***plain or
|
|
13
14
|
* start work. The chat the person talks to is never interrupted for a pulse that went well.
|
|
@@ -32,38 +33,43 @@ export declare function keepGuidance(cwd: string, text: string): void;
|
|
|
32
33
|
export declare function pulseEndsBlock(sentinel: boolean): string;
|
|
33
34
|
/**
|
|
34
35
|
* What the chat the person is in is told of a pulse that landed, with the sentinel on: that it landed, what the sentinel
|
|
35
|
-
* does with it - and to tell the person so, and do nothing else about it.
|
|
36
|
+
* does with it - and to tell the person so, and do nothing else about it. `launching`: launch-after-pulse is on - it is
|
|
37
|
+
* launched in the background, and the sentinel tests it once it runs.
|
|
36
38
|
*/
|
|
37
|
-
export declare function landedNote(job: Job,
|
|
39
|
+
export declare function landedNote(job: Job, options?: {
|
|
38
40
|
shown?: boolean;
|
|
41
|
+
launching?: boolean;
|
|
39
42
|
}): string;
|
|
40
43
|
/**
|
|
41
44
|
* Its identity and its task, in its system prompt in place of the conversation's. A host's `surface` - where the person
|
|
42
|
-
* watches it, in the host's words - stands in place of their not watching, and has it try
|
|
45
|
+
* watches it, in the host's words - stands in place of their not watching, and has it try what is launched with the host's tools.
|
|
43
46
|
*/
|
|
44
47
|
export declare function sentinelPrompt(cwd: string, options?: {
|
|
45
48
|
extraTools?: string[];
|
|
46
49
|
surface?: string;
|
|
47
50
|
}): string;
|
|
48
|
-
/** What the sentinel is told of one finished pulse: the ledger's facts, the chats, and what
|
|
51
|
+
/** What the sentinel is told of one finished pulse: the ledger's facts, the chats, and what runs of it. */
|
|
49
52
|
export declare function sentinelBrief(job: Job, context: {
|
|
50
53
|
project: string;
|
|
51
54
|
asked?: string;
|
|
52
55
|
focused?: string;
|
|
53
|
-
|
|
54
|
-
releaseAfterPulse: boolean;
|
|
56
|
+
launch: PulseLaunch;
|
|
55
57
|
reaction: string;
|
|
56
58
|
}): string;
|
|
57
59
|
/**
|
|
58
|
-
* What the sentinel is told of a host's check:
|
|
59
|
-
* specs to test, with what each says and its scenarios, as turri reads them now.
|
|
60
|
+
* What the sentinel is told of a host's check: what is launched of the module - what runs, and where - and the
|
|
61
|
+
* functional specs to test, with what each says and its scenarios, as turri reads them now.
|
|
60
62
|
*/
|
|
61
63
|
export declare function sentinelCheckBrief(check: SentinelCheck, context: {
|
|
62
64
|
specs: CheckedSpec[];
|
|
63
|
-
|
|
65
|
+
running: LaunchedProcess[];
|
|
64
66
|
commit?: string;
|
|
65
|
-
|
|
67
|
+
failed?: {
|
|
68
|
+
id: string;
|
|
69
|
+
summary?: string;
|
|
70
|
+
};
|
|
66
71
|
focused?: string;
|
|
72
|
+
dir?: string;
|
|
67
73
|
}): string;
|
|
68
74
|
/**
|
|
69
75
|
* The tools the sentinel's agent may call: what reads, write and edit for the project's tooling alone, resume, its
|
package/dist/sentinel.js
CHANGED
|
@@ -11,11 +11,12 @@ import { formatDuration, pulseName } from "./regenerate/jobs.js";
|
|
|
11
11
|
import { readLedger } from "./regenerate/ledger.js";
|
|
12
12
|
import { describePulseView, pulseView } from "./regenerate/ledger-view.js";
|
|
13
13
|
import { MODULES_DIR, ensureInScratch } from "./regenerate/paths.js";
|
|
14
|
+
import { LAUNCHED_ONLY, launchedDir, whatRuns } from "./launch-session.js";
|
|
14
15
|
import { SENTINEL, SENTINEL_START, wentWrong } from "./notice.js";
|
|
15
16
|
export * from "./notice.js";
|
|
16
17
|
/**
|
|
17
18
|
* The sentinel: a chat of the session's own that every finished pulse goes to (docs/sentinel.md). It checks how each
|
|
18
|
-
* pulse went - and, with `
|
|
19
|
+
* pulse went - and, with `launch-after-pulse` on, tests what was launched - finds out why when something is wrong, and
|
|
19
20
|
* puts it to the person as a notice in the chat they look at, with what they can do about it. It changes nothing: its
|
|
20
21
|
* file tools only read, its shell runs with the project read only, and it has none of the tools that change ***plain or
|
|
21
22
|
* start work. The chat the person talks to is never interrupted for a pulse that went well.
|
|
@@ -35,14 +36,14 @@ export function sentinelSetting(cwd) {
|
|
|
35
36
|
* - and whether to start it.
|
|
36
37
|
*/
|
|
37
38
|
export function sentinelStartNotice(about, cwd) {
|
|
38
|
-
let
|
|
39
|
+
let launched = false;
|
|
39
40
|
try {
|
|
40
|
-
|
|
41
|
+
launched = readProjectConfig(cwd).launchAfterPulse === true;
|
|
41
42
|
}
|
|
42
43
|
catch {
|
|
43
|
-
/* a config that cannot be read
|
|
44
|
+
/* a config that cannot be read launches nothing */
|
|
44
45
|
}
|
|
45
|
-
const what = `a background tab that reviews each finished pulse${
|
|
46
|
+
const what = `a background tab that reviews each finished pulse${launched ? " and tries to use what was launched" : ""}`;
|
|
46
47
|
if (!("kind" in about)) {
|
|
47
48
|
return {
|
|
48
49
|
kind: "sentinel-start",
|
|
@@ -119,7 +120,7 @@ export function pulseEndsBlock(sentinel) {
|
|
|
119
120
|
return sentinel
|
|
120
121
|
? [
|
|
121
122
|
"<pulse-ends>",
|
|
122
|
-
"The sentinel - a chat of my own, beside this one - checks every pulse that finishes and tests what was
|
|
123
|
+
"The sentinel - a chat of my own, beside this one - checks every pulse that finishes and tests what was launched.",
|
|
123
124
|
"When a pulse lands, the chat the person is in is told, to tell them it landed and what the sentinel does with it -",
|
|
124
125
|
"and nothing more: the pulse is the sentinel's. A pulse that went wrong you are not told of. What needs the person, the",
|
|
125
126
|
"sentinel puts to them as a notice in the chat they are in: what is wrong, and what can be done. When they accept",
|
|
@@ -130,11 +131,11 @@ export function pulseEndsBlock(sentinel) {
|
|
|
130
131
|
}
|
|
131
132
|
/**
|
|
132
133
|
* What the chat the person is in is told of a pulse that landed, with the sentinel on: that it landed, what the sentinel
|
|
133
|
-
* does with it - and to tell the person so, and do nothing else about it.
|
|
134
|
+
* does with it - and to tell the person so, and do nothing else about it. `launching`: launch-after-pulse is on - it is
|
|
135
|
+
* launched in the background, and the sentinel tests it once it runs.
|
|
134
136
|
*/
|
|
135
|
-
export function landedNote(job,
|
|
136
|
-
const
|
|
137
|
-
const where = released.map((item) => `${item.name} at ${item.url ?? item.command}`).join(", ");
|
|
137
|
+
export function landedNote(job, options = {}) {
|
|
138
|
+
const launching = options.launching === true;
|
|
138
139
|
// The host showed the person the pulse's end itself: what happened, for when they ask - nobody is told anything now.
|
|
139
140
|
if (options.shown === true) {
|
|
140
141
|
return [
|
|
@@ -142,7 +143,7 @@ export function landedNote(job, released, options = {}) {
|
|
|
142
143
|
"",
|
|
143
144
|
(job.report ?? "").trim(),
|
|
144
145
|
"",
|
|
145
|
-
`The sentinel - a chat of my own beside this one -
|
|
146
|
+
`The sentinel - a chat of my own beside this one - checks it${launching ? ", once it is launched, in the background, and tests what runs" : ""}; the person was shown that it landed. The pulse is the sentinel's: nothing is to be tested, launched, opened or run for it here.`,
|
|
146
147
|
].join("\n");
|
|
147
148
|
}
|
|
148
149
|
return [
|
|
@@ -150,14 +151,14 @@ export function landedNote(job, released, options = {}) {
|
|
|
150
151
|
"",
|
|
151
152
|
(job.report ?? "").trim(),
|
|
152
153
|
"",
|
|
153
|
-
|
|
154
|
+
`${launching ? "It is being launched in the background, and the sentinel" : "The sentinel"} - a chat of my own beside this one - checks it${launching ? " and tests what runs once it is up" : " now"}. If it finds something wrong, it puts it to the person in the chat they are in, with what can be done; when it is done, you are told.`,
|
|
154
155
|
"",
|
|
155
|
-
`Tell the person, in a line or two, what landed and that the sentinel is checking it${
|
|
156
|
+
`Tell the person, in a line or two, what landed and that the sentinel is checking it${launching ? " - and tests it once it is launched" : ""}. Do nothing else about it: the pulse is the sentinel's now. Do not test it, launch it, open it, run anything for it, or start other work because of it - whatever the project's guidance says to do when a pulse finishes.`,
|
|
156
157
|
].join("\n");
|
|
157
158
|
}
|
|
158
159
|
/**
|
|
159
160
|
* Its identity and its task, in its system prompt in place of the conversation's. A host's `surface` - where the person
|
|
160
|
-
* watches it, in the host's words - stands in place of their not watching, and has it try
|
|
161
|
+
* watches it, in the host's words - stands in place of their not watching, and has it try what is launched with the host's tools.
|
|
161
162
|
*/
|
|
162
163
|
export function sentinelPrompt(cwd, options = {}) {
|
|
163
164
|
const guidance = readGuidance(cwd);
|
|
@@ -171,22 +172,24 @@ export function sentinelPrompt(cwd, options = {}) {
|
|
|
171
172
|
"asks you to check. This conversation is for the pulse, or the check, in the message turri writes first. For a pulse:",
|
|
172
173
|
"what it was, how it ended,",
|
|
173
174
|
...(surface === ""
|
|
174
|
-
? ["its ***plain diff, its log, and what was
|
|
175
|
+
? ["its ***plain diff, its log, and what was launched. The person does not watch you: they are in another chat, and", "hear from you only through notify_person."]
|
|
175
176
|
: [
|
|
176
|
-
"its ***plain diff, its log, and what was
|
|
177
|
+
"its ***plain diff, its log, and what was launched. The person can watch you try it, where the host shows it;",
|
|
177
178
|
"they talk to you in another chat, and hear what you find only through notify_person.",
|
|
178
179
|
]),
|
|
179
180
|
"",
|
|
180
181
|
"For the pulse:",
|
|
181
182
|
"1. Check how it went, from what turri tells you - and, when that is not enough, the pulse in full (pulses with its id),",
|
|
182
183
|
" its log, and the code and the ***plain, which you read.",
|
|
183
|
-
"2. When it was
|
|
184
|
-
"
|
|
184
|
+
"2. When it was launched (the message says so - launch-after-pulse is on), test it: it is running where the message",
|
|
185
|
+
" says - a launch that holds the pulse's commit, and the pulses after it the message names. Test what the message",
|
|
186
|
+
" says this pulse changed - what a later pulse changed again is that pulse's to test. How far you test is yours to",
|
|
187
|
+
" judge, from what the pulse changed and what the ***plain says",
|
|
185
188
|
" it should do: that it came up, answers, and does what its ***plain diff says it now does. Where the ***plain picks",
|
|
186
189
|
" one way among several - which of a tie comes first, how a default is chosen - try an input on which the ways give",
|
|
187
190
|
" different answers, so a pass shows the ***plain's way and no other: a tie whose first word is also first",
|
|
188
191
|
" alphabetically tells \"first in the file\" from nothing.",
|
|
189
|
-
"3. When something is wrong - the pulse failed or stopped, it did not pass, the
|
|
192
|
+
"3. When something is wrong - the pulse failed or stopped, it did not pass, the launch did not come up, the software",
|
|
190
193
|
" does not do what its ***plain says - find out why. Then:",
|
|
191
194
|
" - When it is the project's tooling - a testing script, or where config.turri.yaml says the scripts are and which",
|
|
192
195
|
" toolchain folders the agents may read (toolchains:) - fix it yourself, with edit: a script calling python3 where",
|
|
@@ -201,19 +204,19 @@ export function sentinelPrompt(cwd, options = {}) {
|
|
|
201
204
|
" the person runs themselves (`brew install node`), and make the action resuming once they have.",
|
|
202
205
|
" When it is a gap in the ***plain the build settled with an assumption - something the person may reasonably leave",
|
|
203
206
|
" as it is - say so with ignorable: the gap in the summary, what the build does in the evidence. Never for",
|
|
204
|
-
" something broken, a pulse that went wrong, or a
|
|
207
|
+
" something broken, a pulse that went wrong, or a launch that did not come up.",
|
|
205
208
|
"4. When all is well, notify no one.",
|
|
206
209
|
"5. Last, call conclude once for it - holds or wrong, and in a line or two what you checked and what you found:",
|
|
207
210
|
" the chat the person is in is told, whether all is well or not. Then say the same here, in a line or two.",
|
|
208
211
|
"",
|
|
209
|
-
"For a check: the person picked functional specs of a module for you to test in
|
|
212
|
+
"For a check: the person picked functional specs of a module for you to test in what is launched of it, which runs where the",
|
|
210
213
|
"message says. Test those - what each says and its scenarios - not the module's other functional specs. Notify the",
|
|
211
214
|
"person of what does not do what its ***plain says, as for a pulse, and call conclude once for the check, by its id.",
|
|
212
215
|
"",
|
|
213
216
|
"You fix the project's tooling and nothing else. Your file tools read the whole project; write and edit reach only the",
|
|
214
217
|
"testing scripts and config.turri.yaml - and in it only where the scripts are, and toolchains:. Your shell runs with",
|
|
215
|
-
"the project read only; the files you try a
|
|
216
|
-
"
|
|
218
|
+
"the project read only; the files you try a launch with go in $TMPDIR - /tmp is outside what it may write. You never change ***plain - it is the person's intent, never yours to fix - and never steer,",
|
|
219
|
+
"launch, or regenerate but by resume after a fix of yours. You install nothing on this machine and change none of",
|
|
217
220
|
"its settings, nor the person's shell - under no circumstances: that is always the person's, said in a notice. You",
|
|
218
221
|
"never ask the person questions - a notice is how you reach them.",
|
|
219
222
|
"",
|
|
@@ -228,7 +231,7 @@ export function sentinelPrompt(cwd, options = {}) {
|
|
|
228
231
|
"<surface>",
|
|
229
232
|
surface,
|
|
230
233
|
"</surface>",
|
|
231
|
-
`Try
|
|
234
|
+
`Try what is launched with ${theirs}, where the person can watch. Keep your shell for what those cannot show - logs, exit`,
|
|
232
235
|
"codes, files.",
|
|
233
236
|
]
|
|
234
237
|
: tools.length > 0
|
|
@@ -238,7 +241,7 @@ export function sentinelPrompt(cwd, options = {}) {
|
|
|
238
241
|
...(guidance !== "" ? ["", "<guidance>", "What the person told you to keep in mind:", guidance, "</guidance>"] : []),
|
|
239
242
|
].join("\n");
|
|
240
243
|
}
|
|
241
|
-
/** What the sentinel is told of one finished pulse: the ledger's facts, the chats, and what
|
|
244
|
+
/** What the sentinel is told of one finished pulse: the ledger's facts, the chats, and what runs of it. */
|
|
242
245
|
export function sentinelBrief(job, context) {
|
|
243
246
|
const view = (() => {
|
|
244
247
|
try {
|
|
@@ -269,13 +272,8 @@ export function sentinelBrief(job, context) {
|
|
|
269
272
|
lines.push("", "Its ***plain diff:", job.diff.trimEnd());
|
|
270
273
|
if (job.logFile !== undefined)
|
|
271
274
|
lines.push("", `Its log: ${job.logFile}`);
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
lines.push("", "It was released, as its last stage (release-after-pulse). What runs now:", ...whatRuns(context.released), "Test it.");
|
|
275
|
-
}
|
|
276
|
-
else if (job.status === "succeeded" && !didNotPass(job)) {
|
|
277
|
-
lines.push("", context.releaseAfterPulse ? "Nothing was released after it." : "release-after-pulse is off: nothing was released, and you test nothing running - check the pulse alone.");
|
|
278
|
-
}
|
|
275
|
+
if (job.status === "succeeded" && !didNotPass(job))
|
|
276
|
+
lines.push("", ...launchLines(job, context.launch));
|
|
279
277
|
if (job.specConflict !== undefined) {
|
|
280
278
|
lines.push("", "It stopped on two functional specs that contradict each other: turri has put that to the person itself. Notify no one about it.");
|
|
281
279
|
}
|
|
@@ -285,23 +283,51 @@ export function sentinelBrief(job, context) {
|
|
|
285
283
|
lines.push("", `When you are done with it, call conclude for ${job.id} - whether all is well or not.`);
|
|
286
284
|
return lines.join("\n");
|
|
287
285
|
}
|
|
288
|
-
/** What runs
|
|
289
|
-
function
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
286
|
+
/** What runs for a pulse that landed, as the sentinel is told it: the launch that holds its commit, or why there is none to test. */
|
|
287
|
+
function launchLines(job, launch) {
|
|
288
|
+
const spec = (each) => `${each.module}:${each.funcId}`;
|
|
289
|
+
if (launch.off === true)
|
|
290
|
+
return [`${launch.commit !== undefined ? `Its commit is ${launch.commit.slice(0, 7)}. ` : ""}launch-after-pulse is off: nothing was launched, and you test nothing running - check the pulse alone.`, LAUNCHED_ONLY];
|
|
291
|
+
if (launch.commit === undefined)
|
|
292
|
+
return ["Nothing was launched for it: turri has no commit it landed - check the pulse alone.", LAUNCHED_ONLY];
|
|
293
|
+
const commit = launch.commit.slice(0, 7);
|
|
294
|
+
if (launch.notAsked !== undefined)
|
|
295
|
+
return [`Its commit is ${commit}. Its launch could not be asked for: ${launch.notAsked}`, "That is what you find out about: the launch did not come up.", LAUNCHED_ONLY];
|
|
296
|
+
if (launch.stopped === true || launch.launch === undefined)
|
|
297
|
+
return [`Its commit is ${commit}. The person stopped its launch: nothing of it runs - check the pulse alone.`, LAUNCHED_ONLY];
|
|
298
|
+
const what = launch.launch;
|
|
299
|
+
const later = launch.later.map((other) => `${other.id} (${pulseName(other)})`);
|
|
300
|
+
const lines = [
|
|
301
|
+
`Its commit is ${commit}. It was launched in the background (launch-after-pulse): what runs is ${what.codebase} at ${what.short} (${what.id}), which holds it${later.length > 0 ? ` and the pulses that landed after it - ${later.join(", ")}` : ""}.`,
|
|
302
|
+
];
|
|
303
|
+
if (what.status === "failed") {
|
|
304
|
+
lines.push(`That launch did not come up: ${what.summary ?? "the launch agent did not say why"}`, "That is what you find out about: the launch did not come up. Test nothing in its place.", LAUNCHED_ONLY);
|
|
305
|
+
return lines;
|
|
306
|
+
}
|
|
307
|
+
lines.push("What runs now:", ...whatRuns(launch.running, launchedDir(what)), LAUNCHED_ONLY);
|
|
308
|
+
if (launch.laterSpecs.length > 0) {
|
|
309
|
+
lines.push(`Test what this pulse changed - but not ${launch.laterSpecs.map(spec).join(", ")}: a later pulse changed ${launch.laterSpecs.length === 1 ? "it" : "them"} again, and its check tests ${launch.laterSpecs.length === 1 ? "it" : "them"}.`);
|
|
310
|
+
}
|
|
311
|
+
else
|
|
312
|
+
lines.push("Test what this pulse changed.");
|
|
313
|
+
return lines;
|
|
293
314
|
}
|
|
294
315
|
/**
|
|
295
|
-
* What the sentinel is told of a host's check:
|
|
296
|
-
* specs to test, with what each says and its scenarios, as turri reads them now.
|
|
316
|
+
* What the sentinel is told of a host's check: what is launched of the module - what runs, and where - and the
|
|
317
|
+
* functional specs to test, with what each says and its scenarios, as turri reads them now.
|
|
297
318
|
*/
|
|
298
319
|
export function sentinelCheckBrief(check, context) {
|
|
299
320
|
const lines = [
|
|
300
|
-
`Check ${check.id}: the person asked you to check ${check.funcIds.length === 1 ? "a functional spec" : `${check.funcIds.length} functional specs`} of ${check.module}, in
|
|
321
|
+
`Check ${check.id}: the person asked you to check ${check.funcIds.length === 1 ? "a functional spec" : `${check.funcIds.length} functional specs`} of ${check.module}, in what is launched of it.`,
|
|
301
322
|
];
|
|
302
323
|
if (context.focused !== undefined)
|
|
303
324
|
lines.push(`The person is in the chat "${context.focused}": a notice goes there.`);
|
|
304
|
-
lines.push("",
|
|
325
|
+
lines.push("", `What is launched of ${check.module} holds its code and that of every module its requires chain builds on${context.commit !== undefined ? `, at its commit ${context.commit}` : ""} - a commit that landed whole, never what a pulse is writing now.${context.failed !== undefined ? "" : " What runs now:"}`, ...(context.failed !== undefined
|
|
326
|
+
? [
|
|
327
|
+
`Its last launch, ${context.failed.id}, did not come up: ${context.failed.summary ?? "the launch agent did not say why"}`,
|
|
328
|
+
"That is what you find out about: the launch did not come up. Test nothing in its place.",
|
|
329
|
+
]
|
|
330
|
+
: whatRuns(context.running, context.dir)), LAUNCHED_ONLY, "", `Test these functional specs of ${check.module} - only these, not its others, though they run too:`);
|
|
305
331
|
for (const spec of context.specs) {
|
|
306
332
|
lines.push("", `# ${spec.funcId}`, spec.text);
|
|
307
333
|
for (const [title, scenarios] of [["Conformance scenarios", spec.conformance], ["Acceptance scenarios", spec.acceptance]]) {
|
|
@@ -442,7 +468,7 @@ export function notifyTool(notify) {
|
|
|
442
468
|
ignorable: Type.Optional(Type.Boolean({
|
|
443
469
|
description: "true when the person may reasonably leave it as the build has it, for good: chiefly a gap in the ***plain the build settled with an " +
|
|
444
470
|
"assumption - then say the gap in the summary and what the build does in the evidence (the ***plain does not say what happens to " +
|
|
445
|
-
"passwords over 72 bytes; the build refuses them with 422). Never for something broken, a pulse that went wrong, or a
|
|
471
|
+
"passwords over 72 bytes; the build refuses them with 422). Never for something broken, a pulse that went wrong, or a launch that did not come up.",
|
|
446
472
|
})),
|
|
447
473
|
}),
|
|
448
474
|
async execute(_id, params) {
|
package/docs/README.md
CHANGED
|
@@ -30,7 +30,7 @@ turri is the first coding agent with the power of regenerative software: [\*\*\*
|
|
|
30
30
|
| which skill does what | [authoring \*\*\*plain](authoring-plain.md#the-skills) |
|
|
31
31
|
| what happens when \*\*\*plain changes | [regenerating the code](regenerating.md#when-plain-changes) |
|
|
32
32
|
| why a test was not allowed to be deleted | [regenerating the code](regenerating.md#the-tests-must-actually-pass) |
|
|
33
|
-
| how to try what is built, and what
|
|
33
|
+
| how to try what is built, and what a launch may install | [launch](launch.md) |
|
|
34
34
|
| what the agents can and cannot reach | [the sandbox](sandbox.md) |
|
|
35
35
|
| how skill review gates and judges work | [skills and gates](skills-and-gates.md) |
|
|
36
36
|
| how the parser matches the reference implementation | [the \*\*\*plain parser](parser.md) |
|
|
@@ -47,7 +47,7 @@ turri is the first coding agent with the power of regenerative software: [\*\*\*
|
|
|
47
47
|
| [The sentinel](sentinel.md) | the chat every finished pulse goes to: what it checks and tests, its notices and how to answer them, what it may do, closing it, its model, in a host |
|
|
48
48
|
| [A Claude subscription](claude-subscription.md) | running every agent on a Claude Pro, Max or Team subscription through Claude Code: setting it up, its models, checking it yourself, in turri-desktop, its limits, when it does not work |
|
|
49
49
|
| [The project config](config.md) | `config.turri.yaml` and a module's own `config.turri.<module>.yaml`: where they are read from, every key, models and their inheritance, conformance, the testing scripts, which file builds a module, the old `config.yaml` |
|
|
50
|
-
| [
|
|
50
|
+
| [Launch](launch.md) | trying what is built: the launch track, a commit in dist/<module>, starting it on your machine, after every pulse, `turri launch` |
|
|
51
51
|
| [Running unattended](headless.md) | regenerating overnight or in CI: before you leave it, the command, the results, resuming, rebuilding one functionality |
|
|
52
52
|
| [Authoring \*\*\*plain](authoring-plain.md) | a \*\*\*plain project, what \*\*\*plain is made of, the rules, writing \*\*\*plain with the agent, the skills, checking \*\*\*plain |
|
|
53
53
|
| [Regenerating](regenerating.md) | where things go, one job, a whole module and how its work is cut into jobs, each job's cases, \*\*\*plain changes, conformance tests, the two records of what is built |
|
package/docs/chats.md
CHANGED
|
@@ -17,10 +17,10 @@ The session's, shared by every chat:
|
|
|
17
17
|
- **the coding model** given with `--coding-model`, and `parallel-jobs`;
|
|
18
18
|
- **steering** - what `steer` was told, every plan follows;
|
|
19
19
|
- **conformance** chosen with `conform`, module by module;
|
|
20
|
-
- **what
|
|
20
|
+
- **what launches started** - it runs until turri ends or `/halt launched <name>`, whatever chats are opened or closed - and the launch track;
|
|
21
21
|
- **the ledger** - one run, each event with the id of the chat its work was asked for in (`chat`), and `chat.opened` and `chat.closed` as they happen.
|
|
22
22
|
|
|
23
|
-
A pulse's end goes to the [sentinel](sentinel.md) - a chat of turri's own, opened in the background with the first pulse that finishes, once you said to start it under `sentinel: ask` - which checks it, tests what was
|
|
23
|
+
A pulse's end goes to the [sentinel](sentinel.md) - a chat of turri's own, opened in the background with the first pulse that finishes, once you said to start it under `sentinel: ask` - which checks it, tests what was launched, and puts what needs you as a notice in the chat you are in. That chat shows the pulse's end; its agent is told of a pulse that landed, to tell you so and what the sentinel is doing with it - and when the sentinel is done with any pulse, what it found - and nothing more - and not of one that went wrong: the sentinel's notice is what it hears of that. With `sentinel: false`, a pulse's end is told to the chat that asked for it instead, shown or not - its agent reacts to it there; the chat's mark in the strip says it has something new. When that chat has been closed, the chat shown is told. Closing a chat stops its turn, never its pulses.
|
|
24
24
|
|
|
25
25
|
## In the terminal
|
|
26
26
|
|