Stable · v1.0.1 · Go 1.26.5

Proof-gated automatic batching for Go

BatchWeaver finds supported scalar access patterns—including common N+1 shapes—proves their safety conditions, previews deterministic changes, and coalesces compatible requests without silently crossing tenant, authorization, transaction, session, cancellation, or ordering boundaries.

Apache-2.0 · No remote telemetry · Overlay-first · Unsupported patterns fail closed

terminal
$ batchweaver scan ./...
BW1001 candidate users.GetUser

$ batchweaver prove ./...
PROVEN static-loop-prefetch
  ordering      preserved
  cancellation  preserved
  partition     request-scoped

$ batchweaver transform diff ./...
review-only overlay; source unchanged

Quick start

Evaluate without changing source

Install an immutable version, validate the environment, scan, prove, preview, and run transformed tests through a Go overlay.

go install github.com/Voskan/BatchWeaver/cmd/batchweaver@v1.0.1

batchweaver version
batchweaver doctor
batchweaver config validate --file examples/configuration/batchweaver.yaml
batchweaver scan ./...
batchweaver prove ./...
batchweaver transform plan ./...
batchweaver transform diff ./...
batchweaver test -- -race ./...

Complete pipeline

One conservative path from source to batch

  1. 01Discover

    Load packages, declarations, config, SSA, call graph, and effects.

  2. 02Prove

    Evaluate named semantic obligations. Unknown means reject.

  3. 03Plan

    Create content-addressed, source-anchored transformation plans.

  4. 04Preview

    Render deterministic diffs and compile through overlays.

  5. 05Test

    Run the transformed application suite, including race checks.

  6. 06Adopt

    Materialize only with explicit approval, backup, revert, and rollback.

Implemented today

Compiler, runtime, adapters, controls, and editor tooling

01

Static analysis

Go package loading, SSA, conservative call graph and effects, declaration discovery, candidate reports, and deterministic diagnostics.

Analysis architecture
02

Semantic proofs

Strategy-specific obligations, explicit assumptions, rejection witnesses, versioned certificates, and no optimistic fallback.

Proof model
03

Transformations

Static prefetch, runtime lowering, and content-addressed SQL bindings through build overlays, source maps, typed bridges, deterministic diffs, materialization, recovery, and revert.

Transformation guides
04

Typed runtime

Request-scoped coalescing, bounded queues, partitioning, deadlines, cancellation, deduplication, memoization, and result validation.

Runtime API
05

Adapters

Adapter SDK, exact/composite-key PostgreSQL synthesis with bounded joins, pgx v5, go-redis v9, gqlgen, grpc-go, HTTP batching, and OpenAPI contracts.

Adapter documentation
06

Operations and editors

Adaptive analysis, fairness, overload control, waves, recursive batching, standalone LSP, gopls proxy, daemon, and VS Code extension.

Editor and operations guides

Safety model

Semantic boundaries are eligibility conditions

Batching is refused when BatchWeaver cannot establish the required equivalence. Supported optimizations preserve the contract that matters to callers.

Developer surfaces

Use the CLI, import typed packages, or integrate an editor

Command line

Scan, prove, transform, test, inspect adapters, collect profiles, run the LSP, and verify releases.

CLI command index →

Go packages

Declare operations and embed the reflection-free runtime in applications through six documented public packages.

Go API guide →

Editor workflow

Get live diagnostics, hovers, code lenses, previews, and optional gopls composition without implicit source writes.

Editor setup →

Documentation portal

From first evaluation to release operations

Browse tutorials, concepts, architecture, task guides, exact reference contracts, limitations, security threat models, adoption guidance, ADRs, and every runnable example.