Skip to content

P5 OX1: the two-build cross-minor check, e2e:cross-build, added by the plan whenever a tree and its peer are a minor apart - #222

Merged
SSFSKIM merged 6 commits into
masterfrom
p5-ox1-cross-build
Oct 27, 2026
Merged

SSFSKIM merged 6 commits into
masterfrom
p5-ox1-cross-build

Conversation

@SSFSKIM

@SSFSKIM SSFSKIM commented Oct 27, 2026 •

Copy link
Copy Markdown
Owner

The two-build cross-minor check that O1 deferred (O1's execution document M6 and residue 11; the tech-debt row "P5 OX1 … No real two-build check exists"; O6's residue 38), as a standing Mac e2e group, e2e:cross-build. The gate builds the second commit itself and adds the group to any run that tests code (unit, unit:darwin or an e2e group) whose tree and peer are a minor apart, so p5-o6's bump, O2's, and every later one is checked without anyone asking for it.

How a bump is detected

  • scripts/ci-gate.sh resolves the peer where the history is, in the new scripts/ci-gate-peer.mjs. The peer is --peer <ref> if given, otherwise the merge base with origin/master, fetched first. --peer none writes nothing.
  • It reads each tree's wire from its src/shared/ipc/wire-manifest.json (major.minor). wire.test.ts holds that manifest equal to WIRE_MAJOR and WIRE_MINOR.
  • It writes three trailers: Peer: <sha>, Peer-Wire: <m.n> and Wire: <m.n>. A rerun therefore keeps the same peer.
  • It writes no trailer when the tree has no manifest, is its own merge base, or its peer has no manifest.
  • It refuses with exit 2, naming --peer <ref> and --peer none, in two cases: an asked-for --peer that names no commit or has no manifest, and a checkout that cannot find its merge base (shallow, or with none against origin/master, such as a single-branch clone). Otherwise such a checkout would silently drop the check.
  • gate-plan.mjs adds every PEER_E2E group (gate.yml: cross-build) when the two wires share a major and differ in minor. It joins only a run whose gates include unit, unit:darwin or an e2e group, so class 1a and the default set get it, while a static, probes or static+probes check stays quick. Even then it skips live runs, which take their live groups alone, and Selection: affected runs, which are never landing evidence. A dispatch has no trailers.
  • The group's entry carries the peer sha. It always runs on the Mac's exclusive instance ([self-hosted, macOS, ARM64]), even on a Linux lane. It is never hosted: notHosted gives the reason peer, Lane: hosted names it, and HOSTED_MAC_E2E naming it is refused. It never runs on the shared instances or in the guest.
  • The group's timeout is 15 + 10 minutes, set from the measured run (3 min 22 s).
  • Asked for without a Peer trailer, the group runs nothing: its spec skips.
  • ci-gate-alerts.mjs takes the peer's trailers too (--trailers), plus Selection: affected under --affected. Its pre-push plan therefore adds the peer's Mac job exactly where the real plan does.
  • A refused run's relaunch line (ci-gate-refusals.sh) carries the peer as resolved, --peer <sha> or --peer none, so the relaunch checks the same pair.

What the job does

.github/scripts/gate-peer.sh does two things:

  • prepare fetches that one commit (git fetch --depth=1 origin <sha>) and checks it out as a worktree at $RUNNER_TEMP/maws-peer. It first removes any leftover there, registered or not. It then runs pnpm install --frozen-lockfile --prefer-offline against the runner's store and builds the peer with its own scripts/e2e-build.sh plain, never from the build cache. On the mini this takes 47 s.
  • stop is an always() step for any peer-group job that checked out, including one whose prepare was cancelled. It kills every maws-supervisor whose bundle is under either checkout, with its process group (its engines), and every app run from either checkout. Then it removes the worktree.

What each scene asserts (e2e/cross-build.spec.ts)

The older build is the one with the lower minor. Before the scenes, the two manifests must differ only additively by classifyWireChange.

There are two scenes on one profile:

  • (update): the older app keeps a session and the newer app attaches.
  • (downgrade): the newer app keeps a session and the older app attaches.

