Skip to content

Testing

You need Node 24.

npm ci --ignore-scripts
npm run check

npm run check is the whole gate, in the order CI runs it:

Step What it proves
npm run fetch:gws the pinned gws 0.22.5 executable is downloaded and verified for this platform
npm run lint @biomejs/biome finds no lint error
npm run typecheck the sources and the tests typecheck under strict settings
npm run bundle dist/index.js is bundled from src/index.ts with esbuild, and the committed file must match
npm test the unit tests under test/unit
npx plugin-kit check the manifest, methods, accounts, sources, bus, status, and conformance T0 and T1
npx plugin-kit record --check fixtures/conformance.json matches what the handlers answer
npm run test:host the built bundle in the real OpenCode 2.4.1 host
npm run test:pack the packed tarball installs and starts
npx plugin-kit docs --check every generated doc section is current

npx plugin-kit conformance runs the whole conformance report on its own, and npm run manifest:check proves manifest/generated.json was generated from the pinned catalog.

The suites

Suite Proves
test/unit the manifest's shape, the handlers and their refusals, the operation pipeline, the policy and recipient rules, the plans, the executable's provenance, the sources and every error code
test/host the built bundle in the real OpenCode 2.4.1 host through the contract's harness: id, namespace, tools, RPC, status, the access rules and the skills
test/support the shared config and request helpers the other suites use
scripts/pack-smoke.mjs the tarball npm pack builds, and that its entry loads

Fixtures

fixtures/conformance.json is the plugin's evidence to the conformance kit, recorded from the synthetic accounts and the plugin's own handlers. The kit replays it, so a changed answer fails the gate instead of drifting. Record from a real account with:

npx plugin-kit record --account <alias>

The kit redacts credentials, emails, phone numbers and home directories before it writes. Read the diff before committing it: the fixture must carry no credential and no person's data.

The contract pin

package.json pins the contract to github:we-the-rebel-alliance/plugin-contract#v0.2.0. Move the pin to the contract's next release tag; never follow a branch, and never copy a contract module into this repository.

The lock records the contract's repository over git+ssh, as npm writes a GitHub dependency. CI rewrites that URL to HTTPS because a runner has no SSH key; do the same locally if npm ci cannot reach GitHub.

Contributing

CONTRIBUTING.md has the pull request rules, the manifest-first order for a new capability and the fixture rules.