Skip to content

ci: overflow hosted Mac e2e to EC2 during queue peaks - #322

Merged
SSFSKIM merged 3 commits into
masterfrom
hosted-overflow-ec2
Oct 29, 2026
Merged

SSFSKIM merged 3 commits into
masterfrom
hosted-overflow-ec2

Conversation

@SSFSKIM

@SSFSKIM SSFSKIM commented Oct 29, 2026 •

Copy link
Copy Markdown
Owner

Summary

When the account's hosted-Mac queue is backed up, place direct-hosted-eligible e2e groups on ci-kit-mac-ec2 only if its queue is shorter. Nothing moves without a fresh readable sample. Home, measured, live, secret, pool, reserved-final and otherwise non-hosted work retain their existing routing. The mini is never an overflow target.

The architect owns landing. This worker will not merge.

Proposed Decision Log entry (architect to number)

ci-gate samples the hosted macOS jobs queued/running across SSFSKIM/MAWS, cua, doperpowers, ci-kit and private manim-master, plus the EC2 runner's state and its compatible queued jobs. It uses the caller's gh token, not GITHUB_TOKEN. A Mac-Backlog: JSON trailer carries the sample into the tested commit. A 60-second atomic per-machine cache shares reads; an in-flight count never makes a sibling wait. Each sample has at most 60 requests and a 45-second deadline; each request has at most 10 seconds. Failed, missing, malformed, future or older-than-five-minute samples preserve existing placement. Offline EC2 never receives overflow.

The MAWS self-hosted count must finish; truncating it would incorrectly favor EC2. Every MAWS runners/runs/jobs page, including the final page, must contain exactly the number of rows its total_count implies; a mismatch fails open. Once it is complete, hitting the call cap in another repository yields an explicitly disclosed hosted lower bound, which favors today's hosted placement. An unreadable repository is a failed sample, not silently omitted. The caller's token successfully read all five repositories in the observed sample.

The backlog trailer is excluded from both the default-ref hash and the committed planner inputs used to derive that identity, so a relaunch of the same work supersedes its predecessor regardless of either placement. The planner is pure: its caller supplies the current time. In gate order, EC2 jobs ahead are busy + EC2 queued + this run's overflowed groups; hosted full rounds ahead are max(0, floor((hosted queued + running + this run's hosted groups - 5) / 5)). Overflow only when the former is strictly smaller; a tie stays hosted. These are queue-depth estimates, not duration predictions or reservations.

Overflow requests [self-hosted, macOS, ARM64, ci-kit-mac-ec2], uses the self-hosted setup and the group's minutes plus the ten-minute exclusive-instance start wait, and keeps direct hosting's one Playwright retry and aggregate MAWS flaky annotation. Its job name is e2e:<group> (EC2 overflow), preserved in ci-gate's tail. Peer holders/waiters and refusal relaunches recognize the suffix; artifacts and group identities remain unchanged. Existing prefix-based flake collection still recognizes the job and its runner. The preflight checks the EC2-specific label, so a free mini cannot mask an EC2 alert.

HOSTED_MAC_ONLY_E2E in gate.yml is the exclusion list for EC2-only reds. It is initially empty for the reasons below. Decision Log 123 remains binding: an EC2-only red is rerun on the mini before counting as a regression, and a group proved red only on EC2 leaves overflow immediately.

Parity audit before this PR

Hosted reference: job 123180082301, image macos-26-arm64 20261013.0424.1. EC2 reference: read-only SSH checks and job 123162480732. No host setting was changed; no osascript ran over SSH.

Dimension Hosted macos-26 ci-kit-mac-ec2 Consequence
macOS 26.6.2 (25G83) 27.0 (26A428), the mini's build Not identical; the existing mini baselines are the bridge, not a claim of image equivalence.
Hardware Virtual M1, 3 CPUs, 7 GiB mac-m4.metal, 10 CPUs, 24 GiB Queue-depth heuristic deliberately makes no timing-equivalence claim.
Display 1920×1080 at 1× 2560×1440 at 2×, the mini's geometry Measured groups remain home-only.
Dock / visible frame Autohide on; 1920×1049 Autohide off; 2560×1332 EC2's larger usable frame does not need the hosted clamp workaround.
Scrollbars Setup writes WhenScrolling (Automatic had legacy gutters) Preference unset / Automatic; AppKit NSScroller.preferredScrollerStyle = 1, overlay, verified read-only No preference mutation is needed for overflow.
Node used by jobs setup-node 22, observed v22.23.3 setup-node 22, observed v22.23.4 EC2's login-shell v26 is not the job runtime.
Xcode / compiler Image default Xcode 26.6 (17F113), multiple full Xcodes; CLT 27; clang 21 CLT only, /Library/Developer/CommandLineTools; Apple clang 21.0.0 Overflow adds no packaged/Xcode job; ordinary e2e uses the established self-hosted setup.
Fonts Image's system fonts; shared .github/ci-setup.sh installs MesloLGM Nerd Font Mono 3.5.1 (confirmed in hosted log) System fonts plus Arial Unicode MS and all four Meslo files Both have the declared test font; a complete system-font inventory equality is not verified across OS versions.
Document tools LibreOffice / Poppler when a group asks Full declaration already present Self-hosted setup remains unchanged.

No hosted-only setup step is copied to EC2. Display, Dock, scrollbar preferences and cask state are not changed by this feature.

Every supplied EC2 red

  • packaged runs 40733229010, 40736955873, 40740460276, and default runs 40745591686, 40748613136, 40759269426, 40756212718: the checked-out sessions.spec.ts contains the obsolete passRelay(page) after a direct fork and lacks ci: admit unsigned packaged gate to direct hosted Macs #297 / 4c3dd29. ci: admit unsigned packaged gate to direct hosted Macs #297 documents the same bug on the mini (40471243073) and corrects the test to assert the inherited direct route. These are not current-tree EC2 parity evidence. Neither packaged nor default is newly eligible for overflow.
  • lane-a run 40756211265 and default run 40756212718: logs show the failure at lane-a.spec.ts:416, not the test title's one-second timing bound. The Overview card selector used a bare app ID instead of its lifted address. Branch fix d81b144 corrects that exact selector. lane-a is not on today's automatic hosted list; default never overflows.
  • default run 40786951312 (ci/o8m5f-53f147ef): its tree has ci: admit unsigned packaged gate to direct hosted Macs #297 but predates 54aab1a and contains O8 M5's unconditional People hover button, which steals the center click on the narrow project row. The architect identified and fixed that branch regression on hosted. This is not an EC2-only failure; default never overflows.

Hosted-only list: empty. None of the supplied reds establishes the same tree green elsewhere and red only on EC2. This is not per-group EC2 admission. Every current HOSTED_MAC_E2E group and the direct peer group cross-build relies on its existing mini baseline, rather than a newly collected same-tree EC2 comparison. The historic successful connectors-oauth runs are not overflow admission: that group remains secret/non-hosted. The live run below is additional evidence only for its named groups.

Verification

  • Focused local TDD: placement tests first failed (82/86), then passed 86/86; the final planner file passes 87/87. Sampler tests first failed 0/6, then passed 6/6; additional cap/pagination/deadline tests now pass 9/9, including a cap-before-MAWS regression observed red before its fix. New workflow retry/name and four consumer regressions were each observed red, then green.
  • Existing focused files: peer holder/waiter 38/38; refusal relaunches 19/19; alerts 32/32 plus the new committed-planner-to-alert test; pool-demand 18/18. Launcher 23/23 using the already-installed global TypeScript parser via NODE_PATH (no dependency installation; remote static supplies lockfile-accurate validation).
  • Pre-review-fix static through a pristine master ci-gate: GREEN, 40803515530, on head 9800357. Typechecks, lint, build and 400/400 gate-script tests passed. Earlier-head static 40803264776 was cancelled as superseded, not counted as evidence.
  • Live wave run through this branch's own ci-gate: GREEN, 40803882214, attempt 1, on pre-review-fix head 9800357. The review fixes below do not change the placement rule or workflow. The committed sample is 21 hosted queued + 5 running, EC2 idle, EC2 queue 0, no truncation, at 2026-10-29T02:00:59.154Z. The actual plan log sends all four groups below to EC2; the jobs' recorded runner_name confirms each placement. The wrapper commit 8860f5a has parent 9800357 and the same tree 1564fa896a611c3252943fcbf96a64ee0373a662.
Group Planned Actual runner_name Result Job id
document EC2 overflow ci-kit-mac-ec2 19 passed 123218142830
settings EC2 overflow ci-kit-mac-ec2 13 passed 123218142761
browser-chrome EC2 overflow ci-kit-mac-ec2 7 passed 123218142891
available EC2 overflow ci-kit-mac-ec2 2 passed 123218142894

All four logs show MAWS_E2E_RETRY: 1; none needed a retry or emitted a flaky notice. All names and ci-gate's final success lines include (EC2 overflow). Total: 41 passed, no failures. These four groups now have this additional EC2 evidence; the other eligible groups still rely on their mini baselines. This is not a full same-tree cross-runner admission campaign.

  • No full suite ran on the MacBook. No independent reviewer was dispatched by the worker; CI-opt owns review.

Verified review fixes and final head

Final head: 97eda58. CI-opt verified the reviewer-medium findings and requested these changes:

  1. Complete MAWS pages: validate the final page as well as earlier pages of runner, run and job lists before using their rows. Regression tests reject advertised-but-missing rows, including a missing 101st job on page two.
  2. Stable default ref: remove Mac-Backlog before both hashing the identity and invoking its committed planner. The regression exercises absent, overflowing and non-overflowing samples: the placements differ when planned normally, but all three produce the same default label.
  3. Deferred lock race: one row in docs/tech-debt-tracker.md records the stale-lock takeover race, its duplicate-read / ENOENT fail-open consequence, and ownership-safe takeover plus per-process temporary files as the closing condition. No lock-race fix was added.

Both behavior regressions were observed failing before implementation; the focused sampler file now passes 10/10 and identity file 8/8. Final-head remote static through the pristine master launcher is GREEN, 40804968791: typechecks, lint, build and 402/402 gate-script tests passed.

Strict-check live sampling

Ten direct sampleBacklog() calls bypassed the cache, with 20 seconds between completed calls, from 2026-10-29 02:10:34Z to 02:15:13Z. 10/10 succeeded; 0/10 failed open (0%); 0 strict-pagination mismatches; no truncated counts. Each call read all five repositories. Durations were 8.1–12.6 seconds; observed hosted queues ranged from 8 to 11, running jobs from 4 to 5, and EC2 was idle with no compatible queued work. The strict rule was not loosened. This is a finite live sample, not a guarantee that GitHub's filtered totals never drift.

The earlier live run remains the placement evidence: all four actual runner names were ci-kit-mac-ec2, 41 tests passed, with the retry flag set and no retries needed. It was intentionally not repeated after these sampler/identity-only review fixes.

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

Sample the account backlog with the caller token, cache bounded reads, and let the pure planner choose EC2 without moving home or measured work. Preserve retry notices, name overflow jobs, and keep peer/refusal/alert consumers aware of that placement.

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

chatgpt-codex-connector Bot commented Oct 29, 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-29T02:02:36.397990Z 55aad66 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.

Cover complete queue pagination, status-transition deduplication and the deadline in the sampler tests.

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

@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: 55aad66987

ℹ️ 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
case $gates in
all|*e2e:*|*unit*) backlog_trailer=$(node "$(dirname "$0")/ci-gate-backlog.mjs") || backlog_trailer='' ;;
esac
[[ -z $backlog_trailer ]] || trailers+=$'\n'"$backlog_trailer"

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 Exclude the backlog timestamp from the default ref identity

For direct-route calls without --label, adding this trailer before deriving the label makes each refreshed sample change the ref, even when queue depths and resulting placement are identical. scripts/ci-gate-identity.mjs hashes Mac-Backlog: verbatim because its advisory-trailer filter does not exclude it, so changing only the sample's at produces a different label. Since .github/workflows/gate.yml:73-75 scopes cancellation to github.ref, an otherwise identical relaunch after the 60-second cache expires no longer supersedes its queued or running predecessor, allowing duplicate work to compound the backlog. Exclude the advisory sample from the identity hash while retaining the resolved placement outputs.

Useful? React with 👍 / 👎.

…tity

Reject short final pages before advising EC2 overflow. Strip queue samples before both identity hashing and its committed-planner call so identical work still supersedes itself. Record the fail-open stale-lock takeover race for the next CI-hygiene wave.

Sminos-Session: CI-opt#a45b97a3 (doperpowers on macbook)
@SSFSKIM
SSFSKIM merged commit fadd605 into master Oct 29, 2026
SSFSKIM added a commit that referenced this pull request Oct 29, 2026
…C2 Mac at queue peaks (#322)

Sminos-Session: GUI AI agent workspace charter#37052769 (MAWS on macbook)
SSFSKIM added a commit that referenced this pull request Oct 29, 2026
…'s start

rows.ts keeps O8 M5's memberNames import and takes repoProjectId from @shared/machine/project-ids, where M3 moved it.

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