Repository navigation
Commit 7a3f86c
fix: refusal and remedy copy from the v18.4.0 sweep (clone control label, short and empty unknown keys, CLI unknown command, MCP doc) (#35397)
<!-- claude-projects-attribution: {"github_login":"os-bill"} -->
_Requested by **Bill** · [project
thread](https://claude.ai/code/project/chan_016iMXWSZDzqWRWvWzdNo8wg?thread=cmsg_016iMXWSZDzqWRWvWzdNo8wgRuogP8Tp8XyFXLc92Bxvo6)_
repo:objectstack#5 · os-bill · session_01Utp6CZiaBg6rk7dpy1s9Me
Fixes #33345
Clause-②: no
Metadata-protocol: none
## 维护者速读
-
用户能看到什么变化:管理员改不了已安装包里的权限集时,提示里的按钮名改成界面上真实显示的「新建类似」;保存元数据被拒时,空键名不再显示成一对空引号,四五个字母的错键不再被乱猜成无关的键;命令行输错子命令时会指向对应的帮助;接入
MCP 的文档改正了撤回审批被拒时的返回码。
- 为什么做:来自上一版全面走查记下的五条提示与文档问题,其中「流程引用环境里的流程」那条此前已修好,本次核实后未改。
- 出错会怎样:只改提示文字、帮助指引和文档,什么能存、什么被拒一律不变;有问题回退本 PR 即可。
- 要你做什么:在随后的决策卡上决定,视图保存被拒时附带的那条笼统「输入无效」条目是删掉、改写还是保留。
## What changes
Five rows from the v18.4.0 sweep ledger (comment 6881136418 on #32908).
Each was re-measured on `origin/main` at `c05a8a01c9`; one was already
fixed and one sub-item is held for a decision. Nothing new is accepted
or refused.
- **Row 130, packaged permission sets (the `ITEM_LOCKED` sentence).**
The save door's regime-C row
(`packages/metadata-protocol/src/packaged-base-regime.ts`) and
plugin-security's `NOT_OVERRIDABLE` lock refusals
(`packaged-permission-set-lock.ts`: the diagnostic and both end-user
texts, 11 locales) sent the admin to a "Clone" action. Measured in the
console source: both entry points, Studio's Access pillar
(`access-new-similar`) and Setup's permission matrix, draw
`perm.clone.action`, which is "New similar" in `en` and "新建类似" in `zh`;
the designer strings ship only those two, so every other language shows
the English label, and a Traditional Chinese session shows the
Simplified catalogue. Each text now names the control that way. The two
docs pages that quote the sentence (`concepts/metadata-lifecycle.mdx`,
`permissions/authorization.mdx`) follow it.
- **Row 60, unknown-key refusal
(`packages/spec/src/shared/suggestions.zod.ts`,
`strictUnknownKeyError`).** Two of its three sub-items are fixed here:
- an empty key rendered as empty backticks; it now reads "an empty key
(`""`)", and no rename is guessed for it (any declared key of two
letters or fewer was within budget);
- below six characters the rename budget is the floor of 2, which exists
for a swap of two adjacent letters; it also admitted two unrelated
edits, so a removed `app.aria` was answered "Did you mean `aria` →
`areas`?". A short key's guess must now be one edit away, counting an
adjacent swap as one (`lable` → `label`, `aeras` → `areas`, `labl` →
`label` are still offered). Keys of six characters or more are scored
exactly as before.
- **Held, not changed:** the sibling `{ path: '', message: 'Invalid
input', code: 'invalid_union' }` entry on a view or form refusal. It is
pinned as `issues[0]` by #5364's "strictly additive" rule
(`protocol.save-union-issues.test.ts`), and Studio parses its exact text
(`translateValidationMessage` maps "invalid input" to its localized
"Invalid"). Dropping or rewording it changes a recorded envelope rule,
so it goes to a decision. It is split out to its own card, #35400,
nested under #33345, so this PR closes the rest of the card.
- **Row 164, CLI unknown command.** `os environments frobnicate`
answered `command environments:frobnicate not found` and nothing else;
`os frobnicate` the same. A `command_not_found` hook
(`packages/cli/src/hooks/command-not-found/point-at-help.ts`, registered
in `package.json` `oclif.hooks`) keeps the hard error, exit 2 and no
suggester, spells the id as typed, and ends with the help of the deepest
topic or command the words reached, matching the `See more help with
--help` tail a wrong flag already gets.
- **Row 233, `content/docs/ai/connect-mcp.mdx`.** The recall/resubmit
paragraph said anyone else is refused `FORBIDDEN`. Measured in
`ApprovalService.refuseUnreadableRequest` and the approvals route's
status table: a caller who cannot read the request gets `404
REQUEST_NOT_FOUND` (as for an id that names no request); one who can
read it gets `403 FORBIDDEN`. The doc now says both.
- **Row 108, dropped: already fixed.** The environment-only holder has
had its own remedy since `40c73a8f4f` ("No package holds it, so no
dependency reaches it: move the flow into …"), pinned by `[#32967] an
environment-only holder` in
`packages/core/src/package-scoped-resolution.test.ts`. That sentence is
absent at the QA run's `ee9ad834` and present at the ledger's
`87330e89`.
- **Changeset** `.changeset/33345-sweep-refusal-copy.md`: `patch` on
spec, metadata-protocol, plugin-security and cli.
- No `docs/qa/platform-checklist/` item quotes a changed sentence:
`cli.flag-command-error-ux` still holds ('command … not found', exit
nonzero), and the one item naming "the Clone action"
(`access-security.packaged-permission-set-lifecycle`) is retired.
## Tests
Final head `111a0f32d8`. One red-then-green pin per code row, at its
producer:
- Row 60: `packages/spec/src/shared/strict-object.test.ts`, new
top-level describe `short and empty unknown keys` (4 cases).
- Row 130:
`packages/plugins/plugin-security/src/packaged-permission-set-lock.test.ts`,
new top-level describe (every locale of both refusals names the console
label, plus the diagnostic); the exact-sentence pins in
metadata-protocol and rest now read "New similar".
- Row 164:
`packages/cli/src/hooks/command-not-found/point-at-help.test.ts` (unit
tier, 4 cases).
<details><summary>Package suites (os-verify-lock, VERDICT command-exit
0, head 151b48c)</summary>
- spec test: Test Files 856 passed (856), Tests 27371 passed, 1 todo;
typecheck exit 0, check:test-typecheck OK
- metadata-protocol test: Test Files 358 passed, 9 skipped; Tests 23218
passed, 45 skipped; typecheck exit 0
- plugin-security test: Test Files 279 passed; Tests 6997 passed, 45
skipped; typecheck exit 0
- cli unit tier: Test Files 430 passed; Tests 6144 passed; typecheck
exit 0. The integration tier is CI's (no spawn entry or integration file
touched).
- rest: `rest-meta-packaged-action-permission-refusal.test.ts` 11 passed
The head then moved by one commit (`111a0f32d8`, a module-top lint
preload in one edited metadata-protocol test, which
`check:test-source-alias` asked for); that file re-ran green: 54 passed.
</details>
<details><summary>Ablations (scripts/ablation-replace.mjs; the tests
import the source by relative path, so no dist leg)</summary>
- Row 164: hook returns oclif's old message, so 3 of 4 fail; restored,
blob 6143c7f equals HEAD, `git diff HEAD` empty.
- Row 60 screen: guess back to plain `findClosestMatches`, so the `aria`
case fails (1 failed, 3 passed); restored, blob a4defaa equals
HEAD.
- Row 60 empty key: renderer back to backticks, so the empty-key case
fails; restored, blob a4defaa equals HEAD.
- Row 130: en user text back to "Clone action", so the en case fails (1
of 31); the regime row back to `"Clone"`, so 3 metadata-protocol pins
fail; both restored, blob equals HEAD.
</details>
## Acceptance notes
- `packages/spec/src/shared/suggestions.zod.ts` is a `packages/spec/src`
non-test producer, so an L2 contract record is owed before the queue.
- Same family, not changed here: the `max(2, len/3)` budget is copied in
`data/object.zod.ts` (`suggestKey`), `data/seed.zod.ts`,
`data/field-value.zod.ts` and `data/default-value-shape.ts`, which this
PR does not touch. A long retired key can still be guessed into a
declared one: form `defaultSort` gets "Did you mean `defaultSort` →
`defaults`?" (distance 3, budget 3).
-
`packages/spec/src/migrations/entries/semantic/18.security-permission-set-overlay-discard-retired.ts`
still says "(the Clone action)" in a released migration note; left as
released.
- Live CLI output at the final build: `os frobnicate` gives "command
frobnicate not found / See more help with `os --help`", exit 2; `os
environments frobnicate` points at `os environments --help`, exit 2; `os
plugin trust frobnicate` points at `os plugin trust --help`; `os migrate
plan --frobnicate` is unchanged.
## Verification
<details><summary>Gates (local, final head 111a0f3)</summary>
- `dispatch-gates --commands`: 133 families derived; all 133 run, each
exit 0. `--ran` reports "133 derived famil(ies) accounted for — 133 run,
0 NOT-MEASURED (a DERIVED zero …)".
- `overlap-check --branch=claude/issue-33345-sweep-refusal-copy`:
VERDICT clean exit 0 (origin/main, #35261, #35129, #34717 merge
cleanly).
- Local-only: `check:skill-frame-freshness` exit 0. `check:dev-prereqs`
exit 1 because the workspace is not fully built (35 ui/example packages
have no dist); that is a reading of this box, not of the diff.
- Dogfood: n/a (no `!` in the title, no narrowing arm). `test:repo` and
the full farm are CI's.
</details>
## 席位核对
- Read first: `packages/spec/src/shared/suggestions.zod.ts`
(`shortKeyScreenedGuess`, `renderUnknownKey`),
`packages/cli/src/hooks/command-not-found/point-at-help.ts`,
`packages/plugins/plugin-security/src/packaged-permission-set-lock.ts`
(locale texts).
- Two-minute check: `pnpm --filter @objectstack/spec exec vitest run
--maxWorkers=2 src/shared/strict-object.test.ts` should show the four
`short and empty unknown keys` cases green.
---
_Generated by [Claude
Code](https://claude.ai/code/session_01Utp6CZiaBg6rk7dpy1s9Me)_
<!-- signed: repo:objectstack#5 · os-bill ·
session_01Utp6CZiaBg6rk7dpy1s9Me -->
---------
Co-authored-by: Claude <noreply@anthropic.com>1 parent ee40658 commit 7a3f86c
15 files changed
Lines changed: 314 additions & 39 deletions
File tree
- .changeset
- content/docs
- ai
- concepts
- permissions
- packages
- cli
- src/hooks/command-not-found
- metadata-protocol/src
- plugins/plugin-security/src
- rest/src
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
565 | 565 | | |
566 | 566 | | |
567 | 567 | | |
568 | | - | |
569 | | - | |
| 568 | + | |
| 569 | + | |
| 570 | + | |
| 571 | + | |
| 572 | + | |
570 | 573 | | |
571 | 574 | | |
572 | 575 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
223 | 223 | | |
224 | 224 | | |
225 | 225 | | |
226 | | - | |
| 226 | + | |
227 | 227 | | |
228 | 228 | | |
229 | 229 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
281 | 281 | | |
282 | 282 | | |
283 | 283 | | |
284 | | - | |
| 284 | + | |
285 | 285 | | |
286 | 286 | | |
287 | 287 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
53 | 53 | | |
54 | 54 | | |
55 | 55 | | |
56 | | - | |
| 56 | + | |
| 57 | + | |
57 | 58 | | |
58 | 59 | | |
59 | 60 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
51 | 51 | | |
52 | 52 | | |
53 | 53 | | |
54 | | - | |
55 | | - | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
56 | 58 | | |
57 | 59 | | |
58 | 60 | | |
| |||
201 | 203 | | |
202 | 204 | | |
203 | 205 | | |
204 | | - | |
| 206 | + | |
205 | 207 | | |
206 | 208 | | |
207 | 209 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
396 | 396 | | |
397 | 397 | | |
398 | 398 | | |
399 | | - | |
| 399 | + | |
400 | 400 | | |
401 | 401 | | |
402 | 402 | | |
| |||
436 | 436 | | |
437 | 437 | | |
438 | 438 | | |
439 | | - | |
| 439 | + | |
440 | 440 | | |
441 | 441 | | |
442 | 442 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
56 | 56 | | |
57 | 57 | | |
58 | 58 | | |
| 59 | + | |
| 60 | + | |
59 | 61 | | |
60 | 62 | | |
61 | 63 | | |
| |||
581 | 583 | | |
582 | 584 | | |
583 | 585 | | |
584 | | - | |
| 586 | + | |
585 | 587 | | |
586 | 588 | | |
587 | 589 | | |
| |||
1265 | 1267 | | |
1266 | 1268 | | |
1267 | 1269 | | |
1268 | | - | |
| 1270 | + | |
1269 | 1271 | | |
1270 | 1272 | | |
1271 | 1273 | | |
| |||
0 commit comments