Skip to content

gate: hosted Macs, the routing, the waiter and the readers (hosted Macs M2) - #154

Merged
SSFSKIM merged 5 commits into
masterfrom
hosted-mac-m2
Oct 26, 2026
Merged

SSFSKIM merged 5 commits into
masterfrom
hosted-mac-m2

Conversation

@SSFSKIM

@SSFSKIM SSFSKIM commented Oct 26, 2026

Copy link
Copy Markdown
Owner

M2 of ci-kit's spec docs/doperpowers/specs/2026-10-26-maws-hosted-mac-design.md (branch maws-hosted-mac-spec), on M1 (#151). It wires the hosted Macs into the gate: under Lane: hosted, or for groups on the new HOSTED_MAC_E2E list (empty until M3), a macOS run's eligible e2e groups run on GitHub's hosted Macs through SSFSKIM/maws-app. Each one is still a private job e2e:<group> whose verdict is the hosted job's.

  • Placement (gate-plan.mjs, gate.yml): the new lists HOSTED_MAC_E2E (empty) and MAC_SECRET_E2E (connectors-oauth, discover), the e2e_hosted output and the e2e-hosted job.
    • A group is eligible unless it is default, measured, live, secret or POOL_E2E. A live run hosts nothing, and neither does a Linux lane.
    • Lane: hosted hosts every eligible group of the run, and the summary names the ones it held back. Lane: no-hosted hosts none. Under Lane: vm the guest wins for a group on both lists.
    • A HOSTED_MAC_E2E entry that is not eligible refuses every run, static included, and names each reason.
    • A hosted entry is in e2e and e2e_hosted, on ["self-hosted","ci-kit-pool","cpus-2"] with a 100-minute timeout. It is not in e2e_host, e2e_vm or e2e_build, so DefaultBeside and pool demand count it unchanged.
  • The waiter (.github/scripts/hosted-mac.sh), steps 2 and 4–6 of the spec's flow:
    • Key handling: the deploy key (MAWS_APP_DEPLOY_KEY) goes to a 0600 file. It connects with pinned GitHub host keys and IdentitiesOnly, falls back to port 443, and refuses a RUNNER_TEMP that is not a plain path.
    • The request: it cancels earlier attempts of its own run and group, with lease-guarded pushes. It filters $GITHUB_SHA and secret-scans only the files that differ from main, and a finding pushes nothing and fails the job.
    • It then commits the request with the Provenance trailers and pushes it with --no-thin, from a blob-less clone with GIT_NO_LAZY_FETCH.
    • The main refresh: main is fast-forwarded only when it is more than a day old and the requested commit is on MAWS master (compare API, tree checked).
    • The wait: it polls ci/result/<suffix> over git every 30 s, accepts only a result whose sole parent is the request, prints the verdict, the hosted run's URL and the body, and deletes both refs.
    • Deadline and cleanup: past the 95-minute deadline it prints hosted: no result by …, cancels its request and exits 1. --cleanup cancels a request that never got its result.
  • The readers:
    • ci-gate.sh --lane hosted|no-hosted.
    • The alert preflight takes a run's Mac jobs from the tested commit's own plan, so a hosted-only run proceeds past a mini alert.
    • The download of a failed hosted job's report from maws-app, in scripts/ci-gate-hosted.sh, with the caller's gh login.

Validation Evidence

  • Class 1a static on the head 605cea6 (gate-offload Decision Log 57): scripts/ci-gate.sh … --gates static → run 40286497884 success, gate-script tests 200/200.
    • Focused files, run on this machine one at a time: gate-plan.test.mjs, hosted-mac.test.mjs 10/10, ci-gate-alerts.test.mjs 24/24, ci-gate.test.mjs 10/10, ci-gate-pool-demand.test.mjs 16/16 and ci-gate-hosted.test.mjs.
  • The tests pin:
    • placement on every lane;
    • the refusal of a list naming an ineligible group;
    • the waiter against a local bare repository standing in for maws-app: its tree equals the filter's, and its trailers are Provenance's;
    • success exits 0 and failure 1, with both refs deleted;
    • a result with a foreign parent is ignored;
    • the deadline cancels and exits 1, and --cleanup cancels;
    • attempt 2 cancels attempt 1;
    • the refresh only fast-forwards, and only from landed work;
    • a scan finding pushes nothing;
    • an unsafe RUNNER_TEMP is refused before the key is written.
  • Acceptance 1: scripts/ci-gate.sh 991d6b95e --gates e2e:document-app,e2e:transcript --runner macos --lane hosted → run 40280116546 success. The maws-app runs were 40280193280 and 40280199856.
    • Both e2e: jobs ran on pool cpus-2 boxes.
    • Each request's MAWS-Source is the run's nonce commit, whose first parent is 991d6b9, and its MAWS-Source-Tree is 991d6b9's tree.
    • The hosted logs read display 1920x1080@1x.
    • No ref of the run is left.
    • After the fix waves, run 40284028971 (--gates e2e:document-app --lane hosted on b7a64e9) is green over the real SSH remote. The last wave added only the path guard ahead of that path.
  • Acceptance 2: a scratch commit breaking e2e/document.spec.ts:154 → run 40280116977 red (maws-app run 40280195275).
    • ci-gate printed RED with the failed test's name in the log tail.
    • The hosted report landed under /tmp/maws-review/gates/ci-6f1e5a8a/.
  • Acceptance 3: rerunning that job made attempt 2, with a new request on the same MAWS-Source; it failed the same way (40281407904). The revert's run 40281350065 is green.
  • Acceptance 4: run 40281362983 was cancelled while waiting. The cleanup pushed a cancel, and the hosted job ended cancelled 48 s after the private cancel (40281460980).
  • Acceptance 5: the filter re-run on a request's MAWS-Source gives tree 3069d91d, the request's tree.
  • Acceptance 6:
    • Scratch token: a random ghp_ token on a scratch commit → run 40280116914 red, with maws-app-scan: src/scratch-token.ts:3 github-pat and hosted: secret scan refused the push. No ref and no run reached maws-app.
    • The grep over acceptance 1's request tree is clean.
  • Acceptance 7:
    • hosted-mac.yml has no secrets. reference and no pull_request trigger.
    • Fork-PR approval is all_external_contributors.
    • maws-app has no runners.
    • Its only key is the deploy key 167668630 maws-hosted-mac.
    • Ruleset 25857219 blocks deletion and non-fast-forward pushes on main.
  • Reviews:
    • a spec-compliance task review, and doperpowers:reviewer-high (the spec's rung for M2);
    • three findings, fixed over two waves:
      • the preflight's flag shortcut ran before the tested commit's plan;
      • shell quoting of the key paths in GIT_SSH_COMMAND;
      • ssh's list parsing of the known-hosts path, now refused at the boundary;
    • both reviews clean at 605cea6.

The branch is on f783456. Master has since moved (#153), touching no file here.

Residue

  • The main refresh has not run live yet. maws-app's main was under a day old during the acceptance runs. The unit tests cover every branch; the first real refresh will come from a run after this lands, a day after M1's main move.
  • desk-web-hub is eligible by Placement's rule but its hosted run is unproven. Its hub suite builds with Vite and drives the system Chrome. It is not a class-1 group, so only a run naming it under Lane: hosted hosts it. Whether to prove it or exclude it is the architect's call.
  • The waiter's log carries maws-app's remote: Create a pull request … lines, four per request. It is cosmetic; filtering ^remote: as ci-gate.sh does is a one-line change.

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

On a macOS lane an eligible e2e group on HOSTED_MAC_E2E (empty), or every
eligible group of a run under `Lane: hosted`, becomes the e2e-hosted job: a
waiter on the pool's cpus-2 box, named e2e:<group>, which pushes the run's
filtered tree to SSFSKIM/maws-app after a secret scan of what it adds, waits
over git for the group's hosted result and exits with its verdict.
`Lane: no-hosted` hosts none. default, measured, live, MAC_SECRET_E2E
(connectors-oauth, discover) and POOL_E2E groups never go hosted, and a list
naming one is refused (ci-kit's hosted-Mac spec, Placement and The flow of
one hosted group).

Sminos-Session: CI-opt#a45b97a3 (doperpowers on macbook)
… preflight, the hosted report

ci-gate.sh takes --lane hosted and no-hosted into the Lane: trailer and
downloads a failed hosted group's report from the maws-app run its waiter
names. The alert preflight reads the run's Mac jobs from the tested
commit's plan, so a run whose e2e groups are all hosted goes ahead past a
mini alert, and guestRun tells no Mac job (`none`) from needing the host.
The pool-demand hint's tests count a waiter as one cpus-2 box.

Sminos-Session: CI-opt#a45b97a3 (doperpowers on macbook)
…re any no-Mac shortcut

The preflight returned "no Mac job" from the flags and this checkout's
POOL_E2E before it ran the tested commit's plan, so a target whose lists
differ could pass an open mini alert with a group its own plan puts on the
Mac. The plan now decides first; the flags' estimate stands only when the
plan cannot be run.

Sminos-Session: CI-opt#a45b97a3 (doperpowers on macbook)
git runs GIT_SSH_COMMAND through a shell, and the paths sat between bare
single quotes, so a RUNNER_TEMP with an apostrophe broke them and shell
syntax in it ran with the deploy key loaded. Each path is now quoted as a
shell word.

Sminos-Session: CI-opt#a45b97a3 (doperpowers on macbook)
… key is written

Quoting the paths for git's shell was not enough: OpenSSH splits
UserKnownHostsFile on whitespace itself. Real runners' temp paths are
plain, so the waiter now refuses any state path outside [A-Za-z0-9/._-]
with a hosted: line before it writes anything, and the ssh command takes
the paths as they are.

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

chatgpt-codex-connector Bot commented Oct 26, 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-26T07:45:14.219089Z 605cea6 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.

@SSFSKIM
SSFSKIM merged commit ddef5e2 into master Oct 26, 2026
SSFSKIM added a commit that referenced this pull request Oct 26, 2026
…PRs #151, #154); two debt rows (browser-comment's dpr cases, presentations' sample index)

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