Skip to content

Commit d3e0f31

Browse files
committed
test: the two query doors and the REST gate table refuse an undeclared aggregation-entry key
Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FEkQ5m158G1nvmxNYr7Jwq
1 parent edb20d0 commit d3e0f31

2 files changed

Lines changed: 7 additions & 0 deletions

File tree

‎packages/rest/src/request-schema-gate.conformance.test.ts‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,10 @@ const CASES: GateCase[] = [
117117
// fallback and an ordinary sum on every SQL datasource — one query, two
118118
// numbers, both plausible.
119119
{ aggregations: [{ function: 'sum', field: 'amount', alias: 'total', distinct: true }] },
120+
// #28609 — an undeclared aggregation-entry key. The node was a plain
121+
// object, so `bogusKey` was stripped and the query answered; it is
122+
// closed at the producer now, as the MCP tool's entry already was.
123+
{ aggregations: [{ function: 'count', alias: 'n', bogusKey: true }] },
120124
// #23574 — `null` was read as no query (`req.body ?? {}`) and answered
121125
// the full record set; `query` declares a QueryAST or nothing.
122126
null,

‎packages/runtime/src/domains/data-write-request-gate.test.ts‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -417,6 +417,9 @@ describe('[#23491] the two POST doors answer each non-record body alike', () =>
417417
const QUERY_REFUSED: ReadonlyArray<readonly [string, unknown, string]> = [
418418
['a mistyped clause, `limit: "ten"`', { limit: 'ten' }, 'query.limit'],
419419
['the retired `joins`', { joins: [] }, 'query.joins'],
420+
// [#28609] An aggregation entry is closed at the producer
421+
// (`AggregationNodeSchema`): both doors stripped `bogusKey` and answered.
422+
['an aggregation entry\'s undeclared key', { aggregations: [{ function: 'count', alias: 'n', bogusKey: true }] }, 'query.aggregations.0'],
420423
['a string', 'garbage', 'query'],
421424
['an array', [{}], 'query'],
422425
['a number', 42, 'query'],

0 commit comments

Comments
 (0)