Repository navigation
Backlog
Backlog
Studio form editor: re-home or retire the "required field in a gated section" author-time check#39852
Feature
Copy link
Labels
area:builddomain:uiDomain lane — seat card indexed by label:pm:seatpm:queueReady for the PM dispatch looppriority:p3
Description
repo:objectstack@os-elon-musk · os-elon-musk · session_016WV4cwiNRyb9B38wT2fjYj
维护者速读
- 问题:表单里把对象必填的字段放进“按人或按条件才显示”的分区,看不到该分区的登录用户提交时会被拒绝,报错点名一个他看不到的字段。原来拦这种表单的设计时检查自协议 19 起已触发不到;目前仓内示例里没有一张表单是这样做的,属于防未来(尤其是 AI 生成的表单)的检查。
- 选项:A 把检查放进 Studio 表单设计器——但设计器本身没有“分区显示条件”这个控件,这种表单只能从源码、接口或 AI 写出来,设计器里拦不到源头,约 1 个 PR;B 正式放弃,作者无任何提醒,最终用户提交时才报错,约 1 个小的文档 PR;C(卡上没有)把检查做成平台统一的元数据校验规则,命令行校验和发布表单时都会拒绝并给出三种改法,Studio 发布时显示同一条拒绝,约 1 个 PR。
- 推荐:C。理由:这类表单只可能从设计器之外写出来,只有统一校验规则能在每个入口都拦住,而且不会再因为某个编辑器改版而悄悄失效(这次就是这样丢的)。
- 不定会怎样:检查处于“写在决策记录里、实际不存在”的状态;作者和 AI 可以做出登录用户无法提交的表单,没有任何提示,问题只在最终用户提交时暴露。
速读已按 Fable 档分析补齐 · 2026-12-06T02:35Z(原推荐「待分析后补」→ 现推荐 C:做成平台统一的元数据校验规则,卡上原来只有 A、B);分析见本卡最新的 at-tier 评论。
Context
Follow-up of card #39003 item 2, second arm ("or moved to the form item designer if it still lacks those features"), carried out of PR #39783 so that PR stays decision-neutral. The maintainer chose, in the project thread on 2026-12-06T01:43Z, to record the gap and decide it on its own card.
Facts (from contract review 7431562202, M1):
- The author-time fence was landed by maintainer ruling (5749269225 letter c and 5831744213 on objectui#6900). ADR-0113 named it as what covers the gated-section case the save-time validator leaves out.
- It was mounted only in the
viewinspector; since protocol 19 it was unreachable forformitems, and PR fix(console): remove Studio form-view leftovers, package-less scope references and nav resolver staleness #39783 removes its code (requiredInGatedSection.tsand its tests). ADR-0113 line 410 keeps its paragraph plus a dated note pointing here. - The hazard is live on
formitems:FormSchematakes the form body by reference,FormSectionSchema.visibleWhencan bindcurrent_user, the server reads no form, and@objectstack/linthas no equivalent rule. - A
formeditor exists:ui/packages/app-shell/src/views/studio-design/publicForm/PublicFormsDesigner.tsxplaces object-required fields into named sections, andpublicFormDesign.ts#sectionBodykeeps a stored section's keys,visibleWhenincluded.
Options
- A: re-home the fence on the
formeditor (restore the pure check frommainbefore fix(console): remove Studio form-view leftovers, package-less scope references and nav resolver staleness #39783, wire it to the form designer's save gate, add tests); ADR-0113 line 410 note updated to say where it lives. - B: retire the fence; ADR-0113 records the retirement and that a required field in a gated section is answered by the record save's refusal.
Metadata
Metadata
Assignees
Labels
area:builddomain:uiDomain lane — seat card indexed by label:pm:seatpm:queueReady for the PM dispatch looppriority:p3
Activity
objectstack-fleet commentedon Dec 6, 2026
triage@hotlong · hotlong · session_01Q4EjjMnyLqJdzuktEmRPXH
Triage (first touch): decision card, stays in the inbox · area:build · domain:ui · Feature · p3 as filed, touched 2026-12-06T02:24Z. Rationale:
area:ux→area:build: the question is whether wrong form metadata (a required field in a section that can hide) is refused at authoring time in Studio — North Stararea:build② "wrong metadata is loudly refused with a prescription". Issue type set to Feature.objectstack-fleet commentedon Dec 6, 2026
triage@hotlong · hotlong · session_01Q4EjjMnyLqJdzuktEmRPXH
Decision analysis at tier, re-run before presenting · 2026-12-06T02:34Z
维护者速读
Analysis
Served-tier:
CONTRACT_REVIEW_TIERAnalysed-by:
subagent of session_01Q4EjjMnyLqJdzuktEmRPXHRead at: objectstack
origin/maineecae948ad. hotcrm local checkout235106f3(inventory only). Cloud not read (the decision does not touch it).Background
A
formitem's section can carry avisibleWhenpredicate. The record save judges the object's field definitions and never reads a form. So a section that hides for some user, holding a field the object requires, gives that user a form they cannot submit: the client skips the hidden rows, the server refuses the save and names a field the user cannot see.The maintainer ruled on this twice. On #13252 (ruling comment 5468998814, 2026-08-30, verbatim 「同意」): option B, the authoring side refuses this arrangement at save/arrangement time; option C, a record validator that reads form metadata, is explicitly rejected. The execution card was objectstack-ai/objectui#6900, where rulings 5749269225 (letter c) and 5831744213 placed the refusal in Studio's
viewinspector as a Save-blocking issue.Protocol 19 (ADR-0159 D7) made
viewlists-only and forms their ownformtype. The inspector's form branch can no longer be reached. PR #39783 removes that branch and the check's module; contract review 7431562202 (finding M1) refused to let the PR record "the save-time refusal answers it" as a decision nobody ruled. This card carries that open question.Governing text
docs/adr/0113-required-write-contract-vs-column-constraint.mdline 410 onorigin/main: "the validator does not consume view metadata (ruled on [Decision] Should the server-side required check read a form section visibleWhen predicate? (objectui#6237 semantic 1, cross-repo half) #13252; Studio's gated-section fence covers the section case at authoring)." (git show origin/main:docs/adr/0113-required-write-contract-vs-column-constraint.md | sed -n 407,411p)ui/packages/app-shell/src/views/metadata-admin/inspectors/requiredInGatedSection.tsdocblock (still onorigin/main): the ruled fence covers only predicates readingcurrent_userand its aliases,features,app,page; "Arecord/previouspredicate, a bare field, a constant and the reverse-directionparentdraw nothing".docs/NORTH-STAR.mdline 18,area:build②: "wrong metadata is loudly refused with a prescription"; line 171: "what is wrong must be loudly refused with a prescription, never silently stored".formitem's one Studio editor.gh api repos/objectstack-ai/objectui/issues/comments/5749269225and.../5831744213both answer HTTP 403 (GitHub API access to that repository is not enabled for this session; only anonymous git reads are, and issue comments are not in git). Their content is read here only through the in-tree citations above (the module docblock,ViewVariantInspector.tsxline 325 to 330, the app-shell CHANGELOG entry402a266). The exact words of letter c were not read.Protocol statement
docs/adr/**, Tier H) that withdraws a ruled fence.@objectstack/lint's published rule set, and metadata that parses today would be refused atos validateand at theformpublish door. The semver level for a new gating rule was not measured here; the dev takes it from the changeset gate.Premises, re-checked
origin/maineecae948ad2418c09d, not merged). The module and its three tests are still onorigin/main, unreachable.gh api repos/objectstack-ai/objectstack/pulls/39783 --jq '.state,.merged,.draft';git ls-tree -r --name-only origin/main | grep requiredInGatedSectionViewKindSchemaisenumWithRetiredValues(['list'], { form: … });PROTOCOL_VERSION = '19.0.0'.git grep -n "export const ViewKindSchema" origin/main -- packages/spec/src/ui/view.zod.tsFormSchematakes the form body by reference; sectionvisibleWhenbindscurrent_userformItemBodyShape()spreadsFormViewSchema.shape; the section docblock sayscurrent_userbinds client-side under a host that publishes a scope.git grep -n "formItemBodyShape|DOES bind here" origin/main -- packages/spec/src/ui/view.zod.ts@objectstack/linthas no equivalent rulerequired.git grep -n -i "required.*section|section.*required" origin/main -- packages/lint/src ':!*.test.ts'→ no ruleformeditor exists and keeps a stored section'svisibleWhenvisibleWhenoccurs 0 times in both designer files;sectionBodyonly spreads the stored section. The editor already has a Save gate of this family (missingRequiredFields, Save disabled while an object-required field is off the form).git show origin/main:ui/packages/app-shell/src/views/studio-design/publicForm/PublicFormsDesigner.tsx | grep -c visibleWhen→ 0; same forpublicFormDesign.ts→ 0formitems"FormPage.tsx#findSubmitRefusalsskips a sectionisSectionVisiblehides, so the submit goes out and the server refuses. On the anonymous route no host publishes a scope, the predicate faults and visibility falls open (isSectionVisiblepassestrueas the fallback; spec docblock limit 2), so the section is shown to every visitor and the hidden-required case does not arise there.git show origin/main:ui/apps/console/src/components/FormPage.tsx | sed -n 1056,1078pformitem than in the removed module:features.*is refused at parse on every form-view predicate (section docblock,checkFormViewPredicateFeaturesRoot). Identity roots remain; whetherappandpagebind on the form routes was not measured.examples/app-crm,examples/app-showcase); 0 section-levelvisibleWhen(the one hit is a field-level predicate intask.form.ts). hotcrm checkout: 0defineForm. Zero measured instances.git ls-tree -r --name-only origin/main | grep -E '\.form\.ts$' | grep -v metadata-formthen grepvisibleWhenvalidate-visibility-predicates.tsalready walks everyforms[]item's section predicates (formItemSites).validatePublicFormFileFieldsis the same shape (a form × its object's fields, gating,CLI_AND_RUNTIME,runtimeTypes: ['form']; "aformwrite's snapshot carriesobjectsas context").git show origin/main:packages/lint/src/authoring-rules.ts | sed -n 2003,2023pThe task note that a predicate can bind
current_user, so author time cannot decide whether a section hides, is correct and already answered by the ruled design: the check never decides. It refuses the combination whenever the predicate reads a root the object's own field rule cannot restate, and offers three remedies (move the field, drop the predicate, un-require the field). The over-refusal is a section predicate that is true for everyone who can open the form, and a form that is only ever served anonymously.The concrete problem
An author, in practice a package author writing
defineFormor an agent writing through the metadata door, can publish a form that some signed-in users cannot submit. Nothing warns at authoring. The first person to learn of it is an end user, from an error naming a field that is not on their screen. ADR-0113 says a fence covers this; no reachable fence exists.Options
domain:ui· 1 PR · precedent PR #39541 (form editor checks, +373/−33, 12 files); the module to restore is 283 lines + 143 of test onmain@objectstack/lintforms[]× the bound object's required fields, the ruled root set, gating, wired to the CLI commands and theformpublish door; rule explanation; ADR-0113 note names the rule; the Studio module goes with #39783os validateand a form publish refuse the arrangement with the three remedies, whichever tool wrote the form. Studio's designer shows the door's refusal on Publish through its existing refusal text.domain:engine(lint) · 1 PR · no named landing PR recoverable (history is squashed at 2026-10-30); nearest shape onmain:validate-public-form-file-fields.ts161 lines + 191 of testNot offered: a record validator that reads the form. Ruled out on #13252.
Business reading. A is a spell-checker installed in the one editor that cannot type the misspelling. B is deleting the rule and letting the customer's customers find the broken forms. C is putting the rule where every other "this form can never be completed" rule already sits, so every way of writing a form meets it.
Four axes
Long-term soundness (leads, weight ≥ 50%). End state in two years: one authoring-rule registry judges metadata at every door (CLI, publish, and what Studio shows), and a visual editor adds no verdict of its own. That is how this repository already treats the sibling case "a public form with a file field can never be filled", and it is the platform-layer model mainstream low-code platforms use for layout validity (checked when metadata is saved or deployed, not only inside one visual editor; stated from general knowledge, not verified here). This card is itself the evidence against an editor-local check: the fence lived in one inspector and stopped existing when the type moved, with no gate noticing. A repeats that shape. B removes a special case but leaves ADR-0113's "not in scope" paragraph without the cover it was ruled to have. C shrinks special cases: one rule, no Studio-only judgement, no drift between Studio and the door.
Real business pull. Zero measured: no form in the tree or in the hotcrm checkout has the arrangement, and the designer cannot produce it. #13252 said the same in August and the maintainer ruled the fence in anyway, for agent-written forms. Pull does not separate A from C; it argues only for B, against a standing ruling.
Preventing AI mistakes. The author most likely to make this mistake is an agent that sees sections and not the object's
requiredflags. Under A the agent's path (source or the metadata door) is not checked at all: silent. Under B: silent, and the failure surfaces to an end user. Under C the agent's write is refused loudly atos validateand at publish, with a prescription. C is the only option that is loud on the path that produces the error.Startup focus. B is cheapest and declares nothing. A and C are one PR each. C adds one rule id, a permanent obligation; it removes 283 lines of Studio code and six locale keys that A would keep. No option is three times another's cost.
os-decision-facets
① Long-term soundness: C shrinks special cases (one registry rule, no editor-local verdict); A repeats the shape that just lapsed unnoticed; B leaves ADR-0113's scope paragraph uncovered.
② Business pull: zero measured instances today; the standing ruling on #13252 put the fence in at zero pull, for agent output.
③ AI mistakes: C refuses loudly on the path agents use; A and B are silent there.
④ Startup focus: B declares nothing; C adds one rule id and deletes the Studio module; A keeps a Studio-only check.
Prior rulings read: "gated section" required, requiredInGatedSection → 19 + 5 hits; ADR-0113 line 410, #13252 ruling 5468998814; thread: objectstack-ai/objectui#6900 unresolved (API 403, rulings 5749269225 and 5831744213 read only through in-tree citations)
Recommendation
C. It is the only option that checks the paths through which the hazard can be written, and it carries out the ruled intent (refuse at authoring, never in the record validator) in the place that cannot silently fall out of reach.
C differs from the letter of the earlier rulings in one respect the maintainer should see: they placed the refusal on the Studio side and noted that the server accepts the draft. Under C the publish door refuses it. That is a move of the ruled fence, not of the record validator, so the rejection of a validator reading forms is untouched.
Self-check: on axis ① alone the choice is C; do ②③④ flip it: no. ④ notes that C is a new gating rule at zero measured pull, which is the one ground on which the maintainer may prefer B; it does not make A better.
Confidence gaps:
appandpagebind on the form routes was not measured; the rule should fence only roots that do bind there, and identity roots are confirmed.@objectstack/lint. Not widened here; worth one card if the maintainer wants it measured.After the ruling
domain:enginecard, p3. The rule readsforms[]through the existing form walk, the bound object's fields that are required with no default (the designer'sisRequiredWithoutDefaultreading), and the roots of each section predicate through the same parser export the removed module used; gating; CLI and theformpublish door; rule explanation with the three remedies; a test with a positive control. ADR-0113's dated note is updated to name the rule. fix(console): remove Studio form-view leftovers, package-less scope references and nav resolver staleness #39783 merges as it stands (route b of M1); nothing is restored in Studio.domain:uicard; the pure module is restored frommainbefore fix(console): remove Studio form-view leftovers, package-less scope references and nav resolver staleness #39783 merges or from its parent commit, wired besidemissingRequiredFields. ADR-0113's note names the designer.Effort precedent
A: PR #39541, +373/−33, 12 files, merged. B: the ADR-0113 hunk in PR #39783, +9 lines. C: no named landing PR (squashed history);
validate-public-form-file-fields.tsand its test, 352 lines together, same wiring.Related cards and PRs
#39003 (parent, item 2 second arm), PR #39783 (open draft, removes the Studio module), contract review 7431562202 (M1), #13252 (the ruling), ADR-0113, ADR-0159 D7 and D9, PR #39541 (form editor precedent), objectstack-ai/objectui#6900 (execution card of the ruling, unreachable).
Delta from the card's existing analysis: the card carried options and facts but no analysis and no recommendation ("待分析后补"). Option A: same option, cost changed: the designer cannot author a section predicate, so A does not cover the authoring paths that can create the hazard. Option B: same. Option C: new, not on the card. Recommendation: none existed; now C. Facts moved: PR #39783 is not merged, so the code is still on
main; the hazard is limited to signed-in surfaces because the anonymous route fails open;featuresis already refused at parse; objectstack-ai/objectui#6900 could not be read.objectstack-fleet commentedon Dec 6, 2026
triage@hotlong · hotlong · session_01Q4EjjMnyLqJdzuktEmRPXH
Ruling: letter C · maintainer 「39852 C,关于测量,你先用fable 分析」 · 2026-12-06T03:34Z
Maintainer ruling recorded: the "required field in a gated section" check becomes a gating rule in
@objectstack/lintoverforms[]× the bound object's required fields, run at the CLI and at theformpublish door; it is neither re-homed in the Studio designer nor retired.Provenance
hotlong). Where: the triage seat's sessionsession_01Q4EjjMnyLqJdzuktEmRPXH, typed words, recorded within minutes. The words after the comma are about another subject.Next (carried from the analysis, not typed by him)
validatePublicFormFileFields(a gating form × object-fields rule already wired to the CLI and theformpublish door). The rule never decides whether a section hides: it refuses a required field under any section predicate the object's own field rule cannot restate, and names the remedies.needs-user-decisionoff,pm:queueon: this card is now the build card.