Skip to content

test(e2e): terminal layout parity check against main - #25681

Merged
Jinwoo-H merged 9 commits into
mainfrom
terminal-layout-parity-check
Oct 6, 2026
Merged

Jinwoo-H merged 9 commits into
mainfrom
terminal-layout-parity-check

Conversation

@Jinwoo-H

@Jinwoo-H Jinwoo-H commented Oct 5, 2026 •

Copy link
Copy Markdown
Contributor
Files Added Deleted Net
Test 6 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​861 0 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​861
Prod 2 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​230 0 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​230

ELI5

The terminal layout refactor is landing as many small PRs, and each one must either change nothing or fix a specific named bug. This PR adds a check that proves it: it builds main and the branch, drives the same terminal layout scenarios through the real app on both, and compares the resulting layouts and saved state. Any difference that isn't declared as a named bug fix fails the check. It is a test tool only; the app is unchanged.

What Changed

  • tests/e2e/terminal-layout-parity.spec.ts: Playwright Electron scenarios (create tab, split right then down, close pane, close tab, reorder panes, drag a pane out onto the tab bar with a real mouse drag and restart twice, split started from the CLI, split plus new tab across a restart, non-git folder workspace). Each captures the window's layout (tabs, groups, layout trees, terminal bindings, pane order, active pane), how the app exited, and the saved session for every partition. Scenarios wait like a user would (each pane's terminal started, main's terminal list matching the window) so main compares equal to itself.
  • tests/e2e/terminal-layout-parity-snapshot.ts: turns ids into stable labels by where they first appear in the layout and masks timestamps, pids, ports, scrollback and temp paths, then diffs.
  • tests/e2e/terminal-layout-parity-declared-differences.ts: the allow-list, keyed by scenario, bug id and field path. An undeclared difference fails, and so does a declared one that no longer appears.
  • config/scripts/run-terminal-layout-parity.mjs and pnpm run test:e2e:terminal-layout-parity: installs and builds a detached checkout of the base commit once (marked done only after the build succeeds, then reused), runs the current spec against both builds and compares. -- --base <sha> --head <sha> compares any two commits; -- -g <name> runs only matching scenarios.
  • A short section in tests/e2e/AGENTS.md on when and how to run it.

Before/after for users: none; test code only.

Why

Unit tests in this area mock the very internals the refactor rewrites, so they can't show that behavior is unchanged. Driving the real app through the e2e harness (already used by ~500 specs) stays stable across the refactor and compares what users actually get. Comparing against main, not against fixed snapshots, means no golden files to re-record.

Linked Issue

Maintainer PR. Supports the terminal layout refactor (Linear STA-9417, STA-9259).

Visual Proof

N/A: test tooling only.

Testing

  • Unit tests for normalizing and comparing (7): equal runs with different ids, paths, times and key order compare equal; an injected ratio change is detected; a declared change passes; a declared change that doesn't appear fails.

  • Main against itself: equal across 10 paced full-suite runs; the new drag-out scenario equal in 5 of 5 separate runs; default run PASS from a fresh shell.

  • Injected change (new splits default to 60/40): FAIL with 14 exact field differences across 5 scenarios, including after restart; declaring them makes it pass.

  • Runtime: about 1.5 to 2 minutes, plus a one-time install and build of the base checkout.

  • I manually tested these changes locally

  • Automated tests added/updated, or explained why not below

Test tooling only; run locally as described above.

Review

Agent skill upstream boundary

  • Not applicable, or this change follows docs/reference/agent-skill-sharing-upstream-boundary.md and copies or mechanically translates no upstream skill-installer source, tests, fixtures, registry entries, path tables, comments, or documentation.

Notes

  • Not covered yet: the setup-script split, SSH (Docker relay) split plus restart, and a second client or mobile edit.
  • Closing a pane used to save a different tab.ptyId about 1 run in 14 on main. The scenario now closes the pane with the keyboard shortcut, as a user does, so main hears about the close directly instead of racing the quit; the list of fields allowed to differ on main is empty.
  • No CI workflow is added in this PR.

Checklist

  • This PR is small and focused
  • I explained what changed and why (ELI5, the user-facing before/after, the mechanism, and why over the alternatives)
  • Before/after screenshots or videos attached for UI changes, or N/A with reason
  • Self-reviewed for correctness, security, and performance
  • Cross-platform, SSH/remote, and path/shortcut impact considered (or N/A)
  • pnpm lint, pnpm typecheck, pnpm test, and pnpm build pass (or CI will cover; local preferred)

