Skip to content

ci: check a dispatched image with the engine-set script - #443

Merged
jencryzthers merged 3 commits into
mainfrom
cursor/image-gate-engine-check-f362
Oct 14, 2026
Merged

jencryzthers merged 3 commits into
mainfrom
cursor/image-gate-engine-check-f362

Conversation

@jencryzthers

@jencryzthers jencryzthers commented Oct 14, 2026 •

Copy link
Copy Markdown
Member

What changed

The manual gate (file unchanged: gox-image-gate.yml, title GOX image gate) now:

  • binds inputs.image to env.IMAGE and quotes "$IMAGE" (from ci: pass the image ref through env in the image gate #431, merged)
  • extracts /app/engines/manifest.json and runs scripts/engine-image-gate.mjs --manifest … --image "$IMAGE"
  • fails closed if the lock is empty or has no engines
  • invokes the CLI via realpath (a symlink still gates)
  • probes each lock binary's --version in the image, not only the manifest

The title stays GOX image gate so it does not collide with #437's renamed image gate workflow.

Why

A dispatch string must not be interpolated in the run: script. A missing lock must not pass. A symlink invocation must not exit 0 without checking. A baked manifest can lie; the binaries have to be present and print a version.

Preuve

HEAD

4fd9ea58aa5b0e16a48c5075b848725670047303

Env (no interpolation)

The check step sets IMAGE: ${{ inputs.image }}. The run: script uses "$IMAGE" only.

Valid manifest

$ node scripts/engine-image-gate.mjs --manifest valid.json
exit=0
stderr=""

Invalid manifest (engineSet: "none")

$ node scripts/engine-image-gate.mjs --manifest none.json
exit=1
stderr="[engines] engine_missing engineSet is none
[engines] engine_missing missing engines: claude,codex,pi,gemini,kimi,qwen,opencode,droid,grok,cursor,hermes"

Missing manifest

$ node scripts/engine-image-gate.mjs --manifest absent.json
exit=1
stderr="[engines] ENOENT: no such file or directory, open '…/absent.json'"

Malformed JSON

$ node scripts/engine-image-gate.mjs --manifest bad.json
exit=1
stderr="[engines] Expected property name or '}' in JSON at position 1 (line 1 column 2)"

Empty lock (fail closed)

$ node scripts/engine-image-gate.mjs --lock empty-lock.json --manifest valid.json
exit=1
stderr="[engines] lock has no engines"

Symlink

$ node ./gate
exit=1
stderr="[engines] --manifest, --labels, --startup-log or --image is required"

(./gate is a symlink to scripts/engine-image-gate.mjs. Same path without a check would have exited 0.)

Image binaries

assessEngineBinaries plus a fake docker on PATH: every lock bin --version prints a line → exit 0; claude missing (exit 127) → exit 1, claude: claude missing or --version failed.

Suite

$ pnpm exec vitest run scripts/engine-image-gate.test.mjs scripts/image-gate-env.test.mjs scripts/gox-deploy.test.mjs
 Test Files  3 passed (3)
      Tests  22 passed (22)

pnpm lint, pnpm typecheck, and i18n:check exited 0 on this revision (pre-push hook).

Open in Web Open in Cursor 

Rename the workflow title. Extract the baked manifest and run
scripts/engine-image-gate.mjs so the manual gate uses the same
production check as the image build. Prove a full manifest exits 0
and engineSet none exits 1.
Take the image-gate env binding from #431 so the dispatch ref is no
longer interpolated inside the run script.
Bind the dispatch image through IMAGE. An empty lock or a lock without
engines exits non-zero. Invoke the CLI via realpath so a symlink still
gates. After the manifest check, --image runs each lock binary's
--version in the image. Missing or malformed manifests fail. The
workflow title stays GOX image gate so it does not collide with the
renamed public workflow.
@jencryzthers
jencryzthers marked this pull request as ready for review October 14, 2026 04:28
@jencryzthers
jencryzthers merged commit fbda755 into main Oct 14, 2026
34 of 35 checks passed
cursor Bot pushed a commit that referenced this pull request Oct 14, 2026
Bring in #438 and #443 so the draft is not behind main again.
@jencryzthers
jencryzthers deleted the cursor/image-gate-engine-check-f362 branch October 14, 2026 11:32
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.

2 participants