Skip to content

Commit 72b47b1

Browse files
committed
chore(spec): regenerate api-surface and export-origins; add the changeset for the refusal codes
Claude-Session: https://claude.ai/code/session_01QcAS3qiYYZNezaxZxaUdMV Co-Authored-By: Claude <noreply@anthropic.com>
1 parent b0b9a29 commit 72b47b1

3 files changed

Lines changed: 27 additions & 0 deletions

File tree

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
---
2+
'@objectstack/formula': minor
3+
'@objectstack/spec': minor
4+
---
5+
6+
Expression refusals now carry a stable `code` and typed `params` beside their English `message`, so a localized author surface can render its own words: `validateExpression` (every entry in `errors[]` and `warnings[]`), `collectCelRootIdentifiers` (its `ok: false` arm) and `predicateSlotRefusal` (#20291)
7+
8+
Clause-②: yes
9+
10+
Until now the only thing a refusal said was an English sentence, and a designer running in another locale could only show it verbatim, beside its own translated headings. Each refusal now also names its code — one of a closed, kebab-case set — and the values its sentence interpolates, so a consumer keys a catalogue row to the code and fills it from the params. The `message` is the same sentence, byte for byte; nothing is removed or renamed, so no existing reader changes.
11+
12+
- `@objectstack/formula` exports `EXPRESSION_REFUSAL_CODES` (the closed set as a frozen list) and the types `ExpressionRefusalCode`, `ExpressionRefusalParams` (code → params), `ExpressionRefusal`, `ExprValidationCode`, `CelRootsRefusalCode`, `CelFieldRole`, `ExpressionSourceKind` and `CelRootIdentifiersResult`. `ExprValidationError` gains `code` and `params`.
13+
- `@objectstack/spec/automation` exports `PREDICATE_SLOT_REFUSAL_CODES` and the types `PredicateSlotRefusalCode`, `PredicateSlotRefusalParams`, `PredicateSlotRefusal` and `PredicateSlotValueKind`. `predicateSlotRefusal` returns `PredicateSlotRefusal`, which is its previous `{ message, source }` plus `code` and `params`.
14+
- Narrowing on `code` narrows `params`. A code never changes once published: a reworded message keeps its code, and a new refusal gets a new one.
15+
- A `detail` param is the CEL or template engine's own diagnostic, in English, passed through as the message carries it.
16+
- These are authoring diagnostics returned as values, not ADR-0112 request error codes, which is why they are kebab-case.
17+
- The `validate_expression` MCP tool forwards `validateExpression`'s `errors` and `warnings` as they are, so each entry in its answer now also carries `code` and `params`.

‎packages/spec/api-surface/automation.json‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -193,13 +193,18 @@
193193
"ORG_MEMBERSHIP_LEVELS (const)",
194194
"OS_CONSTRUCT_EXT (const)",
195195
"PARALLEL_NODE_TYPE (const)",
196+
"PREDICATE_SLOT_REFUSAL_CODES (const)",
196197
"PREDICATE_SLOT_STRING_REFUSAL (const)",
197198
"ParallelBranch (type)",
198199
"ParallelBranchParsed (type)",
199200
"ParallelBranchSchema (const)",
200201
"ParallelConfig (type)",
201202
"ParallelConfigParsed (type)",
202203
"ParallelConfigSchema (const)",
204+
"PredicateSlotRefusal (type)",
205+
"PredicateSlotRefusalCode (type)",
206+
"PredicateSlotRefusalParams (interface)",
207+
"PredicateSlotValueKind (type)",
203208
"ReconciledNodeConfigType (type)",
204209
"RegionAnalysis (interface)",
205210
"ResolvedFlowNodeExpression (interface)",

‎packages/spec/export-origins/automation.json‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -188,13 +188,18 @@
188188
"ORG_MEMBERSHIP_LEVELS": "src/automation/approval.zod.ts#ORG_MEMBERSHIP_LEVELS (const)",
189189
"OS_CONSTRUCT_EXT": "src/automation/bpmn-mapping.ts#OS_CONSTRUCT_EXT (const)",
190190
"PARALLEL_NODE_TYPE": "src/automation/control-flow.zod.ts#PARALLEL_NODE_TYPE (const)",
191+
"PREDICATE_SLOT_REFUSAL_CODES": "src/automation/flow-node-expression-paths.ts#PREDICATE_SLOT_REFUSAL_CODES (const)",
191192
"PREDICATE_SLOT_STRING_REFUSAL": "src/automation/flow-node-expression-paths.ts#PREDICATE_SLOT_STRING_REFUSAL (const)",
192193
"ParallelBranch": "src/automation/control-flow.zod.ts#ParallelBranch (type)",
193194
"ParallelBranchParsed": "src/automation/control-flow.zod.ts#ParallelBranchParsed (type)",
194195
"ParallelBranchSchema": "src/automation/control-flow.zod.ts#ParallelBranchSchema (const)",
195196
"ParallelConfig": "src/automation/control-flow.zod.ts#ParallelConfig (type)",
196197
"ParallelConfigParsed": "src/automation/control-flow.zod.ts#ParallelConfigParsed (type)",
197198
"ParallelConfigSchema": "src/automation/control-flow.zod.ts#ParallelConfigSchema (const)",
199+
"PredicateSlotRefusal": "src/automation/flow-node-expression-paths.ts#PredicateSlotRefusal (type)",
200+
"PredicateSlotRefusalCode": "src/automation/flow-node-expression-paths.ts#PredicateSlotRefusalCode (type)",
201+
"PredicateSlotRefusalParams": "src/automation/flow-node-expression-paths.ts#PredicateSlotRefusalParams (interface)",
202+
"PredicateSlotValueKind": "src/automation/flow-node-expression-paths.ts#PredicateSlotValueKind (type)",
198203
"ReconciledNodeConfigType": "src/automation/schemaless-node-config.zod.ts#ReconciledNodeConfigType (type)",
199204
"RegionAnalysis": "src/automation/control-flow.zod.ts#RegionAnalysis (interface)",
200205
"ResolvedFlowNodeExpression": "src/automation/flow-node-expression-paths.ts#ResolvedFlowNodeExpression (interface)",

0 commit comments

Comments
 (0)