Jinwoo-H and others added 4 commits October 5, 2026 16:28
Runs fixed terminal-layout journeys in the real app on two builds, captures
the renderer topology and the saved workspace session, normalizes volatile
values and fails on any difference not declared for a named bug.

Co-Authored-By: Claude <[email protected]>
@coderabbitai

coderabbitai Bot commented Oct 5, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

Important

Review skipped

Review was skipped as selected files did not have any reviewable changes.

⚙️ Run configuration
  • Configuration used: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: f0cc2edb-0c61-41eb-a977-b704fc5e12b0
📥 Commits

Reviewing files that changed from the base of the PR and between ed0eb08 and 99fc9ae.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: d8b0fedb-1b27-49cb-8cb6-efed84cbed24
📥 Commits

Reviewing files that changed from the base of the PR and between 66af1c0 and ed0eb08.

📒 Files selected for processing (1)
  • package.json

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 7 remain after this review.


📝 Walkthrough

Walkthrough

The change adds end-to-end terminal-layout scenarios that capture renderer and persisted session state. It adds normalization and comparison logic for captures, including declared-difference and main-instability classifications. A CLI command runs the scenarios against base and head checkouts, writes a report, and returns success only when the runs and comparison meet its stated conditions.

Priority: ⬇️ Low

Merge Risk: 🔵 Low · up to ed0eb

The new parity check can compare stale app output if run with SKIP_BUILD set and an existing build artifact. Clear the variable or rebuild before relying on that result; this is a bounded risk in the manual validation workflow.

Security Architecture Review

Security architecture risk: 🔵 Low · up to 66af1

The production terminal behavior is unchanged, and scenarios use disposable profiles. However, inherited remote-connection settings can redirect the new test command’s terminal requests outside those profiles.

Retained concerns

  • Low · security · inferred: The new parity RPC callers are not pinned to their disposable local runtime. The runner inherits connection settings, and RuntimeClient can select remote transport despite receiving a temporary profile path. With valid inherited pairing credentials, requests leave the test instance; if the remote runtime returns a terminal for the test worktree identifier, the CLI scenario sends terminal.split there before checking the local pane count. This is a conditional test-state ownership risk, not an authentication bypass.
Security review details

Security Blast Radius

  • inferred — The identified concern is bounded to the test process and any remote runtime selected by valid inherited pairing credentials. A remote split additionally depends on a terminal being returned for the test worktree identifier. The inspected path does not grant new credentials or demonstrate unauthenticated access.

Security Findings and Attack Paths

  • inferred — The conditional wrong-target path is inherited pairing configuration, remote client selection, terminal discovery and terminal.split against the discovered remote handle. The subsequent local pane assertion can fail after that request; it is not a pre-mutation target check.

Trust Boundaries and Controls

  • observed — Local profile isolation and RPC target selection are separate controls. RuntimeClient uses local profile metadata only when remote pairing is absent; a valid pairing code selects remote transport independently of the supplied profile path.

Resilience and Maintainability Implications

  • observed — The scenario finally block closes a remaining app and disposes its session. Existing shutdown helpers bound graceful close, fall back to process-tree termination and explicitly clean profile-associated daemons. Profile removal is retried unless preservation is requested; these controls do not establish cleanup after abrupt worker termination.

Hardening Proposals

  • proposed — Pin parity RPC clients to local transport by explicitly disabling pairing and environment selection, and reject remote targeting before issuing scenario requests. This would align RPC authority with disposable-profile ownership.
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 44.12% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 34 functions across 6 files. (1 skipped: … Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly identifies the E2E terminal-layout parity check against main, which is the primary change.
Description check ✅ Passed The description covers the purpose, changes, rationale, testing, visual-proof status, scope limits, and checklist. It also identifies this as a maintainer PR and gives the related Linear issues. The m…
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Full details: Docstring Coverage

Explanation

Docstring coverage is 44.12% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 34 functions across 6 files. (1 skipped: 1 unsupported.)

  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2


ℹ️ Review info
⚙️ Run configuration
  • Configuration used: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: c5583190-cc46-4227-9c49-9c16c3914728
📥 Commits

Reviewing files that changed from the base of the PR and between e9ed75a and 08e54a7.

📒 Files selected for processing (8)
  • config/scripts/run-terminal-layout-parity.mjs
  • package.json
  • tests/e2e/AGENTS.md
  • tests/e2e/helpers/runtime-types.ts
  • tests/e2e/terminal-layout-parity-declared-differences.ts
  • tests/e2e/terminal-layout-parity-snapshot.ts
  • tests/e2e/terminal-layout-parity-snapshot.unit.test.ts
  • tests/e2e/terminal-layout-parity.spec.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 2 remain after this review.

Comment on lines +237 to +245
const declaration = declarations.find((entry) => covers(entry, scenario, path))
if (declaration) {
used.add(declaration)
report.declared.push({ ...difference, bugId: declaration.bugId })
} else if (unstableOnMain.some((entry) => covers(entry, scenario, path))) {
report.unstableOnMain.push(difference)
} else {
report.undeclared.push(difference)
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Count a declaration as used only when its scenario has a declared difference.

declarations.find returns only the first matching declaration. Suppose two declarations cover overlapping prefixes in one scenario. The second declaration is never added to used. It is then reported in unusedDeclarations, and the run fails even though the fix was observed. Mark every declaration that covers the path as used.

Proposed fix
-      const declaration = declarations.find((entry) => covers(entry, scenario, path))
-      if (declaration) {
-        used.add(declaration)
+      const matching = declarations.filter((entry) => covers(entry, scenario, path))
+      const declaration = matching[0]
+      if (declaration) {
+        matching.forEach((entry) => used.add(entry))
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
const declaration = declarations.find((entry) => covers(entry, scenario, path))
if (declaration) {
used.add(declaration)
report.declared.push({ ...difference, bugId: declaration.bugId })
} else if (unstableOnMain.some((entry) => covers(entry, scenario, path))) {
report.unstableOnMain.push(difference)
} else {
report.undeclared.push(difference)
}
const matching = declarations.filter((entry) => covers(entry, scenario, path))
const declaration = matching[0]
if (declaration) {
matching.forEach((entry) => used.add(entry))
report.declared.push({ ...difference, bugId: declaration.bugId })
} else if (unstableOnMain.some((entry) => covers(entry, scenario, path))) {
report.unstableOnMain.push(difference)
} else {
report.undeclared.push(difference)
}

…nt maps as empty

Driving PaneManager.closePane directly left main to learn of the close from the
PTY exit, which raced quit; the keyboard path commits the close in main first.

Co-Authored-By: Claude <[email protected]>

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ℹ️ No critical issues — two minor bookkeeping suggestions inline.

Reviewed changes

  • tests/e2e/terminal-layout-parity.spec.ts — eight serial journeys that capture renderer topology (window.__store state plus mounted PaneManager DOM leaf order) and the persisted workspaceSession, pacing on every pane's PTY binding and a matching terminal.list before quitting.
  • tests/e2e/terminal-layout-parity-snapshot.ts — relabels volatile ids by first appearance, masks times/pids/scrollback/paths, diffs base vs head, and classifies each difference as declared / unstableOnMain / undeclared.
  • tests/e2e/terminal-layout-parity-declared-differences.ts — empty allow-list plus one evidenced unstableOnMain entry.
  • config/scripts/run-terminal-layout-parity.mjs and the package.json script — builds a cached detached checkout per SHA, runs head's spec against both builds by cwd, writes report.json, and fails on any undeclared difference or unobserved declaration.
  • tests/e2e/helpers/runtime-types.ts adds getLeafId to the test PaneManager type; tests/e2e/AGENTS.md documents the check.

I confirmed the unit tests pass, lint is clean on the new files, and that base e9ed75a5 already exposes PaneManager.getLeafId (so the head spec does not depend on a hook main lacks). The normalizer's label-by-first-appearance scheme is deterministic across runs; its only blind spot is swapping two otherwise-identical sibling panes, which is not user-observable and is detected once the panes carry distinct titles.

Pullfrog  | Fix all ➔ | Fix 👍s ➔ | View workflow run | Using deepseek-v4.1-flash (free via Pullfrog for OSS) | 𝕏

Comment on lines +237 to +240
const declaration = declarations.find((entry) => covers(entry, scenario, path))
if (declaration) {
used.add(declaration)
report.declared.push({ ...difference, bugId: declaration.bugId })

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

declarations.find marks only the first declaration that covers a path as used. When two declarations for one scenario have overlapping prefixes, the others are reported as unusedDeclarations and fail the run even though their difference was observed. I reproduced this: two declarations both covering [0].renderer.terminalLayoutsByTabId.#1.root.ratio leave the second under unusedDeclarations. Mark every covering declaration as used (the first still supplies the reported bugId).

Suggested change
const declaration = declarations.find((entry) => covers(entry, scenario, path))
if (declaration) {
used.add(declaration)
report.declared.push({ ...difference, bugId: declaration.bugId })
const matching = declarations.filter((entry) => covers(entry, scenario, path))
const declaration = matching[0]
if (declaration) {
matching.forEach((entry) => used.add(entry))
report.declared.push({ ...difference, bugId: declaration.bugId })

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2


ℹ️ Review info
⚙️ Run configuration
  • Configuration used: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 7afc9ce6-0f37-462d-8a42-c706a3a14bfa
📥 Commits

Reviewing files that changed from the base of the PR and between bae59d3 and 66af1c0.

📒 Files selected for processing (3)
  • config/scripts/run-terminal-layout-parity.mjs
  • tests/e2e/AGENTS.md
  • tests/e2e/terminal-layout-parity.spec.ts
🚧 Files skipped from review as they are similar to previous changes (1)
  • tests/e2e/AGENTS.md

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 6 remain after this review.

Comment on lines +155 to +156
// The working tree builds in Playwright's global setup; checkouts were built above.
...(side.skipBuild ? { SKIP_BUILD: '1' } : {})

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick win

🔎 Supported by static analysis

🏁 Script executed:

#!/bin/bash
# Inspect the build-skip contract without running repository code.
rg -n -C 5 'SKIP_BUILD|VITE_EXPOSE_STORE' tests/e2e/global-setup.ts tests/playwright.config.ts config/scripts/run-terminal-layout-parity.mjs

Repository: stablyai/orca

Length of output: 7566


🏁 Script executed:

#!/bin/bash
set -e
printf '%s\n' '--- runner captureSide and callers ---'
nl -ba config/scripts/run-terminal-layout-parity.mjs | sed -n '125,220p'
printf '%s\n' '--- global setup build guard ---'
nl -ba tests/e2e/global-setup.ts | sed -n '45,72p'
printf '%s\n' '--- PR base runner counterpart ---'
git show 17ecee6337e65ec39efe8de598183f679f8437c4:config/scripts/run-terminal-layout-parity.mjs 2>&1 | nl -ba | sed -n '125,220p'

Repository: stablyai/orca

Length of output: 6317


🏁 Script executed:

#!/bin/bash
set -e
printf '%s\n' '--- PR diff for parity runner ---'
git diff --no-ext-diff --unified=6 17ecee6337e65ec39efe8de598183f679f8437c4 66af1c06c766bf4417efdf2c31e95c29430ddcab -- config/scripts/run-terminal-layout-parity.mjs
printf '%s\n' '--- run helper declaration and call sites ---'
rg -n -C 4 'function run|const run|run\(' config/scripts/run-terminal-layout-parity.mjs

Repository: stablyai/orca

Length of output: 10354


🏁 Script executed:

#!/bin/bash
set -e
nl -ba config/scripts/script-child-process.mjs | sed -n '1,145p'

Repository: stablyai/orca

Length of output: 2076


🏁 Script executed:

#!/bin/bash
set -e
rg -n -C 8 'runProcessSync|spawnSync|env:' src/shared/child-process/run-process.ts

Repository: stablyai/orca

Length of output: 2413


🏁 Script executed:

#!/bin/bash
set -e
rg -n -C 8 'interface ProcessSpec|type ProcessSpec|function resolveSpawn|export .*resolveSpawn|env' src/shared/child-process/spawn-resolution.ts src/shared/child-process/run-process.ts

Repository: stablyai/orca

Length of output: 6988


Clear inherited SKIP_BUILD for the working-tree head.

When the caller sets SKIP_BUILD and out/main/index.js exists, global setup skips the build. The head capture can then use stale output. Set SKIP_BUILD to a falsey value when side.skipBuild is false.

🐛 Suggested fix
-      ...(side.skipBuild ? { SKIP_BUILD: '1' } : {})
+      SKIP_BUILD: side.skipBuild ? '1' : ''
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
// The working tree builds in Playwright's global setup; checkouts were built above.
...(side.skipBuild ? { SKIP_BUILD: '1' } : {})
// The working tree builds in Playwright's global setup; checkouts were built above.
SKIP_BUILD: side.skipBuild ? '1' : ''

const persisted = readPersistedSessions(session.userDataDir)
checkpoints.push({ label: 'after-quit', renderer, persisted, exit })

const { expectedPaneCount = 0, times: restarts = 1 } = scenario.restart ?? { times: 0 }

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

🔎 Supported by static analysis

🏁 Script executed:

#!/bin/bash
# Check whether the repo typecheck includes tests/e2e and reports this line.
fd -g 'tsconfig*.json' . --exec rg -n 'e2e' {}

Repository: stablyai/orca

Length of output: 351


🏁 Script executed:

#!/bin/bash
set -e
git diff --unified=8 17ecee6337e65ec39efe8de598183f679f8437c4 66af1c06c766bf4417efdf2c31e95c29430ddcab -- tests/e2e/terminal-layout-parity.spec.ts
printf '\n--- complete relevant source with line numbers ---\n'
nl -ba tests/e2e/terminal-layout-parity.spec.ts | sed -n '1,270p'
printf '\n--- TypeScript configs and package scripts ---\n'
rg -n --glob 'tsconfig*.json' --glob 'package.json' --glob '!node_modules/**' 'typecheck:e2e|terminal-layout-parity|tests/e2e|include|exclude|files' .

Repository: stablyai/orca

Length of output: 37754


🏁 Script executed:

#!/bin/bash
set -e
printf '%s\n' '--- e2e TypeScript configuration ---'
nl -ba config/tsconfig.e2e.json | sed -n '1,28p'
printf '%s\n' '--- package typecheck script ---'
nl -ba package.json | sed -n '58,70p'

Repository: stablyai/orca

Length of output: 2886


Avoid destructuring expectedPaneCount from the fallback union.

The { times: 0 } fallback has no expectedPaneCount property, so the destructuring fails the TypeScript check. The runtime defaults are correct; this change preserves them.

Suggested fix
-    const { expectedPaneCount = 0, times: restarts = 1 } = scenario.restart ?? { times: 0 }
+    const restarts = scenario.restart ? (scenario.restart.times ?? 1) : 0
+    const expectedPaneCount = scenario.restart?.expectedPaneCount ?? 0
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
const { expectedPaneCount = 0, times: restarts = 1 } = scenario.restart ?? { times: 0 }
const restarts = scenario.restart ? (scenario.restart.times ?? 1) : 0
const expectedPaneCount = scenario.restart?.expectedPaneCount ?? 0

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ℹ️ No critical issues — one minor bookkeeping suggestion inline.

Reviewed changes

This run re-reviewed the two commits that landed since the prior pullfrog review (bae59d3fa7, 66af1c06c7).

  • Build stamp is now written only after a passing build — prepareCheckout installs, builds (electron-vite build --mode e2e with VITE_EXPOSE_STORE, then build:cli), and stamps in one place; a failed build throws before the stamp, and the post-run stamp-on-existence write is gone. This closes the earlier concern about SKIP_BUILD=1 reusing a partial or non-e2e out/.
  • Added -g/--grep forwarding — the runner passes a scenario filter through to Playwright on both the base and head runs.
  • Added the drag-out-to-tab scenario — a real pointer drag of a pane handle onto the tab strip, asserted to yield a second tab, then restarted twice through the new restart.times.
  • Close-pane now uses the user's chord (Cmd/Ctrl+W, confirming "Stop and Close") instead of driving PaneManager.closePane, so main commits the close before quit rather than learning it from the PTY exit; the now-unobserved unstableOnMain entry was removed.
  • Absent and empty maps compare equal — diffJson skips a comparison only when both sides are empty, with a matching unit test; tests/e2e/AGENTS.md and the PaneManagerLike.restart type were updated.

I confirmed the 7 unit tests pass at head, the runner's build matches tests/e2e/global-setup.ts, and the -g option parses as documented.

Pullfrog  | Fix all ➔ | Fix 👍s ➔ | View workflow run | Using deepseek-v4.1-flash (free via Pullfrog for OSS) | 𝕏

'--project',
'electron-headless',
'--workers=1',
...(values.grep ? ['--grep', values.grep] : [])

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With -g filtering both runs to a subset of scenarios, compareParityCaptures still evaluates unusedDeclarations over the full declaration list, so any declaration for an un-run scenario is reported as UNOBSERVED and the run fails. The new docs advertise -- -g close-pane as an iteration workflow, but it becomes unusable the moment the first declaration for a different scenario lands.

Technical details
# Scenario filtering invalidates the unused-declaration check
The unused-declaration guard exists to catch a stale declaration on a full run. Under `--grep`, only the matched scenarios are captured, so declarations for every other scenario are necessarily unmatched and incorrectly fail the run.

## Affected sites
- `config/scripts/run-terminal-layout-parity.mjs:148` — forwards `values.grep` to Playwright on both sides, producing a partial capture set.
- `tests/e2e/terminal-layout-parity-snapshot.ts:260` — `report.unusedDeclarations = declarations.filter((entry) => !used.has(entry))` has no knowledge of a scenario filter.

## Required outcome
- A filtered run should not fail because of declarations belonging to scenarios that were intentionally not executed.

## Suggested approach (optional)
- Skip the `unusedDeclarations` check when a grep filter is set (e.g. only enforce it on a full run), or scope the declaration set to the scenarios actually captured.

@Jinwoo-H
Jinwoo-H merged commit 72b8411 into main Oct 6, 2026
43 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant