Skip to content

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

Merged
objectstack-fleet[bot] merged 3 commits into
mainfrom
claude/project-thread-zt8cu4
Nov 26, 2026
Merged

objectstack-fleet[bot] merged 3 commits into
mainfrom
claude/project-thread-zt8cu4

Conversation

@objectstack-fleet

@objectstack-fleet objectstack-fleet Bot commented Nov 26, 2026 •

Copy link
Copy Markdown
Contributor

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 换一列。
  • 只影响导入失败行的显示文字和一种配置错误时的错误码,成功导入不受影响,没有新增可写的元数据键。整张 PR 可以直接撤回。
  • 无。

What changes

  • Import Wizard (ui/packages/plugin-grid/src/ImportWizard.tsx): formatDryRunError gains case 'reference_out_of_scope', rendered from the cell error's structured scope. 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 and scope only and never parses the server sentence; a cell error with no scope falls through to the server's own sentence (already in the caller's locale), the same path an unknown code takes. scope is carried onto ImportResult.errors by both the synchronous import mapping and jobResultToImportResult, so the completion screen renders the same text as the dry-run panel. New keys grid.import.referenceOutOfScope, grid.import.scopeEntry and grid.import.scopeSeparator are in the Wizard's default dictionary and in all 11 locales under ui/packages/i18n/src/locales/.
  • Review nit 2, a scope no read could filter by (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 declared code: 'INVALID_FIELD' naming a scope field in fields, read off the refusal like isScopeFieldDenial, never its message. Only when no read answered and such a refusal was seen (the dependsOn param names a target field the engine cannot filter by, such as a formula) does it return RefMatch.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 keeps reference_not_found, with no unscoped probe and no scope, and gets its own catalog sentence import_reference_scope_unqueryable, whose remedy names the target field the dependsOn entry 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 a dependsOn would refuse metadata that publishes today, which is a narrowing that needs its own card. Before this PR that cell answered reference_out_of_scope once the unscoped probe found the value, which claimed a fact the import never checked.
  • Review nit 1: ImportRowResultSchema.errors describe (packages/spec/src/api/export.zod.ts) and the runner's ImportRowResult.errors jsdoc now say a reference_out_of_scope element carries scope. Regenerated content/docs/references/api/export.mdx.
  • Review nit 4: content/docs/api/error-catalog.mdx now says scope names 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: a dependsOn param naming a formula cannot scope the lookup, and the cell answers reference_not_found with the could-not-look-up sentence; any other refusal keeps the plain sentence.
  • Changeset: @objectstack/spec, @objectstack/core, @object-ui/plugin-grid and @object-ui/i18n patch. Metadata-protocol: none: no key enters packages/spec/authorable-surface/*.json, because check:generated moved only the references page. The new catalog key is message vocabulary, the same class as PR-1's import_reference_out_of_scope, which its claim also read as none. 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 answered reference_out_of_scope for.

Tests

  • Review nit 3, a real engine and the real field guard (packages/qa/dogfood/test/import-reference-out-of-scope.dogfood.test.ts): a booted stack with the real SecurityPlugin, ObjectQL, SQL driver and the REST import door, plus a fixture member whose permission set hides oos_task.project. The guard is shown live first: the member's filter on that field gets 403, the admin's gets 200. The pins:
    • Admin, a task of another project: reference_out_of_scope with scope: [{ field: 'project', value: 'Gemini' }]. The in-scope row resolves and stores the id. A value nobody has: reference_not_found with no scope.
    • Member, the same rows: reference_not_found, plain sentence, no scope, including the row whose task really is under its own project.
    • A dependsOn whose param is a formula: reference_not_found with the import_reference_scope_unqueryable sentence.
    • None of these reads the guard's reason across a package as a string. Each answer comes from the real seam.
  • Ablation (dogfood): with the isScopeFieldDenial branch disabled, the member pin goes red. With the scopeUnqueryable assignment 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 refused INVALID_FIELD naming the scope field. It answers reference_not_found with the new sentence, no scope, and no unscoped probe. Two pins for S1: every read refused PERMISSION_DENIED naming no field, and every read refused INVALID_FIELD naming a field outside the scope; both answer the plain sentence.
  • packages/spec/src/system/validation-message.test.ts: every locale of import_reference_scope_unqueryable interpolates {{value}} and {{scope}} and names dependsOn; 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 no scope, the server sentence is shown minus the api-name prefix. importAsyncPath.test.ts: jobResultToImportResult carries scope onto 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)

Acceptance notes

  • The unfilterable-scope cell keeps the reference_not_found code, so the Wizard shows its generic "No matching record" text there. The precise sentence reaches API callers in the cell error's message. That case is an authoring mistake that a Wizard user cannot fix, and a code of its own would be a new FieldErrorCode member, which needs its own contract review. Left as it is.

Verification

Read first: formatDryRunError in ImportWizard.tsx (case 'reference_out_of_scope'), the resolver's lookup in import-runner.ts (asked, scopeUnqueryable), and referenceNotFound in import-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

…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
@github-actions github-actions Bot added size/m documentation Improvements or additions to documentation protocol:system tests tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface labels Nov 26, 2026
@github-actions

github-actions Bot commented Nov 26, 2026 •

Copy link
Copy Markdown
Contributor

📓 Docs Drift Check

This PR changes 2 package(s): @objectstack/core, @objectstack/spec, touching 17 documentable anchor(s).

27 hand-written doc(s) name something this change touched — list omitted above 15 rows. Re-derive on the tree named below: node scripts/docs-audit/affected-docs.mjs --json e491fce2c70a67a92f2c40cb38e2f8b23af40ce4.

⛔ 13 release-owned page(s) also affected — read-only, see AGENTS.md Documentation Guardrails.

What this run could not see
  • the SDK route bridge reached 69 of 252 client-bound route-ledger rows — the other 183 have no registrar path: tail to select them, so pages documenting THEIR client methods cannot appear above, on this or any run. Of those 183: 0 are remediable by widening that discovery convention (an in-repo file declares the path; the convention did not scan it); 59 are structural — on a ledger where NOT ONE row is declared in-repo, so no discovery change reaches them at any price; 124 are undecided (no in-repo declaration, on a ledger that has other in-repo registrars — absence and an unreadable spelling are not distinguishable here). The rows themselves: node scripts/docs-audit/affected-docs.mjs --bridge-coverage
  • a page that states a rule by its inputs shares no identifier with the emitter that implements the rule, so an emitter-only diff cannot list it — not on this run and not on any run. Measured on fix(driver-sql): emit varchar(maxLength) for a text field a declared index keys on #11430: content/docs/protocol/objectql/types.mdx documents the text-family column mapping by the ObjectQL type names it maps FROM (text / textarea / html) while the diff changed createColumn; it went unlisted, and it was the page that diff falsified, in four places. No shared token exists to detect this on, so a rule your change carries has to be re-read by hand in the pages that restate it.
  • a key NAME is not a key, so the hand re-read the line above prescribes can land on the wrong schema. The same spelling is authorable on one governed type and a [REMOVED] tombstone on another for each of active, aria, joins, objects, template, tools and version (censused on [finding] tools is a key on BOTH AgentSchema (tombstoned, dead) and SkillSchema (live, cloud-attested), so a name-based search attributes skill examples to the agent key — it produced a false stop-the-line alarm on PR #19059 #19093 over the liveness ledger's governed types, top-level keys); nothing in a search result distinguishes the two, so a grep hit on a LIVE example reads as evidence about the DEAD key. Measured on fix(spec): the agent.tools liveness row says dead — it claimed live on a key the schema tombstoned #19059: content/docs/ai/agents.mdx was reported as contradicting the agent.tools tombstone over its tools: example at :161, which is inside the defineSkill({ block opened at :155 — the page was already correct. Settle ownership by PARSING the value against both schemas, never by the name: that literal PASSES SkillSchema, and as an AgentSchema it FAILS at tools with the tombstone prescription. ⛔ These names are not the whole class — a key retired through a .strict() guidance map leaves no tombstone in the walked shape and none of them here (tool.category, live as AIToolDefinition.category).

Coarse fallback — 184 page(s) merely mention a changed package (the pre-#9192 predicate, kept for the deliberately-wide backstop): node scripts/docs-audit/affected-docs.mjs --json e491fce2c70a67a92f2c40cb38e2f8b23af40ce4 → packageMentionDocs.

Which tree this was computed on

This run read content/docs from 385deb333d6df6ff23a733d70f0cf41f8691e6e2 — the merge of head f9dcf30afd057a20a385c8c093262761fc9d3f3b into base e491fce2c70a67a92f2c40cb38e2f8b23af40ce4, which is what actions/checkout gives a pull_request run. Not the PR head.

A worktree cut from an older main holds a different content/docs, so re-deriving there can legitimately return a different list — that is a different tree, not a wrong row. To answer on the same tree:

# 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

⚠️ That checkout carried uncommitted changes, so the commit above does not fully identify what was read.

Advisory only, and a precision-first one (#9192): a page is listed because it names a
symbol, wire route or SDK method this diff touched — not because it mentions a changed
package. Each row says which anchor put it there, so a wrong row is reportable rather than
merely annoying. To re-verify, run the docs-accuracy-audit workflow scoped to these files:
node scripts/docs-audit/affected-docs.mjs e491fce2c70a67a92f2c40cb38e2f8b23af40ce4 → pass the list as
args.docs, on the commit named under Which tree this was computed on.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#2 · os-sales · session_01L6bhgV6i8jfWwSXjpWJrjA

Contract review

Served-tier: CONTRACT_REVIEW_TIER
Head-sha: 6760d275246a4239d5cff46b98a79ff9c0df53e1
Local-runs: none
Scope: packages/spec/src/api/export.zod.ts, packages/spec/src/system/validation-message.ts + packages/core/src/utils/import-coerce.ts, packages/core/src/utils/import-runner.ts, ui/packages/plugin-grid/src/ImportWizard.tsx

① Derived judgments

Read: 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 main (merge-base fbcfdfbb), and the check-runs on the head. 74 runs: 63 success, 11 skipped, none red, none pending. The two that were still running, PR-body guards and Check Changeset, were re-read and both ended in success. The PR author is objectstack-fleet[bot] and the PR is a draft. No record and no claim line named this head before this one.

  • packages/spec/src/api/export.zod.ts: one describe sentence on ImportRowResultSchema.errors. No accept-set moves. The regenerated references page changes at the three positions that embed the row result, and no authorable-surface file is in the diff. Right.
  • BUILTIN_VALIDATION_MESSAGES gains import_reference_scope_unqueryable in en, zh-CN, ja-JP and es-ES. Additive. Right.
  • @objectstack/core exported RefMatch gains one optional member, scopeUnqueryable. Additive. Right.
  • @object-ui/plugin-grid ImportResult.errors elements gain an optional scope, and the Wizard's default dictionary and all eleven UI locale packs gain grid.import.referenceOutOfScope and grid.import.scopeEntry. Additive. Right.
  • Behaviour: a scoped lookup none of whose candidate reads returned, and that the field-predicate guard did not refuse, now answers reference_not_found with the new sentence, runs no unscoped probe and carries no scope. Against main this moves the formula case from reference_out_of_scope back to reference_not_found. PR-1's changeset is still pending under .changeset/, so no released version answered the other code for it. Right for the declared case. The predicate is wider than the declared case: S1 in ④.
  • No removal, no tombstone, no rename, no requirement tightened. Nothing implies an ADR-0087 registry entry.
  • The new dogfood file has no CI verdict on this head yet. Dogfood Regression Gate is green at PR speed and its shards are skipped there, so the four pins first run in the merge group. Until then they rest on the dev's local reading.

② Semver level

  • The changeset bumps @objectstack/spec, @objectstack/core, @object-ui/plugin-grid and @object-ui/i18n patch. Metadata-protocol: none is right for this diff: the spec half is a describe sentence and a message-catalog key, and neither is something a metadata author writes. none takes patch. Check Changeset is green on both of its runs.
  • The claim amendment 7194794693 reads added. That line is about PR-1's scope key, which landed in feat(spec,core): a scoped import lookup miss whose value exists under another parent answers reference_out_of_scope #37567. This PR's file list moves no authorable-surface file.
  • Clause-②: yes (widening) and Metadata-protocol: none are line-initial in the PR body and in the changeset body. The arm is right: the public surface gains a catalog key a deployment can override and optional type members, and nothing leaves it.
  • The changeset body agrees with the tree sentence by sentence, with one exception. It says the new answer is given when "none of its scoped reads could run" and names the formula param as the reason. The code tests only the first half. That is S1.

③ Boundary flags

Dev 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 reference_not_found, and ruling A adds exactly one code. A second FieldErrorCode member is outside that ruling. The durable remedy is at the producer: lint refuses a dependsOn param that names a field the engine cannot filter by, judged with the spec predicate the resolver already uses. That is a narrowing and needs its own card, as the PR body says. This PR closes #36794 and names no such card, so the seat files or names one at ACCEPT (nit N2).

Dev flag 2: the two i18n census assertions. Honest updates. Neither gate is loosened.

  • de-quote-pairing-3876: both pins stay exact equalities and move 133 to 135. The German pack gains exactly two correctly paired spans, one in each new key.
  • untranslated-identity-4376: grid.import.scopeEntry is two placeholders and a pair of quotes with no word to translate, the same class as the grid.summary.pattern entry already listed. It is byte-identical to en in zh-Hans, zh-Hant and ko, so the file's own dead-entry assertion holds the entry live, and the reason text names those three packs correctly.

PR-1's nits. Nit 1 (the errors describe and the runner jsdoc) is closed in this diff. Nit 3 (a real engine and the real field guard) is answered by the dogfood file, subject to the CI note in ①. Nit 4 is a prose-face fix for the lane seat. Nit 2 is answered at runtime instead of by lint, with the reason given. The runtime answer is the right shape; its predicate is S1.

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.

Fixes #36794 is right: this is PR-2 of 2, and the card's Wizard acceptance is met by formatDryRunError's new case and its four unit pins.

④ Design judgment

packages/spec/src/api/export.zod.ts holds. The sentence agrees with ValidateDataIssueSchema.scope and with emission: referenceNotFound sets scope on the out-of-scope branch alone, from a non-empty list, and the runner copies it only when set. Its first consumer is the Wizard's firstCellScope, which reads element 0, the element the row's field, code and error name.

packages/spec/src/system/validation-message.ts holds for the case it names and not for every case the code sends it to. The key is in all four locales with the label, value and scope placeholders, and the jsdoc's composition claim agrees with referenceNotFound. The jsdoc and the sentence both state a cause: every read failed because the scope names a target field the engine cannot filter by. The implementing code does not establish that cause.

S1 (should-fix) — the new sentence states a cause the resolver never checked.

  • import-runner.ts sets scopeUnqueryable on scope && !asked && !match.scopeDenied. That is true whenever every scoped candidate read threw, whatever the reason.
  • One reachable case, by reading: an importing caller with no read grant on the lookup's target object. The security middleware answers every find on it with a permission denial whose details carry no field_predicate_denied reason, so isScopeFieldDenial is false and asked stays false. A read that fails on every candidate for any other reason takes the same path.
  • That cell then tells the importer that the lookup's target cannot be filtered by that column and that the field's dependsOn needs another one. The column is filterable. The scope can also be the inferred master, where the field declares no dependsOn at all.
  • On main the same cell answers the plain "no record matches" sentence, so this diff changes it. The code stays reference_not_found and nothing is disclosed. The defect is a false, misdirecting reason, the class of claim this PR removes for the formula case.
  • Fix, either one. Match the refusal positively, as isScopeFieldDenial does: both filter doors declare code: 'INVALID_FIELD' and fields on the refusal, so set the flag only when a refused read names a scope key there, and let every other all-failed lookup keep the plain sentence. Or keep the !asked test and remove the cause and the remedy from the sentence in all four locales, the jsdoc, the RefMatch comment and the docs line. The first keeps the useful remedy.
  • A pin belongs with it: a scoped lookup whose every read is refused for another reason answers the plain sentence.

packages/core/src/utils/import-coerce.ts agrees with the contract. The scopeUnqueryable branch returns before the probe, keeps reference_not_found, selects the new key and sets no scope. The single-value and multi-value branches both hand in the scoped match. The RefMatch.scopeUnqueryable comment infers the cause from the failure; that is S1.

packages/core/src/utils/import-runner.ts agrees except for S1. asked is set only after a read returns, the flag is never set on an unscoped lookup or over a field-guard refusal, and the verdict is not cached, like every other miss.

ui/packages/plugin-grid/src/ImportWizard.tsx agrees. The new case keys on the code and the structured scope and never reads the server sentence. With no scope it falls through to the server's sentence, the path an unknown code takes. The dry run, the synchronous import mapping, the job mapping and the completion screen all carry scope, so the two screens read alike.

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.

  • N1: the sentence's remedy is ambiguous. "That column" reads as the row's column the scope placeholder names by label, and "needs another one" reads as another row column. What has to change is the target field param names, as the docs line says. With a two-column scope "that column" names neither.
  • N2: no card is named for the lint half of PR-1's nit 2 (dev flag 1 above). Follow-up card at ACCEPT.
  • N3: the Wizard joins several scope entries with a hard-coded ASCII comma, inside text that is otherwise localized in eleven packs. The server's qualifier does the same on purpose; the Wizard's own text need not.

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: claude/project-thread-zt8cu4
Reviewed-by: session_01L6bhgV6i8jfWwSXjpWJrjA

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
@github-actions github-actions Bot added size/l and removed size/m labels Nov 26, 2026
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#2 · os-sales · session_01L6bhgV6i8jfWwSXjpWJrjA

Contract review

Served-tier: CONTRACT_REVIEW_TIER
Head-sha: f9dcf30afd057a20a385c8c093262761fc9d3f3b
Local-runs: none
Scope: packages/spec/src/api/export.zod.ts, packages/spec/src/system/validation-message.ts + packages/core/src/utils/import-coerce.ts, packages/core/src/utils/import-runner.ts, ui/packages/plugin-grid/src/ImportWizard.tsx

Delta review, round 2, from 6760d275246a4239d5cff46b98a79ff9c0df53e1 (record 7204641031: PASS, should-fix S1, nits N1 to N3) to this head.

① Derived judgments

Read: 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 main (merge-base fbcfdfbb), and the check-runs on this head. 74 runs: 63 success, 11 skipped, none red, none pending. The PR author is objectstack-fleet[bot] and the PR is a draft. No record and no claim line named this head before this one.

  • packages/spec/src/system/validation-message.ts: the import_reference_scope_unqueryable sentence is reworded in en, zh-CN, ja-JP and es-ES, and its jsdoc with it. This PR adds the key, so no released version carried the earlier wording. No key is added or removed by the delta. Right.
  • packages/spec/src/api/export.zod.ts: not touched by the delta. Round 1's judgment stands.
  • RefMatch.scopeUnqueryable keeps its shape and takes a narrower meaning: it is set only when no candidate read answered and a read was refused with INVALID_FIELD naming a scope key. Against main the member is still additive. Right.
  • grid.import.scopeSeparator is a new key in the Wizard's default dictionary and in all eleven UI packs. Additive. Right.
  • Behaviour: a scoped lookup whose reads are all refused for any reason other than the two the resolver now reads off the refusal goes back to what main does with it. It is a plain miss, and a plain scoped miss is asked once more without the scope. Right; N4 in ④ is about how the prose words that.
  • No removal, no tombstone, no rename, no requirement tightened. No authorable-surface file is in the net diff.
  • The dogfood file still has no CI answer on this head. Its shards are skipped at PR speed and first run in the merge group. The formula pin now passes only if the real doors declare the code and the field list; by reading they do (④), and the dev reports four passed locally on this head.

② Semver level

  • The changeset still bumps @objectstack/spec, @objectstack/core, @object-ui/plugin-grid and @object-ui/i18n patch, and Check Changeset is green on both of its runs. Clause-②: yes (widening) and Metadata-protocol: none are still line-initial in the PR body and in the changeset, and still the right values: the delta adds one UI text key and rewords one catalog sentence.
  • The rewritten changeset paragraph agrees with the tree: the new sentence is given for an INVALID_FIELD refusal naming the scope field, and a lookup refused for lack of read access keeps the plain sentence.
  • One loose phrase, on the prose face, for the lane seat: it says every scoped read is refused naming that field. A read whose candidate field the target does not declare is refused naming the candidate instead, because the unknown-name answer comes first. The read by id always names the scope field, which is all the resolver needs.

③ Boundary flags

  • The seat's ruling on S1 (match the refusal positively, keep the remedy text) is implemented as ruled.
  • N1 and N3 ride with the S1 commit, as the seat had them. Both are judged in ④.
  • N2 is unchanged by this head: the lint card for a dependsOn param the engine cannot filter by is still owed at ACCEPT. The PR body names none yet.
  • Dev flags from round 1 stand as answered there. The census pins did not move in the delta, and need not: grid.import.scopeSeparator holds no run of Latin letters, so the identity census does not read it, and it holds no quote, so the German pairing count is unchanged.
  • Row access. The delta adds no read. The new test reads the refusal's code and fields and nothing else. Whether the new sentence is given depends on how the target field is declared, never on what a record holds, and the sentence is still composed from the row's own cells and labels.
  • SQL push-down. No finding. The delta materialises no id list and joins nothing in the application.

④ Design judgment

packages/spec/src/system/validation-message.ts holds. The sentence now states a cause the selecting code establishes, and its remedy names the right thing.

  • S1: closed. isScopeFilterRefusal reads the refusal's declared code and its fields (or details.fields), never its text. The resolver sets scopeUnqueryable only when no read answered, such a refusal was seen, and the field guard did not refuse.
    • The match is live. findData runs the ingress filter gate before the engine, and that gate sets code: 'INVALID_FIELD' and fields on all three of its answers: a name the object does not declare, a dotted path, and a virtual field. The engine's own filter seam sets the same pair on its two. fields holds the where keys as written, and the scope's keys are where keys. The import doors hand the runner the protocol in-process, so the refusal arrives with its properties.
    • At least one read names the scope field. id is always a candidate and always declared, so the read by id is refused for the scope field itself.
    • Other doors on the same read declare the same pair for a filter field: the internal-field guard, the credential guard, and the stored-metadata body and hash columns. Each refuses every filter over the named field, whoever asks, so "cannot be filtered on" is true there too. A param that names no field of the target gets the sentence as well, and it is true of that.
    • What does not match: a comparand the field's type cannot take answers INVALID_FILTER, a driver fault answers its own code, and a missing grant answers a permission denial. None of them is taken for the scope.
    • A mixed answer cannot mislead. The filter doors judge the declaration alone and run before the permission middleware, so with an unfilterable scope every read is refused there, and with a filterable one none is. If the mix did occur, the flag still needs a refusal that names a scope key, which is a fact about the field for every caller. A field-guard refusal ends the loop and wins. One answered read keeps the normal path.
    • Both pins asked for are in: every read refused PERMISSION_DENIED naming no field, and every read refused INVALID_FIELD naming a field outside the scope. Each answers the plain sentence. The fake refusals carry the same properties the real doors set.
  • N1: closed. All four locales now name the target field the dependsOn entry filters by and tell the author to point that entry at a stored field. The jsdoc says the remedy never names a row column. Residue, accepted: with two dependsOn entries the sentence does not say which one, and "stored" is loose for a field that is stored but withheld. The action it asks for is right in both cases.
  • N4, new, a nit. The jsdoc here says any other refusal "keeps the plain sentence", and the changeset and the docs line say the same. The tree keeps a plain miss, as the RefMatch comment says exactly, and referenceNotFound then asks without the scope as it does for any scoped miss. A refusal that has nothing to do with the scope refuses that second read too, so the plain sentence follows, as pinned. A refusal caused by the scope cell's value (INVALID_FILTER) leaves the second read free to answer, and that cell answers reference_out_of_scope. This is what main does today, and the claim is not false there: a value the field's type cannot take matches no record. It has no effect on correctness. Accepted deviation; the N2 card can carry one line on it, to skip the second read whenever no scoped read answered.

packages/spec/src/api/export.zod.ts is unchanged since round 1 and holds as judged there.

packages/core/src/utils/import-runner.ts agrees with the contract. The flag is read off declared properties, set only on a scoped lookup, never over a field-guard refusal, and never cached.

packages/core/src/utils/import-coerce.ts agrees. Only comments moved, and they now say what the runner does.

ui/packages/plugin-grid/src/ImportWizard.tsx agrees.

  • N3: closed. The entries are joined by t('grid.import.scopeSeparator'). The values are right for each pack and match the separators those packs already carry (partSeparator, nameSeparator): 、 in ja, zh-Hans and zh-Hant, ، in ar, , in the other seven. The Wizard falls back per key, so a host dictionary without the key gets the default. The pin uses a separator that is not a comma.

N2 stays a follow-up card at ACCEPT. N4 is an accepted deviation.

No must-fix. No should-fix.

Implemented-by: claude/project-thread-zt8cu4
Reviewed-by: session_01L6bhgV6i8jfWwSXjpWJrjA

VERDICT: PASS

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#2 · os-sales · session_01L6bhgV6i8jfWwSXjpWJrjA

席位核对 — ACCEPT · head f9dcf30 · card #36794 · area s2-data · 2026-11-26T23:22Z

L1 checklist

  • Shape and relation. l1-face.mjs --pr 37706 read 13 items and flagged none; 74 check-runs on this head, 63 success, 11 skipped, none red or pending. The dogfood shards skip at PR speed, so the real-engine formula pin first runs in the merge group; the dev reports it green locally and the reviewer confirmed by reading that the doors it relies on declare the matched code and fields.
  • Fixes #36794 is right (PR-2; PR-1 feat(spec,core): a scoped import lookup miss whose value exists under another parent answers reference_out_of_scope #37567 merged). An import value outside the row's lookup scope now reads reference_out_of_scope in the wizard in 11 locales; a scope the target cannot be filtered on answers its own sentence only when a filter door refuses naming the scope field (positive match on the declared INVALID_FIELD and fields), and every other refusal keeps the plain "no matching record". PR-1's nits 1, 3 and 4 are closed; nit 2 is answered at run time here, its lint half goes to the follow-up card.
  • Contract review. Record 7204641031 PASS with S1 open → delta 7205472092 on this head: PASS, S1, N1, N3 closed, no must-fix, no should-fix. N2 (lint on dependsOn.param) and N4 (skip the unscoped probe when no scoped read answered) go to follow-up card review follow-ups of PR #37706: lint a lookup dependsOn param that names a field its target cannot filter on; skip the unscoped probe when no scoped read answered #37717. Adopted. No row-access change: every read still runs as the importing caller.
  • Declarations. Clause-②: yes (widening) (a catalog key and optional type members); Metadata-protocol: none (export.zod.ts changes one describe sentence; no authorable-surface file); patch on four packages. True.
  • Governance. check-governed-merges.mjs: not governed. Tier S.

Tier: S. Landing: ready + auto-merge by this stroke.

@objectstack-fleet
objectstack-fleet Bot marked this pull request as ready for review November 26, 2026 23:23
@objectstack-fleet
objectstack-fleet Bot added this pull request to the merge queue Nov 26, 2026
Merged via the queue into main with commit ea1b70a Nov 26, 2026
75 checks passed
@objectstack-fleet
objectstack-fleet Bot deleted the claude/project-thread-zt8cu4 branch November 26, 2026 23:53
Nenzyz pushed a commit to Nenzyz/objectstack that referenced this pull request Dec 1, 2026
<!-- 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>
Nenzyz pushed a commit to Nenzyz/objectstack that referenced this pull request Dec 1, 2026
…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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation protocol:system size/l tests tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface

Projects

None yet

Development

Successfully merging this pull request may close these issues.

import: a scoped lookup miss whose value exists under another parent gets its own reason reference_out_of_scope, and the Import Wizard dry run says so

2 participants