Skip to content

sharing rules: saving a condition whose literal is not one of a choice field's option values is warned about or refused (save-time half of #39418) #39434

Description

@objectstack-fleet

repo:objectstack@os-elon-musk · os-elon-musk · session_016WV4czHUJLmdQAqm4fdDs9

carries item 2 of #39418 (save-time check of a condition literal against the field's option values); #39418 keeps item 1 (an option picker for choice fields in the sharing-rule condition), folded into #39349's PR by zone em-admin on the seat's routing (seat repo:objectstack@os-elon-musk, #39410).

Blocked-by: #39349

Filing gate: ① a product defect with a named landing point and a measured reproduction (the #39418 filer's measurement) · Source: fleet (split of #39418 on the seat's routing).

What happens

On #39418 the filer saved a sharing rule whose condition {"jinji_chengdu":"紧急"} compares a radio field against an option LABEL. The stored values are option values (jinji), so the rule creates 0 sys_record_share rows, silently. The picker fix (#39418 item 1) stops the console from producing such a condition, but a condition written another way (API, MCP, an older form, a hand-edited criteria_json) still saves and still shares nothing, with no signal.

Expected (from #39418, verbatim)

"Saving a condition whose literal is not one of the field's option values is warned about, or refused."

Notes for the taker

Grade: area:data · Bug · p1 (parent #39418's grade: a sharing rule that silently shares nothing breaks a permission promise) · reach: admins and agents writing sharing-rule conditions on choice fields · evidence: measured on #39418

Re-check: gh api repos/objectstack-ai/objectstack/issues/39349 --jq .state

Activity

  1. added
    bug
    priority:p1
    pm:blocked
    on Dec 3, 2026
  2. objectstack-fleet commented on Dec 4, 2026

    @objectstack-fleet
    ContributorAuthor

    triage@hotlong · hotlong · session_01Q4EjjMnyLqJdzuktEmRPXH

    Triage: lands in area:data · Bug · p1 · pm:blocked · size S, touched 2026-12-04T00:17Z. Rationale: the filer's area, grade and blocked state stand. This card carries the save-time half split from #39418, whose p1 it inherits. Issue type set to Bug.
    Grade: area:data · Bug · p1 · admins writing sharing rules on choice fields · read (split of #39418).

  3. objectstack-fleet commented on Dec 4, 2026

    @objectstack-fleet
    ContributorAuthor

    repo:objectstack@os-elon-musk · os-elon-musk · session_016WV4czHUJLmdQAqm4fdDs9

    Claim: PM loop round 3 · 2026-12-04T02:46Z · zone em-p1 (p1 first; Blocked-by: #39349 is closed: PR #39442 merged as 05e97de19b, which delivers #39418 item 1)
    Area: em-p1
    Session: session_016WV4czHUJLmdQAqm4fdDs9
    Account: os-elon-musk
    Branch: claude/issue-39434-wip
    Worktree: objectstack-issue-39434
    Domain: domain:server
    Seat: repo:objectstack@os-elon-musk
    File surface: packages/plugins/plugin-sharing/src/sharing-rule-service.ts and/or packages/plugins/plugin-sharing/src/rule-criteria.ts (the sys_sharing_rule save path that already judges criteria; the dev names the exact file before editing), a new sibling module there if the check is a new concern, a new test named for 39434, a patch changeset. ⛔ Not packages/plugins/plugin-sharing/src/objects/sys-sharing-rule.object.ts (open PR #39386). ⛔ Not packages/lint/src/** (claims on #39473 and #39336 hold that directory; a lint rule for declared stack.sharingRules is left for after them, noted in the report). Stop on any other breach; explain in the report.
    Container & model: M, mode:subagent, model: default (dispatch-gates --tier: "no path-derived mandate"), effort: high (reason: a permission-adjacent save path; warn-versus-refuse is a premise the dev measures)
    Clause-②: no
    Metadata-protocol: none
    Responsibility: plugin-sharing save path for sys_sharing_rule (objectstack) accepts a criteria literal on a choice field that is not one of the field's option values, so the rule shares nothing, silently | the console picker (PR #39442) stops the console producing it; nothing catches API, MCP or older rows | admins and agents writing sharing-rule conditions on choice fields today
    Thread-read: 7396623774
    Premise: holds — #39418's measurement (criteria {"jinji_chengdu":"紧急"} saved, 0 shares); at origin/main bbc6411 the save path (sharing-rule-service.ts, VALIDATION_FAILED door) checks no option values.
    Pre-claim lane: domain:server (plugin-sharing); this seat keeps it.
    Pre-claim deps: #39349 closed (PR #39442 merged).
    Prior rulings read: precedent for the tier = a WARNING: flow-condition-option-label in packages/lint/src/validate-flow-trigger-readiness.ts (flows) and sibling card #39441 ("Same tier as the flow rule (warning)", validation rules). This claim takes the warning tier on that precedent (Clause-②: no). Premise the dev verifies first: the sys_sharing_rule save path has a channel that carries a warning back to the caller. If it has none, the only loud forms are a refusal (a narrowing) or a server log (silent to the admin): the dev stops and reports the fork, and the zone takes it to the decision inbox; ⛔ no silent fallback to either.
    Serial constraints cleared: check-handover.mjs --inflight --paths=packages/plugins/plugin-sharing/src/sharing-rule-service.ts,packages/plugins/plugin-sharing/src/rule-criteria.ts --card=39434 → NO OVERLAP READ.

  4. added
    pm:dispatched
    and removed
    pm:blocked
    on Dec 4, 2026
  5. objectstack-fleet commented on Dec 4, 2026

    @objectstack-fleet
    ContributorAuthor

    repo:objectstack@os-elon-musk · os-elon-musk · session_016WV4czHUJLmdQAqm4fdDs9
    os-dev-report

    {
      "issue": 39434,
      "status": "needs_decision",
      "branch": "claude/issue-39434-wip",
      "pr": null,
      "session": "session_016WV4czHUJLmdQAqm4fdDs9",
      "premise_still_valid": true,
      "summary": "Card premise holds; the claim's channel premise does NOT, so no code was written (claim 7399336568 fork rule). Card premise, at objectstack origin/main bbc64113: the sys_sharing_rule save doors judge criteria only for match-all (plugin-sharing rule-criteria.ts isMatchAllCriteria, called from rule-hooks.ts:374 bindRuleCriteriaGuard on the /data door and sharing-rule-service.ts:817 in defineRule for POST /sharing/rules); nothing compares a literal to a choice field's option values, and record-validator.ts:1876-1913 refuses non-option writes to select/radio, so an equality literal outside the option values can match no engine-written row. Channel premise: the data-API create/update answer has exactly two members that reach the person, and the spec closes both to this finding. (1) `warnings` is declared as advisory VALIDATION-RULE hits only: packages/spec/src/api/protocol.zod.ts:3575 WRITE_ANSWER_WARNINGS_DESCRIPTION ('Present ONLY when at least one advisory rule hit'), fed only by WriteObservabilityOptions.onValidationAdvisory (spec contracts/data-engine.ts:95), whose event requires `rule` = 'The advisory validation rule's declared name' (spec data/data-engine.zod.ts:408); wired in metadata-protocol protocol-data-writes.ts:80/105 (create) and :154/254 (update); the console already renders it as a warning toast (ui/packages/react/src/record-save-feedback.ts:192 toastRecordSave). A plugin hook emitting a non-rule finding there would put an undeclared rule name into a declared API member. (2) `notice` (ctx.notice / onNotice, protocol-data-writes.ts:82/107) is declared 'Info severity: it reports an outcome, never a problem, so it is distinct from warnings' (protocol.zod.ts:3602-3606; contracts/data-engine.ts:130-132 'never rides onValidationAdvisory'), and the console shows a notice alone as a SUCCESS toast (record-save-feedback.ts:187). POST /sharing/rules answers the bare row with no advisory member at all (packages/rest/src/sharing-routes.ts:719-720). So every warn route is either a spec/API contract change or a misuse; refuse is a narrowing. Fork in open_questions for the zone's decision inbox.",
      "tests": "None run: no code written (needs_decision stop before the first edit). Readings are source reads at objectstack origin/main bbc64113 (worktree objectstack-issue-39434, since removed), cited file:line in summary.",
      "gates": "No local gates: empty diff, so dispatch-gates.mjs --commands has nothing to derive (not run). No PR, so no CI check-runs to cite.",
      "mcp_calls": "0",
      "api_writes": "1 - POST repos/objectstack-ai/objectstack/issues/39434/comments (this os-dev-report, via scripts/pm/post-stamped.mjs). Separately, not REST: one git push, the dev-worktree.sh --probe empty-branch push of claude/issue-39434-wip at bbc64113 (no commits on it). Reads: gh api GET of issues 39434, 39418, 39441 and the comments of 39434 and 39418.",
      "classifier_refusals": [],
      "open_questions": [
        {
          "question": "The sys_sharing_rule save answer has no channel the spec admits a non-rule warning on. Which way does the save-time check go?",
          "options": [
            "A - Refuse (narrowing). In claim surface: a sibling module in plugin-sharing judged by bindRuleCriteriaGuard (rule-hooks.ts) and defineRule (sharing-rule-service.ts), VALIDATION_FAILED 400 naming the field and, for a label, its value. Limited to equality/membership literals (bare value, $eq, $in) on select/radio/multiselect/checkboxes fields whose options the registry holds inline, judged only when criteria changes so a stored row can still be switched off. Covers every door: Setup form, /data API, MCP, POST /sharing/rules. Cost: size S, but Clause-② no (narrowing) + Metadata-protocol narrowed (a value refused) + a contract review before the queue; risk: rows written before a field's options changed could still hold an old value a refused literal would have matched.",
            "B - Build a save-advisory channel (scope growth). Spec: a new WriteObservabilityOptions listener (or relax ValidationAdvisoryEvent.rule to optional) and widen WRITE_ANSWER_WARNINGS_DESCRIPTION; metadata-protocol createData/updateData/clone wire it into `warnings`; then plugin-sharing emits. Console needs no change (warning toast already). POST /sharing/rules stays silent unless its answer is widened too. Cost: size M, outside the claim's file surface (packages/spec, packages/metadata-protocol, packages/rest), an API-answer contract change needing its own card and review; keeps the warning tier the rulings zone chose.",
            "C - Emit through ctx.notice. Rejected by contract: notice is declared info severity, never a problem, shown as a success toast, last writer wins.",
            "D - Server log only. Invisible to the admin who saved; does not meet the card's 'warned about, or refused'."
          ],
          "recommendation": "A, because it is the only option that reaches the admin at every door (including POST /sharing/rules and MCP) without changing a declared API member, fits the claim's file surface at size S, and the refused shape provably shares nothing (record-validator refuses non-option values on select/radio writes), so the narrowing removes no rule that can match a row the engine wrote under the current options; its cost is the Clause-② (narrowing) declaration and a contract review. B if the maintainer prefers to keep the warning tier: it is the correct long-term channel but is its own card in spec + metadata-protocol, and this card would then be Blocked-by it."
        }
      ],
      "security_findings": "none",
      "out_of_scope_findings": [
        "carrier: repo:objectstack@os-elon-musk seat (named in claim 7399336568) · noted, not filed: declared stack.sharingRules have no lint rule comparing a criteria literal to a choice field's option values (packages/lint/src is held by the claims on #39473 and #39336); the flow rule's reader packages/lint/src/flow-select-options.ts is not exported from @objectstack/lint's index and plugin-sharing does not depend on @objectstack/lint, so whichever option lands reads options through the engine registry, not that module."
      ],
      "line_budget": "0 lines changed (no diff)",
      "deviations": "Stopped before the first edit per the claim's fork rule. The probe push left claude/issue-39434-wip on origin at bbc64113 with no commits: reuse it for the chosen option or delete it. Worktree objectstack-issue-39434 removed (node_modules first, no --force).",
      "files_changed": []
    }
  6. objectstack-fleet commented on Dec 4, 2026

    @objectstack-fleet
    ContributorAuthor

    repo:objectstack@os-elon-musk · os-elon-musk · session_016WV4czHUJLmdQAqm4fdDs9

    Release: 2026-12-04T02:53Z · session session_016WV4czHUJLmdQAqm4fdDs9 releases claim 7399336568 · because the claim's fork rule fired: the sys_sharing_rule save answer has no channel the spec admits a non-rule warning on (os-dev report 7399427182, status needs_decision, options A refuse / B build an advisory channel / C notice / D log) · into needs-user-decision, assignee cleared; the seat repo:objectstack@os-elon-musk routed the choice to the decision thread with A recommended and requeues the card to zone em-p1 with the ruling.
    Resume-from: claude/issue-39434-wip@bbc64113 (empty probe branch, no commits)

  7. added
    needs-user-decision
    and removed
    pm:dispatched
    on Dec 4, 2026
  8. objectstack-fleet commented on Dec 4, 2026

    @objectstack-fleet
    ContributorAuthor

    repo:objectstack@os-elon-musk · os-elon-musk · session_016WV4cxhJCxxgNFHE9Ar94a

    维护者速读

    • 问题:管理员(或替他搭应用的 AI)写共享规则「地区 等于 华北」,而下拉字段实际存的是内部值(如 north),「华北」只是显示名;规则照常保存、显示为启用,却一条记录也没共享出去,保存时和之后都没有任何提示,只有本该看到记录的同事来问才会发现(实测一次:报修单的「紧急程度」;界面上的下拉选择器昨天已补,但接口、手写条件和旧表单仍会中招)。
    • 每个选项一句:保存时当场拒绝「把显示名当值写」这一种确定写错的情况,并告诉他该写哪个值(一个改动);把所有不在选项里的值一律拒绝(一个改动,但会误拦导入时保留下来的选项外旧值);新建一条「保存成功但带警告」的通道(至少三个改动,需另立一张卡);借用现有的「保存成功提示」来报(界面会显示成成功,现有约定不允许);只写服务器日志(保存的人看不到)。
    • 推荐与一个理由:推荐第一种,因为流程里同样的写错、以及共享规则另外三种「存得进却永远不生效」的情况,平台都已经是保存时当场拒绝并给出改法,这是同一类问题剩下的最后一个口子。
    • 不定会怎样:这张卡继续停在开发报告的分叉上,界面以外写入的共享规则继续「看着启用、实际谁也没共享到」,而权限承诺落空只能靠用户投诉才被发现。

    Served-tier: CONTRACT_REVIEW_TIER
    Analysed-by: session_016WV4cxhJCxxgNFHE9Ar94a

    Background

    An administrator, or an agent building the app, writes a sharing rule whose condition compares a choice field with the text they see on screen (the option's label) instead of the stored option value. The rule saves, shows as active, and shares nothing. #39418 measured it at origin/main f32b7d6d8f: criteria_json: {"jinji_chengdu":"紧急"} on a radio field whose options are 高 → gao, 紧急 → jinji; five rows hold jinji; the rule wrote 0 sys_record_share rows; patching the criteria to "jinji" wrote 5 at once. I did not re-run that measurement; the source reading at bbc64113 agrees with it (the save doors judge criteria for match-all only, and nothing resolves a label to its value).

    The picker half landed (PR #39442, merged 2026-12-04T02:42Z, closing #39349), so the Setup form no longer produces this shape for a radio field. POST /sharing/rules, a direct write to /data/sys_sharing_rule, the form's "Edit as JSON" fallback and rows written before the picker are still open.

    The dev stopped before the first edit (report 7399427182) because the claim's premise "the save answer can carry a warning" is false: the create and update answers have two members that reach the person, and the spec closes both to this finding.

    Governing text

    • ADR-0078 Decision §1 (Accepted), docs/adr/0078-no-silently-inert-metadata.md: "Parsed, unmarked, silently inert is prohibited", and the tier: "a lint flags the omission at author time (error if the instance is fully inert, warning if it degrades)".
    • ADR-0078 Decision §6: "A rule ships only with the runtime line that makes it true ... A false prescription is worse than a missing rule: it tells an AI author to 'fix' working metadata".
    • The save door already cites that ADR for this table, packages/plugins/plugin-sharing/src/rule-hooks.ts (bindRuleCriteriaGuard docblock): "rules the evaluator now refuses to act on: safe, but silently inert, which is its own authoring trap (ADR-0078). Failing the write instead tells the admin the criteria is missing while they are still looking at the form."
    • packages/spec/src/api/protocol.zod.ts WRITE_ANSWER_WARNINGS_DESCRIPTION: "The advisory validation-rule hits of THIS write ... Present ONLY when at least one advisory rule hit". WRITE_ANSWER_NOTICE_DESCRIPTION: "Info severity: it reports an outcome, never a problem, so it is distinct from warnings".
    • packages/spec/src/api/export.zod.ts createMissingOptions: "Keep a select / radio / multiselect cell that matches none of the field's options instead of failing the row. The cell is stored as written ... The field's option list is not changed". So a stored value outside the options is a declared state.
    • packages/objectql/src/validation/record-validator.ts (select arm): "Option membership is ... a constraint: ⛔ never on a readonly value (the open-vocabulary ruling, see ReadonlyValueScope)".
    • AGENTS.md Post-Task Checklist 3: "(narrowing) is BREAKING ... a value refused or a requirement tightened is narrowed", for "what a metadata author can write".

    grep: grep -n "silently inert" docs/adr/0078-no-silently-inert-metadata.md packages/plugins/plugin-sharing/src/rule-hooks.ts · grep -n "WRITE_ANSWER_WARNINGS_DESCRIPTION\|WRITE_ANSWER_NOTICE_DESCRIPTION" -A8 packages/spec/src/api/protocol.zod.ts · grep -n "createMissingOptions" -A8 packages/spec/src/api/export.zod.ts · grep -n "open-vocabulary" packages/objectql/src/validation/record-validator.ts

    Protocol statement, and whether the protocol changes

    The protocol today: a sharing rule's criteria is an engine filter handed to the data engine as written; a choice field stores option values; nothing in the spec says a criteria literal must be an option value, and nothing gives the save answer a channel for a non-rule warning.

    • A and E change no schema and no spec file. They refuse a value at two save doors that accepted it: an accept-set narrowing in plugin-sharing.
    • B changes the protocol: a new or widened member on the published write answer in packages/spec, wired in metadata-protocol. Under 「协议为基准 ... 改协议、新增公开面另立卡,⛔ 不作 Bug 选项」 it cannot be this Bug card's fix; it is its own card.
    • C contradicts the declared meaning of notice. D changes nothing a person can see.

    Premises (each with its re-check)

    1. The two save doors judge criteria for match-all only. grep -n "isMatchAllCriteria" packages/plugins/plugin-sharing/src/rule-hooks.ts packages/plugins/plugin-sharing/src/sharing-rule-service.ts → rule-hooks.ts:384, sharing-rule-service.ts:817. Holds.
    2. No file in the plugin reads option values. grep -rln "optionValues\|invalid_option" packages/plugins/plugin-sharing/src --include=*.ts → one unrelated test. Holds.
    3. The write answer's warnings is declared as validation-rule hits only, and notice as info that is never a problem; the console shows a notice alone as a success toast. sed -n 3575,3606p packages/spec/src/api/protocol.zod.ts · sed -n 400,412p packages/spec/src/data/data-engine.zod.ts (rule: "The advisory validation rule's declared name") · grep -n "a notice alone keeps" ui/packages/react/src/record-save-feedback.ts. Holds: the dev's channel reading is verified.
    4. POST /sharing/rules answers the bare row. sed -n 705,722p packages/rest/src/sharing-routes.ts. Holds.
    5. The flow rule for the same mistake is a refusal, not a warning. grep -n "severity: 'error'" -A1 packages/lint/src/validate-flow-trigger-readiness.ts | grep -B1 FLOW_CONDITION_OPTION_LABEL → three sites, all error; its docblock says "error at every position"; its explanation lives in packages/lint/src/rule-explanations/publish-time-inert-refusals.ts. So the claim's line "precedent for the tier = a WARNING: flow-condition-option-label" (comment 7399336568) is wrong, and so is validation rules: saving a condition whose literal is not one of a choice field's option values is warned about (save-time half of #39405) #39441's "Same tier as the flow rule (warning)".
    6. The flow rule judges an option LABEL only, never every literal outside the options, and skips shared-picklist fields. Same explanation file: "a label that is also some option's value never is [reported]. Fields whose options come from a shared picklist are not judged".
    7. A stored choice value outside the options is reachable by declared paths: an import with createMissingOptions (premise text above; grep -n "createMissingOptions" packages/core/src/utils/import-coerce.ts), a readonly choice field (shape judged, membership not), and rows written before an option was removed. So the dev's "the refused shape provably shares nothing" holds for a label and does not hold for every literal outside the options.
    8. An import resolves a label to its value before it keeps anything (matchOption, grep -n "matchOption" packages/core/src/utils/import-coerce.ts), so a kept value is one that matches neither a label nor a value. A literal equal to an option's label therefore matches no row written through the engine under the current options. Source read; not run.
    9. Three refusals of the same shape ("the rule could never share anything") already sit on this save door: match-all criteria (PR fix(sharing)!: a rule with no criteria shares NOTHING, not every record (#3896) #3929), an object without record sharing (PR fix(plugin-sharing)!: a sharing rule on an object without record sharing is refused at save #30953, 422 SHARING_NOT_ENABLED), an unresolved user recipient (PR fix(plugin-sharing): refuse an unresolved user recipient on the sys_sharing_rule /data door #39361, merged 2026-12-04). grep -n "^export function bindRule.*Guard" packages/plugins/plugin-sharing/src/rule-hooks.ts.
    10. No existing rule would start being refused under A. Declared rules are not rows and never pass the save door ("sys_sharing_rule holds only the rules an organization authors", packages/plugins/plugin-sharing/src/declared-sharing-rules.ts). Read anyway: grep -rn "condition" examples/app-showcase/src/security/sharing-rules.ts (2 conditions) and, in HotCRM at 63a4c0b, grep -rn "condition" src/*/sharing/*.ts (17 conditions); every choice literal I read is a lowercase option value ('new', 'qualified', "planning", "customer", "closed_won", "critical"). No seed in examples/, packages/apps or HotCRM writes a sys_sharing_rule row (grep -rn "sys_sharing_rule" --include=*.ts examples packages/apps → 0 hits). Rows stored in running deployments: not measured.
    11. A negated comparand ($ne / $nin) on a label excludes no record, so the rule shares more than intended rather than nothing. The flow rule reports it ("excludes no record"). For sharing rules: reasoned from the same filter semantics, not measured.
    12. Whether MCP can write a sys_sharing_rule row today: not measured (the draft door saves metadata; this table is data).

    The concrete question

    When a sharing rule's condition compares a choice field with text that is not one of the field's stored option values, does the save tell the author by refusing, by a new kind of warning, or not at all?

    Options × real cost × workload

    What it does What the customer sees Workload
    A Refuse the option-label comparand Both save doors refuse a condition whose literal is an option's label and not any option's value, on a choice field with inline options that is not readonly and not picklist-bound; plain equality, $eq, $in, and the negated $ne / $nin. Judged on insert, and on update only when the criteria changes. "紧急 is the label of an option on 紧急程度; the field stores jinji" at save, at every door. A stored rule still loads, evaluates and can be switched off. A literal that is neither a label nor a value saves as today. domain:server (plugin-sharing) · 1 PR · precedents PR #39361 (+438/−3, 8 files) and PR #30953 (+409/−11, 10 files), same door, same declaration; the label reading itself: PR #37491 (+676/−14, 6 files)
    E Refuse every literal outside the options (the dev report's A as written) As A, for any literal that is not an option value. Also catches a typo such as nroth. Also refuses a rule over values an import kept, over a retired option that rows still hold, and gives a prescription the platform cannot prove. Same lane · 1 PR · same precedents for size; no landed precedent for this scope: the flow filter rule deliberately stops at the label
    B Build a save-advisory channel A member on the write answer that a non-rule finding may ride, wired through create / update / clone; the plugin emits on it; POST /sharing/rules needs its answer widened too. The rule saves; a warning toast in the console; an API or agent caller gets a 200/201 with an extra member it must read. domain:spec + metadata-protocol + rest + plugin-sharing · at least 3 PRs · precedents PR #22749 (+1121/−70, 29 files, the warnings member) and PR #28247 (+497/−9, 14 files) with PR #28753 (+1664/−54, 63 files, the notice member and its producers)
    C Say it through the save notice The plugin hook calls the notice. A green success toast carrying a problem; a later notice overwrites it. 无先例 (the declared meaning forbids it)
    D Server log only A warn line. Nothing. 无先例

    Measured workload gap between A and B: one PR of about 430 lines against at least three PRs whose nearest precedents total over 3,000 lines, more than 3×. I name it as the rules require; it does not decide the letter (see the self-check).

    What each option means in business terms

    • A: the form refuses "share with 华北" when the list only knows "north", and tells you to write "north". A bank refusing a transfer to an account name that does not match the number, at the counter, with the right name shown.
    • E: the form refuses anything it does not recognise, including a value that is really in your imported data. A clerk refusing a customer whose name is on the old register but not on the new form.
    • B: the rule is accepted with a yellow note. A contract signed with a sticky note saying "this clause may bind nobody".
    • C: the same note printed on the "success" receipt.
    • D: the note filed in the back office.

    Four-axis argument

    Long-term soundness (leads, at least half the weight). In two years a sharing rule is a permission promise that either takes effect or is not accepted: the condition editor offers a choice field's values (as the mainstream CRM criteria editors do for picklist fields; their API-deploy behaviour I did not verify), and every other door answers the same way. The platform has already chosen that end state three times on this door (PRs #3929, #30953, #39361) and once for this exact mistake in flows (PR #37491, error). A is the fourth member of an existing refusal set, written with the reading the flow rule already defined; it adds no new contract member. B adds a permanent second meaning to a published answer member for one producer. E fails ADR-0078 §6 and contradicts a spec-declared state (createMissingOptions): by 「spec 声明 > 实现」 a refusal may not deny a value the spec says can be stored. A warning tier also reads wrong against ADR-0078 §1: a rule whose only predicate is a label is fully inert, which that text grades error.

    Real business pull. Measured pull exists for the label mistake: #39418's filer hit it in a new-company walkthrough, and the same label-for-value mistake has its own cards in flows (#35143, #36964) and validation rules (#39405). There is no measured case of a non-label typo in a sharing rule, and no measured consumer asking for a save-time warning that is not a rule hit. So A has pull, E's extra reach and B's channel have none.

    Keeping an AI author from being wrong. Today the agent gets 201 and reports the rule done; the people who were promised access see nothing, and nobody is told. Under A the agent gets a 400 naming the field and the value to write, and repairs it in the same turn. Under B it gets a success with an extra member; an agent that reads the status and the row, which is the common case, reports done exactly as today. With $ne the silent direction is wider access than intended, which is the worse failure, and only a refusal stops it at the door. Loud beats tolerated.

    No spread at the startup stage. A declares nothing new. B is a declared, maintained channel with one caller: by this axis, zero-pull surface is deferred. On 「新增门禁默认否」: I read that sentence as not reaching A. The text calls a 门禁 "只减不增的零件", and everywhere else the skill uses the word for tooling instruments: the tooling label is "修复落在门禁/脚本/workflow/技能/席位协议/PM 工具面而非产品包", and instrument-discipline.md pairs "新增门禁、巡查行或棘轮". A is a product package's save contract refusing a value; the same section's third axis names exactly that as the preferred form ("契约收紧(严格 schema、publish 时响亮拒绝)优于消费端宽容"). So A is contract tightening, owed a narrowing declaration and a contract review, not a maintainer-named gate. If the maintainer reads the sentence more widely, that is the one reading that would move the letter, and it is theirs to give.

    os-decision-facets

    • ① Long-term soundness: A joins an existing refusal set on the same door and reuses the flow rule's label reading, shrinking a special case; B grows a published answer member; E contradicts a spec-declared stored state.
    • ② Real business pull: the label mistake is measured (sharing rules: the condition value for a single-choice (radio) field is free text, so the option label is stored and the rule shares nothing #39418, and the same family in flows and validation rules); a non-label typo and a non-rule save warning have no measured caller.
    • ③ AI-error prevention: A is a loud 400 with the value to write; B, C and D leave a 201 an agent reads as done, and under a negated comparand the silent result is over-sharing.
    • ④ No spread: A declares nothing; B is a new maintained channel with one producer, so it is deferred; A is contract tightening in a product package, not a new tooling gate.

    Prior rulings read: silently inert,sharing rule,option label,invalid_option,save-time,refused at save → 7 hits; ADR-0078 Decision §1 and §6 (read in full), ADR-0057 D7, ADR-0080 §3/§7/§8, ADR-0142 D2, ADR-0152 D2 (named by the tool, not on this question); thread: none; repo: objectstack-ai/objectstack

    Recommendation

    A. Refuse, at both save doors, a sharing-rule condition that compares a choice field with one of its option labels, naming the field and the value to write.

    Does an existing ruling already answer it? In direction, largely yes: ADR-0078 §1 prohibits the silently inert state and grades a fully inert instance error, the door's own docblock applies that ADR to this table, and under the skill's meta-rule ① ("静默丢弃的声明并入既有拒收集;新支复用母单裁决直接入队") a new branch of an existing refusal set reuses the parent ruling. No ruling names a sharing-rule criteria literal, ADR-0078's text speaks of metadata instances while this is a data row, and a narrowing is BREAKING, for which the precedent PR #30953 took the maintainer's per-PR word. So what is asked of the maintainer is that word and the scope line between A and E, not a new policy.

    Confidence gaps, stated and not used to change the letter:

    Options not taken:

    • E: it refuses a rule over values the spec says may be stored (import-kept values, retired options, readonly vocabulary), so its prescription is unproven under ADR-0078 §6.
    • B: a protocol change with no measured caller beyond this card; correct only if a second non-rule save advisory appears, and then as its own card.
    • C: the notice is declared info-only and renders as success; using it for a problem breaks a published meaning.
    • D: the author never sees it, so the card's "warned about, or refused" is not met.

    只看①选 A;②③④ 是否翻转:否

    After the ruling

    If A is ruled:

    1. The zone re-dispatches sharing rules: saving a condition whose literal is not one of a choice field's option values is warned about or refused (save-time half of #39418) #39434 on the reused branch claude/issue-39434-wip with the ruling attached. File surface as claimed: a sibling module in packages/plugins/plugin-sharing/src/, bound beside the three existing guards in rule-hooks.ts, the same judge called from defineRule in sharing-rule-service.ts, a test named for 39434, one changeset. Not objects/sys-sharing-rule.object.ts (open PR feat(metadata-protocol)!: refuse a package-less create; retire POST /automation; notify-channel judge on /meta flow saves #39386), not packages/lint/src/**.
    2. Scope fixed by this ruling, so the dev does not re-open it: label comparand only; select / radio / multiselect / checkboxes; inline non-empty options; not readonly; not picklist-bound; top-level field of the rule's object, under $and / $or at any depth; plain equality, $eq, $in, and $ne / $nin if the dev's first measurement confirms premise 11. Insert judged; update judged only when the supplied criteria differs from the stored one; system writes pass, as with the neighbouring guards. Refusal VALIDATION_FAILED (400) under criteria_json, the sentence naming field, label and value.
    3. Falsifiable premise the dev verifies first: a label literal matches no row written through the engine under the current options (a real-engine test: write rows, save the rule by label, expect the refusal; save by value, expect shares). If it does not hold, report the fork; ⛔ no fallback to E, B or D.
    4. PR and changeset carry Clause-②: no (narrowing) and a Metadata-protocol: line (precedent: none), the BREAKING banner with FROM → TO ({"jinji_chengdu":"紧急"} → {"jinji_chengdu":"jinji"}), the ADR-0087 disposition, and the 维护者速读 block. No migration and no sweep of stored rows: none is owed, and the maintainer's "no production customers yet, no legacy-data migrations in fixes" rule points the same way.
    5. The narrowing owes a contract review at CONTRACT_REVIEW_TIER on the landing head before the queue, and, as BREAKING, the maintainer's per-PR word (as PR fix(plugin-sharing)!: a sharing rule on an object without record sharing is refused at save #30953).
    6. Follow-ups the seat files or folds, not this PR: the declared-rule lint (a label in a stack.sharingRules CEL condition, the dev's out-of-scope finding, after the claims on Admin-facing lint warnings use labels instead of API names (all ten catalogues) #39473 and objectql: an inline select field whose options repeat a value publishes with no refusal, while a named picklist with the same repeat is refused #39336 release packages/lint/src); correcting validation rules: saving a condition whose literal is not one of a choice field's option values is warned about (save-time half of #39405) #39441's tier line to the flow rule's real severity.

    If B is ruled instead: the seat files a spec card for the save-advisory member at this card's p1, #39434 becomes pm:blocked with Blocked-by: that card, and nothing lands in plugin-sharing until it does.

    Related issues and PRs

  9. objectstack-fleet commented on Dec 4, 2026

    @objectstack-fleet
    ContributorAuthor

    repo:objectstack@os-elon-musk · os-elon-musk · session_016WV4czHUJLmdQAqm4fdDs9

    Correction · 2026-12-04T03:01Z · to released claim 7399336568, Prior rulings read: line. It cited flow-condition-option-label as a WARNING-tier precedent; that rule is severity error (packages/lint/src/validate-flow-trigger-readiness.ts:442, read by the seat for analysis 7399582338). The claim's warning-tier premise rested on #39441's wording, not on the flow rule. Also missed in the claim and the dev's option A: a label under a negated comparand ($ne / $nin) over-shares rather than sharing nothing; any build covers it. Nothing is built until the ruling on this card.

  10. objectstack-fleet commented on Dec 4, 2026

    @objectstack-fleet
    ContributorAuthor

    repo:objectstack@os-elon-musk · os-elon-musk · session_016WV4cxiJF5PkqquFk98Bh7

    Ruled: 2026-12-04T06:09Z · the maintainer tapped 「拒绝把显示名当值写」 at 2026-12-04T06:09:21Z on the project decision card 「共享规则把下拉选项的显示名当成值写,保存时怎么处理?」. That is option A of the analysis in comment 7399582338, scoped to the option-LABEL comparand. The broader "refuse every literal outside the options" (the analysis's option E, the dev report's A) was offered and not chosen.

  11. added
    pm:queue
    and removed
    needs-user-decision
    on Dec 4, 2026
  12. objectstack-fleet commented on Dec 4, 2026

    @objectstack-fleet
    ContributorAuthor

    repo:objectstack@os-elon-musk · os-elon-musk · session_016WV4czHUJLmdQAqm4fdDs9

    Claim: PM loop round 4 · 2026-12-04T06:11Z · zone em-p1 · on the maintainer's ruling recorded at 7403149741 (option A, option-label comparand only)
    Area: em-p1
    Session: session_016WV4czHUJLmdQAqm4fdDs9
    Account: os-elon-musk
    Branch: claude/issue-39434-wip
    Worktree: objectstack-issue-39434
    Domain: domain:server
    Seat: repo:objectstack@os-elon-musk
    File surface: packages/plugins/plugin-sharing/src/rule-hooks.ts (bindRuleCriteriaGuard, the /data door) and packages/plugins/plugin-sharing/src/sharing-rule-service.ts (defineRule, POST /sharing/rules), a new sibling module in packages/plugins/plugin-sharing/src/ for the label check (reason: a new concern beside two large files; rule-criteria.ts only if the criteria walk is reused from there), a new test named for 39434, a patch changeset. ⛔ Not packages/lint/src/**. Stop on any other breach; explain in the report.
    Container & model: M, mode:subagent, model: default (dispatch-gates --tier at 3e83ef2b: "no path-derived mandate"), effort: high (reason: a refusal on a permission save path, under a recorded ruling with three carried items)
    Clause-②: yes (narrowing)
    Metadata-protocol: none (provisional: the ruling leaves narrowed-versus-none to the contract reviewer; precedents #30953 and #39361 declared none on the same door)
    Responsibility: plugin-sharing sys_sharing_rule save path (objectstack) accepts an option LABEL as a criteria literal on a choice field, so the rule shares nothing (positive comparand) or over-shares (negated comparand) | the console picker (PR #39442) stops the console producing it; nothing catches API, MCP or older rows | admins and agents writing sharing-rule conditions on choice fields today
    Thread-read: 7403149741
    Premise: holds — os-dev report 7399427182 (needs_decision) read the save doors at bbc6411: criteria is judged only for match-all (rule-criteria.ts isMatchAllCriteria, rule-hooks.ts:374, sharing-rule-service.ts:817); nothing compares a literal to option labels.
    Pre-claim lane: domain:server (plugin-sharing); this seat keeps it.
    Pre-claim deps: #39349 closed; PR #39386 merged.
    Prior rulings read: 7403149741 verbatim: 「refuse a sys_sharing_rule save when a criteria literal on a choice field is an option label where the row holds the value. The refusal names the value to write. Judged only when the criteria change.」; the broader refusal of every literal outside the options (analysis 7399582338 option E) was NOT chosen; stored values outside the options are admitted by the spec (createMissingOptions, packages/spec/src/api/export.zod.ts:342). Correction carried: the tier precedent in released claim 7399336568 was wrong — flow-condition-option-label is severity error (packages/lint/src/validate-flow-trigger-readiness.ts:442), correction 7399604863. Carried: negated comparands ($ne/$nin) on a label over-share; measured first, then covered.
    Serial constraints cleared: check-handover.mjs --inflight --paths=packages/plugins/plugin-sharing/src/sharing-rule-service.ts,packages/plugins/plugin-sharing/src/rule-criteria.ts,packages/plugins/plugin-sharing/src/rule-hooks.ts --card=39434 → NO OVERLAP READ.

  13. added
    pm:dispatched
    and removed
    pm:queue
    on Dec 4, 2026
  14. objectstack-fleet commented on Dec 4, 2026

    @objectstack-fleet
    ContributorAuthor

    repo:objectstack@os-elon-musk · os-elon-musk · session_016WV4czHUJLmdQAqm4fdDs9
    os-dev-report

    {
      "issue": 39434,
      "status": "done",
      "branch": "claude/issue-39434-wip",
      "pr": "https://github.com/objectstack-ai/objectstack/pull/39543",
      "session": "session_016WV4czHUJLmdQAqm4fdDs9",
      "premise_still_valid": true,
      "summary": "Implemented the ruled option A (7403149741): both sys_sharing_rule save doors refuse VALIDATION_FAILED (400) a criteria literal on a select/radio/multiselect/checkboxes field (inline non-empty options, not readonly, not picklist-bound) that is an option label and no option's value, with one sentence naming the field, the label and the value to write. /data door: bindRuleCriteriaGuard (rule-hooks.ts) after its match-all check, one fields entry {criteria_json, invalid_option}; POST /sharing/rules: defineRule throws 'VALIDATION_FAILED: ' + the same sentence. Judged on insert and only when the criteria change (sameCriteria: key order and string/object spelling aside), so a legacy label row can still be switched off; judged for every caller including system context, like the match-all check in the same guard. Carried item 2 measured FIRST on the real evaluator (ObjectQL+SqlDriver, 3 gao + 2 jinji rows, evaluateRule, sys_record_share read off the driver): $ne '紧急' and $nin ['紧急'] grant ALL 5 records (over-share, the 2 urgent ones included; value controls grant the 3 non-urgent); bare/$eq/$in on the label grant 0. Covered shapes: bare, $eq, $ne, $in, $nin on single-value; $contains/$notContains on multi-value (the membership tests the engine runs on JSON-stored columns); any depth under $and/$or/$not. Deliberately not covered: equality family on multi-value fields (engine refuses it there for another reason), substring/pattern ops on single-value fields (a pattern names no option), ordering/range ops, $null/$exists/$empty, dotted paths; the array (AST) spelling never reaches the check (both doors refuse it first as match-all, measured). A label that is also some option's value: decided NOT a mistake and accepted (same rule as flow-condition-option-label; pinned with stage 'open'). A literal that is neither value nor label: accepted unchanged (pinned 'urgent').",
      "tests": "New packages/plugins/plugin-sharing/src/sharing-rule-option-label-39434.test.ts (30 cases). Red-first at 10ad9101 (test only): 'Tests  13 failed | 17 passed (30)' (every refusal red, measurements+controls green). Green at da6cbc17: single file 'Tests  30 passed (30)'; pnpm --filter @objectstack/plugin-sharing test 'Test Files  84 passed (84)' / 'Tests  1828 passed | 11 skipped (1839)'; typecheck exit 0 ('check:test-typecheck: OK'); build exit 0 ('check-dts-emitted: @objectstack/plugin-sharing - 2/2'). Ablations via scripts/ablation-replace.mjs (tests import src, no dist leg; each 'ok mutation landed' + 'ok restored: blob == HEAD, git diff HEAD empty'): (1) '$ne' dropped from the single-value scalar set -> 'Tests  3 failed | 26 passed (29)'; (2) /data sameCriteria skip deleted -> 'Tests  1 failed | 28 passed (29)'; (3) isSystem skip re-inserted -> 'Tests  1 failed | 29 passed (30)'.",
      "gates": "Derived: node scripts/pm/dispatch-gates.mjs --commands --repo objectstack-ai/objectstack at da6cbc17 -> 73 commands; all 73 run with exit captured before any pipe, all exit 0 (incl. check:adr-0087-registration '1 declared-breaking changeset(s), each carrying an ADR-0087 disposition ... not-required (no-migration-prescription)', check:nul-bytes, check:doc-authoring, check:issue-citations, check:system-context-census, check:dual-build-cjs-loads, check:i18n). --ran: 'Run reconciliation — 73 derived, 73 run, 0 NOT-MEASURED, 0 UNRUN' / 'a DERIVED zero — all 73 recorded an exit code and none of them is 3'. Earlier run at 4b9949e9: check:system-context-census exit 1 (new isSystem read in bindRuleCriteriaGuard had no row on content/docs/permissions/system-context.mdx) -> removed the system skip (da6cbc17); dual-build-cjs-loads and i18n exit 3 PREREQUISITE NOT MET there, exit 0 with pass lines at da6cbc17 (cause of the earlier missing dists not established). check-platform-checklist not run: no exported symbol renamed or deleted. CI check-runs on PR 39543: NOT MEASURED, reason: report delivered at PR open, CI convergence is the seat's.",
      "mcp_calls": "0",
      "api_writes": "3 REST writes in 2 relay strokes: (1) fleet-write pr_create (run 47289809385): POST /repos/objectstack-ai/objectstack/pulls (draft, PR 39543; read-back 11157 bytes sent = stored) + POST /repos/objectstack-ai/objectstack/issues/39543/assignees (os-elon-musk); (2) post-stamped.mjs POST /repos/objectstack-ai/objectstack/issues/39434/comments (this report). Plus 5 git pushes to claude/issue-39434-wip (not REST). Reads: gh api GET issue 39434 + comments, pulls/39543.",
      "classifier_refusals": [],
      "open_questions": [],
      "security_findings": "none",
      "out_of_scope_findings": [
        "carrier: repo:objectstack@os-elon-musk seat · noted, not filed: content/docs/permissions/sharing-rules.mdx lists each save-time refusal on this door and does not yet list this one (outside the claim's file surface) -> PR body 'Skills-docs: follow-up owed — content/docs/permissions/sharing-rules.mdx'; the seat files it and rewrites the line to the card number.",
        "carrier: repo:objectstack@os-elon-musk seat · noted, not filed (carried from report 7399427182): declared stack.sharingRules CEL conditions are not judged for option labels; the lint rule waits for packages/lint/src claims on #39473 and #39336.",
        "carrier: none · noted, not filed: the array (AST) criteria spelling ['F','=','v'] is refused at both doors by isMatchAllCriteria with the 'criteria is required ... unparsable' message although the engine would lower and run it (measured in-process via ObjectQL insert while writing the pins); no named producer writes that spelling, so reach is unmet. In PR Acceptance-notes territory only.",
        "carrier: none · noted, not filed: picklist-bound choice fields are skipped as ruled, though at runtime the registry folds their options in so the same reading would be sound."
      ],
      "line_budget": "+622 / -3 across 5 files at da6cbc17 (625 changed lines, under the 3000 human-merge threshold): rule-criteria-option-label.ts +223 (new), sharing-rule-option-label-39434.test.ts +342 (new), rule-hooks.ts +25/-3, sharing-rule-service.ts +14, changeset +18.",
      "deviations": "(1) dev-worktree.sh refused (a local branch claude/issue-39434-wip already existed with no worktree, left by the earlier round); built the tree by hand: git worktree add ../objectstack-issue-39434 claude/issue-39434-wip, fast-forward to origin/main 3e83ef2b, BASE pinned with dev-worktree.sh --pin-base; pushed normally (ancestor, no force). (2) Analysis 7399582338 said system writes pass; the build judges system-context writes too (same as the match-all check in the same guard), because check:system-context-census required a new row on content/docs/permissions/system-context.mdx (outside the file surface) for the skip's isSystem read; pinned and ablated. Flag for the contract reviewer. (3) One foreground gate batch exceeded the 600 s cap (check:slot-lookup ran ~9 min) and the harness moved it to the background; it completed and was read, no watcher left; later batches were capped with timeout. (4) The AST-spelling pin was dropped after measuring that both doors refuse that spelling first as match-all. (5) Tier: served model is the harness default per the claim line; no tier mismatch measurable from a subagent.",
      "files_changed": [
        ".changeset/39434-sharing-rule-option-label-criteria.md",
        "packages/plugins/plugin-sharing/src/rule-criteria-option-label.ts",
        "packages/plugins/plugin-sharing/src/rule-hooks.ts",
        "packages/plugins/plugin-sharing/src/sharing-rule-option-label-39434.test.ts",
        "packages/plugins/plugin-sharing/src/sharing-rule-service.ts"
      ]
    }
  15. removed
    pm:dispatched
    on Dec 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

area:databugpriority:p1

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions