@cluesmith/codev 3.3.2 → 3.3.4

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 (257) hide show
  1. package/dashboard-dist/assets/{index-D3XaKpZW.js → index-DZf6pNPE.js} +41 -41
  2. package/dashboard-dist/assets/index-DZf6pNPE.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 +48 -0
  7. package/dist/agent-farm/cli.js.map +1 -1
  8. package/dist/agent-farm/commands/ide.d.ts +20 -0
  9. package/dist/agent-farm/commands/ide.d.ts.map +1 -0
  10. package/dist/agent-farm/commands/ide.js +138 -0
  11. package/dist/agent-farm/commands/ide.js.map +1 -0
  12. package/dist/agent-farm/commands/inbox.d.ts.map +1 -1
  13. package/dist/agent-farm/commands/inbox.js +79 -10
  14. package/dist/agent-farm/commands/inbox.js.map +1 -1
  15. package/dist/agent-farm/commands/interrupt.d.ts +4 -1
  16. package/dist/agent-farm/commands/interrupt.d.ts.map +1 -1
  17. package/dist/agent-farm/commands/interrupt.js +6 -3
  18. package/dist/agent-farm/commands/interrupt.js.map +1 -1
  19. package/dist/agent-farm/commands/reset.d.ts +4 -1
  20. package/dist/agent-farm/commands/reset.d.ts.map +1 -1
  21. package/dist/agent-farm/commands/reset.js +6 -3
  22. package/dist/agent-farm/commands/reset.js.map +1 -1
  23. package/dist/agent-farm/commands/send.d.ts +28 -0
  24. package/dist/agent-farm/commands/send.d.ts.map +1 -1
  25. package/dist/agent-farm/commands/send.js +79 -6
  26. package/dist/agent-farm/commands/send.js.map +1 -1
  27. package/dist/agent-farm/commands/spawn-worktree.d.ts.map +1 -1
  28. package/dist/agent-farm/commands/spawn-worktree.js +16 -7
  29. package/dist/agent-farm/commands/spawn-worktree.js.map +1 -1
  30. package/dist/agent-farm/commands/tower.d.ts +21 -9
  31. package/dist/agent-farm/commands/tower.d.ts.map +1 -1
  32. package/dist/agent-farm/commands/tower.js +90 -30
  33. package/dist/agent-farm/commands/tower.js.map +1 -1
  34. package/dist/agent-farm/db/index.d.ts +3 -1
  35. package/dist/agent-farm/db/index.d.ts.map +1 -1
  36. package/dist/agent-farm/db/index.js +8 -443
  37. package/dist/agent-farm/db/index.js.map +1 -1
  38. package/dist/agent-farm/db/mailbox.d.ts +47 -7
  39. package/dist/agent-farm/db/mailbox.d.ts.map +1 -1
  40. package/dist/agent-farm/db/mailbox.js +56 -12
  41. package/dist/agent-farm/db/mailbox.js.map +1 -1
  42. package/dist/agent-farm/db/migrations.d.ts +57 -0
  43. package/dist/agent-farm/db/migrations.d.ts.map +1 -0
  44. package/dist/agent-farm/db/migrations.js +530 -0
  45. package/dist/agent-farm/db/migrations.js.map +1 -0
  46. package/dist/agent-farm/db/schema.d.ts +1 -1
  47. package/dist/agent-farm/db/schema.d.ts.map +1 -1
  48. package/dist/agent-farm/db/schema.js +1 -0
  49. package/dist/agent-farm/db/schema.js.map +1 -1
  50. package/dist/agent-farm/db/tower-owner.d.ts +168 -0
  51. package/dist/agent-farm/db/tower-owner.d.ts.map +1 -0
  52. package/dist/agent-farm/db/tower-owner.js +369 -0
  53. package/dist/agent-farm/db/tower-owner.js.map +1 -0
  54. package/dist/agent-farm/db/types.d.ts +47 -0
  55. package/dist/agent-farm/db/types.d.ts.map +1 -1
  56. package/dist/agent-farm/db/types.js.map +1 -1
  57. package/dist/agent-farm/lib/ide-record.d.ts +65 -0
  58. package/dist/agent-farm/lib/ide-record.d.ts.map +1 -0
  59. package/dist/agent-farm/lib/ide-record.js +118 -0
  60. package/dist/agent-farm/lib/ide-record.js.map +1 -0
  61. package/dist/agent-farm/lib/tunnel-client.d.ts +22 -0
  62. package/dist/agent-farm/lib/tunnel-client.d.ts.map +1 -1
  63. package/dist/agent-farm/lib/tunnel-client.js +96 -19
  64. package/dist/agent-farm/lib/tunnel-client.js.map +1 -1
  65. package/dist/agent-farm/servers/cron-delivery.d.ts +7 -1
  66. package/dist/agent-farm/servers/cron-delivery.d.ts.map +1 -1
  67. package/dist/agent-farm/servers/cron-delivery.js +2 -1
  68. package/dist/agent-farm/servers/cron-delivery.js.map +1 -1
  69. package/dist/agent-farm/servers/gate-profiles.d.ts +44 -2
  70. package/dist/agent-farm/servers/gate-profiles.d.ts.map +1 -1
  71. package/dist/agent-farm/servers/gate-profiles.js +79 -6
  72. package/dist/agent-farm/servers/gate-profiles.js.map +1 -1
  73. package/dist/agent-farm/servers/ide-forward.d.ts +62 -0
  74. package/dist/agent-farm/servers/ide-forward.d.ts.map +1 -0
  75. package/dist/agent-farm/servers/ide-forward.js +274 -0
  76. package/dist/agent-farm/servers/ide-forward.js.map +1 -0
  77. package/dist/agent-farm/servers/ide-server.d.ts +68 -0
  78. package/dist/agent-farm/servers/ide-server.d.ts.map +1 -0
  79. package/dist/agent-farm/servers/ide-server.js +281 -0
  80. package/dist/agent-farm/servers/ide-server.js.map +1 -0
  81. package/dist/agent-farm/servers/mailbox-delivery.d.ts +296 -12
  82. package/dist/agent-farm/servers/mailbox-delivery.d.ts.map +1 -1
  83. package/dist/agent-farm/servers/mailbox-delivery.js +566 -69
  84. package/dist/agent-farm/servers/mailbox-delivery.js.map +1 -1
  85. package/dist/agent-farm/servers/mailbox-wiring.d.ts +66 -19
  86. package/dist/agent-farm/servers/mailbox-wiring.d.ts.map +1 -1
  87. package/dist/agent-farm/servers/mailbox-wiring.js +204 -37
  88. package/dist/agent-farm/servers/mailbox-wiring.js.map +1 -1
  89. package/dist/agent-farm/servers/message-write.d.ts +138 -11
  90. package/dist/agent-farm/servers/message-write.d.ts.map +1 -1
  91. package/dist/agent-farm/servers/message-write.js +144 -35
  92. package/dist/agent-farm/servers/message-write.js.map +1 -1
  93. package/dist/agent-farm/servers/overview.d.ts +28 -12
  94. package/dist/agent-farm/servers/overview.d.ts.map +1 -1
  95. package/dist/agent-farm/servers/overview.js +130 -79
  96. package/dist/agent-farm/servers/overview.js.map +1 -1
  97. package/dist/agent-farm/servers/render-gate.d.ts +77 -1
  98. package/dist/agent-farm/servers/render-gate.d.ts.map +1 -1
  99. package/dist/agent-farm/servers/render-gate.js +174 -25
  100. package/dist/agent-farm/servers/render-gate.js.map +1 -1
  101. package/dist/agent-farm/servers/session-submit.d.ts +7 -4
  102. package/dist/agent-farm/servers/session-submit.d.ts.map +1 -1
  103. package/dist/agent-farm/servers/session-submit.js +7 -4
  104. package/dist/agent-farm/servers/session-submit.js.map +1 -1
  105. package/dist/agent-farm/servers/tower-cron.d.ts.map +1 -1
  106. package/dist/agent-farm/servers/tower-cron.js +7 -3
  107. package/dist/agent-farm/servers/tower-cron.js.map +1 -1
  108. package/dist/agent-farm/servers/tower-instances.d.ts.map +1 -1
  109. package/dist/agent-farm/servers/tower-instances.js +17 -10
  110. package/dist/agent-farm/servers/tower-instances.js.map +1 -1
  111. package/dist/agent-farm/servers/tower-routes.d.ts +32 -0
  112. package/dist/agent-farm/servers/tower-routes.d.ts.map +1 -1
  113. package/dist/agent-farm/servers/tower-routes.js +186 -26
  114. package/dist/agent-farm/servers/tower-routes.js.map +1 -1
  115. package/dist/agent-farm/servers/tower-server.js +79 -9
  116. package/dist/agent-farm/servers/tower-server.js.map +1 -1
  117. package/dist/agent-farm/servers/tower-terminals.d.ts +21 -0
  118. package/dist/agent-farm/servers/tower-terminals.d.ts.map +1 -1
  119. package/dist/agent-farm/servers/tower-terminals.js +106 -13
  120. package/dist/agent-farm/servers/tower-terminals.js.map +1 -1
  121. package/dist/agent-farm/servers/tower-utils.d.ts +35 -0
  122. package/dist/agent-farm/servers/tower-utils.d.ts.map +1 -1
  123. package/dist/agent-farm/servers/tower-utils.js +39 -0
  124. package/dist/agent-farm/servers/tower-utils.js.map +1 -1
  125. package/dist/agent-farm/servers/tower-websocket.d.ts.map +1 -1
  126. package/dist/agent-farm/servers/tower-websocket.js +26 -2
  127. package/dist/agent-farm/servers/tower-websocket.js.map +1 -1
  128. package/dist/agent-farm/utils/message-format.d.ts +78 -2
  129. package/dist/agent-farm/utils/message-format.d.ts.map +1 -1
  130. package/dist/agent-farm/utils/message-format.js +107 -11
  131. package/dist/agent-farm/utils/message-format.js.map +1 -1
  132. package/dist/agent-farm/utils/port.d.ts +22 -0
  133. package/dist/agent-farm/utils/port.d.ts.map +1 -0
  134. package/dist/agent-farm/utils/port.js +35 -0
  135. package/dist/agent-farm/utils/port.js.map +1 -0
  136. package/dist/agent-farm/utils/server-utils.d.ts +26 -0
  137. package/dist/agent-farm/utils/server-utils.d.ts.map +1 -1
  138. package/dist/agent-farm/utils/server-utils.js +36 -0
  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/consult/index.d.ts.map +1 -1
  144. package/dist/commands/consult/index.js +61 -1
  145. package/dist/commands/consult/index.js.map +1 -1
  146. package/dist/commands/consult/tree-tripwire.d.ts +177 -0
  147. package/dist/commands/consult/tree-tripwire.d.ts.map +1 -0
  148. package/dist/commands/consult/tree-tripwire.js +356 -0
  149. package/dist/commands/consult/tree-tripwire.js.map +1 -0
  150. package/dist/commands/doctor.d.ts +69 -0
  151. package/dist/commands/doctor.d.ts.map +1 -1
  152. package/dist/commands/doctor.js +165 -2
  153. package/dist/commands/doctor.js.map +1 -1
  154. package/dist/commands/generate-image.d.ts +25 -1
  155. package/dist/commands/generate-image.d.ts.map +1 -1
  156. package/dist/commands/generate-image.js +410 -2
  157. package/dist/commands/generate-image.js.map +1 -1
  158. package/dist/commands/porch/prompts.d.ts.map +1 -1
  159. package/dist/commands/porch/prompts.js +18 -2
  160. package/dist/commands/porch/prompts.js.map +1 -1
  161. package/dist/lib/agent-env.d.ts +86 -0
  162. package/dist/lib/agent-env.d.ts.map +1 -0
  163. package/dist/lib/agent-env.js +126 -0
  164. package/dist/lib/agent-env.js.map +1 -0
  165. package/dist/lib/forge-contracts.d.ts +76 -5
  166. package/dist/lib/forge-contracts.d.ts.map +1 -1
  167. package/dist/lib/forge-contracts.js.map +1 -1
  168. package/dist/lib/forge-rate-limit.d.ts +45 -0
  169. package/dist/lib/forge-rate-limit.d.ts.map +1 -0
  170. package/dist/lib/forge-rate-limit.js +89 -0
  171. package/dist/lib/forge-rate-limit.js.map +1 -0
  172. package/dist/lib/forge.d.ts +29 -1
  173. package/dist/lib/forge.d.ts.map +1 -1
  174. package/dist/lib/forge.js +96 -21
  175. package/dist/lib/forge.js.map +1 -1
  176. package/dist/lib/github.d.ts +13 -1
  177. package/dist/lib/github.d.ts.map +1 -1
  178. package/dist/lib/github.js +58 -15
  179. package/dist/lib/github.js.map +1 -1
  180. package/dist/lib/test-env.d.ts +17 -0
  181. package/dist/lib/test-env.d.ts.map +1 -1
  182. package/dist/lib/test-env.js +20 -0
  183. package/dist/lib/test-env.js.map +1 -1
  184. package/dist/terminal/pty-manager.d.ts +10 -1
  185. package/dist/terminal/pty-manager.d.ts.map +1 -1
  186. package/dist/terminal/pty-manager.js +38 -9
  187. package/dist/terminal/pty-manager.js.map +1 -1
  188. package/dist/terminal/pty-session.d.ts +174 -8
  189. package/dist/terminal/pty-session.d.ts.map +1 -1
  190. package/dist/terminal/pty-session.js +299 -25
  191. package/dist/terminal/pty-session.js.map +1 -1
  192. package/dist/terminal/session-manager.d.ts +23 -2
  193. package/dist/terminal/session-manager.d.ts.map +1 -1
  194. package/dist/terminal/session-manager.js +115 -36
  195. package/dist/terminal/session-manager.js.map +1 -1
  196. package/dist/terminal/session-screen.d.ts +34 -5
  197. package/dist/terminal/session-screen.d.ts.map +1 -1
  198. package/dist/terminal/session-screen.js +52 -6
  199. package/dist/terminal/session-screen.js.map +1 -1
  200. package/dist/terminal/shellper-client.d.ts +73 -0
  201. package/dist/terminal/shellper-client.d.ts.map +1 -1
  202. package/dist/terminal/shellper-client.js +151 -0
  203. package/dist/terminal/shellper-client.js.map +1 -1
  204. package/dist/terminal/shellper-main.js +20 -3
  205. package/dist/terminal/shellper-main.js.map +1 -1
  206. package/dist/terminal/shellper-process.d.ts +2 -0
  207. package/dist/terminal/shellper-process.d.ts.map +1 -1
  208. package/dist/terminal/shellper-process.js +17 -1
  209. package/dist/terminal/shellper-process.js.map +1 -1
  210. package/dist/terminal/shellper-protocol.d.ts +28 -0
  211. package/dist/terminal/shellper-protocol.d.ts.map +1 -1
  212. package/dist/terminal/shellper-protocol.js.map +1 -1
  213. package/dist/terminal/terminal-replies.d.ts +102 -0
  214. package/dist/terminal/terminal-replies.d.ts.map +1 -0
  215. package/dist/terminal/terminal-replies.js +181 -0
  216. package/dist/terminal/terminal-replies.js.map +1 -0
  217. package/package.json +4 -4
  218. package/scripts/forge/gitea/_lib.sh +214 -0
  219. package/scripts/forge/gitea/issue-comment.sh +8 -1
  220. package/scripts/forge/gitea/issue-view.sh +95 -4
  221. package/scripts/forge/gitea/pr-create.sh +155 -0
  222. package/scripts/forge/gitea/pr-exists.sh +32 -4
  223. package/scripts/forge/gitea/pr-list.sh +40 -31
  224. package/scripts/forge/gitea/pr-view.sh +65 -4
  225. package/scripts/forge/gitea/recently-merged.sh +91 -21
  226. package/scripts/forge/gitea/user-identity.sh +30 -1
  227. package/scripts/forge/github/issue-view.sh +5 -2
  228. package/scripts/forge/github/pr-create.sh +47 -0
  229. package/scripts/forge/github/pr-list.sh +6 -2
  230. package/scripts/forge/github/pr-search.sh +6 -2
  231. package/scripts/forge/gitlab/issue-search.sh +1 -0
  232. package/scripts/forge/gitlab/issue-view.sh +24 -4
  233. package/scripts/forge/gitlab/pr-create.sh +53 -0
  234. package/scripts/forge/gitlab/pr-search.sh +37 -2
  235. package/scripts/forge/linear/auth-status.sh +1 -0
  236. package/scripts/forge/linear/issue-comment.sh +1 -0
  237. package/scripts/forge/linear/issue-list.sh +1 -0
  238. package/scripts/forge/linear/issue-search.sh +1 -0
  239. package/scripts/forge/linear/issue-view.sh +14 -2
  240. package/scripts/forge/linear/recently-closed.sh +1 -0
  241. package/scripts/forge/linear/user-identity.sh +1 -0
  242. package/skeleton/.claude/skills/generate-image/SKILL.md +39 -1
  243. package/skeleton/.codex/skills/generate-image/SKILL.md +39 -1
  244. package/skeleton/protocols/air/prompts/pr.md +6 -1
  245. package/skeleton/protocols/aspir/prompts/review.md +6 -1
  246. package/skeleton/protocols/bugfix/prompts/pr.md +6 -1
  247. package/skeleton/protocols/bugfix/protocol.md +2 -1
  248. package/skeleton/protocols/maintain/prompts/review.md +6 -1
  249. package/skeleton/protocols/pir/prompts/review.md +10 -7
  250. package/skeleton/protocols/spir/prompts/review.md +6 -1
  251. package/skeleton/resources/commands/agent-farm.md +28 -3
  252. package/skeleton/roles/consultant.md +32 -0
  253. package/skeleton/templates/AGENTS.md +1 -1
  254. package/skeleton/templates/CLAUDE.md +1 -1
  255. package/templates/tower.html +16 -1
  256. package/dashboard-dist/assets/index-BZRTEMtH.css +0 -32
  257. package/dashboard-dist/assets/index-D3XaKpZW.js.map +0 -1
