M1.3: Kafka producer acks and consumer group specs #24
Labels
No labels
blocked
bug
design
docs
engineering
feature
infra
priority:high
priority:low
priority:medium
question
No milestone
No project
No assignees
3 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: sscoble/speckl#24
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
What
Extend the KRaft spec to cover producer acknowledgement semantics and consumer group coordination — the parts that actually cause production incidents.
Deliverables
examples/KafkaProducer.speck— producer ack levels (0=fire and forget, 1=leader ack, all=ISR ack), idempotent producer state, transaction coordinatorexamples/KafkaConsumerGroup.speck— consumer group state machine (join, sync, rebalance, heartbeat, leave), offset commit semantics, partition assignmentExit Criteria
Both specs compile and verify. Producer ack invariant proves
acks=allprevents data loss on leader failure (bounded). Consumer group rebalance is modeled and verified for safety.Dependencies
#23 (M1.2: KRaft verification results) must be complete.
Context
Part of M1.3 in
docs/PROVE-KAFKA-PLAN.md.✅ Rust codegen backend implemented.
compiler/src/generators/rust.ts(652 lines).--target=rustproduces full Rust crate (Cargo.toml + src/lib.rs) with state struct, action methods returning Result, and invariant check functions. Types: Nat→u64, Bool→bool, Set→HashSet, Map→HashMap. Tested against ToggleSwitch, TigerBeetleLedger, KafkaKRaft. WASM path is now .speck → Rust → wasm-pack → WASM. All 37 tests passing.M1.3 complete. KafkaProducer.speck written at 13.5KB covering:
ProducerSequenceMonotonic, IdempotentProduce, ConsumerGroupSingleCoordinator,
OffsetMonotonicPerPartition
Extends KafkaKRaft.speck's consensus model to cover the full data plane.