fix(formula): retire the js expression dialect (#3278)#3291
Merged
Conversation
feat(evaluator): route CEL-dialect component/action predicates to the canonical engine (#2664) objectui@2e7d7f0f7ee76b838f580e8a36b74f1309b204fc
`js` was declared in `ExpressionDialect` but never shipped — only a registry
stub with no engine and no author helper (`cel`/`F`/`P` → CEL, `tmpl` →
template, `cron` → cron; nothing ever emitted `js`). Remove it from the enum
(now `{cel, cron, template}`) per ADR-0049 (enforce-or-remove), and fix a
latent `hasDialect` bug that reported the stub as a real engine (a
false-positive `true` — the stub-detection checked for a `stub:` prefix that
no registered engine ever carries).
Procedural JS is unaffected: it remains the L2 `ScriptBody { language: 'js' }`
sandboxed, capability-gated surface — a separate enum, not an expression
dialect.
- spec: narrow `ExpressionDialect`; regenerate reference docs (js drops from
the ~50 Expression-holding declarations — the only generated churn)
- formula: drop the stub + dead stub-detection; `hasDialect` now reports only
registered real engines; registry test asserts `hasDialect('js') === false`
so the gate can actually go red
- ADR-0058: addendum + inline amendments recording the retire
No runtime behavior changes for any valid persisted artifact — no producer
ever emitted `dialect: 'js'` (open-core, cloud: 0).
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
…pression-dialect # Conflicts: # content/docs/references/ui/app.mdx
Contributor
📓 Docs Drift CheckThis PR changes 2 package(s): 104 hand-written doc(s) reference the affected code and may need an implementation-accuracy re-verification:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #3278.
What & why
The
jsexpression dialect was declared inExpressionDialectbut never shipped — it existed only as a registry stub with no engine and no author helper (cel/F/P→ CEL,tmpl→ template,cron→ cron; nothing ever emittedjs). Given CEL already covers L1 declarative predicates and sandboxed JS already exists at L2 (ScriptBody { language: 'js' }), a js-as-expression layer is redundant and works against the AI-native safety story (CEL is non-Turing, statically lintable/explainable/diffable; arbitrary js is not). Per ADR-0049 (enforce-or-remove), retire it.This also corrects the issue's original premise:
hasDialect('js')actually returned a false-positivetrue, because the stub-detection (dialect.startsWith('stub:')) was dead code — stubs are registered under their real name, so the check never fired.Changes
ExpressionDialectto{cel, cron, template}; regenerate the 37 reference docs (js drops from the ~50 Expression-holding declarations — the only generated churn, verified diff is exclusively the enum narrowing).hasDialectnow reports only registered real engines; the registry test assertshasDialect('js') === false(the false-green test previously only checked thecelcase, so the broken detection shipped green).crona stub; cel-engine bounds comment pointed atdialect: jsinstead of the L2 ScriptBody).L1 vs L2 — the two
jssurfaces (kept distinct)jsexpression dialectScriptBody { language: 'js' }z.literal('js')enum)Verification
@objectstack/spectsc --noEmit; all 57 packages build (no downstream consumer of the enum breaks)check:docs(regenerated, in sync),check:skill-refs,check:react-blockscheck:role-word/check:nul-bytes/check:doc-authoringdialect: 'js'producers = 0 in framework/cloud/objectui (only test fixtures reference it)Breaking-change note
Narrows a public
@objectstack/specenum. Markedpatch(fixes declared≠enforced drift; no valid artifact ever usedjs). Maintainers may reclassify if preferred.Follow-up (non-blocking)
objectui
clientValidation.fieldRules.test.tsuses{ dialect: 'js' }as a bad-input fixture; it consumes published spec so it won't break until objectui bumps. Tracked separately.🤖 Generated with Claude Code