Repository navigation
Commit b0e8f6b
docs(seed-data): a reference into a tenantField-walled object resolves to the load organization's row (#34100)
<!-- claude-projects-attribution: {"github_login":"os-steve"} -->
_Requested by **Steve** · [project
thread](https://claude.ai/code/project/chan_01FdL1XeUyvVNxLreh3F4Qi9?thread=cmsg_01FdL1XeUyvVNxLreh3F4Qi9WLWfdqSAaFLKQRS27UZeAT)_
Fixes #33794
Clause-②: no
Metadata-protocol: none
## 维护者速读
- 改了什么:`seed-data.mdx` 里“按组织加载种子时引用解析到哪一行”表格中的一行。以 `tenancy.tenantField`
隔离、没有 `organization_id`
列的对象,现在写的是“只解析到本次加载所属组织的那一行,按该租户列匹配,绝不借用别的组织同名行”。
- 为什么改:该行还停在 #33393 修复之前,写的是“查询被拒并报告”。修复后种子探针按目标对象解析出的租户列过滤,QA
实测也是各组织各自解析到自己的行。文档与行为不符,会误导写种子的人。
- 风险与回滚:纯文档一行,不改代码,不发包(skip-changeset)。回滚就是 revert 这一个提交。
- 先看:`content/docs/data-modeling/seed-data.mdx` 第 476 行附近的表格行。
- 两分钟验证:`grep -n "tenancy.tenantField"
content/docs/data-modeling/seed-data.mdx`,应看到新句子,且全仓 `content/docs` 与
`skills/` 再搜不到 “refused and reported” 描述这个场景。
- 需要你做的:无,席位落地。
## What changes
One row of the "References on an organization's own load" table in
`content/docs/data-modeling/seed-data.mdx`.
- Before: an object walled by another tenant column
(`tenancy.tenantField`) with no `organization_id` column resolves
"nothing on such a load: the lookup is refused and reported, never
answered from another organization".
- After: "a row of the load's organization only, matched on that tenant
column (the column a seeded row of such an object is stamped with);
another organization's row with the same key is never used".
The row was written for the first org-scoped reference change and went
stale with the seed-probe tenant-column fix (PRs #33409 / #33550).
Main's probe, `packages/metadata-protocol/src/seed-loader.ts` at
`63db7240`:
```ts
// probeScopeOf(targetObject)
const tenantColumn = resolveTenantFieldName(definition) ?? DEFAULT_TENANT_FIELD;
let scope: ProbeScope = { kind: 'organization', tenantColumn };
// ...
// the probe itself
if (scope.kind === 'organization') where[scope.tenantColumn] = organizationId;
```
An object that declares a `tenantField` and no `organization_id` is
neither `sys_user`, `sys_organization` nor a global object
(`isGlobalSeedObject` needs no tenant field at all), so it keeps the
`organization` scope and is probed on its declared column. The
integration test
`packages/runtime/src/seed-org-scoped-references.integration.test.ts`
pins it: "an object walled by another tenant column resolves within the
load organization, on that column" (North gets `tag_gold_n`, South gets
`tag_gold_s`, no refusal logged) and "is not taken for a global one:
another organization's row is not borrowed". The stamp half ("the column
a seeded row of such an object is stamped with") is the shipped 18.5.0
note `1e889b1` in `packages/metadata-protocol/CHANGELOG.md` and the test
block "a dataset OF an object walled by a declared tenant column replays
per organization on that column".
## Tests
No code changed; no test edits.
## Acceptance notes
- Changesets: `.changeset/33207-seed-org-scoped-references.md` and
`.changeset/33393-seed-probe-tenant-column.md` were both consumed by the
Version Packages commit `b914e724` (#33097, 18.5.0). Per the order,
nothing is touched. The published
`packages/metadata-protocol/CHANGELOG.md` 18.5.0 section still carries
the 33207 bullet saying a `tenancy.tenantField`-walled target "keep[s]
the old lookup, and its refusal is now reported" (line 527), which the
33393 note in the same section (line 568) supersedes. AGENTS.md routes a
factual error in a released entry to a dedicated docs-only PR amending
that entry; that is for the seat to decide (`carrier: seat`). The
curated release page `content/docs/releases/v18/18-5.mdx` does not
mention this case, so it has nothing to correct.
- Sweep: `grep -rn -i "refused and reported"` over `content/docs` and
`skills` at `63db7240` hit only this row; `grep -rn tenantField` over
both trees found no other sentence on the seed-reference case. No
`skills/**` hit.
## Verification
Gates at head `0a569a31`: `dispatch-gates --commands` derived 43
commands; all 43 exit 0. `--ran` with exit codes: "43 derived famil(ies)
accounted for — 43 run, 0 NOT-MEASURED (a DERIVED zero)".
<details><summary>Notes on the run</summary>
`check:skill-examples` first exited 3 (refused before measuring:
`packages/client-react/dist` was not built). After `pnpm --filter
'@objectstack/client-react...' build` under the verify lock (VERDICT
command-exit 0) it exited 0: "346 prose examples type-check across 3
surface(s)". The spec and lint closures were built first under the lock
(VERDICT command-exit 0).
</details>
---
_Generated by [Claude
Code](https://claude.ai/code/session_01ADHkmPBERWks32kU5eiYwm)_
Co-authored-by: Claude <noreply@anthropic.com>1 parent e9b44ab commit b0e8f6b
1 file changed
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
473 | 473 | | |
474 | 474 | | |
475 | 475 | | |
476 | | - | |
| 476 | + | |
477 | 477 | | |
478 | 478 | | |
479 | 479 | | |
| |||
0 commit comments