Tooling & production/Stability & Benchmarks

Stability & Benchmarks

The v1.0 API freeze contract, extension rules for plugins and adapters, v1.0 benchmark snapshot, CI regression guards, and TinyGo island sizing.

On this page

Fletch freezes its core plugin and subsystem interfaces at v1.0 while letting higher-level packages and tooling iterate between minor releases. This page documents the stability boundary, the v1.0 benchmark snapshot, the continuous CI guards running on main, and the TinyGo island sizing measurements.

The v1.0 API freeze

No v1.x release removes or changes any frozen interface or function signature. Crest plugins and subsystem adapters written against v1.0 continue to compile until v2.

Twelve packages are covered by the freeze:

  • Template extension points: crest/plugin, crest/ast
  • Subsystem packages: assets, assets/pipeline, images, storage, cache, quiver, auth, pubsub, mail, data

TestAPIFreeze enforces the contract by comparing the exported API of those twelve packages against the golden file testdata/api_freeze.txt.

GOWORK=off CGO_ENABLED=0 go test -run TestAPIFreeze .
GOWORK=off CGO_ENABLED=0 go test -run TestAPIFreeze . -update

Extension rules for frozen packages

Frozen interfaces never gain methods during v1.x, because adding a method to an exported interface breaks existing implementations. New capabilities ship as optional interfaces checked by type assertion, such as images.Prewarmer, quiver.Periodic, and data.Describer.

if pw, ok := store.(images.Prewarmer); ok {
	_ = pw
}

Frozen structs may gain fields in minor releases. Always use keyed struct literals so additive fields never break compilation:

info := storage.ObjectInfo{Key: key}

What is not frozen

The following packages and surfaces are outside TestAPIFreeze:

  • crest/tools (compiler internals and LSP)
  • CLI flags and human-readable text output
  • fletch check --json (changes stay additive, though the JSON schema is not frozen)
  • AX and MCP surfaces
  • Live wire protocol and browser runtime (they ship together inside the same binary)
  • Tier 3 islands (live/wasm and fletch island)
  • Root meta-module, router, live, obs, and testkit
  • Standalone provider modules, which follow their own semantic versioning

Benchmarks (v1.0 snapshot)

Benchmark v1.0 snapshot (7158ecf) Target
Router match /tasks/{id}/comments/{cid} 71.4 ns/op, 0 B/op, 0 allocs/op 0 allocs/op
Typed JSON route (router.GetJSON) 248.5 ns/op, 240 B/op, 5 allocs/op (net/http baseline: 292.9 ns/op, 192 B/op, 5 allocs/op) +0 allocs over net/http
Live single boolean toggle diff 75.1 bytes/diff (46.96 µs/op loopback SSE+POST) ≤ 100 B
Idle Live session memory (3-row view floor) 11,867 bytes/session ≤ 24 KiB
Crest generate (50 views, ~30 lines each) 28.1 ms/op ≤ 200 ms
TaskFlow stripped release binary (-trimpath -ldflags="-s -w") 15.56 MiB ≤ 25 MiB
Live client runtime (minified + brotli) 4,032 bytes ≤ 12 KiB

Continuous regression guards

bench/guards_test.go holds three fast regression tests that run in CI and pass on current main:

  • TestGuardRouterMatchZeroAllocs: fails if parametric route matching allocates
  • TestGuardToggleDiffPayloadUnder100B: fails if a single boolean toggle diff exceeds 100 bytes
  • TestGuardClientRuntimeBrotliUnder12KiB: fails if the minified, brotli-compressed Live runtime exceeds 12 KiB

Reproducing locally

cd bench && GOWORK=off CGO_ENABLED=0 go test -bench=. -benchmem -run='^$' -count=3 ./...
cd bench && GOWORK=off CGO_ENABLED=0 go test -run '^TestGuard' ./...
GOWORK=off CGO_ENABLED=0 go test -run TestAPIFreeze .

Tier 3 TinyGo islands spike

Tier 3 WebAssembly islands (live/wasm, fletch island) were evaluated with TinyGo 0.45.0 using the following build flags:

-target=wasm-unknown -no-debug -opt=z -panic=trap -gc=conservative

Measured results from the spike:

Metric Measurement
quickparse release bundle 11.1 KiB brotli (29,146 B raw)
quickparse warm build time 0.73 s
Island SDK floor 5,320 B brotli
Target island budget ≤ 64 KiB brotli

Fletch enforces size guardrails on compiled island bundles during builds and checks:

-gc=conservative is the default collector rather than -gc=leaking. In testing, -gc=leaking grew linear memory from 128 KiB to 16 MiB over 20,000 writes, making it unsuitable for interactive islands that stay mounted for a full user session.