Skip to content

Field rules: a field that is required AND hidden by its visibleWhen is still enforced as required on save — one admin config locks every record that fails the condition #34905

Closed

Description

@os-bob

What (18.5.0, console + Studio, measured in a browser)

A platform administrator adds a field to crm_account in Studio: Data → 客户 → 表单 → 添加字段 → Publish. The field is required and also has a visibleWhen so that it shows only for one customer tier.

After publishing, saving any customer that does not meet the condition is refused, even an edit of an unrelated field such as the owner:

验证用-备注字段是必填项,不能清空

The field is hidden on that record, so the user cannot see it, cannot fill it in, and cannot save anything. A single admin configuration therefore locks every record outside the condition, organization-wide. Deleting the field and republishing restores saving.

Expected

A field hidden by its visibleWhen is not required at that moment. Required should be judged together with visibility, on the server as well as in the form, so that the rule reads as "required when visible". Failing that, Studio should refuse to publish required together with visibleWhen, and explain why.

Severity

High. It needs no code: an administrator doing ordinary self-service configuration can stop the whole sales team from saving customers.

Activity

  1. objectstack-fleet commented on Nov 18, 2026

    @objectstack-fleet
    Contributor

    repo:objectstack#3 · os-support-ai · session_01WGufzgNCAXyGfBQFZBwixH

    Handed over unfinished · 2026-11-18T03:24Z. Seat 3 area o3-G is handing this card to the next PM (maintainer, 2026-11-18 03:19Z), and lease:o3-G and pm:dispatched are removed and the card returns to pm:queue (lane domain:server) in this stroke, so the next PM picks it up from the queue. The PR is #34978 at 84d2f7370c. It is Tier H: os-zhuang approves before it is readied or queued. Still owed: green CI on that head, L1-d's merge delta, and the seat's final delta and held L2 record. State and next steps are in the card thread's hand-off comment on the PR: #34978 (comment)

  2. added
    pm:queue
    and removed
    pm:dispatched
    on Nov 18, 2026
  3. objectstack-fleet commented on Nov 18, 2026

    @objectstack-fleet
    Contributor

    repo:objectstack#1 · os-warren · session_01JQwxbXGvw43spR79ztEvWt

    Claim: PM loop round 1 · 2026-11-18T03:44Z
    Session: session_01JQwxbXGvw43spR79ztEvWt
    Account: os-warren
    Branch: claude/project-thread-9ubqgj (the PR's existing head branch; platform exception, kept as is)
    Worktree: objectstack-issue-34905
    Domain: domain:server
    Seat: repo:objectstack#1 (area o1-A)
    File surface: the 27 paths of PR #34978 at 84d2f7370c, unchanged
    Container & model: L, mode:subagent, model: n/a — reviews and records only, no dev dispatched; the seat delta L2 runs at CONTRACT_REVIEW_TIER (Tier H, narrowing), effort: high
    Clause-②: yes
    Metadata-protocol: semantic
    Responsibility: objectstack objectql write path (rule-validator / record-validator) | none | any admin who sets required + visibleWhen in Studio; yes
    Thread-read: 6968076271
    Premise: holds (seat 3 hand-off 6968044822; L1-d merge-only ACCEPT 6968078436)
    Serial constraints cleared: overlap-check at 2026-11-18T03:44Z: conflicts with #34709 (packages/objectql/src/engine-update.ts, Tier H, waiting on its approver) and #34935 (packages/lint/src/validate-expressions.test.ts); whichever lands second merges main. Clean with #35089, #35085, #34817, #34791.
    Resume-from: claude/project-thread-9ubqgj@84d2f7370c37f81d57f1ffb4ad902bfb29755cdf
    Pre-claim lane: packages/objectql, packages/lint, packages/spec, ui/**, docs/adr/** of PR #34978 — repo:objectstack whole-repo lane, area o1-A; the ADR paths make it Tier H, handed to seat 1 for the approver.
    Pre-claim deps: no Blocked-by: on the card.
    Prior rulings read: route ruling 6956761249; seat rulings 6966073288; seat L2 FAIL 6963978999 at ab10c33f (M2, S2, S3 fixed at 2b709e12 per the hand-off); L1-d ACCEPT 6966084753 and 6968078436.

    Taking over seat 3's hand-off (seat 3 brief objectstack#34584 comment 6968205670; maintainer to seat 3, 2026-11-18 03:30Z: 「代码已推送,交给下一任,用信箱 交接给刚入座的 objectstack#1」; seat 1 split to area o1-A, maintainer 03:32Z: 「已经认领的4个 p1 也开工,不再认领新任务」 in the project thread). The card was released to pm:queue by seat 3, so this is a fresh claim that resumes the same branch and PR.

    Owed, in order: green CI on 84d2f737; the seat delta contract review ab10c33f..84d2f737; the Tier H seat record; seat 1 requests the approver. Never readied, queued or armed before the approval.

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

    @objectstack-fleet
    Contributor

    repo:objectstack#1 · os-warren · session_01JQwxbXGvw43spR79ztEvWt
    os-dev-report

    Stamp: 2026-11-18T06:20Z

    {
      "issue": 34905,
      "status": "done",
      "branch": "claude/project-thread-9ubqgj",
      "pr": "https://github.com/objectstack-ai/objectstack/pull/34978",
      "head": "8248f9ff5450a9de2fdced6792997cc93f94b639",
      "session": "session_01JQwxbXGvw43spR79ztEvWt",
      "premise_still_valid": true,
      "summary": "Fix round for the seat delta contract review 6968679220 (PASS at 84d2f737). S4 measured first and held: the disproof test (formula is_admin reading current_user.positions, admin_note required with visibleWhen record.is_admin, insert with no acting user and without admin_note) was accepted silently at 7f14821c. Fixed with the hop/label()/can mechanism: formulaValuesFor marks a formula reading the acting user (readsUserRoot: current_user, user, ctx, os) unservable when the write has no acting user, through the read closure at any depth, and returns noActingUser so evaluateRequiredWhenShown logs reason no-acting-user naming the chain. Prose brought into agreement (ADR-0113 amendment, ADR-0137 note, visibleWhen describe and regenerated references, formulaValues and evaluateRequiredWhenShown jsdoc, changeset, lint message and doc, Studio helper doc and en/zh strings), N8 folded in prose; N9/N10 open. Same 27 paths; PR body updated.",
      "tests": "Disproof at 7f14821c (before the fix): engine-required-when-shown.test.ts 1 failed / 33 passed of 34, the system-write insert accepted (AssertionError: expected false to be true). On 8248f9ff: that file 35/35; objectql typecheck + full suite 612 files, 13,764 passed; lint typecheck + full suite 218 files, 9,246 passed; ui requiredVisibleWhenReference.test.ts 9/9; ui check:i18n-keys, check:i18n-drift, check:i18n-dead-keys, check:designer-field-key-parity exit 0; spec build + check:generated: check:docs stale, gen:docs, re-run all 14 up to date. Ablations via scripts/ablation-replace.mjs (subject imported from src, no build between): new mark disabled, anchor 1 to 0, 2 of 35 red (both system-write pins), restore blob == HEAD 65304455, git diff HEAD empty; log flag forced off, anchor 1 to 0, 2 of 35 red (reason assertions), restore blob == HEAD 6dd81f48, git diff HEAD empty.",
      "gates": "dispatch-gates --commands on 8248f9ff derived 130 (stderr warned the tree is 19 commits behind origin/main, 1 derive-from file changed; main not merged per the order: overlap-check says origin/main merges cleanly). 127 exit 0 first pass; check:skill-examples, check:dual-build-cjs-loads exit 3 (prerequisite: no dist) and check:type-check-debt exit 3 (lock queue-timeout behind the dogfood battery); after pnpm build 120/120 all three re-run exit 0. --ran with exit codes: 130 run, 0 NOT-MEASURED (a derived zero). CI on 8248f9ff: 70 check runs, 61 success, 9 skipped, 0 failed.",
      "dogfood_battery": "8248f9ff · os-verify-lock VERDICT command-exit 0 · Test Files 479 passed, 3 skipped (482) · Tests 4,072 passed, 68 skipped (4,140) · no failures",
      "mcp_calls": "0",
      "api_writes": "2 relay writes: issue_patch on #34978 (PR body, read back identical, 28,277 bytes) and this comment on #34905. git push x2 not counted.",
      "open_questions": [],
      "security_findings": "none",
      "out_of_scope_findings": []
    }
  6. objectstack-fleet commented on Nov 18, 2026

    @objectstack-fleet
    Contributor

    triage#1 · hotlong · session_01Q4EjjMnyLqJdzuktEmRPXH

    Regraded p1 → p2: p1 is now kept for queue jumps. The maintainer, in triage's session: 「以后我都会要求专门作有一个专题…p1 是不是应该留给真的需要插队的」. He then confirmed triage's review of every open p1 (「确认」). Development is dispatched by epic, and an epic orders its own work. p1 is kept for cards that must jump ahead of it: a regression users meet in a released version, a broken hosted first impression or core flow, data loss or a breach in normal use, or a release or customer blocker.

    Why this card: one admin configuration (required and hidden on the same field); a detail, not a queue jump. Any claim on the card is unchanged.

  7. added
    priority:p2
    and removed
    priority:p1
    on Nov 18, 2026
  8. objectstack-fleet commented on Nov 18, 2026

    @objectstack-fleet
    Contributor

    repo:objectstack#1 · os-warren · session_01JQwxbXGvw43spR79ztEvWt
    os-dev-report

    {
      "issue": 34905,
      "status": "done",
      "branch": "claude/project-thread-9ubqgj",
      "pr": "https://github.com/objectstack-ai/objectstack/pull/34978",
      "session": "session_01JQwxbXGvw43spR79ztEvWt",
      "premise_still_valid": true,
      "summary": "Fix round on 8248f9ff. Merged origin/main twice (c8d5313d at main 961f4741, one conflict in packages/objectql/src/engine-update.ts resolved as a union; 6c9ded43 at main 55020c33, which contains #35116, clean), regenerated the merge-deferred object.mdx (6c0fd9ee). S5 and N11 closed in prose (aefc8aa2): ADR-0137 note and ADR-0113 parenthesis name the bare user-scope root reach of the no-acting-user mark, the server log reason says 'reads the acting user or a bare ctx/os root, and this write has no acting user (a system write)', the USER_SCOPE_ROOTS docblock keeps 'exact' for option visibility and calls the formula plan's reading conservative. The S3 known-limit prose is corrected for the form-side recompute (e6f0dcb4) in the ADR-0113 amendment, the visibleWhen TSDoc and describe (3 references regenerated), the formulaValues and evaluateRequiredWhenShown jsdoc, the changeset and the PR body. No logic change; file list unchanged at 27 paths.",
      "tests": "On e6f0dcb4: @objectstack/objectql typecheck + test: Test Files 612 passed (612), Tests 13835 passed (13835). @objectstack/spec typecheck; test: Test Files 853 passed (853), Tests 27335 passed | 1 todo. spec build + gen:schema + gen:docs + check:generated: all 14 generated artifacts up to date. No tested behaviour changed (prose and one unpinned log string), so no ablation.",
      "gates": "dispatch-gates --commands on e6f0dcb4: 131 families (same set as aefc8aa2); all 131 exit 0, captured before any pipe (check:skill-examples and check:dual-build-cjs-loads first exit 3 for missing dist, re-run after full pnpm build 120/120 tasks: exit 0). --ran: 131 run, 0 NOT-MEASURED, 0 UNRUN. CI on e6f0dcb4 (check-runs): 70 runs, 61 success, 9 skipped, 0 failed; Lint & Repo Gates, TypeScript Type Check, Test Core, Build Core, Governed Surface Queue Guard, Lint UI, Type Check UI, Test UI, Build & E2E UI, Live E2E UI, Dogfood Regression Gate all success; Check Changeset success.",
      "dogfood_battery": "e6f0dcb4 · os-verify-lock: VERDICT command-exit 0 · Test Files 480 passed | 3 skipped (483) · Tests 4075 passed | 68 skipped (4143) · no failures",
      "mcp_calls": "0",
      "api_writes": "2 — fleet-write relay issue_patch on #34978 (PR body, read-back identical 33439 bytes); post-stamped comment on #34905 (this report). Plus 3 git pushes.",
      "open_questions": [
        {
          "question": "With the form recomputing formulas (#35116), the lint warning on every required field whose visibleWhen reads a formula, and the Studio formula advisory (en, zh), still give 'the form does not recompute it' as their reason; the lint test pins 'does not recompute it'. Change what fires?",
          "options": [
            "A: narrow the lint warning and the Studio advisory to the unservable arm (hop, label(), can), dropping the plain formula-read warning; behaviour change, one more round",
            "B: keep both firing and reword only (the plain warning then has no divergence to name)",
            "C: leave as is and track on a follow-up card"
          ],
          "recommendation": "A, because the plain warning's only reason is now false on main, and the unservable arm is the one place form and server still differ."
        }
      ],
      "security_findings": "none",
      "out_of_scope_findings": [
        "carrier: open question above (lint/Studio formula-read warning text vs the form recompute) · noted, not filed"
      ]
    }
  9. objectstack-fleet commented on Nov 18, 2026

    @objectstack-fleet
    Contributor

    repo:objectstack#1 · os-warren · session_01JQwxbXGvw43spR79ztEvWt
    os-dev-report

    {
      "issue": 34905,
      "status": "done",
      "branch": "claude/project-thread-9ubqgj",
      "pr": "https://github.com/objectstack-ai/objectstack/pull/34978",
      "head": "1ca9b694b5",
      "session": "session_01JQwxbXGvw43spR79ztEvWt",
      "premise_still_valid": true,
      "summary": "Fix round on e6f0dcb4 for delta contract review 6977080790: one commit, 1ca9b694, text only, the same 27 paths, no merge of origin/main (overlap-check: merges cleanly). S6 (option B): the lint warning, its module doc, the validate-expressions.ts push-site comment, the Studio advisory (both keys, en and zh), the requiredVisibleWhenReference.ts module doc and jsdoc, and the ObjectFieldInspector.tsx comment no longer say the form does not recompute. What fires is unchanged. The plain formula read keeps one true reason that fits in a sentence: the server's computed value decides, and two checks still compute nothing (the wizard's final-submit check, and a form whose data source serves no object schema). The unservable arm now says the form shows the field and keeps it required. S7: ADR-0113 names both residual judges, verified at this head (gateFinalSubmit(mergedData) calls resolveFieldRuleState with no plan; useObjectFormulaPlan returns undefined when getObjectSchema is missing or its read rejects). WizardForm.tsx and objectFormulas.ts are untouched. N13: the stricter-form sentence names the expression-masked case (formulaRecord.ts marks 'has no expression served to this reader'). The commit uses the AGENTS.md model-free trailer pair, not the harness's model-named Co-Authored-By.",
      "changed_sentences": [
        "lint message, plain arm. OLD: 'The server judges that requirement on the formula computed over the record being written (ADR-0113 D1); the form judges it on the formula value it last read, does not recompute it while the user edits, and has none on a create. So a create, or an edit that moves the formula into the condition, can be refused naming a field the form keeps hidden. Read the formula's own inputs in the predicate if the form should follow the edit.' NEW: 'A reminder: the server judges that requirement on the formula value it computes over the record being written (ADR-0113 D1). The form computes the same formula over the record being edited; a check that does not (a wizard's final-submit check, or a form whose data source serves no object schema) judges the value last read, none on a create, and can disagree with the server.'",
        "lint message, unservable arm. OLD: '... the server counts the field as SHOWN on every write, so it stays required on every record, the ones the form hides it on included.' NEW: '... the server counts the field as SHOWN on every write, so it stays required on every record. The form cannot compute it either: it shows the field and keeps it required.'",
        "lint module doc, first bullet. OLD: 'The form does not recompute a formula. It judges the predicate on the formula value it last read, while the user edits, and a create form has none. A create, or an edit that moves the formula into the condition, is judged by the server on a value the form never showed, and can be refused naming a field the form keeps hidden.' NEW: 'The server's computed value decides. The form computes the object's formulas over the record being edited before it judges the predicate (ADR-0113, as amended), so for a formula it can compute it judges what the server judges. A check that computes none, a wizard's final-submit check or a form whose data source serves no object schema, judges the formula value last read, none on a create, and can disagree with the server; the warning is the reminder that the server's value decides.' Second bullet. OLD tail: 'the field stays required on every write, the records the form hides it on included.' NEW: 'the field stays required on every write. The form cannot compute such a formula either: it shows the field and keeps it required.' Lead-in. OLD: 'Two gaps the author can see at build time:' NEW: 'Two things the author can see at build time:'",
        "validate-expressions.ts comment. OLD: 'A `formula` the predicate reads: the form does not recompute it, and one the write path cannot compute keeps the field required on every write' NEW: 'A `formula` the predicate reads: a reminder that the server judges it on the formula value it computes at write time, and one the write path cannot compute keeps the field required on every write, shown by the form'",
        "lint test. Title OLD: 'warns when the predicate reads a formula field: the form does not recompute it' NEW: 'warns when the predicate reads a formula field: the server judges it on the formula it computes'. Pin OLD: toContain('does not recompute it') NEW: toContain('the formula value it computes over the record being written'). The comment above it is reworded the same way.",
        "Studio en requiredVisibleWhenFormula. OLD: 'The form shows the value it last read and does not recompute it while you edit (a new record has none), so a save can be refused naming this field while the form keeps it hidden. Read the formula's own inputs instead if the form should follow the edit.' NEW: 'The form computes the same formula as you edit; a wizard's final-submit check, or a form whose data source serves no object schema, judges the value it last read instead (a new record has none) and can disagree with the server.' The first sentence is unchanged.",
        "Studio zh requiredVisibleWhenFormula. OLD: '表单显示的是上次读取的公式值,编辑时不会重新计算(新建记录时没有值),因此保存可能因该字段被拒绝,而表单仍隐藏它。如需表单随编辑变化,请改为直接读取公式本身的输入字段。' NEW: '表单在你编辑时也会同样计算该公式;但向导最后提交时的检查,以及数据源不提供对象定义的表单,用的是上次读取的公式值(新建记录时没有值),可能与服务器的判断不一致。'",
        "Studio en requiredVisibleWhenFormulaUnservable. OLD tail: 'so it stays required on every record, including the ones this condition hides it on.' NEW: 'so it stays required on every record. The form cannot compute it either: it shows this field and keeps it required.'",
        "Studio zh requiredVisibleWhenFormulaUnservable. OLD tail: '因此按「显示」处理:所有记录(包括此条件隐藏该字段的记录)都仍要求填写。' NEW: '因此按「显示」处理:所有记录都仍要求填写。表单同样无法计算它:会显示该字段并保持必填。'",
        "requiredVisibleWhenReference.ts module doc. OLD: 'the form judges the formula value it last read, does not recompute it while the user edits, and has none on a create. So a save can be refused naming a field the form keeps hidden, and the advisory says so for any formula read.' NEW: 'and that value decides. The form computes the same formulas over the record being edited; a check that computes none (a wizard's final-submit check, or a form whose data source serves no object schema) judges the formula value last read, none on a create, and can disagree with the server. The advisory is that reminder, for any formula read.' The unservable clause adds 'and the form, which cannot compute it either, shows the field and keeps it required'. Function jsdoc OLD: 'the form judges the predicate on the formula value it last read and does not recompute it, while the server judges the record being saved.' NEW: 'a reminder that the server judges the predicate on the formula value it computes over the record being saved ... and the form shows it.'",
        "ObjectFieldInspector.tsx comment. OLD: 'a formula it reads is computed over the saved record there, while the form judges the value it last read; one the server cannot compute keeps it required on every save.' NEW: 'a formula it reads is computed over the saved record there, and that value decides; one the server cannot compute keeps it required on every save, and the form shows it.'",
        "ADR-0113, S7 (added): 'What is left: a wizard's final-submit gate (`gateFinalSubmit`, `WizardForm.tsx`) still judges `resolveFieldRuleState` over its merged form values with no formula plan, and a form whose data source has no `getObjectSchema`, or whose schema read fails, gets no plan (`objectFormulas.ts`) and computes nothing, so both judge the formula value last read, none on a create.'",
        "ADR-0113, N13. OLD: 'For a formula that reads `os` or calls `can()` the form can be stricter than the server, which may compute it and hide the field.' NEW: 'For a formula that reads `os`, calls `can()` or is served without its expression (a field-level-security mask) the form can be stricter than the server, which may compute it and hide the field.'"
      ],
      "tests": "On 1ca9b694. @objectstack/lint: typecheck plus check:test-typecheck OK; full suite Test Files 217 passed (217), Tests 9248 passed | 5 skipped (9253), VERDICT command-exit 0. The renamed pin by title: Tests 1 passed | 508 skipped. @object-ui/i18n: type-check exit 0 (after building its dependency closure); test Test Files 103 passed (103), Tests 1947 passed | 13 skipped. ui requiredVisibleWhenReference.test.ts: 9 passed (9). No ui test pins the advisory text. No ablation: prose and message strings only, and no tested behaviour moves.",
      "gates": "overlap-check vs origin/main 910306b632: VERDICT clean exit 0. dispatch-gates --commands on 1ca9b694: 131 families (the same set as e6f0dcb4). Each exit was captured before any pipe. The first runner pass read its list through a relative path, ran nothing, and was caught by an empty results file before it was re-run. Second pass: 124 exit 0 and 7 failed. Six exited 3, missing dist: lint check:doc-formula-expressions, lint check:doc-security-posture, spec check:skill-examples, check:docs-transcript-drift, check:dual-build-cjs-loads, check:lean-entry-closure. One exited 1, 'pnpm --dir ui exec vitest run scripts/': @objectstack/client had no build, so 1 test failed to import. After a full pnpm build (120 of 120 tasks, VERDICT command-exit 0), all 7 exit 0. pnpm check:i18n: exit 0, 'OK (10 package(s) — all bundles in sync'. ui check:i18n-drift: exit 0. dispatch-gates --ran with exit codes: 131 derived, 131 run, 0 NOT-MEASURED, 0 UNRUN (a derived zero). CI on 1ca9b694 from check-runs at report time: 74 runs, 61 success, 11 skipped, 2 in_progress. The 2 in progress are re-runs from the PR-body edit, Check Changeset among them; another Check Changeset run on the head is already success. All eleven required contexts are success: Lint & Repo Gates, TypeScript Type Check, Test Core, Build Core, Governed Surface Queue Guard, Lint UI, Type Check UI, Test UI, Build & E2E UI, Live E2E UI, Dogfood Regression Gate.",
      "dogfood_battery": "1ca9b694 · os-verify-lock: VERDICT command-exit 0 · Test Files 480 passed | 3 skipped (483) · Tests 4075 passed | 68 skipped (4143) · no failures",
      "mcp_calls": "0",
      "api_writes": "2 — fleet-write relay issue_patch on #34978. That is the PR body: the Verification section gains the S6/S7/N13 round, and three What-changes sentences that described the old lint reason are corrected. Read-back: 38482 bytes sent, 38482 stored, identical. The other write is a post-stamped comment on #34905 (this report). Also 1 git push.",
      "open_questions": [],
      "security_findings": "none",
      "out_of_scope_findings": [
        "carrier: repo:objectstack#1 seat — the WizardForm gateFinalSubmit residual and the no-getObjectSchema / failed-schema-read residual (objectFormulas.ts). Both are main's code, named in ADR-0113 here and not changed. Review 6977080790 section ③ routes them to their own card. Noted, not filed.",
        "carrier: repo:objectstack#1 seat — option A (narrow the lint and Studio warning set to the unservable arm), escalated in review 6977080790 section ③. Not done here, per the dispatch. Noted, not filed."
      ]
    }
  10. objectstack-fleet commented on Nov 18, 2026

    @objectstack-fleet
    Contributor

    repo:objectstack#1 · os-warren · session_01JQwxbabAdcWyApSTGBYJNY

    Close-out · 2026-11-18T15:29Z: PR #34978 merged at 2026-11-18T15:22Z as 0739dee, after os-zhuang's approval and queue. Fixes #34905 closed this card.

  11. removed
    pm:dispatched
    on Nov 18, 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

    domain:serverpriority:p2

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions