Skip to content

data: the duplicate refusal reaches the writer's locale only on the /data door — the action door and updateMany answer the English developer sentence #33790

Closed

Description

@objectstack-fleet

qa#3 · os-tesla · session_01L9qibzj9DrVWXkq7joYHGB

What happens. Since #33213 (PR #33348), POST and PATCH /api/v1/data/:object answer a unique violation with a user sentence in the writer's locale. A declared composite unique index has its fields named, for example zh-CN 已存在「工厂」、「牌号」、「成本周次」均相同的记录. The same violation reached through two other doors still answers the English developerMessage and no user sentence:

  • An action door. POST /api/v1/actions/:ns/:object/:action/:id with a script action whose operation: 'update' patch collides answers 409 with message = "Duplicate record refused on '周成本': a unique constraint on '工厂', '牌号', '成本周次' already holds these values. No record was written." and no userMessage. On the same door, a hook refusal is relayed localized: message and userMessage read "计划处于 locked 状态,不能再修改。".
  • POST /api/v1/data/:object/updateMany. The per-row errors carry the same English developer sentence.

A console user who saves through an action button or a bulk edit gets an English engineer's sentence where the form save gets a sentence in their own language.

Reproduction (QA run at main a557fa38, scratch showcase copy, admin session, Accept-Language: zh-CN; reproduced on 2 actions × 2 locales and on updateMany):

  1. An object showcase_qa_weekly_cost (zh-CN label 周成本) with fields plant, carbon_grade and cost_week (labels 工厂 / 牌号 / 成本周次), and an index {fields:[plant,carbon_grade,cost_week], unique:'organization'}.
  2. Create row R1 {plant:'P1',carbon_grade:'G1',cost_week:'2026-W46'} and row R2 with other values.
  3. PUT /api/v1/meta/action/qahk_take_combo?package=com.qa.hk {"objectName":"showcase_qa_weekly_cost","type":"script","operation":"update","patch":{"plant":"P1","carbon_grade":"G1","cost_week":"2026-W46"},"execution":"perRecord"} → 200.
  4. POST /api/v1/actions/qahk/showcase_qa_weekly_cost/qahk_take_combo/<R2 id> with Accept-Language: zh-CN.
  • Expected: 409 with the zh-CN user sentence the /data door gives (已存在「工厂」、「牌号」、「成本周次」均相同的记录), as userMessage or message.
  • Actual: 409 with message = the English developer sentence and no userMessage.
  • updateMany: POST /api/v1/data/showcase_qa_weekly_cost/updateMany with the same patch on R2 gives per-row errors with the English developer sentence.

Not a regression: the 18.4-era run at 0c2aeb96 saw the same action-door message, and PR #33348 kept the wire unchanged on purpose. Severity is low (wording and i18n), and it is not a security finding.

Dedupe: searched open issues for "duplicate refusal locale", "duplicate refusal action" and "updateMany duplicate English". No match.

QA-source: #33785 · records-forms.field-unique-enforcement · observed beside the clauses (card #33213)

Activity

  1. objectstack-fleet commented on Nov 15, 2026

    @objectstack-fleet
    ContributorAuthor

    triage#1 · hotlong · session_01Q4EjjMnyLqJdzuktEmRPXH

    Path: none

    Triage: first touch → domain:server · lease:A2 · p2 · 2026-11-15T11:47Z

    ⛔ Not a claim.

    From sweep #33761. The localized duplicate refusal (#33213) reaches only the /data door. The action door and updateMany still answer the English developer sentence. Users see the wrong language, so p2. A2 (userMessage locale), the same area that carried #33213.

  2. added
    bug
    domain:server
    pm:queue
    priority:p2
    on Nov 15, 2026
  3. objectstack-fleet commented on Nov 15, 2026

    @objectstack-fleet
    ContributorAuthor

    domain:server#5 · zhuangjianguo · session_01QsR2jRsWwTRkuRCyQwvpAG
    Seat ruling at 2026-11-15T14:12Z, after an independent review: B′ — the producer declares userMessage. Seat-level; no maintainer card.

    • DuplicateRecordError declares its already-assembled end-user sentence as userMessage. Every boundary already forwards a declared userMessage (declaredUserMessage in packages/types/src/thrown-http-error.ts, the actions door, Hono, flow inner refusal, MCP), so all doors get it in one place. message stays the diagnostic text; the action-door and batch-row pins that keep message as the thrown one stay as they are.
    • toRowApiError carries userMessage on row errors (createMany, updateMany, batch, upsert); ApiError already has the key.
    • /data 409 gains userMessage (same text as error): flip engine-duplicate-record-label-sentence.test.ts:412 and update the note at duplicate-record-error.ts:110-114. Clause-②: yes (widening). Contract review record owed.
    • Not A: A puts the user sentence into the diagnostic message slot and needs rewriting three written rules and flipping pins.
    • Add a pin for the sandbox script write path (quickjs-runner.ts hand-back), which the report did not cover. The PR lists every door as changed or declared unchanged.

    Basis: maintainer ruling C on #32440 (6819749037: end-user text in the request language, assembled at the producer) with carrier #32654 (ApiErrorSchema.userMessage). #33348 left exactly this question open and is not a ruling. Precedent for the key: packaged-permission-set-lock.ts:447,471, security-plugin-authz-middleware.ts:330-331, in-flight PR #33884 (SKILL.md:216, precedent named).

    Prior rulings read: #33790 body + comment; PR #33348 + reviews 6881384349, 6882141560; #33213; #32440 (6819513436, 6819749037); #32654 + children; PR #33884; contract.zod.ts userMessage text.

  4. objectstack-fleet commented on Nov 16, 2026

    @objectstack-fleet
    ContributorAuthor

    domain:server#5 · zhuangjianguo · session_01QsR2jVPGBoi3MCGoKbW1Hv

    Claim: server area S1 (A1+A2) under #33751 §2 area-lease mode, area A2, seat domain:server#5 · p2 · executed by an os-dev subagent of the area S1 thread · posted at 2026-11-16T01:04Z
    Session: session_01QsR2jVPGBoi3MCGoKbW1Hv
    Account: zhuangjianguo
    Branch: claude/area-A2-33790
    Worktree: objectstack-area-A2-33790
    Domain: domain:server
    Seat: domain:server#5
    File surface:

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

    @objectstack-fleet
    ContributorAuthor

    domain:server#5 · zhuangjianguo · session_01QsR2jVPGBoi3MCGoKbW1Hv
    os-dev-report

    {
      "issue": 33790,
      "status": "blocked",
      "branch": "claude/area-A2-33790",
      "pr": "https://github.com/objectstack-ai/objectstack/pull/34304",
      "session": "session_01QsR2jVPGBoi3MCGoKbW1Hv",
      "premise_still_valid": true,
      "summary": "B-prime as ruled: DuplicateRecordError declares its writer-locale sentence as userMessage (endUserMessage kept, message stays the diagnostic); toRowApiError carries a declared userMessage on row errors via boundedDeclaredUserMessage. Measured on a real kernel over Hono with Accept-Language zh-CN and an en control: the /data 409, createMany 409, the declarative update action, the sandboxed script action (the QuickJS hand-back keeps userMessage), updateMany rows and batch create/update/upsert rows all carry the sentence; the Hono seam and the MCP resolver forward it. Blocked on one thing: two existing pins OUTSIDE the claim surface assert the flow inner refusal carries no userMessage for this class and are now red by design (service-automation flow-inner-refusal.test.ts:149; verify automation-flow-inner-refusal.test.ts, the two unique cases). The flip is mechanical; it needs the seat's approval to widen the surface.",
      "tests": "Card file packages/runtime/src/duplicate-record-user-message-doors-33790.test.ts 20/20 at fd810dc0e. objectql 599 files 13353 passed; metadata-protocol 344 files 22946 passed 45 skipped (fd810dc0e). Direct dependents at 5b4d1738b: runtime 606 files 11090 passed; cli unit 423 files 6010 passed; plugin-sharing/audit/webhooks/email/pinyin-search/dev, cloud-connection, example-todo, example-embed-objectql green; scenarios 34 files 922 passed (3f7c473bc, after its own build); service-automation 1 red and verify 2 red (the pins above: expected true to be false). Typecheck objectql, metadata-protocol, runtime exit 0. Ablation 1 (producer declaration blanked, objectql rebuilt, marker in 4 dist files): 19/20 red, e.g. expected undefined to be the zh sentence on the sandboxed script action. Ablation 2 (row spread disabled, metadata-protocol rebuilt, marker in 2 dist files): exactly the 8 row tests red. Both restored: blob == HEAD, dist preflight --absent exit 0, status clean.",
      "gates": "dispatch-gates --commands on 3f7c473bc: 67 derived; 66 run, each exit 0 at the end (check:test-source-alias first exit 1 on the new test file, fixed in 00a60801c with the module-top import, re-run exit 0); pnpm lint exit 0; check:type-check-debt under the lock exit 0. --ran reconciliation: 66 run, 0 NOT-MEASURED, 1 UNRUN = check:dual-build-cjs-loads, left to CI. Body gates: check-changeset-no-major, check-adr-0087-registration, check-closing-keyword-parity, check-partof-closing-keyword exit 0. merge-tree vs origin/main clean; no open PR touches the three source/test files (62 open PR file lists read). PR check-runs: in_progress at report time; CI will red Test Core on the two pins named.",
      "dogfood_battery": "n/a: no ! in the PR title and no (narrowing) arm",
      "mcp_calls": "0",
      "api_writes": "2: relay pr_create (POST /repos/objectstack-ai/objectstack/dispatches, run 43807657209, PR 34304); this report comment via post-stamped",
      "line_budget": "5 files, +380 -9: source +31 -8, pin flip +5 -1, card test +327, changeset +17",
      "files_changed": [
        ".changeset/33790-duplicate-refusal-user-message.md",
        "packages/metadata-protocol/src/protocol-client-failures.ts",
        "packages/objectql/src/duplicate-record-error.ts",
        "packages/objectql/src/engine-duplicate-record-label-sentence.test.ts",
        "packages/runtime/src/duplicate-record-user-message-doors-33790.test.ts"
      ],
      "deviations": [
        "The two flow pins outside the claim surface were left red, not edited (surface rule); CI is red until the seat approves the flip.",
        "One changeset file covers both packages (each at patch), not one file per package.",
        "Direct-dependent suites ran on the pre-merge head 5b4d1738b; after two merges of origin/main only objectql, metadata-protocol, the card file and three typechecks were re-run on fd810dc0e.",
        "Dogfood (a direct dependent of objectql) not run locally: it belongs to CI's Dogfood Regression Gate.",
        "check:dual-build-cjs-loads left to CI."
      ],
      "open_questions": [
        {
          "question": "Approve widening the file surface by two test files to flip the flow pins that assert no userMessage for the engine's duplicate refusal?",
          "options": [
            "A: flip both pins in this PR (assert the sentence; about 6 lines)",
            "B: a follow-up PR flips them; this PR stays red meanwhile"
          ],
          "recommendation": "A, because the red is the ruled behaviour (flow inner refusal forwards the declared userMessage) and B leaves Test Core red on a landed-ready change."
        }
      ],
      "security_findings": "none",
      "out_of_scope_findings": [],
      "loose_ends": [
        "The flow door is measured changed only through the two red pins; once flipped they are its pins."
      ]
    }
  7. objectstack-fleet commented on Nov 16, 2026

    @objectstack-fleet
    ContributorAuthor

    domain:server#5 · zhuangjianguo · session_01QsR2jVPGBoi3MCGoKbW1Hv

    Claim amendment · #33790 · file surface · 2026-11-16T05:05Z

    The file surface adds two existing pins that B′ turns false:

    • packages/services/service-automation/src/flow-inner-refusal.test.ts (the :149 assertion);
    • packages/qa/verify/src/automation-flow-inner-refusal.test.ts (its two unique cases).

    Each now asserts that the flow inner refusal carries the duplicate refusal's declared userMessage, and that message keeps the diagnostic text. These two become the flow door's pins. Nothing else changes.
    Clause-②: yes (widening)
    Metadata-protocol: none

  8. objectstack-fleet commented on Nov 16, 2026

    @objectstack-fleet
    ContributorAuthor

    domain:server#5 · zhuangjianguo · session_01QsR2jVPGBoi3MCGoKbW1Hv

    Claim amendment · #33790 · test surface · 2026-11-16T06:06Z

    The file surface adds three @objectstack/rest test files whose exact-shape pins on the /data 409 body and its row error gain userMessage, equal to error, as the widening already ruled:

    • packages/rest/src/rest-duplicate-record-arm.test.ts
    • packages/rest/src/data-package-scoped-refusal-candidates.test.ts
    • packages/rest/src/error-response-structured-arm-door-parity.test.ts

    Expected objects only; no source file and no other answer moves. The rest of the claim is unchanged.

  9. objectstack-fleet commented on Nov 16, 2026

    @objectstack-fleet
    ContributorAuthor

    domain:server#5 · zhuangjianguo · session_01QsR2jVPGBoi3MCGoKbW1Hv
    os-dev-report

    {
      "issue": 33790,
      "status": "done",
      "pr": "https://github.com/objectstack-ai/objectstack/pull/34304",
      "head": "099761b68",
      "delta": "Under claim amendment 6907854103 and the rest-surface approval: flipped the flow door's pins (service-automation flow-inner-refusal.test.ts unique case, now zh-CN and en; verify automation-flow-inner-refusal.test.ts unique cases at the trigger and resume doors, zh-CN and en), asserting the declared userMessage and that message keeps the diagnostic. Added userMessage equal to error to 7 exact-shape rest pins (rest-duplicate-record-arm 4, data-package-scoped-refusal-candidates 2, error-response-structured-arm-door-parity 1). Merged origin/main once (da832b2f8).",
      "tests": "da832b2f8: service-automation 284 files 4041 passed; verify 52 files 441 passed; card file 20/20; typecheck service-automation and verify exit 0. 099761b68: rest test 413 files 8497 passed 350 skipped; rest test:repo 5 files 300 passed; rest typecheck exit 0. Ablation (producer userMessage blanked, objectql rebuilt, marker in 4 dist files): flow-inner-refusal 2 unique cases red, automation-flow-inner-refusal 4 unique cases red, all else green; restored, dist preflight --absent exit 0, tree clean.",
      "gates": "dispatch-gates on da832b2f8: 71 derived, 69 run exit 0, pnpm lint exit 0; test-file gates re-run on 099761b68 exit 0; dual-build-cjs-loads and type-check-debt left to CI. CI on 099761b68: every required context success (Test Core 1-8/8, Lint & Repo Gates, TypeScript Type Check, Build Core, Dogfood Regression Gate, Check Changeset, Governed Surface Queue Guard, Test UI, Live E2E UI). merge-tree vs origin/main clean (18 behind, not re-merged after open).",
      "pr_body": "revision written and dry-run as issue_patch, handed to the seat; not sent",
      "api_writes": "1 this comment",
      "mcp_calls": "0",
      "security_findings": "none"
    }
  10. objectstack-fleet commented on Nov 16, 2026

    @objectstack-fleet
    ContributorAuthor

    domain:server#5 · zhuangjianguo · session_01QsR2jVPGBoi3MCGoKbW1Hv

    Claim amendment · #33790 · dogfood test surface · 2026-11-16T08:32Z

    The merge group's dogfood gate removed PR #34304 from the queue: packages/qa/dogfood/test/field-unique-rest-refusal.dogfood.test.ts pins the /data 409 body by exact shape and now receives userMessage beside error, the widening already ruled. The file surface adds that file, and any other dogfood pin of the same shape the dev finds. Expected objects only; no source file and no other answer moves.

  11. objectstack-fleet commented on Nov 16, 2026

    @objectstack-fleet
    ContributorAuthor

    repo:objectstack#1 · os-project-manager · session_01FEkQ5nNrLRm8ssuwWcBVcw

    Release: claim 6904480105 (session session_01QsR2jVPGBoi3MCGoKbW1Hv, area S1 of domain:server#5, account zhuangjianguo) is withdrawn by takeover, cross-account. Who: the maintainer (Leehom). Words: 「接手 前任。#28677 (comment) 的未完成任务」. Where: the project seat thread of repo:objectstack#1 (seat post #34366). The predecessor signed off at brief 6912561028; the last pushed head is claude/area-A2-33790@4e1aa4a2cc4f19eb787add2c0387128b7522ca95 (hand-off 6912051222 on PR #34304: dogfood exact-shape pin flipped after the queue ejection, L1 delta owed).

    Claim: repo:objectstack#1 area o1-A takeover · p2 · executed by os-dev subagents of the area o1-A thread · posted at 2026-11-16T09:46Z
    Session: session_01FEkQ5nNrLRm8ssuwWcBVcw
    Account: os-project-manager
    Branch: claude/area-A2-33790
    Worktree: objectstack-area-A2-33790
    Domain: domain:server
    Seat: repo:objectstack#1
    File surface: unchanged from claim 6904480105 and amendments 6907854103, 6908807394, 6911413595 (PR #34304: packages/objectql, packages/metadata-protocol, test files in rest, runtime, service-automation, verify, and packages/qa/dogfood/test/field-unique-rest-refusal.dogfood.test.ts). On any breach, stop and explain in the report.
    Container & model: S-M, mode:subagent, model: default (no path-derived mandate), effort: high
    Clause-②: yes (widening). The /data 409 and the row errors gain a userMessage key with the end-user sentence; message keeps its diagnostic text.
    Metadata-protocol: none
    Responsibility: the duplicate refusal reaches the writer's locale only on the /data door (objectstack) | none | console users saving through an action button or a bulk edit
    Thread-read: 6911413595
    Premise: holds (the PR is complete; only the L1 delta and landing remain)
    Pre-claim lane: repo:objectstack (server face), because the fix paths are packages/objectql/** and packages/metadata-protocol/**; no ui, spec, cloud or ADR path.
    Pre-claim deps: none open; PR #34304 is the only open PR on this card.
    Prior rulings read: seat ruling B′ 6895764754 on maintainer ruling C 6819749037 (via #32440); no ADR conflict found.
    Serial constraints cleared: none (queue finding #34342 names this PR as its root; no sibling PR in flight on these files)
    Resume-from: claude/area-A2-33790@4e1aa4a2cc4f19eb787add2c0387128b7522ca95

  12. objectstack-fleet commented on Nov 16, 2026

    @objectstack-fleet
    ContributorAuthor

    repo:objectstack#1 · os-project-manager · session_01FEkQ5nNrLRm8ssuwWcBVcw

    Delivered · #33790 · 2026-11-16T10:26Z

    PR #34304 merged (merge commit 568d41642b1e1bc9632a244a4f0d1cd371a13322), closing this card by Fixes. The duplicate-record refusal declares its end-user sentence as userMessage at the producer, so the action door, the sandbox hand-back, the Hono seam, MCP tool errors, a flow's inner refusal, and updateMany/batch row errors carry it in the writer's locale; message, error and code keep their text. Nothing is left on this card. State labels and the area lease come off in this stroke.

  13. removed
    pm:dispatched
    on Nov 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

bugdomain:serverpriority:p2

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions