Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
86 changes: 86 additions & 0 deletions .github/workflows/surfaces.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
name: 'Surfaces'
on:
push:
branches:
- main
pull_request:

jobs:
architecture:
name: Architecture
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1
- uses: pnpm/action-setup@eae0cfeb286e66ffb5155f1a79b90583a127a68b # v2.4.1
with:
version: 10.34.5
run_install: false
- uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
with:
node-version-file: 'package.json'
cache: 'pnpm'
- run: pnpm install --frozen-lockfile
- run: node scripts/generate-version.cjs
- run: pnpm typecheck
- run: pnpm lint
- run: pnpm test:arch

surface:
Comment on lines +10 to +29
name: ${{ matrix.project }}
runs-on: ubuntu-latest
timeout-minutes: 15
strategy:
fail-fast: false
matrix:
project: [store, agent, tui, cli, harness]
steps:
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1
- uses: pnpm/action-setup@eae0cfeb286e66ffb5155f1a79b90583a127a68b # v2.4.1
with:
version: 10.34.5
run_install: false
- uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
with:
node-version-file: 'package.json'
cache: 'pnpm'
- run: pnpm install --frozen-lockfile
- run: node scripts/generate-version.cjs
- run: pnpm test:${{ matrix.project }} --coverage
- uses: codecov/codecov-action@13ce06bfc6bbe3ecf90edbbf1bc32fe5978ca1d3 # pin@v5.3.1
with:
token: ${{ secrets.CODECOV_TOKEN }}
fail_ci_if_error: false
flags: ${{ matrix.project }}

bundle:
Comment on lines +30 to +56
name: Bundle audit
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1
- uses: pnpm/action-setup@eae0cfeb286e66ffb5155f1a79b90583a127a68b # v2.4.1
with:
version: 10.34.5
run_install: false
- uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
with:
node-version-file: 'package.json'
cache: 'pnpm'
- run: pnpm install --frozen-lockfile
- name: Production build and smoke test
run: pnpm build
- name: Production chunk manifest
run:
npx tsx scripts/chunk-manifest.no-jest.ts dist >
chunk-manifest.prod.json
- name: CI build and smoke test
run: pnpm build:ci
- name: CI chunk manifest
run:
npx tsx scripts/chunk-manifest.no-jest.ts dist >
chunk-manifest.ci.json
- uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
with:
name: chunk-manifests-${{ github.sha }}
path: chunk-manifest.*.json
Comment on lines +57 to +86
49 changes: 49 additions & 0 deletions e2e-harness/__fixtures__/control-frame-auth.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
PostHog Wizard v2.76.0 Feedback: wizard@posthog.com

PostHog Setup Wizard
✔ Framework: Node.js

Privacy & data
• Source files are read by Claude for AI context
• .env* and secrets stay on your machine
• Press [I] for full privacy & usage info

⠴ Waiting for authentication...





































I privacy & data
49 changes: 49 additions & 0 deletions e2e-harness/__fixtures__/control-frame-intro.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
PostHog Wizard v2.76.0 Feedback: wizard@posthog.com
















███ PostHog Wizard 🦔

We'll use AI to analyze your project and complete work.
Review what data is shared in "Privacy & data."
.env* values stay on your machine.

Let's do two hours of work in eight minutes.

Directory ✔ /wz-baseline-express-todo
Framework ✔ Node.js (detected)

▸ Continue
Change framework
More info
Privacy & data
Cancel















↑↓ navigate enter select
107 changes: 107 additions & 0 deletions e2e-harness/__fixtures__/control-state-baseline.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
{
"recordedFrom": "scripts/tui-host.no-jest.ts MODE=serve via scripts/wizard-ci-mcp.no-jest.ts, wizard 2.76.0",
"app": "wizard-workbench/apps/basic-integration/javascript-node/express-todo (throwaway copy, detection only, no key)",
"projectId": "228144",
"steps": [
{
"call": "open_app",
"state": {
"currentScreen": "intro",
"hasOverlay": false,
"runPhase": "idle",
"session": {
"installDir": "<APP_DIR>",
"integration": "javascript_node",
"detectedFrameworkLabel": "Node.js",
"detectionComplete": true,
"setupConfirmed": false,
"integrate": null,
"hasCredentials": false,
"projectId": null,
"mcpComplete": false,
"slackStepDismissed": false,
"skillsComplete": false,
"outroDismissed": false,
"llmOptIn": false,
"discoveredFeatures": []
},
"tasks": [],
"statusMessages": [],
"eventPlan": [],
"pendingQuestion": null,
"taskNotice": null,
"setupQuestions": [],
"actions": [
{ "id": "confirm_setup", "description": "Confirm the intro and continue (sets setupConfirmed)." }
],
"integration": "idle",
"integrationError": null
}
},
{
"call": "perform_action",
"action": "confirm_setup",
"state": {
"currentScreen": "auth",
"hasOverlay": false,
"runPhase": "idle",
"session": {
"installDir": "<APP_DIR>",
"integration": "javascript_node",
"detectedFrameworkLabel": "Node.js",
"detectionComplete": true,
"setupConfirmed": true,
"integrate": null,
"hasCredentials": false,
"projectId": null,
"mcpComplete": false,
"slackStepDismissed": false,
"skillsComplete": false,
"outroDismissed": false,
"llmOptIn": false,
"discoveredFeatures": []
},
"tasks": [],
"statusMessages": [],
"eventPlan": [],
"pendingQuestion": null,
"taskNotice": null,
"setupQuestions": [],
"actions": []
}
},
{
"call": "read_state",
"state": {
"currentScreen": "auth",
"hasOverlay": false,
"runPhase": "idle",
"session": {
"installDir": "<APP_DIR>",
"integration": "javascript_node",
"detectedFrameworkLabel": "Node.js",
"detectionComplete": true,
"setupConfirmed": true,
"integrate": null,
"hasCredentials": false,
"projectId": null,
"mcpComplete": false,
"slackStepDismissed": false,
"skillsComplete": false,
"outroDismissed": false,
"llmOptIn": false,
"discoveredFeatures": []
},
"tasks": [],
"statusMessages": [],
"eventPlan": [],
"pendingQuestion": null,
"taskNotice": null,
"setupQuestions": [],
"actions": [],
"integration": "idle",
"integrationError": null
}
}
]
}
3 changes: 2 additions & 1 deletion e2e-harness/__tests__/e2e-flow-snapshot.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import { InkUI } from '@ui/tui/ink-ui';
import { setUI } from '@ui/index';
import { buildSession, RunPhase } from '@lib/wizard-session';
import { Integration } from '@lib/constants';
import { HostResolution } from '@lib/host-resolution';
import { FRAMEWORK_REGISTRY } from '@lib/registry';
import { WizardReadiness } from '@lib/health-checks/readiness';
import {
Expand Down Expand Up @@ -89,7 +90,7 @@ function traceFlow(
store.setCredentials({
accessToken: 'phx_x',
projectApiKey: 'phc_x',
host: 'https://us.posthog.com',
host: HostResolution.fromApiHost('https://us.posthog.com'),
projectId: 1,
});
} else if (screen === ScreenId.SelfDrivingGithub) {
Expand Down
2 changes: 1 addition & 1 deletion e2e-harness/__tests__/wizard-ci-driver.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@ describe('WizardCiDriver — source-maps project pick', () => {
store.setCredentials({
accessToken: 'phx_x',
projectApiKey: 'phc_x',
host: 'https://us.posthog.com',
host: HostResolution.fromApiHost('https://us.posthog.com'),
projectId: 1,
});
}
Expand Down
7 changes: 7 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,13 @@
"fix:prettier": "prettier --write \"{lib,src,test}/**/*.ts\"",
"fix:eslint": "eslint . --cache --format stylish --fix",
"test": "pnpm build && vitest run",
"test:store": "vitest run --project store",
"test:agent": "vitest run --project agent",
"test:tui": "vitest run --project tui",
"test:cli": "vitest run --project cli",
"test:harness": "vitest run --project harness",
"test:arch": "vitest run --project architecture",
"test:goldens:update": "vitest run --project tui --project store -u",
"test:coverage": "pnpm build && vitest run --coverage",
"test:e2e": "pnpm build && ./e2e-tests/run.sh",
"test:e2e-record": "export RECORD_FIXTURES=true && pnpm build && ./e2e-tests/run.sh",
Expand Down
1 change: 1 addition & 0 deletions scripts/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ real ink render) and is driven purely by store state manipulation; a PTY parent
| **`tui-host.no-jest.ts`** | Real TUI host: `MODE=fixed` follows a profile; `MODE=serve` accepts socket commands. | `APP_DIR`, `PROJECT_ID`, key for a full run, `SNAP_CTRL`; run under a PTY, with `CONTROL_SOCK` in serve mode |
| **`tui-snapshots.no-jest.ts`** | Runs the fixed host and saves colored `SNAP_OUT/NN-<screen>.ans` frames, including within-screen progress. | `SNAP_OUT`, `APP_DIR`, `PROJECT_ID`, `POSTHOG_KEY_FILE` or `POSTHOG_PERSONAL_API_KEY` |
| **`wizard-ci-mcp.no-jest.ts`** | Stdio MCP server: `open_app`, `read_state`, `perform_action`, `render_screen`, `run_agent`. Screen output is plain text. | Spawns the host; `open_app` requires `appDir` and `projectId`, with optional `keyFile`, `apiKey`, `region` |
| **`chunk-manifest.no-jest.ts`** | Prints a structural manifest of `dist/`: per chunk, the source files it contains and the chunks it imports, hash suffixes stripped. Baselines live in `scripts/__fixtures__/chunk-manifest.{prod,ci}.json`. | A built `dist/` |
| **`wizard-ci-explore.no-jest.ts`** | `pnpm wizard-ci-explore`: opens an app, confirms setup, reads state, prints one frame, and exits. It does not run the agent. | `APP_DIR`, `PROJECT_ID`; optional `POSTHOG_KEY_FILE` |

> You usually don't call these directly — `pnpm wizard-ci-snapshots` (in
Expand Down
Loading
Loading