@cluesmith/codev 3.3.1 → 3.3.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (248) hide show
  1. package/dashboard-dist/assets/{index-D3XaKpZW.js → index-CUIjS_Vb.js} +41 -41
  2. package/dashboard-dist/assets/index-CUIjS_Vb.js.map +1 -0
  3. package/dashboard-dist/assets/index-DnYLy5C_.css +32 -0
  4. package/dashboard-dist/index.html +2 -2
  5. package/dist/agent-farm/cli.d.ts.map +1 -1
  6. package/dist/agent-farm/cli.js +52 -1
  7. package/dist/agent-farm/cli.js.map +1 -1
  8. package/dist/agent-farm/commands/inbox.d.ts.map +1 -1
  9. package/dist/agent-farm/commands/inbox.js +67 -10
  10. package/dist/agent-farm/commands/inbox.js.map +1 -1
  11. package/dist/agent-farm/commands/interrupt.d.ts +4 -1
  12. package/dist/agent-farm/commands/interrupt.d.ts.map +1 -1
  13. package/dist/agent-farm/commands/interrupt.js +6 -3
  14. package/dist/agent-farm/commands/interrupt.js.map +1 -1
  15. package/dist/agent-farm/commands/reset/constants.d.ts +118 -0
  16. package/dist/agent-farm/commands/reset/constants.d.ts.map +1 -1
  17. package/dist/agent-farm/commands/reset/constants.js +118 -0
  18. package/dist/agent-farm/commands/reset/constants.js.map +1 -1
  19. package/dist/agent-farm/commands/reset/context.d.ts +18 -0
  20. package/dist/agent-farm/commands/reset/context.d.ts.map +1 -1
  21. package/dist/agent-farm/commands/reset/context.js +41 -0
  22. package/dist/agent-farm/commands/reset/context.js.map +1 -1
  23. package/dist/agent-farm/commands/reset/receipt.d.ts.map +1 -1
  24. package/dist/agent-farm/commands/reset/receipt.js +16 -5
  25. package/dist/agent-farm/commands/reset/receipt.js.map +1 -1
  26. package/dist/agent-farm/commands/reset/reorient.d.ts +1 -1
  27. package/dist/agent-farm/commands/reset/reorient.d.ts.map +1 -1
  28. package/dist/agent-farm/commands/reset/reorient.js +8 -1
  29. package/dist/agent-farm/commands/reset/reorient.js.map +1 -1
  30. package/dist/agent-farm/commands/reset/self.d.ts +335 -0
  31. package/dist/agent-farm/commands/reset/self.d.ts.map +1 -0
  32. package/dist/agent-farm/commands/reset/self.js +636 -0
  33. package/dist/agent-farm/commands/reset/self.js.map +1 -0
  34. package/dist/agent-farm/commands/reset.d.ts +4 -1
  35. package/dist/agent-farm/commands/reset.d.ts.map +1 -1
  36. package/dist/agent-farm/commands/reset.js +29 -21
  37. package/dist/agent-farm/commands/reset.js.map +1 -1
  38. package/dist/agent-farm/commands/self-refresh.d.ts +60 -0
  39. package/dist/agent-farm/commands/self-refresh.d.ts.map +1 -0
  40. package/dist/agent-farm/commands/self-refresh.js +506 -0
  41. package/dist/agent-farm/commands/self-refresh.js.map +1 -0
  42. package/dist/agent-farm/commands/send.d.ts +28 -0
  43. package/dist/agent-farm/commands/send.d.ts.map +1 -1
  44. package/dist/agent-farm/commands/send.js +90 -7
  45. package/dist/agent-farm/commands/send.js.map +1 -1
  46. package/dist/agent-farm/commands/spawn.d.ts +7 -0
  47. package/dist/agent-farm/commands/spawn.d.ts.map +1 -1
  48. package/dist/agent-farm/commands/spawn.js +13 -1
  49. package/dist/agent-farm/commands/spawn.js.map +1 -1
  50. package/dist/agent-farm/db/index.d.ts +3 -1
  51. package/dist/agent-farm/db/index.d.ts.map +1 -1
  52. package/dist/agent-farm/db/index.js +8 -443
  53. package/dist/agent-farm/db/index.js.map +1 -1
  54. package/dist/agent-farm/db/mailbox.d.ts +47 -7
  55. package/dist/agent-farm/db/mailbox.d.ts.map +1 -1
  56. package/dist/agent-farm/db/mailbox.js +56 -12
  57. package/dist/agent-farm/db/mailbox.js.map +1 -1
  58. package/dist/agent-farm/db/migrations.d.ts +57 -0
  59. package/dist/agent-farm/db/migrations.d.ts.map +1 -0
  60. package/dist/agent-farm/db/migrations.js +530 -0
  61. package/dist/agent-farm/db/migrations.js.map +1 -0
  62. package/dist/agent-farm/db/schema.d.ts +1 -1
  63. package/dist/agent-farm/db/schema.d.ts.map +1 -1
  64. package/dist/agent-farm/db/schema.js +1 -0
  65. package/dist/agent-farm/db/schema.js.map +1 -1
  66. package/dist/agent-farm/db/types.d.ts +22 -0
  67. package/dist/agent-farm/db/types.d.ts.map +1 -1
  68. package/dist/agent-farm/db/types.js.map +1 -1
  69. package/dist/agent-farm/lib/tower-client.d.ts +12 -0
  70. package/dist/agent-farm/lib/tower-client.d.ts.map +1 -1
  71. package/dist/agent-farm/lib/tower-client.js +12 -0
  72. package/dist/agent-farm/lib/tower-client.js.map +1 -1
  73. package/dist/agent-farm/lib/tunnel-client.d.ts.map +1 -1
  74. package/dist/agent-farm/lib/tunnel-client.js +43 -14
  75. package/dist/agent-farm/lib/tunnel-client.js.map +1 -1
  76. package/dist/agent-farm/servers/cron-delivery.d.ts +7 -1
  77. package/dist/agent-farm/servers/cron-delivery.d.ts.map +1 -1
  78. package/dist/agent-farm/servers/cron-delivery.js +2 -1
  79. package/dist/agent-farm/servers/cron-delivery.js.map +1 -1
  80. package/dist/agent-farm/servers/gate-profiles.d.ts +21 -0
  81. package/dist/agent-farm/servers/gate-profiles.d.ts.map +1 -1
  82. package/dist/agent-farm/servers/gate-profiles.js +36 -4
  83. package/dist/agent-farm/servers/gate-profiles.js.map +1 -1
  84. package/dist/agent-farm/servers/mailbox-delivery.d.ts +218 -15
  85. package/dist/agent-farm/servers/mailbox-delivery.d.ts.map +1 -1
  86. package/dist/agent-farm/servers/mailbox-delivery.js +259 -27
  87. package/dist/agent-farm/servers/mailbox-delivery.js.map +1 -1
  88. package/dist/agent-farm/servers/mailbox-wiring.d.ts +66 -11
  89. package/dist/agent-farm/servers/mailbox-wiring.d.ts.map +1 -1
  90. package/dist/agent-farm/servers/mailbox-wiring.js +202 -48
  91. package/dist/agent-farm/servers/mailbox-wiring.js.map +1 -1
  92. package/dist/agent-farm/servers/message-write.d.ts +58 -18
  93. package/dist/agent-farm/servers/message-write.d.ts.map +1 -1
  94. package/dist/agent-farm/servers/message-write.js +73 -28
  95. package/dist/agent-farm/servers/message-write.js.map +1 -1
  96. package/dist/agent-farm/servers/render-gate.d.ts +37 -1
  97. package/dist/agent-farm/servers/render-gate.d.ts.map +1 -1
  98. package/dist/agent-farm/servers/render-gate.js +71 -12
  99. package/dist/agent-farm/servers/render-gate.js.map +1 -1
  100. package/dist/agent-farm/servers/session-submit.d.ts +220 -27
  101. package/dist/agent-farm/servers/session-submit.d.ts.map +1 -1
  102. package/dist/agent-farm/servers/session-submit.js +333 -42
  103. package/dist/agent-farm/servers/session-submit.js.map +1 -1
  104. package/dist/agent-farm/servers/tower-cron.d.ts.map +1 -1
  105. package/dist/agent-farm/servers/tower-cron.js +3 -2
  106. package/dist/agent-farm/servers/tower-cron.js.map +1 -1
  107. package/dist/agent-farm/servers/tower-instances.d.ts.map +1 -1
  108. package/dist/agent-farm/servers/tower-instances.js +11 -3
  109. package/dist/agent-farm/servers/tower-instances.js.map +1 -1
  110. package/dist/agent-farm/servers/tower-routes.d.ts +32 -0
  111. package/dist/agent-farm/servers/tower-routes.d.ts.map +1 -1
  112. package/dist/agent-farm/servers/tower-routes.js +245 -36
  113. package/dist/agent-farm/servers/tower-routes.js.map +1 -1
  114. package/dist/agent-farm/servers/tower-server.js +15 -2
  115. package/dist/agent-farm/servers/tower-server.js.map +1 -1
  116. package/dist/agent-farm/servers/tower-terminals.d.ts +21 -0
  117. package/dist/agent-farm/servers/tower-terminals.d.ts.map +1 -1
  118. package/dist/agent-farm/servers/tower-terminals.js +53 -5
  119. package/dist/agent-farm/servers/tower-terminals.js.map +1 -1
  120. package/dist/agent-farm/servers/tower-tunnel.d.ts.map +1 -1
  121. package/dist/agent-farm/servers/tower-tunnel.js +14 -0
  122. package/dist/agent-farm/servers/tower-tunnel.js.map +1 -1
  123. package/dist/agent-farm/servers/tower-utils.d.ts +35 -0
  124. package/dist/agent-farm/servers/tower-utils.d.ts.map +1 -1
  125. package/dist/agent-farm/servers/tower-utils.js +39 -0
  126. package/dist/agent-farm/servers/tower-utils.js.map +1 -1
  127. package/dist/agent-farm/servers/tower-websocket.d.ts.map +1 -1
  128. package/dist/agent-farm/servers/tower-websocket.js +8 -1
  129. package/dist/agent-farm/servers/tower-websocket.js.map +1 -1
  130. package/dist/agent-farm/types.d.ts +36 -1
  131. package/dist/agent-farm/types.d.ts.map +1 -1
  132. package/dist/agent-farm/utils/message-format.d.ts +136 -4
  133. package/dist/agent-farm/utils/message-format.d.ts.map +1 -1
  134. package/dist/agent-farm/utils/message-format.js +212 -22
  135. package/dist/agent-farm/utils/message-format.js.map +1 -1
  136. package/dist/agent-farm/utils/server-utils.d.ts +8 -2
  137. package/dist/agent-farm/utils/server-utils.d.ts.map +1 -1
  138. package/dist/agent-farm/utils/server-utils.js +19 -2
  139. package/dist/agent-farm/utils/server-utils.js.map +1 -1
  140. package/dist/cli.d.ts.map +1 -1
  141. package/dist/cli.js +3 -1
  142. package/dist/cli.js.map +1 -1
  143. package/dist/commands/doctor.js +2 -2
  144. package/dist/commands/generate-image.d.ts +20 -1
  145. package/dist/commands/generate-image.d.ts.map +1 -1
  146. package/dist/commands/generate-image.js +188 -1
  147. package/dist/commands/generate-image.js.map +1 -1
  148. package/dist/commands/porch/context-refresh.d.ts +181 -0
  149. package/dist/commands/porch/context-refresh.d.ts.map +1 -0
  150. package/dist/commands/porch/context-refresh.js +270 -0
  151. package/dist/commands/porch/context-refresh.js.map +1 -0
  152. package/dist/commands/porch/index.d.ts +6 -0
  153. package/dist/commands/porch/index.d.ts.map +1 -1
  154. package/dist/commands/porch/index.js +46 -0
  155. package/dist/commands/porch/index.js.map +1 -1
  156. package/dist/commands/porch/next.d.ts +0 -9
  157. package/dist/commands/porch/next.d.ts.map +1 -1
  158. package/dist/commands/porch/next.js +133 -4
  159. package/dist/commands/porch/next.js.map +1 -1
  160. package/dist/commands/porch/prompts.d.ts.map +1 -1
  161. package/dist/commands/porch/prompts.js +18 -2
  162. package/dist/commands/porch/prompts.js.map +1 -1
  163. package/dist/commands/porch/protocol.d.ts.map +1 -1
  164. package/dist/commands/porch/protocol.js +102 -0
  165. package/dist/commands/porch/protocol.js.map +1 -1
  166. package/dist/commands/porch/types.d.ts +61 -0
  167. package/dist/commands/porch/types.d.ts.map +1 -1
  168. package/dist/lib/forge-contracts.d.ts +66 -5
  169. package/dist/lib/forge-contracts.d.ts.map +1 -1
  170. package/dist/lib/forge-contracts.js.map +1 -1
  171. package/dist/lib/forge.d.ts +1 -1
  172. package/dist/lib/forge.d.ts.map +1 -1
  173. package/dist/lib/forge.js +33 -11
  174. package/dist/lib/forge.js.map +1 -1
  175. package/dist/lib/self-refresh-invocation.d.ts +60 -0
  176. package/dist/lib/self-refresh-invocation.d.ts.map +1 -0
  177. package/dist/lib/self-refresh-invocation.js +64 -0
  178. package/dist/lib/self-refresh-invocation.js.map +1 -0
  179. package/dist/lib/test-env.d.ts +50 -0
  180. package/dist/lib/test-env.d.ts.map +1 -1
  181. package/dist/lib/test-env.js +76 -0
  182. package/dist/lib/test-env.js.map +1 -1
  183. package/dist/terminal/pty-manager.d.ts +10 -1
  184. package/dist/terminal/pty-manager.d.ts.map +1 -1
  185. package/dist/terminal/pty-manager.js +38 -9
  186. package/dist/terminal/pty-manager.js.map +1 -1
  187. package/dist/terminal/pty-session.d.ts +52 -4
  188. package/dist/terminal/pty-session.d.ts.map +1 -1
  189. package/dist/terminal/pty-session.js +157 -18
  190. package/dist/terminal/pty-session.js.map +1 -1
  191. package/dist/terminal/shellper-client.d.ts +73 -0
  192. package/dist/terminal/shellper-client.d.ts.map +1 -1
  193. package/dist/terminal/shellper-client.js +151 -0
  194. package/dist/terminal/shellper-client.js.map +1 -1
  195. package/dist/terminal/shellper-main.js +20 -3
  196. package/dist/terminal/shellper-main.js.map +1 -1
  197. package/dist/terminal/shellper-process.d.ts +2 -0
  198. package/dist/terminal/shellper-process.d.ts.map +1 -1
  199. package/dist/terminal/shellper-process.js +17 -1
  200. package/dist/terminal/shellper-process.js.map +1 -1
  201. package/dist/terminal/shellper-protocol.d.ts +28 -0
  202. package/dist/terminal/shellper-protocol.d.ts.map +1 -1
  203. package/dist/terminal/shellper-protocol.js.map +1 -1
  204. package/package.json +4 -4
  205. package/scripts/forge/gitea/_lib.sh +214 -0
  206. package/scripts/forge/gitea/issue-comment.sh +8 -1
  207. package/scripts/forge/gitea/issue-view.sh +95 -4
  208. package/scripts/forge/gitea/pr-create.sh +155 -0
  209. package/scripts/forge/gitea/pr-exists.sh +32 -4
  210. package/scripts/forge/gitea/pr-list.sh +40 -31
  211. package/scripts/forge/gitea/pr-view.sh +65 -4
  212. package/scripts/forge/gitea/recently-merged.sh +91 -21
  213. package/scripts/forge/gitea/user-identity.sh +30 -1
  214. package/scripts/forge/github/issue-view.sh +5 -2
  215. package/scripts/forge/github/pr-create.sh +47 -0
  216. package/scripts/forge/github/pr-search.sh +3 -1
  217. package/scripts/forge/gitlab/issue-view.sh +24 -4
  218. package/scripts/forge/gitlab/pr-create.sh +53 -0
  219. package/scripts/forge/gitlab/pr-search.sh +3 -1
  220. package/scripts/forge/linear/issue-view.sh +13 -2
  221. package/skeleton/.claude/skills/arch-save/SKILL.md +8 -2
  222. package/skeleton/.claude/skills/builder-refresh/SKILL.md +138 -0
  223. package/skeleton/.claude/skills/generate-image/SKILL.md +22 -1
  224. package/skeleton/.codex/skills/arch-save/SKILL.md +8 -2
  225. package/skeleton/.codex/skills/builder-refresh/SKILL.md +138 -0
  226. package/skeleton/.codex/skills/generate-image/SKILL.md +22 -1
  227. package/skeleton/protocol-schema.json +17 -0
  228. package/skeleton/protocols/air/prompts/pr.md +6 -1
  229. package/skeleton/protocols/air/protocol.json +1 -1
  230. package/skeleton/protocols/aspir/prompts/review.md +6 -1
  231. package/skeleton/protocols/aspir/protocol.json +5 -1
  232. package/skeleton/protocols/bugfix/prompts/pr.md +6 -1
  233. package/skeleton/protocols/bugfix/protocol.json +1 -1
  234. package/skeleton/protocols/bugfix/protocol.md +2 -1
  235. package/skeleton/protocols/experiment/protocol.json +1 -1
  236. package/skeleton/protocols/maintain/prompts/review.md +6 -1
  237. package/skeleton/protocols/maintain/protocol.json +1 -1
  238. package/skeleton/protocols/pir/prompts/review.md +10 -7
  239. package/skeleton/protocols/pir/protocol.json +1 -1
  240. package/skeleton/protocols/protocol-schema.json +17 -0
  241. package/skeleton/protocols/research/protocol.json +1 -1
  242. package/skeleton/protocols/spike/protocol.json +1 -1
  243. package/skeleton/protocols/spir/prompts/review.md +6 -1
  244. package/skeleton/protocols/spir/protocol.json +5 -1
  245. package/skeleton/resources/commands/agent-farm.md +1 -1
  246. package/templates/tower.html +16 -1
  247. package/dashboard-dist/assets/index-BZRTEMtH.css +0 -32
  248. package/dashboard-dist/assets/index-D3XaKpZW.js.map +0 -1
@@ -12,9 +12,16 @@
12
12
  * TWO deliberate exceptions write a body OUTSIDE this path, both explicit human
13
13
  * gate-bypasses documented at their `tower-routes.ts` call sites: immediate `--interrupt`
14
14
  * (Ctrl+C then the message) and `--escape` (a bare ESC). They are the operator's "I am at
15
- * this terminal now" actions and take the separate per-terminal submission lock
16
- * (`session-submit.ts`), not the per-agent serializer here — every autonomous/scheduled/
17
- * held send, by contrast, delivers through this gate.
15
+ * this terminal now" actions — every autonomous/scheduled/held send, by contrast, delivers
16
+ * through this gate.
17
+ *
18
+ * They are no longer on a DISJOINT lock, though (Issue #1365). This path's write edge takes
19
+ * the same per-terminal submission lock (`session-submit.ts`) those bypasses take, as a leaf
20
+ * inside the per-agent serializer below — so a `^C`/ESC can no longer land inside a
21
+ * delivery's own text→Enter window, clear or truncate the composer, and leave the row marked
22
+ * `delivered` for a message the agent never saw whole. Lock order is always per-agent →
23
+ * per-terminal; see `session-submit.ts` for the full boundary, including what the lock does
24
+ * NOT cover.
18
25
  *
19
26
  * This module replaces the in-memory `SendBuffer` (retired in this phase): held
20
27
  * messages now live in the durable `mailbox` table, so nothing is lost to a Tower
@@ -26,8 +33,9 @@
26
33
  * {@link DeliveryPorts}, so the orchestration is unit-testable without a live Tower.
27
34
  */
28
35
  import type Database from 'better-sqlite3';
29
- import type { DbMailbox, MailboxReason } from '../db/types.js';
36
+ import type { DbMailbox, MailboxGateDetail, MailboxReason } from '../db/types.js';
30
37
  import type { GateProfile, GateVerdict } from './render-gate.js';
38
+ import type { PacedSubmitResult } from './message-write.js';
31
39
  /**
32
40
  * The structural view of a live PTY session the delivery path needs. `PtySession`
33
41
  * satisfies this (ringBuffer + info getter + the Spec 1313 identity getters +
@@ -35,6 +43,13 @@ import type { GateProfile, GateVerdict } from './render-gate.js';
35
43
  * imports the terminal layer.
36
44
  */
37
45
  export interface DeliverySession {
46
+ /**
47
+ * The live terminal/session id — the key of the per-terminal submission lock the write
48
+ * edge takes (Issue #1365). `PtySession` already carries it; a test double MUST supply a
49
+ * real, distinct one, and {@link submitMessagePaced} throws if it is missing rather than
50
+ * letting every lock collapse onto a single `undefined` key.
51
+ */
52
+ readonly id: string;
38
53
  /**
39
54
  * The session's MONOTONE cumulative output-byte counter (Spec 1313 render-gate round 2) —
40
55
  * the gate's change token. It advances on ANY new output and NEVER decreases, so two samples
@@ -48,6 +63,15 @@ export interface DeliverySession {
48
63
  * {@link MailboxDrainer}). `PtySession` exposes it (sourced from `RingBuffer.bytesWritten`).
49
64
  */
50
65
  readonly bytesWritten: number;
66
+ /**
67
+ * Epoch ms of the session's most recent OUTPUT byte (Issue #1573 settle-before-write).
68
+ * `PtySession` tracks it at the same chokepoint that feeds the ring and the gate mirror.
69
+ * The delivery path requires a quiet interval here before it writes: the render gate
70
+ * proves a screen IS a clean prompt, but says nothing about whether it is still being
71
+ * PAINTED — a composer that repainted 1 ms ago classifies identically to one idle a
72
+ * minute, and writing into a settling composer is what ate the leading bytes in #1521.
73
+ */
74
+ readonly lastDataAt: number;
51
75
  readonly info: {
52
76
  cols: number;
53
77
  rows: number;
@@ -66,6 +90,22 @@ export interface DeliverySession {
66
90
  readonly writable: boolean;
67
91
  write(data: string): boolean;
68
92
  }
93
+ /**
94
+ * Why a gated write abandoned inside the per-terminal lock (Issue #1365), decided by
95
+ * {@link deliverAgentMail}'s precheck at the write instant rather than before the lock.
96
+ */
97
+ export type WriteAbort =
98
+ /** Re-hold the row for this reason and retry on a later clean pass. */
99
+ {
100
+ kind: 'hold';
101
+ reason: MailboxReason;
102
+ }
103
+ /** The row was dismissed/superseded under us — a terminal state, so it must NOT be re-held. */
104
+ | {
105
+ kind: 'row-resolved';
106
+ };
107
+ /** Outcome of the gated write edge. See {@link PacedSubmitResult}. */
108
+ export type WriteResult = PacedSubmitResult<WriteAbort>;
69
109
  /** Broadcast frame for a delivered message (the dashboard/inbox message event). */
70
110
  export interface DeliveredBroadcast {
71
111
  type: 'message';
@@ -98,17 +138,24 @@ export interface DeliveryPorts {
98
138
  */
99
139
  classify(session: DeliverySession, profile: GateProfile): Promise<GateVerdict>;
100
140
  /**
101
- * Write a formatted message (text + Enter, unless `noEnter`) to the session and
102
- * report whether every byte reached the terminal. Resolves `true` when the paced
103
- * write — including the trailing Enter — has fully completed; `false` when any
104
- * write was dropped (#1198: a shellper socket that died mid-pace). The delivery
105
- * `await`s it for two reasons: (1) completion chaining — the per-agent serializer
106
- * holds the line until the submit is entirely on the wire, so the next delivery
107
- * never starts mid-write; (2) the boolean gates markDelivered — a dropped write
108
- * holds the row (`no-live-pty`) instead of falsely reporting delivery (Spec 1313
109
- * integration review — the silent-loss finding).
141
+ * Write a formatted message (text + Enter, unless `noEnter`) to the session as ONE
142
+ * submission on the session's per-terminal lock, and report what actually happened.
143
+ * Resolves only once the paced write — trailing Enter included — has completed.
144
+ *
145
+ * The delivery `await`s it for two reasons: (1) completion chaining — the per-agent
146
+ * serializer holds the line until the submit is entirely on the wire, so the next
147
+ * delivery never starts mid-write; (2) the result gates markDelivered — anything but
148
+ * `written` must never be reported as delivered (Spec 1313 integration review — the
149
+ * silent-loss finding; Issue #1365 extended the same rule to in-lock refusals).
150
+ *
151
+ * `precheck` is invoked by the binding INSIDE the lock, immediately before the first
152
+ * byte, and returning non-null aborts with nothing written. It exists because taking
153
+ * the lock alone would only move the race: a delivery that classified a clean screen
154
+ * and then waited behind another submission would write onto the screen that
155
+ * submission just changed. All of the reason authority stays here in the delivery
156
+ * module — the binding only relays the verdict.
110
157
  */
111
- writeMessage(session: DeliverySession, formattedMessage: string, noEnter: boolean): boolean | Promise<boolean>;
158
+ writeMessage(session: DeliverySession, formattedMessage: string, noEnter: boolean, precheck: () => WriteAbort | null): WriteResult | Promise<WriteResult>;
112
159
  /** Emit the delivered-message broadcast frame. */
113
160
  broadcast(frame: DeliveredBroadcast): void;
114
161
  /**
@@ -157,7 +204,57 @@ export interface DeliveryPorts {
157
204
  * already-delivered notice. OPTIONAL, like {@link escalateHeldToOwner}.
158
205
  */
159
206
  clearHeldOwnerNotice?(workspacePath: string, toAgent: string): void;
160
- log(message: string): void;
207
+ /**
208
+ * Begin watching for evidence that a message actually LANDS on the receiving terminal
209
+ * (Issue #1573). Called with the normalized needle from {@link echoNeedle} immediately
210
+ * BEFORE the write; the returned {@link EchoWatch} is consulted AFTER `markDelivered`
211
+ * (Issue #1584 — the delivery is committed first, so verification cannot leave the row in a
212
+ * re-writable state), and its answer becomes the `verified` report, not a retry decision.
213
+ *
214
+ * This is the only end-to-end evidence the delivery path has. Everything upstream of it
215
+ * proves the bytes were QUEUED, never that the terminal absorbed them: `session.write`
216
+ * returns true whenever the socket object is connected, so a receiving composer that ate
217
+ * the leading bytes (#1564) still produced a clean `written`, and the row was marked
218
+ * delivered for a message the agent never saw whole.
219
+ *
220
+ * Split into watch-then-verify rather than a single after-the-fact check because mere
221
+ * PRESENCE of the header proves nothing (CMAP round 1 — codex): a prior attempt's echo
222
+ * sits in the same scrollback, so a redelivery whose bytes were swallowed would match the
223
+ * copy the FIRST attempt left behind and be certified. The watch samples what the screen
224
+ * already showed, so verification can require evidence the write itself produced.
225
+ *
226
+ * DELIBERATELY NARROW: presence of the header line, nothing else. No screen diffing, no
227
+ * repair, no per-harness branches. A negative therefore means "could not confirm", not
228
+ * "definitely lost".
229
+ *
230
+ * What the caller does with a negative CHANGED in Issue #1584: it no longer holds the row for
231
+ * redelivery. The bytes are already out, so a redelivery is a re-injection — and because the
232
+ * residuals below recur for the same message every time, holding produced an unbounded loop
233
+ * (#1583). The row is committed as delivered, flagged `escalated`, and reported to the sender
234
+ * as `verified: false`. This watch is evidence for a REPORT, never a retry decision.
235
+ */
236
+ watchEcho(session: DeliverySession, needle: string): Promise<EchoWatch>;
237
+ /**
238
+ * Raise a human-visible notice for a delivery whose write completed but whose echo never
239
+ * confirmed (Issue #1584). The row is marked `delivered` + `escalated`, and a DELIVERED row
240
+ * is invisible to every held-scoped surface — `afx inbox`, the held-count indicator,
241
+ * `heldSummaryForWorkspace` — so without this the only trace of an unconfirmed delivery is a
242
+ * log line. That is fine for an interactive `afx send` (the sender gets `verified: false`)
243
+ * and not fine for a cron or backstop delivery, which has no sender waiting.
244
+ *
245
+ * Deliberately NOT `onEscalation`: that event means "held past the escalation age" and its
246
+ * binding says so in its title, which would be a false statement about a delivered row.
247
+ *
248
+ * Metadata only (no message body), per the spec's redaction rule. OPTIONAL, so unit fakes
249
+ * that do not exercise it may omit it.
250
+ */
251
+ onUnverifiedDelivery?(info: UnverifiedDeliveryInfo): void;
252
+ /**
253
+ * Tower log line. `level` defaults to `INFO`; the delivery path passes `WARN` for the one
254
+ * case an operator must be able to find after the fact — a delivery whose echo never
255
+ * confirmed (Issue #1584), which is recorded as delivered rather than re-written.
256
+ */
257
+ log(message: string, level?: 'INFO' | 'WARN'): void;
161
258
  now(): number;
162
259
  }
163
260
  /**
@@ -172,10 +269,26 @@ export interface HeldOwnerNoticeInfo {
172
269
  toAgent: string;
173
270
  /** Its current why-held reason (busy/no-profile/no-live-pty), if the gate set one. */
174
271
  reason: MailboxReason | null;
272
+ /**
273
+ * The gate detail behind a `busy` reason (Issue #1482), if one is recorded. This is what
274
+ * decides WHICH notice the owner gets: `user-text` means a human is legitimately at the
275
+ * composer (it will clear when they finish), while `no-region-end`/`no-composer-marker`
276
+ * means the classifier cannot verify the composer at all and the mail will never deliver
277
+ * on its own. Different situations, different remedies, so different wording.
278
+ */
279
+ detail: MailboxGateDetail | null;
175
280
  /** How long the oldest eligible held row has been stuck, in ms. */
176
281
  ageMs: number;
177
282
  /** How many eligible held rows are backed up for the agent. */
178
283
  heldCount: number;
284
+ /**
285
+ * How many CONSECUTIVE not-clean gate checks this agent's mail has seen (Issue #1482) — the
286
+ * drainer's existing per-agent streak, not new state. It turns "held ~7m" into "held ~7m,
287
+ * re-confirmed across 41 checks", which is the difference between a plausible pause and a
288
+ * composer that is genuinely, continuously occupied. 0 when no streak is being tracked
289
+ * (e.g. a notice pass on a Tower that just restarted).
290
+ */
291
+ streak: number;
179
292
  }
180
293
  /**
181
294
  * A sustained `no-profile` hold streak for an agent — carried to the liveness-telemetry
@@ -189,6 +302,18 @@ export interface LivenessInfo {
189
302
  /** Consecutive not-clean (`no-profile`) checks at the moment the streak crossed the threshold. */
190
303
  streak: number;
191
304
  }
305
+ /**
306
+ * Metadata for a delivery that completed its write but could not be confirmed on the receiving
307
+ * terminal (Issue #1584). Ids and addresses only — no message body, per the spec's redaction
308
+ * rule — since this rides the SSE bus to the dashboard's notification surface.
309
+ */
310
+ export interface UnverifiedDeliveryInfo {
311
+ workspacePath: string;
312
+ toAgent: string;
313
+ mailboxId: string;
314
+ /** The terminal the bytes were written to, for correlating against its transcript. */
315
+ terminalId: string;
316
+ }
192
317
  /**
193
318
  * Metadata for a held row that has crossed the escalation age. Carries NO message body
194
319
  * (ids + metadata only, per the spec's redaction rule) — this rides the SSE bus to the
@@ -201,6 +326,12 @@ export interface EscalationInfo {
201
326
  /** How long the row had been held when it escalated, in ms. */
202
327
  ageMs: number;
203
328
  reason: MailboxReason | null;
329
+ /**
330
+ * The gate detail behind a `busy` reason (Issue #1482), read off the row. Null for a
331
+ * non-gate hold. Carried onto the SSE payload so a dashboard/VSCode toast can say WHY the
332
+ * row is stuck, not merely that it is.
333
+ */
334
+ detail: MailboxGateDetail | null;
204
335
  }
205
336
  /** Outcome of one delivery pass over an agent's held mail. */
206
337
  export interface DeliveryOutcome {
@@ -208,6 +339,19 @@ export interface DeliveryOutcome {
208
339
  delivered: string[];
209
340
  /** When nothing was delivered, why the agent's mail stays held; null if delivered or the mailbox was empty. */
210
341
  reason: MailboxReason | null;
342
+ /**
343
+ * Issue #1584: whether the delivered message's header was actually SEEN on the receiving
344
+ * terminal. Present only when a delivery happened AND the message had a needle worth
345
+ * matching ({@link echoNeedle}) — `true` when the echo confirmed, `false` when it did not.
346
+ * Absent means verification was skipped (a body with no distinctive first line) or nothing
347
+ * was delivered, and reads exactly as it did before this field existed.
348
+ *
349
+ * A `false` is "could not confirm", never "definitely lost". The row is delivered and
350
+ * flagged `escalated` either way, because a completed write must never be re-written — the
351
+ * #1573 hold-and-redeliver it replaces is what re-injected one message dozens of times
352
+ * (#1583). This field is how the sender is told, instead.
353
+ */
354
+ verified?: boolean;
211
355
  /**
212
356
  * The gate's internal detail when a `busy` hold came from the render-gate (Spec 1313
213
357
  * render-gate hardening) — telemetry only. Distinguishes a legitimately-occupied line
@@ -218,6 +362,65 @@ export interface DeliveryOutcome {
218
362
  */
219
363
  detail?: GateVerdict['detail'];
220
364
  }
365
+ /**
366
+ * How long the receiving session's screen must have been QUIET before a gated delivery may
367
+ * write onto it (Issue #1573).
368
+ *
369
+ * The render gate answers "is this a clean prompt?" and nothing else — it has no stability
370
+ * requirement, so a composer captured 1 ms into its post-turn repaint passes exactly like one
371
+ * idle for a minute. Writing into that window is how #1521's leading bytes were eaten
372
+ * (`[USER via VS Code]` arriving as `ER via VS Code`). The quiescence drain trigger happened to
373
+ * be safe because it only fires after an output-idle debounce; the request path (`handleSend`'s
374
+ * immediate delivery attempt) and the `'submit'` fast trigger had no such gap. This gives all
375
+ * three the same floor.
376
+ *
377
+ * A hold here is cheap and self-correcting: the backstop drainer retries on its existing
378
+ * schedule, so the cost of being early is at most one tick of latency.
379
+ */
380
+ export declare const SETTLE_BEFORE_WRITE_MS = 250;
381
+ /**
382
+ * A pre-write sample of the receiving terminal, plus the confirmation that the write added
383
+ * something to it (Issue #1573). Returned by {@link DeliveryPorts.watchEcho}.
384
+ */
385
+ export interface EchoWatch {
386
+ /**
387
+ * Did the message's header appear on the terminal as a result of the write this watch was
388
+ * opened for? Bounded — it waits a short interval and then answers false, which the caller
389
+ * treats as "could not confirm" and REPORTS (Issue #1584): the row is delivered and flagged,
390
+ * never re-written. Callable more than once; each call opens a fresh window against the same
391
+ * pre-write sample, and the delivery path uses a second one to give a slow renderer more time
392
+ * without putting a byte on the line.
393
+ */
394
+ verify(): Promise<boolean>;
395
+ }
396
+ /**
397
+ * Reduce text to its alphanumeric skeleton for echo matching (Issue #1573).
398
+ *
399
+ * Matching the header line literally does not survive contact with real harnesses. Measured
400
+ * 2026-09-01 against live PTYs: claude echoes `### [ARCHITECT INSTRUCTION | <ts>] ###`
401
+ * verbatim into its composer, then — once the message is SUBMITTED — re-renders it as
402
+ * `[ARCHITECT INSTRUCTION | <ts>]`, the `###` fences consumed as a markdown H3. codex keeps the
403
+ * fences. Dropping every non-alphanumeric byte makes both forms the same string, and
404
+ * incidentally absorbs the other three ways a TUI mangles a line it is only *displaying*: a
405
+ * `> `/`❯ ` quote prefix, indentation, and wrapping at the viewport width (line breaks vanish
406
+ * with everything else, so a header split across two rows still matches).
407
+ *
408
+ * It is a presence probe, not a fidelity check — it deliberately cannot tell you the body
409
+ * arrived intact, only that the head of the message reached the screen.
410
+ */
411
+ export declare function normalizeForEcho(text: string): string;
412
+ /**
413
+ * The needle {@link DeliveryPorts.watchEcho} opens on: the formatted message's FIRST line,
414
+ * normalized. Returns `''` when it is too short to be distinctive (see
415
+ * {@link MIN_ECHO_NEEDLE_LENGTH}), which the caller reads as "skip verification".
416
+ *
417
+ * The first line and only the first line. A formatted send puts its `### [ARCHITECT
418
+ * INSTRUCTION | <iso timestamp>] ###` header there — long, and unique per message thanks to the
419
+ * timestamp. The TAIL would be the easier thing to find on a scrolled screen and is exactly the
420
+ * wrong choice: #1564's message arrived as its FINAL ~30 characters, so a footer needle would
421
+ * have certified the very corruption this check exists to catch.
422
+ */
423
+ export declare function echoNeedle(formattedMessage: string): string;
221
424
  /**
222
425
  * Composite key identifying an agent within a workspace, used to dedupe the
223
426
  * backstop's per-agent work and to key the liveness-telemetry streak map (which
@@ -1 +1 @@
1
- {"version":3,"file":"mailbox-delivery.d.ts","sourceRoot":"","sources":["../../../src/agent-farm/servers/mailbox-delivery.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAGH,OAAO,KAAK,QAAQ,MAAM,gBAAgB,CAAC;AAY3C,OAAO,KAAK,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAC/D,OAAO,KAAK,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAGjE;;;;;GAKG;AACH,MAAM,WAAW,eAAe;IAC9B;;;;;;;;;;;OAWG;IACH,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;IAC9B,QAAQ,CAAC,IAAI,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC;IAC9C,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,UAAU,EAAE,MAAM,EAAE,CAAC;IAC9B,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB;;;;;;;OAOG;IACH,QAAQ,CAAC,QAAQ,EAAE,OAAO,CAAC;IAC3B,KAAK,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC;CAC9B;AAED,mFAAmF;AACnF,MAAM,WAAW,kBAAkB;IACjC,IAAI,EAAE,SAAS,CAAC;IAChB,IAAI,EAAE;QAAE,OAAO,CAAC,EAAE,MAAM,CAAC;QAAC,KAAK,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;IAC3C,EAAE,EAAE;QAAE,OAAO,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,C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