Skip to content

fix(orchestrator): carry the data-source next steps onto the outro - #1234

Open
Gilbert09 wants to merge 1 commit into
mainfrom
posthog/orchestrated-outro-next-steps
Open

fix(orchestrator): carry the data-source next steps onto the outro#1234
Gilbert09 wants to merge 1 commit into
mainfrom
posthog/orchestrated-outro-next-steps

Conversation

@Gilbert09

Copy link
Copy Markdown
Member

Problem

The integration program builds an outro bullet per detected data source — a
pre-filled link to that source's new-source form, plus the wizard warehouse
command for doing them all at once. Those bullets only ever reach a user
through buildOutroData, which is the linear sequence's seam.

The orchestrated sequence doesn't use it. It composes its own outro message out
of the drain result (steps completed, steps skipped, any review conflict) and
calls setOutroData directly, with no nextSteps. So on an orchestrated run —
the only flow that seeds the warehouse step at all — the links were built and
then dropped.

That lands hardest on the runs where they matter most. When the seeded
warehouse step is declined at its notice, times out unanswered, or skips, the
step never asks anything and never hands over a link of its own; those are the
majority of runs that reach it. The user was told during the run that the
wizard found connectable sources, and then finished the run with nothing
pointing at them. The report-checklist prompt fragment is best-effort by
design, and its own comment says the outro bullet "carries the same information
deterministically" — which wasn't true on this path.

Changes

  • New optional ProgramRun.buildOutroNextSteps: the seam for a sequence that
    owns its own outro message. The sequence keeps the message, the program
    supplies the bullets.
  • The orchestrated sequence calls it when it builds the success outro, passing
    the runner-seeded task types that reached done.
  • The integration program implements it with the same builder the linear path
    uses, and returns nothing when its own warehouse step completed — otherwise a
    run that just connected the sources would end by asking the user to redo the
    work at a form that collides with the source it created. Only done counts;
    every other terminal state left the work undone.

The sequence still knows nothing about what any task type means: it reports
statuses, the program interprets them.

Test plan

  • completedSeededTypes unit tests over a real QueueStore: done is named;
    declined, agent-not-needed, failed and non-seeded tasks are not.
  • Extended the existing warehouse-suggestion tests with the orchestrated path:
    same links as the linear outro, still present when another seeded type
    completed, absent once the warehouse step completed, absent with nothing
    detected.
  • pnpm build, full unit suite (164 files / 2688 tests) and pnpm lint all
    green locally.

Created with PostHog Desktop

The integration program builds a pre-filled link per detected data source for
the outro, but only the linear sequence asks a program for its outro data. The
orchestrated sequence composes its own message from the drain result, so the
links were built and then discarded on every orchestrated run — including the
runs where the seeded warehouse step never connected anything, which is exactly
when they are the only deterministic pointer the user has left.

Adds `ProgramRun.buildOutroNextSteps`, a hook for a sequence that owns its own
outro message: the sequence keeps the message, the program supplies the
bullets. It is handed the runner-seeded task types that finished successfully,
so the integration leaves the bullets off a run whose own warehouse step
connected the sources — otherwise a successful run would end by asking the user
to redo the work at a new-source form that collides with the source just
created. The sequence stays ignorant of what any task type means.

Branch: posthog/orchestrated-outro-next-steps

Generated-By: PostHog Desktop
Task-Id: 3db08a36-bd9a-4c3d-b384-d6070267db7c
@Gilbert09
Gilbert09 requested a review from a team as a code owner September 9, 2026 12:01
Copilot AI lite review requested due to automatic review settings September 9, 2026 12:01

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@github-actions

github-actions Bot commented Sep 9, 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 ai-observability
  • /wizard-ci basic-integration
  • /wizard-ci mcp-analytics
  • /wizard-ci replay-vision
  • /wizard-ci revenue
  • /wizard-ci self-driving
  • /wizard-ci warehouse
  • /wizard-ci warehouse-seeded

Test an individual app:

  • /wizard-ci ai-observability/anthropic
  • /wizard-ci ai-observability/google-adk
  • /wizard-ci ai-observability/groq
Show more apps
  • /wizard-ci ai-observability/manual-capture
  • /wizard-ci ai-observability/openai
  • /wizard-ci ai-observability/openai-agents
  • /wizard-ci ai-observability/opentelemetry
  • /wizard-ci ai-observability/vercel-ai
  • /wizard-ci basic-integration/android
  • /wizard-ci basic-integration/angular
  • /wizard-ci basic-integration/astro
  • /wizard-ci basic-integration/django
  • /wizard-ci basic-integration/fastapi
  • /wizard-ci basic-integration/flask
  • /wizard-ci basic-integration/flutter
  • /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 mcp-analytics/custom-dispatcher
  • /wizard-ci mcp-analytics/typescript-sdk
  • /wizard-ci replay-vision/javascript-node
  • /wizard-ci replay-vision/next-js
  • /wizard-ci replay-vision/react-vite
  • /wizard-ci revenue/stripe
  • /wizard-ci self-driving/astro
  • /wizard-ci self-driving/fastapi
  • /wizard-ci self-driving/nuxt
  • /wizard-ci self-driving/react-router
  • /wizard-ci self-driving/sveltekit
  • /wizard-ci warehouse/monorepo-env
  • /wizard-ci warehouse/multi-source-next
  • /wizard-ci warehouse/stripe-node
  • /wizard-ci warehouse/zero-source
  • /wizard-ci warehouse-seeded/next-stripe
  • /wizard-ci warehouse-seeded/next-stripe-declined

Test against a Context Mill branch:

  • /wizard-ci all context-mill:my-branch

Add context-mill:<branch> to any command above to pin the Context Mill branch. It defaults to main.

Results will be posted here when complete.

@Gilbert09 Gilbert09 added the stamphog Auto-merge stamp for automated PRs label Sep 9, 2026 — with PostHog
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

stamphog Auto-merge stamp for automated PRs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants