Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
f397ea8
test: fix two stale swarm tests that kept the full gate red
bsommers Nov 10, 2026
f23a1d3
test: serialize tests that set the process-global live socket (flake …
bsommers Nov 10, 2026
08f617a
test: portable test-support module and per-OS binary smoke test
bsommers Nov 10, 2026
467f403
test: deterministic property fuzz of the VT parser and screen
bsommers Nov 10, 2026
63c0e24
fix(portability): make clippy -D warnings pass for Windows targets
bsommers Nov 10, 2026
4d9ffc1
test: malformed-input robustness, config dotted keys and CLI argument…
bsommers Nov 10, 2026
de3ac1b
test: :clipboard grammar end to end (every verb, alias and malformed …
bsommers Nov 10, 2026
7f28bd2
test: visible Windows skips for POSIX-shell tests; line-anchored runt…
bsommers Nov 10, 2026
0d4d559
build(verify): shards, parallel pre-build, skip report, Windows entry…
bsommers Nov 10, 2026
930010f
build(coverage): scripts/coverage.sh with a per-module ratchet
bsommers Nov 10, 2026
b8a58d2
ci: six-cell matrix (Linux/macOS/Windows x x86_64/ARM64), tiers, cove…
bsommers Nov 10, 2026
927debd
docs: CI tiers, per-OS gate, cross-target checks, coverage ratchet
bsommers Nov 10, 2026
6a7a4e5
Merge remote-tracking branch 'origin/main' into chore/ci-matrix-and-c…
bsommers Nov 10, 2026
332ae82
test(vt-fuzz): drop the known-bug tolerance now that the char-boundar…
bsommers Nov 10, 2026
6aa0cba
fix(font): ':font add <zip|url>' works on a fresh profile
bsommers Nov 10, 2026
e09636e
test: remove three environment dependencies exposed by CI
bsommers Nov 10, 2026
ef1ce1a
build(verify): keep the panic message in fail.txt
bsommers Nov 10, 2026
7bca4fb
ci: keep the three required check names; calibrate the stt floor on t…
bsommers Nov 10, 2026
787b0a3
fix(daemon): clean up a non-socket file left at the daemon socket pat…
bsommers Nov 10, 2026
34a064a
fix(portability): Windows clippy for code merged from main; gate the …
bsommers Nov 10, 2026
83bf55b
test: short TMPDIR + private XDG_RUNTIME_DIR in the gate; quarantine …
bsommers Nov 10, 2026
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
24 changes: 24 additions & 0 deletions .github/coverage-floor.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Per-module line-coverage floor (percent). Checked by scripts/coverage.sh; a module below its floor fails CI.
# Regenerate after raising coverage: scripts/coverage.sh && scripts/coverage.sh --update-floor
# (recorded as measured minus 2 points of run-to-run slack, floored). Never lower a value by hand.
api 85
cli 94
colon_command 82
config 92
(crate root) 67
daemon 75
input 77
mcp_console 84
pane 81
pty 92
remote 90
# stt: calibrated on the CI runner (72.4%), which has no audio recorder on PATH; a dev box with
# pw-record/parecord/arecord/ffmpeg reaches ~75.6% because the recorder probe then succeeds.
stt 70
swarm 92
tmux 92
TOTAL 82
traffic 91
ui 80
vt 88
wm 84
203 changes: 187 additions & 16 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,16 @@
name: ci

# Six native cells: {Linux, macOS, Windows} x {x86_64, ARM64}.
#
# Tier | quick (build, clippy, unit, binary smoke) | integration (every tests/*.rs, 3 shards) | coverage
# ------------|-------------------------------------------|------------------------------------------|---------
# pull_request| all six cells | linux-x86_64 + macos-arm64 | linux-x86_64
# push to main| all six cells | all six cells | linux-x86_64
# nightly | all six cells | all six cells | linux-x86_64
# manual | all six cells | all six cells | linux-x86_64
#
# Every job runs the same one-line gate (scripts/verify.sh -> "PASS n/n" | "FAIL k/n: <stages>");
# docs/TEST_COVERAGE.md explains the tiers and how to reproduce each cell locally.
on:
pull_request:
push:
Expand All @@ -8,6 +19,9 @@ on:
- '**.md'
- '.planning/**'
- 'docs/**'
schedule:
- cron: '17 4 * * *' # nightly, off the hour
workflow_dispatch:

permissions:
contents: read
Expand All @@ -19,34 +33,191 @@ concurrency:
env:
CARGO_TERM_COLOR: always
CARGO_INCREMENTAL: 0
# Test builds do not need debugger-grade symbols; this roughly halves target/ and link time.
CARGO_PROFILE_DEV_DEBUG: 0

defaults:
run:
shell: bash # Git Bash on Windows: one script for every OS

jobs:
test:
name: clippy + quick verify (${{ matrix.os }})
# ---------------------------------------------------------------------------------------------
# Decides which cells run the full integration tier for this event (see the table above).
plan:
name: plan
runs-on: ubuntu-latest
outputs:
integration: ${{ steps.cells.outputs.integration }}
steps:
- id: cells
env:
EVENT: ${{ github.event_name }}
run: |
linux_x64='{"cell":"linux-x86_64","os":"ubuntu-latest","experimental":false}'
linux_arm='{"cell":"linux-arm64","os":"ubuntu-24.04-arm","experimental":false}'
mac_arm='{"cell":"macos-arm64","os":"macos-latest","experimental":false}'
mac_x64='{"cell":"macos-x86_64","os":"macos-15-intel","experimental":false}'
win_x64='{"cell":"windows-x86_64","os":"windows-latest","experimental":true}'
win_arm='{"cell":"windows-arm64","os":"windows-11-arm","experimental":true}'
if [ "$EVENT" = pull_request ]; then
cells="[$linux_x64,$mac_arm]"
else
cells="[$linux_x64,$linux_arm,$mac_arm,$mac_x64,$win_x64,$win_arm]"
fi
echo "integration={\"cell\":$cells,\"shard\":[1,2,3]}" >>"$GITHUB_OUTPUT"

# ---------------------------------------------------------------------------------------------
# Every event, every cell: the product builds, lints clean, passes its unit tests and starts.
quick:
name: ${{ matrix.name }}
runs-on: ${{ matrix.os }}
timeout-minutes: 45
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest]
runs-on: ${{ matrix.os }}
include:
# Branch protection on main requires the check contexts `clippy + quick verify (ubuntu-latest)`,
# `clippy + quick verify (macos-latest)` and `cargo-deny`. These two cells keep those exact
# names so the required checks keep reporting; rename them only together with the rule.
- { cell: linux-x86_64, os: ubuntu-latest, experimental: false, name: 'clippy + quick verify (ubuntu-latest)' }
- { cell: linux-arm64, os: ubuntu-24.04-arm, experimental: false, name: 'quick (linux-arm64)' }
- { cell: macos-arm64, os: macos-latest, experimental: false, name: 'clippy + quick verify (macos-latest)' }
# Intel macOS: `macos-13` is retired; `macos-15-intel` is the standard x86_64 label
# (`macos-26-intel` also exists). Revisit when macOS 15 images are retired.
- { cell: macos-x86_64, os: macos-15-intel, experimental: false, name: 'quick (macos-x86_64)' }
# Windows: build + clippy are hard gates (cross-checked clean for both MSVC targets).
# The test steps are `continue-on-error` until the first green run on real Windows
# runners (tracking item WIN-TESTS in docs/TEST_COVERAGE.md); their real outcome is
# always written to the job summary, never hidden.
- { cell: windows-x86_64, os: windows-latest, experimental: true, name: 'quick (windows-x86_64)' }
- { cell: windows-arm64, os: windows-11-arm, experimental: true, name: 'quick (windows-arm64)' }
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
# No extra system packages: the default build has no -sys crates that need distro libraries
# (no X11/Wayland); the runner's C toolchain suffices.
- name: Install Rust toolchain (channel from rust-toolchain.toml)
run: |
if ! command -v rustup >/dev/null; then # windows-11-arm images may ship without rustup
curl -sSfLo "$RUNNER_TEMP/rustup-init.exe" https://static.rust-lang.org/rustup/dist/aarch64-pc-windows-msvc/rustup-init.exe
"$RUNNER_TEMP/rustup-init.exe" -y --profile minimal --default-toolchain none
echo "$USERPROFILE/.cargo/bin" >>"$GITHUB_PATH"
export PATH="$USERPROFILE/.cargo/bin:$PATH"
fi
channel=$(sed -n 's/^channel *= *"\(.*\)"/\1/p' rust-toolchain.toml)
rustup toolchain install "$channel" --profile minimal --component clippy
rustc -vV
- uses: Swatinem/rust-cache@d1527c8f67ef9af357290475d4af4b0fab8f12e0 # v2.9.3
with:
key: quick-${{ matrix.cell }}
- name: Build
run: cargo build --locked
- name: Clippy
run: bash scripts/verify.sh --only clippy
- name: Unit tests
id: unit
continue-on-error: ${{ matrix.experimental }}
run: bash scripts/verify.sh --only unit
- name: Binary smoke (--version, --help, MCP session, RPC session, PTY)
id: smoke
continue-on-error: ${{ matrix.experimental }}
run: bash scripts/verify.sh --only t:smoke_binary_per_os
- name: Report
if: always()
env:
CELL: ${{ matrix.cell }}
UNIT: ${{ steps.unit.outcome }}
SMOKE: ${{ steps.smoke.outcome }}
EXPERIMENTAL: ${{ matrix.experimental }}
run: bash scripts/ci_report.sh "quick ($CELL)" "unit=$UNIT" "smoke=$SMOKE" "non-blocking-tests=$EXPERIMENTAL"

# ---------------------------------------------------------------------------------------------
# Every tests/*.rs, fanned out over three shards per cell.
integration:
name: integration (${{ matrix.cell.cell }}, ${{ matrix.shard }}/3)
needs: plan
runs-on: ${{ matrix.cell.os }}
timeout-minutes: 90
# Windows cells: see WIN-TESTS above. A failing shard is reported in the job summary.
continue-on-error: ${{ matrix.cell.experimental }}
strategy:
fail-fast: false
matrix: ${{ fromJSON(needs.plan.outputs.integration) }}
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- name: Install Rust toolchain (channel from rust-toolchain.toml)
run: |
if ! command -v rustup >/dev/null; then
curl -sSfLo "$RUNNER_TEMP/rustup-init.exe" https://static.rust-lang.org/rustup/dist/aarch64-pc-windows-msvc/rustup-init.exe
"$RUNNER_TEMP/rustup-init.exe" -y --profile minimal --default-toolchain none
echo "$USERPROFILE/.cargo/bin" >>"$GITHUB_PATH"
export PATH="$USERPROFILE/.cargo/bin:$PATH"
fi
channel=$(sed -n 's/^channel *= *"\(.*\)"/\1/p' rust-toolchain.toml)
rustup toolchain install "$channel" --profile minimal
- uses: Swatinem/rust-cache@d1527c8f67ef9af357290475d4af4b0fab8f12e0 # v2.9.3
with:
# One cache per cell, shared by its three shards (they build the same dependency graph).
shared-key: integration-${{ matrix.cell.cell }}
save-if: ${{ matrix.shard == 1 }}
- name: Integration tests (shard ${{ matrix.shard }}/3)
id: gate
env:
SHARD: ${{ matrix.shard }}
run: bash scripts/verify.sh --integration --shard "$SHARD/3"
- name: Report
if: always()
env:
CELL: ${{ matrix.cell.cell }}
SHARD: ${{ matrix.shard }}
GATE: ${{ steps.gate.outcome }}
EXPERIMENTAL: ${{ matrix.cell.experimental }}
run: bash scripts/ci_report.sh "integration ($CELL, $SHARD/3)" "gate=$GATE" "non-blocking-tests=$EXPERIMENTAL"

# ---------------------------------------------------------------------------------------------
# Line coverage with a per-module ratchet (.github/coverage-floor.txt). No external service:
# the table goes to the job summary, lcov + HTML to a workflow artifact.
coverage:
name: coverage (linux-x86_64)
runs-on: ubuntu-latest
timeout-minutes: 90
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
# No extra system packages: the default build has no -sys crates that
# need distro libraries (no X11/Wayland); the runner's C toolchain suffices.
- name: Install Rust toolchain
- name: Install Rust toolchain + llvm-tools
run: |
rustup toolchain install stable --profile minimal --component clippy
rustup default stable
channel=$(sed -n 's/^channel *= *"\(.*\)"/\1/p' rust-toolchain.toml)
rustup toolchain install "$channel" --profile minimal --component llvm-tools-preview
- uses: Swatinem/rust-cache@d1527c8f67ef9af357290475d4af4b0fab8f12e0 # v2.9.3
- name: Quick verify (clippy + unit tests)
with:
key: coverage
- name: Install cargo-llvm-cov (pinned, built from crates.io)
run: cargo llvm-cov --version 2>/dev/null | grep -q ' 0\.9\.1$' || cargo install cargo-llvm-cov --locked --version 0.9.1
- name: Coverage + ratchet
run: bash scripts/coverage.sh
- name: Job summary
if: always()
run: |
status=0
bash scripts/verify.sh --quick || status=$?
for f in target/verify/*/fail.txt; do
[ -f "$f" ] && { echo "::group::$f"; cat "$f"; echo "::endgroup::"; }
done
exit "$status"
[ -f target/coverage/summary.md ] && cat target/coverage/summary.md >>"$GITHUB_STEP_SUMMARY"
[ -f target/coverage/modules.tsv ] && cat target/coverage/modules.tsv
exit 0
- name: Upload lcov + HTML report
if: always()
uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
with:
name: coverage-report
path: |
target/coverage/lcov.info
target/coverage/modules.tsv
target/coverage/gaps.txt
target/coverage/summary.md
target/coverage/html
if-no-files-found: warn
retention-days: 14

deny:
name: cargo-deny
Expand Down
2 changes: 1 addition & 1 deletion AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ Bilterm is a terminal user interface (TUI) multiplexer, shell wrapper, and termi
5. **Context Window & Token-Efficiency Discipline (`PERF-CTX-01..03`)**:
- **Compact Between Tasks**: Recommend or run `/compact` after updating `.planning/CHECKPOINT.md` when switching between major tasks so tool turns do not replay large historical contexts.
- **Quiet Cargo Flags (`-q` / `--quiet`)**: Always pass `-q` (`cargo build -q`, `cargo clippy -q --all-targets -- -D warnings`, `cargo test -q`) to suppress routine `Compiling ...` and `test ... ok` lines (~90% token reduction).
- **Scripted Verification (`scripts/verify.sh`) — default gate**: one command, one output line. `PASS <passed>/<total> <secs>s` means done: do NOT read logs. `FAIL <n>/<total>: clippy t:foo -> ...` means read only `target/verify/<stage>/fail.txt` (<=40 lines), then `target/verify/<stage>/log` if still unclear. Result tree: `target/verify/STATUS` (PASS|FAIL), `summary.tsv` (stage, status, secs), `<stage>/{status,fail.txt,log}`. Flags: `--quick` (clippy+unit), `--failed` (rerun only failures), `--only <stage>...`, `--list`, `--status` (re-read last result, no run). Stages are one per `tests/*.rs` (`t:<name>`) plus `clippy`, `unit`; `fmt` is opt-in (legacy drift). New test suites get picked up automatically; new gates (security, perf, arch) go in as new stages in the same script with the same file contract. Never run bare `cargo test` and read its output when this script covers it.
- **Scripted Verification (`scripts/verify.sh`) — default gate**: one command, one output line. `PASS <passed>/<total> <secs>s` means done: do NOT read logs. `FAIL <n>/<total>: clippy t:foo -> ...` means read only `target/verify/<stage>/fail.txt` (<=40 lines), then `target/verify/<stage>/log` if still unclear. Result tree: `target/verify/STATUS` (PASS|FAIL), `summary.tsv` (stage, status, secs), `<stage>/{status,fail.txt,log}`. Flags: `--quick` (clippy+unit), `--failed` (rerun only failures), `--only <stage>...`, `--list`, `--status` (re-read last result, no run). Stages are one per `tests/*.rs` (`t:<name>`) plus `clippy`, `unit`; `fmt` is opt-in (legacy drift). New test suites get picked up automatically; new gates (security, perf, arch) go in as new stages in the same script with the same file contract. Never run bare `cargo test` and read its output when this script covers it. On Windows use `pwsh scripts/verify.ps1` (same line, same files). CI fan-out: `--integration` (every `tests/*.rs`, no clippy/unit) and `--shard K/N`. Skipped or ignored tests are listed in `target/verify/skips.txt`. Coverage has the same contract: `scripts/coverage.sh` prints `PASS coverage N%` or `FAIL coverage N%: <module> X%<floor%` against `.github/coverage-floor.txt` (details in `target/coverage/summary.md`; `--gaps`, `--update-floor`). New integration tests use `tests/common/mod.rs` (isolated env, deadlines instead of sleeps, visible skips); see `docs/TEST_COVERAGE.md` section 8.
- **Worktree Storage**: create worktrees with `scripts/worktree.sh new <name> [branch]`, not under `/tmp` (quota'd tmpfs; a full test build is ~9G even with reduced debug info). Roots come from `git config bilterm.worktreeRoot` / `bilterm.targetRoot` (machine-local). Existing worktree out of space: `scripts/worktree.sh relocate-target`.
- **Delegate Build/Test Loops to `flash` Subagent**: Run multi-step `cargo build -q` / `cargo clippy -q` / `cargo test -q` verification loops inside an isolated `flash` subagent (`invoke_subagent` with `Model: "flash"`) so compiler/test logs never bloat the main conversation history.
6. **Surface Uniformity (`UNI-R01`)**: every functionality MUST be reachable on every surface, with the same behaviour:
Expand Down
9 changes: 8 additions & 1 deletion docs/DEVELOPER_AND_AGENT_GUIDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -483,7 +483,14 @@ on both a Wire and a Payload cell of the same view.

## 7. Verification & CI Conservation Gates

Always run these 4 checks locally before committing or pushing:
The default gate is one command with one output line on every OS: `scripts/verify.sh` (Linux, macOS,
Git Bash) or `pwsh scripts/verify.ps1` (Windows). CI runs it on six cells
({Linux, macOS, Windows} x {x86_64, ARM64}); the tiers, sharding (`--integration --shard K/N`),
cross-target checks, portable-test rules (`tests/common/mod.rs`) and the coverage ratchet
(`scripts/coverage.sh`, `.github/coverage-floor.txt`) are documented in
[`TEST_COVERAGE.md` section 8](TEST_COVERAGE.md#8-ci-matrix-per-os-gate-cross-checks-and-the-coverage-ratchet).

The underlying checks, for reference:

```bash
# 1. Full unit, integration, snapshot, and security test suite
Expand Down
Loading
Loading