Repository navigation
fix(core,spec): the AMBIGUOUS_MATCH import row refusal names the key by label and reads in the caller's locale - #37213
Conversation
…and the object by label and reads in the caller's locale Claude-Session: https://claude.ai/code/session_01QSeKYmRepQK9DkZeU7F53D Co-authored-by: Claude <noreply@anthropic.com>
…pins move into the shared harness Claude-Session: https://claude.ai/code/session_01QSeKYmRepQK9DkZeU7F53D Co-authored-by: Claude <noreply@anthropic.com>
…tence Claude-Session: https://claude.ai/code/session_01QSeKYmRepQK9DkZeU7F53D Co-authored-by: Claude <noreply@anthropic.com>
📓 Docs Drift CheckThis PR changes 2 package(s): 7 hand-written doc(s) NAME something this change touched and may need an implementation-accuracy re-verification:
⛔ 4 release-owned page(s) also name something this change touched. These are read-only:
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 55c95da0a55d5a625e46b84d10536521b1fe96db && git checkout 55c95da0a55d5a625e46b84d10536521b1fe96db
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin a33691e567aa21090e2cb567cedd9d47dba22165 584d821df4209559d62ba04c755701a8f44d71bf && git checkout -B drift-repro a33691e567aa21090e2cb567cedd9d47dba22165 && git merge --no-ff 584d821df4209559d62ba04c755701a8f44d71bf
node scripts/docs-audit/affected-docs.mjs --json a33691e567aa21090e2cb567cedd9d47dba22165
|
|
repo:objectstack#4 · os-justin · session_01QSeKYmRepQK9DkZeU7F53D Final head for L1 + L2 · area a4-U · 2026-11-25T04:27Z
|
|
repo:objectstack#4 · os-justin · session_01QSeKYpEsWWE9Y5YtSsDgqZ Contract reviewServed-tier: Full review of PR #37213 (card #37157) at its head: 3 commits, 4 files, +111/-1. Schema face: one hit, the catalog module under ① Derived judgments
② Semver level
③ Boundary flags
④ Design judgmentHeld against the ruling (7151513753, option B) and the code:
Findings: none graded. N1 — The changeset's second sentence reads "It names the key set the row was matched by its field labels": a "by" is lost ("matched by, by its field labels"). It becomes release-note text for two packages; the PR body's wording is right. N2 — 维护者速读 says the new text "用字段名称代替内部字段名和接口参数名". The old sentence carried the object's API name and N3 — N4 — Test strength: every case runs No must-fix, no should-fix. 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-25T04:35Z · head
State change: ready for review + auto-merge armed; the queue lands it. On MERGED the card #37157 closes through |
Fixes #37157
Clause-②: no
Metadata-protocol: none
维护者速读
What changes
The import runner's last English row refusal,
AMBIGUOUS_MATCH(a row whose match key finds more than one stored record), now renders through the mechanism its siblings use (#36980 and #37025):renderValidationMessagewith the caller's locale (context.locale) and override hook (translate).packages/spec/src/system/validation-message.ts: one newBUILTIN_VALIDATION_MESSAGESrow,import_ambiguous_match, in all four locales (en,zh-CN,ja-JP,es-ES), plus a docblock paragraph beside the sibling ones.{{label}}is the key set the row was matched by, by field LABEL joined with+, and{{field}}is the same names as API names. No sentence ends in a full stop; zh-CN uses the sibling punctuation. en:The match key (Email) matches more than one record, so the row was not written: match on fields whose values identify one record.packages/core/src/utils/import-runner.ts:ambiguousMatchMessage(keySet)besideblankMatchKeyMessage/multiValueMatchKeyMessage, sharingfieldLabel. TheAMBIGUOUS_MATCHrow uses it onmatchedKeySet. The codeAMBIGUOUS_MATCHand the row shape are unchanged.matchFieldsand the object's API name.POST /data/:object/importand the async import job) passes both the request locale and the deployment's translator, so the row reads in the request language and takes an override undervalidation.field.import_ambiguous_match. The connector and datasource pulls pass neither, so they read English and the override is not consulted.Tests
New top-level
describe[#37157] the ambiguous-match row refusal reads in the request languagein the shared harnesspackages/core/src/utils/import-runner-duplicate-match-key-36980.test.ts. A protocol double answers two records for every lookup. It has five cases:匹配键(邮箱)匹配到多条记录,因此该行未写入:请改用取值能唯一确定一条记录的字段匹配, row shape and code kept, nothing written;{{label}}and{{field}}.Acceptance notes
AMBIGUOUS_MATCHby code with the console's owngrid.import.matchAmbiguoustext (ui/packages/plugin-grid/src/ImportWizard.tsx~615,formatDryRunError, on both the dry-run panel and the completion screen). So the on-screen row list was never English. The server sentence reaches two places: the wizard's failed-rows CSV download (handleDownloadFailed, the_errorcolumn) and REST callers. Both now get the localized sentence. The wizard is not changed.ui/packages/plugin-grid/src/importDryRun.test.tsfeeds the old English sentence as an input fixture toformatDryRunError. It asserts the wizard's own text, so it is unaffected.content/docs/data-modeling/import-mappings.mdx(~269, ~305) and thematchFields.describe()describeAMBIGUOUS_MATCHby code and meaning and never state the sentence. They stay true and are unchanged.check:generatedreports nothing stale.Verification
Two-minute check:
pnpm --filter @objectstack/core exec vitest run --maxWorkers=2 src/utils/import-runner-duplicate-match-key-36980.test.ts. Expect 14 passed, including "zh-CN: the sentence is the zh-CN catalog entry, naming the key by its label".Local readings at 584d821
@objectstack/core...(core and its dependency closure, spec included): lock VERDICT command-exit 0.@objectstack/corevitest: Test Files 165 passed (165), Tests 3871 passed (3871).@objectstack/coreand@objectstack/spec: VERDICT command-exit 0.@objectstack/specsrc/system/vitest (every locale defines every key): Test Files 78 passed (78), Tests 2779 passed (2779).@objectstack/spec check:generated: "All 14 generated artifacts are up to date".scripts/ablation-replace.mjs: the row put back to the old English template (anchor 1 to 0, blob db4f26baa550 to d67f32257c80), harness 5 failed / 14 (all five Import wizard: the AMBIGUOUS_MATCH row refusal is still an English sentence naming the matchFields parameter and the object API name #37157 cases). Restore: blob == HEAD (db4f26baa550),git diff HEADempty.dispatch-gates.mjs --commands, 89 families): 86 exit 0, 3 exit 3 (PREREQUISITE NOT MET, so NOT MEASURED:check:doc-formula-expressions, because@objectstack/formulais not built;check:dual-build-cjs-loadsandcheck:lean-entry-closure, which need a full workspace build).--ran: "89 derived famil(ies) accounted for — 86 run, 3 NOT-MEASURED (3 DERIVED from a recorded exit 3)".check-nul-bytes: OK.overlap-check --branch=origin/claude/issue-37157-ambiguous-match-row-language: VERDICT clean exit 0.L2 owed: this PR edits non-test
packages/spec/src/**(one catalog key in four locales and one docblock paragraph). It changes no Zod shape, export, error code or authorable key.Responsibility: the platform's own
@objectstack/coreimport runner | the validation-message catalog its siblings already use, not reached by this row | non-English users importing in update or upsert mode whose row matches two records, from the console import wizard.Generated by Claude Code