updated 2026-11-26·4 min read
CLI Terminal Workflow & Gate Matrix
Interactive stokes audit --diff sessions, 4-stage pre-commit to CI gate lifecycle, stokes bench budgets, and CLI workflow FAQ.
Stokes handles local pre-commit checks, interactive diff patches, micro-benchmark CI gates, and lockfile signing from one CLI.

Interactive stokes audit --diff Workflow
stokes audit --diff walks the SQL, Python, and Rust boundary ASTs, points straight to the overflow line, proposes Dual-Zone (128 core + 72 adaptive) partitioning alongside AND database = currentDatabase(), runs 10,000 proptest cases in 1.42s, and seals stokes.lock + CONFORMANCE.md:
$ stokes audit --diff
[1/4] traversing workspace ast boundaries...
✓ migrations/001_bot_signals.sql (200 canonical signals indexed)
✓ services/feature-pipeline/extractor.py (dynamic dictionary bounds traced)
▲ crates/cloudflame-proxy/src/engine/feature_ingest.rs (fatal slice unwrap on overflow)
error: boundary contract violation: cardinality risk ratio = 1.40
clickhouse reflection matches: 280 features (200 canonical + 80 shard replicas)
rust l7 proxy allocates: [feature; 200] (fixed stack array)
risk: tryfromsliceerror panic on element index 201 crashes l7 proxy worker threads
stokes remediation proposal (automated patch):
architecture: defensive bounds & catalog qualification (dual-zone 128 + 72)
? apply zero-allocation patch to crates/cloudflame-proxy? [y/n]: y
✓ patch applied to crates/cloudflame-proxy/src/engine/feature_ingest.rs
✓ validated against 10,000 randomized property fuzz test cases in 1.42s
✓ conformance lockfile written: stokes.lock (sha256: e3b0c44298fc1c14...855)
Four-Stage Continuous Enforcement Lifecycle
- Local Git Pre-Commit Hook (stokes stage-check)
Parses git-staged boundary files locally without full compiler runs, blocking broken commits before push.
- Interactive Terminal Remediation (stokes audit --diff)
Surfaces cross-compiler drift and applies Dual-Zone partitioning and database qualification patches interactively.
- Non-Bypassable CI Gate (stokes verify --strict & stokes bench)
Validates stokes.lock digests and enforces Criterion hot-path limits (--max-p99-ns=10.0 --max-heap-bytes=0) in CI.
- Cryptographic Audit Certificate (stokes cert)
Emits human-readable CONFORMANCE.md alongside machine-verifiable stokes.lock SHA-256 digests.
Complete CLI Command Matrix
| Command | Stage | Primary Flags | Purpose |
|---|---|---|---|
stokes scan | Inspection | --strict, --json, --contracts | Traverses SQL migrations, Python ETL, and Rust crates; updates stokes.toml. |
stokes stage-check | Pre-commit | --hook, --quiet | Scans git-staged files locally; blocks invalid commits before push. |
stokes audit | Diagnostic | --diff, --export-patch, --strict | Runs parallel AST analyzers and generates Dual-Zone + SQL diffs. |
stokes bench | Benchmark | --max-p99-ns=10.0, --max-heap-bytes=0 | Runs Criterion micro-benchmarks and enforces 10.0 ns and 0 B heap limits. |
stokes verify | CI Gate | --lockfile=stokes.lock, --strict | Validates workspace AST digests against stokes.lock; exits non-zero on drift. |
stokes codegen | Synthesis | --consumer, --write, --export-patch | Synthesizes Dual-Zone 128 + 72 stack partitioning into consumer Rust/C++ boundaries. |
stokes cert | Attestation | --output=stokes.lock, --sha256 | Computes SHA-256 schema digests and writes stokes.lock + CONFORMANCE.md. |
GitHub Actions Workflow with stokes bench & CONFORMANCE.md
name: boundary conformance gate
on: [pull_request, push]
jobs:
stokes-verify:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.13"
- name: install stokes cli
run: curl -fsSL https://trystokes.pages.dev/install.sh | sh
- name: verify cross-boundary invariants
run: stokes verify --lockfile=stokes.lock --strict
- name: validate micro-benchmark budget
run: stokes bench --max-p99-ns=10.0 --max-heap-bytes=0
- name: generate audit certificate
run: stokes certCLI & Terminal Workflow FAQ
- How fast does
stokes stage-checkrun in pre-commit hooks? It skips Docker and full compiler runs and parses only git-staged boundary files. - How does
stokes auditsynthesize diffs? Five parallel language workers emit diagnostics over an in-process bus, scoping upstream SQL queries and inserting Dual-Zoneselect_nth_unstable_bypartitioning downstream. - What happens when
stokes verify --strictruns in CI? It recomputes normalized semantic AST digests for files instokes.lockand exits with code1on schema or buffer drift while ignoring comments and formatting. - How does
stokes mcpintegrate with Cursor and Windsurf? It runs an MCP server overstdio, exposingstokes_audit,stokes_boundary_graph,stokes_remediate,stokes_inspect_channel, andstokes_verify_patchdirectly to IDE AI agents. - How does
stokes codegensynthesize safe buffers? It generates Dual-Zoneselect_nth_unstable_bypartitioning (128core slots +72adaptive slots =200slots) inside a fixed stack array with0 Bheap allocations.
See CLI Reference for full option tables and environment variables.