Skip to content

Commit 36da2bf

Browse files
committed
fix(spec): one job alias per probe — the probe folds case and underscores
Claude-Session: https://claude.ai/code/session_01T9u38rswFp5Rw8DswRUReJ Co-authored-by: Claude <noreply@anthropic.com>
1 parent 1b0a4b3 commit 36da2bf

2 files changed

Lines changed: 5 additions & 3 deletions

File tree

‎packages/spec/src/system/job-pull-organization.test.ts‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,8 @@ describe('JobSchema.organization — the scheduled flow\'s value shape, reused',
105105
});
106106

107107
it('a near-miss spelling is refused at parse and pointed at `organization`', () => {
108-
for (const key of ['organizationId', 'orgId', 'tenantId']) {
108+
// `organization_id` has no entry of its own: the alias probe folds case and `_`.
109+
for (const key of ['organizationId', 'organization_id', 'orgId', 'tenantId']) {
109110
const r = JobSchema.safeParse({ ...base, pull, [key]: 'org_a' });
110111
expect(r.success, key).toBe(false);
111112
const issue = r.error!.issues.find((i) => i.code === 'unrecognized_keys');

‎packages/spec/src/system/job.zod.ts‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -258,8 +258,9 @@ export const JobSchema = lazySchema(() => strictObject({
258258
mapping: 'pull', sync: 'pull', connectorSource: 'pull',
259259
// The organization under the near-miss spellings the scheduled flow's
260260
// refusal names — on this closed shape they are refused at parse, by name.
261-
organizationId: 'organization', organization_id: 'organization', orgId: 'organization', org_id: 'organization',
262-
tenantId: 'organization', tenant_id: 'organization', tenant: 'organization',
261+
// One spelling per probe: the probe folds case and `_`, so `organization_id`,
262+
// `org_id` and `tenant_id` are caught by the camelCase entries.
263+
organizationId: 'organization', orgId: 'organization', tenantId: 'organization', tenant: 'organization',
263264
},
264265
guidance: { id: JOB_ID_RETIRED },
265266
}, {

0 commit comments

Comments
 (0)