review brief: analytics-live round 1
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
1 file changed,
+39
−0
docs/superpowers/reviews/CODEX-REVIEW-BRIEF-analytics-live.md+39 −0
CI cancelled — superseded by a newer push — run details
Intent
Attributed to this commit: 151 g CO₂e (18,803,151 tokens). This is an attribution, not a measurement — usage counted from this commit's own marker forward to the next one on analytics-live, 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-live.md b/docs/superpowers/reviews/CODEX-REVIEW-BRIEF-analytics-live.md| new file mode 100644 |
| index 000000000..eaac81923 |
| --- /dev/null |
| +++ b/docs/superpowers/reviews/CODEX-REVIEW-BRIEF-analytics-live.md |
| @@ -0,0 +1,39 @@ |
| +# Review brief: branch analytics-live, round 1 of 3 |
| + |
| +Repo carlos/platform, branch `analytics-live`, commit fa2f549501 (`git rev-parse fa2f549501` for the full sha). |
| +Under review: the diff `origin/main...fa2f549501` (internal/console only). |
| +Authorities: the console Analytics tab as merged (internal/console/analyticsview.go, analyticsdisplay.go, templates/app_analytics.html, app_overview.html), AGENTS.md (stopping rules; S3 request-cost rule: no new polling per box, state a request budget). |
| + |
| +You are an independent reviewer. Read the diff, then the code it calls, and check every claim in comments and the commit message against that code. |
| + |
| +## Fixed: do not re-argue |
| + |
| +- Paul's asks (2026-10-29): the dashboard updates itself; a bar on the Overview opens that timeframe on the Analytics tab; one tooltip at a time. The refresh is a browser poll once a minute by design (the edge writes counts every five minutes). |
| + |
| +## What to check |
| + |
| +1. The new door GET /a/{sqid}/apps/{app}/analytics/live (analyticslive.go, handleAnalyticsLive): tenant boundary (only the signed-in member's own account's app), what a signed-out or other-account request gets, caching headers, anything a crafted query (view, range, date) can make it read or render. Links it renders use r.PathValue("sqid"): any injection or open-redirect risk? |
| +2. The traffic memo now serves the live door for every view and the day view: key correctness (range, date, UTC day), staleness, memory bound, and whether a memo hit can show one app's or one account's numbers to another. |
| +3. parseAnalyticsQuery and the day view: date bounds (last 30 UTC days, today becomes the today range), the day span (whole UTC day), the memo key, dayNeighbours at the window edges, the hourly chart and insights for a past day. |
| +4. The page script (templates/app_analytics.html, "analyticsscript"): included on both pages, keyboard navigation re-initialised after a swap, refresh pausing (hidden, 30 min idle, pointer or focus inside), the X-Carlos-Live check with redirect "manual", what happens on errors, duplicate timers when both the card and the tab script are on one page. innerHTML of a same-origin answer: any way visitor-controlled strings (paths, referrers, event names, countries) reach it unescaped? |
| +5. Request budget: per open, visible, active tab one live request a minute; state what each costs (settings reads, LIST, day files) and whether anything polls with the page hidden or idle. |
| +6. CSS one-tooltip rule and link columns (a.an-col): keyboard focus, touch (a tap on a link column navigates), and that hourly charts keep buttons. |
| +7. Tests: sound witnesses (analyticslive_test.go); anything in the diff that would fail CI (darwin, windows) or break an existing test. |
| + |
| +## 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). 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/console/ -run ...` is fine. |