Skip to content

feat(wizard-ci): full e2e via control plane (--e2e) + replay (--replay)#2012

Draft
gewenyu99 wants to merge 1 commit into
mainfrom
wizard-e2e-control-plane
Draft

feat(wizard-ci): full e2e via control plane (--e2e) + replay (--replay)#2012
gewenyu99 wants to merge 1 commit into
mainfrom
wizard-e2e-control-plane

Conversation

@gewenyu99

Copy link
Copy Markdown
Contributor

Adds --e2e and --replay to the existing wizard-ci, as a complement to classic --ci (which runs the agent under LoggingUI and exits — no interactive screens, only ANSI stdout to grep). --e2e drives the whole flow headlessly through the wizard-ci-tools control plane and asserts on structured state.

pnpm wizard-ci basic-integration/javascript-node/express-todo --e2e
pnpm wizard-ci --replay /tmp/wizard-e2e-express-todo.recording.json   # Enter ▸ step

Core files

  • services/wizard-ci/e2e.ts — the orchestration + assertion layer.
    • runE2e(): copies the app to /tmp (never the real fixture); strips host CLAUDE*/ANTHROPIC* env so the spawned agent auths with the phx key instead of deferring to the host (the apiKeySource: none → 401 trap when run from inside a Claude Code session); passes the scoped --project-id; applies the happy-path policy (skip MCP + Slack, delete skills, continue past health-check issues); spawns the wizard repo's headless harness; then asserts the structured result — runPhase=completed, posthog dep / .env written, flow reached keep-skills, skillsComplete.
    • replayRecording(): shells to the wizard repo's terminal replayer.
  • services/wizard-ci/index.ts — wires --e2e (positional app, --project-id, --keep-skills) and --replay (--step / --delay <ms>) into the CLI + --help.

Why

--ci can't answer interactive prompts, skips the post-agent screens, and only offers stdout. The control plane drives every decision through the same store setters the real UI uses and asserts on structured state — same agent, full coverage, robust assertions. Validated end-to-end on express-todo (Node) and 15-app-router-todo (Next.js): both real integrations, ✓ E2E PASS.

Depends on

The engine (store + driver run in-process with the wizard): PostHog/wizard companion PR adding src/lib/ci-driver/ + the headless harness. Set WIZARD_PATH to the wizard repo.

🤖 Generated with Claude Code

Adds two modes to the existing wizard-ci, as an alternative to classic --ci
(LoggingUI: agent-only, stdout-grep). --e2e drives the WHOLE interactive flow
headlessly through the wizard-ci-tools control plane and asserts on structured
state; --replay plays a recorded run back in the terminal.

Core files:
- services/wizard-ci/e2e.ts — runE2e(): /tmp app-copy isolation, env hygiene
  (strips host CLAUDE*/ANTHROPIC* so the spawned agent auths with the phx key
  instead of deferring to the host), scoped --project-id, the happy-path policy
  (skip mcp+slack, delete skills, continue past health issues), spawns the
  wizard repo's headless harness, then asserts the structured result
  (runPhase=completed, posthog dep/.env, reached keep-skills, skillsComplete).
  replayRecording(): shells to the wizard repo's terminal replayer.
- services/wizard-ci/index.ts — wires --e2e (positional app, --project-id,
  --keep-skills) and --replay (--step/--delay) into the CLI + --help.

Engine lives in the wizard repo (store + driver must run in-process); point
WIZARD_PATH at it. See PostHog/wizard PR for src/lib/ci-driver + harness.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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