Skip to content

closedStates: a person-facing sentence for the refusal the lock gives when it cannot judge a write (ADR-0162 D4, D8) #38518

Backlog

Description

@objectstack-fleet

repo:objectstack#5 · os-project-manager · session_01FEkQ5nGQtUA88SthJbYyRw

Filing gate: ③ seat-directed follow-up of #37768 slice C · Source: dev report 7252148728 (open question), seat answer in this project's seat thread (A for the slice as built, B filed here for the maintainer)
Related: #37768, PR #38516

维护者速读

  • 问什么:已关闭单据的锁在「判断不了」时(例如明细行用非 id 指定主单、读主单状态失败、批量写超过逐行上限)拒绝写入,这时给用户看的仍是开发者句子,里面带对象的 API 名。要不要给这种情况加一句给人看的话?
  • A 保持现状:和片 B 一样,只有开发者句子;这条路很少见,通常是应用作者写法造成的。零成本。
  • B 新增一句不透明的提示(不说「已关闭」,因为此时并不确定),四种语言,作为 userMessage;约 30 行加测试。这是 D8 之外对消息目录的一次扩充,需要你点头。
  • 推荐:B,作为本卡单独落地;本片(closedStates: the object key and the engine's enforcement of it, released together (ADR-0162 item 1) #37768 片 C)已按 A 落地,不受影响。

What happens

On the closed-state trunk (PR #38516, head 088d94cb95), every 409 RECORD_LOCKED the closed-state lock gives for a record, a line or a cascade is worded from the Operation Message Catalog (record_closed*, record_closed_delete_blocked*). One reason is not: cannot_judge (ADR-0162 D4's three cases the lock cannot judge: a master named by something other than an id, a state read that fails, a many-row write past the engine's per-row ceiling on a store with no line probe). That refusal sets no userMessage, so the wire's error carries the developer sentence, which names objects by API name. Re-check: git grep -n "cannot_judge" origin/claude/o5-data-approvals-trunk -- packages/objectql/src/closed-state-lock.ts (positive control on the same file: record_closed).

D8's family has no form for it, and none of the existing forms fits: the record is not known to be closed, so "is closed" would be false.

Options

Option What changes Effort
A — keep Nothing. The developer sentence stays on that path, as in slice B. 0
B — new opaque key record_closed_unjudged (no placeholders) in en, zh-CN, ja-JP, es-ES; set as userMessage on the cannot_judge refusal; a catalog test row and an engine test per case. ~30 lines + tests, S

Governing text: ADR-0162 D8 ("The sentence never carries a record id, an API name, or the state's value"), D4 (the three cases that cannot be judged are refused).

Four facets

  • Real business need: the path is reached by an app author's write shape (a line that names its master by a non-id value, a bulk write past the ceiling on a probe-less store) or a store failure; end users of such an app would read an API name. No app on main reaches it today (the key is unreleased).
  • Long-term soundness: B makes "no API name reaches a person" hold on every path of the lock, the contract D8 states; A leaves one documented exception.
  • Preventing AI mistakes: B is a loud, uniform refusal; A leaves a path where an AI-written app surfaces developer text to users without any signal.
  • Startup focus: B is a small widening of an existing catalog family, not a new capability; A costs nothing now.

Recommendation: B, because D8's rule then holds on every path; A is safe for slice C because nothing is built behind it.

Grade: area:data · Feature · reach: apps that declare closedStates and hit a cannot-judge case, none before release
Suggested-grade: p3 · rare, author-side path, not a defect of a released surface
Dedupe: searched record_closed_unjudged and cannot_judge sentence (all issues): no hit.

Activity

  1. added
    needs-user-decision
    on Nov 29, 2026
  2. objectstack-fleet commented on Nov 29, 2026

    @objectstack-fleet
    ContributorAuthor

    triage#1 · zhuangjianguo · session_01QsR2jRH2X4frz9bBiZHNk4

    Triage: decision card, stays in the inbox · area:data · domain:server (packages/objectql/src/closed-state-lock.ts and the Operation Message Catalog) · Feature · p3 (a fleet-sourced Feature; Suggested-grade: p3 confirmed) · size S for option B. Rationale: B widens a published message catalog, which the filing seat put to the maintainer. It stays needs-user-decision. Type and domain set at this touch.

  3. added
    domain:server
    on Nov 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:datadomain:serverneeds-user-decisionpriority:p3

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions