aeat.core.telemetry._producers module

Non-sensitive operational telemetry producers.

Each function here projects an already-non-sensitive local signal into an allowlisted TelemetryEventPayload (via build_telemetry_payload()) and hands it to emit_telemetry_event(). Every producer is a pure projection: it reads fields that are already accounting/timing metadata (a command name, a duration, a success flag, a closed error-kind label) and never reads transaction content, profile identity, or file contents.

No producer here performs a network call. When the consent gate refuses (the default posture), emit_telemetry_event() is a pure no-op and none of these functions have any observable side effect beyond that no-op return value.

See also

build_telemetry_payload()

Closed-schema builder each producer uses before emission.

emit_telemetry_event()

Consent-gated dispatcher shared by all producers.

workspace_hash()

Stable pseudonymous deployment identifier carried by producer payloads.

TELEMETRY_METRIC_REGISTRY

Metric allowlist that declares which counters and timings may be remote.

emit_command_invocation_telemetry(*, workspace_hash, succeeded, duration_ms, captured_at, settings, acknowledged, sink=None)[source]

Emit a non-sensitive CLI command-completion event.

Carries only an invocation count, a succeeded/failed split, and a wall-clock duration – never the command’s arguments, output, or any operator-supplied content. Registered under the closed "diagnostics.command_invocation" MetricSchema.

Parameters:
  • workspace_hash (str) – Stable pseudonymous local-deployment identifier (see workspace_hash()).

  • succeeded (bool) – Whether the CLI invocation completed without raising.

  • duration_ms (int) – Wall-clock invocation duration in milliseconds.

  • captured_at (str) – ISO-8601 UTC capture timestamp.

  • settings (Settings) – Resolved deployment settings carrying the telemetry consent posture.

  • acknowledged (bool) – Whether the operator acknowledged remote telemetry for this specific invocation. Never sticky.

  • sink (TelemetrySink | None) – Destination sink; defaults to LocalNoopTelemetrySink.

Return type:

bool

Returns:

True when the event was handed to the sink; False when the consent gate refused and emission was a no-op.

emit_llm_run_telemetry(*, workspace_hash, succeeded, duration_ms, captured_at, settings, acknowledged, sink=None)[source]

Emit a non-sensitive local-LLM-run-completion event.

Projects the same accounting fields LLMRunRecord already carries locally (run count, succeeded/failed split, duration) into the remote-eligible allowlist – never the run’s prompt text, response text, or provider payload. Registered under the closed "diagnostics.llm_run" MetricSchema.

Parameters:
  • workspace_hash (str) – Stable pseudonymous local-deployment identifier.

  • succeeded (bool) – Whether the LLM run completed without raising.

  • duration_ms (int) – Wall-clock run duration in milliseconds.

  • captured_at (str) – ISO-8601 UTC capture timestamp.

  • settings (Settings) – Resolved deployment settings carrying the telemetry consent posture.

  • acknowledged (bool) – Whether the operator acknowledged remote telemetry for this specific invocation. Never sticky.

  • sink (TelemetrySink | None) – Destination sink; defaults to LocalNoopTelemetrySink.

Return type:

bool

Returns:

True when the event was handed to the sink; False when the consent gate refused and emission was a no-op.

emit_error_frequency_telemetry(*, workspace_hash, error_kind, captured_at, settings, acknowledged, sink=None)[source]

Emit a single non-sensitive error-kind occurrence.

error_kind MUST be a short closed label (an exception class name such as "LLMClassifierError", mirroring error_kind) – never raw exception text, a stack trace, or any operator-controlled string. Registered under the closed "diagnostics.error_frequency" MetricSchema.

Parameters:
  • workspace_hash (str) – Stable pseudonymous local-deployment identifier.

  • error_kind (str) – Closed short error-kind label for this occurrence.

  • captured_at (str) – ISO-8601 UTC capture timestamp.

  • settings (Settings) – Resolved deployment settings carrying the telemetry consent posture.

  • acknowledged (bool) – Whether the operator acknowledged remote telemetry for this specific invocation. Never sticky.

  • sink (TelemetrySink | None) – Destination sink; defaults to LocalNoopTelemetrySink.

Return type:

bool

Returns:

True when the event was handed to the sink; False when the consent gate refused and emission was a no-op.