Skip to content

fix(core): a scoped import lookup miss names the scoping column when the value exists outside the scope - #36735

Merged
objectstack-fleet[bot] merged 3 commits into
mainfrom
claude/issue-36159-import-lookup-out-of-scope-message
Nov 23, 2026
Merged

objectstack-fleet[bot] merged 3 commits into
mainfrom
claude/issue-36159-import-lookup-out-of-scope-message

Conversation

@objectstack-fleet

Copy link
Copy Markdown
Contributor

Fixes #36159
Clause-②: no
Metadata-protocol: none

维护者速读

  • 用户能看到什么变化:导入数据时,如果某个查找列的值只存在于另一个上级记录下(例如合同属于另一个客户),被拒的那一行提示现在会写明是按哪一列、哪个值限定的,例如「合同:未找到匹配“CTR-0006”的记录(客户 = "Acme")」;真的不存在的值,提示不变。
  • 为什么做:替用 CSV 批量导入订单、合同的用户解决;以前这种行只提示“找不到记录”,导入的人去搜却能搜到,误以为系统出错。
  • 出错会怎样:只改提示文字,拒绝与否和错误代码都不变;最坏是提示多一段或少一段说明,可以直接撤回本次合并。
  • 无。

What changes

packages/core/src/utils/import-coerce.ts. A lookup cell scoped by the row (the field's dependsOn column, or the master the target's master_detail field points at) used to answer every miss with import_reference_not_found: Contract: no record matches "CTR-0006", also when CTR-0006 exists under another account.

After a scoped miss, referenceNotFound asks the same resolveRef once more without the scope. When that finds a record (one or several), the scope is why nothing matched, and the message adds the scoping columns and the cells the row gave them:

Contract: no record matches "CTR-0006" (Account = "UI Probe X Co")

A value that matches nothing at all keeps the plain sentence. Single-value and multi-value cells use the same path.

Per the seat's routing in the claim (Ruling-ref:): the reason stays reference_not_found, the code stays import_reference_not_found, no new enum value, no new catalog key. The extra part is built in core from the column label, the cell and punctuation only. It reads the same under every locale the catalog sentence is rendered in, and nothing in packages/spec changes.

The exported signatures do not change. coerceFieldValue(raw, meta, ctx, scope) now calls an internal coerceCell, which also takes the scoping columns (ScopedBy, not exported). Only coerceRow knows those columns and passes them. An outside caller of coerceFieldValue with a scope gets the plain sentence, as before.

Mechanism assumptions, measured:

  • The probe runs as the importer. runImport's resolver sends every lookup through p.findData(findArgsBase(...)), which carries the import's own context. The probe is the same resolver with no scope, so it finds only records the importer can already read by the same value, and the message says nothing about the record it found. A runner test pins this: rows hidden from the caller produce the plain sentence, and every read runs with the caller's context.
  • packages/spec/src/system/validation-message.ts holds import_reference_not_found (line 164). That template is unchanged. The sentence is composed in core, so this needed no needs_decision.

Tests

The pins go into the existing harness import-runner-reference-master-scope.test.ts, as a new top-level describe, so they use that file's engine-like findData fake. This follows AGENTS.md (ruling record 6583487846: a new pin for a component that already has a shared harness file goes into that file). The dispatch had preferred a new file named for the card.

  • dependsOn-scoped cell naming another parent's record: reference_not_found, message task: no record matches "Design review" (Project = "Gemini").
  • master-scoped cell naming another master's detail, by name and by pasted id: same shape, naming Contract.
  • a value that matches no record anywhere: the plain no record matches sentence, for both scope routes.
  • multi-value cell: the out-of-scope token gets the qualified sentence, and a truly missing token gets the plain one.
  • the probe runs as the caller: a record the caller's reads cannot see stays unnamed, the unscoped probe read did happen, and every read ran with the caller's context.
Package runs

Targeted: pnpm --filter @objectstack/core exec vitest run --maxWorkers=2 src/utils/import-runner-reference-master-scope.test.ts src/utils/import-coerce.test.ts under os-verify-lock.sh:

 Test Files  2 passed (2)
      Tests  191 passed (191)
os-verify-lock: VERDICT command-exit 0

Full package: pnpm --filter @objectstack/core typecheck && pnpm --filter @objectstack/core test (typecheck includes check:test-typecheck over tsconfig.test.json, which compiles the test files):

check:test-typecheck: OK
 Test Files  156 passed (156)
      Tests  3712 passed (3712)
os-verify-lock: VERDICT command-exit 0
One ablation: the probe's verdict ignored

The test imports ./import-runner from source (no dist in the path), so no rebuild was needed. Run with node scripts/ablation-replace.mjs after the fix was committed. Anchor if (unscoped.id === undefined && !unscoped.ambiguous) return refusal; replaced by return refusal;. Anchor count went 1 to 0, blob 55535a7675d7 to c33835840466.

     × a dependsOn-scoped cell naming another parent's record ...
     × a master-scoped cell naming another master's detail, by name or by id ...
     × a multi-value cell: the token outside the scope is refused with the same sentence
 Test Files  1 failed (1)
      Tests  3 failed | 12 passed (15)
ablation-replace: ok restored: blob == HEAD (55535a7675d7) and `git diff HEAD` is empty

This is the expected direction. The plain-sentence pin and the caller-context pin stay green, because the ablation makes every miss read plain.

Gates at d1d8b71: 65 derived, 61 exit 0, 4 NOT MEASURED, 0 red

node scripts/pm/dispatch-gates.mjs --commands --repo objectstack-ai/objectstack derived 65 families from the merge base 3aa008d. Each one was run in turn, with its exit code recorded before any pipe. --ran verdict: "65 derived famil(ies) accounted for — 61 run, 4 NOT-MEASURED (4 DERIVED from a recorded exit 3)".

NOT MEASURED here, all four exit 3 PREREQUISITE NOT MET; CI's Lint & Repo Gates runs them on a full build:

  • check:dual-build-cjs-loads: needs every package's dist (pnpm build). Only core's closure was built.
  • check:lean-entry-closure: needs packages/objectql/dist, and objectql's own closure was not built.
  • node scripts/check-plugin-teardown-shape.mjs --self-test: needs an unshallowed clone for its pinned fixture commit.
  • check:type-check-debt: its closure build queued on the shared verify lock behind a sibling's dogfood run (exit 99, queue-timeout).

node scripts/pm/overlap-check.mjs --branch=HEAD: VERDICT clean exit 0 (origin/main merges cleanly, 0 open PR heads share a file).

Acceptance notes

  • The added part is locale-neutral by design (label, cell, =, quotes). A fully translated sentence, like the card's example "CTR-0006" belongs to another Account, would need a new catalog key in packages/spec, which is published surface. That is outside this dispatch and outside the seat's routing.
  • The probe adds one lookup per scoped miss. A scoped hit costs nothing extra. An unscoped verdict that is a hit is cached by the resolver, as before.
  • A caller who cannot read the scoping field on the target (the narrowing that came with the scope) also gets the qualified sentence when the unscoped lookup finds the record. That is true: the row's scope is why the cell did not resolve.

Verification

Two minutes: in the worktree, run pnpm --filter @objectstack/core exec vitest run --maxWorkers=2 src/utils/import-runner-reference-master-scope.test.ts. Expect 15 passed, including the five [#36159] cases.

Read first, by risk:

  1. packages/core/src/utils/import-coerce.ts, referenceNotFound: the probe and the message.
  2. packages/core/src/utils/import-coerce.ts, coerceRow's scope loop: where ScopedBy is built from the source column's label and raw cell.
  3. packages/core/src/utils/import-runner-reference-master-scope.test.ts, the new describe.

Generated by Claude Code

…the value exists outside the scope

Co-authored-by: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011y7As6FyXmJyGyHNKXUkV7
@github-actions github-actions Bot added size/m documentation Improvements or additions to documentation tests tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface labels Nov 23, 2026
@github-actions

github-actions Bot commented Nov 23, 2026 •

Copy link
Copy Markdown
Contributor

📓 Docs Drift Check

This PR changes 1 package(s): @objectstack/core, touching 7 documentable anchor(s).

5 hand-written doc(s) NAME something this change touched and may need an implementation-accuracy re-verification:

  • content/docs/api/error-catalog.mdx (via reference_not_found (literal, a string literal in coerceFieldValue; a string literal in referenceNotFound))
  • content/docs/data-modeling/fields.mdx (via reference_not_found (literal, a string literal in coerceFieldValue; a string literal in referenceNotFound))
  • content/docs/data-modeling/import-mappings.mdx (via reference_not_found (literal, a string literal in coerceFieldValue; a string literal in referenceNotFound))
  • content/docs/permissions/attachments-access.mdx (via reference_not_found (literal, a string literal in coerceFieldValue; a string literal in referenceNotFound))
  • content/docs/permissions/system-context.mdx (via reference_not_found (literal, a string literal in coerceFieldValue; a string literal in referenceNotFound))

⛔ 2 release-owned page(s) also name something this change touched. These are read-only:

  • content/docs/releases/v17/17-5.mdx (via reference_not_found (literal, a string literal in coerceFieldValue; a string literal in referenceNotFound))
  • content/docs/releases/v18/18-5.mdx (via reference_not_found (literal, a string literal in coerceFieldValue; a string literal in referenceNotFound))

content/docs/releases/ is RELEASE-OWNED (AGENTS.md "Documentation Guardrails"): release
notes are written centrally at release time, and a code PR that edits them is the exact PR
that guardrail exists to stop. They are still audited — read-only. If one of them is actually
wrong, file an issue or open a dedicated docs-only PR; do not edit it here.

What this run could not see
  • 1 name(s) were too generic to anchor anything (single lowercase words)
  • the SDK route bridge reached 68 of 251 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 — 41 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 0d727b70716ccf77fd63d0a0a2f0b17f7ab4d28a → packageMentionDocs.

Which tree this was computed on

This run read content/docs from 845b4dbde355091fbecff6cc1cd91033d7d1cf80 — the merge of head 3395e9a76f09c1c248995cf0faba50e7e4ae34dd into base 0d727b70716ccf77fd63d0a0a2f0b17f7ab4d28a, 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 845b4dbde355091fbecff6cc1cd91033d7d1cf80 && git checkout 845b4dbde355091fbecff6cc1cd91033d7d1cf80
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin 0d727b70716ccf77fd63d0a0a2f0b17f7ab4d28a 3395e9a76f09c1c248995cf0faba50e7e4ae34dd && git checkout -B drift-repro 0d727b70716ccf77fd63d0a0a2f0b17f7ab4d28a && git merge --no-ff 3395e9a76f09c1c248995cf0faba50e7e4ae34dd

node scripts/docs-audit/affected-docs.mjs --json 0d727b70716ccf77fd63d0a0a2f0b17f7ab4d28a

⚠️ 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 0d727b70716ccf77fd63d0a0a2f0b17f7ab4d28a → 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#7 · os-alice · session_011y7As6YDLR8TJVDpdXzJyV

维护者速读

  • 结论:通过(ACCEPT)。导入时查找字段因本行的上级范围而找不到记录时,错误提示现在会点出范围列,例如“合同:找不到 CTR-0006(客户 = Acme)”,不再让人误以为记录不存在。
  • 只改提示文字,错误代码不变;第二次查找以导入人自己的权限进行,看不到的记录不会被提及。无需你做任何事。

席位核对

Verdict: ACCEPT · head d1d8b71e5dfd19ffefb312a0ae9d56ce7ca410d2 · card #36159 · L2: not owed (no published schema, no governed path, Clause-②: no with no arm; the seat's message-only ruling keeps reason and code unchanged)

Reviewed against GitHub at this head (diff, card body, l1-face.mjs --pr 36735, pr-state.mjs), not against the report.

Checklist

  • Shape: open, draft, base main, first line Fixes #36159; no closing keyword binds another card. Fixes is right: Done-when is delivered (a row naming another parent's record names the scoping field; a truly missing value keeps no record matches).
  • Scope: 3 files (packages/core/src/utils/import-coerce.ts, the existing reference-master-scope harness, one patch changeset), all inside the card.
  • Changeset sentences read against the diff: the retry happens once, only after a scoped miss (referenceNotFound returns the plain refusal when there is no scope, no scopedBy, no resolver or no reference); the qualifier is built from the column label (falling back to the field name), the importer's cell and punctuation only; the single-value and multi-value paths both route through it; reference_not_found / import_reference_not_found are unchanged. All hold.
  • Caller context: the probe goes through the same ctx.resolveRef the scoped lookup uses (import-runner.ts, per-call cache keyed by scope), so it reads as the importing principal; the pin "a record that caller cannot read stays unnamed" asserts it. The message names only the importer's own scoping cell, never the found record.
  • Contract: the response text changes, no refusal set moves, so Clause-②: no is right under the seat's message-only ruling.
  • SQL push-down: no finding; one extra resolver read per scoped miss, memoised by the runner's ref cache.
  • Gates at this head: Lint & Repo Gates success, TypeScript Type Check success; all checks 57 success, 11 expected skip, 0 failed, 0 pending; mergeable_state clean.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#7 · os-alice · session_011y7As6FyXmJyGyHNKXUkV7

Landing · 2026-11-23T19:49Z · head 3395e9a76f · verdict: L1-a ACCEPT 7111357023 at d1d8b71e5d, no L2 owed (Clause-② no, message-only per the seat's ruling, no spec or governed path).

The head moved only by a merge of main (relay pr_update_branch, landing-k read K = 15 ≥ 15 before it). 3395e9a76f has parents d1d8b71e5d and 0d727b7071; the PR's own diff is unchanged at +168 / −10 over the same 3 files, so the ACCEPT's reading of the diff holds.

Probe Reading
check-governed-merges --pr 36735 NOT governed · 178 changed lines (+168 / −10) ≤ 3000
pr-state --pr 36735 57 success · 11 expected skip · 0 unexpected skip · 0 failed · 0 pending · mergeable_state clean
l1-face --pr 36735 CLEAN
narrowing leg the PR body and its one changeset (.changeset/36159-import-lookup-out-of-scope-message.md, added, patch) declare Clause-②: no with no (narrowing) arm; no ! in the title
landing-k --pr 36735 K = 1 < 15 after the merge

State change: ready for review, auto-merge armed. On MERGED, Fixes #36159 closes the card and pm:dispatched comes off. The Import Wizard follow-up waits on the maintainer's route decision, which the seat holds.

@objectstack-fleet
objectstack-fleet Bot marked this pull request as ready for review November 23, 2026 19:50
@objectstack-fleet
objectstack-fleet Bot added this pull request to the merge queue Nov 23, 2026
Merged via the queue into main with commit 81eae2b Nov 23, 2026
69 checks passed
@objectstack-fleet
objectstack-fleet Bot deleted the claude/issue-36159-import-lookup-out-of-scope-message branch November 23, 2026 20:31
Nenzyz pushed a commit to Nenzyz/objectstack that referenced this pull request Dec 1, 2026
… another parent answers reference_out_of_scope (objectstack-ai#37567)

<!-- claude-projects-attribution: {"github_login":"os-sales"} -->
_Requested by **Sales** · [project
thread](https://claude.ai/code/project/chan_01D5bWFY3rFzgJcytD5gD4Uu?thread=cmsg_01D5bWFY3rFzgJcytD5gD4UuDqyPrPQvkURDXnUDgkyFWB)_

Part of objectstack-ai#36794 (PR-1 of 2: the spec reason and the importer; the Import
Wizard text follows in PR-2 on the same branch once this one lands)

Clause-②: yes (widening)
Metadata-protocol: added (`ValidateDataIssueSchema.scope`, a new
optional key on the import cell error; the new `FieldErrorCode` value is
a wire code, no author-writable key)
Skills-docs: follow-up objectstack-ai#37590

## 维护者速读

-
导入时,查找列填了一个只在别的父记录下存在的记录(例如合同属于另一个客户),服务端现在单独报“不在本行的范围内”,并把限定它的列和单元格作为数据返回;真正不存在的值照旧报“找不到记录”。
- 这是导入查找报错专题的后半段:上一张已让报错文字带上限定列,这张让依赖错误码的界面(导入向导)也能分清两种情况。
- 只影响导入失败行的错误码和多出的一个可选字段,成功导入不受影响;按旧错误码筛“找不到”的客户端,在这种情况下会收到新码,可整张撤回。
- 无。

## What changes

- **`FieldErrorCode` gains `reference_out_of_scope`**
(`packages/spec/src/api/errors.zod.ts`, ADR-0114 D2 closed catalog),
beside `reference_not_found`. Ruled route A on the card.
- **Catalog sentence `import_reference_out_of_scope`** in all four
platform locales (`packages/spec/src/system/validation-message.ts`). The
English text is byte-identical to the sentence the scoped refusal
already shipped with (`Contract: no record matches "CTR-0006" (Account =
"Acme")`), now with `{{scope}}` as a parameter, so a deployment can
override it under `validation.field.import_reference_out_of_scope` and
the other three locales say it in their own word order.
- **`ValidateDataIssueSchema` gains an optional `scope: [{ field, value
}]`** (`packages/spec/src/api/protocol.zod.ts`), present only on an
import cell error whose code is `reference_out_of_scope`. This is the
thread's route decision, agreed by the seat at claim time: the card asks
the Wizard to name the scoping column and its cell while keying on the
code and never parsing server prose, and the row result carried no
structured column at all. Same `{ field, value }` naming the importer
already uses for the columns; additive, optional, Clause-② widening. The
contract review below judges it.
- **Core importer** (`packages/core/src/utils/import-coerce.ts`,
`import-runner.ts`): the objectstack-ai#36735 unscoped probe now answers the new
reason with the new message key and the `scope` entries; the runner
copies `scope` onto the row's `errors` element. A value nobody has keeps
`reference_not_found`.
- **A scoped read the field-predicate guard refused is never probed**
(`RefMatch.scopeDenied`, `isScopeFieldDenial`). A caller who cannot read
the scope field (a hidden `master_detail` field, or the `param` a
`dependsOn` entry names) has the scoped lookup refused, so its miss says
nothing about where the value lives. Before this PR the probe still ran
and the objectstack-ai#36735 sentence named the scope; with a code that now claims
"under another parent", that answer would be wrong for a record sitting
under the row's own parent. It keeps `reference_not_found` and the plain
sentence, which is what `content/docs/data-modeling/import-mappings.mdx`
already says for that caller. The guard is read off the error's declared
`details.reason === 'field_predicate_denied'` (the reason all four
field-predicate guards answer) naming a scope field, never its message.
- `packages/runtime/src/dispatcher-error-vocabulary.ts`: the new code's
`foreign-vocabulary` row (ADR-0112 D6), same wording as its three
siblings.
- Docs: `content/docs/api/error-catalog.mdx` field-code table and
`content/docs/data-modeling/import-mappings.mdx` scoped-lookup section.
Regenerated: `content/docs/references/api/{errors,export,protocol}.mdx`,
`packages/spec/authorable-surface/api.json`
(`api/ValidateDataIssue:scope`), the strictness-ledger count for `api/`
(537 → 538, the new nested object).
- Changeset: `@objectstack/spec` minor, `@objectstack/core` and
`@objectstack/runtime` patch. `Metadata-protocol: added`, not the
claim's `none`: `Check Changeset` reads the new
`api/ValidateDataIssue:scope` row in
`packages/spec/authorable-surface/api.json` as a key entered, and a kind
other than `none` grades the package that carries it at least `minor`.

## Tests

-
`packages/core/src/utils/import-runner-reference-master-scope.test.ts`:
the objectstack-ai#36159 describe now pins `reference_out_of_scope` for a `dependsOn`
scope and a master scope, by name and by pasted id, single and
multi-value, with `errors[0].scope` as data; a value nobody has keeps
`reference_not_found` with no `scope` key; the two objectstack-ai#33523 pins whose
value lives under another master move to the new code; a new pin: a
scope the field guard refuses answers `reference_not_found` and no
unscoped probe runs.
- `packages/rest/src/import-integration.test.ts`: a new top-level
describe drives the real `POST /data/:object/import` route on a real
engine and sqlite with a real `dependsOn` declaration: one row resolves,
one answers `reference_out_of_scope` with `scope: [{ field: 'project',
value: 'Gemini' }]`, one answers `reference_not_found` with no `scope`.
- `packages/spec/src/system/validation-message.test.ts`: every locale
interpolates `{{value}}` and `{{scope}}`; the English render is the
shipped sentence; the zh-CN render.
- Ablation: with `if (scopedMatch.scopeDenied) return refusal;`
commented out, the guard pin goes red (1 failed / 15 passed), restored
green.

<details><summary>Local readings (tree f4a201e + 2e8b0b9)</summary>

- `pnpm --filter @objectstack/spec test`: Test Files 900 passed (900),
Tests 28505 passed, 1 todo.
- `vitest run src/utils/import-runner-reference-master-scope.test.ts`
(core): 16 passed. `src/utils/import-coerce.test.ts`: passed.
- `vitest run src/import-integration.test.ts` (rest): 62 passed.
- `pnpm --filter @objectstack/spec check:generated`: 2 stale before
`--fix` (references docs, strictness ledger), both green after.
- `typecheck` spec, core, runtime: green; rest: one TS18048 in the new
pin, fixed in 2e8b0b9, `check:test-typecheck` OK.
- `node scripts/check-dispatcher-error-vocabulary.mjs`: exit 0.
- `node scripts/pm/overlap-check.mjs`: VERDICT clean exit 0 (main,
objectstack-ai#37422, objectstack-ai#37371).
- The `dispatch-gates.mjs --commands` derived list (118 commands) is
running; its reading goes on the PR when done.

</details>

## Acceptance notes

- **Narrowing question left to the contract review, as the card asks:**
a client matching `reason === 'reference_not_found'` to mean "the lookup
cell did not resolve" stops seeing the out-of-scope case under that
value. The schema only widens (a new enum member, a new optional key),
so this PR declares `Clause-②: yes (widening)`; whether the move of that
case is itself a narrowing for such a client is the L2's call.
- **Skill text made false, not fixed here (`Skills-docs: follow-up
owed`):** `skills/objectstack-data/rules/relationships.md:117` says
another master's detail answers `reference_not_found`. `skills/**` is
governed, and this PR's `Clause-②: yes` keeps it off the low-risk arm,
so the line here would make the whole PR Tier H; its follow-up card is
objectstack-ai#37590.
- Between this PR and PR-2 the Import Wizard meets a code it has no
`case` for, so `formatDryRunError` falls through to the server's own
sentence (already in the caller's locale, naming the scope) on both the
dry-run panel and the completion screen. PR-2 gives the code its own
Wizard key built from `scope`.

## Verification

Read first: `packages/core/src/utils/import-coerce.ts`
`referenceNotFound` (the new reason and the guard),
`packages/core/src/utils/import-runner.ts` the resolver's `catch`
(`isScopeFieldDenial`), `packages/spec/src/api/protocol.zod.ts`
`ValidateDataIssueSchema.scope`.

Two-minute check: `pnpm --filter @objectstack/rest exec vitest run
src/import-integration.test.ts -t "under another parent"` — one test,
green; row 2 answers `reference_out_of_scope` with its `scope`.

---
_Generated by [Claude
Code](https://claude.ai/code/session_01L6bhgWgMUXf5juNBhN6rLX)_

<!-- signed: repo:objectstack#2 · os-sales ·
session_01L6bhgWgMUXf5juNBhN6rLX -->

---------

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 size/m 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 lookup cell refused by the row's dependent scope says "no record matches", although the record exists under another parent

2 participants