Skip to content

docs: bring docs, readmes and skills in line with the layers - #1392

Merged
gewenyu99 merged 1 commit into
posthog/functional-r9-18-fence-every-layer-with-typescript-projecfrom
posthog/functional-r9-19-bring-docs-readmes-and-skills-in-line-wi
Oct 5, 2026
Merged

gewenyu99 merged 1 commit into
posthog/functional-r9-18-fence-every-layer-with-typescript-projecfrom
posthog/functional-r9-19-bring-docs-readmes-and-skills-in-line-wi

Conversation

@gewenyu99

@gewenyu99 gewenyu99 commented Sep 29, 2026 •

Copy link
Copy Markdown
Collaborator

Phase 2 of Release C (#1320), PR 4 of 4, after #1391. Docs only. Green on its own tree, which is the final code of the stack, and it lands with the rest of phase 2.

Problem

The docs, READMEs and skills name paths, aliases and hosts that the code in this stack no longer has. A contributor who follows them opens the wrong folder or imports an alias that does not resolve.

Changes

Docs only: no code or config changes.

  • README.md gains a ## What calls what section: each way in, from the CLI through runTui or runHeadless to runProgram and runAgent, plus the tools. ## Entrypoint: bin.ts replaces run.ts.
  • New layer READMEs in src/cli, src/headless, src/host, src/tools and src/tui. Each says what the layer's entry is and what it may import. src/programs/README.md and src/shared/README.md are rewritten.
  • docs/developer-interfaces.md covers runProgram, runAgent, the session store and ## Hosts.
  • AGENTS.md, the skills under .claude/skills/, docs/local-dev.md, docs/error-catalog.md, docs/runbooks/aio-capture.md, the src/agent and scripts READMEs, e2e-harness/ARCHITECTURE.md and docs/images/wizard-run-paths.svg name the current folders and entries.

Test plan

  • This is the verified final tree: pnpm typecheck 0 errors, pnpm lint 0 errors, 236 test files (3,515 tests) pass, pnpm build ok.

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 #1394 September 29, 2026 09:41
@gewenyu99
gewenyu99 force-pushed the posthog/functional-r9-19-bring-docs-readmes-and-skills-in-line-wi branch from 7c07207 to d9d992c Compare September 29, 2026 10:16
@gewenyu99
gewenyu99 force-pushed the posthog/functional-r9-19-bring-docs-readmes-and-skills-in-line-wi branch from d9d992c to e66f35c Compare September 30, 2026 08:06
@gewenyu99
gewenyu99 removed this pull request from stack #1394 September 30, 2026 08:07
@gewenyu99
gewenyu99 added this pull request to stack #1400 September 30, 2026 08:07
@gewenyu99
gewenyu99 force-pushed the posthog/functional-r9-19-bring-docs-readmes-and-skills-in-line-wi branch from e66f35c to 27c16b4 Compare September 30, 2026 08:44
@gewenyu99
gewenyu99 marked this pull request as ready for review September 30, 2026 09:13
@gewenyu99
gewenyu99 requested review from a team as code owners September 30, 2026 09:13
@gewenyu99
gewenyu99 force-pushed the posthog/functional-r9-19-bring-docs-readmes-and-skills-in-line-wi branch from 5ebeb72 to ec42380 Compare October 1, 2026 06:43
@gewenyu99
gewenyu99 removed this pull request from stack #1400 October 1, 2026 06:47
@gewenyu99
gewenyu99 added this pull request to stack #1403 October 1, 2026 06:47
@PostHog PostHog deleted a comment from wizard-ci-bot Bot Oct 1, 2026
@PostHog PostHog deleted a comment from wizard-ci-bot Bot Oct 1, 2026
@PostHog PostHog deleted a comment from wizard-ci-bot Bot Oct 1, 2026
@PostHog PostHog deleted a comment from wizard-ci-bot Bot Oct 1, 2026
@PostHog PostHog deleted a comment from wizard-ci-bot Bot Oct 1, 2026
@PostHog PostHog deleted a comment from wizard-ci-bot Bot Oct 1, 2026
@gewenyu99

Copy link
Copy Markdown
Collaborator Author

/wizard-ci basic-integration/next-js

@wizard-ci-bot

wizard-ci-bot Bot commented Oct 1, 2026 •

Copy link
Copy Markdown

🧙 Wizard CI Results

Trigger ID: c212e50
Workflow: View run

App Confidence PR YARA
basic-integration/next-js/15-app-router-saas 5/5 #4325 (logs) ✓
basic-integration/next-js/15-app-router-todo 5/5 #4323 (logs) ✓
basic-integration/next-js/15-pages-router-saas 4/5 #4324 (logs) ✓
basic-integration/next-js/15-pages-router-todo 5/5 #4322 (logs) ✓

Configuration

Setting Value
Wizard ref posthog/functional-r9-19-bring-docs-readmes-and-skills-in-line-wi
Context Mill ref main
PostHog ref master

Search for trigger ID c212e50 in wizard-workbench PRs.

@johncwaters johncwaters left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Note

Automated review. Not written by a human.

@gewenyu99
gewenyu99 force-pushed the posthog/functional-r9-19-bring-docs-readmes-and-skills-in-line-wi branch from ec42380 to 7898c4a Compare October 2, 2026 16:47
@gewenyu99
gewenyu99 force-pushed the posthog/functional-r9-19-bring-docs-readmes-and-skills-in-line-wi branch from 7898c4a to 0eb0430 Compare October 2, 2026 20:50
@gewenyu99
gewenyu99 force-pushed the posthog/functional-r9-19-bring-docs-readmes-and-skills-in-line-wi branch from 0eb0430 to 2e31e43 Compare October 3, 2026 20:40

@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.

Review of #1392 at 2e31e438. Items outside this PR's diff lines:

[P3] The host layer's file header still calls wizardAbort the process's exit point
src/host/wizard-abort.ts:1-2

"Single exit point for the wizard. Use instead of process.exit() directly" contradicts AGENTS.md, the host README and the reference. It is the one comment the docs pass now contradicts.

Suggested fix: "Ends a decided failure: cleanup, error capture, analytics shutdown, the outro through the caller's presenter, then the host's exit resolves the code. Only the CLI calls process.exit."


Drafted with Claude Code from a review of the whole Release C stack, re-verified at the stack tip 2e31e438. Line numbers are at this PR's head.


Neither the compiler nor these rules stop an `import()` of a computed path,
which TypeScript types as `any`, or a string a test hands `vi.importActual`
that has no `.tsbuild/` or `node_modules/` segment, which no project resolves. ESLint ignores `scripts/`, so the rules don't reach

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.

[P2] The layer-boundaries reference says ESLint ignores scripts/; the config lints it with the fences

ESLint ignores only the .js, .mjs and .cjs scripts, lists scripts among the layers and adds a scripts/**/*.{ts,tsx} override. README.md:626-629, scripts/README.md and AGENTS.md all say scripts are fenced. The canonical reference contradicts them and its own table a few lines above.

Suggested fix: "ESLint lints scripts/*.ts with the layer fences only; the .js, .mjs and .cjs scripts are ignored. The harness project compiles them against its references."

Comment thread README.md
| `@agent` | `src/agent/index.ts`, the agent's runtime entry |
| `@agent/types` | `src/agent/types.ts`, type-only |
| `@agent/*` | `src/agent/*`, inside `src/agent` and its tests only |
| `@agent/*` | `src/agent/*`, for the agent's tests. The agent imports its own modules by relative path, and no other layer maps it |

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.

[P2] "No other layer maps @agent/*" is false: every project maps the deep aliases, and ESLint, not the projects, keeps them home

tsconfig.no-tui.json and tsconfig.base.json map @agent/*, @programs/* and @cli/*; the registry and the program tests import @programs/.... What rejects a deep import from another layer is pnpm lint, as the same reference says at lines 214 to 215. The declaration-resolution rationale is also moot: a referenced project's declarations resolve with that project's own paths.

Suggested fix: Say every project maps the deep alias and pnpm lint rejects it outside the layer that owns it, so the agent and the programs import their own modules by relative path. Drop the declaration-resolution rationale. Same claim at line 641, src/agent/README.md:34 and src/programs/README.md:114.

[`run-agent-quack.ts`](examples/run-agent-quack.ts) is the smallest `runAgent`
call. It builds a `RunConfig` with one prompt and no Write, Edit or Bash, and
prints the transcript tail and the outcome. Each step has a comment.
prints the transcript tail and the outcome. It logs in with `HostResolution`,

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.

[P3] The runAgent example description names functions the example does not use

Suggested fix: "It logs in with resolveApiKeyProject from @shared/api-key-login, takes the gateway token from readCiGatewayCredential, and imports nothing from @programs." There is no bare @shared alias.

`@shared/*` and the rest). Its own project, [`tsconfig.json`](tsconfig.json),
references every layer it imports, and `pnpm typecheck` fails a deeper `@tui/*`
import and any import of Ink or React. ESLint fails a deeper `@programs/*`,
`@agent/*` or `@cli/*` import and a relative import out of `e2e-harness/`.

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.

[P3] The harness doc credits ESLint with the @cli/* ban

Suggested fix: "ESLint fails a deeper @programs/* or @agent/* import and a relative import out of e2e-harness/; @cli and @cli/* fail pnpm typecheck" because the harness project references no src/cli.

Comment thread src/agent/README.md
| YARA scans of tool calls (Pre/PostToolUse) and of installed skills | [`yara-hooks.ts`](yara-hooks.ts) |

Import runtime values from `@agent` and types from `@agent/types`. `@agent`
exports `runAgent`, `RunOutcome` (from `@shared/run-state`, so the hosts read it

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.

[P3] The @agent export list omits two exports

Suggested fix: Add scanVerdict and scanInstalledSkill, and say the TUI reaches the latter through @programs, or write "among others".

| Tabs and status | [TabContainer](../../../../src/tui/primitives/TabContainer.tsx): local active tab, arrow navigation, optional expandable status |
| Single/multiple choice | [PickerMenu](../../../../src/tui/primitives/PickerMenu.tsx): columns, paging, filtering, and confirm-button interaction |
| Categorized choices | [GroupedPickerMenu](../../../../src/tui/primitives/GroupedPickerMenu.tsx): category headers, scrolling, and multi-select |
| Multi-select submission | [ConfirmButton](../../../../src/tui/primitives/ConfirmButton.tsx): bordered submit row with focus and optional count |

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.

[P3] The rebase put back main's wrong ConfirmButton wording in the ink-tui skill

It calls ConfirmButton a "bordered submit row", but ConfirmButton.tsx:10 says the button renders flat, and it has no border.

Suggested fix: Restore "flat submit row with a focus marker and optional count".

@gewenyu99

Copy link
Copy Markdown
Collaborator Author

Real-TUI snapshots: all nine programs on 2e31e438 (final tree)

Each program ran the real TUI in a PTY (scripts/tui-snapshots.no-jest.ts) against a temp copy of a workbench app, local PostHog and local gateway, profile from its test/e2e.json. Every captured frame is below, one collapsed block per program.

✅ posthog-integration: basic-integration/javascript-node/express-todo, 7m40s, tasks 8/10 (2 skipped), 31 frames

Screens: intro → auth → run → outro → mcp → slack-connect → keep-skills

01-intro

01-intro

02-auth

02-auth

03-run

03-run

04-run

04-run

05-run

05-run

06-run

06-run

07-run

07-run

08-run

08-run

09-run

09-run

10-run

10-run

11-run

11-run

12-run

12-run

13-run

13-run

14-run

14-run

15-run

15-run

16-run

16-run

17-run

17-run

18-run

18-run

19-run

19-run

20-run

20-run

21-run

21-run

22-run

22-run

23-run

23-run

24-run

24-run

25-run

25-run

26-outro

26-outro

27-outro

27-outro

28-outro

28-outro

29-mcp

29-mcp

30-slack-connect

30-slack-connect

31-keep-skills

31-keep-skills

✅ error-tracking: basic-integration/javascript-node/express-todo, 10m04s, tasks 6/8 (2 skipped), 25 frames

Screens: error-tracking-intro → auth → error-tracking-detect → run → outro → keep-skills

01-error-tracking-intro

01-error-tracking-intro

02-error-tracking-detect

02-error-tracking-detect

03-run

03-run

04-run

04-run

05-run

05-run

06-run

06-run

07-run

07-run

08-run

08-run

09-run

09-run

10-run

10-run

11-run

11-run

12-run

12-run

13-run

13-run

14-run

14-run

15-run

15-run

16-run

16-run

17-run

17-run

18-run

18-run

19-run

19-run

20-run

20-run

21-run

21-run

22-run

22-run

23-outro

23-outro

24-outro

24-outro

25-keep-skills

25-keep-skills

✅ metrics: basic-integration/javascript-node/express-todo, 2m50s, tasks 3/3, 13 frames

Screens: metrics-intro → auth → run → outro → keep-skills

01-metrics-intro

01-metrics-intro

02-run

02-run

03-run

03-run

04-run

04-run

05-run

05-run

06-run

06-run

07-run

07-run

08-run

08-run

09-run

09-run

10-run

10-run

11-outro

11-outro

12-outro

12-outro

13-outro

13-outro

✅ ai-observability: ai-observability/openai/node-weather, 3m13s, tasks 6/6, 24 frames

Screens: ai-observability-intro → auth → run → outro → keep-skills

01-ai-observability-intro

01-ai-observability-intro

02-run

02-run

03-run

03-run

04-run

04-run

05-run

05-run

06-run

06-run

07-run

07-run

08-run

08-run

09-run

09-run

10-run

10-run

11-run

11-run

12-run

12-run

13-run

13-run

14-run

14-run

15-run

15-run

16-run

16-run

17-run

17-run

18-run

18-run

19-run

19-run

20-run

20-run

21-run

21-run

22-run

22-run

23-outro

23-outro

24-keep-skills

24-keep-skills

✅ audit: audit/posthog-demo-3000, 5m30s, tasks 0/0, 16 frames

Screens: audit-intro → auth → audit-run → audit-outro → keep-skills

01-audit-intro

01-audit-intro

02-audit-run

02-audit-run

03-audit-run

03-audit-run

04-audit-run

04-audit-run

05-audit-run

05-audit-run

06-audit-run

06-audit-run

07-audit-run

07-audit-run

08-audit-run

08-audit-run

09-audit-run

09-audit-run

10-audit-run

10-audit-run

11-audit-run

11-audit-run

12-audit-run

12-audit-run

13-audit-run

13-audit-run

14-audit-run

14-audit-run

15-audit-outro

15-audit-outro

16-keep-skills

16-keep-skills

✅ error-tracking-upload-source-maps: error-tracking-upload-source-maps/cicd-github-actions-node-raw, 1m36s, tasks 8/8, 38 frames

Screens: source-maps-intro → auth → source-maps-detect → run → wizard-ask → run → wizard-ask → run → source-maps-outro → keep-skills

01-source-maps-intro

01-source-maps-intro

02-source-maps-detect

02-source-maps-detect

03-run

03-run

04-run

04-run

05-run

05-run

06-run

06-run

07-run

07-run

08-wizard-ask

08-wizard-ask

09-run

09-run

10-run

10-run

11-run

11-run

12-run

12-run

13-run

13-run

14-run

14-run

15-run

15-run

16-run

16-run

17-run

17-run

18-run

18-run

19-run

19-run

20-run

20-run

21-run

21-run

22-run

22-run

23-run

23-run

24-run

24-run

25-run

25-run

26-run

26-run

27-run

27-run

28-run

28-run

29-wizard-ask

29-wizard-ask

30-wizard-ask

30-wizard-ask

31-wizard-ask

31-wizard-ask

32-run

32-run

33-run

33-run

34-run

34-run

35-run

35-run

36-source-maps-outro

36-source-maps-outro

37-source-maps-outro

37-source-maps-outro

38-keep-skills

38-keep-skills

✅ replay-vision: replay-vision/react-vite/court-booking, 5m19s, tasks 7/7, 26 frames

Screens: agent-skill-intro → auth → run → outro → keep-skills

01-agent-skill-intro

01-agent-skill-intro

02-run

02-run

03-run

03-run

04-run

04-run

05-run

05-run

06-run

06-run

07-run

07-run

08-run

08-run

09-run

09-run

10-run

10-run

11-run

11-run

12-run

12-run

13-run

13-run

14-run

14-run

15-run

15-run

16-run

16-run

17-run

17-run

18-run

18-run

19-run

19-run

20-run

20-run

21-run

21-run

22-run

22-run

23-outro

23-outro

24-outro

24-outro

25-outro

25-outro

26-keep-skills

26-keep-skills

✅ self-driving: self-driving/react-router/expense-splitter, 10m16s, tasks 9/9, 76 frames

Screens: self-driving-intro → self-driving-integration-check → auth → self-driving-integration-detect → run → self-driving-handoff → self-driving-github → run → wizard-ask → run → wizard-ask → run → outro

01-self-driving-intro

01-self-driving-intro

02-self-driving-integration-check

02-self-driving-integration-check

03-self-driving-integration-detect

03-self-driving-integration-detect

04-run

04-run

05-run

05-run

06-run

06-run

07-run

07-run

08-run

08-run

09-run

09-run

10-run

10-run

11-run

11-run

12-run

12-run

13-run

13-run

14-run

14-run

15-run

15-run

16-run

16-run

17-run

17-run

18-run

18-run

19-run

19-run

20-run

20-run

21-run

21-run

22-run

22-run

23-run

23-run

24-run

24-run

25-run

25-run

26-run

26-run

27-run

27-run

28-run

28-run

29-run

29-run

30-run

30-run

31-run

31-run

32-run

32-run

33-run

33-run

34-run

34-run

35-run

35-run

36-run

36-run

37-run

37-run

38-run

38-run

39-run

39-run

40-run

40-run

41-self-driving-handoff

41-self-driving-handoff

42-run

42-run

43-run

43-run

44-run

44-run

45-run

45-run

46-run

46-run

47-run

47-run

48-run

48-run

49-run

49-run

50-run

50-run

51-run

51-run

52-run

52-run

53-run

53-run

54-run

54-run

55-run

55-run

56-run

56-run

57-run

57-run

58-run

58-run

59-run

59-run

60-run

60-run

61-run

61-run

62-run

62-run

63-wizard-ask

63-wizard-ask

64-run

64-run

65-run

65-run

66-run

66-run

67-run

67-run

68-run

68-run

69-wizard-ask

69-wizard-ask

70-run

70-run

71-run

71-run

72-run

72-run

73-run

73-run

74-run

74-run

75-run

75-run

76-outro

76-outro

✅ warehouse-source: revenue/stripe/stripe-saas-demo, 2m07s, tasks 4/4, 2 asks left unanswered by the e2e profile, 22 frames

Screens: warehouse-intro → auth → run → wizard-ask → run → wizard-ask → run → outro → keep-skills

01-warehouse-intro

01-warehouse-intro

02-run

02-run

03-run

03-run

04-run

04-run

05-run

05-run

06-run

06-run

07-run

07-run

08-run

08-run

09-run

09-run

10-wizard-ask

10-wizard-ask

11-wizard-ask

11-wizard-ask

12-run

12-run

13-wizard-ask

13-wizard-ask

14-run

14-run

15-run

15-run

16-run

16-run

17-run

17-run

18-run

18-run

19-run

19-run

20-run

20-run

21-outro

21-outro

22-keep-skills

22-keep-skills

Created with PostHog Desktop

Generated-By: PostHog Desktop
Task-Id: d14e92bb-6ee1-49b5-8502-39cb80079589
@gewenyu99
gewenyu99 removed this pull request from stack #1403 October 5, 2026 09:47
@gewenyu99
gewenyu99 force-pushed the posthog/functional-r9-19-bring-docs-readmes-and-skills-in-line-wi branch from 2e31e43 to 1f7c894 Compare October 5, 2026 09:47
@gewenyu99
gewenyu99 added this pull request to stack #1413 October 5, 2026 09:48
@gewenyu99
gewenyu99 merged commit c1209e0 into main Oct 5, 2026
26 checks passed
@gewenyu99
gewenyu99 deleted the posthog/functional-r9-19-bring-docs-readmes-and-skills-in-line-wi branch October 5, 2026 09:50
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