Architecture Decision Record
ADR-070: Fail-Fast Configuration Contract
Status
Accepted (2026-08-07). Revised 2026-08-14 (source citations re-anchored). Revised 2026-08-23
(inventory re-counted after the password-reset vertical and the opt-in feature waves: twelve validated
chains in the Infrastructure package and sixteen framework registrations in all, six framework
bindings deliberately off the chain, and a custom IValidateOptions<T> in use). Revised 2026-08-31
(the two host-owned sections now bind through the shared AddModuleHost call in seven of the eight
hosts instead of an inline chain per host; source citations re-anchored). Revised 2026-09-01
(inventory re-counted: fifteen validated chains in the Infrastructure package and twenty framework
registrations in all, eight framework bindings deliberately off the chain, and two custom
IValidateOptions<T> in use; source citations re-anchored). Revised 2026-09-03 (the two cache sections
are reached through the AddCaching call AddInfrastructure makes rather than an opt-in method, so
eleven of the fifteen Infrastructure chains ship to every host and four are opt-in; the exception count
in the consumer-host paragraph corrected to eight; source citations re-anchored). Revised 2026-09-19
(inventory re-counted after the internal-commands, two-factor, email-confirmation, stored-permission-grant,
AI, CSP and health-report-cache waves: nineteen validated chains in the Infrastructure package, twelve of
them reaching every host and seven opt-in, and twenty-seven framework registrations in all; nine framework
bindings deliberately off the chain; two settings types implementing IValidatableObject and three custom
IValidateOptions<T> in use). Revised 2026-09-25 (both Identity AuthenticationService classes take
their two IOptions<T> injections directly; neither app has a settings carrier class any longer).
Revised 2026-10-01 (inventory re-counted: thirty-one framework registrations; three IValidatableObject
types and four custom validators; source citations re-anchored). Revised 2026-10-06 (inventory re-counted:
thirty-three framework registrations with SecurityHeadersSettings and SameOriginApiProxySettings now on
the chain, eleven framework bindings deliberately off it, five custom IValidateOptions<T>, and each
Identity AuthenticationService now takes a single IOptions<T>; source citations re-anchored).
Revised 2026-10-07: LegalAcceptanceOptions now states its off-chain reason in a comment at the call
site rather than only in XML remarks, and anchors were refreshed after the v1.233.0 release.
Revised 2026-10-21: inventory re-counted to thirty-five framework registrations (ServiceTokenSettings
and the DefaultSchemeGuard marker added), four IValidatableObject types and six custom validators
(GatewaySettingsValidator added), seven ADC Application injections, and get-only collections noted
on SameOriginApiProxySettings; source citations re-anchored.
Revised 2026-10-26: inventory re-counted to thirty-seven framework registrations (the
CloudAdapterTripwireOptions and HostIntegrationTripwireOptions startup-tripwire markers added),
eight custom validators, and fifteen framework exceptions now that the cloud adapter packages bind six
vendor sections off the chain in place of NativePushSettings and FileStorageSettings; source
citations re-anchored; the NativePush:Enabled tripwire also fails an incomplete push section, the SNS
and FCM push settings bind only once push is enabled and complete, and registration-time Get<T>()
reads never placed in the container are stated as outside the exception inventory.
Revised 2026-10-28: Store's Sales module now binds eight validated sections, its Application layer names
thirteen IOptions injections, and its Sales Infrastructure readers include StripeTaxCalculator and
PaymentReconciliationSettingsValidator; source citations re-anchored.
Revised 2026-11-04: JwksSettings now implements IValidatableObject (MMCA.Common 1.277.0), so five
settings types use it, and the TokenService constructor anchors moved; see Revision below.
Revised 2026-11-23: inventory re-counted to forty-five framework registrations (twenty-five in the
Infrastructure package with ViewAsSettings and four opt-in chains added, plus PasskeySettings,
McpSettings and the Application WebhookSettings outside it) and eleven custom validators; the
CloudAdapterTripwire also fails Passkeys:Enabled and MachineClients:Enabled without their
registration calls; SignInSettings takes the retired UiReadCacheOptions place among the framework
exceptions and MultiFactorAuthorizationSettings makes them sixteen; consumer hosts take the escape five
times and ADC's Conference module once; Store's Sales module binds six
sections; the service hosts reach AddModuleHost through AddMmcaServiceHost; fourteen framework
Application classes read IOptions; source citations re-anchored.
Context
Every host in the workspace reads a dozen or more configuration sections: connection strings, SMTP, JWT key material, outbox tuning, message-bus provider, module enablement, page-size limits. A settings value can go wrong in two places. It can be discovered at first use, where a missing SMTP host becomes a 500 on the first password-reset mail and an unparseable outbox interval becomes a background loop that never drains, both on a replica that already passed its readiness probe and is taking live traffic. Or it can be discovered at boot, where the host refuses to start and the platform never routes to it.
Nothing in the record decided which. ADR-025 gates a replica out of rotation until warm-up has had its chance, but warm-up runs only on a host that started. ADR-031 decides that feature flags are read from configuration without saying what happens when the section is absent. ADR-061 decides where a secret value comes from at runtime, not what a host does when the value never arrives.
A second, related question had no recorded answer: how code below the host reaches a bound setting. The
options pipeline is a Microsoft.Extensions.Options concern, and a layer that is supposed to be free of
hosting concerns taking an IOptions<T> constructor parameter drags that pipeline into it.
Decision
Bind every settings section through a validating chain that runs at startup, and read the bound
value through IOptions<T> of the concrete settings class.
- One binding shape, used everywhere.
AddOptions<T>().Bind(configuration.GetSection(T.SectionName)).ValidateDataAnnotations().ValidateOnStart()is the required form (MMCA.Common/Source/Core/MMCA.Common.Infrastructure/DependencyInjection.cs:73-76)..BindConfiguration(T.SectionName)is the accepted shorthand for theBind(GetSection(...))step and is what Store's Sales module uses for all six of the sections it binds (MMCA.Store/Source/Modules/Sales/MMCA.Store.Sales.API/SalesModule.cs:53-56,:62-65,:67-70,:72-75,:77-80,:82-85).ValidateOnStart()is the load-bearing link: without it the annotations are evaluated lazily on first resolution, which is exactly the first-use failure the contract exists to prevent. - The framework owns the base set. Twenty-four sections are bound on this chain in the
Infrastructure package (one,
MachineClientSettings, dropsValidateDataAnnotations()and relies on its validator; see Rationale). Twenty-three sit in itsDependencyInjectionpartial class, which spans nine files:DependencyInjection.csand its.Caching,.Auth,.Jobs,.Notifications,.FeatureFlags,.MachineClients,.Persistenceand.Messagingparts (the last holdsAddBrokerMessaging,DependencyInjection.Messaging.cs:48, which registers no options chain of its own and reads theMessageBussection back with a plainGet<MessageBusSettings>()at:54to pick the transport; the validated chain for that section is the one inAddInfrastructure), and the twenty-fourth sits in the package's webhook registration (below). Ten sit directly insideAddInfrastructure(the method starting atMMCA.Common/Source/Core/MMCA.Common.Infrastructure/DependencyInjection.cs:58;ConnectionStringSettings:73-76,SmtpSettings:99-102,PersistenceSettings:145-148,OutboxSettings:150-153,LoginProtectionSettings:155-158,PasswordResetSettings:161-164,RefreshSessionSettings:169-172,ViewAsSettings:193-196,MessageBusSettings:215-218,JwksSettings:220-223), an eleventh arrives through the privateAddInternalCommandshelper thatAddInfrastructurecalls (:275):InternalCommandsSettings(DependencyInjection.Jobs.cs:148-152, the helper starting at:146), and two more arrive through theservices.AddCaching(configuration)call thatAddInfrastructureitself makes (:141):CacheSettings(DependencyInjection.Caching.cs:48-51) andQueryCachePipelineSettings(:53-56). Those thirteen reach every host that registers the package, and so does a twenty-fifth Infrastructure registration that binds no section:AddInfrastructureputs aCloudAdapterTripwireOptionsmarker on the chain (DependencyInjection.cs:244, its validator registered at:245-246, the reason for the push check at:240-243, the passkey and machine-client reasons atConfiguration/CloudAdapterTripwire.cs:37-49) so that a host fails at startup when its configuration switches on a capability whose registration call is missing:NativePush:Enabledwhile the push sender is still the inert core default (no adapter call was made, or the call was made but its push section is incomplete, so it returned early),Passkeys:Enabledwith no passkey ceremony registered, orMachineClients:Enabledwith machine clients not registered. The remaining eleven sit in opt-in registration methods a host calls only when it wants the feature:SchedulerSettingsinAddScheduledJobs(DependencyInjection.Jobs.cs:39-42),TwoFactorSettingsinAddTwoFactorAuthentication(DependencyInjection.Auth.cs:48-51),EmailConfirmationSettingsinAddEmailConfirmation(DependencyInjection.Auth.cs:81-84),SignInLinkSettingsinAddSignInLinks(DependencyInjection.Auth.cs:108-111, the method starting at:106),PermissionGrantSettingsinAddStoredPermissionGrants(DependencyInjection.Auth.cs:176-179),AuditTrailSettingsinAddAuditTrail(DependencyInjection.Jobs.cs:110-113),TenancySettingsinAddMultiTenancy(DependencyInjection.cs:322-325, the method starting at:320),PushNotificationSettingsinAddPushNotifications(DependencyInjection.Notifications.cs:43-46, the method starting at:41),FeatureFlagOverrideSettingsinAddReloadableFeatureFlags(DependencyInjection.FeatureFlags.cs:64-67, the method starting at:47),MachineClientSettingsinAddMachineClients(DependencyInjection.MachineClients.cs:41-43, the method starting at:37), andWebhookSettingsinAddWebhooks(MMCA.Common/Source/Core/MMCA.Common.Infrastructure/Webhooks/WebhookServiceCollectionExtensions.cs:71-74, the method starting at:67). The two cache sections take the chain only when the caller passes configuration:AddCachingtakes an optionalIConfiguration(DependencyInjection.Caching.cs:30) and, called without one, registers both unbound (:60-61), soIOptions<T>resolves to the compiled-in defaults instead of failing a caller that configures no cache section at all. Twenty more registrations sit outside the Infrastructure package, seventeen of them binding a section:IdempotencySettings(MMCA.Common/Source/Presentation/MMCA.Common.API/DependencyInjection.cs:78-81),JwtSettings, bound insideAddCommonAuthentication(MMCA.Common/Source/Presentation/MMCA.Common.API/Startup/WebApplicationBuilderExtensions.Authentication.cs:136-139, the method starting at:134),RateLimitingSettings(MMCA.Common/Source/Presentation/MMCA.Common.API/Startup/WebApplicationBuilderExtensions.RateLimiting.cs:410),ApiSettings(MMCA.Common/Source/Presentation/MMCA.Common.UI/DependencyInjection.cs:46-49, the method starting at:43),SecurityHeadersSettings, bound by the Aspire hosting package'sAddCommonSecurityHeaders(MMCA.Common/Source/Hosting/MMCA.Common.Aspire/Security/SecurityHeaders.cs:276-277, the method starting at:268),GatewayRateLimitingSettings, bound by the Aspire hosting package'sAddGatewayRateLimiting(MMCA.Common/Source/Hosting/MMCA.Common.Aspire/Gateway/GatewayRateLimitingExtensions.cs:375-378, the method starting at:369),GatewaySettings, bound by the Gateway package'sAddMmcaGateway(MMCA.Common/Source/Hosting/MMCA.Common.Gateway/GatewayReverseProxyExtensions.cs:63-66, the method starting at:56),AiSettings(MMCA.Common/Source/Core/MMCA.Common.AI/DependencyInjection.cs:123-128),PasskeySettings, bound by the opt-in Passkeys package'sAddPasskeys(MMCA.Common/Source/Core/MMCA.Common.Passkeys/PasskeysServiceCollectionExtensions.cs:41-43),McpSettings, bound by the Mcp package (MMCA.Common/Source/Presentation/MMCA.Common.Mcp/McpHostingExtensions.cs:58-63),ContentPolicySettings(MMCA.Common/Source/Core/MMCA.Common.AI/Guardrails/GuardrailServiceCollectionExtensions.cs:67-70),BlazorCspSettings(MMCA.Common/Source/Presentation/MMCA.Common.UI.Web/DependencyInjection.cs:69-71),SameOriginApiProxySettings(MMCA.Common/Source/Presentation/MMCA.Common.UI.Web/SameOriginProxy/SameOriginApiProxyServiceExtensions.cs:55-65),BlazorCircuitLimitSettings(MMCA.Common/Source/Presentation/MMCA.Common.UI.Web/Hardening/BlazorCircuitLimitExtensions.cs:55-58),UiRateLimitingSettings(MMCA.Common/Source/Presentation/MMCA.Common.UI.Web/Hardening/UiRateLimitingExtensions.cs:222-225, the method starting at:217),HealthReportCacheOptions, bound by the Aspire hosting package (MMCA.Common/Source/Hosting/MMCA.Common.Aspire/Extensions.Health.cs:33-36), andServiceTokenSettings, bound once by a private helper that both of the gRPC package'sAddServiceTokenClientandAddServiceTokenAuthenticationcall (MMCA.Common/Source/Presentation/MMCA.Common.Grpc/Authentication/ServiceTokenServiceCollectionExtensions.cs:110-113, the helper starting at:103, called at:39and:70). Three more bind no section. The Application package'sAddWebhookDelivery()putsWebhookSettingson the chain a second time as a bareAddOptions<WebhookSettings>().ValidateOnStart()beside itsWebhookRegistrationValidator(MMCA.Common/Source/Core/MMCA.Common.Application/DependencyInjection.Webhooks.cs:98-99, the method starting at:94). It is the same options type and section that the InfrastructureAddWebhooksbinds with the full chain, and the validator fails the host unless a subscription store is registered, which in practice meansAddWebhooksran (MMCA.Common/Source/Core/MMCA.Common.Application/Webhooks/WebhookRegistrationValidator.cs:18-22), so in a working host the annotations check that section too. The gRPC file'sAddServiceTokenAuthenticationputs aDefaultSchemeGuardmarker type on the chain so that a service-token scheme which became the default authentication scheme fails the host at startup (:81-85, the reason at:77-80), and the Aspire hosting package'sAddServiceDefaultsputs aHostIntegrationTripwireOptionsmarker on it (MMCA.Common/Source/Hosting/MMCA.Common.Aspire/Extensions.cs:50, its validator registered at:51-52, the reason at:46-49) so that configuration asking for a vendor integration whose adapter call was never made (an Application Insights connection string with no exporter, a vault URI with no configuration source, a key-ring blob with no DataProtection sink) fails the host at startup (MMCA.Common/Source/Hosting/MMCA.Common.Aspire/Integrations/HostIntegrationTripwire.cs:15). Forty-five framework registrations in all (the twoWebhookSettingsregistrations name one options type and one section). - Each service host adds exactly two of its own,
ApplicationSettingsandModulesSettings, and the same pair of chains covers all eight hosts across the three application repos. Seven of the eight reach them through one shared framework call rather than an inline copy:AddModuleHostbinds and validates both sections before it builds the host'sModuleLoader(MMCA.Common/Source/Presentation/MMCA.Common.API/Startup/ModuleHostExtensions.cs:61-64and:69-72, the method starting at:51), and ADC's four services and Store's three reach it through the composed service-host start-up of theMMCA.Common.ServiceHostpackage: each callsbuilder.AddMmcaServiceHost(MMCA.ADC/Source/Services/MMCA.ADC.Conference.Service/Program.cs:82,MMCA.Store/Source/Services/MMCA.Store.Catalog.Service/Program.cs:32), which callsAddModuleHost(MMCA.Common/Source/Hosting/MMCA.Common.ServiceHost/ServiceHostBuilderExtensions.cs:100, the method starting at:63), so no service host writes either chain itself. The Helpdesk monolith seed still writes both chains out in its ownProgram.cs(MMCA.Helpdesk/Source/Hosts/MMCA.Helpdesk.Web/Program.cs:20-23and:109-112), which is exactly what the shared call expands to, so the contract reads the same whether a host takes the helper or spells it out. Modules may add their own sections on the same chain, as Store's Sales module does for Stripe. - Validation is data annotations, extended by
IValidatableObjectwhere a rule spans fields.JwtSettingsmarksIssuerandAudience[Required](MMCA.Common/Source/Core/MMCA.Common.Infrastructure/Auth/JwtSettings.cs:53-58) and implementsIValidatableObject(:16) so key material is checked conditionally on the selected algorithm: RS256 (the default) demandsRsaPrivateKeyPem, HS256 demands aSecretForKeyof at least 32 characters (:79-94).ValidateDataAnnotations()invokes that method, so a host configured for RS256 with no private key fails to boot rather than failing to sign its first token. IOptions<T>of the concrete settings class is the one resolution surface. Code that needs a bound section takes it at the point of use:TokenServicetakesIOptions<JwtSettings>(MMCA.Common/Source/Core/MMCA.Common.Infrastructure/Auth/TokenService.cs:73) beside an optionalIOptions<JwksSettings>that names the signing key in the token'skidheader (:77), both ofSmtpEmailSender's constructors takeIOptions<SmtpSettings>(.../Mail/SmtpEmailSender.cs:29and:50),RepositoryFactorytakesIOptions<ApplicationSettings>(.../Persistence/Repositories/Factory/RepositoryFactory.cs:15), andEntityControllerBaseresolves the same options per request in itsMaxPageSizeandMaxExportRowsaccessors (MMCA.Common/Source/Presentation/MMCA.Common.API/Controllers/EntityControllerBase.cs:62and:82). Settings classes declareget/initmembers (MMCA.Common/Source/Core/MMCA.Common.Infrastructure/Mail/SmtpSettings.cs:18-59), so the value a consumer reads is one it cannot rebind, and there is no second type per section to keep in step with the class the chain binds and validates. Three bound framework types keep a public setter:ModuleSettings.RemoteDependencies(MMCA.Common/Source/Core/MMCA.Common.Application/Settings/ModuleSettings.cs:38, with CA2227 suppressed at:37because configuration binding needs it), every scalar member ofSameOriginApiProxySettings(MMCA.Common/Source/Presentation/MMCA.Common.UI.Web/SameOriginProxy/SameOriginApiProxySettings.cs:39,:47,:83,:90,:98; its two collections,AdditionalTokenIssuingPathsat:53andMaxRequestBodySizeByPathat:76, are get-only;GatewayAddressis filled in by aPostConfigureatSameOriginApiProxyServiceExtensions.cs:60-63), andRegistrationSettings.CollectAddress(MMCA.Common/Source/Presentation/MMCA.Common.UI/Common/Settings/RegistrationSettings.cs:18). Three code-configured options types that bind no section also carry setters:SessionCookieSettings(MMCA.Common/Source/Presentation/MMCA.Common.API/SessionCookies/SessionCookieSettings.cs:19,:29,:38), the three members ofOwnerOrAdminFilterOptions(MMCA.Common/Source/Presentation/MMCA.Common.API/Authorization/OwnerOrAdminFilterOptions.cs:16,:24,:31), which a host sets withservices.Configurein code, andFallbackAuthorizationOptions.Enabled(MMCA.Common/Source/Presentation/MMCA.Common.API/Authorization/Fallback/FallbackAuthorizationOptions.cs:52).- Sixteen exceptions in the framework, thirteen of them on one shared reason: an absent section is a
working default, not a misconfiguration.
CacheKeyPrefixOptionsis bound with a bareservices.Configureand no validation, because an absent section must leave cache keys exactly as callers write them (a single call insideAddCaching,MMCA.Common/Source/Core/MMCA.Common.Infrastructure/DependencyInjection.Caching.cs:46, the method starting at:30).LayoutSettingsbinds withAddOptions().Bind()and nothing after it for the same reason: it is optional footer copy (MMCA.Common/Source/Presentation/MMCA.Common.UI/DependencyInjection.cs:52-53, the reason at:51), and four sections registered beside it bind exactly the same way, each with its reason in a comment beside the binding:LegalSettings(:57-58, an absent section leaves every legal link empty, the reason at:55-56),RegistrationSettings(:62-63, an absent section keeps every register-page block, the reason at:60-61),SignInSettings(:67-68, an absent section offers no new sign-in action, the reason at:65-66), andNotificationBellOptions(:71-72, an absent section leaves the compiled-in defaults, the reason at:70).LegalAcceptanceOptionsbinds the same way inside the opt-inAddLegalAcceptance(MMCA.Common/Source/Core/MMCA.Common.Infrastructure/DependencyInjection.Auth.cs:144-145), because its one setting has no invalid value (any version string turns the feature on, null or whitespace turns it off); the reason sits in a comment at the call (:141-143), and the method's XML remarks (:135-136) add that registration asks for acceptance only whileLegal:CurrentTermsVersionis set. The cloud adapter packages bind their six vendor sections with a bareAddOptions<T>().Bind(...)and no validation, in one of two orders. The four file-storage and hub methods bind first and then read the section back:AzureBlobFileStorageSettings(MMCA.Common/Source/Hosting/MMCA.Common.Azure/AzureServiceCollectionExtensions.cs:48-49, read back at:51),AzureNotificationHubSettings(:90-91, read back at:93),S3FileStorageSettings(MMCA.Common/Source/Hosting/MMCA.Common.Aws/AwsServiceCollectionExtensions.cs:55-56, read back at:58) andGcsFileStorageSettings(MMCA.Common/Source/Hosting/MMCA.Common.Gcp/GcpServiceCollectionExtensions.cs:53-54, read back at:56). The SNS and FCM push methods reverse the order: they read the section first, return early unlessNativePush:Enabledis true and the section is complete, and only then bindSnsNativePushSettings(AwsServiceCollectionExtensions.cs, read at:179, bound at:190) andFcmNativePushSettings(GcpServiceCollectionExtensions.cs, read at:154, bound at:162), so with push off those two register no options at all. Either way each method turns itself into a no-op when its section is absent or incomplete, so a host registers it unconditionally and switches the feature on by configuration alone. The one guard is theCloudAdapterTripwireOptionsmarker above: a host that setsNativePush:EnabledwhileINativePushSenderis stillNullNativePushSenderfails at startup, whether it made no adapter call or made one whose push section is incomplete (the check atMMCA.Common/Source/Core/MMCA.Common.Infrastructure/Configuration/CloudAdapterTripwire.cs:77-78, the message naming both causes at:81, the validator at:32; the same validator collects the passkey and machine-client failures at:64-69and:71-75and reports every failure together), so an incomplete push section with push switched on fails the host rather than becoming a silent no-op, while file storage is deliberately unchecked because aFileStoragesection is routinely shared configuration and the core default fails every upload loudly instead (:24-28).DataSourcesSettingsis the one exception with a mechanical rather than a policy reason: it is constructed directly from the section rather than throughAddOptions, because a root-level dictionary section does not bind through the options pipeline (MMCA.Common/Source/Core/MMCA.Common.Infrastructure/DependencyInjection.cs:88-90, the reason at:86-87), and it still counts because the result is registered for runtime resolution (:91). A plainGet<T>()that a registration method uses only to decide what to register, and never puts in the container, is not an exception: like theGet<MessageBusSettings>()above, the reads ofRdsIamAuthenticationSettings(MMCA.Common/Source/Hosting/MMCA.Common.Aws/AwsServiceCollectionExtensions.cs:112),CloudSqlIamAuthenticationSettings(MMCA.Common/Source/Hosting/MMCA.Common.Gcp/GcpServiceCollectionExtensions.cs:95) andAmazonSqsTransportSettings(MMCA.Common/Source/Hosting/MMCA.Common.Aws/Messaging/AmazonSqsTransport.cs:78) run while the host registers its services, so whatever they check (a half-set key pair, a connection string that would send a token in clear) fails registration rather than first use.OwnerOrAdminFilterOptionsis the fifteenth and keeps more of the chain than the rest: it binds no section (hosts set it in code), is registered withValidateDataAnnotations()and drops onlyValidateOnStart, because its requiredBypassRolehas no framework default (the framework knows no role names), so validating at startup would fail every host that never applies the filter, while validating on first resolve puts the annotation message in front of the host that actually uses it (MMCA.Common/Source/Presentation/MMCA.Common.API/DependencyInjection.cs:94-95, the reason at:90-93).MultiFactorAuthorizationSettingsis the sixteenth: it is bound inside aConfigure<IServiceProvider>delegate with noValidateDataAnnotations()and noValidateOnStart()(MMCA.Common/Source/Presentation/MMCA.Common.API/Authorization/AuthorizationExtensions.cs:142-144, in the privateAddMultiFactorRoleRequirementstarting at:129). Its comment (:140-141) explains only theGetServicelookup (a host with noIConfigurationbinds nothing and the rule stays off), not why the section skips validation, so it is the one framework exception without a stated reason. - Consumer hosts take the same escape five times, and write the reason at the call site. ADC's
Engagement service binds
PointsSettings(MMCA.ADC/Source/Services/MMCA.ADC.Engagement.Service/Program.cs:94-95, the reason at:91-93),CheckInSettings(:100-101, the reason at:97-99) andTicketSettings(:106-107, the reason at:103-105) withoutValidateOnStart: the defaults are working values and an explicit zero is the documented per-rule kill switch, so no value an organizer could set should stop that host from booting mid-conference. ADC's Conference service bindsRoomCheckInSettingsthe same way (MMCA.ADC/Source/Services/MMCA.ADC.Conference.Service/Program.cs:313-314, the reason at:310-312), and its Identity service bindsInviteEmailSettings(MMCA.ADC/Source/Services/MMCA.ADC.Identity.Service/Program.cs:207-208, the reason at:205-206: an unset app-store link is left out of the invitation email). One consumer module does the same: ADC's Conference module bindsSessionizeSettingswithBindConfigurationalone (MMCA.ADC/Source/Modules/Conference/MMCA.ADC.Conference.Infrastructure/DependencyInjection.cs:38-39, the reason at:36-37: a missing section keeps the default response ceiling). All six follow the rule the framework's other fifteen follow: an exception is legitimate when the section has no invalid value, and the reason belongs in a comment beside the binding rather than left to be inferred from its absence.
Every layer reads a bound section the same way. Inside Infrastructure and API that is a constructor
or per-request IOptions<T>: OutboxProcessor
(MMCA.Common/Source/Core/MMCA.Common.Infrastructure/Persistence/Outbox/Processing/OutboxProcessor.cs:64),
BrokerEventBus (.../Messaging/BrokerEventBus.cs:35), LoginProtectionService
(.../Auth/LoginProtectionService.cs:40), RsaJwksProvider (.../Auth/RsaJwksProvider.cs:14),
SQLServerDbContext (.../Persistence/DbContexts/SQLServerDbContext.cs:36), and IdempotencyFilter
(MMCA.Common/Source/Presentation/MMCA.Common.API/Idempotency/IdempotencyFilter.cs:443), and so does the
framework's /client-config minimal-API handler, which reads IOptions<ApiSettings>
(MMCA.Common/Source/Presentation/MMCA.Common.UI.Web/ClientConfig/ClientConfigEndpointExtensions.cs:78)
and which ADC's web host maps with app.MapClientConfigEndpoint
(MMCA.ADC/Source/Hosts/UI/MMCA.ADC.UI.Web/Program.cs:272). Consumer code reads its own sections the
same way: Store's Sales Infrastructure in StripeClientFactory.cs:37, StripePaymentService.cs:63 (and
:67), StripeWebhookRegistrationService.cs:49, StripeTaxCalculator.cs:24,
PaymentReconciliationService.cs:71-72 and PaymentReconciliationSettingsValidator.cs:22.
The Application layer names the options pipeline too, and the framework names it in fourteen of its
own classes, thirteen by constructor injection and one by resolving it from a scope: AuthenticationServiceBase<TUser> takes an optional
IOptions<EmailConfirmationSettings>
(MMCA.Common/Source/Core/MMCA.Common.Application/Auth/AuthenticationServiceBase.cs:81),
AuthSessionIssuer takes IOptions<RefreshSessionSettings>
(MMCA.Common/Source/Core/MMCA.Common.Application/Auth/Sessions/AuthSessionIssuer.cs:57),
ViewAsService takes IOptions<ViewAsSettings> (.../Auth/ViewAs/ViewAsService.cs:46),
MachineClientService takes IOptions<MachineClientSettings>
(.../Auth/MachineClients/MachineClientService.cs:41), PasskeyService takes
IOptions<PasskeySettings> (.../Auth/Passkeys/PasskeyService.cs:34),
AuthenticationValidators takes an optional IOptions<LegalAcceptanceOptions>
(MMCA.Common/Source/Core/MMCA.Common.Application/Auth/AuthenticationValidators.cs:30), the two
sign-in-link bases take IOptions<SignInLinkSettings>, SendSignInLinkHandlerBase
(.../Users/UseCases/SignInLinks/SendSignInLinkHandlerBase.cs:48) and RedeemSignInLinkHandlerBase
(.../Users/UseCases/SignInLinks/RedeemSignInLinkHandlerBase.cs:62), three webhook classes read
IOptions<WebhookSettings>, DeliverWebhookInternalCommandHandler
(.../Webhooks/Delivery/DeliverWebhookInternalCommandHandler.cs:29) and WebhookSubscriptionService
(.../Webhooks/Subscriptions/WebhookSubscriptionService.cs:30) in the constructor and
WebhookFanOutHandler by resolving it from a scope (.../Webhooks/Delivery/WebhookFanOutHandler.cs:62), the shared
ForgotPasswordHandlerBase takes IOptions<PasswordResetSettings>
(MMCA.Common/Source/Core/MMCA.Common.Application/Users/UseCases/ForgotPassword/ForgotPasswordHandlerBase.cs:41),
SendEmailConfirmationHandlerBase takes IOptions<EmailConfirmationSettings>
(MMCA.Common/Source/Core/MMCA.Common.Application/Users/UseCases/EmailConfirmation/SendEmailConfirmationHandlerBase.cs:55),
and CachingQueryDecorator takes an optional IOptions<QueryCachePipelineSettings>
(MMCA.Common/Source/Core/MMCA.Common.Application/UseCases/Decorators/CachingQueryDecorator.cs:48).
ADC adds seven injections across six classes, one each in all but the last: its Identity AuthenticationService takes the
IOptions<EmailConfirmationSettings> it forwards to the base constructor
(MMCA.ADC/Source/Modules/Identity/MMCA.ADC.Identity.Application/Users/AuthenticationService.cs:57),
and the other five are:
ForgotPasswordHandler (.../Users/UseCases/ForgotPassword/ForgotPasswordHandler.cs:25),
SendEmailConfirmationHandler
(.../Users/UseCases/SendEmailConfirmation/SendEmailConfirmationHandler.cs:31), and in
Engagement PointsAwarder
(MMCA.ADC/Source/Modules/Engagement/MMCA.ADC.Engagement.Application/Points/Services/PointsAwarder.cs:32),
GetLeaderboardHandler (.../Points/UseCases/GetLeaderboard/GetLeaderboardHandler.cs:30) and
RecordRoomCheckInHandler, which takes two, IOptions<CheckInSettings> and IOptions<PointsSettings>
(.../CheckIns/UseCases/RecordRoomCheckIn/RecordRoomCheckInHandler.cs:47 and :48).
Store adds thirteen, with the same shape: its Identity AuthenticationService takes the same single
injection
(MMCA.Store/Source/Modules/Identity/MMCA.Store.Identity.Application/Users/AuthenticationService.cs:32),
plus
ForgotPasswordHandler (.../Users/UseCases/ForgotPassword/ForgotPasswordHandler.cs:26),
SendEmailConfirmationHandler
(.../Users/UseCases/EmailConfirmation/SendEmailConfirmationHandler.cs:32),
CreateCheckoutSessionCommandValidator
(MMCA.Store/Source/Modules/Sales/MMCA.Store.Sales.Application/Orders/UseCases/CreateCheckoutSession/CreateCheckoutSessionCommandValidator.cs:22),
CheckOutDeadlineScheduler (.../ShoppingCarts/UseCases/CheckOut/CheckOutDeadlineScheduler.cs:27),
ExpireUnpaidOrderInternalCommandHandler
(.../Orders/InternalCommands/ExpireUnpaidOrderInternalCommandHandler.cs:35),
OrderChargesCalculator, which takes IOptions<ShippingSettings>
(.../Orders/Charges/OrderChargesCalculator.cs:25), the two guest-order senders that take
IOptions<CheckoutRedirectSettings>, SendGuestOrderLinkInternalCommandHandler
(.../Orders/InternalCommands/SendGuestOrderLinkInternalCommandHandler.cs:38) and
GuestOrderPlacedNotifier (.../Orders/UseCases/GuestCheckout/GuestOrderPlacedNotifier.cs:30),
OrderPaymentFailedSagaHandler, which is the one site that resolves its
IOptions<UnpaidOrderExpirySettings> from a scope rather than taking it in the constructor
(.../Orders/Saga/OrderPaymentFailedSagaHandler.cs:72), and in Catalog three classes that take
IOptions<StoreTimeZoneSettings>: ProductVariantDTOMapper, optionally
(MMCA.Store/Source/Modules/Catalog/MMCA.Store.Catalog.Application/Products/DTOs/ProductVariantDTOMapper.cs:29),
SetProductDiscountHandler (.../Products/UseCases/SetProductDiscount/SetProductDiscountHandler.cs:22)
and SetVariantDiscountHandler (.../Products/UseCases/SetVariantDiscount/SetVariantDiscountHandler.cs:23).
Only Helpdesk's Application layer names no IOptions at all.
The contract is therefore one rule rather than two: the fail-fast chain is mandatory for every
section other than the exceptions recorded above, and IOptions<T> at the point of consumption is
how every layer reads the result, Application included. The injections listed above are conformant,
not debt. PasswordResetSettings shows what the single surface buys: the framework's own base class
takes it and both consumer handlers forward their IOptions<PasswordResetSettings> straight into that
base constructor (ADC at
.../MMCA.ADC.Identity.Application/Users/UseCases/ForgotPassword/ForgotPasswordHandler.cs:27, Store at
.../MMCA.Store.Identity.Application/Users/UseCases/ForgotPassword/ForgotPasswordHandler.cs:28), so
what the handler reads is the one instance the host bound and validated at boot, with nothing in
between to fall out of step with it.
Rationale
- A boot failure is cheaper than a first-use failure. A host that will not start is caught by the
deployment, by a local
dotnet run, or by CI. A host that starts and fails on the first mail send is caught by a user, on a replica the platform already considers healthy. ValidateOnStartis the whole point of the chain.ValidateDataAnnotations()alone defers evaluation to first resolution, which for a section only a background service reads can be minutes after the replica takes traffic. Pairing the two is what converts "configured wrong" into "did not start".- Validation belongs on the settings type. Annotations plus
IValidatableObjectkeep the rule next to the property it constrains, soJwtSettingscan express "RS256 requires a private key" once instead of every host re-checking it. - One options surface, validated once. A read-only alias interface per settings class would be a
second type to keep in step with the class the chain binds, and a second way for a reader to ask the
same question.
IOptions<T>of the concrete class is the one surface a consumer sees, theinit-only members (everywhere but the setter-bearing types named above) are what make the value unwritable at the point of use, and the validation that ran at boot covers every reader because there is only one bound instance to read. - One shape makes the contract auditable. Because every chain ends in
ValidateOnStart(), even where it varies (BlazorCspSettingsdropsValidateDataAnnotations(),MMCA.Common/Source/Presentation/MMCA.Common.UI.Web/DependencyInjection.cs:69-71, and so doesSameOriginApiProxySettings, which inserts aPostConfigure,SameOriginApiProxyServiceExtensions.cs:55-65;SecurityHeadersSettingscalls.Bindonly when configuration was supplied,SecurityHeaders.cs:276-281;RateLimitingSettingswrites the chain on one line,MMCA.Common/Source/Presentation/MMCA.Common.API/Startup/WebApplicationBuilderExtensions.RateLimiting.cs:410;AiSettingsinserts aPostConfigure,MMCA.Common/Source/Core/MMCA.Common.AI/DependencyInjection.cs:123-128;McpSettingscarries an inline.Validate(...)delegate in place ofValidateDataAnnotations(),MMCA.Common/Source/Presentation/MMCA.Common.Mcp/McpHostingExtensions.cs:58-63;MachineClientSettingsandPasskeySettingsdropValidateDataAnnotations()and rely on a validator,DependencyInjection.MachineClients.cs:41-45andMMCA.Common/Source/Core/MMCA.Common.Passkeys/PasskeysServiceCollectionExtensions.cs:41-44; Store'sStoreTimeZoneSettingsinserts a delegate.Validate(...),MMCA.Store/Source/Modules/Catalog/MMCA.Store.Catalog.API/CatalogModule.cs:40-44; the gRPC package'sDefaultSchemeGuardbinds no section at all and validates through a.Validate<IOptions<AuthenticationOptions>>(...)delegate,ServiceTokenServiceCollectionExtensions.cs:81-85; the two startup tripwires,CloudAdapterTripwireOptionsandHostIntegrationTripwireOptions, and the Application package'sWebhookSettingsare a bareAddOptions<T>().ValidateOnStart()with noBindand no annotations, checked only by anIValidateOptions<T>,MMCA.Common/Source/Core/MMCA.Common.Infrastructure/DependencyInjection.cs:244,MMCA.Common/Source/Hosting/MMCA.Common.Aspire/Extensions.cs:50andMMCA.Common/Source/Core/MMCA.Common.Application/DependencyInjection.Webhooks.cs:98), a grep forValidateOnStartis a complete inventory of what a host validates at boot: the forty-five framework registrations, plus whatever the host and its modules add. Collapsing the two host-owned sections intoAddModuleHostshortens that inventory rather than hiding it, since the pair is now read once in the framework instead of eight times across the repos.
Trade-offs
- Nothing enforces it. There is no architecture fitness test asserting that a new
AddOptions<T>call carriesValidateDataAnnotations().ValidateOnStart(). The uniformity above is convention held by review, not a gate, which is weaker than the invariant-over-discipline posture ADR-015 applies elsewhere. A section added without the chain fails silently, which is to say it fails later. Sixteen framework bindings, five consumer-host bindings and one consumer-module binding sit off the chain by choice, and nothing in the build distinguishes those from a section whose author simply forgot: only a source comment near each one does, andMultiFactorAuthorizationSettingslacks even that (for the six cloud adapter sections the reason sits only in the XML summary of each registration method, for exampleMMCA.Common/Source/Hosting/MMCA.Common.Azure/AzureServiceCollectionExtensions.cs:37and:77-79,MMCA.Common/Source/Hosting/MMCA.Common.Aws/AwsServiceCollectionExtensions.cs:43and:146, andMMCA.Common/Source/Hosting/MMCA.Common.Gcp/GcpServiceCollectionExtensions.cs:38and:122). - Bad configuration becomes a crash loop, not a degraded start. A deployed replica with a missing required value never reaches the warm-up and readiness machinery of ADR-025: it terminates at host build. That is the intended trade (no half-configured replica serves traffic), but it means a configuration mistake takes the whole rollout rather than one code path.
- The options pipeline reaches every layer. With
IOptions<T>as the one surface,Microsoft.Extensions.Optionsappears in Application-layer constructor signatures as readily as in Infrastructure ones. The alternative buys that purity with an alias type per settings class, and this record takes the pipeline over the second type. - Data annotations are the vocabulary. Anything richer needs
IValidatableObjector a customIValidateOptions<T>, and both escape hatches are in use in the framework: the former five times, the latter eleven times.JwtSettingsimplementsIValidatableObject(MMCA.Common/Source/Core/MMCA.Common.Infrastructure/Auth/JwtSettings.cs:16), and so doAiSettings(MMCA.Common/Source/Core/MMCA.Common.AI/AiSettings.cs:23), whose section is bound with the full chain (MMCA.Common/Source/Core/MMCA.Common.AI/DependencyInjection.cs:123-128),ContentPolicySettings(MMCA.Common/Source/Core/MMCA.Common.AI/Guardrails/ContentPolicySettings.cs:23) andServiceTokenSettings(MMCA.Common/Source/Presentation/MMCA.Common.Grpc/Authentication/ServiceTokenSettings.cs:18), andJwksSettings(MMCA.Common/Source/Core/MMCA.Common.Infrastructure/Auth/JwksSettings.cs:25), whose section is bound with the full chain (MMCA.Common/Source/Core/MMCA.Common.Infrastructure/DependencyInjection.cs:220-223) and which fails startup on an additional key with a missing, over-long or repeatedkid(the currentKeyIdincluded) or with key material that is absent or does not load (:79-116). Eleven validator classes sit beside a chain instead, each registered withTryAddEnumerableso two modules calling the same registration method cannot run the validation twice.AiProviderValidator(MMCA.Common/Source/Core/MMCA.Common.AI/Providers/AiProviderValidator.cs:16, registered atMMCA.Common/Source/Core/MMCA.Common.AI/DependencyInjection.cs:94) exists because whether the configured provider names a registeredIAiProviderFactorydepends on what the host registered, which no annotation onAiSettingscan see.TenancySettingsValidator(MMCA.Common/Source/Core/MMCA.Common.Infrastructure/Persistence/Tenancy/TenancySettingsValidator.cs:24-25, registered atDependencyInjection.cs:328-329) exists because confirming that a tenant's data-source override names a real physical source needsIDataSourceResolver, which no annotation can reach.ConnectionStringSettingsValidator(.../Persistence/DataSources/ConnectionStringSettingsValidator.cs:30-31, registered atDependencyInjection.cs:83-84) exists because the "a host must reach some database" rule spans two sections at once,ConnectionStringsandDataSources, so a SQLite-only host that declares its databases as named sources is legitimate while a host declaring none anywhere is not.BlazorCspSettingsValidator(MMCA.Common/Source/Presentation/MMCA.Common.UI.Web/Security/BlazorCspSettingsValidator.cs:13, registered atMMCA.Common/Source/Presentation/MMCA.Common.UI.Web/DependencyInjection.cs:74-75beside theBlazorCspSettingschain at:69-71) exists because a configured CSP source has to be screened for the characters that would break out of a source expression or widen a directive, which is a rule about the shape of each entry in a collection rather than about a single property.SameOriginApiProxySettingsValidator(MMCA.Common/Source/Presentation/MMCA.Common.UI.Web/SameOriginProxy/SameOriginApiProxySettingsValidator.cs:16, registered atSameOriginApiProxyServiceExtensions.cs:66-67) validates the proxy section, whose chain carries noValidateDataAnnotations().GatewaySettingsValidator(MMCA.Common/Source/Hosting/MMCA.Common.Gateway/GatewaySettingsValidator.cs:19, registered atGatewayReverseProxyExtensions.cs:70-71) exists becauseValidateDataAnnotations()does not recurse into the nested trace-header and health-check objects, so their[Required]values would otherwise never be checked at startup.CloudAdapterTripwire(MMCA.Common/Source/Core/MMCA.Common.Infrastructure/Configuration/CloudAdapterTripwire.cs:32, registered atDependencyInjection.cs:245-246) andHostIntegrationTripwire(MMCA.Common/Source/Hosting/MMCA.Common.Aspire/Integrations/HostIntegrationTripwire.cs:15, registered atMMCA.Common/Source/Hosting/MMCA.Common.Aspire/Extensions.cs:51-52) validate marker types that carry no data at all, because what they check is whether a vendor adapter or opt-in registration call was made, which only the registered services can show.MachineClientSettingsValidator(MMCA.Common/Source/Core/MMCA.Common.Infrastructure/Auth/MachineClients/MachineClientSettingsValidator.cs:15, registered atDependencyInjection.MachineClients.cs:44-45) andPasskeySettingsValidator(MMCA.Common/Source/Core/MMCA.Common.Passkeys/PasskeySettingsValidator.cs:12, registered atPasskeysServiceCollectionExtensions.cs:44) validate sections whose chains carry noValidateDataAnnotations(), andWebhookRegistrationValidator(MMCA.Common/Source/Core/MMCA.Common.Application/Webhooks/WebhookRegistrationValidator.cs:13, registered atMMCA.Common/Source/Core/MMCA.Common.Application/DependencyInjection.Webhooks.cs:99) is the only check that bareWebhookSettingsregistration adds (the annotations come from the InfrastructureAddWebhookschain on the same type). The cost of the second form is that the rule leaves the settings type and has to be registered separately, so a host that binds the section without also registering the validator validates less than it appears to. Store uses both forms on its own sections: two separate validators registered withTryAddEnumerablebeside their chains,StripeSettingsValidator(MMCA.Store/Source/Modules/Sales/MMCA.Store.Sales.API/SalesModule.cs:59-60) andPaymentReconciliationSettingsValidator(:89-90, the reason at:87-88), and an inline.Validate(...)delegate on theStoreTimeZoneSettingschain (MMCA.Store/Source/Modules/Catalog/MMCA.Store.Catalog.API/CatalogModule.cs:43). - A bound value is a snapshot.
IOptions<T>captures the instance built at binding time and never observes a configuration reload. A section that genuinely needs reload would have to move toIOptionsMonitor<T>, and none does today.
Revision (2026-10-01)
No decision or rationale changed; the inventory and several descriptions were brought back in line with
source. The framework now has thirty-one registrations on the chain rather than twenty-seven: a grep finds
33 ValidateOnStart() calls under MMCA.Common/Source, two of them the host-owned pair in
ModuleHostExtensions.cs:61-64 and :69-72, and the four new ones are RateLimitingSettings
(WebApplicationBuilderExtensions.RateLimiting.cs:353), ContentPolicySettings
(GuardrailServiceCollectionExtensions.cs:67-70), BlazorCircuitLimitSettings
(BlazorCircuitLimitExtensions.cs:55-58) and UiRateLimitingSettings
(UiRateLimitingExtensions.cs:164-167), so twelve sections now bind outside the Infrastructure package.
The Infrastructure DependencyInjection class is a partial split across five files, and AddCaching is
one method with an optional IConfiguration (DependencyInjection.Caching.cs:26) rather than two
overloads. The "get/init members only" statement now names its two exceptions
(ModuleSettings.cs:38, OwnerOrAdminFilterOptions.cs:16). The Rationale no longer calls the chain
textually identical, since three variants exist. The escape-hatch counts are now three
IValidatableObject types and four framework validators (AiProviderValidator.cs:16 is new), plus
Store's validator and inline delegate. The /client-config read moved from ADC's host into the framework
(ClientConfigEndpointExtensions.cs:51), Store's CheckOutHandler no longer takes IOptions (its
injection is in CheckOutDeadlineScheduler.cs:27), and Store's Application layer now names ten classes.
Every other citation was re-anchored in place.
Revision (2026-10-06)
No decision or rationale changed; the inventory was re-counted against source.
- A grep now finds 35
ValidateOnStart()calls underMMCA.Common/Source; less the host-owned pair that is thirty-three framework registrations (nineteen in Infrastructure, fourteen outside). The two new ones outside areSecurityHeadersSettings(SecurityHeaders.cs:276-277), which is no longer an exception, andSameOriginApiProxySettings(SameOriginApiProxyServiceExtensions.cs:55-65). - The off-chain exceptions are now eleven: the eight still recorded plus
LegalSettings,RegistrationSettings(UIDependencyInjection.cs:53-54,:58-59) andLegalAcceptanceOptions(DependencyInjection.Auth.cs:106-107), whose reason sits only in XML remarks. - Custom
IValidateOptions<T>validators are now five (SameOriginApiProxySettingsValidator.cs:14). - The setter list now names
SameOriginApiProxySettingsandRegistrationSettings.CollectAddress, and movesOwnerOrAdminFilterOptionsto the code-configured group, since it binds no section (APIDependencyInjection.cs:91-92): three bound types and three code-configured types. IOptions<RefreshSessionSettings>moved fromAuthenticationServiceBasetoAuthSessionIssuer.cs:42,AuthenticationValidators.cs:28takes an optionalIOptions<LegalAcceptanceOptions>, and each app's IdentityAuthenticationServicenow takes one injection (ADC:57, Store:32).- The Infrastructure
DependencyInjectionpartial now spans six files (.Messagingregisters no options chain; it only reads theMessageBussection back atDependencyInjection.Messaging.cs:49). UiRateLimitingSettingsre-anchored toUiRateLimitingExtensions.cs:180-183; every other citation was re-verified against current source and re-anchored in place.
Revision (2026-10-07)
Re-verified against current source. The decision, the rationale and every count are unchanged (thirty-three framework registrations, eleven framework exceptions, five custom validators); one exception's description moved.
LegalAcceptanceOptionsnow carries its reason in a comment at the call (MMCA.Common/Source/Core/MMCA.Common.Infrastructure/DependencyInjection.Auth.cs:106-108, the binding at:109-110): the one setting has no invalid value. The XML remarks (:100-101) remain, so the Decision no longer says the reason sits only there. The Trade-offs caveat now namesNativePushSettingsandFileStorageSettingsinstead: they bind with no comment at the call (MMCA.Common/Source/Core/MMCA.Common.Infrastructure/DependencyInjection.Notifications.cs:84-85,:116-117), their reason only in the XML summary of each registration method (:76-78,:109-110).- Anchors re-verified against current source:
PermissionGrantSettings(DependencyInjection.Auth.cs:141-144), ADC Conference.ServiceAddModuleHost(MMCA.ADC/Source/Services/MMCA.ADC.Conference.Service/Program.cs:371-373, the comment at:362),OutboxProcessor(.../Persistence/Outbox/Processing/OutboxProcessor.cs:59) andAuthSessionIssuer(MMCA.Common/Source/Core/MMCA.Common.Application/Auth/Sessions/AuthSessionIssuer.cs:44).
Revision (2026-10-21)
Re-verified against current source. The decision, the rationale, the nineteen Infrastructure chains, the eleven framework exceptions and the two consumer-host exceptions are unchanged; the inventory outside Infrastructure grew, two escape-hatch counts moved, and two descriptions were corrected.
- A grep now finds 37
ValidateOnStart()calls in 21 files underMMCA.Common/Source; less the host-owned pair inModuleHostExtensions.cs:61-64and:69-72that is thirty-five framework registrations (nineteen in Infrastructure, sixteen outside). The two new ones areServiceTokenSettings(MMCA.Common/Source/Presentation/MMCA.Common.Grpc/Authentication/ServiceTokenServiceCollectionExtensions.cs:103-106) and theDefaultSchemeGuardmarker chain in the same file (:78-82), which binds no section and validates through a.Validate<IOptions<AuthenticationOptions>>(...)delegate; the Rationale's list of chain variants now names it. IValidatableObjectis implemented four times (ServiceTokenSettings.cs:18is new) and customIValidateOptions<T>validators are six:GatewaySettingsValidator(MMCA.Common/Source/Hosting/MMCA.Common.Gateway/GatewaySettingsValidator.cs:19) is registered withTryAddEnumerableatGatewayReverseProxyExtensions.cs:62-63becauseValidateDataAnnotations()does not recurse into nested objects.- ADC's Application layer names seven injections across the same six classes:
RecordRoomCheckInHandlertakes bothIOptions<CheckInSettings>andIOptions<PointsSettings>(.../CheckIns/UseCases/RecordRoomCheckIn/RecordRoomCheckInHandler.cs:46and:47). - Only the scalar members of
SameOriginApiProxySettingskeep a setter (SameOriginApiProxySettings.cs:39,:47,:83,:90,:98); its collectionsAdditionalTokenIssuingPaths(:53) andMaxRequestBodySizeByPath(:76) are get-only. JwtSettings.Validatenow spansJwtSettings.cs:79-94(HS256 check:81-86, RS256 check:88-93).- Anchors re-verified against current source: Infrastructure
DependencyInjection.cs(MessageBusSettings:192-195,JwksSettings:197-200,AddInternalCommandscall:237,AddMultiTenancy:282with its chain at:284-287and theTenancySettingsValidatorregistration at:290-291);DependencyInjection.Notifications.cs(NativePushSettings:87-88,FileStorageSettings:119-120, XML-summary reasons:79-81and:112-113); UIDependencyInjection.cs(method:40,ApiSettings:43-46,LayoutSettings:49-50,LegalSettings:54-55and reason:52-53,RegistrationSettings:59-60and reason:57-58,UiReadCacheOptions:64-65,NotificationBellOptions:67-68, shared reason:62-63);GatewayReverseProxyExtensions.cs:55-58;SameOriginApiProxySettingsValidator.cs:16; ADC Conference.ServiceAddModuleHost(MMCA.ADC/Source/Services/MMCA.ADC.Conference.Service/Program.cs:373-375, the comment at:364);OutboxProcessor.cs:61; ADC UI WebMapClientConfigEndpoint(Program.cs:265);StripeWebhookRegistrationService.cs:49;ForgotPasswordHandlerBase.cs:41;SendEmailConfirmationHandlerBase.cs:45.
Revision (2026-10-26)
Re-verified against current source. The decision, the rationale, the nineteen Infrastructure sections (twelve reaching every host, seven opt-in), the two consumer-host exceptions and the six framework Application injections are unchanged; the cloud-neutral adapter split moved two exceptions into vendor packages and added two startup tripwires.
- A grep now finds 39
ValidateOnStart()calls in 22 files underMMCA.Common/Source; less the host-owned pair inModuleHostExtensions.cs:64and:72that is thirty-seven framework registrations (twenty in Infrastructure, seventeen outside). The two new ones bind no section:CloudAdapterTripwireOptions(MMCA.Common/Source/Core/MMCA.Common.Infrastructure/DependencyInjection.cs:221), insideAddInfrastructureand so reaching every host, andHostIntegrationTripwireOptions(MMCA.Common/Source/Hosting/MMCA.Common.Aspire/Extensions.cs:44), insideAddServiceDefaults. Both are a bareAddOptions<T>().ValidateOnStart(), and the Rationale's list of chain variants now names that shape. - Custom
IValidateOptions<T>validators are eight:CloudAdapterTripwire(MMCA.Common/Source/Core/MMCA.Common.Infrastructure/Configuration/CloudAdapterTripwire.cs:30, registered withTryAddEnumerableatDependencyInjection.cs:222-223) andHostIntegrationTripwire(MMCA.Common/Source/Hosting/MMCA.Common.Aspire/Integrations/HostIntegrationTripwire.cs:15, registered atExtensions.cs:45-46) are new. NativePushSettingsandFileStorageSettingsno longer exist, andDependencyInjection.Notifications.csholds only thePushNotificationSettingschain (:40-43). The cloud adapter packages bind six vendor sections off the chain instead:AzureBlobFileStorageSettingsandAzureNotificationHubSettings(AzureServiceCollectionExtensions.cs:45-46,:87-88),S3FileStorageSettingsandSnsNativePushSettings(AwsServiceCollectionExtensions.cs:54-55,:180), andGcsFileStorageSettingsandFcmNativePushSettings(GcpServiceCollectionExtensions.cs:52-53,:158). The framework exceptions are therefore fifteen, thirteen on the shared "absent section is a working default" reason; the Trade-offs now cite the adapter XML summaries for that reason, and the Decision notes thatNativePush:Enabledwith the push sender stillNullNativePushSenderfails startup throughCloudAdapterTripwire.- The tripwire covers more than a missing adapter call: it fails whenever
INativePushSenderis stillNullNativePushSender(CloudAdapterTripwire.cs:48-50, message at:53), which includes an adapter call whose push section is incomplete, because each push method returns early then (AzureServiceCollectionExtensions.cs:91-96,AwsServiceCollectionExtensions.cs:170-175,GcpServiceCollectionExtensions.cs:148-153). The two non-Azure push methods also bind in the other order from the four storage and hub methods: the section is read first andAddOptions<T>().Bind(...)runs only past the enabled-and-complete gate (Aws:168-180, Gcp:146-158), so with push off they register no options. The Decision now says both. - The fifteen exceptions are unchanged in count. The Decision now states that a registration-time
Get<T>()never placed in the container is outside the inventory, naming the three adapter reads that fall there:RdsIamAuthenticationSettings(AwsServiceCollectionExtensions.cs:111),CloudSqlIamAuthenticationSettings(GcpServiceCollectionExtensions.cs:94) andAmazonSqsTransportSettings(AmazonSqsTransport.cs:78);DataSourcesSettingscounts because it is registered (DependencyInjection.cs:90). - Anchors re-verified against current source: Infrastructure
DependencyInjection.cs(AddCachingcall:140,AddInternalCommandscall:252,AddMultiTenancy:297with its chain at:299-302and theTenancySettingsValidatorregistration at:305-306);AddPushNotifications(DependencyInjection.Notifications.cs:38, chain:40-43);AddBrokerMessaging(DependencyInjection.Messaging.cs:48,Get<MessageBusSettings>()at:54);RateLimitingSettings(WebApplicationBuilderExtensions.RateLimiting.cs:399);GatewayRateLimitingSettings(GatewayRateLimitingExtensions.cs:296-299, method:290);UiRateLimitingSettings(UiRateLimitingExtensions.cs:202-205, method:197); ADC Conference.ServiceAddModuleHost(MMCA.ADC/Source/Services/MMCA.ADC.Conference.Service/Program.cs:379-381, the comment at:370); Store Catalog.ServiceAddModuleHost(MMCA.Store/Source/Services/MMCA.Store.Catalog.Service/Program.cs:131-133, the comment at:119); ADC EngagementPointsSettings(MMCA.ADC/Source/Services/MMCA.ADC.Engagement.Service/Program.cs:134-135, reason:131-133) andCheckInSettings(:141-142, reason:138-140);AuthenticationServiceBase.cs:74;RecordRoomCheckInHandler.cs:47and:48;LoginProtectionService.cs:32; ADC UI WebMapClientConfigEndpoint(Program.cs:271).
Revision (2026-10-28)
Re-verified against current source. The decision, the rationale, the thirty-seven framework
registrations (a grep still finds 39 ValidateOnStart() calls in 22 files under MMCA.Common/Source,
the host-owned pair included), the fifteen framework exceptions, the eight custom validators and ADC's
seven Application injections are unchanged; Store's Sales module grew two sections and its Application
layer three injections.
- Store's Sales module now binds eight sections with
BindConfiguration, each withValidateDataAnnotations().ValidateOnStart():StripeSettings,CheckoutRedirectSettings,UnpaidOrderExpirySettings,ShippingSettings,TaxSettings,PaymentReconciliationSettings,DenormalizationBackfillSettingsandOrderFulfilledBackfillSettings(MMCA.Store/Source/Modules/Sales/MMCA.Store.Sales.API/SalesModule.cs:52-55,:57-60,:62-65,:67-70,:72-75,:77-80,:87-90,:92-95). - Store's Application layer names thirteen
IOptionsinjections rather than ten. The three added areOrderChargesCalculator(IOptions<ShippingSettings>,MMCA.Store/Source/Modules/Sales/MMCA.Store.Sales.Application/Orders/Charges/OrderChargesCalculator.cs:25),SendGuestOrderLinkInternalCommandHandler(IOptions<CheckoutRedirectSettings>,.../Orders/InternalCommands/SendGuestOrderLinkInternalCommandHandler.cs:38) andGuestOrderPlacedNotifier(IOptions<CheckoutRedirectSettings>,.../Orders/UseCases/GuestCheckout/GuestOrderPlacedNotifier.cs:30). - Store's Sales Infrastructure list of
IOptionsreaders now also namesStripeTaxCalculator(IOptions<TaxSettings>,MMCA.Store/Source/Modules/Sales/MMCA.Store.Sales.Infrastructure/Payments/Stripe/StripeTaxCalculator.cs:24) andPaymentReconciliationSettingsValidator, which readsIOptions<UnpaidOrderExpirySettings>(.../Payments/Reconciliation/PaymentReconciliationSettingsValidator.cs:22). - Anchors re-verified against current source: the
PaymentReconciliationSettingsValidatorregistration (SalesModule.cs:84-85, the reason at:82-83); ADC UI WebMapClientConfigEndpoint(MMCA.ADC/Source/Hosts/UI/MMCA.ADC.UI.Web/Program.cs:272); ADC EngagementPointsAwarder(.../Points/Services/PointsAwarder.cs:32).
Revision (2026-11-04)
MMCA.Common 1.277.0 adds JwksSettings.AdditionalKeys (see
ADR-004). The decision, the rationale and the framework
registration count are unchanged: JwksSettings keeps its existing chain.
JwksSettingsnow implementsIValidatableObject(MMCA.Common/Source/Core/MMCA.Common.Infrastructure/Auth/JwksSettings.cs:25,Validateat:79), because the annotations onJwksAdditionalKeyare not reached byValidateDataAnnotations()on the parent list. Every additional key needs akidof at most 64 characters, distinct from every other entry and from the currentKeyId(:81,:88-99), and key material that loads (:101-114), so a duplicatekidor a malformed PEM fails the host at startup. The Trade-offs count ofIValidatableObjecttypes is now five.TokenServicegained a field above its constructor, so theIOptions<JwtSettings>andIOptions<JwksSettings>parameters moved toMMCA.Common/Source/Core/MMCA.Common.Infrastructure/Auth/TokenService.cs:73and:77.- Anchors re-verified against current source: the
JwksSettingschain (MMCA.Common/Source/Core/MMCA.Common.Infrastructure/DependencyInjection.cs:197-200), theJwtSettingschain inAddCommonAuthentication(MMCA.Common/Source/Presentation/MMCA.Common.API/Startup/WebApplicationBuilderExtensions.Authentication.cs:135-138) andRsaJwksProvider(.../Auth/RsaJwksProvider.cs:14).
Revision (2026-11-23)
Re-verified against current source. The decision, the rationale, the five IValidatableObject types and the AddModuleHost pair are unchanged; the inventory
grew. A grep now finds 47 ValidateOnStart() calls in 28 files under MMCA.Common/Source, which is
forty-five framework registrations once the host-owned pair is set aside.
- The Infrastructure package holds twenty-five registrations rather than twenty.
ViewAsSettingsjoins the chains insideAddInfrastructure(MMCA.Common/Source/Core/MMCA.Common.Infrastructure/DependencyInjection.cs:193-196), so thirteen reach every host, and four opt-in chains join the seven:SignInLinkSettings(DependencyInjection.Auth.cs:108-111),FeatureFlagOverrideSettings(DependencyInjection.FeatureFlags.cs:64-67),MachineClientSettings(DependencyInjection.MachineClients.cs:41-43) andWebhookSettings(Webhooks/WebhookServiceCollectionExtensions.cs:71-74). The partial class now spans nine files. - Outside the Infrastructure package there are twenty registrations rather than seventeen:
PasskeySettings(MMCA.Common/Source/Core/MMCA.Common.Passkeys/PasskeysServiceCollectionExtensions.cs:41-43),McpSettings(MMCA.Common/Source/Presentation/MMCA.Common.Mcp/McpHostingExtensions.cs:58-63) and the bare ApplicationWebhookSettingsregistration (MMCA.Common/Source/Core/MMCA.Common.Application/DependencyInjection.Webhooks.cs:98). The Rationale lists their chain variants, andAiSettingsnow inserts aPostConfigure(MMCA.Common/Source/Core/MMCA.Common.AI/DependencyInjection.cs:123-128). CloudAdapterTripwirealso failsPasskeys:Enabledwith no passkey ceremony registered andMachineClients:Enabledwith machine clients not registered, and it reports every failure together (MMCA.Common/Source/Core/MMCA.Common.Infrastructure/Configuration/CloudAdapterTripwire.cs:64-69,:71-75,:85, the reasons at:37-49). TheHostIntegrationTripwireOptionsreason now also names a key-ring blob with no DataProtection sink (MMCA.Common/Source/Hosting/MMCA.Common.Aspire/Extensions.cs:46-49).- Eleven custom validators rather than eight:
MachineClientSettingsValidator(.../Auth/MachineClients/MachineClientSettingsValidator.cs:15),PasskeySettingsValidator(MMCA.Common/Source/Core/MMCA.Common.Passkeys/PasskeySettingsValidator.cs:12) andWebhookRegistrationValidator(MMCA.Common/Source/Core/MMCA.Common.Application/Webhooks/WebhookRegistrationValidator.cs:13). UiReadCacheOptionsno longer exists inMMCA.Common/Source.SignInSettingsbinds off the chain in its place (MMCA.Common/Source/Presentation/MMCA.Common.UI/DependencyInjection.cs:67-68, the reason at:65-66),MultiFactorAuthorizationSettingsbinds off the chain with no stated reason (MMCA.Common/Source/Presentation/MMCA.Common.API/Authorization/AuthorizationExtensions.cs:142-144), so the framework exceptions number sixteen, andNotificationBellOptionsnow carries its own reason comment (:70).- Consumer hosts take the escape five times rather than twice: ADC Engagement adds
TicketSettings(MMCA.ADC/Source/Services/MMCA.ADC.Engagement.Service/Program.cs:106-107), ADC Conference bindsRoomCheckInSettings(MMCA.ADC/Source/Services/MMCA.ADC.Conference.Service/Program.cs:313-314) and ADC Identity bindsInviteEmailSettings(MMCA.ADC/Source/Services/MMCA.ADC.Identity.Service/Program.cs:207-208), each with its reason beside the binding. ADC's Conference module also bindsSessionizeSettingsoff the chain (MMCA.ADC/Source/Modules/Conference/MMCA.ADC.Conference.Infrastructure/DependencyInjection.cs:38-39, the reason at:36-37). - ADC's four and Store's three service hosts call
builder.AddMmcaServiceHost(MMCA.ADC/Source/Services/MMCA.ADC.Conference.Service/Program.cs:82,MMCA.Store/Source/Services/MMCA.Store.Catalog.Service/Program.cs:32), and theMMCA.Common.ServiceHostpackage callsAddModuleHost(MMCA.Common/Source/Hosting/MMCA.Common.ServiceHost/ServiceHostBuilderExtensions.cs:100). - Store's Sales module binds six sections rather than eight: the two backfill settings and their
services no longer exist in
MMCA.Store/Source, so their reader citations are removed. AStripeSettingsValidatornow sits beside theStripeSettingschain (MMCA.Store/Source/Modules/Sales/MMCA.Store.Sales.API/SalesModule.cs:59-60). - The framework's Application layer names
IOptionsin fourteen classes rather than six; the eight added areViewAsService,MachineClientService,PasskeyService,SendSignInLinkHandlerBase,RedeemSignInLinkHandlerBase,DeliverWebhookInternalCommandHandler,WebhookSubscriptionServiceandWebhookFanOutHandler(the last resolving it from a scope). - Anchors re-verified against current source:
AddInfrastructure(DependencyInjection.cs:58) and its chains (:73-76,:99-102,:145-148,:150-153,:155-158,:161-164,:169-172,:215-218,:220-223), theAddCachingcall (:141) andAddInternalCommandscall (:275), the tripwire marker (:244,:245-246, the push reason:240-243),AddMultiTenancy(:320,:322-325,:328-329),ConnectionStringSettingsValidatorregistration (:83-84),DataSourcesSettings(:88-90,:86-87,:91);DependencyInjection.Auth.cs(:48-51,:81-84,:176-179,LegalAcceptanceOptions:144-145,:141-143,:135-136);DependencyInjection.Notifications.cs(:43-46,:41);DependencyInjection.Caching.cs(:30,:46,:48-51,:53-56,:60-61);CloudAdapterTripwire.cs(:32,:77-78,:81,:24-28); the UI shared bindings (DependencyInjection.cs:43,:46-49,:52-53,:57-58,:62-63,:71-72); the APIIdempotencySettings(:78-81) andOwnerOrAdminFilterOptions(:94-95,:90-93);JwtSettings(WebApplicationBuilderExtensions.Authentication.cs:136-139,:134);RateLimitingSettings(:410);GatewayRateLimitingSettings(:375-378,:369);GatewaySettings(GatewayReverseProxyExtensions.cs:63-66,:56, validator:70-71);ServiceTokenSettings(:110-113,:103) andDefaultSchemeGuard(:81-85,:77-80);UiRateLimitingSettings(:222-225,:217); the cloud adapter bindings (Azure:48-49,:51,:90-91,:93; AWS:55-56,:58,:112,:179,:190; GCP:53-54,:56,:95,:154,:162); the Engagement bindings (:94-95,:91-93,:100-101,:97-99); HelpdeskProgram.cs(:20-23,:109-112);OutboxProcessor.cs:64,LoginProtectionService.cs:40,ClientConfigEndpointExtensions.cs:78,EntityControllerBase.cs:62and:82;AuthenticationServiceBase.cs:81,AuthSessionIssuer.cs:57,AuthenticationValidators.cs:30,SendEmailConfirmationHandlerBase.cs:55;AiSettings.cs:23; StorePaymentReconciliationSettingsValidatorregistration (SalesModule.cs:89-90,:87-88).
Related
ADR-025 (startup warm-up and readiness gating: this contract decides what happens before a host reaches that machinery), ADR-031 (feature flags read from configuration, whose section this contract governs the binding of), ADR-061 (where a secret value comes from at runtime; this decides what the host does when it does not arrive), ADR-015 (architecture fitness functions, the enforcement mechanism this contract currently lacks).