@cluesmith/codev 3.3.0 → 3.3.2
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/dashboard-dist/assets/{index-JCbkpAcV.js → index-D3XaKpZW.js} +45 -43
- package/dashboard-dist/assets/index-D3XaKpZW.js.map +1 -0
- package/dashboard-dist/index.html +1 -1
- package/dist/agent-farm/cli.d.ts.map +1 -1
- package/dist/agent-farm/cli.js +99 -36
- package/dist/agent-farm/cli.js.map +1 -1
- package/dist/agent-farm/commands/reset/constants.d.ts +119 -1
- package/dist/agent-farm/commands/reset/constants.d.ts.map +1 -1
- package/dist/agent-farm/commands/reset/constants.js +119 -1
- package/dist/agent-farm/commands/reset/constants.js.map +1 -1
- package/dist/agent-farm/commands/reset/context.d.ts +20 -2
- package/dist/agent-farm/commands/reset/context.d.ts.map +1 -1
- package/dist/agent-farm/commands/reset/context.js +44 -3
- package/dist/agent-farm/commands/reset/context.js.map +1 -1
- package/dist/agent-farm/commands/reset/index.d.ts +7 -7
- package/dist/agent-farm/commands/reset/index.js +8 -8
- package/dist/agent-farm/commands/reset/index.js.map +1 -1
- package/dist/agent-farm/commands/reset/receipt.d.ts +1 -1
- package/dist/agent-farm/commands/reset/receipt.d.ts.map +1 -1
- package/dist/agent-farm/commands/reset/receipt.js +19 -8
- package/dist/agent-farm/commands/reset/receipt.js.map +1 -1
- package/dist/agent-farm/commands/reset/reorient.d.ts +1 -1
- package/dist/agent-farm/commands/reset/reorient.d.ts.map +1 -1
- package/dist/agent-farm/commands/reset/reorient.js +12 -5
- package/dist/agent-farm/commands/reset/reorient.js.map +1 -1
- package/dist/agent-farm/commands/reset/self.d.ts +335 -0
- package/dist/agent-farm/commands/reset/self.d.ts.map +1 -0
- package/dist/agent-farm/commands/reset/self.js +636 -0
- package/dist/agent-farm/commands/reset/self.js.map +1 -0
- package/dist/agent-farm/commands/reset.d.ts +18 -3
- package/dist/agent-farm/commands/reset.d.ts.map +1 -1
- package/dist/agent-farm/commands/reset.js +55 -33
- package/dist/agent-farm/commands/reset.js.map +1 -1
- package/dist/agent-farm/commands/self-refresh.d.ts +60 -0
- package/dist/agent-farm/commands/self-refresh.d.ts.map +1 -0
- package/dist/agent-farm/commands/self-refresh.js +506 -0
- package/dist/agent-farm/commands/self-refresh.js.map +1 -0
- package/dist/agent-farm/commands/send.d.ts.map +1 -1
- package/dist/agent-farm/commands/send.js +27 -2
- package/dist/agent-farm/commands/send.js.map +1 -1
- package/dist/agent-farm/commands/spawn-worktree.js +1 -1
- package/dist/agent-farm/commands/spawn-worktree.js.map +1 -1
- package/dist/agent-farm/commands/spawn.d.ts +7 -0
- package/dist/agent-farm/commands/spawn.d.ts.map +1 -1
- package/dist/agent-farm/commands/spawn.js +13 -1
- package/dist/agent-farm/commands/spawn.js.map +1 -1
- package/dist/agent-farm/commands/tower.d.ts.map +1 -1
- package/dist/agent-farm/commands/tower.js +13 -0
- package/dist/agent-farm/commands/tower.js.map +1 -1
- package/dist/agent-farm/lib/reconnect-backoff.d.ts +10 -0
- package/dist/agent-farm/lib/reconnect-backoff.d.ts.map +1 -1
- package/dist/agent-farm/lib/reconnect-backoff.js +10 -0
- package/dist/agent-farm/lib/reconnect-backoff.js.map +1 -1
- package/dist/agent-farm/lib/tower-client.d.ts +12 -0
- package/dist/agent-farm/lib/tower-client.d.ts.map +1 -1
- package/dist/agent-farm/lib/tower-client.js +12 -0
- package/dist/agent-farm/lib/tower-client.js.map +1 -1
- package/dist/agent-farm/lib/tunnel-client.d.ts.map +1 -1
- package/dist/agent-farm/lib/tunnel-client.js +7 -3
- package/dist/agent-farm/lib/tunnel-client.js.map +1 -1
- package/dist/agent-farm/servers/canvas-relay.d.ts +60 -0
- package/dist/agent-farm/servers/canvas-relay.d.ts.map +1 -0
- package/dist/agent-farm/servers/canvas-relay.js +376 -0
- package/dist/agent-farm/servers/canvas-relay.js.map +1 -0
- package/dist/agent-farm/servers/gate-profiles.d.ts +1 -1
- package/dist/agent-farm/servers/gate-profiles.js +1 -1
- package/dist/agent-farm/servers/mailbox-delivery.d.ts +141 -13
- package/dist/agent-farm/servers/mailbox-delivery.d.ts.map +1 -1
- package/dist/agent-farm/servers/mailbox-delivery.js +172 -16
- package/dist/agent-farm/servers/mailbox-delivery.js.map +1 -1
- package/dist/agent-farm/servers/mailbox-wiring.d.ts +24 -2
- package/dist/agent-farm/servers/mailbox-wiring.d.ts.map +1 -1
- package/dist/agent-farm/servers/mailbox-wiring.js +92 -32
- package/dist/agent-farm/servers/mailbox-wiring.js.map +1 -1
- package/dist/agent-farm/servers/message-write.d.ts +58 -18
- package/dist/agent-farm/servers/message-write.d.ts.map +1 -1
- package/dist/agent-farm/servers/message-write.js +73 -28
- package/dist/agent-farm/servers/message-write.js.map +1 -1
- package/dist/agent-farm/servers/overview.d.ts +19 -0
- package/dist/agent-farm/servers/overview.d.ts.map +1 -1
- package/dist/agent-farm/servers/overview.js +78 -1
- package/dist/agent-farm/servers/overview.js.map +1 -1
- package/dist/agent-farm/servers/render-gate.d.ts +13 -0
- package/dist/agent-farm/servers/render-gate.d.ts.map +1 -1
- package/dist/agent-farm/servers/render-gate.js +21 -0
- package/dist/agent-farm/servers/render-gate.js.map +1 -1
- package/dist/agent-farm/servers/session-submit.d.ts +221 -28
- package/dist/agent-farm/servers/session-submit.d.ts.map +1 -1
- package/dist/agent-farm/servers/session-submit.js +334 -43
- package/dist/agent-farm/servers/session-submit.js.map +1 -1
- package/dist/agent-farm/servers/tower-routes.d.ts.map +1 -1
- package/dist/agent-farm/servers/tower-routes.js +269 -64
- package/dist/agent-farm/servers/tower-routes.js.map +1 -1
- package/dist/agent-farm/servers/tower-server.js +25 -3
- package/dist/agent-farm/servers/tower-server.js.map +1 -1
- package/dist/agent-farm/servers/tower-terminals.d.ts +6 -0
- package/dist/agent-farm/servers/tower-terminals.d.ts.map +1 -1
- package/dist/agent-farm/servers/tower-terminals.js +30 -5
- package/dist/agent-farm/servers/tower-terminals.js.map +1 -1
- package/dist/agent-farm/servers/tower-tunnel.d.ts.map +1 -1
- package/dist/agent-farm/servers/tower-tunnel.js +14 -0
- package/dist/agent-farm/servers/tower-tunnel.js.map +1 -1
- package/dist/agent-farm/servers/tower-websocket.d.ts +6 -1
- package/dist/agent-farm/servers/tower-websocket.d.ts.map +1 -1
- package/dist/agent-farm/servers/tower-websocket.js +90 -37
- package/dist/agent-farm/servers/tower-websocket.js.map +1 -1
- package/dist/agent-farm/types.d.ts +37 -2
- package/dist/agent-farm/types.d.ts.map +1 -1
- package/dist/agent-farm/utils/harness.d.ts +3 -3
- package/dist/agent-farm/utils/harness.js +1 -1
- package/dist/agent-farm/utils/message-format.d.ts +67 -3
- package/dist/agent-farm/utils/message-format.d.ts.map +1 -1
- package/dist/agent-farm/utils/message-format.js +127 -14
- package/dist/agent-farm/utils/message-format.js.map +1 -1
- package/dist/agent-farm/utils/server-utils.d.ts +86 -4
- package/dist/agent-farm/utils/server-utils.d.ts.map +1 -1
- package/dist/agent-farm/utils/server-utils.js +303 -5
- package/dist/agent-farm/utils/server-utils.js.map +1 -1
- package/dist/commands/porch/context-refresh.d.ts +181 -0
- package/dist/commands/porch/context-refresh.d.ts.map +1 -0
- package/dist/commands/porch/context-refresh.js +270 -0
- package/dist/commands/porch/context-refresh.js.map +1 -0
- package/dist/commands/porch/index.d.ts +6 -0
- package/dist/commands/porch/index.d.ts.map +1 -1
- package/dist/commands/porch/index.js +46 -0
- package/dist/commands/porch/index.js.map +1 -1
- package/dist/commands/porch/next.d.ts +0 -9
- package/dist/commands/porch/next.d.ts.map +1 -1
- package/dist/commands/porch/next.js +133 -4
- package/dist/commands/porch/next.js.map +1 -1
- package/dist/commands/porch/protocol.d.ts.map +1 -1
- package/dist/commands/porch/protocol.js +102 -0
- package/dist/commands/porch/protocol.js.map +1 -1
- package/dist/commands/porch/types.d.ts +61 -0
- package/dist/commands/porch/types.d.ts.map +1 -1
- package/dist/lib/forge-contracts.d.ts +9 -0
- package/dist/lib/forge-contracts.d.ts.map +1 -1
- package/dist/lib/forge-contracts.js.map +1 -1
- package/dist/lib/github.d.ts +15 -1
- package/dist/lib/github.d.ts.map +1 -1
- package/dist/lib/github.js +17 -0
- package/dist/lib/github.js.map +1 -1
- package/dist/lib/self-refresh-invocation.d.ts +60 -0
- package/dist/lib/self-refresh-invocation.d.ts.map +1 -0
- package/dist/lib/self-refresh-invocation.js +64 -0
- package/dist/lib/self-refresh-invocation.js.map +1 -0
- package/dist/lib/test-env.d.ts +50 -0
- package/dist/lib/test-env.d.ts.map +1 -1
- package/dist/lib/test-env.js +76 -0
- package/dist/lib/test-env.js.map +1 -1
- package/dist/terminal/attach-replay.d.ts +39 -0
- package/dist/terminal/attach-replay.d.ts.map +1 -0
- package/dist/terminal/attach-replay.js +76 -0
- package/dist/terminal/attach-replay.js.map +1 -0
- package/dist/terminal/pty-manager.d.ts.map +1 -1
- package/dist/terminal/pty-manager.js +35 -17
- package/dist/terminal/pty-manager.js.map +1 -1
- package/dist/terminal/pty-session.d.ts +81 -12
- package/dist/terminal/pty-session.d.ts.map +1 -1
- package/dist/terminal/pty-session.js +113 -25
- package/dist/terminal/pty-session.js.map +1 -1
- package/dist/terminal/session-screen.d.ts +25 -0
- package/dist/terminal/session-screen.d.ts.map +1 -1
- package/dist/terminal/session-screen.js +53 -8
- package/dist/terminal/session-screen.js.map +1 -1
- package/package.json +10 -7
- package/scripts/forge/gitea/pr-view.sh +4 -1
- package/scripts/forge/github/pr-view.sh +1 -1
- package/scripts/forge/gitlab/pr-view.sh +4 -1
- package/skeleton/.claude/skills/afx/SKILL.md +54 -0
- package/skeleton/.claude/skills/arch-save/SKILL.md +8 -2
- package/skeleton/.claude/skills/builder-refresh/SKILL.md +138 -0
- package/skeleton/.codex/skills/afx/SKILL.md +54 -0
- package/skeleton/.codex/skills/arch-save/SKILL.md +8 -2
- package/skeleton/.codex/skills/builder-refresh/SKILL.md +138 -0
- package/skeleton/protocol-schema.json +17 -0
- package/skeleton/protocols/air/protocol.json +1 -1
- package/skeleton/protocols/aspir/protocol.json +5 -1
- package/skeleton/protocols/bugfix/protocol.json +1 -1
- package/skeleton/protocols/experiment/protocol.json +1 -1
- package/skeleton/protocols/maintain/protocol.json +1 -1
- package/skeleton/protocols/pir/builder-prompt.md +3 -2
- package/skeleton/protocols/pir/prompts/implement.md +1 -1
- package/skeleton/protocols/pir/prompts/plan.md +1 -1
- package/skeleton/protocols/pir/prompts/review.md +1 -1
- package/skeleton/protocols/pir/protocol.json +1 -1
- package/skeleton/protocols/pir/protocol.md +4 -4
- package/skeleton/protocols/protocol-schema.json +17 -0
- package/skeleton/protocols/research/protocol.json +1 -1
- package/skeleton/protocols/spike/protocol.json +1 -1
- package/skeleton/protocols/spir/protocol.json +5 -1
- package/skeleton/resources/commands/agent-farm.md +14 -11
- package/skeleton/roles/builder.md +3 -4
- package/templates/3d-viewer.html +32 -4
- package/templates/open.html +58 -12
- package/templates/tower.html +26 -7
- package/templates/vendor/three-3MFLoader.js +1478 -0
- package/templates/vendor/three-STLLoader.js +410 -0
- package/templates/vendor/three-TrackballControls.js +828 -0
- package/templates/vendor/three-fflate.module.js +2474 -0
- package/templates/vendor/three.module.js +53044 -0
- package/dashboard-dist/assets/index-JCbkpAcV.js.map +0 -1
|
@@ -11,22 +11,21 @@
|
|
|
11
11
|
* be unit-tested without a live Tower, and lets `handleSend` and the drainer share
|
|
12
12
|
* exactly one delivery path (and one per-agent write serializer).
|
|
13
13
|
*/
|
|
14
|
-
import { readFileSync, existsSync, readdirSync } from 'node:fs';
|
|
15
14
|
import { homedir } from 'node:os';
|
|
16
15
|
import { loadConfig } from '../../lib/config.js';
|
|
17
16
|
import { terminalDeliverySignals } from '../../terminal/pty-session.js';
|
|
18
17
|
import { getWorkspaceTerminals, getTerminalManager } from './tower-terminals.js';
|
|
19
18
|
import { broadcastMessage, resolveAgentInRegistry, isResolveError } from './tower-messages.js';
|
|
20
|
-
import {
|
|
21
|
-
import { classifyBuffer } from './render-gate.js';
|
|
19
|
+
import { submitMessagePaced } from './message-write.js';
|
|
20
|
+
import { bufferLines, classifyBuffer } from './render-gate.js';
|
|
22
21
|
import { resolveProfile } from './gate-profiles.js';
|
|
23
|
-
import { harnessFromLaunchScript } from '../commands/reset/context.js';
|
|
22
|
+
import { buildContextFsPort, harnessFromLaunchScript, } from '../commands/reset/context.js';
|
|
24
23
|
import { getGlobalDb } from '../db/index.js';
|
|
25
24
|
import { getArchitectByName } from '../state.js';
|
|
26
25
|
import { formatBuilderMessage } from '../utils/message-format.js';
|
|
27
26
|
import { supersede as supersedeMailbox, dismissHeldWithKey, NOTICE_SUPERSEDE_PREFIX } from '../db/mailbox.js';
|
|
28
27
|
import path from 'node:path';
|
|
29
|
-
import { MailboxDrainer, } from './mailbox-delivery.js';
|
|
28
|
+
import { MailboxDrainer, normalizeForEcho, } from './mailbox-delivery.js';
|
|
30
29
|
/**
|
|
31
30
|
* "Recent output" window for the liveness diagnostic (Spec 1313, Phase 7 — spec line
|
|
32
31
|
* 91). A `no-profile` streak only raises the loud log/broadcast when the session emitted
|
|
@@ -42,31 +41,13 @@ export function setMailboxBroadcaster(fn) {
|
|
|
42
41
|
mailboxBroadcaster = fn;
|
|
43
42
|
}
|
|
44
43
|
/**
|
|
45
|
-
*
|
|
46
|
-
*
|
|
47
|
-
*
|
|
44
|
+
* The shared node-fs adapter for {@link ContextFsPort}.
|
|
45
|
+
*
|
|
46
|
+
* Was a hand-rolled copy — one of three identical ones. A stub in any copy
|
|
47
|
+
* silently nulls the porch context for that path, and a regression test can only
|
|
48
|
+
* observe the copy it imports, so the implementations are now one.
|
|
48
49
|
*/
|
|
49
|
-
const NODE_FS_PORT =
|
|
50
|
-
exists: (p) => existsSync(p),
|
|
51
|
-
read: (p) => {
|
|
52
|
-
try {
|
|
53
|
-
return readFileSync(p, 'utf-8');
|
|
54
|
-
}
|
|
55
|
-
catch {
|
|
56
|
-
return null;
|
|
57
|
-
}
|
|
58
|
-
},
|
|
59
|
-
listDirs: (p) => {
|
|
60
|
-
try {
|
|
61
|
-
return readdirSync(p, { withFileTypes: true })
|
|
62
|
-
.filter((d) => d.isDirectory())
|
|
63
|
-
.map((d) => d.name);
|
|
64
|
-
}
|
|
65
|
-
catch {
|
|
66
|
-
return null;
|
|
67
|
-
}
|
|
68
|
-
},
|
|
69
|
-
};
|
|
50
|
+
const NODE_FS_PORT = buildContextFsPort();
|
|
70
51
|
/**
|
|
71
52
|
* The live, writable {@link PtySession} for an agent in a workspace, or `null`
|
|
72
53
|
* when there is no usable live PTY — unknown agent, an exited session (the
|
|
@@ -117,7 +98,7 @@ export function resolveAgentForSession(sessionId) {
|
|
|
117
98
|
* The classifier profile for a session, resolving the wrapped-launch case. A real
|
|
118
99
|
* builder runs through `.builder-start.sh`, so `session.command` is the shell, not
|
|
119
100
|
* the agent, and the pure {@link resolveProfile} returns `null`. We then read the
|
|
120
|
-
* launch script (exactly as `afx
|
|
101
|
+
* launch script (exactly as `afx refresh` does) to recover the underlying harness
|
|
121
102
|
* command and resolve against that. Still `null` → the delivery holds `no-profile`
|
|
122
103
|
* (fail-safe by construction: an unknown agent is held and surfaced, never guessed
|
|
123
104
|
* — this is what correctly trips on wrapper/boot/relaunch screens too).
|
|
@@ -164,6 +145,78 @@ export async function classifyAgentScreen(session, profile) {
|
|
|
164
145
|
const { term, cols, rows } = await screen.read();
|
|
165
146
|
return classifyBuffer(term, cols, rows, profile);
|
|
166
147
|
}
|
|
148
|
+
/**
|
|
149
|
+
* How long {@link watchEchoOnScreen}'s verification waits for a delivered message's header to
|
|
150
|
+
* show up, and how often it re-reads while waiting (Issue #1573).
|
|
151
|
+
*
|
|
152
|
+
* Measured 2026-09-01 against live claude and codex PTYs: the header is on screen from the
|
|
153
|
+
* first sample after the write completes (the composer echoes it as it is typed, before the
|
|
154
|
+
* Enter that submits it), and remains present at every sample out to +5 s. The budget is
|
|
155
|
+
* therefore slack for a loaded machine, not the expected cost — the common case returns on the
|
|
156
|
+
* first read with no added latency. It is bounded because the `afx send` request path awaits
|
|
157
|
+
* this before answering the sender.
|
|
158
|
+
*/
|
|
159
|
+
const ECHO_VERIFY_TIMEOUT_MS = 600;
|
|
160
|
+
const ECHO_VERIFY_POLL_MS = 50;
|
|
161
|
+
/**
|
|
162
|
+
* How many times `needle` appears in the session's rendered mirror right now.
|
|
163
|
+
*
|
|
164
|
+
* A COUNT rather than a boolean because presence alone is not evidence (CMAP round 1 — codex):
|
|
165
|
+
* a previous delivery attempt's echo sits in the same scrollback, so "the header is on screen"
|
|
166
|
+
* would certify a retry whose bytes the composer swallowed. Comparing against a pre-write
|
|
167
|
+
* sample is what ties the evidence to the write that is being judged.
|
|
168
|
+
*
|
|
169
|
+
* Reads the SAME `SessionScreen` the render gate classifies, so verification and gating can
|
|
170
|
+
* never disagree about what the terminal shows, and scans its full retained buffer rather than
|
|
171
|
+
* the viewport — a long message scrolls its own header into scrollback while it types.
|
|
172
|
+
*/
|
|
173
|
+
async function countEchoOnScreen(screen, needle) {
|
|
174
|
+
const { term } = await screen.read();
|
|
175
|
+
const text = normalizeForEcho(bufferLines(term).join('\n'));
|
|
176
|
+
let count = 0;
|
|
177
|
+
for (let at = text.indexOf(needle); at !== -1; at = text.indexOf(needle, at + needle.length))
|
|
178
|
+
count++;
|
|
179
|
+
return count;
|
|
180
|
+
}
|
|
181
|
+
/**
|
|
182
|
+
* Open an echo watch on a session (Issue #1573) — the live binding for
|
|
183
|
+
* {@link DeliveryPorts.watchEcho}.
|
|
184
|
+
*
|
|
185
|
+
* Samples the terminal BEFORE the write, then `verify()` polls until the needle appears MORE
|
|
186
|
+
* often than it did in that sample. New evidence, not mere presence.
|
|
187
|
+
*
|
|
188
|
+
* A session with no mirror has produced no output and therefore cannot echo anything, so its
|
|
189
|
+
* watch verifies `false` rather than passing.
|
|
190
|
+
*
|
|
191
|
+
* Known residuals, all of which fail in the SAFE direction (a redelivery, never a dropped
|
|
192
|
+
* message), and none of which are designed around here:
|
|
193
|
+
* - a harness on the ALTERNATE screen buffer has no scrollback, so a message longer than one
|
|
194
|
+
* viewport can scroll its header out of reach and never confirm. The agy profile boots into
|
|
195
|
+
* the alternate buffer and was not measurable here (unauthenticated).
|
|
196
|
+
* - a very long write can evict the pre-write copy from the 1000-line mirror, so the count
|
|
197
|
+
* comes back equal rather than greater and a genuine delivery reads as unconfirmed.
|
|
198
|
+
* - an unconfirmed delivery re-reads and re-normalizes the retained buffer once per poll
|
|
199
|
+
* while the `afx send` request waits. Bounded by the timeout, and off the happy path
|
|
200
|
+
* entirely — the measured case confirms on the first read.
|
|
201
|
+
*/
|
|
202
|
+
export async function watchEchoOnScreen(session, needle) {
|
|
203
|
+
const screen = session.gateScreen;
|
|
204
|
+
if (!screen)
|
|
205
|
+
return { verify: () => Promise.resolve(false) };
|
|
206
|
+
const before = await countEchoOnScreen(screen, needle);
|
|
207
|
+
return {
|
|
208
|
+
verify: async () => {
|
|
209
|
+
const deadline = Date.now() + ECHO_VERIFY_TIMEOUT_MS;
|
|
210
|
+
for (;;) {
|
|
211
|
+
if (await countEchoOnScreen(screen, needle) > before)
|
|
212
|
+
return true;
|
|
213
|
+
if (Date.now() >= deadline)
|
|
214
|
+
return false;
|
|
215
|
+
await new Promise((resolve) => setTimeout(resolve, ECHO_VERIFY_POLL_MS));
|
|
216
|
+
}
|
|
217
|
+
},
|
|
218
|
+
};
|
|
219
|
+
}
|
|
167
220
|
/** Convert a delivered-message frame to the WebSocket bus shape and broadcast it. */
|
|
168
221
|
function broadcastDelivered(frame) {
|
|
169
222
|
broadcastMessage({
|
|
@@ -186,7 +239,14 @@ export function makeDeliveryPorts(log) {
|
|
|
186
239
|
getSessionForAgent: (ws, agent) => resolveLiveSessionForAgent(ws, agent),
|
|
187
240
|
resolveProfile: (session) => resolveProfileForSession(session),
|
|
188
241
|
classify: (session, profile) => classifyAgentScreen(session, profile),
|
|
189
|
-
|
|
242
|
+
// Issue #1365: the write edge takes the session's per-terminal submission lock as a
|
|
243
|
+
// LEAF inside the per-agent serializer, so a gated delivery and a concurrent
|
|
244
|
+
// `--interrupt`/`--escape` can no longer interleave. The precheck is the delivery
|
|
245
|
+
// module's, re-run inside that lock.
|
|
246
|
+
writeMessage: (session, msg, noEnter, precheck) => submitMessagePaced(session, msg, noEnter, precheck),
|
|
247
|
+
// Issue #1573: the only end-to-end evidence that the bytes reached the terminal — opened
|
|
248
|
+
// before the write, consulted before the row is marked delivered.
|
|
249
|
+
watchEcho: (session, needle) => watchEchoOnScreen(session, needle),
|
|
190
250
|
broadcast: (frame) => broadcastDelivered(frame),
|
|
191
251
|
onHeldStateChange: () => broadcastHeldStateChange(),
|
|
192
252
|
onEscalation: (info) => broadcastEscalation(info),
|
|
@@ -244,7 +304,7 @@ function escalateHeldToOwner(info, log) {
|
|
|
244
304
|
workspacePath: info.workspacePath,
|
|
245
305
|
toAgent: owner.agent,
|
|
246
306
|
body,
|
|
247
|
-
formattedMessage: formatBuilderMessage(NOTICE_SENDER, body),
|
|
307
|
+
formattedMessage: formatBuilderMessage(NOTICE_SENDER, owner.agent, body),
|
|
248
308
|
fromAgent: NOTICE_SENDER,
|
|
249
309
|
fromWorkspace: info.workspacePath,
|
|
250
310
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mailbox-wiring.js","sourceRoot":"","sources":["../../../src/agent-farm/servers/mailbox-wiring.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,EAAE,YAAY,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAChE,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAClC,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACjD,OAAO,EAAE,uBAAuB,EAAmB,MAAM,+BAA+B,CAAC;AACzF,OAAO,EAAE,qBAAqB,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AACjF,OAAO,EAAE,gBAAgB,EAAE,sBAAsB,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAC/F,OAAO,EA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ACF,qBAAqB,GAAG,OAAO,CAAC;IAChC,uBAAuB,CAAC,EAAE,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;IAC9C,uBAAuB,CAAC,EAAE,CAAC,YAAY,EAAE,OAAO,CAAC,CAAC;AACpD,CAAC;AAED,sFAAsF;AACtF,SAAS,0BAA0B;IACjC,IAAI,CAAC,qBAAqB;QAAE,OAAO;IACnC,uBAAuB,CAAC,GAAG,CAAC,QAAQ,EAAE,qBAAqB,CAAC,CAAC;IAC7D,uBAAuB,CAAC,GAAG,CAAC,YAAY,EAAE,qBAAqB,CAAC,CAAC;IACjE,qBAAqB,GAAG,SAAS,CAAC;AACpC,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,mBAAmB,CAAC,GAAU;IAC5C,aAAa,EAAE,CAAC,KAAK,CAAC,iBAAiB,CAAC,GAAG,CAAC,EAAE,WAAW,EAAE,CAAC,CAAC;IAC7D,wBAAwB,EAAE,CAAC;IAC3B,GAAG,CAAC,MAAM,EAAE,oCAAoC,CAAC,CAAC;AACpD,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,kBAAkB;IAChC,0BAA0B,EAAE,CAAC;IAC7B,OAAO,EAAE,IAAI,EAAE,CAAC;AAClB,CAAC;AAED,4EAA4E;AAC5E,MAAM,UAAU,iBAAiB;IAC/B,OAAO,aAAa,EAAE,CAAC;AACzB,CAAC"}
|
|
@@ -4,12 +4,13 @@
|
|
|
4
4
|
* Extracted to a shared module to avoid circular imports between
|
|
5
5
|
* tower-routes.ts and tower-cron.ts.
|
|
6
6
|
*/
|
|
7
|
+
import { type SubmitClock } from './session-submit.js';
|
|
7
8
|
/** Minimal writable session interface — avoids coupling to PtySession. */
|
|
8
9
|
export interface WritableSession {
|
|
9
10
|
/**
|
|
10
11
|
* Write input to the underlying PTY. Returns `false` when the write was dropped
|
|
11
12
|
* (#1198: a shellper-backed session whose socket has died still reports status
|
|
12
|
-
* 'running', yet its writes silently no-op). {@link
|
|
13
|
+
* 'running', yet its writes silently no-op). {@link submitMessagePaced} threads this
|
|
13
14
|
* boolean so a mailbox delivery whose bytes never reached the terminal is held, not
|
|
14
15
|
* marked delivered (Spec 1313 integration review — the silent-loss finding).
|
|
15
16
|
*/
|
|
@@ -53,24 +54,63 @@ export declare function writeEscapeToSession(session: WritableSession, noEnter:
|
|
|
53
54
|
*/
|
|
54
55
|
export declare function writeMessageToSession(session: WritableSession, message: string, noEnter: boolean, delayOffset?: number): number;
|
|
55
56
|
/**
|
|
56
|
-
*
|
|
57
|
-
*
|
|
58
|
-
* `
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
57
|
+
* Outcome of a {@link submitMessagePaced} attempt. Generic in the caller's own abort
|
|
58
|
+
* vocabulary so this module stays free of mailbox concepts — the delivery layer
|
|
59
|
+
* instantiates `A` with its hold reasons.
|
|
60
|
+
*/
|
|
61
|
+
export type PacedSubmitResult<A> =
|
|
62
|
+
/** The whole submit — text and, unless `noEnter`, the trailing Enter — reached the PTY. */
|
|
63
|
+
{
|
|
64
|
+
status: 'written';
|
|
65
|
+
}
|
|
66
|
+
/** #1198: a scheduled write was dropped mid-pace (the shellper socket died). */
|
|
67
|
+
| {
|
|
68
|
+
status: 'dropped';
|
|
69
|
+
}
|
|
70
|
+
/**
|
|
71
|
+
* The bytes went out, but an operator submission bypassed the lock while they did
|
|
72
|
+
* (the ceiling-expired degraded path), so this submit cannot be trusted to have
|
|
73
|
+
* landed intact.
|
|
74
|
+
*/
|
|
75
|
+
| {
|
|
76
|
+
status: 'preempted';
|
|
77
|
+
}
|
|
78
|
+
/** Another submission held the terminal. NOTHING was written; the caller may retry later. */
|
|
79
|
+
| {
|
|
80
|
+
status: 'contended';
|
|
81
|
+
}
|
|
82
|
+
/** The caller's in-lock precheck refused. NOTHING was written. */
|
|
83
|
+
| {
|
|
84
|
+
status: 'aborted';
|
|
85
|
+
abort: A;
|
|
86
|
+
};
|
|
87
|
+
/**
|
|
88
|
+
* Paced write of a message (text + trailing Enter unless `noEnter`) performed as ONE
|
|
89
|
+
* submission on the session's per-terminal lock (Issue #1365).
|
|
90
|
+
*
|
|
91
|
+
* This is the mailbox delivery path's write edge. Before #1365 it wrote directly, under
|
|
92
|
+
* the per-agent serializer only, so a gated delivery could interleave with a concurrent
|
|
93
|
+
* `--interrupt`/`--escape` on the same terminal: a `^C` or ESC landing between the text
|
|
94
|
+
* and its Enter cleared or truncated the composer while every byte still reported
|
|
95
|
+
* success, and the row was marked `delivered` for a message the agent never saw whole.
|
|
96
|
+
* Taking the same lock those paths take is what makes that impossible.
|
|
97
|
+
*
|
|
98
|
+
* Two properties are load-bearing and easy to lose in a refactor:
|
|
62
99
|
*
|
|
63
|
-
* `
|
|
64
|
-
*
|
|
65
|
-
*
|
|
66
|
-
*
|
|
67
|
-
*
|
|
68
|
-
*
|
|
69
|
-
* executes first and its result is observed by resolution time.
|
|
100
|
+
* - **`precheck` runs INSIDE the lock**, immediately before the first byte. Acquiring
|
|
101
|
+
* the lock without it would merely move the race: a delivery that classified a clean
|
|
102
|
+
* screen, then waited behind another submission, would write onto the screen that
|
|
103
|
+
* submission just changed. Returning non-null aborts with nothing written.
|
|
104
|
+
* - **Contention is declined, not queued** (see {@link trySubmitToSession}). The gated
|
|
105
|
+
* delivery path must never block, because the drainer walks agents sequentially.
|
|
70
106
|
*
|
|
71
|
-
*
|
|
72
|
-
*
|
|
73
|
-
*
|
|
107
|
+
* The completion semantics callers depend on are unchanged from the pre-#1365
|
|
108
|
+
* `writeMessagePaced`: the returned promise resolves only after the trailing Enter has
|
|
109
|
+
* been written. `writeMessageToSession` registers the Enter's `setTimeout` before
|
|
110
|
+
* `submitToSession` schedules its own equal-offset sleep, so the Enter still executes
|
|
111
|
+
* first — which is what makes the per-agent serializer's completion-chaining real.
|
|
74
112
|
*/
|
|
75
|
-
export declare function
|
|
113
|
+
export declare function submitMessagePaced<A>(session: WritableSession & {
|
|
114
|
+
id: string;
|
|
115
|
+
}, message: string, noEnter: boolean, precheck: () => A | null, clock?: SubmitClock): Promise<PacedSubmitResult<A>>;
|
|
76
116
|
//# sourceMappingURL=message-write.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"message-write.d.ts","sourceRoot":"","sources":["../../../src/agent-farm/servers/message-write.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,0EAA0E;AAC1E,MAAM,WAAW,eAAe;IAC9B;;;;;;OAMG;IACH,KAAK,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC;CAC9B;AAUD,iEAAiE;AACjE,eAAO,MAAM,GAAG,WAAS,CAAC;AAE1B;;;GAGG;AACH,eAAO,MAAM,qBAAqB,KAAwB,CAAC;AAE3D;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,eAAe,EAAE,OAAO,EAAE,OAAO,GAAG,MAAM,CAKvF;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,qBAAqB,CACnC,OAAO,EAAE,eAAe,EAAE,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,WAAW,SAAI,GAC3E,MAAM,CAqCR;AAED
|
|
1
|
+
{"version":3,"file":"message-write.d.ts","sourceRoot":"","sources":["../../../src/agent-farm/servers/message-write.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAqC,KAAK,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAE1F,0EAA0E;AAC1E,MAAM,WAAW,eAAe;IAC9B;;;;;;OAMG;IACH,KAAK,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC;CAC9B;AAUD,iEAAiE;AACjE,eAAO,MAAM,GAAG,WAAS,CAAC;AAE1B;;;GAGG;AACH,eAAO,MAAM,qBAAqB,KAAwB,CAAC;AAE3D;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,eAAe,EAAE,OAAO,EAAE,OAAO,GAAG,MAAM,CAKvF;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,qBAAqB,CACnC,OAAO,EAAE,eAAe,EAAE,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,WAAW,SAAI,GAC3E,MAAM,CAqCR;AAED;;;;GAIG;AACH,MAAM,MAAM,iBAAiB,CAAC,CAAC;AAC7B,2FAA2F;AACzF;IAAE,MAAM,EAAE,SAAS,CAAA;CAAE;AACvB,gFAAgF;GAC9E;IAAE,MAAM,EAAE,SAAS,CAAA;CAAE;AACvB;;;;GAIG;GACD;IAAE,MAAM,EAAE,WAAW,CAAA;CAAE;AACzB,6FAA6F;GAC3F;IAAE,MAAM,EAAE,WAAW,CAAA;CAAE;AACzB,kEAAkE;GAChE;IAAE,MAAM,EAAE,SAAS,CAAC;IAAC,KAAK,EAAE,CAAC,CAAA;CAAE,CAAC;AAEpC;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,wBAAsB,kBAAkB,CAAC,CAAC,EACxC,OAAO,EAAE,eAAe,GAAG;IAAE,EAAE,EAAE,MAAM,CAAA;CAAE,EACzC,OAAO,EAAE,MAAM,EACf,OAAO,EAAE,OAAO,EAChB,QAAQ,EAAE,MAAM,CAAC,GAAG,IAAI,EACxB,KAAK,CAAC,EAAE,WAAW,GAClB,OAAO,CAAC,iBAAiB,CAAC,CAAC,CAAC,CAAC,CAkD/B"}
|
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
* Extracted to a shared module to avoid circular imports between
|
|
5
5
|
* tower-routes.ts and tower-cron.ts.
|
|
6
6
|
*/
|
|
7
|
+
import { trySubmitToSession, watchBypasses } from './session-submit.js';
|
|
7
8
|
// Messages longer than this threshold are written line-by-line with delays
|
|
8
9
|
// to prevent the receiving terminal from classifying the input as a paste
|
|
9
10
|
// and swallowing the final Enter.
|
|
@@ -91,36 +92,80 @@ export function writeMessageToSession(session, message, noEnter, delayOffset = 0
|
|
|
91
92
|
return lastLineTime;
|
|
92
93
|
}
|
|
93
94
|
/**
|
|
94
|
-
* Paced write of a message (text + trailing Enter unless `noEnter`)
|
|
95
|
-
*
|
|
96
|
-
* `false` when ANY scheduled write was dropped (#1198: a shellper socket that died
|
|
97
|
-
* mid-pace). This is the delivery layer's authoritative success signal — a mailbox
|
|
98
|
-
* delivery holds a row whose bytes never made it instead of marking it delivered
|
|
99
|
-
* (Spec 1313 integration review — the silent-loss finding).
|
|
95
|
+
* Paced write of a message (text + trailing Enter unless `noEnter`) performed as ONE
|
|
96
|
+
* submission on the session's per-terminal lock (Issue #1365).
|
|
100
97
|
*
|
|
101
|
-
*
|
|
102
|
-
*
|
|
103
|
-
*
|
|
104
|
-
*
|
|
105
|
-
*
|
|
106
|
-
*
|
|
107
|
-
* executes first and its result is observed by resolution time.
|
|
98
|
+
* This is the mailbox delivery path's write edge. Before #1365 it wrote directly, under
|
|
99
|
+
* the per-agent serializer only, so a gated delivery could interleave with a concurrent
|
|
100
|
+
* `--interrupt`/`--escape` on the same terminal: a `^C` or ESC landing between the text
|
|
101
|
+
* and its Enter cleared or truncated the composer while every byte still reported
|
|
102
|
+
* success, and the row was marked `delivered` for a message the agent never saw whole.
|
|
103
|
+
* Taking the same lock those paths take is what makes that impossible.
|
|
108
104
|
*
|
|
109
|
-
*
|
|
110
|
-
*
|
|
111
|
-
*
|
|
105
|
+
* Two properties are load-bearing and easy to lose in a refactor:
|
|
106
|
+
*
|
|
107
|
+
* - **`precheck` runs INSIDE the lock**, immediately before the first byte. Acquiring
|
|
108
|
+
* the lock without it would merely move the race: a delivery that classified a clean
|
|
109
|
+
* screen, then waited behind another submission, would write onto the screen that
|
|
110
|
+
* submission just changed. Returning non-null aborts with nothing written.
|
|
111
|
+
* - **Contention is declined, not queued** (see {@link trySubmitToSession}). The gated
|
|
112
|
+
* delivery path must never block, because the drainer walks agents sequentially.
|
|
113
|
+
*
|
|
114
|
+
* The completion semantics callers depend on are unchanged from the pre-#1365
|
|
115
|
+
* `writeMessagePaced`: the returned promise resolves only after the trailing Enter has
|
|
116
|
+
* been written. `writeMessageToSession` registers the Enter's `setTimeout` before
|
|
117
|
+
* `submitToSession` schedules its own equal-offset sleep, so the Enter still executes
|
|
118
|
+
* first — which is what makes the per-agent serializer's completion-chaining real.
|
|
112
119
|
*/
|
|
113
|
-
export function
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
120
|
+
export async function submitMessagePaced(session, message, noEnter, precheck, clock) {
|
|
121
|
+
// Fail LOUD on a missing id rather than keying the lock on `undefined`. Sessions reach
|
|
122
|
+
// this through structurally-typed ports, so a double without an id compiles fine and
|
|
123
|
+
// would silently collapse every per-terminal lock into one global lock — serialization
|
|
124
|
+
// that looks present and is not. A throw here surfaces as a held row (the delivery path
|
|
125
|
+
// never marks a row delivered on a throw), which is the safe failure.
|
|
126
|
+
if (typeof session.id !== 'string' || session.id === '') {
|
|
127
|
+
throw new Error('submitMessagePaced: session.id must be a non-empty string (the per-terminal lock key)');
|
|
128
|
+
}
|
|
129
|
+
// The one thing the lock cannot stop is an operator submission whose wait ceiling expired
|
|
130
|
+
// and wrote anyway. Watch the session's degraded-write counter across our own submission:
|
|
131
|
+
// a bump means a `^C`/ESC bypassed us mid-write, so the composer may have been cleared or
|
|
132
|
+
// truncated under our bytes. Cheaper and more direct than re-classifying the screen — and it
|
|
133
|
+
// is the difference between re-holding the row and falsely reporting a delivery, which is
|
|
134
|
+
// the whole point of Issue #1365. The watch also pins the counter against eviction for
|
|
135
|
+
// exactly as long as we need to compare it; `finally` is what keeps that pin from leaking.
|
|
136
|
+
const bypasses = watchBypasses(session.id);
|
|
137
|
+
try {
|
|
138
|
+
let delivered = true;
|
|
139
|
+
let abort = null;
|
|
140
|
+
const tracked = {
|
|
141
|
+
write: (data) => {
|
|
142
|
+
const ok = session.write(data);
|
|
143
|
+
if (!ok)
|
|
144
|
+
delivered = false;
|
|
145
|
+
return ok;
|
|
146
|
+
},
|
|
147
|
+
};
|
|
148
|
+
const ran = await trySubmitToSession(session.id, () => {
|
|
149
|
+
abort = precheck();
|
|
150
|
+
if (abort !== null)
|
|
151
|
+
return 0; // refused in-lock: not one byte goes out
|
|
152
|
+
return writeMessageToSession(tracked, message, noEnter);
|
|
153
|
+
}, clock);
|
|
154
|
+
if (!ran)
|
|
155
|
+
return { status: 'contended' };
|
|
156
|
+
// Read through a cast: both flags are assigned inside the callback above, which
|
|
157
|
+
// TypeScript's flow analysis does not track back to this scope.
|
|
158
|
+
const refused = abort;
|
|
159
|
+
if (refused !== null)
|
|
160
|
+
return { status: 'aborted', abort: refused };
|
|
161
|
+
if (!delivered)
|
|
162
|
+
return { status: 'dropped' };
|
|
163
|
+
if (bypasses.raced())
|
|
164
|
+
return { status: 'preempted' };
|
|
165
|
+
return { status: 'written' };
|
|
166
|
+
}
|
|
167
|
+
finally {
|
|
168
|
+
bypasses.release();
|
|
169
|
+
}
|
|
125
170
|
}
|
|
126
171
|
//# sourceMappingURL=message-write.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"message-write.js","sourceRoot":"","sources":["../../../src/agent-farm/servers/message-write.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;
|
|
1
|
+
{"version":3,"file":"message-write.js","sourceRoot":"","sources":["../../../src/agent-farm/servers/message-write.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,kBAAkB,EAAE,aAAa,EAAoB,MAAM,qBAAqB,CAAC;AAc1F,2EAA2E;AAC3E,0EAA0E;AAC1E,kCAAkC;AAClC,MAAM,0BAA0B,GAAG,CAAC,CAAC;AACrC,MAAM,mBAAmB,GAAG,EAAE,CAAC;AAC/B,MAAM,oBAAoB,GAAG,EAAE,CAAC;AAChC,MAAM,qBAAqB,GAAG,EAAE,CAAC;AAEjC,iEAAiE;AACjE,MAAM,CAAC,MAAM,GAAG,GAAG,MAAM,CAAC;AAE1B;;;GAGG;AACH,MAA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AE,CAAC;IACrB,CAAC;AACH,CAAC"}
|
|
@@ -138,6 +138,25 @@ export declare function extractProjectIdFromWorktreeName(dirName: string): strin
|
|
|
138
138
|
* Discover builders by scanning .builders/ directory and reading status.yaml.
|
|
139
139
|
*/
|
|
140
140
|
export declare function discoverBuilders(workspaceRoot: string): OverviewBuilder[];
|
|
141
|
+
/**
|
|
142
|
+
* Count a builder's pending review-comments by reading its queue file
|
|
143
|
+
* (`<worktree>/.codev/pending-comments.json`, the single source of truth the
|
|
144
|
+
* VSCode ReviewQueueStore owns, #1037). This is a READ of that file, never a
|
|
145
|
+
* write — the same pattern `discoverBuilders` uses to read worktree state.
|
|
146
|
+
* Tolerant: a missing / unreadable / corrupt file, or a non-array `comments`,
|
|
147
|
+
* reads as 0. Returns the count only, never bodies (#1410).
|
|
148
|
+
*/
|
|
149
|
+
export declare function countQueuedFeedback(worktreePath: string): number;
|
|
150
|
+
/**
|
|
151
|
+
* The workspace's review-feedback delivery mode, read from the VSCode
|
|
152
|
+
* `codev.diffCodelensMode` workspace setting in `<root>/.vscode/settings.json`
|
|
153
|
+
* (`comment` → `'queue'`; anything else, or unreadable, → `'forward'`, matching
|
|
154
|
+
* VSCode's own default). Single-folder workspaces only — a multi-root
|
|
155
|
+
* `.code-workspace` or a user-level override isn't at this path and reads as the
|
|
156
|
+
* default. Tolerant of the JSONC (comments / trailing commas) VSCode may leave
|
|
157
|
+
* in the file: strict parse first, then a comment-stripped retry (#1410).
|
|
158
|
+
*/
|
|
159
|
+
export declare function readFeedbackMode(workspaceRoot: string): 'forward' | 'queue';
|
|
141
160
|
/**
|
|
142
161
|
* Derive backlog from open GitHub issues cross-referenced with specs and builders.
|
|
143
162
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"overview.d.ts","sourceRoot":"","sources":["../../../src/agent-farm/servers/overview.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAeH,OAAO,KAAK,EAAW,kBAAkB,EAAE,MAAM,qBAA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EAAE,GAAG,CAAC,MAAM,CAAC,GAAG,OAAO,CAAC,YAAY,CAAC;IAqNnG;;OAEG;IACH,UAAU,IAAI,IAAI;YAgBJ,cAAc;YAcd,iBAAiB;IAc/B;;;;;OAKG;YACW,sBAAsB;YActB,yBAAyB;YAczB,oBAAoB;CAanC"}
|
|
@@ -660,6 +660,66 @@ function scanArtifactDir(dirPath) {
|
|
|
660
660
|
}
|
|
661
661
|
return result;
|
|
662
662
|
}
|
|
663
|
+
/**
|
|
664
|
+
* Count a builder's pending review-comments by reading its queue file
|
|
665
|
+
* (`<worktree>/.codev/pending-comments.json`, the single source of truth the
|
|
666
|
+
* VSCode ReviewQueueStore owns, #1037). This is a READ of that file, never a
|
|
667
|
+
* write — the same pattern `discoverBuilders` uses to read worktree state.
|
|
668
|
+
* Tolerant: a missing / unreadable / corrupt file, or a non-array `comments`,
|
|
669
|
+
* reads as 0. Returns the count only, never bodies (#1410).
|
|
670
|
+
*/
|
|
671
|
+
export function countQueuedFeedback(worktreePath) {
|
|
672
|
+
try {
|
|
673
|
+
const raw = fs.readFileSync(path.join(worktreePath, '.codev', 'pending-comments.json'), 'utf8');
|
|
674
|
+
const data = JSON.parse(raw);
|
|
675
|
+
return Array.isArray(data.comments) ? data.comments.length : 0;
|
|
676
|
+
}
|
|
677
|
+
catch {
|
|
678
|
+
return 0;
|
|
679
|
+
}
|
|
680
|
+
}
|
|
681
|
+
/**
|
|
682
|
+
* The workspace's review-feedback delivery mode, read from the VSCode
|
|
683
|
+
* `codev.diffCodelensMode` workspace setting in `<root>/.vscode/settings.json`
|
|
684
|
+
* (`comment` → `'queue'`; anything else, or unreadable, → `'forward'`, matching
|
|
685
|
+
* VSCode's own default). Single-folder workspaces only — a multi-root
|
|
686
|
+
* `.code-workspace` or a user-level override isn't at this path and reads as the
|
|
687
|
+
* default. Tolerant of the JSONC (comments / trailing commas) VSCode may leave
|
|
688
|
+
* in the file: strict parse first, then a comment-stripped retry (#1410).
|
|
689
|
+
*/
|
|
690
|
+
export function readFeedbackMode(workspaceRoot) {
|
|
691
|
+
let raw;
|
|
692
|
+
try {
|
|
693
|
+
raw = fs.readFileSync(path.join(workspaceRoot, '.vscode', 'settings.json'), 'utf8');
|
|
694
|
+
}
|
|
695
|
+
catch {
|
|
696
|
+
return 'forward'; // no settings file — the setting is at its default
|
|
697
|
+
}
|
|
698
|
+
const value = readSettingValue(raw, 'codev.diffCodelensMode');
|
|
699
|
+
return value === 'comment' ? 'queue' : 'forward';
|
|
700
|
+
}
|
|
701
|
+
/** Parse a settings.json string (strict, then JSONC-tolerant) and return one
|
|
702
|
+
* key's value, or `undefined` when the file can't be parsed or lacks the key. */
|
|
703
|
+
function readSettingValue(raw, key) {
|
|
704
|
+
for (const candidate of [raw, stripJsonComments(raw)]) {
|
|
705
|
+
try {
|
|
706
|
+
const data = JSON.parse(candidate);
|
|
707
|
+
return data[key];
|
|
708
|
+
}
|
|
709
|
+
catch {
|
|
710
|
+
// try the next candidate
|
|
711
|
+
}
|
|
712
|
+
}
|
|
713
|
+
return undefined;
|
|
714
|
+
}
|
|
715
|
+
/** Minimal JSONC → JSON: drop block/line comments and trailing commas. Good
|
|
716
|
+
* enough for a best-effort settings read (not a general JSONC parser). */
|
|
717
|
+
function stripJsonComments(raw) {
|
|
718
|
+
return raw
|
|
719
|
+
.replace(/\/\*[\s\S]*?\*\//g, '') // block comments
|
|
720
|
+
.replace(/(^|[^:"])\/\/.*$/gm, '$1') // line comments (leave `://` in URLs)
|
|
721
|
+
.replace(/,(\s*[}\]])/g, '$1'); // trailing commas
|
|
722
|
+
}
|
|
663
723
|
/**
|
|
664
724
|
* Derive backlog from open GitHub issues cross-referenced with specs and builders.
|
|
665
725
|
*/
|
|
@@ -896,12 +956,29 @@ export class OverviewCache {
|
|
|
896
956
|
item.reviewPath = `codev/reviews/${reviewFile}`;
|
|
897
957
|
return item;
|
|
898
958
|
});
|
|
959
|
+
// Forge search APIs return relevance ("best match") order, not closure
|
|
960
|
+
// order, so sort most-recently-closed first here: one fix for every
|
|
961
|
+
// forge, since `closedAt` is present on every item (issue #1191). Parse to
|
|
962
|
+
// epoch millis rather than compare strings: provider scripts aren't
|
|
963
|
+
// guaranteed to emit a normalized ISO form, matching the 24h-window filter.
|
|
964
|
+
recentlyClosed.sort((a, b) => new Date(b.closedAt).getTime() - new Date(a.closedAt).getTime());
|
|
965
|
+
}
|
|
966
|
+
// Per-builder queued-feedback counts (#1410): read each builder's pending
|
|
967
|
+
// review-comment queue file. Only non-zero entries are carried, so the map
|
|
968
|
+
// stays `{}` when nothing is queued anywhere; a builder absent from it reads
|
|
969
|
+
// as 0 on every consumer.
|
|
970
|
+
const queuedFeedback = {};
|
|
971
|
+
for (const b of builders) {
|
|
972
|
+
const count = countQueuedFeedback(b.worktreePath);
|
|
973
|
+
if (count > 0)
|
|
974
|
+
queuedFeedback[b.id] = count;
|
|
899
975
|
}
|
|
976
|
+
const feedbackMode = readFeedbackMode(workspaceRoot);
|
|
900
977
|
// `architects` defaults to `[]` here — the filesystem/git-derived overview
|
|
901
978
|
// has no view of the live terminal sessions. `handleOverview` (tower-routes.ts)
|
|
902
979
|
// injects the real architect list via `liveArchitects` before serialization,
|
|
903
980
|
// mirroring how it enriches `lastDataAt`.
|
|
904
|
-
const result = { builders, pendingPRs, backlog, recentlyClosed, architects: [], heldCount, mailboxEscalated };
|
|
981
|
+
const result = { builders, pendingPRs, backlog, recentlyClosed, architects: [], heldCount, mailboxEscalated, queuedFeedback, feedbackMode };
|
|
905
982
|
if (currentUser) {
|
|
906
983
|
result.currentUser = currentUser;
|
|
907
984
|
}
|