Files
reverse-engineering-anything/.github/workflows/real-client-registration.yml
T
dependabot[bot]andVincent Koc b81002e05b build(deps): bump actions/checkout from 4.4.0 to 7.0.1 (#15409)
* build(deps): bump actions/checkout from 4.4.0 to 7.0.1

Bumps [actions/checkout](https://github.com/actions/checkout) from 4.4.0 to 7.0.1.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v4.4.0...3d3c42e5aac5ba805825da76410c181273ba90b1)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-version: 7.0.1
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>

* test(ci): identify the trusted checkout independently of its release

* test(ci): narrow workflow step uses before matching checkout

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Vincent Koc <vincentkoc@ieee.org>
2026-12-03 09:09:58 +08:00

165 lines
7.9 KiB
YAML

name: Native MCP registration
on:
workflow_dispatch:
schedule:
- cron: "31 8 * * 2"
pull_request:
paths:
- ".github/workflows/real-client-registration.yml"
- ".nvmrc"
- "package*.json"
- "scripts/rea.mjs"
- "scripts/verify-*-client.mjs"
- "scripts/verify/clients/**"
- "scripts/lib/**"
- "src/application/*Client*.ts"
- "src/application/Setup*.ts"
- "src/cli/**"
- "src/composition/**"
- "src/config/**"
- "src/contracts/**"
- "src/server/**"
- "!src/**/*.test.ts"
permissions:
contents: read
env:
TURBO_TOKEN: "${{ (github.ref == format('refs/heads/{0}', github.event.repository.default_branch) && (github.event_name == 'push' || github.event_name == 'schedule' || github.event_name == 'workflow_dispatch' || github.event_name == 'workflow_call')) && secrets.TURBO_TOKEN || '' }}"
TURBO_TEAM: ${{ vars.TURBO_TEAM }}
TURBO_CACHE: "${{ (github.ref == format('refs/heads/{0}', github.event.repository.default_branch) && (github.event_name == 'push' || github.event_name == 'schedule' || github.event_name == 'workflow_dispatch' || github.event_name == 'workflow_call')) && 'local:rw,remote:rw' || 'local:rw,remote:r' }}"
jobs:
scoped-catalog:
runs-on: ubuntu-latest
timeout-minutes: 12
strategy:
fail-fast: false
matrix:
include:
- client: codex
package: "@openai/codex"
version: "0.172.0"
- client: claude
package: "@anthropic-ai/claude-code"
version: "2.1.332"
- client: gemini
package: "@google/gemini-cli"
version: "0.70.0"
- client: opencode
package: "@opencode/cli"
version: "2.2.7"
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- name: Verify the catalog in an isolated native client
env:
CLIENT: ${{ matrix.client }}
CLIENT_PACKAGE: ${{ matrix.package }}
CLIENT_VERSION: ${{ github.event_name == 'schedule' && 'latest' || matrix.version }}
run: |
# Only tracked source and these three inputs enter the container.
git archive HEAD | docker run -i --name native-client --user node \
-e CLIENT -e CLIENT_PACKAGE -e CLIENT_VERSION \
-e REA_VERIFY_CODEX_FAILURE_PATH=/tmp/codex-registration-failure.json \
"node:$(cat .nvmrc)-bookworm" bash -eu -o pipefail -c '
cd "$(mktemp -d)"
tar -xf -
npm ci
npm install --prefix /tmp/native-client --no-package-lock --no-audit --no-fund "$CLIENT_PACKAGE@$CLIENT_VERSION"
PATH="/tmp/native-client/node_modules/.bin:$PATH" npm run "verify:${CLIENT}-client" -- scoped-chat
'
- name: Recover Codex failure report
if: failure() && matrix.client == 'codex'
id: diagnostics
run: |
report="$RUNNER_TEMP/codex-registration-failure.json"
if docker cp native-client:/tmp/codex-registration-failure.json "$report" && [[ -f "$report" && ! -L "$report" ]]; then
echo 'available=true' >> "$GITHUB_OUTPUT"
fi
- uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
if: failure() && steps.diagnostics.outputs.available == 'true'
with:
name: codex-registration-failure
path: ${{ runner.temp }}/codex-registration-failure.json
opencode-windows-native:
name: Build OpenCode Windows runtime controls
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
repository: ${{ github.event.pull_request.head.repo.full_name || github.repository }}
ref: ${{ github.event.pull_request.head.sha || github.sha }}
persist-credentials: false
- uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0
with:
node-version-file: .nvmrc
package-manager-cache: false
- uses: ./.github/actions/windows-cross-compiler
- run: corepack npm run build:windows-native
- run: corepack npm run verify:windows-native:artifact
- uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
with:
name: opencode-windows-native-controls
path: native/windows/build/
if-no-files-found: error
retention-days: 7
opencode-windows:
name: OpenCode V2 Windows packaged call
needs: opencode-windows-native
runs-on: windows-latest
timeout-minutes: 25
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
repository: ${{ github.event.pull_request.head.repo.full_name || github.repository }}
ref: ${{ github.event.pull_request.head.sha || github.sha }}
persist-credentials: false
- uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0
with:
node-version-file: .nvmrc
package-manager-cache: false
- run: corepack npm ci
- uses: actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333 # v8.0.2
with:
name: opencode-windows-native-controls
path: native/windows/build/
- run: corepack npm run verify:windows-native:artifact
- run: corepack npm run build:cached
- name: Install and exercise the exact-head package
env:
EXPECTED_SHA: ${{ github.event.pull_request.head.sha || github.sha }}
run: |
$ErrorActionPreference = 'Stop'
$PSNativeCommandUseErrorActionPreference = $true
$proof = Join-Path $env:RUNNER_TEMP 'opencode-windows-proof'
$packageDirectory = Join-Path $proof 'package'
$runtimePrefix = Join-Path $env:RUNNER_TEMP 'opencode-rea-runtime'
$clientPrefix = Join-Path $env:RUNNER_TEMP 'opencode-native-client'
New-Item -ItemType Directory -Force -Path $packageDirectory | Out-Null
$source = (git rev-parse HEAD).Trim()
if ($source -ne $env:EXPECTED_SHA) { throw 'Unexpected package source revision' }
$packed = corepack npm pack --json --silent --pack-destination $packageDirectory | ConvertFrom-Json
$tarball = Join-Path $packageDirectory $packed[0].filename
$digest = (Get-FileHash $tarball -Algorithm SHA256).Hash.ToLowerInvariant()
corepack npm install --prefix $runtimePrefix --no-package-lock --no-save --no-audit --no-fund $tarball
corepack npm install --prefix $clientPrefix --no-package-lock --no-audit --no-fund '@opencode/cli@2.2.7'
$env:REA_VERIFY_RUNTIME_ROOT = Join-Path $runtimePrefix 'node_modules/rea-agents'
$env:REA_VERIFY_OPENCODE_DIALECT = 'v2'
$env:REA_VERIFY_OPENCODE_COMMAND = Join-Path $clientPrefix 'node_modules/.bin/opencode.cmd'
node scripts/verify-opencode-client.mjs call | Tee-Object -FilePath (Join-Path $proof 'call.jsonl')
$receipt = Get-Content (Join-Path $proof 'call.jsonl') -Tail 1 | ConvertFrom-Json
if (!$receipt.passed -or !$receipt.evidenceSeen -or !$receipt.skillLoaded -or !$receipt.finalSeen -or $receipt.host.platform -ne 'win32') {
throw 'OpenCode did not complete the Windows packaged-runtime call'
}
@{ source_sha = $source; package_sha256 = $digest; client_version = $receipt.clientVersion } |
ConvertTo-Json | Set-Content -Encoding utf8NoBOM (Join-Path $proof 'provenance.json')
- uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
if: ${{ !cancelled() }}
with:
name: opencode-windows-call-proof
path: |
${{ runner.temp }}/opencode-windows-proof/call.jsonl
${{ runner.temp }}/opencode-windows-proof/provenance.json
if-no-files-found: warn
retention-days: 7