carlos / platform Public

Analytics on-ramp Task 1: copy deck approved by Luna, and its gate

Luna round 1 changed seven rows and flagged none, so the review ends
there (stopping rule 1). The gate is TestAnalyticsOnrampCopyDeckIsApprovedAndApplied.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
claude agent, operated by paul@keymail.dev d8ff93ecfccc843ff64567b6e22fdffb914d35d8 parent 68f416d
3 files changed, +167 −29
  • docs/superpowers/plans/2026-10-26-analytics-onramp-copy.md +33 −29
  • docs/superpowers/plans/LUNA-COPY-REVIEW-ANALYTICS-ONRAMP.md +13 −0
  • internal/console/approved_analytics_onramp_copy_test.go +121 −0
diff --git a/docs/superpowers/plans/2026-10-26-analytics-onramp-copy.md b/docs/superpowers/plans/2026-10-26-analytics-onramp-copy.md
index cd0e66b78..80ab91d2d 100644
--- a/docs/superpowers/plans/2026-10-26-analytics-onramp-copy.md
+++ b/docs/superpowers/plans/2026-10-26-analytics-onramp-copy.md
@@ -5,7 +5,11 @@ Every new or changed user-facing string of the analytics on-ramp plan
`internal/console/approved_analytics_onramp_copy_test.go`
(`TestAnalyticsOnrampCopyDeckIsApprovedAndApplied`).
-Status: pending the Luna pass.
+Approved 2026-10-26 by delegation: Luna pass, round 1
+(LUNA-COPY-REVIEW-ANALYTICS-ONRAMP.md, brief LUNA-COPY-BRIEF-ANALYTICS-ONRAMP.md).
+Luna changed 7 rows (AN-C02, C04, C06, C15, C21, C22, C40), flagged none, and
+left 21 alone. A round with nothing flagged ends the review (AGENTS.md,
+stopping rule 1). The text below is Luna's, verbatim.
The rules (the same as the console navigation deck,
`2026-10-25-console-ux-nav-copy.md`):
@@ -46,31 +50,31 @@ What the strings are for:
| id | where | old | new | checked by | status |
|---|---|---|---|---|---|
-| AN-C01 | templates/app_analytics.html (analytics off, first sentence, bold) | Analytics is off for this app (from the account). | Analytics is off for this app. | gate | pending |
-| AN-C02 | templates/app_analytics.html (analytics off, what is counted) | When on, the edge counts HTML page views and daily visitors as it serves them: no JavaScript, no cookie, no stored IP. A visitor is a salted hash that changes every day. | When it is on, the edge counts HTML page views and daily visitors. No JavaScript, no cookie, no stored IP. | gate | pending |
-| AN-C03 | templates/app_analytics.html (analytics off, owner's button) | (new) | Turn on analytics | gate | pending |
-| AN-C04 | templates/app_analytics.html (analytics off, what a member sees instead of the button) | (new) | An owner of this account can turn it on. | gate | pending |
-| AN-C05 | templates/app_analytics.html (analytics off, the pointer to Settings; was NAV-C44) | Turn it on for this app in `<a>`Settings, under Errors and analytics`</a>`, or for the whole account in the account's `<a>`Settings`</a>`. | (removed) | TestAnalyticsTabOffStateOwner | pending |
-| AN-C06 | analyticsview.go (flash on the Analytics tab after Turn on analytics) | (new) | Analytics is on for this app. Page views show here as they are counted. | gate | pending |
-| AN-C10 | templates/app_new.html (checkbox label) | (new) | Count page views and visitors with analytics | gate | pending |
-| AN-C11 | templates/app_new.html (under the checkbox) | (new) | No JavaScript, no cookie, no stored IP. | gate | pending |
-| AN-C12 | templates/app_new.html (under the checkbox, the account's default is on) | (new) | This account's default is on. | gate | pending |
-| AN-C13 | templates/app_new.html (under the checkbox, the account's default is off) | (new) | This account's default is off. | gate | pending |
-| AN-C14 | templates/app_new.html (owner's button under the checkbox) | (new) | Make this the account default | gate | pending |
-| AN-C15 | templates/app_new.html (owner's note beside the button) | (new) | The account default also covers every existing app without its own setting. | gate | pending |
-| AN-C16 | templates/app_new.html (member's note; the checkbox is shown but cannot be changed) | (new) | Only an owner can change this. | gate | pending |
-| AN-C17 | server.go (flash: a member's form chose differently from the account default) | (new) | Only an owner can change analytics for a new app. Nothing was created. | gate | pending |
-| AN-C18 | server.go (flash: the app was created but its analytics setting failed to save) | (new) | Created app `<app>`, but its analytics setting could not be saved. Set it in Settings, under Errors and analytics. | TestNewAppAnalyticsWriteFailureSaysSo | pending |
-| AN-C19 | analyticsview.go (flash on the create form after Make this the account default, on) | (new) | Analytics is now on for every app in this account without its own setting. | gate | pending |
-| AN-C20 | analyticsview.go (flash on the create form after Make this the account default, off) | (new) | Analytics is now off for every app in this account without its own setting. | gate | pending |
-| AN-C21 | templates/account_settings.html (Analytics, last sentence of the help) | Whether that needs consent where your visitors are is your call, which is why it is off until you turn it on. | Whether that needs consent where your visitors are is your call. New accounts start with it on. | gate | pending |
-| AN-C22 | templates/app_settings.html (Errors and analytics, last sentence of the Analytics help) | Whether that needs consent where your visitors are is your call, which is why it is off until you turn it on. | Whether that needs consent where your visitors are is your call. New accounts start with it on. | gate | pending |
-| AN-C30 | ../../apps.go (`carlos apps create` flag help, `--analytics`) | (new) | turn analytics on for the new app (default: follow the account) | gate | pending |
-| AN-C31 | ../../apps.go (`carlos apps create` flag help, `--no-analytics`) | (new) | turn analytics off for the new app (default: follow the account) | gate | pending |
-| AN-C32 | ../../apps.go (`carlos apps create` output, the app has its own setting) | (new) | analytics: `<state>`, set for this app | TestAppsCreateAnalyticsLine | pending |
-| AN-C33 | ../../apps.go (`carlos apps create` output, the app follows the account) | (new) | analytics: `<state>`, following the account | TestAppsCreateAnalyticsLine | pending |
-| AN-C34 | ../../apps.go (`carlos apps create` error, the console did not confirm the choice) | (new) | the app `<app>` was created, but the console did not confirm its analytics setting. Set it with: carlos analytics --app `<app>` --set-count `<count>` | TestAppsCreateAnalyticsMismatch | pending |
-| AN-C35 | ../../apps.go (`carlos apps create` error, both flags given) | (new) | choose --analytics or --no-analytics, not both | gate | pending |
-| AN-C36 | apicli.go (`carlos apps create` refusal printed to a member) | (new) | only an owner can choose analytics for a new app. Leave out --analytics and --no-analytics to follow the account | gate | pending |
-| AN-C40 | ../../docs/site/cli.md (carlos analytics, first paragraph) | Off until you turn it on, for one app or for the whole account. | New accounts start with it on. Turn it on or off for one app or for the whole account. | gate | pending |
-| AN-C41 | ../../docs/site/cli.md (carlos apps, after the `--region` example) | (new) | `--analytics` or `--no-analytics` turns analytics on or off for the new app. Without either, the app follows the account's setting. Only an owner can choose differently from the account. | gate | pending |
+| AN-C01 | templates/app_analytics.html (analytics off, first sentence, bold) | Analytics is off for this app (from the account). | Analytics is off for this app. | gate | approved |
+| AN-C02 | templates/app_analytics.html (analytics off, what is counted) | When on, the edge counts HTML page views and daily visitors as it serves them: no JavaScript, no cookie, no stored IP. A visitor is a salted hash that changes every day. | When analytics is on, the edge counts HTML page views and daily visitors. No JavaScript, no cookie, no stored IP. | gate | approved |
+| AN-C03 | templates/app_analytics.html (analytics off, owner's button) | (new) | Turn on analytics | gate | approved |
+| AN-C04 | templates/app_analytics.html (analytics off, what a member sees instead of the button) | (new) | An account owner can turn on analytics. | gate | approved |
+| AN-C05 | templates/app_analytics.html (analytics off, the pointer to Settings; was NAV-C44) | Turn it on for this app in `<a>`Settings, under Errors and analytics`</a>`, or for the whole account in the account's `<a>`Settings`</a>`. | (removed) | TestAnalyticsTabOffStateOwner | removed |
+| AN-C06 | analyticsview.go (flash on the Analytics tab after Turn on analytics) | (new) | Analytics is on for this app. Page views appear here as they are counted. | gate | approved |
+| AN-C10 | templates/app_new.html (checkbox label) | (new) | Count page views and visitors with analytics | gate | approved |
+| AN-C11 | templates/app_new.html (under the checkbox) | (new) | No JavaScript, no cookie, no stored IP. | gate | approved |
+| AN-C12 | templates/app_new.html (under the checkbox, the account's default is on) | (new) | This account's default is on. | gate | approved |
+| AN-C13 | templates/app_new.html (under the checkbox, the account's default is off) | (new) | This account's default is off. | gate | approved |
+| AN-C14 | templates/app_new.html (owner's button under the checkbox) | (new) | Make this the account default | gate | approved |
+| AN-C15 | templates/app_new.html (owner's note beside the button) | (new) | The account default also applies to every existing app without its own setting. | gate | approved |
+| AN-C16 | templates/app_new.html (member's note; the checkbox is shown but cannot be changed) | (new) | Only an owner can change this. | gate | approved |
+| AN-C17 | server.go (flash: a member's form chose differently from the account default) | (new) | Only an owner can change analytics for a new app. Nothing was created. | gate | approved |
+| AN-C18 | server.go (flash: the app was created but its analytics setting failed to save) | (new) | Created app `<app>`, but its analytics setting could not be saved. Set it in Settings, under Errors and analytics. | TestNewAppAnalyticsWriteFailureSaysSo | approved |
+| AN-C19 | analyticsview.go (flash on the create form after Make this the account default, on) | (new) | Analytics is now on for every app in this account without its own setting. | gate | approved |
+| AN-C20 | analyticsview.go (flash on the create form after Make this the account default, off) | (new) | Analytics is now off for every app in this account without its own setting. | gate | approved |
+| AN-C21 | templates/account_settings.html (Analytics, last sentence of the help) | Whether that needs consent where your visitors are is your call, which is why it is off until you turn it on. | Whether that needs consent where your visitors are is your call. New accounts start with analytics on. | gate | approved |
+| AN-C22 | templates/app_settings.html (Errors and analytics, last sentence of the Analytics help) | Whether that needs consent where your visitors are is your call, which is why it is off until you turn it on. | Whether that needs consent where your visitors are is your call. New accounts start with analytics on. | gate | approved |
+| AN-C30 | ../../apps.go (`carlos apps create` flag help, `--analytics`) | (new) | turn analytics on for the new app (default: follow the account) | gate | approved |
+| AN-C31 | ../../apps.go (`carlos apps create` flag help, `--no-analytics`) | (new) | turn analytics off for the new app (default: follow the account) | gate | approved |
+| AN-C32 | ../../apps.go (`carlos apps create` output, the app has its own setting) | (new) | analytics: `<state>`, set for this app | TestAppsCreateAnalyticsLine | approved |
+| AN-C33 | ../../apps.go (`carlos apps create` output, the app follows the account) | (new) | analytics: `<state>`, following the account | TestAppsCreateAnalyticsLine | approved |
+| AN-C34 | ../../apps.go (`carlos apps create` error, the console did not confirm the choice) | (new) | the app `<app>` was created, but the console did not confirm its analytics setting. Set it with: carlos analytics --app `<app>` --set-count `<count>` | TestAppsCreateAnalyticsMismatch | approved |
+| AN-C35 | ../../apps.go (`carlos apps create` error, both flags given) | (new) | choose --analytics or --no-analytics, not both | gate | approved |
+| AN-C36 | apicli.go (`carlos apps create` refusal printed to a member) | (new) | only an owner can choose analytics for a new app. Leave out --analytics and --no-analytics to follow the account | gate | approved |
+| AN-C40 | ../../docs/site/cli.md (carlos analytics, first paragraph) | Off until you turn it on, for one app or for the whole account. | New accounts start with analytics on. Turn it on or off for one app or for the whole account. | gate | approved |
+| AN-C41 | ../../docs/site/cli.md (carlos apps, after the `--region` example) | (new) | `--analytics` or `--no-analytics` turns analytics on or off for the new app. Without either, the app follows the account's setting. Only an owner can choose differently from the account. | gate | approved |
diff --git a/docs/superpowers/plans/LUNA-COPY-REVIEW-ANALYTICS-ONRAMP.md b/docs/superpowers/plans/LUNA-COPY-REVIEW-ANALYTICS-ONRAMP.md
new file mode 100644
index 000000000..756fd4992
--- /dev/null
+++ b/docs/superpowers/plans/LUNA-COPY-REVIEW-ANALYTICS-ONRAMP.md
@@ -0,0 +1,13 @@
+| ID | current | new | why |
+|---|---|---|---|
+| AN-C02 | When it is on, the edge counts HTML page views and daily visitors. No JavaScript, no cookie, no stored IP. | When analytics is on, the edge counts HTML page views and daily visitors. No JavaScript, no cookie, no stored IP. | Clearer subject |
+| AN-C04 | An owner of this account can turn it on. | An account owner can turn on analytics. | Clearer and shorter |
+| AN-C06 | Analytics is on for this app. Page views show here as they are counted. | Analytics is on for this app. Page views appear here as they are counted. | More natural wording |
+| AN-C15 | The account default also covers every existing app without its own setting. | The account default also applies to every existing app without its own setting. | Plainer wording |
+| AN-C21 | Whether that needs consent where your visitors are is your call. New accounts start with it on. | Whether that needs consent where your visitors are is your call. New accounts start with analytics on. | Removes unclear “it” |
+| AN-C22 | Whether that needs consent where your visitors are is your call. New accounts start with it on. | Whether that needs consent where your visitors are is your call. New accounts start with analytics on. | Removes unclear “it” |
+| AN-C40 | New accounts start with it on. Turn it on or off for one app or for the whole account. | New accounts start with analytics on. Turn it on or off for one app or for the whole account. | Removes unclear “it” |
+
+Flagged rows: none.
+
+7 rows changed, 0 flagged, 21 left alone.
\ No newline at end of file
diff --git a/internal/console/approved_analytics_onramp_copy_test.go b/internal/console/approved_analytics_onramp_copy_test.go
new file mode 100644
index 000000000..315cef078
--- /dev/null
+++ b/internal/console/approved_analytics_onramp_copy_test.go
@@ -0,0 +1,121 @@
+package console
+
+import (
+ "os"
+ "path/filepath"
+ "strings"
+ "testing"
+)
+
+// The copy gate of the analytics on-ramp plan
+// (docs/superpowers/plans/2026-10-26-analytics-onramp.md). The deck is
+// docs/superpowers/plans/2026-10-26-analytics-onramp-copy.md, in the same
+// shape as the console navigation deck (approved_nav_copy_test.go): one table
+// with the columns id, where, old, new, checked by, status. Rows whose file
+// sits outside this package name it relative to here ("../../apps.go").
+const onrampCopyDeckPath = "../../docs/superpowers/plans/2026-10-26-analytics-onramp-copy.md"
+
+// onrampCopyBuilt is every deck row whose text the code, templates or docs
+// carry. The task that writes a row's text adds its id here in the same
+// commit, once the row is approved. From then on a "gate" row's new text must
+// be in its file, and any other row's named test must exist.
+var onrampCopyBuilt = map[string]bool{}
+
+// onrampCopyTestFiles are the test sources a non-gate row's test may live in:
+// this package's, and the root package's for the CLI rows.
+var onrampCopyTestFiles = []string{"*_test.go", "../../*_test.go"}
+
+func parseOnrampCopyDeck(t *testing.T) []navCopyRow {
+ t.Helper()
+ raw, err := os.ReadFile(onrampCopyDeckPath)
+ if err != nil {
+ t.Fatal(err)
+ }
+ var rows []navCopyRow
+ for _, line := range strings.Split(string(raw), "\n") {
+ if !strings.HasPrefix(line, "| AN-") {
+ continue
+ }
+ line = strings.TrimSpace(line)
+ line = strings.TrimSuffix(strings.TrimPrefix(line, "| "), " |")
+ cells := strings.Split(line, " | ")
+ if len(cells) != 6 {
+ t.Fatalf("deck row has %d cells, want 6: %.60q", len(cells), line)
+ }
+ rows = append(rows, navCopyRow{
+ ID: strings.TrimSpace(cells[0]), Where: strings.TrimSpace(cells[1]),
+ Old: strings.TrimSpace(cells[2]), New: strings.TrimSpace(cells[3]),
+ CheckedBy: strings.TrimSpace(cells[4]), Status: strings.TrimSpace(cells[5]),
+ })
+ }
+ return rows
+}
+
+func TestAnalyticsOnrampCopyDeckIsApprovedAndApplied(t *testing.T) {
+ rows := parseOnrampCopyDeck(t)
+ if len(rows) < 25 {
+ t.Fatalf("deck parsed %d rows, want at least 25", len(rows))
+ }
+ byID := map[string]navCopyRow{}
+ for _, r := range rows {
+ if _, dup := byID[r.ID]; dup {
+ t.Errorf("%s appears twice in the deck", r.ID)
+ }
+ byID[r.ID] = r
+ if r.Status != "approved" && r.Status != "removed" {
+ t.Errorf("%s status is %q, want approved or removed", r.ID, r.Status)
+ }
+ if strings.Contains(r.New, "—") {
+ t.Errorf("%s: new text holds an em dash", r.ID)
+ }
+ }
+ for id := range onrampCopyBuilt {
+ if _, ok := byID[id]; !ok {
+ t.Errorf("onrampCopyBuilt names %s, which has no deck row", id)
+ }
+ }
+
+ var sources string
+ testSources := func() string {
+ if sources == "" {
+ var b strings.Builder
+ for _, pat := range onrampCopyTestFiles {
+ files, err := filepath.Glob(pat)
+ if err != nil {
+ t.Fatal(err)
+ }
+ for _, f := range files {
+ raw, err := os.ReadFile(f)
+ if err != nil {
+ t.Fatal(err)
+ }
+ b.Write(raw)
+ b.WriteByte('\n')
+ }
+ }
+ sources = b.String()
+ }
+ return sources
+ }
+
+ for _, r := range rows {
+ if !onrampCopyBuilt[r.ID] {
+ continue
+ }
+ if r.CheckedBy != "gate" {
+ if !strings.Contains(testSources(), "func "+r.CheckedBy+"(") {
+ t.Errorf("%s: its test %s does not exist", r.ID, r.CheckedBy)
+ }
+ continue
+ }
+ file, _, _ := strings.Cut(r.Where, " ")
+ raw, err := os.ReadFile(file)
+ if err != nil {
+ t.Errorf("%s: %v", r.ID, err)
+ continue
+ }
+ if !strings.Contains(navSpace(string(raw)), navSpace(r.New)) {
+ t.Errorf("%s: %s does not contain %q", r.ID, file, r.New)
+ }
+ }
+}