review brief: analytics-agents (with analytics-pages) round 1
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
1 file changed,
+38
−0
docs/superpowers/reviews/CODEX-REVIEW-BRIEF-analytics-agents.md+38 −0
CI cancelled — superseded by a newer push — run details
Intent
Attributed to this commit: 399 g CO₂e (51,354,432 tokens). This is an attribution, not a measurement — usage counted from this commit's own marker forward to the next one on analytics-agents, 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/reviews/CODEX-REVIEW-BRIEF-analytics-agents.md b/docs/superpowers/reviews/CODEX-REVIEW-BRIEF-analytics-agents.md| new file mode 100644 |
| index 000000000..f2dd1169e |
| --- /dev/null |
| +++ b/docs/superpowers/reviews/CODEX-REVIEW-BRIEF-analytics-agents.md |
| @@ -0,0 +1,38 @@ |
| +# Review brief: branches analytics-pages and analytics-agents, round 1 of 3 |
| + |
| +Repo carlos/platform, branch `analytics-agents` at commit 9e23ed3099 (`git rev-parse 9e23ed3099`). It is stacked on `analytics-pages` (08a205a0), which lands first; review the whole diff `origin/main...9e23ed3099`. |
| +Authorities: the analytics edge counting and console tab on main (internal/analytics, internal/console/analytics*.go, templates/app_analytics.html), AGENTS.md (stopping rules; S3 request-cost rules; census). |
| + |
| +You are an independent reviewer. Read the diff, then the code it calls, and check every claim in comments, commit messages and page text against that code. |
| + |
| +## Fixed: do not re-argue |
| + |
| +- Paul (2026-10-30): Top pages capped at 25 with a "See all" pages view; Named events removed until carlos.js exists; bots by name and browser families; behavioural crawler detection ("seems like it would be useful anyway"). No raw user agent is stored, only names from fixed lists. |
| + |
| +## What to check |
| + |
| +1. The pace check (internal/analytics/pace.go, Meter.Observe): correctness of the window, hold and reset; that a flagged view is removed from page views, visitors, pages, referrers, countries, browsers and devices and counted as a bot; memory bound and pruning; behaviour across midnight (the visitor hash changes with the day's salt), with no salt, with clock skew (o.When going backwards), and with many apps. Can a real reader be flagged (20 page views in a minute: SPAs with prefetch, reloads, tabs)? Can a crawler evade it trivially, and is that acceptable for v1? |
| +2. Bot naming, browser family and device class (agents.go): ordering mistakes (Edge/Opera/Samsung contain Chrome; Chrome contains Safari; Android tablets), and that only fixed names reach the day file. |
| +3. Day file compatibility: new fields are additive and omitempty; a day written by an older edge, a newer edge's day read by an older console, merge bounds. |
| +4. The pages view (analyticsview.go, analyticsdisplay.go buildPageSections, analyticslive.go query parsing): per-day page counts kept only for the pages view and stripped before the memo otherwise; memo key includes the view; section grouping rules; links (html/template escaping in hrefs); the live refresh keeping filter text and open groups. |
| +5. Census: docs/superpowers/notes/census-proposal-analytics-agents.md re-pins the internal/analytics envelope. Answer its review question (approve or reject, with the reason). |
| +6. Tests: sound witnesses; anything that would fail CI (darwin, windows) or break an existing test; whether other packages' tests that send many requests from one client could now trip the pace check. |
| +7. Page text: only report text that states something false. |
| + |
| +## Severity |
| + |
| +- **P1**: unsafe, would not compile, a test fails, or it would not work. Blocks merge. |
| +- **P2**: wrong or missing. Fixed without reopening this review. |
| +- **P3**: clarity or polish. Goes on a follow-up list; never a reason for another round. |
| + |
| +A P1 states its failure scenario and the evidence (file:line). Do not raise a P2 to P1 to keep the review open. |
| + |
| +## Output |
| + |
| +Findings ranked P1, P2, P3. Each gives the area, the problem, the evidence (file:line, verified), the failure scenario, a concrete fix and the invariant or trust boundary it breaks (its fault family). Then the census verdict. End with exactly one verdict: |
| + |
| +- **READY**: no P1 and no P2. |
| +- **READY AFTER FIXES**: no P1. The listed P2s are fixed without another round. |
| +- **NOT READY**: one or more P1s, listed. |
| + |
| +Do not edit files. Do not spawn Anthropic-model reviewers or subagents of your own. Do not run the full test suites; targeted `go test ./internal/analytics/ ./internal/console/ -run ...` is fine. |