ADR-0240: Produce is previewed, pinned by an etag, gated, and audited without content
- Status: accepted
- Date: 2026-12-03
- Deciders: maintainers
Context
Operators need to produce a record to a Kafka topic to prove a path: a key, a value, headers, an optional partition and a serde. Writing into a production topic is not destructive, but it is irreversible: consumers act on the record, and Kafka cannot delete one record. The existing send to a queue has a dry run and an audit, with no preview, no etag and no gate, and on Kafka it sends no key, no partition and no serde. A record's content can carry secrets and personal data, and the approval gate stores a request's parameters until it runs.
Decision
- Producing is a separate operation from send, with its own permission,
message:produce. Send to a Kafka topic is refused, naming Produce. - A preview encodes and validates the record and writes nothing. A registry serde writes against the subject's registered schema and never registers one. The preview states the partition rule in words: the chosen partition, chosen by the key's hash, or chosen by the producer at send.
- The preview returns an etag, a SHA-256 over the topic id, the partition count, both bindings, the resolved schema versions and the encoded key, value and headers. End offsets are not part of it, because they move with every write and would make every preview stale. Producing requires the etag, and a mismatch is 412
stale-preview. - Confirming is a press and hold (ADR-0186) without the danger tone, because nothing is removed.
- The operation is gated as
message.produce, with no trait, so a policy selects it by type and environment. Its key, value and header values are redacted paths: they appear in no approval display and no stored canonical view, and the full parameters live only in the held row's sealed payload until it runs or expires. The estimate's state key is the etag, so an approved request whose record or schema moved is refused. - The audit records the topic, the partition rule, the encodings, the subjects and versions, the header names, and the sizes and SHA-256 of key, value and header values, never the content. Before is the end offset of the target partition (or of every partition when the producer chooses); after is the landed partition and offset, or "not reported". An unacknowledged send is in doubt (ADR-0211).
Consequences
- An operator sees what will be written and where before it is written, and an approver sees its shape without its content.
- A low-entropy key's hash can be guessed. The key's preview is already governed, and the content itself is never stored.
- Send and produce are two operations with two permissions; a role may send to queues without being able to write into topics.
- Producing through a registry serde needs OpenBroker 0.15.0.
Alternatives considered
- Extend send with a key and a partition. It would keep one permission for two very different reaches and inherit send's missing preview and gate.
- Register the schema at produce. Registering is out of scope for producing, and a preview would write to the registry.
- Store the record in the audit. That is a secret and PII leak into a long-lived store.
- The
DESTRUCTIVEtrait. Producing removes nothing; policies that hold destructive operations would hold it for the wrong reason.