Skip to content

Commit 7f3b9b6

Browse files
committed
wip: lint region fixtures and receiver excusal; runtime fake notify declares title
Claude-Session: https://claude.ai/code/session_01QcAS3qiYYZNezaxZxaUdMV Co-Authored-By: Claude <noreply@anthropic.com>
1 parent 725ffa3 commit 7f3b9b6

4 files changed

Lines changed: 18 additions & 9 deletions

File tree

‎packages/lint/src/validate-expressions.test.ts‎

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2292,7 +2292,7 @@ describe('validateStackExpressions (ADR-0032 build-time)', () => {
22922292
const badRegion = () => ({
22932293
nodes: [
22942294
{ id: 'gate', type: 'decision', config: { condition: '{record.rating} >= 4' } },
2295-
{ id: 'act', type: 'update_record' },
2295+
{ id: 'act', type: 'update_record', config: { objectName: 'crm_lead' } },
22962296
],
22972297
edges: [{ id: 'b1', source: 'gate', target: 'act', condition: '{record.status} == "open"' }],
22982298
});
@@ -2342,7 +2342,7 @@ describe('validateStackExpressions (ADR-0032 build-time)', () => {
23422342
body: {
23432343
nodes: [
23442344
{ id: 'gate', type: 'decision', config: { condition: 'record.rating >= 4' } },
2345-
{ id: 'act', type: 'update_record' },
2345+
{ id: 'act', type: 'update_record', config: { objectName: 'crm_lead' } },
23462346
],
23472347
edges: [{ id: 'b1', source: 'gate', target: 'act', condition: 'record.status == "open"' }],
23482348
},
@@ -3011,6 +3011,11 @@ describe('validateStackExpressions — reads only keys the spec declares (meta-t
30113011
// are `success` / `error`, SafeParseResult's own, so that excuse covers
30123012
// both locals for one reason and masks no metadata read either.
30133013
'blankRefusal',
3014+
// [#20316] The spec's node-config judge, one refusal at a time. Its keys
3015+
// are that helper's own `{ code, params, message, source, path }` —
3016+
// never metadata keys — and it is named to stay clear of the `message` /
3017+
// `source` receivers for the reason the two entries above record.
3018+
'configRefusal',
30143019
// [#14089] NOT a receiver at all — the tail of the `'./flow-variable-scope.js'`
30153020
// import specifier, which this scan cannot tell from `scope.j…`. The two
30163021
// entries above it in this set (`fields`, `guards`) are the same artefact

‎packages/lint/src/validate-expressions.ts‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1634,12 +1634,12 @@ export function validateStackExpressions(stack: AnyRec): ExprIssue[] {
16341634
// check reads what such a source spells — the `functionName` alias,
16351635
// the retired dispatch keys — and names each, where the judge would
16361636
// only see `function` absent.
1637-
.filter((r) => !(nodeType === 'script' && r.path === 'function'));
1638-
for (const refusal of configRefusals) {
1637+
.filter((configRefusal) => !(nodeType === 'script' && configRefusal.path === 'function'));
1638+
for (const configRefusal of configRefusals) {
16391639
issues.push({
1640-
where: `${at} · node '${node.id}' (${nodeType}) config.${refusal.path}`,
1641-
message: refusal.message,
1642-
source: refusal.source,
1640+
where: `${at} · node '${node.id}' (${nodeType}) config.${configRefusal.path}`,
1641+
message: configRefusal.message,
1642+
source: configRefusal.source,
16431643
severity: 'error',
16441644
});
16451645
}

‎packages/runtime/src/domains/automation-put-post-error-parity.test.ts‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,9 @@ import { FlowSchema, validateControlFlow } from '@objectstack/spec/automation';
4545
import { HttpDispatcher } from '../http-dispatcher.js';
4646

4747
/** Config keys the fake's `notify` descriptor declares (the #4277 legal set). */
48-
const NOTIFY_DECLARED_CONFIG_KEYS = ['message', 'recipients', 'channel'];
48+
// `title` joined the set when the flow parse began refusing a notify node with
49+
// neither `title` nor `template` (#20316) — the real notify descriptor declares it.
50+
const NOTIFY_DECLARED_CONFIG_KEYS = ['title', 'message', 'recipients', 'channel'];
4951

5052
/**
5153
* The #4277 refusal, reproduced from `service-automation/src/engine.ts`

‎packages/runtime/src/domains/automation-register-error-class.test.ts‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,9 @@ import { FlowSchema, validateControlFlow } from '@objectstack/spec/automation';
7474
import { HttpDispatcher } from '../http-dispatcher.js';
7575

7676
/** Config keys the fake's `notify` descriptor declares (the #4277 legal set). */
77-
const NOTIFY_DECLARED_CONFIG_KEYS = ['message', 'recipients', 'channel'];
77+
// `title` joined the set when the flow parse began refusing a notify node with
78+
// neither `title` nor `template` (#20316) — the real notify descriptor declares it.
79+
const NOTIFY_DECLARED_CONFIG_KEYS = ['title', 'message', 'recipients', 'channel'];
7880

7981
/**
8082
* The #4277 refusal, reproduced from `service-automation/src/engine.ts`

0 commit comments

Comments
 (0)