Skip to content

fix: align ApplicationInsights packages so func host boots (S5-004r)#96

Merged
lwalden merged 2 commits into
mainfrom
fix/s5-004r-func-host-boot
Jun 10, 2026
Merged

fix: align ApplicationInsights packages so func host boots (S5-004r)#96
lwalden merged 2 commits into
mainfrom
fix/s5-004r-func-host-boot

Conversation

@lwalden

@lwalden lwalden commented Jun 10, 2026

Copy link
Copy Markdown
Owner

What

  • Realign ApplicationInsights packages: Microsoft.ApplicationInsights.WorkerService 3.0.0 was incompatible with Microsoft.Azure.Functions.Worker.ApplicationInsights 2.50.0, causing the isolated worker to crash at startup with TypeLoadException: ITelemetryInitializer.
  • Add the missing bare-TacticalConfig DI registration that also blocked host boot.
  • Docs follow-ups from review: App Insights enablement gates in Program.cs comments, runbook preflight step reorder (host-boot smoke before timer verification), csproj OTel-pin-removal trace note, and DECISIONS.md Known Debt entries (AI 2.x upgrade gate, discord.com URI-redaction gate).

Why

S5-004r rework item: the 590-test suite never boots the Functions host, so the package incompatibility shipped invisibly. The 12-week paper run (starting 2026-06-11) requires the host to stay up with all 4 timers, so host boot is now an explicit acceptance criterion.

Test plan

  • dotnet build TradingSystem.sln — 0 warnings, 0 errors
  • dotnet test TradingSystem.sln — 590/590 passed, 0 skipped
  • Host-boot smoke (func start, Core Tools 4.8.0 / runtime 4.1046): "Worker process started and initialized", all 4 timer functions registered (DailyOrchestrator_EndOfDay, DailyOrchestrator_PreMarket, IncomeSleeve_MonthlyReinvest, IncomeSleeve_QuarterlyAudit), no TypeLoadException
  • CI green

🤖 Generated with Claude Code

lwalden and others added 2 commits June 10, 2026 14:49
…boots (S5-004r)

Microsoft.ApplicationInsights.WorkerService 3.0.0 is OTel-based and removed
classic API types (ITelemetryInitializer) that Functions.Worker.ApplicationInsights
2.50.0 is built against, so the worker died at DI bootstrap with TypeLoadException.
Downgrade to 2.23.0 (latest classic 2.x) — both packages are used by Program.cs,
so removal was not an option.

Also:
- Drop the OpenTelemetry.Api 1.15.3 pin: the vulnerable chain (GHSA-g94r-2vxg-569j)
  came via AI 3.0.0 -> Azure.Monitor.OpenTelemetry.Exporter and is gone on 2.23.0;
  `dotnet list package --vulnerable --include-transitive` is clean without it.
- Register bare TacticalConfig in the composition root: OptionsSleeveManager takes
  the bare type (siblings take IOptions<TacticalConfig>), which failed DI graph
  validation on boot — a second boot-blocker previously masked by the
  TypeLoadException and invisible to the unit suite (tests never build the host
  graph).
- Runbook preflight: add a host-boot smoke line (function banner + no
  TypeLoadException proves the worker process actually loaded).

Verified by booting the real host: Azurite + func start, worker initialized,
both DailyOrchestrator timers listed, stable 35s+, zero crash signatures.
590/590 tests green.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…es (S5-004r)

Judge fix-now items (all docs/comment-only, no behavior change):
- Program.cs: document the App Insights enablement gate (registration is
  inert until APPLICATIONINSIGHTS_CONNECTION_STRING is set) and clarify that
  the HttpClient ILogger filter does not cover AI 2.x dependency telemetry.
- Runbook: host-boot smoke now precedes the function-list check (steps 4-5)
  -- the banner is meaningless until the worker has provably booted.
- Functions csproj: trace why the S5-005 OpenTelemetry.Api pin was removed
  (vulnerable chain only existed on the AI 3.0.0 dependency tree).
- DECISIONS.md Known Debt: KD-005 (AI 2.x->3.x upgrade blocked on Functions
  Worker AI compatibility) and KD-006 (discord.com URI redaction required
  before ever enabling App Insights).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@lwalden lwalden merged commit b410f8f into main Jun 10, 2026
4 checks passed
@lwalden lwalden deleted the fix/s5-004r-func-host-boot branch June 10, 2026 22:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant