Skip to content

Commit d443658

Browse files
docs: teach os mcp connect and the use-runtime deploy target in the remaining pages (#31335)
<!-- claude-projects-attribution: {"github_login":"huangyiirene"} --> _Requested by **Irene** · [project thread](https://claude.ai/code/project/chan_01TJXtQ1tVD26ecLDZxFS67x?thread=cmsg_01TJXtQ1tVD26ecLDZxFS67xLF4QmNSimbBfXVa9LZxfqG)_ Fixes #31235 Clause-②: no Metadata-protocol: none `dispatch-gates --tier` reads a contract-review model mandate for `skills/**` (clause ①). That mandate is waived by the maintainer's standing order in this project (2026-11-03). This card ran on the project's default model, and the dispatching seat (domain:skills#3) runs the contract review. ## 维护者速读 - 改了什么:三个文档页与平台技能跟上 PR #31225 已发布的 CLI。`ai/agents.mdx` 的 Claude Code 行和 `build-with-claude-code.mdx` 的连接步骤先教 `os mcp connect`(自托管或本地用 `--url <base>`),手敲的 `claude mcp add` 留作没有 CLI 时的备选,无头 `--header` 写法不变;`deployment/cli.mdx` § `os dev` 说明 `d` 键只在云目标下先跑 `os cloud login`,`use-runtime` 目标直接部署到该运行时、不要云登录;`operations.md` 的 `os deploy` 退出码 1 段限定为云路径,新增一段写 `use-runtime` 目标的退出码 1 情形。 - 为什么改:这几处仍只教旧路径,照着做的作者会手敲 CLI 已经替他执行的命令,还会以为自托管部署需要云登录(#31235,来自 #31225 契约复核第 9 项与 N8)。 - 风险与回滚:纯文档与技能文字,不动代码;`operations.md` 先删同文件重复内容(-262 字节),余额 +35 tokens 按常设裁定 6513306068 抬高该行棘轮(3340 → 3375);发版 `@objectstack/skills` patch;回滚即 revert。 - 先看:`skills/objectstack-platform/references/operations.md` L95–L102;然后 `content/docs/deployment/cli.mdx` L169–L174。 - 两分钟验证:`node scripts/check-skills-token-ratchet.mjs`(3375 / 3375);对照 `packages/cli/src/commands/deploy.ts` L301–L355 读新段的每个退出情形;`packages/cli/src/utils/dev-deploy-key.ts` L26–L30 读 `d` 键不要云登录。 - 需要你做的:`check-governed-merges` 判为 Tier H(`skills/**`),需 `os-zhuang` 或 `hotlong` 批准;当前 head 尚无席位契约复核 PASS,契约复核待做,请先不要批。 ## What changes ### The four sites, before and after | Site | Before | After | |:--|:--|:--| | `content/docs/ai/agents.mdx` L99, Claude Code row | only the typed `claude mcp add --transport http objectstack https://<your-deployment>/api/v1/mcp`, with the headless `--header` alternative | names `os mcp connect` first (your ObjectOS Cloud environment) and `os mcp connect --url <base>` (a self-hosted or local server, registered as `objectstack`); the typed line stays as the fallback "Without the CLI"; the headless `--header` alternative stays, attached to the typed line, with the reason (`os mcp connect` stores no token) | | `content/docs/getting-started/build-with-claude-code.mdx` L477, L480 | two typed `claude mcp add … support-desk …` lines (local, deployed) | `npx os mcp connect --url http://localhost:3000` (the step-5 dev server), `npx os mcp connect` and `npx os mcp connect --url https://your-deployment.example.com` (a deployed instance); one sentence links `os mcp connect` and says it stores no token; the two typed lines follow as the fallback, byte-identical. L502 (now L511, the headless `--header` form) is unchanged | | `content/docs/deployment/cli.mdx` § `os dev` L169-L172 | "when you are not logged in to ObjectOS Cloud the same key runs `os cloud login` first" | the cloud login is for a cloud target; with a runtime [`os environments use-runtime`](#deploy-to-a-self-hosted-runtime) remembered, the key deploys there and asks for no cloud login | | `skills/objectstack-platform/references/operations.md` L100 | one `os deploy` exit-1 paragraph, all cloud-path refusals | that paragraph is scoped "exit 1, cloud", and a new paragraph gives the `use-runtime` target's path and exit-1 cases (below) | `npx os` matches the page's own step 5 (`npx os dev --ui`, L361). No `--name support-desk`: no later step on the page uses the server's name (the only other `support-desk` server line is the headless alternative at L511, a separate registration), so the CLI's own names stand. ### The new operations.md paragraph, and where each case comes from ```diff -**`os deploy` exit 1:** a refusal before any write publishes nothing: … +**`os deploy` exit 1, cloud:** a refusal before any write publishes nothing: … + +**A `use-runtime` target** (no `--env`) asks for no cloud login: build, dry-run plan, install, live on `hotLoaded`. Exit 1: a failed build; a dry run refused, unserved (no install-local) or ignored (an older runtime installed: upgrade it); an install refusal (rerun with the `--confirm-access-upgrade` / `--confirm-upgrade <token>` it printed); installed but not loaded (live after a restart). ``` | Case | `cli.mdx` § To a self-hosted runtime | Source on `main` | |:--|:--|:--| | no `--env`, no cloud login | L3253-L3255, L3274-L3275 | `deploy.ts` L162-L166 (`flags.env ? undefined : activeRuntimeTarget()`); `dev-deploy-key.ts` L26-L30 | | failed build | step 1 | `deploy.ts` L310-L314 | | dry run refused or unserved | step 2 | `deploy.ts` L329-L334 | | dry run ignored by an older runtime, which installed | step 2 | `package/install.ts` L545-L561 (`does not support a dry run: it ignored --dry-run and INSTALLED`); then `deploy.ts` L330-L334 exits 1 | | install refusal, `--confirm-access-upgrade` / `--confirm-upgrade` | step 3 (names only `--confirm-access-upgrade`) | `deploy.ts` L140-L155 (both flags), L337-L344 | | installed but not loaded | not listed | `deploy.ts` L346-L352 ("it loads when the runtime restarts") | ## Token readings (`scripts/check-skills-token-ratchet.mjs`, tokens = ceil(bytes / 4)) | File | `main` 604a2b3 | This PR | Ceiling | |:--|:--|:--|:--| | `skills/objectstack-platform/references/operations.md` | 13360 B = 3340 | 13500 B = 3375 | 3340 → 3375 | The order read 3285 / 3287; the seat re-measured 3340 / 3340 on `main` (PR #31225 raised the row) and that reading stands. **Deletions, each with its surviving home (-262 bytes):** 1. The `os deploy` row's tail "A `use-runtime` target, no `--env`: build, dry-run plan, install, live on `hotLoaded`; `--confirm-access-upgrade <token>`" becomes "A `use-runtime` target: below" (-92 B). Facts it held: the use-runtime target applies with no `--env`; the sequence build, dry-run plan, install, live on `hotLoaded`; `--confirm-access-upgrade <token>`. Home: the new paragraph two lines down, which carries every one of them. 2. The Common ops pitfalls row "A permission set is declared but grants nobody anything | Declaring a set is not assigning it — see "Assigning a permission set to a user" in **objectstack-data**." (-170 B). Facts it held: the symptom, declaring is not assigning, the pointer. Home: `skills/objectstack-data/rules/security.md` § Assigning a permission set to a user (L35-L37: "Declaring a set grants nobody anything — an assignment is **data**"). No script, test or platform eval pins it. Added: +402 B (the ", cloud" scope and the new paragraph). Net +140 B → 3375 tokens, remainder +35 over the 0-headroom ceiling. Only that row moves, pinned at the measurement, under the standing ruling quoted in the script beside it: maintainer ruling 2026-10-27, verbatim and untranslated, 「A:先削重复,余额按实测提高」 (ruling record 6513306068 on #27847). The seat ruled on these cuts and the +35 before the script was touched. No rewrap: every untouched line is byte-identical to `main`. ## Eval cases `skills/objectstack-platform/evals/config-plugins-ops.json` swept for "hand-typed only" and "deploy needs a cloud login": **none touched.** - Case 17 asks how to see an edit "on my ObjectOS Cloud environment"; its "log in with `os cloud login`" is right for that cloud-only prompt. - Case 21 (use-runtime) and case 22 (`os mcp connect`) already teach the new paths; their `must_not_contain` (`os deploy --url`, `--client cursor`) do not contradict their `expected_output`. ## Other sites found (not edited) - `content/docs/deployment/cli.mdx` § `os deploy` flag table (≈L3240-L3246) lists `--confirm-access-upgrade` but not `--confirm-upgrade` (`deploy.ts` L149-L155, added by #31243); § To a self-hosted runtime step 3 (L3267) names only `--confirm-access-upgrade`, and step 4 (L3270) omits the not-loaded exit 1 (`deploy.ts` L346-L352). - `skills/objectstack-platform/evals/config-plugins-ops.json` case 21 `expected_output` names only `--confirm-access-upgrade`. Not an old-claim case; left alone. - `content/docs/ai/connect-mcp.mdx` L45, L48, L68: typed `claude mcp add` lines, already under "Or type the line yourself" after `os mcp connect` (L27-L38). Already the order's shape. - `content/docs/ai/agents.mdx` L108 (private-deployment callout): "**Claude Code** (`claude mcp add`, or the plugin) dials the endpoint from your own machine". Still true, since `os mcp connect` runs that line. - No other "deploy needs `os cloud login`" claim in `content/docs/**` or `skills/**`. `cli.mdx` L3216 (`os cloud login # once per machine`) is the cloud example in § `os deploy`, correct for that path. - Left alone by order: `content/docs/releases/v16.mdx` L76, L468; blog posts; CHANGELOGs. ## Changeset `.changeset/31235-platform-skill-use-runtime-deploy-exit.md`: `'@objectstack/skills': patch`, with `Clause-②: no` and `Metadata-protocol: none`. ## Gates `node scripts/pm/dispatch-gates.mjs --commands --repo objectstack-ai/objectstack` derived 88 commands against merge base `604a2b3b9`. All 88 ran on head `a082087b` after a full `pnpm build` (exit 0), under `NODE_OPTIONS=--max-old-space-size=8192`: **88 × exit 0, 0 NOT MEASURED** among the listed commands. The CI-only families dispatch-gates names as not locally measurable (shard attestation, Build Core / Build Docs steps, type-check lanes) are left to CI. The order's named checks are all in that list and exit 0: `pnpm --filter @objectstack/spec run check:skill-examples`, `pnpm check:skill-identifier-liveness`, `pnpm --filter @objectstack/spec run check:skill-refs`, `pnpm check:doc-authoring`, `node scripts/check-skills-token-ratchet.mjs` (operations.md 3375 / 3375). Also `node scripts/check-commit-card-trailers.mjs --range origin/main..HEAD` exit 0 and `node scripts/pm/check-governed-merges.mjs --branch HEAD` exit 0 (Tier H). Per-command record: project file `card-31235/gates-a082087b.txt`. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01J8VVAntMdbEQxYFD6N2ePk Co-authored-by: Claude <noreply@anthropic.com>
1 parent 383c353 commit d443658

6 files changed

Lines changed: 47 additions & 11 deletions

File tree

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
---
2+
'@objectstack/skills': patch
3+
---
4+
5+
docs(skills): the platform skill says how `os deploy` exits 1 on a self-hosted runtime target
6+
7+
Clause-②: no
8+
Metadata-protocol: none
9+
10+
`objectstack-platform`'s operations reference scopes its `os deploy` exit-1 paragraph to ObjectOS Cloud and adds one for a target `os environments use-runtime` remembered: it asks for no cloud login, and it exits 1 on a failed build, a dry run the runtime refuses, cannot serve or ignores (an older runtime installed anyway), an install refusal (rerun with the `--confirm-access-upgrade` or `--confirm-upgrade` token it printed), or a package the running kernel did not load (live after a restart). The `os deploy` row's use-runtime tail moves into that paragraph, and a pitfalls row that only pointed to the data skill's permission-set assignment is cut. The CLI behaviour already shipped; this release only teaches it.

‎content/docs/ai/agents.mdx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ Per client:
9696

9797
| Client | How to connect |
9898
|---|---|
99-
| **Claude Code** | `claude mcp add --transport http objectstack https://<your-deployment>/api/v1/mcp` — a browser login opens on first use. Headless alternative: add `--header "x-api-key: osk_..."`. |
99+
| **Claude Code** | [`os mcp connect`](/docs/deployment/cli#os-mcp-connect) registers your ObjectOS Cloud environment; `os mcp connect --url <base>` registers a self-hosted or local server as `objectstack`. Without the CLI: `claude mcp add --transport http objectstack https://<your-deployment>/api/v1/mcp`. Either way a browser login opens on first use. Headless alternative: add `--header "x-api-key: osk_..."` to the `claude mcp add` line (`os mcp connect` stores no token). |
100100
| **Claude Desktop** | Settings → Connectors → *Add custom connector* → paste the MCP URL → sign in when prompted. Connects from Anthropic's servers — needs public HTTPS (see below). |
101101
| **claude.ai (web)** | Settings → Connectors → *Add custom connector* → paste the MCP URL. Connects from Anthropic's servers — needs public HTTPS (see below). |
102102
| **Other MCP clients** | Any client implementing MCP authorization discovers the flow automatically; header-based clients can send the API key instead. |

‎content/docs/deployment/cli.mdx‎

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -167,9 +167,11 @@ Starts development mode. Three usage shapes:
167167
3. **Monorepo root** (cwd has `pnpm-workspace.yaml`) — orchestrates `pnpm -r dev` across packages.
168168

169169
Once the local server is up, `os dev` in an interactive terminal offers
170-
**`d` to deploy**: it runs [`os deploy`](#os-deploy) in the same terminal, and
171-
when you are not logged in to ObjectOS Cloud the same key runs `os cloud login`
172-
first. Saving a file never deploys.
170+
**`d` to deploy**: it runs [`os deploy`](#os-deploy) in the same terminal. When
171+
the target is ObjectOS Cloud and you are not logged in, the same key runs
172+
`os cloud login` first. When the target is a runtime
173+
[`os environments use-runtime`](#deploy-to-a-self-hosted-runtime) remembered, the
174+
key deploys there and asks for no cloud login. Saving a file never deploys.
173175

174176
```bash
175177
os dev # Auto-compile cwd config, then start

‎content/docs/getting-started/build-with-claude-code.mdx‎

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -474,14 +474,23 @@ browser login (you connect as yourself, no admin-minted credentials):
474474

475475
```bash
476476
# the dev server you just booted in step 5
477-
claude mcp add --transport http support-desk http://localhost:3000/api/v1/mcp
477+
npx os mcp connect --url http://localhost:3000
478478

479-
# or a deployed instance
480-
claude mcp add --transport http support-desk https://your-deployment.example.com/api/v1/mcp
479+
# or a deployed instance: your ObjectOS Cloud environment, or a self-hosted server
480+
npx os mcp connect
481+
npx os mcp connect --url https://your-deployment.example.com
481482

482483
# first tool use opens a browser login — you're connected as yourself
483484
```
484485

486+
[`os mcp connect`](/docs/deployment/cli#os-mcp-connect) runs the `claude mcp add`
487+
line for you and stores no token. Without the CLI, type the line yourself:
488+
489+
```bash
490+
claude mcp add --transport http support-desk http://localhost:3000/api/v1/mcp
491+
claude mcp add --transport http support-desk https://your-deployment.example.com/api/v1/mcp
492+
```
493+
485494
Or install the [official plugin](https://github.com/objectstack-ai/claude-plugin) —
486495
it bundles the portable ObjectStack agent skill and a guided `/objectstack:connect`
487496
command (one plugin serves every deployment; the URL is the only input):

‎scripts/check-skills-token-ratchet.mjs‎

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1130,7 +1130,21 @@ export const CEILINGS = new Map([
11301130
// measured, raises the row, pinned at the measurement. Same maintainer
11311131
// ruling, verbatim and untranslated: 「A:先削重复,余额按实测提高」 (ruling
11321132
// record 6513306068 on #27847).
1133-
['skills/objectstack-platform/references/operations.md', 3340],
1133+
// 3340 -> 3375: the `os deploy` exit-1 paragraph is scoped to the cloud and
1134+
// a `use-runtime` target's own paragraph follows: no cloud login, and its
1135+
// exit 1 (a failed build; a dry run refused, unserved or ignored; an install
1136+
// refusal with `--confirm-access-upgrade` / `--confirm-upgrade`; installed
1137+
// but not loaded). Paid first by deleting restatement in the same file
1138+
// (-262 bytes): the `os deploy` row's use-runtime tail (home: the new
1139+
// paragraph, which carries each of its facts) and the Common ops pitfalls
1140+
// row on a declared permission set that grants nobody anything (home:
1141+
// objectstack-data rules/security.md § Assigning a permission set to a
1142+
// user). 13360 -> 13500 bytes (+140 net: -262 cut, +402 added)
1143+
// -> ceil(13500 / 4) = 3375; headroom was 0, so
1144+
// the remainder, +35 measured, raises the row, pinned at the measurement.
1145+
// Same maintainer ruling, verbatim and untranslated:
1146+
// 「A:先削重复,余额按实测提高」 (ruling record 6513306068 on #27847).
1147+
['skills/objectstack-platform/references/operations.md', 3375],
11341148
['skills/objectstack-platform/references/plugin-development.md', 3137],
11351149
['skills/objectstack-upgrade/references/examples-upgrade.md', 1197],
11361150

‎skills/objectstack-platform/references/operations.md‎

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -92,12 +92,14 @@ Port resolution is the same for `os dev` and `os start` (both spawn `os serve`):
9292
| `os environments list` / `create` / `switch` | Manage cloud environments (prod/staging/dev) |
9393
| `os environments use-runtime <url> --token <key>` | Deploy to a self-hosted runtime instead: the key (one it issued) is tried first (`--no-verify` skips), then kept in `~/.objectstack/cloud.json` (0600) across cloud login/logout. `--forget` or `os environments switch` targets the cloud again |
9494
| `os cloud login` / `logout` / `whoami` | Cloud auth subcommands (these three only — there are no `os cloud logs/metrics/status`) |
95-
| `os deploy` (or `npm run deploy`, or `d` in `os dev`) | See an edit on your org's ObjectOS Cloud environment: build, publish `<manifest.version>-dev.<timestamp>`, install, wait until served. Environment: `--env <id>`, else the one `os environments switch` recorded (kept across `os cloud login`), else your organization's only one. `--no-wait`; `--wait-timeout <seconds>` (600). A `use-runtime` target, no `--env`: build, dry-run plan, install, live on `hotLoaded`; `--confirm-access-upgrade <token>` |
95+
| `os deploy` (or `npm run deploy`, or `d` in `os dev`) | See an edit on your org's ObjectOS Cloud environment: build, publish `<manifest.version>-dev.<timestamp>`, install, wait until served. Environment: `--env <id>`, else the one `os environments switch` recorded (kept across `os cloud login`), else your organization's only one. `--no-wait`; `--wait-timeout <seconds>` (600). A `use-runtime` target: below |
9696
| `os package publish [dist/objectstack.json] [--env … --install --visibility org]` | Upload the compiled artifact as a versioned package to the cloud catalog (ADR-0008 P3). Listing file, README, review and every screen the customer's administrator meets: [Marketplace handbook](https://objectstack.ai/docs/deployment/marketplace-handbook) |
9797
| `os package install <manifest-id │ ./dist/objectstack.json> [--version │ -u/--url]` | Install a package into a **running** runtime. Catalog mode (by manifest id) or air-gapped local-artifact mode. Auths as a **target runtime** user (`-t/--token` or `--email/--password`; env `OS_RUNTIME_TOKEN` or `OS_RUNTIME_EMAIL`/`OS_RUNTIME_PASSWORD`), not the cloud login. No `-u`: the `use-runtime` runtime and, with no `-t`/`--email`, its key; else `http://localhost:3000` |
9898
| `os mcp connect` | Register the cloud environment's MCP server (picked as `os deploy` picks it) with Claude Code (`claude mcp add`); `--url <base>` for a self-hosted or local server (named `objectstack`); `--name`; `--print` runs nothing (other clients). Stores no token: the client runs the server's own OAuth |
9999

100-
**`os deploy` exit 1:** a refusal before any write publishes nothing: log in (`os cloud login`), pick an environment (`--env`; none: create one in the ObjectOS Cloud console), or fix the local build or `manifest.version`. `could not build …: <reason>`: the environment's build failed, it keeps serving the previous one; fix and deploy again. `Timed out after …`: the install is recorded and a failing build reads as pending for minutes; deploy again with a longer `--wait-timeout`, or see the build in the ObjectOS Cloud console.
100+
**`os deploy` exit 1, cloud:** a refusal before any write publishes nothing: log in (`os cloud login`), pick an environment (`--env`; none: create one in the ObjectOS Cloud console), or fix the local build or `manifest.version`. `could not build …: <reason>`: the environment's build failed, it keeps serving the previous one; fix and deploy again. `Timed out after …`: the install is recorded and a failing build reads as pending for minutes; deploy again with a longer `--wait-timeout`, or see the build in the ObjectOS Cloud console.
101+
102+
**A `use-runtime` target** (no `--env`) asks for no cloud login: build, dry-run plan, install, live on `hotLoaded`. Exit 1: a failed build; a dry run refused, unserved (no install-local) or ignored (an older runtime installed: upgrade it); an install refusal (rerun with the `--confirm-access-upgrade` / `--confirm-upgrade <token>` it printed); installed but not loaded (live after a restart).
101103

102104
> **Cloud connection & marketplace (`@objectstack/cloud-connection`, ADR-0008/0009):**
103105
> the open runtime-side cloud client; its `MarketplaceInstallLocalPlugin` serves the
@@ -175,5 +177,4 @@ the other imports: [Using Plugins](./plugin-development.md#using-plugins).
175177
| LiteKernel test passes, ObjectKernel boot fails | Test missed a plugin the CLI auto-registers — compare your test's `use()` list against the `os dev` boot log |
176178
| Hot reload misses new objects | Barrel `src/objects/index.ts` not re-exporting — check the file |
177179
| Login works but **Setup / Studio missing** | The logged-in user isn't a platform admin. Setup/Studio are gated by `setup.access` / `studio.access` on `admin_full_access`, auto-granted only to the first registered **human** (`bootstrapPlatformAdmin`). The `usr_system` seed identity is skipped, so it can't steal the grant. Either sign up first (`--seed-admin`/`--fresh` does this) or check `sys_user_permission_set` for a cross-tenant (`organization_id = NULL`) `admin_full_access` link on your user. Don't edit nav code first. |
178-
| A permission set is declared but grants nobody anything | Declaring a set is not assigning it — see "Assigning a permission set to a user" in **objectstack-data**. |
179180
| The official image exits at start naming `OS_DATABASE_URL` / `OS_AUTH_SECRET` / `OS_SECRET_KEY` | The image presets `OS_DEPLOYMENT_DURABILITY_CHECK_ENABLED=true`: with any of the three unset, `os start` exits 1 before it writes a database file or a secret. Set the named ones on the run command. Upgrading a container that ran on the image's defaults? **Keep its generated values**, read from the old container's `/home/node/.objectstack` (`docker exec <container> cat <file>`, or its volume): `OS_AUTH_SECRET` is the contents of `auth-secret`, `OS_SECRET_KEY` the contents of `dev-crypto-key`, and the data is `data/objectstack.db` (`OS_DATABASE_URL=file:…` on the kept volume, or migrate it). Fresh values leave every saved credential unreadable and sign everyone out. |

0 commit comments

Comments
 (0)