@emmaneugene/pi-cursor-sdk 0.3.7 → 0.4.0
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 +16 -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-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/docs/cursor-dogfood-checklist.md +4 -4
- package/docs/cursor-live-smoke-checklist.md +23 -23
- 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 +7 -7
- package/docs/cursor-testing-lessons.md +23 -16
- package/docs/cursor-tool-surfaces.md +2 -4
- package/docs/platform-smoke-implementation.md +5 -5
- package/docs/platform-smoke.md +27 -72
- package/package.json +3 -17
- package/platform-smoke.config.mjs +2 -1
- 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/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-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/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
|
@@ -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
|
|
|
@@ -203,18 +203,25 @@ Pass criteria:
|
|
|
203
203
|
|
|
204
204
|
## Local validation ladder
|
|
205
205
|
|
|
206
|
-
Run
|
|
206
|
+
Run the current fork release evidence checks before claiming release-ready for provider/runtime changes:
|
|
207
207
|
|
|
208
208
|
```bash
|
|
209
209
|
npm test
|
|
210
210
|
npm run typecheck
|
|
211
211
|
npm pack --dry-run
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
212
|
+
|
|
213
|
+
# Live print-mode evidence. Keep the key in the environment, never in this file.
|
|
214
|
+
# -ne keeps a host `pi install` of this package from colliding with -e .
|
|
215
|
+
SMOKE_DIR="$(mktemp -d /tmp/pi-cursor-sdk-release.XXXXXX)"
|
|
216
|
+
PI_CURSOR_SETTING_SOURCES=none \
|
|
217
|
+
pi -ne --approve -e . --cursor-no-fast --model cursor/grok-4.6:slow \
|
|
218
|
+
--session-dir "$SMOKE_DIR/session" --no-tools \
|
|
219
|
+
-p 'Reply exactly: LIVE_PRINT_OK'
|
|
220
|
+
|
|
221
|
+
npm run smoke:visual -- \
|
|
222
|
+
--label release-check \
|
|
223
|
+
--prompt 'Read ./package.json and reply with its package name.'
|
|
224
|
+
rm -rf "$SMOKE_DIR"
|
|
218
225
|
```
|
|
219
226
|
|
|
220
227
|
After changing `scripts/validate-smoke-jsonl.mjs` or replay scan expectations, also run:
|
|
@@ -223,16 +230,16 @@ After changing `scripts/validate-smoke-jsonl.mjs` or replay scan expectations, a
|
|
|
223
230
|
npm test -- test/validate-smoke-jsonl.test.ts
|
|
224
231
|
```
|
|
225
232
|
|
|
226
|
-
Then use the [Cursor live smoke checklist](./cursor-live-smoke-checklist.md)
|
|
233
|
+
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
234
|
|
|
228
235
|
## What belongs in CI vs platform/manual smoke
|
|
229
236
|
|
|
230
237
|
- **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
|
|
238
|
+
- **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.'`.
|
|
239
|
+
- **Deferred platform matrix:** `npm run smoke:platform:all`, tracked in [issue #2](https://github.com/emmaneugene/pi-cursor-sdk/issues/2).
|
|
240
|
+
- **Focused manual smoke:** `npm run smoke:isolated`, `npm run smoke:live`, and selected live-checklist sections for behavior mocks cannot reproduce.
|
|
234
241
|
|
|
235
|
-
If
|
|
242
|
+
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
243
|
|
|
237
244
|
## Cursor SDK event capture probe
|
|
238
245
|
|
|
@@ -257,7 +264,7 @@ The script writes timestamped artifacts under `--out` (default `/tmp/pi-cursor-s
|
|
|
257
264
|
|
|
258
265
|
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
266
|
|
|
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.
|
|
267
|
+
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
268
|
|
|
262
269
|
## Pi provider SDK event capture
|
|
263
270
|
|
|
@@ -308,7 +315,7 @@ Artifacts under `--out` (default `.debug/cursor-sdk-events/<timestamp>/` under `
|
|
|
308
315
|
During any normal pi session you can also opt in with:
|
|
309
316
|
|
|
310
317
|
```bash
|
|
311
|
-
PI_CURSOR_SDK_EVENT_DEBUG=1 pi --approve -e . --model cursor/grok-4.6
|
|
318
|
+
PI_CURSOR_SDK_EVENT_DEBUG=1 pi -ne --approve -e . --model cursor/grok-4.6
|
|
312
319
|
```
|
|
313
320
|
|
|
314
321
|
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
|
|
|
@@ -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`.
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@emmaneugene/pi-cursor-sdk",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"description": "pi provider extension backed by @cursor/sdk local
|
|
3
|
+
"version": "0.4.0",
|
|
4
|
+
"description": "pi provider extension backed by @cursor/sdk local agents",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
7
7
|
},
|
|
@@ -41,8 +41,6 @@
|
|
|
41
41
|
"scripts/visual-tui-smoke.mjs",
|
|
42
42
|
"scripts/visual-tui-smoke-self-test.mjs",
|
|
43
43
|
"scripts/isolated-cursor-smoke.sh",
|
|
44
|
-
"scripts/cloud-runtime-smoke.mjs",
|
|
45
|
-
"scripts/cloud-runtime-smoke.d.mts",
|
|
46
44
|
"scripts/local-resume-smoke.mjs",
|
|
47
45
|
"scripts/local-resume-cleanup-smoke.mjs",
|
|
48
46
|
"scripts/local-resume-smoke.d.mts",
|
|
@@ -81,16 +79,6 @@
|
|
|
81
79
|
"scripts/platform-smoke/targets.mjs",
|
|
82
80
|
"scripts/platform-smoke/visual-evidence.mjs",
|
|
83
81
|
"scripts/platform-smoke/wrapped-line-match.mjs",
|
|
84
|
-
"scripts/lib/cloud-smoke-cleanup-evidence.mjs",
|
|
85
|
-
"scripts/lib/cloud-smoke-cleanup-evidence.d.mts",
|
|
86
|
-
"scripts/lib/cloud-smoke-artifacts.mjs",
|
|
87
|
-
"scripts/lib/cloud-smoke-artifacts.d.mts",
|
|
88
|
-
"scripts/lib/cloud-smoke-pi-runner.mjs",
|
|
89
|
-
"scripts/lib/cloud-smoke-pi-runner.d.mts",
|
|
90
|
-
"scripts/lib/cloud-smoke-github.mjs",
|
|
91
|
-
"scripts/lib/cloud-smoke-github.d.mts",
|
|
92
|
-
"scripts/lib/cloud-smoke-shutdown.mjs",
|
|
93
|
-
"scripts/lib/cloud-smoke-shutdown.d.mts",
|
|
94
82
|
"scripts/lib/cursor-cli-args.mjs",
|
|
95
83
|
"scripts/lib/cursor-cli-args.d.mts",
|
|
96
84
|
"scripts/lib/cursor-child-process.mjs",
|
|
@@ -140,8 +128,6 @@
|
|
|
140
128
|
"smoke:live": "npm run build && scripts/tmux-live-smoke.sh",
|
|
141
129
|
"smoke:visual": "npm run build && node scripts/visual-tui-smoke.mjs",
|
|
142
130
|
"smoke:isolated": "npm run build && scripts/isolated-cursor-smoke.sh",
|
|
143
|
-
"smoke:cloud": "node scripts/cloud-runtime-smoke.mjs",
|
|
144
|
-
"smoke:cloud:context": "node scripts/cloud-runtime-smoke.mjs --context-matrix",
|
|
145
131
|
"smoke:local-resume": "node scripts/local-resume-smoke.mjs",
|
|
146
132
|
"smoke:local-resume:safety": "node scripts/local-resume-smoke.mjs --safety",
|
|
147
133
|
"smoke:local-resume:tool-surface": "node scripts/local-resume-smoke.mjs --tool-surface",
|
|
@@ -157,7 +143,7 @@
|
|
|
157
143
|
"debug:sdk-events": "node scripts/debug-sdk-events.mjs",
|
|
158
144
|
"debug:provider-events": "node scripts/debug-provider-events.mjs",
|
|
159
145
|
"debug:mcp-coldstart": "node scripts/probe-mcp-coldstart.mjs",
|
|
160
|
-
"check:platform-smoke": "node --check platform-smoke.config.mjs && node --check scripts/
|
|
146
|
+
"check:platform-smoke": "node --check platform-smoke.config.mjs && node --check scripts/local-resume-cleanup-smoke.mjs && node --check scripts/local-resume-smoke.mjs && node --check scripts/lib/local-resume-smoke-harness.mjs && node --check scripts/platform-smoke.mjs && node --check scripts/platform-smoke/artifact-bundle-chunk.mjs && node --check scripts/platform-smoke/artifact-bundle-contract.mjs && node --check scripts/platform-smoke/artifact-fs-safety.mjs && node --check scripts/platform-smoke/artifact-anchored-extract.mjs && node --check scripts/platform-smoke/artifact-secrets.mjs && node --check scripts/platform-smoke/assertions.mjs && node --check scripts/platform-smoke/artifacts.mjs && node --check scripts/platform-smoke/card-detect.mjs && node --check scripts/platform-smoke/crabbox-runner.mjs && node --check scripts/platform-smoke/doctor.mjs && node --check scripts/platform-smoke/jsonl-text.mjs && node --check scripts/platform-smoke/live-suite-runner.mjs && node --check scripts/platform-smoke/local-resume-runner.mjs && node --check scripts/platform-smoke/pty-capture.mjs && node --check scripts/platform-smoke/render-ansi.mjs && node --check scripts/platform-smoke/scenarios.mjs && node --check scripts/platform-smoke/target-runtime.mjs && node --check scripts/platform-smoke/targets.mjs && node --check scripts/platform-smoke/visual-evidence.mjs && node --check scripts/platform-smoke/wrapped-line-match.mjs && 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",
|
|
161
147
|
"smoke:platform": "node scripts/platform-smoke.mjs",
|
|
162
148
|
"smoke:platform:doctor": "node scripts/platform-smoke.mjs doctor",
|
|
163
149
|
"smoke:platform:macos": "node scripts/platform-smoke.mjs run --target macos",
|
|
@@ -4,7 +4,8 @@
|
|
|
4
4
|
import { LOCAL_RESUME_SUITE_NAMES } from "./scripts/platform-smoke/local-resume-suites.mjs";
|
|
5
5
|
|
|
6
6
|
export default {
|
|
7
|
-
packageName: "pi-cursor-sdk",
|
|
7
|
+
packageName: "@emmaneugene/pi-cursor-sdk",
|
|
8
|
+
packageSlug: "pi-cursor-sdk",
|
|
8
9
|
cursorModel: "cursor/grok-4.6",
|
|
9
10
|
artifactRoot: ".artifacts/platform-smoke",
|
|
10
11
|
artifactRetention: {
|
|
@@ -21,20 +21,6 @@ import { buildCursorSmokeEnv } from "./cursor-smoke-env.mjs";
|
|
|
21
21
|
import { scrubSensitiveText } from "../../shared/cursor-sensitive-text.mjs";
|
|
22
22
|
|
|
23
23
|
const root = resolve(dirname(fileURLToPath(import.meta.url)), "../..");
|
|
24
|
-
const CLOUD_RUNTIME_ENV_NAMES = [
|
|
25
|
-
"PI_CURSOR_CLOUD_ACK",
|
|
26
|
-
"PI_CURSOR_CLOUD_ALLOW_LOCAL_STATE",
|
|
27
|
-
"PI_CURSOR_CLOUD_CONTEXT",
|
|
28
|
-
"PI_CURSOR_CLOUD_REPO",
|
|
29
|
-
"PI_CURSOR_CLOUD_BRANCH",
|
|
30
|
-
"PI_CURSOR_CLOUD_DIRECT_PUSH",
|
|
31
|
-
"PI_CURSOR_CLOUD_AUTO_CREATE_PR",
|
|
32
|
-
"PI_CURSOR_CLOUD_SKIP_REVIEWER_REQUEST",
|
|
33
|
-
"PI_CURSOR_CLOUD_ENV",
|
|
34
|
-
"PI_CURSOR_CLOUD_ENV_FROM_FILES",
|
|
35
|
-
"PI_CURSOR_CLOUD_ENV_TYPE",
|
|
36
|
-
"PI_CURSOR_CLOUD_ENV_NAME",
|
|
37
|
-
];
|
|
38
24
|
|
|
39
25
|
export function scrubSmokeText(value) {
|
|
40
26
|
return scrubSensitiveText(String(value), process.env.CURSOR_API_KEY);
|
|
@@ -128,7 +114,6 @@ export function buildLocalResumeSmokeEnv(
|
|
|
128
114
|
: localResumeEnv === false
|
|
129
115
|
? "unset"
|
|
130
116
|
: localResumeEnv;
|
|
131
|
-
for (const name of CLOUD_RUNTIME_ENV_NAMES) delete env[name];
|
|
132
117
|
delete env.PI_CURSOR_LOCAL_RESUME;
|
|
133
118
|
if (resumeMode === "on") env.PI_CURSOR_LOCAL_RESUME = "1";
|
|
134
119
|
else if (resumeMode === "off") env.PI_CURSOR_LOCAL_RESUME = "0";
|
|
@@ -137,7 +122,6 @@ export function buildLocalResumeSmokeEnv(
|
|
|
137
122
|
return {
|
|
138
123
|
...env,
|
|
139
124
|
PI_CODING_AGENT_DIR: agentDir,
|
|
140
|
-
PI_CURSOR_RUNTIME: "local",
|
|
141
125
|
};
|
|
142
126
|
}
|
|
143
127
|
|
|
@@ -472,8 +456,6 @@ export async function promptAbortAndRead({
|
|
|
472
456
|
|
|
473
457
|
export function assertTurnMetadata(label, turn, expected) {
|
|
474
458
|
const meta = turn.metadata.providerMeta ?? {};
|
|
475
|
-
if (meta.runtime === "cloud")
|
|
476
|
-
fail(`${label} unexpectedly recorded cloud runtime`, turn.metadataPath);
|
|
477
459
|
if (meta.localResume !== true)
|
|
478
460
|
fail(`${label} did not record localResume=true`, turn.metadataPath);
|
|
479
461
|
if (meta.resumedAgent !== expected.resumedAgent) {
|
|
@@ -30,7 +30,7 @@ const CARD_PATTERNS = [
|
|
|
30
30
|
},
|
|
31
31
|
{ id: "bridge-read-failure", pattern: /^\s*(?:read \.\/definitely-missing-platform-smoke-file\.txt|ENOENT: no such file)\s*/i },
|
|
32
32
|
{ id: "bridge-shell-success", pattern: /^\s*bridge visual smoke\s*$/i },
|
|
33
|
-
{ id: "http1-status", pattern: /\bcursor
|
|
33
|
+
{ id: "http1-status", pattern: /\bcursor\b.*\bhttp1\b/i },
|
|
34
34
|
{ id: "footer-status", pattern: /\bgrok-4\.6\b|\bcomposer-2-5\b|\bcomposer-2\.5\b/i },
|
|
35
35
|
];
|
|
36
36
|
|
|
@@ -244,7 +244,7 @@ export function buildLocalResumeSuiteCommand(
|
|
|
244
244
|
const evidenceDir = `${prepDir}/${powershellTarget ? "lr" : `local-resume-${suiteName}`}`;
|
|
245
245
|
const packagePath = `${prepDir}/packed-workspace/node_modules/${packageName}`;
|
|
246
246
|
if (powershellTarget) {
|
|
247
|
-
const powershell = `$ErrorActionPreference='Stop';$p=${quotePowerShell(prepDir)};$e=$p+'/lr';$w=$e.Replace('/','\\');$x=$p+${quotePowerShell(`/packed-workspace/node_modules/${packageName}`)};node scripts/platform-smoke/live-suite-runner.mjs --prepare-only --target ${targetName} --package-name ${packageName} --prep-dir $p;if($LASTEXITCODE){exit $LASTEXITCODE};for($i=0;$i -lt 10 -and (Test-Path -LiteralPath $e);$i++){cmd.exe /d /c rd /s /q $w;if(Test-Path -LiteralPath $e){Start-Sleep -Milliseconds 200}};if(Test-Path -LiteralPath $e){throw 'local-resume evidence cleanup failed'};$env:CURSOR_LOCAL_RESUME_SMOKE_EXTENSION_PATH=$x;$env:CURSOR_LOCAL_RESUME_SMOKE_ARTIFACT_DIR=$e;$env:CURSOR_LOCAL_RESUME_SMOKE_KEEP_ARTIFACTS='1';$env:CURSOR_LOCAL_RESUME_SMOKE_EMIT_BUNDLE='1';npm run ${script}`;
|
|
247
|
+
const powershell = `$ErrorActionPreference='Stop';$p=${quotePowerShell(prepDir)};$e=$p+'/lr';$w=$e.Replace('/','\\');$x=$p+${quotePowerShell(`/packed-workspace/node_modules/${packageName}`)};node scripts/platform-smoke/live-suite-runner.mjs --prepare-only --target ${targetName} --package-name ${quotePowerShell(packageName)} --prep-dir $p;if($LASTEXITCODE){exit $LASTEXITCODE};for($i=0;$i -lt 10 -and (Test-Path -LiteralPath $e);$i++){cmd.exe /d /c rd /s /q $w;if(Test-Path -LiteralPath $e){Start-Sleep -Milliseconds 200}};if(Test-Path -LiteralPath $e){throw 'local-resume evidence cleanup failed'};$env:CURSOR_LOCAL_RESUME_SMOKE_EXTENSION_PATH=$x;$env:CURSOR_LOCAL_RESUME_SMOKE_ARTIFACT_DIR=$e;$env:CURSOR_LOCAL_RESUME_SMOKE_KEEP_ARTIFACTS='1';$env:CURSOR_LOCAL_RESUME_SMOKE_EMIT_BUNDLE='1';npm run ${script}`;
|
|
248
248
|
return `powershell.exe -NoLogo -NoProfile -ExecutionPolicy Bypass -EncodedCommand ${Buffer.from(powershell, "utf16le").toString("base64")}`;
|
|
249
249
|
}
|
|
250
250
|
const prep = `node scripts/platform-smoke/live-suite-runner.mjs --prepare-only --target ${quotePosix(targetName)} --package-name ${quotePosix(packageName)} --prep-dir ${quotePosix(prepDir)}`;
|
|
@@ -60,7 +60,7 @@ Steps:
|
|
|
60
60
|
8. run shell and preserve the failure: {{shellFailure}}
|
|
61
61
|
9. stop using tools and answer exactly:
|
|
62
62
|
NATIVE_MATRIX_OK package=<name> grep=<yes/no> find=<yes/no> list=<yes/no> shell=<yes/no> shell_fail=<yes/no> write=<yes/no> edit=<yes/no>`,
|
|
63
|
-
finalMarker: "NATIVE_MATRIX_OK package
|
|
63
|
+
finalMarker: "NATIVE_MATRIX_OK package=@emmaneugene/pi-cursor-sdk",
|
|
64
64
|
requiredCards: [
|
|
65
65
|
"read", "grep", "find", "shell-success", "write", "edit-diff", "shell-failure", "footer-status",
|
|
66
66
|
],
|
|
@@ -44,13 +44,18 @@ function makeRunId() {
|
|
|
44
44
|
return `run-${Date.now()}-${Math.random().toString(36).slice(2, 8)}`;
|
|
45
45
|
}
|
|
46
46
|
|
|
47
|
+
function targetSlug(config, targetName) {
|
|
48
|
+
const packageSlug = config.packageSlug ?? String(config.packageName ?? "pi-cursor-sdk").replace(/^@/, "").replaceAll("/", "-");
|
|
49
|
+
return `${packageSlug}-${targetName}`;
|
|
50
|
+
}
|
|
51
|
+
|
|
47
52
|
export function createLeaseCleanupResult(config, targetName, leaseId, stopResult, runId = makeRunId()) {
|
|
48
53
|
const suiteName = "lease-cleanup";
|
|
49
54
|
const suiteDir = createSuiteDir(config.artifactRoot, runId, targetName, suiteName);
|
|
50
55
|
writeFileSync(resolve(suiteDir, "target.json"), JSON.stringify({
|
|
51
56
|
targetName,
|
|
52
57
|
platform: platformFor(targetName),
|
|
53
|
-
slug:
|
|
58
|
+
slug: targetSlug(config, targetName),
|
|
54
59
|
runId,
|
|
55
60
|
writtenAt: new Date().toISOString(),
|
|
56
61
|
}, null, 2));
|
|
@@ -88,7 +93,7 @@ export async function runTargetSuite(config, targetName, suiteName, leaseSession
|
|
|
88
93
|
const runId = leaseSession?.runId ?? makeRunId();
|
|
89
94
|
const suiteDir = createSuiteDir(config.artifactRoot, runId, targetName, suiteName);
|
|
90
95
|
const platform = platformFor(targetName);
|
|
91
|
-
const slug =
|
|
96
|
+
const slug = targetSlug(config, targetName);
|
|
92
97
|
|
|
93
98
|
console.log(`\n── [${targetName}] ${suiteName} ──`);
|
|
94
99
|
console.log(` runId: ${runId}`);
|
|
@@ -133,7 +138,7 @@ export async function runTargetSuite(config, targetName, suiteName, leaseSession
|
|
|
133
138
|
* This is the release-gate path; per-suite runs remain available for diagnosis.
|
|
134
139
|
*/
|
|
135
140
|
export async function runTargetSuites(config, targetName, suiteNames) {
|
|
136
|
-
const slug =
|
|
141
|
+
const slug = targetSlug(config, targetName);
|
|
137
142
|
const runId = makeRunId();
|
|
138
143
|
console.log(` targetRunId: ${runId}`);
|
|
139
144
|
console.log(` warmup ${targetName}...`);
|
|
@@ -369,6 +374,10 @@ function posixSection(name, command) {
|
|
|
369
374
|
/**
|
|
370
375
|
* Build a shell command that runs the full platform-build pipeline and packed-install contract.
|
|
371
376
|
*/
|
|
377
|
+
function quotePowerShellArgument(value) {
|
|
378
|
+
return `'${String(value).replaceAll("'", "''")}'`;
|
|
379
|
+
}
|
|
380
|
+
|
|
372
381
|
export function buildPlatformBuildCommand(targetName, packageName = "pi-cursor-sdk", nodeValidationMajor = 24) {
|
|
373
382
|
const platform = platformFor(targetName);
|
|
374
383
|
const lines = [];
|
|
@@ -471,7 +480,7 @@ export function buildPlatformBuildCommand(targetName, packageName = "pi-cursor-s
|
|
|
471
480
|
lines.push("fi");
|
|
472
481
|
lines.push('echo "PLATFORM_BUILD_OK"');
|
|
473
482
|
} else {
|
|
474
|
-
lines.push(`powershell.exe -NoLogo -NoProfile -ExecutionPolicy Bypass -File .\\scripts\\platform-smoke\\platform-build-windows.ps1 -PackageName ${packageName} -NodeValidationMajor ${nodeValidationMajor}`);
|
|
483
|
+
lines.push(`powershell.exe -NoLogo -NoProfile -ExecutionPolicy Bypass -File .\\scripts\\platform-smoke\\platform-build-windows.ps1 -PackageName ${quotePowerShellArgument(packageName)} -NodeValidationMajor ${nodeValidationMajor}`);
|
|
475
484
|
}
|
|
476
485
|
return lines.join("\n");
|
|
477
486
|
}
|
|
@@ -666,7 +675,7 @@ function buildLiveSuiteCommand(config, targetName, suiteName, prepDir) {
|
|
|
666
675
|
const packageName = config.packageName ?? "pi-cursor-sdk";
|
|
667
676
|
const prepArgs = prepDir ? ` --prep-dir ${platformFor(targetName) === "powershell" ? prepDir : shellQuote(prepDir)}` : "";
|
|
668
677
|
if (platformFor(targetName) === "powershell") {
|
|
669
|
-
return `powershell.exe -NoLogo -NoProfile -ExecutionPolicy Bypass -Command "node scripts/platform-smoke/live-suite-runner.mjs --suite ${suiteName} --target ${targetName} --model ${model} --package-name ${packageName}${prepArgs}"`;
|
|
678
|
+
return `powershell.exe -NoLogo -NoProfile -ExecutionPolicy Bypass -Command "node scripts/platform-smoke/live-suite-runner.mjs --suite ${suiteName} --target ${targetName} --model ${model} --package-name ${quotePowerShellArgument(packageName)}${prepArgs}"`;
|
|
670
679
|
}
|
|
671
680
|
return `node scripts/platform-smoke/live-suite-runner.mjs --suite ${shellQuote(suiteName)} --target ${shellQuote(targetName)} --model ${shellQuote(model)} --package-name ${shellQuote(packageName)}${prepArgs}`;
|
|
672
681
|
}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { isCursorModel } from "./cursor-model.js";
|
|
2
2
|
import { registerCursorModelLifecycle, type CursorModelLifecycleExtensionApi } from "./cursor-model-lifecycle.js";
|
|
3
|
-
import { resolveEffectiveCursorConfigForContext } from "./cursor-runtime-state.js";
|
|
4
3
|
import { resolveCursorFacingSystemPrompt } from "./cursor-agents-context.js";
|
|
5
4
|
|
|
6
5
|
export type CursorAgentsContextExtensionApi = CursorModelLifecycleExtensionApi;
|
|
@@ -9,14 +8,10 @@ export function registerCursorAgentsContextDedup(pi: CursorAgentsContextExtensio
|
|
|
9
8
|
registerCursorModelLifecycle(pi, {
|
|
10
9
|
beforeAgentStart: (event, ctx) => {
|
|
11
10
|
if (!isCursorModel(ctx.model)) return undefined;
|
|
12
|
-
const runtime = resolveEffectiveCursorConfigForContext(ctx).runtime.value;
|
|
13
11
|
const resolved = resolveCursorFacingSystemPrompt(
|
|
14
12
|
event.systemPrompt,
|
|
15
13
|
ctx.model,
|
|
16
14
|
event.systemPromptOptions,
|
|
17
|
-
undefined,
|
|
18
|
-
undefined,
|
|
19
|
-
runtime,
|
|
20
15
|
);
|
|
21
16
|
if (resolved === event.systemPrompt) return undefined;
|
|
22
17
|
return { systemPrompt: resolved };
|