feat(agent-core-v2): enforce telemetry domain coverage in the event registry - #3393
feat(agent-core-v2): enforce telemetry domain coverage in the event registry#33937Sageer wants to merge 1 commit into
Conversation
|
|
@codex review |
|
Codex Review: Didn't find any major issues. Hooray! Reviewed commit: ℹ️ About Codex in GitHubCodex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback". |
Related Issue
No linked issue — internal telemetry governance follow-up.
Problem
agent-core-v2's telemetry is governed only for what is emitted:track2checks every event against thetelemetryEventDefinitionsregistry at compile time. But nothing governs what should be emitted — whether a source domain records anything at all relies on author discipline. A full audit of the ~130 domains undersrc/found 44 emit nothing (silent-degradation paths, security decision points, execution paths that bypasstool_call, and experiment features with no adoption signal), and there was no mechanism to even notice when a newly added domain skipped the telemetry decision.What changed
Turns the event registry into a coverage map so the per-domain telemetry decision is structurally enforced instead of conventional:
events.tsnow declares its owningdomain— asrc/directory path (agent/loop,wire) or the pseudo-domainhostfor events the host app emits (first_launch,exit). The field is required byTelemetryEventMeta, so new events cannot register without it.src/app/telemetry/coverage.ts:telemetryDomainExemptionsrecords the domains that intentionally emit nothing, with a reason each;telemetryDomainKnownGapsrecords the domains with zero coverage today, with the planned events each — the audit's gap list becomes checked-in, trackable data instead of chat history.test/app/telemetry/events.test.tsnow walkssrc/and fails unless every domain owns an event, is exempted, or is a known gap. It also validates that referenced domains exist, that exemptions and known gaps are disjoint, and that reasons are non-empty. Adding a domain without making the telemetry decision now breaks the test.packages/agent-core-v2/AGENTS.mdand the agent-core-dev skill's telemetry topic describe the convention; also fixed a stale "no production bootstrap wired yet" note (kap-server, run-v2-print, and node-sdk all wire appenders today).The mechanism already proved itself on first run: it flagged
agent/modeMutex, a domain added after the initial audit, which is now exempted with a reason.Checklist
gen-changesetsskill, or this PR needs no changeset. (No changeset: registry metadata, tests, and docs are not user-perceivable.)gen-docsskill, or this PR needs no doc update. (No user-facing behavior change; engine contributor docs updated in-repo.)