trantor 0.18.144 → 0.18.146
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/.claude-plugin/marketplace.json +2 -2
- package/.claude-plugin/plugin.json +1 -1
- package/bin/canary.mjs +55 -15
- package/bin/capacity.mjs +3 -1
- package/bin/crew-runner.mjs +76 -16
- package/bin/disk.mjs +8 -5
- package/bin/wake-nudge.mjs +27 -3
- package/configs/dispatcher-policy.json +84 -0
- package/docs/FEATURES.md +25 -12
- package/hub/routes/capacity.mjs +1 -1
- package/hub/routes/cards.mjs +7 -2
- package/hub/routes/insights.mjs +1 -0
- package/kimi.plugin.json +1 -1
- package/lib/canary/canary.mjs +66 -7
- package/lib/canary/registry.mjs +153 -4
- package/lib/capacity.mjs +21 -4
- package/lib/classify-failure.mjs +14 -8
- package/lib/dispatcher/policy.mjs +41 -0
- package/lib/dispatcher/schemas.mjs +218 -0
- package/lib/dispatcher/snapshot.mjs +70 -0
- package/lib/dispatcher/store.mjs +111 -0
- package/lib/launchd.mjs +61 -0
- package/lib/seat-liveness.mjs +41 -0
- package/lib/session-liveness.mjs +23 -0
- package/lib/turn-usage.mjs +88 -17
- package/package.json +1 -1
|
@@ -6,14 +6,14 @@
|
|
|
6
6
|
},
|
|
7
7
|
"metadata": {
|
|
8
8
|
"description": "Trantor — the hub-world for AI agent crews: live message bus, presence, project Kanban/flow board + context-handoff for independent AI coding agents (Claude, Codex, Gemini, …)",
|
|
9
|
-
"version": "0.18.
|
|
9
|
+
"version": "0.18.146"
|
|
10
10
|
},
|
|
11
11
|
"plugins": [
|
|
12
12
|
{
|
|
13
13
|
"name": "trantor",
|
|
14
14
|
"source": "./",
|
|
15
15
|
"description": "The hub-world for AI agent crews. Say \"fire up the crew\" and Claude becomes the architect: a plan-aware Advisor routes the work (solo / cheap inline calls / live crew of Codex, GLM, Kimi & DeepSeek in their own terminal windows), a Kanban/flow command center with a testing gate tracks it, and an economics brain (Scrooge) keeps the receipts. Includes the relay MCP, a SessionStart auto-discovery hook, and a PreCompact context-handoff so a fresh session can take over a full window instead of compacting.",
|
|
16
|
-
"version": "0.18.
|
|
16
|
+
"version": "0.18.146",
|
|
17
17
|
"author": {
|
|
18
18
|
"name": "Sasha Bogojevic"
|
|
19
19
|
},
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "trantor",
|
|
3
|
-
"version": "0.18.
|
|
3
|
+
"version": "0.18.146",
|
|
4
4
|
"description": "Trantor — the hub-world for AI agent crews: live message bus, presence, project Kanban/flow board + crew orchestration for independent AI coding agents (Claude, Codex, Gemini, Kimi, DeepSeek)",
|
|
5
5
|
"mcpServers": {
|
|
6
6
|
"relay": {
|
package/bin/canary.mjs
CHANGED
|
@@ -1,19 +1,20 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
// trantor canary — run every docs/FEATURES.md probe (#14655).
|
|
3
|
-
// trantor canary [--json]
|
|
4
|
-
// trantor canary
|
|
5
|
-
// trantor canary install | uninstall | plist
|
|
3
|
+
// trantor canary [--json] [--daily] probes only; --daily also records the run and posts new failures
|
|
4
|
+
// trantor canary install | uninstall | plist | check | attach <path…> | brief (#14670: docs/FEATURES.md)
|
|
6
5
|
import { mkdirSync, writeFileSync, rmSync, existsSync } from "node:fs";
|
|
7
6
|
import { join } from "node:path";
|
|
8
7
|
import { homedir } from "node:os";
|
|
9
8
|
import { execFileSync } from "node:child_process";
|
|
10
9
|
import { fileURLToPath } from "node:url";
|
|
11
10
|
import { busDir, resolveHub, knownProjects, checkoutFor, readConfig } from "../lib/project.mjs";
|
|
12
|
-
import { loadRegistry } from "../lib/canary/registry.mjs";
|
|
11
|
+
import { loadRegistry, validateRegistry, registryHash, attachProbes } from "../lib/canary/registry.mjs";
|
|
12
|
+
import { PROBES } from "../lib/canary/probes.mjs";
|
|
13
13
|
import {
|
|
14
|
-
runCanary, tally, advanceEpisodes, episodeMessage, readEpisodes, recordRun,
|
|
15
|
-
defaultContext, canaryPlist, CANARY_LABEL,
|
|
14
|
+
runCanary, tally, advanceEpisodes, markDelivered, episodeMessage, readEpisodes, readLastRun, recordRun,
|
|
15
|
+
regressionBrief, defaultContext, canaryPlist, CANARY_LABEL,
|
|
16
16
|
} from "../lib/canary/canary.mjs";
|
|
17
|
+
import { reloadLaunchAgent } from "../lib/launchd.mjs";
|
|
17
18
|
|
|
18
19
|
const SELF = fileURLToPath(import.meta.url);
|
|
19
20
|
const PROJECT = "trantor";
|
|
@@ -35,8 +36,9 @@ if (cmd === "install") {
|
|
|
35
36
|
mkdirSync(join(busDir(), "logs"), { recursive: true });
|
|
36
37
|
mkdirSync(join(homedir(), "Library", "LaunchAgents"), { recursive: true });
|
|
37
38
|
writeFileSync(PLIST_PATH, canaryPlist({ script: SELF, busDir: busDir() }), { mode: 0o644 });
|
|
38
|
-
|
|
39
|
-
|
|
39
|
+
// #14661: reload through bootout-wait-bootstrap; a failed bootstrap is an error, not a stack.
|
|
40
|
+
const reloaded = reloadLaunchAgent({ label: CANARY_LABEL, plist: PLIST_PATH, domain: `gui/${process.getuid()}` });
|
|
41
|
+
if (!reloaded.ok) { console.error(reloaded.error); process.exit(1); }
|
|
40
42
|
console.log(`installed: ${PLIST_PATH}\nruns every day at 09:30; failures post to the ${PROJECT} lane and the app once per episode`);
|
|
41
43
|
process.exit(0);
|
|
42
44
|
}
|
|
@@ -48,8 +50,41 @@ if (cmd === "uninstall") {
|
|
|
48
50
|
process.exit(0);
|
|
49
51
|
}
|
|
50
52
|
|
|
53
|
+
const rows = loadRegistry(process.env.TRANTOR_FEATURES_PATH || undefined);
|
|
54
|
+
const valid = validateRegistry(rows, PROBES);
|
|
55
|
+
|
|
56
|
+
if (cmd === "check") {
|
|
57
|
+
const hash = registryHash(rows);
|
|
58
|
+
if (JSON_MODE) console.log(JSON.stringify({ ...valid, registryHash: hash, rows: rows.length, mapped: rows.filter((r) => r.mapped).length }, null, 2));
|
|
59
|
+
else {
|
|
60
|
+
for (const e of valid.errors) console.log(` ✗ ${e}`);
|
|
61
|
+
console.log(`${rows.length} features, ${rows.filter((r) => r.mapped).length} mapped, registry ${hash.slice(0, 12)}${valid.ok ? ", mappings valid" : `, ${valid.errors.length} malformed`}`);
|
|
62
|
+
}
|
|
63
|
+
process.exit(valid.ok ? 0 : 1);
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
if (cmd === "attach") {
|
|
67
|
+
const at = args.indexOf("--features");
|
|
68
|
+
const featureArg = at >= 0 ? args[at + 1] || "" : "";
|
|
69
|
+
const claims = args.slice(1).filter((a, i, all) => !a.startsWith("--") && all[i - 1] !== "--features");
|
|
70
|
+
const out = attachProbes({ rows, claims, declaredFeatures: featureArg.split(",").map((s) => s.trim()).filter(Boolean) });
|
|
71
|
+
if (JSON_MODE) console.log(JSON.stringify(out, null, 2));
|
|
72
|
+
else {
|
|
73
|
+
console.log(out.probeIds.length ? `required probes: ${out.probeIds.map((p) => `${p} (${out.hosts[p]})`).join(", ")}` : "required probes: none");
|
|
74
|
+
console.log(`features: ${out.features.join(", ") || "none"} registry ${out.registryHash.slice(0, 12)}`);
|
|
75
|
+
for (const p of out.problems) console.log(` ✗ ${p}`);
|
|
76
|
+
}
|
|
77
|
+
process.exit(out.ok && valid.ok ? 0 : 1);
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
if (cmd === "brief") {
|
|
81
|
+
const lines = regressionBrief({ episodes: readEpisodes(busDir()), lastRun: readLastRun(busDir()) });
|
|
82
|
+
console.log(lines.length ? lines.join("\n") : "no open regressions");
|
|
83
|
+
process.exit(0);
|
|
84
|
+
}
|
|
85
|
+
|
|
51
86
|
if (cmd !== "run") {
|
|
52
|
-
console.error("usage: trantor canary [--json] [--daily] | install | uninstall | plist");
|
|
87
|
+
console.error("usage: trantor canary [--json] [--daily] | check | attach <path…> | brief | install | uninstall | plist");
|
|
53
88
|
process.exit(2);
|
|
54
89
|
}
|
|
55
90
|
|
|
@@ -76,25 +111,30 @@ async function post(text) {
|
|
|
76
111
|
}
|
|
77
112
|
|
|
78
113
|
const bus = busDir();
|
|
79
|
-
const rows = loadRegistry(process.env.TRANTOR_FEATURES_PATH || undefined);
|
|
80
114
|
const ctx = defaultContext({ busDir: bus, hub: resolveHub(PROJECT), knownProjects, checkoutFor, appRead });
|
|
81
115
|
const run = await runCanary({ rows, ctx });
|
|
116
|
+
if (!valid.ok) {
|
|
117
|
+
run.results.push({ id: "registry", probeId: "registry", host: "any", feature: "docs/FEATURES.md mappings", status: "fail", detail: valid.errors.join("; ") });
|
|
118
|
+
}
|
|
82
119
|
const t = tally(run.results);
|
|
83
120
|
|
|
84
121
|
if (DAILY) {
|
|
85
122
|
const step = advanceEpisodes(readEpisodes(bus), run);
|
|
86
123
|
const text = episodeMessage(step, run);
|
|
87
|
-
const record = { ...run, posted: [] };
|
|
124
|
+
const record = { ...run, posted: [], registryHash: registryHash(rows) };
|
|
125
|
+
const ids = step.announce.map((r) => r.id);
|
|
126
|
+
let episodes = step.episodes;
|
|
88
127
|
if (text) {
|
|
89
|
-
try { await post(text); record.posted =
|
|
128
|
+
try { await post(text); record.posted = ids; episodes = markDelivered(episodes, ids, true); }
|
|
90
129
|
catch (error) {
|
|
91
|
-
//
|
|
92
|
-
|
|
130
|
+
// #14670: the episode stays open marked undelivered, so the next run announces it again and the
|
|
131
|
+
// brief shows the alert never landed, instead of the failure going quiet.
|
|
132
|
+
episodes = markDelivered(episodes, ids, false, error.message);
|
|
93
133
|
record.postError = error.message;
|
|
94
134
|
console.error(`canary: could not post: ${error.message}`);
|
|
95
135
|
}
|
|
96
136
|
}
|
|
97
|
-
recordRun(bus, record,
|
|
137
|
+
recordRun(bus, record, episodes);
|
|
98
138
|
}
|
|
99
139
|
|
|
100
140
|
if (JSON_MODE) {
|
package/bin/capacity.mjs
CHANGED
|
@@ -103,5 +103,7 @@ for (const s of seats) {
|
|
|
103
103
|
const live = s.online ? "online" : `last seen ${fmtAge(s.ageMs)}`;
|
|
104
104
|
const last = s.lastTurn ? `last turn ${fmtAge(s.lastTurn.ageMs)} · ${s.lastTurn.outcome || "unknown"}` : "no turn in 7d";
|
|
105
105
|
const model = s.model || "cli-default";
|
|
106
|
-
|
|
106
|
+
const fault = s.fault ? ` · FAULT ${s.fault}: ${s.unconsumedWork?.count || 0} direct message(s) unconsumed for ${fmtAge(s.unconsumedWork?.ageMs)}` : "";
|
|
107
|
+
console.log(` ${s.session} ${live} · ${model} · ${last}${s.machine ? ` · ${s.machine}` : ""}${fault}`);
|
|
108
|
+
if (s.lastTurn?.stderrTail) console.log(` redacted stderr tail:\n${s.lastTurn.stderrTail.split("\n").map(line => ` ${line}`).join("\n")}`);
|
|
107
109
|
}
|
package/bin/crew-runner.mjs
CHANGED
|
@@ -17,6 +17,7 @@ import { signedHeaders } from "../lib/signed-fetch.mjs";
|
|
|
17
17
|
import { ensureEnrolled } from "../lib/enroll.mjs";
|
|
18
18
|
import { redactKeys } from "../lib/redact.mjs";
|
|
19
19
|
import { writeTurnState } from "../lib/turnstate.mjs";
|
|
20
|
+
import { NON_RUNNABLE_CARD_STATUSES, TURNLESS_AFTER_MS, stampWakeDelivery, turnlessContract } from "../lib/seat-liveness.mjs";
|
|
20
21
|
import { completeTurnRow, isTurnRow, shipTurnRows } from "../lib/telemetry-ship.mjs";
|
|
21
22
|
import { alignSeatWorktree, applyWorktreeDeclaration, ensureSeatWorktree, provisioningLines, readWorktreeDeclaration } from "../lib/seat-worktree.mjs";
|
|
22
23
|
import {
|
|
@@ -35,7 +36,7 @@ import {
|
|
|
35
36
|
CUT_CHAIN_PARK_MIN, cutChainEvidence, isBoundedPark, askDuringTurn, askedVerdict,
|
|
36
37
|
} from "../lib/turn-policy.mjs";
|
|
37
38
|
import { snapshotBeforeCut } from "./cut-snapshot.mjs";
|
|
38
|
-
import { ocTurnUsage, dshTurnUsage, usageTotal, processedInput, codexStepInput, kimiStepInput, claudeStepInput, codexTurnModel, kimiTurnModel, claudeTurnModel } from "../lib/turn-usage.mjs";
|
|
39
|
+
import { ocTurnUsage, ocSessionId, kimiTurnUsage, dshTurnUsage, usageTotal, processedInput, codexStepInput, kimiStepInput, claudeStepInput, codexTurnModel, kimiTurnModel, claudeTurnModel } from "../lib/turn-usage.mjs";
|
|
39
40
|
import { effortName, isInfraFailure, providerForModel } from "../lib/fitness.mjs";
|
|
40
41
|
import { capConfig, capDecision, capHandoffPrompt, capPointerLine, capExhaustedNote } from "../lib/context-cap.mjs";
|
|
41
42
|
import { ocCompactionContent, ocCompactionLogLine, readOpencodeUserConfig, seatMcpOverlay, seatPermissionOverlay, seatConfigContent } from "../lib/seat-compaction.mjs";
|
|
@@ -150,11 +151,7 @@ function ocSid(dir) {
|
|
|
150
151
|
// realpath of the /var/... path the runner holds — query both spellings.
|
|
151
152
|
const dirs = [dir];
|
|
152
153
|
try { const real = realpathSync(dir); if (real !== dir) dirs.push(real); } catch {}
|
|
153
|
-
|
|
154
|
-
const q = `SELECT id FROM session WHERE directory IN (${list}) ORDER BY time_updated DESC LIMIT 1;`;
|
|
155
|
-
const r = spawnSync("sqlite3", ["-readonly", OC_DB, q], { encoding: "utf8", stdio: ["ignore", "pipe", "ignore"], timeout: 5000 });
|
|
156
|
-
const id = String(r.stdout || "").trim();
|
|
157
|
-
return /^ses_[A-Za-z0-9]+$/.test(id) ? id : "";
|
|
154
|
+
return ocSessionId(OC_DB, dirs);
|
|
158
155
|
} catch { return ""; }
|
|
159
156
|
}
|
|
160
157
|
// RUNNER_SESSION override: an orchestrator seat (bin/orchestrate.mjs) runs the same CLI as a crew
|
|
@@ -190,6 +187,9 @@ const log = (s) => console.log(`\x1b[38;5;43m[runner]\x1b[0m ${redactKeys(String
|
|
|
190
187
|
const LOGDIR = join(homedir(), ".agent-bus", "logs");
|
|
191
188
|
try { mkdirSync(LOGDIR, { recursive: true }); } catch {}
|
|
192
189
|
let TURN = releaseState?.turn || 0;
|
|
190
|
+
let lastTurnStartedAt = Number(releaseState?.lastTurnStartedAt) || 0;
|
|
191
|
+
const TURNLESS_MS = Math.max(50, Number(process.env.RUNNER_TURNLESS_MS) || TURNLESS_AFTER_MS);
|
|
192
|
+
let turnlessAlertKey = releaseState?.turnlessAlertKey || "";
|
|
193
193
|
// #13923: when THIS seat instance started. A seat name is reused across instances and the board's
|
|
194
194
|
// assignee only knows the name, so the my-cards surfaces (relay_board mine, the own-card reroute)
|
|
195
195
|
// fence assignments against this stamp — cards assigned before it are a predecessor's (#12138).
|
|
@@ -366,6 +366,7 @@ let consecFails = 0;
|
|
|
366
366
|
// it every retry costs a turn for every live seat (monitoring doctrine: duration, not repetition).
|
|
367
367
|
let announced = "";
|
|
368
368
|
let lastErrText = "";
|
|
369
|
+
let lastFailureTail = "";
|
|
369
370
|
let lastPermissionReject = null;
|
|
370
371
|
// #5481: the turn exited 0 with a NULL/empty transcript — the Inception/Mercury trap. The provider
|
|
371
372
|
// burned its whole max_tokens budget on internal reasoning and returned a null completion; the
|
|
@@ -676,6 +677,10 @@ async function balanceRows() {
|
|
|
676
677
|
// The detached watchdog repeats the working payload once a minute: runTurn blocks this event loop.
|
|
677
678
|
const PRESENCE_MS = Math.max(100, Number(process.env.RUNNER_PRESENCE_MS) || 60_000);
|
|
678
679
|
async function registerStatus(status, extra = {}) {
|
|
680
|
+
if (extra.phase === "working") {
|
|
681
|
+
lastTurnStartedAt = Number(extra.phaseSince) || Date.now();
|
|
682
|
+
turnlessAlertKey = "";
|
|
683
|
+
}
|
|
679
684
|
const url = HUB + "/register";
|
|
680
685
|
const payload = { session: SESSION, project: PROJ, status, persona: PERSONA, agent: AGENT, llm: AGENT, model: MODEL, ...extra };
|
|
681
686
|
if (MACHINE_LABEL) payload.machine = MACHINE_LABEL;
|
|
@@ -928,7 +933,7 @@ async function runTurn(prompt, isFirst, trigger = "kickoff", opts = {}) {
|
|
|
928
933
|
await registerStatus(`working · ${trigger}`, { phase: "working", phaseSince: t0 });
|
|
929
934
|
// #7749: the same boundary on disk — the watchdog refreshes lastBytesAt/lastTranscriptAt while
|
|
930
935
|
// the turn runs, so a live reader sees the turn advance without waiting for its end.
|
|
931
|
-
writeTurnState(PERSONA, PROJ, { turn: TURN, phase: "working", since: t0, card: sessionCard || 0, lastBytesAt: t0, lastTranscriptAt: 0 });
|
|
936
|
+
writeTurnState(PERSONA, PROJ, { turn: TURN, phase: "working", since: t0, card: sessionCard || 0, lastBytesAt: t0, lastTranscriptAt: 0, fault: "", turnless: null, alertDelivery: "" });
|
|
932
937
|
const pf = join(homedir(), ".agent-bus", `turn-${PERSONA}-${PROJ}.txt`);
|
|
933
938
|
appendFileSync(pf, "", { flag: "w" }); // truncate
|
|
934
939
|
appendFileSync(pf, prompt);
|
|
@@ -1259,10 +1264,12 @@ exit $turn_exit`;
|
|
|
1259
1264
|
// actually carried counts.
|
|
1260
1265
|
if (c) tokens = c.input + c.output + c.cache_read + c.cache_creation;
|
|
1261
1266
|
} // #8234: the CLIs that print no usage on stdout keep the counts in their own session records —
|
|
1262
|
-
// opencode's db, the session
|
|
1263
|
-
//
|
|
1267
|
+
// opencode's db, kimi's wire, the dsh session log. Sum this turn's window there; null (unknown)
|
|
1268
|
+
// leaves the stdout paths above standing — never 0 ("free"). #14663: the sqlite reads go through
|
|
1269
|
+
// node's built-in SQLite (netcup has no sqlite3 binary), else every glm/openrouter turn read ~0.
|
|
1264
1270
|
const usage = cli.pinned && sid ? ocTurnUsage(OC_DB, sid, t0, Date.now())
|
|
1265
1271
|
: AGENT === "dsh" ? dshTurnUsage(join(homedir(), ".dsh", "sessions"), TURN_DIR, t0, Date.now())
|
|
1272
|
+
: DRIVER === "kimi" ? kimiTurnUsage(join(homedir(), ".kimi-code", "sessions"), sid, t0, Date.now())
|
|
1266
1273
|
: null;
|
|
1267
1274
|
if (usage) tokens = usageTotal(usage);
|
|
1268
1275
|
// #11559: every token this turn spent rides the card it served. A card-0 turn (kickoff, pulse,
|
|
@@ -1320,10 +1327,10 @@ exit $turn_exit`;
|
|
|
1320
1327
|
lastNoDelivery = noDelivery;
|
|
1321
1328
|
lastNoDeliveryStatus = cardStatusAtEnd;
|
|
1322
1329
|
if (noDelivery) log(`\x1b[33mexit 0 but the turn DELIVERED NOTHING on #${sessionCard} — no new commit, card still ${cardStatusAtEnd || "unknown"}\x1b[0m`);
|
|
1323
|
-
// #5868: the verdict rides
|
|
1324
|
-
//
|
|
1325
|
-
//
|
|
1326
|
-
//
|
|
1330
|
+
// #5868/#14662: the verdict rides telemetry; an unrecognized failure also keeps its redacted
|
|
1331
|
+
// stderr tail on the row and card. A silent cut names its own verdict (#7752): the exit under it
|
|
1332
|
+
// is the sweep's SIGPIPE. A box cut passes `cut` so its 137 reads as SIGKILL (#7099); zero usage
|
|
1333
|
+
// names its own verdict too (#9724).
|
|
1327
1334
|
const verdict = stallCut ? stallVerdict() : zeroUsage ? zeroUsageVerdict()
|
|
1328
1335
|
: askVerdict ? askVerdict
|
|
1329
1336
|
: blockedVerdict ? blockedVerdict
|
|
@@ -1335,6 +1342,8 @@ exit $turn_exit`;
|
|
|
1335
1342
|
// empty/stalled turns to the card that produced nothing. `cut` stays too: the drills read it.
|
|
1336
1343
|
const outcome = cut ? (stallCut ? "stalled" : "cut") : (effExit !== 0 ? (lastPermissionReject ? "rejected" : "api-error") : noDelivery ? "no-delivery" : lastEmptyTurn ? "empty" : "completed");
|
|
1337
1344
|
const finalOutcome = askVerdict ? "asked" : blockedVerdict ? "blocked" : outcome;
|
|
1345
|
+
const failure = effExit !== 0 ? classifyFailure(effExit, ownOut, lastEmptyOutput, lastEmptyTurn, cut) : null;
|
|
1346
|
+
lastFailureTail = failure?.reason === "crashed" ? failure.stderrTail : "";
|
|
1338
1347
|
const endedAt = Date.now();
|
|
1339
1348
|
const transcriptModel = DRIVER === "codex" ? codexTurnModel(join(homedir(), ".codex", "sessions"), t0, TURN_DIR)
|
|
1340
1349
|
: DRIVER === "kimi" ? kimiTurnModel(join(homedir(), ".kimi-code", "sessions"), sid, t0)
|
|
@@ -1342,8 +1351,9 @@ exit $turn_exit`;
|
|
|
1342
1351
|
// #14654: structured transcript metadata, else the pinned model; free-text model: lines are never read.
|
|
1343
1352
|
const actualModel = transcriptModel || MODEL || "unknown";
|
|
1344
1353
|
const telemetryRow = { ts: endedAt, persona: PERSONA, agent: AGENT, project: PROJ, turn: TURN, trigger, card: sessionCard || 0, model: actualModel, duration_ms: endedAt - t0, exit: realExit, effExit, authFailed: effExit !== realExit, emptyOutput: lastEmptyOutput, emptyTurn: lastEmptyTurn, verdict, outcome: finalOutcome, tokens };
|
|
1354
|
+
if (lastFailureTail) telemetryRow.stderrTail = lastFailureTail;
|
|
1345
1355
|
if (sessionCard > 0) {
|
|
1346
|
-
const
|
|
1356
|
+
const failureReason = failure?.reason || classifyFailure(effExit, ownOut, lastEmptyOutput, lastEmptyTurn, cut).reason;
|
|
1347
1357
|
telemetryRow.attempt = {
|
|
1348
1358
|
id: `${SESSION}:${t0}:${TURN}`, card: sessionCard, seat: SESSION, project: PROJ,
|
|
1349
1359
|
provider: providerForModel(DRIVER, actualModel), model: actualModel,
|
|
@@ -1351,7 +1361,7 @@ exit $turn_exit`;
|
|
|
1351
1361
|
taskKind: cardKind || "unknown", difficulty: cardDifficulty || "unknown",
|
|
1352
1362
|
machine: MACHINE_LABEL || "unknown", start: new Date(t0).toISOString(), end: new Date(endedAt).toISOString(),
|
|
1353
1363
|
commit: newCommit ? headAfter : "", outcome: finalOutcome,
|
|
1354
|
-
infraFailure: isInfraFailure(finalOutcome,
|
|
1364
|
+
infraFailure: isInfraFailure(finalOutcome, failureReason), tokens: Number.isFinite(tokens) ? tokens : null,
|
|
1355
1365
|
};
|
|
1356
1366
|
}
|
|
1357
1367
|
if (usage) telemetryRow.usage = usage;
|
|
@@ -1672,6 +1682,7 @@ async function resolveWakeCard(messages, { session }) {
|
|
|
1672
1682
|
const shed = restored.wake.filter(isExpiredHubAlert).length +
|
|
1673
1683
|
restored.bcast.filter(isExpiredHubAlert).length;
|
|
1674
1684
|
let pendingWake = restored.wake.filter(shouldWake);
|
|
1685
|
+
stampWakeDelivery(pendingWake);
|
|
1675
1686
|
let pendingBcast = restored.bcast.filter(m => !isExpiredHubAlert(m) && !isReceipt(m) && !isStatusBroadcast(m));
|
|
1676
1687
|
if (shed) {
|
|
1677
1688
|
log(`\x1b[33mdropped ${shed} expired hub staleness alert(s) older than ${Math.round(HUB_ALERT_TTL_MS / 60000)}m — they describe conditions that have long since changed\x1b[0m`);
|
|
@@ -1702,6 +1713,49 @@ async function resolveWakeCard(messages, { session }) {
|
|
|
1702
1713
|
await api("/send", { from: SESSION, to: "all", project: PROJ, kind: "status", text }).catch(() => {});
|
|
1703
1714
|
}
|
|
1704
1715
|
let lastTurnAt = releaseState?.lastTurnAt || Date.now();
|
|
1716
|
+
async function checkTurnless() {
|
|
1717
|
+
const cardStatuses = {};
|
|
1718
|
+
for (;;) {
|
|
1719
|
+
const candidate = turnlessContract({
|
|
1720
|
+
messages: pendingWake, session: SESSION, nowMs: Date.now(), lastTurnStartedAt,
|
|
1721
|
+
awaitingAsk: !!awaitingAsk, parked: !!parkState,
|
|
1722
|
+
pausedCards: budgetStop ? [budgetStop.card] : [], cardStatuses, stuckAfterMs: TURNLESS_MS,
|
|
1723
|
+
});
|
|
1724
|
+
if (!candidate) return;
|
|
1725
|
+
const key = `${candidate.wakeId}:${candidate.deliveredAt}`;
|
|
1726
|
+
if (turnlessAlertKey === key) return;
|
|
1727
|
+
if (candidate.card && cardStatuses[candidate.card] === undefined) {
|
|
1728
|
+
const status = await api(`/card?project=${encodeURIComponent(PROJ)}&id=${candidate.card}`)
|
|
1729
|
+
.then(r => String(r?.task?.status || "")).catch(() => "");
|
|
1730
|
+
cardStatuses[candidate.card] = status;
|
|
1731
|
+
if (NON_RUNNABLE_CARD_STATUSES.has(status)) continue;
|
|
1732
|
+
}
|
|
1733
|
+
turnlessAlertKey = key;
|
|
1734
|
+
const age = candidate.ageMs >= 60e3 ? `${Math.floor(candidate.ageMs / 60e3)}m` : `${Math.floor(candidate.ageMs / 1000)}s`;
|
|
1735
|
+
const card = candidate.card ? ` card #${candidate.card}` : "";
|
|
1736
|
+
const last = candidate.lastTurnStartedAt ? new Date(candidate.lastTurnStartedAt).toISOString() : "never";
|
|
1737
|
+
const text = `⚠️ ${SESSION} alive-but-turnless — wake #${candidate.wakeId}${card} delivered ${age} ago, no turn started; runner pid ${process.pid}, phase idle, last turn start ${last}. Check wake delivery and the runner process.`;
|
|
1738
|
+
const evidence = { wakeId: candidate.wakeId, card: candidate.card, deliveredAt: candidate.deliveredAt, ageMs: candidate.ageMs, pid: process.pid, lastTurnStartedAt: candidate.lastTurnStartedAt };
|
|
1739
|
+
writeTurnState(PERSONA, PROJ, { phase: "idle", fault: "alive-but-turnless", turnless: evidence, alertDelivery: "sending" });
|
|
1740
|
+
await registerStatus(`FAULT alive-but-turnless · wake #${candidate.wakeId}${card}`, { phase: "idle", fault: "alive-but-turnless" });
|
|
1741
|
+
const orch = `${hostId()}:${PROJ}`;
|
|
1742
|
+
const sender = String(candidate.message.from || "");
|
|
1743
|
+
const to = sender && sender !== SESSION && !sender.startsWith("hub:") ? sender : orch;
|
|
1744
|
+
let delivered = false;
|
|
1745
|
+
try {
|
|
1746
|
+
const response = await api("/send", { from: SESSION, to, text, project: PROJ, kind: "alert" });
|
|
1747
|
+
delivered = !!response && response.ok !== false;
|
|
1748
|
+
} catch {}
|
|
1749
|
+
writeTurnState(PERSONA, PROJ, { alertDelivery: delivered ? "delivered" : "failed" });
|
|
1750
|
+
if (!delivered && candidate.card) {
|
|
1751
|
+
await api("/task/update", { id: candidate.card, by: SESSION,
|
|
1752
|
+
note: `alive-but-turnless: wake #${candidate.wakeId} has had no turn start for ${age}; runner pid ${process.pid}. Alert delivery FAILED; this note and the local turn-state file retain the incident.` }).catch(() => {});
|
|
1753
|
+
}
|
|
1754
|
+
cmuxStatus("turnless", "#ef6a6a", "alert", { alert: true, priority: 90 });
|
|
1755
|
+
log(`${text} · alert delivery ${delivered ? "succeeded" : "FAILED"}`);
|
|
1756
|
+
return;
|
|
1757
|
+
}
|
|
1758
|
+
}
|
|
1705
1759
|
function restartForRelease() {
|
|
1706
1760
|
const version = installedVersion();
|
|
1707
1761
|
if (!newerVersion(version, bootVersion) || attemptedVersions.has(version)) return;
|
|
@@ -1717,7 +1771,7 @@ async function resolveWakeCard(messages, { session }) {
|
|
|
1717
1771
|
writeFileSync(PENDF, JSON.stringify({ persona: PERSONA, agent: AGENT, project: PROJ, ts: Date.now(),
|
|
1718
1772
|
wake: pendingWake, bcast: pendingBcast, seen: seenLedger, ask: awaitingAsk?.id || 0, askTo: awaitingAsk?.to || "" }));
|
|
1719
1773
|
const state = { cursor, turn: TURN, sid, sessionCard, retryAt, deliveryFails,
|
|
1720
|
-
noDeliveryRetry, askReleased, lastTurnAt, attempted: [...attemptedVersions], bootTs: BOOT_TS,
|
|
1774
|
+
noDeliveryRetry, askReleased, lastTurnAt, lastTurnStartedAt, turnlessAlertKey, attempted: [...attemptedVersions], bootTs: BOOT_TS,
|
|
1721
1775
|
cardTokens, cardCommits, cardStartedAt, budgetStop, budgetRetryAt,
|
|
1722
1776
|
capHandoffs, capLogged, capArmed, capFreshTurn };
|
|
1723
1777
|
process.execve(process.execPath, [process.execPath, ...process.execArgv, ...process.argv.slice(1)],
|
|
@@ -1762,6 +1816,7 @@ async function resolveWakeCard(messages, { session }) {
|
|
|
1762
1816
|
// is owed but NEVER redelivered. #11559: a budget-paused card paces its own redeliveries on
|
|
1763
1817
|
// budgetRetryAt - a clock that never delays a poll-delivered contract for a different card.
|
|
1764
1818
|
if (pendingWake.length && !awaitingAsk && Date.now() >= retryAt && Date.now() >= budgetRetryAt) { await deliverWake(); continue; }
|
|
1819
|
+
await checkTurnless();
|
|
1765
1820
|
// cap the long-poll hold so neither a due pulse nor a due redelivery waits out a silent 280s window
|
|
1766
1821
|
const due = [];
|
|
1767
1822
|
if (PULSE_MS) due.push(PULSE_MS - (Date.now() - lastTurnAt));
|
|
@@ -1854,6 +1909,7 @@ async function resolveWakeCard(messages, { session }) {
|
|
|
1854
1909
|
if (!wake.length) { if (freshBatch.kept.length) { savePending(pendingWake, pendingBcast); log(`${freshBatch.kept.length} broadcast(s) batched (no wake) — ${pendingBcast.length} pending`); } continue; }
|
|
1855
1910
|
// Queue BEFORE running the turn, and persist immediately. Everything between here and a clean
|
|
1856
1911
|
// exit 0 — the CLI dying, the machine losing power — now leaves a record of what this seat owes.
|
|
1912
|
+
stampWakeDelivery(wake);
|
|
1857
1913
|
pendingWake.push(...wake);
|
|
1858
1914
|
if (pendingWake.length > PENDING_MAX) {
|
|
1859
1915
|
const dropped = pendingWake.splice(0, pendingWake.length - PENDING_MAX);
|
|
@@ -2224,6 +2280,10 @@ async function resolveWakeCard(messages, { session }) {
|
|
|
2224
2280
|
if (reason === "exhausted") quotaReset = quotaResetAt(rows);
|
|
2225
2281
|
}
|
|
2226
2282
|
savePending(pendingWake, pendingBcast);
|
|
2283
|
+
if (reason === "crashed" && lastFailureTail && sessionCard > 0) {
|
|
2284
|
+
const note = `turn failed with an unrecognized error (exit ${ec}); redacted stderr tail:\n${lastFailureTail.slice(-1600)}`;
|
|
2285
|
+
await api("/task/update", { id: sessionCard, note, by: SESSION }).catch(() => {});
|
|
2286
|
+
}
|
|
2227
2287
|
await reportFailure(ec, "message", pendingWake.length, reason);
|
|
2228
2288
|
// #6289: TWO consecutive failed turns on one contract PARK the seat — "stalled" for a
|
|
2229
2289
|
// silent chain (#7752), time-box when the chain died to cuts, api-error otherwise —
|
package/bin/disk.mjs
CHANGED
|
@@ -8,6 +8,7 @@ import { fileURLToPath } from "node:url";
|
|
|
8
8
|
import { mkdirSync, writeFileSync } from "node:fs";
|
|
9
9
|
import { homedir, platform, userInfo } from "node:os";
|
|
10
10
|
import { runDisk, formatHuman, launchdPlist, diskSummary } from "../lib/disk.mjs";
|
|
11
|
+
import { reloadLaunchAgent } from "../lib/launchd.mjs";
|
|
11
12
|
|
|
12
13
|
const ROOT = dirname(dirname(fileURLToPath(import.meta.url)));
|
|
13
14
|
|
|
@@ -40,11 +41,13 @@ async function install() {
|
|
|
40
41
|
mkdirSync(dirname(logPath), { recursive: true });
|
|
41
42
|
writeFileSync(plistPath, launchdPlist({ scriptPath: join(ROOT, "bin", "disk.mjs"), logPath }));
|
|
42
43
|
const uid = userInfo().uid;
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
44
|
+
// #14661: reload through bootout-wait-bootstrap; if launchd still refuses, the legacy load -w is
|
|
45
|
+
// the fallback — and a bootstrap that fails BOTH ways is an error, never a quiet "installed".
|
|
46
|
+
const launchctl = (argv) => { const r = exec("launchctl", argv); return { status: r.status ?? 1, stdout: String(r.stdout || "") }; };
|
|
47
|
+
const reloaded = reloadLaunchAgent({ label: "com.trantor.disk", plist: plistPath, domain: `gui/${uid}`, launchctl });
|
|
48
|
+
if (!reloaded.ok && exec("launchctl", ["load", "-w", plistPath]).status !== 0) {
|
|
49
|
+
console.error(`trantor disk install: launchctl refused ${plistPath} (bootstrap and load -w both failed) — the daily job is NOT installed`);
|
|
50
|
+
process.exit(1);
|
|
48
51
|
}
|
|
49
52
|
console.log(`installed: ${plistPath}\nruns every day at 09:00 (safe tier only); result lands as one bus message. Log: ${logPath}`);
|
|
50
53
|
}
|
package/bin/wake-nudge.mjs
CHANGED
|
@@ -27,6 +27,7 @@ import { ledgerPaths } from "../hooks/lib/inbox-ledger.mjs";
|
|
|
27
27
|
import { dutyEscalations, claimDutyNudges, auditDutyNudges, releaseDutyNudgeClaims } from "../lib/duty-nudges.mjs";
|
|
28
28
|
import { reserveNudgeIds, releaseNudgeIds } from "../lib/nudge-ledger.mjs";
|
|
29
29
|
import { recipientPanes } from "../lib/duty-recipient.mjs";
|
|
30
|
+
import { reloadLaunchAgent } from "../lib/launchd.mjs";
|
|
30
31
|
|
|
31
32
|
const SELF = fileURLToPath(import.meta.url);
|
|
32
33
|
const LABEL = "com.trantor.wake-nudge";
|
|
@@ -272,6 +273,25 @@ export function keepalivePlist({ bus, hub, home = homedir(), script = SELF, path
|
|
|
272
273
|
</dict></plist>\n`;
|
|
273
274
|
}
|
|
274
275
|
|
|
276
|
+
// #14661: a reload whose bootout let a process escape leaves a poller outside launchd — the canary
|
|
277
|
+
// probe reads that orphan as healthy while nothing would ever restart it. Reap wake-nudge run
|
|
278
|
+
// processes the freshly-loaded job does not own; the pattern is THIS script's path (another
|
|
279
|
+
// checkout's daemon is that install's business), and no owned pid yet means the sweep is skipped.
|
|
280
|
+
const SELF_RUN_RE = new RegExp(`${SELF.replaceAll(/[.*+?^${}()|[\]\\]/g, "\\$&")}\\s+run\\b`);
|
|
281
|
+
export function reapStrayWakeNudges(ownedPid, { command = run, kill = (pid) => process.kill(pid, "SIGTERM") } = {}) {
|
|
282
|
+
if (!ownedPid) return [];
|
|
283
|
+
let rows;
|
|
284
|
+
try { rows = processRows(command("ps", ["-axo", "pid=,ppid=,command="])); } catch { return []; }
|
|
285
|
+
const owned = new Set(descendants(ownedPid, rows));
|
|
286
|
+
const reaped = [];
|
|
287
|
+
for (const row of rows) {
|
|
288
|
+
if (row.pid === process.pid || owned.has(row.pid)) continue;
|
|
289
|
+
if (!SELF_RUN_RE.test(row.command)) continue;
|
|
290
|
+
try { kill(row.pid); reaped.push(row.pid); } catch { /* already gone */ }
|
|
291
|
+
}
|
|
292
|
+
return reaped;
|
|
293
|
+
}
|
|
294
|
+
|
|
275
295
|
async function main() {
|
|
276
296
|
const [cmd = "status", ...args] = process.argv.slice(2);
|
|
277
297
|
const hub = fleetHub(args);
|
|
@@ -284,9 +304,13 @@ async function main() {
|
|
|
284
304
|
mkdirSync(bus, { recursive: true });
|
|
285
305
|
mkdirSync(dirname(plist), { recursive: true });
|
|
286
306
|
writeFileSync(plist, keepalivePlist({ bus, hub }), { mode: 0o600 });
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
307
|
+
// #14661: reload the already-registered job instead of betting one bootstrap against the
|
|
308
|
+
// teardown race; a bootstrap that still fails is an error, never a quiet unloaded agent.
|
|
309
|
+
const reloaded = reloadLaunchAgent({ label: LABEL, plist, domain: `gui/${process.getuid()}` });
|
|
310
|
+
if (!reloaded.ok) throw new Error(reloaded.error);
|
|
311
|
+
const reaped = reapStrayWakeNudges(reloaded.pid);
|
|
312
|
+
for (const pid of reaped) console.error(`${LABEL}: reaped stray pid ${pid} that was polling outside launchd`);
|
|
313
|
+
console.log(`${LABEL} installed${reloaded.pid ? ` (pid ${reloaded.pid})` : ""}; polling ${hub}`);
|
|
290
314
|
} else if (cmd === "down") {
|
|
291
315
|
try { run("launchctl", ["bootout", service]); } catch { /* #7429: stop is idempotent. */ }
|
|
292
316
|
rmSync(plist, { force: true });
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
{
|
|
2
|
+
"schemaVersion": 1,
|
|
3
|
+
"version": "dispatcher-v1-defaults",
|
|
4
|
+
"parentVersion": null,
|
|
5
|
+
"createdAtMs": 0,
|
|
6
|
+
"createdBy": "builtin-defaults",
|
|
7
|
+
"plannerVersion": "dispatcher-v1",
|
|
8
|
+
"modeByProject": {},
|
|
9
|
+
"roster": [],
|
|
10
|
+
"placementByKind": {},
|
|
11
|
+
"discoveryTtlMs": 172800000,
|
|
12
|
+
"invocationTtlMs": 86400000,
|
|
13
|
+
"balanceTtlMs": 300000,
|
|
14
|
+
"machineTtlMs": 90000,
|
|
15
|
+
"heartbeatMs": 30000,
|
|
16
|
+
"leaseSilenceMs": 600000,
|
|
17
|
+
"reserveFractionPpm": 150000,
|
|
18
|
+
"prepaidReserveFloorMicros": 250000,
|
|
19
|
+
"dailyLimits": {
|
|
20
|
+
"deepseek": {
|
|
21
|
+
"usdMicros": 2000000,
|
|
22
|
+
"timeZone": "UTC"
|
|
23
|
+
},
|
|
24
|
+
"openrouter": {
|
|
25
|
+
"usdMicros": 3000000,
|
|
26
|
+
"timeZone": "UTC"
|
|
27
|
+
}
|
|
28
|
+
},
|
|
29
|
+
"accountOverrides": [],
|
|
30
|
+
"qualityPriors": [],
|
|
31
|
+
"capabilityFloors": [
|
|
32
|
+
{
|
|
33
|
+
"difficulty": "easy",
|
|
34
|
+
"kind": "code",
|
|
35
|
+
"minimumScorePpm": 0
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
"difficulty": "medium",
|
|
39
|
+
"kind": "code",
|
|
40
|
+
"minimumScorePpm": 350000
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
"difficulty": "hard",
|
|
44
|
+
"kind": "code",
|
|
45
|
+
"minimumScorePpm": 550000
|
|
46
|
+
}
|
|
47
|
+
],
|
|
48
|
+
"exploration": {
|
|
49
|
+
"fractionPpm": 100000,
|
|
50
|
+
"minimumBatch": 10
|
|
51
|
+
},
|
|
52
|
+
"ranking": {
|
|
53
|
+
"tieRatioPpm": 1100000,
|
|
54
|
+
"priorityBasesPpm": [
|
|
55
|
+
1000000,
|
|
56
|
+
700000,
|
|
57
|
+
500000,
|
|
58
|
+
350000,
|
|
59
|
+
250000
|
|
60
|
+
],
|
|
61
|
+
"deadlineHorizonMs": 172800000,
|
|
62
|
+
"agingPerHourPpm": 50000,
|
|
63
|
+
"agingCapPpm": 2000000
|
|
64
|
+
},
|
|
65
|
+
"retry": {
|
|
66
|
+
"maxSwaps": 2,
|
|
67
|
+
"backoffMs": [
|
|
68
|
+
30000,
|
|
69
|
+
120000
|
|
70
|
+
]
|
|
71
|
+
},
|
|
72
|
+
"machineLimits": {
|
|
73
|
+
"cpuPct": 85,
|
|
74
|
+
"memPressurePct": 90,
|
|
75
|
+
"minDiskFreeBytes": 2147483648,
|
|
76
|
+
"minFreeMemoryBytes": 1073741824
|
|
77
|
+
},
|
|
78
|
+
"kill": {
|
|
79
|
+
"fleet": false,
|
|
80
|
+
"projects": []
|
|
81
|
+
},
|
|
82
|
+
"exclusions": [],
|
|
83
|
+
"hash": "sha256:8520e6f7e1f530b54ce0f80b58233d6901bc6f5b51f676dcd23dec622029d4ef"
|
|
84
|
+
}
|
package/docs/FEATURES.md
CHANGED
|
@@ -15,18 +15,31 @@ Rules for this file:
|
|
|
15
15
|
clicks, navigates, stages or commits.
|
|
16
16
|
- A probe says `skip` when the thing it reads is not on this machine (no app running, no idle
|
|
17
17
|
Claude pane, not macOS). A skip is never posted, and it neither opens nor closes an episode.
|
|
18
|
-
- When a card's files touch a feature below, that feature's probe joins the card's drill.
|
|
18
|
+
- When a card's files touch a feature below, that feature's probe joins the card's drill (#14670).
|
|
19
|
+
`files` lists exact repo paths; a path ending in `/` covers that whole directory. A card whose
|
|
20
|
+
claimed files overlap a row carries the row's probe, pinned to this table's registry hash, and a
|
|
21
|
+
probe marked required must pass on the card's artifact SHA before acceptance. A skip or a missing
|
|
22
|
+
run keeps acceptance pending; a host other than `any` means the probe only runs on that machine.
|
|
23
|
+
A claimed path no row covers needs an owner-approved no-feature-impact reason on the card.
|
|
24
|
+
`trantor canary attach <path…>` prints the probes a set of paths attaches.
|
|
25
|
+
- Changing a row's files, probe, host or required column changes the registry hash, so every open
|
|
26
|
+
card planned against the old hash replans and reverifies. `trantor canary check` validates the
|
|
27
|
+
mappings: a path with globs, `..` or a leading `/`, a probe missing from `lib/canary/probes.mjs`,
|
|
28
|
+
or a required value other than yes or no fails the check and the daily canary.
|
|
29
|
+
- `trantor canary brief` prints open regressions first, oldest first, then a missing daily run or one
|
|
30
|
+
older than 36h. A failure whose alert could not be posted stays open, says so, and is posted again
|
|
31
|
+
on the next run.
|
|
19
32
|
|
|
20
33
|
## Registry
|
|
21
34
|
|
|
22
|
-
| id | feature | what the probe reads | origin |
|
|
23
|
-
|
|
24
|
-
| `duty-turns` | The duty seat is alive and takes a turn at least once a day | `~/.agent-bus/duty.pid` names a live process, the runner's `*-trantor-duty.jsonl` turn log has a turn in the last 24h, and the hub's `/health` reports duty online | #14646 |
|
|
25
|
-
| `wake-nudge` | The wake-nudge daemon is installed and polling | `com.trantor.wake-nudge.plist` exists and `wake-nudge-cursor.json` was rewritten in the last 10 minutes (the daemon rewrites it every poll) | #7429 |
|
|
26
|
-
| `bus-delivery` | The bus delivers messages | the hub's `/health`: answers ok, persistence healthy, duty consuming with nothing stuck and no escalations queued | #5686 |
|
|
27
|
-
| `chat-working-state` | The chat working state follows herdr and the transcript | `herdr agent list` answers with a status on every agent, and the Claude agents' session ids resolve to transcripts under `~/.claude/projects` | #14644 |
|
|
28
|
-
| `cc-suggestion-pills` | The predicted-prompt pills can read Claude Code's suggestion | `herdr pane read --source visible --format ansi` on idle Claude panes still shows the `❯` + NBSP prompt line the pill parser anchors on | #11649 |
|
|
29
|
-
| `release-install` | The release install path works | the npm registry's `trantor@latest` has a version and a tarball, and the newest GitHub app release carries a `Trantor_*.dmg` | #14571 |
|
|
30
|
-
| `workspace-layouts` | The Workspace layouts render | the running app's read socket returns the main window's text, non-empty and without an error screen | #14618 |
|
|
31
|
-
| `file-actions-no-commit` | File actions in the operator's own checkout don't commit | each known project's main checkout HEAD reflog for the last 7 days has no `create … in the app` / `delete … in the app` / `rename … in the app` commit | #14639 |
|
|
32
|
-
| `launchers` | Every com.trantor.* launcher's program path exists | each `~/Library/LaunchAgents/com.trantor.*.plist`'s pinned paths exist and none is a versioned Homebrew Cellar path | #14646 |
|
|
35
|
+
| id | feature | what the probe reads | origin | files | probe | host | required for acceptance |
|
|
36
|
+
|---|---|---|---|---|---|---|---|
|
|
37
|
+
| `duty-turns` | The duty seat is alive and takes a turn at least once a day | `~/.agent-bus/duty.pid` names a live process, the runner's `*-trantor-duty.jsonl` turn log has a turn in the last 24h, and the hub's `/health` reports duty online | #14646 | `bin/duty.mjs`, `lib/duty-nudges.mjs`, `lib/duty-recipient.mjs` | `duty-turns` | mac | yes |
|
|
38
|
+
| `wake-nudge` | The wake-nudge daemon is installed and polling | `com.trantor.wake-nudge.plist` exists and `wake-nudge-cursor.json` was rewritten in the last 10 minutes (the daemon rewrites it every poll) | #7429 | `bin/wake-nudge.mjs` | `wake-nudge` | mac | yes |
|
|
39
|
+
| `bus-delivery` | The bus delivers messages | the hub's `/health`: answers ok, persistence healthy, duty consuming with nothing stuck and no escalations queued | #5686 | `hub/routes/messages.mjs` | `bus-delivery` | any | yes |
|
|
40
|
+
| `chat-working-state` | The chat working state follows herdr and the transcript | `herdr agent list` answers with a status on every agent, and the Claude agents' session ids resolve to transcripts under `~/.claude/projects` | #14644 | `desktop/src-tauri/src/chat.rs`, `desktop/src-tauri/src/transcript_facts.rs`, `desktop/src-tauri/src/herdr.rs` | `chat-working-state` | mac | yes |
|
|
41
|
+
| `cc-suggestion-pills` | The predicted-prompt pills can read Claude Code's suggestion | `herdr pane read --source visible --format ansi` on idle Claude panes still shows the `❯` + NBSP prompt line the pill parser anchors on | #11649 | `desktop/src-tauri/src/cc_suggestion.rs` | `cc-suggestion-pills` | mac | yes |
|
|
42
|
+
| `release-install` | The release install path works | the npm registry's `trantor@latest` has a version and a tarball, and the newest GitHub app release carries a `Trantor_*.dmg` | #14571 | `.github/workflows/release.yml` | `release-install` | any | yes |
|
|
43
|
+
| `workspace-layouts` | The Workspace layouts render | the running app's read socket returns the main window's text, non-empty and without an error screen | #14618 | `desktop/src/v2/shell/`, `desktop/src/v2/screens/Workspace/` | `workspace-layouts` | mac | yes |
|
|
44
|
+
| `file-actions-no-commit` | File actions in the operator's own checkout don't commit | each known project's main checkout HEAD reflog for the last 7 days has no `create … in the app` / `delete … in the app` / `rename … in the app` commit | #14639 | `desktop/src-tauri/src/file_ops.rs` | `file-actions-no-commit` | mac | yes |
|
|
45
|
+
| `launchers` | Every com.trantor.* launcher's program path exists | each `~/Library/LaunchAgents/com.trantor.*.plist`'s pinned paths exist and none is a versioned Homebrew Cellar path | #14646 | `lib/launchd.mjs`, `lib/launch-node.mjs` | `launchers` | mac | yes |
|
package/hub/routes/capacity.mjs
CHANGED
|
@@ -39,7 +39,7 @@ export async function routeCapacity({ req, res, P, auth, ctx }) {
|
|
|
39
39
|
const burnRows = turnTelemetry.readRows({ since: nowMs - 86400e3 });
|
|
40
40
|
const lastRows = turnTelemetry.readRows({ since: nowMs - 7 * 86400e3 });
|
|
41
41
|
const { low, pct } = lowThresholds();
|
|
42
|
-
const seats = seatsView({ peers: state.peers, lastRows, nowMs, onlineMs: ONLINE_MS });
|
|
42
|
+
const seats = seatsView({ peers: state.peers, lastRows, messages: state.messages, nowMs, onlineMs: ONLINE_MS });
|
|
43
43
|
const visibleSeats = filterReadable(auth, seats, (s) => s.project);
|
|
44
44
|
const seatKey = (s) => `${s.persona}\u0000${s.project}`;
|
|
45
45
|
const visibleKeys = new Set(visibleSeats.map(seatKey));
|
package/hub/routes/cards.mjs
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
/* oxlint-disable anti-slop/no-runtime-typeof, anti-slop/no-conditional-empty-object-spread -- SAFETY: Card wire envelopes and omission semantics are a compatibility contract; this module is a mechanical extraction with unchanged suites. */
|
|
2
|
+
import { seatWorkFlags } from "../../lib/capacity.mjs";
|
|
3
|
+
|
|
2
4
|
// The three fields that make a card heavy (#6983): its note log, its status history, and its
|
|
3
5
|
// checklist. All three are per-card detail nobody reads off a board — a board shows how many notes
|
|
4
6
|
// a card carries, never their text. Dropping them is what turns a 1.55MB read into 0.26MB.
|
|
@@ -569,8 +571,11 @@ export async function routeCards({ req, res, q, P, auth, ctx }) {
|
|
|
569
571
|
const ttlCut = now() - PEER_TTL_MS; // #8723: a memory row (quiet past PEER_TTL_MS) never lists as a board agent…
|
|
570
572
|
for (const [s, v] of filterReadable(auth, Object.entries(state.peers), ([, v]) => v.project || "")) {
|
|
571
573
|
if ((v.lastSeen || 0) < ttlCut) continue; // …declaredCrewFor and the duty watermark still read it from state.
|
|
572
|
-
const k = proj(v.project); const e = mk(k);
|
|
573
|
-
|
|
574
|
+
const k = proj(v.project); const e = mk(k);
|
|
575
|
+
const online = v.lastSeen > cutoff;
|
|
576
|
+
const work = seatWorkFlags({ messages: state.messages, session: s, deliveredUpTo: v.deliveredUpTo, nowMs: now(), online });
|
|
577
|
+
e.agents.push({ session: s, online, status: v.status || "", health: work.fault ? "stuck" : healthOf(v.status), ...work,
|
|
578
|
+
llm: v.llm || "", model: v.model || "", hookVersion: v.hookVersion || "", staleHooks: !!(online && v.hookVersion && HUB_VERSION && cmpSemver(v.hookVersion, HUB_VERSION) < 0) });
|
|
574
579
|
if ((v.lastSeen || 0) > e.lastActivity) e.lastActivity = v.lastSeen;
|
|
575
580
|
}
|
|
576
581
|
for (const t of filterReadable(auth, state.tasks, t => t.project || "")) { const e = mk(proj(t.project)); e.tasks[t.status] = (e.tasks[t.status]||0)+1; if (t.status === "doing") e.doingTitles.push(t.title); if ((t.updated || 0) > e.lastActivity) e.lastActivity = t.updated; }
|