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. |
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