Skip to content

feat(identity): count email clicks as daily aggregates - #243

Merged
harlan-zw merged 2 commits into
chore/remove-telemetryfrom
feat/digest-click-counts
Sep 22, 2026
Merged

harlan-zw merged 2 commits into
chore/remove-telemetryfrom
feat/digest-click-counts

Conversation

@harlan-zw

@harlan-zw harlan-zw commented Sep 16, 2026 •

Copy link
Copy Markdown
Collaborator

Stacked on #240.

❓ Type of change

  • ✨ New feature

📚 Description

#240 dropped weekly_click_events because every row named a reader. That also removed the one number the ROADMAP Loop 2 evidence bar depends on: digest click-throughs. This brings the number back with nothing that names a person.

Email links go back through a redirect, /api/e/{weekly|digest}. Every recipient of an issue gets identical links. The redirect adds one to a (day, campaign, issue, placement, path) counter in migration 0120 and stores nothing else. The admin weekly report shows clicks, clicks per accepted email, and share clicks again. The daily health summary gains weekly and digest click totals.

Every placement is counted now, including the GitHub links. Liked and trending rows point at SKILL.md on GitHub, which is where a reader judges a change, and those clicks were the evidence bar's biggest gap. The link carries g, a path on GitHub, and the route puts the constant github.com origin back. No request supplies a host, so the redirect cannot be steered off GitHub: that is the same reason the same-site form takes a path and never a URL. The counter stores gh:/owner/repo, so a new commit sha does not start a new row and weeks stay comparable.

flowchart LR
  S["Weekly / digest send"] -->|"rewrite links"| L["/api/e/{campaign}?p=&i=&(to|g)="]
  R["Reader clicks"] --> L
  L -->|"+1 on (day, campaign, issue, placement, path)"| D["email_click_counts"]
  L -->|"302"| P1["skilld.dev page"]
  L -->|"302, origin is a constant"| P2["github.com/owner/repo/blob/..."]
  D --> A["Admin weekly report"]
  D --> H["Daily health summary"]
Loading

Things a reviewer should weigh:

  • The counter is per UTC day, so the health summary sums whole days from the window start rather than an exact 24 hours.
  • No retention. The purge job landed in chore(privacy): keep less personal data #241. email_click_counts could join it at 180 days; it names no account, so nothing forces that.
  • The endpoint is public, so anyone can inflate counts or add rows. Paths are capped at 512 characters. There is no rate limiting.
  • Old links from delivered emails (?p=&k=&w=&u=) still redirect and are not counted. The u value is ignored.
  • Plain text stays uncounted. Those clients show the raw URL, and a bare skilld.dev link reads better there than a redirect.

🤖 AI disclosure: Harlan Agent Kit modified this description. My AI open-source policy.

@harlan-zw
harlan-zw added this pull request to stack #245 September 16, 2026 15:09
@harlan-github-agent harlan-github-agent Bot added harlan-agent-running An Agent holds a Task on this issue or pull request right now. harlan-agent-review-required Pull request triage requires an adversarial Review for this head commit. labels Sep 16, 2026
@harlan-github-agent

harlan-github-agent Bot commented Sep 16, 2026 •

Copy link
Copy Markdown
Contributor

🤖 MERGED

Harlan Agent Kit posted this automated review. It is not Harlan's personal review or approval. AI open source policy. Last updated: 2026-09-22 08:14 UTC.

GitHub merged this pull request.

No material findings were recorded.

Review completed. No material findings.

@harlan-github-agent harlan-github-agent Bot added harlan-agent-ready The automated Review passed every gate on this head commit. and removed harlan-agent-running An Agent holds a Task on this issue or pull request right now. harlan-agent-review-required Pull request triage requires an adversarial Review for this head commit. labels Sep 16, 2026
harlan-zw added a commit that referenced this pull request Sep 16, 2026
The page described the site after #240 and #241 only. #242, #243, #244,
and #246 change CLI token labels, email click counts, like visibility,
repository indexing, and image loading, and D1 recovery keeps deleted rows
for up to 30 days.
@harlan-github-agent harlan-github-agent Bot added harlan-agent-pending The automated Review is waiting on a gate for this head commit. harlan-agent-ready The automated Review passed every gate on this head commit. and removed harlan-agent-ready The automated Review passed every gate on this head commit. harlan-agent-pending The automated Review is waiting on a gate for this head commit. labels Sep 16, 2026
@harlan-github-agent harlan-github-agent Bot added harlan-agent-running An Agent holds a Task on this issue or pull request right now. harlan-agent-blocked The automated Review found a material defect in this head commit. and removed harlan-agent-ready The automated Review passed every gate on this head commit. harlan-agent-running An Agent holds a Task on this issue or pull request right now. labels Sep 21, 2026
@harlan-github-agent harlan-github-agent Bot added harlan-agent-pending The automated Review is waiting on a gate for this head commit. harlan-agent-ready The automated Review passed every gate on this head commit. and removed harlan-agent-blocked The automated Review found a material defect in this head commit. harlan-agent-pending The automated Review is waiting on a gate for this head commit. labels Sep 21, 2026
@harlan-github-agent harlan-github-agent Bot added harlan-agent-blocked The automated Review found a material defect in this head commit. and removed harlan-agent-ready The automated Review passed every gate on this head commit. labels Sep 22, 2026
@harlan-zw
harlan-zw force-pushed the feat/digest-click-counts branch from 8242ebf to 4edd16f Compare September 22, 2026 02:29
@harlan-github-agent harlan-github-agent Bot added harlan-agent-running An Agent holds a Task on this issue or pull request right now. and removed harlan-agent-running An Agent holds a Task on this issue or pull request right now. harlan-agent-blocked The automated Review found a material defect in this head commit. labels Sep 22, 2026
harlan-zw added a commit that referenced this pull request Sep 22, 2026
The page described the site after #240 and #241 only. #242, #243, #244,
and #246 change CLI token labels, email click counts, like visibility,
repository indexing, and image loading, and D1 recovery keeps deleted rows
for up to 30 days.
@harlan-github-agent harlan-github-agent Bot added harlan-agent-running An Agent holds a Task on this issue or pull request right now. harlan-agent-ready The automated Review passed every gate on this head commit. and removed harlan-agent-running An Agent holds a Task on this issue or pull request right now. labels Sep 22, 2026
Loop 2 is judged on digest click-throughs, and #240 removed the only measure along with the per-reader click history. Links now carry the campaign, issue, placement, and path, and a daily counter stores nothing that names a reader.
Liked and trending rows link to SKILL.md on GitHub, which is where a reader
judges a change. Those were the only digest clicks left uncounted, and they
are the clearest Loop 2 evidence.

The link now carries `g`, a path on GitHub, and the route puts the constant
`github.com` origin back. No request supplies a host, so the redirect cannot
be steered off GitHub. The counter stores `gh:/owner/repo`, so a new commit
sha does not start a new row and weeks stay comparable.
@harlan-zw
harlan-zw force-pushed the feat/digest-click-counts branch from 4edd16f to aa109d7 Compare September 22, 2026 07:02
@harlan-github-agent harlan-github-agent Bot added harlan-agent-running An Agent holds a Task on this issue or pull request right now. and removed harlan-agent-ready The automated Review passed every gate on this head commit. labels Sep 22, 2026
@harlan-zw
harlan-zw merged commit 8f96865 into main Sep 22, 2026
5 checks passed
@harlan-zw
harlan-zw deleted the feat/digest-click-counts branch September 22, 2026 07:03
@harlan-github-agent harlan-github-agent Bot removed the harlan-agent-running An Agent holds a Task on this issue or pull request right now. label Sep 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant