Repository navigation
docs(data-modeling): name what the lookup dependsOn formula check does not see on import - #38125
Merged
objectstack-fleet[bot] merged 1 commit intoNov 28, 2026
Conversation
…s not see on import The import-mappings page said an import meets the "could not be looked up within" sentence only on metadata stored before the authoring check. The check judges lookup, master_detail and user fields against the objects it can see: a tree or legacy reference field, which the import scopes by dependsOn too, and an os validate of a stack that does not hold both objects stay unjudged. The page now names those cases, and that the runtime publish gate refuses turning a target field into a formula. Claude-Session: https://claude.ai/code/session_017xRBcSAaBEfQpU2yJexSJ8 Co-authored-by: Claude <noreply@anthropic.com>
2 tasks
Contributor
Author
|
repo:objectstack#8 · sunhaolin · session_017xRBcSAaBEfQpU2yJexSJ8 L1: ACCEPT · head 席位核对
Landing — non-governed docs PR: the seat lands it through the ordinary queue. |
Contributor
Author
|
repo:objectstack#8 · sunhaolin · session_017xRBcSAaBEfQpU2yJexSJ8 Landing · 2026-11-28T03:26Z · head
State: ready for review + auto-merge (L1 ACCEPT 7233074530). |
objectstack-fleet
Bot
deleted the
claude/issue-37936-import-mappings-reach
branch
November 28, 2026 03:50
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Part of #37936
Clause-②: no
Metadata-protocol: none
维护者速读
What changes
content/docs/data-modeling/import-mappings.mdx, one paragraph. The sentence "so an import meets this sentence only on metadata stored before that check" overstated the authoring check that refuses adependsOnfilter key naming a formula of the target. It now says the check judges alookup,master_detailoruserfield against the objects it can see, and names the cases where an import still meets the could-not-be-looked-up sentence. Each case was measured againstorigin/mainat 6e06729 before it was named:treefield, or a legacyreferencefield. The lint resolves the referenced half only onPICKER_FIELD_TYPES = lookup, master_detail, user(packages/lint/src/validate-object-field-refs.ts:442, applied at:1002); the importer scopes bydependsOnon every type inIMPORT_REFERENCE_TYPES(packages/spec/src/data/field-value.zod.ts:154-155addstree,packages/spec/src/data/import-coercion.ts:44-47addsreference; read atpackages/core/src/utils/import-coerce.ts:1056-1061). Probe: the same task/project pair with the target field a formula gives onecomputed on readfinding forlookupandmaster_detail, zero fortreeandreference.os validateof a stack that does not hold both objects. The rule's graph is the validated stack alone (indexServedObjectGraph(stack),validate-object-field-refs.ts:683), the formula check readsgraph.get(against)?.fields(:1054), and only the stack's own objects are walked (:998). Probe: a lookup whose target is not in the stack gives zero findings; the control with the formula target in the stack gives one. The same holds for the owning side: a target field turned into a formula in a package validated without the owning object is never judged there.The card's third wording, "a target field changed from stored to formula after the owning object was published", was measured false for the runtime publish gate and is not named as a gap there. The gate's context is every object the environment serves, registry plus stored rows (
packages/metadata-protocol/src/protocol-authoring-gate.ts:527-552); its differential drops the written item from the baseline (packages/lint/src/runtime-gate.ts:968) and charges findings the candidate adds (addedFindings,:1344). Probe: writing the target object with the field now a formula, while the owning object sits in the context, is refused withobjects.pr_task.fields.project.dependsOn[0].param "acct_label" is a formula field of "pr_project", computed on read. The page says so in its last sentence. The case survives only on the CLI, as part of item 3.Tests
Docs-only. No test changed. The measurements above came from a throwaway vitest file in
packages/lint/src(deleted before commit, never pushed), run aspnpm --filter @objectstack/lint exec vitest run --maxWorkers=2 PROBE_FILEafter building the lint dependency closure; it printed:probe output (4 tests passed)
Acceptance notes
N2 is measured here, not changed (the card stays open). Readings, each against
origin/mainat 6e06729:dependsOn's describe (packages/spec/src/data/field.zod.ts:2657) declares candidate-query scoping "Forlookup/master_detail" and option gating forselect/multiselect/radio; it names neithertreenorusernorreference. The Studio field form offersdependsOnonly onlookup,master_detail,select,multiselect,radio,checkboxes(packages/spec/src/data/field.metadata-form.ts:327). Control: the schema itself does not gatedependsOnby type (field.zod.ts:2650), so atreefield carrying it parses.dependsOnonlookup,master_detail,user,tree(REFERENCE_VALUE_TYPES,field-value.zod.ts:154-155) andreference(import-coercion.ts:44-47), read atimport-coerce.ts:1056-1061. Atreewith noreferenceis not scoped (:1056,!meta?.reference).dependsOnonly onlookup,master_detail,user(validate-object-field-refs.ts:442,:1002). Its docblock says on any other type "those keys have no reader" (:436-441). Counter-reading: the console renderstreewith the lookup widget (ui/packages/fields/src/field-type-alias.ts:142,tree: 'field:lookup'), the widget that readsdependsOn. And atreefield'sreferencemay only name its own object (packages/spec/src/data/object.zod.ts:2018), so its target is always in the stack the lint sees.git grepoverexamples/,packages/platform-objects/,skills/:treefields at 3 source sites (examples/app-showcase/src/data/objects/field-zoo.object.ts:122,examples/app-showcase/src/ui/views/business-unit.view.ts:27,packages/platform-objects/src/identity/sys-business-unit.object.ts:55) plus one skill sample (skills/objectstack-data/rules/relationships.md:147);type: 'reference'at 0 sites. None of them carriesdependsOn: zero files hold both outside aCHANGELOG.mdand the skill page, whosedependsOnmention is the lookup paragraph at:106, not the tree sample. Control: the same grep findsdependsOnin 3 example object files (cascading-select,contact,invoice), all on lookup or option fields. Sibling repos (hotcrm, cloud) were not measured.The two options the card names, for the seat:
treeandreferenceto the types whosedependsOnreference half is judged). Cost: a narrowing of@objectstack/lint(Clause-② narrowing, minor), zero known producers broken by (d). It matches the console, which already readsdependsOnontree.referenceis not aFieldTypethe parse accepts, so it only matters for legacy stored rows the lint sees. Size XS.lookup/master_detail, maybeuser). Cost: an import behaviour change in@objectstack/core. Atreecell that is scoped today would resolve across the whole object, and the import would disagree with the console picker, which still filters atreebydependsOn. Also needs a spec describe decision onuser. Size S.Recommendation: A. It closes the lint gap without opening a new one between the import and the picker. The spec describe would then name
treebesidelookup/master_detail(prose that follows the ruling).Verification
Two-minute check: open
content/docs/data-modeling/import-mappings.mdxat the paragraph beginning "AdependsOnentry whoseparamnames a target field". It should list three cases (stored metadata,tree/legacyreference, anos validateof a stack without both objects) and end saying the runtime publish gate refuses turning such a target field into a formula.Read first: the one changed paragraph, lines 372-386.