Skip to content

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 #36794

Description

@objectstack-fleet

repo:objectstack#7 · os-alice · session_011y7As6FyXmJyGyHNKXUkV7

Filing gate: maintainer ruling. The decision card on seat repo:objectstack#7 was answered 2026-11-23T21:15Z with option A, relayed by the seat. Source: the open question in os-dev report 7104848201 on #36159, raised under the seat's message-only ruling ("if the dev finds a real consumer that needs to tell the two apart, report it"). Follow-up to PR #36735 (merged 2026-11-23T20:31Z).
Dedupe: reference_out_of_scope found no open issue. formatDryRunError reference found no open card.

What happens today

With #36735 merged, a scoped import lookup miss whose value exists outside the row's scope is refused with a qualified message: Contract: no record matches "CTR-0006" (Account = "Acme"). The reason is still reference_not_found (packages/spec/src/api/errors.zod.ts:286), and the code is still import_reference_not_found.

The REST import door and the import report carry that qualifier. The Studio Import Wizard dry run does not. ui/packages/plugin-grid/src/ImportWizard.tsx formatDryRunError (case 'reference_not_found', around :582) builds its own localized text from the code alone (grid.import.referenceNotFound: No matching record for "{{value}}"). It drops the server message by design, because the wizard keys every message on the code. So a wizard user who names a record under another parent still reads "no matching record". That is the misreading #36159 was filed for.

Ruled route (A)

  1. Spec (o7-spec row): add the reason value reference_out_of_scope to the published reason enum, beside reference_not_found, with its catalog / validation-message key. The core import (packages/core/src/utils/import-coerce.ts, the referenceNotFound probe from fix(core): a scoped import lookup miss names the scoping column when the value exists outside the scope #36735) answers the out-of-scope case with the new reason. A value that matches nothing anywhere keeps reference_not_found. Clause-②: yes (widening) on @objectstack/spec. The Metadata-protocol value is for the spec lane to judge; the card expects none, because no authorable key moves. A contract review is owed at CONTRACT_REVIEW_TIER.
  2. Wizard (a follow-up PR in o7-studio, after 1 lands): formatDryRunError gets a case 'reference_out_of_scope' with its own localized key that names the scoping column and its cell, so the wizard keeps keying on the code and never parses server prose. Locale packs follow the repository's usual rule for a new user-text key.

Constraints

Acceptance

  • A row naming a record under another parent answers reason: 'reference_out_of_scope' on the REST import door and in the import report. A truly missing value still answers reference_not_found. Both are pinned.
  • The Import Wizard dry run shows the out-of-scope text for the new reason, with a component or unit pin. The plain "no matching record" text stays for reference_not_found.
  • Gates green; L1 and the contract-review L2 PASS on the final head of each PR.

Size: M. Area: data (spec part to the o7-spec row, wizard part to o7-studio). Grade: left to triage, p2 suggested (it completes #36159's user-visible fix in the wizard).

Activity

  1. objectstack-fleet commented on Nov 24, 2026

    @objectstack-fleet
    ContributorAuthor

    triage#1 · os-warren · session_01JQwxbZKP5YM48rWMWTS7wE

    Triage: lands in area:data · domain:spec · priority:p2 · Feature · pm:queue · size M. The card carried no labels, so area, grade, domain and state are added here. Type set to Feature.
    Rationale: the maintainer ruled route A on the seat's decision card. It adds a published reason value, reference_out_of_scope, and its wizard text, so the Import Wizard stops telling a user "no matching record" for a record that exists under another parent. The fix needs a new value on a published enum, so it is split off as a Feature rather than a Bug. Under North Star Priority rule 2, a Feature that improves UX and is sourced by the maintainer is p2. The spec PR lands first and the wizard PR follows, as the card orders.

  2. added
    domain:spec
    pm:queue
    priority:p2
    on Nov 24, 2026
  3. objectstack-fleet commented on Nov 26, 2026

    @objectstack-fleet
    ContributorAuthor

    repo:objectstack#2 · os-sales · session_01L6bhgV6i8jfWwSXjpWJrjA

    Claim: PM loop round 1 · 2026-11-26T13:10Z
    Session: session_01L6bhgV6i8jfWwSXjpWJrjA
    Thread session: session_01L6bhgWgMUXf5juNBhN6rLX
    Account: os-sales
    Branch: claude/project-thread-zt8cu4 (PR-1 spec; after PR-1 merges the same branch restarts from main for PR-2 Wizard)
    Worktree: objectstack-issue-36794
    Domain: domain:spec
    Seat: repo:objectstack#2
    Area: s2-data (card thread)
    File surface: PR-1 packages/spec/src/** (errors.zod.ts, validation-message.ts, protocol.zod.ts), the import coercion import-coerce.ts; PR-2 ImportWizard.tsx and the i18n locale packs; tests and one changeset per PR
    Container & model: M, mode:thread, model: default — dispatch-gates --tier: no path-derived mandate (floor sonnet · default opus · ceiling fable); thread served default, reported, effort: high
    Clause-②: yes (widening)
    Metadata-protocol: none (a wire error code, no author-writable key)
    Responsibility: objectstack platform (a scoped lookup miss whose value exists under another parent answers reference_not_found, and ImportWizard formatDryRunError :599 maps it to grid.import.referenceNotFound "no matching record") | none | admins importing rows into a scoped lookup; reachable today
    Thread-read: 7118224568
    Premise: holds (thread's read at origin/main 061e342: FieldErrorCode has no reference_out_of_scope, errors.zod.ts:286 only reference_not_found; import-coerce.ts referenceNotFound changes only the message)
    Serial constraints cleared: none at claim; overlap-check runs on the first local commit before the first push
    Route note: the card asks the Wizard to name the scoping column without parsing server text, and ValidateDataIssueSchema {field, code, message} carries no column. PR-1 adds an optional scope ([{field, value}], only on reference_out_of_scope) to the issue element in the same spec PR. This is a widening inside ruling A's surface, decided by the thread and listed in the PR body; PR-1 owes a CONTRACT_REVIEW_TIER L2 before the queue, which judges it.

  4. added
    pm:dispatched
    and removed
    pm:queue
    on Nov 26, 2026
  5. objectstack-fleet commented on Nov 26, 2026

    @objectstack-fleet
    ContributorAuthor

    repo:objectstack#2 · os-sales · session_01L6bhgV6i8jfWwSXjpWJrjA

    Claim amendment · 2026-11-26T14:24Z · claim 7192981274, on the thread's PR-1 report (PR #37567, head 15f65b7):
    Metadata-protocol: added
    The new optional ValidateDataIssueSchema.scope enters authorable-surface/api.json, and Check Changeset reads that key as added. @objectstack/spec therefore goes minor (core and runtime patch), and the PR body and changeset say the same. Clause-②: yes (widening) stands. The Skills-docs: follow-up for skills/objectstack-data/rules/relationships.md is filed as #37590. Every other line stands.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

area:datadomain:specpm:dispatchedpriority:p2

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions