Skip to content

fix(integration): known-good insight payloads in the dashboard step + soften event-plan cleanup#214

Merged
gewenyu99 merged 1 commit into
mainfrom
posthog-code/dashboard-payload-examples
Jul 7, 2026
Merged

fix(integration): known-good insight payloads in the dashboard step + soften event-plan cleanup#214
gewenyu99 merged 1 commit into
mainfrom
posthog-code/dashboard-payload-examples

Conversation

@gewenyu99

Copy link
Copy Markdown
Collaborator

Items 6 (partial) and 8 from the wizard's 2026-07-07 triage (PostHog/wizard@eebc04a). Both changes are in integration/references/4-conclude.md, the single source shared by every framework variant.

1. Known-good insight payloads in the dashboard step

Agents build the first dashboard by trial and error (~7 remarks/week across both harnesses): TrendsQuery.breakdown rejected (the accepted shape is breakdownFilter.breakdowns), funnelWindowInterval/funnelWindowIntervalUnit rejected at the FunnelsQuery top level or as snake_case (they're camelCase inside funnelsFilter), and guessed trendsFilter.display values (ActionsBarChart → invalid).

The dashboard step now pastes two complete insight-create payloads — both verified against the live MCP (query-trends and query-funnel accepted and computed them as-is) — plus the valid display enum, and tells the agent to fix a rejected payload against the examples instead of retrying variations.

Upstream ask to make the MCP validation errors self-describing: PostHog/posthog#68944.

2. .posthog-events.json cleanup no longer demands removal

The conclude step said "Upon completion, remove .posthog-events.json." unconditionally. On the wizard's pi harness rm is fence-blocked, making this the #1 bash denial (~31/week) and a retry loop; the wizard host already deletes the file after the run. Now: update the file to match the implemented events, try removal with file tools, and if removal is blocked leave it and move on — explicitly no shell fallbacks and no retries. The anthropic path (where removal works) keeps working.

Complements PostHog/wizard#816, which adds the same guidance to the pi runtime notes wizard-side.

pnpm test (95) and pnpm build (114 skills) green.

🤖 Generated with Claude Code

… soften event-plan cleanup

Two field fixes from the wizard's 2026-07-07 triage (items 6 and 8):

1. The dashboard step now includes two known-good insight-create payloads, verified against the live MCP: a trends insight with a breakdown (breakdowns live in breakdownFilter.breakdowns — agents kept sending a top-level TrendsQuery.breakdown and getting rejected) and a conversion funnel (funnelWindowInterval/funnelWindowIntervalUnit are camelCase INSIDE funnelsFilter — agents put them at the FunnelsQuery top level or used snake_case). Also lists the valid trendsFilter.display enum, the other recurring rejection (~5 remarks/week guessed ActionsBarChart). Upstream ask to make the MCP errors self-describing: PostHog/posthog#68944.

2. The conclude step told the agent to "remove .posthog-events.json" unconditionally — on the pi harness rm is fence-blocked, making this the #1 bash denial (~31/week) and a retry loop. Now: update the file to match implemented events, try removal with file tools, and if removal is blocked leave it — the wizard host cleans it up after the run.

Generated-By: PostHog Code
Task-Id: bcb96bcb-e37f-421d-841d-738647c73b8e
@github-actions

github-actions Bot commented Jul 7, 2026

Copy link
Copy Markdown

🧙 Wizard CI

Run the Wizard CI and test your changes against wizard-workbench example apps by replying with a GitHub comment using one of the following commands:

Test all apps:

  • /wizard-ci all

Test all apps in a directory:

  • /wizard-ci basic-integration
  • /wizard-ci error-tracking-upload-source-maps
  • /wizard-ci mcp-analytics
  • /wizard-ci misc
  • /wizard-ci revenue

Test an individual app:

  • /wizard-ci basic-integration/android
  • /wizard-ci basic-integration/angular
  • /wizard-ci basic-integration/astro
Show more apps
  • /wizard-ci basic-integration/django
  • /wizard-ci basic-integration/fastapi
  • /wizard-ci basic-integration/flask
  • /wizard-ci basic-integration/javascript-node
  • /wizard-ci basic-integration/javascript-web
  • /wizard-ci basic-integration/laravel
  • /wizard-ci basic-integration/next-js
  • /wizard-ci basic-integration/nuxt
  • /wizard-ci basic-integration/python
  • /wizard-ci basic-integration/rails
  • /wizard-ci basic-integration/react-native
  • /wizard-ci basic-integration/react-router
  • /wizard-ci basic-integration/sveltekit
  • /wizard-ci basic-integration/swift
  • /wizard-ci basic-integration/tanstack-router
  • /wizard-ci basic-integration/tanstack-start
  • /wizard-ci basic-integration/vue
  • /wizard-ci error-tracking-upload-source-maps/android
  • /wizard-ci error-tracking-upload-source-maps/cicd-docker-node-raw
  • /wizard-ci error-tracking-upload-source-maps/cicd-github-actions-docker-node-raw
  • /wizard-ci error-tracking-upload-source-maps/cicd-github-actions-nested-docker-node-raw
  • /wizard-ci error-tracking-upload-source-maps/cicd-github-actions-node-raw
  • /wizard-ci error-tracking-upload-source-maps/cicd-github-actions-single-stage-docker-node-raw
  • /wizard-ci error-tracking-upload-source-maps/cicd-gitlab-node-raw
  • /wizard-ci error-tracking-upload-source-maps/cicd-monorepo-pnpm-node-react
  • /wizard-ci error-tracking-upload-source-maps/cicd-monorepo-raw-node-react
  • /wizard-ci error-tracking-upload-source-maps/cicd-ssh-vps-node-raw
  • /wizard-ci error-tracking-upload-source-maps/flutter
  • /wizard-ci error-tracking-upload-source-maps/ios
  • /wizard-ci error-tracking-upload-source-maps/next
  • /wizard-ci error-tracking-upload-source-maps/next-no-posthog
  • /wizard-ci error-tracking-upload-source-maps/node-raw
  • /wizard-ci error-tracking-upload-source-maps/node-rollup
  • /wizard-ci error-tracking-upload-source-maps/node-rollup-typescript-plugin
  • /wizard-ci error-tracking-upload-source-maps/node-webpack
  • /wizard-ci error-tracking-upload-source-maps/nuxt-3-6
  • /wizard-ci error-tracking-upload-source-maps/nuxt-4-3
  • /wizard-ci error-tracking-upload-source-maps/react-native
  • /wizard-ci error-tracking-upload-source-maps/react-vite
  • /wizard-ci error-tracking-upload-source-maps/rust
  • /wizard-ci mcp-analytics/custom-dispatcher
  • /wizard-ci mcp-analytics/typescript-sdk
  • /wizard-ci misc/quack-quack
  • /wizard-ci revenue/stripe

Results will be posted here when complete.

@gewenyu99 gewenyu99 requested a review from a team July 7, 2026 15:00

Copy link
Copy Markdown
Collaborator Author

Live validation against us.posthog.com project 2, 2026-07-07 ~15:01 UTC. Test insights soft-deleted after creation.

insight-create — trends + breakdown → accepted (id: 9889831, short_id: qX8aj8Aq)

{
  "name": "Signups by plan (wizard) — schema validation, will delete",
  "query": {
    "kind": "InsightVizNode",
    "source": {
      "kind": "TrendsQuery",
      "series": [{ "kind": "EventsNode", "event": "user_signed_up", "math": "total" }],
      "interval": "day",
      "dateRange": { "date_from": "-30d" },
      "breakdownFilter": { "breakdowns": [{ "type": "event", "property": "plan" }] },
      "trendsFilter": { "display": "ActionsBar" }
    }
  }
}

Server-normalized query echoed back:

{
  "kind": "InsightVizNode",
  "source": {
    "kind": "TrendsQuery",
    "series": [{ "kind": "EventsNode", "math": "total", "event": "user_signed_up" }],
    "interval": "day",
    "dateRange": { "date_from": "-30d", "explicitDate": false },
    "breakdownFilter": { "breakdowns": [{ "type": "event", "property": "plan" }], "breakdown_type": "event" },
    "trendsFilter": { "display": "ActionsBar", "...defaults": "..." },
    "filterTestAccounts": false,
    "version": 2
  }
}

insight-create — funnel → accepted (id: 9889836, short_id: IkQC3riX)

{
  "name": "Signup funnel (wizard) — schema validation, will delete",
  "query": {
    "kind": "InsightVizNode",
    "source": {
      "kind": "FunnelsQuery",
      "series": [
        { "kind": "EventsNode", "event": "page_viewed" },
        { "kind": "EventsNode", "event": "user_signed_up" }
      ],
      "dateRange": { "date_from": "-30d" },
      "funnelsFilter": {
        "funnelVizType": "steps",
        "funnelOrderType": "ordered",
        "funnelWindowInterval": 14,
        "funnelWindowIntervalUnit": "day"
      }
    }
  }
}

Server-normalized query echoed back:

{
  "kind": "InsightVizNode",
  "source": {
    "kind": "FunnelsQuery",
    "series": [
      { "kind": "EventsNode", "event": "page_viewed" },
      { "kind": "EventsNode", "event": "user_signed_up" }
    ],
    "dateRange": { "date_from": "-30d", "explicitDate": false },
    "funnelsFilter": {
      "funnelVizType": "steps",
      "funnelOrderType": "ordered",
      "funnelStepReference": "total",
      "funnelWindowInterval": 14,
      "funnelWindowIntervalUnit": "day",
      "breakdownAttributionType": "first_touch",
      "layout": "vertical",
      "exclusions": []
    },
    "filterTestAccounts": false
  }
}

query-funnel (compute) — same funnelsFilter shape → accepted and computed

{
  "series": [
    { "kind": "EventsNode", "event": "$pageview" },
    { "kind": "EventsNode", "event": "insight analyzed" }
  ],
  "dateRange": { "date_from": "-7d" },
  "funnelsFilter": {
    "funnelVizType": "steps",
    "funnelOrderType": "ordered",
    "funnelWindowInterval": 14,
    "funnelWindowIntervalUnit": "day"
  }
}
{ "results": [
  { "name": "$pageview", "order": 0, "count": 273310 },
  { "name": "insight analyzed", "order": 1, "count": 28964, "median_conversion_time": 10.62 }
] }

query-trends (compute) — same breakdownFilter + display shape → accepted and computed

{
  "series": [{ "kind": "EventsNode", "event": "$pageview", "math": "total" }],
  "interval": "day",
  "dateRange": { "date_from": "-7d" },
  "breakdownFilter": { "breakdowns": [{ "type": "event", "property": "$browser" }] },
  "trendsFilter": { "display": "ActionsBar" }
}
{ "results": [
  { "label": "Chrome", "count": 7303852 },
  { "label": "Safari", "count": 579330 },
  { "label": "Brave", "count": 565727 },
  { "label": "Firefox", "count": 557183 },
  { "...": "..." }
] }

@gewenyu99 gewenyu99 merged commit 14205e5 into main Jul 7, 2026
15 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.

2 participants