Skip to content

Wizard form final-submit gate judges visibleWhen without the form's formula recompute #35189

Closed

Description

@objectstack-fleet

repo:objectstack#1 · os-warren · session_01JQwxbXGvw43spR79ztEvWt

What

#35116 made the form compute the object's formula fields over the record being edited before it judges field rules. That is planObjectFormulas (ui/packages/core/src/evaluator/formulaRecord.ts), applied in ui/packages/components/src/renderers/form/form.tsx (ruleRecord = formulaPlan.compute(...)) and ui/apps/console/src/components/FormPage.tsx.

One form-side judge was not changed. gateFinalSubmit in ui/packages/plugin-form/src/WizardForm.tsx (about line 865) calls resolveFieldRuleState over mergedData, the last-read record, with no formula plan. Per the file's own comment (about line 729), a simple form's mobile stepper also submits through it.

So on a wizard, or on the mobile stepper, a required field whose visibleWhen reads a formula is judged on the stale formula value. After an edit that moves the field out of (or into) the condition, the final-submit gate can demand a field the server does not require, or skip one it does.

A smaller residual in the same family: in ui/packages/components/src/renderers/form/objectFormulas.ts, a data source without getObjectSchema, or a failed schema read, yields no plan. The form then judges on the stored value.

Cheapest disproof

Write one WizardForm test. Give it a required field whose visibleWhen reads a formula, make an edit that moves the formula value out of the condition, then final-submit. Today the gate judges the pre-edit value.

Origin

Contract review 6977080790 on PR #34978 (S7, read, not run). PR #34978 records the residual in ADR-0113. The fix belongs to #35116's surface (card #35033's area), not #34978's.

Re-check: git grep -n "resolveFieldRuleState\|planObjectFormulas" origin/main -- ui/packages/plugin-form/src/WizardForm.tsx

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:ui · pm:queue. Not a queue jump: the wizard and mobile stepper final-submit gate still judges a formula-read visibleWhen on the stale value, a detail left after #35116.

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

    @objectstack-fleet
    ContributorAuthor

    repo:objectstack#5 · os-bill · session_01Utp6CajiB6BSQKWowy6YLB

    Claim: PM loop round 1 · area data-2 (lease:data-2, leased by seat 5; the maintainer, verbatim, 2026-11-19 project chat: 「再开 area:data」, p1/p2 only) · 2026-11-19T04:43Z
    Session: session_01Utp6CajiB6BSQKWowy6YLB
    Account: os-bill
    Branch: claude/issue-35189-wizard-gate-formula
    Worktree: objectstack-issue-35189
    Domain: domain:ui
    Seat: repo:objectstack#5
    File surface: ui/packages/plugin-form/src/WizardForm.tsx (gateFinalSubmit and how it obtains the object's formula plan), reuse of ui/packages/components/src/renderers/form/objectFormulas.ts / ui/packages/core/src/evaluator/formulaRecord.ts read-only unless an export is missing, a new test file named for the card, root .changeset/. ⛔ No packages/spec/**, no server, no new i18n key. Stop on breach and report.
    Container & model: M, mode:subagent, model: default — no path-derived mandate, effort: high
    Clause-②: no
    Metadata-protocol: none
    Responsibility: ui plugin-form WizardForm.tsx in objectstack judges a formula-read visibleWhen on the pre-edit formula value at final submit (wizard and the simple form's mobile stepper); no platform path covers it (#35116 fixed form.tsx and FormPage.tsx only); every wizard / mobile-stepper user of an object whose required field's visibleWhen reads a formula
    Thread-read: 6977711957
    Premise: holds — on origin/main de8d5497: WizardForm.tsx:875 calls resolveFieldRuleState( inside gateFinalSubmit and the file has no planObjectFormulas reference (the card's own re-check grep)
    Serial constraints cleared: none — no open PR touches ui/packages/plugin-form/src/** (live read of all 44 open PRs' files at claim time; #35129 touches only plugin-form CHANGELOG/package.json)
    Pre-claim lane: domain:ui (ui/packages/plugin-form/**)
    Pre-claim deps: none named; source #35116 and PR #34978 merged/closed
    Prior rulings read: wizard, gateFinalSubmit, visibleWhen, formula, planObjectFormulas → ADR-0113 (formula paragraph; PR #34978 recorded this residual there) binds: form judges rules on the record being written with formulas computed; contract review 6977080790 (S7) is the origin; none conflicts

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

    @objectstack-fleet
    ContributorAuthor

    repo:objectstack#5 · os-bill · session_01Utp6CajiB6BSQKWowy6YLB
    os-dev-report

    {
      "issue": 35189,
      "status": "done",
      "branch": "claude/issue-35189-wizard-gate-formula",
      "pr": "https://github.com/objectstack-ai/objectstack/pull/35348",
      "head": "f2cc860ab2ff597693b0412bfa99eb8b136d26ac",
      "session": "session_01Utp6CajiB6BSQKWowy6YLB",
      "premise_still_valid": true,
      "summary": "WizardForm plans the object's formula fields once from the object schema it already reads (planObjectFormulas from @object-ui/core, for the predicate scope's acting user; no new export, no second read). gateFinalSubmit judges resolveFieldRuleState and the view-level visibleOn on formulaPlan.compute(record), the value the written record would serve, as form.tsx and FormPage.tsx do (ADR-0113 formula paragraph); emptiness is still read off the written record. A visibleWhen reading an unservable formula is dropped in the gate (plan.unservableReadsOf), the way the step form drops it: shown, keeps required, no fault. The no-plan residual (no getObjectSchema / failed schema read) is unchanged and recorded in the PR body. The first run was blocked by commit refusals; the maintainer's authorisation, relayed by the coordinator, cleared them, and the staged work was committed unchanged.",
      "files_changed": [
        "ui/packages/plugin-form/src/WizardForm.tsx (+30/-4)",
        "ui/packages/plugin-form/src/__tests__/wizardFormulaGate-35189.test.tsx (new)",
        ".changeset/35189-wizard-gate-formula.md (new, @object-ui/plugin-form patch; Clause-②: no; Metadata-protocol: none, measured on the diff, matches the claim)"
      ],
      "line_budget": "219 changed lines (+215/-4, 3 files); under the ~400 stop line",
      "readings": {
        "A1": "holds: on de8d5497 gateFinalSubmit called resolveFieldRuleState over record (= mergedData from handleStepSubmit) with no formula plan, and the file had 0 planObjectFormulas references. No other per-step rule judge exists in WizardForm; the step forms render through SchemaRenderer to form.tsx, which plans formulas from the renderer CONTEXT's dataSource.",
        "A2": "holds without a new export: @object-ui/core already exports planObjectFormulas and ObjectFormulaPlan, and the wizard already holds objectSchema from its own getObjectSchema read. withoutUnservableVisibleWhen is not exported from components, so the gate uses plan.unservableReadsOf directly.",
        "A3": "holds: with the base WizardForm (planObjectFormulas count 0), the new file gave 3 failed / 2 passed (5): the out-of-condition, into-condition and unservable legs were red, and both no-formula CONTROLS were green. The fixed file was restored with a matching blob hash 02be997cb77fa3f4bad42033f233808dbd6e820f before and after. The red leg ran before the commit (commits were refused then), so the restore is proven by byte hash."
      },
      "tests": "pnpm --dir ui exec vitest run --maxWorkers=2 packages/plugin-form/src/__tests__/wizardFormulaGate-35189.test.tsx: with the fix VERDICT command-exit 0, Tests 5 passed (5); with the base WizardForm VERDICT command-exit 1, Tests 3 failed / 2 passed (5). Package: pnpm --dir ui exec vitest run --maxWorkers=2 packages/plugin-form/ gave VERDICT command-exit 0, Test Files 238 passed (238), Tests 2678 passed / 1 skipped. pnpm --filter @object-ui/plugin-form type-check gave VERDICT command-exit 0, and tsc -p tsconfig.test.json --listFiles includes the new test. Closure was built first with pnpm --workspace-concurrency=2 --filter '@object-ui/plugin-form^...' build, VERDICT command-exit 0. These runs were on the tree that was committed byte-for-byte as f2cc860a (staged content, committed without changes).",
      "gates": "dispatch-gates --commands --repo objectstack-ai/objectstack derived 38 commands for the 3 paths. 37 exited 0; pnpm --dir ui exec vitest run scripts/ was OOM-killed on the first unlocked pass and re-ran under the lock with --maxWorkers=2: VERDICT command-exit 0, 171 files passed / 2 skipped. The --ran reconciliation gave 38 derived, 38 run, 0 NOT-MEASURED, 0 UNRUN. node scripts/pm/overlap-check.mjs at f2cc860a gave VERDICT clean exit 0 (merges cleanly with origin/main e4bfa339; 0 PR heads overlap). PR #35348 check-runs at the time of the report: Check Changeset, Check PR Size, Governed Surface Queue Guard, Lint (ESLint, PM dispatch-gates, docs and code guards, repo and tooling gates, CI release and engine gates, three scoped lanes), PR-body guards and Type Check (consumer gates, debt ledger, source gates, workspace) are all in_progress; the opt-in, queue and schedule jobs were skipped. in_progress is the honest value here.",
      "dogfood_battery": "n/a: no ! in the PR title and no (narrowing) arm",
      "mcp_calls": "0",
      "api_writes": "2: the relay pr_create (POST /repos/objectstack-ai/objectstack/dispatches, run 44467856705, which created pull #35348 plus POST issues/35348/assignees os-bill; the read-back showed 4912 bytes sent and 4912 stored, identical) and this os-dev-report comment via post-stamped (POST issues/35189/comments). There were also two git pushes: the empty landing push and the push of f2cc860a.",
      "deviations": [
        "Commits were refused by the permission classifier in the first run (Destructive or Unwanted Actions, four times); this run proceeded only on the maintainer's relayed authorisation.",
        "The red leg ran before the commit, against the staged fix; the restore was proven by a blob-hash match instead of a HEAD checkout.",
        "The test mounts WizardForm inside SchemaRendererProvider, as a host does; the gate's refusal is asserted on its own observable (wizard-step:s2 data-error=true, update not called)."
      ],
      "open_questions": [],
      "security_findings": "none",
      "out_of_scope_findings": [
        "carrier: none · noted, not filed (PR Acceptance notes). The step form (form.tsx useObjectFormulaPlan) reads its data source only from the SchemaRendererProvider context, while WizardForm also takes an explicit dataSource prop. A host passing only the prop gets a gate that computes formulas and a step form that judges the stale value. On an into-condition edit, the gate refuses and opens a step whose form hides the field. Before this PR, the server's 400 named the same hidden field. Reach unmeasured. Dedupe words: useObjectFormulaPlan context dataSource, wizard step form formula, explicit dataSource prop formula plan.",
        "carrier: none · noted (dispatch section 3): the second residual is unchanged. A data source without getObjectSchema, or a failed schema read, gives no plan, and the gate judges the record as held."
      ]
    }
  7. objectstack-fleet commented on Nov 19, 2026

    @objectstack-fleet
    ContributorAuthor

    repo:objectstack#5 · os-bill · session_01Utp6CajiB6BSQKWowy6YLB

    Closed-out · area data-2 · 2026-11-19T06:32Z

    reading value
    PR #35348 MERGED through the merge queue as 1aac465fe1 (Fixes #35189; this card closed completed)
    contract record none owed (Clause-②: no, confirmed in L1-a ACCEPT 7001364138)

    Delivered: the wizard's final-submit check (and the simple form's mobile stepper, which submits through it) computes the object's formula fields over the record being written before judging visibleWhen / requiredWhen / readonlyWhen, as the simple form does since #35116; a visibleWhen reading an uncomputable formula counts as shown and keeps required.
    Unchanged (documented fallback, no card owed per L1-a): no getObjectSchema or a failed schema read → no plan → judged on the record as held.
    State: pm:dispatched removed; card closed.

  8. 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:datadomain:uifindingpriority:p2

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions