chopin-ai 0.2.0 → 0.3.0
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 +1 -2
- package/dist/agent.d.ts +5 -5
- package/dist/agent.js +7 -11
- package/dist/agent.js.map +1 -1
- package/dist/bin.js +7 -2
- package/dist/bin.js.map +1 -1
- package/dist/chat.js +7 -0
- package/dist/chat.js.map +1 -1
- package/dist/credentials.d.ts +5 -1
- package/dist/credentials.js +18 -0
- package/dist/credentials.js.map +1 -1
- package/dist/header.d.ts +1 -0
- package/dist/header.js +7 -1
- package/dist/header.js.map +1 -1
- package/dist/home.d.ts +22 -3
- package/dist/home.js +11 -3
- package/dist/home.js.map +1 -1
- package/dist/project.d.ts +19 -2
- package/dist/project.js +111 -26
- package/dist/project.js.map +1 -1
- package/dist/rsi/control.d.ts +34 -0
- package/dist/rsi/control.js +142 -0
- package/dist/rsi/control.js.map +1 -0
- package/dist/rsi/evolve.d.ts +15 -0
- package/dist/rsi/evolve.js +314 -0
- package/dist/rsi/evolve.js.map +1 -0
- package/dist/rsi/export.d.ts +6 -0
- package/dist/rsi/export.js +25 -0
- package/dist/rsi/export.js.map +1 -0
- package/dist/rsi/harvest.d.ts +87 -0
- package/dist/rsi/harvest.js +274 -0
- package/dist/rsi/harvest.js.map +1 -0
- package/dist/rsi/held.d.ts +29 -0
- package/dist/rsi/held.js +45 -0
- package/dist/rsi/held.js.map +1 -0
- package/dist/rsi/lifecycle.d.ts +8 -0
- package/dist/rsi/lifecycle.js +25 -0
- package/dist/rsi/lifecycle.js.map +1 -0
- package/dist/rsi/models.d.ts +25 -0
- package/dist/rsi/models.js +71 -0
- package/dist/rsi/models.js.map +1 -0
- package/dist/rsi/records.d.ts +14 -0
- package/dist/rsi/records.js +20 -0
- package/dist/rsi/records.js.map +1 -0
- package/dist/rsi/round.d.ts +62 -0
- package/dist/rsi/round.js +333 -0
- package/dist/rsi/round.js.map +1 -0
- package/dist/rsi/schedule.d.ts +14 -0
- package/dist/rsi/schedule.js +42 -0
- package/dist/rsi/schedule.js.map +1 -0
- package/dist/rsi/summary.d.ts +5 -0
- package/dist/rsi/summary.js +41 -0
- package/dist/rsi/summary.js.map +1 -0
- package/dist/serve.js +52 -29
- package/dist/serve.js.map +1 -1
- package/dist/transcript.js +6 -1
- package/dist/transcript.js.map +1 -1
- package/package.json +11 -12
- package/dist/browser.d.ts +0 -2
- package/dist/browser.js +0 -9
- package/dist/browser.js.map +0 -1
- package/dist/web.d.ts +0 -3
- package/dist/web.js +0 -20
- package/dist/web.js.map +0 -1
|
@@ -0,0 +1,314 @@
|
|
|
1
|
+
import { createHash } from "node:crypto";
|
|
2
|
+
import { mkdir, readFile, realpath, stat } from "node:fs/promises";
|
|
3
|
+
import { createInterface } from "node:readline/promises";
|
|
4
|
+
import { homedir } from "node:os";
|
|
5
|
+
import { join, relative, sep } from "node:path";
|
|
6
|
+
import { CodingTools } from "@earendil-works/pi-durable/tools";
|
|
7
|
+
import { audit, auditSamples, calibrate, Calibration, CALIBRATION, continuationSamples, judgeEquivalent, judgeRepeat, LayerVersions, loadLayer, mcpSecrets, secretValues, SHELVE_AFTER, } from "@chopin-ai/core";
|
|
8
|
+
import { continueAt, layerExtension, stepText, transcriptMessages } from "@chopin-ai/harness-pi";
|
|
9
|
+
import { chopinModels, credentialsFrom } from "../credentials.js";
|
|
10
|
+
import { exclusive } from "../lock.js";
|
|
11
|
+
import { chopinHome, layerDirectory, readSettings, rsiDirectory } from "../home.js";
|
|
12
|
+
import { Budget, completer, namedModel, paidCall } from "./models.js";
|
|
13
|
+
import { harvest, sessionSources } from "./harvest.js";
|
|
14
|
+
import { answerCorrections, correctionsAsked, decideHeld, heldChanges, loopChanges, loopStanding, undoChange } from "./control.js";
|
|
15
|
+
import { archiveUnused } from "./lifecycle.js";
|
|
16
|
+
import { records } from "./records.js";
|
|
17
|
+
import { runRounds } from "./round.js";
|
|
18
|
+
const DAY_MS = 24 * 60 * 60_000;
|
|
19
|
+
/** How many of a kind's corrections the user is shown when asked about it. */
|
|
20
|
+
const CORRECTION_EXAMPLES = 3;
|
|
21
|
+
/** A configured path, with a leading `~/` meaning the home directory. */
|
|
22
|
+
function expand(path) {
|
|
23
|
+
return path === "~" ? homedir() : path.startsWith("~/") ? join(homedir(), path.slice(2)) : path;
|
|
24
|
+
}
|
|
25
|
+
const EMPTY = { instructions: undefined, skills: [], mcpServers: {}, gates: [] };
|
|
26
|
+
/**
|
|
27
|
+
* What a round needs that costs money, reaching models with `credentials`, else those signed in here; refused until
|
|
28
|
+
* the models and the week's budget are set.
|
|
29
|
+
*/
|
|
30
|
+
async function paid(credentials) {
|
|
31
|
+
const settings = await readSettings();
|
|
32
|
+
const rsi = settings.rsi ?? {};
|
|
33
|
+
const missing = [
|
|
34
|
+
...(rsi.regularModel === undefined ? ["rsi.regularModel"] : []),
|
|
35
|
+
...(rsi.strongModel === undefined ? ["rsi.strongModel"] : []),
|
|
36
|
+
...(rsi.weeklyBudgetUsd === undefined ? ["rsi.weeklyBudgetUsd"] : []),
|
|
37
|
+
...(settings.model === undefined ? ["model"] : []),
|
|
38
|
+
];
|
|
39
|
+
if (missing.length > 0)
|
|
40
|
+
throw new Error(`set ${missing.join(", ")} in ${join(chopinHome(), "config.json")} before the loop may spend anything`);
|
|
41
|
+
const models = await chopinModels(credentials);
|
|
42
|
+
const budget = new Budget(records().spend, rsi.weeklyBudgetUsd);
|
|
43
|
+
const sessionModel = namedModel(models, settings.model);
|
|
44
|
+
return {
|
|
45
|
+
rsi, models, budget, sessionModel, modelName: settings.model,
|
|
46
|
+
regular: completer(models, namedModel(models, rsi.regularModel), budget),
|
|
47
|
+
strong: completer(models, namedModel(models, rsi.strongModel), budget),
|
|
48
|
+
own: completer(models, sessionModel, budget),
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
async function handLayer() {
|
|
52
|
+
const directory = layerDirectory();
|
|
53
|
+
const loaded = await stat(directory).then(() => loadLayer(directory), () => undefined);
|
|
54
|
+
if (loaded?.ok === false)
|
|
55
|
+
throw new Error(`invalid layer ${directory}:\n${loaded.problems.join("\n")}`);
|
|
56
|
+
return loaded?.ok === true ? loaded.layer : EMPTY;
|
|
57
|
+
}
|
|
58
|
+
/** Runs the loop once now: calibrates the judges if they were not today, gathers evidence, and runs due rounds. */
|
|
59
|
+
export const evolveCommand = {
|
|
60
|
+
name: "evolve",
|
|
61
|
+
args: "[--credentials-on-stdin]",
|
|
62
|
+
summary: "improve the agent from its sessions once now: gather failures, propose changes, keep those that test better",
|
|
63
|
+
run: async (args, io) => {
|
|
64
|
+
// A service whose credentials live in it alone hands them over through a pipe.
|
|
65
|
+
if (args.some((arg) => arg !== "--credentials-on-stdin")) {
|
|
66
|
+
io.err("usage: chopin evolve [--credentials-on-stdin]");
|
|
67
|
+
return 2;
|
|
68
|
+
}
|
|
69
|
+
const credentials = args.length === 0 ? undefined : await credentialsFrom(await text(process.stdin));
|
|
70
|
+
await mkdir(rsiDirectory(), { recursive: true, mode: 0o700 });
|
|
71
|
+
const lock = exclusive(evolveLock());
|
|
72
|
+
if (lock === undefined) {
|
|
73
|
+
io.out("the loop is already running");
|
|
74
|
+
return 0;
|
|
75
|
+
}
|
|
76
|
+
try {
|
|
77
|
+
return await evolveOnce(io, credentials);
|
|
78
|
+
}
|
|
79
|
+
finally {
|
|
80
|
+
lock.close();
|
|
81
|
+
}
|
|
82
|
+
},
|
|
83
|
+
};
|
|
84
|
+
/** Everything `stream` has, as text. */
|
|
85
|
+
async function text(stream) {
|
|
86
|
+
let all = "";
|
|
87
|
+
for await (const chunk of stream)
|
|
88
|
+
all += chunk.toString();
|
|
89
|
+
return all;
|
|
90
|
+
}
|
|
91
|
+
/** The lock a running loop holds. */
|
|
92
|
+
const evolveLock = () => join(rsiDirectory(), "evolve.lock");
|
|
93
|
+
/** Whether the loop is running now, in this process or another. */
|
|
94
|
+
export async function evolving() {
|
|
95
|
+
// A loop that never ran here left no lock to hold.
|
|
96
|
+
if ((await stat(evolveLock()).catch(() => undefined)) === undefined)
|
|
97
|
+
return false;
|
|
98
|
+
const lock = exclusive(evolveLock(), 0);
|
|
99
|
+
lock?.close();
|
|
100
|
+
return lock === undefined;
|
|
101
|
+
}
|
|
102
|
+
async function evolveOnce(io, credentials) {
|
|
103
|
+
const kept = records();
|
|
104
|
+
const money = await paid(credentials);
|
|
105
|
+
for (const recovered of [await kept.versions.recover(), await kept.ledger.recover()]) {
|
|
106
|
+
if (recovered)
|
|
107
|
+
io.err(`chopin: the loop's records were changed outside it and were put back: ${JSON.stringify(recovered)}`);
|
|
108
|
+
}
|
|
109
|
+
const judges = await calibrated(kept.calibration, money.strong, io);
|
|
110
|
+
if (!judges)
|
|
111
|
+
return 1;
|
|
112
|
+
const base = await handLayer();
|
|
113
|
+
// Sessions may hold what the user pasted, such as a token their MCP servers are configured with.
|
|
114
|
+
const secrets = [...secretValues(process.env), ...mcpSecrets(base.mcpServers)];
|
|
115
|
+
const sources = await sessionSources(chopinHome(), (money.rsi.transcriptSources ?? []).map(expand));
|
|
116
|
+
io.out(`reading ${sources.length} recent sessions`);
|
|
117
|
+
let done = 0;
|
|
118
|
+
const gathered = await harvest(kept.evidence, sources, money.regular, secrets, (source, found) => {
|
|
119
|
+
done += 1;
|
|
120
|
+
io.out(`[${done}] ${source.path}: ${found.failures} failures, ${found.corrections} corrections`);
|
|
121
|
+
});
|
|
122
|
+
io.out(`read ${gathered.read} sessions: ${gathered.failures} new failures, ${gathered.corrections} corrections to confirm`);
|
|
123
|
+
const projects = await projectsOf(sources);
|
|
124
|
+
const setup = {
|
|
125
|
+
evidence: kept.evidence, sources, versions: kept.versions, base, ledger: kept.ledger,
|
|
126
|
+
projectOf: (session) => {
|
|
127
|
+
const key = projects.get(session);
|
|
128
|
+
return key === undefined ? undefined : { key, versions: new LayerVersions(join(chopinHome(), "projects", key, "rsi", "layer")) };
|
|
129
|
+
},
|
|
130
|
+
rejections: kept.rejections, certificates: kept.certificates, propose: money.own, judge: money.strong,
|
|
131
|
+
held: kept.held, holdForReview: money.rsi.holdForReview === true,
|
|
132
|
+
report: (error) => io.err(`chopin: left out a decision point: ${error instanceof Error ? error.message : String(error)}`),
|
|
133
|
+
rules: money.rsi.rulesFile === undefined ? "" : await readFile(expand(money.rsi.rulesFile), "utf8"),
|
|
134
|
+
model: money.modelName, secrets,
|
|
135
|
+
continueStep: async (layer, prefix) => stepText(await paidCall(money.budget, () => continueAt({
|
|
136
|
+
messages: transcriptMessages(prefix, money.sessionModel), extensions: [CodingTools, layerExtension(layer, new Set())],
|
|
137
|
+
model: money.sessionModel, models: money.models,
|
|
138
|
+
}))),
|
|
139
|
+
};
|
|
140
|
+
await runRounds(setup, (outcome) => io.out(outcome.outcome === "kept" ? `kept a change for ${outcome.failure} as version ${outcome.version}`
|
|
141
|
+
: outcome.outcome === "set_aside" ? `set aside ${outcome.failure}: ${outcome.reason}`
|
|
142
|
+
: outcome.outcome === "held" ? `held a change for ${outcome.failure} for your review (chopin evolve review): ${outcome.reason}`
|
|
143
|
+
: `refused a change for ${outcome.failure}: ${outcome.reason}`));
|
|
144
|
+
const archived = await archiveUnused(kept.versions, sources, secrets);
|
|
145
|
+
if (archived.length > 0)
|
|
146
|
+
io.out(`archived ${archived.length} skills no session read for 30 days: ${archived.map((id) => id.slice(0, 8)).join(", ")}`);
|
|
147
|
+
io.out(`spent $${(await money.budget.spent()).toFixed(2)} of $${money.budget.weeklyUsd.toFixed(2)} this week`);
|
|
148
|
+
return 0;
|
|
149
|
+
}
|
|
150
|
+
/**
|
|
151
|
+
* Measures each judge on cases whose answers are known, once a day or sooner while it has answered too few to count;
|
|
152
|
+
* a judge that errs, or has not yet answered enough, decides nothing.
|
|
153
|
+
*/
|
|
154
|
+
async function calibrated(log, strong, io) {
|
|
155
|
+
const known = continuationSamples();
|
|
156
|
+
const audits = auditSamples({ existing: [], diagnosisTasks: [], rules: "" });
|
|
157
|
+
const ids = (samples) => new Set(samples.map((sample) => sample.id));
|
|
158
|
+
const judges = [
|
|
159
|
+
{ name: "audit", ids: ids(audits), run: () => calibrate("audit", async (input) => (await audit(input, strong))?.decision, audits, log) },
|
|
160
|
+
{ name: "repeat", ids: ids(known.repeat), run: () => calibrate("repeat", (input) => judgeRepeat(input.context, input.step, input.failure, strong, input.correction), known.repeat, log) },
|
|
161
|
+
{ name: "equivalent", ids: ids(known.equivalent), run: () => calibrate("equivalent", (input) => judgeEquivalent(input.context, input.original, input.step, strong), known.equivalent, log) },
|
|
162
|
+
];
|
|
163
|
+
const problems = [];
|
|
164
|
+
for (const judge of judges) {
|
|
165
|
+
const last = await log.lastAnswered(judge.name);
|
|
166
|
+
const { total } = await log.accuracy(judge.name, judge.ids);
|
|
167
|
+
const untried = await log.unanswered(judge.name, judge.ids);
|
|
168
|
+
if (last === undefined || Date.now() - last >= DAY_MS || total < CALIBRATION.minimum || untried.length > 0)
|
|
169
|
+
await judge.run();
|
|
170
|
+
const { correct, total: answered } = await log.accuracy(judge.name, judge.ids);
|
|
171
|
+
if (answered < CALIBRATION.minimum)
|
|
172
|
+
problems.push(`the ${judge.name} judge has answered ${answered} of the ${CALIBRATION.minimum} known cases it needs`);
|
|
173
|
+
else if (!(await log.trusted(judge.name, judge.ids)))
|
|
174
|
+
problems.push(`the ${judge.name} judge got ${answered - correct} of ${answered} known cases wrong`);
|
|
175
|
+
}
|
|
176
|
+
for (const problem of problems)
|
|
177
|
+
io.err(`chopin: ${problem}; no change is decided until it measures well`);
|
|
178
|
+
return problems.length === 0;
|
|
179
|
+
}
|
|
180
|
+
/** What the loop holds now. */
|
|
181
|
+
export const evolveStatusCommand = {
|
|
182
|
+
name: "evolve status",
|
|
183
|
+
args: "",
|
|
184
|
+
summary: "show what the loop has learned, what it is waiting on, and what it has spent",
|
|
185
|
+
run: async (_args, io) => {
|
|
186
|
+
const standing = await loopStanding();
|
|
187
|
+
io.out([
|
|
188
|
+
`layer version ${standing.version}: ${standing.inUse} items in use, ${standing.archived} archived`,
|
|
189
|
+
`failures: ${standing.kinds} kinds, ${standing.recurring} recurring, ${standing.shelved} set aside: refused ${SHELVE_AFTER} times, or not recurring on this model`,
|
|
190
|
+
`kinds of correction waiting for you: ${standing.corrections} (chopin evolve corrections)`,
|
|
191
|
+
`changes held for your review: ${standing.held} (chopin evolve review)`,
|
|
192
|
+
`spent this week: $${standing.spentUsd.toFixed(2)}${standing.weeklyBudgetUsd === null ? " (no budget set)" : ` of $${standing.weeklyBudgetUsd.toFixed(2)}`}`,
|
|
193
|
+
].join("\n"));
|
|
194
|
+
return 0;
|
|
195
|
+
},
|
|
196
|
+
};
|
|
197
|
+
/** Asks the user about each change the audit held; an approved one is tested in the next round, a refused one counts against its kind. */
|
|
198
|
+
export const evolveReviewCommand = {
|
|
199
|
+
name: "evolve review",
|
|
200
|
+
args: "",
|
|
201
|
+
summary: "approve or refuse the changes the audit held for you; approved ones are still tested before they are kept",
|
|
202
|
+
run: async (_args, io) => {
|
|
203
|
+
const waiting = await heldChanges();
|
|
204
|
+
if (waiting.length === 0) {
|
|
205
|
+
io.out("no change is held for your review");
|
|
206
|
+
return 0;
|
|
207
|
+
}
|
|
208
|
+
await asking(async (ask) => {
|
|
209
|
+
for (const held of waiting) {
|
|
210
|
+
const question = [
|
|
211
|
+
`For ${held.failure}, a ${held.kind}${held.skill === undefined ? "" : ` (${held.skill})`}:`,
|
|
212
|
+
held.text.split("\n").map((line) => ` ${line}`).join("\n"),
|
|
213
|
+
`It predicts: ${held.prediction}`,
|
|
214
|
+
`The audit asks for you because: ${held.reasons.join("; ")}`,
|
|
215
|
+
"Test it for keeping? [y/n/skip] ",
|
|
216
|
+
].join("\n");
|
|
217
|
+
const answer = await ask(question);
|
|
218
|
+
if (answer === "y" || answer === "n")
|
|
219
|
+
await decideHeld(held.id, answer === "y");
|
|
220
|
+
}
|
|
221
|
+
});
|
|
222
|
+
return 0;
|
|
223
|
+
},
|
|
224
|
+
};
|
|
225
|
+
/** The loop's changes, newest first. */
|
|
226
|
+
export const evolveLogCommand = {
|
|
227
|
+
name: "evolve log",
|
|
228
|
+
args: "",
|
|
229
|
+
summary: "list the changes the loop kept, newest first",
|
|
230
|
+
run: async (_args, io) => {
|
|
231
|
+
const changes = await loopChanges();
|
|
232
|
+
if (changes.length === 0)
|
|
233
|
+
io.out("the loop has kept no change yet");
|
|
234
|
+
for (const change of changes) {
|
|
235
|
+
io.out(`${change.id.slice(0, 8)} ${change.added.slice(0, 10)} ${change.kind}${change.archived ? " (archived)" : ""} ${change.text.split("\n")[0]}`);
|
|
236
|
+
}
|
|
237
|
+
return 0;
|
|
238
|
+
},
|
|
239
|
+
};
|
|
240
|
+
/** Takes a change back out; it stays in the history and can be restored by a later version. */
|
|
241
|
+
export const evolveUndoCommand = {
|
|
242
|
+
name: "evolve undo",
|
|
243
|
+
args: "<id>",
|
|
244
|
+
summary: "archive one change the loop kept, so new conversations run without it",
|
|
245
|
+
run: async (args, io) => {
|
|
246
|
+
const [id] = args;
|
|
247
|
+
if (id === undefined || args.length > 1) {
|
|
248
|
+
io.err("usage: chopin evolve undo <id>");
|
|
249
|
+
return 2;
|
|
250
|
+
}
|
|
251
|
+
const undone = await undoChange(id);
|
|
252
|
+
if (typeof undone === "string") {
|
|
253
|
+
io.err(undone);
|
|
254
|
+
return 1;
|
|
255
|
+
}
|
|
256
|
+
io.out(`archived ${undone.undone.id.slice(0, 8)}; new conversations use version ${undone.version}`);
|
|
257
|
+
return 0;
|
|
258
|
+
},
|
|
259
|
+
};
|
|
260
|
+
/** Asks the user about each correction the loop found; a confirmed one becomes a failure to learn from. */
|
|
261
|
+
export const evolveCorrectionsCommand = {
|
|
262
|
+
name: "evolve corrections",
|
|
263
|
+
args: "",
|
|
264
|
+
summary: "confirm or dismiss, kind by kind, the corrections the loop found in your sessions",
|
|
265
|
+
run: async (_args, io) => {
|
|
266
|
+
const { asking: kinds, later } = await correctionsAsked();
|
|
267
|
+
if (later > 0)
|
|
268
|
+
io.out(`${later} correction${later === 1 ? "" : "s"} wait until their kind comes up in another session`);
|
|
269
|
+
if (kinds.length === 0) {
|
|
270
|
+
if (later === 0)
|
|
271
|
+
io.out("no correction is waiting");
|
|
272
|
+
return 0;
|
|
273
|
+
}
|
|
274
|
+
await asking(async (ask) => {
|
|
275
|
+
for (const kind of kinds) {
|
|
276
|
+
const examples = kind.examples.map((example) => ` - ${example}`).join("\n");
|
|
277
|
+
const answer = await ask(`In ${kind.sessions} sessions you corrected the agent for ${kind.key}:\n${examples}\nLearn from these? [y/n/skip] `);
|
|
278
|
+
if (answer === "y" || answer === "n")
|
|
279
|
+
await answerCorrections(kind.key, answer === "y");
|
|
280
|
+
}
|
|
281
|
+
});
|
|
282
|
+
return 0;
|
|
283
|
+
},
|
|
284
|
+
};
|
|
285
|
+
/** Asks the user in this terminal for as long as `questions` runs; answers come back trimmed and in lower case. */
|
|
286
|
+
async function asking(questions) {
|
|
287
|
+
const terminal = createInterface({ input: process.stdin, output: process.stdout });
|
|
288
|
+
try {
|
|
289
|
+
await questions(async (question) => (await terminal.question(question)).trim().toLowerCase());
|
|
290
|
+
}
|
|
291
|
+
finally {
|
|
292
|
+
terminal.close();
|
|
293
|
+
}
|
|
294
|
+
}
|
|
295
|
+
/**
|
|
296
|
+
* The project of each session, named as chopin names a project's directory: from where a chopin service wrote it, or
|
|
297
|
+
* from the working directory another agent's log records.
|
|
298
|
+
*/
|
|
299
|
+
async function projectsOf(sources) {
|
|
300
|
+
const projects = new Map();
|
|
301
|
+
const exported = join(chopinHome(), "projects");
|
|
302
|
+
for (const source of sources) {
|
|
303
|
+
if (source.kind === "acp" && source.path.startsWith(exported)) {
|
|
304
|
+
projects.set(source.path, relative(exported, source.path).split(sep)[0]);
|
|
305
|
+
continue;
|
|
306
|
+
}
|
|
307
|
+
const cwd = /"cwd":"((?:[^"\\]|\\.)*)"/.exec((await readFile(source.path, "utf8")).slice(0, 200_000))?.[1];
|
|
308
|
+
const root = cwd === undefined ? undefined : await realpath(JSON.parse(`"${cwd}"`)).catch(() => undefined);
|
|
309
|
+
if (root !== undefined)
|
|
310
|
+
projects.set(source.path, createHash("sha256").update(root).digest("hex").slice(0, 16));
|
|
311
|
+
}
|
|
312
|
+
return projects;
|
|
313
|
+
}
|
|
314
|
+
//# sourceMappingURL=evolve.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"evolve.js","sourceRoot":"","sources":["../../src/rsi/evolve.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AACnE,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AACzD,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAClC,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,GAAG,EAAE,MAAM,WAAW,CAAC;AAChD,OAAO,EAAE,WAAW,EAAE,MAAM,kCAAkC,CAAC;AAC/D,OAAO,EACL,KAAK,EAAE,YAAY,EAAE,SAAS,EAAE,WAAW,EAAE,WAAW,EAAE,mBAAmB,EAAE,eAAe,EAAE,WAAW,EAC3G,aAAa,EAAE,SAAS,EAAE,UAAU,EAAE,YAAY,EAAE,YAAY,GACjE,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,UAAU,EAAE,cAAc,EAAE,QAAQ,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAEjG,OAAO,EAAE,YAAY,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAClE,OAAO,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AACvC,OAAO,EAAE,UAAU,EAAE,cAAc,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AACpF,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACtE,OAAO,EAAE,OAAO,EAAE,cAAc,EAAe,MAAM,cAAc,CAA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AAC;YAC9D,QAAQ,CAAC,GAAG,CAAC,MAAM,CAAC,IAAI,EAAE,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC,IAAI,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAE,CAAC,CAAC;YAC1E,SAAS;QACX,CAAC;QACD,MAAM,GAAG,GAAG,2BAA2B,CAAC,IAAI,CAAC,CAAC,MAAM,QAAQ,CAAC,MAAM,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,OAAO,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;QAC3G,MAAM,IAAI,GAAG,GAAG,KAAK,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,MAAM,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,GAAG,GAAG,CAAW,CAAC,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC,SAAS,CAAC,CAAC;QACrH,IAAI,IAAI,KAAK,SAAS;YAAE,QAAQ,CAAC,GAAG,CAAC,MAAM,CAAC,IAAI,EAAE,UAAU,CAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC;IAClH,CAAC;IACD,OAAO,QAAQ,CAAC;AAClB,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { AgentService } from "@chopin-ai/harness-pi";
|
|
2
|
+
/**
|
|
3
|
+
* Writes each conversation changed since it was last written as an ACP transcript in `directory`, one file per
|
|
4
|
+
* conversation, so the loop reads what it learns from without opening the project's store. Says how many it wrote.
|
|
5
|
+
*/
|
|
6
|
+
export declare function exportTranscripts(service: AgentService, directory: string): Promise<number>;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { mkdir, readFile } from "node:fs/promises";
|
|
2
|
+
import { join } from "node:path";
|
|
3
|
+
import { BACKGROUND_CONTEXT } from "@earendil-works/chord/context";
|
|
4
|
+
import { writeWhole } from "../home.js";
|
|
5
|
+
const OWNER = "local";
|
|
6
|
+
const MARKS = "exported.json";
|
|
7
|
+
/**
|
|
8
|
+
* Writes each conversation changed since it was last written as an ACP transcript in `directory`, one file per
|
|
9
|
+
* conversation, so the loop reads what it learns from without opening the project's store. Says how many it wrote.
|
|
10
|
+
*/
|
|
11
|
+
export async function exportTranscripts(service, directory) {
|
|
12
|
+
await mkdir(directory, { recursive: true, mode: 0o700 });
|
|
13
|
+
const marksFile = join(directory, MARKS);
|
|
14
|
+
const marks = await readFile(marksFile, "utf8").then((text) => JSON.parse(text), () => ({}));
|
|
15
|
+
let written = 0;
|
|
16
|
+
for (const changed of await service.changedSince(OWNER, marks, BACKGROUND_CONTEXT)) {
|
|
17
|
+
await writeWhole(join(directory, `${changed.id}.jsonl`), changed.transcript.map((entry) => `${JSON.stringify(entry)}\n`).join(""), 0o600);
|
|
18
|
+
marks[String(changed.id)] = changed.modified;
|
|
19
|
+
written += 1;
|
|
20
|
+
}
|
|
21
|
+
if (written > 0)
|
|
22
|
+
await writeWhole(marksFile, JSON.stringify(marks), 0o600);
|
|
23
|
+
return written;
|
|
24
|
+
}
|
|
25
|
+
//# sourceMappingURL=export.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"export.js","sourceRoot":"","sources":["../../src/rsi/export.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AACnD,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,kBAAkB,EAAE,MAAM,+BAA+B,CAAC;AAEnE,OAAO,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAExC,MAAM,KAAK,GAAG,OAAO,CAAC;AACtB,MAAM,KAAK,GAAG,eAAe,CAAC;AAE9B;;;GAGG;AACH,MAAM,CAAC,KAAK,UA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in-ai/core";
|
|
2
|
+
/** A session log the loop reads: an ACP transcript a chopin service wrote, or another agent's message log. */
|
|
3
|
+
export interface Source {
|
|
4
|
+
path: string;
|
|
5
|
+
kind: "acp" | "messages";
|
|
6
|
+
}
|
|
7
|
+
/** Every session log the loop may learn from: each chopin project's exported transcripts, and the configured logs. */
|
|
8
|
+
export declare function sessionSources(chopinHome: string, logDirectories: readonly string[], now?: number): Promise<Source[]>;
|
|
9
|
+
/** A short digest of a criterion text, which keys the verdicts judged by it. */
|
|
10
|
+
export declare function digest(text: string): string;
|
|
11
|
+
/** A user's correction found in a session, named as a failure of the agent step it answers, waiting for the user. */
|
|
12
|
+
export interface Correction extends CorrectionCandidate {
|
|
13
|
+
session: string;
|
|
14
|
+
/** The agent step it corrects. */
|
|
15
|
+
step: number;
|
|
16
|
+
signature: FailureSignature;
|
|
17
|
+
/** The version of the rules it was named by. */
|
|
18
|
+
classifier: number;
|
|
19
|
+
confirmed?: boolean;
|
|
20
|
+
}
|
|
21
|
+
/** Corrections of one kind waiting for the user, and the distinct sessions they came from. */
|
|
22
|
+
export interface CorrectionKind {
|
|
23
|
+
key: string;
|
|
24
|
+
corrections: Correction[];
|
|
25
|
+
sessions: string[];
|
|
26
|
+
}
|
|
27
|
+
/** What the loop has gathered: the failures found, the corrections proposed, and which logs it has read as they were. */
|
|
28
|
+
export declare class Evidence {
|
|
29
|
+
#private;
|
|
30
|
+
readonly root: string;
|
|
31
|
+
constructor(root: string);
|
|
32
|
+
/** The failures named by the current rules; ones named by earlier rules are kept but no longer counted. */
|
|
33
|
+
failures(): Promise<Failure[]>;
|
|
34
|
+
addFailure(failure: Failure): Promise<void>;
|
|
35
|
+
/** Signals the current rules judged no failure, by session and line, so they are not asked about again. */
|
|
36
|
+
dismissed(): Promise<Set<string>>;
|
|
37
|
+
dismiss(session: string, line: number): Promise<void>;
|
|
38
|
+
/** The kinds of failure, each under the name its other names are merged into. */
|
|
39
|
+
kinds(): Promise<FailureClass[]>;
|
|
40
|
+
/** Looks for kinds that are other names for one mechanism again, once a kind not looked at before has come in. */
|
|
41
|
+
mergeKinds(complete: Complete): Promise<void>;
|
|
42
|
+
corrections(): Promise<Correction[]>;
|
|
43
|
+
addCorrection(correction: Correction): Promise<void>;
|
|
44
|
+
/** Corrections named by the current rules that the user has not answered yet. */
|
|
45
|
+
pendingCorrections(): Promise<Correction[]>;
|
|
46
|
+
/** The pending corrections by kind, under the same names failures are merged into, the most sessions first. */
|
|
47
|
+
correctionKinds(): Promise<CorrectionKind[]>;
|
|
48
|
+
/** Records the user's answer on a correction; the latest answer for a line wins. */
|
|
49
|
+
answerCorrection(correction: Correction, confirmed: boolean): Promise<void>;
|
|
50
|
+
/**
|
|
51
|
+
* What the user said to correct each step they confirmed a correction of, by session and line: the strongest
|
|
52
|
+
* evidence a failure has, and the criterion it is judged by.
|
|
53
|
+
*/
|
|
54
|
+
confirmedCorrections(): Promise<Map<string, string>>;
|
|
55
|
+
/** The criteria a kind's failures are judged by, as a digest: empty when none was named by the user's correction. */
|
|
56
|
+
criteria(found: FailureClass): Promise<string>;
|
|
57
|
+
/** The user's answer on every correction of a kind; confirmed ones become failures at the steps they correct. */
|
|
58
|
+
answerKind(kind: CorrectionKind, confirmed: boolean): Promise<void>;
|
|
59
|
+
/** Whether each failure recurred when the given layer version continued its session on `model`, by point. */
|
|
60
|
+
recurrence(version: number, model: string): Promise<Map<string, boolean>>;
|
|
61
|
+
addRecurrence(point: string, version: number, model: string, recurred: boolean): Promise<void>;
|
|
62
|
+
/** The kinds of failure a kept change answers, globally or in a project; a kind whose change was undone is open again. */
|
|
63
|
+
answered(): Promise<Set<string>>;
|
|
64
|
+
addAnswered(failure: string): Promise<void>;
|
|
65
|
+
reopen(failure: string): Promise<void>;
|
|
66
|
+
/** Which logs were read as they were, under the current rules; new rules read every log again. */
|
|
67
|
+
seen(): Promise<Record<string, string>>;
|
|
68
|
+
markSeen(seen: Record<string, string>): Promise<void>;
|
|
69
|
+
/** How many lines of each log were asked about corrections, which no change of rules asks about again. */
|
|
70
|
+
correctionsRead(): Promise<Record<string, number>>;
|
|
71
|
+
markCorrectionsRead(read: Record<string, number>): Promise<void>;
|
|
72
|
+
}
|
|
73
|
+
/** A session's entries as the loop reads them: converted to ACP when needed, and redacted. */
|
|
74
|
+
export declare function readSession(source: Source, secrets: readonly string[]): Promise<TranscriptEntry[]>;
|
|
75
|
+
/**
|
|
76
|
+
* Reads every log that changed since it was last read: names each failure in it with the regular model, and asks it
|
|
77
|
+
* which of the user's messages correct the agent, naming each as a failure too, so the user confirms them by kind. A
|
|
78
|
+
* failure or correction already gathered is not asked about again.
|
|
79
|
+
*/
|
|
80
|
+
export declare function harvest(evidence: Evidence, sources: readonly Source[], complete: Complete, secrets: readonly string[], onRead?: (source: Source, found: {
|
|
81
|
+
failures: number;
|
|
82
|
+
corrections: number;
|
|
83
|
+
}) => void): Promise<{
|
|
84
|
+
read: number;
|
|
85
|
+
failures: number;
|
|
86
|
+
corrections: number;
|
|
87
|
+
}>;
|