agent-coord-mcp 0.26.25 → 0.26.27
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 +31 -70
- package/dist/capabilities.js +72 -2
- package/dist/capabilities.js.map +1 -1
- package/dist/server.js +13 -3
- package/dist/server.js.map +1 -1
- package/dist/tools/herdr-tail.js +26 -4
- package/dist/tools/herdr-tail.js.map +1 -1
- package/dist/tools/transport.js +84 -158
- package/dist/tools/transport.js.map +1 -1
- package/dist/transports/config.js +22 -11
- package/dist/transports/config.js.map +1 -1
- package/dist/transports/herdr.js +16 -0
- package/dist/transports/herdr.js.map +1 -1
- package/dist/transports/index.js +3 -2
- package/dist/transports/index.js.map +1 -1
- package/dist/transports/tmux.js +5 -2
- package/dist/transports/tmux.js.map +1 -1
- package/dist/transports/types.js +18 -3
- package/dist/transports/types.js.map +1 -1
- package/hooks/submit.mjs +12 -1
- package/package.json +4 -2
- package/scripts/check-global-mcp-fallback.mjs +85 -0
- package/scripts/coord-seat.mjs +96 -0
- package/scripts/coord-token.mjs +79 -4
- package/scripts/stop-agent.sh +8 -4
- package/src/capabilities.ts +75 -4
- package/src/server.ts +12 -3
- package/src/tools/herdr-tail.ts +37 -5
- package/src/tools/transport.ts +76 -162
- package/src/transports/config.ts +25 -12
- package/src/transports/herdr.ts +18 -0
- package/src/transports/index.ts +3 -2
- package/src/transports/tmux.ts +5 -2
- package/src/transports/types.ts +19 -4
- package/hooks/tmux-pusher.mjs +0 -971
- package/scripts/spawn-agent.sh +0 -94
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"herdr-tail.js","sourceRoot":"","sources":["../../src/tools/herdr-tail.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsCG;AACH,OAAO,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AACjD,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,QAAQ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G,MAAM,CAAC,GAAG,eAAe,CAAC,OAAO,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC,CAAC;IACtD,IAAI,CAAC,CAAC,OAAO;QAAE,GAAG,CAAC,iCAAiC,CAAC,CAAC,GAAG,EAAE,CAAC,CAAC;AAC/D,CAAC"}
|
package/dist/tools/transport.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { loadLiveTransports, isMarkerLive, isPidAlive
|
|
2
|
-
import {
|
|
1
|
+
import { loadLiveTransports, isMarkerLive, isPidAlive } from "./registry.js";
|
|
2
|
+
import { registerTmuxHost, activeTransport, HERDR, isLocallyProbeable, isTmuxKind, paneExists, tmuxVersion, targetOf, tmuxAvailable, } from "../transports/index.js";
|
|
3
3
|
import { newestMtimeUnder, onDiskBuildMtime, onDiskSourceMtime, SERVER_BUILD_MTIME, SERVER_BUILD_SHA, BUILD_DIR } from "../build.js";
|
|
4
4
|
import { prefixOf, prefixVerdict } from "../prefix.js";
|
|
5
5
|
import { execFileSync } from "node:child_process";
|
|
@@ -17,14 +17,14 @@ import { resolveServerIdentity } from "../server-identity.js";
|
|
|
17
17
|
import { capabilitiesTool } from "../capabilities.js";
|
|
18
18
|
import { sendMessageTool, readMessagesTool } from "./messaging.js";
|
|
19
19
|
import { randomUUID } from "node:crypto";
|
|
20
|
-
import { existsSync
|
|
20
|
+
import { existsSync } from "node:fs";
|
|
21
21
|
import { promises as fsp } from "node:fs";
|
|
22
|
-
import {
|
|
22
|
+
import { spawnSync } from "node:child_process";
|
|
23
23
|
import { fileURLToPath } from "node:url";
|
|
24
24
|
import { z } from "zod";
|
|
25
25
|
import { seatBuildOf, installedFrom, psReader } from "./seat-build.js";
|
|
26
26
|
import path from "node:path";
|
|
27
|
-
import { AGENTS_FILE, CURSOR_DIR, DEFAULT_ROOM, INBOX_DIR, ROOT, ROOM_FILE, ROOMS_DIR, ROOMS_FILE, STATUS_FILE, appendJsonl, cursorFile, deleteFile, ensureRoom, fileSize, getRooms, inboxFile, listCursorFiles, listInboxFiles, listSessionFiles, listTransportFiles,
|
|
27
|
+
import { AGENTS_FILE, CURSOR_DIR, DEFAULT_ROOM, INBOX_DIR, ROOT, ROOM_FILE, ROOMS_DIR, ROOMS_FILE, STATUS_FILE, appendJsonl, cursorFile, deleteFile, ensureRoom, fileSize, getRooms, inboxFile, listCursorFiles, listInboxFiles, listSessionFiles, listTransportFiles, normalizeRoom, pidFile, readJson, readJsonl, receiptFile, rewriteJsonl, roomFile, transportFile, TRANSPORT_DIR, updateJson, } from "../store.js";
|
|
28
28
|
import { agentIdFromCursorFilename, STALE_MS, EVICT_MS, } from "./shared.js";
|
|
29
29
|
// ---------- ping ----------
|
|
30
30
|
export const pingSchema = {
|
|
@@ -535,152 +535,20 @@ export async function attachAgentTool(args) {
|
|
|
535
535
|
note: "herdr socket transport: no pusher process — delivery is made in-process by this server through herdr's socket API; liveness is herdr's own pane status",
|
|
536
536
|
};
|
|
537
537
|
}
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
// Validate target exists. The probe's discriminating power, and the control
|
|
546
|
-
// that proves it, are documented once on `paneExists`.
|
|
547
|
-
const targetProbe = probePane(target);
|
|
548
|
-
if (!targetProbe.exists) {
|
|
549
|
-
return {
|
|
550
|
-
ok: false,
|
|
551
|
-
error: `tmux target '${target}' not found: ${targetProbe.stderr}`,
|
|
552
|
-
};
|
|
553
|
-
}
|
|
554
|
-
// If something's already attached, refuse rather than spawn a second pusher.
|
|
555
|
-
const existing = await readJson(transportFile(args.agentId), null);
|
|
556
|
-
if (markerHoldsLiveProcess(existing)) {
|
|
557
|
-
return {
|
|
558
|
-
ok: false,
|
|
559
|
-
error: `agent '${args.agentId}' already has a live ${existing.transport} attached (pid ${existing.pid}). Call detach_agent first.`,
|
|
560
|
-
existing,
|
|
561
|
-
};
|
|
562
|
-
}
|
|
563
|
-
// Clean up dead marker, if any.
|
|
564
|
-
if (existing)
|
|
565
|
-
await deleteFile(transportFile(args.agentId));
|
|
566
|
-
const pusher = resolvePusherPath();
|
|
567
|
-
if (!existsSync(pusher)) {
|
|
568
|
-
return { ok: false, error: `tmux-pusher not found at ${pusher}` };
|
|
569
|
-
}
|
|
570
|
-
// Detached spawn so the pusher outlives this MCP request/process.
|
|
571
|
-
const log = logFile(args.agentId, "pusher");
|
|
572
|
-
await fsp.mkdir(path.dirname(log), { recursive: true });
|
|
573
|
-
await fsp.mkdir(path.dirname(pidFile(args.agentId, "pusher")), { recursive: true });
|
|
574
|
-
await fsp.mkdir(path.dirname(transportFile(args.agentId)), { recursive: true });
|
|
575
|
-
const logFd = openSync(log, "a");
|
|
576
|
-
// Default: deliver room broadcasts too. The bus is chat-first — silence on
|
|
577
|
-
// a room post is a worse failure mode than a slightly noisier pane. Callers
|
|
578
|
-
// who want DM-only can pass includeRoom:false explicitly.
|
|
579
|
-
const includeRoom = args.includeRoom !== false;
|
|
580
|
-
// Use the exact node binary running this server, not bare "node" — the MCP
|
|
581
|
-
// server is often launched via an absolute path (nvm/Homebrew/bundled
|
|
582
|
-
// runtime) that isn't on the spawned child's PATH, which would silently fail
|
|
583
|
-
// the pusher launch ("attached but nothing arrives").
|
|
584
|
-
// `--agent <id>` is inert to the pusher (env stays authoritative) but puts
|
|
585
|
-
// the agentId in argv, so a pattern kill can be scoped to ONE pusher
|
|
586
|
-
// (`pkill -f "tmux-pusher.mjs --agent <id>"`). Without it the only matchable
|
|
587
|
-
// pattern was the script path, and a `pkill -f tmux-pusher.mjs` during one
|
|
588
|
-
// agent's cleanup silently detached every live agent on the bus (2026-07-28).
|
|
589
|
-
const child = spawn(process.execPath, [pusher, "--agent", args.agentId], {
|
|
590
|
-
detached: true,
|
|
591
|
-
stdio: ["ignore", logFd, logFd],
|
|
592
|
-
env: {
|
|
593
|
-
...process.env,
|
|
594
|
-
AGENT_COORD_ID: args.agentId,
|
|
595
|
-
AGENT_COORD_TMUX_TARGET: target,
|
|
596
|
-
...(includeRoom ? { AGENT_COORD_INCLUDE_ROOM: "1" } : {}),
|
|
597
|
-
...(args.allowlist && args.allowlist.length > 0
|
|
598
|
-
? { AGENT_COORD_ALLOWLIST: args.allowlist.join(",") }
|
|
599
|
-
: {}),
|
|
600
|
-
...(args.debounceMs ? { AGENT_COORD_DEBOUNCE_MS: String(args.debounceMs) } : {}),
|
|
601
|
-
},
|
|
602
|
-
});
|
|
603
|
-
child.unref();
|
|
604
|
-
const pid = child.pid;
|
|
605
|
-
if (!pid)
|
|
606
|
-
return { ok: false, error: "spawn returned no pid" };
|
|
607
|
-
// Write pid file (for scripts) and transport marker (for list_agents).
|
|
608
|
-
await fsp.writeFile(pidFile(args.agentId, "pusher"), String(pid), "utf8");
|
|
609
|
-
// Stamp the pusher source's freshness so doctor() can flag a stale daemon if
|
|
610
|
-
// it outlives a later upgrade of the on-disk code (see v0.8.1 → v0.8.2 bug
|
|
611
|
-
// report: control commands silently dropped by pre-v0.8 in-memory code).
|
|
612
|
-
const scriptMtime = newestPusherSourceMtime();
|
|
613
|
-
const marker = {
|
|
614
|
-
agentId: args.agentId,
|
|
615
|
-
transport: TMUX_PUSH,
|
|
616
|
-
pid,
|
|
617
|
-
// DUAL-WRITTEN, and the duplication is the point. `target` is what every
|
|
618
|
-
// consumer now reads (`targetOf`); `tmuxTarget` is what the code a merge
|
|
619
|
-
// revert restores reads. Writing only the new field would leave markers the
|
|
620
|
-
// old server cannot parse, and that failure does not degrade gracefully —
|
|
621
|
-
// it silences every attached lane at once.
|
|
622
|
-
target,
|
|
623
|
-
tmuxTarget: target,
|
|
624
|
-
since: Date.now(),
|
|
625
|
-
scriptMtime,
|
|
626
|
-
// Provenance: the build identity THIS server loaded at startup — not a
|
|
627
|
-
// fresh stat of dist/, because the code doing the stamping is the loaded
|
|
628
|
-
// code, and after an in-place rebuild the two differ (that difference is
|
|
629
|
-
// exactly what doctor's provenance check exists to surface).
|
|
630
|
-
serverBuildMtime: SERVER_BUILD_MTIME,
|
|
631
|
-
// WHAT this transport carries, recorded by the code that decides it.
|
|
632
|
-
// `includeRoom` is what the pusher is actually spawned with a few lines
|
|
633
|
-
// above, so the marker cannot claim a capability the process was not
|
|
634
|
-
// given — the marker and the spawn come from one value, not two.
|
|
635
|
-
rooms: includeRoom,
|
|
636
|
-
};
|
|
637
|
-
// Use updateJson so it lockfile-protects and creates the file atomically.
|
|
638
|
-
await updateJson(transportFile(args.agentId), marker, () => marker);
|
|
639
|
-
// Best-effort scan for a peek-coord.mjs hook wired to the same agentId —
|
|
640
|
-
// both consumers share the cursor file and would race / double-deliver.
|
|
641
|
-
const conflictingHook = await detectPeekCoordHook(args.agentId);
|
|
538
|
+
// ⟨q-ec020f6a⟩ slice C — local tmux-push DELETED outright: 0 of 13 live seats used it,
|
|
539
|
+
// and keeping it meant a second delivery mechanism (hooks/tmux-pusher.mjs, now removed)
|
|
540
|
+
// plus a role-card precondition that halted every live herdr seat on a false requirement.
|
|
541
|
+
// attach_agent handles exactly one kind now. A remote seat never came through here in
|
|
542
|
+
// the first place — it registers via report_transport (scripts/coord-pusher.mjs) — so
|
|
543
|
+
// this refuses rather than silently trying (and failing) to spawn a script that no
|
|
544
|
+
// longer exists.
|
|
642
545
|
return {
|
|
643
|
-
ok:
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
pid,
|
|
648
|
-
log,
|
|
649
|
-
...(conflictingHook
|
|
650
|
-
? {
|
|
651
|
-
warnings: [
|
|
652
|
-
`peek-coord.mjs hook for agentId='${args.agentId}' detected in ${conflictingHook}. ` +
|
|
653
|
-
`Running both transports causes double-delivery — disable one. ` +
|
|
654
|
-
`Recommend removing the peek-coord hook entry since tmux-push supersedes it.`,
|
|
655
|
-
],
|
|
656
|
-
}
|
|
657
|
-
: {}),
|
|
546
|
+
ok: false,
|
|
547
|
+
error: `attach_agent only attaches the herdr transport now (this fleet's active transport is ` +
|
|
548
|
+
`${activeT ? `'${activeT.kind}'` : "unconfigured"}) — local tmux-push was removed (⟨q-ec020f6a⟩). ` +
|
|
549
|
+
`A remote seat registers via report_transport, not attach_agent.`,
|
|
658
550
|
};
|
|
659
551
|
}
|
|
660
|
-
async function detectPeekCoordHook(agentId) {
|
|
661
|
-
const home = process.env.HOME ?? "";
|
|
662
|
-
const cwd = process.cwd();
|
|
663
|
-
const candidates = [
|
|
664
|
-
path.join(home, ".claude", "settings.json"),
|
|
665
|
-
path.join(home, ".claude", "settings.local.json"),
|
|
666
|
-
path.join(cwd, ".claude", "settings.json"),
|
|
667
|
-
path.join(cwd, ".claude", "settings.local.json"),
|
|
668
|
-
];
|
|
669
|
-
for (const file of candidates) {
|
|
670
|
-
if (!existsSync(file))
|
|
671
|
-
continue;
|
|
672
|
-
try {
|
|
673
|
-
const raw = await fsp.readFile(file, "utf8");
|
|
674
|
-
if (raw.includes("peek-coord.mjs") && raw.includes(`AGENT_COORD_ID=${agentId}`)) {
|
|
675
|
-
return file;
|
|
676
|
-
}
|
|
677
|
-
}
|
|
678
|
-
catch {
|
|
679
|
-
// unreadable, skip
|
|
680
|
-
}
|
|
681
|
-
}
|
|
682
|
-
return undefined;
|
|
683
|
-
}
|
|
684
552
|
export const detachAgentSchema = {
|
|
685
553
|
agentId: z.string().min(1),
|
|
686
554
|
};
|
|
@@ -1556,6 +1424,21 @@ export async function doctorTool(args) {
|
|
|
1556
1424
|
counts.set(file, await scanJsonl(file));
|
|
1557
1425
|
return counts.get(file);
|
|
1558
1426
|
};
|
|
1427
|
+
/** A PUSH cursor's bound: bytes on disk, the same figure `advancePushCursor` writes. ⟨q-f018dd51⟩ */
|
|
1428
|
+
const sizes = new Map();
|
|
1429
|
+
const byteSizeOf = async (file) => {
|
|
1430
|
+
if (!sizes.has(file)) {
|
|
1431
|
+
let n = 0;
|
|
1432
|
+
try {
|
|
1433
|
+
n = (await fsp.stat(file)).size;
|
|
1434
|
+
}
|
|
1435
|
+
catch {
|
|
1436
|
+
n = 0;
|
|
1437
|
+
}
|
|
1438
|
+
sizes.set(file, n);
|
|
1439
|
+
}
|
|
1440
|
+
return sizes.get(file);
|
|
1441
|
+
};
|
|
1559
1442
|
// 4. Cursor offsets past end-of-file (would return [] forever).
|
|
1560
1443
|
//
|
|
1561
1444
|
// q-40449919: `id` must be the AGENT's id, not the cursor filename minus
|
|
@@ -1566,24 +1449,51 @@ export async function doctorTool(args) {
|
|
|
1566
1449
|
// agent's inbox in the first place.
|
|
1567
1450
|
{
|
|
1568
1451
|
const broken = [];
|
|
1452
|
+
const lagging = [];
|
|
1569
1453
|
for (const fname of await listCursorFiles()) {
|
|
1570
1454
|
const { id, kind } = agentIdFromCursorFilename(fname);
|
|
1571
1455
|
const cursorPath = path.join(CURSOR_DIR, fname);
|
|
1572
1456
|
const cursor = await readJson(cursorPath, {});
|
|
1573
1457
|
const overflow = [];
|
|
1574
|
-
|
|
1458
|
+
// ⛔⛔ THE TWO CURSOR KINDS ARE IN DIFFERENT UNITS, AND CONFLATING THEM ARMED A DESTRUCTIVE FIX.
|
|
1459
|
+
// A READ cursor (`<agent>.json`) indexes PARSED ENTRIES — a message count. A PUSH cursor
|
|
1460
|
+
// (`<agent>.push.json`) is a BYTE OFFSET: `advancePushCursor` writes `toOffset ?? statSync(file).size`,
|
|
1461
|
+
// "the byte just past the line that was delivered". Measuring a byte offset against a message
|
|
1462
|
+
// count makes EVERY push cursor on a non-trivial inbox read as past EOF — and because this
|
|
1463
|
+
// check is `fixable`, the "clamp" then rewinds it to the count. ⟨q-f018dd51⟩: on 2026-09-17 a
|
|
1464
|
+
// `doctor {fix:true}` did exactly that to 11 of 13 seats across two fleets in one call —
|
|
1465
|
+
// cass-poc-coordinator went from byte 3,413,506 to byte 992, i.e. to the START of its inbox.
|
|
1466
|
+
// Nothing replayed only because the running tails held an in-process high-water mark; the
|
|
1467
|
+
// damage was LATENT and would have fired on the next restart, when that mark is gone.
|
|
1468
|
+
const boundOf = async (file) => (kind === "push" ? await byteSizeOf(file) : (await countFor(file)).parsed);
|
|
1469
|
+
const unit = kind === "push" ? "bytes" : "entries";
|
|
1470
|
+
const inboxMax = await boundOf(inboxFile(id));
|
|
1575
1471
|
if ((cursor.inboxOffset ?? 0) > inboxMax)
|
|
1576
|
-
overflow.push(`inboxOffset ${cursor.inboxOffset}>${inboxMax}`);
|
|
1577
|
-
const roomMax =
|
|
1472
|
+
overflow.push(`inboxOffset ${cursor.inboxOffset}>${inboxMax} ${unit}`);
|
|
1473
|
+
const roomMax = await boundOf(ROOM_FILE);
|
|
1578
1474
|
if ((cursor.roomOffset ?? 0) > roomMax)
|
|
1579
|
-
overflow.push(`roomOffset ${cursor.roomOffset}>${roomMax}`);
|
|
1580
|
-
const statusMax =
|
|
1475
|
+
overflow.push(`roomOffset ${cursor.roomOffset}>${roomMax} ${unit}`);
|
|
1476
|
+
const statusMax = await boundOf(STATUS_FILE);
|
|
1581
1477
|
if ((cursor.statusOffset ?? 0) > statusMax)
|
|
1582
|
-
overflow.push(`statusOffset ${cursor.statusOffset}>${statusMax}`);
|
|
1478
|
+
overflow.push(`statusOffset ${cursor.statusOffset}>${statusMax} ${unit}`);
|
|
1583
1479
|
for (const [chan, off] of Object.entries(cursor.roomOffsets ?? {})) {
|
|
1584
|
-
const max =
|
|
1480
|
+
const max = await boundOf(roomFile(chan));
|
|
1585
1481
|
if (off > max)
|
|
1586
|
-
overflow.push(`roomOffsets[${chan}] ${off}>${max}`);
|
|
1482
|
+
overflow.push(`roomOffsets[${chan}] ${off}>${max} ${unit}`);
|
|
1483
|
+
}
|
|
1484
|
+
// ⭐ THE DIRECTION THAT WAS NEVER TESTED, AND THE ONE THAT ACTUALLY BIT. Everything above asks
|
|
1485
|
+
// "is the cursor PAST the end" — an over-run. A seat goes silently deaf from the opposite
|
|
1486
|
+
// shape: its push cursor sits BEHIND a grown inbox, so mail is owed and never typed
|
|
1487
|
+
// (⟨q-cdb5b007⟩). doctor reported "all cursor offsets are within bounds" for seats 10KB
|
|
1488
|
+
// behind, all day, while a worker missed its GO and idled 40 minutes.
|
|
1489
|
+
// ⛔ REPORTED, NEVER "FIXED": advancing a lagging cursor to EOF SKIPS the backlog rather than
|
|
1490
|
+
// delivering it. The remedy is a working tail; a clamp here would destroy the evidence and
|
|
1491
|
+
// the mail. This is why lag is deliberately absent from the `fix` branch below.
|
|
1492
|
+
if (kind === "push") {
|
|
1493
|
+
const size = await byteSizeOf(inboxFile(id));
|
|
1494
|
+
const behind = size - Number(cursor.inboxOffset ?? 0);
|
|
1495
|
+
if (behind > 0)
|
|
1496
|
+
lagging.push(`${id}: ${behind} byte(s) owed (push cursor ${cursor.inboxOffset ?? 0}/${size})`);
|
|
1587
1497
|
}
|
|
1588
1498
|
if (overflow.length) {
|
|
1589
1499
|
broken.push(`${id}${kind === "push" ? " (push)" : ""}: ${overflow.join(", ")}`);
|
|
@@ -1597,7 +1507,9 @@ export async function doctorTool(args) {
|
|
|
1597
1507
|
c.statusOffset = statusMax;
|
|
1598
1508
|
if (c.roomOffsets) {
|
|
1599
1509
|
for (const chan of Object.keys(c.roomOffsets)) {
|
|
1600
|
-
|
|
1510
|
+
// Same per-kind bound as the detection above — a clamp that used the other unit
|
|
1511
|
+
// would be the very rewind this row exists to stop.
|
|
1512
|
+
const max = kind === "push" ? (sizes.get(roomFile(chan)) ?? 0) : (counts.get(roomFile(chan))?.parsed ?? 0);
|
|
1601
1513
|
if (c.roomOffsets[chan] > max)
|
|
1602
1514
|
c.roomOffsets[chan] = max;
|
|
1603
1515
|
}
|
|
@@ -1611,10 +1523,24 @@ export async function doctorTool(args) {
|
|
|
1611
1523
|
findings.push({
|
|
1612
1524
|
check: "cursor-past-eof",
|
|
1613
1525
|
level: broken.length ? "error" : "ok",
|
|
1614
|
-
detail: broken.length
|
|
1526
|
+
detail: broken.length
|
|
1527
|
+
? `${broken.length} cursor(s) with an offset past EOF — delivery stalled`
|
|
1528
|
+
: "all cursor offsets are within bounds (push cursors measured in BYTES, read cursors in parsed entries)",
|
|
1615
1529
|
fixable: true,
|
|
1616
1530
|
items: broken.length ? broken : undefined,
|
|
1617
1531
|
});
|
|
1532
|
+
// A SEPARATE FINDING, AND DELIBERATELY `fixable: false`. Lag is the ⟨q-cdb5b007⟩ deafness shape:
|
|
1533
|
+
// mail owed and never typed. It is a symptom of a tail that is not running or not typing, and
|
|
1534
|
+
// the remedy is that tail — advancing the cursor would SKIP the backlog, not deliver it.
|
|
1535
|
+
findings.push({
|
|
1536
|
+
check: "push-cursor-lag",
|
|
1537
|
+
level: lagging.length ? "warn" : "ok",
|
|
1538
|
+
detail: lagging.length
|
|
1539
|
+
? `${lagging.length} seat(s) with mail owed but not yet typed into their pane — a tail that is not running, or running and holding. Check herdrTail: delivered/held tells you which, and they have opposite fixes. NOT auto-repairable: advancing a lagging cursor SKIPS the backlog instead of delivering it.`
|
|
1540
|
+
: "no push cursor is behind its inbox",
|
|
1541
|
+
fixable: false,
|
|
1542
|
+
items: lagging.length ? lagging : undefined,
|
|
1543
|
+
});
|
|
1618
1544
|
}
|
|
1619
1545
|
// 5. Malformed JSONL lines (silently desync offset math between server + hooks).
|
|
1620
1546
|
{
|