pi-cursor-sdk 0.1.27 → 0.1.29
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +29 -0
- package/README.md +40 -37
- package/docs/crabbox-platform-testing-lessons.md +508 -0
- package/docs/cursor-dogfood-checklist.md +4 -3
- package/docs/cursor-live-smoke-checklist.md +24 -22
- package/docs/cursor-model-ux-spec.md +12 -12
- package/docs/cursor-native-tool-replay.md +10 -10
- package/docs/cursor-native-tool-visual-audit.md +9 -7
- package/docs/cursor-testing-lessons.md +22 -17
- package/docs/cursor-tool-surfaces.md +3 -3
- package/docs/platform-smoke.md +994 -0
- package/package.json +35 -6
- package/platform-smoke.config.mjs +21 -0
- package/scripts/debug-provider-events.mjs +10 -3
- package/scripts/debug-sdk-events.mjs +10 -2
- package/scripts/isolated-cursor-smoke.sh +4 -4
- package/scripts/lib/cursor-visual-render.mjs +1 -0
- package/scripts/platform-smoke/artifacts.mjs +124 -0
- package/scripts/platform-smoke/assertions.mjs +101 -0
- package/scripts/platform-smoke/card-detect.mjs +96 -0
- package/scripts/platform-smoke/crabbox-runner.mjs +215 -0
- package/scripts/platform-smoke/doctor.mjs +446 -0
- package/scripts/platform-smoke/jsonl-text.mjs +31 -0
- package/scripts/platform-smoke/live-suite-runner.mjs +677 -0
- package/scripts/platform-smoke/platform-build-windows.ps1 +187 -0
- package/scripts/platform-smoke/pty-capture.mjs +131 -0
- package/scripts/platform-smoke/render-ansi.mjs +65 -0
- package/scripts/platform-smoke/scenarios.mjs +186 -0
- package/scripts/platform-smoke/targets.mjs +900 -0
- package/scripts/platform-smoke/visual-evidence.mjs +139 -0
- package/scripts/platform-smoke.mjs +193 -0
- package/scripts/probe-mcp-coldstart.mjs +8 -1
- package/scripts/steering-rpc-smoke.mjs +1 -1
- package/scripts/tmux-live-smoke.sh +3 -3
- package/scripts/visual-tui-smoke.mjs +1 -1
- package/src/cursor-pi-tool-bridge-abort.ts +1 -0
- package/src/cursor-pi-tool-bridge-diagnostics.ts +12 -1
- package/src/cursor-pi-tool-bridge.ts +46 -1
- package/src/cursor-provider-errors.ts +18 -2
- package/src/cursor-provider-turn-lifecycle-emitter.ts +65 -8
- package/src/cursor-provider-turn-tool-ledger.ts +2 -3
- package/src/cursor-run-final-text.ts +11 -1
- package/src/cursor-sdk-process-error-guard.ts +1 -1
- package/src/cursor-state.ts +38 -19
- package/src/cursor-tool-lifecycle.ts +1 -1
- package/src/cursor-tool-manifest.ts +1 -1
- package/src/cursor-transcript-utils.ts +7 -3
|
@@ -0,0 +1,508 @@
|
|
|
1
|
+
# Crabbox Local Platform Testing Guide for pi Extensions
|
|
2
|
+
|
|
3
|
+
## Purpose
|
|
4
|
+
|
|
5
|
+
This is the reusable field guide for adding **local Crabbox platform testing** to pi extension repositories.
|
|
6
|
+
|
|
7
|
+
Current scope:
|
|
8
|
+
|
|
9
|
+
- pi extension packages only;
|
|
10
|
+
- local maintainer machine is macOS;
|
|
11
|
+
- required target matrix is macOS, Ubuntu Linux, and native Windows;
|
|
12
|
+
- Windows runs through the local Parallels template `pi-extension-windows-template` and snapshot `crabbox-ready` unless a project documents a different source of truth.
|
|
13
|
+
|
|
14
|
+
This guide is generic on purpose. Do not copy another project's model IDs, package names, API keys, VM clones, artifact folders, prompts, or release decisions. Copy the architecture and conventions, then make the target project own its config, docs, assertions, and release gate.
|
|
15
|
+
|
|
16
|
+
Official references:
|
|
17
|
+
|
|
18
|
+
- [Crabbox docs](https://crabbox.sh/)
|
|
19
|
+
- [openclaw/crabbox](https://github.com/openclaw/crabbox)
|
|
20
|
+
- Crabbox source docs worth reading before changing a harness: `docs/commands/run.md`, `docs/commands/warmup.md`, `docs/commands/stop.md`, `docs/features/doctor.md`, `docs/features/sync.md`, `docs/features/env-forwarding.md`, `docs/providers/ssh.md`, `docs/providers/local-container.md`, and `docs/providers/parallels.md`.
|
|
21
|
+
|
|
22
|
+
Local reference implementations reviewed for this guide:
|
|
23
|
+
|
|
24
|
+
- `~/Projects/AI/pi-cursor-sdk` — full provider/runtime gate with live model, visual TUI, JSONL, bridge, usage/cache, and abort-cleanup assertions.
|
|
25
|
+
- `~/Projects/AI/pi-oracle` — package/build platform gate plus project-specific real smoke, with a project-specific env prefix.
|
|
26
|
+
- `~/Projects/AI/pi-codex-goal` — compact reusable harness with platform build plus real pi runtime smoke on all targets.
|
|
27
|
+
|
|
28
|
+
## Standard local matrix
|
|
29
|
+
|
|
30
|
+
| Harness target | Crabbox provider | Local purpose | Shell contract | Default work root |
|
|
31
|
+
| --- | --- | --- | --- | --- |
|
|
32
|
+
| `macos` | `ssh` static localhost | Current host macOS | POSIX shell over SSH | `/Users/$USER/crabbox/<project>` |
|
|
33
|
+
| `ubuntu` | `local-container` | Linux smoke without cloud | POSIX shell in a Docker-compatible container | provider default `/work/crabbox` |
|
|
34
|
+
| `windows-native` | `parallels` | Real native Windows behavior | PowerShell/OpenSSH, `--windows-mode normal` | `C:\crabbox\<project>` |
|
|
35
|
+
|
|
36
|
+
Use this matrix by default for pi extensions. If a project does not need all three targets, that project's docs must say which target is non-required and why. A missing required target is a blocked local setup, not a skipped pass.
|
|
37
|
+
|
|
38
|
+
## What Crabbox owns vs. what the project owns
|
|
39
|
+
|
|
40
|
+
Crabbox owns the lease/sync/run loop:
|
|
41
|
+
|
|
42
|
+
1. lease or claim a target;
|
|
43
|
+
2. sync tracked plus nonignored local files;
|
|
44
|
+
3. run a command remotely;
|
|
45
|
+
4. stream output;
|
|
46
|
+
5. expose timing, logs, failure bundles, and cleanup commands;
|
|
47
|
+
6. stop or expire the lease.
|
|
48
|
+
|
|
49
|
+
The project owns the test contract:
|
|
50
|
+
|
|
51
|
+
- which targets and suites are required;
|
|
52
|
+
- target setup and runtime versions;
|
|
53
|
+
- package install semantics;
|
|
54
|
+
- pi commands and prompts;
|
|
55
|
+
- assertions over stdout, JSONL, visual evidence, artifacts, cleanup, and redaction;
|
|
56
|
+
- docs and release criteria.
|
|
57
|
+
|
|
58
|
+
Do not treat Crabbox as a runtime installer. If a target needs Node, npm, Git, `tar`, `rsync`, `zstd`, `ffmpeg`, a browser renderer, or another reusable tool, put that setup in the target image/template or in a documented project setup step.
|
|
59
|
+
|
|
60
|
+
## Recommended repository shape
|
|
61
|
+
|
|
62
|
+
Use names that fit the project, but keep this shape unless the project already has a better source of truth.
|
|
63
|
+
|
|
64
|
+
```text
|
|
65
|
+
platform-smoke.config.mjs
|
|
66
|
+
scripts/platform-smoke.mjs
|
|
67
|
+
scripts/platform-smoke/doctor.mjs
|
|
68
|
+
scripts/platform-smoke/crabbox-runner.mjs
|
|
69
|
+
scripts/platform-smoke/targets.mjs
|
|
70
|
+
scripts/platform-smoke/artifacts.mjs
|
|
71
|
+
scripts/platform-smoke/platform-build-windows.ps1
|
|
72
|
+
scripts/platform-smoke/<runtime-suite>.mjs # optional real pi/model smoke
|
|
73
|
+
scripts/platform-smoke/pty-capture.mjs # optional TUI/PTY suites
|
|
74
|
+
scripts/platform-smoke/render-ansi.mjs # optional host-side visual renderer
|
|
75
|
+
docs/platform-smoke.md # project source of truth
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
Gitignored local state:
|
|
79
|
+
|
|
80
|
+
```text
|
|
81
|
+
.artifacts/
|
|
82
|
+
.crabbox/
|
|
83
|
+
.debug/
|
|
84
|
+
.platform-smoke-runs/
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
Package scripts:
|
|
88
|
+
|
|
89
|
+
```json
|
|
90
|
+
{
|
|
91
|
+
"scripts": {
|
|
92
|
+
"check:platform-smoke": "node --check scripts/platform-smoke.mjs && node --check scripts/platform-smoke/doctor.mjs && node --check scripts/platform-smoke/crabbox-runner.mjs && node --check scripts/platform-smoke/targets.mjs",
|
|
93
|
+
"smoke:platform": "node scripts/platform-smoke.mjs",
|
|
94
|
+
"smoke:platform:doctor": "node scripts/platform-smoke.mjs doctor",
|
|
95
|
+
"smoke:platform:macos": "node scripts/platform-smoke.mjs run --target macos",
|
|
96
|
+
"smoke:platform:ubuntu": "node scripts/platform-smoke.mjs run --target ubuntu",
|
|
97
|
+
"smoke:platform:windows-native": "node scripts/platform-smoke.mjs run --target windows-native",
|
|
98
|
+
"smoke:platform:all": "node scripts/platform-smoke.mjs run --target macos,ubuntu,windows-native"
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
Add tests for cheap harness invariants: syntax, help text, target/suite validation, package-file inclusion or exclusion, packed-install command rendering, artifact-manifest failure behavior, cleanup-failure behavior, path traversal rejection, and secret redaction.
|
|
104
|
+
|
|
105
|
+
## Host Crabbox install
|
|
106
|
+
|
|
107
|
+
Install the Crabbox CLI on the macOS host and keep the harness explicit about the binary it uses:
|
|
108
|
+
|
|
109
|
+
```sh
|
|
110
|
+
brew install openclaw/tap/crabbox
|
|
111
|
+
crabbox --version
|
|
112
|
+
crabbox providers
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
If Homebrew already has the OpenClaw tap configured, `brew install crabbox` may resolve to the same formula. Use `PLATFORM_SMOKE_CRABBOX=/path/to/crabbox` only when testing a non-default binary or a locally built Crabbox.
|
|
116
|
+
|
|
117
|
+
## Configuration conventions
|
|
118
|
+
|
|
119
|
+
Keep project-specific defaults in `platform-smoke.config.mjs`:
|
|
120
|
+
|
|
121
|
+
```js
|
|
122
|
+
export default {
|
|
123
|
+
packageName: "pi-example-extension",
|
|
124
|
+
artifactRoot: ".artifacts/platform-smoke",
|
|
125
|
+
requiredTargets: ["macos", "ubuntu", "windows-native"],
|
|
126
|
+
requiredSuites: ["platform-build"],
|
|
127
|
+
requiredCrabbox: { minVersion: "0.24.0" },
|
|
128
|
+
ubuntuContainerImage: "cimg/node:24.16",
|
|
129
|
+
nodeValidationMajor: 24,
|
|
130
|
+
};
|
|
131
|
+
```
|
|
132
|
+
|
|
133
|
+
Use the config as the harness source of truth. Crabbox itself resolves config as `flags > env > repo .crabbox.yaml/crabbox.yaml > user config > defaults`; local smoke harnesses should still pass critical provider/work-root flags explicitly so the gate does not depend on hidden user config.
|
|
134
|
+
|
|
135
|
+
Environment conventions:
|
|
136
|
+
|
|
137
|
+
- Prefer defaults derived from `config.packageName` for project-specific work roots and slugs.
|
|
138
|
+
- Do not export project-specific work-root overrides globally.
|
|
139
|
+
- Use `PLATFORM_SMOKE_*` for reusable harness knobs when scripts are shared across projects.
|
|
140
|
+
- Use a project-specific prefix such as `PI_ORACLE_SMOKE_*` only when a repo needs to coexist with another harness or already has established project-specific environment names.
|
|
141
|
+
- Keep auth variable names in config, not auth values.
|
|
142
|
+
|
|
143
|
+
Useful standard variables:
|
|
144
|
+
|
|
145
|
+
```text
|
|
146
|
+
PLATFORM_SMOKE_CRABBOX=/opt/homebrew/bin/crabbox
|
|
147
|
+
PLATFORM_SMOKE_MAC_HOST=localhost
|
|
148
|
+
PLATFORM_SMOKE_MAC_USER=$USER
|
|
149
|
+
PLATFORM_SMOKE_MAC_WORK_ROOT=/Users/$USER/crabbox/<project>
|
|
150
|
+
PLATFORM_SMOKE_UBUNTU_IMAGE=cimg/node:24.16
|
|
151
|
+
PLATFORM_SMOKE_WINDOWS_VM=pi-extension-windows-template
|
|
152
|
+
PLATFORM_SMOKE_WINDOWS_SNAPSHOT=crabbox-ready
|
|
153
|
+
PLATFORM_SMOKE_WINDOWS_USER=<windows-ssh-user>
|
|
154
|
+
PLATFORM_SMOKE_WINDOWS_WORK_ROOT=C:\crabbox\<project>
|
|
155
|
+
```
|
|
156
|
+
|
|
157
|
+
Pin Crabbox deliberately. Exact pins are best for release-critical harnesses whose parsing depends on CLI output. Minimum version checks are fine for simpler gates. Current local baseline is Crabbox `0.24.0`.
|
|
158
|
+
|
|
159
|
+
## Target setup best practices
|
|
160
|
+
|
|
161
|
+
### macOS: static SSH to the current host
|
|
162
|
+
|
|
163
|
+
Use the `ssh` provider for current macOS. It is a static provider: Crabbox does not create or clean up the host.
|
|
164
|
+
|
|
165
|
+
Required setup:
|
|
166
|
+
|
|
167
|
+
- macOS Remote Login enabled.
|
|
168
|
+
- Noninteractive SSH works: `ssh -o BatchMode=yes $USER@localhost 'whoami'`.
|
|
169
|
+
- Target user has a writable work root such as `/Users/$USER/crabbox/<project>`.
|
|
170
|
+
- `node`, `npm`, `git`, `rsync`, `tar`, and project-specific native tools are on the remote SSH path.
|
|
171
|
+
|
|
172
|
+
Base args:
|
|
173
|
+
|
|
174
|
+
```text
|
|
175
|
+
--provider ssh
|
|
176
|
+
--target macos
|
|
177
|
+
--static-host localhost
|
|
178
|
+
--static-user $USER
|
|
179
|
+
--static-port 22
|
|
180
|
+
--static-work-root /Users/$USER/crabbox/<project>
|
|
181
|
+
```
|
|
182
|
+
|
|
183
|
+
Notes:
|
|
184
|
+
|
|
185
|
+
- Static `stop` removes Crabbox's local claim only; it does not clean the Mac.
|
|
186
|
+
- Use `--reclaim` intentionally when multiple repos reuse localhost and a previous claim blocks the run.
|
|
187
|
+
- Because this is the real host, avoid tests that mutate global user state unless the project explicitly owns cleanup.
|
|
188
|
+
|
|
189
|
+
### Ubuntu: local-container provider
|
|
190
|
+
|
|
191
|
+
Use `local-container` for the Linux target. It runs through Docker Desktop, OrbStack, Colima, or another Docker-compatible runtime on the local machine. There is no broker or cloud dependency.
|
|
192
|
+
|
|
193
|
+
Required setup:
|
|
194
|
+
|
|
195
|
+
- `docker info` passes.
|
|
196
|
+
- The chosen image supports the project's Node/npm baseline or can bootstrap quickly.
|
|
197
|
+
- Default image for current pi extension smokes: `cimg/node:24.16`.
|
|
198
|
+
|
|
199
|
+
Base args:
|
|
200
|
+
|
|
201
|
+
```text
|
|
202
|
+
--provider local-container
|
|
203
|
+
--target linux
|
|
204
|
+
--local-container-image cimg/node:24.16
|
|
205
|
+
```
|
|
206
|
+
|
|
207
|
+
Notes:
|
|
208
|
+
|
|
209
|
+
- Use a prebuilt image when first-start package bootstrapping becomes a bottleneck.
|
|
210
|
+
- Do not mount the host Docker socket unless the suite actually needs nested Docker; that grants the container access to the host daemon.
|
|
211
|
+
- Treat container cache volumes as local mutable state. Name them per project and clean obsolete keys manually.
|
|
212
|
+
|
|
213
|
+
### Windows: Parallels native Windows template
|
|
214
|
+
|
|
215
|
+
Use the `parallels` provider for native Windows. The default reusable template is:
|
|
216
|
+
|
|
217
|
+
```text
|
|
218
|
+
source VM: pi-extension-windows-template
|
|
219
|
+
snapshot: crabbox-ready
|
|
220
|
+
mode: windows normal
|
|
221
|
+
```
|
|
222
|
+
|
|
223
|
+
Base args:
|
|
224
|
+
|
|
225
|
+
```text
|
|
226
|
+
--provider parallels
|
|
227
|
+
--target windows
|
|
228
|
+
--windows-mode normal
|
|
229
|
+
--parallels-source pi-extension-windows-template
|
|
230
|
+
--parallels-source-snapshot crabbox-ready
|
|
231
|
+
--parallels-user <windows-ssh-user>
|
|
232
|
+
--parallels-work-root C:\crabbox\<project>
|
|
233
|
+
```
|
|
234
|
+
|
|
235
|
+
Template requirements:
|
|
236
|
+
|
|
237
|
+
- Parallels Tools installed.
|
|
238
|
+
- A stable SSH user.
|
|
239
|
+
- OpenSSH Server enabled and reachable on port `22`.
|
|
240
|
+
- PowerShell available.
|
|
241
|
+
- Git for Windows installed.
|
|
242
|
+
- `tar` available for archive sync.
|
|
243
|
+
- Node/npm at the project validation baseline.
|
|
244
|
+
- Writable `C:\crabbox` work root.
|
|
245
|
+
- The source VM is not used as a normal work machine.
|
|
246
|
+
- `crabbox-ready` is a known-good power-off snapshot. Linked clones depend on that snapshot, so do not delete or replace it casually.
|
|
247
|
+
|
|
248
|
+
PowerShell rules:
|
|
249
|
+
|
|
250
|
+
- Use a checked-in `.ps1` script for long Windows suites.
|
|
251
|
+
- Run with `powershell.exe -NoLogo -NoProfile -ExecutionPolicy Bypass -File .\scripts\platform-smoke\platform-build-windows.ps1`.
|
|
252
|
+
- Avoid one giant quoted `--shell` string for Windows unless it is a small probe.
|
|
253
|
+
- If installing Git or tools changes PATH, restart `sshd` or validate in a fresh SSH session.
|
|
254
|
+
|
|
255
|
+
### Windows template image policy
|
|
256
|
+
|
|
257
|
+
Agents should reuse `pi-extension-windows-template` instead of creating one-off Windows VMs for each project.
|
|
258
|
+
|
|
259
|
+
Add a tool to the template when all are true:
|
|
260
|
+
|
|
261
|
+
- more than one pi extension is likely to need it;
|
|
262
|
+
- installing it every run is slow, flaky, or network-dependent;
|
|
263
|
+
- it is safe to have globally on Windows test machines;
|
|
264
|
+
- it has no project secrets, local user auth, or repo-specific config.
|
|
265
|
+
|
|
266
|
+
Keep project-specific tools in repo scripts when they are truly one-off.
|
|
267
|
+
|
|
268
|
+
Template update runbook:
|
|
269
|
+
|
|
270
|
+
1. Prefer updating `pi-extension-windows-template` over adding per-project/per-run installers when a tool is reusable across pi extensions.
|
|
271
|
+
2. Boot the source VM, not a Crabbox clone.
|
|
272
|
+
3. Install or update the globally useful tool.
|
|
273
|
+
4. Verify from a fresh SSH session: `node --version`, `npm --version`, `git --version`, `tar --version`, and the new tool's `--version` or equivalent.
|
|
274
|
+
5. Remove caches, downloads, auth files, local checkouts, `.pi` state, `.artifacts`, `.debug`, and secrets.
|
|
275
|
+
6. Shut down the VM cleanly.
|
|
276
|
+
7. Create a new known-good power-off snapshot. Prefer a dated snapshot for trial adoption; promote it to `crabbox-ready` only after at least one project passes the Windows smoke.
|
|
277
|
+
8. Update project docs/config if the snapshot name changes.
|
|
278
|
+
9. Stop or clean stale clones after the template update so future runs do not reuse pre-update state.
|
|
279
|
+
|
|
280
|
+
Never bake API keys, browser sessions, user project checkouts, generated artifacts, or repo-specific `.env` files into the template.
|
|
281
|
+
|
|
282
|
+
## Doctor is mandatory
|
|
283
|
+
|
|
284
|
+
`npm run smoke:platform:doctor` should fail before any expensive, token-spending, or long-running suite starts. The release entrypoint should enforce this, either by making `smoke:platform:all` run doctor first or by making the canonical release command run `smoke:platform:doctor && smoke:platform:all`.
|
|
285
|
+
|
|
286
|
+
Doctor should check:
|
|
287
|
+
|
|
288
|
+
- Crabbox binary path and version/minimum version.
|
|
289
|
+
- `crabbox providers` includes `ssh`, `local-container`, and `parallels`.
|
|
290
|
+
- `crabbox doctor --provider local-container --json` passes for the configured image.
|
|
291
|
+
- `crabbox doctor --provider ssh --target macos --json` passes or reports a concrete host setup failure.
|
|
292
|
+
- Docker is running for Ubuntu.
|
|
293
|
+
- macOS SSH probe reaches the host and sees Node/npm/Git.
|
|
294
|
+
- `prlctl` exists.
|
|
295
|
+
- The Windows source VM and snapshot exist.
|
|
296
|
+
- The Windows snapshot is forkable/power-off; if the template has no live IP because it is stopped, a disposable Crabbox clone probe is acceptable.
|
|
297
|
+
- Host `node`, `npm`, `git`, `tar`, and any host-side renderer tools exist.
|
|
298
|
+
- Required auth variables for live suites are present, reported as redacted presence only.
|
|
299
|
+
- Artifact root is writable.
|
|
300
|
+
- Repo status is visible.
|
|
301
|
+
- Forbidden files such as `.env`, `.env.*`, local package tarballs, `.artifacts`, `.crabbox`, and `.debug` are not in the package or source archive.
|
|
302
|
+
|
|
303
|
+
Do not downgrade a missing required target to a warning. A release gate with missing Windows, Docker, SSH, auth, or Crabbox setup is blocked.
|
|
304
|
+
|
|
305
|
+
## Lease and run strategy
|
|
306
|
+
|
|
307
|
+
Use target sessions, not one fresh lease per suite.
|
|
308
|
+
|
|
309
|
+
Recommended shape:
|
|
310
|
+
|
|
311
|
+
```text
|
|
312
|
+
for each target in parallel:
|
|
313
|
+
warmup once with slug <project>-<target>
|
|
314
|
+
run suites serially on that lease
|
|
315
|
+
stop lease in finally
|
|
316
|
+
```
|
|
317
|
+
|
|
318
|
+
Targets can run concurrently when the host can handle Docker, localhost SSH, and Parallels together. Suites should stay serial within a target unless the project has proven its ports, sessions, workspaces, and artifacts are isolated.
|
|
319
|
+
|
|
320
|
+
Use stable slugs:
|
|
321
|
+
|
|
322
|
+
```text
|
|
323
|
+
<project>-macos
|
|
324
|
+
<project>-ubuntu
|
|
325
|
+
<project>-windows-native
|
|
326
|
+
```
|
|
327
|
+
|
|
328
|
+
Sync rules:
|
|
329
|
+
|
|
330
|
+
- Start with `crabbox sync-plan` when first onboarding a repo or when sync is unexpectedly large.
|
|
331
|
+
- Use `.gitignore`, `.crabboxignore`, or Crabbox `sync.exclude` for generated state.
|
|
332
|
+
- Use `--fresh-sync` when a target workspace may be stale or a previous suite mutated the checkout.
|
|
333
|
+
- Use `--no-sync` only after a deliberate shared prep step on the same lease.
|
|
334
|
+
- If a private/local repo cannot use remote Git seeding reliably, set `CRABBOX_SYNC_GIT_SEED=false` in the harness and document why.
|
|
335
|
+
- Do not use `--force-sync-large` unless the large transfer is understood and intentional.
|
|
336
|
+
|
|
337
|
+
Always record:
|
|
338
|
+
|
|
339
|
+
```text
|
|
340
|
+
crabbox.stdout.txt
|
|
341
|
+
crabbox.stderr.txt
|
|
342
|
+
crabbox.timing.json
|
|
343
|
+
crabbox.stop.stdout.txt
|
|
344
|
+
crabbox.stop.stderr.txt
|
|
345
|
+
crabbox.stop.exit-code.txt
|
|
346
|
+
```
|
|
347
|
+
|
|
348
|
+
A `stop` failure is a test result. Preserve the original suite result and add a failing `lease-cleanup` result or mark the owning suite failed.
|
|
349
|
+
|
|
350
|
+
## pi extension release contract
|
|
351
|
+
|
|
352
|
+
For pi extensions, the baseline `platform-build` suite should prove package installation, not only source-tree execution.
|
|
353
|
+
|
|
354
|
+
On every required target:
|
|
355
|
+
|
|
356
|
+
1. Check Node major version against `nodeValidationMajor`.
|
|
357
|
+
2. Run `npm ci`.
|
|
358
|
+
3. Run the repo's local verification command, usually `npm run verify` or the repo-specific equivalent.
|
|
359
|
+
4. Run `npm pack`.
|
|
360
|
+
5. Create a fresh target-local pi project/workspace.
|
|
361
|
+
6. Run `npm install --no-save <packed tarball>`.
|
|
362
|
+
7. Run `pi install -l ./node_modules/<package>`.
|
|
363
|
+
8. Run `pi list`.
|
|
364
|
+
9. Assert the installed package came from the packed install path.
|
|
365
|
+
10. Assert the release proof did not use `pi -e .` or `pi --extension .`.
|
|
366
|
+
|
|
367
|
+
`pi -e .` is inner-loop debug only. It is not release proof because it bypasses package contents, `files`, install layout, and publish-time mistakes.
|
|
368
|
+
|
|
369
|
+
Add a real pi runtime suite when the extension's user contract depends on runtime behavior that unit tests cannot prove. Keep it deterministic:
|
|
370
|
+
|
|
371
|
+
- install the packed package into a clean project;
|
|
372
|
+
- use a fixed model/provider unless the project config overrides it;
|
|
373
|
+
- forward only named auth env vars;
|
|
374
|
+
- write session JSONL and target-local result files;
|
|
375
|
+
- assert final assistant text, tool calls/results, extension state, and persisted files structurally, not by broad substring scans.
|
|
376
|
+
|
|
377
|
+
Add visual/TUI suites only when the extension has user-facing terminal UI. The portable visual contract is:
|
|
378
|
+
|
|
379
|
+
```text
|
|
380
|
+
target captures PTY/ConPTY ANSI
|
|
381
|
+
host renders ANSI through one xterm/Playwright renderer
|
|
382
|
+
host writes HTML + PNG evidence
|
|
383
|
+
assert rendered output, not prompt text
|
|
384
|
+
```
|
|
385
|
+
|
|
386
|
+
Do not make tmux the cross-platform visual source of truth when native Windows is required. Use PTY on POSIX targets and ConPTY on Windows.
|
|
387
|
+
|
|
388
|
+
## Artifact contract
|
|
389
|
+
|
|
390
|
+
Every suite should write a self-contained directory:
|
|
391
|
+
|
|
392
|
+
```text
|
|
393
|
+
.artifacts/platform-smoke/<run-id>/<target>/<suite>/
|
|
394
|
+
summary.json
|
|
395
|
+
artifact-manifest.json
|
|
396
|
+
target.json
|
|
397
|
+
suite.json
|
|
398
|
+
command.txt
|
|
399
|
+
exit-code.txt
|
|
400
|
+
crabbox.stdout.txt
|
|
401
|
+
crabbox.stderr.txt
|
|
402
|
+
crabbox.timing.json
|
|
403
|
+
assertions.json
|
|
404
|
+
failures.md # only when assertions fail
|
|
405
|
+
```
|
|
406
|
+
|
|
407
|
+
Add suite-specific evidence, for example:
|
|
408
|
+
|
|
409
|
+
```text
|
|
410
|
+
node-version.txt
|
|
411
|
+
npm-ci.stdout.txt
|
|
412
|
+
npm-ci.stderr.txt
|
|
413
|
+
npm-test.stdout.txt
|
|
414
|
+
npm-test.stderr.txt
|
|
415
|
+
packed-tarball.txt
|
|
416
|
+
packed-node-install.stdout.txt
|
|
417
|
+
packed-node-install.stderr.txt
|
|
418
|
+
pi-install.stdout.txt
|
|
419
|
+
pi-install.stderr.txt
|
|
420
|
+
pi-list.stdout.txt
|
|
421
|
+
pi-list.stderr.txt
|
|
422
|
+
session.jsonl
|
|
423
|
+
terminal.ansi
|
|
424
|
+
terminal.html
|
|
425
|
+
terminal.png
|
|
426
|
+
redaction-scan.json
|
|
427
|
+
```
|
|
428
|
+
|
|
429
|
+
Pass/fail invariant:
|
|
430
|
+
|
|
431
|
+
```text
|
|
432
|
+
summary.ok === assertions.ok
|
|
433
|
+
artifact-manifest.missing.length === 0 for any passing suite
|
|
434
|
+
missing required artifact => assertion failure + summary.ok=false
|
|
435
|
+
```
|
|
436
|
+
|
|
437
|
+
Do not rely on Crabbox `--artifact-glob` for this matrix. Crabbox's SSH artifact collector is useful on Linux, but native Windows and macOS targets reject that collector. A portable harness should write host-side artifact files from captured stdout/stderr, explicit target output markers, session paths, or a safe target-produced bundle whose paths are validated before unpacking.
|
|
438
|
+
|
|
439
|
+
## Secrets and environment forwarding
|
|
440
|
+
|
|
441
|
+
Crabbox intentionally does not forward your whole environment to the remote target. By default it forwards only narrow built-ins such as `CI` and `NODE_OPTIONS`. Live pi suites must opt in to exactly the variables they need.
|
|
442
|
+
|
|
443
|
+
Local forwarding of secrets is acceptable for these maintainer-owned smoke gates when the suite needs real provider/model auth. The hard line is persistence and sharing: secrets must never be committed, baked into templates, written to artifacts, printed in docs/PRs, or posted in chat.
|
|
444
|
+
|
|
445
|
+
Best practices:
|
|
446
|
+
|
|
447
|
+
- Keep auth values out of docs, configs, shell commands, artifact names, and template images.
|
|
448
|
+
- Store auth variable names in config, e.g. `defaultAuthEnv: ["ZAI_API_KEY"]`.
|
|
449
|
+
- Forward only named auth variables with `--allow-env NAME` or `--env-from-profile <file> --allow-env NAME`.
|
|
450
|
+
- Do not pass API keys as command-line arguments.
|
|
451
|
+
- Preserve normal local process environment such as `PATH`, `HOME`, and tool configuration, but do not dump the full environment into artifacts.
|
|
452
|
+
- Redact stdout, stderr, JSONL, HTML, ANSI, debug files, and failure bundles before committing, publishing, posting, or sharing them.
|
|
453
|
+
- Fail if a redaction scan finds API keys, bearer tokens, cookies, auth headers, or raw `.env` contents in persisted artifacts.
|
|
454
|
+
|
|
455
|
+
Docs may say `CURSOR_API_KEY=(present, redacted)` or `ZAI_API_KEY=(present, redacted)`. They must never include values.
|
|
456
|
+
|
|
457
|
+
## Make false green states impossible
|
|
458
|
+
|
|
459
|
+
The main guardrails:
|
|
460
|
+
|
|
461
|
+
- `doctor` is required before `all`.
|
|
462
|
+
- Required targets do not skip green.
|
|
463
|
+
- Release proof uses packed install, not `pi -e .`.
|
|
464
|
+
- A suite cannot pass with missing required artifacts.
|
|
465
|
+
- Cleanup failures fail the target result.
|
|
466
|
+
- Visual assertions inspect rendered output, not only prompt text.
|
|
467
|
+
- JSONL assertions inspect specific message fields, not all-file substrings.
|
|
468
|
+
- Auth is forwarded to targets by explicit allowlist only.
|
|
469
|
+
- Secrets can be used locally, but artifacts/docs/comments never expose them.
|
|
470
|
+
- Target-specific assumptions live in `docs/platform-smoke.md`, not in chat.
|
|
471
|
+
|
|
472
|
+
## Adoption procedure for a new pi extension
|
|
473
|
+
|
|
474
|
+
1. Identify the package name and pi install path.
|
|
475
|
+
2. Define required targets: default to `macos`, `ubuntu`, and `windows-native`.
|
|
476
|
+
3. Define required suites: always start with `platform-build`; add runtime or visual suites only for real user contracts.
|
|
477
|
+
4. Add `platform-smoke.config.mjs` with package name, targets, suites, Crabbox version, Ubuntu image, and Node baseline.
|
|
478
|
+
5. Add `scripts/platform-smoke.mjs` with `doctor`, per-target, and `all` commands.
|
|
479
|
+
6. Add a thin `crabbox-runner.mjs` that owns target base args, warmup, run, timeout, env allowlist, and stop.
|
|
480
|
+
7. Add target command builders in `targets.mjs`; keep POSIX and PowerShell paths explicit.
|
|
481
|
+
8. Add `platform-build-windows.ps1` for the Windows suite body.
|
|
482
|
+
9. Add `artifacts.mjs` and make missing artifacts fail.
|
|
483
|
+
10. Add `doctor.mjs`; all required local prerequisites fail hard.
|
|
484
|
+
11. Add cheap tests for harness syntax, help, target selection, packed-install command rendering, manifest failure, cleanup failure, and package inclusion/exclusion.
|
|
485
|
+
12. Add `docs/platform-smoke.md` as the project-specific source of truth.
|
|
486
|
+
13. Add a short pointer in `AGENTS.md` and README if the platform gate is release-blocking.
|
|
487
|
+
14. Run `npm run check:platform-smoke`, then `npm run smoke:platform:doctor`, then a single target, then `npm run smoke:platform:all`.
|
|
488
|
+
|
|
489
|
+
## Project adoption checklist
|
|
490
|
+
|
|
491
|
+
Before declaring a project integrated, answer these in that project's docs:
|
|
492
|
+
|
|
493
|
+
1. What package/install path must release prove?
|
|
494
|
+
2. Which OS targets are release-blocking?
|
|
495
|
+
3. What exact Crabbox version or minimum version is supported?
|
|
496
|
+
4. Which Ubuntu image is used?
|
|
497
|
+
5. Which Parallels template and snapshot are used?
|
|
498
|
+
6. What target tools are expected globally, especially on Windows?
|
|
499
|
+
7. What suite proves packed pi install?
|
|
500
|
+
8. What suite, if any, proves real pi runtime behavior?
|
|
501
|
+
9. What visual evidence, if any, is required?
|
|
502
|
+
10. What auth env names are allowed to cross into targets?
|
|
503
|
+
11. What artifacts must exist for a pass?
|
|
504
|
+
12. What redaction scans run before sharing evidence?
|
|
505
|
+
13. How are lease cleanup failures surfaced?
|
|
506
|
+
14. Which docs, package scripts, and tests are the source of truth?
|
|
507
|
+
|
|
508
|
+
The standard is not "copy every file from pi-cursor-sdk." The standard is: define the platform failure modes that matter for the extension, then make the local Crabbox gate produce durable evidence for them on macOS, Ubuntu, and native Windows without sharing state between repositories.
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
# Cursor dogfood checklist
|
|
2
2
|
|
|
3
|
-
Short maintainer checklist for **minimal-surface** validation after prompt, bridge, replay, or manifest changes. This is the fast path from pi-cursor-composer dogfood sessions—not a substitute for the
|
|
3
|
+
Short maintainer checklist for **minimal-surface** validation after prompt, bridge, replay, or manifest changes. This is the fast path from pi-cursor-composer dogfood sessions—not a substitute for the required [platform smoke gate](./platform-smoke.md).
|
|
4
4
|
|
|
5
5
|
## Minimal environment
|
|
6
6
|
|
|
7
|
-
- Extension only: `pi -e . --cursor-no-fast --model cursor/composer-2
|
|
7
|
+
- Extension only: `pi -e . --cursor-no-fast --model cursor/composer-2-5`
|
|
8
8
|
- Fresh session dir: `--session-dir /tmp/pi-cursor-dogfood-<id>`
|
|
9
9
|
- Baseline surface (no ambient Cursor MCP/rules):
|
|
10
10
|
- `PI_CURSOR_SETTING_SOURCES=none`, **or**
|
|
@@ -53,5 +53,6 @@ Canonical visual evidence: `npm run smoke:visual` (see [Cursor native tool visua
|
|
|
53
53
|
## Related docs
|
|
54
54
|
|
|
55
55
|
- [Cursor tool surfaces in pi](./cursor-tool-surfaces.md) — three namespaces and discoverability
|
|
56
|
-
- [
|
|
56
|
+
- [Platform smoke gate](./platform-smoke.md) — required cross-platform release gate
|
|
57
|
+
- [Cursor live smoke checklist](./cursor-live-smoke-checklist.md) — inner-loop/manual debug checks
|
|
57
58
|
- [Cursor testing lessons](./cursor-testing-lessons.md) — auth, JSONL scans, plan-mode traps
|