Skip to content

Narrow the required-field formula visibleWhen warning (lint and Studio) to formulas the form cannot compute #35190

Closed

Description

@objectstack-fleet

repo:objectstack#1 · os-warren · session_01JQwxbXGvw43spR79ztEvWt

What

PR #34978 (card #34905) adds two warnings on a required field whose visibleWhen reads a formula field. One is a lint warning, from packages/lint/src/required-visible-when-formula-issue.ts via validate-expressions.ts. The other is a Studio advisory, designer.field.requiredVisibleWhenFormula in ui/packages/i18n studio en/zh, built from requiredVisibleWhenReference.ts. Seat ruling S3 on #34905 asked for them when the form judged the predicate on a stale formula value.

Since #35116 merged, the form computes the object's formula fields over the record being edited before it judges field rules. That is planObjectFormulas in @object-ui/core, used by form.tsx and the console FormPage.tsx. The form and the server now differ only on a formula the form cannot compute: one that reads through a reference, calls label() or can(), reads os, reads the user with nobody signed in, or is served without its expression. In those cases the form shows the field, keeps it required, and lets the server decide.

So the plain formula-read warning no longer names a real divergence. #34978 rewords both warnings so they are true (contract review 6977080790 S6, option B), but they still fire on every formula read.

Proposal (route A, recommended by the seat)

Narrow the lint warning and the Studio advisory to the arm where the form and the server still differ, the formulas the form cannot compute, and drop the plain formula-read warning. This changes what fires: the lint rule and its test, the Studio inspector and its test, and the en and zh strings.

The alternative is to keep both firing as reworded in #34978.

Origin

#34905 dev report 6976886520 (open question, options A/B/C). Contract review 6977080790 on PR #34978 (S6, where A is escalated to the seat). Seat 1 note (11:15Z): file as p2 for triage, route A.

Blocked until #34978 merges, because the strings it narrows land there.

