Repository navigation
fix(signals): merge survey answers per question in the surveys scout recipe - #116683
Merged
trunk-io[bot] merged 1 commit intoOct 14, 2026
Merged
trunk-io[bot] merged 1 commit into
trunk-io[bot] merged 1 commit into
Conversation
…recipe The surveys scout reference kept only the latest event of each submission and read answers from it. A later event that omits an earlier answer made the recipe drop that answer. The recipe now keeps the latest nonempty value of each question per submission, the same merge the responses API uses, and reads completion separately. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Generated-By: PostHog Desktop Task-Id: dab5f15d-dd9c-401a-a205-7850ca5ea961
|
😎 Merged successfully - details. |
Contributor
🤖 CI report
|
There was a problem hiding this comment.
Approved.
Contained scout-reference update with no open review concerns or identified showstoppers. The platform-attested Inbox provenance exempts the machine author from the bot-author refusal rule.
- PostHog Review (Standard) reviewed the current head: no findings.
Gate mechanics and policy version
| Gate | Result | |
|---|---|---|
| prerequisites | ✓ | all clear |
| deny-list | ✓ | no deny categories matched |
| size | ✓ | 0L, 0F substantive, 110L/1F incl. docs/generated/snapshots — within ceiling |
| tier | ✓ | T0 auto-approve: T0-deterministic (110L, 1F, single-area, fix) |
| stamphog 2.5.0 | .stamphog/policy.yml @ a08353f · reviewed head a08353f |
andrewm4894
approved these changes
Oct 14, 2026
Member
|
/trunk merge |
trunk-io
Bot
deleted the
posthog-self-driving/fixsurveys-scout-preserve-earlier-60edff
branch
October 14, 2026 06:01
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
response-querying.mdkept onlyargMax(uuid, timestamp)for each submission and read the answers from that one event.Origin
Changes
survey sentevents by submission and keeps the latest nonempty value of each question (argMaxIf(answer, timestamp, answer != '')). This is the same merge thatfetch_response_rows()in the surveys responses API uses.$survey_idfilter, theuuidfallback when$survey_submission_idis missing, and$survey_iterationas a grouping boundary.$survey_completed: false.How did you test this code?
execute-sql. It had complementary partial events, cumulative events, a changed answer, a later empty answer, and legacy events without an ID. The merge gave the expected value in each case. The old latest-event read returned empty for the later-empty case.eventswith a placeholder survey ID to confirm that it compiles.posthog/test/repo_invariants/test_signals_scout_tool_citations.pypasses, and Prettier is clean.Test rationale: This change edits only a Markdown prompt reference. No test reads the content of a scout reference, so the fixture check above stands in for a unit test.
Release status
Docs update
None. The edited file is the scout's own reference.
lazy_seedmirrors it to teams that have not changed their copy.🤖 Agent context
Autonomy: Fully autonomous
Agent: PostHog Desktop (Claude Code), claude-opus-5-5
products/surveys/backend/responses/fetch_rows.pyand did not design a new one. This keeps the scout and the product in agreement.products/surveys/backend/util.py(get_unique_survey_event_uuids_sql_subquery) unchanged, because the report scopes the fix to the scout reference.gh pr list --state open --search "survey scout response"found no PR for this defect.Created with PostHog Desktop from this inbox report.
🤖 Generated with Claude Code