Skip to content

refactor(web): remove the unread playground funnel analytics - #956

Merged
devswha merged 1 commit into
devfrom
bot/remove-funnel-analytics
Sep 26, 2026
Merged

devswha merged 1 commit into
devfrom
bot/remove-funnel-analytics

Conversation

@devswha

@devswha devswha commented Sep 26, 2026

Copy link
Copy Markdown
Owner

Summary

Removes the playground's aggregate funnel analytics: the browser adapter (playground/analytics.js), the same-origin collector /api/funnel (api/funnel.js and src/funnel-analytics.js), and every track(...) call site in playground/chatgpt.js. Nothing in the repository read the Upstash counters, and the campaign enum was still pinned to the 2026-09-07 launch. Policy: docs/WORKFLOW.md

No Issue: the owner approved this removal in the 2026-09-26 dead-feature sweep.

  • Deleted api/funnel.js, src/funnel-analytics.js, playground/analytics.js, tests/unit/funnel-analytics.test.js, tests/unit/playground-analytics.test.js, and the runbook for the removed measurement, docs/operations/multilingual-funnel-20260907.md.
  • playground/chatgpt.js: removed track, the bucket helpers (inputBucket, latencyBucket, scoreBand), rewriteData, failureOutcome, the telemetry attempt field, the terminalTracked dedupe, trackInputStarted, and the arrival hook. Rewrite, refine, verify, cancel, retry, result actions, and the pricing and tier controls behave as before.
  • playground/index.html drops the analytics script. scripts/dev-server.mjs drops the /api/funnel route and the /analytics.js alias. scripts/check-architecture.mjs, docs/ARCHITECTURE.md, playground/DESIGN.md, playground/README.md, and docs/operations/README.md follow.
  • Tests: a new test, the playground calls no analytics hook during initialization, input, or a rewrite, failed on the old controller (73 pass / 1 fail) and passes now. The locale test no longer asserts funnel arrivals. The dev-server and deploy-invariant tests drop the endpoint and the script.

Scope and risk

  • Contract impact: the internal same-origin /api/funnel endpoint disappears on the next deploy. The CLI, the npm package, and the public HTTP API are unchanged.
  • Not changed: the server-side aggregate observability that pro-monitor reads (src/web-observability.js, PATINA_OBSERVABILITY_REST_API_*), checkout UTM forwarding (captureUtm), audit receipts, and rewrite behavior.
  • Existing patina:funnel:v1:* Upstash counters expire on their 35-day TTL; no cleanup is needed.
  • Size: 17 files, +25 / −1388. Whole-file deletions carry most of it.

Verification

  • npm test → 0 (2111 tests: 2110 pass, 1 skipped, 0 fail)
  • npm run lint → 0 (architecture: 107 modules, 361 edges, 0 violations)
  • npm run test:browser → 0 (Playwright playground suite, 9/9; not part of CI)
  • npm run release:check, npm run check:no-private-assets, npm run dogfood, git diff --check → 0
  • Base: origin/dev 9108a63. A later rebase on the Pro-packs PR (feat!: remove Pro pack delivery (patina pack, /api/packs) #953) is expected: both touch neighbouring lines in docs/ARCHITECTURE.md and scripts/check-architecture.mjs.

Release and rollback

  • Semver impact: none for CLI and npm consumers; this is hosted-playground telemetry only.
  • Rollback: revert the squash commit. The counters resume on the next deploy.

@vercel

vercel Bot commented Sep 26, 2026 •

Copy link
Copy Markdown
Contributor

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

Project Deployment Actions Updated
patina Ready Ready Preview Sep 26, 2026 8:17am UTC

Request Review

@devswha

devswha commented Sep 26, 2026

Copy link
Copy Markdown
Owner Author

Independent review (read-only, one pass): APPROVE

Reviewer: separate read-only gate-review agent (did not write the change).

  • No blocker, major, or minor findings.
  • Nit: the test fixture still names its hook parameter funnel (it maps to patinaFunnelReady so the new test can inject it). Kept.

Verified by the reviewer: every playground/chatgpt.js path (preflight early return, done/floor/rejected, non-ok frames with quota upsell and credential recovery, network error and timeout, stop/cancel, retry, verify mode, result actions, pricing, tier and license controls, init) is unchanged apart from the removed tracking calls; no dangling identifiers, eslint clean; no remaining references outside historical records. The new regression test was run against the restored old controller and fails there (it catches the ready hook plus Input Started, Tier Selected ×2, Rewrite Requested, and Rewrite Completed); it passes on the branch. Targeted tests 91/91; check-architecture 0 violations.

Removes the browser analytics adapter, the same-origin /api/funnel
collector, and every track() call site in the playground controller.
Nothing in the repository read the Upstash counters and the campaign
enum was still pinned to the 2026-09-07 launch. Server-side
observability for pro-monitor, checkout UTM forwarding, and audit
receipts are unchanged.
@devswha
devswha force-pushed the bot/remove-funnel-analytics branch from 45d2516 to 09f464b Compare September 26, 2026 08:17
@devswha
devswha marked this pull request as ready for review September 26, 2026 08:20
@devswha
devswha merged commit 849a9a4 into dev Sep 26, 2026
8 checks passed
@devswha
devswha deleted the bot/remove-funnel-analytics branch September 26, 2026 08:20

This branch was successfully deployed

1 active deployment
Preview — 09f464b7 Deployed Sep 26, 2026 by vercel[bot]
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