Skip to content
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 32 additions & 0 deletions skills/uipath-maestro-case/references/case-runtime.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,38 @@ make from syntax alone. Exact signatures remain in the generated API.
error. Write the complementary condition explicitly, even when the negative
arm only routes to a close-out.

## Action recipients and the go-live trap

<!-- RULE:case.recipient.externalize -->
- An action task's `recipient` bakes the email address into the plan. Safe for
testing; a trap for go-live. Going live requires editing every action's
recipient in the source and republishing the case.

When a request names a person or test mailbox as the recipient, wire it
through a case **input** with a placeholder default instead of a literal.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💬 Non-blocker · Architecture & design

CA-232 asks for test settings outside the case, such as an asset. This rule still embeds a default and requires a source edit and republish to change it.

Add a supported external configuration route, or explicitly track that ticket requirement as unresolved and describe this change as disclosure guidance.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Partly addressed in a0e145e. The recipient is now the case input, so going live means changing the input default, or passing the address at start with case process run --inputs. Nobody edits every action any more. An Orchestrator asset as the source is not covered. CA-232 stays open for that part, and the PR body says so.

Declare the input, reference it in the `recipient` field, and verify with
`case check --source` that the expression resolves:

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should fix: case check cannot verify this. checkCaseExpressions (builder-sdk case/case-expr-check.ts:189) never reads action.recipient. A wrong path passes as check: OK, so the fallback on line 56 never triggers. Either drop the verification claim, or file the builder-sdk change that adds recipient to the expression check.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in a0e145e. The verification claim now names what really catches this shape. With SDK 6.120.17, case check warns STRICT_RECIPIENT_EXPRESSION_TYPE on a bare-string '=vars.approver', because that is type 2. I probed this. case validate --strict fails on the same shape: strict-case-rules.ts raises it with severity error, which I read in the source but did not run. The script-task fallback is gone.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Partly: the doc now says case check warns STRICT_RECIPIENT_EXPRESSION_TYPE, but that code is only in validate --strict. The SDK check says OK on the bare form. Details in the new inline comment; validate --strict does catch it, so it's not blocking.


```ts
.input({ approver: types.string })

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Blocking. types is not exported from @uipath/maestro-builder-sdk/case. Compiling this snippet fails with does not provide an export named 'types'. Case inputs use string type names plus their trigger: .input({ approver: 'string' }, { from: manual }). The text above promises a placeholder default, but this snippet declares none.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in a0e145e. The snippet now declares .input({ approver: { type: 'string', default: '<TEST_EMAIL>' } }, { from: manual }), which is the SDK's { type, default } input shape. With SDK 6.120.17, case-check --source prints check: OK on it, and case-compile puts the default in variables.inputs[].default.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verified at 5451ad2: the snippet now uses .input({ approver: { type: 'string', default: '<TEST_EMAIL>' } }, { from: manual }) and compiles with the builder SDK; the default lands in variables.inputs.

// ...
.action({ ..., recipient: '=vars.start.output.approver' })

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Blocking. =vars.start.output.approver is the Flow path shape. In a case plan the input is vars.approver (variables.inputOutputs[0].id). This compiles to {"Type": 2, "Value": "=vars.start.output.approver"} (Type 2 = a single user by email), and case check says OK and case validate says Valid. Runtime not verified: there is no expression-valued recipient anywhere in the platform corpus, so please confirm with one case debug that even =vars.approver resolves before recommending it.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in a0e145e. The recipient is now { type: 3, value: '=vars.approver' }, and it compiles to {"Type":3,"Value":"=vars.approver"}. Type 3 is the expression type: CLI sdd-convert/recipient.ts maps an expression recipient to it, and strict-case-rules.spec.ts accepts it. The same source comment says 68 of the 74 corpus expression recipients use type 3, and that one ran in TIF-12003. I did not run case debug.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verified at 5451ad2: recipient: { type: 3, value: '=vars.approver' } compiles to {"Type": 3, "Value": "=vars.approver"} and passes validate --strict. Type 3 is backed by the CLI's strict rule and its corpus note; runtime assignment not verified by me.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛑 Blocker · Types & contracts: use the case recipient contract

This recipe fails before it can route an action: the case entry point does not export types.string. Changing that to 'string' still leaves two problems: case inputs use =vars.approver, and a string recipient is serialized as Type 2, a literal email. =vars.start.output.approver is the Flow path and becomes literal recipient text.

Show the supported input/default syntax and an expression recipient, { type: 3, value: '=vars.approver' }. Replace the script fallback below too: copying the value into another variable does not change recipient Type 2. Current SDK plan checks diagnose this contract.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in a0e145e, as you suggested. The recipe is a case input plus { type: 3, value: '=vars.approver' }, which compiles and checks clean on SDK 6.120.17. The script fallback is gone. The rule also says that the SDK's RecipientType doc comment, which calls 0/1/3 reserved, is stale.

```

If `check` reports the expression as a literal, use a script task to read
the input into a variable and pass that variable's value instead.

Tell the user before publishing:
1. The input default is a **test** value. It routes every action to that
address until someone edits the case input defaults and republishes.
2. Going live means changing the defaults in the source (or removing them so
the caller must supply real addresses) and publishing a new version.

<!-- RULE:case.recipient.no-silent-default -->
- Do not set a recipient default to the user's own email without saying so.
State what the default is, that it is baked into the plan, and what
changing it requires. The user decides whether to publish with that default.

## Script tasks

<!-- RULE:case.script.positional-rename -->
Expand Down
Loading