@@ -33,9 +33,9 @@
33
33
  * {@link DeliveryPorts}, so the orchestration is unit-testable without a live Tower.
34
34
  */
35
35
  import type Database from 'better-sqlite3';
36
- import type { DbMailbox, MailboxReason } from '../db/types.js';
36
+ import type { DbMailbox, MailboxGateDetail, MailboxReason } from '../db/types.js';
37
37
  import type { GateProfile, GateVerdict } from './render-gate.js';
38
- import type { PacedSubmitResult } from './message-write.js';
38
+ import { type PacedSubmitResult, type WriteStrategy } from './message-write.js';
39
39
  /**
40
40
  * The structural view of a live PTY session the delivery path needs. `PtySession`
41
41
  * satisfies this (ringBuffer + info getter + the Spec 1313 identity getters +
@@ -72,6 +72,31 @@ export interface DeliverySession {
72
72
  * minute, and writing into a settling composer is what ate the leading bytes in #1521.
73
73
  */
74
74
  readonly lastDataAt: number;
75
+ /**
76
+ * The session's MONOTONE cumulative INPUT-change counter (Issue #1473) — the input-side twin
77
+ * of {@link bytesWritten}, and the half of the gate's change token that a keystroke moves.
78
+ *
79
+ * `bytesWritten` counts OUTPUT, so until this existed a human keystroke landing in the
80
+ * gate→write window moved nothing the gate compared: both samples agreed, the verdict stayed
81
+ * CLEAN, and the message fused into the draft the human had started. Folding this into
82
+ * {@link ringToken} closes that, and — the case that earns it on its own — stops a memoized
83
+ * CLEAN verdict from being reused across a keystroke, which a token of output alone cannot
84
+ * see because PTY input does not advance the ring.
85
+ *
86
+ * REQUIRED, not optional, and test doubles must supply a real number: an optional field would
87
+ * let production compile a port that silently reads "no input ever" while presenting as a
88
+ * working gate.
89
+ */
90
+ readonly inputSeq: number;
91
+ /**
92
+ * Epoch ms of the session's most recent HUMAN input (Issue #1473) — the input-side twin of
93
+ * {@link lastDataAt}, and the only signal that can see input which landed BEFORE the gate
94
+ * sampled anything and has not been echoed yet. No counter comparison can catch that case:
95
+ * both samples agree, correctly, and the classifier reads a genuinely empty composer because
96
+ * the character is still in flight to the TUI. `0` on a session that has never had input,
97
+ * which reads as settled.
98
+ */
99
+ readonly lastInputAt: number;
75
100
  readonly info: {
76
101
  cols: number;
77
102
  rows: number;
@@ -95,10 +120,19 @@ export interface DeliverySession {
95
120
  * {@link deliverAgentMail}'s precheck at the write instant rather than before the lock.
96
121
  */
97
122
  export type WriteAbort =
98
- /** Re-hold the row for this reason and retry on a later clean pass. */
123
+ /**
124
+ * Re-hold the row for this reason and retry on a later clean pass.
125
+ *
126
+ * `detail` carries the gate detail when the in-lock refusal has one to give (Issue #1473's
127
+ * `recent-input`); absent/null keeps the detail-nulling behaviour every other refusal wants.
128
+ * `retryAfterMs` is set when the refusal clears on a known interval of its own — an input
129
+ * settle, or a composer redraw — see {@link DeliveryOutcome.retryAfterMs}.
130
+ */
99
131
  {
100
132
  kind: 'hold';
101
133
  reason: MailboxReason;
134
+ detail?: MailboxGateDetail | null;
135
+ retryAfterMs?: number;
102
136
  }
103
137
  /** The row was dismissed/superseded under us — a terminal state, so it must NOT be re-held. */
104
138
  | {
@@ -137,6 +171,23 @@ export interface DeliveryPorts {
137
171
  * output) classifies not-clean (`no-composer-marker`), exactly as an empty replay always did.
138
172
  */
139
173
  classify(session: DeliverySession, profile: GateProfile): Promise<GateVerdict>;
174
+ /**
175
+ * A fingerprint of the session's composer REGION as rendered right now (Issue #1664) — the
176
+ * signal that replaced whole-screen output quiescence as the "has it stopped being painted?"
177
+ * test. See `composerRegionFingerprint` for what it covers; `null` means no composer region
178
+ * could be located, which every caller here treats as MOVED (fail-toward-hold).
179
+ *
180
+ * SYNCHRONOUS, deliberately. Its second consumer is the in-lock precheck, which runs inside
181
+ * the per-terminal submission lock immediately before the first byte and cannot await. The
182
+ * live binding therefore reads the gate mirror without flushing its parser; the cost is one
183
+ * parse turn of lag, and the caller's stability requirement — the region unchanged across two
184
+ * samples a settle apart — is what carries the safety.
185
+ *
186
+ * REQUIRED, not optional, for the reason {@link DeliverySession.inputSeq} is: an optional
187
+ * port would let production compile a binding that silently answers "the composer never
188
+ * moves" while presenting as a working gate.
189
+ */
190
+ composerFingerprint(session: DeliverySession, profile: GateProfile): string | null;
140
191
  /**
141
192
  * Write a formatted message (text + Enter, unless `noEnter`) to the session as ONE
142
193
  * submission on the session's per-terminal lock, and report what actually happened.
@@ -155,7 +206,13 @@ export interface DeliveryPorts {
155
206
  * submission just changed. All of the reason authority stays here in the delivery
156
207
  * module — the binding only relays the verdict.
157
208
  */
158
- writeMessage(session: DeliverySession, formattedMessage: string, noEnter: boolean, precheck: () => WriteAbort | null): WriteResult | Promise<WriteResult>;
209
+ writeMessage(session: DeliverySession, formattedMessage: string, noEnter: boolean, precheck: () => WriteAbort | null,
210
+ /**
211
+ * Issue #1567: how the frame is put on the wire (bracketed paste + chunking, or the
212
+ * per-line opt-out), resolved from the recipient's gate profile. Optional so unit fakes
213
+ * written before #1567 keep compiling; the live binding forwards it.
214
+ */
215
+ strategy?: WriteStrategy): WriteResult | Promise<WriteResult>;
159
216
  /** Emit the delivered-message broadcast frame. */
160
217
  broadcast(frame: DeliveredBroadcast): void;
161
218
  /**
@@ -207,8 +264,9 @@ export interface DeliveryPorts {
207
264
  /**
208
265
  * Begin watching for evidence that a message actually LANDS on the receiving terminal
209
266
  * (Issue #1573). Called with the normalized needle from {@link echoNeedle} immediately
210
- * BEFORE the write; the returned {@link EchoWatch} is consulted after it and before
211
- * `markDelivered`.
267
+ * BEFORE the write; the returned {@link EchoWatch} is consulted AFTER `markDelivered`
268
+ * (Issue #1584 — the delivery is committed first, so verification cannot leave the row in a
269
+ * re-writable state), and its answer becomes the `verified` report, not a retry decision.
212
270
  *
213
271
  * This is the only end-to-end evidence the delivery path has. Everything upstream of it
214
272
  * proves the bytes were QUEUED, never that the terminal absorbed them: `session.write`
@@ -224,12 +282,36 @@ export interface DeliveryPorts {
224
282
  *
225
283
  * DELIBERATELY NARROW: presence of the header line, nothing else. No screen diffing, no
226
284
  * repair, no per-harness branches. A negative therefore means "could not confirm", not
227
- * "definitely lost" — so the caller HOLDS the row for the existing redelivery machinery
228
- * rather than dropping it, making the direction of error a duplicate delivery instead of
229
- * a silent loss.
285
+ * "definitely lost".
286
+ *
287
+ * What the caller does with a negative CHANGED in Issue #1584: it no longer holds the row for
288
+ * redelivery. The bytes are already out, so a redelivery is a re-injection — and because the
289
+ * residuals below recur for the same message every time, holding produced an unbounded loop
290
+ * (#1583). The row is committed as delivered, flagged `escalated`, and reported to the sender
291
+ * as `verified: false`. This watch is evidence for a REPORT, never a retry decision.
230
292
  */
231
293
  watchEcho(session: DeliverySession, needle: string): Promise<EchoWatch>;
232
- log(message: string): void;
294
+ /**
295
+ * Raise a human-visible notice for a delivery whose write completed but whose echo never
296
+ * confirmed (Issue #1584). The row is marked `delivered` + `escalated`, and a DELIVERED row
297
+ * is invisible to every held-scoped surface — `afx inbox`, the held-count indicator,
298
+ * `heldSummaryForWorkspace` — so without this the only trace of an unconfirmed delivery is a
299
+ * log line. That is fine for an interactive `afx send` (the sender gets `verified: false`)
300
+ * and not fine for a cron or backstop delivery, which has no sender waiting.
301
+ *
302
+ * Deliberately NOT `onEscalation`: that event means "held past the escalation age" and its
303
+ * binding says so in its title, which would be a false statement about a delivered row.
304
+ *
305
+ * Metadata only (no message body), per the spec's redaction rule. OPTIONAL, so unit fakes
306
+ * that do not exercise it may omit it.
307
+ */
308
+ onUnverifiedDelivery?(info: UnverifiedDeliveryInfo): void;
309
+ /**
310
+ * Tower log line. `level` defaults to `INFO`; the delivery path passes `WARN` for the one
311
+ * case an operator must be able to find after the fact — a delivery whose echo never
312
+ * confirmed (Issue #1584), which is recorded as delivered rather than re-written.
313
+ */
314
+ log(message: string, level?: 'INFO' | 'WARN'): void;
233
315
  now(): number;
234
316
  }
235
317
  /**
@@ -244,10 +326,26 @@ export interface HeldOwnerNoticeInfo {
244
326
  toAgent: string;
245
327
  /** Its current why-held reason (busy/no-profile/no-live-pty), if the gate set one. */
246
328
  reason: MailboxReason | null;
329
+ /**
330
+ * The gate detail behind a `busy` reason (Issue #1482), if one is recorded. This is what
331
+ * decides WHICH notice the owner gets: `user-text` means a human is legitimately at the
332
+ * composer (it will clear when they finish), while `no-region-end`/`no-composer-marker`
333
+ * means the classifier cannot verify the composer at all and the mail will never deliver
334
+ * on its own. Different situations, different remedies, so different wording.
335
+ */
336
+ detail: MailboxGateDetail | null;
247
337
  /** How long the oldest eligible held row has been stuck, in ms. */
248
338
  ageMs: number;
249
339
  /** How many eligible held rows are backed up for the agent. */
250
340
  heldCount: number;
341
+ /**
342
+ * How many CONSECUTIVE not-clean gate checks this agent's mail has seen (Issue #1482) — the
343
+ * drainer's existing per-agent streak, not new state. It turns "held ~7m" into "held ~7m,
344
+ * re-confirmed across 41 checks", which is the difference between a plausible pause and a
345
+ * composer that is genuinely, continuously occupied. 0 when no streak is being tracked
346
+ * (e.g. a notice pass on a Tower that just restarted).
347
+ */
348
+ streak: number;
251
349
  }
252
350
  /**
253
351
  * A sustained `no-profile` hold streak for an agent — carried to the liveness-telemetry
@@ -261,6 +359,24 @@ export interface LivenessInfo {
261
359
  /** Consecutive not-clean (`no-profile`) checks at the moment the streak crossed the threshold. */
262
360
  streak: number;
263
361
  }
