From 3264e9d255adfaa141ebba95defe2204d69269f5 Mon Sep 17 00:00:00 2001 From: Neil <4138956+nwparker@users.noreply.github.com> Date: Sun, 6 Sep 2026 18:53:49 -0700 Subject: [PATCH] test: assert Wayland launch and register native Hangul evidence --- config/reliability-gates.jsonc | 91 +++++++++++++++++++ .../scripts/run-terminal-ibus-hangul-e2e.mjs | 14 +-- ...al-hangul-terminating-digit-native.spec.ts | 2 + 3 files changed, 100 insertions(+), 7 deletions(-) diff --git a/config/reliability-gates.jsonc b/config/reliability-gates.jsonc index ede7c46c751..2bcba7cb737 100644 --- a/config/reliability-gates.jsonc +++ b/config/reliability-gates.jsonc @@ -18573,6 +18573,97 @@ "Other released version pairs remain untested; not a required PR check." ], "demotionRule": "Keep experimental if any direction skips or fails; do not extend timeouts or retry to green." + }, + { + "id": "terminal-input.native-wayland-hangul-digit", + "title": "Native Wayland Hangul terminating digits reach the PTY exactly once", + "maturity": "experimental", + "protection": "partial", + "owner": "terminal-input", + "layer": "electron-native-ime-e2e", + "surfaces": [ + "native Hangul composition", + "Wayland terminal input" + ], + "platforms": [ + "linux" + ], + "providers": [ + "local" + ], + "coveredPlatforms": [ + "linux" + ], + "coveredProviders": [ + "local" + ], + "coverageNotes": "Ubuntu 22.04 nested GNOME and IBus Hangul drive three complete native executions in GitHub Actions. GNOME owns IBus; daemon and CLI share its default config discovery path.", + "motivatingLinks": [ + "https://github.com/stablyai/orca/pull/19174" + ], + "invariant": "Typing d k 1 Return through native IBus Hangul delivers exactly 아1 followed by newline without missing, duplicate, or reordered characters.", + "oracle": "Three executions each assert three exact UTF-8 PTY lines. Verify the exact Playwright title, zero skips/retries, each individual native composition receipt, and the nested launch Wayland flag.", + "commands": [ + "gh workflow run terminal-ime-e2e.yml", + "gh run view 34074017928 --log", + "pnpm exec playwright test --config tests/playwright.config.ts tests/e2e/terminal-hangul-terminating-digit-native.spec.ts --project=electron-headful --workers=1 --repeat-each=3 --retries=0 --reporter=list,json", + "ORCA_BACKGROUND_LAUNCH=1 node_modules/.bin/vitest run --config config/vitest.config.ts config/scripts/terminal-ime-e2e-workflow.test.mjs" + ], + "testFiles": [ + "tests/e2e/terminal-hangul-terminating-digit-native.spec.ts", + "config/scripts/terminal-ime-e2e-workflow.test.mjs" + ], + "assertionRefs": [ + { + "file": "tests/e2e/terminal-hangul-terminating-digit-native.spec.ts", + "assertions": [ + "a digit typed right after a Hangul syllable reaches the pty" + ] + }, + { + "file": "config/scripts/terminal-ime-e2e-workflow.test.mjs", + "assertions": [ + "runs native Wayland independently with CJK fonts and retained evidence" + ] + } + ], + "evidenceRuns": [ + { + "date": "2026-09-07", + "runner": "ci", + "platform": "linux", + "command": "gh run view 34074017928 --log", + "result": "passed", + "summary": "Permanent runner passed three native executions, nine exact lines and zero skips/retries. Downloaded participation report and all three engagement receipts verified; compositor cleanup reported no remaining group members. Independent X11 job passed.", + "durationSeconds": 76.61 + } + ], + "runtimeBudget": { + "p95Seconds": 1500, + "scope": "CI job timeout including installation/build; measured p95 not established" + }, + "flakeHistory": { + "status": "soaking", + "evidence": "Earlier diagnostic repetition had one unexplained missing Hangul commit. GNOME-owned diagnostic and corrected permanent runner each passed 3/3. Long-term soak is missing." + }, + "redGreenEvidence": { + "status": "partial", + "evidence": "Original exact-byte assertions retained. Permanent startup failed until the GNOME config-discovery mismatch was corrected. No intentional production regression was introduced." + }, + "performanceBudget": { + "required": false, + "evidence": "CI-only harness; no application runtime changes." + }, + "promotionCriteria": [ + "Collect 100 soak runs across 14 days with no unexplained flakes.", + "Exercise native Wayland desktops beyond nested GNOME before broadening the claim." + ], + "knownGaps": [ + "Only Hangul terminating digits; no native candidate-selection or other input-method coverage claim.", + "No macOS, Windows, SSH terminal, packaged build, or mixed-version claim.", + "Default config paths are shared with GNOME on a disposable hosted CI runner; nested mode refuses non-GitHub-Actions execution." + ], + "demotionRule": "Keep experimental on unexplained failures; retain exact bytes and participation checks without retries, skips, or longer deadlines." } ] } diff --git a/config/scripts/run-terminal-ibus-hangul-e2e.mjs b/config/scripts/run-terminal-ibus-hangul-e2e.mjs index 3a84a5afac0..572f1988629 100644 --- a/config/scripts/run-terminal-ibus-hangul-e2e.mjs +++ b/config/scripts/run-terminal-ibus-hangul-e2e.mjs @@ -115,12 +115,12 @@ function configureHangulEngine() { } } -async function waitForHangulEngine(ibusProcess) { +async function waitForHangulEngine(sessionProcess) { let lastError = '' const deadline = Date.now() + 15_000 while (Date.now() < deadline) { - if (ibusProcess.exitCode !== null) { - throw new Error(`ibus-daemon exited early with code ${ibusProcess.exitCode}`) + if (sessionProcess.exitCode !== null) { + throw new Error(`IME session process exited early with code ${sessionProcess.exitCode}`) } if ( nestedWayland && @@ -292,7 +292,7 @@ async function runInsideSession(evidenceDir) { testExitCode = await waitForExit(testProcess) } finally { if (ibusProcess?.pid) { - evidence.ibusGroupBeforeCleanup = ibusProcess?.pid ? processGroupMembers(ibusProcess.pid) : [] + evidence.ibusGroupBeforeCleanup = processGroupMembers(ibusProcess.pid) evidence.ibusGroupAfterCleanup = await stopOwnedProcessGroup(ibusProcess.pid) } if (windowManagerProcess?.pid) { @@ -384,7 +384,7 @@ async function runInsideSession(evidenceDir) { async function runOuter() { if (process.platform !== 'linux') { - throw new Error('The native IBus Hangul E2E runner requires Linux/X11') + throw new Error('The native IBus Hangul E2E runner requires Linux') } const evidenceDir = mkdtempSync(path.join(os.tmpdir(), 'orca-terminal-ime-e2e-')) @@ -437,11 +437,11 @@ async function runOuter() { if (!sessionProcess.pid) { throw new Error('xvfb-run did not return a PID') } - console.error(`[terminal-ime] started isolated X11 session PID ${sessionProcess.pid}`) + console.error(`[terminal-ime] started isolated display session PID ${sessionProcess.pid}`) const exitCode = await waitForExit(sessionProcess) const remaining = await stopOwnedProcessGroup(sessionProcess.pid) if (remaining.length > 0) { - throw new Error(`Owned X11 session processes survived cleanup: ${remaining.join('; ')}`) + throw new Error(`Owned display session processes survived cleanup: ${remaining.join('; ')}`) } return exitCode } diff --git a/tests/e2e/terminal-hangul-terminating-digit-native.spec.ts b/tests/e2e/terminal-hangul-terminating-digit-native.spec.ts index 4344f94adaf..9d0127d4df4 100644 --- a/tests/e2e/terminal-hangul-terminating-digit-native.spec.ts +++ b/tests/e2e/terminal-hangul-terminating-digit-native.spec.ts @@ -190,6 +190,8 @@ test.describe('Hangul terminating digit @headful', () => { })) console.log(`[digit-diag] ${JSON.stringify(launchDiagnostics)}`) if (INJECTOR === 'nested') { + expect(launchDiagnostics.ozonePlatform).toBe('wayland') + expect(launchDiagnostics.waylandDisplay).toBeTruthy() // Under Wayland the app's ready-to-show never fires here, so the window // stays hidden and the compositor has nothing to give keyboard focus to. await electronApp.evaluate(({ BrowserWindow }) => {