Add anonymous shape-only usage telemetry with stdlib-only sender - #33
Merged
Conversation
|
Bugbot is not enabled for your account, so this pull request was not reviewed. Enable Bugbot in the Cursor dashboard to get automatic reviews on future PRs. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds anonymous, shape-only usage telemetry to guide development priorities (adapter adoption, evaluation surface usage) without collecting any agent content, prompts, or user data. The implementation uses only stdlib (
urllib,json,threading,queue) with zero new dependencies. Telemetry failures are isolated and never propagate to the host process.Key Changes
Core telemetry module (
src/agentegrity/core/telemetry.py):~/.agentegrity/id(mode 0600), with fallback to ephemeral per-process IDsDO_NOT_TRACK=1,AGENTEGRITY_TELEMETRY_DISABLED=1, ordisable_telemetry()at runtimeShape builders (
src/agentegrity/core/_telemetry_props.py):Client instrumentation (
src/agentegrity/sdk/client.py):evaluate(): captures profile shape + per-property scores + composite bucket + durationattest(): captures record kind, signedness, evidence countcreate_adapter(): captures adapter name + framework availability (even on import failure)Monitor instrumentation (
src/agentegrity/core/monitor.py):monitor_violation(): captures action + lowest-scoring property for violation attributionAttestation chain instrumentation (
src/agentegrity/core/attestation.py):verify_chain(): captures record count, decision count, verification outcomeCLI instrumentation (
src/agentegrity/__main__.py):Test suite (
tests/test_telemetry.py):Documentation (
docs/telemetry.md):Public API (
src/agentegrity/core/__init__.py):disable_telemetry(),telemetry_capture(),telemetry_run_context(),telemetry_tag(),scoped_telemetryImplementation Details
_scope_depth > 0, preventing orphaned events outside a run contextatexithook@scoped_telemetrywraps both sync and async callables, automatically establishing a run contextOpt-Out
Telemetry is fully disabled