362
+ /**
363
+ * Metadata for a delivery that completed its write but could not be confirmed on the receiving
364
+ * terminal (Issue #1584). Ids and addresses only — no message body, per the spec's redaction
365
+ * rule — since this rides the SSE bus to the dashboard's notification surface.
366
+ */
367
+ export interface UnverifiedDeliveryInfo {
368
+ workspacePath: string;
369
+ toAgent: string;
370
+ mailboxId: string;
371
+ /** The terminal the bytes were written to, for correlating against its transcript. */
372
+ terminalId: string;
373
+ /**
374
+ * Why it could not be confirmed (Issue #1473) — the notification text branches on it, since
375
+ * "its header never appeared on that screen" is a false statement about a delivery whose
376
+ * header DID appear and whose tail was eaten by a human keystroke.
377
+ */
378
+ cause: UnverifiedCause;
379
+ }
264
380
  /**
265
381
  * Metadata for a held row that has crossed the escalation age. Carries NO message body
266
382
  * (ids + metadata only, per the spec's redaction rule) — this rides the SSE bus to the
@@ -273,13 +389,46 @@ export interface EscalationInfo {
273
389
  /** How long the row had been held when it escalated, in ms. */
274
390
  ageMs: number;
275
391
  reason: MailboxReason | null;