In each scene:

  1. Keep. The keeper starts a paced replay with a background failure inserted before its request, then quits with keep, mid-turn. The failure and the request land while no app runs.
  2. Hello across the minor. host.log has client connected: appPid <attaching app> build <its build> wire 3.<its minor>. The attaching main has connected to supervisor pid <kept> build <keeper's build> wire 3.<keeper's minor>. host.status reads matches: 'build', the kept pid, one live session, exit-when-idle armed, and the update banner shows.
  3. The tail reaches main. Events journaled after the keeper's quit are in session.events. The failure's Needs-you item appears, which only main's live derivation of the tail raises. The request raised while away is pending.
  4. A launch works. A new replay session launches on the kept supervisor (two live sessions) and plays a turn.
  5. The kept session is served. The attaching app answers the request, the kept supervisor plays on, and rows arrive live in the window until the turn ends.
  6. The move. Once both sessions idle they are released, and the kept supervisor exits by itself (exiting (exitWhenIdle)). The app connects to a supervisor of its own build: matches: 'same', the lock names it, its welcome is at the app's own minor and the banner is gone. It then serves a launch.
  7. The gap (update only). Each command the newer build added is invoked from a newer window with an input sampled from its JSON Schema. Commands its own mainOnlyCommands lists name are skipped. An engine-host command must answer unknown_command from the older supervisor and something else from its own. A command of another owner (machine, served by main) must answer alike on either supervisor.
  8. No refusals. Neither end logs a refusal of what the other build sent: a malformed message, an invalid output or event, a response to an unknown request, a closed client or connection, or a handler output its registry refused. Keys or events dropped by the tolerant reader are listed. No console errors appear.

The launch passes this checkout's LaunchSpec through the receiving build's own session.launch schema, so a later LaunchSpec field does not turn the downgrade red.

Proof

All runs used the merge base 5b7705914 (wire 3.0) as the peer.

On the head 162aeb958, after CI-opt's and the architect's four changes (relaunch peer, alert Selection, refusal without a merge base, join rule):

  • 40502339549: GREEN. Class 1a on the head: static, probes and unit 1/4 to 4/4. The head is at wire 3.0, so no group joined.
  • 40502341495: GREEN. Class 1a on the bump merge c026ff5a3 (p5-o6's M1 e546d9752 merged onto the head, wire 3.1). The plan still added e2e:cross-build under the new join rule, and both scenes passed. machine.identity answered ok on either supervisor, and neither end dropped anything.
  • 40502340584: GREEN. --gates static on the same bump merge. Only plan and static ran, and the plan's summary says: "Peer: 5b77059, wire 3.0; this tree's 3.1, a minor apart, but the peer groups join only a run with unit or an e2e group."
  • Gate-script tests: 248/248 locally.

Before those changes:

  • 40495960740: GREEN. Scratch commit f526ac529 (wire 3.1, one additive engine-host command host.wireProbe, never lands), --gates e2e:cross-build --runner macos. Both scenes passed. host.wireProbe answered unknown_command from the older supervisor and ok from its own.
  • 40498265642: GREEN. p5-o6's M1 head e546d9752 (wire 3.1, machine.identity) merged onto this branch as 7af4aad8c, run as --gates static,unit,probes --class1a pool. The plan added e2e:cross-build by itself. Results: static, probes, unit 1/4 to 4/4 and e2e:cross-build all green. In the update scene, machine.identity answered ok on either supervisor. Neither end dropped anything.
  • 40498263499: GREEN. This branch's head 6f4811881, class 1a (--gates static,unit,probes --class1a pool). Results: static, probes and unit 1/4 to 4/4 green, no preemption. The tree's wire is master's 3.0, so the plan added no group.
  • 40498044903: GREEN. e2e:supervisor on 27273ed2c, for the move of its Scratch helpers into e2e/support/supervisor-scratch.ts. That tree differs from the head only in one pin in a gate test. It ran on a hosted Mac (maws-app run 40498169733), and all 10 scenes passed.

Earlier runs while iterating:

  • 40492641560: the update scene was green. The downgrade was red because the peer's app lost its first stdout lines: Playwright requires its loader only into the Electron it resolves itself. Fixed in 51f5ded20.
  • 40495961158: p5-o6 M1 merged as above. The group was green and static was red on a second e2e-default-specs pin I had missed. Fixed in 6f4811881.
  • 40493588878 and 40493589526: cancelled.

The gate scripts' tests passed 244/244 locally at that point. A doperpowers:reviewer-medium review found four P2s:

  • a cancelled prepare skipped the stop;
  • a registered leftover worktree blocked the next prepare;
  • the main-only exemption was inferred from the failure under test;
  • a handler's invalid output went uncounted.

All four are fixed in 6d491437d, and the reviewer re-checked the fixes as correct.

On OX1's negotiation

No cross-minor bug showed at 3.0 and 3.1, in either direction, for an engine-host command (the scratch) or a machine command (O6). Three observations for the architect:

  • A window cannot gate on the peer's minor. HostSupervisor.peer(owner) is main's alone, and host.status gives matches but no minor or capabilities. While an older supervisor serves the update window (sessions started meanwhile run on it too), a newer window that calls a newer engine-host command gets unknown_command. OX1 makes that the contract, but the renderer can only react to it, not avoid it. A feature that adds an engine-host command used from a window should handle that answer, or host.status should carry the peer's minor.
  • Two refusals look the same. The preload bridge refuses a name it does not bridge with the same unknown_command and the same message text as an older supervisor that lacks the command. A caller cannot tell the two apart. The spec reads the build's main-only lists from source for that reason.
  • p5-o6's current head is red on its own. At f6b8c86d2 (its M2), static (preload-bridge and tab types) and unit (renderer Composer tests) fail with or without this branch. The real-gap proof therefore uses its M1 head.

Sminos-Session: GUI AI agent workspace charter#37052769 (MAWS on macbook)

…p the plan adds whenever the tree and its peer are a minor apart

scripts/ci-gate.sh resolves the peer (the merge base with master, or --peer) and writes it with both wires as trailers; gate-plan.mjs adds the PEER_E2E groups to a run whose wires are a minor apart; the e2e job fetches and builds the peer under RUNNER_TEMP (.github/scripts/gate-peer.sh) and stops both builds' supervisors whatever happened. e2e/cross-build.spec.ts runs each build's app against the other's supervisor on one profile, both ways.

Sminos-Session: GUI AI agent workspace charter#37052769 (MAWS on macbook)
…ckout's does, so its main's first lines are read

Sminos-Session: GUI AI agent workspace charter#37052769 (MAWS on macbook)
…ed leftover peer replaced, main-only read from the build's own lists, an invalid handler output counted a refusal)

Sminos-Session: GUI AI agent workspace charter#37052769 (MAWS on macbook)
… min 22 s, run 40495960740), 15 minutes

