From e49360433b329af7da78d3b7dcc3fd56eadc6cb0 Mon Sep 17 00:00:00 2001 From: Taras Mankovski Date: Sun, 15 Nov 2026 18:12:12 -0500 Subject: [PATCH 1/2] Repair staged refusal fixture for REPL wheel bursts --- packages/cli/tests/repl-wheel-burst.test.ts | 28 +++++++++++++-------- 1 file changed, 18 insertions(+), 10 deletions(-) diff --git a/packages/cli/tests/repl-wheel-burst.test.ts b/packages/cli/tests/repl-wheel-burst.test.ts index 7514038ad..111650c83 100644 --- a/packages/cli/tests/repl-wheel-burst.test.ts +++ b/packages/cli/tests/repl-wheel-burst.test.ts @@ -4,7 +4,7 @@ import { scoped, sleep } from "effection"; import type { Operation } from "effection"; import { useReplPage } from "./support/repl-page.ts"; import type { ReplPage, ScreenCell } from "./support/repl-page.ts"; -import { composerHolds, intoComposer, paneLines } from "./support/screen-journeys.ts"; +import { draftHolds, intoComposer, intoDraft, paneLines } from "./support/screen-journeys.ts"; import { generateTypingHistory } from "./support/typing-history.ts"; const SIZE = { columns: 160, rows: 36 }; @@ -130,28 +130,36 @@ describe("wheel bursts in one input chunk", () => { }); it("a tick that clears a staged refusal moves the next one within the freed capacity", function* () { - const reason = - "Permission to start was declined because the chosen fixture rejected this request. "; - const request = "Please refuse this request"; - const footer = "! Permission to start was declined"; + const request = ``; + const footer = "! this entry cannot run here: Cannot resolve component:"; const cell = { column: 140, row: 13 }; function* endpoints(move: typeof burst) { return yield* scoped(function* () { const page = yield* useReplPage({ size: SIZE }); yield* generateTypingHistory(page, 2, 80); - yield* intoComposer(page); // The staged refusal frees more rows than one tick moves when it clears. - page.repl.fake.script({ reply: "", failure: reason.repeat(8) }); + yield* intoDraft(page); yield* page.type(request); - yield* page.until("the request in Message", (one) => composerHolds(one, request)); + yield* page.until("the unknown component in Draft", (one) => + draftHolds(one, "Component />"), + ); + const visible = () => + paneLines(page.screen()).flatMap( + (row) => row.slice(row.lastIndexOf("│") + 1).match(/TAIL-(?:LINE|END)-\d+/g) ?? [], + ); + const before = visible(); yield* page.key("Enter"); yield* page.until("the staged refusal", (one) => one.shows(footer)); - const start = paneLines(page.screen()); + const start = visible(); + expect(start.length + 3).toBeLessThan(before.length); yield* move(page, "up", cell, 2); expect(page.screen().shows(footer)).toBe(false); - return { start, end: paneLines(page.screen()) }; + const end = visible(); + expect(end.length).toBeGreaterThan(start.length); + expect(end[0]).not.toBe(start[0]); + return { start, end }; }); } From 11a028fef85d951ca2353c6489a612853fd6aaf6 Mon Sep 17 00:00:00 2001 From: Taras Mankovski Date: Sun, 15 Nov 2026 18:40:47 -0500 Subject: [PATCH 2/2] Size the staged refusal from its component name The refusal's searched paths include the platform temp directory, so on Linux the old name wrapped one row shorter and freed only three rows, the same as one wheel tick. Three dotted name segments, each within a file name, now wrap the refusal to at least seven rows on any platform. The Draft readiness matches the closing "/>", and each TAIL measurement reads the frame the readiness check returned. Co-Authored-By: Claude Opus 5.5 --- packages/cli/tests/repl-wheel-burst.test.ts | 32 ++++++++++++--------- 1 file changed, 19 insertions(+), 13 deletions(-) diff --git a/packages/cli/tests/repl-wheel-burst.test.ts b/packages/cli/tests/repl-wheel-burst.test.ts index 111650c83..b4b3fb023 100644 --- a/packages/cli/tests/repl-wheel-burst.test.ts +++ b/packages/cli/tests/repl-wheel-burst.test.ts @@ -3,7 +3,7 @@ import { expect } from "@executablemd/test-support/expect"; import { scoped, sleep } from "effection"; import type { Operation } from "effection"; import { useReplPage } from "./support/repl-page.ts"; -import type { ReplPage, ScreenCell } from "./support/repl-page.ts"; +import type { ReplPage, ScreenCell, ScreenReading } from "./support/repl-page.ts"; import { draftHolds, intoComposer, intoDraft, paneLines } from "./support/screen-journeys.ts"; import { generateTypingHistory } from "./support/typing-history.ts"; @@ -52,6 +52,13 @@ function chatRows(page: ReplPage): number[] { return shown; } +// The generated TAIL lines the Sidekick chat shows, right of the Draft pane. +function tailLines(reading: ScreenReading): string[] { + return paneLines(reading).flatMap( + (row) => row.slice(row.lastIndexOf("│") + 1).match(/TAIL-(?:LINE|END)-\d+/g) ?? [], + ); +} + // A labelled turn row left of the Sidekick pane. function transcriptCell(page: ReplPage): ScreenCell { const rows = page.screen().rows; @@ -130,7 +137,9 @@ describe("wheel bursts in one input chunk", () => { }); it("a tick that clears a staged refusal moves the next one within the freed capacity", function* () { - const request = ``; + // Each dotted segment is one probed path segment, so each stays within a file name. + const name = ["Unknown", "Missing", "Absent"].map((at) => at + "Component".repeat(27)); + const request = `<${name.join(".")} />`; const footer = "! this entry cannot run here: Cannot resolve component:"; const cell = { column: 140, row: 13 }; @@ -138,25 +147,22 @@ describe("wheel bursts in one input chunk", () => { return yield* scoped(function* () { const page = yield* useReplPage({ size: SIZE }); yield* generateTypingHistory(page, 2, 80); - // The staged refusal frees more rows than one tick moves when it clears. + // The name alone wraps the staged refusal past the searched paths, which + // vary by platform, so clearing it frees more rows than one tick moves. yield* intoDraft(page); yield* page.type(request); - yield* page.until("the unknown component in Draft", (one) => - draftHolds(one, "Component />"), + const drafted = yield* page.until("the unknown component in Draft", (one) => + draftHolds(one, "/>"), ); - const visible = () => - paneLines(page.screen()).flatMap( - (row) => row.slice(row.lastIndexOf("│") + 1).match(/TAIL-(?:LINE|END)-\d+/g) ?? [], - ); - const before = visible(); + const before = tailLines(drafted); yield* page.key("Enter"); - yield* page.until("the staged refusal", (one) => one.shows(footer)); - const start = visible(); + const refused = yield* page.until("the staged refusal", (one) => one.shows(footer)); + const start = tailLines(refused); expect(start.length + 3).toBeLessThan(before.length); yield* move(page, "up", cell, 2); expect(page.screen().shows(footer)).toBe(false); - const end = visible(); + const end = tailLines(page.screen()); expect(end.length).toBeGreaterThan(start.length); expect(end[0]).not.toBe(start[0]); return { start, end };