Skip to content

Default-on daily heartbeat with two-tier telemetry consent - #133

Open
wkoverfield wants to merge 2 commits into
mainfrom
feat/heartbeat-telemetry
Open

Default-on daily heartbeat with two-tier telemetry consent#133
wkoverfield wants to merge 2 commits into
mainfrom
feat/heartbeat-telemetry

Conversation

@wkoverfield

Copy link
Copy Markdown
Owner

What

Adds a default-on daily anonymous heartbeat alongside the existing opt-in command-event telemetry, making telemetry two-tier with one shared kill switch.

  • quilt_heartbeat fires at most once per 24h from the first ordinary command of the day: quilt version, platform, node major, random local id, nothing else. The TTL stamp is claimed with exclusive-create so concurrent quilt processes cannot double-send, and a corrupt stamp self-heals instead of silently disabling the heartbeat forever.
  • Command events (setup, session, claim, commit, escalation) are unchanged and stay opt-in.
  • Any opt-out silences everything, including the heartbeat: a stored "no" from any prior version, quilt telemetry off, QUILT_TELEMETRY=0, DO_NOT_TRACK (newly honored), or a set CI variable. Explicit QUILT_TELEMETRY wins over ambient signals.
  • Every hook-* command remains uninstrumented (never stamps, never mints an id, never sends). quilt setup prints an unconditional heartbeat disclosure (TTY or not) and sends only after printing it, so a fresh install's first send cannot precede the first chance to read what is sent.
  • quilt telemetry now reports both tiers and the reason for the effective state.
  • README, docs/reference.md, and CHANGELOG updated; version bumped to 0.6.1.

Not yet done

The PostHog key in src/telemetry.ts and site/index.html is a placeholder (phc_QUILT_PROJECT_KEY_TBD) until the destination PostHog project exists. Sends fail silently until it is replaced; do not publish 0.6.1 before swapping in the real key and seeing a live quilt_heartbeat arrive.

Testing

  • 378 tests pass, including new coverage: the full consent matrix (defaults, stored decisions, QUILT_TELEMETRY, DO_NOT_TRACK, CI, precedence), TTL collapse of repeat sends, heartbeat payload key allow-list, corrupt-stamp self-heal, id stability across consent toggles, and hook-path silence for all five hook-* commands including the argv fast-path trio.
  • Non-interactive quilt setup is asserted to never prompt, never record a decision, and always print the heartbeat disclosure.

🤖 Generated with Claude Code

Opt-in-only telemetry answers no questions in practice: the consent
prompt renders only on an interactive TTY at setup, and most quilt
operators are agents running non-interactively, so the prompt never
shows and nothing is ever sent. Add a second, minimal tier that can
actually measure whether installs stay active.

The daily heartbeat sends the shared envelope only (quilt version,
platform, node major, random local id) at most once per 24h, stamped
via exclusive-create so concurrent quilt processes on one machine
cannot double-send, with a corrupt stamp treated as stale rather than
fatal. Command events remain strictly opt-in. Any opt-out silences
both tiers: a stored "no" from any version, `quilt telemetry off`,
QUILT_TELEMETRY=0, the now-honored DO_NOT_TRACK convention, or a CI
environment. Explicit QUILT_TELEMETRY wins over ambient signals.

The heartbeat rides on ordinary command entries via a preAction hook;
every hook-* command stays uninstrumented, and setup sends only after
printing its unconditional disclosure so a fresh install's first send
cannot precede the first chance to read what is sent. The PostHog key
ships as a placeholder until the destination project exists; sends
fail silently until it is replaced.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@vercel

vercel Bot commented Aug 31, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
quilt-dev Ready Ready Preview Aug 31, 2026 4:18pm

Request Review

Replaces the placeholder write-only key with the dedicated project's.
Verified live: a heartbeat sent through the detached-child path is
queryable in the destination project.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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