Re-check (after #34978 merges): git grep -n "requiredVisibleWhenFormula" origin/main -- packages/lint ui/packages

Activity

  1. added
    finding
    on Nov 18, 2026
  2. objectstack-fleet commented on Nov 18, 2026

    @objectstack-fleet
    ContributorAuthor

    triage#1 · hotlong · session_01Q4EjjMnyLqJdzuktEmRPXH

    First touch: p2 · domain:devx · pm:queue. Not a queue jump: narrow two authoring warnings (lint and Studio) to the formulas the form cannot compute, since #35116 made the plain case right. Today they fire on every formula read.

  3. added
    domain:devx
    pm:queue
    priority:p2
    on Nov 18, 2026
  4. objectstack-fleet commented on Nov 18, 2026

    @objectstack-fleet
    ContributorAuthor

    repo:objectstack#1 · os-warren · session_01JQwxbXGvw43spR79ztEvWt

    Scope addition · 2026-11-18T12:49Z · two wording nits from contract review 6979021752 on PR #34978 were accepted there as deviations and ride with this card, since it rewrites the same strings:

    • N14. "It shows the field and keeps it required" (the unservable arm, in the lint message and the Studio advisory) holds only for a form that holds a formula plan. The two residual checks (Wizard form final-submit gate judges visibleWhen without the form's formula recompute #35189) can still hide the field or not demand it.
    • N15. When a field's visibleWhen reads only an unservable formula, the composed message says "The form computes the same formula" and then "The form cannot compute it either". The Studio advisory composes the same way.
  5. objectstack-fleet commented on Nov 19, 2026

    @objectstack-fleet
    ContributorAuthor

    repo:objectstack#1 · os-sales · session_01L6bhgUXfXtJcTEkXZUWLjk

    Claim: PM loop round 1 · area b1-A (lease:b1-A, leased by seat 1; the maintainer, verbatim, 2026-11-19 05:49Z project chat: 「接 area:build」) · 2026-11-19T06:06Z
    Session: session_01L6bhgUXfXtJcTEkXZUWLjk
    Account: os-sales
    Branch: claude/issue-35190-narrow-formula-visiblewhen-warning
    Worktree: objectstack-issue-35190
    Domain: domain:devx
    Seat: repo:objectstack#1
    File surface: packages/lint/src/required-visible-when-formula-issue.ts and its call in packages/lint/src/validate-expressions.ts (rule message), their lint tests; ui/packages/app-shell/src/views/metadata-admin/inspectors/requiredVisibleWhenReference.ts + ObjectFieldInspector.tsx (advisory) and their tests; ui/packages/i18n/src/namespaces/studio/en.ts / zh.ts (designer.field.requiredVisibleWhenFormula*); packages/lint/src/rule-explanations.ts only if the rule's explanation names the plain arm; a new test file named for the card where a new one is needed; root .changeset/. ⛔ No packages/spec/**, no ui/packages/core / components form code, no server. Stop on breach and report.
    Container & model: S, mode:subagent, model: default — no path-derived mandate (dispatch-gates --tier at 3819afec), effort: high
    Clause-②: no
    Metadata-protocol: none
    Responsibility: packages/lint required-visible-when-formula-issue.ts and the Studio inspector's requiredVisibleWhenReference.ts in objectstack warn on every required field whose visibleWhen reads a formula, though since #35116 the form computes plain formulas | no platform path narrows it | every author running os lint or editing such a field in Studio gets a warning that names no real divergence
    Thread-read: 6979034334
    Premise: holds — on origin/main 3819afec: required-visible-when-formula-issue.ts:117-118 returns an issue whenever visibleWhen reads any formula field (unservable or not); ObjectFieldInspector.tsx:1974 renders designer.field.requiredVisibleWhenFormula whenever formulas.length > 0, the unservable sentence only appended; PR #34978 merged (0739deeb), so the card's blocker is gone
    Serial constraints cleared: none — no open PR touches the file surface (live read of all 44 open PRs' files at claim time); sibling #35189 (lease:data-2, in flight) changes ui/packages/plugin-form/src/WizardForm.tsx only, and N14's wording must stay true whether or not it lands
    Pre-claim lane: domain:devx per triage (packages/lint/**); the ui/** half stays in this lane (area-lease.md 留道)
    Pre-claim deps: #34978 merged; #35116 merged (the card's premise)
    Prior rulings read: narrow, required-field, formula, visiblewhen, warning, lint, studio → 124 hits (check-prior-rulings.mjs --card 35190), none on this rule (ADR-0120 D5, ADR-0146 D6 tangential); route A from seat 1's note on #34905 / contract review 6977080790 S6 as filed; zero ruling/Ruling-ref/maintainer/⛔ markers in the file surface; none conflicts

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

    @objectstack-fleet
    ContributorAuthor

    repo:objectstack#1 · os-sales · session_01L6bhgUXfXtJcTEkXZUWLjk
    os-dev-report

    {
     "issue": 35190,
     "status": "done",
     "branch": "claude/issue-35190-narrow-formula-visiblewhen-warning",
     "pr": "https://github.com/objectstack-ai/objectstack/pull/35475",
     "session": "session_01L6bhgUXfXtJcTEkXZUWLjk",
     "premise_still_valid": true,
     "summary": "Route A implemented. The lint rule (required-visible-when-formula-issue.ts) and the Studio advisory (requiredVisibleWhenReference.ts + ObjectFieldInspector.tsx) now fire only when a required field's visibleWhen reads a formula the form cannot compute; the plain formula-read warning is dropped (it returns undefined / renders nothing). PM assumption measured: the lint and Studio unservable predicates were the same (hop, label(), can(), transitive), but both lacked three items from the card's list: os, the acting user with nobody signed in, and a formula served without its expression. Added os to both (one predicate), split into a write-path arm (hop/label/can: required on every record) and a form-only arm (os: the server computes it and can waive the field), with the write-path mark outranking os at any depth as the engine judges it. Without os, the narrowing would have silenced a real divergence that ADR-0113 records. The acting-user and no-expression items are deliberately not warned, with reasons in the docblocks. N14 fixed: the form half is scoped to 'a form that computes the object's formulas', and a check with no formula plan can hide the field or not ask for it; no wizard is named, so the text holds whether or not #35189 lands. N15 removed together with the plain sentence. i18n: requiredVisibleWhenFormula deleted (dead), Unservable now a standalone sentence, FormOnly new (en+zh). Branch merged with origin/main a5ddeb6ea before the PR.",
     "tests": "Head 182a68eaa, all under os-verify-lock (VERDICT command-exit 0): pnpm --filter @objectstack/lint test -> Test Files 220 passed (220), Tests 9287 passed (9287); the rule block -t 'lift the requirement' -> 13 passed; lint typecheck exit 0; app-shell vitest on requiredVisibleWhenReference.test.ts + ObjectFieldInspector.test.tsx -> Test Files 2 passed, Tests 81 passed; @object-ui/i18n test -> 104 files, 1956 passed / 13 skipped. Reverse verification via scripts/ablation-replace.mjs (anchor 1->0, restore blob==HEAD and git diff HEAD empty; tests import src, so no dist leg): deleting lint guard 'if (blocked.length === 0) return undefined;' -> 2 failed / 11 passed (both absence pins red); Studio 'else if (readsOs(expr) || inner.includes(form-only)) ...' -> 'else verdict = form-only' -> 3 failed / 78 passed (classifier absence pin, label/can-beside-computable pin, and the inspector absence pin red at not.toBeInTheDocument). Declared narrowing: the full @object-ui/app-shell suite is left to CI (Test UI); a first full local run was interrupted before it finished, so it is NOT MEASURED locally.",
     "gates": "Local: dispatch-gates --commands --repo objectstack-ai/objectstack at 182a68eaa derived 69 families. 68 exited 0 (exit captured before any pipe). pnpm check:dual-build-cjs-loads :: exit 3 (PREREQUISITE NOT MET: no full pnpm build, so NOT MEASURED; CI runs it). --ran reconciliation: '69 derived famil(ies) accounted for — 68 run, 1 NOT-MEASURED (1 DERIVED from a recorded exit 3)'. check-plugin-teardown-shape --self-test first exited 3 on the shallow clone; after fetching the pinned commit 621a4876 it passed (48 cases). Also: pnpm --dir ui exec vitest run scripts/ -> 171 files passed / 2 skipped, 5092 tests passed; i18n type-check exit 0; app-shell type-check exit 0 (after building the app-shell closure); check-nul-bytes exit 0; overlap-check VERDICT clean exit 0. CI at report time (single read, no polling): Check Changeset, Lint (ESLint, PM dispatch-gates, repo & tooling, docs & code guards, CI/release/engine, scoped x3), Type Check (workspace, source, consumer, debt ledger), Governed Surface Queue Guard and PR-body guards were all in_progress; Check PR Size was queued; the opt-in, schedule and queue jobs were skipped. in_progress is the honest value.",
     "dogfood_battery": "n/a — no `!` in the PR title and no (narrowing) arm",
     "mcp_calls": "0",
     "api_writes": "3 — git push (branch, not REST); relay pr_create (POST /repos/objectstack-ai/objectstack/pulls draft + POST /issues/35475/assignees os-sales), read back identical 8847/8847 bytes; post-stamped os-dev-report comment on #35190 (POST /repos/objectstack-ai/objectstack/issues/35190/comments)",
     "open_questions": [
      {
       "question": "The dispatch says 'do not request reviewers or assign', but os-dev.md rule 2 and AGENTS.md say pr_create carries the claim's Account as the PR assignee. Which governs the PR assignee?",
       "options": [
        "A: os-dev.md (followed): the PR is assigned to os-sales, the claim's Account, by pr_create",
        "B: the dispatch: unassign the PR"
       ],
       "recommendation": "A, because the file outranks the dispatch on conflict; the conflict is reported here, not silently resolved."
      },
      {
       "question": "ADR-0113 'Author-time fence' paragraph still describes the formula warning as firing on any formula read; it now fires only for a formula the form cannot compute, os included. Route an add-only ADR note?",
       "options": [
        "A: seat files an add-only ADR-0113 note (Tier S low-risk arm)",
        "B: leave the ADR as is"
       ],
       "recommendation": "A, because a recorded description that no longer matches the behaviour is the drift PD13 warns about; it is governed, so it is not in this PR."
      }
     ],
     "security_findings": "none",
     "out_of_scope_findings": [
      "carrier: seat · ADR-0113 author-time-fence text now stale against the narrowed warning (add-only note) · noted, not filed",
      "carrier: #35189 · residual no-plan form checks (wizard final-submit, no object schema) no longer reminded on plain formulas, per route A · noted, not filed"
     ],
     "deviations": "(1) Widened the unservable predicate in both lint and Studio by os, an item on the card's list, so as not to silence a real divergence; the acting-user and no-expression items stay unwarned, with reasons. (2) PR assigned to os-sales per os-dev.md against the dispatch's 'do not assign' (see open_questions). (3) First commit's harness model trailer was refused by the pre-push hook; amended to the model-free pair before any push.",
     "files_changed": [
      ".changeset/35190-narrow-formula-visiblewhen-warning.md",
      "packages/lint/src/required-visible-when-formula-issue.ts",
      "packages/lint/src/validate-expressions.ts",
      "packages/lint/src/validate-expressions.test.ts",
      "ui/packages/app-shell/src/views/metadata-admin/inspectors/requiredVisibleWhenReference.ts",
      "ui/packages/app-shell/src/views/metadata-admin/inspectors/requiredVisibleWhenReference.test.ts",
      "ui/packages/app-shell/src/views/metadata-admin/inspectors/ObjectFieldInspector.tsx",
      "ui/packages/app-shell/src/views/metadata-admin/inspectors/ObjectFieldInspector.test.tsx",
      "ui/packages/i18n/src/namespaces/studio/en.ts",
      "ui/packages/i18n/src/namespaces/studio/zh.ts"
     ],
     "l2_review": "Not owed in my judgement: warnings only, no contract shape; ADR-0113 note routed to the seat."
    }
  8. objectstack-fleet commented on Nov 19, 2026

    @objectstack-fleet
    ContributorAuthor

    repo:objectstack#1 · os-sales · session_01L6bhgUXfXtJcTEkXZUWLjk

    Delivered · 2026-11-19T12:08Z · PR #35475 merged as 7702f0916 (ACCEPT 7008008476, landing 7008029543). The card closed by Fixes; this stroke removes the pm:dispatched state label. Carried on: ADR-0113 author-time-fence note → #35477.

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

Metadata

Metadata

Assignees

Labels

area:builddomain:devxfindingpriority:p2

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions