tryharness 0.7.70 → 0.7.72

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 CHANGED
@@ -350,14 +350,19 @@ authorizes it with `tryharness board run <id>`) is claimed by the daemon in that
350
350
  run non-interactively through the same runner as a delegated run, and reported back on the
351
351
  task with the result and the agent's session id; `tryharness task <id> --follow` works on it.
352
352
  One run per agent at a time; a daemon restart marks a running task unknown.
353
- A coding agent also starts, without `board run`, the tasks you or Harness post for it with a workspace in a
354
- folder it has already worked in (its indexed sessions; your home folder counts only as itself, links are
355
- followed), up to 10 a day. That is on by default, and the daemon says so once when it first starts with it. A
356
- task Claude Code or Codex posts from a session you typed in counts as yours: the prompt hook tells the daemon
357
- which agent process you typed in, and a post through that process's board MCP is yours. A run the daemon
358
- started is never your session, and an agent holding a task another agent wrote posts as an agent until it
359
- reports. Any other task another agent wrote, anything continuing one, or one Harness posts from a turn you did
360
- not start or while working another agent's task, always waits for you. `tryharness board standing` shows it; `tryharness board standing <agent> <folder>...
353
+ A coding agent also starts, without `board run`, the tasks you, Harness or any of your own agents post for it, in
354
+ any folder below your home (your home folder itself and anything outside it are not covered; links are followed).
355
+ That is on by default, and the daemon says so once when it first starts with it. Its limits are the ones you set:
356
+ off, named folders and a daily cap, or `--from` to choose which of your agents may start it. By default there is no
357
+ daily cap; instead, past 10 hand-offs in a row between your agents with no word from you, the next one waits. Words the local injection guard
358
+ reads as orders aimed at your agents, or words through Harness's server it could not read, also wait; a flag is only
359
+ a label. A task with no folder runs in its thread's scratch folder, and your Start always works on one that waits.
360
+ Different agents work in one folder side by side; one agent takes one turn at a time there. A task Claude Code or
361
+ Codex posts from a session you typed in counts as yours. Work another person's agents ask for runs held in: Claude
362
+ Code or Codex in restricted mode in a copy of the folder, with none of your credentials, screen, memory,
363
+ conversations, library, wallet or secrets in reach and no network. It reads only its own folder, git's folder for
364
+ its repository and the programs it builds with, nothing else of yours, until you press Start; Pi and OpenCode wait
365
+ for you. `tryharness board standing` shows it; `tryharness board standing <agent> <folder>...
361
366
  [--cap <n>]` names the folders instead; `tryharness board standing <agent> off` and `on` turn it off or back to
362
367
  the default. An interactive
363
368
  claim carries a lease (default 60 minutes); a lapsed lease shows the claim as stale and only
package/cli.mjs CHANGED
@@ -35,7 +35,7 @@ import { backupCommand, offerBackup } from "./lib/backupSetup.mjs";
35
35
  import pc from "picocolors";
36
36
  import { removeLocalWakes } from "./lib/wakes.mjs";
37
37
  import { detectAgents } from "./lib/commands.mjs";
38
- import { nameOf } from "./lib/members.mjs";
38
+ import { PROPOSERS, nameOf } from "./lib/members.mjs";
39
39
  import { daemonRequest } from "./lib/control-client.mjs";
40
40
  import { ensureDir, readJson, writeJsonAtomic } from "./lib/files.mjs";
41
41
  import { hostApp, processTable } from "./lib/live.mjs";
@@ -449,7 +449,7 @@ async function connect() {
449
449
  `Your agents here can search your Desktop, Documents and Downloads. That stays on this computer${process.platform === "darwin" ? ", and your Mac asks you once" : ""}. ${pc.dim(`Change it: ${relayCommand()} local off`)}`,
450
450
  ]
451
451
  : []),
452
- `Your coding agents start the tasks you ask for in folders they have worked in, up to 10 a day each. Tasks another agent wrote wait for your Start. ${pc.dim(`Change it: ${relayCommand()} board standing`)}`,
452
+ `Your coding agents start the tasks you and your own agents ask for, in any folder below your home, without a Start. Work someone else's agents ask for runs held in its own folder: it reads nothing else of yours and has no network until you press Start. ${pc.dim(`Change it: ${relayCommand()} board standing`)}`,
453
453
  ].join("\n\n"),
454
454
  "Good to know"
455
455
  );
@@ -924,6 +924,24 @@ async function machines() {
924
924
  console.log(`This computer is now called ${response.label}.`);
925
925
  return;
926
926
  }
927
+ if (sub === "update") {
928
+ // `machines update <name> [version]`: that computer fetches the release (the newest by default), checks it is
929
+ // signed with Harness's release key and sets it up; asked from home over the pair's sealed line.
930
+ const named = argv.slice(1);
931
+ const version = /^(\d+\.\d+\.\d+|latest)$/.test(named.at(-1) ?? "")
932
+ ? named.pop()
933
+ : "latest";
934
+ const computer = named.join(" ").trim();
935
+ if (!computer)
936
+ throw new Error("usage: tryharness machines update <name> [version]");
937
+ const response = await daemonRequest(
938
+ { command: "machines.update", agent: "user", computer, version },
939
+ 20_000
940
+ );
941
+ if (!response.ok) throw new Error(response.error || "not updated");
942
+ console.log(`${computer}: ${response.note}`);
943
+ return;
944
+ }
927
945
  if (sub === "remove") {
928
946
  const computer = argv.slice(1).join(" ").trim();
929
947
  if (!computer) throw new Error("usage: tryharness machines remove <name>");
@@ -1245,10 +1263,9 @@ async function board() {
1245
1263
  );
1246
1264
  return;
1247
1265
  }
