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
172 changes: 110 additions & 62 deletions .github/workflows/ci.yml

Large diffs are not rendered by default.

9 changes: 5 additions & 4 deletions .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ env:

jobs:
coverage:
name: Rust coverage (plan=${{ matrix.execution_plan }})
name: Rust coverage (plan=${{ matrix.execution_plan }}, owned-jq=${{ matrix.experimental_jq }})
# Pinned for the GNU coreutils oracle, like ci.yml's `test` job; see the
# note there.
runs-on: ubuntu-24.04
Expand All @@ -33,6 +33,7 @@ jobs:
fail-fast: false
matrix:
execution_plan: [false, true]
experimental_jq: [false, true]
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
Expand Down Expand Up @@ -64,13 +65,13 @@ jobs:
# (past --timeout). Its tests still run in the main CI test job.
- name: Generate coverage report
run: |
cargo tarpaulin --features="http_client${{ matrix.execution_plan && ',bashkit/experimental_execution_plan' || '' }}" \
cargo tarpaulin --features="http_client,jq${{ matrix.experimental_jq && ',bashkit/experimental_jq' || '' }}${{ matrix.execution_plan && ',bashkit/experimental_execution_plan' || '' }}" \
--workspace \
--exclude bashkit-python \
--exclude bashkit-eval \
--out xml \
--out html \
--output-dir coverage/${{ matrix.execution_plan }} \
--output-dir coverage/${{ matrix.execution_plan }}-${{ matrix.experimental_jq }} \
--exclude-files "crates/bashkit-bench/*" \
--exclude-files "crates/bashkit-cli/*" \
--exclude-files "crates/bashkit-python/*" \
Expand All @@ -81,7 +82,7 @@ jobs:
- name: Upload coverage artifacts
uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7
with:
name: rust-${{ matrix.execution_plan }}-coverage-report
name: rust-${{ matrix.execution_plan }}-${{ matrix.experimental_jq }}-coverage-report
path: coverage/
retention-days: 30

Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/fuzz.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ jobs:
run: echo "matrix=$(python3 scripts/fuzz-smoke.py --matrix)" >> "$GITHUB_OUTPUT"

fuzz:
name: Fuzz (${{ matrix.target }}, plan=${{ matrix.execution_plan }})
name: Fuzz (${{ matrix.target }}, plan=${{ matrix.execution_plan }}, owned-jq=${{ matrix.experimental_jq }})
needs: targets
runs-on: ubuntu-latest
strategy:
Expand Down Expand Up @@ -76,9 +76,9 @@ jobs:
uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v5
with:
path: crates/bashkit/fuzz/corpus
key: fuzz-corpus-${{ matrix.target }}-${{ matrix.execution_plan }}-${{ github.sha }}
key: fuzz-corpus-${{ matrix.target }}-${{ matrix.execution_plan }}-${{ matrix.experimental_jq }}-${{ github.sha }}
restore-keys: |
fuzz-corpus-${{ matrix.target }}-${{ matrix.execution_plan }}-
fuzz-corpus-${{ matrix.target }}-${{ matrix.execution_plan }}-${{ matrix.experimental_jq }}-

- name: Run fuzzer - ${{ matrix.target }}
working-directory: crates/bashkit
Expand Down Expand Up @@ -107,7 +107,7 @@ jobs:
if: failure()
uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7
with:
name: fuzz-crashes-${{ matrix.target }}-${{ matrix.execution_plan }}
name: fuzz-crashes-${{ matrix.target }}-${{ matrix.execution_plan }}-${{ matrix.experimental_jq }}
path: |
crates/bashkit/fuzz/artifacts/${{ matrix.target }}
retention-days: 30
27 changes: 23 additions & 4 deletions .github/workflows/js.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# The independent native jq matrix sweeps both flags. Instrumented package
# rows also enable owned jq so binding/browser artifacts execute that backend
# without doubling every language-version/architecture packaging matrix.
# JavaScript/TypeScript CI — builds NAPI-RS bindings and runs tests
# Triggered on PRs and pushes to main when JS-related files change.

Expand Down Expand Up @@ -183,19 +186,35 @@ jobs:
with:
bun-version: ${{ matrix.version }}

# Deno's canary-latest.txt can briefly point to a missing binary. Keep
# exercising the binding against stable 2.x and report the fallback.
- name: Check Deno canary artifact
id: deno_canary
if: matrix.runtime == 'deno' && matrix.version == 'canary'
shell: bash
run: |
sha="$(curl -fsSL --retry 2 --max-time 15 https://dl.deno.land/canary-latest.txt || true)"
if [[ "$sha" =~ ^[0-9a-f]{40}$ ]] && curl -fsSI --retry 2 --max-time 15 -o /dev/null "https://dl.deno.land/canary/$sha/deno-x86_64-unknown-linux-gnu.zip"; then
echo "available=true" >> "$GITHUB_OUTPUT"
else
echo "available=false" >> "$GITHUB_OUTPUT"
echo "::warning::Deno canary artifact unavailable; testing stable 2.x instead"
echo "Deno canary artifact unavailable; this job tested stable 2.x instead." >> "$GITHUB_STEP_SUMMARY"
fi

- name: Setup Deno
if: matrix.runtime == 'deno'
uses: denoland/setup-deno@22d081ff2d3a40755e97629de92e3bcbfa7cf2ed # v2
with:
deno-version: ${{ matrix.version }}
deno-version: ${{ matrix.version == 'canary' && steps.deno_canary.outputs.available != 'true' && '2.x' || matrix.version }}

- name: Install dependencies
run: pnpm install --frozen-lockfile
working-directory: crates/bashkit-js

- name: Build native binding
run: |
pnpm exec napi build --platform --release --features="${{ matrix.execution_plan && 'bashkit/experimental_execution_plan' || '' }}"
pnpm exec napi build --platform --release --features="${{ matrix.execution_plan && 'bashkit/experimental_execution_plan,bashkit/experimental_jq' || '' }}"
pnpm run build:cjs
pnpm run build:ts
working-directory: crates/bashkit-js
Expand Down Expand Up @@ -347,7 +366,7 @@ jobs:
working-directory: crates/bashkit-js
- if: ${{ !matrix.target }}
run: |
pnpm exec napi build --platform --release --features="${{ matrix.execution_plan && 'bashkit/experimental_execution_plan' || '' }}"
pnpm exec napi build --platform --release --features="${{ matrix.execution_plan && 'bashkit/experimental_execution_plan,bashkit/experimental_jq' || '' }}"
pnpm run build:cjs
pnpm run build:ts
working-directory: crates/bashkit-js
Expand All @@ -370,7 +389,7 @@ jobs:
# resumes rather than rebuilds. Only the toolchain crash is retried:
# a genuine compile error fails again and still fails the job.
for attempt in 1 2 3; do
if pnpm exec napi build --platform --release --features="${{ matrix.execution_plan && 'bashkit/experimental_execution_plan' || '' }}" --target ${{ matrix.target }}; then
if pnpm exec napi build --platform --release --features="${{ matrix.execution_plan && 'bashkit/experimental_execution_plan,bashkit/experimental_jq' || '' }}" --target ${{ matrix.target }}; then
break
fi
if [ "$attempt" = 3 ]; then
Expand Down
26 changes: 26 additions & 0 deletions .github/workflows/nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,16 @@ jobs:
env:
MIRIFLAGS: -Zmiri-disable-isolation

- name: Miri owned jq storage and iterator lifetimes
run: |
cargo +nightly-2026-10-30 miri test -p bashkit --no-default-features --features experimental_jq --lib -- \
--test-threads=1 refused_attachment_leaves_the_container_valid \
failed_cow_does_not_copy_or_change_the_shared_body failed_object_growth_does_not_reserve_storage \
removal_invalidates_depth_and_drop_refunds_storage owning_iterator_keeps_storage_charged_until_drop \
collection_charges_capacity_before_advancing_the_iterator nested_meter_restores_poll_progress
env:
MIRIFLAGS: -Zmiri-disable-isolation

# CI audits lockfiles on push and PR only, so main goes unscanned for as long
# as nobody pushes — and an advisory is published against code that has not
# changed. This job re-runs the same scan daily against a fresh copy of the
Expand Down Expand Up @@ -224,6 +234,22 @@ jobs:
cargo +nightly-2026-10-30 test --features="${{ matrix.execution_plan && 'bashkit/experimental_execution_plan' || '' }}" -Z build-std --target x86_64-unknown-linux-gnu --lib --tests \
-- --test-threads=1

- name: Run owned jq lifecycle and compatibility tests with AddressSanitizer
env:
RUSTFLAGS: "-Z sanitizer=address"
ASAN_OPTIONS: "detect_stack_use_after_return=1:detect_leaks=0"
run: |
# The default ASan pass above owns the long throughput workloads
# and strict 300-ms timeout test. Avoid running those twice in this
# instrumented owned-container slice.
cargo +nightly-2026-10-30 test --features="experimental_jq${{ matrix.execution_plan && ',experimental_execution_plan' || '' }}" \
-Z build-std --target x86_64-unknown-linux-gnu -p bashkit --no-default-features --lib --test integration -- \
--test-threads=1 jq yq \
--skip growth_inside_one_evaluation_stops_at_the_limit \
--skip non_emitting_loop_stops_at_the_timeout \
--skip ordinary_workloads_still_fit \
--skip unbounded_generator_is_capped

# The default-feature run above leaves out embedded python3. The Monty
# forks (crates/bashkit-monty*) are our code now, with unsafe in the
# metered allocator and VM, so their tests get their own ASan pass.
Expand Down
13 changes: 8 additions & 5 deletions .github/workflows/python.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# The independent native jq matrix sweeps both flags. Instrumented package
# rows also enable owned jq so binding/browser artifacts execute that backend
# without doubling every language-version/architecture packaging matrix.
# CI for bashkit Python package
# Builds the native extension via maturin and runs pytest on each PR.
# Complements publish-python.yml (release-only) with per-PR validation.
Expand Down Expand Up @@ -122,7 +125,7 @@ jobs:
# abi3-py39), so it must be built against each interpreter.
- name: Build random filesystem fixture
run: |
python -m maturin build --features="${{ matrix.execution_plan && 'bashkit/experimental_execution_plan' || '' }}" --release --out /tmp/bashkit-random-fs \
python -m maturin build --features="${{ matrix.execution_plan && 'bashkit/experimental_execution_plan,bashkit/experimental_jq' || '' }}" --release --out /tmp/bashkit-random-fs \
-m crates/bashkit-python/test-fixtures/random-fs/Cargo.toml \
-i python${{ matrix.python-version }}
pip install bashkit-random-fs --no-index --find-links /tmp/bashkit-random-fs --force-reinstall
Expand Down Expand Up @@ -154,7 +157,7 @@ jobs:
- name: Build and install native wheel
run: |
python -m pip install "maturin${{ env.MATURIN_VERSION }}"
python -m maturin build --features="${{ matrix.execution_plan && 'bashkit/experimental_execution_plan' || '' }}" -m crates/bashkit-python/Cargo.toml --out dist
python -m maturin build --features="${{ matrix.execution_plan && 'bashkit/experimental_execution_plan,bashkit/experimental_jq' || '' }}" -m crates/bashkit-python/Cargo.toml --out dist
python -m pip install bashkit --no-index --find-links dist
python -m pip install pytest pytest-asyncio pytest-timeout langchain-core deepagents fastapi httpx
- name: Install uvloop on Unix
Expand Down Expand Up @@ -198,7 +201,7 @@ jobs:

- name: Build wheel
working-directory: crates/bashkit-python
run: python -m maturin build --features="${{ matrix.execution_plan && 'bashkit/experimental_execution_plan' || '' }}" --release --out dist -i python3.12
run: python -m maturin build --features="${{ matrix.execution_plan && 'bashkit/experimental_execution_plan,bashkit/experimental_jq' || '' }}" --release --out dist -i python3.12

- name: Install local wheel
run: |
Expand All @@ -207,7 +210,7 @@ jobs:

- name: Build random filesystem fixture
run: |
python -m maturin build --features="${{ matrix.execution_plan && 'bashkit/experimental_execution_plan' || '' }}" --release --out /tmp/bashkit-random-fs \
python -m maturin build --features="${{ matrix.execution_plan && 'bashkit/experimental_execution_plan,bashkit/experimental_jq' || '' }}" --release --out /tmp/bashkit-random-fs \
-m crates/bashkit-python/test-fixtures/random-fs/Cargo.toml \
-i python3.12
pip install bashkit-random-fs --no-index --find-links /tmp/bashkit-random-fs --force-reinstall
Expand Down Expand Up @@ -251,7 +254,7 @@ jobs:

- name: Build wheel
working-directory: crates/bashkit-python
run: python -m maturin build --features="${{ matrix.execution_plan && 'bashkit/experimental_execution_plan' || '' }}" --release --out dist
run: python -m maturin build --features="${{ matrix.execution_plan && 'bashkit/experimental_execution_plan,bashkit/experimental_jq' || '' }}" --release --out dist

- name: Verify wheel metadata
run: |
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ Awesomely fast virtual sandbox with bash and file system. Written in Rust.
- **Experimental: Python support** - Embedded Python interpreter via [Monty](https://github.com/pydantic/monty) (`python` feature), or real CPython 3.14 in a WebAssembly sandbox (`cpython` feature)
- **Experimental: TypeScript support** - Embedded TypeScript interpreter via [ZapCode](https://github.com/TheUncharted/zapcode) (`typescript` feature)
- **Experimental: script execution plans** - Opt-in compilation of scalar arithmetic and control flow, with interpreter fallback (`experimental_execution_plan` feature; [details](crates/bashkit/docs/compatibility.md#experimental-execution-plans))
- **Experimental: owned jq containers** - Checked value/resource storage shared by jq and yq (`experimental_jq`, off by default; [details](crates/bashkit/docs/jq.md#experimental-owned-containers))
- **Experimental: SQLite support** - Embedded SQLite-compatible engine via [Turso](https://github.com/tursodatabase/turso) (`sqlite` feature)

## Install
Expand Down
4 changes: 4 additions & 0 deletions crates/bashkit-bench/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,7 @@ tempfile.workspace = true
# Terminal output
colored = "3"
tabled = "0.22"

[features]
# Opt-in checked jq containers; keep production defaults unchanged.
experimental_jq = ["bashkit/experimental_jq"]
Loading
Loading