Skip to content

gate: mini copies, a mini run of each run's own e2e groups whose specs the diff touches - #646

Merged
SSFSKIM merged 4 commits into
masterfrom
gate-mini-copy
Nov 14, 2026
Merged

SSFSKIM merged 4 commits into
masterfrom
gate-mini-copy

Conversation

@SSFSKIM

@SSFSKIM SSFSKIM commented Nov 14, 2026

Copy link
Copy Markdown
Owner

The architect's R1: a landing that adds or edits an e2e spec, or anything under e2e/support, runs each group that reaches it once on the mini. Two scenes had gone green on hosted Macs and red on the mini (#639). Until now the wave picked those groups by hand; the gate now does it itself.

Selection: scripts/ci-gate.sh. ci-gate-e2e-coverage.mjs --mini-copy reuses the coverage import graph (discoverGroups, importGraph). A candidate is one of the run's own requested groups whose specs reach a path the merge-base diff changes under e2e/. For --gates all, it is the tested commit's CLASS1_E2E. Each candidate becomes one trailer line, MiniCopy: <group> <path>, … (+n more), cut at 508 bytes.

  • --no-mini-copy <reason> writes MiniCopy: none (<reason>) instead, for a run whose copy already stands on an earlier head.
  • When the candidates can't be computed, the summary says why and the run makes no copies.

Placement: .github/scripts/gate-plan.mjs. The plan reads the trailer on pushes only. A group gets a copy only when its original runs off the mini (on a hosted Mac or EC2):

  • A guest-eligible group (on MAC_VM_E2E, not a peer group) goes to the guest. One run's guest copies are packed first-fit into shared e2e-copy jobs, named e2e: mini copy (<groups>). A job holds 3 slots and stays within 90 minutes, under ci-kit's 100-minute VM lane bound. Each slot is bounded at 15 minutes, or the group's own E2E_MINUTES.
  • Any other group runs on the home host, [ci-kit-mac-home], as e2e:<group> (mini copy). That label is never EC2's. A guest copy too long for a guest job goes there as well.
  • A LAUNCHD_E2E group never gets a host copy.
  • Groups already on the mini (final refs included) and pool/Linux groups get no copy, and the summary says why.

The summary names each copy, its runner, and the changed paths that pulled it in. It also gives the opt-out reason, and, under Lane: vm/vm-trial, each group it leaves off the mini and where it went.

The shared guest job: .github/scripts/gate-copy.sh. Each slot has its own timeout-minutes, continue-on-error, and artifacts named e2e-<slug>-mini. Each out/ variant is downloaded once.

  • Each slot runs in its own process group. Before the next slot, a slot cut at its bound is reaped: its group, then its detached strays (anything with its cwd in the checkout, or whose argv names the checkout or the e2e scratch roots), with leader identity checked by pid and start time. TERM comes first, then KILL with a confirmation check; whatever survives fails the job loudly.
  • A verdict step writes one line per group and fails the job if any slot failed.

Consumers.

  • The alert check counts a guest copy as vm and a host copy as home.
  • Pool demand counts the copies' e2e-build boxes.
  • The refusal relaunch gives a guest copy its own --lane vm line. A host copy joins the main line, whose plan copies it again.
  • The push-anyway line after an alert refusal now prints its arguments shell-quoted.

Review. reviewer-medium found four P2s (host copies could reach EC2, a cut slot could overlap the next, an oversized guest job, the quoting). A re-review of those fixes found three more in the reaping (detached descendants, pgid ownership, confirming the KILL). All are fixed and tested.

Evidence.

  • static green at the head: 43542880584.
  • Guest proof with comment-only spec edits, --gates e2e:to-human,e2e:c12: 43526195746 at 3aeb505, and 43540931777 at 2c512b9. In both, the originals ran on hosted Macs, and e2e: mini copy (to-human, c12) ran both groups in one VM, green; each slot restored its own variant.
  • Host proof: 43539832870, with e2e:lane-a (mini copy) on ci-kit-mac-home (17 passed).
  • The last commit changes only the cut-slot path of gate-copy.sh, covered by gate-copy.test.mjs's 5 tests.
  • Local node --test: gate-plan 124/124, gate-copy 5/5, refusals 23/23, alerts 37/37, pool-demand 20/20, identity 9/9, peer-held 23/23, ci-gate 37/37.

Limits.

  • A process that leaves the checkout's cwd and names none of those paths escapes the stray sweep. The sweep's path matching is safe only because the guest VM runs this one job.
  • The 15-minute slot bound is a measured choice: the slowest hosted-eligible MAC_VM_E2E test step took 5 min in the guest across 120 runs. Raise COPY_STEP_MINUTES if a group outgrows it.

Sminos-Session: CI-opt#a45b97a3 (doperpowers on macbook)

…he run hosts them

The architect's ruling: a landing that adds or edits an e2e spec, or anything under
e2e/support, runs the groups reaching it once on the Mac mini too, because scenes
went green on GitHub's hosted Macs and red on the mini. Sessions picked those groups
by hand; the gate now does it.

ci-gate.sh reuses the spec-import graph (ci-gate-e2e-coverage.mjs --mini-copy): each
e2e group the call asks for (for `all`, the tested commit's CLASS1_E2E) whose specs
reach a changed path under e2e/ gets a `MiniCopy: <group> <paths>` trailer, computed
before the alert check, the label and the pool hint, whose plans the copies change.
--no-mini-copy <reason> writes `MiniCopy: none (<reason>)` instead, for a head whose
copies already stand on an earlier one (a re-merge of master).

gate-plan.mjs runs a copy only where the original is off the mini (hosted, or on
EC2): in the guest for a guest-eligible group, else pinned to the exclusive host;
none for a LAUNCHD_E2E group outside the guest, a group already on the mini, or one
never on a Mac. Host copies join e2e_host as `e2e:<group> (mini copy)`. Guest copies
share jobs, since each guest job boots a VM of its own: e2e-copy runs up to three
groups one after another, each in a slot with its own bound, continue-on-error and
upload under `<slug>-mini`, and a verdict that fails the job and names each group.
A job stays within 90 minutes (ci-kit's 100-minute VM job bound less its 10): the
uplink margin once, then 15 minutes a group (the slowest hosted-eligible guest
groups' test steps took 7 minutes hosted, 5 in the guest), or its E2E_MINUTES.
The summary names each copy, its runner and paths, each candidate kept off and why,
or the opt-out's reason; a Lane: vm run now also names the groups it leaves off the
mini. Refused or red copies relaunch as their plain groups on the mini alone
(--lane vm or no-hosted), under a label of their own.

Sminos-Session: CI-opt#a45b97a3 (doperpowers on macbook)
no-unused-vars on the copies' paths dropped by destructuring, and no-useless-assignment
on the CLI's output, which both branches assign.

Sminos-Session: CI-opt#a45b97a3 (doperpowers on macbook)
Host copies take the mini's home label, [self-hosted, macOS, ARM64, ci-kit-mac-home]:
today's three labels alone match the EC2 Mac too, where a copy would pass without
touching the mini, and the alert check would accept it. LAUNCHD_E2E groups still get
none. No ci-gate flag reaches that label (--lane no-hosted leaves an unlisted group on
the three), so a refused or red host copy now joins the main relaunch under the run's
lane, whose plan hosts the original and copies it home again.

A guest slot's command runs in a process group of its own. Actions' step timeout ends
the step's shell alone, so a group cut at its bound went on running (pnpm, Playwright,
Electron) beside the next slot, sharing its reports and out/. Each later slot and the
verdict stop what a slot left (TERM, then KILL), sweep the LaunchAgents under LAUNCHD,
and the verdict line says the slot was cut and whether its processes had to be stopped.

A guest copy whose own bound passes a guest job's 90 minutes (35 + its E2E_MINUTES) no
longer opens a job over ci-kit's VM bound: it takes the home host, or no copy when it is
LAUNCHD_E2E, the reason in the summary.

The alert refusal's push-anyway line shell-quotes the call's arguments, so a
--no-mini-copy reason with spaces or a leading # survives a paste.

Sminos-Session: CI-opt#a45b97a3 (doperpowers on macbook)
… that is confirmed

The re-review's three gaps in reaping a slot cut at its bound.

A private host or supervisor spawns detached, in a session and group of its own
(detached-transport.ts), and the worker's exit hook that ends it does not run after a
SIGKILL, so killing the slot's group left it running. No existing sweep runs from the
shell (processes.ts's needs the profile), so a cut slot's reap also stops each process
working in the checkout or naming it or an e2e scratch root in its argv, but the
script's own ancestry.

The record holds the group leader's pid and start time; a live leader of another start
is a reused pid and is never signalled. KILL follows TERM only while the group is still
there, and is confirmed within 5 s: what outlives it fails the reap, so the next slot
does not start and the verdict is red, and its record stays for every later reap.

Sminos-Session: CI-opt#a45b97a3 (doperpowers on macbook)
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 14, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

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

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-14T02:00:50.656335Z 20f7d34 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.

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