tryharness 0.7.45 → 0.7.54

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 (125) hide show
  1. package/README.md +239 -14
  2. package/assets/dsh-plugin.mjs +72 -0
  3. package/assets/opencode-plugin.js +4 -3
  4. package/cli.mjs +497 -196
  5. package/lib/actorRoster.mjs +28 -5
  6. package/lib/adapters.mjs +165 -222
  7. package/lib/agentRuntimeConfig.mjs +36 -0
  8. package/lib/agentRuntimes.mjs +570 -0
  9. package/lib/agentSignIn.mjs +226 -0
  10. package/lib/atlas.mjs +7 -2
  11. package/lib/audit.mjs +643 -0
  12. package/lib/backupSetup.mjs +141 -0
  13. package/lib/boardAccess.mjs +8 -1
  14. package/lib/boardBackup.mjs +283 -0
  15. package/lib/boardCommands.mjs +5 -10
  16. package/lib/boardFileCommands.mjs +2 -1
  17. package/lib/boardMirror.mjs +523 -0
  18. package/lib/boardProtocol.json +263 -6
  19. package/lib/boardTools.mjs +2 -6
  20. package/lib/boardWaits.mjs +102 -0
  21. package/lib/book.mjs +659 -0
  22. package/lib/bridge.mjs +26 -4
  23. package/lib/browserWake.mjs +60 -0
  24. package/lib/cards.mjs +159 -16
  25. package/lib/cloudBoot.mjs +124 -0
  26. package/lib/commands.mjs +25 -5
  27. package/lib/connectionTools.d.ts +13 -0
  28. package/lib/connectionTools.js +45 -0
  29. package/lib/connectorAuth.mjs +309 -0
  30. package/lib/connectorCatalog.json +41 -0
  31. package/lib/connectorCommands.mjs +121 -0
  32. package/lib/connectorGoogle.mjs +513 -0
  33. package/lib/connectors.mjs +805 -0
  34. package/lib/context.mjs +18 -4
  35. package/lib/contractGate.mjs +377 -0
  36. package/lib/coordinator.mjs +152 -39
  37. package/lib/coreModels.mjs +78 -0
  38. package/lib/daemon.mjs +973 -54
  39. package/lib/desk.mjs +239 -0
  40. package/lib/desktop.mjs +113 -8
  41. package/lib/digest.mjs +32 -0
  42. package/lib/directLink.mjs +283 -0
  43. package/lib/environments.mjs +825 -0
  44. package/lib/folders.mjs +4 -4
  45. package/lib/gitHost.mjs +174 -0
  46. package/lib/goalCommands.mjs +58 -14
  47. package/lib/hookDialects.mjs +298 -0
  48. package/lib/inference.mjs +263 -152
  49. package/lib/landed.mjs +887 -0
  50. package/lib/lessons.mjs +6 -0
  51. package/lib/lineup.mjs +324 -0
  52. package/lib/live.mjs +284 -13
  53. package/lib/localmodels.mjs +10 -0
  54. package/lib/machineIdentity.mjs +3 -0
  55. package/lib/machineRoutes.mjs +40 -2
  56. package/lib/machineRuns.mjs +30 -3
  57. package/lib/machineSeal.mjs +69 -10
  58. package/lib/mcp-stdio.mjs +189 -120
  59. package/lib/mcpRelay.mjs +119 -0
  60. package/lib/members.json +26 -0
  61. package/lib/members.mjs +33 -0
  62. package/lib/modelMemory.mjs +100 -0
  63. package/lib/models.mjs +48 -15
  64. package/lib/museSession.mjs +122 -0
  65. package/lib/nativeHost.mjs +203 -0
  66. package/lib/neovim.mjs +126 -0
  67. package/lib/network.mjs +7 -2
  68. package/lib/nudge.mjs +57 -18
  69. package/lib/onboard.mjs +430 -1
  70. package/lib/oneclawLocal.mjs +150 -0
  71. package/lib/ownMachines.mjs +828 -39
  72. package/lib/pairing.mjs +182 -0
  73. package/lib/paths.mjs +8 -0
  74. package/lib/personModel.mjs +89 -0
  75. package/lib/phones.mjs +119 -3
  76. package/lib/placeCommands.mjs +27 -0
  77. package/lib/places.mjs +337 -9
  78. package/lib/plans.mjs +151 -27
  79. package/lib/profile.mjs +152 -0
  80. package/lib/projects.mjs +624 -137
  81. package/lib/readiness.mjs +400 -0
  82. package/lib/record.mjs +115 -0
  83. package/lib/repoLinks.mjs +354 -0
  84. package/lib/roomChannels.mjs +641 -0
  85. package/lib/runBrief.mjs +32 -2
  86. package/lib/runRequests.mjs +157 -0
  87. package/lib/runWorker.mjs +37 -9
  88. package/lib/runner.mjs +74 -11
  89. package/lib/secretPatterns.json +55 -0
  90. package/lib/secrets.mjs +10 -27
  91. package/lib/seen.mjs +102 -0
  92. package/lib/service.mjs +11 -6
  93. package/lib/sessionControl.mjs +386 -96
  94. package/lib/sessionIndex.mjs +5 -3
  95. package/lib/specialties.json +74 -0
  96. package/lib/specialties.mjs +477 -0
  97. package/lib/specialtyKeys.d.ts +3 -0
  98. package/lib/specialtyKeys.js +58 -0
  99. package/lib/specialtyNotice.mjs +147 -0
  100. package/lib/specialtySnapshot.mjs +138 -0
  101. package/lib/store.mjs +829 -29
  102. package/lib/subagents.mjs +8 -4
  103. package/lib/swarm.mjs +483 -37
  104. package/lib/swarmMemory.mjs +947 -0
  105. package/lib/t3.mjs +56 -17
  106. package/lib/taskCommands.mjs +91 -13
  107. package/lib/taskRuns.mjs +68 -11
  108. package/lib/team.json +253 -144
  109. package/lib/team.mjs +538 -147
  110. package/lib/threadLine.mjs +116 -0
  111. package/lib/threadRuns.mjs +78 -12
  112. package/lib/threadView.mjs +66 -16
  113. package/lib/tokenizer.mjs +405 -0
  114. package/lib/ui.mjs +16 -2
  115. package/lib/usageTotals.mjs +148 -0
  116. package/lib/vault.mjs +1144 -0
  117. package/lib/vaultCloud.mjs +117 -0
  118. package/lib/vaultCommands.mjs +201 -0
  119. package/lib/vaultTools.d.ts +12 -0
  120. package/lib/vaultTools.js +42 -0
  121. package/lib/windowAsks.mjs +42 -0
  122. package/lib/workFocus.mjs +59 -0
  123. package/lib/workLinks.mjs +90 -0
  124. package/lib/worktrees.mjs +51 -13
  125. package/package.json +10 -5
