Skip to content

Make the tasks plugin forkable - #4192

Merged
SawyerHood merged 1 commit into
bb/forkable-10-nav-panelsfrom
bb/forkable-11-tasks
Sep 23, 2026
Merged

SawyerHood merged 1 commit into
bb/forkable-10-nav-panelsfrom
bb/forkable-11-tasks

Conversation

@SawyerHood

@SawyerHood SawyerHood commented Sep 23, 2026 •

Copy link
Copy Markdown
Collaborator

Human comments

What was wrong

Tenth PR in the forkable built-ins stack; it builds on #4191. bb Tasks is the biggest shared-ui-only built-in: about 110 files and 34k lines.

A copy couldn't install or run its tests:

  • 17 @bb/shared-ui imports.
  • A test that counted SQL statements through bb's own database connection (packages/db).
  • vitest.shared.ts.
  • A tsconfig that included only a few entry points. Vite applies tsconfig paths only to included files, so every view test in a copy failed to resolve @/.

What changed

  • UI imports go through the registry alias.
  • The SQL-count test runs on the SDK harness's plugin database with the same prepare() wrapper, so it proves the same statement counts and index plan.
  • defineConfig keeps the tippy alias, setup file, timeout, and inlined dependency.
  • The tsconfig includes every file, which brings the tests under tsc; their RPC handlers read unknown input through a plugin-local helper.
  • Test peers are declared.
  • Lint: two comments removed, two lists memoized, and one deliberate effect marked for the linter.
  • The @bb/scripts test that checks the lint rule ignores unlisted plugins used tasks as its example; it now uses a name that isn't in the repository.

Dropping sharedWorkerProjects did not slow the suite. Under load it ran in 7.9–9.0s, down from 10.3–11.8s at the base, because the SDK now resolves to its built entries and the icon no longer pulls in shared-ui's glyph map.

How you verified

  • pnpm exec turbo run typecheck test lint --filter=bb-plugin-tasks.
  • pnpm check:plugin-forks plugins/tasks passes in a copy.
  • @bb/app typecheck; @bb/scripts and @bb/plugin-api-map tests.
  • Bundle identity: app.css and server.js are byte-identical. app.js differs only in where the icon shim sits, the registry icon (the same host component), and the two memoized lists.

🤖 Generated with Claude Code

AGENT GENERATED

@SawyerHood
SawyerHood added this pull request to stack #4182 September 23, 2026 17:22
@SawyerHood SawyerHood changed the title bb/forkable 11 tasks Make the tasks plugin forkable Sep 23, 2026
@SawyerHood
SawyerHood force-pushed the bb/forkable-11-tasks branch 3 times, most recently from 7aa39f6 to 44626b2 Compare September 23, 2026 20:40
@SawyerHood
SawyerHood marked this pull request as ready for review September 23, 2026 21:07
@SawyerHood
SawyerHood removed this pull request from stack #4182 September 23, 2026 21:40
@SawyerHood
SawyerHood added this pull request to stack #4220 September 23, 2026 21:41
A copy of plugins/tasks could not install or run its tests:

- It imported 17 @bb/shared-ui components and helpers. It now imports
  them through the registry alias (@/components/ui/button, @/lib/utils,
  @/components/ui/hooks/use-compact-viewport, ...), which its tsconfig
  maps onto shared-ui's source and the registry's host-backed icon.
- lifecycle/queries.test.ts counted SQL statements through bb's own
  connection (packages/db/src/connection). It now uses the SDK harness's
  plugin database and wraps its prepare() the same way, so it still
  proves one indexed lookup per unrelated thread event, the per-mapping
  statement counts, and the index plan.
- Its vitest config imported the repository's vitest.shared.ts. It now
  uses defineConfig with resolve.tsconfigPaths and keeps the tippy.js
  alias, setup file, timeout, and inlined bubble-menu dependency. The
  tests run with vitest's default isolation instead of the shared-worker
  projects.
- The tsconfig included only a few entry points and two directories.
  Vite applies tsconfig paths only to files the tsconfig includes, so in
  a copy every view test failed to resolve @/components/ui/*. The
  tsconfig now includes every .ts and .tsx file, which also brings the
  tests under tsc; their loosely typed RPC handlers now take unknown
  inputs and read them through a plugin-local rpcInput helper.
- The SDK harness's optional peers were not declared; the plugin now
  lists what its tests load.

The icon now comes from the SDK's experimental_Icon, so
task-activity.test.tsx mocks @get-bb/plugin-sdk/app partially instead
of replacing it. The lint script surfaced two code comments, now
removed, two useMemo inputs rebuilt every render (feed and folder
lists), now memoized, and a deliberate subPath-only effect in the app
shell, now marked for the linter. The scripts test that checks the lint
rule ignores unlisted plugins used tasks as its example; it now uses a
plugin name that is not in the repository.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
@SawyerHood
SawyerHood merged commit b7e34aa into main Sep 23, 2026
18 checks passed
@SawyerHood
SawyerHood deleted the bb/forkable-11-tasks branch September 23, 2026 22:13
SawyerHood added a commit that referenced this pull request Sep 23, 2026
## Human comments

## What was wrong

Eleventh PR in the forkable built-ins stack; it builds on #4192.
bb-guide renders the standard introduction bb gives agents with
`renderTemplate` from `@bb/templates`, a workspace package a copy can't
install. No other code renders that template
(`standardAgentAppendInstructions`). The plugin also used
`vitest.shared.ts` and didn't declare the SDK harness's peers.

## What changed

- **Introduction:** the text moves into the plugin as `introduction.ts`.
`packages/templates` drops the template file and its test, and the test
moves into the plugin, where it checks the text the plugin contributes.
- **Bundle size:** the built `server.js` shrinks from 316 KB to 3 KB,
since it no longer bundles Handlebars and every bb template.
- **Test config:** `defineConfig`, declared peers, a lint script, and a
turbo test entry.

## How you verified

- **Agent text unchanged:** the text agents receive is byte-identical.
Importing the built `server.js` from before and after with a fake `bb`
produced the same instructions, `configure()` result, and settings for
introduction on and off (same sha256).
- **Turbo:** `pnpm exec turbo run typecheck test lint
--filter=bb-plugin-bb-guide --filter=@bb/templates`, and typecheck of
`@bb/app`, `@bb/server`, `@bb/sdk`, `@bb/cli`, and
`@bb/integration-tests`.
- **Tests:** `@bb/cli` tests (including `bb-cli-skill-coverage`) and the
integration smoke `lifecycle.test.ts`, which loads the built-in bb-guide
and checks the instructions.
- **Fork check:** `pnpm check:plugin-forks plugins/bb-guide` passes in a
copy.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

> AGENT GENERATED
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