diff --git a/.githooks/commit-msg b/.githooks/commit-msg deleted file mode 100755 index 28e4c8c..0000000 --- a/.githooks/commit-msg +++ /dev/null @@ -1,24 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail - -MSG_FILE="${1:-}" -if [[ -z "$MSG_FILE" || ! -f "$MSG_FILE" ]]; then - echo "commit-msg hook: missing commit message file" >&2 - exit 1 -fi - -FIRST_LINE="$(sed -n '1p' "$MSG_FILE" | tr -d '\r')" - -if [[ "$FIRST_LINE" =~ ^Merge\ ]] || [[ "$FIRST_LINE" =~ ^Revert\ \" ]] || [[ "$FIRST_LINE" =~ ^fixup!\ ]] || [[ "$FIRST_LINE" =~ ^squash!\ ]]; then - exit 0 -fi - -PATTERN='^(build|chore|ci|docs|feat|fix|perf|refactor|revert|style|test)(\([a-z0-9._/-]+\))?(!)?: .+$' -if [[ ! "$FIRST_LINE" =~ $PATTERN ]]; then - cat >&2 <<'EOERR' -Commit message does not follow conventional format. -Expected: (): -Allowed types: build chore ci docs feat fix perf refactor revert style test -EOERR - exit 1 -fi diff --git a/.github/ISSUE_TEMPLATE/_config.yml b/.github/ISSUE_TEMPLATE/_config.yml deleted file mode 100644 index 0086358..0000000 --- a/.github/ISSUE_TEMPLATE/_config.yml +++ /dev/null @@ -1 +0,0 @@ -blank_issues_enabled: true diff --git a/.github/ISSUE_TEMPLATE/bug.md b/.github/ISSUE_TEMPLATE/bug.md deleted file mode 100644 index 1e5cbe0..0000000 --- a/.github/ISSUE_TEMPLATE/bug.md +++ /dev/null @@ -1,36 +0,0 @@ ---- -name: Bug report -about: Report a problem in the package, repository docs, or GitHub/community surface -title: "[Bug]: " -labels: ["bug"] -assignees: [] ---- - -## Summary - -Describe the bug clearly and briefly. - -## Affected Area - -Select or describe the area involved: - -- package behavior or published guidance -- build, test, or repository setup -- repository documentation or structure -- GitHub or community-health files - -## Expected Behavior - -What did you expect to happen? - -## Actual Behavior - -What happened instead? - -## Reproduction - -List the smallest steps needed to reproduce the problem. - -## Notes - -Add any context that may help reviewers understand the issue faster. diff --git a/.github/ISSUE_TEMPLATE/feature.md b/.github/ISSUE_TEMPLATE/feature.md deleted file mode 100644 index 60c7253..0000000 --- a/.github/ISSUE_TEMPLATE/feature.md +++ /dev/null @@ -1,33 +0,0 @@ ---- -name: Feature request -about: Request a package, docs, or governance improvement -title: "[Feature]: " -labels: ["enhancement"] -assignees: [] ---- - -## Summary - -Describe the requested change briefly. - -## Requested Area - -Select or describe the area involved: - -- package improvement -- repository documentation or structure -- GitHub or community-health surface -- governance or contributor guidance - -## Why - -What problem does this solve? - -## Boundary Impact - -Does this change affect repository structure, documentation placement, or the -public governance surface? - -## Notes - -Add constraints, examples, or related issues if helpful. diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 0166c63..59f475a 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -1,22 +1,10 @@ version: 2 - updates: - package-ecosystem: swift directory: / schedule: interval: weekly - open-pull-requests-limit: 2 - groups: - swift: - patterns: ["*"] - update-types: [minor, patch] - - package-ecosystem: github-actions directory: / schedule: interval: weekly - open-pull-requests-limit: 2 - groups: - actions: - patterns: ["*"] - update-types: [minor, patch] diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md deleted file mode 100644 index 0f155f2..0000000 --- a/.github/pull_request_template.md +++ /dev/null @@ -1,25 +0,0 @@ -## Scope - -What changed? - -## Why - -Why is this change needed? - -## Affected Area - -Which area does this PR affect? - -- package behavior or public guidance -- repository docs or structure -- governance or contributor guidance -- GitHub templates or collaboration configuration - -## Boundary Impact - -Does this change affect repository structure, documentation placement, or the -GitHub/community surface? - -## Review Notes - -Anything reviewers should focus on? diff --git a/.github/release.json b/.github/release.json new file mode 100644 index 0000000..bf92dc7 --- /dev/null +++ b/.github/release.json @@ -0,0 +1,40 @@ +{ + "repository": "swift-library/swift-codex", + "version_file": "VERSION", + "version_pattern": "^([^\\n]+)\\n?$", + "changelog": "CHANGELOG.md", + "check_command": "Scripts/check", + "minimum_swift": "6.2", + "platforms": { + "macOS": [ + 15, + 26, + 27 + ] + }, + "ci": { + "include": [ + { + "name": "macos-15-swift-6.2", + "runner": "macos-15", + "xcode": "26.0.1", + "command": "Scripts/check --compiler-check", + "timeout_minutes": 90 + }, + { + "name": "macos-26-swift-6.3", + "runner": "macos-26", + "xcode": "26.6", + "command": "Scripts/check --compiler-check", + "timeout_minutes": 90 + }, + { + "name": "repository-quality", + "runner": "macos-26", + "xcode": "26.6", + "command": "brew install ripgrep && Scripts/check --quality-check", + "timeout_minutes": 90 + } + ] + } +} diff --git a/.github/signing-allowed-signers b/.github/signing-allowed-signers deleted file mode 100644 index d7c5f74..0000000 --- a/.github/signing-allowed-signers +++ /dev/null @@ -1 +0,0 @@ -10173746+showxu@users.noreply.github.com ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAILHGQPJSUmRekTmVB8u7JAFlc4IksP8k+arbw8AybYLe diff --git a/.github/workflows/commit-message.yml b/.github/workflows/commit-message.yml deleted file mode 100644 index 53e36ae..0000000 --- a/.github/workflows/commit-message.yml +++ /dev/null @@ -1,40 +0,0 @@ -name: Commit Message Policy - -on: - pull_request: - types: [opened, synchronize, reopened, edited] - -jobs: - validate-commit-messages: - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@fbc6f3992d24b796d5a048ff273f7fcc4a7b6c09 # v5 - with: - fetch-depth: 0 - - - name: Validate commit subjects (Conventional Commits) - shell: bash - run: | - set -euo pipefail - - base_sha="${{ github.event.pull_request.base.sha }}" - head_sha="${{ github.event.pull_request.head.sha }}" - pattern='^(build|chore|ci|docs|feat|fix|perf|refactor|revert|style|test)(\([a-z0-9._/-]+\))?(!)?: .+$' - - bad=0 - while IFS= read -r subject; do - [[ -z "$subject" ]] && continue - if [[ "$subject" =~ ^Merge\ ]] || [[ "$subject" =~ ^Revert\ \" ]] || [[ "$subject" =~ ^fixup!\ ]] || [[ "$subject" =~ ^squash!\ ]]; then - continue - fi - if [[ ! "$subject" =~ $pattern ]]; then - echo "Invalid commit subject: $subject" - bad=1 - fi - done < <(git log --format=%s "${base_sha}..${head_sha}") - - if [[ "$bad" -ne 0 ]]; then - echo "Commit message policy check failed." - exit 1 - fi diff --git a/.github/workflows/release-gate.yml b/.github/workflows/release-gate.yml deleted file mode 100644 index f31bfb9..0000000 --- a/.github/workflows/release-gate.yml +++ /dev/null @@ -1,84 +0,0 @@ -name: Release Gate - -on: - push: - tags: ["v*"] - workflow_dispatch: - -permissions: - contents: read - -jobs: - verify: - name: Verify release ref - runs-on: macos-26 - timeout-minutes: 60 - env: - NSUnbufferedIO: 'YES' - steps: - - name: Checkout - uses: actions/checkout@fbc6f3992d24b796d5a048ff273f7fcc4a7b6c09 # v5 - with: - fetch-depth: 0 - - - name: Install release tooling - run: brew install ripgrep - - - name: Verify tag, version, and changelog - if: startsWith(github.ref, 'refs/tags/') - shell: bash - run: | - set -euo pipefail - version="${GITHUB_REF_NAME#v}" - verification_ref="refs/release-verification/$GITHUB_REF_NAME" - [[ "$GITHUB_REF_NAME" =~ ^v[0-9]+\.[0-9]+\.[0-9]+$ ]] - git fetch --force --no-tags origin \ - "refs/tags/$GITHUB_REF_NAME:$verification_ref" - [[ "$(git cat-file -t "$verification_ref")" == tag ]] - [[ "$(git rev-parse "$verification_ref^{}")" == "$GITHUB_SHA" ]] - git config gpg.ssh.allowedSignersFile .github/signing-allowed-signers - git verify-tag "$verification_ref" - rg -q "^## \[$version\] - [0-9]{4}-[0-9]{2}-[0-9]{2}$" CHANGELOG.md - python3 - "$version" <<'PY' - from pathlib import Path - import re - import sys - - versions = re.findall(r'\.upToNextMinor\(from: "([0-9]+\.[0-9]+\.[0-9]+)"\)', - Path("README.md").read_text()) - if versions != [sys.argv[1]]: - raise SystemExit("README dependency example must match the release tag") - lines = Path("CHANGELOG.md").read_text().splitlines() - start = lines.index("## [Unreleased]") + 1 - end = next( - (index for index in range(start, len(lines)) if lines[index].startswith("## [")), - len(lines), - ) - if any(line.strip() for line in lines[start:end]): - raise SystemExit("Unreleased must be empty on a release tag") - PY - - - name: Repository, schema, dependency, and API gates - run: | - Scripts/verify-public-repository.sh - Scripts/verify-schema-snapshot.sh - Scripts/verify-dependency-manifest.py - Scripts/verify-public-api.py - - - name: Strict Swift format - run: | - xcrun swift-format lint --strict --recursive --configuration .swift-format \ - Package.swift Sources Tests Plugins - - - name: Default build - run: swift build - - - name: Default tests - run: swift test --no-parallel - - - name: Isolated native build and test - timeout-minutes: 25 - run: Scripts/verify-native-build-and-test.sh - - - name: DocC warning gate - run: Scripts/verify-documentation.sh diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..5286d60 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,24 @@ +name: Release +on: + workflow_dispatch: + inputs: + tag: + description: Existing accepted version tag + required: true + type: string +permissions: + contents: read +jobs: + validate: + uses: swift-library/.github/.github/workflows/swift-package-ci.yml@c4fac2499d45d7ff3fb543e803e89dae2be5a6c6 + with: + ref: ${{ inputs.tag }} + publish: + needs: validate + permissions: + contents: write + actions: read + uses: swift-library/.github/.github/workflows/swift-package-release.yml@c4fac2499d45d7ff3fb543e803e89dae2be5a6c6 + with: + tag: ${{ inputs.tag }} + accepted_commit: ${{ needs.validate.outputs.commit }} diff --git a/.github/workflows/swift-package.yml b/.github/workflows/swift-package.yml index 804e8bd..f96dd10 100644 --- a/.github/workflows/swift-package.yml +++ b/.github/workflows/swift-package.yml @@ -5,6 +5,7 @@ on: branches: [master] pull_request: branches: [master] + types: [opened, synchronize, reopened, edited] workflow_dispatch: permissions: @@ -13,7 +14,7 @@ permissions: jobs: policy: if: github.event_name == 'pull_request' || github.event_name == 'push' - uses: swift-library/.github/.github/workflows/policy.yml@b1ea823a9792496113f625c6f9f8649a3b28268a + uses: swift-library/.github/.github/workflows/policy.yml@c4fac2499d45d7ff3fb543e803e89dae2be5a6c6 with: allow-terms: Codex @@ -21,7 +22,7 @@ jobs: uses: ./.github/workflows/real-codex-binary.yml result: - needs: [policy, windows, windows-runtime, quality, build-and-test, integration] + needs: [policy, windows, windows-runtime, validate, integration] if: always() runs-on: ubuntu-24.04 steps: @@ -147,80 +148,5 @@ jobs: include-hidden-files: true if-no-files-found: error - quality: - name: Repository quality - runs-on: macos-26 - steps: - - name: Checkout - uses: actions/checkout@fbc6f3992d24b796d5a048ff273f7fcc4a7b6c09 # v5 - - - name: Install release tooling - run: brew install ripgrep - - - name: Toolchain - run: | - swift --version - xcodebuild -version - - - name: Public repository hygiene - run: Scripts/verify-public-repository.sh - - - name: Vendored schema integrity - run: Scripts/verify-schema-snapshot.sh - - - name: Dependency manifest - run: Scripts/verify-dependency-manifest.py - - - name: Public API baseline - run: Scripts/verify-public-api.py - - - name: Strict Swift format - run: | - xcrun swift-format lint --strict --recursive \ - --configuration .swift-format \ - Package.swift Sources Tests Plugins - - - name: Build DocC documentation - run: Scripts/verify-documentation.sh - - build-and-test: - name: ${{ matrix.name }} - strategy: - fail-fast: false - matrix: - include: - - name: Swift 6.2 baseline - runner: macos-26 - xcode_path: /Applications/Xcode_26.0.1.app/Contents/Developer - expected_version: 'Swift version 6.2' - - name: Current hosted Swift - runner: macos-26 - xcode_path: /Applications/Xcode.app/Contents/Developer - expected_version: '' - runs-on: ${{ matrix.runner }} - timeout-minutes: 45 - env: - NSUnbufferedIO: 'YES' - steps: - - name: Checkout - uses: actions/checkout@fbc6f3992d24b796d5a048ff273f7fcc4a7b6c09 # v5 - - - name: Toolchain - run: | - sudo xcode-select --switch "${{ matrix.xcode_path }}" - swift_version="$(swift --version)" - echo "$swift_version" - xcodebuild -version - if [[ -n "${{ matrix.expected_version }}" ]]; then - [[ "$swift_version" == *"${{ matrix.expected_version }}"* ]] - fi - - - name: Build - run: swift build - - - name: Test - run: swift test --no-parallel - - - name: Isolated native build and test - timeout-minutes: 25 - run: Scripts/verify-native-build-and-test.sh + validate: + uses: swift-library/.github/.github/workflows/swift-package-ci.yml@c4fac2499d45d7ff3fb543e803e89dae2be5a6c6 diff --git a/CHANGELOG.md b/CHANGELOG.md index 75d840c..2e60764 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,9 +3,11 @@ All notable changes to `swift-codex` are documented in this file. The project follows [Semantic Versioning](https://semver.org/) beginning with `0.1.0`. -## [Unreleased] +## Unreleased -## [0.5.0] - 2026-10-05 +## 0.5.0 + +Released 2026-10-05. ### Added @@ -32,7 +34,9 @@ follows [Semantic Versioning](https://semver.org/) beginning with `0.1.0`. generated models require upstream-mandated shared fields. These public changes require a minor release during `0.x`. -## [0.4.1] - 2026-09-29 +## 0.4.1 + +Released 2026-09-29. ### Fixed @@ -41,7 +45,9 @@ follows [Semantic Versioning](https://semver.org/) beginning with `0.1.0`. identity through a Double fallback. Supported exact integers and finite fractions retain their representation across the native CodexMCP path. -## [0.4.0] - 2026-09-29 +## 0.4.0 + +Released 2026-09-29. ### Added @@ -66,7 +72,9 @@ follows [Semantic Versioning](https://semver.org/) beginning with `0.1.0`. - Join version probes, failed native writes, process termination and transport retirement without retaining blocked pipe readers or request owners. -## [0.3.0] - 2026-09-27 +## 0.3.0 + +Released 2026-09-27. ### Added @@ -80,7 +88,9 @@ follows [Semantic Versioning](https://semver.org/) beginning with `0.1.0`. switches must handle it; this source compatibility change requires a minor release during `0.x`. -## [0.2.2] - 2026-09-21 +## 0.2.2 + +Released 2026-09-21. ### Fixed @@ -89,7 +99,9 @@ follows [Semantic Versioning](https://semver.org/) beginning with `0.1.0`. - Wait for tool requests to reach the MCP transport before returning their call handles, so immediate cancellation cannot overtake the original request. -## [0.2.1] - 2026-09-19 +## 0.2.1 + +Released 2026-09-19. ### Fixed @@ -101,7 +113,9 @@ follows [Semantic Versioning](https://semver.org/) beginning with `0.1.0`. validation, and bound CI validation jobs so a stall cannot occupy a runner for six hours. -## [0.2.0] - 2026-09-19 +## 0.2.0 + +Released 2026-09-19. ### Changed @@ -125,7 +139,9 @@ follows [Semantic Versioning](https://semver.org/) beginning with `0.1.0`. - Close Exec standard input after writing the prompt and retain native process termination and cancellation results. -## [0.1.2] - 2026-08-17 +## 0.1.2 + +Released 2026-08-17. ### Added @@ -133,7 +149,9 @@ follows [Semantic Versioning](https://semver.org/) beginning with `0.1.0`. `codex exec --ignore-user-config` flag while retaining `CODEX_HOME` authentication. -## [0.1.1] - 2026-08-09 +## 0.1.1 + +Released 2026-08-09. ### Fixed @@ -141,7 +159,9 @@ follows [Semantic Versioning](https://semver.org/) beginning with `0.1.0`. checking its signature in the release workflow. This prevents the checkout action's peeled commit ref from replacing the signed tag object. -## [0.1.0] - 2026-08-09 +## 0.1.0 + +Released 2026-08-09. ### Added diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md deleted file mode 100644 index 7eaeebf..0000000 --- a/CODE_OF_CONDUCT.md +++ /dev/null @@ -1,37 +0,0 @@ -# Code of Conduct - -## Our Pledge - -We want `swift-codex` to be a respectful, constructive, and welcoming project -for everyone participating in the repository. - -## Expected Behavior - -- Be respectful in technical and non-technical discussions. -- Focus criticism on ideas, code, documentation, and behavior, not people. -- Assume good intent, ask clarifying questions, and keep feedback concrete. -- Respect differing viewpoints, experience levels, and communication styles. - -## Unacceptable Behavior - -- harassment, discrimination, or personal attacks -- trolling, deliberate intimidation, or sustained disruption -- publishing private information without permission -- abusive, insulting, or demeaning language - -## Scope - -This code of conduct applies to repository discussions, issues, pull requests, -reviews, and other project spaces maintained for `swift-codex`. - -## Reporting - -If you experience or witness behavior that violates this code of conduct, open -a private or minimally scoped issue requesting maintainer follow-up. Do not -include sensitive personal details in a public report. - -## Enforcement - -Project maintainers may remove, edit, or reject comments, issues, pull -requests, code, and other contributions that are not aligned with this code of -conduct. diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index c655cef..b209b3a 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -33,7 +33,8 @@ Keep changes small, boundary-first, and placed by role. - Keep current structure in `Documentation/Architecture/*`. - Keep task-specific plans and investigation notes outside the public tree. - Keep GitHub-facing collaboration files in `.github/`. -- Use Conventional Commit subjects because local hooks and CI validate them. +- External contributions are welcome. Use a Conventional Commit PR title. + Maintainers follow the shared [signing instructions](https://github.com/swift-library/.github/blob/master/MAINTENANCE.md#signing). ## Work Ownership And Closeout @@ -62,9 +63,8 @@ Keep changes small, boundary-first, and placed by role. ## Dependency Maintenance -- Dependabot checks Swift packages and GitHub Actions weekly. Minor and patch - version updates are grouped by ecosystem; major updates remain separate. - Grouping does not replace compatibility review or required checks. +- Dependabot checks Swift packages and GitHub Actions weekly. Updates need + compatibility review and all required checks. - For an accepted Swift dependency update, synchronize `Package.resolved` and `DEPENDENCIES.json` using `Scripts/verify-dependency-manifest.py --update`, then run the verifier and the applicable package gates. Review the resulting pins, diff --git a/Documentation/Assets/Logo.png b/Documentation/Assets/Logo.png index 027b6ce..4bea466 100644 Binary files a/Documentation/Assets/Logo.png and b/Documentation/Assets/Logo.png differ diff --git a/Documentation/Assets/Logo.svg b/Documentation/Assets/Logo.svg index 04f9f60..7bbdc83 100644 --- a/Documentation/Assets/Logo.svg +++ b/Documentation/Assets/Logo.svg @@ -1 +1 @@ - + diff --git a/LICENSE b/LICENSE.txt similarity index 100% rename from LICENSE rename to LICENSE.txt diff --git a/NOTICE b/NOTICE index 0279116..364b51d 100644 --- a/NOTICE +++ b/NOTICE @@ -2,7 +2,7 @@ swift-codex Copyright (c) 2026 Xudong Xu and the swift-library project authors Licensed under Apache License 2.0 with the Swift Runtime Library Exception. -See LICENSE for the complete terms. +See LICENSE.txt for the complete terms. The vendored App Server protocol schema has its own notice. See THIRD_PARTY_NOTICES.md. diff --git a/README.md b/README.md index 48e48c7..6afe3ba 100644 --- a/README.md +++ b/README.md @@ -12,7 +12,7 @@ CI Swift 6.2+ Platforms: macOS 14+ - License: Apache-2.0 + License: Apache-2.0 WITH Swift-exception

[Overview](#overview) · [Install](#install) · [Quick start](#quick-start) · @@ -513,14 +513,14 @@ Each public library also has a DocC catalog under Read [CONTRIBUTING.md](CONTRIBUTING.md) before opening a pull request, and run `Scripts/verify-public-repository.sh`, `swift build`, and `swift test --no-parallel` before submitting changes. -[SUPPORT.md](SUPPORT.md) covers questions and bug reports. Report +[Support](https://github.com/swift-library/.github/blob/master/SUPPORT.md) covers questions and bug reports. Report vulnerabilities through the private route in [SECURITY.md](SECURITY.md). -Participation follows the [Code of Conduct](CODE_OF_CONDUCT.md). +Participation follows the [Code of Conduct](https://github.com/swift-library/.github/blob/master/CODE_OF_CONDUCT.md). ## License swift-codex is licensed under the Apache License 2.0 with the Swift Runtime -Library Exception. See [LICENSE](LICENSE) and [NOTICE](NOTICE). +Library Exception. See [LICENSE.txt](LICENSE.txt) and [NOTICE](NOTICE). The vendored App Server protocol schema in `Vendor/CodexAppServerProtocolSchema` is derived from the OpenAI Codex CLI source and is licensed under the Apache diff --git a/RELEASING.md b/RELEASING.md index 226a0d7..f658138 100644 --- a/RELEASING.md +++ b/RELEASING.md @@ -1,19 +1,34 @@ # Releasing swift-codex -Releases are cut from a clean, reviewed default branch. The first public -release is `0.1.0`; that tag establishes the package's API compatibility -baseline. +Follow the [shared release standard](https://github.com/swift-library/.github/blob/master/VERSIONING.md). +`VERSION` declares the package version, `CHANGELOG.md` records release notes, +and `.github/release.json` selects the shared validation matrix. -## Versioning +## Compatibility surface -- Tags use `vMAJOR.MINOR.PATCH`. -- Package consumers should use `.upToNextMinor(from: "0.1.0")` during `0.x`. -- During `0.x`, minor releases may contain deliberate source-breaking changes. -- Patch releases remain source-compatible and do not change the pinned - upstream stable protocol contract incompatibly. -- Experimental AppServer models may change when the pinned upstream - experimental schema changes. Such changes must still be called out in the - changelog. +All eleven library products share one version. Compatibility includes public +Swift APIs, process and transport behavior, protocol models and compiler/platform +requirements. Experimental App Server models follow the pinned experimental +schema; changes to that surface belong in the changelog. + +## Requirements and validation + +The package requires Swift 6.2 and macOS 14. Shared CI tests Swift 6.2 on macOS 15 and Swift 6.3 +on macOS 26 and runs repository, schema, dependency, API, formatting and DocC +checks. Additional CI retains Windows product and process tests, public API +compatibility diagnosis, and the pinned real-binary integration tests. + +`Scripts/check` runs the complete macOS gate. Its `--compiler-check` scope +builds and tests with the default engine and runs the isolated native gate; +`--quality-check` checks repository integrity, schema and dependency manifests, +public API baselines, strict formatting and all eleven DocC catalogs. +The native gate constrains only the built Swift Testing process and requires +both Exec stress suites to execute successfully. + +Run the `Real Codex Binary` workflow against the intended release ref for +credential-free App Server and MCP integration. Verify a fresh remote consumer +and inspect its resolved dependency graph before publishing. Evidence belongs +in `.build/release-validation`. ## Public API Baselines @@ -26,66 +41,3 @@ run's source commit and toolchain, merge the freshly generated records with the local toolchain records, and verify the committed result locally and through the candidate's Repository quality check. Do not retain a hash from an older API merely because its compiler is unavailable. - -## Release Gate - -From the repository root, run: - -```sh -Scripts/verify-public-repository.sh -Scripts/verify-schema-snapshot.sh -Scripts/verify-dependency-manifest.py -Scripts/verify-public-api.py -Scripts/verify-documentation.sh -swift-format lint --strict --recursive --configuration .swift-format \ - Package.swift Sources Tests Plugins -swift build -swift test --no-parallel -Scripts/verify-native-build-and-test.sh -``` - -The isolated native gate uses the selected Xcode toolchain for its build and -test runtime. It applies the single-worker cooperative-pool constraint only to -the built Swift Testing process, and requires both Exec stress suites to report -executed, passing cases. SwiftPM package planning itself runs without that -constraint. - -Run the GitHub `Real Codex Binary` workflow against the intended release ref. -It installs the Codex version matching the vendored schema tag and executes the -credential-free AppServer and MCP binary checks. - -Before tagging: - -1. Move the complete changelog entry from `Unreleased` to the release version - and add the release date. -2. Confirm `Vendor/CodexAppServerProtocolSchema/upstream.lock.json` records an - exact upstream commit, tag, file inventory, and aggregate hashes. -3. Confirm all 11 DocC catalogs build without unresolved links or warnings. -4. Generate and verify the public API inventory. Compare it with the previous - release when one exists. -5. Confirm generated Swift output, `.build`, DocC archives, credentials, and - machine-local paths are not tracked. -6. Resolve and build a fresh consumer without this repository's `.build` or a - sibling checkout. -7. Open a pull request for the release preparation branch. Address or answer - review findings and confirm all required checks pass before squash-merging - the reviewed head. Follow the organization's - [PR workflow](https://github.com/swift-library/.github/blob/master/MAINTENANCE.md). -8. Fetch the merged default branch and verify the clean merged candidate and - its required checks before tagging. Use that accepted commit for the tag. - -Set `release_tag` to the intended immutable `vMAJOR.MINOR.PATCH` tag and -`accepted_commit` to the validated merged commit. Create a signed annotated -tag only after the above acceptance: - -```sh -git tag -s -a "$release_tag" "$accepted_commit" -m "swift-codex $release_tag" -git push origin "$release_tag" -``` - -After publishing, check out the remote tag in an empty directory and repeat -resolve, build, test, schema, API, and documentation verification before -declaring the release complete. - -Do not move or replace a published tag. Correct a bad release with a new patch -version. diff --git a/SUPPORT.md b/SUPPORT.md deleted file mode 100644 index 7e8d60f..0000000 --- a/SUPPORT.md +++ /dev/null @@ -1,28 +0,0 @@ -# Support - -## Questions - -For usage questions or general guidance, open a GitHub issue and describe the -package or repository area involved. - -## Bugs - -Use the bug issue template for problems with: - -- package behavior or published guidance -- build, test, or repository setup -- repository documentation or structure -- GitHub-facing governance or collaboration files - -## Feature Requests - -Use the feature issue template for: - -- package improvements -- repository documentation or structure improvements -- governance or contributor guidance improvements - -## Security Issues - -Do not report security-sensitive issues through normal bug reports. Follow -`SECURITY.md` instead. diff --git a/Scripts/check b/Scripts/check new file mode 100755 index 0000000..82336c9 --- /dev/null +++ b/Scripts/check @@ -0,0 +1,43 @@ +#!/bin/bash +# SPDX-License-Identifier: Apache-2.0 WITH Swift-exception +set -euo pipefail +cd "$(dirname "$0")/.." +case "${1:-all}" in + all) export RELEASE_CHECK_SCOPE=all ;; + --quality-check) export RELEASE_CHECK_SCOPE=quality ;; + --compiler-check) export RELEASE_CHECK_SCOPE=compiler ;; + *) echo 'Usage: Scripts/check [--quality-check|--compiler-check]' >&2; exit 2 ;; +esac +mkdir -p .build/release-validation +if [ "$RELEASE_CHECK_SCOPE" = all ] || [ "$RELEASE_CHECK_SCOPE" = quality ]; then + Scripts/verify-public-repository.sh + Scripts/verify-schema-snapshot.sh + Scripts/verify-dependency-manifest.py + Scripts/verify-public-api.py + xcrun swift-format lint --strict --recursive --configuration .swift-format Package.swift Sources Tests Plugins + Scripts/verify-documentation.sh +fi +if [ "$RELEASE_CHECK_SCOPE" = all ] || [ "$RELEASE_CHECK_SCOPE" = compiler ]; then + swift build --force-resolved-versions + swift test --force-resolved-versions --no-parallel + Scripts/verify-native-build-and-test.sh +fi +python3 - <<'PY' +import hashlib, json, os, pathlib, platform, subprocess +root = pathlib.Path('.build/release-validation') +result = {key: subprocess.check_output(['git', 'rev-parse', ref], text=True).strip() + for key, ref in [('commit', 'HEAD'), ('tree', 'HEAD^{tree}')]} +result['scope'] = os.environ['RELEASE_CHECK_SCOPE'] +result['os'] = platform.platform() +result['swift'] = subprocess.check_output(['swift', '--version'], text=True).strip() +result['xcode'] = subprocess.check_output(['xcodebuild', '-version'], text=True).strip() +result['sdk'] = subprocess.check_output(['xcrun', '--sdk', 'macosx', '--show-sdk-version'], text=True).strip() +result['validation_script_sha256'] = hashlib.sha256(pathlib.Path('Scripts/check').read_bytes()).hexdigest() +result['checks'] = [] +if result['scope'] in ('all', 'quality'): + result['checks'] += ['repository-hygiene', 'schema-integrity', 'dependency-manifest', + 'public-api-baseline', 'strict-format', 'docc'] +if result['scope'] in ('all', 'compiler'): + result['checks'] += ['swift-build', 'swift-test', 'native-build-and-test', 'cooperative-pool-tests'] +(root / 'provenance.json').write_text(json.dumps(result, indent=2) + '\n') +PY diff --git a/Scripts/verify-public-repository.sh b/Scripts/verify-public-repository.sh index 84681ca..ed6ad36 100755 --- a/Scripts/verify-public-repository.sh +++ b/Scripts/verify-public-repository.sh @@ -113,7 +113,7 @@ if any("library" not in product.get("type", {}) for product in products): ' || fail "Package.swift does not expose exactly the 11 supported libraries" for required_file in \ - LICENSE \ + LICENSE.txt \ THIRD_PARTY_NOTICES.md \ DEPENDENCIES.json \ API/PublicAPI.json \ diff --git a/THIRD_PARTY_NOTICES.md b/THIRD_PARTY_NOTICES.md index dd43a7e..8a50116 100644 --- a/THIRD_PARTY_NOTICES.md +++ b/THIRD_PARTY_NOTICES.md @@ -1,7 +1,7 @@ # Third-Party Notices `swift-codex`'s original Swift source is licensed under the Apache License 2.0 -with the Swift Runtime Library Exception in [`LICENSE`](LICENSE). The following +with the Swift Runtime Library Exception in [`LICENSE.txt`](LICENSE.txt). The following vendored material has separate terms. ## OpenAI Codex App Server Protocol Schema diff --git a/VERSION b/VERSION new file mode 100644 index 0000000..8f0916f --- /dev/null +++ b/VERSION @@ -0,0 +1 @@ +0.5.0