carlos / platform Public

Analytics on-ramp: plan

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
claude agent, operated by paul@keymail.dev be6888e8ac29d507ce272febf200e7eb01a63a3c parent 5634538
1 file changed, +24 −0
  • docs/superpowers/plans/2026-10-26-analytics-onramp.md +24 −0

CI failed — run details

diff --git a/docs/superpowers/plans/2026-10-26-analytics-onramp.md b/docs/superpowers/plans/2026-10-26-analytics-onramp.md
new file mode 100644
index 000000000..030fd7648
--- /dev/null
+++ b/docs/superpowers/plans/2026-10-26-analytics-onramp.md
@@ -0,0 +1,24 @@
+# Analytics on-ramp
+
+Paul, 2026-10-26, approved in chat ("Yes, go ahead"):
+
+1. The Analytics tab, when analytics is off, stops pointing at Settings. It shows one short line on what is counted (no JavaScript, no cookie, no stored IP, HTML page views only) and, for owners, a **Turn on analytics** button that saves the app's analytics setting through the existing POST door and redirects back to the Analytics tab. Members see a line saying an owner can turn it on. The empty table, chart and "Nothing yet" sections are hidden while it is off.
+2. Create app (console form at `/a/{sqid}/apps/new`) gets an analytics checkbox, ticked from the account's effective default. Choosing differently from the account default gives the new app its own setting; matching it writes nothing (the app follows the account). Under the checkbox, owners get a link/control to make the current choice the account default (the existing account-level analytics setting).
+3. New accounts default to analytics **on** (write the account-level setting on at account creation). Existing accounts are unchanged.
+4. CLI: `carlos apps create` gains `--analytics` / `--no-analytics` (no flag = follow the account default), through the existing create API.
+
+## Constraints
+
+- Reuse the existing settings doors and storage (`telemetry` package: account key, app key, Fold/Resolve; `analyticsview.go` POST handlers). No new storage format.
+- Gate order unchanged; only owners can change analytics (as today: `role != RoleOwner` refusal in the setting handlers). The create-app path writes the app's setting only for a user allowed to create apps; check whether non-owners can create apps and, if they can, whether they may set analytics: refuse up front rather than silently ignore.
+- The console's per-app frame cache and perf walk exist on main after console-perf-quick-wins merges; this branch is cut from main before that merge, so keep changes to the analytics template, create-app form/handler, account creation and CLI create, and expect a later merge.
+- Every new or changed user-facing string is listed in `docs/superpowers/plans/2026-10-26-analytics-onramp-copy.md` and reviewed by a Luna pass (`codex exec -m gpt-5.6-luna`, house rules: no em dashes, plain, short, human text only) before templates/CLI carry it.
+- Targeted tests with `-run` only; gofmt, vet, darwin and windows builds; commit trailer `Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>`; no tenant names.
+- Census: run `make census-card` at the end; decisions go to Paul.
+
+## Tasks
+
+1. Copy record + Luna pass.
+2. Analytics tab off-state with the Turn on button (owner) / member line; POST redirects back to the tab (`back` parameter or equivalent) on success and refusal; tests for owner, member, and that the page shows data sections only when on.
+3. Create app checkbox + account-default link; new-account default on; CLI flags; tests (form default follows account; differing choice writes app setting; matching writes nothing; new account starts on; CLI flags map to the API).
+4. Final gate + census card.