Skip to content

ci: the layout oracle gates merges - #27600

Merged
Jinwoo-H merged 3 commits into
mainfrom
layout-p2-oracle-required
Oct 11, 2026
Merged

Jinwoo-H merged 3 commits into
mainfrom
layout-p2-oracle-required

Conversation

@Jinwoo-H

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

Copy link
Copy Markdown
Contributor
Files Added Deleted Net
Test 4 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​115 $\color{#cf222e}{\Huge{\mathbf{−}}}$​44 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​71
Prod 7 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​141 $\color{#cf222e}{\Huge{\mathbf{−}}}$​40 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​101

ELI5

The layout oracle is the test that checks every view of a workspace's panes and tabs agrees with what the app actually holds. Until now it ran on some PRs but could not block a merge. This makes it a required check for PRs that touch layout code, and leaves every other PR alone.

What Changed

Before: the oracle ran inside the general end-to-end job, which is deliberately left out of the required verify check because the full suite is red on main. A PR that broke layout could merge with a red oracle.

After:

  • A new layout oracle job in .github/workflows/pr.yml is in verify's needs. It calls the existing e2e.yml with only the two oracle specs: the window spec runs in the changed-spec lane, and the headless spec runs in the orcad lane on both serve hosts (orcad and Electron orca serve). Nothing else from the end-to-end suite runs.
  • It follows the same pattern as the other path-routed required jobs: pr-code-change-scope.mjs gets a layout_oracle output, and verify requires success when it should run and skipped when it should not. A PR outside the route shows the job as skipped, and that counts as a pass. A ready-for-review rerun of an already-passed source skips it the same way the other required jobs are skipped.
  • It runs on the PR's merge commit (github.sha), the same commit the other required jobs check out, so a PR whose base is stale cannot pass against an old main.
  • Route (config/scripts/pr-layout-oracle-route.mjs, a readable list):
    • The layout model, its persistence and the compatibility folders.
    • While the layout-holder stack is open, the window-side layout writers it edits: the tab and terminal store slices, store/terminals/, components/terminal-pane/, graph sync, web-session-tabs-sync, tab-group repair and drag-drop commit, the runtime split, sync-window-graph and layout-projection modules, and the snapshot and leaf-move helpers.
    • The oracle's own harness: the shared e2e helpers it imports (a test checks every file it imports transitively is routed), the Playwright config, the window-manager script, and the runtime client it reads every view through. The client is included because a change there (refactor(remote): clients connect through a paired-connection handle, not a pairing offer #27533) broke main's oracle without running it.
    • Its own definition: e2e.yml, ci-e2e-job-selection.mjs and the route module.
    • Unit tests, unit-test fixtures under src/ and test harnesses do not route.
  • The two oracle routes are removed from the advisory end-to-end routing, and a direct edit to an oracle spec no longer goes there either, so no PR runs the oracle twice. The nightly full run still includes it.
  • e2e.yml gets an optional artifact_suffix input. GitHub requires artifact names to be unique within one run, and pr.yml now calls e2e.yml twice. Without the suffix, the build artifact upload would fail when both calls run.

Why

Reusing e2e.yml keeps the required run the same as the oracle lanes people already dispatch by hand, so there is no second copy of the build and orcad setup to keep in step. A separate workflow file would have duplicated about 40 lines of setup. It also could not be dispatched before it reached main. Routing through pr-code-change-scope.mjs (which imports the route module), like the other required jobs, means the readiness-reuse and skipped-is-pass rules apply to it without any new code.

This changes workflow and CI-script files only; repository settings are untouched. main has no branch protection or ruleset, so verify blocks a merge by team convention, as it does today.

CI cost: about 19 job-minutes per routed PR, in parallel: build about 1 min, native cache about 1 min, window oracle about 10 min, headless orcad + Electron about 6 min. Wall time is about 12 min. Over the last 300 main merges, 73 (24%) would have run it, including those that touch force-all files such as the lockfile or pr.yml.yml`. Under the old non-blocking route, 19 did.

Linked Issue

None. This is part of the terminal layout rework.

Visual Proof

N/A. This is a CI-only change with no app behaviour change.

Testing

Review

Agent skill upstream boundary

  • Not applicable, or this change copies or mechanically translates no upstream skill-installer source, tests, fixtures, registry entries, path tables, comments, or documentation.

Notes

No app code changes, so security, cross-platform, SSH and mobile behaviour are unaffected. The oracle runs on Linux, as before.

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)

@coderabbitai

coderabbitai Bot commented Oct 11, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

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: 59708019-de6d-4183-b8f1-c099986ed8fe

📥 Commits

Reviewing files that changed from the base of the PR and between ac2c722 and 5415cc9.


📒 Files selected for processing (2)
  • config/scripts/pr-e2e-layout-oracle-routing.test.mjs
  • config/scripts/pr-layout-oracle-route.mjs

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



📝 Walkthrough

Walkthrough

The PR workflow routes selected workspace layout changes to a dedicated oracle E2E job. The job runs two oracle specs on github.sha and is included in required-check validation. The reusable E2E workflow accepts an optional artifact suffix and applies it to build and trace artifact names. Tests cover source routing, job classification, and workflow configuration.


Priority: ⬇️ Low

Merge Risk: 🟡 Moderate · up to 5415c

Changes limited to the split-orientation module can still merge without the layout oracle, leaving a gap in the new gate. The reported headless token failure path is fixed, but the routing gap should be addressed before relying on this gate.

Pre-merge checks | Passed 4 | Failed 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 16.67% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 6 functions across 8 files. 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 and concisely identifies the primary change: making the layout oracle gate merges.
Description check Passed The description is detailed and covers the required sections, including the change, rationale, testing, visual proof, scope considerations, and checklist. It notes that no linked issue exists and leav…
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.

  • Fix all pre-merge checks with AI
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Commit to this branch
  • Create a new PR







  • Autofix · 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: 1


ℹ️ Review info
⚙️ Run configuration
  • Configuration used: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 12642142-4935-4d42-9aa8-adcded5d0c07
📥 Commits

Reviewing files that changed from the base of the PR and between bd54fc7 and 5ae0c042e7432a753f44b560a41921362fa46f0a.

📒 Files selected for processing (6)
  • .github/workflows/e2e.yml
  • .github/workflows/pr.yml
  • config/scripts/pr-code-change-scope.mjs
  • config/scripts/pr-code-change-scope.test.mjs
  • config/scripts/pr-e2e-layout-oracle-routing.test.mjs
  • config/scripts/pr-e2e-source-routing.mjs

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 thread config/scripts/pr-code-change-scope.mjs Outdated
Comment on lines +291 to +292
const WORKSPACE_LAYOUT_ORACLE_MODULE =
/^(?:src\/(?:main|renderer\/src)\/runtime\/(?:[^/]+\/)*[^/]*(?:pane-admission|workspace-layout|session-tab|headless-[^/]*tab|layout-client|create-terminal|split-pty-backed-terminal|terminal-split-layout|spawn-placement)[^/]*\.ts$|tests\/e2e\/(?:helpers\/)?(?:workspace-layout-oracle|headless-layout-oracle|terminal-layout-journeys))/

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 | 🟠 Major | ⚡ Quick win

Route split-orientation resolution through the layout oracle.

For a PR that changes only src/renderer/src/runtime/remote-terminal-layout-resolution.ts, this matcher returns false and the required layout_oracle job skips. The existing split-orientation E2E route identifies that module as a source of layout values that are published and written back to the tree. Add its exact path to the classifier and cover it with a job-classification test.

An oracle-only job joins verify's needs. It runs only the two layout oracle
specs through the existing e2e workflow, routed by layout writer paths; a PR
outside the route skips it and verify treats the skip as a pass. The route is
widened to the terminal store, terminal pane, graph sync, frozen mirror and
compatibility folders while the layout-holder stack is open. The oracle specs
leave the advisory e2e job so a PR does not run them twice.
@Jinwoo-H
Jinwoo-H force-pushed the layout-p2-oracle-required branch from 5ae0c04 to bfa0946 Compare October 11, 2026 22:07

@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: 1


ℹ️ Review info
⚙️ Run configuration
  • Configuration used: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 83df0525-6e10-4c8c-9339-1fb8bfa2ba8e
📥 Commits

Reviewing files that changed from the base of the PR and between 5ae0c042e7432a753f44b560a41921362fa46f0a and bfa0946.

📒 Files selected for processing (3)
  • .github/workflows/pr.yml
  • config/scripts/pr-code-change-scope.mjs
  • config/scripts/pr-e2e-source-routing.mjs

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

Comment thread .github/workflows/pr.yml
Comment on lines +1395 to +1400
uses: ./.github/workflows/e2e.yml
with:
ref: ${{ github.event.pull_request.head.sha }}
test_files: '["tests/e2e/workspace-layout-oracle-headless.spec.ts","tests/e2e/workspace-layout-oracle.spec.ts"]'
run_changed_e2e: true
needs_build: true

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.

🩺 Stability & Availability | 🟠 Major | ⚡ Quick win

Keep this required gate behind the headless-oracle fix.

The PR summary reports that the headless oracle failed every scenario in both oracle-only runs on this branch. The same summary reports green runs with #27601 applied. If this job becomes required before #27601 merges, routed PRs will fail verify even when their layout changes pass. Merge the prerequisite first, or keep this gate from becoming required until the headless oracle passes on the target branch.

🧰 Tools
🪛 zizmor (1.30.1)

[warning] 1395-1395: use GitHub's dedicated self-repository syntax (self-repository): use '$/...' instead of './...'

(self-repository)

…nd stack writers

Review fixes: run on the merge commit so a stale-base PR cannot pass on an old
main; route the oracle's own e2e harness and runtime client (a change there broke
main's oracle without running it), and the window-side layout writers the stack
edits; move the route into its own module.
@Jinwoo-H
Jinwoo-H merged commit 29dca8c into main Oct 11, 2026
40 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