Skip to content

feat: a website's posts on Insights, their views kept a month at a time (ADR 0069) - #61

Merged
jagdish-kumawat merged 1 commit into
mainfrom
feat/2026-11-07-posts-on-insights
Nov 7, 2026
Merged

jagdish-kumawat merged 1 commit into
mainfrom
feat/2026-11-07-posts-on-insights

Conversation

@jagdish-kumawat

Copy link
Copy Markdown
Contributor

Summary

Phase 5 of the Insights plan: a website's posts on Insights. Recorded in ADR 0069.

  • What Insights shows. A Posts highlight (the count Settings gives), the ten newest posts with their views, the most read ever, and a calendar of the last twelve months of posting. The calendar is one keyboard stop with a day, week and month key map, and is also offered as a list. Views follow People only. Each sitemap state, with the right action for owners, editors and viewers, says what is going on in plain words.
  • Views kept a month at a time. ClickHouse migration 0015_posts_read_month_by_month adds consolidated_post_months: per website and finished month, each read post's path with pages delivered to everybody and to people. It has no TTL and is purged with the website. This widens the retention envelope; ADR 0069 states it in full.
  • One statement per question. A post's views use the list-of-pages arithmetic. The store returns every delivered path of the window and the engine keeps the posts', so no post path enters a statement or a bound value.
  • Counting. MonthlyConsolidation gains a post pass of its own, run after the month totals. It follows MonthsToCount's rule held to CountingRules.Posts, plus a recount one hour after the list of posts changes (fingerprint). It deletes nothing, and a post failure leaves the totals kept.
  • Reading. GET /api/sites/{id}/insights/posts[?only=people] uses kept post months before the first month answered from its reports, and the reports from there to now. The population is checked before the website is resolved, and unknown and forbidden websites are answered identically. A website with no posts is answered without asking the telemetry store.
  • The migration. The release must back up first.

Tests

  • Free edition, every suite: Testing 11, Domain 256, Application 561, Classification 530, Architecture 32, Api 66, Sql 317, Mail 30, Integration 2,511. After the review's single-statement fix: Sql 317, Application 561, Architecture 32, and the six touched integration classes 77/77.
  • Cloud edition: Ee.Integration 206 (22 skipped, unchanged) and Ee 198; both editions compile after the fix.
  • pnpm verify: web 2,226, tracker 84, edition 124 and site 78.
  • Screens photographed in every posts state, light and dark, desktop and phone.

🤖 Generated with Claude Code

…me (ADR 0069)

Insights shows how many posts a website's sitemap lists, the ten newest with how often each was
read, the most read ever, and a calendar of the last twelve months of posting.

- ClickHouse migration 0015 adds consolidated_post_months: one row per website per finished month,
  each read post's path with its pages delivered to everybody and to people, no TTL, removed with
  the website. It widens the retention envelope, stated in full in ADR 0069.
- A post's views are the dashboard's list-of-pages arithmetic, asked as one statement per question:
  the store returns every delivered path of the window and the engine keeps the posts', so no post
  path is ever part of a statement or a bound value.
- The background service that keeps months keeps each month's posts in a pass of its own, counted
  again on the month's own terms and when the list of posts changes (after an hour), never deleting
  anything; a failing post pass leaves the month totals kept.
- GET /api/sites/{id}/insights/posts reads kept months before the first month answered from its
  reports, and the reports from there on, so a post's views are never behind the record.
- A post is credited with the path a same-site redirect landed on, unless that path is another
  listed post's own.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@jagdish-kumawat
jagdish-kumawat merged commit db74fb6 into main Nov 7, 2026
7 checks passed
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