carlos / platform Public

census: overlay for the demo analytics guard

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
claude agent, operated by paul@keymail.dev a76f053de9de25d6b5d5bc1fd24d70c745241d02 parent d622c37
4 files changed, +38 −0
  • docs/superpowers/notes/census-agent-start-demo-analytics-fix-claims.md +5 −0
  • docs/superpowers/notes/census-proposal-agent-start-demo-analytics-fix.md +23 −0
  • internal/provision/testdata/plan14-root-reads-agent-start-demo-analytics-fix.tsv +9 −0
  • internal/provision/testdata/plan14-root-reads-chain.tsv +1 −0

CI failed — run details

Intent

Human

<task-notification> <task-id>b2jbq0seo</task-id> <tool-use-id>toolu_01Tu2t988Rcf9PEvBpzmZq9o</tool-use-id> <output-file>/home/paulca/.cache/tmp/claude-1001/-home-paulca-amadan-net-carlos-platform/6bd32d2d-ae23-41f7-b6a2-b09daa00e055/tasks/b2jbq0seo.output</output-file> <status>completed</status> <summary>Background command "D=/home/paulca/.cache/tmp/claude-1001/afix; until [ -f $D/impl.done ]; do sleep 30; done; tail -40 $D/impl.log" completed (exit code 0)</summary> </task-notification>

Attributed to this commit: 12.6 g CO₂e (1,319,634 tokens). This is an attribution, not a measurement — usage counted from this commit's own marker forward to the next one on agent-start-demo-analytics-fix, never backward from it. A turn that produced more than one commit books all of its tokens to the last one, and a concurrent session on this branch can add to the same figure. Some of it was priced using the shared default rate, because no model-specific factor row exists yet for at least one model involved. The Carbon view has the repo total, which is never derived from this attribution.

diff --git a/docs/superpowers/notes/census-agent-start-demo-analytics-fix-claims.md b/docs/superpowers/notes/census-agent-start-demo-analytics-fix-claims.md
new file mode 100644
index 000000000..fd1e344c1
--- /dev/null
+++ b/docs/superpowers/notes/census-agent-start-demo-analytics-fix-claims.md
@@ -0,0 +1,5 @@
+# Census claims: agent-start-demo-analytics-fix
+# Author claims only. Envelope review map: internal/analytics day.go:186-190 UpsertDay returns nil for tmp-demo- apps before any store I/O (drops writes only);
+# internal/edge analytics.go:54-65 analyticsEnabled refuses demo routes/reserved demo hosts (reads demo config already loaded, no new I/O).
+internal/edge/analytics.go:Edge.observeAnalytics analytics.go:121 also refuses requests whose Host is a reserved demo name (demoAuthority/demoReserved over already-loaded demo config); only suppresses an observation, no new read, open or follow.
+internal/edge/analytics.go:Edge.analyticsEnabled analytics.go:61-63 returns false for rt.IsDemo() or a reserved demo route Host (new read registry:Host, compared against already-loaded demo config); can only disable analytics, opens or follows nothing.
diff --git a/docs/superpowers/notes/census-proposal-agent-start-demo-analytics-fix.md b/docs/superpowers/notes/census-proposal-agent-start-demo-analytics-fix.md
new file mode 100644
index 000000000..8de6a6aa1
--- /dev/null
+++ b/docs/superpowers/notes/census-proposal-agent-start-demo-analytics-fix.md
@@ -0,0 +1,23 @@
+# Census approval: agent-start-demo-analytics-fix
+
+Ruling `census-ruling-agent-start-demo-analytics-fix`. The independent reviewer approves or rejects every change below, 1 with a new disposition; nothing goes to the census owner (Paul, #280, 2026-10-26).
+
+| unit | change | read sites | what changed |
+|---|---|---|---|
+| `internal/edge/analytics.go` `Edge.observeAnalytics` | body | unchanged (4) | analytics.go:121 also refuses requests whose Host is a reserved demo name (demoAuthority/demoReserved over already-loaded demo config); only suppresses an observation, no new read, open or follow. |
+
+Envelopes re-pinned: `internal/analytics`, `internal/edge`.
+
+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. Reject 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. A rejected unit goes back to the author to correct; nothing escalates to the census owner.
+
+Recorded dispositions, which each change must still satisfy:
+
+- `internal/edge/analytics.go` `Edge.observeAnalytics`: legacy, task accepted-legacy. Basis: accepted-legacy;rev3=J1;basis=root-route
+
+New dispositions, which census-propose wrote and the reviewer checks against the unit's reads and the diff:
+
+- reads `internal/edge/analytics.go:Edge.analyticsEnabled`: +registry:Host; keeps legacy, task accepted-legacy
+
+Seal: `6462853d58331c23d0b2f9ee3b52ccec5198b061d864cc97ba6e7b931017f02a` → `82c82c7f6ed4cf81b76761ea2e1fba73db8569a1a4217ac5da9b15dc34e8b8d7`.
+
+Overlay: `internal/provision/testdata/plan14-root-reads-agent-start-demo-analytics-fix.tsv`, appended to `internal/provision/testdata/plan14-root-reads-chain.tsv`.
diff --git a/internal/provision/testdata/plan14-root-reads-agent-start-demo-analytics-fix.tsv b/internal/provision/testdata/plan14-root-reads-agent-start-demo-analytics-fix.tsv
new file mode 100644
index 000000000..6679b68bf
--- /dev/null
+++ b/internal/provision/testdata/plan14-root-reads-agent-start-demo-analytics-fix.tsv
@@ -0,0 +1,9 @@
+# Census overlay agent-start-demo-analytics-fix, written by census-propose (#369). census-ruling-agent-start-demo-analytics-fix, approved on #280 before the merge; the approval card is docs/superpowers/notes/census-proposal-agent-start-demo-analytics-fix.md.
+# 1 body, 0 sites, 2 envelope: each changed unit re-frozen at its existing disposition with its claim appended.
+# 1 new dispositions: 1 reads re-frozen at their disposition with the claim, 0 new units frozen accepted-legacy, 0 quiet units retired while they read nothing, 0 other.
+@legacy 2bcff30e91a8d322243f24e9a53d1d283dac0fcd52653eff5fa5542fdc9e290b internal/edge/analytics.go Edge.observeAnalytics legacy accepted-legacy accepted-legacy;rev3=J1;basis=root-route;rev3=census-ruling-agent-start-demo-analytics-fix;basis=analytics.go:121 also refuses requests whose Host is a reserved demo name (demoAuthority/demoReserved over already-loaded demo config); only suppresses an observation, no new read, open or follow. registry:App@776,registry:Host@790,whole:Route@173,whole:Route@766 e208b314c285d2c7f761e7d89357ec3226a68d8c774c588a720e3bf43fc9dca5
+@legacy 4342df0fc2892ee0f3e805e6ea715e29b7ca505b159b0f44586ec2344754981c internal/edge/analytics.go Edge.analyticsEnabled legacy accepted-legacy accepted-legacy;rev3=J1;basis=root-route;rev3=census-ruling-agent-start-demo-analytics-fix;basis=analytics.go:61-63 returns false for rt.IsDemo() or a reserved demo route Host (new read registry:Host, compared against already-loaded demo config); can only disable analytics, opens or follows nothing. registry:App@231,registry:Host@100,whole:Route@223 d23302b3adeb4e5f45d2637d87212f56a714c39b09106419a473d9abc50e499c
+internal/edge/analytics.go Edge.observeAnalytics legacy accepted-legacy accepted-legacy;rev3=J1;basis=root-route;rev3=census-ruling-agent-start-demo-analytics-fix;basis=analytics.go:121 also refuses requests whose Host is a reserved demo name (demoAuthority/demoReserved over already-loaded demo config); only suppresses an observation, no new read, open or follow. registry:App@776,registry:Host@790,whole:Route@173,whole:Route@766 e208b314c285d2c7f761e7d89357ec3226a68d8c774c588a720e3bf43fc9dca5
+internal/edge/analytics.go Edge.analyticsEnabled legacy accepted-legacy accepted-legacy;rev3=J1;basis=root-route;rev3=census-ruling-agent-start-demo-analytics-fix;basis=analytics.go:61-63 returns false for rt.IsDemo() or a reserved demo route Host (new read registry:Host, compared against already-loaded demo config); can only disable analytics, opens or follows nothing. registry:App@231,registry:Host@100,whole:Route@223 d23302b3adeb4e5f45d2637d87212f56a714c39b09106419a473d9abc50e499c
+@coverage internal/analytics 77d44b75df70a60062f3a84c785862352dc04bc0815f08d5d86f460c3e19eeb4
+@coverage internal/edge 412eaa7944e0321f2adef804a9d4a3e680b060db6f6aca216d00f6802a95edac
diff --git a/internal/provision/testdata/plan14-root-reads-chain.tsv b/internal/provision/testdata/plan14-root-reads-chain.tsv
index 2b6a09fb9..7a5d32e1f 100644
--- a/internal/provision/testdata/plan14-root-reads-chain.tsv
+++ b/internal/provision/testdata/plan14-root-reads-chain.tsv
@@ -98,3 +98,4 @@ plan14-root-reads-region-ha-p3b2.tsv 1b5ef39b210f3c7db69e589da8a467ac4d4a4f218e1
plan14-root-reads-region-ha-p1b3b-s.tsv 05f08edeb46837a18f1abca302ad21d8c7782edef8af00cc4082f5ed4ea35ad6
plan14-root-reads-region-ha-g2-t8.tsv 05f08edeb46837a18f1abca302ad21d8c7782edef8af00cc4082f5ed4ea35ad6
plan14-root-reads-region-ha-g2-t3.tsv 6462853d58331c23d0b2f9ee3b52ccec5198b061d864cc97ba6e7b931017f02a
+plan14-root-reads-agent-start-demo-analytics-fix.tsv 82c82c7f6ed4cf81b76761ea2e1fba73db8569a1a4217ac5da9b15dc34e8b8d7