|
40 | 40 | context.Configuration.GetSection("TradingSystem")); |
41 | 41 | services.Configure<TacticalConfig>( |
42 | 42 | context.Configuration.GetSection("TradingSystem:Tactical")); |
| 43 | + // S5-004r: OptionsSleeveManager takes the bare TacticalConfig (its siblings take |
| 44 | + // IOptions<TacticalConfig>), so the bare type must be resolvable or the worker dies |
| 45 | + // at DI validation on boot. This was masked by the AI-package TypeLoadException — |
| 46 | + // the unit suite never builds the full host graph, only the real `func start` does. |
| 47 | + services.AddSingleton(sp => |
| 48 | + sp.GetRequiredService<Microsoft.Extensions.Options.IOptions<TacticalConfig>>().Value); |
43 | 49 | services.Configure<IBKRConfig>( |
44 | 50 | context.Configuration.GetSection("IBKR")); |
45 | 51 | services.Configure<LocalStorageConfig>( |
|
53 | 59 | services.Configure<ReportingConfig>( |
54 | 60 | context.Configuration.GetSection("Reporting")); |
55 | 61 |
|
56 | | - // Application Insights |
| 62 | + // Application Insights — registration is inert until APPLICATIONINSIGHTS_CONNECTION_STRING |
| 63 | + // is set (it is NOT set in local.settings.json or any deployed config today): with no |
| 64 | + // connection string the SDK builds a disabled TelemetryConfiguration and sends nothing. |
| 65 | + // Before ever setting that variable, the discord.com URI-redaction gate in DECISIONS.md |
| 66 | + // (Known Debt KD-005/KD-006) must be satisfied — AI 2.x dependency telemetry records full |
| 67 | + // request URLs, which for the Discord named clients are token-bearing webhook URLs. |
57 | 68 | services.AddApplicationInsightsTelemetryWorkerService(); |
58 | 69 | services.ConfigureFunctionsApplicationInsights(); |
59 | 70 |
|
|
124 | 135 | builder.SetMinimumLevel(LogLevel.Information); |
125 | 136 | // S5-004 (review): IHttpClientFactory's LogicalHandler logs the full request URI at |
126 | 137 | // Information on every send — for Discord named clients that URI IS the token-bearing |
127 | | - // webhook URL. Warning+ only for the HttpClient categories keeps the secret out of |
128 | | - // console/App Insights logs while preserving error visibility. |
| 138 | + // webhook URL. Warning+ for every "System.Net.Http.HttpClient.*" ILogger category |
| 139 | + // keeps the secret out of console logs and out of App Insights *log* telemetry while |
| 140 | + // preserving error visibility. Scope note (S5-004r review): this filter governs only |
| 141 | + // ILogger output — it does NOT cover App Insights *dependency* telemetry, which the |
| 142 | + // AI 2.x SDK emits with the full request URL outside the logging pipeline. That path |
| 143 | + // is dormant solely because APPLICATIONINSIGHTS_CONNECTION_STRING is unset (see the |
| 144 | + // enablement-gate comment at the App Insights registration above and DECISIONS.md |
| 145 | + // Known Debt). |
129 | 146 | builder.AddFilter("System.Net.Http.HttpClient", LogLevel.Warning); |
130 | 147 | }); |
131 | 148 | }) |
|
0 commit comments