Skip to content

feat(telemetry): aggregate identifier-free reporting installation counts - #32

Merged
steipete merged 1 commit into
mainfrom
openclaw/identifier-free-installation-counts
Oct 30, 2026
Merged

steipete merged 1 commit into
mainfrom
openclaw/identifier-free-installation-counts

Conversation

@steipete

Copy link
Copy Markdown
Contributor

Receiver for the merged client openclaw/openclaw#186569. Implemented by Roboclaw on Team; its automatic publication (operation 3f1ba16c) stalled with an unconfirmed push, so this PR recovers the identical reviewed tree and finishes it from a maintainer checkout.

What Problem This Solves

Daily update-check event totals cannot estimate unique reporting installations without retaining a cross-request identifier or receiving client-regulated contributions.

User Impact

A compatible client can contribute to private daily/weekly/monthly reporting-installation estimates while the receiver retains only aggregate (day, gap, reports) totals: no individual count requests, identifiers, geography, versions or feature inventory. Ordinary update and outcome behavior stays available.

Collection remains disabled in production: wrangler.jsonc gains no D1 binding and no cron trigger (asserted by test/deployment.test.ts). Activation needs a separately configured D1 binding, the migration, scheduled cleanup with monitoring, and review of provider recovery retention. Estimates describe reporting installation-state roots, not people or engagement.

Why This Change Was Made

Fresh successful ordinary update answers advertise OpenClaw-Installation-Count: 1;<server UTC day> (with no-store) only when the optional store is bound. A separate empty POST (User-Agent: openclaw-installation-count/1, OpenClaw-Installation-Count: 1;<day>;<gap 1-31>) is routed before legacy analytics and geography, including malformed traffic. Body framing is validated without reading the stream, the day is revalidated at the write boundary, and a transactional D1 batch prunes past 90 days and upserts the cell. The privacy page and README disclose the flow and opt-outs. This matches the merged client's header, user-agent and gap contract exactly.

Evidence

  • npm run check on this branch rebased onto current main (536a3c9): vocabulary check, tsc --noEmit, and Vitest 16 files / 590 tests passed, including 49 installation-count tests that drive real workerd + persisted local D1 (concurrent increments, restart persistence, malformed/duplicate headers, outcomes, missing storage, UTC boundaries, retention, stalled chunked upload rejected with zero body reads).
  • Original Team proof (from the stalled publication): a real paired OpenClaw Gateway completed a model turn and cold-restarted; exactly one update GET and one empty count-only POST, no restart duplicates, D1 cell 2 → 3.
  • Fresh Codex autoreview of the final diff: scoped-clean at P0–P2.
  • Privacy page before/after, captured from local wrangler dev of main and this branch:

Before:
privacy page before

After:
privacy page after

Receiver for openclaw/openclaw#186569. Successful update answers advertise
the server UTC day only when the optional INSTALLATION_COUNTS D1 binding
exists; a separate empty count-only POST increments an aggregate
(day, gap, reports) histogram with 90-day pruning. Production stays unbound.

Recovered from stalled Team publication 3f1ba16c (push never confirmed).

Co-authored-by: roboclaw-bot <309084314+roboclaw-bot@users.noreply.github.com>
@clawsweeper

clawsweeper Bot commented Oct 30, 2026

Copy link
Copy Markdown

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

@steipete
steipete marked this pull request as ready for review October 30, 2026 11:49
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 30, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-30T11:50:04.462727Z 4b326bc Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@steipete
steipete merged commit df7a206 into main Oct 30, 2026
8 checks passed
@steipete
steipete deleted the openclaw/identifier-free-installation-counts branch October 30, 2026 11:50
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