Skip to content

[TEST] Pre-build dist integrity check — verify bus methods survive bundling #163

Description

@four-bytes-robby

Problem

The brain plugin had a bug where forProject was stripped from the bundled dist because the dependency was pinned to a stale version. This went undetected because there was no post-build verification.

Test File

Create test/dist-integrity.test.ts with the following test cases:

  1. forProject is present in the server dist — read dist/four-opencode-brain.js, verify forProject appears at least 2 times (definition + call site). If only 1 occurrence, method was stripped → FAIL.
  2. forService is present — verify at least 2 occurrences (definition + call site).
  3. forSession is present — verify at least 1 occurrence (definition).
  4. Brain version matches package.json — read version from package.json, verify it appears in the dist.

Integration

Add "test": "bun test" to package.json scripts.

Verification

Run bun test after build to confirm all checks pass.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions