Skip to content

refactor: C2a — state every layer's entry and interface types - #1369

Closed
gewenyu99 wants to merge 1 commit into
posthog/functional-c1-movefrom
posthog/functional-c2a-tui
Closed

gewenyu99 wants to merge 1 commit into
posthog/functional-c1-movefrom
posthog/functional-c2a-tui

Conversation

@gewenyu99

@gewenyu99 gewenyu99 commented Sep 27, 2026 •

Copy link
Copy Markdown
Collaborator

Problem

The layers of the wizard (agent, programs, shared, TUI, headless, CLI, tools) have no stated surface. Program types import TUI store and screen types, hosts reach into each other's modules, and a reviewer has to read the logic to learn what one layer promises another. This PR puts every contract in front of the reader first, so the logic PR after it can be read against them.

Changes

This PR adds and edits interface files only: each layer's one entry and the types other layers use. No behavior lives here. It compiles only together with #1313, which adds the modules these entries name.

  • Entries, one per layer: src/cli/index.ts (runCli), src/headless/index.ts (runHeadless, HeadlessLaunch), src/tui/index.ts (runTui, runTuiTool, renderFamilyPicker, runPlayground, createTuiTarget, tuiProgramFlow, and the screen ids AuditScreenId, SourceMapsScreenId, PostHogIntegrationScreenId, SelfDrivingScreenId), src/tools/index.ts (TOOL_REGISTRY, Tool, getTool), and a wider src/programs/index.ts (runProgram, SessionStore, ProgramAbort, PROGRAM_REGISTRY).
  • Program run contract: ProgramInput, ProgramStep, ProgramWorkflowConnector, ProgramOptions, ProgramProgress, ProgramRunOutcome in src/programs/program-input.ts, and ProgramSession in src/programs/program-session.ts.
  • ProgramConfig names no TUI code: it gains runSteps (ProgramRunStep), binding, commandAliases and healthCheck, and drops steps, getContentBlocks and getTips.
  • TUI program and tool shapes: TuiProgram and TuiPrograms in src/tui/programs/types.ts, TuiTool and TuiToolContext in src/tui/tools/types.ts, TuiLaunch and TuiToolLaunch in src/tui/launch.ts, ScreenId and Overlay in src/tui/screen-ids.ts.
  • Tool ids: ToolId and ToolConfig in src/tools/types.ts.
  • Shared leaf types: ControlTarget, ControlState, ControlAction and ControlSetter in src/shared/control/types.ts, OutroData and OutroKind in src/shared/outro.ts, RunOutcome, RunPhase, ScanConsent and McpOutcome in src/shared/run-state.ts, TaskStatus in src/shared/task-status.ts.
  • Agent: RunConfig takes routing (AgentRouting), ResolvedRunConfig is what the runner reads, DEFAULT_BINDING and streamMcpPrompt are on the entry.
Kind Files Lines Review
New entries and interface files 16 +755 read
Edited type files 11 +253/-375 read
Total 27 +1,008/-375 read

Stack: #1311 moves, #1369 contracts, #1313 logic, #1370 tests, #1315 fences, #1371 docs

Test plan

Created with PostHog Desktop

@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 feature-flags
  • /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 feature-flags/django
  • /wizard-ci feature-flags/next-js
  • /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.

@gewenyu99
gewenyu99 added this pull request to stack #1372 September 27, 2026 15:28
Entry and type files for the agent, programs, shared, the hosts, the CLI and tools. They compile with the next PR, which implements them.

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