Skip to content

Commit 4e7f6f6

Browse files
committed
Prepare Codex Blackbox for public release
1 parent cc8e7b2 commit 4e7f6f6

162 files changed

Lines changed: 6429 additions & 9686 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.dockerignore

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
**
22
!Cargo.toml
33
!Cargo.lock
4-
!coditor-cli/
5-
!coditor-cli/**
6-
!coditor-core/
7-
!coditor-core/**
4+
!codex-blackbox-cli/
5+
!codex-blackbox-cli/**
6+
!codex-blackbox-core/
7+
!codex-blackbox-core/**

.github/workflows/ci.yml

Lines changed: 105 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,105 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
pull_request:
6+
7+
env:
8+
CARGO_TERM_COLOR: always
9+
10+
jobs:
11+
rust:
12+
name: Rust checks
13+
runs-on: ubuntu-latest
14+
timeout-minutes: 30
15+
16+
steps:
17+
- name: Check out repository
18+
uses: actions/checkout@v6
19+
20+
- name: Install Rust toolchain
21+
uses: dtolnay/rust-toolchain@1.86.0
22+
with:
23+
components: clippy, rustfmt
24+
25+
- name: Cache Rust artifacts
26+
uses: Swatinem/rust-cache@v2
27+
28+
- name: Show tool versions
29+
run: |
30+
rustc --version
31+
cargo --version
32+
docker --version
33+
docker compose version
34+
35+
- name: Check formatting
36+
run: cargo fmt --check
37+
38+
- name: Run unit and integration tests
39+
run: cargo test --workspace
40+
41+
- name: Run clippy
42+
run: cargo clippy --workspace -- -D warnings
43+
44+
fake-responses:
45+
name: Fake Responses contracts
46+
runs-on: ubuntu-latest
47+
timeout-minutes: 45
48+
49+
steps:
50+
- name: Check out repository
51+
uses: actions/checkout@v6
52+
53+
- name: Install Rust toolchain
54+
uses: dtolnay/rust-toolchain@1.86.0
55+
56+
- name: Cache Rust artifacts
57+
uses: Swatinem/rust-cache@v2
58+
59+
- name: Show tool versions
60+
run: |
61+
rustc --version
62+
cargo --version
63+
docker --version
64+
docker compose version
65+
66+
- name: Validate default ChatGPT/Codex Envoy config
67+
run: ./test/validate-openai-config.sh
68+
69+
- name: Run narrow fake Responses proxy test
70+
run: ./test/e2e-openai-responses.sh
71+
72+
- name: Run fake observability validation
73+
run: ./test/observability-openai-responses.sh
74+
75+
- name: Run broad fake Responses regression
76+
run: ./test/e2e-openai-responses-full.sh
77+
78+
- name: Capture docker compose state on failure
79+
if: failure()
80+
run: |
81+
mkdir -p /tmp/codex-blackbox-ci
82+
docker compose ps > /tmp/codex-blackbox-ci/compose-ps.txt 2>&1 || true
83+
docker compose logs --no-color > /tmp/codex-blackbox-ci/compose-logs.txt 2>&1 || true
84+
85+
- name: Upload failure logs
86+
if: failure()
87+
uses: actions/upload-artifact@v7
88+
with:
89+
name: docker-compose-logs
90+
path: /tmp/codex-blackbox-ci
91+
92+
- name: Tear down stack
93+
if: always()
94+
run: docker compose down -t 5 || true
95+
96+
installer:
97+
name: Installer syntax
98+
runs-on: ubuntu-latest
99+
100+
steps:
101+
- name: Check out repository
102+
uses: actions/checkout@v6
103+
104+
- name: Check install.sh syntax
105+
run: sh -n install.sh

.github/workflows/release.yml

Lines changed: 230 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,230 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
tags:
6+
- "v*.*.*"
7+
8+
permissions:
9+
contents: write
10+
packages: write
11+
12+
jobs:
13+
build-cli:
14+
name: Build CLI (${{ matrix.target }})
15+
runs-on: ${{ matrix.os }}
16+
strategy:
17+
fail-fast: false
18+
matrix:
19+
include:
20+
- os: ubuntu-latest
21+
target: x86_64-unknown-linux-gnu
22+
cross: false
23+
- os: ubuntu-latest
24+
target: aarch64-unknown-linux-gnu
25+
cross: true
26+
- os: macos-15-intel
27+
target: x86_64-apple-darwin
28+
cross: false
29+
- os: macos-14
30+
target: aarch64-apple-darwin
31+
cross: false
32+
33+
steps:
34+
- name: Checkout
35+
uses: actions/checkout@v6
36+
37+
- name: Check crate version matches tag
38+
shell: bash
39+
run: |
40+
set -euo pipefail
41+
crate_version="$(awk -F'"' '/^version = / { print $2; exit }' codex-blackbox-cli/Cargo.toml)"
42+
test "v${crate_version}" = "$GITHUB_REF_NAME"
43+
44+
- name: Install Rust
45+
uses: dtolnay/rust-toolchain@stable
46+
with:
47+
targets: ${{ matrix.target }}
48+
49+
- name: Install cross
50+
if: matrix.cross
51+
run: cargo install cross --locked
52+
53+
- name: Build
54+
shell: bash
55+
run: |
56+
set -euo pipefail
57+
if [[ "${{ matrix.cross }}" == "true" ]]; then
58+
cross build --release -p codex-blackbox-cli --target "${{ matrix.target }}"
59+
else
60+
cargo build --release -p codex-blackbox-cli --target "${{ matrix.target }}"
61+
fi
62+
63+
- name: Package
64+
shell: bash
65+
run: |
66+
set -euo pipefail
67+
target="${{ matrix.target }}"
68+
archive="codex-blackbox-${target}.tar.gz"
69+
staging="dist/${target}"
70+
mkdir -p "$staging"
71+
cp "target/${target}/release/codex-blackbox" "$staging/codex-blackbox"
72+
cp README.md LICENSE "$staging/"
73+
tar -czf "dist/${archive}" -C "$staging" codex-blackbox README.md LICENSE
74+
if command -v sha256sum >/dev/null 2>&1; then
75+
sha256sum "dist/${archive}" > "dist/${archive}.sha256"
76+
else
77+
shasum -a 256 "dist/${archive}" > "dist/${archive}.sha256"
78+
fi
79+
80+
- name: Upload artifact
81+
uses: actions/upload-artifact@v7
82+
with:
83+
name: codex-blackbox-${{ matrix.target }}
84+
path: |
85+
dist/codex-blackbox-${{ matrix.target }}.tar.gz
86+
dist/codex-blackbox-${{ matrix.target }}.tar.gz.sha256
87+
88+
docker-image:
89+
name: Build and push codex-blackbox-core image (${{ matrix.arch }})
90+
runs-on: ${{ matrix.runner }}
91+
strategy:
92+
fail-fast: false
93+
max-parallel: 1
94+
matrix:
95+
include:
96+
- arch: amd64
97+
platform: linux/amd64
98+
runner: ubuntu-latest
99+
- arch: arm64
100+
platform: linux/arm64
101+
runner: ubuntu-24.04-arm
102+
103+
steps:
104+
- name: Checkout
105+
uses: actions/checkout@v6
106+
107+
- name: Check crate version matches tag
108+
shell: bash
109+
run: |
110+
set -euo pipefail
111+
crate_version="$(awk -F'"' '/^version = / { print $2; exit }' codex-blackbox-cli/Cargo.toml)"
112+
test "v${crate_version}" = "$GITHUB_REF_NAME"
113+
114+
- name: Set image tags
115+
id: tags
116+
shell: bash
117+
run: |
118+
set -euo pipefail
119+
tag="${GITHUB_REF_NAME}"
120+
version="${tag#v}"
121+
image="ghcr.io/${GITHUB_REPOSITORY_OWNER,,}/codex-blackbox-core"
122+
{
123+
echo "image=${image}"
124+
echo "tag=${tag}"
125+
echo "version=${version}"
126+
} >> "$GITHUB_OUTPUT"
127+
128+
- name: Set up Docker Buildx
129+
uses: docker/setup-buildx-action@v4
130+
131+
- name: Login to GHCR
132+
uses: docker/login-action@v4
133+
with:
134+
registry: ghcr.io
135+
username: ${{ github.actor }}
136+
password: ${{ secrets.GITHUB_TOKEN }}
137+
138+
- name: Build and push
139+
uses: docker/build-push-action@v7
140+
with:
141+
context: .
142+
file: ./codex-blackbox-core/Dockerfile
143+
platforms: ${{ matrix.platform }}
144+
push: true
145+
cache-from: type=gha,scope=codex-blackbox-core-${{ matrix.arch }}
146+
cache-to: type=gha,mode=max,scope=codex-blackbox-core-${{ matrix.arch }}
147+
tags: |
148+
${{ steps.tags.outputs.image }}:${{ steps.tags.outputs.tag }}-${{ matrix.arch }}
149+
${{ steps.tags.outputs.image }}:${{ steps.tags.outputs.version }}-${{ matrix.arch }}
150+
151+
docker-manifest:
152+
name: Publish codex-blackbox-core image manifest
153+
runs-on: ubuntu-latest
154+
needs:
155+
- docker-image
156+
157+
steps:
158+
- name: Set image tags
159+
id: tags
160+
shell: bash
161+
run: |
162+
set -euo pipefail
163+
tag="${GITHUB_REF_NAME}"
164+
version="${tag#v}"
165+
image="ghcr.io/${GITHUB_REPOSITORY_OWNER,,}/codex-blackbox-core"
166+
{
167+
echo "image=${image}"
168+
echo "tag=${tag}"
169+
echo "version=${version}"
170+
} >> "$GITHUB_OUTPUT"
171+
172+
- name: Set up Docker Buildx
173+
uses: docker/setup-buildx-action@v4
174+
175+
- name: Login to GHCR
176+
uses: docker/login-action@v4
177+
with:
178+
registry: ghcr.io
179+
username: ${{ github.actor }}
180+
password: ${{ secrets.GITHUB_TOKEN }}
181+
182+
- name: Publish manifest
183+
shell: bash
184+
run: |
185+
set -euo pipefail
186+
image="${{ steps.tags.outputs.image }}"
187+
tag="${{ steps.tags.outputs.tag }}"
188+
version="${{ steps.tags.outputs.version }}"
189+
docker buildx imagetools create \
190+
-t "${image}:${tag}" \
191+
-t "${image}:${version}" \
192+
-t "${image}:latest" \
193+
"${image}:${tag}-amd64" \
194+
"${image}:${tag}-arm64"
195+
196+
release:
197+
name: Publish GitHub release
198+
runs-on: ubuntu-latest
199+
needs:
200+
- build-cli
201+
env:
202+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
203+
204+
steps:
205+
- name: Checkout
206+
uses: actions/checkout@v6
207+
208+
- name: Download CLI artifacts
209+
uses: actions/download-artifact@v8
210+
with:
211+
path: dist
212+
pattern: codex-blackbox-*
213+
merge-multiple: true
214+
215+
- name: Create release
216+
shell: bash
217+
run: |
218+
set -euo pipefail
219+
assets=(
220+
dist/codex-blackbox-*.tar.gz
221+
dist/codex-blackbox-*.tar.gz.sha256
222+
install.sh
223+
)
224+
notes="Install with: curl -fsSL https://raw.githubusercontent.com/softcane/codex-blackbox/main/install.sh | sh"
225+
if gh release view "$GITHUB_REF_NAME" >/dev/null 2>&1; then
226+
gh release upload "$GITHUB_REF_NAME" "${assets[@]}" --clobber
227+
gh release edit "$GITHUB_REF_NAME" --title "$GITHUB_REF_NAME" --notes "$notes"
228+
else
229+
gh release create "$GITHUB_REF_NAME" "${assets[@]}" --title "$GITHUB_REF_NAME" --notes "$notes"
230+
fi

.gitignore

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ target/
1212
*~
1313

1414
# Runtime state and local volumes
15-
coditor_data/
15+
codex_blackbox_data/
1616
prometheus_data/
1717
grafana_data/
1818
reports/
@@ -28,6 +28,11 @@ docker-compose.override.yml
2828
.env.local
2929
*.log
3030

31-
# External agent/runtime state
31+
# Internal planning docs and external agent/runtime state
32+
internal_docs/
33+
doc_internal/
34+
docs/internal/
35+
wiki/*
36+
CLAUDE.md
3237
.claude/
3338
.omx/

0 commit comments

Comments
 (0)