Skip to content

telemetry: log and mark are what the mod's hooks do, the noun added only where the engine has none - #96917

Merged
poteat merged 2 commits into
mainfrom
poteat/telemetry-destinations
Sep 25, 2026
Merged

poteat merged 2 commits into
mainfrom
poteat/telemetry-destinations

Conversation

@poteat

@poteat poteat commented Sep 25, 2026 •

Copy link
Copy Markdown
Contributor

What $.telemetry.log and $.telemetry.mark do was the two methods of the noun the mod adds in the engine.create fold. It now lives in two hooks on the noun's events, telemetry.log and telemetry.mark, beneath the gate: each checks the entry, queues its row and answers { value }; an entry that breaks a rule is answered { deny } with the reason, so the caller's promise still rejects, its text ending $.telemetry.log: <reason> as before. The rows, the batching, the gate and what is sent are unchanged.

This lets the same mod run on an engine that provides $.telemetry itself: the engine.create step hands up what it was given, untouched, when that already has a telemetry, and adds the noun, as before, only where there is none. A log entry may name where it goes with to: anthropic, the default, is this mod's, and an entry for collector is passed on beneath. to is never part of a row. types/index.d.ts gains TelemetryDestination and the optional to; the README says what the mod hooks now.

Checked:

  • mods/telemetry/tests/register.test.ts: a new case, "a refused entry is denied by the hook, naming the caller and the reason", pins the rejection's exact text for log and for mark.
  • mods/telemetry/tests/gate.test.ts: two new cases, each with a plugin whose one hook is on every event: one turns a row's to to the other destination, one adds a key beside the entry's fields. Either way the row goes out once and equals the expected row.
  • Against a current build, at this branch's head: the mods' typecheck passes, the build's scan of the hooks module accepts it, and claude plugin test mods/telemetry passes 34 of 34; the other mods' suites are unchanged and green. With these tests run over main's hooks, the exact-text case is the one that fails.

@poteat
poteat merged commit 6557bbe into main Sep 25, 2026
2 checks passed
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.

2 participants