Skip to content

feat(core): add PostHog telemetry v1#65

Open
hachej wants to merge 15 commits into
mainfrom
plan/telemetry
Open

feat(core): add PostHog telemetry v1#65
hachej wants to merge 15 commits into
mainfrom
plan/telemetry

Conversation

@hachej
Copy link
Copy Markdown
Owner

@hachej hachej commented May 22, 2026

Summary

  • Implements PostHog telemetry v1 behind an explicit core-owned env helper.
  • Adds tiny structural TelemetrySink contracts so agent/workspace remain PostHog-free.
  • Wires env-only telemetry through the core-composed app/server path.
  • Emits minimal safe server-side events for app open, failed requests, agent chat lifecycle, and tool completion/failure.
  • Documents opt-in env vars, shared PostHog project prefixing, allowed properties, and deferred browser/runtime telemetry scope.

Privacy / AGENTS.md alignment

  • Telemetry is off by default; POSTHOG_KEY alone is a no-op.
  • Captured properties are default-deny allowlisted and sanitized centrally.
  • No prompts, assistant output, file contents, command strings/output, raw paths, headers/cookies/tokens, env dumps, raw errors, or stack traces are captured.
  • PostHog dependency/imports live only in @hachej/boring-core; agent/workspace use the structural sink only.
  • No browser telemetry endpoint, runtime config, direct browser PostHog, Sentry/OTLP, or tenant/provider routing in v1.

Validation

  • pnpm --filter @hachej/boring-core test src/server/telemetry/__tests__/posthog.test.ts src/app/server/__tests__/createCoreWorkspaceAgentServer.telemetry.test.ts src/app/server/__tests__/createCoreWorkspaceAgentServer.telemetry-smoke.test.ts
  • pnpm --filter @hachej/boring-agent test src/shared/__tests__/telemetry.test.ts src/server/__tests__/createAgentApp.test.ts src/server/http/routes/__tests__/chat.test.ts src/server/harness/pi-coding-agent/__tests__/tool-adapter.telemetry.test.ts
  • pnpm --filter @hachej/boring-workspace test src/shared/__tests__/telemetry.test.ts
  • pnpm --filter @hachej/boring-agent typecheck
  • pnpm --filter @hachej/boring-workspace typecheck
  • pnpm --filter @hachej/boring-core typecheck
  • pnpm lint:invariants

Review

  • Fresh model review: SHIP (Claude), after fixing the stale WORKSPACE_NOT_READY test expectation introduced by the main merge.

@hachej hachej changed the title docs(plan): app-level telemetry feat(core): add PostHog telemetry v1 May 23, 2026
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.

1 participant