@emmaneugene/pi-cursor-sdk 0.3.7 → 0.4.1
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 +22 -0
- package/README.md +99 -126
- package/dist/cursor-agents-context-registration.js +1 -3
- package/dist/cursor-agents-context.js +2 -2
- package/dist/cursor-config.js +2 -290
- package/dist/cursor-extension-factory-guard.js +31 -0
- package/dist/cursor-pi-tool-bridge-server.js +3 -0
- package/dist/cursor-pi-tool-bridge.js +5 -0
- package/dist/cursor-provider-errors.js +3 -58
- package/dist/cursor-provider-live-run-drain.js +0 -3
- package/dist/cursor-provider-run-finalizer.js +4 -7
- package/dist/cursor-provider-run-outcome.js +1 -1
- package/dist/cursor-provider-turn-finalize.js +3 -55
- package/dist/cursor-provider-turn-prepare.js +8 -144
- package/dist/cursor-provider-turn-runner.js +9 -23
- package/dist/cursor-provider-turn-send.js +8 -35
- package/dist/cursor-runtime-state.js +6 -268
- package/dist/cursor-sdk-billed-usage.js +3 -18
- package/dist/cursor-sdk-platform-package.js +88 -0
- package/dist/cursor-session-agent.js +18 -14
- package/dist/cursor-skill-tool.js +12 -22
- package/dist/cursor-state.js +5 -8
- package/dist/cursor-usage-accounting.js +1 -1
- package/dist/index.js +65 -49
- package/docs/cursor-dogfood-checklist.md +4 -4
- package/docs/cursor-live-smoke-checklist.md +24 -24
- package/docs/cursor-model-ux-spec.md +27 -30
- package/docs/cursor-native-tool-replay.md +4 -4
- package/docs/cursor-native-tool-visual-audit.md +10 -10
- package/docs/cursor-testing-lessons.md +38 -16
- package/docs/cursor-tool-surfaces.md +2 -4
- package/docs/platform-smoke-implementation.md +5 -5
- package/docs/platform-smoke.md +28 -73
- package/node_modules/cross-spawn/node_modules/which/CHANGELOG.md +166 -0
- package/package.json +3 -17
- package/platform-smoke.config.mjs +2 -1
- package/scripts/lib/cursor-visual-render.mjs +12 -2
- package/scripts/lib/local-resume-smoke-harness.mjs +0 -18
- package/scripts/platform-smoke/card-detect.mjs +1 -1
- package/scripts/platform-smoke/local-resume-runner.mjs +1 -1
- package/scripts/platform-smoke/scenarios.mjs +1 -1
- package/scripts/platform-smoke/targets.mjs +14 -5
- package/scripts/visual-tui-smoke-self-test.mjs +9 -33
- package/scripts/visual-tui-smoke.mjs +54 -11
- package/src/cursor-agents-context-registration.ts +0 -5
- package/src/cursor-agents-context.ts +1 -3
- package/src/cursor-config.ts +8 -379
- package/src/cursor-extension-factory-guard.ts +57 -0
- package/src/cursor-pi-tool-bridge-server.ts +4 -0
- package/src/cursor-pi-tool-bridge.ts +5 -0
- package/src/cursor-provider-errors.ts +2 -62
- package/src/cursor-provider-live-run-drain.ts +0 -3
- package/src/cursor-provider-run-finalizer.ts +4 -12
- package/src/cursor-provider-run-outcome.ts +0 -3
- package/src/cursor-provider-turn-finalize.ts +3 -61
- package/src/cursor-provider-turn-prepare.ts +8 -165
- package/src/cursor-provider-turn-runner.ts +15 -31
- package/src/cursor-provider-turn-send.ts +7 -38
- package/src/cursor-provider-turn-types.ts +9 -30
- package/src/cursor-runtime-state.ts +6 -345
- package/src/cursor-sdk-billed-usage.ts +3 -24
- package/src/cursor-sdk-platform-package.ts +106 -0
- package/src/cursor-session-agent.ts +16 -12
- package/src/cursor-skill-tool.ts +10 -26
- package/src/cursor-state.ts +5 -10
- package/src/cursor-usage-accounting.ts +1 -3
- package/src/index.ts +70 -49
- package/dist/cursor-cloud-lifecycle.js +0 -650
- package/dist/cursor-cloud-local-state.js +0 -460
- package/dist/cursor-cloud-options.js +0 -145
- package/dist/cursor-cloud-reporting.js +0 -222
- package/dist/cursor-ripgrep-path.js +0 -27
- package/scripts/cloud-runtime-smoke.d.mts +0 -42
- package/scripts/cloud-runtime-smoke.mjs +0 -623
- package/scripts/lib/cloud-smoke-artifacts.d.mts +0 -16
- package/scripts/lib/cloud-smoke-artifacts.mjs +0 -94
- package/scripts/lib/cloud-smoke-cleanup-evidence.d.mts +0 -209
- package/scripts/lib/cloud-smoke-cleanup-evidence.mjs +0 -585
- package/scripts/lib/cloud-smoke-github.d.mts +0 -78
- package/scripts/lib/cloud-smoke-github.mjs +0 -331
- package/scripts/lib/cloud-smoke-pi-runner.d.mts +0 -42
- package/scripts/lib/cloud-smoke-pi-runner.mjs +0 -214
- package/scripts/lib/cloud-smoke-shutdown.d.mts +0 -67
- package/scripts/lib/cloud-smoke-shutdown.mjs +0 -133
- package/shared/cursor-cloud-lifecycle-constants.d.mts +0 -3
- package/shared/cursor-cloud-lifecycle-constants.mjs +0 -7
- package/src/cursor-cloud-lifecycle.ts +0 -733
- package/src/cursor-cloud-local-state.ts +0 -536
- package/src/cursor-cloud-options.ts +0 -182
- package/src/cursor-cloud-reporting.ts +0 -267
- package/src/cursor-ripgrep-path.ts +0 -32
|
@@ -39,7 +39,7 @@ PI_CURSOR_MCP_CONNECT_TIMEOUT_MS=5000 pi --model cursor/grok-4.6
|
|
|
39
39
|
PI_CURSOR_PI_TOOL_BRIDGE_DEBUG=1 pi --model cursor/grok-4.6
|
|
40
40
|
```
|
|
41
41
|
|
|
42
|
-
`PI_CURSOR_ASK_QUESTION=0` disables only `cursor_ask_question` / `pi__cursor_ask_question`, leaving the rest of the pi bridge available; it is enabled by default. `PI_CURSOR_PI_TOOL_BRIDGE=0` disables the bridge, including `pi__cursor_ask_question`. `PI_CURSOR_EXPOSE_BUILTIN_TOOLS=1` opts in to exposing overlapping pi tool names that Cursor already has native equivalents for (`read`, `bash`, `write`, `edit`, `grep`, `find`, and `ls`). By default those names are hidden even when pi's Cursor replay wrapper has registered them as extension tools; non-overlapping active built-ins remain bridgeable by default. The installed Cursor SDK uses a 60-second MCP protocol default; pi-cursor-sdk overrides that seam by default with 3600 seconds for MCP `callTool` requests and 10 seconds for verified initialize/listTools requests on first send. Bridged calls also have a local fail-closed deadline capped by the effective MCP tool timeout; lower it with `PI_CURSOR_PI_BRIDGE_CALL_TIMEOUT_MS` to reject stale pending state and abort active pi execution sooner. Unknown MCP protocol timeout stacks keep the SDK default. `PI_CURSOR_PI_TOOL_BRIDGE_DEBUG=1` emits typed, allowlisted, scrubbed single-line JSONL bridge diagnostics to `process.stderr` with prefix `[pi-cursor-sdk:bridge]`; it is off by default, uses run-safe IDs that are not reused in endpoint paths, and does not print endpoint URLs/path components/tokens, raw args/results, file contents, or secrets. Cursor-native tools, Cursor settings, plugins, and configured Cursor MCP servers still come from the Cursor SDK local agent path.
|
|
42
|
+
`PI_CURSOR_ASK_QUESTION=0` disables only `cursor_ask_question` / `pi__cursor_ask_question`, leaving the rest of the pi bridge available; it is enabled by default. `PI_CURSOR_PI_TOOL_BRIDGE=0` disables the bridge, including `pi__cursor_ask_question`. `PI_CURSOR_EXPOSE_BUILTIN_TOOLS=1` opts in to exposing overlapping pi tool names that Cursor already has native equivalents for (`read`, `bash`, `write`, `edit`, `grep`, `find`, and `ls`). By default those names are hidden even when pi's Cursor replay wrapper has registered them as extension tools; non-overlapping active built-ins remain bridgeable by default. The installed Cursor SDK uses a 60-second MCP protocol default; pi-cursor-sdk overrides that seam by default with 3600 seconds for MCP `callTool` requests and 10 seconds for verified initialize/listTools requests on first send. Bridged calls also have a local fail-closed deadline capped by the effective MCP tool timeout; lower it with `PI_CURSOR_PI_BRIDGE_CALL_TIMEOUT_MS` to reject stale pending state and abort active pi execution sooner. Unknown MCP protocol timeout stacks keep the SDK default. `PI_CURSOR_PI_TOOL_BRIDGE_DEBUG=1` emits typed, allowlisted, scrubbed single-line JSONL bridge diagnostics to `process.stderr` with prefix `[pi-cursor-sdk:bridge]`; it is off by default, uses run-safe IDs that are not reused in endpoint paths, and does not print endpoint URLs/path components/tokens, raw args/results, file contents, or secrets. Cursor-native tools, Cursor settings, plugins, and configured Cursor MCP servers still come from the Cursor SDK local agent path.
|
|
43
43
|
|
|
44
44
|
## What gets replayed
|
|
45
45
|
|
|
@@ -64,13 +64,13 @@ When Cursor reports completed tool activity, the extension can display recorded
|
|
|
64
64
|
|
|
65
65
|
Cursor `glob` activity is displayed through native `find` cards.
|
|
66
66
|
|
|
67
|
-
For the full `@cursor/sdk@1.0.
|
|
67
|
+
For the full `@cursor/sdk@1.0.30` `ToolType` set, disposition matrix, and runtime alias normalization, see [SDK ToolType replay matrix](#sdk-tooltype-replay-matrix) below. Official SDK reference: https://cursor.com/docs/sdk/typescript
|
|
68
68
|
|
|
69
69
|
Edit and write activity replays through pi-facing `edit` and `write` cards only when replay arguments truthfully satisfy the matching pi schema, but still uses recorded Cursor results only. The adapter passes through truthful Cursor paths, content when Cursor reported it, and recorded diff/details; it does not pretend Cursor's editing schema is pi's schema and it fails closed if a recorded replay result is missing. Cursor `StrReplace` with recorded replacement text displays as native-looking `edit`; path-only Cursor `edit` and notebook edit activity fall back to neutral Cursor activity so pi does not reject the replay before recorded-result handling. Cursor `write` displays as native-looking `write`. Diagnostics, delete, todos/plans, task/subagent, image, MCP, semantic search, screen recording, and web search/fetch activity use neutral Cursor activity cards with pi's default success/error tool shell. Cursor SDK `task` activity is labeled **Cursor subagent** by default because it represents Cursor-spawned child-agent work; `PI_CURSOR_TASK_PRESENTATION=task` keeps the older **Cursor task** wording for comparison. MCP completions whose `toolName` is `WebSearch` / `web_search` / `WebFetch` / similar are labeled **Cursor web search** or **Cursor web fetch** instead of generic **Cursor MCP**. Neutral Cursor activity cards carry display metadata such as `activityTitle` and `activitySummary`, so partial/collapsed cards can say `Cursor plan`, `Cursor todos`, `Cursor subagent`, `Cursor MCP`, `Cursor semantic search`, `Cursor screen recording`, `Cursor web search`, `Cursor web fetch`, or `Cursor edit` instead of only `Cursor activity`. These replay tools only display recorded Cursor results; they never mutate files or execute tool work directly. Replay paths are normalized to workspace-relative paths when possible. Most collapsed replay cards include bounded previews for diffs and text details so small edits, todos, task output, and MCP results are visible without expanding; web search/fetch activity stays summary-only while collapsed because those cards often arrive after final text and can otherwise bury the answer. Ctrl+O expansion shows the recorded details. Edit previews omit raw unified diff headers and show compact numbered changed/context lines using pi's native diff added/removed/context colors, and write previews use syntax highlighting when pi can infer a language from the path. Image generation replay cards show the saved image path in the collapsed summary and render the image inline when pi terminal image display is enabled and the generated file is still readable.
|
|
70
70
|
|
|
71
71
|
## SDK ToolType replay matrix
|
|
72
72
|
|
|
73
|
-
Source of truth for SDK tool names: `@cursor/sdk@1.0.
|
|
73
|
+
Source of truth for SDK tool names: `@cursor/sdk@1.0.30` conversation `ToolType` values and https://cursor.com/docs/sdk/typescript
|
|
74
74
|
|
|
75
75
|
Implementation owners: `src/cursor-tool-presentation-registry.ts` (canonical names, labels, visibility, replay policy, bridge exclusions for internal replay wrappers, alias normalization, and display-spec key completeness), `src/cursor-transcript-tool-specs.ts` (registry-keyed display implementations for transcript formatting and pi display builders), `src/cursor-native-tool-display-replay.ts` (replay card rendering derived from registry replay metadata), and `src/cursor-web-tool-activity.ts` (MCP/web alias remapping before display lookup).
|
|
76
76
|
|
|
@@ -184,7 +184,7 @@ Lifecycle rules:
|
|
|
184
184
|
|
|
185
185
|
As Cursor SDK tool completions arrive, the extension mirrors native Codex ordering by ending a tool-use turn, letting pi render the recorded tool results, then continuing with live post-tool Cursor thinking/text, later Cursor tool batches, or Cursor's final answer as the next assistant turn. For plan-mode runs, neutral Cursor plan/todo cards can therefore appear before the final Cursor plan text.
|
|
186
186
|
|
|
187
|
-
Bridged pi tool calls follow the same visible pi `toolUse` turn shape, but they are real pi tool executions rather than replayed Cursor results. Local usage accounting uses per-turn raw Cursor SDK `turn-ended.usage` when available before the corresponding pi turn is emitted, including cache read/write fields; observed local full-prompt/partition semantics map into disjoint pi input/cache components and set `usage.totalTokens = inputTokens + outputTokens` for occupancy (distinct from published SDK `toTokenUsage` additive totals). If the local SDK reports no usage in time, the provider falls back to local `input/output` activity estimates with `usage.totalTokens` set to the current replayable context estimate, then ignores later usage for that live run rather than risk applying stale usage to the wrong pi turn.
|
|
187
|
+
Bridged pi tool calls follow the same visible pi `toolUse` turn shape, but they are real pi tool executions rather than replayed Cursor results. Local usage accounting uses per-turn raw Cursor SDK `turn-ended.usage` when available before the corresponding pi turn is emitted, including cache read/write fields; observed local full-prompt/partition semantics map into disjoint pi input/cache components and set `usage.totalTokens = inputTokens + outputTokens` for occupancy (distinct from published SDK `toTokenUsage` additive totals). If the local SDK reports no usage in time, the provider falls back to local `input/output` activity estimates with `usage.totalTokens` set to the current replayable context estimate, then ignores later usage for that live run rather than risk applying stale usage to the wrong pi turn.
|
|
188
188
|
|
|
189
189
|
For shell replay, completed `stdout` / `stderr` remain the primary source. While exactly one shell call is active, the provider also emits a bounded scrubbed preview of the first few `shell-output-delta` stdout/stderr chunks so long-running commands show visible progress before completion. If a successful completed shell result is empty, the replay card uses unambiguous buffered delta data as display-only fallback data. Overlapping shell calls make delta attribution ambiguous, so those fallback/progress deltas are dropped rather than guessed. `(no output)` is kept only when no completed output or safe delta fallback is available.
|
|
190
190
|
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
# Cursor Native Tool Visual Audit Workflow
|
|
2
2
|
|
|
3
|
-
> **
|
|
3
|
+
> **Release visual evidence:** `npm run smoke:visual -- --label release-check --prompt 'Read ./package.json and reply with its package name.'` is the current fork visual check. The deterministic cross-platform card matrix remains deferred under [issue #2](https://github.com/emmaneugene/pi-cursor-sdk/issues/2); see [docs/platform-smoke.md](./platform-smoke.md) for the retained future contract.
|
|
4
4
|
|
|
5
5
|
This workflow is the canonical repo path for verifying Cursor SDK tool replay the way a human sees it in pi's interactive TUI, without stealing macOS focus.
|
|
6
6
|
|
|
7
7
|
Use it before accepting replay-card commits or PRs, and for every Cursor provider/runtime release where TUI card/color behavior could regress. Text logs and JSONL are necessary, but they are not enough when the claim is visual parity: always keep PNGs for the exact prompt, and keep before/after PNGs when reviewing a rendering change.
|
|
8
8
|
|
|
9
|
-
Current validation baseline: Pi 0.84.0 or later, exact `@cursor/sdk@1.0.
|
|
9
|
+
Current validation baseline: Pi 0.84.0 or later, exact `@cursor/sdk@1.0.30`, and local validation packages `@earendil-works/pi-ai`, `@earendil-works/pi-coding-agent`, and `@earendil-works/pi-tui` at exact 0.84.0. Optional published Pi core peer dependencies use `"*"` ranges per current Pi package guidance.
|
|
10
10
|
|
|
11
11
|
## Cursor SDK 1.0.17 / pi 0.79.0 cutover visual record
|
|
12
12
|
|
|
@@ -14,9 +14,9 @@ Record the required cutover validation here or in the final release handoff. The
|
|
|
14
14
|
|
|
15
15
|
| Field | Required value / evidence |
|
|
16
16
|
| --- | --- |
|
|
17
|
-
| Command/session used | `npm run smoke:visual -- --ext "$PWD" --cwd "$PWD" --mode plan --out-dir <fresh /tmp dir> --label
|
|
18
|
-
| Baseline versions | `pi --version` = 0.
|
|
19
|
-
| Card categories checked | Claim only categories proven by both PNG and JSONL. Required cutover categories are read, grep/search, find/glob, shell success, write, edit/diff, and true read failure. Direct `ls`/list is tracked as
|
|
17
|
+
| Command/session used | `npm run smoke:visual -- --ext "$PWD" --cwd "$PWD" --mode plan --out-dir <fresh /tmp dir> --label release-check --prompt <bounded prompt>` with default native-replay isolation |
|
|
18
|
+
| Baseline versions | `pi --version` = 0.84.0; `npm ls` = `@cursor/sdk@1.0.30` and local `@earendil-works/*@0.84.0` |
|
|
19
|
+
| Card categories checked | Claim only categories proven by both PNG and JSONL. Required cutover categories are read, grep/search, find/glob, shell success, write, edit/diff, and true read failure. Direct `ls`/list is tracked as optional because composer-2-5 does not route it through native `ls` reliably; source-enumeration coverage is gated through find/glob. Neutral Cursor plan/todo/task/mode activity is optional/opportunistic and only counts when JSONL contains a completed Cursor workflow event. |
|
|
20
20
|
| Observed status/card colors | Confirm native-looking cards use native pi styling; neutral Cursor activity is not red; true errors are distinct; diff previews show red/green; plan status is readable |
|
|
21
21
|
| Screenshot/ANSI evidence location | External path only, for example `/tmp/pi-cursor-sdk-1016-visual.*/read-package.{ansi,txt,html,png,jsonl.path}` |
|
|
22
22
|
| Debug artifact location | External `.debug/cursor-sdk-events/...` or temp artifact directory path only; do not commit raw artifacts |
|
|
@@ -29,7 +29,7 @@ Required prompt matrix for this cutover:
|
|
|
29
29
|
| `read-package` | `Use only your file read tool. Read ./package.json and answer with only the package name. Do not use shell, grep, glob, find, or list tools.` | `toolCall.name=read`, `toolResult.toolName=read`, `isError=false` | Native-looking read card; collapsed label/path readable |
|
|
30
30
|
| `grep-readme` | `Use only your grep/search tool to search ./README.md for the literal string "pi-cursor-sdk". Do not use shell, read, glob, find, ls, or list tools. Report only the first matching file path.` | `toolCall.name=grep`, `toolResult.toolName=grep`, `isError=false` | Native-looking grep/search card; match preview readable |
|
|
31
31
|
| `find-readme` | `Use only your glob/file-search/find tool to find README.md from the repository root. Do not use shell, read, grep, ls, or list tools. Report matched paths exactly.` | `toolCall.name=find`, `toolResult.toolName=find`, `isError=false` | Native-looking find/glob card; matched path readable |
|
|
32
|
-
| `list-src` |
|
|
32
|
+
| `list-src` | Optional. Track manually when Cursor reliably routes this prompt through native `ls`. | `toolCall.name=ls`, `toolResult.toolName=ls`, `isError=false` when exercised | Native-looking list card; directory/path readable |
|
|
33
33
|
| `shell-success` | `Use only your shell/terminal tool to run printf 'cursor visual smoke\\n'. Do not use read, grep, glob, find, ls, edit, or write. Report the output.` | `toolCall.name=bash`, `toolResult.toolName=bash`, `isError=false` | Shell success card is not red/error-styled; stdout readable |
|
|
34
34
|
| `write-file` | `Use your normal file write tool to create .debug/visual-smoke/cursor-mode.txt with exactly two lines: alpha and beta. Do not use shell.` | `toolCall.name=write`, `toolResult.toolName=write`, `isError=false` | Native-looking write card; path/content preview readable |
|
|
35
35
|
| `edit-file` | `Use your normal file edit/str-replace tool to change beta to gamma in .debug/visual-smoke/cursor-mode.txt. Do not use shell.` | `toolCall.name=edit`, `toolResult.toolName=edit`, `isError=false` | Native-looking edit card; diff preview shows red/green added/removed lines |
|
|
@@ -63,7 +63,7 @@ The canonical workflow is now offscreen and browser-rendered:
|
|
|
63
63
|
5. Save PNG screenshots with `agent_browser` when the harness is available, or Playwright directly when running outside that harness.
|
|
64
64
|
6. Inspect the session JSONL for exact persisted `toolCall` / `toolResult` data.
|
|
65
65
|
|
|
66
|
-
This is the best default focused visual-debug path because it exercises the real pi TUI, captures card class/color/label/order/truncation issues before users see them, avoids desktop focus stealing, and leaves reviewable artifacts. Use visible Terminal/Ghostty screenshots only for terminal-specific or pixel-level bugs that cannot be judged through browser-rendered ANSI. The cross-platform
|
|
66
|
+
This is the best default focused visual-debug path because it exercises the real pi TUI, captures card class/color/label/order/truncation issues before users see them, avoids desktop focus stealing, and leaves reviewable artifacts. Use visible Terminal/Ghostty screenshots only for terminal-specific or pixel-level bugs that cannot be judged through browser-rendered ANSI. The cross-platform matrix is retained as a future gate under [Platform Smoke](./platform-smoke.md) and issue #2.
|
|
67
67
|
|
|
68
68
|
## Tool stack
|
|
69
69
|
|
|
@@ -76,7 +76,7 @@ npm install
|
|
|
76
76
|
npx playwright install chromium
|
|
77
77
|
```
|
|
78
78
|
|
|
79
|
-
|
|
79
|
+
Automatic PNG capture uses Playwright's Chromium or a system Chrome installation. If neither is available, run `npx playwright install chromium`. When running inside the pi agent harness, `agent_browser` is the preferred screenshot tool for generated HTML/ANSI output because it can open local files, verify saved artifacts, and capture exact evidence paths. In that case, run `npm run smoke:visual -- --no-screenshot ...` and screenshot the generated `.html` with `agent_browser`. Outside the harness, use Playwright through the checked-in runner.
|
|
80
80
|
|
|
81
81
|
## Runner contract
|
|
82
82
|
|
|
@@ -95,8 +95,8 @@ npx playwright install chromium
|
|
|
95
95
|
- `TERM=xterm-256color`
|
|
96
96
|
- cwd set to the target audit repo; the tmux session starts in `--cwd` with a non-login shell so a stale tmux-server cwd cannot print `getcwd` errors
|
|
97
97
|
- `--session-id` forwarded to pi only when explicitly provided, so fresh captures avoid the new-session warning line
|
|
98
|
-
- prompt
|
|
99
|
-
- bounded post-
|
|
98
|
+
- prompt submitted after the Cursor TUI footer appears, using bracketed tmux paste and a literal carriage return
|
|
99
|
+
- bounded TUI readiness wait via `--startup-ms` and bounded post-submit wait via `--wait-ms`
|
|
100
100
|
- artifacts outside the repo by default
|
|
101
101
|
- `<label>.ansi`, `<label>.txt`, `<label>.html`, `<label>.png`, `<label>.jsonl.path`, and `<label>.manifest.json`
|
|
102
102
|
- `--label`, `--ext`, `--cwd`, `--prompt`, `--prompt-file`, `--wait-ms`, and `--out-dir`
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
# Cursor Testing Lessons
|
|
2
2
|
|
|
3
|
-
> **
|
|
3
|
+
> **Release evidence:** The current fork release evidence bar includes unit tests, typechecks, package dry run, a live print-mode Cursor run, and visual smoke. The Crabbox-backed cross-platform matrix is deferred under [issue #2](https://github.com/emmaneugene/pi-cursor-sdk/issues/2). See [the deferred platform smoke runbook](./platform-smoke.md) for the retained implementation.
|
|
4
4
|
|
|
5
5
|
## Purpose
|
|
6
6
|
|
|
7
7
|
This document records maintainer testing lessons for `pi-cursor-sdk`. It complements unit tests and the [Cursor live smoke checklist](./cursor-live-smoke-checklist.md). Use it when adding regression coverage, debugging false-green releases, or building isolated smoke harnesses.
|
|
8
8
|
|
|
9
|
-
For a **minimal one-session dogfood pass** (baseline env, one native + one bridge call, JSONL ID patterns, bootstrap manifest, edit diff card), use the [Cursor dogfood checklist](./cursor-dogfood-checklist.md) as
|
|
9
|
+
For a **minimal one-session dogfood pass** (baseline env, one native + one bridge call, JSONL ID patterns, bootstrap manifest, edit diff card), use the [Cursor dogfood checklist](./cursor-dogfood-checklist.md) as focused evidence before the full release evidence bar.
|
|
10
10
|
|
|
11
11
|
## Core lesson: integration-shaped bugs beat unit mocks
|
|
12
12
|
|
|
@@ -28,6 +28,21 @@ Passing hundreds of unit tests did not prove that chain was safe. Regression cov
|
|
|
28
28
|
|
|
29
29
|
When changing provider/runtime behavior, ask whether the bug spans **pi extension lifecycle**, **active tool state**, **provider streaming**, and **persisted JSONL**. If yes, add an integration-style unit test or live smoke coverage for that chain.
|
|
30
30
|
|
|
31
|
+
## In-process child sessions re-run the extension factory
|
|
32
|
+
|
|
33
|
+
Pi subagents build a child `AgentSession` in the same process (`createAgentSession` + `bindExtensions`). That re-invokes the `pi-cursor-sdk` factory against a new ExtensionAPI while the parent Cursor run still owns the process-global bridge, session scope, and pooled SDK agent.
|
|
34
|
+
|
|
35
|
+
The observed failure: the child dies at `0 tool uses` with no transcript file, the parent turn aborts with `This operation was aborted`, and bridge diagnostics show `request_rejected` / `cancelled` with `Cursor pi tool bridge extension reloaded`.
|
|
36
|
+
|
|
37
|
+
Regression coverage:
|
|
38
|
+
|
|
39
|
+
- `src/cursor-extension-factory-guard.ts` — the first factory owns the process; nested loads no-op until the owner session shuts down and Pi can create its replacement runtime
|
|
40
|
+
- `test/cursor-extension-factory-guard.test.ts` — owner tokens reject stale release and release for every Pi shutdown reason
|
|
41
|
+
- `test/index-factory-guard.test.ts` — nested factory does not re-register, does not steal session scope, and does not dispose a live parent MCP run
|
|
42
|
+
- `test/cursor-pi-tool-bridge.test.ts` — `registerCursorPiToolBridge` keeps the existing registry when a run is live
|
|
43
|
+
|
|
44
|
+
If the host resolves a Cursor model for a child, that child uses the process-global Cursor agent pool. This guard stops the parent teardown; it does not give the child an independent Cursor session agent. Cursor-child model selection remains a separate live-test requirement.
|
|
45
|
+
|
|
31
46
|
## Dual-check invariant: `context.tools` vs pi active tools
|
|
32
47
|
|
|
33
48
|
Native replay routing intentionally uses two layers:
|
|
@@ -203,18 +218,25 @@ Pass criteria:
|
|
|
203
218
|
|
|
204
219
|
## Local validation ladder
|
|
205
220
|
|
|
206
|
-
Run
|
|
221
|
+
Run the current fork release evidence checks before claiming release-ready for provider/runtime changes:
|
|
207
222
|
|
|
208
223
|
```bash
|
|
209
224
|
npm test
|
|
210
225
|
npm run typecheck
|
|
211
226
|
npm pack --dry-run
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
227
|
+
|
|
228
|
+
# Live print-mode evidence. Keep the key in the environment, never in this file.
|
|
229
|
+
# -ne keeps a host `pi install` of this package from colliding with -e .
|
|
230
|
+
SMOKE_DIR="$(mktemp -d /tmp/pi-cursor-sdk-release.XXXXXX)"
|
|
231
|
+
PI_CURSOR_SETTING_SOURCES=none \
|
|
232
|
+
pi -ne --approve -e . --cursor-no-fast --model cursor/grok-4.6:slow \
|
|
233
|
+
--session-dir "$SMOKE_DIR/session" --no-tools \
|
|
234
|
+
-p 'Reply exactly: LIVE_PRINT_OK'
|
|
235
|
+
|
|
236
|
+
npm run smoke:visual -- \
|
|
237
|
+
--label release-check \
|
|
238
|
+
--prompt 'Read ./package.json and reply with its package name.'
|
|
239
|
+
rm -rf "$SMOKE_DIR"
|
|
218
240
|
```
|
|
219
241
|
|
|
220
242
|
After changing `scripts/validate-smoke-jsonl.mjs` or replay scan expectations, also run:
|
|
@@ -223,16 +245,16 @@ After changing `scripts/validate-smoke-jsonl.mjs` or replay scan expectations, a
|
|
|
223
245
|
npm test -- test/validate-smoke-jsonl.test.ts
|
|
224
246
|
```
|
|
225
247
|
|
|
226
|
-
Then use the [Cursor live smoke checklist](./cursor-live-smoke-checklist.md)
|
|
248
|
+
Then use the [Cursor live smoke checklist](./cursor-live-smoke-checklist.md) for focused surfaces the scripts do not cover (bridge MCP, abort/cancel, full TUI observation, packaging review, cleanup).
|
|
227
249
|
|
|
228
250
|
## What belongs in CI vs platform/manual smoke
|
|
229
251
|
|
|
230
252
|
- **CI / default `npm test`:** mocked provider tests, extension lifecycle tests, JSONL validator tests, script syntax/help checks. No live Cursor calls.
|
|
231
|
-
- **
|
|
232
|
-
- **
|
|
233
|
-
- **Focused manual smoke:** `npm run smoke:isolated`, `npm run smoke:live`, and selected live-checklist sections for
|
|
253
|
+
- **Current fork release evidence:** full unit tests, typechecks, `npm pack --dry-run`, a live print-mode Cursor run, and `npm run smoke:visual -- --label release-check --prompt 'Read ./package.json and reply with its package name.'`.
|
|
254
|
+
- **Deferred platform matrix:** `npm run smoke:platform:all`, tracked in [issue #2](https://github.com/emmaneugene/pi-cursor-sdk/issues/2).
|
|
255
|
+
- **Focused manual smoke:** `npm run smoke:isolated`, `npm run smoke:live`, and selected live-checklist sections for behavior mocks cannot reproduce.
|
|
234
256
|
|
|
235
|
-
If
|
|
257
|
+
If Cursor auth is unavailable, report the release as **blocked**, not skipped-ready. Missing deferred platform infrastructure does not block the current fork evidence bar.
|
|
236
258
|
|
|
237
259
|
## Cursor SDK event capture probe
|
|
238
260
|
|
|
@@ -257,7 +279,7 @@ The script writes timestamped artifacts under `--out` (default `/tmp/pi-cursor-s
|
|
|
257
279
|
|
|
258
280
|
Stdout prints artifact paths and summary counts only. Raw payloads stay on disk and may contain local paths, project text, tool args/results, or secrets — do not commit or share them.
|
|
259
281
|
|
|
260
|
-
Hard repo rule: Cursor SDK behavior claims must come from the installed `@cursor/sdk` package and/or https://cursor.com/docs/sdk/typescript, not from memory or ad-hoc probes alone. Current cutover validation targets exact `@cursor/sdk@1.0.
|
|
282
|
+
Hard repo rule: Cursor SDK behavior claims must come from the installed `@cursor/sdk` package and/or https://cursor.com/docs/sdk/typescript, not from memory or ad-hoc probes alone. Current cutover validation targets exact `@cursor/sdk@1.0.30` and Pi 0.84.0 local packages.
|
|
261
283
|
|
|
262
284
|
## Pi provider SDK event capture
|
|
263
285
|
|
|
@@ -308,7 +330,7 @@ Artifacts under `--out` (default `.debug/cursor-sdk-events/<timestamp>/` under `
|
|
|
308
330
|
During any normal pi session you can also opt in with:
|
|
309
331
|
|
|
310
332
|
```bash
|
|
311
|
-
PI_CURSOR_SDK_EVENT_DEBUG=1 pi --approve -e . --model cursor/grok-4.6
|
|
333
|
+
PI_CURSOR_SDK_EVENT_DEBUG=1 pi -ne --approve -e . --model cursor/grok-4.6
|
|
312
334
|
```
|
|
313
335
|
|
|
314
336
|
Multi-turn sessions group automatically by pi session file:
|
|
@@ -54,11 +54,9 @@ PI_CURSOR_TOOL_MANIFEST=0 pi --model cursor/grok-4.6
|
|
|
54
54
|
|
|
55
55
|
Current defaults:
|
|
56
56
|
|
|
57
|
-
-
|
|
58
|
-
- The pi bridge uses loopback MCP and is the
|
|
57
|
+
- All Cursor SDK agents run locally.
|
|
58
|
+
- The pi bridge uses loopback MCP and is the implemented Pi-tool transport for Cursor agents.
|
|
59
59
|
- SDK `local.customTools` remains deferred and needs SDK cancellation/deadline support before it can replace the loopback MCP bridge; no transport config is exposed.
|
|
60
|
-
- Explicit cloud runtime selection requires first-use acknowledgement (`/cursor-runtime cloud`, `/cursor-runtime cloud --save-user`, `--cursor-cloud-ack`, or `PI_CURSOR_CLOUD_ACK=1`) plus preflight. Project config may save a cloud runtime default but not the acknowledgement. Cloud runs use fresh context by default and do **not** get local pi tools through loopback MCP or `local.customTools`; cloud Pi-tool access would require a separate secure remote bridge and a new product decision.
|
|
61
|
-
- Inline cloud MCP is not exposed in the initial cloud runtime because live probes showed first-run/replacement/resume behavior was not deterministic enough.
|
|
62
60
|
|
|
63
61
|
## Cursor settings vs pi toggles
|
|
64
62
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Platform Smoke Implementation Reference
|
|
2
2
|
|
|
3
|
-
Back to the
|
|
3
|
+
Back to the [deferred Platform Smoke Matrix runbook](./platform-smoke.md) for the retained future release commands, targets, suites, artifacts, assertions, and security contract. Reintroduction is tracked in [issue #2](https://github.com/emmaneugene/pi-cursor-sdk/issues/2).
|
|
4
4
|
|
|
5
5
|
This document records detailed detector, registry, command-rendering, implementation-history, replacement, and portability material. The phase plan is retained as implementation history, not as active release instructions.
|
|
6
6
|
|
|
@@ -165,17 +165,17 @@ Exit criteria:
|
|
|
165
165
|
|
|
166
166
|
### Phase 9: docs and legacy cleanup
|
|
167
167
|
|
|
168
|
-
|
|
168
|
+
When reintroducing the matrix, update:
|
|
169
169
|
|
|
170
|
+
- `AGENTS.md`
|
|
170
171
|
- `README.md`
|
|
171
172
|
- `docs/cursor-live-smoke-checklist.md`
|
|
172
173
|
- `docs/cursor-testing-lessons.md`
|
|
173
174
|
- `docs/cursor-native-tool-visual-audit.md`
|
|
174
175
|
|
|
175
|
-
They must state:
|
|
176
|
+
They must then state:
|
|
176
177
|
|
|
177
|
-
-
|
|
178
|
-
- cloud-runtime changes additionally require `npm run smoke:cloud`;
|
|
178
|
+
- the release gate is `npm run smoke:platform:all`;
|
|
179
179
|
- legacy smoke scripts are inner-loop/debug helpers;
|
|
180
180
|
- `tmux` visual smoke is not the canonical cross-platform gate.
|
|
181
181
|
|
package/docs/platform-smoke.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
# Platform Smoke
|
|
1
|
+
# Deferred Platform Smoke Matrix
|
|
2
2
|
|
|
3
|
-
Status:
|
|
3
|
+
Status: deferred for this fork. The Crabbox runner, packed-install platform-build suite, and real live PTY/ConPTY suite runner remain available for macOS, Ubuntu, and Windows native targets with one-lease-per-target orchestration. Issue [#2](https://github.com/emmaneugene/pi-cursor-sdk/issues/2) tracks reintroducing this matrix as a release gate.
|
|
4
4
|
|
|
5
5
|
Detailed detector, registry, command-rendering, implementation-history, replacement, and portability reference: [Platform Smoke Implementation Reference](./platform-smoke-implementation.md).
|
|
6
6
|
|
|
@@ -12,42 +12,31 @@ Crabbox best-practice baseline applied from `~/Projects/crabbox`: Crabbox owns l
|
|
|
12
12
|
|
|
13
13
|
## Decision
|
|
14
14
|
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
Inner-loop checks remain useful, but they are not release gates:
|
|
15
|
+
This fork does not use the Crabbox platform matrix as a current release gate. The current release evidence bar is:
|
|
18
16
|
|
|
19
17
|
```bash
|
|
20
|
-
npm
|
|
18
|
+
npm test
|
|
19
|
+
npm run typecheck
|
|
21
20
|
npm pack --dry-run
|
|
21
|
+
# one live print-mode Cursor run with cursor/grok-4.6:slow
|
|
22
|
+
npm run smoke:visual -- --label release-check --prompt 'Read ./package.json and reply with its package name.'
|
|
22
23
|
```
|
|
23
24
|
|
|
24
|
-
The
|
|
25
|
+
The retained matrix command is a future gate candidate:
|
|
25
26
|
|
|
26
27
|
```bash
|
|
27
28
|
npm run smoke:platform:all
|
|
28
29
|
```
|
|
29
30
|
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
```bash
|
|
33
|
-
npm run smoke:cloud
|
|
34
|
-
```
|
|
35
|
-
|
|
36
|
-
`smoke:platform:all` runs `smoke:platform:doctor` first and only starts the target matrix after doctor passes. Maintainers may still run `npm run smoke:platform:doctor` by itself for setup diagnosis.
|
|
37
|
-
|
|
31
|
+
That command runs `smoke:platform:doctor` first and starts the target matrix only after doctor passes. Use it for future infrastructure work and diagnosis. Issue [#2](https://github.com/emmaneugene/pi-cursor-sdk/issues/2) defines the conditions for making it mandatory again.
|
|
38
32
|
|
|
39
|
-
Per-target commands
|
|
33
|
+
Per-target commands remain available for diagnosis and iteration. They are not current release requirements.
|
|
40
34
|
|
|
41
|
-
## Fork status (emmaneugene/pi-cursor-sdk)
|
|
42
35
|
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
No partial adoption exists. The release evidence must include macOS, Ubuntu, and Windows native passing through `smoke:platform:all`.
|
|
46
|
-
|
|
47
|
-
## Non-negotiable constraints
|
|
36
|
+
## Future matrix constraints
|
|
48
37
|
|
|
49
38
|
- No GitHub Actions dependency.
|
|
50
|
-
- No
|
|
39
|
+
- No remote provider dependency in the platform gate.
|
|
51
40
|
- No Crabbox broker/coordinator dependency.
|
|
52
41
|
- No release gate that runs on only one operating system.
|
|
53
42
|
- No release gate that proves command behavior but not TUI visual behavior.
|
|
@@ -71,7 +60,7 @@ version: 0.26.0 or newer
|
|
|
71
60
|
binary: Homebrew `crabbox` on PATH (`/opt/homebrew/bin/crabbox` on Apple Silicon Homebrew installs)
|
|
72
61
|
```
|
|
73
62
|
|
|
74
|
-
Use the Homebrew Crabbox binary on PATH for
|
|
63
|
+
Use the Homebrew Crabbox binary on PATH for future matrix runs. `PLATFORM_SMOKE_CRABBOX=/path/to/crabbox` is only an explicit override for testing a non-default binary. `smoke:platform:doctor` verifies the configured binary and fails when it is older than the configured minimum version.
|
|
75
64
|
|
|
76
65
|
Required Crabbox providers:
|
|
77
66
|
|
|
@@ -110,7 +99,7 @@ Rendering is host-side. Targets capture the real ANSI stream; the macOS host ren
|
|
|
110
99
|
|
|
111
100
|
## Target session model
|
|
112
101
|
|
|
113
|
-
Each target opens one Crabbox target session, syncs once, runs all suites for that target under one coherent target run id, collects artifacts, and stops/releases the target. The
|
|
102
|
+
Each target opens one Crabbox target session, syncs once, runs all suites for that target under one coherent target run id, collects artifacts, and stops/releases the target. The future matrix entrypoint runs required targets sequentially to prevent shared host, VM/container, and Cursor API contention; each target runs its own suites in order and fails fast within that target. Platform smoke disables Crabbox git-seed sync (`CRABBOX_SYNC_GIT_SEED=false`) so every run tests the current local checkout and uncommitted smoke-runner changes rather than a remote Git seed.
|
|
114
103
|
|
|
115
104
|
```text
|
|
116
105
|
start target session
|
|
@@ -139,7 +128,7 @@ start target session
|
|
|
139
128
|
end target session
|
|
140
129
|
```
|
|
141
130
|
|
|
142
|
-
The target session fails fast. The
|
|
131
|
+
The target session fails fast. The future matrix path handles one target at a time: it warms one Crabbox lease, performs one fresh sync, runs suites in order, and stops that target after the first failure before starting the next target. Total wall time is therefore additive across required targets; this avoids nondeterministic worker loss and live-run stalls from competing VM/container load and concurrent Cursor API calls. Per-suite commands remain available for diagnosis, but they are intentionally not the normal matrix path because repeated warmup/sync/install cycles make releases too slow.
|
|
143
132
|
|
|
144
133
|
Runtime budget is part of the contract:
|
|
145
134
|
|
|
@@ -160,33 +149,6 @@ Runtime budget is part of the contract:
|
|
|
160
149
|
|
|
161
150
|
Ubuntu is covered as its own local-container target, and Windows native remains a full visual TUI target.
|
|
162
151
|
|
|
163
|
-
## Required cloud smoke gate
|
|
164
|
-
|
|
165
|
-
Cloud validation stays separate from `smoke:platform:all`. Releases that touch actual cloud execution must run both the local platform gate and:
|
|
166
|
-
|
|
167
|
-
```bash
|
|
168
|
-
npm run smoke:cloud
|
|
169
|
-
```
|
|
170
|
-
|
|
171
|
-
The no-flag command is the required `cursor/grok-4.6` matrix. It uses current `gh` CLI authentication to create one private throwaway GitHub repository, seeds clean `main`, `starting-ref`, and `direct-push` branches, and runs persisted-session named lanes for:
|
|
172
|
-
|
|
173
|
-
- cancellation, with exact agent/run IDs captured before abort, retained `runIdSource` (`metadata` or installed-SDK `Agent.listRuns()` recovery), and terminal `cancelled` independently read through the SDK;
|
|
174
|
-
- explicit HTTPS repository plus `startingRef`, requiring a distinct pushed cloud branch with remote-content and starting-ref-ancestry proof, recording whether the SDK returned branch metadata, and validating any returned PR URL through GitHub;
|
|
175
|
-
- explicit direct-push opt-in, independently fetching the remote branch and checking its changed file content;
|
|
176
|
-
- a nonexistent starting branch, which must fail closed;
|
|
177
|
-
- `/cursor-cloud delete <exact bc-id> --yes` in the run's persisted session, followed by independent `Agent.get` not-found/404 and archived-inclusive list exclusion;
|
|
178
|
-
- passive artifacts and raw usage, recording observed true/false and validating bounded known shapes when the account returns either. Absence is an observation, not a skipped lane.
|
|
179
|
-
|
|
180
|
-
Prerequisites are intentionally strict: `CURSOR_API_KEY` with cloud entitlement, Cursor's GitHub integration with access to the new private repository, and `gh` auth with private-repository create, clone/push, inspect, and delete capability. Missing auth, entitlement, integration/access, required output, or any cleanup proof fails the gate. The GitHub mutation scope is destructive but bounded to self-created repositories named `pi-cursor-cloud-smoke-<uuid>` with an exact ownership-marker description. A cleanup handle is exposed only after create ownership is established (or an ambiguous create probe observes that exact marker). Deletion rejects arbitrary repository handles and independently requires an authenticated GitHub API HTTP 404 afterward.
|
|
181
|
-
|
|
182
|
-
Every path harvests exact IDs from provider metadata and canonical lifecycle session JSONL/journals. Final cleanup takes their union, archives every still-existing agent, requires `archived: true`, deletes it, then requires `Agent.get` not-found/404 and `Agent.list({ runtime: "cloud", includeArchived: true })` exclusion. `SIGINT` and `SIGTERM` first terminate the active detached Pi child, reject the lane, and then enter the same agent/repository cleanup coordinator before the process exits. Evidence is staged to a temporary file, then an event-loop signal checkpoint runs immediately before the atomic rename; that rename is the evidence commit point. A signal observed before it discards staged evidence. A signal dispatched after it but before the final terminal checkpoint still fails the process and suppresses the success marker, while the committed completed-cleanup summary remains valid. Emitting the success marker is the terminal-success boundary. Signal handlers stay installed through process teardown and independently set a failing exit code, so a still-active process cannot exit successfully if a signal is dispatched after that boundary, even when the marker was already written. Cleanup or repository-deletion verification failure fails the gate and retains the raw temporary artifact root. Successful runs remove raw artifacts unless `CURSOR_CLOUD_SMOKE_KEEP_ARTIFACTS=1`.
|
|
183
|
-
|
|
184
|
-
Before removing successful raw artifacts, the gate atomically replaces `docs/evidence/cursor-cloud-smoke-matrix-latest.json` with a known-shape summary containing timestamp, model, lane observations, exact agent/run IDs, agent cleanup proof, repository cleanup proof, and retained evidence provenance. Provenance records the extension package version, installed `@cursor/sdk` version, git source revision, and a deterministic `packageSourceSha256` over the full published package surface from `package.json` `files` plus `package.json` itself (relative path + bytes; directories expanded; symlinks/non-regular paths rejected). Generated `docs/evidence/*` is outside that published surface and is not hashed. Because successful pre-commit checkouts may be uncommitted, the package-source hash is authoritative for code identity and the revision is baseline identity only. The summary is a runtime-validated known shape (explicit six-lane allowlist, complete lane-agent cleanup coverage, repository proof, provenance) that round-trips through the persisted-evidence validator with no prompts or raw output, and must pass canonical secret scrubbing plus forbidden-field scanning; a run or cleanup failure observed before the atomic rename commit point never overwrites the last successful summary. A signal first dispatched after that point can fail the process while retaining the newly committed completed-cleanup summary, as defined above. Offline release-gate resource coordination (run → harvest IDs → cleanup agents → cleanup repo → evidence only on complete success) lives in `coordinateCloudSmokeReleaseGate()` inside `scripts/lib/cloud-smoke-cleanup-evidence.mjs`. GitHub throwaway fixture ownership lives in `scripts/lib/cloud-smoke-github.mjs`, signal-safe child shutdown lives in `scripts/lib/cloud-smoke-shutdown.mjs`, and `scripts/cloud-runtime-smoke.mjs` keeps concrete lane logic.
|
|
185
|
-
|
|
186
|
-
`npm run smoke:cloud:context` (`--context-matrix`) remains optional, separate proof for fresh-versus-bootstrap context handoff. `fresh` must answer `NO_MARKER`; `bootstrap` must recall the marker. Its agents receive the same archive, delete, `Agent.get` not-found/404, and archived-inclusive list-exclusion verification, but it does not create a GitHub repository or replace the required-matrix evidence summary.
|
|
187
|
-
|
|
188
|
-
This cloud gate does not replace the local macOS/Ubuntu/Windows `smoke:platform:all` gate.
|
|
189
|
-
|
|
190
152
|
## Focused local resume smoke
|
|
191
153
|
|
|
192
154
|
The platform matrix includes the required local-resume lanes: restart, safety, tool-surface, abort, tree, copy/switch, fallback, compaction, default/opt-out proof, and recorded-ID-only cleanup. Platform lanes run those scripts against the target's shared packed package path, then copy each lane's session JSONL, Cursor SDK debug metadata, runtime-launch record, and other bounded smoke artifacts into its canonical platform suite directory. The same scripts still load the source checkout by default when run directly as focused host-local inner-loop checks. Windows uses the intentionally short target-side evidence component `lr` so the Cursor SDK's derived SQLite path remains below legacy `MAX_PATH`; every suite removes and verifies that directory before use, failing closed on stale or locked evidence.
|
|
@@ -257,15 +219,13 @@ Package scripts:
|
|
|
257
219
|
|
|
258
220
|
```json
|
|
259
221
|
{
|
|
260
|
-
"check:platform-smoke": "node --check platform-smoke.config.mjs && node --check <platform smoke scripts> && vitest run test/platform-artifact-boundaries.test.ts test/platform-smoke-artifact-transport.test.ts test/
|
|
222
|
+
"check:platform-smoke": "node --check platform-smoke.config.mjs && node --check <platform smoke scripts> && vitest run test/platform-artifact-boundaries.test.ts test/platform-smoke-artifact-transport.test.ts test/smoke-cli-package-contracts.test.ts test/smoke-tooling.test.ts",
|
|
261
223
|
"smoke:platform": "node scripts/platform-smoke.mjs",
|
|
262
224
|
"smoke:platform:doctor": "node scripts/platform-smoke.mjs doctor",
|
|
263
225
|
"smoke:platform:macos": "node scripts/platform-smoke.mjs run --target macos",
|
|
264
226
|
"smoke:platform:ubuntu": "node scripts/platform-smoke.mjs run --target ubuntu",
|
|
265
227
|
"smoke:platform:windows-native": "node scripts/platform-smoke.mjs run --target windows-native",
|
|
266
228
|
"smoke:platform:all": "npm run smoke:platform:doctor && node scripts/platform-smoke.mjs run --target macos,ubuntu,windows-native",
|
|
267
|
-
"smoke:cloud": "node scripts/cloud-runtime-smoke.mjs",
|
|
268
|
-
"smoke:cloud:context": "node scripts/cloud-runtime-smoke.mjs --context-matrix",
|
|
269
229
|
"smoke:local-resume": "node scripts/local-resume-smoke.mjs",
|
|
270
230
|
"smoke:local-resume:safety": "node scripts/local-resume-smoke.mjs --safety",
|
|
271
231
|
"smoke:local-resume:tool-surface": "node scripts/local-resume-smoke.mjs --tool-surface",
|
|
@@ -291,7 +251,8 @@ Required config fields:
|
|
|
291
251
|
import { LOCAL_RESUME_SUITE_NAMES } from "./scripts/platform-smoke/local-resume-suites.mjs";
|
|
292
252
|
|
|
293
253
|
export default {
|
|
294
|
-
packageName: "pi-cursor-sdk",
|
|
254
|
+
packageName: "@emmaneugene/pi-cursor-sdk",
|
|
255
|
+
packageSlug: "pi-cursor-sdk",
|
|
295
256
|
cursorModel: "cursor/grok-4.6",
|
|
296
257
|
artifactRoot: ".artifacts/platform-smoke",
|
|
297
258
|
artifactRetention: {
|
|
@@ -323,7 +284,7 @@ export default {
|
|
|
323
284
|
};
|
|
324
285
|
```
|
|
325
286
|
|
|
326
|
-
`ubuntuContainerBaseImage` is the Ubuntu 24.04 Node 24 base with the current glibc baseline for native test dependencies. The runner builds the local `ubuntuContainerImage` wrapper with only `USER root` changed before warmup because Crabbox 0.36.0 must install SSH/Git/rsync/curl during bootstrap and `cimg/node` defaults to an unprivileged user. An explicit `PLATFORM_SMOKE_UBUNTU_IMAGE` bypasses that build and must already support Crabbox bootstrap. `nodeValidationMajor: 24` is the release-smoke validation baseline. It does not change the package engine by itself. A separate compatibility lane can test Node 22.19 later; this
|
|
287
|
+
`ubuntuContainerBaseImage` is the Ubuntu 24.04 Node 24 base with the current glibc baseline for native test dependencies. The runner builds the local `ubuntuContainerImage` wrapper with only `USER root` changed before warmup because Crabbox 0.36.0 must install SSH/Git/rsync/curl during bootstrap and `cimg/node` defaults to an unprivileged user. An explicit `PLATFORM_SMOKE_UBUNTU_IMAGE` bypasses that build and must already support Crabbox bootstrap. `nodeValidationMajor: 24` is the release-smoke validation baseline. It does not change the package engine by itself. A separate compatibility lane can test Node 22.19 later; this future matrix validates Node 24 on every target.
|
|
327
288
|
|
|
328
289
|
`windowsParallels` records this repo's default shared Windows template contract. Environment overrides may point at a temporary candidate template during infrastructure work, but release runs should use the shared `pi-extension-windows-template` / `crabbox-ready` baseline unless this document is updated.
|
|
329
290
|
|
|
@@ -450,7 +411,7 @@ tar --version
|
|
|
450
411
|
|
|
451
412
|
## Doctor command
|
|
452
413
|
|
|
453
|
-
`npm run smoke:platform:doctor` runs before any token-spending suite. The
|
|
414
|
+
`npm run smoke:platform:doctor` runs before any token-spending suite when maintainers exercise this deferred matrix. The retained `npm run smoke:platform:all` script enforces doctor first before it starts macOS, Ubuntu, or Windows suites.
|
|
454
415
|
|
|
455
416
|
Doctor checks:
|
|
456
417
|
|
|
@@ -473,7 +434,7 @@ Doctor checks:
|
|
|
473
434
|
17. `tar` is available on macOS and native Windows.
|
|
474
435
|
18. `node-pty` self-test passes on every target.
|
|
475
436
|
19. Target pi tool probe proves the shell tool accepts platform-rendered commands on every target.
|
|
476
|
-
20. Host-side xterm/Playwright render self-test passes by rendering a minimal ANSI fixture through the repo xterm helper and launching Playwright Chromium to write a tiny PNG. If
|
|
437
|
+
20. Host-side xterm/Playwright render self-test passes by rendering a minimal ANSI fixture through the repo xterm helper and launching Playwright Chromium or system Chrome to write a tiny PNG. If neither browser is available, run `npm install` and `npx playwright install chromium` before live suites.
|
|
477
438
|
21. `CURSOR_API_KEY` is present.
|
|
478
439
|
22. Artifact root is writable.
|
|
479
440
|
23. `git status --short` is recorded.
|
|
@@ -520,7 +481,7 @@ Purpose:
|
|
|
520
481
|
- fail before spending Cursor tokens;
|
|
521
482
|
- produce the packed extension used by later suites.
|
|
522
483
|
|
|
523
|
-
|
|
484
|
+
When this deferred matrix is exercised, the host `smoke:platform:all` entrypoint enforces doctor first before running targets. Required artifacts include `node-version.txt`, `npm-version.txt`, stdout/stderr for `npm ci`, `npm run check:platform-smoke`, `npm test`, `npm run typecheck`, `npm pack`, packed npm install, `pi install --approve`, and `pi list --approve`, plus `packed-tarball.txt`, `summary.json`, `artifact-manifest.json`, `assertions.json`, and `failures.md` on failed assertions.
|
|
524
485
|
|
|
525
486
|
### `cursor-local-resume-restart`
|
|
526
487
|
|
|
@@ -530,7 +491,7 @@ Purpose:
|
|
|
530
491
|
|
|
531
492
|
- prove guarded local resume default-on behavior across a pi process restart on each required OS;
|
|
532
493
|
- assert the first turn creates a local `agent-*` and the second turn resumes the same `agent-*`;
|
|
533
|
-
- force local
|
|
494
|
+
- force the local agent path so ambient settings cannot change this suite.
|
|
534
495
|
|
|
535
496
|
The suite prepares or reuses the target's packed npm install, runs `npm run smoke:local-resume` with that packed extension path, and asserts the `local-resume-smoke-ok` marker plus the resumed local agent id line. It also requires extracted session, debug, and runtime-launch evidence under `local-resume-evidence/`; checkout `pi -e <repo-root>` is reserved for the standalone inner-loop command.
|
|
536
497
|
|
|
@@ -642,7 +603,7 @@ PI_CURSOR_SDK_EVENT_DEBUG=1
|
|
|
642
603
|
Purpose:
|
|
643
604
|
|
|
644
605
|
- prove the packed extension completes a real local provider turn through the SDK's opt-in HTTP/1.1/SSE transport on every required OS;
|
|
645
|
-
- prove the final TUI status visibly includes `cursor
|
|
606
|
+
- prove the final TUI status visibly includes `cursor ... http1`;
|
|
646
607
|
- keep the default transport covered by the other required live suites.
|
|
647
608
|
|
|
648
609
|
Required final marker: `HTTP1_LIVE_OK`.
|
|
@@ -802,7 +763,7 @@ Maximum per target: `37` Cursor invocations.
|
|
|
802
763
|
|
|
803
764
|
Maximum full gate: `111` Cursor invocations.
|
|
804
765
|
|
|
805
|
-
|
|
766
|
+
When reintroduced, the matrix gate will be `npm run smoke:platform:all`; that script runs doctor first and then the matrix to preserve this budget. No suite adds a new Cursor invocation without updating this plan and the scenario source of truth (`scripts/platform-smoke/scenarios.mjs`, plus `scripts/platform-smoke/local-resume-suites.mjs` for local-resume lanes).
|
|
806
767
|
|
|
807
768
|
## Artifact contract
|
|
808
769
|
|
|
@@ -984,18 +945,12 @@ The runner must binary-safe scan every bounded regular artifact file, including
|
|
|
984
945
|
|
|
985
946
|
Bridge diagnostics may include safe tool names and correlation IDs only.
|
|
986
947
|
|
|
987
|
-
##
|
|
948
|
+
## Future release bar
|
|
988
949
|
|
|
989
|
-
|
|
950
|
+
When issue #2 closes, a local provider/runtime release will also require this exact command to pass on the maintainer machine:
|
|
990
951
|
|
|
991
952
|
```bash
|
|
992
953
|
npm run smoke:platform:all
|
|
993
954
|
```
|
|
994
955
|
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
```bash
|
|
998
|
-
npm run smoke:cloud
|
|
999
|
-
```
|
|
1000
|
-
|
|
1001
|
-
`smoke:platform:all` runs doctor first and then all required local targets and suites in one full gate execution.
|
|
956
|
+
Until then, use the current fork release evidence bar documented in `AGENTS.md`, `README.md`, and `docs/cursor-live-smoke-checklist.md`.
|