Skip to content

feat(signals): make an inbox visit a trigger for the first activity summary - #133442

Merged
trunk-io[bot] merged 1 commit into
masterfrom
posthog/inbox-visit-activity-summary-trigger
Nov 11, 2026
Merged

trunk-io[bot] merged 1 commit into
masterfrom
posthog/inbox-visit-activity-summary-trigger

Conversation

@posthog

@posthog posthog Bot commented Nov 11, 2026 •

Copy link
Copy Markdown
Contributor

Problem

  • A person who opens the Inbox once or twice can wait days for a personal ranking, because the ranking needs a first activity summary (#133426).

Closes #133426

Origin

  • Issues: #133426, #133427
  • Scout: a custom scout
  • First signal: 2026-11-11
  • Inbox report: open
  • Task started by: a person, from the inbox

Changes

  • A person with no summary who opened the Inbox in the window is now due on the next tick, with a new inbox_visit trigger.
  • These pairs fill a reserved share of each tick (inbox_visit_budget_share, default 0.2), paying organizations first. Unused slots go back to the normal passes.
  • A skip or an empty profile backs off as before.
  • The tick event gains due_inbox_visit.

Note

count_views is on in the live payload, so the trigger starts at deploy, inside the daily pair and cost caps.

How did you test this code?

Test rationale: New view-trigger cases cover one Inbox visit, another scene, views off and an existing summary. A new tick test fails without the reserve, the paying-first order or the unused-share return.

Release status

  • This change is behind a feature flag and is not available to users

Docs update

  • None.

🤖 Agent context

Autonomy: Human-driven (agent-assisted)

Agent: Claude Code, Claude Opus 5.5 (claude-opus-5-5)

Skills: /writing-tests, /writing-code-comments, /writing-pr-descriptions

More context for AI agents

Created with PostHog Desktop from an inbox report

🤖 Generated with Claude Code

…ummary

A pair with no summary and an Inbox scene view in the window is now due with the inbox_visit trigger. These pairs fill a reserved inbox_visit_budget_share of each tick, paying organizations first, and the unused part goes back to the normal passes. The tick event reports due_inbox_visit.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

Generated-By: PostHog Desktop
Task-Id: 140ef66d-0395-46af-bad4-ed5e1189095c
@posthog posthog Bot added the self-driving label Nov 11, 2026
@posthog
posthog Bot marked this pull request as ready for review November 11, 2026 10:21
@trunk-io

trunk-io Bot commented Nov 11, 2026 •

Copy link
Copy Markdown

😎 Merged successfully - details.

@stamphog
stamphog Bot requested a review from a team November 11, 2026 10:21
@posthog
posthog Bot requested a review from andrewm4894 November 11, 2026 10:21
@parameterai

parameterai Bot commented Nov 11, 2026 •

Copy link
Copy Markdown

Risk: No findings

This change makes an Inbox visit trigger the first activity summary for pairs with no summary, reserving a configurable share of each scheduler tick for them. It is an internal scheduler/config change with no new user-facing endpoint: the trigger subquery is correctly team- and user-scoped, the new budget share is clamped by the fail-closed config parser, and the existing per-day pair and cost caps plus skip backoff still bound any cost amplification. No security issues found.

Sentinel reviewed 64f78fa · Review settings

@github-actions

github-actions Bot commented Nov 11, 2026 •

Copy link
Copy Markdown
Contributor

🤖 CI report

⚠️ Trunk lane — backend Python lane

This PR is assigned to the backend Python lane. It runs backend Python tests and may merge in parallel with PRs in other lanes.

✅ Duplication (Python) — clean

New Python code duplication introduced by this branch. Fails at 70+ tokens in app code, or 150+ tokens when both copies live in test files. Advisory while the gate proves itself: extract a shared helper instead of copying.

✅ Duplication (TypeScript) — clean

New TypeScript code duplication introduced by this branch. Fails at 70+ tokens in app code, or 150+ tokens when both copies live in test files. Advisory while the gate proves itself: extract a shared helper instead of copying.

⚠️ Comment density — 4% of added code lines are comments (5 of 115)

This section warns when comments are more than 3% of the code lines a PR adds, and alerts above 6%. Before agent-assisted PRs, the typical share was about 2%. Only full-line comments count. Docstrings, generated files, snapshots, migrations, and workflow files are left out.

Comments that restate the code, record how the change came about, or narrate the next line add noise for the next reader. Keep the comments that explain a reason the code cannot show, and remove the rest. See .agents/skills/writing-code-comments/SKILL.md for the house rules.

Files with the most added comment lines:

File Comment lines Added lines
products/signals/backend/activity_summary/queue.py 4 56
products/signals/backend/activity_summary/config.py 1 3

This check does not block merging. It updates on every push and clears when the share drops.

@andrewm4894

Copy link
Copy Markdown
Member

/trunk merge

@trunk-io
trunk-io Bot merged commit 1840777 into master Nov 11, 2026
366 of 406 checks passed
@trunk-io
trunk-io Bot deleted the posthog/inbox-visit-activity-summary-trigger branch November 11, 2026 11:10
@deployment-status-posthog

deployment-status-posthog Bot commented Nov 11, 2026 •

Copy link
Copy Markdown

Deploy status

Environment Status Deployed At Workflow
dev ✅ Deployed 2026-11-11 11:44 UTC Run
prod-us ✅ Deployed 2026-11-11 12:06 UTC Run
prod-eu ✅ Deployed 2026-11-11 12:05 UTC Run

This table shows the posthog release only. Hogstation shows every service that this PR reaches, Kargo services included.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat(signals): make an inbox visit a trigger for the first activity summary

1 participant