| new file mode 100644 |
| index 000000000..86312d52d |
| --- /dev/null |
| +++ b/docs/superpowers/reviews/CODEX-FINDINGS-analytics-agents-R1.md |
| @@ -0,0 +1,24 @@ |
| +Reviewed `origin/main...9e23ed3099` under the brief at `52e3ce5f`. No P1 findings. |
| + |
| +1. **P2 — Named bots are counted as people.** |
| + [agents.go:15](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/analytics-agents/internal/analytics/agents.go:15) names Google InspectionTool, ChatGPT-User, Claude-User and Meta ExternalAgent, but `IsPageview` first requires `IsBot`, whose markers omit them. Verified: each returns a bot name yet produces `pageview=true, bot=false`. Their requests inflate visitors and page-view breakdowns instead of their named bot counts. |
| + **Fix:** Make named-bot recognition part of `IsBot`, and test classification through `Observe`. |
| + **Fault family:** Consistency between bot recognition, naming and counting. |
| + |
| +2. **P2 — Overflow is incorrectly grouped as a top-level page.** |
| + At [analyticsdisplay.go:571](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/analytics-agents/internal/console/analyticsdisplay.go:571), the singleton-folder condition also matches `_other`. Verified with `/blog/a:1, _other:100`: “Top level” becomes the first section, reporting one page and 100 views. The intended separate, last overflow section disappears. |
| + **Fix:** Exclude `analytics.OtherKey` from singleton-folder folding; add an overflow grouping witness. |
| + **Fault family:** Overflow represents unattributed mass, not a page or folder. |
| + |
| +3. **P2 — Backward timestamps can prematurely release a flagged crawler.** |
| + [pace.go:64](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/analytics-agents/internal/analytics/pace.go:64) replaces `last` unconditionally. Verified: flag a visitor at noon, observe an out-of-order timestamp at 11:00, then observe 12:00:01. The visitor becomes unflagged because the hold calculation uses 11:00. |
| + **Fix:** Keep the latest timestamp monotonically increasing for hold expiry and pruning; define and test backward-time window handling separately. |
| + **Fault family:** The crawler hold lasts until 30 minutes after the latest observation. |
| + |
| +The heuristic can flag genuine reload/tab bursts and is easily evaded by changing UA or staying below the threshold. Declared prefetches are excluded. Midnight changes the visitor hash and starts fresh pace state; salt failure bypasses detection. Those are v1 limitations, not additional findings. |
| + |
| +Targeted analytics tests and server-free console tests passed. Additional witnesses ran through memory-only Go overlays; no files were edited. Console integration tests were blocked by the sandbox’s socket restriction, so their runtime behavior remains unverified. An external working-tree edit to the Bots sentence was left untouched. |
| + |
| +**Census: APPROVE** the `internal/analytics` envelope re-pin. The changed functions add counting and classification state without introducing root read paths or weakening checks on existing reads. No individual units receive new dispositions. |
| + |
| +**READY AFTER FIXES** |
| \ No newline at end of file |