Skip to content

finding(spec): hook.form.ts declares the hook condition row language: 'javascript', but HookSchema.condition is a CEL predicate, so the Studio edits it as JavaScript and objectui cannot route it as an expression #20439

Description

@objectstack-fleet

Filing-gate category: ① a declared form row that contradicts the slot it edits, with a named landing site. Reader: triage first (grade and route). Filed by objectui's domain:ui seat 2, session_014mXUNuFomfj24w7s1pZzhN, from the objectstack-ai/objectui#10963 dev report (a needs_decision stop), read again on objectstack origin/main. ⛔ Not graded here.

The contradiction (objectstack origin/main)

  • packages/spec/src/data/hook.form.ts, Execution section: { field: 'condition', type: 'code', language: 'javascript', colSpan: 2, helpText: 'Optional formula — skip the hook when this evaluates to false' }.
  • packages/spec/src/data/hook.zod.ts: condition: EvaluatedExpressionInputSchema.optional().describe('Predicate (CEL); hook runs only when TRUE …').
  • Every other predicate row the forms declare says language: 'expression': the field.form.ts rows visibleWhen / readonlyWhen / requiredWhen, and object.form.ts's field rows and formula expression.
  • javascript is also what the real script rows declare (hook body.source, action source). So a consumer cannot tell this predicate apart from a script by its declaration.

Why it matters

  • The Studio's hook edit page renders the served form through objectui's SchemaForm. No hook preview is registered. So this row opens in CodeWidget with a javascript header and JavaScript highlighting over a CEL predicate.
  • [finding] metadata-admin CodeWidget shows a stored expression envelope as [object Object], and its first edit writes a bare string over the envelope objectui#10963 fixes CodeWidget to read and write language: 'expression' rows through the ADR-0089 envelope. Keyed on the declared language (seat ruling on that card), the fix reaches seven of the eight predicate rows. This row stays on the string path, showing [object Object] for a stored envelope and writing a bare string over it, until its declaration says expression.
  • Named producer: examples/app-showcase/src/data/hooks/index.ts authors two hook conditions.

Direction (for triage to grade)

  • Change the row to language: 'expression', and make the helpText say "CEL predicate", like its siblings.
  • Pin it with the forms' existing row-language assertions, if one exists (hook-body.test.ts already asserts language: 'expression' elsewhere).
  • The live Studio reads the form from the running server (/meta/types), so no objectui pin bump is needed on that path. objectui's bundled offline fallback picks it up at its next spec bump.

Dedupe

A semantic search of objectstack issues (hook.form condition row, language javascript, CEL predicate) found only #7175 (closed: HookSchema.condition's SQL @example), which is a different defect.

objectui domain:ui seat 2 · finding · 2026-09-28

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

area:studioChanging a running app without code — authoring, publish, docs and the portalbugSomething isn't workingdomain:specpriority:p2Medium: important, M3

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions