Repository navigation
Commit 2d1a76b
docs(spec): retire the "return with M2" texts for allowRestore / allowPurge (#31562)
<!-- claude-projects-attribution: {"github_login":"marchtian"} -->
_Requested by **田騏** · [project
thread](https://claude.ai/code/project/chan_01VmuUhXU9SSUzqJYyXSmYSi?thread=cmsg_01VmuUhXU9SSUzqJYyXSmYSi8kq4zpmYQCfyfqbeo3ASPM)_
Fixes #31508
Clause-②: no
Metadata-protocol: none
## 维护者速读
- **改了什么:** 只改文字,不改任何行为。旧权限键 `allowRestore` / `allowPurge` 的第 18 号转换条目
`summary`(`os migrate meta` 会打印给升级的作者)、语义迁移条目、step 18 的 rationale、四条
retired-key 注释、liveness 的两条 dead 记录和文件说明、lint 的 `retiredKeyRemedy`
注释、metadata 与 ui 的代码注释,不再说「随 M2 回归」,改为:这两个键不会回来,回收站(ADR-0148)已提供 restore
/ purge,授权键是 `allowRestoreOwnDeleted` 和 `manageRecycleBin`。
- **为什么改:** PR #31438 已把墓碑提示改成现状,但这些地方还在承诺旧键回归,升级旧元数据的作者会读到错误指引。
- **风险与回滚:** 无运行时风险:转换条目的 id、toMajor、retiredAfter、surface、变换与 fixture
逐字节不变;无 schema、accept-set、墓碑或 lint 逻辑变化。条目文字随 `@objectstack/spec` 发布,所以带
patch changeset。回滚即 revert。
- **先看:**
`packages/spec/src/conversions/entries/18/permission-allow-restore-purge-removed.ts`
的 `summary`,和
`packages/spec/src/migrations/entries/semantic/18.permission-restore-purge-bits-retired.ts`
的 `replacement`。
- **两分钟验证:** `grep -rn "M2"
packages/spec/src/conversions/entries/18/permission-allow-restore-purge-removed.ts
packages/spec/src/migrations/entries/semantic/18.permission-restore-purge-bits-retired.ts
packages/spec/src/migrations/registry.ts.template | grep -i
restore`,预期无输出;`pnpm --filter @objectstack/spec exec vitest run
src/migrations src/conversions` 全部通过。
- **需要你做的:** 无,座位做契约复核后落地。
## What changes
Card #31508: after PR #31438 (`6a708214`) the recycle bin's `restore` /
`purge` read `allowRestoreOwnDeleted` / `manageRecycleBin` (ADR-0148
D5), and the tombstone prescriptions say so. These texts still said the
retired keys "return with the M2 lifecycle initiative". Each now says
the keys do not return and names the two grants, in the tombstones'
wording; the history (the operations did not exist when the keys were
retired, and a dispatched `restore`/`purge` then stayed denied by
`DESTRUCTIVE_OPERATIONS`) is kept in past tense.
The order's six sites:
1. **Conversion `permission-allow-restore-purge-removed`**
(`conversions/entries/18/`): `summary` and docblock. Measured
byte-identical outside those two hunks: `id`, `toMajor: 18`,
`retiredFromLoadPath`, `retiredAfter: '17.2.0'`, `surface`, `apply` and
`fixture` are unchanged (`git diff -U0` shows only the docblock and
`summary` hunks).
2. **Semantic entry `permission-restore-purge-bits-retired`**:
`replacement`, `reason`, `acceptanceCriteria`. The acceptance criteria
no longer say `restore`/`purge` is denied for every principal; they say
stripping the keys changes no access decision because nothing reads
them. Registry regenerated with `gen:migration-registry` (git-ignored,
not committed).
3. **`liveness/permission.json`**: the `allowRestore` / `allowPurge`
`dead` notes (status and evidence unchanged), plus a dated sentence on
the file `_note` (review should-fix). The `allowTransfer` row is left
alone, as ordered.
4. **`lint` `retiredKeyRemedy` docblock**: neither prescription's
"Delete the key" sentence runs past 200 characters now, so the
parenthetical says so.
5. **`metadata` `plugin.ts`** comment on the artifact door's version
key.
6. **`ui` `permission-slice.ts`** comment: "NO RETURN PATH", and its
stale strip rationale (review should-fix).
Ridden along under the bounded in-place exemption (same defect class,
same spec gate family, no other claim on the files; the seat amends the
claim's file surface):
- **Step 18 `rationale` fragment** in `migrations/registry.ts.template`,
which the protocol 17 → 18 upgrade guide prints.
- **The four retired-key rows**
`18.security__{ObjectPermission,EffectiveObjectPermission}__{allowRestore,allowPurge}.ts`,
whose comments the generator carries into `registry.ts`.
- **Comments** in `packages/spec/src/security/permission.test.ts` and
`ui/.../previews/PermissionPreview.retiredLifecycleKeys.test.tsx`.
## Acceptance notes
- **Seat ruling (claim 6722322190): a released entry's prose may be
reworded.** Measured again: no test or generated, committed artifact
pins the old wording (`docs/protocol-upgrade-guide.md` is a pointer; the
guide is generated and git-ignored).
- **Left for another card (stale "M2" prose about the same keys, not
touched here):**
- `content/docs/permissions/permission-metadata.mdx:99-104` and
`content/docs/permissions/permission-sets.mdx:54` (user-facing docs:
"the operations … do not exist yet … return with the M2 lifecycle
batch").
- `packages/spec/liveness/README.md:991` (permission row: "keys return
with M2 per the #1883 ruling").
- `packages/spec/liveness/permission.json:88` (`allowTransfer` row: "no
transfer/restore/purge operations in packages/objectql"), left by order.
- Test headers
`ui/.../PermissionMatrixEditor.retiredLifecycleKeys.test.tsx:7-15`,
`packages/metadata/src/plugin-artifact-forward-conversion.test.ts:24`,
`packages/plugins/plugin-security/src/controlled-by-parent-detail-write-authority.test.ts:218`,
`packages/plugins/plugin-security/src/security-plugin.test.ts:2797`. The
first two were edited and then reverted: editing a test file brings it
under `check:test-source-alias`'s edited-file half, which then asks for
a module-top import, a test change outside this card.
## Reviews
Fable full review (round 1): PASS with should-fix, no must-fix; 3
should-fixes and 4 nits applied, nit 6 (the transfer row) declined per
the order. Delta review: PASS; its two tense nits applied. The verdict
is posted on this PR.
## Verification
After `git merge origin/main` (merge `9c50b2f254`), with the delta
commits on top (head `b266470e70`):
- `pnpm install --frozen-lockfile`, spec `gen:schema` and `gen:docs` ::
exit 0, no tree change; `gen:migration-registry` regenerated the
git-ignored registry.
- `pnpm turbo run build` (all packages) :: exit 0. Spec
`check:generated` :: exit 0 (14 artifacts current; the first pass called
`test-typecheck-debt.json` stale from a heap limit, and
`check:test-typecheck` with `--max-old-space-size=6144` :: exit 0).
- `dispatch-gates --commands` derived 99 commands; all 99 ran.
`check:test-source-alias` was red only on the two test headers this PR
then reverted, and :: exit 0 after; `check:dual-build-cjs-loads` exit 3
before the full build and :: exit 0 after. `dispatch-gates --ran`: 99
run, 0 NOT-MEASURED, exit 0.
- `eslint` on the touched spec, lint and metadata sources :: exit 0.
- `vitest`: spec `src/migrations` + `src/conversions` +
`src/security/permission.test.ts`: 29 files, 1116 tests passed; lint
`validate-retired-permission-residue.test.ts`: 23 passed; ui
`PermissionPreview.retiredLifecycleKeys.test.tsx` (from the ui root): 3
passed.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
https://claude.ai/code/session_017ihL2c6HACa8QkBPQD6c7i
---------
Co-authored-by: Claude <noreply@anthropic.com>1 parent 645ed3d commit 2d1a76b
16 files changed
Lines changed: 119 additions & 85 deletions
File tree
- .changeset
- content/docs/permissions
- packages
- lint/src
- metadata/src
- spec
- liveness
- src
- conversions/entries/18
- migrations
- entries
- retired-keys
- semantic
- security
- ui/packages/app-shell/src/views/metadata-admin
- previews
| 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 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
98 | 98 | | |
99 | 99 | | |
100 | 100 | | |
101 | | - | |
102 | | - | |
103 | | - | |
104 | | - | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
105 | 107 | | |
106 | 108 | | |
107 | 109 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
51 | 51 | | |
52 | 52 | | |
53 | 53 | | |
54 | | - | |
| 54 | + | |
55 | 55 | | |
56 | 56 | | |
57 | 57 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
113 | 113 | | |
114 | 114 | | |
115 | 115 | | |
116 | | - | |
117 | | - | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
118 | 120 | | |
119 | 121 | | |
120 | 122 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1207 | 1207 | | |
1208 | 1208 | | |
1209 | 1209 | | |
1210 | | - | |
1211 | | - | |
1212 | | - | |
| 1210 | + | |
| 1211 | + | |
| 1212 | + | |
| 1213 | + | |
| 1214 | + | |
| 1215 | + | |
| 1216 | + | |
1213 | 1217 | | |
1214 | 1218 | | |
1215 | 1219 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
| 3 | + | |
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| |||
91 | 91 | | |
92 | 92 | | |
93 | 93 | | |
94 | | - | |
| 94 | + | |
95 | 95 | | |
96 | 96 | | |
97 | 97 | | |
98 | 98 | | |
99 | 99 | | |
100 | | - | |
| 100 | + | |
101 | 101 | | |
102 | 102 | | |
103 | 103 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
22 | | - | |
23 | | - | |
24 | | - | |
25 | | - | |
26 | | - | |
27 | | - | |
28 | | - | |
29 | | - | |
30 | | - | |
31 | | - | |
32 | | - | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
33 | 34 | | |
34 | 35 | | |
35 | 36 | | |
| |||
52 | 53 | | |
53 | 54 | | |
54 | 55 | | |
55 | | - | |
56 | | - | |
57 | | - | |
58 | | - | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
59 | 59 | | |
60 | 60 | | |
61 | 61 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
6 | | - | |
| 6 | + | |
| 7 | + | |
7 | 8 | | |
8 | 9 | | |
9 | 10 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
6 | | - | |
| 6 | + | |
| 7 | + | |
7 | 8 | | |
8 | 9 | | |
9 | 10 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
5 | | - | |
6 | | - | |
7 | | - | |
8 | | - | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
9 | 8 | | |
10 | 9 | | |
11 | 10 | | |
12 | 11 | | |
13 | 12 | | |
14 | | - | |
15 | | - | |
16 | | - | |
17 | | - | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
| |||
0 commit comments