@uru-intelligence/cli 0.5.7 → 0.5.9

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.
Files changed (5) hide show
  1. package/CHANGELOG.md +25 -0
  2. package/README.md +137 -24
  3. package/dist/library.mjs +1259 -119
  4. package/dist/uru.mjs +13539 -11317
  5. package/package.json +5 -12
package/CHANGELOG.md CHANGED
@@ -10,12 +10,22 @@
10
10
  - Action: Update agents and scripts that expected a compiler result from uru gems validate or uru gems build. Print or store hosted_job_id, then poll gem.build_job, or pass --wait.
11
11
  - Registry-family commands (uru home, sharing, web, files, workspace, business-sql, datasets, distribution, library source) send --params-json fields exactly as the tool's input schema spells them. The camelCase-to-snake_case rewrite and its error are gone. — surfaces: cli, docs; reference: apps/cli/src/local-commands.ts
12
12
  - Action: Send the field names uru <family> <operation> --get-schema or uru operations inspect <id> prints, for example target_id and idempotency_key, not targetId and idempotencyKey.
13
+ - Search and run exact connected actions with stable account IDs. Serve MCP over stdio through the installed Uru CLI. — surfaces: cli, docs, release, sdk; reference: docs/adr/0010-shared-action-discovery-execution.md
14
+ - Action: Install CLI 0.5.9 and regenerate client settings with uru mcp config. Existing eager clients can narrow their tools with saved action references.
13
15
  - uru automations dlq and the automation.dlq_list, dlq_reprocess and dlq_delete operations are gone, and uru automations runs debug no longer takes --turns-limit. The old automation engine's dead-letter queue and its run archive were deleted. — surfaces: cli, docs; reference: apps/cli/src/local-commands.ts
14
16
  - Action: Remove uru automations dlq calls and the dlq_* operation ids from scripts. Drop --turns-limit from uru automations runs debug. Read a run's activity from node_executions in uru automations runs get or debug; steps, agent_activity and archived no longer appear.
17
+ - uru business-sql and its two business_sql operations are gone. Those tools now run only as company tools in the workspaces that own them. — surfaces: cli, docs; reference: URU-1566
18
+ - Action: Remove uru business-sql calls and the business_sql operation ids from scripts. Find the tool with uru tools ls --owner company, then run it with uru tools run <address>.
15
19
  - uru gems share replaces uru gems links. A share decides who may open a Gem: each person you name gets their own URL, and a share with no people has one anyone URL. promote, rollback, open, gems deploy, gems analytics and gems delegations name a share instead of a link. — surfaces: cli, docs; reference: skills/uru-gems/references/publishing.md
16
20
  - Action: Replace uru gems links create with uru gems share create, links set-version, set-access and set-notifications with uru gems share update, and links rotate and revoke with uru gems share rotate and revoke. Pass --share-id to promote and rollback, and --share to open, gems deploy, gems analytics and gems delegations. The gem_control_plane link_* ops and the link_id parameter are removed; the error names the share op to use.
17
21
  - uru logs --follow now streams live lines over the server-sent stream only. The one-second poll fallback and the --poll-interval-ms flag on logs are gone. — surfaces: cli; reference: docs/research/gem-debugging-2026-09.md
18
22
  - Action: Drop --poll-interval-ms from uru logs and uru gems logs; the flag is rejected. --follow reads the recent page once, then follows the same stream the web Activity tab uses. When a Gem has no runtime log stream, the command now says so instead of polling.
23
+ - uru mcp config and uru mcp install now fail when no workspace resolves. Every generated MCP config writes URU_WORKSPACE_ID, because every MCP call names its workspace. — surfaces: cli; reference: apps/cli/src/mcp-commands.ts
24
+ - Action: Pass --workspace <workspace-id>, set URU_WORKSPACE_ID, run uru switch <workspace-id>, or run uru link --workspace <workspace-id> before uru mcp config or uru mcp install. Rerun uru mcp install for an existing client config that has no URU_WORKSPACE_ID.
25
+ - uru mcp config and uru mcp install write a direct streamable HTTP entry for the Uru MCP server (type http, the MCP URL of the CLI's environment, and the X-Uru-Workspace-Id header). The npx uru-mcp stdio bridge, its version pin and --package are gone. The default entry has no API key, so the client signs in with OAuth. The workspace must be a UUID, because the MCP server refuses any other value. uru mcp list and uru doctor flag an old npx uru-mcp entry and print the install command that replaces it, with --server-name when the entry has another name. — surfaces: cli, docs; reference: apps/cli/src/mcp-commands.ts
26
+ - Action: Run the uru mcp install command that uru mcp list or uru doctor prints to replace an old npx uru-mcp entry. Pass the workspace ID in UUID form. Replace --api-key <key> with --api-key-env URU_API_KEY for a headless client; the entry then references that environment variable in an Authorization header. Drop --package. Pass --mcp-url <url> for a server the CLI does not know.
27
+ - uru tokens create, ls and revoke (and the token alias) are gone, with the token.create, token.list and token.revoke operations. Gem deploy tokens were removed from Uru. — surfaces: cli, docs; reference: apps/cli/src/command-spec.ts
28
+ - Action: Gem deploy tokens are gone and nothing replaces them. In CI, set URU_TOKEN to a workspace API key from Settings > API Keys, or sign in with uru login.
19
29
 
20
30
  ### Security
21
31
 
@@ -28,6 +38,9 @@
28
38
 
29
39
  ### Added
30
40
 
41
+ - @uru-intelligence/app 2.2.4: four recoverable background job examples ship with the package, at @uru-intelligence/app/examples/customer-workflows/scheduled-collector, review-only-draft, file-processor and approved-external-write. — surfaces: docs, sdk; reference: PR #6956
42
+ - @uru-intelligence/app 2.2.4: uploads.request and uploads.upload take an idempotencyKey, and the SDK keeps its automatic key after an uncertain response. uploads.status reads the saved result for a key without starting another upload, and the UruUploadStatus type is exported. A private upload stays bound to the viewer's stable identity. — surfaces: sdk; reference: PR #7042
43
+ - Action: After an uncertain upload response, call uploads.status with the same key, or send the request again with the same idempotencyKey, instead of starting a new upload.
31
44
  - A tool call that parks for approval now names itself, and uru tools approve <question-id> --accept|--decline answers it from the shell. — surfaces: cli; reference: URU-1362
32
45
  - Action: A parked call prints its named status (approval_required or refused_by_policy), its question id, and its write class. Answer it with uru tools approve <question-id> --accept or --decline. The id is the durable approval row's own id, so the same answer settles the card in chat. Running the command twice is safe: it prints the answer that won.
33
46
  - Add `uru link --verify` for local link diagnostics and `uru gems links create --verify` to run browser verification after link creation. — surfaces: cli, docs; reference: apps/cli/src/workspace-commands.ts
@@ -62,6 +75,8 @@
62
75
  - Action: Run uru gems debug-token [gem] [--deployment <id>] [--ttl-seconds <n>] to inspect a running Gem. The session authorizes that deployment's log route and nothing else, and the backend refuses it once it expires. The CLI never holds an internal provider credential.
63
76
  - uru gems share create --role editor makes an editor share: each person you name signs in and edits the Gem from their Library. --consent and the new uru gems share consents --grant/--revoke lend the editors your connections, Datasets and secrets, as kind:id. uru sharing shares_list with no path lists the Gems other people shared with you. — surfaces: cli, docs; reference: skills/uru-gems/references/publishing.md
64
77
  - Action: Nothing changes for a viewer share. For an editor share, pass --role editor with --people, and name each connection, Dataset or secret the editors may run with --consent kind:id (kind is connection, dataset or secret). Only the owner of each one can lend it. An editor share refuses --version, --pin, --gate, --anyone, --expires-at, --notify-on-open and --verify, because it has no URL.
78
+ - uru gems share create and add-people take --no-notify, which adds the people without the "shared with you" email. Each command now prints the addresses the email was queued for. — surfaces: cli; reference: docs/GEM_SYSTEM.md
79
+ - Action: Nothing changes by default: each person you name is still emailed. Add --no-notify to name people without an email; they still get the Uru inbox card.
65
80
  - uru gems share update --confirm-link-off confirms a general access change that takes a live link from people who have it: --no-anyone on a working link, or --organization or --workspaces on a link that opens for anyone. Without it the server refuses the change and says how many people opened the link. — surfaces: cli, docs; reference: skills/uru-gems/references/publishing.md
66
81
  - Action: Tell the person what the refusal says first. Run the same command again with --confirm-link-off only when they agree. A CLI older than this release cannot send the confirmation; until you upgrade, use gem_control_plane share_update with audience_confirm_link_off: true.
67
82
  - uru tools reads the whole tool catalog — platform, personal, adopted, company and external MCP — and runs a connector tool through the MCP proxy. — surfaces: cli, docs; reference: URU-1363
@@ -73,6 +88,8 @@
73
88
 
74
89
  ### Changed
75
90
 
91
+ - @uru-intelligence/app 2.2.4: UruAppRuntimeError.code keeps the Dataset conflict codes row_conflict, dataset_conflict and idempotency_conflict, and the job failure code job_import_failed. It no longer passes through four retired codes: dataset_frozen_gem_release_unverified, dataset_frozen_gem_compatibility_disabled, tool_result_content_unavailable and tool_parameters_content_unavailable. — surfaces: sdk; reference: PR #6957, PR #7347, PR #7134
92
+ - Action: Branch on row_conflict, dataset_conflict or idempotency_conflict instead of reading the error message. Remove any branch on the four retired codes; Uru no longer sends them.
76
93
  - `uru logs --follow` streams Gem runtime logs over SSE for up to 30 minutes and falls back to polling when the stream route is missing. — surfaces: cli; reference: apps/cli/src/gem-lifecycle-commands.ts
77
94
  - Action: No action is required. `--follow-duration-ms` now accepts up to 30 minutes (was 5).
78
95
  - uru logs --request-id prints one ordered waterfall per request instead of a flat page. — surfaces: cli; reference: docs/research/gem-debugging-2026-09.md
@@ -82,6 +99,11 @@
82
99
 
83
100
  ### Fixed
84
101
 
102
+ - @uru-intelligence/app 2.2.4: a job cancel sends an empty JSON object with an application/json content type, so the provider gateway accepts it from a Fly job. — surfaces: sdk; reference: PR #7213
103
+ - @uru-intelligence/app 2.2.4: a keyed Dataset row write, jobs.progress and jobs.checkpoint are sent again with the same body after a temporary answer (HTTP 408, 429 or 503), so a short database stall no longer fails a Gem job. A 500, any other status, retryable: false and a missing-setup 503 stay final. The waits of one call add up to at most 63 seconds; with 30 second sends a call can take about 5 minutes in the worst case. These calls carry x-uru-sdk-resends: temporary, so the provider gateway does not send them again too. — surfaces: sdk; reference: PR #8045
104
+ - Action: Rebuild a Gem with @uru-intelligence/app 2.2.4 after it is published. Until then, the provider gateway sends these calls again inside its 20 second window for Gems built with an older SDK.
105
+ - @uru-intelligence/app 2.2.4: actions.run waits out an action that answers pending. It reads the execution's status until the action ends, inside the caller's signal and timeoutMs, and returns its result or throws its final failure. The background-job coordinator also keeps a job record that another deployment of the same Gem saved, so a new release can observe, wait on, cancel and resume the job. — surfaces: sdk; reference: PR #7198
106
+ - Action: Rebuild a Gem with @uru-intelligence/app 2.2.4 after it is published. Pass the job handler's signal to actions.run so a canceled job stops waiting.
85
107
  - A connector call the host parked or refused now reaches the shell with its status and its resumable question id, instead of a sentence the CLI had to read for the word approval. — surfaces: cli; reference: https://linear.app/uru-intelligence/issue/URU-1362
86
108
  - Action: Answer a parked call with uru tools approve <question-id> --accept or --decline. The id is printed with the refusal.
87
109
  - Approved connected tools now run from uru tools run when their provider name differs from their catalog name. — surfaces: cli; reference: apps/cli/src/tools-mcp.ts
@@ -102,6 +124,8 @@
102
124
  - Action: After `uru mcp config` against development or staging, set URU_API_KEY and use the emitted URU_PROXY_URL so clients do not fall through to production MCP. Prefer published CLI >= 0.4.14.
103
125
  - Recover from a revoked CLI session without reusing the dead JWT. When the API returns `session_revoked`, the CLI now rotates the stored OAuth login once or clears it instead of sending the revoked token until local expiry. — surfaces: cli; reference: apps/cli/src/cli.ts
104
126
  - Action: No action is required. Failures of this class now carry the `session_revoked` error code so they can be distinguished from a generic `auth_required` response.
127
+ - Refreshing a saved connector login also refreshes its platform session. Sign-in, sign-out and workspace changes preserve a newer saved login when commands overlap. — surfaces: cli; reference: PR #7640
128
+ - Action: Install CLI 0.5.8. Existing valid device sign-ins need no new approval.
105
129
  - Report a non-JSON API response as what it is. A proxy or firewall that answers with an HTML page now produces the HTTP status and content type instead of `Unexpected token '<', "<!DOCTYPE "... is not valid JSON`. — surfaces: cli; reference: apps/cli/src/client.ts
106
130
  - Action: No action is required. Failures of this class now carry the `non_json_response` error code, keep the auth exit code on a 401, and print a tip naming the likely cause.
107
131
  - Report what a rejected credential actually means: `uru doctor` now runs a read-only data call instead of trusting `uru whoami`, API error envelopes are read in full, and auth advice follows where the token came from. — surfaces: cli; reference: apps/cli/src/doctor.ts
@@ -114,6 +138,7 @@
114
138
  - Action: Nothing to do. If an older server answers with an envelope this CLI does not read, the error now says the operation may have completed and to check with uru library ls before retrying.
115
139
  - Tip library_fs read refusals toward library_query, and ship labels/list aliases that need a live catalog with list_labels/create_label. — surfaces: cli, docs; reference: PR #5379 CF001; PR #5381 staging labels catalog
116
140
  - Action: Prefer published CLI >= 0.4.15. Use uru sharing labels_list / label_create (or operations sharing.labels_list / sharing.label_create). library_fs read ops should point callers at library_query instead of an opaque safety refusal.
141
+ - uru logs --follow uses the saved delivery position after the recent page and after reconnect. Delayed lines keep their original times, appear once, and cannot be skipped by mixed time forms. — surfaces: cli; reference: apps/cli/src/gem-lifecycle-commands.ts
117
142
  - uru operations inspect <id> and uru <family> <verb> --get-schema print the operation's real input schema, narrowed to its op, with the op's examples, instead of Input schema: {}. — surfaces: cli; reference: URU-1425
118
143
  - Action: Nothing to change. A not-logged-in inspect prints a pointer to uru login and exits 0; operations ls stays local and schema-free.
119
144
  - uru operations run and inspect accept the tool name that uru operations ls prints beside each operation id, invalid_tool_arguments names the failing fields of the operation that ran, and a retryable failure says it is temporary and how to retry a write safely. — surfaces: cli; reference: apps/cli/src/tool-failure-guidance.ts
package/README.md CHANGED
@@ -15,8 +15,8 @@ bun src/index.ts switch <workspace-id>
15
15
 
16
16
  The CLI is registry-backed. Dedicated Gem/Library/Dataset/Automation commands
17
17
  are thin adapters over the same platform tools used by MCP and the web UI;
18
- broader workspace, prompt/persona/context, sharing, web/file, business SQL,
19
- secret/env/token operations remain exposed through the generated operation
18
+ broader workspace, prompt/persona/context, sharing, web/file, and
19
+ secret/env operations remain exposed through the generated operation
20
20
  registry while dedicated UX commands continue to mature. The `deploy` aliases
21
21
  call the same saved Version and Release operations as the web UI. A requested
22
22
  Share is created only after the server returns a ready Release. The server owns
@@ -108,8 +108,10 @@ bun src/index.ts automations runs cancel <run-id> <automation-id> --yes
108
108
 
109
109
  # Raw platform-tool escape hatch for diagnostics and low-level operations.
110
110
  bun src/index.ts tools ls
111
- bun src/index.ts tools schema gem_control_plane --json
112
- bun src/index.ts tools run gem_control_plane --params-json '{"op":"inspect","path":"library/Golden Gems/My Gem.gem"}'
111
+ bun src/index.ts tools search "gem inspect" --limit 50 --json
112
+ bun src/index.ts tools schema <address-from-search> --json
113
+ bun src/index.ts tools output <result-ref> --json
114
+ bun src/index.ts tools run <address-from-search> --params-json '{"path":"library/Golden Gems/My Gem.gem"}'
113
115
 
114
116
  # Show and execute the generated operation registry.
115
117
  bun src/index.ts operations ls
@@ -118,15 +120,13 @@ bun src/index.ts operations run gem.inspect --params-json '{"path":"library/Gold
118
120
  bun src/index.ts library search "client brief"
119
121
  bun src/index.ts docs library_fs
120
122
  bun src/index.ts docs search library_fs
121
- bun src/index.ts api platform/tools/search_tools/execute -F query=gem
122
- bun src/index.ts api /api/platform/tools/search_tools/execute -F query=gem
123
123
 
124
- # MCP client config helper. Prefer ${URU_API_KEY} or --api-key. List never prints keys.
124
+ # MCP client config helper. Writes a streamable HTTP entry. List never prints keys.
125
125
  bun src/index.ts mcp list
126
126
  bun src/index.ts mcp list --target cursor
127
- bun src/index.ts mcp config --api-key "$URU_API_KEY"
128
- bun src/index.ts mcp install --target cursor
129
- bun src/index.ts mcp install --path ~/.config/claude-code/mcp.json --api-key "$URU_API_KEY"
127
+ bun src/index.ts mcp config --workspace <workspace-id> --target claude
128
+ bun src/index.ts mcp install --workspace <workspace-id> --target cursor
129
+ bun src/index.ts mcp install --workspace <workspace-id> --target claude --api-key-env URU_API_KEY
130
130
  bun src/index.ts mcp remove --target cursor
131
131
 
132
132
  # Local auth facts. Never prints a JWT.
@@ -140,9 +140,47 @@ bun src/index.ts complete fish
140
140
  bun src/index.ts complete powershell
141
141
  ```
142
142
 
143
- Generated MCP configs use non-interactive `npx -y` and pin
144
- `uru-mcp@3.7.2`. Pass `--package <package@version>` only for an intentional,
145
- explicit bridge override.
143
+ Generated MCP configs connect straight to the Uru MCP server over streamable
144
+ HTTP: `"type": "http"` and the MCP URL of the CLI's environment
145
+ (`https://mcp.uruintelligence.com/mcp` for production). Pass `--mcp-url <url>`
146
+ for another server. Generated configs do not use a local `npx` or stdio bridge.
147
+
148
+ By default the entry has no API key, so the client signs in with OAuth. The
149
+ Cursor entry also names Cursor's public OAuth client, as in the
150
+ [MCP guide](../../content/docs/guides/mcp.mdx). For a headless client, pass
151
+ `--api-key-env URU_API_KEY`. The entry then gets an `Authorization` header that
152
+ references that environment variable (`${URU_API_KEY}` for Claude Code,
153
+ `${env:URU_API_KEY}` for Cursor). The CLI never writes a key value. It refuses
154
+ `--api-key <key>`.
155
+
156
+ Every entry sends the `X-Uru-Workspace-Id` header, because every MCP call names
157
+ its workspace. `mcp config` and `mcp install` fail when no workspace resolves
158
+ from `--workspace`, `URU_WORKSPACE_ID`, the linked project, or the last
159
+ `uru switch`.
160
+
161
+ The workspace must be a UUID, because the MCP server refuses any other value
162
+ in the workspace header.
163
+
164
+ `mcp list` and `doctor` flag an old `npx uru-mcp` entry and print the
165
+ `mcp install` command that replaces it. For an entry with a name other than
166
+ `uru`, that command adds `--server-name <name>`.
167
+
168
+ Pass `--tool-filter '<JSON array of saved action references>'` to `mcp config`
169
+ or `mcp install` to narrow the generated entry. The config sends the stable
170
+ references in the `X-Uru-Tool-Filter` header. The server intersects them with
171
+ the authorized catalog. An empty array shows no discovered actions.
172
+
173
+ The explicit `uru mcp serve` command remains available for clients that need a
174
+ stdio bridge. It accepts `--mcp-url` and `--tool-filter`; generated configs do
175
+ not select it.
176
+
177
+ `uru tools search` uses the same server index as chat and MCP. It returns five
178
+ matches by default, with a maximum of 50. Use the returned `--cursor` for the
179
+ next page. `uru tools schema` loads the exact selected action schema.
180
+ `uru tools output` reads the complete redacted JSON behind a retained result
181
+ handle. It uses the logged-in user and workspace, and reads bounded pages.
182
+ `uru tools run` sends its stable action reference and arguments. Platform
183
+ operation calls do not take an `op` argument; the server sets that value.
146
184
 
147
185
  `tools run --parallel` accepts a JSON array of input objects. Calls run in order.
148
186
  If one fails, the command prints completed results and the failed input index.
@@ -190,7 +228,8 @@ explicit token/API-key paths:
190
228
  - interactive commands with missing or expired stored auth start browser login and then retry the command without printing login success text to stdout
191
229
  - `--no-input` disables implicit login and exits `4` when authentication is missing
192
230
  - `uru logout` invalidates the current CLI session, revokes the renewable OAuth credential, and clears local auth state
193
- - precedence: `--token` / `--token-file` / `--token-stdin` > `URU_TOKEN` > OS keychain > `--insecure-storage` local config
231
+ - precedence: `--token` / `--token-file` / `--token-stdin` > `URU_TOKEN` > a local config login saved with `--insecure-storage` for the selected API > the OS keychain entry for the selected API
232
+ - A local config login for another API is not selected or cleared by this invocation.
194
233
  - manually supplied tokens and CI tokens are used as-is and do not gain OAuth renewal
195
234
  - local config: `URU_CONFIG_HOME`, then XDG config home, then `~/.config/uru`
196
235
  - config file permissions: `0600`
@@ -199,12 +238,6 @@ explicit token/API-key paths:
199
238
  - `uru auth status` reports logged-in / workspace / storage / expiry and never prints a JWT. `uru whoami` stays a server identity call.
200
239
  - `uru switch` sets the local default workspace. `uru link` binds this directory to one Gem. `--workspace` / `URU_WORKSPACE_ID` select one of your current workspace memberships for one invocation.
201
240
  - The screen says Agent; Library paths and schemas say persona (`library/Agents/Name.persona.md`).
202
- - Gem-scoped deploy tokens for CI use `uru tokens create|ls|revoke`
203
- - `uru tokens create` requires `--name` plus exactly one lifetime flag:
204
- `--expiry <duration>` or `--expires-at <iso timestamp>`
205
- - created tokens default to the server-enforced `gem:deploy` scope
206
- - custom `--scope`/`--scopes` values must include `gem:deploy` before the token
207
- can operate Gem deploy/query/control routes
208
241
  - Gem secrets use `uru secrets put|ls|rm`; values are write-only
209
242
  - `uru env pull` writes a metadata-only template, never downloads remote secret
210
243
  values, and clamps the output file to `0600` even when overwriting an existing
@@ -213,11 +246,11 @@ explicit token/API-key paths:
213
246
 
214
247
  ## CI cookbook
215
248
 
216
- Use a Gem-scoped token, never a session JWT, and fail closed:
249
+ Use a workspace API key (create it in Settings > API Keys), never a session
250
+ JWT, and fail closed:
217
251
 
218
252
  ```bash
219
- uru tokens create 'library/Golden Gems/My Gem.gem' --name CI --expiry 30d --json
220
- export URU_TOKEN=<token-from-create-once>
253
+ export URU_TOKEN=<workspace-api-key>
221
254
  export URU_WORKSPACE_ID=<workspace-id>
222
255
  uru --no-input doctor --json
223
256
  uru --no-input auth status --json
@@ -277,10 +310,35 @@ URU_CLI_MCP_STAGING_SMOKE_TARGET=staging \
277
310
  node apps/cli/scripts/staging-smoke.mjs --cli "$prefix/bin/uru" --json
278
311
  ```
279
312
 
313
+ ### Named offline safety
314
+
315
+ The PR client safety lane and CLI release gate run `test:safety`. The
316
+ [Agent Testing Guide](../../docs/agent-guides/testing.md) owns the test rule.
317
+ Ordinary command arguments, operation mappings, and successful polling belong
318
+ to deployed product runs. The remaining offline cases protect these failures:
319
+
320
+ | Failure | Test owner | Why the deployed suite cannot show it safely or precisely |
321
+ | --- | --- | --- |
322
+ | A session token reaches the wrong proxy, or refresh overwrites a newer login | `cli-connector-oauth.test.ts`, `cli-connector-auth-status.test.ts`, `cli.test.ts` | These cases control native credential stores, expiry, and account changes between local callbacks. The browser suite cannot control those local stores or callback races. |
323
+ | A local token file stays readable by other users | `config.test.ts` | The deployed product cannot inspect or repair a CLI user's local file mode. This case writes a real file and checks mode `0600`. |
324
+ | Source reads truncate bytes, corrupt local files, discard edits, or advance a stale checkout | `cli-source-sync.test.ts`, `cli-source-sync-push.test.ts`, `cli-source-sync.part2.test.ts` | The deployed Gem group uses browser and backend tools. It does not own the CLI's local files or source lock. Corrupt page replies and a failure after the first read need controlled I/O. |
325
+ | A destructive command or top-level rollback runs without confirmation, exposes a token, or bypasses a registered policy | `cli-platform-tools.test.ts`, `cli-gem-v2-commands.test.ts`, `cli-tools-catalog.test.ts` | The cases prove refusal before execution and keep uppercase spellings inside the same confirmation guard. Top-level rollback has its own guard; the lifecycle command test reaches a different guard. Using a live deletion or provider write to check a missing guard could destroy data or cost money. |
326
+ | A disable command enables a job, or guesses the wrong capability kind | `cli-gem-capabilities.test.ts` | The CLI off-switch has its own boolean contract. The deployed Gem fixtures have no runnable job; testing a runaway job would execute real work. |
327
+ | A failed parallel batch hides completed work, invalid input starts part of a batch, or a Gem action runs without a retry key | `cli-tools-catalog.test.ts`, `cli-gem-bindings.test.ts` | These cases control which provider call fails after another completes and prove refusal before an unkeyed action. They prevent a caller from repeating completed work. The API action has a separate key guard; a live runnable action could execute paid work if that guard disappears. |
328
+ | A changed owner row leaks a connection, or a provider failure exposes private detail | `cli-tools-catalog.test.ts`, `client.test.ts` | A valid deployed catalog does not return contradictory ownership or echoed secret fields. The cases inject those replies at the external I/O boundary. |
329
+ | A failed diagnostic claims healthy access, or a missing route becomes an endless poll | `cli-doctor.test.ts`, `cli-gem-logs-follow.test.ts`, `cli-gem-source-remote-degrade.test.ts` | These cases need a deliberate route or middleware fault and a timed local cancellation. A deployed test run cannot change the server or choose a socket failure point. |
330
+ | Approval waiting hangs, or a deadline becomes success | `cli-automations-wait.test.ts` | The cases control the poll sequence and a five-millisecond deadline. A live automation cannot provide that exact timing. |
331
+ | A broken response or split stream becomes false success, lost data, or an unsafe retry | `client.test.ts`, `gem-result.test.ts` | The runner cannot choose edge-proxy replies or stream chunk boundaries. An unsupported result schema would require an incompatible live server. |
332
+ | A library caller omits scope, selects another workspace, or loses cancellation | `library.test.ts` | The deployed browser suite does not construct the published CLI library or inspect its local cancellation signal. |
333
+ | Release smoke runs the checkout, crosses an environment, accepts an unrelated refusal, or leaves original owned resources after failure | `staging-smoke.test.ts` | The cases run the native smoke with an installed executable and the real Product fixture. They control only external HTTP and browser I/O. A deployed run cannot safely cross Production, lose a create reply, or keep a grant active on demand. |
334
+ | A foreign or unprotected dispatch reaches credentials, or Development reaches publication | `publish-immutable-cli.test.ts` | The native shell tests execute the publisher's actual mode guard before credential and package-write stand-ins. The deployed product suite cannot forge private GitHub runner authority. |
335
+
280
336
  Publish the scoped CLI through the **Publish Uru CLI to npm** workflow
281
337
  (`.github/workflows/publish-uru-cli.yml`) from `staging` or `main`. Pass the exact
282
338
  `apps/cli/package.json` version as its `version` input. The workflow rejects
283
- other branches or a version mismatch.
339
+ an unprotected source, another repository, a non-manual event, or a version
340
+ mismatch. Development accepts only `operation=prepare-next` with
341
+ `smoke_only=true`. Development cannot publish a version or change a public tag.
284
342
 
285
343
  The workflow runs the source gates, builds one tarball, and retains the exact
286
344
  tarball for 90 days. Package smoke tests check that tarball before npm trusted
@@ -304,6 +362,54 @@ against staging, then skips the publish and exact-archive jobs:
304
362
  gh workflow run publish-uru-cli.yml --ref staging -f version=<version> -f smoke_only=true
305
363
  ```
306
364
 
365
+ To prepare the same tarball against Development, dispatch the protected
366
+ Development workflow with the exact served release commit and MCP image revision
367
+ from the normal successful release receipt:
368
+
369
+ ```bash
370
+ gh workflow run publish-uru-cli.yml --ref development \
371
+ -f version=<version> -f operation=prepare-next -f smoke_only=true \
372
+ -f expected_served_release=<40-hex-served-development-sha> \
373
+ -f expected_mcp_image_revision=<40-hex-receipt-mcp-image-revision>
374
+ ```
375
+
376
+ The retained tarball uses the workflow's protected build source commit. The
377
+ served release input identifies the backend deployment under test. The MCP
378
+ image input identifies the receipt's `release_image_revisions.mcp_proxy`.
379
+ Image reuse can make these commits differ. Obtain both inputs from the successful
380
+ release receipt; never infer the expected image from the current public health
381
+ response. The guard requires both exact 40-hex inputs before credentials.
382
+ The smoke checks the same backend deployment and exact MCP image with
383
+ `direct-actions-v1` before and after the test. Both targets use the API and MCP from
384
+ `scripts/lib/environments.mjs`; a supplied URL must match that exact target.
385
+
386
+ Development uses the Product QA accounts and QA Organization. It uses the same
387
+ password sign-in, marked temporary workspace and anchor, browser device
388
+ approval, private session record, and cleanup code as the Product suite. It
389
+ creates a synthetic draft static Gem for the direct read proof. It starts no
390
+ Gem build, release, model call, or provider job. It never loads the Staging
391
+ Golden Gem bearer, Keychain entry, workspace, or Gem path. Missing account,
392
+ Organization, or Gem access fails the preparation.
393
+
394
+ Cleanup must confirm deletion of the original Gem and workspaces. It must also
395
+ confirm separate revocation of the CLI grant and all issued sessions. Workspace
396
+ containment alone cannot pass. The cleanup owner keeps the original CLI
397
+ credential and private state until explicit grant revocation, session
398
+ revocation, and workspace deletion all pass. A later recovery uses that same
399
+ credential, including a refresh token that the failed check rotated.
400
+ The private record saves each workspace marker
401
+ before its create request, so cleanup can recover a lost create answer through
402
+ the exact owned marker. The workflow's recovery step uses that same record after
403
+ a failed or stopped smoke. Private state stays on the runner when cleanup fails;
404
+ the workflow never uploads it. Recovery cannot change the original smoke result.
405
+
406
+ A Development preparation reports `publication_not_attempted` and
407
+ `exact_archive_verified=false`. Publish, public archive verification, and Main
408
+ latest promotion each exclude Development. Preparation uses the source, Linux,
409
+ Windows, certified archive, installed failure, documentation, type, and safety
410
+ gates and retains the same archive for 90 days. It does not qualify a different
411
+ published CLI version or a Sandbox image.
412
+
307
413
  Before npm can publish, the workflow checks earlier publish runs on Staging and
308
414
  Main. If an earlier run may have reached npm, a retry uses its retained tarball
309
415
  when available and compares every byte with the current tested tarball. It then
@@ -342,3 +448,10 @@ the installation. Interactive text-mode commands also perform a bounded
342
448
  once-per-24h npm version check and write a single stderr notice when a newer CLI
343
449
  is available. The notifier is disabled for JSON/streaming output, CI,
344
450
  `NO_UPDATE_NOTIFIER`, and `URU_NO_UPDATE_NOTIFIER`.
451
+
452
+ The live CLI smoke takes the target environment's existing tenant-mutation
453
+ turn, shared with release deploys and migration apply. Package validation and
454
+ Windows checks run outside that turn. Before dispatch, read the latest
455
+ successful release receipt for both expected identities. A release that
456
+ changes before the smoke acquires its turn causes a refusal before access.
457
+ The workflow run title names the operation, source branch, and package version.