Skip to content

feat(prompt): teach composition as the reuse primitive (telemetry #70… #182

feat(prompt): teach composition as the reuse primitive (telemetry #70…

feat(prompt): teach composition as the reuse primitive (telemetry #70… #182

Workflow file for this run

name: CI
# The gate, as GitHub Actions: clippy across the shipped feature configs (kept
# warning-clean), the full test suite, the wasm guard, the cartridge corpus +
# codegen/host-parity proofs (rustlite compiles + runs real cartridges — the gate
# `cargo test` can't, which let a compiler panic ship before 0.57.0), and the
# proxy tsc + test suite. `cargo fmt` is intentionally NOT enforced — this is hand-
# formatted to match surrounding style, not rustfmt-canonical. The heavy
# `browser-app-local` (in-browser Gemma / Burn) config is left to the local
# pre-release sweep — it pulls ~570MB and isn't in the shipped bundle.
on:
push:
branches: [main]
pull_request:
env:
CARGO_TERM_COLOR: always
concurrency:
group: ci-${{ github.ref }}
cancel-in-progress: true
jobs:
rust:
name: rust — clippy + test + wasm
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
with:
components: clippy
targets: wasm32-unknown-unknown
- uses: Swatinem/rust-cache@v2
# Clippy across every SHIPPED feature config — all kept warning-clean.
- name: clippy (default / native)
run: cargo clippy --all-targets -- -D warnings
- name: clippy (wallet)
run: cargo clippy --features wallet --all-targets -- -D warnings
- name: clippy (wallet + anthropic + openai)
run: cargo clippy --features "wallet anthropic openai" --all-targets -- -D warnings
- name: clippy (browser-app, wasm32)
run: cargo clippy --no-default-features --features browser-app --target wasm32-unknown-unknown -- -D warnings
# The SHIPPED bundle is browser-app + mainnet (build-web.sh). mainnet flips
# feature-gated code (chain config, sponsor.rs key embedding), so a change
# that only breaks under `mainnet` would pass every check above yet fail the
# real deploy build. Gate it too.
- name: clippy (browser-app + mainnet, wasm32)
run: cargo clippy --no-default-features --features browser-app,mainnet --target wasm32-unknown-unknown -- -D warnings
- name: test (wallet + anthropic + openai — superset)
run: cargo test --features "wallet anthropic openai"
- name: test (default)
run: cargo test
- name: wasm guard (SDK-only)
run: cargo check --no-default-features --target wasm32-unknown-unknown
cartridges:
name: cartridges — corpus + codegen + host parity
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
- uses: actions/setup-node@v4
with:
node-version: 20
# These compile each examples/cartridges/*.rl via the localharness CLI,
# instantiate the emitted wasm under a stub host, and assert it doesn't trap
# / draws correctly — catching rustlite codegen bugs and JS↔Rust host-table
# drift that a bare `cargo test` (wasm-magic-header check only) cannot. The
# release script runs these via verify.sh; mirror the cheap (no wasm-pack)
# subset here so they gate every push, not just a release.
- name: cartridge corpus (compile -> instantiate -> run -> assert)
run: node scripts/test-cartridges.mjs
- name: variable framebuffer resolution (dims convention)
run: node scripts/test-variable-resolution.mjs
- name: cartridge-in-cartridge composition (host::compose wiring)
run: node scripts/test-compose-wiring.mjs
- name: worker host-parity (off-main-thread cartridge runtime)
run: node scripts/test-worker-host-parity.mjs
proxy:
name: proxy — tsc + tests
runs-on: ubuntu-latest
defaults:
run:
working-directory: proxy
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20
- run: npm ci
- name: tsc --noEmit
run: npx tsc --noEmit
- name: proxy test suite (auth-parity / sponsor / mpp / webpush)
run: bash test/run.sh
tab-e2e:
# Browser tab-E2E of the SHIPPED bundle (scripts/tab-e2e/): boots the real
# wasm app in a headless Chrome tab and asserts what a user actually sees —
# boot, the intent router's free path, the bell, the display overlay,
# Stop/TURN_ACTIVE mid-stream (as a tenant), and the cartridge loop (embed
# card, history resume, app.rl public face, overlay worker kill). Zero
# network spend: model calls are stalled or rerouted to the local
# fake-Gemini SSE endpoint and the tenant-sim aborts all RPC/proxy requests.
#
# Deliberately NOT done here: building the release CLI for cartridge-e2e's
# fixture compile gate (LH_CLI). `cargo build --release --features wallet
# --bin localharness` would add several uncached minutes for ONE duplicate
# check — the same fixture is compiled in-browser by the app anyway, and the
# suite logs the skip honestly when no binary exists. Set LH_CLI later if
# that trade-off changes.
name: tab-e2e — browser regression (headless Chrome)
runs-on: ubuntu-latest
timeout-minutes: 45
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
with:
targets: wasm32-unknown-unknown
- uses: Swatinem/rust-cache@v2
- uses: actions/setup-node@v4
with:
node-version: 20
# Prebuilt binary via the official installer (`cargo install wasm-pack`
# costs minutes). No binaryen/wasm-opt setup: this repo DISABLES wasm-opt
# (Cargo.toml [package.metadata.wasm-pack.profile.release] wasm-opt=false
# — the bundled wasm-opt rejects post-MVP features modern rustc emits).
- name: install wasm-pack
run: curl -sSf https://rustwasm.github.io/wasm-pack/installer/init.sh | sh
# The real deploy build: gen-docs → wasm-pack (release, browser-app,
# mainnet) → cache-buster stamp. bash-clean on Linux (the cygpath calls
# are ||-guarded).
# Cold-cache this is the long pole; rust-cache keeps warm runs short.
- name: build web bundle (./scripts/build-web.sh)
timeout-minutes: 35
run: ./scripts/build-web.sh
# puppeteer-core is pinned in scripts/tab-e2e/package.json (no lockfile
# there, so npm install not ci). It drives the runner's EXISTING Chrome —
# downloads no browser.
- name: install puppeteer-core
run: npm install --prefix scripts/tab-e2e --no-audit --no-fund
# ubuntu runners ship Google Chrome at /usr/bin/google-chrome (a path
# lib.mjs::findBrowser probes itself); CHROME_PATH just pins the choice.
# This step fails loudly if the runner image ever drops Chrome.
- name: chrome sanity
run: google-chrome --version
# Suite failures fail the job (each suite exits 1 on any FAIL check); the
# per-step timeouts only bound a hung browser/server — no retries.
- name: tab-e2e-main (boot / router / bell / display / Stop turn-guard)
timeout-minutes: 8
env:
CHROME_PATH: /usr/bin/google-chrome
run: node scripts/tab-e2e/tab-e2e-main.mjs
- name: stop-e2e (tenant, Stop genuinely mid-stream)
timeout-minutes: 8
env:
CHROME_PATH: /usr/bin/google-chrome
run: node scripts/tab-e2e/stop-e2e.mjs
- name: cartridge-e2e (embed card / history resume / app.rl face / overlay)
timeout-minutes: 8
env:
CHROME_PATH: /usr/bin/google-chrome
run: node scripts/tab-e2e/cartridge-e2e.mjs