392
+ /**
393
+ * The gate detail behind a `busy` reason (Issue #1482), read off the row. Null for a
394
+ * non-gate hold. Carried onto the SSE payload so a dashboard/VSCode toast can say WHY the
395
+ * row is stuck, not merely that it is.
396
+ */
397
+ detail: MailboxGateDetail | null;
276
398
  }
399
+ /**
400
+ * A hold's diagnostic detail as this module reports it: the render gate's own verdict details,
401
+ * plus two the delivery path decides for itself: `'recent-input'` (Issue #1473), read from the
402
+ * session's input signals rather than from anything on the screen, and `'composer-redraw'`
403
+ * (Issue #1664), read from the composer region's stability across samples — a property no
404
+ * single classify can see.
405
+ *
406
+ * Both stay inert in {@link isUnverifiableVerdict} by construction: that predicate is an
407
+ * allow-list of the two can't-verify details, so a value it does not name can never escalate.
408
+ * They must stay outside it — `'recent-input'` is the same self-clearing "a human is at the
409
+ * line" class as `user-text` and escalating it would false-alarm on every ordinary typist, and
410
+ * `'composer-redraw'` clears one settle after the composer stops moving.
411
+ */
412
+ export type DeliveryDetail = GateVerdict['detail'] | 'recent-input' | 'composer-redraw';
277
413
  /** Outcome of one delivery pass over an agent's held mail. */
