refactor(telemetry): drop dead live-collector smoke and the compact/end severity probe
tests/otel.e2e.ts self-skipped on $DSH_OTLP_E2E_ENDPOINT, which nothing in the repo sets — it never ran; the mock-collector wire spec and the keyless Loader-composition e2e already cover the pipeline both ways. The severityOf compact/end probe parsed another package's merged event shape by string comparison — an untyped cross-package contract that breaks silently — and its only consumer was the test's own stand-in declaration. Unknown event types now uniformly fall through as info; outcome semantics stay with the owning package.
This commit is contained in:
@@ -218,15 +218,11 @@ function severityOf(event: SessionEvent): TelemetrySeverity {
|
||||
return event.data.reason.kind === 'error' ? 'error' : 'info'
|
||||
case 'prompt/blocked':
|
||||
return 'warn'
|
||||
default: {
|
||||
// Merge-extensible fall-through (no assertNever): types this seam does
|
||||
// not depend on still get their RFC-pinned severity via a widened
|
||||
// probe — `compact/end` is declared by dsh-compact, which the seam
|
||||
// deliberately does not import.
|
||||
const type: string = event.type
|
||||
if (type === 'compact/end' && (event.data as { error?: unknown }).error !== undefined) return 'error'
|
||||
default:
|
||||
// Merge-extensible fall-through (no assertNever): event types this seam
|
||||
// does not depend on — including plugin-merged ones it never heard of —
|
||||
// pass through as info; their owners' outcome semantics stay theirs.
|
||||
return 'info'
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -44,9 +44,10 @@ declare module 'cordis' {
|
||||
/**
|
||||
* Severity of a telemetry record, pre-mapped at capture so a receiver can
|
||||
* alert with zero configuration: `error` for events whose own outcome flag
|
||||
* says so (`tool/result.isError`, `turn/end` error reasons, `compact/end`
|
||||
* errors) and for `agent-error` operational records, `warn` for
|
||||
* `prompt/blocked`, `info` for everything else.
|
||||
* says so (`tool/result.isError`, `turn/end` error reasons) and for
|
||||
* `agent-error` operational records, `warn` for `prompt/blocked`, `info`
|
||||
* for everything else — including event types merged by other packages,
|
||||
* whose outcome semantics stay with their owners.
|
||||
*/
|
||||
export type TelemetrySeverity = 'info' | 'warn' | 'error'
|
||||
|
||||
|
||||
Reference in New Issue
Block a user