Skip to content

Commit 57e88ed

Browse files
committed
test(lint): an action param's widget no longer draws the planned-property warning
The params.widget liveness row is live now that the console reads it, so the pin that expected the planned warning becomes its inverse, with a control that the same walk still warns on a planned row. Claude-Session: https://claude.ai/code/session_01L6bhgXcNPmrQhpwYYn7fEq Co-authored-by: Claude <noreply@anthropic.com>
1 parent ae7e6fa commit 57e88ed

1 file changed

Lines changed: 20 additions & 14 deletions

File tree

‎packages/lint/src/lint-liveness-properties.test.ts‎

Lines changed: 20 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -187,11 +187,12 @@ describe('lintLivenessProperties', () => {
187187
}).filter((f) => f.message.includes('objectName'))).toEqual([]);
188188
});
189189

190-
// #30259 — `action.params[].widget` is declared before the console's dialog
191-
// reads it (#30260 adds the pass-through), so the drilled row is `planned` +
192-
// `authorWarn`. Pinned through the SHIPPED ledger and an array of params, so
193-
// the drill (`params.widget`) and the array fan-out both have to hold.
194-
it('warns on an action param that names a widget — planned, nothing reads it yet', () => {
190+
// #30259 declared `action.params[].widget` before any reader (`planned` +
191+
// `authorWarn`, pinned here as a warning). #30260 gave it its console reader
192+
// and flipped the drilled row to `live`, so the SAME param now draws nothing.
193+
// Pinned through the SHIPPED ledger and an array of params, so the drill
194+
// (`params.widget`) and the array fan-out both have to hold.
195+
it('no longer warns on an action param that names a widget — live since its console reader (#30260)', () => {
195196
const findings = lintLivenessProperties({
196197
actions: [{
197198
name: 'create_user',
@@ -201,18 +202,23 @@ describe('lintLivenessProperties', () => {
201202
],
202203
}],
203204
});
204-
const warned = findings.filter((f) => f.message.includes('sets `params.widget`'));
205-
expect(warned).toHaveLength(1);
206-
expect(warned[0].rule).toBe('liveness-planned-property');
207-
expect(warned[0].hint).toContain('nothing reads it yet');
208-
// The live siblings the drill graded stay silent.
205+
expect(findings.filter((f) => f.message.includes('params.widget'))).toEqual([]);
206+
expect(ruleOf(findings, 'params.widget')).toBeUndefined();
207+
// The live siblings the drill graded stay silent too.
209208
for (const key of ['name', 'type', 'required', 'options', 'helpText', 'carryOver']) {
210209
expect(ruleOf(findings, `params.${key}`), key).toBeUndefined();
211210
}
212-
// And an action whose params name no widget draws nothing about it.
213-
expect(lintLivenessProperties({
214-
actions: [{ name: 'a2', params: [{ name: 'note', type: 'text' }] }],
215-
}).filter((f) => f.message.includes('widget'))).toEqual([]);
211+
// CONTROL: the same walk still warns on a drilled `planned` + authorWarn
212+
// row elsewhere in the shipped ledger, so the silence above is the
213+
// widget row's verdict, not a walk that reaches nothing.
214+
const flow = lintLivenessProperties({
215+
flows: [{
216+
name: 'close_account',
217+
variables: [{ name: 'accountId', type: 'text', isInput: true, objectName: 'crm_account' }],
218+
nodes: [{ id: 'start', type: 'start' }],
219+
}],
220+
});
221+
expect(ruleOf(flow, 'variables.objectName')).toBe('liveness-planned-property');
216222
});
217223

218224
it('warns on an experimental prop with no authorWarn of its own (tool.outputSchema)', () => {

0 commit comments

Comments
 (0)