Repository navigation
Commit 28f2e99
docs(skills): the automation mcp recipe teaches the providerConfig.toolsSnapshot pin (#28597)
Fixes #28582
Clause-②: no
Metadata-protocol: none
## 维护者速读
- 改了什么:`skills/objectstack-automation/references/integration-recipes.md`
的 `mcp` 配方(第 2 则,GitHub 远程 MCP)新增一段,教 `providerConfig.toolsSnapshot`
钉住工具定义:钉的是什么、钉名必须在 `include`
里、摘要从哪来(`computeMcpToolsSnapshot`,或占位钉后读降级原因里打印的实际摘要)、钉不匹配时作者看到什么,并链接
connectors 文档的 pin 小节;配套一个 `@objectstack/skills` 的 `patch` changeset。
- 为什么改:PR #28515 落地了 pin 但刻意没动 `skills/**`(Tier H);写应用的 agent 先读
skills,配方里没有 pin 就等于每个 MCP 应用都不设防,服务端悄悄改一个工具的含义不会被发现。
- 风险与回滚:只改一份已发布的技能参考文件与一个 changeset,不改代码、schema、键或行为;回滚即 revert 这一个
commit。教学内容逐句对照 `packages/connectors/connector-mcp/src/mcp-provider.ts`
与 `tool-snapshot.ts` 在本基点的实现写成,没有运行时不兑现的键。
- 先看:① `integration-recipes.md` 第 2 则代码块后的新段(唯一的新增内容);② 同文件为付 token
棘轮而删掉的几处重复(Holds 的 `input` 条、第 4 则的签名格式句、第 6 则的连接细节、WeChat 条的括号)——每处在
SKILL.md、objectstack-platform 或 connectors 文档页另有原文;③
`.changeset/28582-skills-mcp-tools-snapshot.md`。
- 两分钟验证:`node scripts/check-skills-token-ratchet.mjs`,预期看到
`integration-recipes.md is 2487 tokens (ceiling 2488; headroom 1)`,且结尾
`57 authored bundle file(s) within their ceilings`。
- 需要你做的:`skills/**` 是 Tier H,本 PR 等待维护者批准或合入;无其他动作。
## What changes
- `skills/objectstack-automation/references/integration-recipes.md`,
recipe 2 (remote MCP server): one paragraph after the code block
teaching `providerConfig.toolsSnapshot` — tool name → sha256 of the
tool's `tools/list` definition; a pinned name `include` leaves out is
refused at boot; digests from `computeMcpToolsSnapshot(tools)`
(`@objectstack/connector-mcp`) or, with a 64-hex placeholder pin, from
the served digest the degraded reason prints; a pinned tool served
differently degrades the instance with no actions
(`CONNECTOR_UPSTREAM_CHANGED`), one no longer listed too, with the
reason on `GET /api/v1/automation/connectors` naming each tool and the
digest it now serves; link to the connectors page's pin section. Every
clause is read off
`packages/connectors/connector-mcp/src/mcp-provider.ts`
(`parseToolsSnapshot`, the include-coverage refusal,
`compareToolsSnapshot`, `toolsSnapshotDriftError`,
`pinnedToolsHiddenError`) and `tool-snapshot.ts` at the base commit
`cd065d36`; no example block is added.
- Paid for under the skills token ratchet (the file was at 2488/2488,
headroom 0) by deleting restatements in the same file, each with a
surviving home: the Holds `input` bullet's `{…}`-token refusal and "`os
validate` does not judge the `inputSchema` fit yet" (verbatim in
SKILL.md's `connector_action` row); recipe 4's `x-objectstack-signature`
format (SKILL.md § Inbound webhook, *Signature*; the recipe now points
there); the intro's `plugins:` / `requires` reminder
(objectstack-platform SKILL.md, the `requires` table and its "Keep
`automation` whenever `plugins:` lists a connector" bullet); recipe 6's
"(organization admins by default)", "for the admin to open" and "`GET`
reads the status; `DELETE` revokes" (the connectors page); recipe 2's
"folded into the request headers" aside and recipe 4's `// no trigger
user` (recipe 1's own comment); the WeChat bullet's `alipay-v3` aside
(the Holds `auth` list). The file lands at 2487 tokens against its 2488
ceiling; no ceiling moves.
- `.changeset/28582-skills-mcp-tools-snapshot.md`: `@objectstack/skills`
`patch` (the `skills/**` tree ships as that package), carrying
`Clause-②: no` and `Metadata-protocol: none`.
### Skills readings (`skills/**` diff — line and token counts, before →
after)
| Reading | Before (`cd065d36`) | After (`64882e22`) |
|:--|:--|:--|
| `integration-recipes.md`, lines | 176 | 178 |
| `integration-recipes.md`, bytes / ratchet tokens | 9949 / 2488
(ceiling 2488, headroom 0) | 9946 / 2487 (ceiling 2488, headroom 1) |
| Whole package `skills/**`, lines (every tracked file) | 19546 | 19548
|
| All `SKILL.md` files, lines (sum of 11) | 4587 | 4587 (untouched) |
| Whole shipped bundle, ratchet tokens (`check-skills-token-ratchet`
bundle total) | 221928 | 221927 |
Net content is a small deletion (−3 bytes, −1 token); the two added
lines are wrap, not growth.
## Tests
- No package code changes: the dependency closure (①) is empty and no
package test or typecheck is owed (②). No tested behaviour changed, so
no ablation.
- The skills token ratchet measured this edit in both directions on this
tree: at an intermediate state it was red — `integration-recipes.md is
2496 tokens; the ratchet ceiling is 2488 (over by 8)`, exit 1 — and
after the last cut it is green at 2487/2488, exit 0 (log below). That
red→green is the reading that the gate prices this file.
- Control-character scan of the two edited files: `grep -naP
'[\x00-\x08\x0b\x0c\x0e-\x1f\x7f]'` → no match (exit 1).
## Acceptance notes
- Judgement on the card's open question ("too niche for a recipe?"): not
too niche. The pin is one key beside `include`, the recipe already shows
`include`, and an app author has a no-code path to the digests — pin a
64-hex placeholder, boot, and read the served digest off the degraded
reason on `GET /api/v1/automation/connectors` (`toolsSnapshotDriftError`
prints `tool 'X' changed (it now hashes to …)`).
`computeMcpToolsSnapshot(tools)` is exported for anyone with a tool list
in code; there is no CLI command that prints a server's digests today (a
finding, not a defect: the docs page says the same and the placeholder
route is what the runtime delivers).
- Deliberately not taught in the recipe (docs-only detail, same file
budget): the canonical-JSON definition of the digest, the retry backoff
on which a degraded instance recovers, and the credential-path nuance
for a pinned tool the server no longer lists on an instance whose `auth`
reached the server (`pinnedToolsHiddenError`, a 403 naming both causes).
The recipe says such a tool "degrades it too" without naming the code,
which is true on both paths; the linked pin section carries the rest.
- Observation, noted and not filed (`carrier: none`): `connectors.mdx`'s
failure-mode table row for the pin folds the "no longer listed" case
under `CONNECTOR_UPSTREAM_CHANGED`, while the prose above it and
`mcp-provider.ts` route that case through the credential-rejected path
when the instance's credential reached the server; the prose is correct
and the row is a summary, so this is read as a precision note, not a
contract violation.
- `Skills-docs:` line: not owed (`Clause-②: no`, `Metadata-protocol:
none`).
## Verification
Final head `64882e22` (`git rev-parse --short HEAD` at the time of the
sweep; the working tree had no further edits). Gate list derived with
`node scripts/pm/dispatch-gates.mjs --commands --repo
objectstack-ai/objectstack` on this diff (2 paths vs merge base
`cd065d36`), every command run with its exit captured before any pipe,
then reconciled with `--ran`.
- Reconciliation verdict: `✓ dispatch-gates --ran: 44 derived famil(ies)
accounted for — 40 run, 4 NOT-MEASURED (4 DERIVED from a recorded exit
3).` — 0 UNRUN.
- 40 run, all exit 0, including the skills gates:
`check-skills-token-ratchet` (`check-skills-token-ratchet:
skills/objectstack-automation/references/integration-recipes.md is 2487
tokens (ceiling 2488; headroom 1).`), `check:skill-identifier-liveness`,
`check:skill-frame-sync`, `check:skill-compatibility`,
`@objectstack/spec check:skill-refs`, `check:nul-bytes`,
`check:doc-authoring`, `check:pm-skill-id-lint`,
`check:empty-changeset`, `check:changeset-no-major`,
`check:adr-0087-registration`, `check:closing-keyword-parity`.
`@objectstack/lint check:doc-formula-expressions` first answered exit 3
(its `@objectstack/formula` / `@objectstack/lint` dist absent in a fresh
worktree); after `turbo run build --filter=@objectstack/formula
--filter=@objectstack/lint` under `os-verify-lock.sh` (`VERDICT
command-exit 0`) it re-ran green, exit 0.
- NOT MEASURED locally, 4 (exit 3, `PREREQUISITE NOT MET` — each reads
the `dist/` of the whole 129-package closure, which this diff does not
touch): `check:dts-closure`, `check:dual-build-cjs-loads`,
`check:lean-entry-closure`, `check:sourcemap-no-sources-content`. CI
runs them after its build; read them off this PR's check-runs.
- The intermediate ratchet red that proves the gate prices this file:
`integration-recipes.md is 2496 tokens; the ratchet ceiling is 2488
(over by 8)` (exit 1), then the final green above (exit 0).
- Not run locally, by rule: `pnpm lint`, `test:repo` and the rest of the
repo-wide farm (CI's `Lint & Repo Gates`, `Test Core`); no package test
or typecheck is owed by a diff that touches no package.
- Local-only families (`check:dev-prereqs`,
`check:skill-frame-freshness`): the derivation did not name them and the
diff touches no four-axis frame file or `packages/spec` build, so they
were not run.
<details>
<summary>Run record (`ran.list`, the input to `--ran`): 44 commands with
exit codes</summary>
```text
node scripts/check-adr-0087-registration.mjs --base origin/main :: exit 0
node scripts/check-adr-0087-registration.mjs --self-test :: exit 0
node scripts/check-changeset-no-major.mjs --base origin/main :: exit 0
node scripts/check-closing-keyword-parity.mjs :: exit 0
node scripts/check-closing-keyword-parity.mjs --self-test :: exit 0
node scripts/check-comment-mask-corpus.mjs :: exit 0
node scripts/check-doc-route-spelling.mjs --advisory :: exit 0
node scripts/check-doc-route-spelling.mjs --self-test :: exit 0
node scripts/check-dts-emitted.mjs --self-test :: exit 0
node scripts/check-empty-changeset.mjs --base origin/main :: exit 0
node scripts/check-empty-changeset.mjs --self-test :: exit 0
node scripts/check-skills-token-ratchet.mjs :: exit 0
node scripts/check-skills-token-ratchet.mjs --self-test :: exit 0
node scripts/ci/assert-turbo-remote-cache.mjs --self-test :: exit 0
node scripts/ci/plan-test-core-shards.mjs --self-test :: exit 0
node scripts/ci/prune-turbo-cache.mjs --self-test :: exit 0
node scripts/pm/release-rehearsal-clone.mjs --self-test :: exit 0
node scripts/release-pending-publish.mjs --self-test :: exit 0
pnpm --filter @objectstack/lint run check:doc-formula-expressions :: exit 0
pnpm --filter @objectstack/spec run check:skill-refs :: exit 0
pnpm check:agent-test-spelling :: exit 0
pnpm check:changeset-gate-self-tests :: exit 0
pnpm check:ci-filter-parity :: exit 0
pnpm check:closed-ceremony-text :: exit 0
pnpm check:corpus-claim-drift :: exit 0
pnpm check:cross-package-test-inputs :: exit 0
pnpm check:doc-authoring :: exit 0
pnpm check:driver-memory-census :: exit 0
pnpm check:dts-closure :: exit 3
pnpm check:dual-build-cjs-loads :: exit 3
pnpm check:gitlink-declared :: exit 0
pnpm check:lean-entry-closure :: exit 3
pnpm check:nul-bytes :: exit 0
pnpm check:pm-changeset-deadline-census :: exit 0
pnpm check:pm-governed-merges :: exit 0
pnpm check:pm-skill-id-lint :: exit 0
pnpm check:published-files :: exit 0
pnpm check:refd-timer-probe :: exit 0
pnpm check:role-word :: exit 0
pnpm check:skill-compatibility :: exit 0
pnpm check:skill-frame-sync :: exit 0
pnpm check:skill-identifier-liveness :: exit 0
pnpm check:sourcemap-no-sources-content :: exit 3
pnpm check:watch-hint-literal :: exit 0
```
</details>
<details>
<summary>`check-skills-token-ratchet` final lines on
`64882e22`</summary>
```text
✓ check-skills-token-ratchet: skills/objectstack-automation/references/integration-recipes.md is 2487 tokens (ceiling 2488; headroom 1).
✓ check-skills-token-ratchet: 57 authored bundle file(s) within their ceilings; 10 generator-owned file(s) and 29 eval fixture(s) measured, not ratcheted.
```
</details>
---
_Generated by [Claude
Code](https://claude.ai/code/session_017xRBcVBKAFk1ntXSjvPt7U)_
---------
Co-authored-by: Claude <noreply@anthropic.com>1 parent a798ae8 commit 28f2e99
3 files changed
Lines changed: 53 additions & 39 deletions
File tree
- .changeset
- content/docs/automation
- skills/objectstack-automation/references
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
866 | 866 | | |
867 | 867 | | |
868 | 868 | | |
869 | | - | |
| 869 | + | |
870 | 870 | | |
871 | 871 | | |
872 | 872 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
11 | | - | |
12 | | - | |
| 11 | + | |
| 12 | + | |
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
18 | | - | |
19 | | - | |
20 | | - | |
21 | | - | |
22 | | - | |
23 | | - | |
24 | | - | |
25 | | - | |
26 | | - | |
27 | | - | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
28 | 24 | | |
29 | 25 | | |
30 | 26 | | |
31 | | - | |
| 27 | + | |
32 | 28 | | |
33 | 29 | | |
34 | | - | |
| 30 | + | |
| 31 | + | |
35 | 32 | | |
36 | 33 | | |
37 | 34 | | |
| |||
47 | 44 | | |
48 | 45 | | |
49 | 46 | | |
50 | | - | |
| 47 | + | |
51 | 48 | | |
52 | 49 | | |
53 | 50 | | |
54 | 51 | | |
55 | 52 | | |
56 | 53 | | |
57 | | - | |
| 54 | + | |
58 | 55 | | |
59 | 56 | | |
60 | 57 | | |
| |||
66 | 63 | | |
67 | 64 | | |
68 | 65 | | |
69 | | - | |
70 | | - | |
| 66 | + | |
| 67 | + | |
71 | 68 | | |
72 | 69 | | |
73 | 70 | | |
| |||
77 | 74 | | |
78 | 75 | | |
79 | 76 | | |
80 | | - | |
81 | | - | |
| 77 | + | |
| 78 | + | |
82 | 79 | | |
83 | 80 | | |
84 | | - | |
| 81 | + | |
85 | 82 | | |
86 | 83 | | |
87 | 84 | | |
88 | 85 | | |
89 | 86 | | |
90 | 87 | | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
91 | 100 | | |
92 | 101 | | |
93 | 102 | | |
94 | 103 | | |
95 | 104 | | |
96 | | - | |
| 105 | + | |
97 | 106 | | |
98 | 107 | | |
99 | 108 | | |
| |||
107 | 116 | | |
108 | 117 | | |
109 | 118 | | |
110 | | - | |
| 119 | + | |
111 | 120 | | |
112 | 121 | | |
113 | 122 | | |
| |||
121 | 130 | | |
122 | 131 | | |
123 | 132 | | |
124 | | - | |
125 | | - | |
126 | | - | |
127 | | - | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
128 | 136 | | |
129 | 137 | | |
130 | 138 | | |
| |||
162 | 170 | | |
163 | 171 | | |
164 | 172 | | |
165 | | - | |
166 | | - | |
167 | | - | |
168 | | - | |
169 | | - | |
170 | | - | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
171 | 178 | | |
172 | | - | |
173 | | - | |
174 | | - | |
175 | | - | |
176 | | - | |
| |||
0 commit comments