Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
# Protocol provenance verifies original file bytes on every platform.
Sources/CodexAdapter/Resources/Protocol/** -text
# Runtime notice provenance is bound to the original upstream bytes.
Vendor/SwiftWindowsRuntime/** -text
# Every platform archive must match the manifest stored at its release tag.
computer-mcp-plugin.toml -text
229 changes: 1 addition & 228 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,28 +4,13 @@ on:
push:
branches: [master]
workflow_dispatch:
inputs:
windows_sdk_revision:
description: 'Expected locked swift-codex commit for focused Windows checks; empty runs native packaging on both platforms'
required: false
type: string
windows_validation_scope:
description: 'Windows candidate checks; all remains the complete adapter gate'
type: choice
options: [all, host-mcp, database, artifact]
default: all
windows_artifact_run:
description: 'Completed source audit run whose exact linked Windows binary should be checked'
required: false
type: string
permissions:
contents: read
concurrency:
group: ci-${{ github.ref }}-${{ inputs.windows_validation_scope || 'all' }}
group: ci-${{ github.ref }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
jobs:
package:
if: ${{ inputs.windows_sdk_revision == '' }}
runs-on: macos-latest
timeout-minutes: 30
steps:
Expand Down Expand Up @@ -90,217 +75,5 @@ jobs:
if-no-files-found: error
retention-days: 14

windows-package:
if: ${{ inputs.windows_sdk_revision == '' }}
runs-on: windows-2022
timeout-minutes: 45
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
with:
persist-credentials: false
- uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7
with:
python-version: '3.13'
- uses: compnerd/gha-setup-swift@bbae8ce86bac5a3449f3992b3d88bc4ca25f2057
with:
swift-version: swift-6.2.3-release
swift-build: 6.2.3-RELEASE
- name: Validate native package ownership and inputs
shell: pwsh
run: |
python Scripts/version.py check
if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE }
foreach ($pattern in @('test_package*.py', 'test_windows*.py', 'test_protocol*.py', 'test_version.py')) {
python -m unittest discover -s Tests -p $pattern -v
if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE }
}
swift package resolve
if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE }
git diff --exit-code -- Package.resolved
if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE }
- name: Build the native archive and runtime receipt
shell: pwsh
run: |
python Scripts/package.py --output dist --configuration release
if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE }
git diff --exit-code -- Package.resolved computer-mcp-plugin.toml
if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE }
- uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7
with:
name: codex-plugin-windows-x86_64-${{ github.sha }}
path: |
dist/codex-plugin-windows-x86_64.zip
dist/receipt.json
if-no-files-found: error
retention-days: 14

windows-package-acceptance:
needs: windows-package
runs-on: windows-2022
timeout-minutes: 15
permissions:
actions: read
contents: read
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
with:
persist-credentials: false
- uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7
with:
python-version: '3.13'
- name: Download the exact package from this run
shell: pwsh
env:
GH_TOKEN: ${{ github.token }}
run: |
gh run download $env:GITHUB_RUN_ID --repo $env:GITHUB_REPOSITORY --name "codex-plugin-windows-x86_64-$env:GITHUB_SHA" --dir accepted-artifact
if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE }
- name: Check relocated package with app-local runtime
shell: pwsh
run: ./Scripts/check-windows-package.ps1 -ArtifactDirectory accepted-artifact -OutputDirectory .build/windows-package-acceptance
- name: Preserve exact archive acceptance
if: always()
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7
with:
name: codex-plugin-windows-package-acceptance-${{ github.run_id }}-${{ github.run_attempt }}
path: .build/windows-package-acceptance/evidence/
include-hidden-files: true
if-no-files-found: error

windows-candidate:
if: ${{ inputs.windows_sdk_revision != '' && inputs.windows_validation_scope != 'host-mcp' && inputs.windows_validation_scope != 'artifact' }}
runs-on: windows-2022
timeout-minutes: 45
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
with:
persist-credentials: false
- uses: compnerd/gha-setup-swift@bbae8ce86bac5a3449f3992b3d88bc4ca25f2057
with:
swift-version: swift-6.2.3-release
swift-build: 6.2.3-RELEASE
- name: Audit native dependencies and complete adapter source
shell: pwsh
env:
CODEX_CANDIDATE_REVISION: ${{ inputs.windows_sdk_revision }}
WINDOWS_VALIDATION_SCOPE: ${{ inputs.windows_validation_scope }}
run: |
$databaseOnly = $env:WINDOWS_VALIDATION_SCOPE -eq 'database'
./Scripts/validate-windows-candidate.ps1 -SDKRevision $env:CODEX_CANDIDATE_REVISION -DatabaseOnly:$databaseOnly
- name: Preserve Windows source audit
if: always()
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7
with:
name: codex-plugin-windows-source-${{ github.run_id }}-${{ github.run_attempt }}
path: .build/windows-candidate/evidence/
include-hidden-files: true
if-no-files-found: error

windows-process:
if: ${{ inputs.windows_sdk_revision != '' && (inputs.windows_validation_scope == '' || inputs.windows_validation_scope == 'all') }}
runs-on: windows-2022
timeout-minutes: 30
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
with:
persist-credentials: false
- name: Validate exact SDK input
shell: pwsh
env:
CODEX_CANDIDATE_REVISION: ${{ inputs.windows_sdk_revision }}
run: |
if ($env:CODEX_CANDIDATE_REVISION -cnotmatch '^[0-9a-f]{40}$') {
throw 'Windows process acceptance requires an exact SDK commit'
}
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
with:
repository: swift-library/swift-codex
ref: ${{ inputs.windows_sdk_revision }}
path: .build/windows-process-sdk
persist-credentials: false
- uses: compnerd/gha-setup-swift@bbae8ce86bac5a3449f3992b3d88bc4ca25f2057
with:
swift-version: swift-6.2.3-release
swift-build: 6.2.3-RELEASE
- name: Test exact production process sources in debug and release
shell: pwsh
run: ./Scripts/test-windows-process.ps1 -SDKPath .build/windows-process-sdk -OutputDirectory .build/windows-process
- name: Preserve native process acceptance
if: always()
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7
with:
name: codex-plugin-windows-process-${{ github.run_id }}-${{ github.run_attempt }}
path: .build/windows-process/evidence/
include-hidden-files: true
if-no-files-found: error

windows-host-mcp:
if: ${{ inputs.windows_sdk_revision != '' && inputs.windows_validation_scope != 'database' && inputs.windows_validation_scope != 'artifact' }}
runs-on: windows-2022
timeout-minutes: 20
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
with:
persist-credentials: false
- name: Validate exact SDK input
shell: pwsh
env:
CODEX_CANDIDATE_REVISION: ${{ inputs.windows_sdk_revision }}
run: |
if ($env:CODEX_CANDIDATE_REVISION -cnotmatch '^[0-9a-f]{40}$') {
throw 'Host MCP acceptance requires an exact SDK commit'
}
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
with:
repository: swift-library/swift-codex
ref: ${{ inputs.windows_sdk_revision }}
path: .build/windows-host-sdk
persist-credentials: false
- uses: compnerd/gha-setup-swift@bbae8ce86bac5a3449f3992b3d88bc4ca25f2057
with:
swift-version: swift-6.2.3-release
swift-build: 6.2.3-RELEASE
- name: Test inherited host pipes with the shipping MCP dependency
shell: pwsh
run: ./Scripts/test-windows-host-mcp.ps1 -SDKPath .build/windows-host-sdk -OutputDirectory .build/windows-host-mcp
- name: Preserve native host MCP acceptance
if: always()
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7
with:
name: codex-plugin-windows-host-mcp-${{ github.run_id }}-${{ github.run_attempt }}
path: .build/windows-host-mcp/evidence/
include-hidden-files: true
if-no-files-found: error

windows-artifact:
if: ${{ inputs.windows_validation_scope == 'artifact' && inputs.windows_sdk_revision != '' }}
runs-on: windows-2022
timeout-minutes: 15
permissions:
actions: read
contents: read
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
with:
persist-credentials: false
- uses: compnerd/gha-setup-swift@bbae8ce86bac5a3449f3992b3d88bc4ca25f2057
with:
swift-version: swift-6.2.3-release
swift-build: 6.2.3-RELEASE
- name: Check the exact linked native adapter
shell: pwsh
env:
GH_TOKEN: ${{ github.token }}
SOURCE_RUN: ${{ inputs.windows_artifact_run }}
SDK_REVISION: ${{ inputs.windows_sdk_revision }}
run: ./Scripts/check-windows-artifact.ps1 -SourceRun $env:SOURCE_RUN -SDKRevision $env:SDK_REVISION
- name: Preserve native artifact acceptance
if: always()
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7
with:
name: codex-plugin-windows-artifact-${{ github.run_id }}-${{ github.run_attempt }}
path: .build/windows-artifact/evidence/
include-hidden-files: true
if-no-files-found: error
brand:
uses: computer-mcp/.github/.github/workflows/brand-check.yml@f402911abcdfb87ef0c41a2759e8c51387b18935 # master
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# Changelog

## Unreleased

### Removed

- Windows support; the plugin ships only for macOS.
3 changes: 1 addition & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,7 @@ python3 -m unittest discover -s Tests -p 'test_*.py'
python3 Scripts/package.py --output OUTPUT_DIRECTORY --configuration release
```

CI also packages and checks the Windows x86_64 archive on a Windows runner and
runs the organization brand check. Exercise help, valid input and invalid input
CI also runs the organization brand check. Exercise help, valid input and invalid input
from outside the checkout. Keep command output contracts and generated resources
covered by tests.

Expand Down
41 changes: 14 additions & 27 deletions Documentation/Architecture/Package.md
Original file line number Diff line number Diff line change
@@ -1,23 +1,19 @@
# Package

The package uses Swift tools 6.2 and supports macOS 14 and Windows x86_64.
Windows archives use the reviewed Swift 6.2.3 runtime and pinned SQLite static
build. `CodexMCPAdapter` owns argument
handling; `CodexAdapter` owns configuration, MCP projection and Codex domain
implementation. Runtime tests live in `CodexAdapterTests`; command parsing tests
The package uses Swift tools 6.2 and supports macOS 14 or newer.
`CodexMCPAdapter` owns argument handling; `CodexAdapter` owns configuration,
MCP projection and Codex domain implementation. Runtime tests live in `CodexAdapterTests`; command parsing tests
live in `CodexMCPAdapterTests`. Computer MCP Core is not a
dependency.

## Dependencies

| Package | Responsibility |
| --- | --- |
| `computer-mcp/swift-sdk` transport fork | Standard northbound MCP transport, tools and results; native Windows stdio and complete POSIX frame writes |
| `computer-mcp/swift-sdk` transport fork | Standard northbound MCP transport, tools and results; stdio and complete POSIX frame writes |
| swift-codex | App Server client and Exec client, each with its own lifecycle |
| swift-subprocess 0.4.0 | Child process launch and line I/O on Apple platforms |
| swift-subprocess 0.4.0 | Child process launch and line I/O |
| swift-argument-parser 1.8.2 | Named options, schema-comparison subcommand, validation and generated CLI help |
| Apple Swift System 1.8.1 | Typed CRT descriptors for inherited Windows MCP pipe handles; already shared by the MCP dependency |
| Apple Swift Crypto 4.5.2 | SHA-256 on Windows; Apple platforms retain CryptoKit |
| GRDB 7.11.1 | Codex approval, runtime/thread ownership, acceptance run, worktree lease and managed-worktree storage and transactions |

`Scripts/verify-swift-codex-release-gate.sh` verifies that the manifest's exact
Expand Down Expand Up @@ -171,10 +167,8 @@ through unchanged. An initial directory or Git worktree is not OS isolation.
`CodexProcessEnvironment` preserves vendor state configuration and proxy
behavior while removing parent Codex session and Computer MCP launch metadata.
External Codex installation and user credentials remain user-owned.
Environment filtering uses native case-insensitive name comparison on Windows.
Proxy settings preserve the existing spelling and do not create case aliases;
ambiguous caller-supplied names remain subject to native launch validation.
Apple platforms retain distinct uppercase/lowercase proxy variables.
Environment names are case-sensitive. Proxy settings mirror a single inherited
uppercase or lowercase value while preserving explicitly configured distinct values.

App Server and Exec resolve the configured executable using the same
launch environment and workspace: absolute paths are direct, relative paths
Expand Down Expand Up @@ -276,17 +270,10 @@ acceptance before promoting an artifact to a public release.

## Inherited host channel

The host binds callbacks to its own immutable caller/workspace scope. macOS uses
an inherited connected Unix socket. The Windows transport accepts a paired read
and write byte-pipe handle through `COMPUTER_MCP_HOST_READ_HANDLE` and
`COMPUTER_MCP_HOST_WRITE_HANDLE`, alongside the host context. Handles must be
canonical decimal values, distinct, inherited, and separate from standard I/O.
Ambiguous environment keys, partial pairs, files and message pipes are rejected.

Admission clears inheritance and bridges owned duplicates through Swift System's
CRT descriptor type. Once the MCP transport has duplicated the handles for native
I/O, the adapter closes the inherited originals and CRT intermediates. The owning
MCP transport supplies framing, bounded queues, cancellation and native I/O joins;
the adapter retains one connection/close task. Callback metadata is removed from
vendor environments. Windows native transport evidence is separate from a complete
host launch, adapter artifact or authenticated model acceptance.
The host binds callbacks to its own immutable caller/workspace scope over an
inherited connected Unix socket. `COMPUTER_MCP_HOST_FD` selects a canonical
descriptor from 3 through 9 alongside the host context. The transport requires
a connected stream socket, sets close-on-exec and nonblocking mode, and bounds
message sizes, queued data and write deadlines. Disconnect closes the owned
descriptor and joins active I/O. Callback metadata is removed from vendor
environments.
4 changes: 2 additions & 2 deletions Documentation/Architecture/VersioningAndRelease.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ Accept the complete host/plugin/SDK combination before delivery. Create a formal
signed tag only for the accepted commit; `release.yml` promotes the
already-built artifact from its verified source run into the matching draft.
The upload verifies every platform archive's inventory and manifest against the
formal tag before uploading any asset. It promotes both declared native archives
and their receipts from the same successful source run without rebuilding.
formal tag before uploading any asset. It promotes the declared macOS archive
and its receipt from the successful source run without rebuilding.
An already uploaded asset must have the same digest; conflicting bytes fail.
Candidate retries keep the intended product version and use a new run identity.
A public tag and archive remain immutable. Only changed components are released.
Expand Down
Loading
Loading