Skip to content

Commit 61ded62

Browse files
fix(service-automation)!: the connector pull door refuses an input key its read action does not declare, as connector_action does (#34089)
<!-- claude-projects-attribution: {"github_login":"zhuangjianguo"} --> _Requested by **Steedos** · [project thread](https://claude.ai/code/project/chan_018ETKaNwMZCNRYD7D8Q9Ubb?thread=cmsg_018ETKaNwMZCNRYD7D8Q9UbbTGhxJSYAmQXU7efVdNqrpw)_ Fixes #33894 Clause-②: no (narrowing) — a mapping whose `connectorSource.input`, or the watermark parameter the pull adds to its `query`, carries a key the read action's `inputSchema` does not declare used to pull and send that key to the provider; the pull now fails before the call with `VALIDATION_ERROR`. Nothing published widens: no export, no key, no option is added. First-party mappings affected: 0 (no `connectorSource` under `examples/` or `packages/apps/`). Metadata-protocol: narrowed Skills-docs: none — `git grep -i 'connectorSource|watermark' -- skills/` has 0 hits: no published skill teaches the connector pull door's input ## 维护者速读 - 改了什么:映射的连接器拉取入口(`connectorSource.input`)也像 `connector_action` 节点一样,拒收读取动作 `inputSchema` 未声明的输入键,包括拉取入口自己加进 `query` 的水位参数(如 `since`);拒绝时报 `VALIDATION_ERROR`,点名该键和修法,不调用外部服务、不写入。 - 为什么改:维护者裁决 6896271476「多余参数直接报错」:凡是调用连接器动作的入口,对输入一视同仁;以后新入口直接继承,不再回来要裁决。 - 风险与回滚:收窄。定时拉取没有 fault 边,带多余键的映射每次运行都失败(`sys_sync_run` 记 failed),直到映射或 OpenAPI 文档修好;水位参数只在目标已有值后才发送,所以首拉成功、第二次起失败。第一方受影响 0 处;rest 连接器的 `query` 是开放的,不受影响。回滚 = revert 本 PR。 - 先看:`packages/services/service-automation/src/connector-pull.ts` 的判定段(打开 `refuseUndeclaredKeys`,以及单独判定水位参数以便在拒绝句里点名它);`connector-pull-undeclared-input-key.test.ts`;changeset 的迁移说明。 - 两分钟验证:`pnpm --filter @objectstack/service-automation exec vitest run src/connector-pull-undeclared-input-key.test.ts src/connector-pull.test.ts`,预期全部通过(新文件 6 个用例,翻转后的拒绝 pin 在 `connector-pull.test.ts`)。 - 需要你做的:无,席位落地(合同档复核由区域安排)。 ## What changes - `packages/services/service-automation/src/connector-pull.ts`: the pull door judges the input it is about to send with `judgeConnectorInput(..., { refuseUndeclaredKeys: true })`, as `connector_action` does (ruling 6896271476: every door that dispatches a connector action judges its input alike). The refusal keeps its `VALIDATION_ERROR` 400 `input_schema_mismatch` envelope and appends the pull door's own hint: remove the key from `connectorSource.input` or declare it in the action (for `openapi`, in the OpenAPI document). When the undeclared key is the watermark parameter the door added itself (judged alone against the schema, so the sentence never blames the watermark for an author's key), the refusal names it and says to declare it as an `in: query` parameter of the operation. - `connector-pull.test.ts`: the pin `[#33553] an undeclared key is not refused here` (formerly 385-398) is flipped in place to a refusal pin: `code` + `status` + `reason`, both undeclared keys named, handler never called, nothing written. - New `connector-pull-undeclared-input-key.test.ts` (named by the card): the door-added watermark key. An openapi-shaped operation that lists only `query.limit`, and one that emits no `query` section, both refuse `since` naming it and the OpenAPI fix; an author's stray key with the watermark declared does not mention the watermark. Controls: the declared watermark is sent; the first pull (nothing stored) sends no watermark and is not refused; a `rest` connector's open `query` takes the watermark as before. - `packages/spec/src/data/mapping.zod.ts` (`connectorSource.input` describe) and the generated `content/docs/references/data/mapping.mdx`: input is judged before the call; an undeclared key is refused, the watermark parameter included. - New semantic migration entry `18.connector-pull-undeclared-input-key-refused` (entry 18 `connector-action-undeclared-input-key-refused`, shipped in 18.5.0, is not touched). - `content/docs/automation/jobs.mdx`: the `connectorSource` run bullet says the input is judged, names the watermark parameter and the OpenAPI fix, and that a scheduled run has no `fault` edge, so the refusal fails every run until fixed. - BREAKING changeset (`minor` on `@objectstack/service-automation` and `@objectstack/spec`) with the ADR-0087 marker and the FROM → TO migration. **For the sync-in owner (ADR-0153 D2, Proposed):** when the pull door starts sending paging parameters (`connectorSource.paging`), they are judged by this same rule, so the design now presumes the read action declares them; a paging parameter an `openapi` operation does not list will be refused like the watermark. ## Tests <details><summary>Touched-package suites and typecheck (head before the last main merge; re-run touched files on the final head where noted)</summary> - `pnpm --filter @objectstack/service-automation test`: Test Files 283 passed (283), Tests 4003 passed (4003). - `pnpm --filter @objectstack/service-automation typecheck` (tsc + check:test-typecheck): exit 0 after typing the new file's handler (first run named TS2493 in the new file, fixed). - `pnpm --filter @objectstack/spec test`: Test Files 842 passed (842), Tests 26961 passed, 1 todo; `pnpm --filter @objectstack/spec typecheck`: exit 0. - `pnpm --filter @objectstack/spec check:generated`: 1 of 14 stale (`check:docs`), regenerated with `--fix`, committed. - The four connector-pull files (unit, new file, integration through the real `rest` connector, service door): 64 passed. </details> <details><summary>Ablations (each red, then restored with blob == HEAD and git diff HEAD empty)</summary> - A, drop `{ refuseUndeclaredKeys: true }` from the door's judge: 4 failed (the flipped pin and three new-file pins), "the pull must refuse, not resolve: expected undefined to be an instance of ConnectorPullError". - B, never name the watermark (`addedUndeclared = false`): 2 failed, "expected ... to contain 'watermark parameter 'since''". - C, make the watermark probe always undeclared: 1 failed, "expected ... not to contain 'watermark parameter'". </details> ## Acceptance notes - First pull edge: the watermark parameter is sent only once the target holds a value, so a mapping whose operation does not declare it pulls once and fails from the second run on. The changeset, the migration entry and the refusal say so; judging it on the first pull too would be a further narrowing not in the ruling. - `connector-input-schema.ts`'s header and `ConnectorInputJudgeOptions.refuseUndeclaredKeys` doc name only the `connector_action` node as the door that opts in; they stay true but incomplete (outside the claim's file surface, left untouched). - `packages/spec/docs/SYNC_ARCHITECTURE.md` says the pull judges required parameters and types "as a `connector_action` flow node's is"; it does not list the undeclared-key refusal (outside the claim's file surface). - The 18.5.0 changeset for the node half ends "The connector pull door (`connectorSource.input`) is unchanged."; released text, true when shipped, superseded by this changeset; not edited here. ## Verification - Hot-file rule: no open PR shares a file with this branch (59 open PRs' file lists read). `git merge-tree --write-tree --name-only` against origin/main and the two PRs that add sibling files in `entries/semantic/` (#33970, #34001): exit 0, no conflicted paths. - Dogfood battery and the derived gate subset: see the report comment on the card. --- _Generated by [Claude Code](https://claude.ai/code/session_01QsR2jTEivi2wogPpeo3xd5)_ 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Co-authored-by: Claude <noreply@anthropic.com> Co-authored-by: objectstack-fleet[bot] <332303061+objectstack-fleet[bot]@users.noreply.github.com>
1 parent 571cf90 commit 61ded62

8 files changed

Lines changed: 314 additions & 11 deletions

File tree

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
---
2+
'@objectstack/service-automation': minor
3+
'@objectstack/spec': minor
4+
---
5+
6+
fix(service-automation)!: the connector pull door refuses an input key its read action does not declare, as the `connector_action` node does
7+
8+
Clause-②: no (narrowing) — a mapping whose `connectorSource.input`, or the watermark parameter the pull adds to its `query`, carries a key the read action's `inputSchema` does not declare used to pull and send that key to the provider; the pull now fails before the call. Nothing published widens: no export, no key, no option is added. First-party mappings affected: 0 (no `connectorSource` under `examples/` or `packages/apps/`).
9+
Metadata-protocol: narrowed
10+
11+
<!-- adr-0087: registered connector-pull-undeclared-input-key-refused -->
12+
13+
**BREAKING** for a mapping pulled through `connectorSource` whose input holds a key the read action does not declare. Every door that dispatches a connector action now judges its input alike: the pull judges the input it is about to send, the watermark parameter included, by the rule the `connector_action` node has applied since 18.5.0, and refuses with `code: 'VALIDATION_ERROR'` (status 400) before the action is called, naming each undeclared key by its dotted path and the keys the action declares at that level. Nothing is pulled and nothing is written.
14+
15+
A scheduled pull has no `fault` edge: a job whose `pull` names such a mapping fails every run (its `sys_sync_run` row ends `failed`, and the job's `retryPolicy` applies) until the mapping or the action's document is fixed.
16+
17+
The key the pull adds itself is judged too. With `connectorSource.watermark`, the pull sends the highest stored value of the target field as `query[watermark.param]` — but only once the target holds a value, so a mapping whose first pull wrote rows fails from its second pull on. An `openapi` connector declares only the query parameters its OpenAPI document names, so an operation that does not name the watermark parameter (or names none in `query` while declaring a parameter elsewhere or a body) refuses it; the refusal names the parameter. An operation with no parameter and no body has no `inputSchema`, so nothing is judged and the watermark is sent; it starts refusing the watermark the day the document gives it its first parameter or a body, unless the watermark parameter is declared with it. A `rest` connector's `request` action declares `query` with no `properties`, which reads as open, so its query keys, the watermark included, are not refused.
18+
19+
Migration, FROM → TO:
20+
21+
- A stray key the author wrote: `connectorSource: { connector: 'crm_api', action: 'list_contacts', input: { query: { limit: 50, stale: 'x' } } }` → drop `stale` from `input`, or declare it in the action.
22+
- The watermark parameter on an `openapi` connector: `watermark: { field: 'updated_at', param: 'since' }` over an operation whose document lists only `limit` → add `{ name: 'since', in: 'query', schema: { type: 'string' } }` to that operation's `parameters` in the OpenAPI document (its declared type must be the target field's), then let the connector re-materialize.
23+
24+
`GET /api/v1/automation/connectors` lists each action's `inputSchema`, which is what the pull judges against. Which schemas declare their keys is the `connector_action` node's rule, unchanged: an object schema that lists `properties`, or says `additionalProperties: false`; one that admits more keys (`additionalProperties` true or a schema, `patternProperties`, a composition keyword, `$ref`) or lists no `properties` still sends every key, and so does an action with no `inputSchema`.

‎content/docs/automation/jobs.mdx‎

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -285,7 +285,17 @@ export const OrdersPullJob = defineJob({
285285
- A **`connectorSource`** run calls the connector's read action once and reads
286286
one response — see
287287
[Data sync is defined on the target](https://github.com/objectstack-ai/objectstack/blob/main/packages/spec/docs/SYNC_ARCHITECTURE.md#data-sync-is-defined-on-the-target)
288-
for the watermark and the one-response limit.
288+
for the watermark and the one-response limit. The input it sends is judged
289+
against the action's `inputSchema` first, as a `connector_action` step's is:
290+
a key the action does not declare is refused, never sent. That includes the
291+
watermark parameter the run adds to `query` (`since`, say) once the target
292+
holds a value, so an `openapi` connector's read operation that declares any
293+
parameter or a body must declare it as an `in: query` parameter in the
294+
OpenAPI document. An operation that declares neither has no `inputSchema`
295+
and is not judged, until the day it gains its first parameter or a body;
296+
from then on an undeclared watermark is refused. A scheduled run has no
297+
`fault` edge: such a refusal fails every run until the mapping or the
298+
document is fixed.
289299
- A **`datasourceSource`** run reads the federated object in windows cut on
290300
`watermark.field`. A built-in driver's windows are read whole, paged by the key
291301
the object's `external.columnMap` maps onto `id`. A plugin driver's windows go

‎content/docs/references/data/mapping.mdx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ const result = ImportFieldMappingSchema.parse(data);
7575
| :--- | :--- | :--- | :--- |
7676
| **connector** | `string` | ✅ | Name of the connector instance the rows are pulled from — a `connectors[]` entry whose `provider` is `rest` or `openapi` (version 1) |
7777
| **action** | `string` | ✅ | Key of the connector action that reads the records: `request` on a `rest` connector, an operation key on an `openapi` connector |
78-
| **input** | `Record<string, any>` | optional | Fixed input passed to the action on every pull (e.g. `{ method: 'GET', path: '/contacts' }` for `rest`) |
78+
| **input** | `Record<string, any>` | optional | Fixed input passed to the action on every pull (e.g. `{ method: 'GET', path: '/contacts' }` for `rest`). Judged against the action's `inputSchema` before the call, as a `connector_action` node's input is: a key the action does not declare is refused, never sent — the watermark parameter the pull adds to `query` included, so an `openapi` operation that declares any parameter or a body must declare it in its OpenAPI document. An operation that declares neither has no `inputSchema` and is not judged, until the day it gains its first parameter or a body |
7979
| **recordsPath** | `string` | optional | Dot path, within the action's result, to the array of records (e.g. `body.results`); omitted ⇒ the result's `body` is the array |
8080
| **watermark** | `{ field: string; param: string }` | optional | Timestamp-incremental pull; omitted ⇒ every pull reads the full set. Either way a pull makes ONE action call and reads ONE response: the connector's paging is not followed, so a paged endpoint yields its first page only — and an incremental pull over a newest-first paged endpoint moves its starting point past the pages it never read |
8181
| **paging** | `{ style: Enum<'page' \| 'cursor' \| 'offset' \| 'none'>; param?: string; nextPath?: string }` | optional | The connector's paging convention: page, cursor or offset, or `none` for a source whose one response is the whole set. Omitted ⇒ a pull reads one response and does not treat it as complete |
Lines changed: 200 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,200 @@
1+
// Copyright (c) 2026 ObjectStack. Licensed under the Apache-2.0 license.
2+
3+
/**
4+
* [#33894] The connector pull door refuses an input key the read action does
5+
* not declare, as the `connector_action` node does: every door that
6+
* dispatches a connector action judges its input alike. The undeclared key
7+
* the author wrote is pinned beside the door's other input refusals in
8+
* `connector-pull.test.ts`; this file pins the key the door ADDS itself —
9+
* the watermark parameter, sent as `query[watermark.param]` once the target
10+
* holds a value — which only the action can declare (for an `openapi`
11+
* connector, its OpenAPI document).
12+
*
13+
* The schemas below are the shapes the shipped producers emit: the `openapi`
14+
* generator's `{ path, query, header, body }` sections, where a location the
15+
* operation declares no parameter in is left out, and the `rest` connector's
16+
* `request`, whose `query` lists no `properties` and so declares open input.
17+
*
18+
* Every refusal asserts the ADR-0112 pair (`code` + `status`), the executor's
19+
* `reason`, the named key, and that neither the action nor a write ran.
20+
*/
21+
22+
import { describe, it, expect, vi } from 'vitest';
23+
import {
24+
pullConnectorSource,
25+
ConnectorPullError,
26+
type ConnectorPullDeps,
27+
} from './connector-pull.js';
28+
29+
const silent = { debug() {}, info() {}, warn() {}, error() {} } as unknown as ConnectorPullDeps['logger'];
30+
31+
const contactObject = {
32+
name: 'contact',
33+
fields: {
34+
external_id: { name: 'external_id', type: 'text' },
35+
name: { name: 'name', type: 'text' },
36+
synced_at: { name: 'synced_at', type: 'text' },
37+
},
38+
};
39+
40+
/** An incremental mapping: `updated_at` is copied onto `synced_at`, and sent back as `query.since`. */
41+
function incrementalMapping(input: Record<string, unknown>) {
42+
return {
43+
name: 'crm_contacts',
44+
targetObject: 'contact',
45+
fieldMapping: [
46+
{ source: 'id', target: 'external_id' },
47+
{ source: 'name', target: 'name' },
48+
{ source: 'updated_at', target: 'synced_at' },
49+
],
50+
mode: 'upsert',
51+
upsertKey: ['external_id'],
52+
connectorSource: {
53+
connector: 'crm_api', action: 'list_contacts', input,
54+
watermark: { field: 'updated_at', param: 'since' },
55+
},
56+
};
57+
}
58+
59+
/** An `openapi` operation declaring `query.limit` only — the document never names `since`. */
60+
const OPENAPI_LIMIT_ONLY = {
61+
type: 'object',
62+
properties: { query: { type: 'object', properties: { limit: { type: 'integer' } } } },
63+
};
64+
65+
/** An `openapi` operation declaring only a header parameter: the generator emits no `query` section at all. */
66+
const OPENAPI_NO_QUERY = {
67+
type: 'object',
68+
properties: { header: { type: 'object', properties: { 'X-Tenant': { type: 'string' } } } },
69+
};
70+
71+
/** The same operation once the document declares `since` as an `in: query` parameter. */
72+
const OPENAPI_SINCE_DECLARED = {
73+
type: 'object',
74+
properties: {
75+
query: { type: 'object', properties: { limit: { type: 'integer' }, since: { type: 'string' } } },
76+
},
77+
};
78+
79+
/** The `rest` connector's `request` action: `query` lists no `properties`, so every query key is open. */
80+
const REST_REQUEST = {
81+
type: 'object',
82+
properties: {
83+
method: { type: 'string' },
84+
path: { type: 'string' },
85+
headers: { type: 'object' },
86+
query: { type: 'object' },
87+
body: {},
88+
},
89+
};
90+
91+
const STORED = [{ synced_at: '2026-01-02T00:00:00.000Z' }];
92+
93+
function harness(opts: {
94+
/** Absent ⇒ the action declares no `inputSchema`. */
95+
inputSchema: Record<string, unknown> | undefined;
96+
input: Record<string, unknown>;
97+
stored?: Array<Record<string, unknown>>;
98+
}) {
99+
const writes: unknown[] = [];
100+
const handler = vi.fn(async (_input: Record<string, unknown>) => ({ status: 200, ok: true, body: [] }) as Record<string, unknown>);
101+
const mapping = incrementalMapping(opts.input);
102+
const deps: ConnectorPullDeps = {
103+
protocol: {
104+
async getMetaItem({ type, name }) {
105+
if (type === 'mapping' && name === mapping.name) return { type, name, item: mapping };
106+
if (type === 'object' && name === 'contact') return { type, name, item: contactObject };
107+
return undefined;
108+
},
109+
async findData() { return { records: opts.stored ?? [] }; },
110+
async createData(args) { writes.push(args); return { id: 'new' }; },
111+
async updateData(args) { writes.push(args); return { id: 'upd' }; },
112+
},
113+
registry: {
114+
resolveConnectorAction: (connector, action) =>
115+
connector === 'crm_api' && action === 'list_contacts' ? handler : undefined,
116+
getConnectorOrigin: (name) => (name === 'crm_api' ? 'declarative' : undefined),
117+
getConnectorDegradedReason: () => undefined,
118+
getConnectorDescriptors: () => [{
119+
name: 'crm_api', label: 'CRM', type: 'api', origin: 'declarative', state: 'ready',
120+
actions: [{ key: 'list_contacts', label: 'List contacts', inputSchema: opts.inputSchema }],
121+
}],
122+
},
123+
providerOf: (name) => (name === 'crm_api' ? 'openapi' : undefined),
124+
logger: silent,
125+
};
126+
return { deps, handler, writes };
127+
}
128+
129+
async function refusal(h: ReturnType<typeof harness>): Promise<ConnectorPullError> {
130+
const err = await pullConnectorSource(h.deps, { mapping: 'crm_contacts' }).then(
131+
() => undefined,
132+
(e: unknown) => e,
133+
);
134+
expect(err, 'the pull must refuse, not resolve').toBeInstanceOf(ConnectorPullError);
135+
const e = err as ConnectorPullError;
136+
expect({ code: e.code, status: e.status, reason: e.reason, mapping: e.mapping }).toEqual({
137+
code: 'VALIDATION_ERROR', status: 400, reason: 'input_schema_mismatch', mapping: 'crm_contacts',
138+
});
139+
expect(h.handler).toHaveBeenCalledTimes(0);
140+
expect(h.writes).toEqual([]);
141+
return e;
142+
}
143+
144+
describe('[#33894] connector pull — the watermark parameter the door adds is judged like any other input key', () => {
145+
it('a watermark parameter the operation does not declare is refused, naming it and the OpenAPI fix', async () => {
146+
const h = harness({ inputSchema: OPENAPI_LIMIT_ONLY, input: { query: { limit: 50 } }, stored: STORED });
147+
const err = await refusal(h);
148+
expect(err.message).toContain("'query.since' is not an input the action declares");
149+
expect(err.message).toContain("watermark parameter 'since'");
150+
expect(err.message).toContain('OpenAPI document');
151+
});
152+
153+
it('an operation that declares no query parameter at all refuses the watermark the same way', async () => {
154+
const h = harness({ inputSchema: OPENAPI_NO_QUERY, input: {}, stored: STORED });
155+
const err = await refusal(h);
156+
expect(err.message).toContain("'query' is not an input the action declares");
157+
expect(err.message).toContain("watermark parameter 'since'");
158+
});
159+
160+
it('an undeclared key the author wrote does not blame the watermark when the watermark is declared', async () => {
161+
const h = harness({
162+
inputSchema: OPENAPI_SINCE_DECLARED,
163+
input: { query: { limit: 50, stale: 'x' } },
164+
stored: STORED,
165+
});
166+
const err = await refusal(h);
167+
expect(err.message).toContain("'query.stale' is not an input the action declares");
168+
expect(err.message).not.toContain('watermark parameter');
169+
});
170+
171+
it('CONTROL: once the document declares the watermark parameter, the pull sends it', async () => {
172+
const h = harness({ inputSchema: OPENAPI_SINCE_DECLARED, input: { query: { limit: 50 } }, stored: STORED });
173+
await pullConnectorSource(h.deps, { mapping: 'crm_contacts' });
174+
expect(h.handler).toHaveBeenCalledTimes(1);
175+
expect(h.handler.mock.calls[0][0]).toEqual({ query: { limit: 50, since: '2026-01-02T00:00:00.000Z' } });
176+
});
177+
178+
it('CONTROL: the first pull, with nothing stored yet, sends no watermark and so is not refused for it', async () => {
179+
const h = harness({ inputSchema: OPENAPI_LIMIT_ONLY, input: { query: { limit: 50 } } });
180+
await pullConnectorSource(h.deps, { mapping: 'crm_contacts' });
181+
expect(h.handler).toHaveBeenCalledTimes(1);
182+
expect(h.handler.mock.calls[0][0]).toEqual({ query: { limit: 50 } });
183+
});
184+
185+
it('CONTROL: an openapi operation with no parameter and no body declares no inputSchema, so nothing is judged and the watermark is sent', async () => {
186+
const h = harness({ inputSchema: undefined, input: {}, stored: STORED });
187+
await pullConnectorSource(h.deps, { mapping: 'crm_contacts' });
188+
expect(h.handler).toHaveBeenCalledTimes(1);
189+
expect(h.handler.mock.calls[0][0]).toEqual({ query: { since: '2026-01-02T00:00:00.000Z' } });
190+
});
191+
192+
it('CONTROL: a rest connector\'s open query section takes the watermark parameter as before', async () => {
193+
const h = harness({ inputSchema: REST_REQUEST, input: { method: 'GET', path: '/contacts' }, stored: STORED });
194+
await pullConnectorSource(h.deps, { mapping: 'crm_contacts' });
195+
expect(h.handler).toHaveBeenCalledTimes(1);
196+
expect(h.handler.mock.calls[0][0]).toEqual({
197+
method: 'GET', path: '/contacts', query: { since: '2026-01-02T00:00:00.000Z' },
198+
});
199+
});
200+
});

‎packages/services/service-automation/src/connector-pull.test.ts‎

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -382,7 +382,7 @@ describe('[#28040] connector pull — the input is checked against the action\'s
382382
expect(res.pulled).toBe(0);
383383
});
384384

385-
it('[#33553] an undeclared key is not refused here: the pull door does not opt in to that judgment', async () => {
385+
it('[#33894] an undeclared key is VALIDATION_ERROR 400 naming it, as at the connector_action node, and the action is never called', async () => {
386386
const h = harness({
387387
inputSchema: SINCE_REQUIRED,
388388
mapping: baseMapping({
@@ -392,11 +392,12 @@ describe('[#28040] connector pull — the input is checked against the action\'s
392392
},
393393
}),
394394
});
395-
await pullConnectorSource(h.deps, { mapping: 'crm_contacts' });
396-
expect(h.handler).toHaveBeenCalledTimes(1);
397-
expect(h.handler.mock.calls[0][0]).toEqual({
398-
path: '/contacts', query: { since: '2026-01-01', stale: 'x' }, extra: 'kept',
399-
});
395+
const err = await refusal(h);
396+
expectRefused(err, { code: 'VALIDATION_ERROR', status: 400, reason: 'input_schema_mismatch' });
397+
expect(err.message).toContain("'query.stale' is not an input the action declares");
398+
expect(err.message).toContain("'extra' is not an input the action declares");
399+
expect(h.handler).toHaveBeenCalledTimes(0);
400+
expect(h.writes).toEqual([]);
400401
});
401402

402403
it('a valid input still pulls and writes', async () => {

0 commit comments

Comments
 (0)