Skip to content

Telemetry config: single-source catalog + CLI editor #522

Closed
6 of 6 issues completed
Closed

Description

@nockawa

Design: claude/design/Observability/telemetry-config-catalog-cli.md

Invert the source of truth for Typhon's 224 telemetry flags: one declarative JSONC catalog -> source-generated perf projection (TelemetryConfig.g.cs) + runtime catalog (TelemetryFlagCatalog.g.cs); docs regenerate from it (retiring the C#-source reverse-parser). Add a typhon telemetry CLI to author typhon.telemetry.json in the working directory -- scriptable verbs + an interactive tri-state tree -- so users can discover/toggle flags without hand-editing nested JSON or memorising key paths.

Tasks tracked as sub-issues.

Acceptance criteria

  • telemetry-flags.jsonc is the single source; docs + static readonly bool fields + runtime catalog all derive from it.
  • Generated TelemetryConfig.g.cs is byte-equivalent (field set + values) to the current hand-written class (golden diff) before the hand-written version is deleted.
  • JIT-fold gate-shape invariant preserved (public static readonly bool); resolver + gate tests green.
  • Zero runtime-behavior change (P): the 3 intentional exceptions (subtree roots default-off, master's direct children default-off, Scheduler gauges default-true & ungated) preserved.
  • typhon telemetry list/enable/disable/reset/effective operate on ./typhon.telemetry.json with correct effective-state resolution.
  • Interactive typhon telemetry edit renders tri-state + honest cascade (exceptions don't falsely inherit).
  • C#-source reverse-parse removed from gen-telemetry-reference.py; --check CI green on the catalog.

Sub-issues

Sub-issues

6 of 6 Issues completed
Loading 6 sub-issues

Activity

  1. moved this to Todo in Typhonon Jul 19, 2026
  2. added theissue type on Jul 19, 2026
  3. moved this from Todo to In Progress in Typhonon Jul 19, 2026
  4. nockawa commented on Jul 19, 2026

    @nockawa
    CollaboratorAuthor

    Accepted implementation plan (2026-07-19)

    Scope: whole feature (T1–T6), one PR on feature/cli-telemetry-config. Design: claude/design/Observability/telemetry-config-catalog-cli.md.

    OQ4 refinement (approved): Typhon.Generators is IsPackable=false and not shipped to consumers (only Typhon.Generators.Consumer ships the TraceEvent subset). So the telemetry generators live in Typhon.Generators and are simply excluded from .Consumer — no new Typhon.Generators.Telemetry assembly. Same guarantee, one fewer project.

    Sequencing: T1 → T2 → T3 → T4 → T5 → T6. T2's golden-equivalence gate is the critical path — nothing is deleted until generated ≡ current is proven.

    Acceptance criteria (per task):

    Gate: mandatory code review (/review + /simplify + self-review vs ACs/design/claude/rules) before completion. No commits — hand off "ready for review + commit".

  5. nockawa commented on Jul 19, 2026

    @nockawa
    CollaboratorAuthor

    Implementation complete (T1–T6) — ready for review + commit

    All six tasks landed on feature/cli-telemetry-config; nothing committed (per convention).

    Two in-flight pivots (both approved):

    1. Field naming → preserve exact names, not full-procedural. The field names are a hard ABI — 96 [TraceEvent(Gate="…")] strings bind to them, plus irregular acronym casing (Data:MVCC:ChainWalk → DataMvccChainWalkActive). The catalog stores each exact field (+ enabledField for composites); the generator emits them verbatim → zero call-site / gate-string renames. Only 2 zero-consumer aliases dropped.
    2. Generator home → existing Typhon.Generators (already IsPackable=false, not consumer-shipped), excluded from .Consumer. No new assembly (OQ4 refined).

    Verification:

    • Engine + Shell build green. Docs regenerate from the catalog; gen-telemetry-reference.py --check + docs-affected.py --validate green.
    • Full engine suite: 4020 passed / 0 failed / 38 skipped (a 2-failure earlier run was pre-existing parallel-load flakiness — passed clean on re-run).
    • 8 telemetry + 3 new catalog tests pass; CLI verbs smoke-tested (presets, minimal-JSONC writes, near-match suggestions, and both exceptions surfaced correctly incl. the leaf-under-off-parent footgun).

    Net −1,584 LOC (the hand-written ctor/fields deleted; ABI now generated from telemetry-flags.jsonc).

    Follow-ups noted: no Shell test project exists (T5/T6 lack dedicated unit tests — model is covered via the engine resolver + smoke tests); design doc carries an "implementation pivots" callout reconciling the above.

  6. nockawa commented on Aug 10, 2026

    @nockawa
    CollaboratorAuthor

    Closing as completed — all six tasks shipped in PR #556 and are on main; only the bookkeeping lagged. All seven acceptance criteria on this issue are met and now ticked.

    Verified against main today:

    Task Evidence on main
    #523 T1 JSONC catalog src/Typhon.Engine/Observability/telemetry-flags.jsonc + scripts/bootstrap-telemetry-catalog.py
    #524 T2 TelemetryConfig.g.cs TelemetryConfigGenerator.cs; hand-written gate fields + ctor gone, TelemetryConfig.cs retained as the non-gate partial half (helpers only)
    #525 T3 TelemetryFlagCatalog.g.cs TelemetryFlagCatalogGenerator.cs
    #526 T4 docs pipeline repointed gen-telemetry-reference.py reads the catalog; C# reverse-parse gone
    #527 T5 non-interactive verbs 8 verbs incl. preset, TelemetryCommands.cs
    #528 T6 tri-state edit TUI TelemetryEditor.cs

    Two things worth recording rather than losing:

    1. Generator home — an approved pivot, not a deviation (T2 — Source generator: emit TelemetryConfig.g.cs (perf projection) #524/T3 — Source generator: emit TelemetryFlagCatalog.g.cs (runtime tree) #525). The sub-issue bodies carried the original OQ4 decision (a dedicated Typhon.Generators.Telemetry assembly); the design doc's Implementation pivots banner already records that it was superseded in-flight. As shipped it is a namespace inside Typhon.Generators. OQ4's guarantee holds regardless: Typhon.Generators is IsPackable=false and only the Typhon.Generators.Consumer subset ships, so pack-check is unaffected. The doc's OQ4 entry and §2 still stated the pre-pivot plan and read as self-contradictory — both are now annotated.

    2. One T4 — Repoint docs pipeline to the catalog; retire the reverse-parser #526 acceptance criterion was genuinely not met — coverage/docs-affected-map.json has zero telemetry entries, leaving telemetry unmapped for the Layer-2 doc-accuracy reviewer. Carved out as docs-affected map has no telemetry entry — Layer-2 reviewer is blind to telemetry doc drift #748 rather than swept under the close.

  7. moved this from In Progress to Done in Typhonon Aug 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Fields

    Priority

    None yet

    Estimate

    None yet

    Area

    None yet

    Start date

    None yet

    Target date

    None yet

    Product

    User adoption

    Projects

    • Status
      Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions