Track agent work cycles and invitation onboarding in PostHog
Record agent connection, task take, accepted agent push, and landed task work. A person landing a task-linked pull request is the activation event. Send invitation signups and namespace joins as account events. Pass the queue context through push processing so push merges are captured. Plannotator review returned no changes requested. All 104 tests, typecheck, production build, and diff checks pass.
4 decisions
Treat a person merging a task-linked pull request as the activation event work.landed.
Why
- Activation requires a human-reviewed agent work cycle
- A merge by a person is the review outcome refs records
Assumes
- Task-linked pull requests carry agent work; join with agent events on repo_id and task_number to confirm
Touches
analytics.tsindex.tspushes.ts
Send work.landed for push merges only when a person pushed, and once per pull request.
Why
- Sweep-found merges have no known person
- Queue retries skip pull requests that are already merged
Touches
pushes.tsmain.ts
Carry repo_id and task_number on work events, without namespace_id or agent runtime names.
Why
- The web merge path has no namespace in scope; repository events link repo_id to its namespace
- Clients set runtime names, so they are not an allowlisted value
Touches
analytics.tssessions.tsproduct-analytics.md
Send invitation onboarding as account events, with member.joined for both new and existing accounts.
Why
- Invitation signups skip the waitlist and need their own entry path
- A namespace join is team-adoption evidence, not proof of team use
Touches
analytics.tsindex.ts