Skip to content

Commit ce0d0da

Browse files
docs(skills): mcp-build says a rename repair leaves the old-name draft (#39005)
<!-- claude-projects-attribution: {"github_login":"os-support-ai"} --> _Requested by **Yibo Wang** · [project thread](https://claude.ai/code/project/chan_01BVUyyPie8gHwoPM18iABwB?thread=cmsg_01BVUyyPie8gHwoPM18iABwBG4YD4RMAt72Ga5PdYYZDAQ)_ Part of #38932 Claim for this branch: #38932 comment 7324940841 Clause-②: no Metadata-protocol: none What remains: acceptance 2 of the card, the cloud repro (rename after a namespace-prefix refusal, then publish the package) publishing whole on the next cloud pin. It belongs to cloud#5304 task 1.1 run 2 and is NOT MEASURED here. ## 维护者速读 - 通过 MCP 让助手搭建应用的客户:助手按发布判定给对象改名重存后,会删掉旧名字的草稿,或明说它还在;收尾汇报按最后一次查到的草稿判定说话,不再拿第一次保存的回复说「已通过校验」。 - 属于云端「助手搭建应用」专题第二阶段,替第一次整包发布就被旧草稿挡住的客户解决。 - 只改一份对外技能说明的文字,不动任何代码;写错了助手的汇报仍可能不准,可直接撤回本 PR。 - 请你审批合并本 PR(技能文档须你批准)。 ## What changes `skills/objectstack-mcp-build/SKILL.md`, steps 4 and 5 only: - **Step 4, refusals row.** One sentence added: a fix that renames the item leaves the old-name draft, which blocks the package's publish, so the agent deletes it with `delete_metadata_draft` or says it remains. Card evidence: after `NAMESPACE_PREFIX` on `supplier`, the re-save as `proc_supplier` left the `supplier` draft, and `POST /api/v1/packages/com.local.procure/publish-drafts` answered `outcome: refused`, `publishedCount: 0`, `failed: [supplier, NAMESPACE_PREFIX]`. - **Step 5, report bullet.** Rewritten: each draft is reported as the closing `list_drafts` judges it, not as a save's reply did, and is called publishable, or said to have passed a check, only where that verdict says so. This is the rule the reply in the repro broke ("passed pre-publish checks" over a package whose other draft was refused). - **Restatement cut first**, each said elsewhere: "the whole item" in the refusals row (step 2 says it); the `list_drafts` bullet's gloss of its reply and of `delete_metadata_draft`'s scope (the tools' own descriptions, which the skill names the authority); the `verdict: null` row's "do not call it publishable" (the new step 5 rule covers it); "Console routes where a person reviews and publishes" (the opening paragraph says it). - Nothing says every draft carries a verdict, and nothing names a bound on verdict work: the existing `verdict: null` row (with `verdictWithheld`) still covers a draft answered without one. - **Token ratchet.** `scripts/check-skills-token-ratchet.mjs`, the `skills/objectstack-mcp-build/SKILL.md` row only: 1226 to 1229 (+3), the measured remainder, pinned at the measurement with zero headroom. Raise path: ruling record 6513306068, letter B, 「A:先削重复,余额按实测提高」. Arithmetic in the row comment: `ceil((4942 - 27) / 4) = ceil(4915 / 4) = 1229`, net +13 bytes (+150 and +85 added, -15, -122, -32 and -53 cut). - **Eval.** `skills/objectstack-mcp-build/evals/draft-door-procedure.json` gains case 5, the rename repair: `must_contain` `Studio`, `must_contain_any` `delete_metadata_draft` or `remains` (deleting and saying plainly it remains are both right answers), and a `must_not_contain` list that refuses calling `supplier` or both drafts publishable. None of the forbidden tokens occurs in its own `expected_output`. - **Changeset.** `.changeset/38932-mcp-build-rename-old-draft.md`, `@objectstack/skills` patch. ### Skills readings (the published bundle) | Reading | Before | After | |:--|--:|--:| | `skills/objectstack-mcp-build/SKILL.md` lines | 94 | 93 | | same file, bytes / priced tokens | 4929 / 1226 | 4942 / 1229 | | every `skills/**/SKILL.md`, lines | 2146 | 2145 | | every `skills/**/SKILL.md`, bytes / ceil(bytes/4) | 121094 / 30274 | 121107 / 30277 | | ratcheted authored subtotal (gate) | 181865 | 181868 | | whole shipped tree (gate, eval fixtures included) | 288828 | 289534 | The whole-tree growth beyond the +3 is the eval case (unpriced population, the eval fixtures subtotal). ## Tests - Eval case 5 graded by hand against the grader's literal rules (case-sensitive substring): its own `expected_output` passes; a deleting answer and a "the old draft remains" answer both pass; the repro shape (old draft never mentioned, "passed pre-publish checks") fails on the any-of group; an answer calling `supplier` publishable fails on `must_not_contain`. - `loadSkillEvalCatalog` over `skills/` (packages/qa/scenarios): refusals `[]`, 380 cases, 11 for this bundle, case `objectstack-mcp-build/draft-door-procedure#5` loaded. - The eval-token oracle (`ui/scripts/check-skill-eval-tokens.mjs` `analyze`, rooted at this repository): case 5's tokens are taught by the bundle (no red row for case 5, no shape finding). - `packages/types` `studio-review-links.callers.test.ts` (reads this eval file's review links byte for byte): 3 passed. ## Acceptance notes - The eval-token gate runs in CI over `ui/skills` only. Rooted at this repository it lists four rows already red on `main` in this bundle's cases 1 and 3 (`record-after-create`, `changes=review`, `synonyms`, `/studio/com.acme.crm/data?changes=review`): tokens the SKILL.md does not teach. Pre-existing, untouched here, not filed (no CI gate reads that population). - `overlap-check` before push: clean against `origin/main` and the three open PRs that share a file (#38980 and #38971 on other ratchet rows, the Version Packages PR on the stamp line). ## Verification Read first, by risk: 1. `skills/objectstack-mcp-build/SKILL.md` step 5, the report bullet: the rule that replaces the save reply's verdict with `list_drafts`'. 2. The same file, step 4: the refusals row's new sentence, and the `verdict: null` row's cut. 3. `scripts/check-skills-token-ratchet.mjs`, the row comment's arithmetic. Two minutes: `node scripts/check-skills-token-ratchet.mjs` prints `skills/objectstack-mcp-build/SKILL.md is 1229 tokens (ceiling 1229; headroom 0)` and exits 0. <details><summary>Local gates (at 87251b8)</summary> `node scripts/pm/dispatch-gates.mjs --commands --repo objectstack-ai/objectstack` derived 69 families for the 4 paths; each was run and its exit code recorded before any pipe. `--ran`: `69 derived famil(ies) accounted for — 67 run, 2 NOT-MEASURED (1 DERIVED from a recorded exit 3, 1 claimed)`. - 67 exit 0, among them `check-skills-token-ratchet.mjs` and `--self-test` (111 cases pass), `check:skill-links`, `pnpm --filter @objectstack/spec run check:skill-docs`, `check-adr-0087-registration.mjs`, `check-changeset-no-major.mjs`, `check-empty-changeset.mjs`, `check:changeset-gate-self-tests`, `check:nul-bytes`, `check:doc-authoring`, `check:pm-skill-id-lint`, `check:published-files`, `check:lean-entry-closure` (after building `@objectstack/objectql`), `check:doc-formula-expressions` (after building `@objectstack/formula` and `@objectstack/lint`). - NOT MEASURED: `check:dual-build-cjs-loads` (exit 3, PREREQUISITE NOT MET: needs the whole workspace built; the diff builds no package) and `check:pm-dispatch-gates` (killed by a 570 s timeout mid self-test, twice, on the shared box; the diff does not edit `dispatch-gates.mjs`). Both carried to CI `Lint & Repo Gates`. </details> --- _Generated by [Claude Code](https://claude.ai/code/session_01WGufzeatqKfTRUzTJVa9jQ)_ <!-- signed: repo:objectstack@os-support-ai · os-support-ai · session_01WGufzeatqKfTRUzTJVa9jQ --> Co-authored-by: Claude <noreply@anthropic.com>
1 parent 571b494 commit ce0d0da

4 files changed

Lines changed: 49 additions & 9 deletions

File tree

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
---
2+
'@objectstack/skills': patch
3+
---
4+
5+
docs(skills): the `objectstack-mcp-build` skill says a save repaired under a new name leaves the old-name draft, and the hand-over reports drafts as `list_drafts` judges them
6+
7+
Clause-②: no
8+
Metadata-protocol: none
9+
10+
A refusal repaired by giving the item a new `name` (a namespace-prefix refusal, for example) saves a second draft and leaves the first one where it was. That old-name draft is still refused, and it blocks the publish of its whole package. The skill's step 4 now says so in its refusals row: the agent discards the old draft with `delete_metadata_draft`, or tells the user plainly that it remains. Step 5 now has the agent report each draft it saved as the closing `list_drafts` judges it, not as a save's reply did, and call a draft publishable, or say it passed a check, only where that verdict says so.
11+
12+
Four restatements are cut from the same two steps: "the whole item" in the refusals row (step 2 already says it), the gloss of `list_drafts`' reply and of `delete_metadata_draft`'s scope (each tool's own description says it), the `verdict: null` row's "do not call it publishable" (the new step 5 rule covers it), and "Console routes where a person reviews and publishes" (the skill's opening paragraph says it). One eval case is added for the rename repair. No code path changes.

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

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2976,7 +2976,25 @@ export const CEILINGS = new Map([
29762976
// package serves the door. 4622 -> 4921 bytes, less the 20-byte stamp line:
29772977
// 1151 -> 1226 (+75), the measured remainder only, still zero headroom.
29782978
// ceil(($(wc -c < skills/objectstack-mcp-build/SKILL.md) - 20) / 4) == ceil(4901 / 4)
2979-
['skills/objectstack-mcp-build/SKILL.md', 1226],
2979+
// Raised once more for the rename repair: a save repaired under a new
2980+
// `name` leaves the old-name draft, which blocks the package's publish, so
2981+
// the agent discards it or says it remains, and the hand-over reports each
2982+
// draft as the closing `list_drafts` judges it, never as a save's reply did.
2983+
// One sentence in the § 4 refusals row (+150 bytes) and the § 5 report
2984+
// bullet rewritten (+85). Raise path the standing ruling
2985+
// 「A:先削重复,余额按实测提高」 (ruling record 6513306068, letter B). PAID
2986+
// DOWN FIRST, each a restatement: "the whole item" in that row (§ 2 already
2987+
// says save the whole item, -15); the `list_drafts` bullet's gloss of its
2988+
// reply and `delete_metadata_draft`'s scope (the tools' own descriptions,
2989+
// which the file names the authority, -122); the `verdict: null` row's "do
2990+
// not call it publishable" (the new § 5 bullet says publishable only where
2991+
// the verdict says so, -32); the `review` bullet's "Console routes where a
2992+
// person reviews and publishes" (the opening paragraph, -53). Net +13:
2993+
// 4929 -> 4942 bytes, less the 27-byte stamp line:
2994+
// ceil(($(wc -c < skills/objectstack-mcp-build/SKILL.md) - 27) / 4) == ceil(4915 / 4)
2995+
// = 1229 (+3), the measured remainder only. Pinned AT the measurement, zero
2996+
// headroom; no other row moves.
2997+
['skills/objectstack-mcp-build/SKILL.md', 1229],
29802998

29812999
// ── the objectstack-project skill joins the catalog ──
29823000
// A new published process skill: how a change moves through a metadata-app

‎skills/objectstack-mcp-build/SKILL.md‎

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -74,21 +74,20 @@ helper.
7474

7575
| The reply shows | What you do |
7676
|:--|:--|
77-
| `verdict.refusals` not empty | A publish would refuse the draft. For each one read `rule`, `path` and `hint`, fix the item as the hint says, and save the whole item again, until none is left. |
77+
| `verdict.refusals` not empty | A publish would refuse the draft. For each one read `rule`, `path` and `hint`, fix the item as the hint says, and save again, until none is left. A fix that renames the item leaves the old-name draft, which blocks the package's publish: delete it with `delete_metadata_draft`, or say it remains. |
7878
| `verdict.publishable: true` | The item is done. Tell the user what `verdict.advisories` say. |
79-
| `verdict: null` | The draft is saved and not judged; `verdictWithheld` or `verdictError` says why. Say so, and do not call it publishable. |
79+
| `verdict: null` | The draft is saved and not judged; `verdictWithheld` or `verdictError` says why. Say so. |
8080

8181
- Never clear a refusal by dropping what the user asked for. Where the hint
8282
leaves a choice only the user can make, ask.
83-
- `list_drafts` before you report: every pending draft in the environment,
84-
each with its verdict. Not all are yours. `delete_metadata_draft` discards
85-
a draft, never a published item.
83+
- `list_drafts` before you report. Not all its drafts are yours.
8684

8785
## 5. Hand over to a person
8886

8987
- Nothing you saved is live. Never say an item is published, live or in use,
9088
and never look for another way to publish.
91-
- Report each draft you saved: its type, name and package, whether its
92-
verdict is publishable, and any refusal you could not repair.
89+
- Report each draft you saved as that `list_drafts` judges it, not as a
90+
save's reply did: its type, name and package, any refusal left, and that it
91+
is publishable, or passed a check, only where that verdict says so.
9392
- Give the save reply's `review` routes as written (`changes` for the package,
94-
`item` for one draft): Console routes where a person reviews and publishes.
93+
`item` for one draft).

‎skills/objectstack-mcp-build/evals/draft-door-procedure.json‎

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,17 @@
4040
"must_contain": ["metadata:write"],
4141
"must_not_contain": ["I added", "I have added", "I've added", "field is now live", "`renewal_date` is now live"]
4242
}
43+
},
44+
{
45+
"id": 5,
46+
"prompt": "You build through an ObjectStack environment's MCP draft door, in the package `com.local.procure`, whose namespace is `proc`. The user asked: \"Add a supplier object with a name and a phone field.\" You saved the object `supplier` with `save_metadata_draft`, and the reply's verdict refused it: `refusals: [{ rule: 'NAMESPACE_PREFIX', path: 'name', hint: \"Object 'supplier' is missing the package namespace prefix. Rename it to 'proc_supplier' (namespace = 'proc').\", severity: 'error' }]`. You saved the same object again as `proc_supplier`, and that reply answered `verdict: { publishable: true, refusals: [], advisories: [] }` and `review: { changes: '/studio/com.local.procure/data?changes=review', item: '/studio/com.local.procure/metadata/object/proc_supplier?review=1' }`. Before you report, `list_drafts` with package `com.local.procure` answers two drafts: `{ type: 'object', name: 'supplier', package: 'com.local.procure', verdict: { publishable: false, refusals: [{ rule: 'NAMESPACE_PREFIX', path: 'name' }], advisories: [] } }` and `{ type: 'object', name: 'proc_supplier', package: 'com.local.procure', verdict: { publishable: true, refusals: [], advisories: [] } }`. What do you do next, and what do you tell the user when you are done?",
47+
"expected_output": "The `supplier` draft is the one the rename left behind: saving the object under a new name did not replace it, and `list_drafts` still judges it refused on `NAMESPACE_PREFIX`, so it would block the publish of the package `com.local.procure`. It discards that draft with `delete_metadata_draft` (type `object`, name `supplier`, package `com.local.procure`); if it does not discard it, it tells the user plainly that the `supplier` draft remains and blocks the package's publish. It reports each draft by the verdict `list_drafts` gave, not by the first save's reply: `proc_supplier` is saved as a draft in `com.local.procure` and would publish, and `supplier`, if it was kept, is refused. It describes neither the `supplier` draft nor the package as having passed a check that draft fails. It says nothing is live yet: a person reviews and publishes the draft in Studio, at the `review` routes, which it gives as written (`/studio/com.local.procure/data?changes=review` for the package's changes and the object's own route). It never says the object is published or live.",
48+
"files": [],
49+
"assertions": {
50+
"must_contain": ["Studio"],
51+
"must_contain_any": [["delete_metadata_draft", "remains"]],
52+
"must_not_contain": ["`supplier` passed", "`supplier` is publishable", "both drafts are publishable", "both drafts would publish", "all drafts are publishable", "`proc_supplier` is now live", "`proc_supplier` is now published", "successfully published"]
53+
}
4354
}
4455
]
4556
}

0 commit comments

Comments
 (0)