Sminos-Session: GUI AI agent workspace charter#37052769 (MAWS on macbook)
…e2e/cross-build.spec.ts)

Sminos-Session: GUI AI agent workspace charter#37052769 (MAWS on macbook)
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 27, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-27T11:59:38.621153Z 6f48118 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 6f48118810

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread scripts/ci-gate.sh Outdated
alert_check='ci-gate: MAWS_GATE_IGNORE_ALERTS=1, the ci-kit alert check skipped'
else
alert_check=$(node "$(dirname "$0")/ci-gate-alerts.mjs" --gates "$gates_trailer" --runner "$runner" --class1a "$class1a" --lane "$lane" --live "$live" --git-dir "$git_dir" --sha "$sha")
alert_check=$(node "$(dirname "$0")/ci-gate-alerts.mjs" --gates "$gates_trailer" --runner "$runner" --class1a "$class1a" --lane "$lane" --live "$live" --trailers "$peer_trailers" --git-dir "$git_dir" --sha "$sha")

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Pass the affected selection to the alert planner

For an --affected --gates static,unit,probes --class1a pool run whose tree and peer differ in wire minor, this forwards the peer trailers but omits Selection: affected. The alert planner consequently adds e2e:cross-build and requires a healthy Mac, whereas the actual pushed run excludes that group because gate-plan.mjs checks the selection trailer. If the Macs have open alerts, this incorrectly refuses a run that only needs Linux/pool jobs. Forward the affected selection to the alert check so its placement matches the eventual run.

Useful? React with 👍 / 👎.

… the alert check sees an iteration's Selection; a checkout that cannot find its merge base is refused; the peer groups join only a run with unit or an e2e group)

Sminos-Session: GUI AI agent workspace charter#37052769 (MAWS on macbook)
@SSFSKIM
SSFSKIM merged commit 7b98708 into master Oct 27, 2026
SSFSKIM added a commit that referenced this pull request Oct 27, 2026
…; gate-offload Decision Log 126, P5 Decision Log 58; OX1's tracker row closed, three rows added

Sminos-Session: GUI AI agent workspace charter#37052769 (MAWS on macbook)
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