278
414
  export interface DeliveryOutcome {
279
415
  /** Row ids delivered this pass — 0 or 1 (one message per clean gate; its Enter makes the line busy). */
280
416
  delivered: string[];
281
417
  /** When nothing was delivered, why the agent's mail stays held; null if delivered or the mailbox was empty. */
282
418
  reason: MailboxReason | null;
419
+ /**
420
+ * Issue #1584: whether the delivered message's header was actually SEEN on the receiving
421
+ * terminal. Present only when a delivery happened AND the message had a needle worth
422
+ * matching ({@link echoNeedle}) — `true` when the echo confirmed, `false` when it did not.
423
+ * Absent means verification was skipped (a body with no distinctive first line) or nothing
424
+ * was delivered, and reads exactly as it did before this field existed.
425
+ *
426
+ * A `false` is "could not confirm", never "definitely lost". The row is delivered and
427
+ * flagged `escalated` either way, because a completed write must never be re-written — the
428
+ * #1573 hold-and-redeliver it replaces is what re-injected one message dozens of times
429
+ * (#1583). This field is how the sender is told, instead.
430
+ */
431
+ verified?: boolean;
283
432
  /**
284
433
  * The gate's internal detail when a `busy` hold came from the render-gate (Spec 1313
285
434
  * render-gate hardening) — telemetry only. Distinguishes a legitimately-occupied line
@@ -288,8 +437,48 @@ export interface DeliveryOutcome {
288
437
  * which {@link MailboxDrainer.recordStreak} escalates to liveness telemetry. Absent
289
438
  * for non-gate holds (`no-live-pty`/`no-profile`) and deliveries.
290
439
  */
291
- detail?: GateVerdict['detail'];
440
+ detail?: DeliveryDetail;
441
+ /**
442
+ * Why a completed delivery could not be confirmed (Issue #1473). Present only alongside a
443
+ * delivery that was flagged — absent means confirmed, or not verifiable in the first place.
444
+ *
445
+ * - `'input-raced'` — human input landed on the terminal DURING the paced write, so the
446
+ * body may have been truncated (`^U`/`^W`/`^C`) or submitted early (their Enter);
447
+ * - `'no-echo'` — the write completed but the message's header never appeared on screen.
448
+ *
449
+ * `'input-raced'` WINS when both are true: it names the more actionable remedy, and a missing
450
+ * echo is often just the downstream symptom of the race.
451
+ *
452
+ * Deliberately NOT overloaded onto {@link verified}, which would make one field mean two
453
+ * different things — and the input-raced case frequently has `verified: true` (the header did
454
+ * land; it was the tail that was lost), which is exactly why the sender was being told plain
455
+ * "Message delivered" for it.
456
+ */
457
+ unverifiedCause?: UnverifiedCause;
458
+ /**
459
+ * Present when this pass held on a signal that clears by ITSELF after a known interval — the
460
+ * terminal's recent input (Issue #1473: the ms after which {@link inputSettled} would pass) or
461
+ * the composer still being repainted (Issue #1664: the ms after which the current region
462
+ * sample counts as stable). The drainer arms one coalesced, generation-guarded re-drain for
463
+ * it, so the row delivers roughly one settle after the movement stops rather than on the next
464
+ * 1.5 s backstop tick. Which of the two it was is in {@link detail}.
465
+ *
466
+ * It is not a speculative optimisation: the `'submit'` fast trigger fires SYNCHRONOUSLY from
467
+ * `stopComposing`, and the drain it schedules runs in a microtask — so at that pass
468
+ * `lastInputAt` is always `now`, and the submit trigger is now provably always held. Without
469
+ * the re-drain, pressing Enter to clear the line would reliably cost a full backstop period.
470
+ * It also shortens the escalation-blind hold below from "forever" to "one settle".
471
+ */
472
+ retryAfterMs?: number;
292
473
  }
