Skip to content

Conversation

@rekmarks
Copy link
Member

@rekmarks rekmarks commented Feb 10, 2026

Rationalizes vat bundling in the extensions to forego the need of bundling and serving separately using the CLI. This ensures that changes to vat entry files are picked up during watched builds.

  • Create a bundleVats() Vite plugin in @ocap/repo-tools that bundles vat source files as part of the Vite build pipeline, with watch mode support via addWatchFile
  • Move vat bundler, strip-comments plugin, and export-metadata plugin from @ocap/cli to @ocap/repo-tools
  • Integrate the plugin in omnium-gatherum (echo caplet + controller vat) and extension (sample-vat), eliminating the separate ocap bundle pre-build step
  • Move default-cluster.json from kernel-browser-runtime to extension with relative bundle paths (resolved against the extension root at runtime)
  • Simplify e2e CI scripts — no separate ocap bundle / ocap serve needed for omnium-gatherum
  • Inline cluster config test data in kernel-ui tests to remove the kernel-browser-runtime/default-cluster dependency

Note

Medium Risk
Build and packaging behavior changes across the CLI and extension/omnium Vite configs, so regressions are most likely around watch mode, emitted asset paths, and runtime bundle resolution rather than core kernel logic.

Overview
Vat bundling is moved into the Vite build pipeline by adding bundleVats (and exporting bundleVat/VatBundle) in @ocap/repo-tools, with tests, so vats are bundled and emitted as build assets and their sources are tracked for watch mode.

The CLI’s bundle command is updated to import bundleVat from @ocap/repo-tools, and @ocap/extension and @ocap/omnium-gatherum are updated to use bundleVats in vite.config.ts to produce required vat bundles during builds (and adjust static copy targets accordingly), eliminating bespoke pre-bundle steps.

Cluster config and scripts are streamlined: kernel-browser-runtime drops its default-cluster export/shim, the extension now ships its own default-cluster.json with relative bundleSpec values, kernel-ui tests inline cluster config fixtures, and e2e CI scripts/start scripts remove explicit ocap start/bundle/serve flows in favor of running Playwright directly.

Written by Cursor Bugbot for commit 12941f2. This will update automatically on new commits. Configure here.

Kim

@rekmarks rekmarks requested a review from a team as a code owner February 10, 2026 23:48
@rekmarks rekmarks marked this pull request as draft February 10, 2026 23:53
rekmarks and others added 2 commits February 11, 2026 11:00
Create a Vite plugin in @ocap/repo-tools that bundles vat source files
as part of the Vite build pipeline, replacing the separate `ocap bundle`
pre-build step for omnium-gatherum and extension.

- Move vat bundler, strip-comments plugin, and export-metadata plugin
  from @ocap/cli to @ocap/repo-tools
- Create `bundleVats()` plugin with `buildStart` (watch mode) and
  `generateBundle` (emit assets) hooks
- Integrate plugin in omnium-gatherum (echo caplet + controller vat)
  and extension (sample-vat)
- Move default-cluster.json from kernel-browser-runtime to extension
  with relative bundle paths
- Simplify e2e CI scripts (no separate bundle/serve step needed)
- Inline cluster config test data in kernel-ui tests

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add a VatBundle type annotation in bundle.ts that ensures the repo-tools
definition stays assignable to the kernel-utils definition. If either
type drifts, the CLI build will fail with a type error.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@rekmarks rekmarks force-pushed the rekm/better-vat-bundling branch from fa13659 to 12941f2 Compare February 11, 2026 19:02
@rekmarks
Copy link
Member Author

@cursor review

Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

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

✅ Bugbot reviewed your changes and found no new issues!

Comment @cursor review or bugbot run to trigger another review on this PR

The e2e tests load minimal-cluster.json which references vat bundles at
localhost:3000. These are test-only concerns that don't belong in the
Vite config. Restore the script to bundle and serve test vats separately
while production bundles (sample-vat) remain in the Vite plugin output.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@github-actions
Copy link
Contributor

Coverage Report

Status Category Percentage Covered / Total
🔵 Lines 77.88%
⬆️ +0.02%
6294 / 8081
🔵 Statements 77.84%
⬆️ +0.02%
6395 / 8215
🔵 Functions 75.87%
⬆️ +0.05%
1585 / 2089
🔵 Branches 77.79%
🟰 ±0%
2319 / 2981
File Coverage
File Stmts Branches Functions Lines Uncovered Lines
Changed Files
packages/cli/src/commands/bundle.ts 92.3%
🟰 ±0%
50%
🟰 ±0%
100%
🟰 ±0%
92.3%
🟰 ±0%
74
packages/extension/src/background.ts 0%
🟰 ±0%
0%
🟰 ±0%
0%
🟰 ±0%
0%
🟰 ±0%
18-176
packages/repo-tools/src/vite-plugins/index.ts 100%
🟰 ±0%
100%
🟰 ±0%
100%
🟰 ±0%
100%
🟰 ±0%
packages/repo-tools/src/vite-plugins/bundle-vats/index.ts 100% 100% 100% 100%
Generated in workflow #3718 for commit ef6df2f by the Vitest Coverage Report Action

@rekmarks rekmarks marked this pull request as ready for review February 11, 2026 20:21
@rekmarks rekmarks enabled auto-merge February 11, 2026 20:21
@rekmarks rekmarks added this pull request to the merge queue Feb 11, 2026
Merged via the queue into main with commit 27a791c Feb 11, 2026
28 checks passed
@rekmarks rekmarks deleted the rekm/better-vat-bundling branch February 11, 2026 21:25
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.

2 participants