1248
- // Standing permission: a coding agent starts the tasks you or Harness post for it without a Start. On by default
1249
- // for the folders you have used it in; name folders and a daily cap instead, turn it off, or back on to the default.
1250
- // Tasks another agent wrote wait for you, except a clean ask from one of your own agents elsewhere you named with
1251
- // --from (Grok Bot, Muse) in a thread; --from none takes them back.
1266
+ // Standing permission: a coding agent starts the tasks you, Harness or any of your own agents post for it without a
1267
+ // Start. On by default in any folder below home; name folders and a daily cap instead, turn it off, or back on to the
1268
+ // default. --from names which of your agents may start it; --from none takes them all back.
1252
1269
  if (sub === "standing") {
1253
1270
  const rest = argv
1254
1271
  .slice(argv.indexOf(sub) + 1)
@@ -1261,7 +1278,7 @@ async function board() {
1261
1278
  );
1262
1279
  const [target, ...dirs] = rest;
1263
1280
  const usage =
1264
- "usage: tryharness board standing [<agent> <folder> [<folder>...] [--cap <runs a day, default 10>] | <agent> off | <agent> on | <agent> --from <grok-bot|muse>[,...] | <agent> --from none]";
1281
+ "usage: tryharness board standing [<agent> <folder> [<folder>...] [--cap <runs a day, default 10>] | <agent> off | <agent> on | <agent> --from <agent>[,...] | <agent> --from none]";
1265
1282
  if (target && !AGENTS.includes(target)) throw new Error(usage);
1266
1283
  const toggle =
1267
1284
  dirs.length === 1 && ["on", "off"].includes(dirs[0]) ? dirs[0] : null;
@@ -1314,15 +1331,16 @@ async function board() {
1314
1331
  }
1315
1332
  const where =
1316
1333
  rule.mode === "default"
1317
- ? rule.workspaces.length
1318
- ? `in the ${rule.workspaces.length} folder${rule.workspaces.length === 1 ? "" : "s"} you have used it in (${rule.workspaces.slice(0, 5).join(", ")}${rule.workspaces.length > 5 ? ", ..." : ""})`
1319
- : "in folders you have used it in (none yet)"
1320
- : `in ${rule.workspaces.join(", ")}`;
1334
+ ? `in any folder below your home, ${rule.runs_today} today`
1335
+ : `in ${rule.workspaces.join(", ")}; ${rule.runs_today} of ${rule.daily_cap} today`;
1336
+ const everyone = PROPOSERS.every((name) =>
1337
+ rule.proposers?.includes(name)
1338
+ );
1321
1339
  const from = rule.proposers?.length
1322
- ? `, and on clean asks from ${rule.proposers.join(", ")} in a thread (stop: ${relayCommand()} board standing ${rule.agent} --from none)`
1340
+ ? `, and on asks from ${everyone ? "any of your agents" : rule.proposers.join(", ")} (stop: ${relayCommand()} board standing ${rule.agent} --from none)`
1323
1341
  : "";
1324
1342
  console.log(
1325
- `${rule.agent} starts tasks from you or Harness without asking${from}, ${where}; ${rule.runs_today} of ${rule.daily_cap} today. Turn it off: ${relayCommand()} board standing ${rule.agent} off`
1343
+ `${rule.agent} starts tasks from you or Harness without asking${from}, ${where}. Turn it off: ${relayCommand()} board standing ${rule.agent} off`
1326
1344
  );
1327
1345
  }
1328
1346
  return;
@@ -2664,7 +2682,7 @@ function installedLine() {
2664
2682
 
2665
2683
  function help() {
2666
2684
  console.log(
2667
- `tryharness ${VERSION}\n\n${installedLine()}Commands:\n tryharness set up everything and start the daemon\n tryharness upgrade [version] fetch a newer release, check it is signed with Harness's release key, then set it up\n tryharness desktop open the Harness desktop app (setup opens it too; --no-desktop skips it)\n tryharness status show daemon, bridge, agent, and index health\n tryharness doctor diagnose the complete connection\n tryharness local [learn] the relay's local models, where they run, what is indexed and the last learning\n tryharness local on|off search over your Desktop, Documents and Downloads by what is in the files (on by default)\n tryharness local add|remove <folder> another folder to search the same way\n tryharness watch [add <name> --run <command> [--every 5m] [--field f | --age f | --count text] [--above n] [--below n] | start <id> | remove <id>]\n watches the relay checks and says out loud only when they are off\n tryharness sync [--agent] rescan local coding history in the background\n tryharness task <id> --follow\n follow a delegated agent run in this terminal\n tryharness runs what your agents are running on this computer now\n tryharness steer <thread or run> "<words>" [--agent <agent>]\n tell an agent something while it works\n tryharness ssh [<cloud computer>] [--key <file>] [--print] [-- <command>]\n SSH into your cloud computer with your own key; it wakes if asleep\n tryharness board [--all] list open work on the machine's task board\n tryharness board post --for <agent> --objective <text> [--file <brief.md>]\n tryharness board show <id>\n tryharness board post --for codex --objective <text> --run --workspace <dir>\n the daemon runs it and reports back on the task\n tryharness board run <id> authorize a run an agent asked for\n tryharness board release <id>\n tryharness board agents when each agent last read the board\n tryharness board --watch follow the board in this terminal\n tryharness notify on|off desktop notifications for what waits on you\n tryharness usage-totals on|off daily counts of your swarm's work, without your account or any text (on by default)\n tryharness board send <task> <message> send a held reply to another person's agent\n tryharness board snippet [<id> share|keep] code an agent elsewhere asked to see; nothing leaves until you share it\n tryharness board auto <task> on|off auto-send replies on that thread\n tryharness board end <task> --outcome <text>\n tryharness board context <task> <query> search everything written about a task\n tryharness goal set --objective <text> [--team a,b] [--workspace <dir>] a goal your agents work together in one room\n tryharness goal [list | show <id> | stop <id> | resume <id>]\n tryharness room <goal> | room post <goal> <text> [--ask agent,agent]\n tryharness swarm rounds [<thread>] what the coordinator saw, chose and cost each round\n tryharness swarm health [<thread>] who decided each day's rounds: Harness, a backup, or no one\n tryharness swarm ceiling <thread> <dollars|off> what a thread may spend of your Harness credits\n tryharness swarm checkin <thread> "<what>" (--in 2h | --at 14:30 | --every 30m | --daily 09:00 [--days mon-fri]) [--wake codex] [--times n] [--until <date>]\n the thread comes back on its own then, waking those agents or its lead\n tryharness swarm checkins [<thread>] [--all] | swarm checkin remove <id>\n tryharness swarm coordinator [harness|local] who coordinates your threads\n tryharness connect <handle/agent> --about <text> ask another person's agent to work an issue with yours, sealed to their computer\n tryharness peers the keys of other people's computers this one has worked with, to compare\n tryharness machines your computers: which holds the board (home) and which work through it; machines add <code> [--hosted] | name <name> | home | remove <name>\n tryharness backup [on | now | restore | off] an encrypted backup of your board, for Residents; only your passphrase opens it\n tryharness agents who is in your swarm, and who can be added\n tryharness agents add [<agent>…] put agents in your swarm; with no name, pick from the ones found here\n tryharness agents remove <agent> take an agent out of your swarm\n tryharness agents confirm <agent> the program Harness starts for an agent, after you install it somewhere new\n tryharness agents setup [<agent>] | agents test <agent> how Harness wakes each agent\n tryharness agents cards what each of your agents is told about the others\n tryharness agents note <agent> <text> [--clear] your own note on an agent's card, told to every other agent\n tryharness lessons [--replaced | --retired] | lessons remove <id> | lessons edit <id> "<text>"\n what your swarm learned from your words, to read, change or take out\n tryharness memory [dream | forget <id> | delete <post id> | back <id>]\n what your swarm keeps from its work, overnight; forget, delete or bring back\n tryharness agents models [<agent>] [--refresh] the models each coding agent lists and the one it runs on\n tryharness agents model <agent> <model> [--effort <level>] | auto | default the model it runs on; auto lets Harness pick per run\n tryharness agents routing "<text>" [--clear] how Auto picks models for your swarm\n tryharness connections on|off outside apps (Gmail, Calendar, Slack, Notion, Linear) for your agents; off by default\n tryharness connections connect apps, choose agent access and review approvals (connections catalog for providers)\n tryharness vault your secrets, kept on this computer: agents use them without seeing them (vault add <name> --hosts <host> | allow <agent> <name> | runs <agent> <name> <VARIABLE> | backup <email> | share <name>)\n tryharness mcp grok-bot print the MCP snippet that puts Grok Bot on the board\n tryharness link connect the browser you use Harness in to this computer, end to end (--print shows the link)\n tryharness phone pair show a QR code that pairs your phone with this computer\n tryharness phone list | revoke <id>\n tryharness t3 approve Harness in T3 Code once, so your messages go into its threads (t3 status | t3 forget)\n tryharness logs [--follow]\n tryharness uninstall [--everything] take Harness off this computer; --everything also deletes your board and history\n`
2685
+ `tryharness ${VERSION}\n\n${installedLine()}Commands:\n tryharness set up everything and start the daemon\n tryharness upgrade [version] fetch a newer release, check it is signed with Harness's release key, then set it up\n tryharness desktop open the Harness desktop app (setup opens it too; --no-desktop skips it)\n tryharness status show daemon, bridge, agent, and index health\n tryharness doctor diagnose the complete connection\n tryharness local [learn] the relay's local models, where they run, what is indexed and the last learning\n tryharness local on|off search over your Desktop, Documents and Downloads by what is in the files (on by default)\n tryharness local add|remove <folder> another folder to search the same way\n tryharness watch [add <name> --run <command> [--every 5m] [--field f | --age f | --count text] [--above n] [--below n] | start <id> | remove <id>]\n watches the relay checks and says out loud only when they are off\n tryharness sync [--agent] rescan local coding history in the background\n tryharness task <id> --follow\n follow a delegated agent run in this terminal\n tryharness runs what your agents are running on this computer now\n tryharness steer <thread or run> "<words>" [--agent <agent>]\n tell an agent something while it works\n tryharness ssh [<cloud computer>] [--key <file>] [--print] [-- <command>]\n SSH into your cloud computer with your own key; it wakes if asleep\n tryharness board [--all] list open work on the machine's task board\n tryharness board post --for <agent> --objective <text> [--file <brief.md>]\n tryharness board show <id>\n tryharness board post --for codex --objective <text> --run --workspace <dir>\n the daemon runs it and reports back on the task\n tryharness board run <id> authorize a run an agent asked for\n tryharness board release <id>\n tryharness board agents when each agent last read the board\n tryharness board --watch follow the board in this terminal\n tryharness notify on|off desktop notifications for what waits on you\n tryharness usage-totals on|off daily counts of your swarm's work, without your account or any text (on by default)\n tryharness board send <task> <message> send a held reply to another person's agent\n tryharness board snippet [<id> share|keep] code an agent elsewhere asked to see; nothing leaves until you share it\n tryharness board auto <task> on|off auto-send replies on that thread\n tryharness board end <task> --outcome <text>\n tryharness board context <task> <query> search everything written about a task\n tryharness goal set --objective <text> [--team a,b] [--workspace <dir>] a goal your agents work together in one room\n tryharness goal [list | show <id> | stop <id> | resume <id>]\n tryharness room <goal> | room post <goal> <text> [--ask agent,agent]\n tryharness swarm rounds [<thread>] what the coordinator saw, chose and cost each round\n tryharness swarm health [<thread>] who decided each day's rounds: Harness, a backup, or no one\n tryharness swarm ceiling <thread> <dollars|off> what a thread may spend of your Harness credits\n tryharness swarm checkin <thread> "<what>" (--in 2h | --at 14:30 | --every 30m | --daily 09:00 [--days mon-fri]) [--wake codex] [--times n] [--until <date>]\n the thread comes back on its own then, waking those agents or its lead\n tryharness swarm checkins [<thread>] [--all] | swarm checkin remove <id>\n tryharness swarm coordinator [harness|local] who coordinates your threads\n tryharness connect <handle/agent> --about <text> ask another person's agent to work an issue with yours, sealed to their computer\n tryharness peers the keys of other people's computers this one has worked with, to compare\n tryharness machines your computers: which holds the board (home) and which work through it; machines add <code> [--hosted] | name <name> | home | update <name> [version] | remove <name>\n tryharness backup [on | now | restore | off] an encrypted backup of your board, for Residents; only your passphrase opens it\n tryharness agents who is in your swarm, and who can be added\n tryharness agents add [<agent>…] put agents in your swarm; with no name, pick from the ones found here\n tryharness agents remove <agent> take an agent out of your swarm\n tryharness agents confirm <agent> the program Harness starts for an agent, after you install it somewhere new\n tryharness agents setup [<agent>] | agents test <agent> how Harness wakes each agent\n tryharness agents cards what each of your agents is told about the others\n tryharness agents note <agent> <text> [--clear] your own note on an agent's card, told to every other agent\n tryharness lessons [--replaced | --retired] | lessons remove <id> | lessons edit <id> "<text>"\n what your swarm learned from your words, to read, change or take out\n tryharness memory [dream | forget <id> | delete <post id> | back <id>]\n what your swarm keeps from its work, overnight; forget, delete or bring back\n tryharness agents models [<agent>] [--refresh] the models each coding agent lists and the one it runs on\n tryharness agents model <agent> <model> [--effort <level>] | auto | default the model it runs on; auto lets Harness pick per run\n tryharness agents routing "<text>" [--clear] how Auto picks models for your swarm\n tryharness connections on|off outside apps (Gmail, Calendar, Slack, Notion, Linear) for your agents; off by default\n tryharness connections connect apps, choose agent access and review approvals (connections catalog for providers)\n tryharness vault your secrets, kept on this computer: agents use them without seeing them (vault add <name> --hosts <host> | allow <agent> <name> | runs <agent> <name> <VARIABLE> | backup <email> | share <name>)\n tryharness mcp grok-bot print the MCP snippet that puts Grok Bot on the board\n tryharness link connect the browser you use Harness in to this computer, end to end (--print shows the link)\n tryharness phone pair show a QR code that pairs your phone with this computer\n tryharness phone list | revoke <id>\n tryharness t3 approve Harness in T3 Code once, so your messages go into its threads (t3 status | t3 forget)\n tryharness logs [--follow]\n tryharness uninstall [--everything] take Harness off this computer; --everything also deletes your board and history\n`
2668
2686
  );
2669
2687
  }
2670
2688
 
@@ -3,7 +3,7 @@ import os from "node:os";
3
3
  import path from "node:path";
4
4
  import { spawn, spawnSync } from "node:child_process";
5
5
  import { randomBytes } from "node:crypto";
6
- import { secretReason } from "./secrets.mjs";
6
+ import { maskReason } from "./secrets.mjs";
7
7
 
8
8
  const { cloud: CLOUD_LIST } = JSON.parse(
9
9
  fs.readFileSync(new URL("./members.json", import.meta.url), "utf8")
@@ -148,7 +148,7 @@ const clean = (text) =>
148
148
  .map((line) => line.trimEnd())
149
149
  .filter(Boolean)
150
150
  .map((line) =>
151
- secretReason(line)
151
+ maskReason(line)
152
152
  ? "(something secret was printed here; it stays on this computer)"
153
153
  : line
154
154
  );
package/lib/asks.mjs CHANGED
@@ -111,6 +111,8 @@ export function createAsks({
111
111
  agent: ask.agent,
112
112
  objective: objectiveOf(thread, ask),
113
113
  result: `Could not be asked: ${reason}`.slice(0, 4_000),
114
+ // When, so a round reads the failure as the agent's answer to the job posted for it (coordinator.mjs).
115
+ at: new Date().toISOString(),
114
116
  },
115
117
  ].slice(-5)
116
118
  )
@@ -1,6 +1,12 @@
1
1
  import { LOCAL_DECIDERS, askLocalAgent } from "./localAgentAsk.mjs";
2
2
  import { roundFields } from "./cards.mjs";
3
- import { MACHINE_RUNNERS, MEMBERS, TAGGED_ONLY, nameOf } from "./members.mjs";
3
+ import {
4
+ CLOUD_HOMED,
5
+ MACHINE_RUNNERS,
6
+ MEMBERS,
7
+ TAGGED_ONLY,
8
+ nameOf,
9
+ } from "./members.mjs";
4
10
  import { LEAD_TIMES } from "./schedules.mjs";
5
11
  import { SPECIALTIES, pinnedFor, specialtyName } from "./specialties.mjs";
6
12
  import { TEAM } from "./team.mjs";
@@ -170,6 +176,33 @@ export function createCoordinator({
170
176
  // not, and reads first what Harness's server decided.
171
177
  pick = () => null,
172
178
  }) {
179
+ // Agents on Harness's server (Bankr, Quotient, Muse) keep their tasks there, not on this board (asks.mjs), so whether
180
+ // one is at work in a thread is read from the thread itself: a job posted for it that it has not answered since. Its
181
+ // result, its question and its failure each land as its own post (jobAnswers.mjs); an ask that never reached Harness
182
+ // is a failed ask. Read from the board alone, Bankr looked idle while it worked, and the round handed it the same
183
+ // purchase again.
184
+ const hostedAtWork = (goalId) => {
185
+ const { posts } = store.recentRoomPosts(goalId, { limit: 500 });
186
+ const answeredAt = (agent) =>
187
+ [
188
+ posts.findLast((post) => post.author === agent)?.created_at,
189
+ ...failedAsks(goalId)
190
+ .filter((failure) => failure.agent === agent)
191
+ .map((failure) => failure.at),
192
+ ].reduce((newest, at) => (at && at > newest ? at : newest), "");
193
+ return CLOUD_HOMED.filter((agent) => {
194
+ const job = posts.findLast(
195
+ (post) => post.kind === "job" && post.mentions.includes(agent)
196
+ );
197
+ return Boolean(job) && job.created_at > answeredAt(agent);
198
+ });
199
+ };
200
+ // Whether the agent already holds work in the thread, here or on Harness's server.
201
+ const holdsWork = (goalId, agent) =>
202
+ store
203
+ .threadRuns(goalId)
204
+ .some((run) => run.target_agent === agent && going(run)) ||
205
+ hostedAtWork(goalId).includes(agent);
173
206
  const failedHereLately = (threadId, agent) => {
174
207
  const at = Date.parse(store.meta(`job-failed:${threadId}:${agent}`) || "");
175
208
  return Date.now() - at < FAILED_REST_MS;
@@ -273,7 +306,11 @@ export function createCoordinator({
273
306
  objective: run.objective,
274
307
  result: String(run.result || ""),
275
308
  })),
276
- ...failedAsks(thread.id),
309
+ ...failedAsks(thread.id).map(({ agent, objective, result }) => ({
310
+ agent,
311
+ objective,
312
+ result,
313
+ })),
277
314
  ]
278
315
  .slice(-5)
279
316
  .map((job) => ({
@@ -364,9 +401,11 @@ export function createCoordinator({
364
401
  );
365
402
  // The route: where it stands, or none yet, which the person's message to the swarm triages (on the privacy setting,
366
403
  // this computer's next round). A round that starts the next piece a framer split off routes it with the same facts.
367
- const teamView = keepsTeams()
368
- ? team.roundView(thread.id, runs, { head: headOf(thread.id) })
369
- : null;
404
+ const repairRoute = keepsTeams() && team.needsRouting(thread.id);
405
+ const teamView =
406
+ keepsTeams() && !repairRoute
407
+ ? team.roundView(thread.id, runs, { head: headOf(thread.id) })
408
+ : null;
370
409
  if (teamView && !keepsPlacement())
371
410
  teamView.steps = teamView.steps.map(({ machines, ...step }) => step);
372
411
  const pins = keepsTeams() ? pinsNow() : {};
@@ -376,7 +415,7 @@ export function createCoordinator({
376
415
  };
377
416
  const teamFacts = teamView
378
417
  ? { team: teamView, ...(teamView.nextPiece ? routing : {}) }
379
- : keepsTeams() && (asked || mode() === "local")
418
+ : keepsTeams() && (asked || mode() === "local" || repairRoute)
380
419
  ? { team: null, ...routing }
381
420
  : {};
382
421
  // Earlier words close in meaning to the newest post that the transcript no longer carries, from this thread and the
@@ -434,7 +473,8 @@ export function createCoordinator({
434
473
  progress: {
435
474
  runsFinished,
436
475
  newResults,
437
- stillRunning: runs.filter(going).length,
476
+ stillRunning:
477
+ runs.filter(going).length + hostedAtWork(thread.id).length,
438
478
  roundsWithoutProgress: state.withoutProgress,
439
479
  failedJobs,
440
480
  // A Harness that does not know the field would refuse the round: it goes only to one that takes Harness's tasks.
@@ -686,7 +726,7 @@ export function createCoordinator({
686
726
  const message = asked?.seq
687
727
  ? store.roomPosts(thread.id, asked.seq - 1, 1)[0]
688
728
  : null;
689
- return message?.seq === asked?.seq ? message.created_at : null;
729
+ return message && message.seq === asked?.seq ? message.created_at : null;
690
730
  };
691
731
  const applyTeamPlan = (thread, decision, coordinator, asked = null) => {
692
732
  const proposed = decision.team?.plan;
@@ -694,7 +734,7 @@ export function createCoordinator({
694
734
  !proposed ||
695
735
  decision.team?.step === "piece" ||
696
736
  !keepsTeams() ||
697
- team.plan(thread.id)
737
+ (team.plan(thread.id) && !team.needsRouting(thread.id))
698
738
  )
699
739
  return null;
700
740
  // The route answers the person's message: its first step began when they sent it (team.mjs set).
@@ -854,7 +894,7 @@ export function createCoordinator({
854
894
  given.team?.plan &&
855
895
  given.team.step !== "piece" &&
856
896
  keepsTeams() &&
857
- !team.plan(thread.id)
897
+ (!team.plan(thread.id) || team.needsRouting(thread.id))
858
898
  ) {
859
899
  pauseGoal(
860
900
  thread.id,
@@ -864,6 +904,19 @@ export function createCoordinator({
864
904
  return;
865
905
  }
866
906
  const decision = guardQuestion(thread, given, candidates, rules);
907
+ if (
908
+ keepsTeams() &&
909
+ team.needsRouting(thread.id) &&
910
+ ["hand_on", "assemble"].includes(decision.action) &&
911
+ decision.team?.step !== "piece"
912
+ ) {
913
+ pauseGoal(
914
+ thread.id,
915
+ "The saved route needs an executable replacement before another agent can start."
916
+ );
917
+ notifyBoard(store.getTask(thread.id));
918
+ return;
919
+ }
867
920
  // The person's message is never met with silence: a round that brings no one in and asks them nothing lets the
868
921
  // agents hear it as they wrote it, as with `@swarm`. That is the fallback whenever Jev does not understand the
869
922
  // message. A message naming an agent is not silent: that agent has it.
@@ -1006,6 +1059,14 @@ export function createCoordinator({
1006
1059
  const agent = review
1007
1060
  ? independentReviewer(thread, decision.agent, candidates, coordinator)
1008
1061
  : decision.agent;
1062
+ // Work that became the agent's while the round was decided (a reading of the server's words takes seconds) is
1063
+ // not handed to it again: Bankr was handed the same purchase twice, and a round begun on a new thread's title
1064
+ // posted "@claude-code (review, no changes)" after the person's own ask had started Claude Code, whose turn did
1065
+ // the review instead (live, October 31). The person's new message is new work, and still reaches it.
1066
+ if (!asked && holdsWork(thread.id, agent)) {
1067
+ notifyBoard(store.getTask(thread.id));
1068
+ return;
1069
+ }
1009
1070
  if (!thread.goal.team.includes(agent))
1010
1071
  store.setGoalTeam(thread.id, [...thread.goal.team, agent]);
1011
1072
  const text = String(decision.text).slice(0, 4_000);
@@ -1123,7 +1184,9 @@ export function createCoordinator({
1123
1184
  // A turn T3 Code is running for one of the thread's agents counts as work going on, though Harness did not start it
1124
1185
  // (the coordinator once told Claude Code to "continue" three times while it worked in T3).
1125
1186
  const active =
1126
- store.threadRuns(goalId).some(going) || busyInT3(thread).length > 0;
1187
+ store.threadRuns(goalId).some(going) ||
1188
+ hostedAtWork(goalId).length > 0 ||
1189
+ busyInT3(thread).length > 0;
1127
1190
  // A thread started through Harness by an agent that runs elsewhere gets no rounds until the person sets a spend ceiling.
1128
1191
  if (store.meta(`hosted-thread:${goalId}`)) return;
1129
1192
  const local = mode() === "local";
@@ -1147,9 +1210,11 @@ export function createCoordinator({
1147
1210
  const assembling = Boolean(asked) && assembles();
1148
1211
  const resumedNow = store.meta(`coordinator-resumed:${goalId}`) === "1";
1149
1212
  const inventoryWaiting = Boolean(store.meta(`inventory-wait:${goalId}`));
1213
+ const repairRoute = keepsTeams() && team.needsRouting(goalId);
1150
1214
  if (
1151
1215
  !assembling &&
1152
- (active || (!posts.length && !resumedNow && !inventoryWaiting))
1216
+ (active ||
1217
+ (!posts.length && !resumedNow && !inventoryWaiting && !repairRoute))
1153
1218
  ) {
1154
1219
  if (posts.length) await keepGoalNow(thread, state);
1155
1220
  return;
package/lib/daemon.mjs CHANGED
@@ -125,6 +125,7 @@ import { createProxyLinks } from "./proxyLinks.mjs";
125
125
  import { createCloudSsh } from "./cloudSsh.mjs";
126
126
  import { loadMachine, saveMachine } from "./machineIdentity.mjs";
127
127
  import { createOwnMachines, FROM_MACHINE } from "./ownMachines.mjs";
128
+ import { startUpdate } from "./selfUpdate.mjs";
128
129
  import { createBoardBackup } from "./boardBackup.mjs";
129
130
  import { createMachineRuns } from "./machineRuns.mjs";
130
131
  import { createPlans } from "./plans.mjs";
@@ -885,11 +886,10 @@ export async function startDaemon() {
885
886
  for (const id of store.backfillContributions())
886
887
  log(`context: backfilled task ${id}`);
887
888
 
888
- // Standing permission, decided when a task is posted: a run the person asked for (themselves or through Harness),
889
- // for a coding agent installed here, in a folder the permission covers, under today's cap, starts without a Start.
890
- // By default it covers the folders the person has already used that agent in; home and anything above it count only
891
- // as themselves, never as a root. Anything another agent wrote never starts. Links are followed, so no path inside a
892
- // covered folder leads out of it.
889
+ // Standing permission, decided when a task is posted: a run the person asked for (themselves, through Harness or
890
+ // through any of their own agents), for a coding agent installed here, in a folder the permission covers, starts
891
+ // without a Start. By default it covers any folder below home, with no daily limit; the person may name folders and a
892
+ // limit instead (runAuthority.mjs covers). Links are followed, so no path inside a covered folder leads out of it.
893
893
  const authority = createRunAuthority({ store, installedAgents });
894
894
  const { RUNNERS } = authority;
895
895
  const threadAuthority = createThreadAuthority({
@@ -1481,7 +1481,6 @@ export async function startDaemon() {
1481
1481
  replaceHeld,
1482
1482
  sendThreadMessage: sealed.sendMessage,
1483
1483
  setupNote,
1484
- slotOf: (...args) => slotOf(...args),
1485
1484
  state,
1486
1485
  store,
1487
1486
  swarmCommand: (...args) => swarmCommand(...args),
@@ -2342,7 +2341,7 @@ export async function startDaemon() {
2342
2341
  });
2343
2342
  // A session's agent hears its work again after its context is compacted (compaction.mjs, the session hook).
2344
2343
  const compaction = createCompaction({ store, goals });
2345
- const { activeRuns, slotOf, whyWaiting, runBoard } = worker;
2344
+ const { activeRuns, whyWaiting, runBoard } = worker;
2346
2345
 
2347
2346
  // The agents the person picked for this cloud computer, installed here and joined to the swarm (cloudAgents.mjs).
2348
2347
  const cloudSave = config.cloud
@@ -2626,6 +2625,8 @@ export async function startDaemon() {
2626
2625
  ? (from, call) => proxyLinks.answer(from, call)
2627
2626
  : null,
2628
2627
  ownSsh: cloudSsh?.allow ?? null,
2628
+ ownUpdate: (spec) => startUpdate(spec, { from: DAEMON_VERSION, log }),
2629
+ runningVersion: DAEMON_VERSION,
2629
2630
  onNotice: (notice) => {
2630
2631
  // Home stopped a run on this computer (the person stopped or removed its task).
2631
2632
  if (typeof notice?.stop === "string") stopAgentTask(notice.stop);
@@ -2653,7 +2654,6 @@ export async function startDaemon() {
2653
2654
  callHome: (request) => ownMachines.callHome(request),
2654
2655
  taskRuns,
2655
2656
  agents: installedAgents,
2656
- // Only in a folder this computer's own agents' sessions or T3 Code worked in, never just one home names.
2657
2657
  knownFolders: () => folders.known({ own: true }).map((place) => place.path),
2658
2658
  // A folder-less thread's files, as this computer's copy of the board lists them (boardMirror.mjs).
2659
2659
  threadFileIds: (threadId) => {
@@ -2896,6 +2896,12 @@ export async function startDaemon() {
2896
2896
  ? ownMachines.remove(request.computer)
2897
2897
  : { ok: false, error: "only the person removes a computer" }
2898
2898
  ),
2899
+ // tryharness machines update: one of the person's computers fetches a newer signed release and sets it up.
2900
+ "machines.update": onMachines((request) =>
2901
+ request.agent === "user"
2902
+ ? ownMachines.update(request)
2903
+ : { ok: false, error: "only the person updates a computer" }
2904
+ ),
2899
2905
  "machines.models": onMachines((request) =>
2900
2906
  ownMachines.models({ refresh: request.refresh === true })
2901
2907
  ),
package/lib/firewall.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import { secretReason } from "./secrets.mjs";
1
+ import { maskReason } from "./secrets.mjs";
2
2
  import { personalSpans } from "./personal.mjs";
3
3
 
4
4
  // The handoff firewall: two small local models on the text agents pass each other. Inbound, an injection guard reads
@@ -149,8 +149,7 @@ export function createFirewall({ inference, log = () => {} }) {
149
149
  });
150
150
  const candidates = lines.filter(
151
151
  ({ line }) =>
152
- line.length <= 2_000 &&
153
- (CANDIDATE_LINE.test(line) || secretReason(line))
152
+ line.length <= 2_000 && (CANDIDATE_LINE.test(line) || maskReason(line))
154
153
  );
155
154
  let probabilities = [];
156
155
  if (candidates.length) {
@@ -173,14 +172,14 @@ export function createFirewall({ inference, log = () => {} }) {
173
172
  }
174
173
  }
175
174
  candidates.forEach(({ line, start }, i) => {
176
- const flagged = (probabilities[i] ?? 0) >= 0.74 || secretReason(line);
175
+ const flagged = (probabilities[i] ?? 0) >= 0.74 || maskReason(line);
177
176
  if (!flagged) return;
178
177
  const span = secretSpan(line);
179
178
  if (span)
180
179
  spans.push({
181
180
  start: start + span.at,
182
181
  end: start + span.at + span.text.length,
183
- reason: secretReason(line) || "a credential",
182
+ reason: maskReason(line) || "a credential",
184
183
  });
185
184
  });
186
185
  return spans.sort((a, b) => a.start - b.start);
@@ -34,7 +34,6 @@ export function createGoalCommands({
34
34
  replaceHeld,
35
35
  sendThreadMessage,
36
36
  setupNote,
37
- slotOf,
38
37
  state,
39
38
  store,
40
39
  swarmCommand,
@@ -177,8 +176,8 @@ export function createGoalCommands({
177
176
  if (!inRoom(goal, agent) || agent === "user")
178
177
  return { ok: false, error: `${agent} is not on this goal's team` };
179
178
  if (!teams) return { ok: false, error: "the daemon is still starting" };
180
- // A note goes to every agent of the swarm, so it is checked like a post: never a secret, never orders to the
181
- // swarm (notes are the swarm's shared memory).
179
+ // A note goes to every agent of the swarm, so it is checked like a post: never a secret, and words the guard flags
180
+ // stay out of the swarm's shared memory.
182
181
  const said = `${request.text ?? ""}\n${request.reason ?? ""}`;
183
182
  const flag = secretReason(said);
184
183
  if (flag)
@@ -187,12 +186,6 @@ export function createGoalCommands({
187
186
  error: `not saved: it looks like ${flag}, and a note is shared with every agent`,
188
187
  };
189
188
  const save = (verdict) => {
190
- if (verdict?.verdict === "hold")
191
- return {
192
- ok: false,
193
- error:
194
- "not saved: it reads like instructions aimed at the person's agents",
195
- };
196
189
  const kept = teams.learn(goal.id, agent, {
197
190
  text: request.text,
198
191
  reason: request.reason,
@@ -200,8 +193,9 @@ export function createGoalCommands({
200
193
  });
201
194
  if (!kept.ok) return kept;
202
195
  learned(goal.id, agent, `${request.text} (${request.reason})`);
203
- // Pushed to the swarm's memory unless the guard flagged it: a flagged note stays with its role in this folder.
204
- if (verdict?.verdict !== "flag")
196
+ // Pushed to the swarm's memory unless the guard flagged it or read it as orders: such a note stays with its role
197
+ // in this folder.
198
+ if (verdict?.verdict !== "flag" && verdict?.verdict !== "hold")
205
199
  remembered(goal, agent, {
206
200
  ...kept.note,
207
201
  replaces: request.replaces ? String(request.replaces) : null,
@@ -262,29 +256,13 @@ export function createGoalCommands({
262
256
  note: HELD_NOTE(flag),
263
257
  };
264
258
  }
265
- // An agent's post is read by the injection guard first (firewall.mjs): one that reads as orders to the swarm is held
266
- // for the person like a secret; one that may carry instructions is posted with a flag every reader of the room sees.
259
+ // An agent's post is read by the injection guard first (firewall.mjs) and posted with a flag every reader of the
260
+ // room sees when it may carry instructions. It is never held for the person: the guard cannot tell agents
261
+ // coordinating from planted orders, and on the person's board it held ordinary posts. Words it reads as orders
262
+ // start no one on them (threadAuthority.mjs, threadActions.mjs).
267
263
  const guarded =
268
264
  agent !== "user" && agent !== "harness" && localReady(["guard"]);
269
265
  const publish = (verdict) => {
270
- if (verdict?.verdict === "hold") {
271
- const held = store.roomPost({
272
- goalId: goal.id,
273
- author: agent,
274
- machine,
275
- kind: "held",
276
- text,
277
- });
278
- notifyDesktop(
279
- `A post by ${nameOf(agent)} in a thread was held: it reads like instructions aimed at your agents.`
280
- );
281
- return {
282
- ok: true,
283
- post: { ...held, kind: "held" },
284
- held: "instructions aimed at the person's agents",
285
- note: HELD_NOTE("instructions aimed at the person's agents"),
286
- };
287
- }
288
266
  // Anyone in the thread can bring in any of the person's agents. The person and Harness do it by naming them. An
289
267
  // agent does it by asking (`ask`), and its answer wakes whoever is waiting on it; any other name in an agent's
290
268
  // words is a reference, like a thanks, and wakes no one.
@@ -343,7 +321,7 @@ export function createGoalCommands({
343
321
  });
344
322
  replaceHeld(goal.id, agent, post);
345
323
  if (agent === "user") heardPerson(goal, post);
346
- if (verdict?.verdict === "flag")
324
+ if (verdict?.verdict === "flag" || verdict?.verdict === "hold")
347
325
  store.meta(`flagged:${post.id}`, String(verdict.score));
348
326
  // Shared with guests: the post goes out on each guest's thread, held for the owner unless that thread auto-sends.
349
327
  if (request.shareWithGuests === true)
@@ -392,9 +370,10 @@ export function createGoalCommands({
392
370
  const wake = store
393
371
  .threadRuns(goal.id)
394
372
  .find((run) => run.target_agent === name && run.status === "open");
373
+ // The asker's own turn in the wake's folder holds a hand-off it asked for (runWorker.mjs askerHolds).
395
374
  const holder =
396
- wake &&
397
- getActiveRuns().get(slotOf({ ...wake, parent_id: goal.id }));
375
+ wake?.run_workspace &&
376
+ getActiveRuns().get(`${path.resolve(wake.run_workspace)}:${agent}`);
398
377
  return holder?.agent === agent
399
378
  ? `${nameOf(name)} starts when your turn ends: you work in the same folder, one at a time. End your turn now; you are woken when ${nameOf(name)} answers you.`
400
379
  : null;
@@ -425,7 +404,7 @@ export function createGoalCommands({
425
404
  localEvent(
426
405
  "guard",
427
406
  verdict?.verdict === "hold"
428
- ? `held a post by ${nameOf(agent)} that read like orders`
407
+ ? `flagged a post by ${nameOf(agent)} that read like orders`
429
408
  : verdict?.verdict === "flag"
430
409
  ? `flagged a post by ${nameOf(agent)}`
431
410
  : `checked a post by ${nameOf(agent)}`,
package/lib/live.mjs CHANGED
@@ -38,6 +38,8 @@ const TABLE_STALE_MS = 30_000;
38
38
 
39
39
  function* processSteps() {
40
40
  const table = new Map();
41
+ // When it was read: a session recorded after it may name a process it does not hold yet (liveSessions).
42
+ table.readAt = Date.now();
41
43
  const ps = yield [PS, ["-axo", "pid=,ppid=,tty=,comm="]];
42
44
  for (const line of (ps || "").split("\n")) {
43
45
  const match = line.trim().match(/^(\d+)\s+(\d+)\s+(\S+)\s+(.+)$/);
@@ -194,7 +196,7 @@ export function sessionOfProcess(agent, pid, recent = []) {
194
196
  export function liveSessions({
195
197
  exclude = new Set(),
196
198
  recent = [],
197
- table = processTable(),
199
+ table: given = null,
198
200
  reported = [],
199
201
  } = {}) {
200
202
  const sessions = [];
@@ -203,8 +205,28 @@ export function liveSessions({
203
205
  try {
204
206
  files = fs.readdirSync(records).filter((name) => name.endsWith(".json"));
205
207
  } catch {}
206
- for (const name of files) {
207
- const record = readJson(path.join(records, name), null);
208
+ const recorded = files.map((name) => {
209
+ const file = path.join(records, name);
210
+ let changedAt = 0;
211
+ try {
212
+ changedAt = fs.statSync(file).mtimeMs;
213
+ } catch {}
214
+ return { record: readJson(file, null), changedAt };
215
+ });
216
+ // A session recorded after the kept reading names a process that reading may not hold yet: the table is read now
217
+ // for it. Read only from the kept one, a session that had just started was left out of the one answer a phone asked
218
+ // for, and nothing asked again (it read Claude Code as idle while T3 Code waited on it).
219
+ let table = given ?? processTable();
220
+ const started = recorded
221
+ .filter(
222
+ ({ record, changedAt }) =>
223
+ record?.pid &&
224
+ !table.has(record.pid) &&
225
+ changedAt >= (table.readAt ?? 0)
226
+ )
227
+ .map(({ record }) => record.pid);
228
+ if (started.length) table = processTable({ having: started });
229
+ for (const { record } of recorded) {
208
230
  if (
209
231
  !record?.pid ||
210
232
  !table.has(record.pid) ||