Repository navigation
fix(mcp): send no standalone $identify and put $set on $exception - #390
lucasheriques wants to merge 2 commits into
Conversation
sdk-specs "Person identity": the SDK SHALL NOT send a standalone $identify event, and sends the resolved identity as $set on every event. - Identity.resolve returns the identity only; the $identify event, its change detection, and EventType::IDENTIFY are gone. The public Event::IDENTIFY constant stays. - $exception now carries $set, like the event it accompanies. Tested: bundle exec rspec (2635 examples, 0 failures; person_identity_spec failed 2 of 3 first), rubocop clean, rake public_api:check passes.
Tested: bundle exec rspec spec/posthog/mcp (no failures).
|
@PostHog review |
|
@lucasheriques PostHog Review is reviewing this pull request. |
PR overviewNo security issues were found in this pull request. Reviews
|
posthog-ruby-sync Compliance ReportDate: 2026-11-25T19:39:19.896723+00:00 ✅ All Tests Passed!47/47 tests passed Capture Tests✅ 30/30 tests passed View Details
Feature_Flags Tests✅ 17/17 tests passed View Details
|
posthog-ruby-async Compliance ReportDate: 2026-11-25T19:39:27.615983+00:00 ✅ All Tests Passed!47/47 tests passed Capture Tests✅ 30/30 tests passed View Details
Feature_Flags Tests✅ 17/17 tests passed View Details
|
There was a problem hiding this comment.
Approved.
The analytics write-path changes have independent assurance from a current-head review with no findings. No unresolved substantive concerns or other refusal grounds were found.
- Author wrote 8% of the modified lines and has 8 merged PRs in these paths (familiarity MODERATE).
- PostHog Review (Standard) reviewed the current head: no findings.
- posthog[bot] reviewed the current head.
Gate mechanics and policy version
| Gate | Result | |
|---|---|---|
| prerequisites | ✓ | all clear |
| deny-list | ✓ | no deny categories matched |
| every_file_attested | ✓ | not a bot PR |
| size | ✓ | 112L, 4F substantive, 253L/11F incl. docs/generated/snapshots — within ceiling |
| tier | ✓ | T1-agent / T1d-complex (253L, 11F, cross-cutting, fix) |
| stamphog 2.9.1 | .stamphog/policy.yml @ a6edfac · reviewed head a6edfac |
SDK performance: posthog-rubyBenchmarks completed. No changes flagged for review. Flags require at least a 5% change in the median and all six pairs agreeing on direction. This is a noise filter, not proof of a performance change or a CI gate. View all results
Values are medians of paired measurements. Not flagged does not mean unchanged. Unavailable means a measurement could not be provided, not zero. Estimated allocation measurements retain their instrumentation uncertainty. RSS measures the whole process, not just SDK allocations; observed peaks are sampled checkpoints. Paired ranges in the diagnostics describe variability, not confidence intervals. Each shard uses its own runner; compare Before PR against With PR within a row, not across shards. Compared 102 metric rows; 102 rows shown in all results. Omitted or shortened data remain in |
💡 Motivation and Context
Stacked on #389. The sdk-specs "Person identity" requirement says the SDK "SHALL NOT send a standalone
$identifyevent", and that it sends identity properties as$seton every event.PostHog::MCPsent$identifywhenever a session's identity changed, and its$exceptionevents carried no$set.What changed
Identity.resolvereturns the resolved identity only. The$identifyevent, its change detection and the internalEventType::IDENTIFYare gone. The publicEvent::IDENTIFYconstant stays, so the public API is unchanged.$exceptioncarries$setlike the event it accompanies.💚 How did you test it?
spec/posthog/mcp/person_identity_spec.rbruns the spec's "An identified call sends no $identify" scenario, with$setchecked on both$mcp_tool_calland$exception. It failed first. Specs that asserted$identifyare updated.bundle exec rspec: 0 failures.rubocopandrake public_api:checkpass.📝 Checklist
If releasing new changes
pnpm changesetto generate a changeset file🤖 Agent context
Autonomy: Human-driven (agent-assisted)
Claude Code (Opus) found this gap in a spec-alignment audit of #386 and checked it against sdk-specs main. It wrote the fix test-first. The pre-PR gate ran over the whole stack: /simplify, a comment pass, and an adversarial review by Opus and Sonnet. Every verified finding is fixed here with a test.