Repository navigation
Commit d4b14a8
fix(core): the outside-closure refusal names the move when the holder already depends on the reader (#32982)
<!-- claude-projects-attribution: {"github_login":"os-sales"} -->
_Requested by **Sales** · [project
thread](https://claude.ai/code/project/chan_01D5bWFY3rFzgJcytD5gD4Uu?thread=cmsg_01D5bWFY3rFzgJcytD5gD4UuXoji6hhHpSoiEVSsF3VSYf)_
Part of #32929
## 维护者速读
- 问题:HotCRM 的 app 包看板读自家 revenue 模块的数据集,18.4.0 候选版返回
409。拒绝语只说「声明对持有包的依赖」,可模块本来就依赖 app,反过来声明会成环,启动直接失败(实测 `Circular
dependency detected`)。
- 改法:只改 `outside-closure`
拒绝语。保留原来的「声明依赖」,后面加一句:持有包已经依赖读取方时,把读取的条目搬到持有包,或把被读的条目搬到读取方。
- 裁定:#32929 选二(6840360115);18.4.0 底线是「文案修正 + HotCRM
自修」(6840525219)。作者期拒绝挪到 18.4.1,另立卡。
- 答案不变:各门的状态码、错误码、`details.candidates`、解析到哪一项,全都不变,只是句子变长。另外修正三个
changeset 里「第一方 0」的说法,点名 HotCRM。
- 风险与回滚:纯文案。回滚就是 revert 本 PR。
- 需要你做的:无,席位落地。
Clause-②: no
Metadata-protocol: none
## FROM → TO
| Door | FROM (main a7c9729) | TO |
|---|---|---|
| Every package-scoped by-name read refused `outside-closure` (dataset
query doors single and batch, `/meta/:type/:name?callerPackage=`, the
picklist, flow, function, webhook, permission-set readers) | `… held
outside the declared dependency closure of package "P": package "Q".
Declare a dependency on the package that holds it (ADR-0141).` | Same
sentence, then: `If that package already depends on "P", the dependency
would be a cycle: move what reads it into that package, or move the
<type> into "P" (ADR-0150 D3).` |
| Status, code, `details.candidates`, the resolved item | unchanged |
unchanged |
| `.changeset/32072-dataset-resolve-by-package.md` | "first-party count
for each: 0" | read in this repository: 0, plus a correction naming
HotCRM's CRM Overview tile |
| `.changeset/32310-dataset-caller-package.md` | "Who moves. Nothing
first-party sent the parameter" | same, plus a correction: once the
console sends it, HotCRM's tile is refused |
| `.changeset/32311-dataset-caller-package-ui.md` | "The fix for those:
add the holder to P's `dependencies`, or ship the dataset in P." | same,
plus the cycle case (move the reading item into the holder) and HotCRM
named |
| `.changeset/32077-dataset-query-package.md` | "No first-party package
references a dataset across packages." | same, plus a correction naming
HotCRM's CRM Overview tile |
## Measured (step 0 on #32929, main a6be0fe, build-shaped artifact
boot)
An app package `com.qa.sib.app` and a module `com.qa.sib.rev` that
declares it, both in one namespace. The module holds the object and the
dataset; the app's dashboard binds it.
- `POST /api/v1/analytics/dataset/query?callerPackage=com.qa.sib.app`
returns 409 `outside-closure`, and so does the batch entry. The query
with no package returns 200 (2 rows). `?callerPackage=com.qa.sib.rev`
returns 200.
- The fix the old sentence names (the app declares the module) does not
boot: `[Kernel] Circular dependency detected: com.qa.sib.rev`.
- Ablation: with #32337's caller arm switched off, the query returns
200/200. With #32804's admission arm switched off, it still returns
409/409.
## Tests
- `packages/core/src/package-scoped-resolution.test.ts`: two new cases
under `[#32929]`, the whole sentence for a dataset and the type label
for an email template. Ablation: putting back the old sentence turns
both red (2 failed / 30 passed); restoring it turns them green again
(32/32).
- `pnpm --filter @objectstack/core test`: 3362 / 3362 passed, run on
b71abe3.
- No other test pins the whole sentence. Every other reader asserts
`toContain` on its head (`git grep "held outside the declared dependency
closure"` over `*.test.ts`).
- Derived gates (`node scripts/pm/dispatch-gates.mjs --commands --repo
objectstack-ai/objectstack`), run on b71abe3: `--ran` gives 65
derived, 65 run, 0 NOT-MEASURED. 64 exit 0. `check-plugin-teardown-shape
--self-test` exited 3 until its pinned fixture was fetched (shallow
clone), then 0. `check:dual-build-cjs-loads` exited 3 until a full `pnpm
build` ran, then 0 (123 entries / 72 packages). `check-empty-changeset
--base origin/main` exits 1: this is the deliberate correction declared
below.
## DELIBERATE CORRECTION (`check-empty-changeset`)
Four pending release notes are corrected in this PR. Each counted 0
first-party consumers, and HotCRM is one. Where a note says how HotCRM
fixes it, it now reads: "HotCRM fixes it in its own release, by moving
the dashboard into the module or the dataset into the app package; the
HotCRM lane chooses (#32929)." (review S1; ruling 6840525219, "Not ruled
here"). The corrected sentences:
- `.changeset/32072-dataset-resolve-by-package.md`: "(first-party count
for each, read in this repository: 0 — … ; **corrected by #32929:** one
first-party app outside this repository moves with the reader's package
— HotCRM's CRM Overview dashboard, in its app package
`app.objectstack.hotcrm`, binds the dataset `product_metrics` that its
module package `app.objectstack.hotcrm.revenue` holds; …)"
- `.changeset/32310-dataset-caller-package.md`: "- **Who moves.** …
**Corrected by #32929:** once the console sends it
(`32311-dataset-caller-package-ui`), one first-party app is refused —
HotCRM's CRM Overview dashboard …"
- `.changeset/32311-dataset-caller-package-ui.md`: "**The fix for
those:** … When the holder already depends on P (a module of the app
that reads it), that dependency is a cycle: move the reading item into
the holder instead. **First-party (corrected by #32929):** HotCRM's CRM
Overview dashboard …"
- `.changeset/32077-dataset-query-package.md`: "No first-party package
references a dataset across packages (read in this repository;
**corrected by #32929:** one first-party app outside this repository
does — HotCRM's CRM Overview dashboard … so once the console sends the
item's package the tile is refused where it drew on 18.3.0; … Other
first-party apps outside this repository: not measured)." (review S2)
The dispatching seat confirms these by its own record.
## Acceptance notes
- **Out of scope, carried to a follow-up card under #32929 (18.4.1):**
- Authoring refusal: `indexResolvableDatasets`
(`packages/lint/src/validate-widget-bindings.ts`) still treats every
body of the artifact as resolution context, so `os validate` / `os
build` keep accepting the tile the runtime refuses. A work-in-progress
commit is on `claude/project-thread-ldkwcp-pr2` (c0ccb67, not tested
on that head).
- The CLI picklist hint (`packages/cli/src/utils/picklist-references.ts`
`refusedReferenceHint`) and the publish probe's `widget_not_probed` fix
(`packages/metadata-protocol/src/build-probes.ts` `datasetNotProbed`)
still name only the dependency.
- Whether the three app actions in HotCRM that launch module flows are
refused: not measured.
- HotCRM's own fix (move the dashboard into the revenue module) is the
hotcrm card that is `Blocked-by: #32929`; this PR does not touch it.
- Wording only: no package's answer moves, so no first-party consumer
count changes.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
https://claude.ai/code/session_01L6bhgUxLM4ELbDe8g3b14b
<!-- signed: domain:server#1 · os-sales ·
session_01L6bhgVaKJ9TPfXPRhdqx3e -->
---------
Co-authored-by: Claude <noreply@anthropic.com>
Co-authored-by: objectstack-fleet[bot] <332303061+objectstack-fleet[bot]@users.noreply.github.com>1 parent e336a33 commit d4b14a8
7 files changed
Lines changed: 41 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
21 | | - | |
| 21 | + | |
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
24 | | - | |
| 24 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
31 | | - | |
| 31 | + | |
32 | 32 | | |
33 | 33 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
21 | | - | |
| 21 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
76 | 76 | | |
77 | 77 | | |
78 | 78 | | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
79 | 97 | | |
80 | 98 | | |
81 | 99 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
560 | 560 | | |
561 | 561 | | |
562 | 562 | | |
| 563 | + | |
| 564 | + | |
| 565 | + | |
| 566 | + | |
563 | 567 | | |
564 | | - | |
| 568 | + | |
| 569 | + | |
| 570 | + | |
565 | 571 | | |
566 | 572 | | |
567 | 573 | | |
| |||
0 commit comments