Skip to content
Toolkit

ADR-0070 — The declared field order phrases the notification

  • Status: Accepted
  • Date: 2026-08-28
  • Deciders: Repository owner, track 003 phase 04
  • Follows: ADR-0068 (what a block collects is registry data), ADR-0069 (the form is drawn from the collect spec)

Context

ADR-0068 moved which types collect, what they collect and where it lands into the registry, and left one compiled fact behind: formatSubmissionMessage switched on the block type to phrase the notification a submission triggers. It shaped text rather than a destination, so it was deliberately out of that slice's scope — and it was the last line in the collect path that could not survive a collector type it had never heard of.

It had also drifted in the way an enumeration does. It named email_collector and phone_collector; contact_collector, a type in the same registry, fell to a default arm that joined the payload with k: v in Go's randomised map order — so the same three answers phrased themselves differently on every send, and the notification a page owner got for a contact form was neither the shape of the other two nor stable between two of its own.

Decision

The collect spec's declared field order phrases the message. The first declared field the visitor filled in is the subject; the rest follow it in parentheses, in the same order.

That rule reproduces what the two named arms did — Alice (alice@example.com), or the address alone when a collector asks for no name — without either arm existing, because name is first in those specs. contact_collector gets the same shape for the first time, and any collector registered later gets it without a line here.

The order in Fields is therefore load-bearing twice over: it is the order the form asks in (ADR-0069) and the emphasis the notification takes. A registry entry that wants the address to lead puts the address first.

Consequences

  • The collect path has no switch on block type left in it. What a block collects, what it asks for, where it lands and how it is announced are all the registry entry's, and phase 04's remaining work is the destination (a second sink), not the shape.
  • A notification message is now deterministic for every collector. The regression test asserts the contact form's phrasing ten times over a payload built in a different order than the spec declares.
  • Nothing in the notification's Fields map changed: handlers that render the key/value pairs are unaffected, and only the human summary line is derived.

Source: docs/decisions/0070-the-declared-field-order-phrases-the-notification.md

Library