Skip to content

Commit 254d40c

Browse files
committed
test(lint, service-automation): the sharing-rule and API-flow list-equality pins build fixtures that register
The sharing-rule fixture named a recipient type the spec does not have and no rule type, so the three sharing-site cases stopped at the spec-validity guard. The API-flow control carried no hook secret, so registerFlow refused it before the advisory pass ran. Claude-Session: https://claude.ai/code/session_01QsR2jVXKcrF3rr7ShYFZ9E Co-authored-by: Claude <noreply@anthropic.com>
1 parent 434021d commit 254d40c

2 files changed

Lines changed: 11 additions & 5 deletions

File tree

‎packages/lint/src/validate-expressions.list-equality-36167.test.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,7 @@ describe('publish lint — list-equality at a sharing rule condition', () => {
205205
specValid({
206206
objects: [ticket],
207207
sharingRules: [
208-
{ name: 'sr', object: 'ticket_probe', condition, sharedWith: { type: 'role', value: 'r' }, accessLevel: 'read' },
208+
{ name: 'sr', type: 'criteria', object: 'ticket_probe', condition, sharedWith: { type: 'team', value: 't' }, accessLevel: 'read' },
209209
],
210210
});
211211
/** The expression lint's findings and the enforceability pass's (which lowers the condition) together. */

‎packages/services/service-automation/src/list-equality-advisory-36167.test.ts‎

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,13 +40,18 @@ describe('registerFlow — a list compared with a scalar is reported (advisory)'
4040
}
4141

4242
/** A record-triggered flow by default; `entrance` swaps in a flow no record write fires. */
43-
function makeFlow(condition: string, entrance: { type: string; triggerType?: string } = { type: 'record_change', triggerType: 'record-after-update' }) {
43+
type Entrance = { type: string; triggerType?: string; secretRef?: string };
44+
function makeFlow(condition: string, entrance: Entrance = { type: 'record_change', triggerType: 'record-after-update' }) {
4445
return {
4546
name: 'ticket_flow', label: 'Ticket Flow', type: entrance.type,
4647
nodes: [
4748
{
4849
id: 'start', type: 'start', label: 'Start',
49-
config: { objectName: 'ticket', ...(entrance.triggerType ? { triggerType: entrance.triggerType } : {}) },
50+
config: {
51+
objectName: 'ticket',
52+
...(entrance.triggerType ? { triggerType: entrance.triggerType } : {}),
53+
...(entrance.secretRef ? { secretRef: entrance.secretRef } : {}),
54+
},
5055
},
5156
{ id: 'check', type: 'decision', label: 'Check', config: { condition } },
5257
{ id: 'end', type: 'end', label: 'End' },
@@ -58,7 +63,7 @@ describe('registerFlow — a list compared with a scalar is reported (advisory)'
5863
};
5964
}
6065

61-
function warningsFor(condition: string, entrance?: { type: string; triggerType?: string }): string[] {
66+
function warningsFor(condition: string, entrance?: Entrance): string[] {
6267
const warns: string[] = [];
6368
const engine = new AutomationEngine(loggerCapturing(warns));
6469
engine.setObjectSchemaResolver((name) => (name === 'ticket' ? parseObjectFieldSchema(TICKET_FIELDS) : undefined));
@@ -96,7 +101,8 @@ describe('registerFlow — a list compared with a scalar is reported (advisory)'
96101
// A flow no record write fires runs on what its entrance handed it: the
97102
// names are not proven to be the ticket's fields, so no verdict.
98103
it.each([
99-
['an API flow', { type: 'api', triggerType: 'api' }],
104+
// An inbound api flow registers only with a hook secret (ADR-0041).
105+
['an API flow', { type: 'api', triggerType: 'api', secretRef: 'TICKET_HOOK_SECRET' }],
100106
['a scheduled flow', { type: 'schedule', triggerType: 'schedule' }],
101107
['a trigger-less autolaunched flow', { type: 'autolaunched' }],
102108
])('CONTROL — %s: neither the bare nor the record. read is reported', (_label, entrance) => {

0 commit comments

Comments
 (0)