Conformance · Source: mqlite main · docs/conformance.md — source v0.4.3 with unreleased changes. Latest supported release: v0.4.3. These docs track main; use the linked release for published artifacts.

Conformance — correct mqlite behavior (TCK)

This specification covers released v0.4.3 behavior and follows main for later documentation corrections. Use the v0.4.3 conformance specification for the exact release snapshot. For an installed v0.4.2 release, use the conformance specification at that tag; see CHANGELOG.md for version-specific behavior changes.

This is the normative spec of how mqlite must behave — the invariants that define "correct," independent of any one implementation detail. Each is enforced by a hermetic test (cross-referenced); together these are mqlite's TCK. If a change would break a MUST here, it is a behavior change, not a refactor.

Default Peek-Lock delivery is at-least-once: redelivery is possible, so handlers must be idempotent. Receive-and-delete is the caller's explicit at-most-once broker-removal path and removes a message before returning it; the same receive attempt ID can replay its saved response. Other documented discard paths include message TTL configured to discard, DLQ retention, forced resource deletion, and fixed subscription expiry. (§1.7, §3, §8, §14)

1 · Peek-Lock lifecycle

2 · Settlement (fenced on lock_token)

Exactly one verb per outcome; new effects require the lock_token from Receive and an unexpired lease, with the exact-request replay exception in §2.6.

3 · Idempotency & at-least-once

4 · Deduplication

5 · Ordering modes

6 · Dead-letter queue

7 · Scheduling, deferral & TTL

8 · DLQ retention

9 · Auth & errors (broker)

10 · Storage & schema invariants

11 · Subscription filters

12 · Topics & naming

13 · Cancellation (context deadlines)

Cancelling a call is not a way to undo it, and on a local store it is not a latency knob either. The rules below are the whole contract; they are stated here, and not only in the changelog, because a caller can observe every one of them.

14 · Concurrency invariants

The properties a user cannot work around, asserted under real parallelism rather than by asking the engine to grade itself — an engine with a bug reports that everything is fine.

15 · Crash recovery (process death)

Asserted by killing a real process hard (SIGKILL / TerminateProcess — no cleanup, no flush) while it is mid-transaction, restarting, and checking what survived. This covers process death, NOT power loss: a hard kill does not lose data the OS already accepted, so it exercises application-level recovery, not filesystem durability.

Run: make crash (race-instrumented, tag-gated; a separate Linux CI job, excluded from the default package matrix).


This spec is the contract a non-SQLite storage backend (see the Store-interface research) would have to satisfy to be a conformant mqlite. Hermetic package tests run with -race in the OS/Go matrix; tagged crash tests run with -race in their own Linux job. Live Turso tests run separately without -race; the large no-loss sweep also runs weekly without -race.