carlos / platform Public

Analytics on-ramp: census proposal (approvals only)

make census-propose NAME=analytics-onramp: six body changes (handleAPICreateApp,
four templates, telemetry.Resolve) and four envelope re-pins; no decision.
Seal 798a1ee3 -> 32c09625. Needs a cross-family reviewer's approval on #280.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
claude agent, operated by paul@keymail.dev 3e0edc7f4e6adb1c2ac4bc2a52feca614d57f65c parent e49bfd0
3 files changed, +48 −0
  • docs/superpowers/notes/census-proposal-analytics-onramp.md +29 −0
  • internal/provision/testdata/plan14-root-reads-analytics-onramp.tsv +18 −0
  • internal/provision/testdata/plan14-root-reads-chain.tsv +1 −0

CI failed — run details

diff --git a/docs/superpowers/notes/census-proposal-analytics-onramp.md b/docs/superpowers/notes/census-proposal-analytics-onramp.md
new file mode 100644
index 000000000..1d34a2454
--- /dev/null
+++ b/docs/superpowers/notes/census-proposal-analytics-onramp.md
@@ -0,0 +1,29 @@
+# Census approval: analytics-onramp
+
+Ruling `census-ruling-analytics-onramp`. Every change below keeps the disposition it already has, so it needs an approval, not a decision.
+
+| unit | change | read sites | what changed |
+|---|---|---|---|
+| `internal/console/apicli.go` `Server.handleAPICreateApp` | body | unchanged (2) | analytics on-ramp: an optional analytics field (edge/off) checked before the claim (owner-only when it differs from the account default, via telemetry.Resolve of the account), written after it through updateAppTelemetry, and echoed from telemetry.Resolve of the new app, all in the console's own release store; the same two sites (registry:Account, whole:Fleet); no read added |
+| `internal/console/templates/account_settings.html` `external` | body | unchanged (1) | the Analytics help's last sentence now says new accounts start with analytics on; markup only; no read added |
+| `internal/console/templates/app_analytics.html` `external` | body | unchanged (1) | analytics off: a Turn on analytics form posting count=edge and back=analytics with the CSRF token to the existing /a/{sqid}/apps/{app}/analytics/setting door (owners), a line for members, and data sections shown only when on or counted; markup only; no read added |
+| `internal/console/templates/app_new.html` `external` | body | unchanged (1) | an analytics checkbox (count=edge, hidden count=off) on the create form and, for owners, a formaction button posting the form to the existing /a/{sqid}/analytics/setting door with back=new-app; markup only; no read added |
+| `internal/console/templates/app_settings.html` `external` | body | unchanged (1) | the Analytics help's last sentence now says new accounts start with analytics on; markup only; no read added |
+| `internal/telemetry/telemetry.go` `Resolve` | body | unchanged (2) | an empty app name returns the account level folded over the defaults without reading AppKey(sqid, ""); one read fewer on that path, none added |
+
+Envelopes re-pinned: `.`, `internal/console`, `internal/console/templates`, `internal/telemetry`.
+
+Review: a model from the other family than the author reads the branch's diff against main on the amadan.net remote (`origin` or `amadan`, whichever points at amadan.net) and gives a verdict for every unit and every re-pinned envelope above. For a unit, compare the change with its recorded disposition and basis below; for an envelope, read every changed function in the package and what it reaches. Escalate if the change lets root open, run, query or follow anything it did not before from a path or input a tenant, an app or a box agent can create, write or name; if it weakens a check, refusal, validation, argument or environment the basis relies on; or if the diff cannot settle either. Otherwise approve. Record each verdict on #280 with the tip. An escalation goes to the census owner as a decision.
+
+Recorded dispositions, which each change must still satisfy:
+
+- `internal/console/apicli.go` `Server.handleAPICreateApp`: legacy, task accepted-legacy. Basis: accepted-legacy;rev3=J1;basis=root-route;rev3=census-ruling-instance-egress-sizes-328-329;basis=#328/#329 plan 1 Task 11: two more outcomes of the create claim answer 503: claimPolicyClearFailed (the message names apppolicy.Key(acct.Sqid, name), a string built from the account and the requested name) and claimPolicyWriterRefused (the lease's refusal message). The same two sites (registry:Account, whole:Fleet); no read added.
+- `internal/console/templates/account_settings.html` `external`: legacy, task accepted-legacy. Basis: accepted-legacy;rev3=J4;basis=root-input;rev3=census-ruling-pro-6214-service-runs;basis=the console (cmd/console serve, user carlos-console): embedded UI: a Commands column, the minted line names a run credential's commands, and a commands input on the mint form; markup only; no read added;rev3=census-ruling-console-ux-nav;basis=forms use the settings-row class and btn-sm buttons; same actions and fields; markup only; no read added
+- `internal/console/templates/app_analytics.html` `external`: legacy, task accepted-legacy. Basis: accepted-legacy;rev3=J4;basis=root-input;rev3=census-ruling-console-ux-nav;basis=drops the lognav sub-tabs, the filter form uses the toolbar class, and the turn-on link points at Settings, Errors and analytics; same form fields; markup only; no read added
+- `internal/console/templates/app_new.html` `external`: legacy, task accepted-legacy. Basis: accepted-legacy;rev3=J4;basis=root-input
+- `internal/console/templates/app_settings.html` `external`: legacy, task accepted-legacy. Basis: accepted-legacy;rev3=J4;basis=root-input;rev3=census-ruling-design-edge-rate-limit-358;basis=the Settings page gains a Rate limit section: per instance host, a form of four numbers (busy at, per address while busy, backstop rate, backstop burst) and a reset form, both posting to /a/{sqid}/apps/{app}/ratelimit with the CSRF token, and the record's path rules listed read-only; embedded and rendered by the console (carlos-console), as before; no read added;rev3=census-ruling-console-ux-nav;basis=adds the Placement section (the existing POST /place form, moved from app_instances) and the Errors and analytics section; Advanced folds into General; link texts reworded; markup only; no read added;rev3=census-ruling-region-labels;basis=General gains a Region section (RC-18a, RC-18d, RC-19, RL-S1, or the unread sentence); the placement form's button reads Change fleet (RC-14); markup only; no read added;rev3=census-ruling-app-region-set;basis=the General Region section gains, for an owner or a deployment operator, a select of region codes and a Change region button posting to /a/{sqid}/apps/{app}/region with the CSRF token, and a note; markup only; no read added
+- `internal/telemetry/telemetry.go` `Resolve`: legacy, task accepted-legacy. Basis: accepted-legacy;rev3=J4;basis=root-input;rev3=PROPOSED-s3-change-index;identity=unchanged (the console and the agent);basis=the fold over the defaults moved into Fold, which the agent's switch pass calls over cached settings; the same two telemetry.Read calls, offsets moved
+
+Seal: `798a1ee3d8c8b775f963b9ae1dbc45e18628fa0c1e63404f46606601766ad66c` → `32c096252eb452753eabd457d1cc97e7204529502ed985fd3b3e641f34137d26`.
+
+Overlay: `internal/provision/testdata/plan14-root-reads-analytics-onramp.tsv`, appended to `internal/provision/testdata/plan14-root-reads-chain.tsv`.
diff --git a/internal/provision/testdata/plan14-root-reads-analytics-onramp.tsv b/internal/provision/testdata/plan14-root-reads-analytics-onramp.tsv
new file mode 100644
index 000000000..bf385a0a3
--- /dev/null
+++ b/internal/provision/testdata/plan14-root-reads-analytics-onramp.tsv
@@ -0,0 +1,18 @@
+# Census overlay analytics-onramp, written by census-propose (#369). census-ruling-analytics-onramp, approved on #280 before the merge; the approval card is docs/superpowers/notes/census-proposal-analytics-onramp.md.
+# 6 body, 0 sites, 4 envelope: each changed unit re-frozen at its existing disposition with its claim appended.
+@legacy 66f5056ebaf095eed91b0a8c823e0ce0cc1ef37c824408f502e9ec6d256e0855 internal/console/apicli.go Server.handleAPICreateApp legacy accepted-legacy accepted-legacy;rev3=J1;basis=root-route;rev3=census-ruling-instance-egress-sizes-328-329;basis=#328/#329 plan 1 Task 11: two more outcomes of the create claim answer 503: claimPolicyClearFailed (the message names apppolicy.Key(acct.Sqid, name), a string built from the account and the requested name) and claimPolicyWriterRefused (the lease's refusal message). The same two sites (registry:Account, whole:Fleet); no read added.;rev3=census-ruling-analytics-onramp;basis=analytics on-ramp: an optional analytics field (edge/off) checked before the claim (owner-only when it differs from the account default, via telemetry.Resolve of the account), written after it through updateAppTelemetry, and echoed from telemetry.Resolve of the new app, all in the console's own release store; the same two sites (registry:Account, whole:Fleet); no read added registry:Account@4216,whole:Fleet@4204 3d53c1a5479bb2cc0fbd4a399d6220de8e6c4e8ed395588dc4dafea149e4ed3a
+@legacy 3e56bf560ef74949c99c435b4269ce7ce5502006e173adb6bede0e267ba70e2c internal/console/templates/account_settings.html external legacy accepted-legacy accepted-legacy;rev3=J4;basis=root-input;rev3=census-ruling-pro-6214-service-runs;basis=the console (cmd/console serve, user carlos-console): embedded UI: a Commands column, the minted line names a run credential's commands, and a commands input on the mint form; markup only; no read added;rev3=census-ruling-console-ux-nav;basis=forms use the settings-row class and btn-sm buttons; same actions and fields; markup only; no read added;rev3=census-ruling-analytics-onramp;basis=the Analytics help's last sentence now says new accounts start with analytics on; markup only; no read added file:external@0 888e28be47dd94d04b67eff1697ce6c20d5cecf690618ef61762eca04e2d5477
+@legacy a91acfd1065ea42b1f5c8785fa15b1e6330d485e9e787748dba165511af1b9d9 internal/console/templates/app_analytics.html external legacy accepted-legacy accepted-legacy;rev3=J4;basis=root-input;rev3=census-ruling-console-ux-nav;basis=drops the lognav sub-tabs, the filter form uses the toolbar class, and the turn-on link points at Settings, Errors and analytics; same form fields; markup only; no read added;rev3=census-ruling-analytics-onramp;basis=analytics off: a Turn on analytics form posting count=edge and back=analytics with the CSRF token to the existing /a/{sqid}/apps/{app}/analytics/setting door (owners), a line for members, and data sections shown only when on or counted; markup only; no read added file:external@0 6b38239c98e5f4531607f630053b6552943121a8c6686f14bb6c5a17510c2d45
+@legacy f480533cf8161f32d4e728d6dfb0804831d761ce8026571768e249b1d8842930 internal/console/templates/app_new.html external legacy accepted-legacy accepted-legacy;rev3=J4;basis=root-input;rev3=census-ruling-analytics-onramp;basis=an analytics checkbox (count=edge, hidden count=off) on the create form and, for owners, a formaction button posting the form to the existing /a/{sqid}/analytics/setting door with back=new-app; markup only; no read added file:external@0 ee78c363f96cd9c219f86f93b09b096983fca82e4c4c7626d2a6fbdf72d3c19d
+@legacy 9c0373c68ede777a7515fae70a8b2b32e52a863d0b0e129923a6d1326c9adc08 internal/console/templates/app_settings.html external legacy accepted-legacy accepted-legacy;rev3=J4;basis=root-input;rev3=census-ruling-design-edge-rate-limit-358;basis=the Settings page gains a Rate limit section: per instance host, a form of four numbers (busy at, per address while busy, backstop rate, backstop burst) and a reset form, both posting to /a/{sqid}/apps/{app}/ratelimit with the CSRF token, and the record's path rules listed read-only; embedded and rendered by the console (carlos-console), as before; no read added;rev3=census-ruling-console-ux-nav;basis=adds the Placement section (the existing POST /place form, moved from app_instances) and the Errors and analytics section; Advanced folds into General; link texts reworded; markup only; no read added;rev3=census-ruling-region-labels;basis=General gains a Region section (RC-18a, RC-18d, RC-19, RL-S1, or the unread sentence); the placement form's button reads Change fleet (RC-14); markup only; no read added;rev3=census-ruling-app-region-set;basis=the General Region section gains, for an owner or a deployment operator, a select of region codes and a Change region button posting to /a/{sqid}/apps/{app}/region with the CSRF token, and a note; markup only; no read added;rev3=census-ruling-analytics-onramp;basis=the Analytics help's last sentence now says new accounts start with analytics on; markup only; no read added file:external@0 2270f7eb9ecbacaba0c5f7241222ee0fdb8da2fed260294c7af6d9e1d6cfedb5
+@legacy 8787f374d7eb01165db4d1a44bf12684e174512a6a532306e4c478e39b2de512 internal/telemetry/telemetry.go Resolve legacy accepted-legacy accepted-legacy;rev3=J4;basis=root-input;rev3=PROPOSED-s3-change-index;identity=unchanged (the console and the agent);basis=the fold over the defaults moved into Fold, which the agent's switch pass calls over cached settings; the same two telemetry.Read calls, offsets moved;rev3=census-ruling-analytics-onramp;basis=an empty app name returns the account level folded over the defaults without reading AppKey(sqid, ""); one read fewer on that path, none added file:Read@167,file:Read@335 1762a8b1979dcfcdbb440742b25a6c01465fd8891466cb41e5007108a3e1e9ed
+internal/console/apicli.go Server.handleAPICreateApp legacy accepted-legacy accepted-legacy;rev3=J1;basis=root-route;rev3=census-ruling-instance-egress-sizes-328-329;basis=#328/#329 plan 1 Task 11: two more outcomes of the create claim answer 503: claimPolicyClearFailed (the message names apppolicy.Key(acct.Sqid, name), a string built from the account and the requested name) and claimPolicyWriterRefused (the lease's refusal message). The same two sites (registry:Account, whole:Fleet); no read added.;rev3=census-ruling-analytics-onramp;basis=analytics on-ramp: an optional analytics field (edge/off) checked before the claim (owner-only when it differs from the account default, via telemetry.Resolve of the account), written after it through updateAppTelemetry, and echoed from telemetry.Resolve of the new app, all in the console's own release store; the same two sites (registry:Account, whole:Fleet); no read added registry:Account@4216,whole:Fleet@4204 3d53c1a5479bb2cc0fbd4a399d6220de8e6c4e8ed395588dc4dafea149e4ed3a
+internal/console/templates/account_settings.html external legacy accepted-legacy accepted-legacy;rev3=J4;basis=root-input;rev3=census-ruling-pro-6214-service-runs;basis=the console (cmd/console serve, user carlos-console): embedded UI: a Commands column, the minted line names a run credential's commands, and a commands input on the mint form; markup only; no read added;rev3=census-ruling-console-ux-nav;basis=forms use the settings-row class and btn-sm buttons; same actions and fields; markup only; no read added;rev3=census-ruling-analytics-onramp;basis=the Analytics help's last sentence now says new accounts start with analytics on; markup only; no read added file:external@0 888e28be47dd94d04b67eff1697ce6c20d5cecf690618ef61762eca04e2d5477
+internal/console/templates/app_analytics.html external legacy accepted-legacy accepted-legacy;rev3=J4;basis=root-input;rev3=census-ruling-console-ux-nav;basis=drops the lognav sub-tabs, the filter form uses the toolbar class, and the turn-on link points at Settings, Errors and analytics; same form fields; markup only; no read added;rev3=census-ruling-analytics-onramp;basis=analytics off: a Turn on analytics form posting count=edge and back=analytics with the CSRF token to the existing /a/{sqid}/apps/{app}/analytics/setting door (owners), a line for members, and data sections shown only when on or counted; markup only; no read added file:external@0 6b38239c98e5f4531607f630053b6552943121a8c6686f14bb6c5a17510c2d45
+internal/console/templates/app_new.html external legacy accepted-legacy accepted-legacy;rev3=J4;basis=root-input;rev3=census-ruling-analytics-onramp;basis=an analytics checkbox (count=edge, hidden count=off) on the create form and, for owners, a formaction button posting the form to the existing /a/{sqid}/analytics/setting door with back=new-app; markup only; no read added file:external@0 ee78c363f96cd9c219f86f93b09b096983fca82e4c4c7626d2a6fbdf72d3c19d
+internal/console/templates/app_settings.html external legacy accepted-legacy accepted-legacy;rev3=J4;basis=root-input;rev3=census-ruling-design-edge-rate-limit-358;basis=the Settings page gains a Rate limit section: per instance host, a form of four numbers (busy at, per address while busy, backstop rate, backstop burst) and a reset form, both posting to /a/{sqid}/apps/{app}/ratelimit with the CSRF token, and the record's path rules listed read-only; embedded and rendered by the console (carlos-console), as before; no read added;rev3=census-ruling-console-ux-nav;basis=adds the Placement section (the existing POST /place form, moved from app_instances) and the Errors and analytics section; Advanced folds into General; link texts reworded; markup only; no read added;rev3=census-ruling-region-labels;basis=General gains a Region section (RC-18a, RC-18d, RC-19, RL-S1, or the unread sentence); the placement form's button reads Change fleet (RC-14); markup only; no read added;rev3=census-ruling-app-region-set;basis=the General Region section gains, for an owner or a deployment operator, a select of region codes and a Change region button posting to /a/{sqid}/apps/{app}/region with the CSRF token, and a note; markup only; no read added;rev3=census-ruling-analytics-onramp;basis=the Analytics help's last sentence now says new accounts start with analytics on; markup only; no read added file:external@0 2270f7eb9ecbacaba0c5f7241222ee0fdb8da2fed260294c7af6d9e1d6cfedb5
+internal/telemetry/telemetry.go Resolve legacy accepted-legacy accepted-legacy;rev3=J4;basis=root-input;rev3=PROPOSED-s3-change-index;identity=unchanged (the console and the agent);basis=the fold over the defaults moved into Fold, which the agent's switch pass calls over cached settings; the same two telemetry.Read calls, offsets moved;rev3=census-ruling-analytics-onramp;basis=an empty app name returns the account level folded over the defaults without reading AppKey(sqid, ""); one read fewer on that path, none added file:Read@167,file:Read@335 1762a8b1979dcfcdbb440742b25a6c01465fd8891466cb41e5007108a3e1e9ed
+@coverage . 22927f5b0145c678608910d552836d28b62ee87a4dd2fbb0bb1c7db36da36fc2
+@coverage internal/console 05571f0b798f5e31512488ac50cafc374e89a66449f5e47d0527e800d769c657
+@coverage internal/console/templates cfa3b41de9efaf902f9ebbdfb3cb3224d15792493fe3e82976f028c68896a5ad
+@coverage internal/telemetry 7e0e6ad650a66ef7ffd36ffc26aceef3f04f6f2926ea5b91b44b367291d6367f
diff --git a/internal/provision/testdata/plan14-root-reads-chain.tsv b/internal/provision/testdata/plan14-root-reads-chain.tsv
index 83161f11f..17998c6c2 100644
--- a/internal/provision/testdata/plan14-root-reads-chain.tsv
+++ b/internal/provision/testdata/plan14-root-reads-chain.tsv
@@ -59,3 +59,4 @@ plan14-root-reads-region-labels-decisions.tsv b265c2ae74edbaca766d33e085d31a8e7c
plan14-root-reads-region-labels.tsv d1e00cfb29d88b7a8e4998b641164e539067a6e1e9e4f52524255343c0c5f9f7
plan14-root-reads-app-region-set.tsv 798a1ee3d8c8b775f963b9ae1dbc45e18628fa0c1e63404f46606601766ad66c
plan14-root-reads-nearest-region-a.tsv 798a1ee3d8c8b775f963b9ae1dbc45e18628fa0c1e63404f46606601766ad66c
+plan14-root-reads-analytics-onramp.tsv 32c096252eb452753eabd457d1cc97e7204529502ed985fd3b3e641f34137d26