pi-oracle uses Crabbox for the local release-blocking platform gate. The gate runs on macOS, Ubuntu Linux, and native Windows and is meant to catch broken package installs, platform assumptions, and real pi tool-call failures before push or publish.
- Config:
../platform-smoke.config.mjs - CLI:
../scripts/platform-smoke.mjs - Target runner:
../scripts/platform-smoke/targets.mjs - Windows build script:
../scripts/platform-smoke/platform-build-windows.ps1 - Real runtime smoke:
../scripts/oracle-real-smoke.mjs - Artifact root:
.artifacts/platform-smoke/(gitignored)
Required targets: macos, ubuntu, windows-native.
Required suites: platform-build, real-extension.
Crabbox baseline: 0.26.0 or newer.
Install Crabbox with Homebrew and keep it on PATH:
brew install openclaw/tap/crabbox
crabbox --version
crabbox providersPLATFORM_SMOKE_CRABBOX is the reusable binary override. PI_ORACLE_SMOKE_CRABBOX is a project-specific alias and wins when both are set.
Target setup:
- macOS: Remote Login enabled; noninteractive
ssh $USER@localhostworks;node,npm,git,tar,rsync,zstd, andagent-browserare on the SSH PATH. - Ubuntu: Docker is running and the configured image (
PI_ORACLE_SMOKE_UBUNTU_IMAGE, defaultpi-oracle-platform-smoke:node24) hasnode,npm,git,tar,rsync,zstd, andagent-browseron PATH. Build the local image when needed withdocker build -t pi-oracle-platform-smoke:node24 -f scripts/platform-smoke/Dockerfile.ubuntu .. - Windows native: Parallels has stopped source VM
pi-extension-windows-templateand the configured power-off snapshot (crabbox-readyby default for this repo). The template must have OpenSSH, PowerShell, Git, Node/npm,tar,zstd, andagent-browseron PATH. Do not bake API keys, browser sessions, project checkouts,.pistate, artifacts, or secrets into the template.
Real runtime suite auth:
- Default deterministic installed-tool smoke does not require provider API keys.
- Provider/model defaults remain
zai/glm-5.2for optional model-agent debugging. - Set
PI_ORACLE_REAL_TEST_MODEL_AGENT=1to run the slower model-agent path; then the provider auth env is required (ZAI_API_KEYby default, reported only as present/redacted). - Override with
PI_ORACLE_REAL_TEST_PROVIDERandPI_ORACLE_REAL_TEST_MODEL; auth variable names live inplatform-smoke.config.mjs.
Use the narrowest workflow that proves the change. Do not run the full platform matrix for ordinary edits when the local gate and cheap invariants prove the change.
| Situation | Canonical command(s) | What it proves |
|---|---|---|
| Everyday local iteration | npm run verify:oracle |
Syntax, bundle, platform-smoke invariants, type checks, oracle sanity, and package dry-run pass locally. |
| Platform-sensitive change | npm run smoke:platform:doctor, then node scripts/platform-smoke.mjs run --target <target> --suite <suite> |
Target setup is ready and the affected platform/suite works without paying for unrelated targets. |
| Platform matrix proof | npm run smoke:platform:all |
Doctor-first packed-install proof passes on every required target and suite. |
| ChatGPT preset release proof | npm run release:proof:chatgpt-presets |
Fresh loaded-extension proof exists for every canonical ChatGPT preset. |
| Publish/release gate | npm run release:check |
Local verification (verify:oracle) passes, fresh ChatGPT preset proof exists, then the doctor-first platform matrix passes. |
Platform-sensitive changes include archive behavior, process cleanup, runtime/browser profile handling, package metadata, Crabbox harness code, or anything that may differ across macOS/Linux/Windows.
Doctor is mandatory before the full platform matrix. The canonical all-target platform command enforces that:
npm run smoke:platform:allFocused commands:
npm run smoke:platform:doctor
npm run smoke:platform:macos
npm run smoke:platform:ubuntu
npm run smoke:platform:windows-native
node scripts/platform-smoke.mjs run --target windows-native --suite real-extensionFull release gate:
npm run release:checkrelease:check runs verify:oracle, then release:proof:chatgpt-presets, then smoke:platform:all, matching the release order: cheap harness checks, fresh live ChatGPT preset proof, doctor, full matrix, then artifact review. prepublishOnly runs npm run release:check.
On each required target, platform-build:
- checks Node major version against
nodeValidationMajor; - runs
npm ci; - requires target tools (
zstd,agent-browser) to already be available from target setup; - runs
npm run verify:oracle:platform, the platform-focused gate for syntax, platform-smoke invariants, real-smoke script syntax, platform-sensitive oracle sanity coverage, and package dry-run; - runs
npm pack; - creates a fresh target-local pi project;
- runs
npm install --no-save <packed tarball>; - runs
pi install -l ./node_modules/pi-oracle --approveso Pi 0.79+ project-trust gating intentionally trusts the temporary fixture; - runs
pi list --approve; - asserts the installed package came from
node_modules/pi-oracleand did not usepi -e/ source-extension shortcuts.
real-extension is required release proof. It runs npm run smoke:real:packed on each target, which:
- packs this checkout with
npm pack; - installs the tarball into a clean pi project;
- runs
pi install -l ./node_modules/pi-oracle --approve; - asserts
pi list --approveshows the packed install path; - executes
oracle_submitfrom the installed package path, not sourcepi -e; - asserts whole-project archive creation and default exclusions.
The default runtime suite executes the installed tool directly so platform proof is deterministic and bounded instead of waiting on a model turn. Set PI_ORACLE_REAL_TEST_MODEL_AGENT=1 only when you specifically need to debug the slower model-agent path. Symlink escape rejection and other negative archive cases are covered by npm run sanity:oracle; the optional second-agent negative check is available with PI_ORACLE_REAL_TEST_NEGATIVE_SYMLINK=1 when debugging that path.
For inner-loop/debug only, use:
npm run smoke:real:sourceThat source-mode smoke loads extensions/oracle/index.ts with pi --approve --no-extensions -e; it is useful while developing but is not release proof.
Each suite writes reviewable evidence under:
.artifacts/platform-smoke/<run-id>/<target>/<suite>/
summary.json
target.json
suite.json
command.txt
exit-code.txt
crabbox.stdout.txt
crabbox.stderr.txt
crabbox.timing.json
crabbox.stop.stdout.txt
crabbox.stop.stderr.txt
crabbox.stop.exit-code.txt
assertions.json
artifact-manifest.json
failures.md # only on failure
platform-build also writes packed install extracts (packed-tarball.txt, packed-node-install.*, pi-install.*, pi-list.*). Passing suites require summary.ok === true, assertions.ok === true, and artifact-manifest.missing.length === 0.
Artifacts are local evidence only. Do not commit or share them without redaction. Secret scans fail on bearer/API-key/cookie-like values.
When Windows lacks a reusable tool such as zstd or agent-browser, update the shared pi-extension-windows-template infrastructure rather than adding a per-run installer:
- revert/switch
pi-extension-windows-templateto the current canonicalcrabbox-readysnapshot; - boot the template;
- install/update the reusable tool globally without secrets;
- verify from a fresh SSH session:
node --version,npm --version,git --version,tar --version,zstd --version,agent-browser --version, andagent-browser install; - remove downloads, caches, checkouts,
.pi,.artifacts,.debug, browser auth/session state, and secrets; - shut down cleanly;
- create/promote the configured power-off
crabbox-readysnapshot; - run
npm run smoke:platform:doctorandnpm run smoke:platform:windows-nativeagainst the promoted snapshot; - clean stale clones/leases.