lietzsche;stokes

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 terminal view showing workspace AST traversal, 1.40 cardinality risk error, and automated remediation proposal
interactive stokes audit --diff session flagging a 280-vs-200 cardinality collision.

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

  1. Local Git Pre-Commit Hook (stokes stage-check)

    Parses git-staged boundary files locally without full compiler runs, blocking broken commits before push.

  2. Interactive Terminal Remediation (stokes audit --diff)

    Surfaces cross-compiler drift and applies Dual-Zone partitioning and database qualification patches interactively.

  3. 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.

  4. Cryptographic Audit Certificate (stokes cert)

    Emits human-readable CONFORMANCE.md alongside machine-verifiable stokes.lock SHA-256 digests.

Complete CLI Command Matrix

CommandStagePrimary FlagsPurpose
stokes scanInspection--strict, --json, --contractsTraverses SQL migrations, Python ETL, and Rust crates; updates stokes.toml.
stokes stage-checkPre-commit--hook, --quietScans git-staged files locally; blocks invalid commits before push.
stokes auditDiagnostic--diff, --export-patch, --strictRuns parallel AST analyzers and generates Dual-Zone + SQL diffs.
stokes benchBenchmark--max-p99-ns=10.0, --max-heap-bytes=0Runs Criterion micro-benchmarks and enforces 10.0 ns and 0 B heap limits.
stokes verifyCI Gate--lockfile=stokes.lock, --strictValidates workspace AST digests against stokes.lock; exits non-zero on drift.
stokes codegenSynthesis--consumer, --write, --export-patchSynthesizes Dual-Zone 128 + 72 stack partitioning into consumer Rust/C++ boundaries.
stokes certAttestation--output=stokes.lock, --sha256Computes 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 cert
CLI & Terminal Workflow FAQ
  • How fast does stokes stage-check run in pre-commit hooks? It skips Docker and full compiler runs and parses only git-staged boundary files.
  • How does stokes audit synthesize diffs? Five parallel language workers emit diagnostics over an in-process bus, scoping upstream SQL queries and inserting Dual-Zone select_nth_unstable_by partitioning downstream.
  • What happens when stokes verify --strict runs in CI? It recomputes normalized semantic AST digests for files in stokes.lock and exits with code 1 on schema or buffer drift while ignoring comments and formatting.
  • How does stokes mcp integrate with Cursor and Windsurf? It runs an MCP server over stdio, exposing stokes_audit, stokes_boundary_graph, stokes_remediate, stokes_inspect_channel, and stokes_verify_patch directly to IDE AI agents.
  • How does stokes codegen synthesize safe buffers? It generates Dual-Zone select_nth_unstable_by partitioning (128 core slots + 72 adaptive slots = 200 slots) inside a fixed stack array with 0 B heap allocations.

See CLI Reference for full option tables and environment variables.

Search wiki and portfolio

type to search across all entries.