package/lib/desk.mjs ADDED
@@ -0,0 +1,239 @@
1
+ import {
2
+ deskAsk,
3
+ fileBankrReceipt,
4
+ onchainExecutors,
5
+ readBook,
6
+ strategyOfThread,
7
+ treasurerOf,
8
+ writeBook,
9
+ } from "./book.mjs";
10
+ import {
11
+ approveDeploy,
12
+ buildAsk,
13
+ contractOfDeploy,
14
+ deployRequest,
15
+ fileBuild,
16
+ fileCheck,
17
+ fileJudge,
18
+ markDeployAsked,
19
+ startContract,
20
+ verifyDeployment,
21
+ view,
22
+ } from "./contractGate.mjs";
23
+
24
+ // The onchain desk on this computer (docs/swarm-organization.md, "The onchain desk"): the book's commands for agents
25
+ // and the person (board.desk.*), each Bankr ask in a thread under a strategy carrying that strategy's high-level
26
+ // instructions instead of the book, Bankr's chain receipts filed into the book when its work comes back, and the
27
+ // contract gate's deploy ask and the check of what was deployed.
28
+
29
+ export function createDesk({
30
+ store,
31
+ log = () => {},
32
+ // What the chain holds at an address, read by Harness's server: { ok, sha256, bytes } (walletReads.ts deployed_code).
33
+ readCode = async () => ({
34
+ ok: false,
35
+ error: "the chain cannot be read here",
36
+ }),
37
+ // Posts an ask for Bankr in a thread in the asker's name; resolves to the posted task or rejects.
38
+ askBankr = async () => {
39
+ throw new Error("Bankr cannot be asked from here");
40
+ },
41
+ }) {
42
+ const executors = () => onchainExecutors();
43
+
44
+ /** A Bankr task about to go to Harness: in a thread under a strategy it carries the strategy's slice, fitted. */
45
+ const forBankr = (request) => {
46
+ if (!executors().includes(String(request.targetAgent || "")))
47
+ return request;
48
+ const refs = Array.isArray(request.contextRefs) ? request.contextRefs : [];
49
+ const askRef = refs.find(
50
+ (ref) => ref?.kind === "ask" && typeof ref.ref === "string"
51
+ );
52
+ const fitted = deskAsk(store, {
53
+ threadId: request.parentId ? String(request.parentId) : null,
54
+ ask: askRef?.ref ?? String(request.objective || ""),
55
+ history: String(request.brief || ""),
56
+ });
57
+ if (!fitted) return request;
58
+ return {
59
+ ...request,
60
+ brief: fitted.history,
61
+ contextRefs: [
62
+ ...refs.filter((ref) => ref !== askRef),
63
+ { kind: "ask", ref: fitted.ask },
64
+ ],
65
+ };
66
+ };
67
+
68
+ // After Bankr deployed reviewed code: what the chain holds at the address it created is compared with that code.
69
+ const verify = async (contract, chain, address) => {
70
+ const read = await readCode(chain, address).catch((error) => ({
71
+ ok: false,
72
+ error: error.message,
73
+ }));
74
+ const checked = verifyDeployment(store, {
75
+ contract: contract.id,
76
+ address,
77
+ deployedSha256: read?.ok ? read.sha256 : null,
78
+ });
79
+ if (checked.status === "mismatch")
80
+ log(
81
+ `contract ${contract.id}: the code at ${address} is not the code reviewed`
82
+ );
83
+ return { ...checked, ...(read?.ok ? {} : { error: read?.error }) };
84
+ };
85
+
86
+ /** A Bankr job in one of the person's threads came back: its chain receipt goes into the book. */
87
+ const cloudJob = (job) => {
88
+ const receipt = fileBankrReceipt(store, job);
89
+ if (!receipt) return null;
90
+ log(`filed Bankr's receipt for ${job.id} in the book (${receipt.outcome})`);
91
+ const contract = contractOfDeploy(store, job.id);
92
+ const created = receipt.operations.flatMap((op) =>
93
+ (op.created ?? []).map((address) => ({ chain: op.chain, address }))
94
+ );
95
+ if (contract && created.length)
96
+ void verify(
97
+ contract,
98
+ created[0].chain ?? contract.chain,
99
+ created[0].address
100
+ );
101
+ return receipt;
102
+ };
103
+
104
+ const contractCommand = async (request, agent) => {
105
+ const action = String(request.action || "");
106
+ const id = String(request.contract || "");
107
+ if (action === "view") {
108
+ const contract = view(
109
+ store.db.get("select * from book_contracts where id = ?", [id])
110
+ );
111
+ return contract
112
+ ? {
113
+ ok: true,
114
+ contract,
115
+ buildAsk: buildAsk(store, id),
116
+ deploy: deployRequest(store, { contract: id }),
117
+ }
118
+ : { ok: false, error: "no contract in the book has that id" };
119
+ }
120
+ if (action === "start")
121
+ return startContract(store, agent, {
122
+ strategy: request.strategy,
123
+ name: request.name,
124
+ chain: request.chain,
125
+ oneGo: request.one_go === true,
126
+ buildChain: request.build_chain,
127
+ });
128
+ if (action === "file_build")
129
+ return fileBuild(store, agent, {
130
+ contract: id,
131
+ source: request.source,
132
+ runtimeCode: request.runtime_code,
133
+ buildTask: request.build_task,
134
+ address: request.address,
135
+ });
136
+ if (action === "check")
137
+ return fileCheck(store, agent, {
138
+ contract: id,
139
+ model: request.model,
140
+ sha256: request.sha256,
141
+ passed: request.passed,
142
+ });
143
+ if (action === "judge")
144
+ return fileJudge(store, agent, {
145
+ contract: id,
146
+ model: request.model,
147
+ sha256: request.sha256,
148
+ accepted: request.accepted,
149
+ });
150
+ if (action === "approve")
151
+ return approveDeploy(store, agent, {
152
+ contract: id,
153
+ sha256: request.sha256,
154
+ });
155
+ if (action === "deploy") {
156
+ if (agent !== "user" && treasurerOf(store).agent !== agent)
157
+ return {
158
+ ok: false,
159
+ error: "the treasurer or the person asks Bankr to deploy",
160
+ };
161
+ const gate = deployRequest(store, { contract: id });
162
+ if (!gate.ok)
163
+ return {
164
+ ok: false,
165
+ error: `not deployed: ${gate.refusals.join("; ")}`,
166
+ refusals: gate.refusals,
167
+ };
168
+ const row = store.db.get(
169
+ "select strategy_id from book_contracts where id = ?",
170
+ [id]
171
+ );
172
+ const thread =
173
+ String(request.thread || "") ||
174
+ store.db.get(
175
+ "select thread_id from book_threads where strategy_id = ? order by created_at limit 1",
176
+ [row.strategy_id]
177
+ )?.thread_id;
178
+ if (!thread || strategyOfThread(store, thread) !== row.strategy_id)
179
+ return {
180
+ ok: false,
181
+ error:
182
+ "name a thread under the contract's strategy for Bankr's deploy ask",
183
+ };
184
+ const task = await askBankr({
185
+ threadId: thread,
186
+ asker: agent,
187
+ words: gate.ask,
188
+ });
189
+ return {
190
+ ok: true,
191
+ contract: markDeployAsked(store, id, task.id),
192
+ task: task.id,
193
+ };
194
+ }
195
+ if (action === "verify") {
196
+ const contract = view(
197
+ store.db.get("select * from book_contracts where id = ?", [id])
198
+ );
199
+ if (!contract)
200
+ return { ok: false, error: "no contract in the book has that id" };
201
+ const address = String(request.address || contract.address || "");
202
+ if (!address)
203
+ return { ok: false, error: "name the address it was deployed to" };
204
+ return verify(contract, String(request.chain || contract.chain), address);
205
+ }
206
+ return { ok: false, error: `unknown contract action ${action}` };
207
+ };
208
+
209
+ /** board.desk.*: any agent reads the book; the treasurer and the person write it; Bankr never reads it. */
210
+ const command = (request, agent) => {
211
+ // Bankr is asked with a strategy's instructions only; work another person's agent asked for (a restricted run) and
212
+ // agents reaching the board through Harness do not read the person's book.
213
+ if (executors().includes(agent))
214
+ return {
215
+ ok: false,
216
+ error:
217
+ "Bankr is asked with a strategy's instructions; the book stays with the treasurer",
218
+ };
219
+ if (request.hostedCaller || request.restricted === true)
220
+ return {
221
+ ok: false,
222
+ error:
223
+ "the desk's book is only for the person and their agents on their computers",
224
+ };
225
+ if (request.command === "board.desk.book")
226
+ return readBook(store, {
227
+ strategy: request.strategy ? String(request.strategy) : null,
228
+ });
229
+ if (request.command === "board.desk.write")
230
+ return writeBook(store, agent, request.entry ?? {});
231
+ if (request.command === "board.desk.treasurer")
232
+ return { ok: true, treasurer: treasurerOf(store) };
233
+ if (request.command === "board.desk.contract")
234
+ return { pending: contractCommand(request, agent) };
235
+ return { ok: false, error: `unknown desk command ${request.command}` };
236
+ };
237
+
238
+ return { command, forBankr, cloudJob };
239
+ }
package/lib/desktop.mjs CHANGED
@@ -208,11 +208,16 @@ export function quitDesktop({
208
208
  const exes = executables(target, platform).filter(
209
209
  (exe) => path.basename(exe) !== "HarnessDaemon"
210
210
  );
211
- for (const exe of exes) execute("pkill", ["-f", exe]);
211
+ // Match the executable boundary: "Harness" must not match "HarnessDaemon".
212
+ const processes = exes.map((exe) => {
213
+ const escaped = exe.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
214
+ return `^${escaped}($| )`;
215
+ });
216
+ for (const pattern of processes) execute("pkill", ["-f", pattern]);
212
217
  // Opening it again before the old one has gone fails on macOS (LaunchServices error -600).
213
218
  for (
214
219
  let i = 0;
215
- i < 50 && exes.some((exe) => execute("pgrep", ["-f", exe]).ok);
220
+ i < 50 && processes.some((pattern) => execute("pgrep", ["-f", pattern]).ok);
216
221
  i++
217
222
  ) {
218
223
  Atomics.wait(new Int32Array(new SharedArrayBuffer(4)), 0, 0, 100);
@@ -277,15 +282,106 @@ export function openDesktop({
277
282
  child.unref();
278
283
  }
279
284
 
280
- /** Disconnecting stops the app and takes it out of login items; the app itself stays. */
281
- export function retireDesktop({
285
+ const BUNDLE_ID = "ai.tryharness.desktop";
286
+ // The app's own uninstall run (UNINSTALL_ARG in the app's lib.rs) takes out what macOS registered for it, the
287
+ // Lid-Closed power helper and its backstop job, which nothing outside the app can remove. Buddies up to 0.7.53 don't
288
+ // know the argument and would open instead.
289
+ const UNINSTALL_ARG = "--uninstall";
290
+ const LAST_WITHOUT_UNINSTALL = "0.7.53";
291
+
292
+ /** Where the app keeps its settings, log and web storage (the app's platform/*.rs, and its webview's own folders). */
293
+ export function desktopFolders({
294
+ platform = process.platform,
295
+ env = process.env,
296
+ homeDir = os.homedir(),
297
+ } = {}) {
298
+ if (platform === "darwin") {
299
+ const library = path.join(homeDir, "Library");
300
+ return [
301
+ path.join(library, "Application Support", "Harness Desktop"),
302
+ path.join(library, "Logs", "Harness Desktop"),
303
+ path.join(library, "Caches", BUNDLE_ID),
304
+ path.join(library, "WebKit", BUNDLE_ID),
305
+ path.join(library, "HTTPStorages", BUNDLE_ID),
306
+ path.join(library, "Preferences", `${BUNDLE_ID}.plist`),
307
+ path.join(library, "Saved Application State", `${BUNDLE_ID}.savedState`),
308
+ ];
309
+ }
310
+ if (platform === "linux") {
311
+ const config = env.XDG_CONFIG_HOME || path.join(homeDir, ".config");
312
+ const data = env.XDG_DATA_HOME || path.join(homeDir, ".local", "share");
313
+ const cache = env.XDG_CACHE_HOME || path.join(homeDir, ".cache");
314
+ return [
315
+ path.join(config, "harness-desktop"),
316
+ path.join(data, "harness-desktop"),
317
+ path.join(data, BUNDLE_ID),
318
+ path.join(cache, BUNDLE_ID),
319
+ ];
320
+ }
321
+ if (platform === "win32") {
322
+ const roaming = env.APPDATA || path.join(homeDir, "AppData", "Roaming");
323
+ const local = env.LOCALAPPDATA || path.join(homeDir, "AppData", "Local");
324
+ return [
325
+ path.join(roaming, "Harness Desktop"),
326
+ path.join(local, "Harness Desktop"),
327
+ path.join(local, BUNDLE_ID),
328
+ ];
329
+ }
330
+ return [];
331
+ }
332
+
333
+ // A Mac app bundle's Info.plist, or "" when there is none.
334
+ const infoPlist = (app) => {
335
+ try {
336
+ return fs.readFileSync(path.join(app, "Contents", "Info.plist"), "latin1");
337
+ } catch {
338
+ return "";
339
+ }
340
+ };
341
+
342
+ const bundleVersion = (plist) =>
343
+ /CFBundleShortVersionString<\/key>\s*<string>([^<]+)</.exec(plist)?.[1];
344
+
345
+ // The installed app: where setup recorded it, and on a Mac also ~/Applications/Harness.app when it is ours, so an
346
+ // app left after ~/.harness was deleted still goes.
347
+ function installedApps({ platform, env, homeDir }) {
348
+ const apps = new Set();
349
+ const recorded = readJson(marker(), {}).path;
350
+ if (recorded && fs.existsSync(recorded)) apps.add(recorded);
351
+ if (platform === "darwin") {
352
+ const usual = desktopTarget({
353
+ source: { app: "Harness.app" },
354
+ env,
355
+ platform,
356
+ homeDir,
357
+ });
358
+ if (infoPlist(usual).includes(BUNDLE_ID)) apps.add(usual);
359
+ }
360
+ return [...apps];
361
+ }
362
+
363
+ // The app undoes what it changed and takes out its power helper before it is deleted, when it knows how.
364
+ function cleanUpMacApp(app, execute) {
365
+ const version = bundleVersion(infoPlist(app));
366
+ if (!newerVersion(version, LAST_WITHOUT_UNINSTALL)) return;
367
+ const program = path.join(app, "Contents", "MacOS", "Harness");
368
+ if (fs.existsSync(program)) execute(program, [UNINSTALL_ARG]);
369
+ }
370
+
371
+ /** `tryharness uninstall`: the app quits, cleans up after itself and is deleted with its login item and folders. */
372
+ export function uninstallDesktop({
282
373
  platform = process.platform,
283
374
  execute = run,
375
+ env = process.env,
284
376
  homeDir = os.homedir(),
285
- }) {
286
- const installed = readJson(marker(), {});
287
- if (installed.path)
288
- quitDesktop({ target: installed.path, platform, execute });
377
+ } = {}) {
378
+ for (const app of installedApps({ platform, env, homeDir })) {
379
+ quitDesktop({ target: app, platform, execute });
380
+ if (platform === "darwin") cleanUpMacApp(app, execute);
381
+ try {
382
+ fs.rmSync(app, { recursive: true, force: true });
383
+ } catch {}
384
+ }
289
385
  // Where the app's own login item lives (tauri-plugin-autostart, named after the product).
290
386
  if (platform === "darwin") {
291
387
  const agents = path.join(homeDir, "Library", "LaunchAgents");
@@ -306,4 +402,13 @@ export function retireDesktop({
306
402
  "Harness",
307
403
  "/f",
308
404
  ]);
405
+ for (const folder of [
406
+ ...desktopFolders({ platform, env, homeDir }),
407
+ path.join(paths.home, "desktop"),
408
+ downloads(),
409
+ marker(),
410
+ ])
411
+ try {
412
+ fs.rmSync(folder, { recursive: true, force: true });
413
+ } catch {}
309
414
  }
package/lib/digest.mjs CHANGED
@@ -39,6 +39,37 @@ function learnedLines(store, since) {
39
39
  ];
40
40
  }
41
41
 
42
+ // What the dream did since (swarmMemory.mjs): what it kept from the work, changed, and which lessons it retired or
43
+ // widened. `tryharness memory` lists them, and brings any back.
44
+ function dreamLines(store, since) {
45
+ let dream = null;
46
+ try {
47
+ dream = JSON.parse(store.meta("dream-last") || "null");
48
+ } catch {}
49
+ if (!dream?.ok || dream.at <= since) return [];
50
+ const quoted = (items) =>
51
+ `${items
52
+ .slice(0, 2)
53
+ .map((item) => `"${clip(item.text.replace(/\.$/, ""), 70)}"`)
54
+ .join("; ")}${items.length > 2 ? ` and ${items.length - 2} more` : ""}`;
55
+ return [
56
+ ...(dream.kept.length
57
+ ? [`Overnight the swarm kept from the work: ${quoted(dream.kept)}.`]
58
+ : []),
59
+ ...(dream.changed.length
60
+ ? [`It changed what it kept: ${quoted(dream.changed)}.`]
61
+ : []),
62
+ ...(dream.retired.length
63
+ ? [
64
+ `It retired lessons that were instructions for one job: ${quoted(dream.retired)}.`,
65
+ ]
66
+ : []),
67
+ ...(dream.widened.length
68
+ ? [`These now hold for all your work: ${quoted(dream.widened)}.`]
69
+ : []),
70
+ ];
71
+ }
72
+
42
73
  /** { since, lines, threads, empty }: lines are plain sentences, threads their ids for opening them. */
43
74
  export function digestSince(
44
75
  store,
@@ -100,6 +131,7 @@ export function digestSince(
100
131
  }
101
132
  for (const alert of alerts) lines.push(`Watch: ${alert.text}`);
102
133
  lines.push(...learnedLines(store, since));
134
+ lines.push(...dreamLines(store, since));
103
135
  if (learning?.kept && learning.at > since)
104
136
  lines.push(
105
137
  `Learned from ${learning.runs} runs: briefs now hold the files agents went on to change ${Math.round(learning.recallAt10.candidate * 100)}% of the time (was ${Math.round(Math.max(learning.recallAt10.default, learning.recallAt10.current ?? 0) * 100)}%).`