feat(daemon): wire app-usage telemetry for app-store supervisor (PILOT-402)#265
Closed
matthew-pilot wants to merge 5 commits into
Closed
feat(daemon): wire app-usage telemetry for app-store supervisor (PILOT-402)#265matthew-pilot wants to merge 5 commits into
matthew-pilot wants to merge 5 commits into
Conversation
…(PILOT-400) Adds a self-contained telemetry client package that emits signed events to a configured endpoint only when consent is active (--telemetry-url non-empty). When the flag is empty (default), the client is a hard no-op: no dial, no buffering, no goroutines. The client signs all requests with the node's Ed25519 identity following the canonical telemetry signing contract (X-Pilot-Timestamp, X-Pilot-Public-Key, X-Pilot-Signature). This matches the telemetry server's internal/sig verification at pilot-protocol/telemetry. Changes: - pkg/telemetry/client.go: consent-gated telemetry client with Signed HTTP POST, lazy disabled init, configurable endpoint - pkg/telemetry/client_test.go: tests for no-op paths, disabled state, SignMessage round-trip verification - cmd/daemon/main.go: --telemetry-url flag (env PILOT_TELEMETRY_URL) - pkg/daemon/daemon.go: TelemetryURL field in Config struct Closes PILOT-400
Add a NewClientFromIdentity convenience constructor to the telemetry package that creates a consent-gated client from a node's Ed25519 identity file on disk. Wire telemetry into the app-store install command: after a successful install (bundle validated, manifest planted, audit logs written), emit an app_installed event carrying app_id, version, and source (catalogue|local). The emission is best-effort and consent-gated — when PILOT_TELEMETRY_URL is empty or identity.json is absent, the client is a hard no-op. Tests cover the new NewClientFromIdentity helper with valid identity, missing identity, loose file permissions, and empty URL (all no-op paths). Closes PILOT-401
…T-402) The appstoreAdapter now holds telemetryURL and identityPath, using them to create a consent-gated telemetry.Client on Start. The client is wrapped in an telemetryEmitter that satisfies appstore.TelemetryEmitter, passing app_usage events from supervisor.callFrom into the signed telemetry pipeline. When consent is off (empty telemetry URL) the client is a permanent no-op — no goroutines, no dials, no buffering. Related: app-store module also updated for PILOT-402 (commit 8edfed7efa72e78499f02260ea84ae42b724f49a).
4 tasks
Collaborator
|
Superseded by #277 which combines PILOT-401/402/406/407 into a clean branch off current main. |
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.
What
Wire the real telemetry client into the app-store daemon adapter so
app_usageevents emitted by the supervisor are sent to the telemetry endpoint.Changes
cmd/daemon/appstore_adapter.go— addedtelemetryURL/identityPathfields toappstoreAdapter, createdtelemetryEmitteradapter implementingappstore.TelemetryEmitter, wired intoDeps.Telemetryon Startcmd/daemon/main.go— pass telemetry URL and identity path to adapter constructorVerification
go build ./cmd/daemon/✅go vet ./cmd/daemon/✅Companion PR
Depends on pilot-protocol/app-store#20 which adds the TelemetryEmitter interface + callFrom hook.
Closes PILOT-402