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¶
- Add the catalogue entry and its working example in
src/catalogue.ts; the golden suite holds its drawing. - Regenerate what is generated:
node scripts/data.mjsfor locales and atlases,bun scripts/cookbook.tsfor the cookbook skill and the recipe table. Both outputs are committed. - A golden SVG changes only with
UPDATE_GOLDEN=1and a reviewed gallery.
Adding a method¶
- Declare it in
package.jsoncapabilities, with its class, accounts and operations. - Write
src/handlers/<method>.ts, and add it to the registry insrc/registry.ts. - Run
npx plugin-kit docsto regenerate the doc sections, thennpm 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.