474
+ /**
475
+ * Why a committed delivery is flagged unconfirmed (Issue #1473) — carried to every operator
476
+ * surface, the SENDER included. Before this, `tower-routes` surfaced only `verified` and the
477
+ * CLI warned only on `verified === false`, so the truncation case this exists for — where the
478
+ * header landed and `verified` is `true` — reported an unqualified success to the one human who
479
+ * was standing there.
480
+ */
481
+ export type UnverifiedCause = 'no-echo' | 'input-raced';
293
482
  /**
294
483
  * How long the receiving session's screen must have been QUIET before a gated delivery may
295
484
  * write onto it (Issue #1573).
@@ -314,10 +503,50 @@ export interface EchoWatch {
314
503
  /**
315
504
  * Did the message's header appear on the terminal as a result of the write this watch was
316
505
  * opened for? Bounded — it waits a short interval and then answers false, which the caller
317
- * treats as "could not confirm" and holds.
506
+ * treats as "could not confirm" and REPORTS (Issue #1584): the row is delivered and flagged,
507
+ * never re-written. Callable more than once; each call opens a fresh window against the same
508
+ * pre-write sample, and the delivery path uses a second one to give a slow renderer more time
509
+ * without putting a byte on the line.
318
510
  */
319
511
  verify(): Promise<boolean>;
