Skip to content

Testing

The repository has one local entry point, npm run check, which CI runs unchanged. It runs every stage in order and stops at the first failure.

Set up

npm ci
npx playwright-core install --only-shell chromium   # once; on Linux add --with-deps
npm run check

Node 24 and Bun 1.4.4 are what CI uses. The browser stage needs playwright-core's headless Chromium, at the build the exact playwright-core version in package-lock.json pins.

The stages

Stage Checks
bundle Writes dist/: the entry, the lazy renderer, the worker, the TUI and the browser runtimes.
typecheck tsc over the repository.
kit plugin-kit check: conformance T0 and T1, the doc file set, forbidden text and no bundled kit.
record The conformance fixture holds no secret or personal data.
unit The unit suites in test/ and test/unit/.
browser Interactive HTML made through the built plugin in headless Chromium: each page starts under its own CSP with no violation and no request.
evals Every catalogue example renders to a checked picture, and the advice gates hold against the committed baseline.
host A stock OpenCode 2.4.1 binary loads the built plugin from a local path.
pack The packed package holds what it should.

A stage never skips in CI. A missing Chromium or a missing host binary fails the run, because a release that did not run is not evidence.

The browser and host stages

The browser stage installs playwright-core's headless Chromium; the browser stage is the run. The host stage needs OPENCODE_BIN_2_4_1, or the binary under $OPENCODE_STOCK_ROOT/2.4.1; CI installs the stock 2.4.1 package itself.

Adding a chart

  1. Add the catalogue entry and its working example in src/catalogue.ts; the golden suite holds its drawing.
  2. Regenerate what is generated: node scripts/data.mjs for locales and atlases, bun scripts/cookbook.ts for the cookbook skill and the recipe table. Both outputs are committed.
  3. A golden SVG changes only with UPDATE_GOLDEN=1 and a reviewed gallery.

Adding a method

  1. Declare it in package.json capabilities, with its class, accounts and operations.
  2. Write src/handlers/<method>.ts, and add it to the registry in src/registry.ts.
  3. Run npx plugin-kit docs to regenerate the doc sections, then npm run check.

Text

Model-facing text and docs describe what the code does now: no process narrative, no internal decision references, no machine-local paths, no secrets. An error is CODE: what happened. Next step: what to do.