Skip to content
This repository was archived by the owner on Nov 4, 2026. It is now read-only.

feat(app-shell): an assignment value can be written as a CEL expression envelope beside {token} text - #10509

Merged
objectstack-fleet[bot] merged 4 commits into
mainfrom
claude/issue-7588-assignment-cel-envelope
Sep 25, 2026
Merged

objectstack-fleet[bot] merged 4 commits into
mainfrom
claude/issue-7588-assignment-cel-envelope

Conversation

@objectstack-fleet

Copy link
Copy Markdown
Contributor

Fixes #7588
Clause-②: no

Dispatched by the domain:ui seat 5 (claim comment 5827049024 on this card). Session: https://claude.ai/code/session_01KUxVUa7e39aNjhkKi1gsoy.

What changes

The assignment node's Assignments editor gets a per-value toggle, "Write as a CEL expression" (a toggle button with aria-pressed).

  • Off (text): the smart-parsed cell, same as before. A {token} string is stored exactly as typed. It is never rewritten into an envelope.
  • On (expression): the value is stored as the CEL value envelope { dialect: 'cel', source }. The installed spec declares this envelope for the slot (objectstack#14149 ruling A; the spec half is objectstack PR #15113). The released @objectstack/service-automation 17.4.0 evaluates it: its dist carries evaluateValueEnvelope. So the CEL stdlib (joinNonEmpty, …) can now be authored from Studio.

Files:

  • flow-value-envelope.ts (new). Every decision it makes is read from @objectstack/spec/automation:
    • FLOW_NODE_EXPRESSION_PATHS says which map is a value-role slot.
    • isExpressionEnvelopeShaped says what counts as an envelope.
    • AssignmentValueSchema gives the refusal. Its issues start with ASSIGNMENT_VALUE_ENVELOPE_REFUSAL.
    • AssignmentExpressionValueSchema.shape.dialect.value gives the dialect that gets written.
    • Nothing declares the envelope shape or the refusal text locally.
  • FlowKeyValueField.tsx:
    • A row now carries an optional mode: 'expression' and the envelope it was read from.
    • rowsToValue writes both storage shapes (the legacy array and the map) through one rowValue, so both shapes handle text rows and expression rows.
    • A malformed envelope stays the stored object, never a string, and the spec's refusal renders inline with role="alert". Malformed means: no source, a blank source, a dialect other than cel, or ast only.
    • Editing an expression's source keeps meta and drops ast, following the objectui#3218 write table. An unedited envelope comes back as the same object.
  • FlowNodeConfigField.tsx:
    • Passes valueEnvelope only when isValueEnvelopeSlot(context.node.type, field.path) is true. This is how the editor knows which map it is serving: it takes the node's type and the field's config.KEY path, and looks up KEY.* with role value in the spec's expression ledger.
    • Every other keyValue map (params, headers, field values, filters, inputs) renders exactly as before. A pin lists every hand-table keyValue field and requires the offered set to be exactly assignment:config.assignments.
  • metadata-admin/i18n.ts: two keys, en and zh (the designer table's two locales).
  • Docs:
    • The app-shell README's key/value bullet.
    • content/docs/guide/flow-designer.md: a new Assignment paragraph that shows the config JSON first.
  • Changeset: @object-ui/app-shell minor.

The legacy array shape: a conflict between the triage constraint and the spec

  • Triage 5548138334 requires the affordance's storage path to cover both shapes.
  • The installed spec (17.4.0) and the released executor read an envelope as an expression only in the canonical map. In assignments: [{ variable, value }], an envelope-shaped object is a literal. The spec's ASSIGNMENT_ARRAY_FORM_PRESCRIPTION says: "write the map, which is also the only shape that accepts a CEL value envelope".
  • So storing an envelope inside the array would declare a capability the runtime does not provide.

What this PR does:

  • The toggle is offered in both shapes.
  • While no row is an expression, the array is written back unchanged. A {token} value stays byte-identical, and a stored envelope-shaped literal comes back deep-equal.
  • The first expression row makes the editor write the map. Every other value carries across unchanged.
  • An array-shaped value shows the spec's prescription sentence as a note, so the move is announced.
  • Measured demand for the array form:
    • 0 hits for assignments: [ in the example trees of objectstack origin/main 8d76c2d3 and objectui origin/main 8c929e6.
    • Positive control: 4 map-form hits in objectstack's app-showcase flows.

The dispatch report carries this as an open question with options; the seat decides.

Tests (the targeted set re-run at f18f425, the head of this PR)

  • pnpm exec vitest run on flow-value-envelope.test.ts, FlowKeyValueField.shape.test.ts, FlowKeyValueField.valueEnvelope.test.tsx, FlowNodeConfigField.test.tsx and FlowNodeInspector.test.tsx → 5 files, 41 passed.
  • These runs were at 16f2420. f18f425 only changes content/docs/guide/flow-designer.md, and no test or script reads it (git grep flow-designer: 0 hits).
    • pnpm exec vitest run packages/app-shell/src/views/metadata-admin/inspectors/ → 93 files, 1143 passed, 1 skipped.
    • pnpm exec vitest run packages/app-shell/src/views/metadata-admin/ → 297 files, 3225 passed, 1 skipped.
    • The test files outside that tree that read a changed file (found by git grep; they include packages/app-shell/src/__tests__/) → 17 files, 715 passed.
  • pnpm turbo run type-check --filter @object-ui/app-shell at f18f425 → 30/30 tasks successful. tsconfig.test.json --listFilesOnly lists all three new or changed test files.
  • eslint on the 7 changed ts/tsx files at f18f425 → 0 errors, 4 warnings, all react-refresh/only-export-components on exported helpers. The base file had 2 of these; toRows and switchRowMode are exported for the pins.
  • Ablations: each mutation went through ablation-replace.mjs. In each, the anchor hit once, the blob changed, the restore matched the HEAD blob, and git diff HEAD was empty afterwards.
    • Slot derivation mutated to always answer true → 3 pins red (the non-slot pins and the create_record DOM pin).
    • Text rows normalized into envelopes → 12 red (every {token} byte-identity pin, plus the two existing shape pins).
    • The legacy array read as envelopes → 1 red (the array literal round-trip).

Gates at f18f425 (each exit code written to a file before it was read)

These all exited 0:

  • check:i18n-keys, check:i18n-drift, check:i18n-dead-keys, check:i18n-designer-parity
  • check:control-bytes, check:test-path-roots
  • check:vi-mock-specifiers, check:vi-mock-inherit, check:vi-mock-override-shape
  • check:new-line-citations (0 new citations), check:changeset-claims, check:pending-changeset-literals, check-changeset-presence.mjs
  • check:doc-types, check:doc-fences, check:doc-example-ids
  • check:spec-symbols, check:designer-field-key-parity, check:phantom-deps, check:self-import
  • check:esm-specifiers, check:unreferenced-sources, check:shell-escape-residue, check:installed-pin-claims
  • check:metadata-write-doors, check:docs-route-closure
  • check-governed-queue-guard.mjs --test → NOT GOVERNED.

check:changeset-claims pointed at three pending changesets that name metadata-admin/i18n.ts: the 6310, 7125 and 8632 changesets. I read all three paragraphs. They are about other keys and stay true.

check:doc-types went red once, on this PR's first guide fence: it read the flow node's type as an SDUI type. The fence now shows the config map instead.

Not measured

  • check:doc-snippets and check:doc-examples exited 2 (PRECONDITION NOT MET: unbuilt packages). Both judge only ts, tsx and typescript fences; this PR adds only json fences.
  • check:readme-exports exited 1 because the plugin-gantt dist is unbuilt. That README is untouched here, and the gate could not judge anything.
  • check:eager-closure exited 2: there is no console build. @objectstack/spec/automation was already a runtime import in the same inspector graph (FlowReferenceField, which FlowNodeConfigField imports).
  • app-shell tests outside views/metadata-admin that do not read a changed file, and the repo-wide eslint run: declared to CI.
  • Browser verification: not run.

Acceptance notes

  • Pre-existing, unchanged: the smart-parse re-types a stored string that looks numeric or boolean ('30', 'true') whenever any row of the map is edited. This is the design the file header documents.
  • The brace-trap message from validateExpressionClient says "inside a condition" for the value role too. It is a wording issue only.
  • Spec floor: app-shell declares ^17.3.0.
    • The 17.3.0 tarball exports every symbol this PR imports, and symbol presence is what check:spec-floors judges.
    • But in 17.3.0, AssignmentExpressionValueSchema extends ExpressionSchema, not EvaluatedExpressionSchema. So at the floor, a blank-source or ast-only envelope is not refused inline.
  • Out-of-scope findings, reported to the seat for filing:
    • The Studio flow simulator writes a value envelope through as a literal object. Probe: a map with n: 2 and doubled set to a n * 2 envelope gives doubled equal to the envelope object.
    • The unknown-reference check flags CEL comprehension-macro variables. Probe: rows.map(r, r.subject) with rows in scope flags r. Control: joinNonEmpty(rows, ", ") is clean.
  • Surface: the claim's file list did not name FlowNodeConfigField.tsx, which is the editor's only caller and gets a one-prop wire in the same cleared directory. It also did not name the README and guide paragraphs, which AGENTS.md Add automated testing infrastructure and CI/CD workflows #2 requires.
  • Commit trailers: they carry a model name, which the dispatch contract says trailer pairs should not. History is not rewritten.

Generated by Claude Code

… stored as the spec's value envelope

The assignment node's `assignments` editor now offers, per value, a text
cell (`{token}` interpolation, stored exactly as typed) or a CEL expression
stored as `{ dialect: 'cel', source }`. The editor learns it is serving a
`value`-role slot from the spec's expression ledger
(`FLOW_NODE_EXPRESSION_PATHS`), so no other key/value map changes. A
malformed envelope shows `AssignmentValueSchema`'s refusal inline, and the
legacy array form names the spec's prescription; an expression row writes
the map, the only shape the spec reads an envelope in.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KUxVUa7e39aNjhkKi1gsoy
… with its changeset

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KUxVUa7e39aNjhkKi1gsoy
…pe type off the spec

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KUxVUa7e39aNjhkKi1gsoy
…, in the flow designer guide

The fence carried the flow node `type`, which `check:doc-types` reads as an
SDUI component type.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KUxVUa7e39aNjhkKi1gsoy
@github-actions github-actions Bot added documentation Improvements or additions to documentation tests package: app-shell labels Sep 25, 2026
@github-actions

Copy link
Copy Markdown
Contributor

changeset-claim-re-read

⚠️ 3 pending changeset(s) describe a file this change touches

Their bodies publish verbatim into the CHANGELOG at the next release, so this is a request to re-read them against your diff — addressed here because you are the one seat that can answer it without re-deriving anything.

⛔ Nothing here blocks, and nothing here is a verdict on your change. This gate exits 0, is not a required context, and judges name resolution, never meaning: it asked whether a pending body names a file you touched. "Is this sentence still true?" is the one question it will not answer, and the one you are being asked to answer.

.changeset/6310-designer-formula-key-retired.md

  • names packages/app-shell/src/views/metadata-admin/i18n.ts → packages/app-shell/src/views/metadata-admin/i18n.ts — edited by this change

    Not touched: designer.field.formula ('Formula (CEL)') in packages/app-shell/src/views/metadata-admin/i18n.ts, a different and live key belonging to metadata-admin's ObjectFieldInspector — the surface that still authors formula expressions.

.changeset/7125-dashboard-empty-state-keys-retired.md

  • names packages/app-shell/src/views/metadata-admin/i18n.ts → packages/app-shell/src/views/metadata-admin/i18n.ts — edited by this change

    Not touched: table.noRows ('No rows to display') and engine.form.noRows (packages/app-shell/src/views/metadata-admin/i18n.ts, read at widgets.tsx) — two different, same-named keys in different namespaces. Nor the comments in WidgetEmptyState.tsx, DatasetWidget.tsx, ObjectDataTable.tsx and PivotTable.tsx that record WHY three widgets with three strings became one shared empty state; the packs' own comment keeps that rationale and now names the retirement instead of a row that is gone.

.changeset/8632-malformed-picklist-option-loud.md

  • names views/metadata-admin/i18n.ts → packages/app-shell/src/views/metadata-admin/i18n.ts — edited by this change

    Two new strings land in the designer's own en / zh tables — the metadata-admin console owns its strings in views/metadata-admin/i18n.ts and is deliberately outside the ten locale packs (packages/i18n/README.md, "Scope — the engine.* carve-out").

Read the paragraph, not the line: both false halves of the objectui#8617 claim sat in one paragraph, and correcting either alone would have left it asserting the same wrong thing.

If a claim did go false, correct the body. That is precedented and prose-only, frontmatter untouched; check-changeset-overwrite.mjs will report the correction as its own case 2 ("correcting a declaration on purpose … legitimate"), which is the intended shape — one gate asks for the read, the other records the write.

Not covered, stated so nobody reads this as more: a born-false claim that spells no line address at all (objectui#9495 coordinated one by ORDINAL — "a grep finds that member first" — and deciding that means reading what the sentence means), a claim spelled as a symbol or a package rather than a backticked file name, and a file named ambiguously.

Compared the checked-out tree with 00715f5ba (merge-base with origin/main): 9 file(s) changed outside .changeset/, read against 1418 pending declaration(s) that publish a body (1998 pending in total). · run

@github-actions

Copy link
Copy Markdown
Contributor

✅ Console Performance Budget

Metric Value Budget
Eager closure (gzip, 329 chunks) 3045.6 KB 3104.5 KB
Main entry chunk (gzip) 147.8 KB 350 KB
Entry file index-6vWtKH2t.js —
Status PASS —

The eager closure is every chunk the entry reaches through static imports — what the browser fetches and parses before the app renders. The entry chunk on its own is a small fraction of it.


📦 Bundle Size Report

Package Size Gzipped
app-shell (consoleActionDispatch.js) 0.20KB 0.19KB
app-shell (index.js) 16.68KB 6.20KB
app-shell (runtime-config.js) 20.68KB 7.36KB
app-shell (types.js) 0.01KB 0.04KB
app-shell (urlParams.js) 10.06KB 3.86KB
auth (ActiveOrganizationStorage.js) 27.95KB 10.04KB
auth (AuthContext.js) 0.31KB 0.24KB
auth (AuthGuard.js) 2.07KB 1.00KB
auth (AuthProvider.js) 40.18KB 10.59KB
auth (AuthShell.js) 3.49KB 1.40KB
auth (ForgotPasswordForm.js) 12.21KB 3.45KB
auth (LoginForm.js) 18.15KB 5.39KB
auth (PreviewBanner.js) 0.90KB 0.50KB
auth (RegisterForm.js) 6.65KB 2.22KB
auth (SocialSignInButtons.js) 9.61KB 3.89KB
auth (UserMenu.js) 3.41KB 1.23KB
auth (auth-gate-events.js) 1.29KB 0.66KB
auth (authStyles.js) 5.04KB 1.72KB
auth (createAuthClient.js) 40.21KB 10.80KB
auth (createAuthenticatedFetch.js) 8.52KB 3.45KB
auth (index.js) 3.63KB 1.64KB
auth (invitation-status.js) 1.22KB 0.70KB
auth (org-roles.js) 6.66KB 2.78KB
auth (phone-identifier.js) 1.11KB 0.66KB
auth (types.js) 0.59KB 0.35KB
auth (useAuth.js) 5.30KB 1.02KB
auth (useWorkspaceAdminStatus.js) 11.08KB 4.58KB
collaboration (CommentThread.js) 27.13KB 7.95KB
collaboration (LiveCursors.js) 3.17KB 1.27KB
collaboration (PresenceAvatars.js) 6.49KB 2.64KB
collaboration (PresenceProvider.js) 2.79KB 1.13KB
collaboration (index.js) 1.68KB 0.73KB
collaboration (useCollaborationTranslation.js) 6.05KB 2.52KB
collaboration (useCommentSearch.js) 1.98KB 0.88KB
collaboration (useConflictResolution.js) 7.75KB 1.86KB
collaboration (useMentionNotifications.js) 1.81KB 0.68KB
collaboration (usePresence.js) 6.33KB 1.84KB
collaboration (useRealtimeSubscription.js) 7.91KB 2.01KB
components (index.js) 544.62KB 130.17KB
core (index.js) 9.22KB 3.71KB
create-plugin (index.js) 27.94KB 9.51KB
data-objectstack (index.js) 223.86KB 62.25KB
fields (index.js) 256.68KB 65.01KB
i18n (LocalizationContext.js) 1.76KB 0.96KB
i18n (builtinAggregateLabels.js) 0.86KB 0.49KB
i18n (currency.js) 2.59KB 1.22KB
i18n (fallbackInterpolation.js) 6.25KB 2.77KB
i18n (i18n.js) 8.87KB 3.64KB
i18n (index.js) 5.24KB 2.27KB
i18n (pickLocalized.js) 9.86KB 3.95KB
i18n (provider.js) 39.40KB 12.91KB
i18n (useDisplayLocale.js) 3.52KB 1.76KB
i18n (useObjectLabel.js) 34.34KB 9.17KB
i18n (useSafeTranslation.js) 5.60KB 2.33KB
layout (index.js) 39.28KB 11.09KB
mobile (MobileProvider.js) 0.92KB 0.49KB
mobile (ResponsiveContainer.js) 0.94KB 0.38KB
mobile (breakpoints.js) 1.51KB 0.70KB
mobile (createOfflineDataSource.js) 5.61KB 1.75KB
mobile (index.js) 1.99KB 0.87KB
mobile (offlineQueue.js) 3.91KB 1.35KB
mobile (pwa.js) 0.97KB 0.49KB
mobile (serviceWorker.js) 1.48KB 0.62KB
mobile (serviceWorkerSource.js) 3.41KB 1.48KB
mobile (useBreakpoint.js) 1.54KB 0.65KB
mobile (useGesture.js) 6.96KB 1.98KB
mobile (useOfflineSync.js) 1.99KB 0.72KB
mobile (usePullToRefresh.js) 6.62KB 2.45KB
mobile (useResponsive.js) 0.72KB 0.42KB
mobile (useSpecGesture.js) 5.52KB 2.10KB
mobile (useTouchTarget.js) 1.01KB 0.54KB
permissions (MePermissionsProvider.js) 13.52KB 4.88KB
permissions (PermissionContext.js) 0.31KB 0.25KB
permissions (PermissionGuard.js) 0.89KB 0.45KB
permissions (PermissionProvider.js) 6.24KB 2.16KB
permissions (discardProofCache.js) 1.04KB 0.55KB
permissions (evaluator.js) 8.33KB 3.07KB
permissions (index.js) 0.93KB 0.41KB
permissions (store.js) 0.91KB 0.42KB
permissions (useFieldPermissions.js) 1.28KB 0.53KB
permissions (usePermissions.js) 4.83KB 2.27KB
plugin-ai (index.js) 16.01KB 3.93KB
plugin-calendar (index.js) 51.22KB 14.56KB
plugin-charts (index.js) 74.95KB 20.88KB
plugin-chatbot (index.js) 198.36KB 47.20KB
plugin-dashboard (index.js) 133.59KB 35.39KB
plugin-designer (index.js) 216.25KB 44.39KB
plugin-detail (index.js) 232.19KB 61.38KB
plugin-editor (index.js) 2.23KB 1.05KB
plugin-form (index.js) 146.50KB 37.51KB
plugin-gantt (index.js) 168.43KB 41.50KB
plugin-grid (index.js) 215.49KB 58.91KB
plugin-kanban (index.js) 49.30KB 15.39KB
plugin-list (index.js) 114.48KB 28.29KB
plugin-map (index.js) 21.83KB 7.07KB
plugin-markdown (index.js) 13.88KB 4.80KB
plugin-report (index.js) 43.55KB 11.99KB
plugin-timeline (index.js) 30.64KB 8.94KB
plugin-tree (index.js) 10.52KB 3.69KB
plugin-view (index.js) 88.00KB 21.97KB
providers (DataSourceProvider.js) 0.75KB 0.39KB
providers (MetadataProvider.js) 1.37KB 0.59KB
providers (ThemeProvider.js) 1.90KB 0.85KB
providers (UploadProvider.js) 11.66KB 3.50KB
providers (index.js) 0.45KB 0.23KB
providers (types.js) 0.01KB 0.04KB
react-runtime (index.js) 5.62KB 2.34KB
react (LazyPluginLoader.js) 4.47KB 1.63KB
react (SchemaRenderer.js) 114.58KB 37.60KB
react (data-invalidation.js) 5.05KB 2.08KB
react (index.js) 4.03KB 1.86KB
react (schema-input.js) 4.25KB 2.04KB
react (spec-input.js) 0.20KB 0.18KB
sdui-parser (body-dialect.js) 4.78KB 2.09KB
sdui-parser (codegen.js) 6.58KB 2.74KB
sdui-parser (dashboard-widget-options.js) 3.08KB 1.30KB
sdui-parser (index.js) 5.78KB 2.56KB
sdui-parser (input-type.js) 2.84KB 1.40KB
sdui-parser (kanban-quick-add.js) 3.89KB 1.87KB
sdui-parser (parse.js) 25.28KB 7.80KB
sdui-parser (provenance.js) 3.66KB 1.82KB
sdui-parser (types.js) 0.28KB 0.23KB
sdui-parser (validate.js) 18.27KB 6.20KB
types (ai.js) 4.11KB 2.06KB
types (api-types.js) 0.20KB 0.18KB
types (app.js) 2.87KB 1.00KB
types (base.js) 0.20KB 0.18KB
types (blocks.js) 0.20KB 0.18KB
types (complex.js) 2.93KB 1.49KB
types (crud.js) 0.20KB 0.18KB
types (dashboard-filter-alias.js) 6.23KB 2.74KB
types (data-display.js) 3.75KB 1.85KB
types (data-protocol.js) 0.20KB 0.19KB
types (data.js) 0.20KB 0.18KB
types (designer.js) 1.85KB 0.85KB
types (disclosure.js) 0.20KB 0.18KB
types (error-code.js) 1.54KB 0.88KB
types (expression.js) 0.20KB 0.18KB
types (feedback.js) 0.20KB 0.18KB
types (field-types.js) 0.20KB 0.18KB
types (form.js) 0.20KB 0.18KB
types (http-inflight.js) 8.87KB 3.73KB
types (http-retry.js) 4.32KB 2.02KB
types (icon-key-migration.js) 4.26KB 1.63KB
types (index.js) 4.74KB 2.25KB
types (layout.js) 0.20KB 0.18KB
types (managed-by.js) 0.19KB 0.18KB
types (mobile.js) 5.00KB 2.39KB
types (navigation.js) 0.20KB 0.18KB
types (objectql.js) 0.20KB 0.18KB
types (overlay.js) 0.20KB 0.18KB
types (permissions.js) 0.20KB 0.18KB
types (plugin-scope.js) 0.20KB 0.18KB
types (record-components.js) 0.20KB 0.19KB
types (record-semantics.js) 1.28KB 0.67KB
types (registry.js) 0.20KB 0.18KB
types (reports.js) 0.20KB 0.18KB
types (select-option.js) 0.20KB 0.19KB
types (spec-report.js) 5.05KB 1.93KB
types (spec-ui-namespace.js) 0.20KB 0.19KB
types (strict-authoring-face.js) 17.15KB 6.32KB
types (system-fields.js) 3.33KB 1.54KB
types (theme.js) 6.28KB 2.87KB
types (ui-action.js) 8.11KB 3.32KB
types (views.js) 0.20KB 0.18KB
types (widget.js) 0.20KB 0.18KB

Size Limits

  • ✅ Core packages should be < 50KB gzipped
  • ✅ Component packages should be < 100KB gzipped
  • ⚠️ Plugin packages should be < 150KB gzipped

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

Contract review

Served-tier: CONTRACT_REVIEW_TIER
Head-sha: f18f4257fb69936792d7219ec4475f83a7b68186

① Derived judgments

All line numbers are at the head f18f425, read with git show refs/review/pr-10509:PATH; the base is the merge-base 8c929e6. The spec is the installed @objectstack/spec@17.4.0 (lockfile resolution at the head; src/automation/builtin-node-config.zod.ts and dist/automation/index.mjs), probed with Node, not read from the report.

  1. {token} strings round-trip byte-identically, both shapes. FlowKeyValueField.tsx:59-64 (toRaw hands a string back as itself), :67-85 (parseValue returns the untrimmed raw when brace-wrapped text is not JSON, so {record.first} {record.last} and {amount} survive), :126-128 (rowValue: a text row goes through parseValue only), :112-123 (toRows never gives a string row a mode), :222-230 (promoteEnvelopeText promotes only text whose parse is an editable envelope, never a {token} string). Map and array pinned at FlowKeyValueField.shape.test.ts:64-73, the DOM commit at FlowKeyValueField.valueEnvelope.test.tsx:70-74. The pre-existing smart-parse re-typing ('30' to 30, whitespace-only to '', null to '') is unchanged from the base and does not touch a {token} string. Judgment: holds.

  2. The stored envelope is exactly the spec's shape; nothing re-declared. flow-value-envelope.ts:51 reads the dialect off AssignmentExpressionValueSchema.shape.dialect.value (probe on 17.4.0: "cel"); :100-108 writes { dialect: VALUE_DIALECT, source } or patches a prior envelope's source (keeps meta, drops ast, hands an unedited one back by identity); :113-116 the refusal is AssignmentValueSchema.safeParse issues verbatim (probe: every malformed case's message leads with ASSIGNMENT_VALUE_ENVELOPE_REFUSAL); :70-73 the slot is read off FLOW_NODE_EXPRESSION_PATHS (probe: the value-role entries are exactly assignment / assignments.*); :87-93 uses the spec's isExpressionEnvelopeShaped. The one local predicate, isEditableValueEnvelope, is a UI editability rule narrower than the spec recognizer (dialect cel plus a string source); a value the spec calls envelope-shaped but this rule rejects stays JSON text in the cell and is refused by the spec schema, never rewritten. ValueEnvelope is a Pick of the spec's own type. Judgment: holds.

  3. A malformed envelope surfaces the spec's refusal inline and is not silently stored as something else. FlowKeyValueField.tsx:316 computes the refusal per row from rowValue(row) through the spec; :373-380 renders each message under role="alert". A stored malformed envelope is read as text JSON (:118-121), and parseValue (:77-83) writes it back as the object, never a string (shape.test.ts:97-103). A blank expression writes { dialect: 'cel', source: '' } and is refused inline (shape.test.ts:104-108; valueEnvelope.test.tsx:84-95, template dialect and blank source). The draft holds the value with the refusal visible, which is the triage's acceptable state (the bad case was an editor that stores a malformed envelope with no error). Judgment: holds.

  4. The affordance is offered only on the spec's value-role map. FlowNodeConfigField.tsx:146-151 passes valueEnvelope only when isValueEnvelopeSlot(context?.node?.type, field.path); flow-value-envelope.ts:64-70 requires a ['config', KEY] path and a ledger entry with that node type, role value and path KEY.*. The production caller passes the node (FlowNodeInspector.tsx:454, context={{ draft, node }}), and FlowNodeConfigField.tsx:131 is the only non-test caller of FlowKeyValueField. The pin at flow-value-envelope.test.ts:31-50 enumerates every hand-table keyValue field (15 of them: fields, filter, headers, inputs, variables, defaults, input, connectorConfig.input, params, timeRelative.filter, and assignments) and requires the offered set to be exactly assignment:config.assignments; the DOM control on create_record fields is valueEnvelope.test.tsx:64-66. Descriptor-derived keyValue fields go through the same predicate and cannot match. Judgment: holds.

  5. Legacy array shape. FlowKeyValueField.tsx:114 (the array never reads envelopes), :136-138 (writesArrayShape: array while no row is an expression), :153-158 (else the canonical map), :300 (no refusal while the array is written, since an envelope-shaped object is a literal there), :305-309 (the spec's ASSIGNMENT_ARRAY_FORM_PRESCRIPTION shown as a note). This is consistent with the spec's declaration: the ledger comment says an envelope-shaped object in the array is a literal, the prescription says the map is the only shape that accepts an envelope, and AssignmentConfigSchema refuses the array. The PR never writes an envelope where the spec reads a literal, and converts only on the author's explicit toggle, to the shape the spec prescribes. Data: every kept (variable, value) pair carries across (shape.test.ts:90-94; DOM valueEnvelope.test.tsx:97-105); the base editor already normalized name/key aliases to variable and dropped any other entry key on every write, so the head loses nothing the base kept. Edge cases that change meaning: (a) an envelope-shaped literal already inside a legacy array becomes an evaluated expression once another row's toggle writes the map, same bytes, different meaning; the row visibly flips to expression mode after the flush (:274) and a malformed one is then refused inline, but the note is the spec's general prescription and no prose tells the author that this specific value's meaning changed; (b) integer-like variable names lose the array's order in a JS object map, theoretical; (c) pre-existing in both shapes and unchanged: null to '' and '30' to 30 on any write. Judgment: sound; (a) is the one silent-meaning edge and it is a corner of an unused shape (see ③).

  6. Published surfaces. packages/app-shell/package.json exports stay . and ./styles.css; src/index.ts does not reach the inspectors; no api-surface file changed. New module-level exports toRows, switchRowMode (FlowKeyValueField.tsx:112, :166) and the flow-value-envelope.ts symbols are internal to app-shell. README (packages/app-shell/README.md:523-529) and guide (content/docs/guide/flow-designer.md:124-142) prose is judged in ②. Judgment: no published surface moves.

  7. Card coverage. Asked and delivered: a per-value text / expression choice; the envelope stored; the spec refusal inline; the stdlib reachable (joinNonEmpty(...) pinned unrefused and unflagged, valueEnvelope.test.tsx:60-63, flow-value-envelope.test.ts:81); {token} byte-identical; both storage paths through one rowValue; pins beside FlowKeyValueField.shape.test.ts; one changeset; locale keys in both designer tables (i18n.ts:409-410, :2377-2378; the file has only EN and ZH engine tables, so parity is complete). Done but not asked: the array-form note; mono on expression rows; the two helper exports for pins; the behaviour-preserving removeRow refactor (:290-292); the README and guide paragraphs. Nothing asked is missing.

② Semver level

'@object-ui/app-shell': minor is correct: a new authoring feature; AGENTS.md 版本号策略 says objectui never declares major (even its own breaking changes are minor) and app-shell sits in the 40-package fixed group of .changeset/config.json. CI's Changeset Bump Policy and Changeset Fixed Group Check are green at the head.

Changeset prose, sentence by sentence: the title sentence, true. "now has a per-value toggle, Write as a CEL expression", true (FlowKeyValueField.tsx:345-358, label i18n.ts:409). "Off, the value is text: a {token} string is stored exactly as typed, and numbers, booleans and JSON literals are smart-parsed as before", true (item 1). "On, the value is stored as the CEL value envelope the spec declares for this slot, { dialect: 'cel', source }, so the CEL stdlib can be authored from the designer", true (item 2; the runtime claim is the spec's own description). The JSON example, true to what the editor writes. "The editor reads which maps take an envelope from the spec's expression ledger; every other key/value map is unchanged", true (item 4). "A malformed envelope (no source, a blank one, a non-cel dialect) shows the spec's AssignmentValueSchema refusal beside the cell, and is kept as the object it is rather than turned into a string", true at the installed 17.4.0 (item 3; see the floor flag in ③). "A node still using the legacy array shows the spec's prescription for it. Switching one of its values to an expression writes the canonical map, the only shape the spec reads an envelope in; the other values move across unchanged", true as data (item 5, with the pre-existing smart-parse re-typing applying as it always did).

README :523-529: "On a map the spec's expression ledger declares value-role (today the assignment node's Assignments), each value also has a Write as a CEL expression toggle", true. "off, a {token} string is stored exactly as typed", true. "on, the value is stored as the CEL value envelope { dialect: 'cel', source }", true. "a malformed envelope shows the spec's AssignmentValueSchema refusal inline", true for the map, which is the sentence's scope. It does not mention that the legacy array also shows the toggle; incomplete, not false.

Guide :124-142: "sets one variable per row. Each value is either text or a CEL expression, chosen with the row's toggle", true. "The node's config then reads" plus the JSON fence, true. "Text is {token} interpolation and is stored exactly as typed", true. "An expression is stored as the envelope and evaluated by the expression engine, so the CEL stdlib is available", true as the spec's declared runtime contract; note that the designer's own simulate panel (previews/simulator/flow-simulator.ts:324-346, interpolateValue at :355 returns a non-string unchanged) passes the envelope object through as a literal, which the PR itself names as an out-of-scope finding. "A malformed envelope shows the spec's refusal under the cell", true. "The toggle appears only on maps whose values the spec declares may be an expression; other key/value editors have none", true (item 4).

③ Boundary flags

  • PR body flags. Surface: FlowNodeConfigField.tsx (the sole caller, a one-prop wire in the same cleared directory), the README bullet and the guide paragraph were outside the claim's file list; disclosed in the body, no other claim names the directory, and the additions are the minimum wire plus repo-required docs. Acceptable; the seat's call, since the claim said stop on breach. Commit trailers: the four commits carry a model name in Co-Authored-By, against the dispatch contract; a squash merge replaces them, so this is a process flag only. Spec floor: app-shell declares ^17.3.0 (package.json:86) while the lockfile and this review use 17.4.0; the body states that at 17.3.0 AssignmentExpressionValueSchema does not refuse a blank-source or ast-only envelope, which I could not verify within my reads. If so, the changeset's "a blank one" sentence and the blank-source pins hold only from 17.4.0; recommend raising the floor to ^17.4.0 or qualifying the sentence. For filing by the seat, both confirmed by reading: the simulator writes the envelope through as a literal (flow-simulator.ts:324-346), and findUnknownRefs (flow-ref-check.ts:99-129) would flag a CEL comprehension variable such as r in rows.map(r, r.subject) as an unknown root, an amber note, not a refusal.
  • Open question, the array shape: option A is sound. It never writes an envelope where the spec and the executor read a literal (C would), it does not split the affordance by shape (B would, the split the triage warned about), and the conversion it performs is the spec's own prescription, only on the author's explicit toggle, with every pair carried across. Demand: at the merge-base the only assignments: [ hit outside tests in objectui is a doc comment (flow-simulator.ts:320), and the map form has 2 non-test hits, so A and B differ only for hand-authored legacy flows. The one silent-meaning edge is item 5(a); a one-line prose addition to the note would close it, and is not a contract breach.
  • CI at f18f425, polled 2026-09-25T06:01Z: 43 check-runs; 40 success, 3 skipped (Test (coverage), Test (coverage shard), dependabot), 0 failure, 0 in progress. No re-poll needed. Lint, Type Check, the 8 test shards, Doc Component Type Check, README Export Check, Changeset Bump Policy and Governed Surface Queue Guard are among the green ones.
  • Draft: yes, the PR is still draft, as the dispatch contract requires.
  • Clause-②: no holds. No package export moved (package.json exports unchanged; src/index.ts does not reach the inspectors); no accept set moved (the spec is consumed, not changed); no public prop appeared (valueEnvelope is a prop of an internal component that the package entry does not export). The new exports are module-level inside app-shell.
  • Main moved: refs/review/main is 12 commits past the merge-base 8c929e6; none touch the ten PR files or packages/app-shell/src/views/metadata-admin/inspectors/. GitHub reports mergeable: true, mergeable_state: behind.

Implemented-by: claude/issue-7588-assignment-cel-envelope
Reviewed-by: session_01KUxVUa7e39aNjhkKi1gsoy

VERDICT: PASS

@objectstack-fleet
objectstack-fleet Bot marked this pull request as ready for review September 25, 2026 07:31
@objectstack-fleet
objectstack-fleet Bot added this pull request to the merge queue Sep 25, 2026
Merged via the queue into main with commit 82bdd3a Sep 25, 2026
45 checks passed
@objectstack-fleet
objectstack-fleet Bot deleted the claude/issue-7588-assignment-cel-envelope branch September 25, 2026 07:43
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

documentation Improvements or additions to documentation package: app-shell tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Studio: an affordance for the assignment node's CEL value envelope beside {token} interpolation — the consumer half of objectstack#14149

2 participants