diff --git a/config/reliability-gates.jsonc b/config/reliability-gates.jsonc index ea5fa6160d8..49c5e8b07cf 100644 --- a/config/reliability-gates.jsonc +++ b/config/reliability-gates.jsonc @@ -13666,7 +13666,7 @@ "providers": ["local", "daemon", "ssh"], "coveredPlatforms": ["macos"], "coveredProviders": ["local", "ssh"], - "coverageNotes": "Deterministic renderer and IPC-transport tests prove count and text ceilings, oldest-reply shedding, explicit query-reply source routing, ordinary-input preservation, one-reply-per-write delivery for OSC, DA1, and CPR replies, real xterm OSC reply generation and OSC 11 then CSI 6n ordering, drain-failure containment, and clear/reuse generation fencing. Remote-runtime tests preserve separate query-reply writes across pending input, async validation, and viewport-claim buffering. Host-contract tests prove a later DA1/CPR reply cannot overtake an earlier OSC reply, including a coalesced legacy-client payload. Live macOS Electron tests cover local PTY OSC replies and interactive typing; a macOS-hosted Docker OpenSSH test proves an upstream-node-pty Linux relay keeps OSC/DA1 replies out of the next fish child's stdin. No live daemon, paired-runtime, WSL, physical Linux/Windows client, or binary mixed-version run is registered.", + "coverageNotes": "Deterministic renderer and IPC-transport tests prove count and text ceilings, oldest-reply shedding, explicit query-reply source routing, ordinary-input preservation, one-reply-per-write delivery for OSC, DA1, and CPR replies, real xterm OSC reply generation and OSC 11 then CSI 6n ordering, drain-failure containment, and clear/reuse generation fencing. Remote-runtime tests preserve separate query-reply writes across pending input, async validation, and viewport-claim buffering. Host-contract tests prove a later DA1/CPR reply cannot overtake an earlier OSC reply, and that a coalesced payload of echo-safe replies is written in order. Live macOS Electron tests cover local PTY OSC replies and interactive typing; a macOS-hosted Docker OpenSSH test proves an upstream-node-pty Linux relay keeps OSC/DA1 replies out of the next fish child's stdin. No live daemon, paired-runtime, WSL, physical Linux/Windows client, or binary mixed-version run is registered.", "motivatingLinks": [ "https://github.com/stablyai/orca/issues/13137", "https://github.com/stablyai/orca/issues/7329", @@ -13674,7 +13674,7 @@ "https://github.com/stablyai/orca/issues/16672" ], "invariant": "The desktop PTY input queue retains at most 64 explicitly sourced pending terminal query replies and 4096 UTF-16 code units. Every retained reply reaches the provider as one atomic write, and the host writes each reply the moment it accepts it, so replies reach the PTY in the order they were produced with no queue that could reorder them. A reply's own echo is contained on the output side by projecting its known echo shapes; the ESC-initial verbatim shape is matched only when complete, never held as a partial, so a query torn at its own ESC is still answered. Overflow removes only the oldest query replies, never ordinary input except the documented modified-F3/CPR byte collision, and drain failures cannot clear a newer queue generation.", - "oracle": "Synchronously enqueue separate 10,000-entry OSC and DA1 reply floods before the scheduled drain and assert that only the initial immediate reply and newest 64 pending replies are written, each as one provider write, before a trailing keystroke. Derive the replies to OSC 11 followed by CSI 6n from real xterm, both in one write and with the color query itself torn across output chunks, and assert the PTY receives the exact OSC response and then the CPR as two separate writes; preserve the same order for separate or legacy-coalesced host payloads. At the remote-runtime boundary, preserve separate writes around pending ordinary input, async validation, and viewport-claim buffering. Repeat behind 10,000 ordinary inputs and exercise the text ceiling, real xterm generation, provider-write failure, rejected yield, and clear/reuse generation fencing.", + "oracle": "Synchronously enqueue separate 10,000-entry OSC and DA1 reply floods before the scheduled drain and assert that only the initial immediate reply and newest 64 pending replies are written, each as one provider write, before a trailing keystroke. Derive the replies to OSC 11 followed by CSI 6n from real xterm, both in one write and with the color query itself torn across output chunks, and assert the PTY receives the exact OSC response and then the CPR as two separate writes; preserve the same order for separate host payloads. At the remote-runtime boundary, preserve separate writes around pending ordinary input, async validation, and viewport-claim buffering. Repeat behind 10,000 ordinary inputs and exercise the text ceiling, real xterm generation, provider-write failure, rejected yield, and clear/reuse generation fencing.", "commands": [ "pnpm exec vitest run --config config/vitest.config.ts src/renderer/src/components/terminal-pane/pty-input-write-queue.test.ts src/renderer/src/components/terminal-pane/pty-transport-input-write.test.ts src/shared/terminal-query-reply.test.ts src/shared/pty-startup-ingress-live-query-reply.test.ts src/shared/pty-startup-reply-echo-shapes.test.ts", "pnpm exec vitest run --config config/vitest.config.ts src/renderer/src/components/terminal-pane/remote-runtime-pty-batching.test.ts src/renderer/src/components/terminal-pane/remote-runtime-pty-query-reply-immediate.test.ts src/renderer/src/components/terminal-pane/remote-runtime-pty-transport-input-coalescing.test.ts", @@ -13840,7 +13840,8 @@ "knownGaps": [ "No live daemon, paired-runtime, WSL, physical Linux/Windows client, mixed-version, or network-fault run is registered.", "Ordinary-input queue growth predates this change and is outside this reply-only gate.", - "Query-reply ordering is pinned only where both queries land in one parse turn. A tear between the OSC and the CPR query is not covered: the chunk boundary lets a held reply flush before the CPR is produced, so that shape stays green even when ordering is inverted.", + "Query-reply ordering is pinned only where both queries land in one parse turn. A tear between the OSC and the CPR query is a weaker shape and is not covered: a hold shorter than the inter-chunk gap flushes inside the gap, so it only reds on holds that outlive the gap.", + "A payload coalescing an OSC reply with a DA1/CPR reply is declined to the host's own write path instead of taking the ordered queue, so its PTY order is not pinned; that boundary is pinned as a known limitation in terminal-query-reply.test.ts.", "Reply overload intentionally sheds the oldest synthetic replies; the modified-F3/CPR byte collision shares that budget, and live application behavior under a pathological query flood is not measured." ], "demotionRule": "Keep experimental or revert if ordinary input is evicted, pending replies exceed either ceiling, retained replies are coalesced, a trailing key sits behind more than the bounded reply window, or the gate develops unexplained flakes." diff --git a/src/renderer/src/components/terminal-pane/pty-input-write-queue.test.ts b/src/renderer/src/components/terminal-pane/pty-input-write-queue.test.ts index c8e081a222f..68f308a8a75 100644 --- a/src/renderer/src/components/terminal-pane/pty-input-write-queue.test.ts +++ b/src/renderer/src/components/terminal-pane/pty-input-write-queue.test.ts @@ -346,9 +346,9 @@ describe('pty input write queue', () => { it.each([ ['one write', ['\x1b[7;1H\x1b]11;?\x1b\\\x1b[6n']], // Tears the color query itself, so xterm resumes its OSC parse across chunks; both replies - // still come from one parse turn. Do not "improve" this into a tear BETWEEN the two queries: - // the chunk boundary lets a held reply flush before the CPR exists, so that shape passes - // even when the order is genuinely inverted. + // still come from one parse turn. A tear BETWEEN the two queries is strictly weaker, not an + // upgrade: a hold shorter than the inter-chunk gap flushes inside the gap and that shape stays + // green, while this one reds on a hold of any length. ['a query torn across output chunks', ['\x1b[7;1H\x1b]11;', '?\x1b\\\x1b[6n']] ] as const)( 'keeps xterm OSC 11 ahead of the following CPR at the PTY host (%s)', @@ -377,7 +377,7 @@ describe('pty input write queue', () => { return queue.enqueueQueryReply('pty-1', data) } const capabilityReplies = installTerminalCapabilityReplyHandlers({ - terminal: term as never, + terminal: { cols: term.cols, rows: term.rows, element: undefined, options: term.options }, parser: term.parser, sendInput: enqueueReply, isReplaying: () => false