320
512
  }
513
+ /**
514
+ * The longest gap between two observations that can still be treated as ONE continuous run of
515
+ * the composer holding still (Issue #1664).
516
+ *
517
+ * Two equal fingerprints far apart in time prove nothing on their own: between them the
518
+ * composer could have changed and changed back, which is exactly #1521's turn-end redraw. An
519
+ * agent with no held mail is not sampled at all, so without this bound a sample taken minutes
520
+ * ago would authorise an immediate write onto a composer that had just been repainted —
521
+ * observed in the #1664 acceptance harness, where consecutive trials reused a stale sample and
522
+ * delivered on their very first pass.
523
+ *
524
+ * Set above the drainer's 1.5 s backstop so an ordinary chain of passes always counts as
525
+ * continuous, and the delivery of a held row never depends on a faster trigger existing. In
526
+ * practice the gap is far smaller: a `composer-redraw` hold carries a `retryAfterMs`, so the
527
+ * next observation lands about a settle later.
528
+ */
529
+ export declare const MAX_COMPOSER_SAMPLE_GAP_MS = 2000;
530
+ /**
531
+ * How long the receiving session must have been free of HUMAN INPUT before a gated delivery
532
+ * may write onto it (Issue #1473) — the input-side counterpart of {@link SETTLE_BEFORE_WRITE_MS}.
533
+ *
534
+ * The change token catches input that arrives after the gate sampled it. It cannot catch input
535
+ * that arrived just BEFORE the sample and has not been echoed yet: nothing has moved, both
536
+ * samples agree — correctly — and the classifier reads a genuinely empty composer while the
537
+ * character is still travelling to the TUI. Only elapsed time can see that.
538
+ *
539
+ * One notch above the output settle because the round trip it covers is strictly the longer
540
+ * one: an echo has to reach the TUI, be processed, be painted, and come back as output, whereas
541
+ * the output settle only waits for painting to stop.
542
+ *
543
+ * **This BOUNDS the echo-lag window; it does not close it.** Input older than this interval
544
+ * whose echo is still delayed, and input in flight from the browser at sample time, both
545
+ * survive by construction. A larger constant buys coverage at the price of latency on every
546
+ * delivery, which is why the next tightening (if measurement wants one) is a BOUNDED
547
+ * `lastInputAt > lastDataAt` hold rather than a bigger number here.
548
+ */
549
+ export declare const INPUT_SETTLE_BEFORE_WRITE_MS = 300;
321
550
  /**
322
551
  * Reduce text to its alphanumeric skeleton for echo matching (Issue #1573).
323
552
  *
@@ -334,6 +563,17 @@ export interface EchoWatch {
334
563
  * arrived intact, only that the head of the message reached the screen.
335
564
  */
336
565
  export declare function normalizeForEcho(text: string): string;
566
+ /**
567
+ * The paste placards a TUI renders in place of a long bracketed paste (Issue #1567), in
568
+ * {@link normalizeForEcho} form: claude shows `[Pasted text #N +M lines]`, codex
569
+ * `[Pasted Content N chars]` (both measured, `codev/evidence/1567-head-loss/`). A long frame
570
+ * now travels as a bracketed paste, so until it is submitted the composer shows one of these
571
+ * instead of the header — and a `--no-enter` send never submits. The echo watch therefore
572
+ * counts these alongside the header needle; a NEW occurrence of either is evidence the write
573
+ * landed. Counted, not merely matched, for the same reason as the header: a previous paste's
574
+ * placard may already be on screen.
575
+ */
576
+ export declare const PASTE_PLACARD_NEEDLES: readonly string[];
337
577
  /**
338
578
  * The needle {@link DeliveryPorts.watchEcho} opens on: the formatted message's FIRST line,
339
579
  * normalized. Returns `''` when it is too short to be distinctive (see
@@ -418,6 +658,8 @@ export declare class MailboxDrainer {
418
658
  private readonly notifiedAgents;
419
659
  private readonly scheduledDrains;
420
660
  private readonly verdictMemo;
661
+ private readonly inputRetryTimers;
662
+ private readonly consecutiveInputHolds;
421
663
  private generation;
422
664
  constructor(opts?: {
423
665
  intervalMs?: number;
@@ -429,6 +671,48 @@ export declare class MailboxDrainer {
429
671
  stop(): void;
430
672
  /** Per-agent consecutive not-clean count (liveness telemetry; Phase 7 reads this). */
431
673
  get streaks(): ReadonlyMap<string, number>;
674
+ /** Agents with a pending input re-drain timer (Issue #1473; test/observability). */
675
+ get pendingInputRetries(): ReadonlyArray<string>;
676
+ /** Per-agent consecutive input-hold count (Issue #1473; test/observability). */
677
+ get inputHoldStreaks(): ReadonlyMap<string, number>;
678
+ /**
679
+ * Arm the input re-drain for a pass this drainer did not itself run (Issue #1473).
680
+ *
681
+ * The `afx send` REQUEST path calls `deliverAgentMailSerialized` directly rather than going
682
+ * through the drainer, so its outcome — `retryAfterMs` included — never reached
683
+ * {@link armInputRetry}. The visible consequence was that a send arriving while the terminal
684
+ * had just been typed at fell through to the quiescence trigger or the backstop, which is
685
+ * precisely the latency the re-drain exists to remove, in the one case an operator is sitting
686
+ * there watching. Measured, not theorised: the dev-approval evidence run timed that pass at
687
+ * the quiescence debounce rather than one settle.
688
+ *
689
+ * A no-op before the drainer is started, and idempotent per agent — the timer coalesces, so a
690
+ * request-path arm and a backstop arm for the same agent cannot stack.
691
+ */
692
+ noteOutcome(workspacePath: string, toAgent: string, outcome: DeliveryOutcome): void;
693
+ /**
694
+ * Arm the one-shot input re-drain and track the consecutive-input-hold diagnostic
695
+ * (Issue #1473). Called from both pass sites, exactly where {@link recordStreak} is, so the
696
+ * backstop tick and the fast trigger behave identically.
697
+ *
698
+ * The retry exists because the `'submit'` fast trigger is now provably ALWAYS held: it fires
699
+ * synchronously from `stopComposing`, and the drain it schedules runs in a microtask, so at
700
+ * that pass the input timestamp is `now` by construction. Without a retry, the single most
701
+ * common "the line just cleared, deliver now" path would silently degrade to the 1.5 s
702
+ * backstop — as would any navigation key that provokes no output of its own.
703
+ *
704
+ * COALESCED: while a timer is pending for an agent, later input holds do not stack another.
705
+ * GENERATION-GUARDED like {@link scheduleDrain}, so a timer that survives a stop()/start()
706
+ * bails instead of driving the new generation's state.
707
+ */
708
+ private armInputRetry;
709
+ /**
710
+ * The one-shot re-drain timer shared by both self-clearing holds (Issue #1473's input settle
711
+ * and Issue #1664's composer redraw). COALESCED — while a timer is pending for an agent, a
712
+ * later hold does not stack another — and GENERATION-GUARDED, so a timer that survives a
713
+ * stop()/start() bails instead of driving the new generation's state.
714
+ */
715
+ private armRetryTimer;
432
716
  /**
433
717
  * Agent keys that currently hold a cached gate verdict (render-gate memo).
434
718
  * Observability/test only: {@link tick} prunes this to the current held-agent set, so
@@ -1 +1 @@
1
- {"version":3,"file":"mailbox-delivery.d.ts","sourceRoot":"","sources":["../../../src/agent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