Skip to content

refactor(cli): C2b — folded into C2a (empty) - #1313

Draft
gewenyu99 wants to merge 9 commits into
posthog/functional-c2a-tuifrom
posthog/functional-c2b-headless
Draft

gewenyu99 wants to merge 9 commits into
posthog/functional-c2a-tuifrom
posthog/functional-c2b-headless

Conversation

@gewenyu99

@gewenyu99 gewenyu99 commented Sep 23, 2026 •

Copy link
Copy Markdown
Collaborator

Change

Empty. Its scope (the CLI owns headless runs and abort) landed in the C2a PR, so this PR can close.

Created with PostHog Desktop

… startup

Commands and runners imported program configs, audit types, authenticate,
detection helpers and the task stream by path. They now import from
@programs and @programs/types; the task stream loads through
loadTaskStream().

The runners read TUI flows only when a run needs them (post-auth gates, the
health-check probe, the composed walk), and the family picker loads Ink
only when it opens. The bin.js startup closure drops from 310 to 288
sources: the TUI primitives and picker no longer load with every command.

Allowlist 37 -> 5.

Generated-By: PostHog Desktop
Task-Id: d14e92bb-6ee1-49b5-8502-39cb80079589
Detection hooks and headless pre-runs called wizardAbort, which exits the
process: only the CLI may do that. ProgramCiHost and ProgramReadyContext
gain abort(failure), and the posthog-integration, error-tracking and
replay-vision hooks call it. The headless runner supplies wizardAbort; the
TUI store carries the abort path the CLI hands startTUI (TuiHost), which
also installs the TUI's UI as current before the first frame, and the TUI's
login host aborts through it.

env.ts now imports nothing: the headless flag's name moves into it and
@cli/headless-mode reads it from there.

Allowlist 5 -> 4.

Generated-By: PostHog Desktop
Task-Id: d14e92bb-6ee1-49b5-8502-39cb80079589
The getUI() singleton, the WizardUI contract and wizardAbort move from
src/ui and shared utils into src/cli (ui.ts, wizard-ui.ts, wizard-abort.ts):
only CLI code looks up the current UI or exits the process. Everything else
receives a host.

The progress and interaction halves of that contract, ProgressUi and
InteractionUi, move to programs with createUiReducer and uiInteraction
(src/programs/host-ui.ts, exported from @programs). InkUI and LoggingUI
implement those halves; the CLI's setUI checks the full WizardUI where it
installs one. HeadlessUI tees into a structural HeadlessRunStateSink instead
of the TUI store type. WizardError and the cleanup registry are imported
from their owners. src/ui and the @ui alias are gone.

Allowlist 4 -> 0.

Generated-By: PostHog Desktop
Task-Id: d14e92bb-6ee1-49b5-8502-39cb80079589
@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 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.

Generated-By: PostHog Desktop
Task-Id: d14e92bb-6ee1-49b5-8502-39cb80079589

# Conflicts:
#	src/agent/runner/README.md
Merge the restacked C2a (d5145f3) into C2b. Test imports follow C2b's
moves: `getUI` comes from `@cli/ui`, and the ErrorCodes imports join
them. The runner README takes the B-layer line that says programs
resolve the binding.

Generated-By: PostHog Desktop
Task-Id: d14e92bb-6ee1-49b5-8502-39cb80079589
Merge the restacked posthog/functional-c2b-headless (480e323) and the new base (49cda16). The tree matches 480e323, where typecheck, lint and tests pass.

Generated-By: PostHog Desktop
Task-Id: d14e92bb-6ee1-49b5-8502-39cb80079589
Merge the joined C2a (9270071) into C2b. B's register-then-commit skill
cleanup now imports from C2b's modules: `@utils/cleanup-registry`,
`@cli/wizard-abort`, `@cli/ui`, and `@programs` for `detectErrorCode` and
`watchAuditLedger`. The headless renderer keeps C2b's exported
`HeadlessRunStateSink`. The scanner allowlist stays empty.

Generated-By: PostHog Desktop
Task-Id: d14e92bb-6ee1-49b5-8502-39cb80079589
@gewenyu99 gewenyu99 changed the title refactor(cli): C2b CLI entries, abort as host capability refactor(cli): C2b — CLI owns headless runs and abort Sep 24, 2026
Carry the host-only B2 into C2b. The session adapter takes C2a's
runProgram call, with the run and program settings from its caller, and
keeps C2b's imports: getUI from @cli/ui, wizardAbort from
@cli/wizard-abort, createUiReducer and uiInteraction from @programs, and
the TUI flow loaded when a run needs it. host-ui.ts gains C2a's
signal-driven dismissal and the activity case. The headless sink gains
setEventPlan. The no-agent and access-token refresh tests go with their
modules; C2b implemented neither the MCP port nor a headless doctor. The
allowlist stays empty.

Generated-By: PostHog Desktop
Task-Id: d14e92bb-6ee1-49b5-8502-39cb80079589
C2a now carries the CLI-owned runner pieces (legacy adapter, task stream, login, headless UI, abort presenter). This branch keeps C2a's tree.

Generated-By: PostHog Desktop
Task-Id: d14e92bb-6ee1-49b5-8502-39cb80079589
Base automatically changed from posthog/functional-c2a-tui to posthog/functional-c1-move September 27, 2026 15:19
@gewenyu99
gewenyu99 force-pushed the posthog/functional-c2b-headless branch from fd1b0b8 to 25fc53d Compare September 27, 2026 15:24
@gewenyu99
gewenyu99 changed the base branch from posthog/functional-c1-move to posthog/functional-c2a-tui September 27, 2026 15:26
@gewenyu99 gewenyu99 changed the title refactor(cli): C2b — CLI owns headless runs and abort refactor(cli): C2b — folded into C2a (empty) Sep 27, 2026
@gewenyu99
gewenyu99 added this pull request to stack #1372 September 27, 2026 15:28
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.

1 participant