Repository navigation
Commit f7f9345
docs(metadata-protocol): name the disabled-package predicate on the $expand and relation-target checks, and pin its order (#37893)
<!-- claude-projects-attribution: {"github_login":"os-tesla"} -->
_Requested by **Tesla** · [project
thread](https://claude.ai/code/project/chan_01AXsQkLFKRdQCqQ3RTr6Jao?thread=cmsg_01AXsQkLFKRdQCqQ3RTr6JaoLphuot5c2R2SFweEMeNTrP)_
Fixes #35528
Clause-②: no
Metadata-protocol: none
## 维护者速读
- 用户能看到什么变化:用户无感;只改了代码注释、部署手册里"数据面"一条说明,外加一条测试。
- 为什么做:停用模块的关联展开与关联条件修好后(上一轮合并的修复),注释和手册仍只讲"接口是否开放",没讲"所属模块已停用"这一条。
- 出错会怎样:说明写错只会误导读文档的人,不影响运行;这次改动可以直接撤回。
- 要你做什么:无。
## What changes
- **N1 docblocks** (`packages/metadata-protocol/src/protocol.ts`,
`protocol-query-validation.ts`): `refuseUnservedRelationTarget`,
`servedExpand` and `servesExpansionTarget` now name the disabled-package
predicate (`isObjectPackageDisabled`) beside the exposure decision, and
say the package refusal is asked first. No code change.
- **`EXPANSION_TARGET_OPERATION`**: the card said its "alike on both
doors" sentence no longer held for a disabled target. Re-measured on
`origin/main` e69fa46: it holds again. The dataset door's label pass
now withholds a disabled package's target too (`analytics-service.ts`
~1737, wired in `service-analytics/src/plugin.ts` ~1803). So the
sentence stays, and one added sentence says the disabled case renders
the stored id on both doors.
- **N2 pin**: a top-level `describe` in the existing harness file
`protocol.expand-disabled-package-35427.test.ts`, which holds the PR
#35444 pins. It covers a target that is both package-disabled and
unexposed, in two forms: `apiEnabled: false`, and an `apiMethods:
['get']` whitelist that serves `$expand` but not `list`. The relation
condition answers `404 OBJECT_PACKAGE_DISABLED` (`code` + `status` +
`object`), the engine is never called, and `$expand` withholds both
entries. A re-enable control shows each target's own exposure answer:
`OBJECT_API_DISABLED` 404, `OBJECT_API_METHOD_NOT_ALLOWED` 405, and the
whitelist target expanded. The whitelist case discriminates in both
directions.
- **N3 handbook** (`content/docs/deployment/marketplace-handbook.mdx`,
Data plane bullet): a lookup from an enabled object into a disabled
module keeps the stored id under `$expand`, and a condition on the
related object's fields is refused `404 OBJECT_PACKAGE_DISABLED`.
- Changeset: `@objectstack/metadata-protocol` patch.
## Tests
<details><summary>metadata-protocol pin files + typecheck at 224d707;
full package suite at 13b9b1b (the later commit is
docblock-only)</summary>
```
vitest run src/protocol.expand-disabled-package-35427.test.ts src/protocol.expand-target-exposure.test.ts
Test Files 2 passed (2)
Tests 30 passed (30)
tsc --noEmit (package typecheck; --listFiles counts the pin file: 1)
os-verify-lock: VERDICT command-exit 0
vitest run (whole @objectstack/metadata-protocol)
Test Files 372 passed | 9 skipped (381)
Tests 23579 passed | 45 skipped (23624)
os-verify-lock: VERDICT command-exit 0
```
</details>
## Acceptance notes
- The pin went green on `main` as written, so this PR adds no fix. The
behaviour already held.
- **Deviation from the claim's file surface:** the claim named "one new
pin test file". AGENTS.md binds a new pin for a component that already
has a shared harness file to go into that file as a top-level `describe`
(ruling record 6583487846). The PR #35444 harness (`SCHEMAS` +
`makeProtocol`) is exactly what this pin needs, so the pin is in that
file under a `[#35528]` describe and the harness is not copied. Two
schema rows and two lookups were added to its `SCHEMAS`.
## Verification
Read first: (1) the new `describe` at the end of
`protocol.expand-disabled-package-35427.test.ts`, (2) the
`refuseUnservedRelationTarget` docblock in `protocol.ts`, (3) the
`EXPANSION_TARGET_OPERATION` docblock.
Two-minute check: `pnpm --filter @objectstack/metadata-protocol exec
vitest run src/protocol.expand-disabled-package-35427.test.ts` should
report 15 passed, 3 of them under `[#35528]`.
<details><summary>Derived gate families, local run at head
224d707</summary>
`node scripts/pm/dispatch-gates.mjs --commands` derived 104 families
from the 5 changed paths. All 104 were run after the final commit. Each
exit code was captured before any pipe, and the `--ran` reconciliation
over that record says: `104 derived famil(ies) accounted for — 103 run,
1 NOT-MEASURED (1 DERIVED from a recorded exit 3)`.
- 103 exited 0, including `pnpm check:facade-delegation-only`:
`packages/metadata-protocol/src/protocol.ts: 11705 lines, ceiling 11705
(0 left)`.
- NOT MEASURED: `node scripts/check-plugin-teardown-shape.mjs
--self-test` exited 3. The reason is a shallow clone: it cannot read its
positive-control commit `621a4876`, and this run did not deepen the
shared clone. CI runs it.
</details>
Ceiling note: the first head (13b9b1b) grew `protocol.ts` by 11 lines,
and the facade line ceiling (0 margin, ruling 6897467376) went red on
that. The second commit rewrites the docblocks so they take exactly the
lines they replace, net 0 in `protocol.ts`. The ceiling was not raised.
---
_Generated by [Claude
Code](https://claude.ai/code/session_01L9qibyBJGiLjzCtE4F6HHB)_
---------
Co-authored-by: Claude <noreply@anthropic.com>1 parent 1e721fd commit f7f9345
5 files changed
Lines changed: 69 additions & 18 deletions
File tree
- .changeset
- content/docs/deployment
- packages/metadata-protocol/src
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
322 | 322 | | |
323 | 323 | | |
324 | 324 | | |
325 | | - | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
326 | 329 | | |
327 | 330 | | |
328 | 331 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
220 | 220 | | |
221 | 221 | | |
222 | 222 | | |
223 | | - | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
224 | 226 | | |
225 | 227 | | |
226 | 228 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
53 | 53 | | |
54 | 54 | | |
55 | 55 | | |
| 56 | + | |
| 57 | + | |
56 | 58 | | |
57 | 59 | | |
58 | 60 | | |
59 | 61 | | |
60 | 62 | | |
61 | 63 | | |
62 | 64 | | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
63 | 69 | | |
64 | 70 | | |
65 | 71 | | |
| |||
161 | 167 | | |
162 | 168 | | |
163 | 169 | | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5108 | 5108 | | |
5109 | 5109 | | |
5110 | 5110 | | |
5111 | | - | |
5112 | | - | |
5113 | | - | |
5114 | | - | |
5115 | | - | |
5116 | | - | |
5117 | | - | |
5118 | | - | |
5119 | | - | |
5120 | | - | |
| 5111 | + | |
| 5112 | + | |
| 5113 | + | |
| 5114 | + | |
| 5115 | + | |
| 5116 | + | |
| 5117 | + | |
| 5118 | + | |
| 5119 | + | |
| 5120 | + | |
5121 | 5121 | | |
5122 | 5122 | | |
5123 | 5123 | | |
| |||
5137 | 5137 | | |
5138 | 5138 | | |
5139 | 5139 | | |
5140 | | - | |
5141 | | - | |
5142 | | - | |
5143 | | - | |
5144 | | - | |
| 5140 | + | |
| 5141 | + | |
| 5142 | + | |
| 5143 | + | |
| 5144 | + | |
5145 | 5145 | | |
5146 | 5146 | | |
5147 | 5147 | | |
| |||
5172 | 5172 | | |
5173 | 5173 | | |
5174 | 5174 | | |
5175 | | - | |
| 5175 | + | |
5176 | 5176 | | |
5177 | 5177 | | |
5178 | 5178 | | |
| |||
0 commit comments