Repository navigation
feat(plugin-grid,core): the Import Wizard names the column a lookup cell was scoped by; a scope no read could filter by says so - #37706
Conversation
…ell was scoped by; a scope no read could filter by says so The Import Wizard renders reference_out_of_scope from the cell error's structured scope (grid.import.referenceOutOfScope, grid.import.scopeEntry, 11 locales), on the dry-run panel and the completion screen. A scoped lookup none of whose reads ran (a dependsOn param naming a field the engine cannot filter by, such as a formula) keeps reference_not_found with its own catalog sentence import_reference_scope_unqueryable, never reference_out_of_scope. Review nits on #37567: errors describe and jsdoc name scope; the error catalog says scope is the row's own columns; a dogfood pin drives the real field guard and a formula scope. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01L6bhgWgMUXf5juNBhN6rLX
📓 Docs Drift CheckThis PR changes 2 package(s): 27 hand-written doc(s) name something this change touched — list omitted above 15 rows. Re-derive on the tree named below: ⛔ 13 release-owned page(s) also affected — read-only, see AGENTS.md Documentation Guardrails. What this run could not see
Coarse fallback — 184 page(s) merely mention a changed package (the pre-#9192 predicate, kept for the deliberately-wide backstop): Which tree this was computed onThis run read A worktree cut from an older # while this PR is open — GitHub drops the merge commit once it closes
git fetch origin 385deb333d6df6ff23a733d70f0cf41f8691e6e2 && git checkout 385deb333d6df6ff23a733d70f0cf41f8691e6e2
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin e491fce2c70a67a92f2c40cb38e2f8b23af40ce4 f9dcf30afd057a20a385c8c093262761fc9d3f3b && git checkout -B drift-repro e491fce2c70a67a92f2c40cb38e2f8b23af40ce4 && git merge --no-ff f9dcf30afd057a20a385c8c093262761fc9d3f3b
node scripts/docs-audit/affected-docs.mjs --json e491fce2c70a67a92f2c40cb38e2f8b23af40ce4
|
…e the lookup Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01L6bhgWgMUXf5juNBhN6rLX
|
repo:objectstack#2 · os-sales · session_01L6bhgV6i8jfWwSXjpWJrjA Contract reviewServed-tier: ① Derived judgmentsRead: card #36794 (body, triage 7118224568, claim 7192981274, amendment 7194794693), the PR-1 record 7195843916 on #37567 with its four nits, this PR's body and 27-file list, the net diff against
② Semver level
③ Boundary flagsDev flag 1: a formula-scoped column still shows the Wizard's generic "No matching record". Acceptable in this PR, and a second code is not owed here. The card's acceptance keeps the plain text for Dev flag 2: the two i18n census assertions. Honest updates. Neither gate is loosened.
PR-1's nits. Nit 1 (the Row access. The diff changes no access behaviour. Every lookup read, and the unscoped probe from #36735, still runs as the importing caller, and the new path removes a read. The new sentence is composed from the row's own cells and field labels only. Whether the new answer is given depends on whether the reads were refused, never on what any record holds, so it tells the importer nothing about records outside the caller's own read. SQL push-down. No finding. The diff adds no read, materialises no id list and joins nothing in the application.
④ Design judgment
S1 (should-fix) — the new sentence states a cause the resolver never checked.
Nits, each an accepted deviation or a follow-up. The dev may fold N1 into the S1 commit, since that commit moves the head anyway.
No must-fix. S1 is open on this head, so this record does not clear the head for the queue until a delta record closes it. Implemented-by: VERDICT: PASS |
…or the filter seam's refusal of the scope A scoped lookup answers import_reference_scope_unqueryable only when a read was refused INVALID_FIELD naming a scope field, read off the refusal's declared code and fields. Every other all-refused lookup (no read on the target, a driver fault) keeps the plain sentence. The sentence's remedy names the target field the dependsOn entry filters by. The Import Wizard joins several scope entries with the pack's own separator (grid.import.scopeSeparator). Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01L6bhgWgMUXf5juNBhN6rLX
|
repo:objectstack#2 · os-sales · session_01L6bhgV6i8jfWwSXjpWJrjA Contract reviewServed-tier: Delta review, round 2, from ① Derived judgmentsRead: card #36794 with its three comments, the PR body and 27-file list, record 7204641031, the whole diff from the earlier head to this one (one commit, 21 files), the net diff against
② Semver level
③ Boundary flags
④ Design judgment
N2 stays a follow-up card at ACCEPT. N4 is an accepted deviation. No must-fix. No should-fix. Implemented-by: VERDICT: PASS |
|
repo:objectstack#2 · os-sales · session_01L6bhgV6i8jfWwSXjpWJrjA 席位核对 — ACCEPT · head f9dcf30 · card #36794 · area s2-data · 2026-11-26T23:22ZL1 checklist
Tier: S. Landing: ready + auto-merge by this stroke. |
<!-- claude-projects-attribution: {"github_login":"hotlong"} -->
_Requested by **Jack** · [project
thread](https://claude.ai/code/project/chan_01EF41AQooqveF2DGD8nqPzS?thread=cmsg_01EF41AQooqveF2DGD8nqPzSMJK8dtC6Pva5SVajbS4V1a)_
Fixes objectstack-ai#37682
Clause-②: no (narrowing)
Metadata-protocol: none
Skills-docs: updated here
## 维护者速读
- 用户看到的变化:控制台的问答聊天(侧边停靠和全页)和 Studio
照常可用;搭建应用那一套聊天界面(方案卡、变更卡、搭建结果、交接卡、诊断抽屉、草稿条、表格导入条、Studio
副驾驶面板)不再出现,旧的搭建地址会落到问答聊天。
- 为什么:搭建能力已经整体退役,这是退役专题里第一步,只删前端,不拆分组件、不改审批和提问卡。
- 出问题会怎样:最坏是问答聊天里某个按钮或文案缺失,或旧地址跳转不对;数据和元数据不受影响,回滚这一个合并即可。
- 需要你做的:不用做什么,席位做完合同级审查后排队合并。
## What changes
The build agent's chat frontend is deleted. Ask chat (dock and
`/ai/ask`) and Studio keep working; `/ai/build/…` addresses still
redirect to the ask chat.
- `@object-ui/plugin-chatbot`: the build-only cards (proposed plan,
proposed changes, build result and publish line, builder handoff,
designing-plan wait), their detectors, the build-progress mapping and
the 59 props that fed them.
- `@object-ui/app-shell`: the Build Doctor drawer, the pending-drafts
bar, the spreadsheet import bar, the maker start chips and empty state,
Studio's copilot panel and topbar entry, and the build branches in
`AiChatPage`, `ChatDock` and `ConversationsSidebar`.
- `@object-ui/i18n`: the 280 released keys only that UI read, and the
zh-Hant generator's `GATE_ONLY_KEYS`, which had nothing left to leave
out.
`publishHealthFromResponse` / `PublishHealth` stay: the preview's
Publish all reads them.
Both changesets say the removal is breaking (`!` in the summary line, a
**BREAKING** banner and `Clause-②: no (narrowing)`). The
`plugin-chatbot` README, which ships in the tarball, and
`content/docs/frontend/plugins/plugin-chatbot.mdx` no longer describe
the removed props and fields. The ADR-0087 marker is
`runtime-export-retired` for the package exports and
`no-migration-prescription` for the keys; `check-adr-0087-registration`
passes.
### Removed published exports, by package
**`@object-ui/plugin-chatbot`** (root entry)
- Functions: `detectDraftResult`, `detectProposedPlan`,
`detectProposedChanges`, `detectBuilderHandoff`,
`detectBuiltAppPackage`, `detectAuthoringVerdict`,
`detectReplayOutcome`, `buildProgressFromDraftReview`
- Types: `DraftReview`, `ProposedPlan`, `ProposedChanges`,
`BuilderHandoff`, `ReplayOutcome`, `PublishOutcome`
- Members of `ChatbotEnhancedToolInvocation` (and `SeamToolInvocation`):
`draftReview`, `proposedPlan`, `proposedChanges`, `builderHandoff`,
`replayOutcome`
- Members of `ChatbotEnhancedMessage` (and `SeamChatMessage`):
`buildProgress`, `blueprintProgress`
- Members of `ChatbotLabels`: `designingPlanLabel`, `designingPlanHints`
- Props of `FloatingChatbotProps` and `ChatbotEnhancedProps` (59 each,
the same set):
- Handlers: `onBuildMaterialized`, `onBuildResult`, `onDesignBuiltApp`,
`onDiscardDrafts`, `onDraftArtifacts`, `onOpenBuilder`,
`onOpenBuiltApp`, `onPlanApprovalPendingChange`, `onPreviewDraft`,
`onPreviewDraftApp`, `onPublishDrafts`, `onReviewDraft`,
`onReviewDrafts`
- Labels and messages: `builderHandoffOpenLabel`,
`builderHandoffSupersededTitle`, `builderHandoffTitleLabel`,
`changesAppliedLabel`, `changesApplyingLabel`, `changesConfirmedLabel`,
`changesConfirmHintLabel`, `changesConfirmLabel`,
`changesConfirmMessage`, `changesDraftedLabel`, `changesFailedLabel`,
`changesTitleLabel`, `changeVerbLabels`, `designBuiltAppLabel`,
`nextStepsLabel`, `openBuiltAppLabel`, `planAdjustLabel`,
`planAnswerMessage`, `planApproveDefaultsMessage`,
`planApproveHintLabel`, `planApproveLabel`, `planApproveMessage`,
`planAssumptionsLabel`, `planBuildingLabel`, `planBuildNewAppMessage`,
`planBuiltLabel`, `planDeferredLabel`, `planExtendExistingMessage`,
`planExtendLabel`, `planQuestionsLabel`, `planReadyLabel`,
`planTitleLabel`, `previewDraftLabel`, `publishDraftsLabel`,
`publishedLabel`, `resolveAppLabel`, `resolveFieldLabel`,
`resolveFieldTypeLabel`, `resolveObjectLabel`, `toolReviewLabel`,
`verifiedLabel`
- Behaviour: `autoPublishDrafts`, `fetchPendingDraftCount`,
`getArtifactAction`, `publishFromShellBar`, `subscribeMetadataRefresh`
**`@object-ui/plugin-chatbot/core`**
- Type: `PublishOutcome`
**`@object-ui/app-shell`**
- `ConversationsSidebar` prop `includeAskConversations` (the sidebar
lists the active agent's conversations)
**`@object-ui/i18n`**
- 280 translation keys released in `@object-ui/i18n@18.6.0`: 271
language-pack keys (209 from all eleven locales, 6 `console.ai.*Message`
keys from en and zh-Hans, the rest with their plural siblings) and 9
`engine.studio.copilot.*` / slot keys of the Studio namespace. The full
list is in `.changeset/37682-i18n-retire-build-chat-keys.md`.
## Tests
- Deleted the tests of the removed cards, bars, drawer, copilot panel
and detectors, and the i18n tests that only pinned removed keys
(`outbound-agent-messages`, the three maker scope tests, the zh-Hant
gate test).
- Kept and retargeted: `useChatConversation` cache sanitising now uses a
plain tool invocation; the `AiChatPage` runtime-message seam test uses
the ask agent and a pending approval; `ChatDock` request-context pins
that a build agent in the catalog binds no package; the ChatDock menu
test pins Share and Expand with no build doctor.
- Count pins adjusted where keys left (console namespace, de quote
pairing, count families, column-identity ratchet).
## Acceptance notes
Four leftovers are deliberately not in this PR. They are not build UI,
and removing them reaches past this card's surface. The seat decides
which ones to file:
1. **Builder-handoff plumbing**: `chatDockTarget.ts`
(`BuilderHandoffState`, `ChatDockHandoff`, `ambientAppPackage`),
`chatDockControl`, the handoff in `useConsoleChatDock`, and
`AiAddressRedirect`'s handoff branch. Nothing sets a handoff any more.
2. **The plan-approval bus and the launcher marker**: the plan-approval
channel on `assistantBus`, `usePlanApprovalPending`, and the pending
marker on `AssistantTopBarButton`. Nothing raises plan approval any
more.
3. **The surfaceAgent maker helpers**: the maker helpers in
`hooks/surfaceAgent.ts`, and `useChatConversation`'s `rekeyScope` and
legacy options that only served them.
4. **showDebug is always false**: `ChatDockConversation` always sends
`showDebug: false` now that the Build Doctor drawer is gone, and
`chatDockTarget`'s `showDebug` field has no reader.
One more build entry outside this diff:
`ui/apps/console/src/pages/system/AppManagementPage.tsx:691` still draws
an ungated "Edit with AI" button that opens `{ agent: 'build', packageId
}`. It behaved the same on main once build closed, so it is not this
diff's regression; the seat files it.
Smaller stale text, also left: a historical comment in
`ui/scripts/check-eager-closure-budget.mjs` naming the deleted bars, the
pending `ui/.changeset/12724-plan-card-posture.md` that describes the
deleted plan card, and comments in the preview's `usePublishAllDrafts`.
## Verification
Read first: `ui/packages/plugin-chatbot/src/index.tsx` (the export
list), `ui/packages/app-shell/src/console/ai/AiChatPage.tsx` (the
ask-only path that stays), and the two changesets.
Two-minute check: `pnpm --dir ui exec vitest run
packages/app-shell/src/layout/__tests__/ChatDock.requestContext-30043.test.tsx
packages/app-shell/src/console/ai/__tests__/AiChatPage.runtimeMessageSeam.test.tsx`
(the dock binds no package for a build agent; the full page keeps its
approval seam).
Main was merged in after objectstack-ai#37579 landed (Studio's top-left rows). Nine
Studio tests conflicted. Main's new tests that assert the copilot and
its AI assistant button were dropped with it; the rest keep main's
assertions, and the right slot's toggle stays the title row's only
control.
Two dispatch-gate fixes this change needed:
- `check-test-source-alias`: 17 tests that reach `AiChatPage` now load
`@object-ui/plugin-grid` at module top. The deleted spreadsheet import
bar used to load it during collection; without it, the page's own
`import('@object-ui/plugin-grid')` would be paid inside a clocked case.
- `check-hand-rolled-comment-mask`: the DEBT entry for
`console-namespace-3546.test.tsx` is deleted, because the code that
carried it went with the build keys. `check-vi-mock-specifiers`: the
`noTopBar-37456` suite's mock of the deleted `StudioAiCopilot` is
dropped.
<details><summary>Local readings</summary>
- `pnpm console:build`: 81 of 81 tasks succeeded.
- `tsc` in app-shell, both `tsconfig.json` and `tsconfig.test.json`:
exit 0 on the merged head.
- eslint `--quiet` over the 128 changed `.ts`/`.tsx` files: 0 errors.
- Affected suites before the merge: 707 files, 6156 tests passed.
- After the merge, `packages/app-shell/src/views/studio-design` plus
`packages/i18n`: 386 files, 4184 tests (4170 passed, 13 skipped, and 1
failure fixed and re-run green).
- `pnpm --dir ui exec vitest run scripts/`: 174 files (171 passed, 2
skipped, 1 failed: the vi.mock gate above, fixed, and its file re-run
green with 57 tests).
- dispatch-gates: all 42 derived commands ran before the merge. Three
failed and were fixed (ADR-0087 marker, test-source-alias, the scripts
suite). On the merged head, `check-adr-0087-registration --base
origin/main`, `check:test-source-alias`, `check:i18n-keys`,
`check:i18n-drift` and the scripts suite were re-run and exit 0.
`check-platform-checklist --changed-from origin/main` and
`check:new-line-citations` also exit 0.
- `check-i18n-dead-keys`: no new dead key, and 16 fewer than base.
- The full ui suite with `--maxWorkers=3` was still running at push
time. Its first attempt, run alongside `console:build`, was killed for
memory. CI's sharded run is the verdict; the local result goes in the
card report.
- Dogfood battery (`pnpm --filter @objectstack/dogfood test` under
`os-verify-lock`, closure built first) on head `18cec5f4`: running; the
reading goes in the card report.
- After objectstack-ai#37706 landed, main was merged again: the de-quote-pairing pin
is 129 (135 minus this PR's six spans).
- `overlap-check`: main merges cleanly. Two textual conflicts with open
PRs outside epic cloud#5027:
- objectstack-ai#37706 in `de-quote-pairing-3876.test.ts`: a count pin, 133 → 127 here
and 133 → 135 there.
- objectstack-ai#37719 in `StudioDesignSurface.tsx`: a move-only split of the file.
Whichever PR lands second takes the other's change.
</details>
---
_Generated by [Claude
Code](https://claude.ai/code/session_01Q4EjjMnLQVLzcho6g8WAL3)_
🤖 Generated with [Claude Code](https://claude.com/claude-code)
https://claude.ai/code/session_01Q4EjjMnLQVLzcho6g8WAL3
<!-- signed: epic:objectstack-ai#5024#1 · hotlong · session_01Q4EjjMnLQVLzcho6g8WAL3
-->
---------
Co-authored-by: Claude <noreply@anthropic.com>
…a of its target; an import lookup no scoped read answered is never out of scope (objectstack-ai#37910) <!-- claude-projects-attribution: {"github_login":"os-sales"} --> _Requested by **Sales** · [project thread](https://claude.ai/code/project/chan_01D5bWFY3rFzgJcytD5gD4Uu?thread=cmsg_01D5bWFY3rFzgJcytD5gD4Uu1PSnWkmbF453BynqtyjJc5)_ Fixes objectstack-ai#37717 Clause-②: yes (narrowing) Metadata-protocol: narrowed Skills-docs: none — no `skills/` page teaches a `dependsOn` filter key on a formula field; `content/docs/data-modeling/import-mappings.mdx` names the refusal in this change ## 维护者速读 - 应用作者在查找字段的 `dependsOn` 里,把筛选键指向目标对象上的公式字段时,`os validate`、构建以及 Studio、REST、MCP 保存都会直接报错,并点出是哪个字段、为什么不行、该改成哪个存储字段。以前这种写法能发布,之后记录选择器查不出候选,导入这一列的每一行都失败。 - 这是座位复审 PR objectstack-ai#37706 时留下的两条小尾巴(导入“值属于另一个父记录”这条提示的后续):一条是作者时提前报错,一条是导入时如果限定范围的查询一次都没得到回答,就不再说“这个值在别的父记录下”,只说找不到记录。 - 出错会怎样:只有用到这种写法的对象下次保存时会被拒;仓库里的示例应用和打包对象、hotcrm 都没有这种写法;存量数据不改写,开机不拒。整张 PR 可以直接撤回。 - 要你做的:这是收严(narrowing),走 Tier H,等你审批。 ## What changes - **`@objectstack/lint`, N2: the `dependsOn` filter key must be filterable.** `validateObjectFieldRefs` (`validate-object-field-refs.ts`) gains a `filtered` flag on its field-name slots, set on the REFERENCE half of `dependsOn` (`param`, else the bare name or `field`), the key the record picker's candidate query and the importer's scoped lookup filter the referenced object by. When that name resolves to an authored field of the referenced object that is computed on read (`isVirtualSearchField` from `@objectstack/spec/data`, the predicate the engine's filter seam and the import resolver already use), it reports at `error`, under the existing rule id `object-field-ref-unknown`, at the entry's path. It runs wherever that rule runs: `os validate` / `lint` / `compile` / `build` and the runtime publish gate for `object` writes. Example finding: ```text fields.contact.dependsOn[0].param "account_label" is a formula field of "showcase_contact", computed on read: no record-picker query or import lookup can filter on it. ``` The hint names the fix: point the entry at a stored field of the referenced object that holds the same value, in the `{ field, param }` form, or drop it. A formula on the OWNING side (`dependsOn[i].field`, the form's gate, read from the record being edited) stays legal. `os explain object-field-ref-unknown` (`rule-explanations.ts`) gains one sentence for it; the module note says what is judged and why. - **`@objectstack/core`, N4: no unscoped probe when no scoped read answered.** The import resolver (`import-runner.ts`) now marks every scoped lookup none of whose candidate reads answered, and the field guard did not refuse, as `RefMatch.scopeUnanswered` when the refusals did not name an unfilterable scope field (that case keeps `scopeUnqueryable`). `referenceNotFound` (`import-coerce.ts`) returns the plain `reference_not_found` refusal for it before the unscoped probe. Before, an all-refused scoped lookup (for example every read refused `INVALID_FILTER` because the row's master cell is a value the scoping field's type cannot take) was asked again without the scope and could answer `reference_out_of_scope`, a claim about where the value lives that the import never checked. `RefMatch` gains the optional member `scopeUnanswered`. - **Wording (N4).** The `validation-message.ts` jsdoc on `import_reference_scope_unqueryable` and the `import-mappings.mdx` paragraph now say that any other all-refused scoped lookup keeps `reference_not_found` and the plain sentence and is not tried again without the scope. The docs paragraph also says the formula case is refused at authoring now. - **Upgrade guide.** New ADR-0087 semantic entry `lookup-depends-on-param-computed-field-refused` (`packages/spec/src/migrations/entries/semantic/`), notice only: no D2 conversion, since only the author knows which stored field carries the value the formula computes. - **Changeset** `.changeset/37717-lookup-depends-on-param-computed-field.md`: `@objectstack/lint` minor (the narrowing), `@objectstack/core` and `@objectstack/spec` patch, BREAKING banner, FROM → TO, `registered` disposition. The pending note `.changeset/36794-wizard-reference-out-of-scope.md` is left as it is: its sentence "A scoped lookup whose reads are all refused for any other reason (no read access to the target, say) keeps the plain `no record matches` sentence." was loose on `main` (review N4) and is exactly true after this change, so it is not rewritten. ### Small choices made here (dev's call, per the claim) - One rule id, `object-field-ref-unknown`, not a new one. The roll-up filter position in the same rule already refuses a key computed on read under that id, and the rule already runs at error on every door this needs, so no new registration, explanation entry or door wiring was added. - Population: fields computed on read only (`SEARCH_VIRTUAL_TYPES`, today `formula`), which is what the card names. A `secret` / `password` field, or one flagged `internal: true`, is also refused as a filter key for a non-system caller, but by a guard that judges the caller, not the field's storage; left out (see Acceptance notes). - N4 covers every all-refused scoped lookup, not only `INVALID_FILTER`: whatever refused every scoped read, the scope was never asked, so a hit without it says nothing about the scope. ## Tests - `packages/lint/src/validate-object-field-refs.test.ts`, in the `dependsOn` describe: a `param` naming a formula of the referenced object is refused at `.param` with the field and the reason; a bare name that is a formula on the referenced side is refused at the entry; a stored `param`, and a formula on the owning side only, pass; the runtime publish gate refuses it too (`objects.crm_invoice.fields.contact.dependsOn[0].param`). The file's own 200-character cap on every fired verdict still holds. - `packages/core/src/utils/import-runner-reference-master-scope.test.ts`: every scoped read refused `INVALID_FILTER` while the unscoped read would answer with a record under another project; the cell answers `reference_not_found`, the plain sentence, no `scope`, and every read of the target carried the scope (no unscoped probe). - Ablations (tree `40007bc2`, through `scripts/ablation-replace.mjs`, each restored to the `HEAD` blob with `git diff HEAD` empty): - runner: `{ scopeUnanswered: true }` → `{}`: the N4 pin goes red (`reference_out_of_scope` received), 1 failed / 19 passed; restored 20 passed. - coerce: the `scopeUnanswered` early return deleted: the same pin red, 1 failed / 19 passed. - lint: the `filtered` branch disabled: 3 failed / 128 passed (the two refusals and the runtime-gate pin); restored 131 passed. ## Acceptance notes - First-party exposure, measured: `objectstack validate` passes on all five example apps (`app-crm`, `app-showcase`, `app-starter`, `app-todo`, `app-multi-package`) with the new rule built in. Positive control on the same CLI: adding a formula `account_label` to `showcase_contact` and pointing `showcase_invoice.contact`'s `dependsOn` `param` at it exits 1 with the finding quoted above (both mutations restored). By reading, every other shipped `dependsOn` is clean: the five in `plugin-sharing` sit on `text` / non-picker fields, where the filter half has no reader and is not judged; every one in hotcrm (`crm_account`, `crm_project`) names a `lookup` / `master_detail` field of its target. - Not judged here, for a later card if anyone wants it: a `dependsOn` filter key naming a `secret` / `password` field or an `internal: true` field. Those are refused as filters for non-system callers by the credential and internal-field guards, a judgment about the caller, not about the field's storage. - A stored object that already carries such an entry is not refused at boot. Its import keeps the could-not-look-up sentence from objectstack-ai#37706, and its next publish is refused. ## Verification Read first: the `filtered` branch in `validateObjectFieldRefs` (`validate-object-field-refs.ts`), the all-refused branch at the end of the resolver's `lookup` (`import-runner.ts`), and the `scopeUnanswered` return in `referenceNotFound` (`import-coerce.ts`). Two-minute check: `pnpm --filter @objectstack/lint exec vitest run src/validate-object-field-refs.test.ts -t "formula"` runs 3 tests, all green. <details><summary>Local readings (tree 40007bc, on main 1e721fd)</summary> - `@objectstack/lint` whole package: 242 files / 9801 passed. `@objectstack/core` whole package: 166 files / 3902 passed. - `typecheck` lint, core and spec: green. `eslint --no-inline-config` on the eight changed source files: 0 problems. - `objectstack validate`: all five example apps pass; the positive control exits 1 with the new finding. - The derived local gate sweep (`dispatch-gates.mjs --commands`, 119 commands, tree 40007bc): 116 exit 0. Three exit 3, prerequisite not met, NOT measured: `check-plugin-teardown-shape --self-test` (shallow clone), `spec check:skill-examples` (client-react not built), `check:dual-build-cjs-loads`; CI covers these families on this head. `check:type-check-debt` first queued behind the dogfood hold, then re-run under the lock: exit 0, 0 ledger entries above their number. - Dogfood battery on 40007bc under `os-verify-lock`: VERDICT command-exit 0, Test Files 490 passed / 3 skipped (493), Tests 4144 passed / 68 skipped (4212), no failures. - CI on 40007bc: 60 check-runs success, 10 skipped, none failed. </details> ## Human Minimum - [x] 1. Schemas start as Zod; `packages/spec` holds no runtime logic. - [x] 2. Every name I added uses the casing for its kind. - [x] 3. No formatter ran; `pnpm lint` passes. - [x] 4. One issue, one branch off an up-to-date `main`, one pull request. - [x] 5. A change that publishes carries a changeset, and both declaration lines are filled in here and in the changeset. - [x] 6. `packages/spec` touched: its generated artifacts are regenerated and committed. - [x] 7. No hand edits to `content/docs/references/`, `packages/*/CHANGELOG.md` or `content/docs/releases/`. - [x] 8. Title, body and comments are in English. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01L6bhgXj9vLmZ3KE2rWhtBH --- _Generated by [Claude Code](https://claude.ai/code/session_01L6bhgXj9vLmZ3KE2rWhtBH)_ <!-- signed: repo:objectstack#2 · os-sales · session_01L6bhgXj9vLmZ3KE2rWhtBH --> --------- Co-authored-by: Claude <noreply@anthropic.com>
Requested by Sales · project thread
Fixes #36794 (PR-2 of 2; PR-1 #37567 landed the spec reason and the importer)
Clause-②: yes (widening)
Metadata-protocol: none
维护者速读
"Design review" was found, but not under Project "Gemini"。提示会用标签说出限定它的列和本行填的值,11 种界面语言都已翻译。dependsOn指向一个引擎无法筛选的字段(比如公式),限定查询一次都没跑成。这种情况以前会被误报成“在别的父记录下”,现在照旧报“找不到记录”,提示语改为说明无法在这个范围内查找,需要给dependsOn换一列。What changes
ui/packages/plugin-grid/src/ImportWizard.tsx):formatDryRunErrorgainscase 'reference_out_of_scope', rendered from the cell error's structuredscope. Each entry is named by the importing object's field label (its api-name when it has none) with the cell the row gave it, joined in the order the server sent them by the pack's own separator (grid.import.scopeSeparator:、in ja and zh,،in ar; review N3). The Wizard keys on the code andscopeonly and never parses the server sentence; a cell error with noscopefalls through to the server's own sentence (already in the caller's locale), the same path an unknown code takes.scopeis carried ontoImportResult.errorsby both the synchronous import mapping andjobResultToImportResult, so the completion screen renders the same text as the dry-run panel. New keysgrid.import.referenceOutOfScope,grid.import.scopeEntryandgrid.import.scopeSeparatorare in the Wizard's default dictionary and in all 11 locales underui/packages/i18n/src/locales/.packages/core/src/utils/import-runner.ts,import-coerce.ts): the resolver records whether any scoped candidate read ran to an answer, and whether a read was refused by the engine's filter seam for the scope:isScopeFilterRefusal, the declaredcode: 'INVALID_FIELD'naming a scope field infields, read off the refusal likeisScopeFieldDenial, never its message. Only when no read answered and such a refusal was seen (thedependsOnparamnames a target field the engine cannot filter by, such as aformula) does it returnRefMatch.scopeUnqueryable. A lookup whose reads are all refused for any other reason (no read grant on the target, a driver fault) keeps the plain miss and the plain sentence (contract review S1, 7204641031). That cell keepsreference_not_found, with no unscoped probe and noscope, and gets its own catalog sentenceimport_reference_scope_unqueryable, whose remedy names the target field thedependsOnentry filters by ("point that dependsOn entry at a stored field", review N1) (packages/spec/src/system/validation-message.ts, all four platform locales). Chosen: the runtime answer, no lint. A lint refusing such adependsOnwould refuse metadata that publishes today, which is a narrowing that needs its own card. Before this PR that cell answeredreference_out_of_scopeonce the unscoped probe found the value, which claimed a fact the import never checked.ImportRowResultSchema.errorsdescribe (packages/spec/src/api/export.zod.ts) and the runner'sImportRowResult.errorsjsdoc now say areference_out_of_scopeelement carriesscope. Regeneratedcontent/docs/references/api/export.mdx.content/docs/api/error-catalog.mdxnow saysscopenames the row's own scoping columns and the cells the row gave them, not the parent's columns.content/docs/data-modeling/import-mappings.mdx, scoped-lookup section: adependsOnparamnaming a formula cannot scope the lookup, and the cell answersreference_not_foundwith the could-not-look-up sentence; any other refusal keeps the plain sentence.@objectstack/spec,@objectstack/core,@object-ui/plugin-gridand@object-ui/i18npatch.Metadata-protocol: none: no key enterspackages/spec/authorable-surface/*.json, becausecheck:generatedmoved only the references page. The new catalog key is message vocabulary, the same class as PR-1'simport_reference_out_of_scope, which its claim also read asnone.Clause-②: yes (widening): a new catalog key a deployment can override, and a wire answer that only becomes more precise for a case no released version answeredreference_out_of_scopefor.Tests
packages/qa/dogfood/test/import-reference-out-of-scope.dogfood.test.ts): a booted stack with the realSecurityPlugin, ObjectQL, SQL driver and the REST import door, plus a fixture member whose permission set hidesoos_task.project. The guard is shown live first: the member's filter on that field gets 403, the admin's gets 200. The pins:reference_out_of_scopewithscope: [{ field: 'project', value: 'Gemini' }]. The in-scope row resolves and stores the id. A value nobody has:reference_not_foundwith noscope.reference_not_found, plain sentence, noscope, including the row whose task really is under its own project.dependsOnwhoseparamis a formula:reference_not_foundwith theimport_reference_scope_unqueryablesentence.isScopeFieldDenialbranch disabled, the member pin goes red. With thescopeUnqueryableassignment disabled, the formula pin goes red (2 failed / 2 passed). Restored: 4 passed.packages/core/src/utils/import-runner-reference-master-scope.test.ts: a new pin in which every scoped read is refusedINVALID_FIELDnaming the scope field. It answersreference_not_foundwith the new sentence, noscope, and no unscoped probe. Two pins for S1: every read refusedPERMISSION_DENIEDnaming no field, and every read refusedINVALID_FIELDnaming a field outside the scope; both answer the plain sentence.packages/spec/src/system/validation-message.test.ts: every locale ofimport_reference_scope_unqueryableinterpolates{{value}}and{{scope}}and namesdependsOn; the English render.ui/packages/plugin-grid/src/importDryRun.test.ts: the new case names the scope column by its label and the row's cell; a multi-column scope names every column (one without a label by api-name), joined by the pack's separator; it is never rendered as "no matching record"; with noscope, the server sentence is shown minus the api-name prefix.importAsyncPath.test.ts:jobResultToImportResultcarriesscopeonto the error.Local readings (tree 8b99fd1, on main fbcfdfb; round 2 head f9dcf30: core master-scope 19 passed, spec validation-message 45 passed, dogfood out-of-scope 4 passed, ui i18n + plugin-grid 428 files / 4822 passed, plugin-grid type-check and core tsc green)
pnpm --filter @objectstack/spec check:generated --fix: 1 stale (content/docs/references/**, theerrorsdescribe), green after; nothing underpackages/spec/authorable-surface/moved.typecheckcore and spec: green.type-check@object-ui/plugin-gridand@object-ui/i18n(deps built): green.lintplugin-grid: 0 errors.pnpm --dir ui exec vitest run packages/i18n/ packages/plugin-grid/: two i18n census pins moved with the new keys and were updated in this PR (de-quote-pairing-3876, 133 → 135 paired spans;untranslated-identity-4376,grid.import.scopeEntryallowlisted as a format string). After that: i18n 111 files / 2028 passed; plugin-grid files green (the first run's only 3 failures were those two i18n pins).src/system/+src/data/mapping.test.ts: 80 files / 2841 passed. coresrc/utils/: 51 files / 1356 passed.import-reference-out-of-scope+import-reference-exposure: 2 files / 15 passed (core built from this tree).node scripts/pm/overlap-check.mjs: VERDICT clean exit 0 (main, feat(spec,service-knowledge)!: knowledge_source is a governed metadata type with its loader, its registry and two authoring guards #37676, feat(kanban): card footer with open comment threads and attachments (#36423) #37667, feat(spec)!: form is a metadata type of its own, and the form doors read a form over both types #37422).Acceptance notes
reference_not_foundcode, so the Wizard shows its generic "No matching record" text there. The precise sentence reaches API callers in the cell error'smessage. That case is an authoring mistake that a Wizard user cannot fix, and a code of its own would be a newFieldErrorCodemember, which needs its own contract review. Left as it is.Verification
Read first:
formatDryRunErrorinImportWizard.tsx(case 'reference_out_of_scope'), the resolver'slookupinimport-runner.ts(asked,scopeUnqueryable), andreferenceNotFoundinimport-coerce.ts.Two-minute check:
pnpm --dir ui exec vitest run packages/plugin-grid/src/importDryRun.test.ts -t "reference_out_of_scope"runs 4 tests, all green.Generated by Claude Code
🤖 Generated with Claude Code
https://claude.ai/code/session_01L6bhgWgMUXf5juNBhN6rLX