@hypequery/protocol-conformance 0.14.0 → 0.15.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.
@@ -1 +1 @@
1
- {"version":3,"file":"generators.d.ts","sourceRoot":"","sources":["../../src/adapters/generators.ts"],"names":[],"mappings":"AAIA,KAAK,IAAI,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;AAkBpC,wBAAgB,sBAAsB,CAAC,IAAI,EAAE,IAAI,GAAG,OAAO,CAuC1D;AAID,wBAAgB,qBAAqB,CAAC,IAAI,EAAE,IAAI,GAAG,MAAM,CAMxD;AAMD,wBAAgB,qBAAqB,CAAC,IAAI,EAAE,IAAI,GAAG,OAAO,CA0CzD;AAID,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,IAAI,GAAG,OAAO,CA2BrD;AAgBD,wBAAgB,yBAAyB,CAAC,IAAI,EAAE,IAAI,GAAG,OAAO,CAuB7D;AA4CD,wBAAgB,6BAA6B,CAAC,IAAI,EAAE,IAAI,GAAG,OAAO,CAsFjE;AAkBD,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,IAAI,GAAG,OAAO,CAyBpD;AAeD,wBAAgB,sBAAsB,CAAC,IAAI,EAAE,IAAI,GAAG,OAAO,CAoB1D;AAmBD,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,IAAI,GAAG,OAAO,CAmBrD;AAaD,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,IAAI,GAAG,OAAO,CAgBtD"}
1
+ {"version":3,"file":"generators.d.ts","sourceRoot":"","sources":["../../src/adapters/generators.ts"],"names":[],"mappings":"AAIA,KAAK,IAAI,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;AAkBpC,wBAAgB,sBAAsB,CAAC,IAAI,EAAE,IAAI,GAAG,OAAO,CAuC1D;AAID,wBAAgB,qBAAqB,CAAC,IAAI,EAAE,IAAI,GAAG,MAAM,CAMxD;AAMD,wBAAgB,qBAAqB,CAAC,IAAI,EAAE,IAAI,GAAG,OAAO,CA0CzD;AAID,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,IAAI,GAAG,OAAO,CA2BrD;AAgBD,wBAAgB,yBAAyB,CAAC,IAAI,EAAE,IAAI,GAAG,OAAO,CAuB7D;AA4CD,wBAAgB,6BAA6B,CAAC,IAAI,EAAE,IAAI,GAAG,OAAO,CAsFjE;AAkBD,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,IAAI,GAAG,OAAO,CAiCpD;AAeD,wBAAgB,sBAAsB,CAAC,IAAI,EAAE,IAAI,GAAG,OAAO,CAyB1D;AAmBD,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,IAAI,GAAG,OAAO,CAmBrD;AAaD,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,IAAI,GAAG,OAAO,CAgBtD"}
@@ -331,6 +331,14 @@ export function materializeEvent(spec) {
331
331
  case 'invalid-target': return { ...value, target: { project: 'has space', environment: 'production' } };
332
332
  case 'invalid-query-name': return { ...value, queryName: 'not an identifier' };
333
333
  case 'oversized-correlation-id': return { ...value, correlationId: repeat('x', 2_049) };
334
+ case 'newer-version-with-new-field': return { ...value, version: 2, sampleRate: 0.5 };
335
+ case 'wrong-kind-with-unknown-field': return { ...value, kind: 'hypequery-query-log', sql: 'SELECT 1' };
336
+ case 'impossible-calendar-date': return { ...value, occurredAt: '2026-02-30T00:00:00Z' };
337
+ case 'hour-twenty-four': return { ...value, occurredAt: '2026-07-20T24:00:00Z' };
338
+ case 'one-digit-fraction': return { ...value, occurredAt: '2026-07-20T12:34:56.5Z' };
339
+ case 'fractional-duration': return { ...value, durationMs: 1.5 };
340
+ case 'correlation-id-one-byte-over': return { ...value, correlationId: `${repeat('\u00e9', 512)}x` };
341
+ case 'correlation-id-lone-surrogate': return { ...value, correlationId: 'req\ud800id' };
334
342
  case 'unsafe-accessor': {
335
343
  const unsafe = baseEvent();
336
344
  Object.defineProperty(unsafe, 'kind', { enumerable: true, get: () => 'hypequery-query-event' });
@@ -366,6 +374,11 @@ export function materializeDiagnostics(spec) {
366
374
  case 'zero-attempts': return { ...value, attempts: 0 };
367
375
  case 'control-character-message': return { ...value, safeMessage: 'bad\u0007message' };
368
376
  case 'oversized-debug-query': return { ...value, debugQuery: repeat('x', 4_097) };
377
+ case 'newer-version-with-new-field': return { ...value, version: 2, retryReason: 'transient' };
378
+ case 'too-many-attempts': return { ...value, attempts: 65 };
379
+ case 'prefixed-runtime-identity': return { ...value, runtimeIdentity: `sha256:${repeat('d', 64)}` };
380
+ case 'debug-query-lone-surrogate': return { ...value, debugQuery: 'SELECT \udc00' };
381
+ case 'debug-query-bell-character': return { ...value, debugQuery: 'SELECT\u00071' };
369
382
  case 'unsafe-accessor': {
370
383
  const unsafe = baseDiagnostics();
371
384
  Object.defineProperty(unsafe, 'kind', { enumerable: true, get: () => 'hypequery-query-diagnostics' });
@@ -9,5 +9,10 @@
9
9
  { "id": "zero-attempts", "generator": { "type": "zero-attempts" }, "error": "HQ_DIAGNOSTICS_INVALID_VALUE" },
10
10
  { "id": "control-character-message", "generator": { "type": "control-character-message" }, "error": "HQ_DIAGNOSTICS_INVALID_VALUE" },
11
11
  { "id": "oversized-debug-query", "generator": { "type": "oversized-debug-query" }, "error": "HQ_DIAGNOSTICS_TOO_LARGE" },
12
+ { "id": "newer-version-with-new-field", "generator": { "type": "newer-version-with-new-field" }, "error": "HQ_DIAGNOSTICS_INVALID_VERSION" },
13
+ { "id": "too-many-attempts", "generator": { "type": "too-many-attempts" }, "error": "HQ_DIAGNOSTICS_INVALID_VALUE" },
14
+ { "id": "prefixed-runtime-identity", "generator": { "type": "prefixed-runtime-identity" }, "error": "HQ_DIAGNOSTICS_INVALID_VALUE" },
15
+ { "id": "debug-query-lone-surrogate", "generator": { "type": "debug-query-lone-surrogate" }, "error": "HQ_DIAGNOSTICS_INVALID_VALUE" },
16
+ { "id": "debug-query-bell-character", "generator": { "type": "debug-query-bell-character" }, "error": "HQ_DIAGNOSTICS_INVALID_VALUE" },
12
17
  { "id": "unsafe-accessor", "generator": { "type": "unsafe-accessor" }, "error": "HQ_DIAGNOSTICS_UNSAFE_OBJECT" }
13
18
  ]
@@ -23,5 +23,17 @@
23
23
  "debugQuery": "SELECT sum(revenue) FROM orders WHERE tenant_id = {tenant_fingerprint:String} AND day >= {start_date:Date}",
24
24
  "safeMessage": "The query exceeded its execution deadline."
25
25
  }
26
+ },
27
+ {
28
+ "id": "boundary-diagnostics",
29
+ "value": {
30
+ "kind": "hypequery-query-diagnostics",
31
+ "version": 1,
32
+ "eventId": "0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef",
33
+ "queryId": "eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee",
34
+ "terminalReason": "drained",
35
+ "attempts": 64,
36
+ "debugQuery": "SELECT sum(revenue)\nFROM (\n\tSELECT revenue FROM orders WHERE day >= {start_date:Date}\n)"
37
+ }
26
38
  }
27
39
  ]
@@ -14,5 +14,13 @@
14
14
  { "id": "invalid-target", "generator": { "type": "invalid-target" }, "error": "HQ_EVENT_INVALID_VALUE" },
15
15
  { "id": "invalid-query-name", "generator": { "type": "invalid-query-name" }, "error": "HQ_EVENT_INVALID_VALUE" },
16
16
  { "id": "oversized-correlation-id", "generator": { "type": "oversized-correlation-id" }, "error": "HQ_EVENT_TOO_LARGE" },
17
+ { "id": "newer-version-with-new-field", "generator": { "type": "newer-version-with-new-field" }, "error": "HQ_EVENT_INVALID_VERSION" },
18
+ { "id": "wrong-kind-with-unknown-field", "generator": { "type": "wrong-kind-with-unknown-field" }, "error": "HQ_EVENT_INVALID_VALUE" },
19
+ { "id": "impossible-calendar-date", "generator": { "type": "impossible-calendar-date" }, "error": "HQ_EVENT_INVALID_VALUE" },
20
+ { "id": "hour-twenty-four", "generator": { "type": "hour-twenty-four" }, "error": "HQ_EVENT_INVALID_VALUE" },
21
+ { "id": "one-digit-fraction", "generator": { "type": "one-digit-fraction" }, "error": "HQ_EVENT_INVALID_VALUE" },
22
+ { "id": "fractional-duration", "generator": { "type": "fractional-duration" }, "error": "HQ_EVENT_INVALID_VALUE" },
23
+ { "id": "correlation-id-one-byte-over", "generator": { "type": "correlation-id-one-byte-over" }, "error": "HQ_EVENT_TOO_LARGE" },
24
+ { "id": "correlation-id-lone-surrogate", "generator": { "type": "correlation-id-lone-surrogate" }, "error": "HQ_EVENT_INVALID_VALUE" },
17
25
  { "id": "unsafe-accessor", "generator": { "type": "unsafe-accessor" }, "error": "HQ_EVENT_UNSAFE_OBJECT" }
18
26
  ]
@@ -36,5 +36,25 @@
36
36
  "tenantFingerprint": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
37
37
  "correlationId": "checkout-deploy-2026-07-20T21:00Z"
38
38
  }
39
+ },
40
+ {
41
+ "id": "boundary-failure-event",
42
+ "value": {
43
+ "kind": "hypequery-query-event",
44
+ "version": 1,
45
+ "eventId": "0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef",
46
+ "occurredAt": "2028-02-29T00:00:00.000Z",
47
+ "target": {
48
+ "project": "prj_acme-analytics",
49
+ "environment": "production"
50
+ },
51
+ "queryName": "daily_revenue",
52
+ "operation": "command",
53
+ "outcome": "failure",
54
+ "errorCategory": "aborted",
55
+ "durationMs": 86400000,
56
+ "rowCount": 1000000000000,
57
+ "correlationId": "éééééééééééééééééééééééééééééééééééééééééééééééééééééééééééééééééééééééééééééééééééééééééééééééééééééééééééééééééééééééééééééééééééééééééééééééééééééééééééééééééééééééééééééééééééééééééééééééééééééééééééééééééééééééééééééééééééééééééééééééééééééééééééééééééééééééééééééééééééééééééééééééééééééééééééééééééééééééééééééééééééééééééééééééééééééééééééééééééééééééééééééééééééééééééééééééééééééééééééééééééééééééééééééééééééééééééééééééééééééééééééééééééééééééééééééééééééééééééééééééééééééééééééééééééééééééééééééééé"
58
+ }
39
59
  }
40
60
  ]
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hypequery/protocol-conformance",
3
- "version": "0.14.0",
3
+ "version": "0.15.0",
4
4
  "description": "Cross-language conformance runner for the Hypequery analytics security protocol",
5
5
  "keywords": [
6
6
  "hypequery",
@@ -31,12 +31,12 @@
31
31
  "README.md"
32
32
  ],
33
33
  "dependencies": {
34
- "@hypequery/protocol": "^0.17.0"
34
+ "@hypequery/protocol": "^0.18.0"
35
35
  },
36
36
  "devDependencies": {
37
37
  "@types/node": "^22.5.0",
38
38
  "typescript": "^5.7.3",
39
- "vitest": "^3.2.6"
39
+ "vitest": "^5.0.2"
40
40
  },
41
41
  "repository": {
42
42
  "type": "git",
@@ -53,7 +53,7 @@
53
53
  "scripts": {
54
54
  "build": "node scripts/copy-fixtures.mjs && tsc --project tsconfig.json",
55
55
  "dev": "tsc --project tsconfig.json --watch",
56
- "lint": "eslint --ext .ts \"src/**/*.ts\"",
56
+ "lint": "eslint \"src/**/*.ts\"",
57
57
  "test": "vitest run",
58
58
  "types": "tsc --project tsconfig.json --noEmit && tsc --project tsconfig.test.json"
59
59
  }