Skip to content

feat(self-driving): Add the self-driving program to set up PostHog Self-driving#642

Open
sortafreel wants to merge 43 commits into
mainfrom
feat/product-autonomy
Open

feat(self-driving): Add the self-driving program to set up PostHog Self-driving#642
sortafreel wants to merge 43 commits into
mainfrom
feat/product-autonomy

Conversation

@sortafreel

@sortafreel sortafreel commented Jun 11, 2026

Copy link
Copy Markdown
Contributor

Problem

  • We didn't have a program like that

Changes

  • Now we do
  • A new self-driving command and program, gated behind its own program id. It requires the base posthog-integration flow to have run first.
  • A 8-step agent run: check access, read project state, connect GitHub, enable signal sources, offer issue-tracker integrations, configure the scout fleet, design custom scouts, write the report.
  • Its own intro screen (with prerequisite detection), a Signals-flavored set of sidebar tips, and a clean outro that links straight to the inbox.
  • Twelve extra OAuth scopes (task, integration, signal scout, a few read-only product probes, external data source, llm skill) that are requested only when this program runs.

Shared Wizard changes — all optional, nothing else is affected

  • Sidebar tips during the run. A program can supply its own tips; everyone else keeps the default set.
CleanShot 2026-06-19 at 19 13 04
  • Intro subtitle. A screen can pass its own subtitle line; unset means the usual generic copy.
CleanShot 2026-06-19 at 17 29 00
  • Outro link and "what's next". The outro can now show a link and a short next-steps list. Self-driving uses these for the inbox URL and a few inbox actions. Programs that don't set them get the outro they already have.
CleanShot 2026-06-19 at 17 29 21
CleanShot 2026-06-19 at 23 19 44
  • Per-option descriptions on multi-select questions. An option can carry a one-line explanation shown under its label. Questions without descriptions look and space identically to before.
CleanShot 2026-06-19 at 15 38 37
  • Clickable, copyable links in questions. Opt in with richLinks and long URLs render as terminal hyperlinks (with a clipboard fallback) instead of wrapping into garbage. Off by default, so other prompts are untouched.
CleanShot 2026-06-19 at 16 01 56

Test plan

@github-actions

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 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/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 misc/quack-quack
  • /wizard-ci revenue/stripe

Results will be posted here when complete.

sortafreel commented Jun 11, 2026

Copy link
Copy Markdown
Contributor Author

sortafreel and others added 12 commits June 11, 2026 16:22
…ons is reachable

evaluateAskCap rejected every call once askCallCount reached
ASK_BATCH_THRESHOLD (3), and the rejected call never advanced the
counter — so the nudge repeated forever and any maxQuestions above 3
was unreachable. Track the nudge in the server closure and pass it to
evaluateAskCap so the batch-your-questions error fires exactly once,
after which sequential asks proceed up to the real cap.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
New skill-based program that sets up PostHog Product Autonomy
(Signals) for an already-onboarded project. The agent runs the
context-mill product-autonomy-setup skill to enable the right signal
sources, require the GitHub integration, confirm org AI-data-processing
approval, and materialize + tune the scout fleet, then writes
posthog-product-autonomy-report.md.

- detect step requires posthog-setup-report.md; custom intro screen
  renders the typed detect errors
- scope additions: task:read/write (signal source configs live under
  the task scope object), integration:read, signal_scout:read/write
- requestDeepLink learns optional {purpose, path} so postRun can mint
  an inbox deep link for the outro
- no keep-skills step: the transient setup skill is removed in postRun
- .gitignore re-includes src/lib/ so user-global lib/ ignore patterns
  cannot silently drop program sources from commits

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@sortafreel sortafreel force-pushed the wizard/add-logs-fix-local-rins branch from 9fcc815 to 6f1c211 Compare June 11, 2026 14:22
@sortafreel sortafreel force-pushed the feat/product-autonomy branch from 2d86ad7 to af15908 Compare June 11, 2026 14:22
@sortafreel sortafreel changed the base branch from wizard/add-logs-fix-local-rins to graphite-base/642 June 11, 2026 14:25
@sarahxsanders

Copy link
Copy Markdown
Collaborator

hey @sortafreel!! just a heads up, once the CLI overhaul merges tomorrow AM you're gonna hit a bin.ts conflict when you rebase. it rewrites the .use() command chain and tweaks command.ts.

resolution should be straightforward, just re-add your import { autonomyCommand } and .use(autonomyCommand) to the new chain. your command itself needs no changes: autonomyCommand is a flat Command and the overhaul only added optional fields to the interface, so it stays compatible :)

Comment thread src/lib/oauth/program-scopes.ts
Comment thread src/lib/oauth/program-scopes.ts
Comment thread src/ui/tui/primitives/link-helpers.ts
Comment thread src/ui/tui/screens/WizardAskScreen.tsx
Comment thread src/lib/programs/self-driving/detect.ts Outdated
Comment thread src/lib/programs/self-driving/prompt.ts
Comment thread src/ui/tui/primitives/LinkText.tsx
Comment thread src/lib/programs/self-driving/index.ts
Comment thread src/lib/programs/self-driving/index.ts
Comment thread src/lib/programs/self-driving/index.ts
Comment thread src/lib/agent/agent-runner.ts Outdated
Comment thread src/ui/tui/primitives/link-helpers.ts
Comment thread src/ui/tui/screens/RunScreen.tsx
Comment thread src/lib/programs/self-driving/prompt.ts
Comment thread src/utils/provisioning.ts
Comment thread src/lib/wizard-tools.ts
Comment thread src/lib/programs/self-driving/steps.ts
@sortafreel sortafreel changed the title (DONT-REVIEW-YET) feat(self-driving): Add the self-driving program to set up PostHog Self-driving feat(self-driving): Add the self-driving program to set up PostHog Self-driving Jun 19, 2026

@gewenyu99 gewenyu99 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Pretty isolated so I'd be fine if this shipped. I'm gonna come back Monday and review the copy writing more carefully, but that can be a fast follow PR as well

text: string;
}

export const LinkText = ({ text }: LinkTextProps) => {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Long links will most certainly explode on many terminals.

We tend to use a button mapped menu and call opn on links.

It might be a better experience to just do that.

@@ -0,0 +1,84 @@
/**
* Link-rendering helpers for terminal prompts.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Again links are likely to explode. Unless super necessary, I suggest hiding links behind buttons that call opn but if this is necessary, just make sure they display entirely on their own block and have full width so they copy correctly.

@sortafreel sortafreel requested a review from a team June 19, 2026 23:00
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.

4 participants