WS-BR-02 Optional startup delay blocks before hooks and Run¶
Field
Value
Statement
When configuration key DelayStart (milliseconds, integer) is present, startup blocks for that long after the host is built and before the configuration hooks and IHost.Run().
WS-BR-03 Configuration source stack is altered by re-added providers¶
Field
Value
Statement
The host reads appsettings.json (optional) and environment variables, in addition to and after, the Generic Host defaults, and runs as a Windows Service when started by the SCM.
Trigger
CreateHostBuilder(args) runs.
Enforcement
ServiceProgramRunnerBase.CreateHostBuilder.
Outcome
The re-added sources override command-line args and appsettings.{Environment}.json, because later sources win*.
WS-BR-05 Required hosting services must be registered¶
Field
Value
Statement
A SAIF Windows Service must have IWindowsServiceErrorHandler, ISaifWindowsServiceLogService, IEnvironmentClient, and IHttpJsonClient registered, and the logger is always configured at startup with the environment client and HTTP client.
Trigger
Configure(host) / ConfigureLogger(host) runs.
Enforcement
ServiceProgramRunnerBase.Configure/ConfigureLogger, using GetRequiredService.
Outcome
Startup fails with InvalidOperationException if any required service is missing. Otherwise SaifWindowsServiceLog.Configure runs.
WS-BR-09 Shutdown exemption requires an exact type match and an allowing predicate¶
Field
Value
Statement
An exception is exempt from shutdown only if its exact runtime type full name equals a registered ShutdownExemptExceptionType.Type and at least one matching entry's IsAllowed(ex) returns true; subclasses are not matched.
Trigger
A task error occurs.
Enforcement
ServiceWorker<T>.IsExceptionExemptFromShutdown. Entry validation (non-null, strict Exception subclass, default predicate true) comes from SAIF.NetCore.ServiceContracts's ShutdownExemptExceptionType.
The error message passed to the handler is "An error occured in task: {TaskTitle}" plus a newline plus ex.Message, with "Service will shutdown." appended when not exempt.
Trigger
A task error occurs.
Enforcement
ServiceWorker<T>.BuildErrorMessage.
Outcome
A consistent, overridable message text is produced for every task error.
WS-BR-12 Every error is reported before any shutdown¶
Field
Value
Statement
Every task error is reported to IWindowsServiceErrorHandler.HandleError before any shutdown, whether exempt or not.
Trigger
A task error occurs.
Enforcement
ServiceWorker<T>.HandleTaskError.
Outcome
WindowsServiceErrorHandler.HandleError builds the error object, raises the BeginErrorHandling event first (default Handled = false, FireSpecialActions = true), then logs through ISaifWindowsServiceLogService.Error only if a subscriber has not set Handled = true, then -- only if FireSpecialActions is true -- fires each registered ISpecialErrorAction whose own independent fire-condition predicate allows it, logging any action that fails, and finally raises ErrorHandled. All of this completes before HandleTaskError evaluates whether to call StopAsync.
This library has no in-repo consumer and no test project; composition-pattern statements are otherwise unverified against a real consumer in this repository.
Note: Statements marked with * were inferred from code structure, naming conventions, or
contextual evidence where direct confirmation was not available in source artifacts. Statements
marked with ** could not be confirmed; treat as unknown until verified.