Architecture Decision Record
ADR-084: Stripe Webhook Ingress (Acceptance-Coded Responses and Startup Self-Registration)
Status
Accepted (2026-08-14). Revised 2026-09-03.
Revised 2026-09-07 (the webhook action carries its own request size limit, the auto-minted signing
secret is shared through the distributed cache, cancelling a payable order expires the provider
session, and reconciliation sweeps stranded unpaid orders).
Revised 2026-10-01 (current-state sections re-anchored and the shared signing secret described).
Revised 2026-10-06: the minted signing secret is never printed (an operator reveals it in the Stripe Dashboard), and the paid-order short-circuit covers every status past Paid.
Revised 2026-10-07: anchors refreshed after the v1.233.0 release.
Revised 2026-10-21: webhook verification accepts either the runtime or the configured signing secret, and the startup reconcile runs under an ADR-108 distributed lock so, with Redis present as in production, one replica mints at a time.
Revised 2026-10-26: anchors refreshed after the Store Sales, Gateway and main.bicep edits and the Common edge rate-limiting kit changes since 2026-10-21.
Revised 2026-10-28: anchors refreshed after the Store Sales, Gateway and main.bicep edits and the Common caching registration changes since 2026-10-26.
Revised 2026-11-23: the handler also records refunds and disputes and registration subscribes six event types, adding missing ones to an existing endpoint; a host holding a live key with no usable webhook secret and no WebhookBaseUrl refuses to start, and the earlier text that registration skips an empty SecretKey (and that the Stripe settings stand outside ADR-070) was corrected, since [Required] with ValidateOnStart already refused that at startup; only a whsec_-prefixed value counts as a signing secret; and the shared secret is stored protected when the Data Protection key ring is shared.
Context
Four ADRs already cover how a message crosses a boundary in this workspace. ADR-003 decides how an
event leaves a service (outbox, at-least-once). ADR-021 decides how a redelivered broker message is
recognized on the way in (consumer inbox). ADR-017 decides how a retried HTTP client request is
deduped at the inbound edge (Idempotency-Key). ADR-054 decides what happens when a message that was
supposed to arrive never does (a reconciliation sweep). None of them decides the case Store Sales
actually runs in production: an inbound call from a third party we do not control.
Stripe is that caller, and it fits none of the existing shapes. It cannot authenticate as an
application user (MMCA.Store/Source/Modules/Sales/MMCA.Store.Sales.API/Controllers/PaymentsController.cs:16-17),
so the endpoint has to be anonymous. It does not send an Idempotency-Key, so ADR-017 does not apply,
and the endpoint states that exemption in code with [NonIdempotent(...)] from
MMCA.Common.API.Idempotency (PaymentsController.cs:58-65, attribute at
MMCA.Common/Source/Presentation/MMCA.Common.API/Idempotency/NonIdempotentAttribute.cs:23): its
justification names both the absent header and why caching a 200 would be wrong here, since the status
code is the retry signal. It does not go through the broker, so ADR-021's inbox never sees it. And it
treats the HTTP status code as a delivery protocol, not as an application result: a non-2xx response makes Stripe retry
the event and, if failures persist, disable the endpoint entirely, which silently stops every payment
status update for the whole store.
Two production incidents shaped this, and both are recorded in the source. Rejections were logged at
Warning for weeks while the configured signing secret did not match the live endpoint, so 100% of
deliveries returned 400 and nothing surfaced it (PaymentsController.cs:105-110). Separately, between
2026-06-12 and 2026-07-30 a disabled-but-still-present endpoint caused a second endpoint to be created
at the same URL with a brand-new signing secret, invalidating the configured one; 507 deliveries failed
in the final week alone (MMCA.Store/Source/Modules/Sales/MMCA.Store.Sales.Infrastructure/Payments/Stripe/StripeWebhookRegistrationService.cs:209-216).
Both were failures of the ingress contract, not of payment logic.
Decision
Treat third-party webhook ingress as its own contract with two halves: an acceptance-coded endpoint and a self-registering, self-provisioning endpoint registration at startup.
- One anonymous, raw-body endpoint.
POST /Payments/webhookis[AllowAnonymous](PaymentsController.cs:57,66). The body is read straight offHttpContext.Request.Bodywith S6932 suppressed, because signature verification needs the unmodified payload and model binding would destroy it (PaymentsController.cs:83-87); theStripe-Signatureheader is read alongside it (:86). The Gateway forwards/Payments/{**catch-all}to Sales over plain HTTP/1.1: the route is declared in the Gateway'sReverseProxyconfiguration rather than in code (ADR-089), as thesales-paymentsroute (MMCA.Store/Source/Hosts/MMCA.Store.Gateway/appsettings.json:152-156) on asalescluster that carries noHttpRequestblock at all, soVersionandVersionPolicystay unset (appsettings.json:182-186), unlikecatalog(:164-172) andidentity(:173-181) which pinVersion2 withRequestVersionExact(:166-167,:175-176); the reasoning is atMMCA.Store/Source/Hosts/MMCA.Store.Gateway/Program.cs:134-143, which also notes that the shared cluster default deliberately carries no version pair so it can never reach the sales cluster and downgrade the webhook path. That is why Sales keeps the ADR-012 mixed-endpoint profile: its container app's ingress staystransport: 'http'for REST plus this webhook (MMCA.Store/infra/main.bicep:2171), with a TCP-passthroughadditionalPortMappingsentry carrying the h2c gRPC port alongside it (:2178-2184). - The status code encodes ACCEPTED, not PROCESSED. Five error codes return 400, held in a
FrozenSetnamedRejectionCodes:SignatureVerificationFailed,ParseFailed,SecretMissing,PayloadMissingandSignatureMissing(PaymentsController.cs:39-46, defined inPaymentWebhookErrorCodesatMMCA.Store/Source/Modules/Sales/MMCA.Store.Sales.Application/Orders/Interfaces/IPaymentService.cs:61,64,67,73,79). The last two are shape rejections raised one stage ahead of the handler:ProcessPaymentWebhookCommandValidatorrefuses a delivery that arrived with no body or noStripe-Signatureheader and tags each rule with the matching code (MMCA.Store/Source/Modules/Sales/MMCA.Store.Sales.Application/Orders/UseCases/ProcessPaymentWebhook/ProcessPaymentWebhookCommandValidator.cs:28-36), so the Validating decorator short-circuits before any verification runs. Shape only is the point: authenticity is still decided by the provider signature check, and no validation rule stands in for it (ProcessPaymentWebhookCommandValidator.cs:10-16). They belong in the rejection set for the same reason the parse failures do: nothing was verified, so answering 200 would report a delivery as accepted that never was and would suppress the retry a genuinely broken caller still needs. Outside the set, a body-less or signature-less delivery gets a silent 200 instead of the 400 the caller has to see (PaymentsController.cs:31-38). Everything past acceptance returns 200, including an order that cannot be found, because retrying those would fail identically forever (PaymentsController.cs:48-56,100-116,118). - Verification and parsing are separate steps, so the three provider-side reasons stay distinguishable.
ParseWebhookEvent(MMCA.Store/Source/Modules/Sales/MMCA.Store.Sales.Infrastructure/Payments/Stripe/StripePaymentService.cs:293) verifies the signature first (:320,EventUtility.ValidateSignatureat:602) and returnsSignatureVerificationFailedwhen it fails (:320-330), then runsEventUtility.ParseEventwiththrowOnApiVersionMismatch: false, so an account whose API version rolled ahead of the pinned library does not reject a correctly signed event (:337). A missing secret is named as its own deployment gap rather than reported as a bad signature (:307-318). The method's remarks record why one combinedConstructEventcall is not used: it reports an API-version mismatch or an unparseable body as a signature failure (:276-282), and the controller names the missing secret as the third cause that read the same way (PaymentsController.cs:95-98). - A rejection logs at
Critical, everything else atWarning.LogWebhookRejectedis a source-generatedCriticalmessage that names the code, the message, and the operational consequence (PaymentsController.cs:111,122-126).Criticalis deliberate: it clears the production Azure Monitor log floor (Logging__OpenTelemetry__LogLevel__Default=Warning) with room to spare (:109-110). A post-acceptance failure logsWarningand still returns 200 (:115,118). - Processing idempotency lives in the handler, not in the transport. The handler routes six event
types (
MMCA.Store/Source/Modules/Sales/MMCA.Store.Sales.Application/Orders/UseCases/ProcessPaymentWebhook/ProcessPaymentWebhookHandler.cs:15-26,34-39,50-59). Exactly two move an order through payment:checkout.session.completedpays it andcheckout.session.expiredfails it, whilepayment_intent.payment_failedis recorded and nothing else (:76-83). An order that isPaidor later (Paid,ShippedorDelivered) short-circuits to success (:97-101), logging for a refund when the event carries a different payment intent than the one stored (:93-96,99,133-143), as does an already-failed or cancelled one (:170-173), and two contradictory transitions log an anomaly instead of erroring: a success for a cancelled or failed order (:104-108) and an expiry for aPaidorder (:176-180), messages at:274-275and:283-284. The failure-side guard covers onlyPaid, so an expiry for aShippedorDeliveredorder reachesMarkAsPaymentFailedand its refusal is returned as a failure with no anomaly log (:182-184). A completed session is not by itself proof of payment: unlessPaymentProof.IsPaymentForOrderconfirms a paid session for this order's total and currency, the event is acknowledged with success and the order is left unchanged for an operator (:113-117). The other three record what happened to the money after payment, and find the order by its stored payment intent rather than by session (:246-253):charge.refundedrecords the refunded total throughorder.RecordRefund, a full refund holding the order from shipping (:21-23,194-222; a refund in a currency other than the order's is acknowledged and logged, not recorded,:203-209), andcharge.dispute.createdandcharge.dispute.closedrecord the dispute throughRecordDisputeOpenedandRecordDisputeClosed, a won dispute releasing the hold and a lost one keeping it (:23-24,228-244). A refund or dispute event that matches no order is acknowledged with aWarning, never retried (:197-201,231-235,286-290). Unhandled event types return success (:58). The command is deliberately notITransactional(ProcessPaymentWebhookCommand.cs:8-17). - The provider-side endpoint registers itself at startup.
StripeWebhookRegistrationServiceis aBackgroundService(StripeWebhookRegistrationService.cs:47-54) registered byAddModuleSalesInfrastructure(MMCA.Store/Source/Modules/Sales/MMCA.Store.Sales.Infrastructure/DependencyInjection.cs:51). It skips entirely whenWebhookBaseUrlis empty, which is the local-development path where the Stripe CLI forwards instead (:102-106, logged atDebug,:366-367). It has noSecretKeyskip: an emptySecretKeynever reaches it, becauseStripeSettings.SecretKeyis[Required](MMCA.Store/Source/Modules/Sales/MMCA.Store.Sales.Infrastructure/Payments/Stripe/StripeSettings.cs:24-25) and the settings are bound withValidateDataAnnotations().ValidateOnStart()(MMCA.Store/Source/Modules/Sales/MMCA.Store.Sales.API/SalesModule.cs:53-56), so the host refuses to start.StripeSettingsValidator(registered atSalesModule.cs:58-60) also refuses to start a host holding a live key whenStripe:WebhookSecretis not a usable signing secret andWebhookBaseUrlis empty, since no webhook could then ever be verified (MMCA.Store/Source/Modules/Sales/MMCA.Store.Sales.Infrastructure/Payments/Stripe/StripeSettingsValidator.cs:33-41). The expected URL isWebhookBaseUrlplus the constant/Payments/webhook(:56,134); production injectsStripe__WebhookBaseUrlas the Gateway FQDN (main.bicep:2279), so the registered endpoint is the Gateway route above. It subscribes six event types: the three that drive payment pluscharge.refunded,charge.dispute.createdandcharge.dispute.closed(:78-91). An existing endpoint missing any of them is updated to the union of what it already has and what is missing, which leaves its signing secret unchanged, while a wildcard endpoint is left alone (EnsureEventTypesAsync,:329-363, called at:193). The addition logs atInformation(:357,399-400); only an update that fails with aStripeExceptionlogs theWarningnaming the missing types (:359-361, declared at:396-397). - One replica reconciles at a time. Listing, deleting and creating endpoints is check-then-act on
Stripe's state, so two replicas booting together with no shared secret could each mint a different
secret. The reconcile therefore runs under the
IDistributedLockprimitive of ADR-108 (:37-45,52), keyedstripe:webhook-registration:plus the expected URL (:147-149,252), with a 2-minute time to live as a crash guard (:69) and a 30-second wait (:76). Once the lock is held the shared store is read again, so a replica that waited behind a sibling's mint adopts that secret instead of minting another (:164). A replica that cannot take the lock within the wait reads the shared store once more, logsLogRegistrationNotClaimedand leaves Stripe alone (:151-158, declared at:382-383). The lock spans replicas only when Redis is present: Common registersRedisDistributedLockwhen anIConnectionMultiplexeris registered and a process-localInProcessDistributedLockotherwise (MMCA.Common/Source/Core/MMCA.Common.Infrastructure/DependencyInjection.Caching.cs:101-123). Production Sales is givenConnectionStrings__redis(MMCA.Store/infra/main.bicep:2241); without it, two replicas booting together can still each mint. - It deletes only endpoints it created itself. Every auto-created endpoint carries the description
prefix
Auto-registered by MMCA(:63,229-233).IsStaleAutoRegisteredreturnsfalsefor any endpoint without that prefix, so an operator-created endpoint is never touched (:286-290), andtruefor an auto-registered one whose URL no longer matches or whose status is notenabled(:292-293), which is what collapses the disabled same-URL duplicate that caused the 2026 incident (:269-283). Cleanup is best-effort and per-endpoint isolated: a failed delete is logged and never aborts the others or the reconcile (:174-179,302-327, per-endpointtry/catchat:314-325). - The signing secret is minted once, shared across replicas, and never printed.
Before anything else the service adopts a secret already minted for the same URL from the shared
IStripeWebhookSecretStore(:143, implemented at:258-267). Stripe returns a signing secret only at creation time (:239-245), so the created value is written first to that shared store (:246) and then to the singletonStripeWebhookSecretProvider(:247), a volatile-backed holder (StripeWebhookSecretProvider.cs:16-26). The shared entry is stored protected under its own Data Protection purpose when the host registersSharedDataProtectionKeyRing(ADR-069), and as the plain secret otherwise, with oneInformationline saying so; an entry this host cannot unprotect is treated as absent with aWarning(MMCA.Store/Source/Modules/Sales/MMCA.Store.Sales.Infrastructure/Payments/Stripe/SharedCacheStripeWebhookSecretStore.cs:37-43,57,133,153-169,172-183;AddDataProtectionatDependencyInjection.cs:36). On every incoming eventStripePaymentServicebuilds its candidate secrets from the runtime value and then the configuredStripe:WebhookSecret, keeping the distinct ones that are usable signing secrets, meaning non-blank and carrying thewhsec_prefix, so the committedSET-VIA-USER-SECRETSplaceholder counts as no secret (StripeSettings.cs:62-63, applied atStripePaymentService.cs:299-305), and accepts the signature when EITHER candidate validates (:320, loop at:591-613);SecretMissingis returned only when no candidate is usable (:307-318). The creation is announced atCriticalwith the endpoint id only (StripeWebhookRegistrationService.cs:249,393-394), and that message tells the operator to reveal the endpoint's signing secret in the Stripe Dashboard and save it inStripe:WebhookSecret; the secret itself is never written to a log or a console stream (:21-25,244-245). When a usable secret is already configured and a new endpoint still has to be created, a secondCriticalstates that the configured value is now provably stale (:218-221,408-409). - An existing enabled endpoint plus a known secret is trusted without validation. When either the
adopted shared secret or the configured secret is a usable signing secret (
:190), that path only ensures event types and returns (:185-195), and its log deliberately does not say "verified", because Stripe never re-reveals a secret and a stale one is undetectable here: it surfaces only as theCriticalrejection on the first delivery (:372-376). When the endpoint exists but no usable secret is known anywhere, the endpoint is deleted and recreated to obtain a fresh one (:197-204).
Adoption is Store Sales only. It is the workspace's single inbound third-party webhook, and nothing
in this decision has been generalized into MMCA.Common; recording a single-application pattern as an ADR
follows the ADR-072 precedent (a decision that is ADC-only). The two halves are covered by unit tests
that pin the contract rather than the implementation: the controller's accept-versus-reject mapping in
two [Theory] methods covering five cases, one pinning the 200 after acceptance whether the handler
succeeds or fails and one pinning the 400 for SignatureVerificationFailed and both shape rejections
(MMCA.Store/Tests/Modules/Sales/MMCA.Store.Sales.API.Tests/Controllers/PaymentsControllerTests.cs:38-50,59-72;
no case pins the 400 for ParseFailed or SecretMissing), plus a third method that pins the action's
request size limit (:80-94), and the deletion predicate in two [Theory] methods with six rows,
including the operator-created endpoint that must never be stale
(MMCA.Store/Tests/Modules/Sales/MMCA.Store.Sales.Infrastructure.Tests/Services/StripeWebhookRegistrationServiceTests.cs:358-371).
Three more methods in that class pin the shared-secret and lock contract: the shared secret is adopted
ahead of the configured one (:147), a replica that does not acquire the lock makes no Stripe call
(:185), and a secret shared by the time the lock is held creates no new endpoint (:224). Three pin
the event-type subscription (an existing endpoint gains the refund and dispute events, a wildcard one
is left alone, a new one is created with them: :258,271,283), and two pin the usable-secret rule (a
configured placeholder alone mints a fresh secret, a real one is trusted and writes nothing:
:296,308).
Rationale
- The caller's protocol decides the response vocabulary. Stripe reads a status code as "keep retrying" or "stop", not as "this succeeded" or "this failed". Mapping every application failure to 400 would be locally honest and globally catastrophic: it costs the endpoint, and with it every payment status update. Encoding acceptance is the only mapping that keeps the caller's retry machine pointed at the cases a retry can actually fix.
- Three named rejection reasons beat one. A tampered payload, an unparseable body and a missing
signing secret need three different responses from a human, and the collapsed version sent on-call
after the wrong thing (
StripePaymentService.cs:276-282,PaymentsController.cs:95-98). Criticalis the level this environment can see. The production log floor isWarning(PaymentsController.cs:109-110), and a total payment-status outage that logs atWarningis indistinguishable from noise: that is exactly how it went unnoticed for weeks.- Self-registration removes a manual step the platform keeps invalidating. The public URL is a
Container Apps default domain, so it changes on a region move; a hand-registered endpoint drifts and
a dead one keeps firing failing-webhook alerts (
StripeWebhookRegistrationService.cs:174-177). - Marker-scoped deletion is what makes automated deletion acceptable. The service is allowed to
delete only endpoints it can prove it created, so the worst case of a buggy predicate is a
re-registration, never the removal of an operator's endpoint (
:281-282,286-290). - The runtime secret provider keeps the very first boot working. Without it, an auto-created
endpoint would reject every delivery until a human copied the secret into configuration and
redeployed (
:239-247,StripePaymentService.cs:299-305). - Accepting either candidate secret keeps an operator's roll from breaking delivery. The shared
entry outranks configuration only for a secret this service minted, and it lives 365 days, so after
an operator rolls the signing secret in Stripe or re-creates the endpoint by hand and updates the
configuration, the adopted value is stale while the configured one is current. Trying both keeps
deliveries verifying through that window, and widens nothing, since each candidate is a secret this
deployment trusts (
StripePaymentService.cs:284-290). - The lock makes the shared secret hold under a simultaneous scale-out. Sharing the minted secret
only helps a replica that reads it after the mint; two replicas reconciling at once could both mint.
Serializing the reconcile and re-reading the store under the lock turns the second replica into an
adopter (
StripeWebhookRegistrationService.cs:37-45,161-164), provided the lock is the Redis one (DependencyInjection.Caching.cs:101-123) and the holder publishes within the 30-second wait (StripeWebhookRegistrationService.cs:76).
Trade-offs
- A startup service that writes to a live third-party account. Booting a Sales replica creates and
deletes webhook endpoints in the real Stripe account, and updates the event types of an existing one
(
StripeWebhookRegistrationService.cs:203-204,236-237,317-318,353-356). The blast radius is bounded by the description marker and by theWebhookBaseUrlguard (:102-106), with an emptySecretKeyrefused at startup before the service runs (SalesModule.cs:53-56), but this is still automated mutation of an external system at boot, and a misconfiguredWebhookBaseUrlregisters a wrong endpoint rather than failing. Nor does a placeholder key fail fast: the committedSET-VIA-USER-SECRETSSecretKey(MMCA.Store/Source/Services/MMCA.Store.Sales.Service/appsettings.json:105) satisfies[Required], andStripeSettingsValidatorchecks only live keys (StripeSettingsValidator.cs:33-37), so with aWebhookBaseUrlset the host starts and the registration call fails against Stripe, caught and logged atError(StripeWebhookRegistrationService.cs:112-114,369-370). - A replica that loses the lock race does not reconcile. It adopts whatever the shared store holds
and leaves Stripe alone (
:151-158), so if the holder fails mid-reconcile, the endpoint is checked again only on a later start; the 2-minute time to live bounds how long a dead holder blocks the key (:65-69). Nor does it look at the shared store again: the store is read only during registration (:143,156,164), and verification reads only the in-process provider and the configured value (StripePaymentService.cs:299-305). A replica that gives up before the holder publishes (the holder outlasts the 30-second wait at:76, or crashes) therefore runs on the configured value alone until it restarts, answeringSecretMissingwhen that value is not a usable secret (StripePaymentService.cs:307-318) or rejecting signatures when it is stale. - Persisting a minted secret takes an operator trip to the Stripe Dashboard. The secret is never
written to a log or a console stream, because container stdout and stderr land in Log Analytics
(
:21-25); theCriticalcreation log names only the endpoint id and tells the operator to reveal that endpoint's secret in the Dashboard (:393). Zero-touch provisioning still holds for the running deployment through the shared store and the runtime provider: a replica already running keeps its in-memory secret (StripeWebhookSecretProvider.cs:18), and a restart with no usable configured value and no shared entry deletes the endpoint and mints again (StripeWebhookRegistrationService.cs:197-204,236-247). The lasting gap is a stale configured value: until a human saves the revealed value intoStripe:WebhookSecret, a restart whose shared entry is gone takes the trusted path on that stale value (:190) and rejects every delivery. - A stale shared entry is tolerated, not evicted. After an operator rolls the secret or
re-creates the endpoint by hand, the shared entry can hold a superseded secret for up to its 365-day
lifetime; verification still succeeds against the configured value because either candidate is
accepted (
StripePaymentService.cs:284-290,320). Nothing removes the stale entry automatically: theCriticalrejection log tells the operator that both candidates were tried and to evict the shared entry and restart when the configured value is right (MMCA.Store/Source/Modules/Sales/MMCA.Store.Sales.API/Controllers/PaymentsController.cs:125). The registration service still adopts the stale shared value as its runtime secret at startup (StripeWebhookRegistrationService.cs:258-267). - 200 hides processing failures from Stripe by design. A post-acceptance failure is invisible in
the Stripe dashboard's delivery view, so it has to surface through our own telemetry: the
Warninglog (PaymentsController.cs:115) and, for an order left stuck because no webhook ever completed the work, the ADR-054 reconciliation sweep (PaymentReconciliationService,DependencyInjection.cs:52-54). The 200 for a post-acceptance failure is itself pinned by test (PaymentsControllerTests.cs:38-50). - A configured secret is trusted, never validated. A stale
Stripe:WebhookSecretcannot be detected at startup and is discovered only on the first rejected delivery (StripeWebhookRegistrationService.cs:372-376). This is a provider constraint (the secret is never re-revealed), not a choice, but it means startup can log a reassuring "endpoint found" line while the deployment is already broken. - Losing the shared secret costs one re-mint. A restart adopts the shared secret and takes the
trusted path (
StripeWebhookRegistrationService.cs:143,190), so it does not mint again. The no-secret path deletes and recreates the endpoint to mint a fresh one (:197-204) only when the shared entry is gone: a cache flush or replacement, or the 365-day entry lifetime (SharedCacheStripeWebhookSecretStore.cs:26-35,72). With no distributed cache configured, the in-memory fallback degrades to per-process behavior (:32-34), so a restart there mints a new secret that supersedes the previous one until a human saves a value into configuration. - The endpoint is anonymous, internet-reachable and exempt from the edge rate limiter. Signature
verification is the only authentication (
StripePaymentService.cs:293-330); an unsigned or wrongly signed request reaches the handler pipeline before it is rejected, and each rejection emits aCriticallog, so a hostile caller can generateCriticalvolume. Nothing meters that at the Gateway:GatewayRateLimiting.BypassPathPrefixeslists/Payments(MMCA.Store/Source/Hosts/MMCA.Store.Gateway/appsettings.json:16-21), which exempts the whole prefix from both edge limiters, the per-client-IP fixed window and the replica-wide concurrency ceiling (MMCA.Common/Source/Hosting/MMCA.Common.Aspire/Gateway/GatewayRateLimitingExtensions.cs:109,121-130,222-225,270-273,343-352,412-416). The exemption is deliberate and stated where the kit is wired up (MMCA.Store/Source/Hosts/MMCA.Store.Gateway/Program.cs:89-96): a 429 is a non-2xx, so throttling Stripe buys the retry storm and the disabled endpoint this whole ADR exists to avoid. The price is that the rejection-log amplification path is bounded only by the caller's own sending rate. - Single-module adoption. None of this lives in MMCA.Common, so a second inbound webhook (in this
or another repo) starts from a copy of
PaymentsControllerandStripeWebhookRegistrationServicerather than from a framework contract.
Revision (2026-09-07)
Four changes from the 2026-09-07 security review. The ingress contract (raw body, signature verified before parsing, anonymous endpoint) is unchanged.
- The webhook action bounds its own request body (SEC-Store-15). Signature verification requires
buffering the whole body before anything is known about the caller, on an anonymous endpoint, in a
service that runs at 0.5 GiB.
[RequestSizeLimit(1_000_000)](MMCA.Store/Source/Modules/Sales/MMCA.Store.Sales.API/Controllers/PaymentsController.cs:76) is enforced by Kestrel at the transport layer (:72), so an oversized body is rejected before it is read rather than after. - The auto-minted signing secret is shared across replicas (SEC-Store-35).
SharedCacheStripeWebhookSecretStore(MMCA.Store/Source/Modules/Sales/MMCA.Store.Sales.Infrastructure/Payments/Stripe/SharedCacheStripeWebhookSecretStore.cs:37) keeps the secret understripe:webhook-signing-secret:plus the endpoint URL (:46, read at:57, written at:75). Held in one replica's memory, a scaled-out Sales rejected every event that landed on a replica which had not minted it. The endpoint URL is part of the key so a public URL change does not read a stale secret. The rationale for the cache over the database or Key Vault is recorded on the type (:13-19): the app identity holds only get and list on Key Vault, so it cannot write there. - Cancelling a payable order expires the provider session (SEC-Store-34).
CancelOrderHandleracts only on an order that isPaymentInitiatedand carries a session id (MMCA.Store/Source/Modules/Sales/MMCA.Store.Sales.Application/Orders/UseCases/Cancel/CancelOrderHandler.cs:92). If the provider says the session is already paid, the cancel is refused withOrderCancellationErrorCodes.PaymentAlreadyCompleted(:101-105; constant atMMCA.Store/Source/Modules/Sales/MMCA.Store.Sales.Application/Orders/UseCases/Cancel/OrderCancellationErrorCodes.cs:18) rather than cancelling an order the customer has paid for. Otherwise it expires the hosted session (:116), because a cancelled order whose checkout page stays payable takes money for something nothing will fulfil. A failure to read or expire is logged with the manual-refund consequence spelled out (:140,:145) and does not block the cancel. - Reconciliation sweeps stranded unpaid orders (SEC-Store-61). Beside the existing class of
PaymentInitiatedorders it asks the provider about, the service now takesPendingPaymentandPaymentFailedorders older thanStuckAgeMinutes(default 30,MMCA.Store/Source/Modules/Sales/MMCA.Store.Sales.Infrastructure/Payments/Reconciliation/PaymentReconciliationSettings.cs:42) straight toCancelled(MMCA.Store/Source/Modules/Sales/MMCA.Store.Sales.Infrastructure/Payments/Reconciliation/PaymentReconciliationService.cs:28-36). It asks the provider nothing for this class, because aPendingPaymentorder may have no session at all.Cancelledrather thanPaymentFailedis deliberate:PaymentFailedis retryable, and onlyCancelledis the terminal state theOrderCancelledcompensation listens on to return the committed stock (:37-42). Checkout commits stock, so without this an abandoned checkout held inventory forever and repeating it was a denial-of-service on availability.
Revision (2026-10-01)
The ingress contract (acceptance-coded status codes, anonymous raw-body endpoint, startup self-registration with marker-scoped deletion) is unchanged. This revision brings the current-state sections in line with the code:
- The Decision now describes the shared signing secret it already uses. The bullet that said the
minted secret is "held in memory" now states that the service first adopts the secret shared for
the same URL (
MMCA.Store/Source/Modules/Sales/MMCA.Store.Sales.Infrastructure/Payments/Stripe/StripeWebhookRegistrationService.cs:101-106), writes a newly minted one to the shared store before the in-process provider (:187-188), and trusts an existing endpoint when either secret is known (:132). - Two trade-offs were restated. The
Criticalcreation log carries only the endpoint id; the raw secret goes to stderr alone (:190-193,293). The restart loop that re-minted a secret on every boot now happens only after the shared entry is lost or expires, or when no distributed cache is configured (MMCA.Store/Source/Modules/Sales/MMCA.Store.Sales.Infrastructure/Payments/Stripe/SharedCacheStripeWebhookSecretStore.cs:25-32,54). - Two handler behaviors are now recorded. A completed session that
PaymentProofdoes not confirm as payment of the order is acknowledged and left for an operator, and a second payment intent on aPaidorder is logged for a refund (MMCA.Store/Source/Modules/Sales/MMCA.Store.Sales.Application/Orders/UseCases/ProcessPaymentWebhook/ProcessPaymentWebhookHandler.cs:84-91,100-107,123-133). - The stranded-unpaid sweep from the 2026-09-07 revision is now a backstop. Each order arms its
own
Sales.ExpireUnpaidOrderinternal command at checkout, and the reconciliation class two covers only the cases that command cannot (MMCA.Store/Source/Modules/Sales/MMCA.Store.Sales.Infrastructure/Payments/Reconciliation/PaymentReconciliationService.cs:52-60).
All other path:line citations in Context, Decision, Rationale and Trade-offs were re-anchored to
the current PaymentsController, IPaymentService, StripePaymentService,
StripeWebhookRegistrationService, DependencyInjection, the Gateway appsettings.json,
main.bicep, GatewayRateLimitingExtensions and the two test classes.
Revision (2026-10-06)
The ingress contract is unchanged. Corrections to the current-state sections:
- The minted signing secret is never printed. The Decision and Trade-offs no longer say the raw
secret goes to stderr (item 2 of the 2026-10-01 revision is superseded on this point). The
Criticalcreation log names only the endpoint id and tells the operator to reveal the secret in the Stripe Dashboard (MMCA.Store/Source/Modules/Sales/MMCA.Store.Sales.Infrastructure/Payments/Stripe/StripeWebhookRegistrationService.cs:205,308), and the type states that the secret is never written to a log or a console stream (:21-24). The stderr trade-off was replaced by the Dashboard step it now costs. - The paid-order short-circuit covers every status past
Paid.ShippedandDeliveredare acknowledged the same way asPaid, including the refund log for a different payment intent (MMCA.Store/Source/Modules/Sales/MMCA.Store.Sales.Application/Orders/UseCases/ProcessPaymentWebhook/ProcessPaymentWebhookHandler.cs:84-92). The failure side is narrower: only aPaidorder on the expiry path logs an anomaly (:168-173); aShippedorDeliveredone returns theMarkAsPaymentFailedrefusal as a failure (:175-177). - The controller test class has a fifth method that pins the request size limit
(
PaymentsControllerTests.cs:82-83); the accept-versus-reject mapping is still four methods. - The 2026-09-07 cancel behavior now lives in one helper. The guard, the
PaymentAlreadyCompletedrefusal and the expiry with its failure logs are inCancelOrderHandler.RetirePaymentSessionAsync(MMCA.Store/Source/Modules/Sales/MMCA.Store.Sales.Application/Orders/UseCases/Cancel/CancelOrderHandler.cs:104-140: refusal:126-132, expiry throughPaymentSessionRetirement.RetireAsyncat:116, failure logs:121,136).
All path:line citations in Status, Context, Decision, Rationale and Trade-offs were re-verified
against current source and re-anchored where they had moved.
Revision (2026-10-07)
Re-verified against current source. The ingress contract, the Decision, the Rationale and the Trade-offs are unchanged, and their citations still hold. Only anchors inside the earlier dated revisions have moved; those revisions stay as written, and the current locations are recorded here.
- Anchors re-verified against current source:
- The 2026-09-07 item 3 cancel behavior: the guard is at
MMCA.Store/Source/Modules/Sales/MMCA.Store.Sales.Application/Orders/UseCases/Cancel/CancelOrderHandler.cs:106insideRetirePaymentSessionAsync(:104-140), the expiry runs throughPaymentSessionRetirement.RetireAsync(:116), thePaymentAlreadyCompletedrefusal is at:126-132, and the read and expire failure logs are at:121and:136; the constant is still atOrderCancellationErrorCodes.cs:18. - The 2026-09-07 item 4 default:
StuckAgeMinutesdefaults to 30 atMMCA.Store/Source/Modules/Sales/MMCA.Store.Sales.Infrastructure/Payments/Reconciliation/PaymentReconciliationSettings.cs:48(range[Range(5, 10080)]at:47); the class-two description is atPaymentReconciliationService.cs:29-41and the Cancelled-over-PaymentFailed reasoning at:43-50. - The 2026-10-01 items 1 to 3: in
MMCA.Store/Source/Modules/Sales/MMCA.Store.Sales.Infrastructure/Payments/Stripe/StripeWebhookRegistrationService.csthe shared-secret adoption is at:115-120, the shared-store write and then the provider assignment at:202-203, the creation log call and declaration at:205,308-309, and the existing-endpoint trust check at:146; inProcessPaymentWebhookHandler.csthe paid short-circuit is at:84-92, thePaymentProofcheck at:101-108and the refund log for a different payment intent at:124-134.
- The 2026-09-07 item 3 cancel behavior: the guard is at
Revision (2026-10-21)
Re-verified against current source. The ingress contract (acceptance-coded status codes, anonymous raw-body endpoint, verification before parsing, marker-scoped deletion) is unchanged. Two behaviors moved since the 2026-10-07 revision, which therefore no longer describes the current state: webhook verification accepts either candidate secret, and the startup reconcile runs under a distributed lock.
- Verification accepts either candidate secret (M249). The Decision and Rationale no longer say
StripePaymentServiceprefers the runtime secret over the configured one. It builds the non-empty, distinct candidates from the runtime value and thenStripe:WebhookSecret(MMCA.Store/Source/Modules/Sales/MMCA.Store.Sales.Infrastructure/Payments/Stripe/StripePaymentService.cs:324-330), accepts the signature when either validates (:345,:597-619), and reportsSecretMissingonly when both are empty (:332); the reasoning (a 365-day shared entry outliving an operator's roll or re-create) is at:311-317. A Rationale bullet and a stale-shared-entry trade-off were added, the latter citing the rejection log that now tells the operator to evict the stale cache entry (MMCA.Store/Source/Modules/Sales/MMCA.Store.Sales.API/Controllers/PaymentsController.cs:125). - The startup reconcile is serialized across replicas (ADR-108).
StripeWebhookRegistrationServicetakes anIDistributedLock(MMCA.Store/Source/Modules/Sales/MMCA.Store.Sales.Infrastructure/Payments/Stripe/StripeWebhookRegistrationService.cs:52) keyed on the expected URL (:143-145,248), with a 2-minute time to live (:69) and a 30-second wait (:76), re-reads the shared store under the lock (:160), and on a lost race adopts the shared secret and leaves Stripe alone (:147-155). The lock spans replicas only when Redis is registered; otherwise it is process-local (MMCA.Common/Source/Core/MMCA.Common.Infrastructure/DependencyInjection.Caching.cs:88-101), and production Sales is givenConnectionStrings__redis(MMCA.Store/infra/main.bicep:1903). A Decision bullet, a Rationale bullet, a trade-off (including that a replica giving up the wait does not read the shared store again) and the ADR-108 entry in Related were added. - The registration tests cover the new contract. Besides the five deletion-predicate methods,
three methods pin shared-secret adoption and the lock
(
MMCA.Store/Tests/Modules/Sales/MMCA.Store.Sales.Infrastructure.Tests/Services/StripeWebhookRegistrationServiceTests.cs:183,221,260). - Anchors re-verified against current source:
main.bicep: Sales ingresstransport: 'http'atMMCA.Store/infra/main.bicep:1833,additionalPortMappingsat:1840-1846,Stripe__WebhookBaseUrlat:1941.StripePaymentService.cs:ParseWebhookEventat:320, the collapsed-call note at:303-309, the missing-secret branch at:332-343, the signature-failure return at:345-355,ParseEventwiththrowOnApiVersionMismatch: falseat:362.StripeWebhookRegistrationService.cs: class at:47-54,WebhookPathat:56, marker at:63, event types at:78-83, skips at:94-98and:100-104, expected URL at:130, first adoption at:139(implemented at:254-263), existing-endpoint trust check at:186(block:181-191), recreate at:193-200, stale-configurationCriticalat:214-217(declared at:380-381), create call at:232-233, shared-store write and provider assignment at:242-243, creation log at:245(declared at:368-369),IsStaleAutoRegisteredat:265-289,RemoveStaleEndpointsAsyncat:298-323(called at:170-175),VerifyEventTypesat:325-335, the not-verified log comment at:347-352; the Context incident note is at:205-213.- Deletion-predicate tests at
StripeWebhookRegistrationServiceTests.cs:302,310,324,334,347.
Revision (2026-10-26)
Re-verified against current source. The ingress contract, the Decision, the Rationale and the
Trade-offs are unchanged: verification still tries the runtime then the configured secret and
accepts either, the handler's idempotency and anomaly paths behave as described, Sales keeps the
mixed http ingress with a TCP-passthrough gRPC port, and /Payments is still exempt from both edge
limiters. Only anchors moved. They were re-pointed in Context, Decision, Rationale and Trade-offs;
the anchors inside the earlier dated revisions stay as written, and the current locations are
recorded here.
- Anchors re-verified against current source:
StripePaymentService.cs(MMCA.Store/Source/Modules/Sales/MMCA.Store.Sales.Infrastructure/Payments/Stripe/StripePaymentService.cs):ParseWebhookEventat:318, candidate secrets at:322-328, the missing-secret branch at:330-341, theTryValidateSignaturecall and signature-failure return at:343-353,ParseEventwiththrowOnApiVersionMismatch: falseat:357-360(call:360), the collapsed-call note at:302-307, the either-candidate remarks at:309-315,TryValidateSignatureat:595-617withEventUtility.ValidateSignatureat:606.ProcessPaymentWebhookHandler.cs(MMCA.Store/Source/Modules/Sales/MMCA.Store.Sales.Application/Orders/UseCases/ProcessPaymentWebhook/ProcessPaymentWebhookHandler.cs): event-type switch at:39-45(unhandled default:44), declined-attempt handler at:63-70, paid short-circuit at:84-88(comment:80-83), refund log call at:86andLogIfPaidByAnotherIntentat:120-130, terminal-order anomaly at:90-95,PaymentProofgate at:97-104, failed/cancelled skip at:156-160,Paid-expiry anomaly at:162-167,MarkAsPaymentFailedrefusal at:169-171, anomaly messages at:196-197and:205-206.MMCA.Store/infra/main.bicep: Sales ingresstransport: 'http'at:1839,additionalPortMappingsat:1846-1852, SalesConnectionStrings__redisat:1909,Stripe__WebhookBaseUrlat:1947.MMCA.Store/Source/Hosts/MMCA.Store.Gateway/Program.cs: edge-kit wiring and the/Paymentsexemption rationale at:85-93(bypass sentence:89-91), the version-pair reasoning at:128-137.MMCA.Common/Source/Hosting/MMCA.Common.Aspire/Gateway/GatewayRateLimitingExtensions.cs: always-bypassed prefixes at:87-92,IsBypassed(both limiters) at:94-113,IsExemptFromLimitersat:205-208, the per-IP no-limiter branch and fixed window at:233-236and:246-253, the concurrency partition at:271-278, the chained global limiter at:330-337;BypassPathPrefixesstill lists/PaymentsatMMCA.Store/Source/Hosts/MMCA.Store.Gateway/appsettings.json:20.
Revision (2026-10-28)
Re-verified against current source. The ingress contract, the Decision, the Rationale and the
Trade-offs are unchanged: verification still builds the runtime then the configured candidate,
returns SecretMissing only when both are empty and checks the signature before ParseEvent; the
reconcile lock is still Redis-backed when a multiplexer is registered; Sales keeps the mixed http
ingress. Only anchors moved. They were re-pointed in Decision, Rationale and Trade-offs; the anchors
inside the earlier dated revisions stay as written, and the current locations are recorded here.
- Anchors re-verified against current source:
StripePaymentService.cs(MMCA.Store/Source/Modules/Sales/MMCA.Store.Sales.Infrastructure/Payments/Stripe/StripePaymentService.cs):ParseWebhookEventat:332, remarks at:314-331(collapsed-call note:315-321, either-candidate paragraph:322-330), candidate secrets at:336-342, the missing-secret branch at:344-355, theTryValidateSignaturecall and signature-failure return at:357-367,ParseEventwiththrowOnApiVersionMismatch: falseat:371-374(call:374),TryValidateSignatureat:633-655withEventUtility.ValidateSignatureat:644; the authentication range is:332-367.MMCA.Store/Source/Modules/Sales/MMCA.Store.Sales.Infrastructure/DependencyInjection.cs:StripeWebhookRegistrationServiceregistered at:47,PaymentReconciliationServicecomment and registration at:48-50.MMCA.Store/infra/main.bicep(insidesalesApp,:1821): ingresstransport: 'http'at:1840,additionalPortMappingsat:1847-1853,ConnectionStrings__redisat:1910,Stripe__WebhookBaseUrlat:1948.MMCA.Store/Source/Hosts/MMCA.Store.Gateway/Program.cs: edge-kit comment at:88-95(the/Paymentsbypass sentence:92-94) and theAddGatewayRateLimitingcall at:96; theAddMmcaGatewayversion-pair reasoning at:131-140(shared default carries no version pair:139-140).MMCA.Common/Source/Core/MMCA.Common.Infrastructure/DependencyInjection.Caching.cs: theIDistributedLockregistration at:98-118(comment:98-103, Redis branch:106-113, in-process fallback:115-117).
Revision (2026-11-23)
Re-verified against current source. The ingress contract is unchanged: acceptance-coded status codes with the same five rejection codes, an anonymous raw-body endpoint, verification before parsing with either candidate secret accepted, marker-scoped deletion, a minted secret that is shared and never printed, and a reconcile serialized by the ADR-108 lock. Four behaviors moved (items 1, 2, 4 and 5), item 3 adds one startup check and corrects an earlier misdescription, and Context, Decision, Rationale, Trade-offs and Related were corrected or re-anchored in place; the anchors inside the earlier dated revisions stay as written.
- The handler records refunds and disputes. Besides the two payment transitions and the
recorded decline,
charge.refunded,charge.dispute.createdandcharge.dispute.closedare routed, found by the stored payment intent, and recorded on the order; an event for no known order is acknowledged with aWarning(MMCA.Store/Source/Modules/Sales/MMCA.Store.Sales.Application/Orders/UseCases/ProcessPaymentWebhook/ProcessPaymentWebhookHandler.cs:50-59,194-253,286-290). - Registration subscribes six event types and adds missing ones.
WebhookEventTypesholds the three payment events plus the refund and dispute events (MMCA.Store/Source/Modules/Sales/MMCA.Store.Sales.Infrastructure/Payments/Stripe/StripeWebhookRegistrationService.cs:83-91), and an existing endpoint missing any is updated to the union rather than only warned about; theWarningnow fires only when that update fails (:334-363). - A live key with no way to verify webhooks refuses to start, and the empty-
SecretKeytext was corrected. The new check isStripeSettingsValidator(registered atMMCA.Store/Source/Modules/Sales/MMCA.Store.Sales.API/SalesModule.cs:58-60), which fails a host holding a live key whose webhook secret is not usable and whoseWebhookBaseUrlis empty (MMCA.Store/Source/Modules/Sales/MMCA.Store.Sales.Infrastructure/Payments/Stripe/StripeSettingsValidator.cs:33-41). The earlier Decision text that registration skips with aWarningwhenSecretKeyis empty, and the Related entry that placed this startup path outside the ADR-070 fail-fast contract, were wrong rather than outdated:StripeSettings.SecretKeyis[Required](MMCA.Store/Source/Modules/Sales/MMCA.Store.Sales.Infrastructure/Payments/Stripe/StripeSettings.cs:24-25) underValidateDataAnnotations().ValidateOnStart()(SalesModule.cs:53-56), so an empty value already refused to start and that skip was unreachable; the registration service no longer carries it (StripeWebhookRegistrationService.cs:98-130). Only an emptyWebhookBaseUrlskips. A non-empty placeholderSecretKeysuch as the committedSET-VIA-USER-SECRETS(MMCA.Store/Source/Services/MMCA.Store.Sales.Service/appsettings.json:105) passes both checks. - Only a
whsec_-prefixed value counts as a signing secret.IsUsableWebhookSecret(StripeSettings.cs:62-63) filters the verification candidates (MMCA.Store/Source/Modules/Sales/MMCA.Store.Sales.Infrastructure/Payments/Stripe/StripePaymentService.cs:299-305), the registration trust check (StripeWebhookRegistrationService.cs:190) and the stale-config check (:218), so the committed placeholder is treated as no secret. - The shared secret is stored protected when the key ring is shared (ADR-069), plaintext with
a one-time
Informationline otherwise, and an unreadable entry is treated as absent (MMCA.Store/Source/Modules/Sales/MMCA.Store.Sales.Infrastructure/Payments/Stripe/SharedCacheStripeWebhookSecretStore.cs:37-43,57,133,153-183). - The test description was corrected. The controller mapping is two
[Theory]methods over five cases plus a size-limit[Fact], with no case forParseFailedorSecretMissing(MMCA.Store/Tests/Modules/Sales/MMCA.Store.Sales.API.Tests/Controllers/PaymentsControllerTests.cs:38-50,59-72,80-94); the deletion predicate is two[Theory]methods with six rows, and event-type and usable-secret tests were added (MMCA.Store/Tests/Modules/Sales/MMCA.Store.Sales.Infrastructure.Tests/Services/StripeWebhookRegistrationServiceTests.cs:258,271,283,296,308,358-371). - Anchors re-verified against current source:
- The 2026-10-07 item for the 2026-09-07 item 4 default:
StuckAgeMinutesdefaults to 30 atMMCA.Store/Source/Modules/Sales/MMCA.Store.Sales.Infrastructure/Payments/Reconciliation/PaymentReconciliationSettings.cs:49(range[Range(5, 10080)]at:48). - The 2026-09-07 item 2 store:
SharedCacheStripeWebhookSecretStoreat:54, key prefix at:64, read at:107, write at:127, the cache-over-database rationale at:15-24, the 365-day lifetime at:72. PaymentWebhookErrorCodesatMMCA.Store/Source/Modules/Sales/MMCA.Store.Sales.Application/Orders/Interfaces/IPaymentService.cs:58-80.StripePaymentService.cs:ParseWebhookEventat:293, remarks at:275-292,ParseEventat:337,ParseFailedreturns at:405-415,TryValidateSignatureat:591-613.StripeWebhookRegistrationService.cs: base-URL skip at:102-106, expected URL at:134, first adoption at:143, lock at:147-149(key:252), not-claimed at:151-158, re-read at:164, incident note at:209-216, mint block at:236-247.MMCA.Store/Source/Modules/Sales/MMCA.Store.Sales.Infrastructure/DependencyInjection.cs: registration service at:51, reconciliation at:52-54.MMCA.Store/infra/main.bicep(insidesalesApp,:2152): ingresstransport: 'http'at:2171,additionalPortMappingsat:2178-2184,ConnectionStrings__redisat:2241,Stripe__WebhookBaseUrlat:2279.- Gateway: routes and clusters at
appsettings.json:152-186;Program.csedge-kit comment at:89-96and version-pair reasoning at:134-143. DependencyInjection.Caching.cs: theIDistributedLockregistration at:101-123.GatewayRateLimitingExtensions.cs: always-bypassed prefixes at:109,IsBypassedat:121-130,IsExemptFromLimitersat:222-225, the chained global limiter at:412-416.
- The 2026-10-07 item for the 2026-09-07 item 4 default:
Related
ADR-003 (outbound at-least-once delivery, the other end of the same family), ADR-021 (broker-side
inbound dedup, which never sees a webhook), ADR-017 (client-supplied idempotency keys, which a third
party does not send), ADR-054 (the reconciliation backstop for the order a webhook never completed),
ADR-012 (the Sales mixed-endpoint profile that keeps an HTTP/1.1 surface for this webhook), ADR-069
(the shared key ring that protects the stored signing secret), ADR-070 (the fail-fast configuration
contract the Stripe settings follow: an empty SecretKey, or a live key with no way to verify
webhooks, refuses to start, and only an empty WebhookBaseUrl still skips registration, for the
local Stripe CLI path; a non-empty placeholder SecretKey is not caught at startup), ADR-072 (precedent for recording a single-application decision), ADR-108
(the distributed lock that serializes the startup reconcile across replicas).