@memberjunction/server 5.36.0 → 5.37.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/agents/skip-agent.d.ts.map +1 -1
- package/dist/agents/skip-agent.js +14 -2
- package/dist/agents/skip-agent.js.map +1 -1
- package/dist/agents/skip-sdk.d.ts +10 -0
- package/dist/agents/skip-sdk.d.ts.map +1 -1
- package/dist/agents/skip-sdk.js +139 -1
- package/dist/agents/skip-sdk.js.map +1 -1
- package/dist/resolvers/AdhocQueryResolver.d.ts.map +1 -1
- package/dist/resolvers/AdhocQueryResolver.js +42 -28
- package/dist/resolvers/AdhocQueryResolver.js.map +1 -1
- package/package.json +70 -70
- package/src/__tests__/AdhocQueryResolver.bugs.test.ts +269 -0
- package/src/agents/skip-agent.ts +15 -2
- package/src/agents/skip-sdk.ts +148 -1
- package/src/resolvers/AdhocQueryResolver.ts +42 -28
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AdhocQueryResolver.js","sourceRoot":"","sources":["../../src/resolvers/AdhocQueryResolver.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,OAAO,EAAE,GAAG,EAAE,GAAG,EAAE,KAAK,EAAE,QAAQ,EAAE,KAAK,EAAE,GAAG,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAChF,OAAO,
|
|
1
|
+
{"version":3,"file":"AdhocQueryResolver.js","sourceRoot":"","sources":["../../src/resolvers/AdhocQueryResolver.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,OAAO,EAAE,GAAG,EAAE,GAAG,EAAE,KAAK,EAAE,QAAQ,EAAE,KAAK,EAAE,GAAG,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAChF,OAAO,EAAoB,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAClE,OAAO,EAAE,sBAAsB,EAAE,MAAM,wBAAwB,CAAC;AAChE,OAAO,EAAE,cAAc,EAAE,MAAM,2CAA2C,CAAC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cAAc;gBACzB,OAAO,EAAE,KAAK;gBACd,OAAO,EAAE,IAAI;gBACb,QAAQ,EAAE,CAAC;gBACX,aAAa,EAAE,CAAC;gBAChB,UAAU,EAAE,SAAS;gBACrB,QAAQ,EAAE,SAAS;gBACnB,aAAa,EAAE,eAAe;gBAC9B,YAAY,EAAE,2BAA2B,YAAY,EAAE;aAC1D,CAAC;QACN,CAAC;IACL,CAAC;IAEO,gBAAgB,CAAC,YAAoB;QACzC,OAAO;YACH,OAAO,EAAE,EAAE;YACX,SAAS,EAAE,cAAc;YACzB,OAAO,EAAE,KAAK;YACd,OAAO,EAAE,IAAI;YACb,QAAQ,EAAE,CAAC;YACX,aAAa,EAAE,CAAC;YAChB,UAAU,EAAE,SAAS;YACrB,QAAQ,EAAE,SAAS;YACnB,aAAa,EAAE,CAAC;YAChB,YAAY,EAAE,YAAY;SAC7B,CAAC;IACN,CAAC;CACJ,CAAA;AAzIS;IADL,KAAK,CAAC,GAAG,EAAE,CAAC,kBAAkB,CAAC;IAE3B,WAAA,GAAG,CAAC,OAAO,EAAE,GAAG,EAAE,CAAC,eAAe,CAAC,CAAA;IACnC,WAAA,GAAG,EAAE,CAAA;;qCADsC,eAAe;;2DAwH9D;AA3HQ,kBAAkB;IAD9B,QAAQ,EAAE;GACE,kBAAkB,CA2I9B"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@memberjunction/server",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.37.0",
|
|
4
4
|
"description": "MemberJunction: This project provides API access via GraphQL to the common data store.",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"types": "./src/index.ts",
|
|
@@ -27,75 +27,75 @@
|
|
|
27
27
|
"@as-integrations/express5": "^1.0.0",
|
|
28
28
|
"@graphql-tools/schema": "latest",
|
|
29
29
|
"@graphql-tools/utils": "^11.0.0",
|
|
30
|
-
"@memberjunction/actions": "5.
|
|
31
|
-
"@memberjunction/actions-apollo": "5.
|
|
32
|
-
"@memberjunction/actions-base": "5.
|
|
33
|
-
"@memberjunction/actions-bizapps-accounting": "5.
|
|
34
|
-
"@memberjunction/actions-bizapps-crm": "5.
|
|
35
|
-
"@memberjunction/actions-bizapps-formbuilders": "5.
|
|
36
|
-
"@memberjunction/actions-bizapps-lms": "5.
|
|
37
|
-
"@memberjunction/actions-bizapps-social": "5.
|
|
38
|
-
"@memberjunction/ai": "5.
|
|
39
|
-
"@memberjunction/ai-agent-manager": "5.
|
|
40
|
-
"@memberjunction/ai-agent-manager-actions": "5.
|
|
41
|
-
"@memberjunction/ai-agents": "5.
|
|
42
|
-
"@memberjunction/ai-core-plus": "5.
|
|
43
|
-
"@memberjunction/ai-mcp-client": "5.
|
|
44
|
-
"@memberjunction/ai-prompts": "5.
|
|
45
|
-
"@memberjunction/ai-provider-bundle": "5.
|
|
46
|
-
"@memberjunction/ai-vector-sync": "5.
|
|
47
|
-
"@memberjunction/ai-vectordb": "5.
|
|
48
|
-
"@memberjunction/ai-vectors-pinecone": "5.
|
|
49
|
-
"@memberjunction/aiengine": "5.
|
|
50
|
-
"@memberjunction/api-keys": "5.
|
|
51
|
-
"@memberjunction/auth-providers": "5.
|
|
52
|
-
"@memberjunction/codegen-lib": "5.
|
|
53
|
-
"@memberjunction/communication-ms-graph": "5.
|
|
54
|
-
"@memberjunction/communication-sendgrid": "5.
|
|
55
|
-
"@memberjunction/communication-types": "5.
|
|
56
|
-
"@memberjunction/component-registry-client-sdk": "5.
|
|
57
|
-
"@memberjunction/computer-use-engine": "5.
|
|
58
|
-
"@memberjunction/config": "5.
|
|
59
|
-
"@memberjunction/core": "5.
|
|
60
|
-
"@memberjunction/core-actions": "5.
|
|
61
|
-
"@memberjunction/core-entities": "5.
|
|
62
|
-
"@memberjunction/core-entities-server": "5.
|
|
63
|
-
"@memberjunction/data-context": "5.
|
|
64
|
-
"@memberjunction/data-context-server": "5.
|
|
65
|
-
"@memberjunction/doc-utils": "5.
|
|
66
|
-
"@memberjunction/encryption": "5.
|
|
67
|
-
"@memberjunction/entity-communications-base": "5.
|
|
68
|
-
"@memberjunction/entity-communications-server": "5.
|
|
69
|
-
"@memberjunction/external-change-detection": "5.
|
|
70
|
-
"@memberjunction/generic-database-provider": "5.
|
|
71
|
-
"@memberjunction/global": "5.
|
|
72
|
-
"@memberjunction/graphql-dataprovider": "5.
|
|
73
|
-
"@memberjunction/integration-engine": "5.
|
|
74
|
-
"@memberjunction/integration-schema-builder": "5.
|
|
75
|
-
"@memberjunction/interactive-component-types": "5.
|
|
76
|
-
"@memberjunction/lists": "5.
|
|
77
|
-
"@memberjunction/lists-base": "5.
|
|
78
|
-
"@memberjunction/notifications": "5.
|
|
79
|
-
"@memberjunction/postgresql-dataprovider": "5.
|
|
80
|
-
"@memberjunction/queue": "5.
|
|
81
|
-
"@memberjunction/redis-provider": "5.
|
|
82
|
-
"@memberjunction/scheduling-actions": "5.
|
|
83
|
-
"@memberjunction/scheduling-base-types": "5.
|
|
84
|
-
"@memberjunction/scheduling-engine": "5.
|
|
85
|
-
"@memberjunction/scheduling-engine-base": "5.
|
|
86
|
-
"@memberjunction/schema-engine": "5.
|
|
87
|
-
"@memberjunction/search-engine": "5.
|
|
88
|
-
"@memberjunction/server-extensions-core": "5.
|
|
89
|
-
"@memberjunction/skip-types": "5.
|
|
90
|
-
"@memberjunction/sql-dialect": "5.
|
|
91
|
-
"@memberjunction/sqlserver-dataprovider": "5.
|
|
92
|
-
"@memberjunction/storage": "5.
|
|
93
|
-
"@memberjunction/tag-engine": "5.
|
|
94
|
-
"@memberjunction/tag-engine-base": "5.
|
|
95
|
-
"@memberjunction/templates": "5.
|
|
96
|
-
"@memberjunction/testing-engine": "5.
|
|
97
|
-
"@memberjunction/testing-engine-base": "5.
|
|
98
|
-
"@memberjunction/version-history": "5.
|
|
30
|
+
"@memberjunction/actions": "5.37.0",
|
|
31
|
+
"@memberjunction/actions-apollo": "5.37.0",
|
|
32
|
+
"@memberjunction/actions-base": "5.37.0",
|
|
33
|
+
"@memberjunction/actions-bizapps-accounting": "5.37.0",
|
|
34
|
+
"@memberjunction/actions-bizapps-crm": "5.37.0",
|
|
35
|
+
"@memberjunction/actions-bizapps-formbuilders": "5.37.0",
|
|
36
|
+
"@memberjunction/actions-bizapps-lms": "5.37.0",
|
|
37
|
+
"@memberjunction/actions-bizapps-social": "5.37.0",
|
|
38
|
+
"@memberjunction/ai": "5.37.0",
|
|
39
|
+
"@memberjunction/ai-agent-manager": "5.37.0",
|
|
40
|
+
"@memberjunction/ai-agent-manager-actions": "5.37.0",
|
|
41
|
+
"@memberjunction/ai-agents": "5.37.0",
|
|
42
|
+
"@memberjunction/ai-core-plus": "5.37.0",
|
|
43
|
+
"@memberjunction/ai-mcp-client": "5.37.0",
|
|
44
|
+
"@memberjunction/ai-prompts": "5.37.0",
|
|
45
|
+
"@memberjunction/ai-provider-bundle": "5.37.0",
|
|
46
|
+
"@memberjunction/ai-vector-sync": "5.37.0",
|
|
47
|
+
"@memberjunction/ai-vectordb": "5.37.0",
|
|
48
|
+
"@memberjunction/ai-vectors-pinecone": "5.37.0",
|
|
49
|
+
"@memberjunction/aiengine": "5.37.0",
|
|
50
|
+
"@memberjunction/api-keys": "5.37.0",
|
|
51
|
+
"@memberjunction/auth-providers": "5.37.0",
|
|
52
|
+
"@memberjunction/codegen-lib": "5.37.0",
|
|
53
|
+
"@memberjunction/communication-ms-graph": "5.37.0",
|
|
54
|
+
"@memberjunction/communication-sendgrid": "5.37.0",
|
|
55
|
+
"@memberjunction/communication-types": "5.37.0",
|
|
56
|
+
"@memberjunction/component-registry-client-sdk": "5.37.0",
|
|
57
|
+
"@memberjunction/computer-use-engine": "5.37.0",
|
|
58
|
+
"@memberjunction/config": "5.37.0",
|
|
59
|
+
"@memberjunction/core": "5.37.0",
|
|
60
|
+
"@memberjunction/core-actions": "5.37.0",
|
|
61
|
+
"@memberjunction/core-entities": "5.37.0",
|
|
62
|
+
"@memberjunction/core-entities-server": "5.37.0",
|
|
63
|
+
"@memberjunction/data-context": "5.37.0",
|
|
64
|
+
"@memberjunction/data-context-server": "5.37.0",
|
|
65
|
+
"@memberjunction/doc-utils": "5.37.0",
|
|
66
|
+
"@memberjunction/encryption": "5.37.0",
|
|
67
|
+
"@memberjunction/entity-communications-base": "5.37.0",
|
|
68
|
+
"@memberjunction/entity-communications-server": "5.37.0",
|
|
69
|
+
"@memberjunction/external-change-detection": "5.37.0",
|
|
70
|
+
"@memberjunction/generic-database-provider": "5.37.0",
|
|
71
|
+
"@memberjunction/global": "5.37.0",
|
|
72
|
+
"@memberjunction/graphql-dataprovider": "5.37.0",
|
|
73
|
+
"@memberjunction/integration-engine": "5.37.0",
|
|
74
|
+
"@memberjunction/integration-schema-builder": "5.37.0",
|
|
75
|
+
"@memberjunction/interactive-component-types": "5.37.0",
|
|
76
|
+
"@memberjunction/lists": "5.37.0",
|
|
77
|
+
"@memberjunction/lists-base": "5.37.0",
|
|
78
|
+
"@memberjunction/notifications": "5.37.0",
|
|
79
|
+
"@memberjunction/postgresql-dataprovider": "5.37.0",
|
|
80
|
+
"@memberjunction/queue": "5.37.0",
|
|
81
|
+
"@memberjunction/redis-provider": "5.37.0",
|
|
82
|
+
"@memberjunction/scheduling-actions": "5.37.0",
|
|
83
|
+
"@memberjunction/scheduling-base-types": "5.37.0",
|
|
84
|
+
"@memberjunction/scheduling-engine": "5.37.0",
|
|
85
|
+
"@memberjunction/scheduling-engine-base": "5.37.0",
|
|
86
|
+
"@memberjunction/schema-engine": "5.37.0",
|
|
87
|
+
"@memberjunction/search-engine": "5.37.0",
|
|
88
|
+
"@memberjunction/server-extensions-core": "5.37.0",
|
|
89
|
+
"@memberjunction/skip-types": "5.37.0",
|
|
90
|
+
"@memberjunction/sql-dialect": "5.37.0",
|
|
91
|
+
"@memberjunction/sqlserver-dataprovider": "5.37.0",
|
|
92
|
+
"@memberjunction/storage": "5.37.0",
|
|
93
|
+
"@memberjunction/tag-engine": "5.37.0",
|
|
94
|
+
"@memberjunction/tag-engine-base": "5.37.0",
|
|
95
|
+
"@memberjunction/templates": "5.37.0",
|
|
96
|
+
"@memberjunction/testing-engine": "5.37.0",
|
|
97
|
+
"@memberjunction/testing-engine-base": "5.37.0",
|
|
98
|
+
"@memberjunction/version-history": "5.37.0",
|
|
99
99
|
"@types/compression": "^1.8.1",
|
|
100
100
|
"@types/cors": "^2.8.19",
|
|
101
101
|
"@types/jsonwebtoken": "9.0.10",
|
|
@@ -0,0 +1,269 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Failing-test suite for known AdhocQueryResolver bugs.
|
|
3
|
+
*
|
|
4
|
+
* Two bugs are encoded here, both observed in production
|
|
5
|
+
* (Skip → ExecuteAdhocQuery → SQL Server rejection):
|
|
6
|
+
*
|
|
7
|
+
* Bug #2 — `{{query:"..."}}` composition macros pass through to SQL
|
|
8
|
+
* Server as literal text because AdhocQueryResolver never
|
|
9
|
+
* calls into the QueryCompositionEngine / RenderPipeline.
|
|
10
|
+
*
|
|
11
|
+
* Bug #3 — `SELECT … GROUP BY … ORDER BY …` (no top-level TOP) gets
|
|
12
|
+
* wrapped as `SELECT TOP N * FROM (<inner>) AS _adhoc_capped`.
|
|
13
|
+
* SQL Server rejects: "The ORDER BY clause is invalid in
|
|
14
|
+
* views, inline functions, derived tables, subqueries, and
|
|
15
|
+
* CTEs, unless TOP, OFFSET or FOR XML is also specified."
|
|
16
|
+
*
|
|
17
|
+
* Instantiating the resolver and running it through MSSQL requires a
|
|
18
|
+
* very heavy mock graph (type-graphql decorators, `mssql`, AppContext,
|
|
19
|
+
* config, auth, providers). To keep these tests fast and deterministic,
|
|
20
|
+
* we use a hybrid strategy:
|
|
21
|
+
*
|
|
22
|
+
* 1. **Source-shape contract tests** — read the resolver source file
|
|
23
|
+
* and assert structural properties that *must* be true after the
|
|
24
|
+
* fix (e.g., RenderPipeline is imported and called; the manual
|
|
25
|
+
* `SELECT TOP N * FROM (...)` wrap is gone).
|
|
26
|
+
*
|
|
27
|
+
* 2. **Pipeline behavior tests** — exercise RenderPipeline.Run with
|
|
28
|
+
* the exact Skip inputs that hit this resolver, asserting on the
|
|
29
|
+
* shape of the output. Once the resolver routes through the
|
|
30
|
+
* pipeline (the fix), these tests become end-to-end coverage.
|
|
31
|
+
*
|
|
32
|
+
* **All tests are expected to FAIL against the current implementation.**
|
|
33
|
+
*/
|
|
34
|
+
import { describe, it, expect, vi, afterEach } from 'vitest';
|
|
35
|
+
import { readFileSync } from 'fs';
|
|
36
|
+
import { resolve } from 'path';
|
|
37
|
+
import { Metadata } from '@memberjunction/core';
|
|
38
|
+
import { RenderPipeline } from '@memberjunction/generic-database-provider';
|
|
39
|
+
|
|
40
|
+
const ADHOC_RESOLVER_PATH = resolve(__dirname, '../resolvers/AdhocQueryResolver.ts');
|
|
41
|
+
|
|
42
|
+
function readResolverSource(): string {
|
|
43
|
+
return readFileSync(ADHOC_RESOLVER_PATH, 'utf8');
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
afterEach(() => {
|
|
47
|
+
vi.restoreAllMocks();
|
|
48
|
+
});
|
|
49
|
+
|
|
50
|
+
function stubMetadata(): void {
|
|
51
|
+
vi.spyOn(Metadata, 'Provider', 'get').mockReturnValue({
|
|
52
|
+
Queries: [],
|
|
53
|
+
QueryDependencies: [],
|
|
54
|
+
} as ReturnType<typeof Metadata.Provider>);
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
// ════════════════════════════════════════════════════════════════════
|
|
58
|
+
// Source-shape contract tests
|
|
59
|
+
// ════════════════════════════════════════════════════════════════════
|
|
60
|
+
|
|
61
|
+
describe('AdhocQueryResolver source-shape contract', () => {
|
|
62
|
+
|
|
63
|
+
it('Bug #2: AdhocQueryResolver must import RenderPipeline (currently does not)', () => {
|
|
64
|
+
const src = readResolverSource();
|
|
65
|
+
// After the fix, the resolver should delegate composition + Nunjucks +
|
|
66
|
+
// MaxRows handling to the canonical pipeline rather than re-implementing
|
|
67
|
+
// a partial subset.
|
|
68
|
+
const importsRenderPipeline =
|
|
69
|
+
/import\s*\{[^}]*\bRenderPipeline\b[^}]*\}\s*from\s*['"]@memberjunction\/generic-database-provider['"]/.test(src);
|
|
70
|
+
expect(importsRenderPipeline).toBe(true);
|
|
71
|
+
});
|
|
72
|
+
|
|
73
|
+
it('Bug #2: AdhocQueryResolver must call RenderPipeline.Run() somewhere (currently does not)', () => {
|
|
74
|
+
const src = readResolverSource();
|
|
75
|
+
const callsRenderPipelineRun = /\bRenderPipeline\.Run\s*\(/.test(src);
|
|
76
|
+
expect(callsRenderPipelineRun).toBe(true);
|
|
77
|
+
});
|
|
78
|
+
|
|
79
|
+
it('Bug #3: AdhocQueryResolver must NOT contain the manual `SELECT TOP N * FROM (...)` wrap', () => {
|
|
80
|
+
const src = readResolverSource();
|
|
81
|
+
// The current implementation builds executable SQL with:
|
|
82
|
+
// `SELECT TOP ${startRow + maxRows} * FROM (\n${input.SQL}\n) AS _adhoc_capped`
|
|
83
|
+
// After the fix, MaxRows handling should be routed through the pipeline,
|
|
84
|
+
// not implemented inline with a derived-table wrap.
|
|
85
|
+
const containsManualWrap = /SELECT\s+TOP\s+\$\{[^}]+\}\s+\*\s+FROM\s*\(/.test(src);
|
|
86
|
+
expect(containsManualWrap).toBe(false);
|
|
87
|
+
});
|
|
88
|
+
|
|
89
|
+
it('Bug #3: AdhocQueryResolver must NOT rely on a `^\\s*WITH\\b` guard to skip the wrap', () => {
|
|
90
|
+
const src = readResolverSource();
|
|
91
|
+
// The presence of this regex guard is a tell that there's still a
|
|
92
|
+
// manual wrap; after the fix, no special-casing of `WITH` is needed
|
|
93
|
+
// because the pipeline handles it generically.
|
|
94
|
+
const hasWithGuard = /\/\^\\s\*WITH\\b\/i\.test\(/.test(src);
|
|
95
|
+
expect(hasWithGuard).toBe(false);
|
|
96
|
+
});
|
|
97
|
+
});
|
|
98
|
+
|
|
99
|
+
// ════════════════════════════════════════════════════════════════════
|
|
100
|
+
// Bug #2 — composition macros must be resolved before execution
|
|
101
|
+
// ════════════════════════════════════════════════════════════════════
|
|
102
|
+
|
|
103
|
+
describe('Bug #2: composition macros in ad-hoc SQL', () => {
|
|
104
|
+
|
|
105
|
+
it('RenderPipeline must strip {{query:"..."}} when ContextUser is provided', () => {
|
|
106
|
+
// The pipeline already supports this. The bug is that AdhocQueryResolver
|
|
107
|
+
// doesn't call into it. This test pins the pipeline contract that the
|
|
108
|
+
// resolver fix will rely on.
|
|
109
|
+
stubMetadata();
|
|
110
|
+
const sql = `SELECT YEAR(base.CreatedAt) AS JoinYear, COUNT(*) AS MemberCount
|
|
111
|
+
FROM {{query:"Demos/Active Users"}} base
|
|
112
|
+
GROUP BY YEAR(base.CreatedAt)
|
|
113
|
+
ORDER BY JoinYear DESC`;
|
|
114
|
+
|
|
115
|
+
// Whether or not a real query metadata entry exists, the pipeline
|
|
116
|
+
// should at least detect the composition tokens and report them.
|
|
117
|
+
// We do not require the pipeline to *succeed* without a real dep —
|
|
118
|
+
// we require the resolver to AT LEAST attempt resolution rather than
|
|
119
|
+
// shipping `{{query:` verbatim to SQL Server.
|
|
120
|
+
const hasTokens = RenderPipeline.HasCompositionTokens(sql);
|
|
121
|
+
expect(hasTokens).toBe(true);
|
|
122
|
+
});
|
|
123
|
+
|
|
124
|
+
it('the literal text "{{query:" must not appear in the resolver-executed SQL', () => {
|
|
125
|
+
// This is the end-to-end invariant. After the fix, regardless of
|
|
126
|
+
// success/failure, the resolver should never hand a string containing
|
|
127
|
+
// "{{query:" to SQL Server.
|
|
128
|
+
//
|
|
129
|
+
// We encode this as a contract on the resolver source: it must call
|
|
130
|
+
// into RenderPipeline whenever composition tokens are present, OR
|
|
131
|
+
// reject early with a clear error. Either way, the literal text
|
|
132
|
+
// "{{query:" must not reach `request.query(...)`.
|
|
133
|
+
const src = readResolverSource();
|
|
134
|
+
|
|
135
|
+
// Acceptable post-fix shape: source mentions RenderPipeline.Run and
|
|
136
|
+
// passes input.SQL through it. We've already asserted the import +
|
|
137
|
+
// call above; here we additionally require that input.SQL flows
|
|
138
|
+
// through RenderPipeline.Run rather than directly to request.query.
|
|
139
|
+
//
|
|
140
|
+
// The current code contains `request.query(executableSql)` where
|
|
141
|
+
// `executableSql` is derived from input.SQL via a string concat —
|
|
142
|
+
// bypassing the pipeline entirely.
|
|
143
|
+
const directlyExecutesInputSQL = /request\.query\s*\(\s*input\.SQL\s*\)/.test(src);
|
|
144
|
+
expect(directlyExecutesInputSQL).toBe(false);
|
|
145
|
+
|
|
146
|
+
// And — the executable string must be derived from a pipeline result,
|
|
147
|
+
// not from an inline template literal that just concatenates input.SQL.
|
|
148
|
+
// Heuristic: the file should reference `FinalSQL` (the pipeline's
|
|
149
|
+
// output field) somewhere — this is what gets sent to the DB.
|
|
150
|
+
const referencesFinalSQL = /\bFinalSQL\b/.test(src);
|
|
151
|
+
expect(referencesFinalSQL).toBe(true);
|
|
152
|
+
});
|
|
153
|
+
});
|
|
154
|
+
|
|
155
|
+
// ════════════════════════════════════════════════════════════════════
|
|
156
|
+
// Bug #3 — GROUP BY + ORDER BY (no top-level TOP) must not be wrapped
|
|
157
|
+
// into an ORDER-BY-bearing derived table without TOP/OFFSET
|
|
158
|
+
// ════════════════════════════════════════════════════════════════════
|
|
159
|
+
|
|
160
|
+
describe('Bug #3: GROUP BY + ORDER BY (no top-level TOP) under MaxRows', () => {
|
|
161
|
+
|
|
162
|
+
/**
|
|
163
|
+
* Helper: returns true if `sql` contains the canonical AdhocQuery wrap
|
|
164
|
+
* with an inner ORDER BY that has no inner TOP/OFFSET — SQL Server
|
|
165
|
+
* rejects this shape.
|
|
166
|
+
*/
|
|
167
|
+
function hasBrokenAdhocOrderByWrap(sql: string): boolean {
|
|
168
|
+
// Outer wrap form used by AdhocQueryResolver: `... AS _adhoc_capped`
|
|
169
|
+
const m = sql.match(/SELECT\s+TOP\s+\d+\s+\*\s+FROM\s*\(([\s\S]*?)\)\s*AS\s+_adhoc_capped/i);
|
|
170
|
+
if (!m) return false;
|
|
171
|
+
const inner = m[1];
|
|
172
|
+
if (!/ORDER\s+BY\b/i.test(inner)) return false;
|
|
173
|
+
if (/\bTOP\s+\d+\b/i.test(inner)) return false;
|
|
174
|
+
if (/\bOFFSET\s+\d+\s+ROWS?\b/i.test(inner)) return false;
|
|
175
|
+
if (/\bFOR\s+XML\b/i.test(inner)) return false;
|
|
176
|
+
return true;
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
it('RenderPipeline output for the Skip GROUP-BY+ORDER-BY shape must not be the broken adhoc wrap', () => {
|
|
180
|
+
// After the resolver-fix, this exact SQL flows through RenderPipeline.Run.
|
|
181
|
+
// So we test the pipeline output for the post-fix shape.
|
|
182
|
+
stubMetadata();
|
|
183
|
+
const sql = `SELECT YEAR(p.JoinDate) AS JoinYear, COUNT(p.ID) AS PersonCount
|
|
184
|
+
FROM dbo.vwPeople p
|
|
185
|
+
WHERE p.JoinDate IS NOT NULL
|
|
186
|
+
GROUP BY YEAR(p.JoinDate)
|
|
187
|
+
ORDER BY JoinYear DESC`;
|
|
188
|
+
|
|
189
|
+
const result = RenderPipeline.Run(sql, {
|
|
190
|
+
Platform: 'sqlserver',
|
|
191
|
+
MaxRows: 100,
|
|
192
|
+
});
|
|
193
|
+
|
|
194
|
+
expect(hasBrokenAdhocOrderByWrap(result.FinalSQL)).toBe(false);
|
|
195
|
+
|
|
196
|
+
// Acceptable post-fix shapes:
|
|
197
|
+
// - `SELECT TOP 100 ... ORDER BY JoinYear DESC` (TOP at outer scope, same as ORDER BY)
|
|
198
|
+
// - ORDER BY ... OFFSET 0 ROWS FETCH NEXT 100 ROWS ONLY
|
|
199
|
+
// The AST-sqlify round-trip wraps identifiers in [] on SQL Server,
|
|
200
|
+
// so the ORDER BY column may be emitted as `JoinYear` or `[JoinYear]`.
|
|
201
|
+
const outerTopOrderBy =
|
|
202
|
+
/SELECT\s+TOP\s+100\b[\s\S]+ORDER\s+BY\s+\[?JoinYear\]?\s+DESC/i.test(result.FinalSQL);
|
|
203
|
+
const offsetFetch =
|
|
204
|
+
/ORDER\s+BY\s+\[?JoinYear\]?\s+DESC[\s\S]+OFFSET\s+0\s+ROWS\s+FETCH\s+NEXT\s+100\s+ROWS\s+ONLY/i.test(result.FinalSQL);
|
|
205
|
+
expect(outerTopOrderBy || offsetFetch).toBe(true);
|
|
206
|
+
});
|
|
207
|
+
|
|
208
|
+
it('GROUP BY + ORDER BY without TOP under Paging should already work (parity baseline)', () => {
|
|
209
|
+
// Paging path already handles this correctly via OFFSET/FETCH —
|
|
210
|
+
// this test is a baseline showing what "correct" looks like.
|
|
211
|
+
stubMetadata();
|
|
212
|
+
const sql = `SELECT YEAR(p.JoinDate) AS JoinYear, COUNT(p.ID) AS PersonCount
|
|
213
|
+
FROM dbo.vwPeople p
|
|
214
|
+
WHERE p.JoinDate IS NOT NULL
|
|
215
|
+
GROUP BY YEAR(p.JoinDate)
|
|
216
|
+
ORDER BY JoinYear DESC`;
|
|
217
|
+
|
|
218
|
+
const result = RenderPipeline.Run(sql, {
|
|
219
|
+
Platform: 'sqlserver',
|
|
220
|
+
Paging: { StartRow: 0, MaxRows: 100 },
|
|
221
|
+
});
|
|
222
|
+
|
|
223
|
+
expect(result.FinalSQL).toMatch(/ORDER\s+BY\s+JoinYear\s+DESC[\s\S]+OFFSET\s+0\s+ROWS\s+FETCH\s+NEXT\s+100\s+ROWS\s+ONLY/i);
|
|
224
|
+
});
|
|
225
|
+
});
|
|
226
|
+
|
|
227
|
+
// ════════════════════════════════════════════════════════════════════
|
|
228
|
+
// Bug #3b — CTE-headed SQL via AdhocQuery is currently silently bypassed
|
|
229
|
+
// ════════════════════════════════════════════════════════════════════
|
|
230
|
+
|
|
231
|
+
describe('Bug #3b: CTE-headed SQL via AdhocQuery currently has no row cap at all', () => {
|
|
232
|
+
|
|
233
|
+
it('AdhocQueryResolver source: the `^\\s*WITH\\b` guard silently skips the row cap, which is also a bug', () => {
|
|
234
|
+
// The current resolver's `canWrap` predicate excludes CTE-headed SQL
|
|
235
|
+
// from the wrap by detecting `^\s*WITH\b` and falling back to "no
|
|
236
|
+
// wrap, slice in memory after the full result returns". This means a
|
|
237
|
+
// user requesting `MaxRows: 100` against a CTE that returns 10M rows
|
|
238
|
+
// gets a 10M-row scan from SQL Server and then a 100-row slice in
|
|
239
|
+
// JavaScript — a hidden performance bug and a memory hazard.
|
|
240
|
+
//
|
|
241
|
+
// After the fix, MaxRows for CTEs must be enforced AT THE DATABASE
|
|
242
|
+
// (via OFFSET/FETCH appended to the outer SELECT inside the WITH),
|
|
243
|
+
// not via post-execution slicing.
|
|
244
|
+
const src = readResolverSource();
|
|
245
|
+
const hasWithGuard = /\/\^\\s\*WITH\\b\/i\.test\(/.test(src);
|
|
246
|
+
expect(hasWithGuard).toBe(false);
|
|
247
|
+
});
|
|
248
|
+
|
|
249
|
+
it('a CTE with ORDER BY under MaxRows should get an OFFSET/FETCH at the outer SELECT (no in-memory slicing)', () => {
|
|
250
|
+
stubMetadata();
|
|
251
|
+
const sql = `WITH cte AS (
|
|
252
|
+
SELECT ID, Name FROM dbo.Users
|
|
253
|
+
)
|
|
254
|
+
SELECT * FROM cte ORDER BY Name`;
|
|
255
|
+
|
|
256
|
+
const result = RenderPipeline.Run(sql, {
|
|
257
|
+
Platform: 'sqlserver',
|
|
258
|
+
MaxRows: 100,
|
|
259
|
+
});
|
|
260
|
+
|
|
261
|
+
// After the fix the row cap should be expressed in the SQL itself,
|
|
262
|
+
// so SQL Server can short-circuit. Either OFFSET/FETCH at the
|
|
263
|
+
// outer scope OR a TOP injected onto the outermost SELECT is
|
|
264
|
+
// acceptable.
|
|
265
|
+
const outerTop = /\)\s*SELECT\s+TOP\s+100\b/i.test(result.FinalSQL);
|
|
266
|
+
const offsetFetch = /OFFSET\s+0\s+ROWS\s+FETCH\s+NEXT\s+100\s+ROWS\s+ONLY/i.test(result.FinalSQL);
|
|
267
|
+
expect(outerTop || offsetFetch).toBe(true);
|
|
268
|
+
});
|
|
269
|
+
});
|
package/src/agents/skip-agent.ts
CHANGED
|
@@ -358,13 +358,25 @@ export class SkipProxyAgent extends BaseAgent {
|
|
|
358
358
|
const skipMessage = response.messages?.filter(msg => msg.role === 'system').pop();
|
|
359
359
|
const analysisText = response.analysis?.trim();
|
|
360
360
|
|
|
361
|
+
// Skip-Brain attaches actionableCommands as an extension field on the
|
|
362
|
+
// analysis_complete response (e.g. `client:capture-data-snapshot` when
|
|
363
|
+
// the Analysis Agent needs the user's current view). Forward to the
|
|
364
|
+
// next step so AgentRunner persists them to ConversationDetail.ActionableCommands
|
|
365
|
+
// — which the chat UI's actionable-commands.component reads to render buttons.
|
|
366
|
+
const responseExt = response as unknown as { actionableCommands?: unknown[] };
|
|
367
|
+
const actionableCommands = Array.isArray(responseExt.actionableCommands) && responseExt.actionableCommands.length > 0
|
|
368
|
+
? (responseExt.actionableCommands as BaseAgentNextStep<ComponentSpec>['actionableCommands'])
|
|
369
|
+
: undefined;
|
|
370
|
+
LogStatus(`[SkipProxyAgent DEBUG] handleAnalysisComplete actionableCommands from response: ${JSON.stringify(responseExt.actionableCommands)}`);
|
|
371
|
+
|
|
361
372
|
if (!hasComponentOptions) {
|
|
362
373
|
if (analysisText || skipMessage?.content) {
|
|
363
374
|
return {
|
|
364
375
|
terminate: true,
|
|
365
376
|
step: 'Success',
|
|
366
377
|
message: analysisText || skipMessage!.content,
|
|
367
|
-
newPayload: undefined
|
|
378
|
+
newPayload: undefined,
|
|
379
|
+
actionableCommands
|
|
368
380
|
};
|
|
369
381
|
}
|
|
370
382
|
|
|
@@ -387,7 +399,8 @@ export class SkipProxyAgent extends BaseAgent {
|
|
|
387
399
|
terminate: true,
|
|
388
400
|
step: 'Success',
|
|
389
401
|
message: skipMessage?.content || response.title || 'Analysis complete',
|
|
390
|
-
newPayload: componentSpec
|
|
402
|
+
newPayload: componentSpec,
|
|
403
|
+
actionableCommands
|
|
391
404
|
};
|
|
392
405
|
}
|
|
393
406
|
|