Skip to content

Remove legacy Typhon:Telemetry:* config back-compat shim #443

Description

@nockawa

Summary

The Phase 0 namespace migration (#329, merged 2026-05-11) flattened Typhon:Telemetry:Profiler:* config to
Typhon:Profiler:* but kept a back-compat shim "for one release," explicitly promising removal "in the next
minor." Multiple releases have shipped since (#350, #351/352/355, #359, #364/365/366, #399, #405...) and the shim
is still there. Confirmed directly in code — this isn't just a stale doc claim.

What's still there

src/Typhon.Engine/Observability/public/TelemetryConfig.cs (1693 lines, 23 references to Typhon:Telemetry):

  • ReadBoolFallback(config, newKey, oldKey, ...) — every legacy-aware flag (Scheduler tracking flags, GC/memory/
    gauges profiler flags, etc.) carries a dead oldKey branch.
  • ReadMasterEnabled — special-cased legacy logic requiring Typhon:Telemetry:Enabled AND
    Typhon:Telemetry:Profiler:Enabled both true.
  • LegacyConfigDetected (public flag) + EmitDeprecationWarning() — writes to Console.Error at static-class
    load when any legacy key is present.
  • XML doc comments throughout referencing the legacy paths (lines 40-45, 55, 70-72, 94, etc.).

src/Typhon.Engine/Observability/public/TelemetryServiceExtensions.cs:

  • AddTyphonTelemetry(this IServiceCollection) — [Obsolete("...provided for one release and will be removed in the next minor.")] delegating shim to AddTyphonProfiler. Same overdue promise.

No tests exercise the legacy paths specifically (TelemetryConfigResolverTests only tests current-namespace
resolution), so removal has no test-suite fallout beyond deleting now-dead code.

Why remove now, not defer again

Per Loïc: nobody uses Typhon as a dependency today — there is no real deployment reading the old
Typhon:Telemetry:* paths to break. Keeping a deprecation shim alive past its own stated expiry with zero
consumers is pure debt for no compatibility benefit.

Doc fallout (same claim, two copies + one pre-existing bug)

  • doc/feature-set/Observability/telemetry-config-gating.md — the guarantee bullet claiming the shim ("emits a
    deprecation warning... will be removed") needs to go once the code does.
  • doc/in-depth-overview/12-observability.md:119 — same claim, second copy, same fix.
  • claude/overview/09-observability.md:159-161 — pre-existing, unrelated bug found while checking this: shows
    three AddTyphonTelemetry(...) overloads ((configuration), (), (opts => ...)) as if they exist. Only the
    parameterless obsolete shim exists — the other two overloads were never implemented. Already flagged in
    claude/scratch/overview-audit.md:158. Worth fixing in the same pass since it's the same file/area.

Related — broader cleanup already scoped, not required here

claude/scratch/tracing-instrumentation-proposal.md (§ item 0, "Telemetry-namespace cleanup (precursor)") already
scopes a larger superset of this: dead *Active/*Enabled/*Track* flags, a parallel TelemetryOptions IOptions
hierarchy, SchedulerTrack* flag migration, SpatialActive gate deletion, 5 typhon.telemetry.json file
migrations, a Workbench TS string fix, and a stale PITCH.md:208 reference — estimated "~400 lines deleted, 5 JSON
migrations." This issue is intentionally narrower: just the expired back-compat shim + its doc claims. The larger
proposal is a reasonable follow-on if there's appetite, not a prerequisite.

Acceptance criteria

  • TelemetryConfig.cs: delete ReadBoolFallback's legacy-key parameter/branch (callers pass only the new key),
    ReadMasterEnabled's legacy special-case, LegacyConfigDetected, EmitDeprecationWarning(), and all
    Typhon:Telemetry:* doc-comment references.
  • TelemetryServiceExtensions.cs: delete AddTyphonTelemetry.
  • doc/feature-set/Observability/telemetry-config-gating.md and doc/in-depth-overview/12-observability.md:
    remove the legacy-shim guarantee bullet.
  • claude/overview/09-observability.md:159-161: fix to reflect the actual (single, parameterless)
    AddTyphonProfiler() surface.
  • Full test suite green; no Typhon:Telemetry:* string remains outside historical claude/ design docs
    documenting the original migration.

Activity

  1. self-assigned this
    on Jul 2, 2026
  2. added
    technical-debt
    on Jul 2, 2026
  3. added this to the pre-alpha milestone on Jul 2, 2026
  4. added theissue type on Jul 2, 2026
  5. moved this to Todo in Typhonon Jul 2, 2026
  6. updated Product Engine and Area Execution on Jul 2, 2026
  7. moved this from Todo to In Progress in Typhonon Jul 3, 2026
  8. nockawa commented on Jul 3, 2026

    @nockawa
    CollaboratorAuthor

    Implemented — ready for review + commit (branch feature/443-remove-telemetry-config-shim)

    Pure deletion of the expired back-compat shim + doc alignment. Net −164 / +22 (158 lines gone from TelemetryConfig.cs).

    Acceptance criteria

    • AC#1 — TelemetryConfig.cs: deleted ReadBoolFallback (method + all 5 call-site legacy branches), ReadMasterEnabled's legacy special-case (collapsed the master switch into the existing ReadBool — provably equivalent), LegacyConfigDetected, EmitDeprecationWarning(), the legacy-presence-detection block, the Legacy Config Detected summary line, all Typhon:Telemetry:* doc-comments, and the now-unused using System.Linq;.
    • AC#2 — TelemetryServiceExtensions.cs: deleted AddTyphonTelemetry (zero callers in solution).
    • AC#3 — removed the legacy-shim bullet from telemetry-config-gating.md + 12-observability.md.
    • AC#4 — already satisfied, no action. The referenced claude/overview/09-observability.md:159-161 was overwritten by the Runtime-gated correctness checks ("strict mode") for the Release NuGet #422 strict-mode merge; those lines now document CheckConfig, and AddTyphonTelemetry survives nowhere but the (now-deleted) shim. Nothing left to fix.
    • AC#5 — full suite green (3974 passed; the only 3 failures are pre-existing lock-timeout flakes — *WhenLockTimeout* / VariableSizedBufferAccessor_Constructor_WhenLockTimeout — that pass in isolation and are unrelated to config). Grep-verified: zero Typhon:Telemetry:* / TYPHON__TELEMETRY__* in src/, doc/, tools/, test/.

    Two decisions taken (approved)

    1. SchedulerArchetypeTouchesActive — this call's ReadBoolFallback args were reversed (its primary key was the legacy Typhon:Telemetry:Scheduler:ArchetypeTouches). Flipped to read Typhon:Profiler:Scheduler:ArchetypeTouches:Enabled (default true preserved). No other code/config reads either exact key string.
    2. Doc scope — AC#5 reached 4 doc files beyond AC#3's 2; 2 of those were now-wrong instructions (a legacy-namespace JSON example in profiler-lifecycle-bootstrap.md, an old two-gate options table in typed-event-capture-pipeline.md) corrected to the flattened Typhon:Profiler:* shape. 6 doc files total.

    Tests

    • New reflection guard test/Typhon.Engine.Tests/Observability/TelemetryShimRemovedTests.cs — asserts LegacyConfigDetected field and AddTyphonTelemetry method stay absent (fails if the shim is re-introduced). Passes.
    • Existing TelemetryConfigCpuSamplingTests still green (exercises GetConfigurationSummary() after the Legacy line removal).
    • Note: TelemetryConfig is static-init-once from ambient config, so the ArchetypeTouches key-flip isn't behaviorally unit-testable without an out-of-scope refactor; its proof is the green suite + equivalence argument.

    Review

    Independent adversarial code review: PASS — master-switch semantics proven unchanged input-by-input, all retained keys/defaults correct, zero dangling references, no CS1574/CS0618, guard test correct.

  9. added a commit that references this issue on Jul 3, 2026
  10. moved this from In Progress to Done in Typhonon Jul 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

technical-debt

Fields

Priority

None yet

Estimate

None yet

Area

Execution

Start date

None yet

Target date

None yet

Product

Engine

Projects

  • Status
    Done

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions