From 3213160265e84b164b51cc5258bf8cf1a85d3921 Mon Sep 17 00:00:00 2001 From: Claude Date: Sat, 8 Aug 2026 07:25:25 +0000 Subject: [PATCH] test(lint,service-automation): replace out-of-grammar `record-created` fixture token with `record-after-create` MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 12 test fixtures spelled a flow start node's `triggerType` as `record-created`, which is outside the closed grammar the record-change trigger maps: /^record-(before|after)-(create|insert|update|delete|write)$/ (triggerTypeToHookEvents, packages/triggers/trigger-record-change) The token is missing its phase segment, so it maps to ZERO hook events — the exact shape `flow-trigger-unknown-event` reports, and an `error` since #5762. Nothing is red today: all three test files call their own rule directly (`validateFlowTemplatePaths` / `validateReferenceIntegrity` / the runtime expand integration) and none routes through `validateFlowTriggerReadiness`, which is not a `REFERENCE_INTEGRITY_RULES` member. This is a corpus fix, not a defect fix: fixtures are read as examples, and a token the platform's own lint calls "never fires" appearing 12 times in-repo teaches the wrong spelling to anyone (and any AI) reading the tests. `triggerType` is inert at all 12 sites — every fixture flow declares `type: 'record_change'`, so `isRecordTriggered` returns from its first branch without reading the token, and no assertion in any of the three files names `triggerType`. No assertion changes. Refs #5762, #3427. Fixes #5957 Co-Authored-By: Claude Fable 5 Claude-Session: https://claude.ai/code/session_01F8q5J1MQyocgtNspb15fSn --- .../src/reference-integrity-suite.test.ts | 2 +- .../src/validate-flow-template-paths.test.ts | 20 +++++++++---------- .../record-lookup-expand.integration.test.ts | 2 +- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/packages/lint/src/reference-integrity-suite.test.ts b/packages/lint/src/reference-integrity-suite.test.ts index 3cc1fea44d..cc35fcabf5 100644 --- a/packages/lint/src/reference-integrity-suite.test.ts +++ b/packages/lint/src/reference-integrity-suite.test.ts @@ -191,7 +191,7 @@ describe('reference-integrity suite — every member actually runs', () => { // the two must not diverge across commands again. runAs: 'user', nodes: [ - { id: 'start', type: 'start', config: { objectName: 'crm_lead', triggerType: 'record-created' } }, + { id: 'start', type: 'start', config: { objectName: 'crm_lead', triggerType: 'record-after-create' } }, // validateFlowTemplatePaths: `budget` is not a field on crm_lead. In a // FILTER position an erased condition widens the query rather than // narrowing it, so the runtime refuses the node — gating, not advisory diff --git a/packages/lint/src/validate-flow-template-paths.test.ts b/packages/lint/src/validate-flow-template-paths.test.ts index 92e062207b..3161027b12 100644 --- a/packages/lint/src/validate-flow-template-paths.test.ts +++ b/packages/lint/src/validate-flow-template-paths.test.ts @@ -32,7 +32,7 @@ function flowWith(notify: AnyRec, objectName = 'crm_lead'): AnyRec { name: 'notify_lead', type: 'record_change', nodes: [ - { id: 'start', type: 'start', config: { objectName, triggerType: 'record-created' } }, + { id: 'start', type: 'start', config: { objectName, triggerType: 'record-after-create' } }, { id: 'n1', type: 'notify', notify }, ], }, @@ -117,7 +117,7 @@ describe('validateFlowTemplatePaths', () => { name: 'external', type: 'record_change', nodes: [ - { id: 'start', type: 'start', config: { objectName: 'sys_user', triggerType: 'record-created' } }, + { id: 'start', type: 'start', config: { objectName: 'sys_user', triggerType: 'record-after-create' } }, { id: 'n1', type: 'notify', notify: { title: '{record.anything.deep}', body: 'x' } }, ], }, @@ -158,7 +158,7 @@ describe('validateFlowTemplatePaths', () => { name: 'typed_start', type: 'record_change', nodes: [ - { id: 'start', type: 'start', start: { objectName: 'crm_lead', triggerType: 'record-created' } }, + { id: 'start', type: 'start', start: { objectName: 'crm_lead', triggerType: 'record-after-create' } }, { id: 'n1', type: 'notify', notify: { title: '{record.crm_account.name}', body: 'x' } }, ], }, @@ -176,7 +176,7 @@ describe('validateFlowTemplatePaths', () => { name: 'webhook', type: 'record_change', nodes: [ - { id: 'start', type: 'start', config: { objectName: 'crm_lead', triggerType: 'record-created' } }, + { id: 'start', type: 'start', config: { objectName: 'crm_lead', triggerType: 'record-after-create' } }, { id: 'h1', type: 'http', http: { url: 'https://x.test/{record.full_naem}', method: 'GET' } }, ], }, @@ -197,7 +197,7 @@ describe('validateFlowTemplatePaths', () => { { id: 'start', type: 'start', - config: { objectName: 'crm_lead', triggerType: 'record-created', expand: ['crm_account'] }, + config: { objectName: 'crm_lead', triggerType: 'record-after-create', expand: ['crm_account'] }, }, { id: 'n1', type: 'notify', notify: { title: 'From {record.crm_account.name}', body: 'x' } }, ], @@ -218,7 +218,7 @@ describe('validateFlowTemplatePaths', () => { { id: 'start', type: 'start', - config: { objectName: 'crm_lead', triggerType: 'record-created', expand: ['target_channels'] }, + config: { objectName: 'crm_lead', triggerType: 'record-after-create', expand: ['target_channels'] }, }, { id: 'n1', type: 'notify', notify: { title: 'From {record.crm_account.name}', body: 'x' } }, ], @@ -247,7 +247,7 @@ describe('validateFlowTemplatePaths', () => { name: 'crud_flow', type: 'record_change', nodes: [ - { id: 'start', type: 'start', config: { objectName: 'crm_lead', triggerType: 'record-created' } }, + { id: 'start', type: 'start', config: { objectName: 'crm_lead', triggerType: 'record-after-create' } }, { id: 'c1', type, config }, ], }, @@ -330,7 +330,7 @@ describe('validateFlowTemplatePaths', () => { { id: 'start', type: 'start', - config: { objectName: 'crm_lead', triggerType: 'record-created', expand: ['crm_account'] }, + config: { objectName: 'crm_lead', triggerType: 'record-after-create', expand: ['crm_account'] }, }, { id: 'c1', @@ -360,7 +360,7 @@ describe('validateFlowTemplatePaths', () => { name: 'guarded', type: 'record_change', nodes: [ - { id: 'start', type: 'start', config: { objectName: 'crm_lead', triggerType: 'record-created' } }, + { id: 'start', type: 'start', config: { objectName: 'crm_lead', triggerType: 'record-after-create' } }, { id: 'guard', type: 'try_catch', label: 'Guard', config: container }, ], }, @@ -399,7 +399,7 @@ describe('validateFlowTemplatePaths', () => { name: 'looped', type: 'record_change', nodes: [ - { id: 'start', type: 'start', config: { objectName: 'crm_lead', triggerType: 'record-created' } }, + { id: 'start', type: 'start', config: { objectName: 'crm_lead', triggerType: 'record-after-create' } }, { id: 'each', type: 'loop', diff --git a/packages/services/service-automation/src/record-lookup-expand.integration.test.ts b/packages/services/service-automation/src/record-lookup-expand.integration.test.ts index 670390e72a..184f79daa0 100644 --- a/packages/services/service-automation/src/record-lookup-expand.integration.test.ts +++ b/packages/services/service-automation/src/record-lookup-expand.integration.test.ts @@ -50,7 +50,7 @@ function expandFlow(name: string, runAs: 'system' | 'user', expand: string[], fi name, label: name, type: 'record_change', runAs, variables: [{ name: 'noteId', type: 'text', isInput: true }], nodes: [ - { id: 'start', type: 'start', label: 'Start', config: { objectName: 'lead', triggerType: 'record-created', expand } }, + { id: 'start', type: 'start', label: 'Start', config: { objectName: 'lead', triggerType: 'record-after-create', expand } }, { id: 'up', type: 'update_record', label: 'Up', config: { objectName: 'audit', filter: { id: '{noteId}' }, fields } }, { id: 'end', type: 'end', label: 'End' }, ],