Repository navigation
fix(core,spec): the blank and multi-value match-key import row refusals name fields by label and read in the caller's locale - #37126
Conversation
…ls read in the request language Claude-Session: https://claude.ai/code/session_01QSeKYmRepQK9DkZeU7F53D Co-authored-by: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QSeKYmRepQK9DkZeU7F53D Co-authored-by: Claude <noreply@anthropic.com>
📓 Docs Drift CheckThis PR changes 2 package(s): 34 hand-written doc(s) name something this change touched — list omitted above 15 rows. Re-derive on the tree named below: ⛔ 9 release-owned page(s) also affected — read-only, see AGENTS.md Documentation Guardrails. What this run could not see
Coarse fallback — 183 page(s) merely mention a changed package (the pre-#9192 predicate, kept for the deliberately-wide backstop): Which tree this was computed onThis run read A worktree cut from an older # while this PR is open — GitHub drops the merge commit once it closes
git fetch origin d5cd32d68b439d723fa4796753f1581c76705d88 && git checkout d5cd32d68b439d723fa4796753f1581c76705d88
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin 95734fef75e6abfe2ab68a5ffa588e9b4a387392 fce607bb2c6f1c56b153f24fe36617126ffa29f7 && git checkout -B drift-repro 95734fef75e6abfe2ab68a5ffa588e9b4a387392 && git merge --no-ff fce607bb2c6f1c56b153f24fe36617126ffa29f7
node scripts/docs-audit/affected-docs.mjs --json 95734fef75e6abfe2ab68a5ffa588e9b4a387392
|
|
repo:objectstack#4 · os-justin · session_01QSeKYmRepQK9DkZeU7F53D Final head for L1 and L2 · area a4-U · 2026-11-24T21:34Z
|
…alog sentence, not the door's refusal Claude-Session: https://claude.ai/code/session_01QSeKYmRepQK9DkZeU7F53D Co-authored-by: Claude <noreply@anthropic.com>
…s describe Claude-Session: https://claude.ai/code/session_01QSeKYmRepQK9DkZeU7F53D Co-authored-by: Claude <noreply@anthropic.com>
|
repo:objectstack#4 · os-justin · session_01QSeKYmRepQK9DkZeU7F53D Final head for L1 and L2 (after fix round 1) · area a4-U · 2026-11-24T23:23Z
|
|
repo:objectstack#4 · os-justin · session_01QSeKYpEsWWE9Y5YtSsDgqZ Contract reviewServed-tier: ① Derived judgments
② Semver level
③ Boundary flags
④ Design judgmentHeld against the code:
Findings: S1 (should-fix) — The rewritten S2 (should-fix) — The PR body calls these "the import runner's two remaining English row refusals". A third stands on the same code path, eight lines above the blank-key site: N1 (nit) — Neither helper passes N2 (nit) — N3 (nit) — The N4 (nit) — Test strength: Implemented-by: VERDICT: PASS |
|
repo:objectstack#4 · os-justin · session_01QSeKYpEsWWE9Y5YtSsDgqZ 席位核对 — REWORK · L1 · head
|
…port-row-refusals-language
… match-key row sentences get; pass field names to overrides Claude-Session: https://claude.ai/code/session_01QSeKYmRepQK9DkZeU7F53D Co-authored-by: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QSeKYmRepQK9DkZeU7F53D Co-authored-by: Claude <noreply@anthropic.com>
|
repo:objectstack#4 · os-justin · session_01QSeKYmRepQK9DkZeU7F53D Final head for delta L1 + L2 (round 2) · area a4-U · 2026-11-25T01:22Z
|
|
repo:objectstack#4 · os-justin · session_01QSeKYpEsWWE9Y5YtSsDgqZ Contract reviewServed-tier: Delta review of ① Derived judgments
② Semver level
③ Boundary flags
④ Design judgmentS1, each claim held against the code at this head:
S2: the PR body's sentence now reads "Two of the import runner's English row refusals", names Closing lines:
No must-fix, no should-fix. Noted, ungraded: the PR title ("…read in the request language") and the Acceptance note "Docs made true in this PR (fix round 1)" still carry the round-1 wording ("in the request language") for the multi-value row. The Reach paragraph and the round-2 section in the same body state the per-path truth, and no shipped file carries the old wording; worth one edit before the squash subject is taken from the title. Implemented-by: VERDICT: PASS |
|
repo:objectstack#4 · os-justin · session_01QSeKYpEsWWE9Y5YtSsDgqZ 席位核对 — ACCEPT · L1 · head
|
|
repo:objectstack#4 · os-justin · session_01QSeKYmRepQK9DkZeU7F53D Landing · area a4-U · 2026-11-25T01:58Z · head
State change: ready for review + auto-merge armed; the queue lands it. On MERGED the card #37025 closes through |
Fixes #37025
Clause-②: no
Metadata-protocol: none
维护者速读
What changes
Reach (narrower than the card states; the defect stands): the console import wizard cannot trigger either refusal. It sends one flat key set, and it keeps multi-value fields out of its match-key picker. Two kinds of caller do receive them: a REST caller that sends ordered key sets (
POST /data/:object/importwithmatchFields: string[][]) gets the blank-key row, and callers that hand rows to the runner directly (connector and datasource pulls) get the multi-value row. For those callers the rows were English sentences naming API fields. They now name fields by label and read in the caller's locale when the caller carries one, English otherwise. The REST endpoint passes the request locale and the deployment's translator, so the blank-key row reads in the request language and takes a deployment override. The pulls pass no locale and no translator, so the multi-value row reads in English there, and its override is not consulted.Two of the import runner's English row refusals, the blank-key row and the multi-value-key row, now render through the same mechanism the duplicate-match-key row uses:
renderValidationMessagewith the caller's locale (context.locale) and the caller's override hook (translate), naming fields by LABEL (the API name only for a field with no label). They are not the last English row refusal:AMBIGUOUS_MATCH(import-runner.ts~1655) is still English, namesmatchFieldsand the object's API name, and is reachable from the wizard. It is carried by #37157.packages/spec/src/system/validation-message.ts: two new rows inBUILTIN_VALIDATION_MESSAGES, in all four locales the table carries (en,zh-CN,ja-JP,es-ES), plus a docblock paragraph beside theimport_duplicate_match_keyone:import_blank_match_key: a row blank on every ordered key set (BLANK_MATCH_KEY).{{label}}is the key sets by label, a set's fields joined with+, the sets with;. The English sentence drops the API parameter namematchFields; otherwise it keeps its wording.import_multi_value_match_key: a run whose match key names a field holding a list or a structured value (VALIDATION_ERROR, every row failed, for a caller that reaches the runner without the import door).{{label}}is those fields by label, joined with,. The sentence is phrased so it reads for one field or several.packages/core/src/utils/import-runner.ts:blankMatchKeyMessageandmultiValueMatchKeyMessagebesideduplicateMatchKeyMessage, sharing onefieldLabelhelper; the two failed rows use them. Codes are unchanged (BLANK_MATCH_KEY,VALIDATION_ERROR), the multi-value row'sfieldkeeps the API name, and the row shape is unchanged.multiValueMatchKeyRefusalitself is untouched: the import door's400 INVALID_REQUESTrequest refusal still uses itsmessage(namingkeyedBy, API names and types); only the runner's row sentence moved to the catalog. Its docblock now says so.ui/packages/plugin-grid/src/ImportWizard.tsx): not changed. The wizard renders a row'serroras the server sent it, and it cannot produce either refusal (see Acceptance notes).Keys chosen:
import_blank_match_key,import_multi_value_match_key, afterimport_duplicate_match_keyand the otherimport_*row-report keys.Tests
packages/core/src/utils/import-runner-duplicate-match-key-36980.test.ts(shared harness, new top-leveldescribe): in zh-CN a row blank on every key set reads the zh-CNimport_blank_match_keyentry naming邮箱; 电话 + company(a label-less field falls back to its API name), with noemailormatchFields, in Han script; in zh-CN a multi-value key fails every row with the zh-CNimport_multi_value_match_keyentry naming标签, notags,field: 'tags'kept;enand no locale read the English entries.packages/core/src/utils/import-runner-multi-value-match-key.test.tsasserted each failed row'serrorequals the door'smultiValueMatchKeyRefusal(...).message. It now asserts the catalog's Englishimport_multi_value_match_keysentence (the field has no label, so its API name), and that this sentence differs from the door's message, so the pin still fails if the runner falls back to the door text. Row, code, field and count assertions are unchanged.has no match key,structured value,single-value fieldsin test files).packages/rest/src/import-apply-on-match-key-sets.test.tsasserts theBLANK_MATCH_KEYcode only and passes unchanged.Acceptance notes
matchFieldsas one flat key set (assembleImportRequest), so a blank key there is theskippedBLANK_MATCH_KEYrow (no sentence) or a create, never the failed row; and its match-key picker excludes multi-value and structured fields (isMatchKeyField), while a named mapping'supsertKeyis filtered to strings by the import door, which also refuses a multi-value key with400 INVALID_REQUESTfirst. The blank-key sentence reaches a REST caller that sends ordered key sets (POST /data/:object/import,matchFields: string[][]) in a non-English locale. The multi-value row sentence reaches the runner-direct callers (connector pull, datasource pull), which run without a request locale and so read English, by label.packages/rest/src/import-prepare.ts(~606, theskipBlankMatchKeywith key sets refusal, and ~723, the door's multi-value refusal) are request-level400 INVALID_REQUESTsentences, not these row refusals, and are unchanged.packages/services/service-automation/src/connector-pull.tsrefuseBlankMatchKeysrewrites the runner's SKIPPEDBLANK_MATCH_KEYrow (which carries no sentence) with its own English sentence; it never sees the failed row's text and is unchanged. Those English request and pull sentences are noted here, not filed: they are API-caller and operator text, not the row report.content/docs/data-modeling/import-mappings.mdx(~307, hand-written) said a runner-direct caller's rows fail "with that refusal" (the door's). It now says every row fails with that code, and itserroris theimport_multi_value_match_keycatalog sentence, naming fields by label, in the caller's locale when the caller passes one and English otherwise (the connector and datasource pulls pass none, so it reads English there). The same false clause ("the same refusal instead") was in thematchFields.describe()inpackages/spec/src/api/export.zod.ts; it is corrected there, andcontent/docs/references/api/export.mdxis regenerated throughcheck:generated --fix, never hand-edited.Verification
Two-minute check:
pnpm --filter @objectstack/core exec vitest run --maxWorkers=2 src/utils/import-runner-duplicate-match-key-36980.test.ts. Expect 8 passed, including "zh-CN: a row blank on every key set is refused in zh-CN, naming each set by its labels".Local readings at ea69e29
@objectstack/core...(core and its dependencies, spec included) and@objectstack/rest^..., lock VERDICT command-exit 0 each.@objectstack/coreand@objectstack/spec, then@objectstack/spec check:generated: VERDICT command-exit 0; "All 14 generated artifacts are up to date".@objectstack/corevitest: Test Files 165 passed (165), Tests 3865 passed (3865).@objectstack/specsrc/system/vitest (includesvalidation-message.test.ts, every locale defines every key): Test Files 78 passed (78), Tests 2779 passed (2779). The rest of the spec suite is left to CITest Core, since the diff there is two catalog rows and a docblock.@objectstack/rest:import-apply-on-match-key-sets,import-multi-value-match-key,import-upsert-in-file-duplicate-key: Test Files 3 passed, Tests 34 passed.dispatch-gates.mjs --commands, 89 families): 84 exit 0, 5 exit 3 (PREREQUISITE NOT MET, so NOT MEASURED):check-plugin-teardown-shape --self-test(needs an unshallow clone),check:doc-formula-expressions(@objectstack/lintnot built),check:dual-build-cjs-loadsandcheck:lean-entry-closure(need a full workspace build),check:type-check-debt(lock queue-timeout).--ran: "89 derived famil(ies) accounted for — 84 run, 5 NOT-MEASURED (5 DERIVED from a recorded exit 3)".scripts/ablation-replace.mjs: the blank-key site restored to the old English template.import-runner-duplicate-match-key-36980: 2 failed / 8 (the zh-CN blank-key case and the en/no-locale case). Restore: blob after restore == HEAD (97306190b06d),git diff HEADempty.overlap-check --branch=claude/issue-37025-import-row-refusals-language: VERDICT clean exit 0.Fix round 1 readings at 4d99d24
@objectstack/specbuild, thencheck:generated: 1 of 14 stale (check:docs,content/docs/references/**) after the.describe()edit;check:generated --fixregenerated only that one (content/docs/references/api/export.mdx, 2 lines); re-run: "All 14 generated artifacts are up to date".dispatch-gates.mjs --commands, 114 families): 106 exit 0, 8 exit 3 (PREREQUISITE NOT MET, NOT MEASURED):check-plugin-teardown-shape --self-test,check:doc-formula-expressions,check:doc-security-posture,check:skill-examples,check:docs-transcript-drift,check:dual-build-cjs-loads,check:lean-entry-closure,check:type-check-debt.--ran: "114 derived famil(ies) accounted for — 106 run, 8 NOT-MEASURED (8 DERIVED from a recorded exit 3)".overlap-check: VERDICT clean exit 0.L2 owed: this PR edits non-test
packages/spec/src/**(two catalog keys in four locales and one docblock paragraph). No Zod shape, export, error code or authorable key changes.Fix round 2 (merge of origin/main, review S1, S2 and nits)
origin/mainmerged in (a9dcc75).packages/specmoved on main, so spec was rebuilt andcheck:generatedrun.matchFields.describe()(export.zod.ts), the regeneratedexport.mdx,import-mappings.mdx~307 and the changeset now say what each caller path gets: the catalog sentence by label, in the caller's locale when it carries one and English otherwise, with a deployment override only where the caller passes a translator. The REST blank-key path gets both; the pulls get neither.AMBIGUOUS_MATCHand its card, Import wizard: the AMBIGUOUS_MATCH row refusal is still an English sentence naming the matchFields parameter and the object API name #37157.field, so a deployment override can print{{field}}. No built-in sentence prints them.duplicateMatchKeyMessagedocblock is back above its function;fieldLabelhas its own line.import_*entries (enuses an em dash,es-ESa semicolon); zh-CN reads匹配键每个字段只比较一个值,而列表或结构化值没有单一的值可比较.validation.field.import_blank_match_key, filled with the labels and{{field}}.@objectstack/specbuild,check:generated1 of 14 stale (check:docs) after the describe edit,--fixregeneratedcontent/docs/references/api/export.mdxonly, re-run "All 14 generated artifacts are up to date". Typecheck core and spec: VERDICT command-exit 0. Full@objectstack/corevitest: Test Files 165 passed (165), Tests 3866 passed (3866).@objectstack/specsrc/system/andsrc/api/: Test Files 142 passed (142), Tests 4907 passed (4907).scripts/ablation-replace.mjs, each restored with blob == HEAD (0d7bfebcbb17) andgit diff HEADempty. Blank-key site back to the old English template: 3 failed / 9 in the 36980 harness (the zh-CN case, the en/no-locale case and the override case). Multi-value site back to the door'srefusedKey.message: 5 failed / 32 across the 36980 harness andimport-runner-multi-value-match-key.test.ts.check:doc-formula-expressions,check:doc-security-posture,check:skill-examples,check:docs-transcript-drift,check:dual-build-cjs-loads,check:lean-entry-closure.--ran: "114 derived famil(ies) accounted for — 108 run, 6 NOT-MEASURED (6 DERIVED from a recorded exit 3)".overlap-check: VERDICT clean exit 0.Generated by Claude Code