Skip to content

chore(test): baselines and per-surface test projects for the functional stack (P0) - #1288

Merged
gewenyu99 merged 9 commits into
mainfrom
posthog/functional-p0-baselines
Sep 21, 2026
Merged

gewenyu99 merged 9 commits into
mainfrom
posthog/functional-p0-baselines

Conversation

@gewenyu99

@gewenyu99 gewenyu99 commented Sep 21, 2026 •

Copy link
Copy Markdown
Collaborator

Records what the wizard does today so the surface split can prove it didn't change. Nothing moves. Revives #1269 onto current main.

Goldens. 45 screens at 120x40 and 80x28, 16 keyboard-vs-control-action diffs, 24 flow traces, the post-auth gate table, 72 cross-surface import edges. All run inside pnpm test. A new edge fails. A changed screen fails with a diff.

Projects. Six Vitest projects keyed by today's directories: legacy, agent, tui, cli, harness, architecture. legacy is the catch-all until B1 and C1 empty it. pnpm test still runs everything once.

Source changes. Nine files, 35 lines added, 25 removed. Two carry behavior.

File Change Behavior
RevenueIntroScreen.tsx Spread two Sets before .slice/.map Yes. The detect-error branch rendered Set.slice is not a function and unmounted. Frame golden covers it, mutation-checked. Rides in the typecheck commit since the plan forbids force-pushing the split.
bootstrap.ts, program-step.ts Post-auth gate loop extracted into exported postAuthGateSteps Same loop, same order, same log lines. Extracted so the golden reads production code, not a copy.
pi/mcp.ts, MetricsIntroScreen.tsx, CrateStack.tsx, McpDemo.tsx, bounded-fs.ts, wizard.ts Type-only fixes so tsc --noEmit passes on the whole tree No

Known and recorded, not fixed here. Gated programs fire screen run, screen ai-opt-in, screen run. authenticate.ts sets credentials before apiUser. Six keyboard pairs commit different state than their control action, confirm_setup skips the scan-consent default. Both are named in the tests and are production behavior changes for their own PRs.

Differs from #1269: no stub barrels, store renamed legacy, no surfaces workflow, no bundle fixtures. The startup-closure check returns as a unit test on dist once src/agent exists.


Created with PostHog Desktop

Type-only fixes for the 32 errors tsc reported. One runtime fix rides along:
RevenueIntroScreen spread the POSTHOG_SDKS and STRIPE_SDKS sets before
calling array methods on them, which previously threw on those branches.

Generated-By: PostHog Desktop
Task-Id: d14e92bb-6ee1-49b5-8502-39cb80079589
Projects: store, agent, tui, cli, harness, architecture, keyed by today's
directories. New scripts test:<project> and test:arch, a surfaces workflow
that runs each project alone plus a production and CI bundle audit, aliases
and empty shape files for the future src/{store,agent,tui,cli} surfaces, and
a chunk manifest script for dist/.

Generated-By: PostHog Desktop
Task-Id: d14e92bb-6ee1-49b5-8502-39cb80079589
Goldens recorded from the current tree: a frame per screen and overlay at two
sizes through the real ScreenContainer, keyboard versus control action session
diffs, store invariants, flow traces and screen analytics per program, post
auth gate ids, the MCP control state sequence, and prod and CI chunk
manifests. The import boundaries test seeds the 72 current violations and
fails on new ones or stale entries.

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.

Comment thread .github/workflows/surfaces.yml Fixed
Comment thread .github/workflows/surfaces.yml Fixed
Comment thread .github/workflows/surfaces.yml Fixed
@gewenyu99

Copy link
Copy Markdown
Collaborator Author

Evidence (local, Node v22.22.0, base 22187ad2)

Check Result
pnpm typecheck pass
pnpm lint 0 errors, 477 pre-existing warnings
pnpm test (build + all Vitest projects) 183 files, 3101 tests pass
Goldens (frames, keyboard pairs, flow traces, post-auth gates, commandments, credential isolation) byte-identical against current main, no -u
Postbuild smoke-test.sh + warlock smoke pass
Headless CI run: CI build, --ci on a temp copy of wizard-workbench express-todo, project 228144, US exit 0, orchestrator, 7/7 steps completed
Chunk-manifest fixtures regenerated from this branch's prod and CI builds, 49 chunks

Delta vs #1269: dropped the empty src/{store,agent,tui,cli} stub barrels and their aliases (tsconfig.build.json identical to main); catch-all architecture surface renamed store → legacy; known-violations.json unchanged (72 edges).

Not part of this PR: pnpm test:e2e (jest, e2e-tests/) is a dead suite on main. With a local moduleNameMapper fix it resolves modules, then every test times out on PHW_CLI_INTERACTIVE_REQUIRED because it drives the pre-Ink prompt flow. No CI workflow runs it. Needs its own retire-or-rewrite PR.

@gewenyu99 gewenyu99 changed the title chore(test): WIP per-surface test projects and behavior baselines for the functional stack (P0) chore(test): WIP baselines and per-surface test projects for the functional stack (P0) Sep 21, 2026
@gewenyu99

gewenyu99 commented Sep 21, 2026 •

Copy link
Copy Markdown
Collaborator Author

Review round applied in 426ce05, then 730848e

Finding Done
Five fixtures with no reader All five deleted. The chunk-manifest diff went in, then came out: output differs between macOS and Linux, and it was a proxy for a startup-closure check that has nothing to check until src/agent exists. chunk-manifest.no-jest.ts stays as a reading tool.
44 identical 60x15 frames Second size is 80x28, the container minimum. One 60x15 case pins the guard. 45 screens re-recorded.
Flow trace freezes the run, ai-opt-in, run triple Documented in the test header as a known defect with the cause. Fix is a production analytics change, separate PR.
confirm_setup skips consent Recorded as a named knownDivergence on the pair. Store method change belongs with the other five divergences, separate PR.
Keyboard goldens depend on host path and clock Temp install dir. Fake timers don't work here: Ink delivers stdin through the event loop and every keyboard diff came back empty, noted in the test. Real timers stay.
Snapshotting equal Asserts toEqual, or not.toEqual with the reason, on each pair. Boolean gone from the snap.
Revenue fix untested Frame golden for the detect-error branch at both sizes. Reverting the spread fails it with POSTHOG_SDKS.slice is not a function.
Revenue fix hidden in a chore commit Left in place. Splitting it means rewriting pushed history and the plan forbids force-push. The PR body names it now.
Post-auth golden tests itself postAuthGateSteps exported from program-step.ts, used by bootstrap.ts and the test.
Matrix re-runs every test, lints twice surfaces.yml deleted. build.yml owns tests, the architecture test runs inside pnpm test.
test:goldens:update misses projects Now vitest run -u.
Dead harness rule Removed.
Tests outside __tests__ run nowhere legacy and harness include **/*.{test,spec}.*.
Stale commit body Left, same force-push reason. The body's store project and shape files don't exist; legacy does.
Taxonomy in three lists Left. A2′ replaces the rules table when src/agent and src/shared exist.

Typecheck, lint 0 errors, 183 files, 3104 tests. Frames re-recorded, every other golden unchanged.

Frames record at 120x40 and 80x28, the ScreenContainer minimum, with one
60x15 case pinning the viewport guard. A revenue-intro detect-error case
covers the Set spread fix that shipped in the typecheck commit. The keyboard
test asserts equality and names the six known divergences instead of
snapshotting a boolean, and uses a temp install dir so no host path leaks
in. The post-auth gate golden reads the production walk, now exported as
postAuthGateSteps. The three control fixtures had no reader and are gone.
The bundle job diffs the chunk manifests against their fixtures so the
audit can fail. The surfaces workflow drops the test matrix and lint, both
already run by build.yml, and declares read permissions. Tests outside
__tests__ land in legacy rather than nowhere. The dead harness surface rule
is removed. The flow-trace golden documents the run, ai-opt-in, run triple
as a known defect.

Generated-By: PostHog Desktop
Task-Id: d14e92bb-6ee1-49b5-8502-39cb80079589
Rolldown assigns shared modules such as analytics and yara-hooks to
different chunks on macOS and Linux, so a byte diff of the per-chunk
manifest failed on the runner against a fixture recorded locally. The
script gains --summary: chunk names plus the sorted set of bundled sources,
identical on both platforms. The fixtures become that summary and the
Surfaces workflow diffs it. The full manifests still upload as artifacts.

Generated-By: PostHog Desktop
Task-Id: d14e92bb-6ee1-49b5-8502-39cb80079589
Sourcemap sources differ between macOS and Linux, so a locally recorded
summary can never match the runner. The prod fixture now comes from the
Surfaces artifact. The job builds both variants and uploads both summaries
before diffing, so a drift still leaves the files to re-record from.

Generated-By: PostHog Desktop
Task-Id: d14e92bb-6ee1-49b5-8502-39cb80079589
Same source as the prod fixture one commit earlier. The prod summary from
this run matched its fixture byte for byte, so the gate holds on Linux.

Generated-By: PostHog Desktop
Task-Id: d14e92bb-6ee1-49b5-8502-39cb80079589
Architecture and Bundle audit run with continue-on-error. Drift in the
import edges or the chunk summaries lands in the job summary with the diff
and the file to re-record. The unit-test goldens in build.yml still block.

Generated-By: PostHog Desktop
Task-Id: d14e92bb-6ee1-49b5-8502-39cb80079589
The architecture test already runs inside pnpm test. The bundle audit was a
platform-dependent proxy for the startup-closure check, which belongs in a
unit test on dist once src/agent exists. chunk-manifest.no-jest.ts stays as
a reading tool.

Generated-By: PostHog Desktop
Task-Id: d14e92bb-6ee1-49b5-8502-39cb80079589
@gewenyu99
gewenyu99 marked this pull request as ready for review September 21, 2026 19:29
@gewenyu99
gewenyu99 requested a review from a team as a code owner September 21, 2026 19:29
@gewenyu99 gewenyu99 changed the title chore(test): WIP baselines and per-surface test projects for the functional stack (P0) chore(test): baselines and per-surface test projects for the functional stack (P0) Sep 21, 2026

@edwinyjlim edwinyjlim left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

whew

@gewenyu99

Copy link
Copy Markdown
Collaborator Author

/wizard-ci ai-observability

@wizard-ci-bot

wizard-ci-bot Bot commented Sep 21, 2026 •

Copy link
Copy Markdown

🧙 Wizard CI Results

Trigger ID: eace05a
Workflow: View run

App Confidence PR YARA
ai-observability/anthropic/node-weather 4/5 #4065 (logs) ✓
ai-observability/anthropic/python-weather 4/5 #4061 (logs) ✓
ai-observability/google-adk/node-weather 1/5 #4068 (logs) ✓
ai-observability/groq/node-chat 5/5 #4067 (logs) ✓
ai-observability/manual-capture/node-http-chat 5/5 #4064 (logs) ✓
ai-observability/openai-agents/python-travel-triage N/A #4062 (logs) ✓
ai-observability/openai/node-weather 5/5 #4066 (logs) ✓
ai-observability/openai/python-docs-rag N/A Failed (logs) ✓
ai-observability/openai/python-weather 5/5 #4063 (logs) ✓
ai-observability/opentelemetry/go-weather N/A Failed (logs) ✓
ai-observability/vercel-ai/nextjs-support-chat 4/5 #4070 (logs) ✓

Configuration

Setting Value
Wizard ref posthog/functional-p0-baselines
Context Mill ref main
PostHog ref master

Search for trigger ID eace05a in wizard-workbench PRs.

@gewenyu99

Copy link
Copy Markdown
Collaborator Author

Rwar flaky CI

@gewenyu99

Copy link
Copy Markdown
Collaborator Author

the heck is

POST /graphql - 504 with id 7001:3D3C87:10D9FBD:36F742E:6AB1A18F in 11230ms
      Failed to create signed commit: HttpError
 ELIFECYCLE  Command failed with exit code 1.
 ``` 
 
 will deal with this later. not_vincent can you take a look?

@gewenyu99

gewenyu99 commented Sep 21, 2026 •

Copy link
Copy Markdown
Collaborator Author
ai-observability/google-adk/node-weather 1/5

Looks like the behavior was actually correct. SDK version mismatch with already instrumented posthog. Needs a fix workbench side.

@gewenyu99
gewenyu99 merged commit beccc79 into main Sep 21, 2026
21 checks passed
@gewenyu99
gewenyu99 deleted the posthog/functional-p0-baselines branch September 21, 2026 21:38
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.

3 participants