From ed3a9a8da85845f1d30343b1343e6f05c050b323 Mon Sep 17 00:00:00 2001 From: Claude Date: Fri, 27 Nov 2026 06:36:39 +0000 Subject: [PATCH] docs(lint): os explain flow-condition-option-label covers filters and edge conditions (#37504) The explanation said the rule reads a record-change start condition only. Since #37491 it also reads edge and decision conditions and the query filters of get_record / update_record / delete_record and a time-relative sweep; the text now says so, with each position's matching rules and the CEL value envelope escape for a deliberate label filter. Co-Authored-By: Claude Claude-Session: https://claude.ai/code/session_01L6bhgT5oFVDnxy3bMa3NBi --- .changeset/37504-option-label-explanation.md | 7 ++++ packages/lint/src/rule-explanations.ts | 36 ++++++++++++++------ 2 files changed, 32 insertions(+), 11 deletions(-) create mode 100644 .changeset/37504-option-label-explanation.md diff --git a/.changeset/37504-option-label-explanation.md b/.changeset/37504-option-label-explanation.md new file mode 100644 index 00000000000..d1d2ae7082c --- /dev/null +++ b/.changeset/37504-option-label-explanation.md @@ -0,0 +1,7 @@ +--- +'@objectstack/lint': patch +--- + +docs(lint): `os explain flow-condition-option-label` describes every place the rule reads — the start condition, edge and decision conditions, and the `get_record` / `update_record` / `delete_record` and time-relative sweep filters — and names the CEL value envelope as the way to filter on a label on purpose + +Clause-②: no (explanation text only) diff --git a/packages/lint/src/rule-explanations.ts b/packages/lint/src/rule-explanations.ts index 04383c4a59a..0ded7a779e5 100644 --- a/packages/lint/src/rule-explanations.ts +++ b/packages/lint/src/rule-explanations.ts @@ -6743,17 +6743,31 @@ const FLOW_TRIGGER_OBJECT_MISSING_EXPLANATION: RuleExplanation = { const FLOW_CONDITION_OPTION_LABEL_EXPLANATION: RuleExplanation = { rule: 'flow-condition-option-label', - covers: 'why a start condition compares option values', - paragraphs: [ - 'A select field stores the option\'s `value`, never its `label`. A record-change start condition that ' + - 'reads the field and compares it with a quoted label (`record.stage == \'Closed Lost\'` where the option ' + - 'is `{ value: \'closed_lost\', label: \'Closed Lost\' }`) is false on every record, or true on every ' + - 'record for `!=`, so the condition never tells one record from another.', - 'Reported only when the label is the comparand of that field: `F == \'L\'`, `F != \'L\'`, `\'L\' == F`, or ' + - 'a member of `F in [...]`, with `F` read bare or as `record.F` / `previous.F`. A label quoted elsewhere ' + - 'in the condition, such as the comparand of another field, is not. A label that is also some option\'s ' + - 'value is never reported. Fields whose options come from a shared picklist are not judged: the stack ' + - 'does not hold that list.', + covers: 'why flow conditions and filters use option values', + paragraphs: [ + 'A select field stores the option\'s `value`, never its `label`. A flow that compares the field with a ' + + 'quoted label (`record.stage == \'Closed Lost\'` where the option is ' + + '`{ value: \'closed_lost\', label: \'Closed Lost\' }`) never matches a record, or matches every record ' + + 'for `!=`, and the run still reports success.', + 'The rule reads every place a flow compares the field: a record-change start condition, an edge ' + + '`condition`, a `decision` branch\'s `expression`, and the `filter` of a `get_record`, `update_record` or ' + + '`delete_record` step or of a time-relative sweep. A flow filter reaches the data engine as written and ' + + 'is never translated from label to value, so the read finds nothing, the update or delete changes ' + + 'nothing, and the branch is never taken.', + 'In a condition, reported only when the label is the comparand of that field: `F == \'L\'`, ' + + '`F != \'L\'`, `\'L\' == F`, or a member of `F in [...]`. `F` is the trigger record\'s field, read bare or ' + + 'as `record.F` / `previous.F`, or a field of the row a single-row `get_record` step bound to its ' + + '`outputVariable` (`deal.F`). A variable that something else in the flow also binds is not judged: ' + + 'which row it holds is decided by the run.', + 'In a filter, reported when the label is the field\'s plain equality, its `$eq` / `$ne` operand or a ' + + 'member of its `$in` / `$nin` list, at the top level or under `$and` / `$or` / `$not`. A related ' + + 'object\'s field, an ordering or text operator, and a string carrying a brace (a template such as ' + + '`{current_user_id}`) are not judged. To find rows that still hold a label on purpose, for a clean-up ' + + 'after the options changed, write the operand as a CEL value envelope (`{ dialect: \'cel\', source }`): ' + + 'it is not judged.', + 'Everywhere, a label quoted elsewhere, such as the comparand of another field, is not reported, and a ' + + 'label that is also some option\'s value never is. Fields whose options come from a shared picklist are ' + + 'not judged: the stack does not hold that list.', ], };