@descryy/runtime-database-observation 0.3.0 → 0.4.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/LICENSE ADDED
@@ -0,0 +1,6 @@
1
+ Copyright (c) Descry
2
+
3
+ All rights reserved. This software is proprietary and confidential.
4
+ No license, express or implied, to reproduce, distribute, modify, or
5
+ create derivative works is granted except as explicitly agreed in
6
+ writing.
@@ -1,10 +1,8 @@
1
1
  /**
2
- * `Evidence.collectorVersion`'s source for every collector in this package:
3
- * this package's own `package.json` "version", read from the artifact
4
- * itself rather than hand-duplicated into a second string that can drift
5
- * from what actually shipped. Same idea as `nodeVersion` elsewhere in this
6
- * repo (`process.version`, always known, never probed) applied to a
7
- * package instead of the Node runtime.
2
+ * `Evidence.collectorVersion` for every collector here: read from this
3
+ * package's own `package.json` "version" rather than hand-duplicated into
4
+ * a second string that can drift. Same idea as `nodeVersion`
5
+ * (`process.version`) applied to a package instead of the runtime.
8
6
  */
9
7
  export declare const COLLECTOR_VERSION: string;
10
8
  //# sourceMappingURL=collector-version.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"collector-version.d.ts","sourceRoot":"","sources":["../src/collector-version.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAMH,eAAO,MAAM,iBAAiB,EAAE,MAA6E,CAAC"}
1
+ {"version":3,"file":"collector-version.d.ts","sourceRoot":"","sources":["../src/collector-version.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAMH,eAAO,MAAM,iBAAiB,EAAE,MAA6E,CAAC"}
@@ -1,10 +1,8 @@
1
1
  /**
2
- * `Evidence.collectorVersion`'s source for every collector in this package:
3
- * this package's own `package.json` "version", read from the artifact
4
- * itself rather than hand-duplicated into a second string that can drift
5
- * from what actually shipped. Same idea as `nodeVersion` elsewhere in this
6
- * repo (`process.version`, always known, never probed) applied to a
7
- * package instead of the Node runtime.
2
+ * `Evidence.collectorVersion` for every collector here: read from this
3
+ * package's own `package.json` "version" rather than hand-duplicated into
4
+ * a second string that can drift. Same idea as `nodeVersion`
5
+ * (`process.version`) applied to a package instead of the runtime.
8
6
  */
9
7
  import { createRequire } from "node:module";
10
8
  const require = createRequire(import.meta.url);
@@ -1 +1 @@
1
- {"version":3,"file":"collector-version.js","sourceRoot":"","sources":["../src/collector-version.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAE5C,MAAM,OAAO,GAAG,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAE/C,MAAM,CAAC,MAAM,iBAAiB,GAAY,OAAO,CAAC,iBAAiB,CAAkC,CAAC,OAAO,CAAC"}
1
+ {"version":3,"file":"collector-version.js","sourceRoot":"","sources":["../src/collector-version.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAE5C,MAAM,OAAO,GAAG,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAE/C,MAAM,CAAC,MAAM,iBAAiB,GAAY,OAAO,CAAC,iBAAiB,CAAkC,CAAC,OAAO,CAAC"}
@@ -1,17 +1,14 @@
1
1
  /**
2
- * §10/§18's "graph correlation" row (RT-141's own disclosed gap, closed
3
- * here): resolving an observed `DATABASE_QUERY`'s captured table name to
4
- * the real `DATABASE_TABLE` graph node `resolveDatabaseTableNode`
5
- * (`@descryy/runtime-graph-correlator`) already knows how to find.
2
+ * §10/§18's graph correlation row (RT-141's disclosed gap, closed here):
3
+ * resolving an observed `DATABASE_QUERY`'s captured table name to the real
4
+ * `DATABASE_TABLE` graph node via `resolveDatabaseTableNode`
5
+ * (`@descryy/runtime-graph-correlator`).
6
6
  *
7
- * Same shape as `test-runner`'s own `resolveObservedTestCase`
8
- * (`graph-mapping.ts`), deliberately: a thin per-package translation, not a
9
- * new abstraction, and it does not call `EvidenceStore.attribute()` itself
10
- * — that needs the evidence's real `evidenceId`, which only exists after
11
- * `store.write()` has returned it, outside this collector's own reach, same
12
- * as every other collector's `graphNodeId: null`. The caller that already
13
- * holds both the store and the graph `driver` attributes; this only
14
- * resolves.
7
+ * Same shape as `test-runner`'s `resolveObservedTestCase`, deliberately: a
8
+ * thin per-package translation, not a new abstraction. Doesn't call
9
+ * `EvidenceStore.attribute()` itself — that needs the real `evidenceId`,
10
+ * which only exists after `store.write()` returns it. Caller attributes;
11
+ * this only resolves.
15
12
  */
16
13
  import type { SqlDriver } from "@descryy/core";
17
14
  import { type DatabaseTableResolution } from "@descryy/runtime-graph-correlator";
@@ -1 +1 @@
1
- {"version":3,"file":"graph-mapping.d.ts","sourceRoot":"","sources":["../src/graph-mapping.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAC/C,OAAO,EAA4B,KAAK,uBAAuB,EAAE,MAAM,mCAAmC,CAAC;AAC3G,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,4BAA4B,CAAC;AAE3D,MAAM,MAAM,+BAA+B,GACvC,uBAAuB,GACvB;IAAE,QAAQ,CAAC,OAAO,EAAE,UAAU,CAAC;IAAC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAA;CAAE,CAAC;AAE9D;;;;;GAKG;AACH,wBAAgB,4BAA4B,CAC1C,MAAM,EAAE,SAAS,EACjB,QAAQ,EAAE,IAAI,CAAC,QAAQ,EAAE,WAAW,GAAG,SAAS,CAAC,EACjD,OAAO,GAAE;IAAE,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAA;CAAO,GACxC,+BAA+B,CAkBjC"}
1
+ {"version":3,"file":"graph-mapping.d.ts","sourceRoot":"","sources":["../src/graph-mapping.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAC/C,OAAO,EAA4B,KAAK,uBAAuB,EAAE,MAAM,mCAAmC,CAAC;AAC3G,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,4BAA4B,CAAC;AAE3D,MAAM,MAAM,+BAA+B,GACvC,uBAAuB,GACvB;IAAE,QAAQ,CAAC,OAAO,EAAE,UAAU,CAAC;IAAC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAA;CAAE,CAAC;AAE9D;;;;;GAKG;AACH,wBAAgB,4BAA4B,CAC1C,MAAM,EAAE,SAAS,EACjB,QAAQ,EAAE,IAAI,CAAC,QAAQ,EAAE,WAAW,GAAG,SAAS,CAAC,EACjD,OAAO,GAAE;IAAE,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAA;CAAO,GACxC,+BAA+B,CAkBjC"}
@@ -1,17 +1,14 @@
1
1
  /**
2
- * §10/§18's "graph correlation" row (RT-141's own disclosed gap, closed
3
- * here): resolving an observed `DATABASE_QUERY`'s captured table name to
4
- * the real `DATABASE_TABLE` graph node `resolveDatabaseTableNode`
5
- * (`@descryy/runtime-graph-correlator`) already knows how to find.
2
+ * §10/§18's graph correlation row (RT-141's disclosed gap, closed here):
3
+ * resolving an observed `DATABASE_QUERY`'s captured table name to the real
4
+ * `DATABASE_TABLE` graph node via `resolveDatabaseTableNode`
5
+ * (`@descryy/runtime-graph-correlator`).
6
6
  *
7
- * Same shape as `test-runner`'s own `resolveObservedTestCase`
8
- * (`graph-mapping.ts`), deliberately: a thin per-package translation, not a
9
- * new abstraction, and it does not call `EvidenceStore.attribute()` itself
10
- * — that needs the evidence's real `evidenceId`, which only exists after
11
- * `store.write()` has returned it, outside this collector's own reach, same
12
- * as every other collector's `graphNodeId: null`. The caller that already
13
- * holds both the store and the graph `driver` attributes; this only
14
- * resolves.
7
+ * Same shape as `test-runner`'s `resolveObservedTestCase`, deliberately: a
8
+ * thin per-package translation, not a new abstraction. Doesn't call
9
+ * `EvidenceStore.attribute()` itself — that needs the real `evidenceId`,
10
+ * which only exists after `store.write()` returns it. Caller attributes;
11
+ * this only resolves.
15
12
  */
16
13
  import { resolveDatabaseTableNode } from "@descryy/runtime-graph-correlator";
17
14
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"graph-mapping.js","sourceRoot":"","sources":["../src/graph-mapping.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAGH,OAAO,EAAE,wBAAwB,EAAgC,MAAM,mCAAmC,CAAC;AAO3G;;;;;GAKG;AACH,MAAM,UAAU,4BAA4B,CAC1C,MAAiB,EACjB,QAAiD,EACjD,UAAuC,EAAE;IAEzC,IAAI,QAAQ,CAAC,SAAS,KAAK,gBAAgB,EAAE,CAAC;QAC5C,OAAO;YACL,OAAO,EAAE,UAAU;YACnB,MAAM,EAAE,0BAA0B,QAAQ,CAAC,SAAS,gHAAgH;SACrK,CAAC;IACJ,CAAC;IACD,MAAM,OAAO,GAAG,QAAQ,CAAC,OAAuC,CAAC;IACjE,MAAM,KAAK,GAAG,OAAO,OAAO,CAAC,KAAK,KAAK,QAAQ,CAAC,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC;IACvE,IAAI,KAAK,KAAK,IAAI,EAAE,CAAC;QACnB,OAAO;YACL,OAAO,EAAE,UAAU;YACnB,MAAM,EACJ,wGAAwG;gBACxG,qEAAqE;SACxE,CAAC;IACJ,CAAC;IACD,OAAO,wBAAwB,CAAC,MAAM,EAAE,KAAK,EAAE,OAAO,CAAC,CAAC;AAC1D,CAAC"}
1
+ {"version":3,"file":"graph-mapping.js","sourceRoot":"","sources":["../src/graph-mapping.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAGH,OAAO,EAAE,wBAAwB,EAAgC,MAAM,mCAAmC,CAAC;AAO3G;;;;;GAKG;AACH,MAAM,UAAU,4BAA4B,CAC1C,MAAiB,EACjB,QAAiD,EACjD,UAAuC,EAAE;IAEzC,IAAI,QAAQ,CAAC,SAAS,KAAK,gBAAgB,EAAE,CAAC;QAC5C,OAAO;YACL,OAAO,EAAE,UAAU;YACnB,MAAM,EAAE,0BAA0B,QAAQ,CAAC,SAAS,gHAAgH;SACrK,CAAC;IACJ,CAAC;IACD,MAAM,OAAO,GAAG,QAAQ,CAAC,OAAuC,CAAC;IACjE,MAAM,KAAK,GAAG,OAAO,OAAO,CAAC,KAAK,KAAK,QAAQ,CAAC,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC;IACvE,IAAI,KAAK,KAAK,IAAI,EAAE,CAAC;QACnB,OAAO;YACL,OAAO,EAAE,UAAU;YACnB,MAAM,EACJ,wGAAwG;gBACxG,qEAAqE;SACxE,CAAC;IACJ,CAAC;IACD,OAAO,wBAAwB,CAAC,MAAM,EAAE,KAAK,EAAE,OAAO,CAAC,CAAC;AAC1D,CAAC"}
@@ -1,23 +1,19 @@
1
1
  /**
2
2
  * `DatabaseQueryCollector` (plan §18 / checklist §14): translates
3
3
  * `sqlite-instrumentation.ts`'s captured queries into `DATABASE_QUERY`
4
- * Evidence. Same shape as `LogCollector` (`@descryy/runtime-backend-observation`)
5
- * deliberately — a `ProcessOutputSource` in, `Evidence` out, streaming-first,
6
- * a collector failure reported as evidence rather than swallowed — but for
7
- * a different marker on the same stream.
4
+ * Evidence. Same shape as `LogCollector` deliberately — `ProcessOutputSource`
5
+ * in, `Evidence` out, streaming-first, a collector failure reported as
6
+ * evidence rather than swallowed — for a different marker on the same stream.
8
7
  *
9
- * **What this collector does not do, named rather than silently absent:**
10
- * no transaction-boundary tracking (BEGIN/COMMIT/ROLLBACK are captured as
11
- * ordinary queries, not grouped) — a real, still-open §14/§18 row.
8
+ * Does not do transaction-boundary tracking — BEGIN/COMMIT/ROLLBACK are
9
+ * captured as ordinary queries, not grouped (open §14/§18 row).
12
10
  *
13
- * **`graphNodeId` on emitted evidence is still always null here, same as
14
- * every other collector** (RT-076's own precedent, `test-runner-collector.ts`)
15
- * — `graph-mapping.ts`'s `resolveObservedDatabaseQuery` is what a caller
16
- * holding both the store and the graph driver uses to resolve a captured
17
- * table name to the real `DATABASE_TABLE` node and attribute it, after
18
- * `write()`, the same way `vertical-slice` already does for every other
19
- * evidence type. The resolver itself (RT-146) is real; this collector
20
- * simply isn't the one that calls it.
11
+ * `graphNodeId` on emitted evidence is always null here, same as every
12
+ * other collector (RT-076 precedent) — `graph-mapping.ts`'s
13
+ * `resolveObservedDatabaseQuery` is what a caller holding the store and
14
+ * driver uses to resolve the table and attribute it after `write()`, the
15
+ * way `vertical-slice` does for every evidence type. The resolver (RT-146)
16
+ * is real; this collector just isn't the one that calls it.
21
17
  */
22
18
  import type { Collector } from "@descryy/runtime-contracts";
23
19
  import { type ProcessOutputSource } from "@descryy/runtime-backend-observation";
@@ -1 +1 @@
1
- {"version":3,"file":"query-collector.d.ts","sourceRoot":"","sources":["../src/query-collector.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAGH,OAAO,KAAK,EAAE,SAAS,EAAmF,MAAM,4BAA4B,CAAC;AAC7I,OAAO,EAAyB,KAAK,mBAAmB,EAAE,MAAM,sCAAsC,CAAC;AAMvG,iNAAiN;AACjN,eAAO,MAAM,0BAA0B,QAAyE,CAAC;AAEjH,MAAM,WAAW,6BAA6B;IAC5C,QAAQ,CAAC,MAAM,EAAE,mBAAmB,CAAC;IACrC,mHAAmH;IACnH,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC;CAC3B;AA2BD,wBAAgB,4BAA4B,CAAC,OAAO,EAAE,6BAA6B,GAAG,SAAS,CAkG9F"}
1
+ {"version":3,"file":"query-collector.d.ts","sourceRoot":"","sources":["../src/query-collector.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAGH,OAAO,KAAK,EAAE,SAAS,EAAmF,MAAM,4BAA4B,CAAC;AAC7I,OAAO,EAAyB,KAAK,mBAAmB,EAAE,MAAM,sCAAsC,CAAC;AAMvG,iNAAiN;AACjN,eAAO,MAAM,0BAA0B,QAAyE,CAAC;AAEjH,MAAM,WAAW,6BAA6B;IAC5C,QAAQ,CAAC,MAAM,EAAE,mBAAmB,CAAC;IACrC,mHAAmH;IACnH,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC;CAC3B;AAyBD,wBAAgB,4BAA4B,CAAC,OAAO,EAAE,6BAA6B,GAAG,SAAS,CAgG9F"}
@@ -1,23 +1,19 @@
1
1
  /**
2
2
  * `DatabaseQueryCollector` (plan §18 / checklist §14): translates
3
3
  * `sqlite-instrumentation.ts`'s captured queries into `DATABASE_QUERY`
4
- * Evidence. Same shape as `LogCollector` (`@descryy/runtime-backend-observation`)
5
- * deliberately — a `ProcessOutputSource` in, `Evidence` out, streaming-first,
6
- * a collector failure reported as evidence rather than swallowed — but for
7
- * a different marker on the same stream.
4
+ * Evidence. Same shape as `LogCollector` deliberately — `ProcessOutputSource`
5
+ * in, `Evidence` out, streaming-first, a collector failure reported as
6
+ * evidence rather than swallowed — for a different marker on the same stream.
8
7
  *
9
- * **What this collector does not do, named rather than silently absent:**
10
- * no transaction-boundary tracking (BEGIN/COMMIT/ROLLBACK are captured as
11
- * ordinary queries, not grouped) — a real, still-open §14/§18 row.
8
+ * Does not do transaction-boundary tracking — BEGIN/COMMIT/ROLLBACK are
9
+ * captured as ordinary queries, not grouped (open §14/§18 row).
12
10
  *
13
- * **`graphNodeId` on emitted evidence is still always null here, same as
14
- * every other collector** (RT-076's own precedent, `test-runner-collector.ts`)
15
- * — `graph-mapping.ts`'s `resolveObservedDatabaseQuery` is what a caller
16
- * holding both the store and the graph driver uses to resolve a captured
17
- * table name to the real `DATABASE_TABLE` node and attribute it, after
18
- * `write()`, the same way `vertical-slice` already does for every other
19
- * evidence type. The resolver itself (RT-146) is real; this collector
20
- * simply isn't the one that calls it.
11
+ * `graphNodeId` on emitted evidence is always null here, same as every
12
+ * other collector (RT-076 precedent) — `graph-mapping.ts`'s
13
+ * `resolveObservedDatabaseQuery` is what a caller holding the store and
14
+ * driver uses to resolve the table and attribute it after `write()`, the
15
+ * way `vertical-slice` does for every evidence type. The resolver (RT-146)
16
+ * is real; this collector just isn't the one that calls it.
21
17
  */
22
18
  import { fileURLToPath } from "node:url";
23
19
  import { extractCorrelationIds } from "@descryy/runtime-backend-observation";
@@ -42,9 +38,7 @@ function computeCapabilities() {
42
38
  sourceMapping: status,
43
39
  stackCapture: status,
44
40
  processLifecycle: status,
45
- // The field this collector's own RT-141 entry named as missing and
46
- // deferred (RT-142) -- closed here (RT-146), alongside the field's
47
- // own addition to the contract.
41
+ // RT-141 named this missing, deferred as RT-142 -- closed here (RT-146).
48
42
  databaseObservation: { availability: "available", reason: null },
49
43
  externalServiceObservation: { availability: "unavailable", reason: "DatabaseQueryCollector instruments node:sqlite only; outbound requests are ExternalRequestCollector's to observe (RT-146)." },
50
44
  };
@@ -72,14 +66,12 @@ export function createDatabaseQueryCollector(options) {
72
66
  traceId,
73
67
  requestId,
74
68
  correlationId: null,
75
- // Resolved later, by a caller holding the store and driver --
76
- // resolveObservedDatabaseQuery (graph-mapping.ts), not here. Same
77
- // split every other collector's graphNodeId already takes.
69
+ // Resolved later by a caller holding store+driver --
70
+ // resolveObservedDatabaseQuery (graph-mapping.ts), not here.
78
71
  graphNodeId: null,
79
72
  sourceLocation: null,
80
73
  stackTrace: null,
81
- // The observation itself (a real captured call, real timing, real
82
- // success/failure) is not probabilistic.
74
+ // Real captured call, real timing, real outcome -- not probabilistic.
83
75
  confidence: 1,
84
76
  redactionStatus: "pending-redaction",
85
77
  collectorVersion: COLLECTOR_VERSION,
@@ -1 +1 @@
1
- {"version":3,"file":"query-collector.js","sourceRoot":"","sources":["../src/query-collector.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAEzC,OAAO,EAAE,qBAAqB,EAA4B,MAAM,sCAAsC,CAAC;AAEvG,OAAO,EAAE,cAAc,EAAsB,MAAM,wBA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rH,WAAW,EAAE,4BAA4B,OAAO,CAAC,MAAM,CAAC,SAAS,EAAE;4BACnE,KAAK,EAAE,MAAM;yBACd;wBACD,OAAO,EAAE,IAAI;wBACb,SAAS,EAAE,IAAI;wBACf,aAAa,EAAE,IAAI;wBACnB,WAAW,EAAE,IAAI;wBACjB,cAAc,EAAE,IAAI;wBACpB,UAAU,EAAE,IAAI;wBAChB,UAAU,EAAE,CAAC;wBACb,eAAe,EAAE,mBAAmB;wBACpC,gBAAgB,EAAE,iBAAiB;qBACpC,CAAC,CAAC;gBACL,CAAC;gBAAC,OAAO,SAAkB,EAAE,CAAC;oBAC5B,OAAO,CAAC,KAAK,CACX,6BAA6B,OAAO,CAAC,MAAM,CAAC,SAAS,yBAAyB,MAAM,2CAA2C,MAAM,CAAC,SAAS,CAAC,EAAE,CACnJ,CAAC;gBACJ,CAAC;YACH,CAAC,CAAC,CAAC;YACH,OAAO,OAAO,CAAC,OAAO,CAAC,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;QAC9C,CAAC;QAED,KAAK,CAAC,IAAI;YACR,MAAM,eAAe,CAAC;QACxB,CAAC;QAED,YAAY;YACV,IAAI,kBAAkB,KAAK,IAAI;gBAAE,OAAO,YAAY,CAAC;YACrD,OAAO;gBACL,GAAG,YAAY;gBACf,gBAAgB,EAAE;oBAChB,YAAY,EAAE,aAAa;oBAC3B,MAAM,EAAE,6CAA6C,kBAAkB,gDAAgD;iBACxH;aACF,CAAC;QACJ,CAAC;KACF,CAAC;AACJ,CAAC"}
@@ -6,11 +6,9 @@
6
6
  */
7
7
  import { QUERY_MARKER, type CapturedMethod, type CapturedQuery } from "./query-marker.ts";
8
8
  /**
9
- * `null` for a non-matching line (ordinary application output) AND for a
10
- * line that starts with the marker but fails to parse as one of this
11
- * package's own captured queries — a malformed marker line is refused,
12
- * never guessed at, the same "wrong shape, not a wrong value" distinction
13
- * `test-runner`'s own `isNodeTestEvent` makes.
9
+ * `null` for a non-matching line AND for a line that starts with the
10
+ * marker but fails to parse -- a malformed marker line is refused, never
11
+ * guessed at (same distinction `test-runner`'s `isNodeTestEvent` makes).
14
12
  */
15
13
  export declare function parseQueryLine(line: string): CapturedQuery | null;
16
14
  export type { CapturedMethod, CapturedQuery };
@@ -1 +1 @@
1
- {"version":3,"file":"query-line-parser.d.ts","sourceRoot":"","sources":["../src/query-line-parser.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAMH,OAAO,EAAE,YAAY,EAAE,KAAK,cAAc,EAAE,KAAK,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAc1F;;;;;;GAMG;AACH,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,GAAG,aAAa,GAAG,IAAI,CAUjE;AAED,YAAY,EAAE,cAAc,EAAE,aAAa,EAAE,CAAC;AAC9C,OAAO,EAAE,YAAY,EAAE,CAAC"}
1
+ {"version":3,"file":"query-line-parser.d.ts","sourceRoot":"","sources":["../src/query-line-parser.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAKH,OAAO,EAAE,YAAY,EAAE,KAAK,cAAc,EAAE,KAAK,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAc1F;;;;GAIG;AACH,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,GAAG,aAAa,GAAG,IAAI,CAUjE;AAED,YAAY,EAAE,cAAc,EAAE,aAAa,EAAE,CAAC;AAC9C,OAAO,EAAE,YAAY,EAAE,CAAC"}
@@ -4,10 +4,9 @@
4
4
  * stdout/stderr — is not this parser's concern and is left alone; a
5
5
  * database collector does not also try to be a log collector.
6
6
  */
7
- // From `query-marker.ts`, never from `sqlite-instrumentation.ts`. That import
8
- // used to read as free — one string constant — and was not: it loaded a module
9
- // that patches `DatabaseSync.prototype` and writes to stdout at module scope,
10
- // into every consumer of this package's index.
7
+ // From query-marker.ts, never sqlite-instrumentation.ts: that module patches
8
+ // DatabaseSync.prototype and writes to stdout at module scope -- importing
9
+ // it here would leak into every consumer of this package's index.
11
10
  import { QUERY_MARKER } from "./query-marker.js";
12
11
  function isCapturedQuery(value) {
13
12
  if (typeof value !== "object" || value === null)
@@ -20,11 +19,9 @@ function isCapturedQuery(value) {
20
19
  (v.error === null || typeof v.error === "string"));
21
20
  }
22
21
  /**
23
- * `null` for a non-matching line (ordinary application output) AND for a
24
- * line that starts with the marker but fails to parse as one of this
25
- * package's own captured queries — a malformed marker line is refused,
26
- * never guessed at, the same "wrong shape, not a wrong value" distinction
27
- * `test-runner`'s own `isNodeTestEvent` makes.
22
+ * `null` for a non-matching line AND for a line that starts with the
23
+ * marker but fails to parse -- a malformed marker line is refused, never
24
+ * guessed at (same distinction `test-runner`'s `isNodeTestEvent` makes).
28
25
  */
29
26
  export function parseQueryLine(line) {
30
27
  if (!line.startsWith(`${QUERY_MARKER} `))
@@ -1 +1 @@
1
- {"version":3,"file":"query-line-parser.js","sourceRoot":"","sources":["../src/query-line-parser.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,8EAA8E;AAC9E,+EAA+E;AAC/E,8EAA8E;AAC9E,+CAA+C;AAC/C,OAAO,EAAE,YAAY,EAA2C,MAAM,mBAAmB,CAAC;AAE1F,SAAS,eAAe,CAAC,KAAc;IACrC,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI;QAAE,OAAO,KAAK,CAAC;IAC9D,MAAM,CAAC,GAAG,KAAgC,CAAC;IAC3C,OAAO,CACL,OAAO,CAAC,CAAC,GAAG,KAAK,QAAQ;QACzB,OAAO,CAAC,CAAC,MAAM,KAAK,QAAQ;QAC5B,OAAO,CAAC,CAAC,UAAU,KAAK,QAAQ;QAChC,OAAO,CAAC,CAAC,OAAO,KAAK,SAAS;QAC9B,CAAC,CAAC,CAAC,KAAK,KAAK,IAAI,IAAI,OAAO,CAAC,CAAC,KAAK,KAAK,QAAQ,CAAC,CAClD,CAAC;AACJ,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,cAAc,CAAC,IAAY;IACzC,IAAI,CAAC,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E,OAAO,IAAI,CAAC;IACtD,MAAM,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;IACjD,IAAI,MAAe,CAAC;IACpB,IAAI,CAAC;QACH,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;IAC5B,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,IAAI,CAAC;IACd,CAAC;IACD,OAAO,eAAe,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC;AACjD,CAAC;AAGD,OAAO,EAAE,YAAY,EAAE,CAAC"}
@@ -2,25 +2,21 @@
2
2
  * The wire vocabulary shared by the two halves of database observation: the
3
3
  * marker prefix and the shape that follows it.
4
4
  *
5
- * This module exists to be **free of side effects**, and that is its entire
6
- * job. `sqlite-instrumentation.ts` — the other holder of these names until
7
- * now — patches `DatabaseSync.prototype` at module scope and writes to
8
- * stdout, which is right for a `--import` preload inside an observed process
9
- * and wrong everywhere else. `query-line-parser.ts` needed nothing from it
10
- * but the string `"DESCRY_DB_QUERY"`, and importing a string is still
11
- * importing a module: the patch and the stdout writer came along, through the
12
- * package index, into every consumer. Downstream that reached `@descryy/mcp`,
13
- * whose stdout is a JSON-RPC transport — one `analyze` call put 14,906
14
- * `DESCRY_DB_QUERY` lines into the protocol stream.
5
+ * Exists to be free of side effects -- that's its entire job.
6
+ * `sqlite-instrumentation.ts` patches `DatabaseSync.prototype` at module
7
+ * scope and writes to stdout, right for a `--import` preload in an
8
+ * observed process, wrong everywhere else. Importing just the string
9
+ * `"DESCRY_DB_QUERY"` from it still imports the module -- the patch and
10
+ * stdout writer came along through the package index into every consumer,
11
+ * reaching `@descryy/mcp`, whose stdout is a JSON-RPC transport: one
12
+ * `analyze` call put 14,906 `DESCRY_DB_QUERY` lines into the protocol stream.
15
13
  *
16
- * So: the emitter imports the vocabulary, the parser imports the vocabulary,
17
- * and neither imports the other. Anything added here must stay a constant or
18
- * a type. A function with a module-scope effect would rebuild the same trap
19
- * one file over.
14
+ * So: emitter and parser both import the vocabulary, neither imports the
15
+ * other. Anything added here must stay a constant or type -- a
16
+ * module-scope-effect function would rebuild the same trap.
20
17
  *
21
- * The prefix convention itself is the benchmark harness's `BENCH_RESULT
22
- * {json}` (RT-072): one line of structured JSON, never prose, because
23
- * scraping prose measures the prose.
18
+ * Prefix convention: the benchmark harness's `BENCH_RESULT {json}` (RT-072)
19
+ * -- one line of structured JSON, never prose.
24
20
  */
25
21
  export declare const QUERY_MARKER = "DESCRY_DB_QUERY";
26
22
  export type CapturedMethod = "exec" | "prepare" | "run" | "get" | "all";
@@ -1 +1 @@
1
- {"version":3,"file":"query-marker.d.ts","sourceRoot":"","sources":["../src/query-marker.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAOH,eAAO,MAAM,YAAY,oBAAsC,CAAC;AAEhE,MAAM,MAAM,cAAc,GAAG,MAAM,GAAG,SAAS,GAAG,KAAK,GAAG,KAAK,GAAG,KAAK,CAAC;AAExE,MAAM,WAAW,aAAa;IAC5B,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,MAAM,EAAE,cAAc,CAAC;IAChC,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC;IAC1B,QAAQ,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;CAC/B"}
1
+ {"version":3,"file":"query-marker.d.ts","sourceRoot":"","sources":["../src/query-marker.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAMH,eAAO,MAAM,YAAY,oBAAsC,CAAC;AAEhE,MAAM,MAAM,cAAc,GAAG,MAAM,GAAG,SAAS,GAAG,KAAK,GAAG,KAAK,GAAG,KAAK,CAAC;AAExE,MAAM,WAAW,aAAa;IAC5B,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,MAAM,EAAE,cAAc,CAAC;IAChC,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC;IAC1B,QAAQ,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;CAC/B"}
@@ -2,29 +2,24 @@
2
2
  * The wire vocabulary shared by the two halves of database observation: the
3
3
  * marker prefix and the shape that follows it.
4
4
  *
5
- * This module exists to be **free of side effects**, and that is its entire
6
- * job. `sqlite-instrumentation.ts` — the other holder of these names until
7
- * now — patches `DatabaseSync.prototype` at module scope and writes to
8
- * stdout, which is right for a `--import` preload inside an observed process
9
- * and wrong everywhere else. `query-line-parser.ts` needed nothing from it
10
- * but the string `"DESCRY_DB_QUERY"`, and importing a string is still
11
- * importing a module: the patch and the stdout writer came along, through the
12
- * package index, into every consumer. Downstream that reached `@descryy/mcp`,
13
- * whose stdout is a JSON-RPC transport — one `analyze` call put 14,906
14
- * `DESCRY_DB_QUERY` lines into the protocol stream.
5
+ * Exists to be free of side effects -- that's its entire job.
6
+ * `sqlite-instrumentation.ts` patches `DatabaseSync.prototype` at module
7
+ * scope and writes to stdout, right for a `--import` preload in an
8
+ * observed process, wrong everywhere else. Importing just the string
9
+ * `"DESCRY_DB_QUERY"` from it still imports the module -- the patch and
10
+ * stdout writer came along through the package index into every consumer,
11
+ * reaching `@descryy/mcp`, whose stdout is a JSON-RPC transport: one
12
+ * `analyze` call put 14,906 `DESCRY_DB_QUERY` lines into the protocol stream.
15
13
  *
16
- * So: the emitter imports the vocabulary, the parser imports the vocabulary,
17
- * and neither imports the other. Anything added here must stay a constant or
18
- * a type. A function with a module-scope effect would rebuild the same trap
19
- * one file over.
14
+ * So: emitter and parser both import the vocabulary, neither imports the
15
+ * other. Anything added here must stay a constant or type -- a
16
+ * module-scope-effect function would rebuild the same trap.
20
17
  *
21
- * The prefix convention itself is the benchmark harness's `BENCH_RESULT
22
- * {json}` (RT-072): one line of structured JSON, never prose, because
23
- * scraping prose measures the prose.
18
+ * Prefix convention: the benchmark harness's `BENCH_RESULT {json}` (RT-072)
19
+ * -- one line of structured JSON, never prose.
24
20
  */
25
21
  import { RESERVED_MARKER_PREFIX } from "@descryy/runtime-contracts";
26
- // Derived, not spelled again: `RESERVED_MARKER_PREFIX` is what the
27
- // backend log collector skips on, so a marker that did not use it would
28
- // come back as the application's own log output.
22
+ // Derived, not spelled again -- RESERVED_MARKER_PREFIX is what the backend
23
+ // log collector skips on; a marker without it reads as application output.
29
24
  export const QUERY_MARKER = `${RESERVED_MARKER_PREFIX}DB_QUERY`;
30
25
  //# sourceMappingURL=query-marker.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"query-marker.js","sourceRoot":"","sources":["../src/query-marker.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAEH,OAAO,EAAE,sBAAsB,EAAE,MAAM,4BAA4B,CAAC;AAEpE,mEAAmE;AACnE,wEAAwE;AACxE,iDAAiD;AACjD,MAAM,CAAC,MAAM,YAAY,GAAG,GAAG,sBAAsB,UAAU,CAAC"}
1
+ {"version":3,"file":"query-marker.js","sourceRoot":"","sources":["../src/query-marker.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,EAAE,sBAAsB,EAAE,MAAM,4BAA4B,CAAC;AAEpE,2EAA2E;AAC3E,2EAA2E;AAC3E,MAAM,CAAC,MAAM,YAAY,GAAG,GAAG,sBAAsB,UAAU,CAAC"}
@@ -1,23 +1,18 @@
1
1
  /**
2
2
  * `--import`-loaded preload: patches `node:sqlite`'s `DatabaseSync`
3
- * prototype before the target application's own code runs, so every real
4
- * query the application issues through its own `import { DatabaseSync }
5
- * from "node:sqlite"` is observed — proven directly (a probe script, not
6
- * assumed): Node's built-in modules are a process-wide singleton, so a
7
- * `--import` preload patching `DatabaseSync.prototype` here and an
8
- * application's completely separate `import` of the same built-in later
9
- * see the same prototype object.
3
+ * prototype before the target application's code runs, so every real query
4
+ * through the app's own `import { DatabaseSync } from "node:sqlite"` is
5
+ * observed -- verified directly (probe script): Node's built-in modules
6
+ * are a process-wide singleton, so a `--import` preload and the app's own
7
+ * later import see the same prototype object.
10
8
  *
11
- * Deliberately minimal and import-free, like `test-runner`'s own
12
- * `reporter.ts` — this runs inside the OBSERVED process, not this
13
- * package's own, and is loaded by absolute path via `node --import`, never
14
- * through this package's normal dependency graph. Interpretation (target
15
- * table, correlation ids) happens on the collector side, in the observing
16
- * process, not here — this only captures.
9
+ * Deliberately minimal and import-free, like `test-runner`'s `reporter.ts`
10
+ * -- runs inside the OBSERVED process, loaded by absolute path via
11
+ * `node --import`, never through this package's normal dependency graph.
12
+ * Interpretation happens on the collector side; this only captures.
17
13
  *
18
- * One line of structured JSON per query, prefixed exactly like the
19
- * benchmark harness's own `BENCH_RESULT {json}` convention (RT-072):
20
- * scraping prose measures the prose, so nothing here is prose.
14
+ * One line of structured JSON per query, same convention as the benchmark
15
+ * harness's `BENCH_RESULT {json}` (RT-072).
21
16
  */
22
17
  export {};
23
18
  //# sourceMappingURL=sqlite-instrumentation.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"sqlite-instrumentation.d.ts","sourceRoot":"","sources":["../src/sqlite-instrumentation.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG"}
1
+ {"version":3,"file":"sqlite-instrumentation.d.ts","sourceRoot":"","sources":["../src/sqlite-instrumentation.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG"}
@@ -1,30 +1,24 @@
1
1
  /**
2
2
  * `--import`-loaded preload: patches `node:sqlite`'s `DatabaseSync`
3
- * prototype before the target application's own code runs, so every real
4
- * query the application issues through its own `import { DatabaseSync }
5
- * from "node:sqlite"` is observed — proven directly (a probe script, not
6
- * assumed): Node's built-in modules are a process-wide singleton, so a
7
- * `--import` preload patching `DatabaseSync.prototype` here and an
8
- * application's completely separate `import` of the same built-in later
9
- * see the same prototype object.
3
+ * prototype before the target application's code runs, so every real query
4
+ * through the app's own `import { DatabaseSync } from "node:sqlite"` is
5
+ * observed -- verified directly (probe script): Node's built-in modules
6
+ * are a process-wide singleton, so a `--import` preload and the app's own
7
+ * later import see the same prototype object.
10
8
  *
11
- * Deliberately minimal and import-free, like `test-runner`'s own
12
- * `reporter.ts` — this runs inside the OBSERVED process, not this
13
- * package's own, and is loaded by absolute path via `node --import`, never
14
- * through this package's normal dependency graph. Interpretation (target
15
- * table, correlation ids) happens on the collector side, in the observing
16
- * process, not here — this only captures.
9
+ * Deliberately minimal and import-free, like `test-runner`'s `reporter.ts`
10
+ * -- runs inside the OBSERVED process, loaded by absolute path via
11
+ * `node --import`, never through this package's normal dependency graph.
12
+ * Interpretation happens on the collector side; this only captures.
17
13
  *
18
- * One line of structured JSON per query, prefixed exactly like the
19
- * benchmark harness's own `BENCH_RESULT {json}` convention (RT-072):
20
- * scraping prose measures the prose, so nothing here is prose.
14
+ * One line of structured JSON per query, same convention as the benchmark
15
+ * harness's `BENCH_RESULT {json}` (RT-072).
21
16
  */
22
17
  import { DatabaseSync } from "node:sqlite";
23
- // The vocabulary lives in a module with no side effects of its own, and the
24
- // direction matters: this file imports it, nothing imports this file. The
25
- // parser once reached in here for `QUERY_MARKER` alone and took the prototype
26
- // patch and the stdout writer with it, all the way into a JSON-RPC transport.
27
- // See `query-marker.ts` for the measurement.
18
+ // query-marker.ts has no side effects; direction matters -- this file
19
+ // imports it, nothing imports this file. Importing QUERY_MARKER alone from
20
+ // here once dragged the prototype patch and stdout writer into a JSON-RPC
21
+ // transport. See query-marker.ts for the measurement.
28
22
  import { QUERY_MARKER } from "./query-marker.js";
29
23
  function emit(query) {
30
24
  process.stdout.write(`${QUERY_MARKER} ${JSON.stringify(query)}\n`);
@@ -63,10 +57,9 @@ if (target[PATCHED] !== true) {
63
57
  return timed(sql, method, () => original.apply(stmt, args));
64
58
  };
65
59
  }
66
- // `iterate()` deliberately left unwrapped: it returns a lazy generator,
67
- // so "duration" would mean the time to build the iterator, not the
68
- // time to consume it -- a different, misleading number under the same
69
- // name. Disclosed here rather than measured wrong.
60
+ // iterate() deliberately unwrapped: it returns a lazy generator, so
61
+ // "duration" would measure building the iterator, not consuming it --
62
+ // disclosed rather than measured wrong.
70
63
  return stmt;
71
64
  };
72
65
  }
@@ -1 +1 @@
1
- {"version":3,"file":"sqlite-instrumentation.js","sourceRoot":"","sources":["../src/sqlite-instrumentation.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAE3C,4EAA4E;AAC5E,0EAA0E;AAC1E,8EAA8E;AAC9E,8EAA8E;AAC9E,6CAA6C;AAC7C,OAAO,EAAE,YAAY,EAA2C,MAAM,mBAAmB,CAAC;AAE1F,SAAS,IAAI,CAAC,KAAoB;IAChC,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,GAAG,YAAY,IAAI,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;AACrE,CAAC;AAED,SAAS,KAAK,CAAI,GAAW,EAAE,MAAsB,EAAE,GAAY;IACjE,MAAM,KAAK,GAAG,WAAW,CAAC,GAAG,EAAE,CAAC;IAChC,IAAI,CAAC;QACH,MAAM,MAAM,GAAG,GAAG,EAAE,CAAC;QACrB,IAAI,CAAC,EAAE,GAAG,EAAE,MAAM,EAAE,UAAU,EAAE,WAAW,CAAC,GAAG,EAAE,GAAG,KAAK,EAAE,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;QACzF,OAAO,MAAM,CAAC;IAChB,CAAC;IAAC,OAAO,KAAc,EAAE,CAAC;QACxB,MAAM,MAAM,GAAG,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC,IAAI,KAAK,KAAK,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC,MAAM,CAA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,KAAK,MAAM,MAAM,IAAI,CAAC,KAAK,EAAE,KAAK,EAAE,KAAK,CAAU,EAAE,CAAC;YACpD,MAAM,QAAQ,GAAG,UAAU,CAAC,MAAM,CAAiC,CAAC;YACpE,UAAU,CAAC,MAAM,CAAC,GAAG,SAAS,sBAAsB,CAAC,GAAG,IAAe;gBACrE,OAAO,KAAK,CAAC,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,CAAC,QAAQ,CAAC,KAAK,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC,CAAC;YAC9D,CAAC,CAAC;QACJ,CAAC;QACD,oEAAoE;QACpE,sEAAsE;QACtE,wCAAwC;QACxC,OAAO,IAAI,CAAC;IACd,CAA0C,CAAC;AAC7C,CAAC"}
@@ -1,22 +1,19 @@
1
1
  /**
2
2
  * Extracts the single target table a DML statement names — deliberately
3
- * not a SQL parser, same reasoning `adapter-sql`'s `parse.ts` gives for
4
- * its own DDL-only scope: a bounded reader that recognises a few shapes
5
- * and refuses (`null`) on everything else is honest; a reader that guesses
6
- * at a JOIN or a subquery is not.
3
+ * not a SQL parser, same reasoning `adapter-sql`'s `parse.ts` gives for its
4
+ * own DDL-only scope: a bounded reader that recognises a few shapes and
5
+ * refuses (`null`) on the rest is honest; guessing at a JOIN or subquery
6
+ * isn't.
7
7
  *
8
- * `adapter-sql` (descry-adapters) reads CREATE/ALTER — schema declaration.
9
- * This reads INSERT/UPDATE/DELETE/SELECT — a different problem (which
10
- * table did a query at RUNTIME actually touch), so its own small reader
11
- * rather than a false shared abstraction over two different questions.
8
+ * `adapter-sql` reads CREATE/ALTER (schema declaration); this reads
9
+ * INSERT/UPDATE/DELETE/SELECT (which table a query touched at RUNTIME) --
10
+ * a different question, its own small reader rather than a false shared
11
+ * abstraction.
12
12
  *
13
- * **Refused, not guessed, for:** a JOIN anywhere in the statement (which
14
- * table is "the" table is genuinely ambiguous), a comma-separated FROM
15
- * list (old-style implicit join, same ambiguity), a subquery in FROM, a
16
- * CTE (`WITH ... AS`), and anything this reader does not recognise the
17
- * shape of at all. The wrong-table negative control this package's tests
18
- * assert on is exactly this: a two-table JOIN must resolve to `null`, not
19
- * to either table picked arbitrarily.
13
+ * Refused, not guessed: a JOIN anywhere, a comma-separated FROM list
14
+ * (old-style implicit join), a subquery in FROM, a CTE, or an unrecognised
15
+ * shape. Tested negative control: a two-table JOIN must resolve to `null`,
16
+ * not either table picked arbitrarily.
20
17
  */
21
18
  /**
22
19
  * `null` for anything not recognised as exactly one of INSERT/UPDATE/
@@ -1 +1 @@
1
- {"version":3,"file":"table-extraction.d.ts","sourceRoot":"","sources":["../src/table-extraction.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AA8BH;;;;GAIG;AACH,wBAAgB,kBAAkB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAmB7D"}
1
+ {"version":3,"file":"table-extraction.d.ts","sourceRoot":"","sources":["../src/table-extraction.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AA8BH;;;;GAIG;AACH,wBAAgB,kBAAkB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAmB7D"}
@@ -1,22 +1,19 @@
1
1
  /**
2
2
  * Extracts the single target table a DML statement names — deliberately
3
- * not a SQL parser, same reasoning `adapter-sql`'s `parse.ts` gives for
4
- * its own DDL-only scope: a bounded reader that recognises a few shapes
5
- * and refuses (`null`) on everything else is honest; a reader that guesses
6
- * at a JOIN or a subquery is not.
3
+ * not a SQL parser, same reasoning `adapter-sql`'s `parse.ts` gives for its
4
+ * own DDL-only scope: a bounded reader that recognises a few shapes and
5
+ * refuses (`null`) on the rest is honest; guessing at a JOIN or subquery
6
+ * isn't.
7
7
  *
8
- * `adapter-sql` (descry-adapters) reads CREATE/ALTER — schema declaration.
9
- * This reads INSERT/UPDATE/DELETE/SELECT — a different problem (which
10
- * table did a query at RUNTIME actually touch), so its own small reader
11
- * rather than a false shared abstraction over two different questions.
8
+ * `adapter-sql` reads CREATE/ALTER (schema declaration); this reads
9
+ * INSERT/UPDATE/DELETE/SELECT (which table a query touched at RUNTIME) --
10
+ * a different question, its own small reader rather than a false shared
11
+ * abstraction.
12
12
  *
13
- * **Refused, not guessed, for:** a JOIN anywhere in the statement (which
14
- * table is "the" table is genuinely ambiguous), a comma-separated FROM
15
- * list (old-style implicit join, same ambiguity), a subquery in FROM, a
16
- * CTE (`WITH ... AS`), and anything this reader does not recognise the
17
- * shape of at all. The wrong-table negative control this package's tests
18
- * assert on is exactly this: a two-table JOIN must resolve to `null`, not
19
- * to either table picked arbitrarily.
13
+ * Refused, not guessed: a JOIN anywhere, a comma-separated FROM list
14
+ * (old-style implicit join), a subquery in FROM, a CTE, or an unrecognised
15
+ * shape. Tested negative control: a two-table JOIN must resolve to `null`,
16
+ * not either table picked arbitrarily.
20
17
  */
21
18
  const IDENTIFIER = String.raw `(?:\[[^\]]+\]|"[^"]+"|` + "`[^`]+`" + String.raw `|[A-Za-z_][A-Za-z0-9_]*)`;
22
19
  const QUALIFIED = `${IDENTIFIER}(?:\\.${IDENTIFIER})?`;
@@ -1 +1 @@
1
- {"version":3,"file":"table-extraction.js","sourceRoot":"","sources":["../src/table-extraction.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,MAAM,UAAU,GAAG,MAAM,CAAC,GAAG,CAAA,wBAAwB,GAAG,SAAS,GAAG,MAAM,CAAC,GAAG,CAAA,0BAA0B,CAAC;AACzG,MAAM,SAAS,GAAG,GAAG,UAAU,SAAS,UAAU,IAAI,CAAC;AAEvD,MAAM,WAAW,GAAG,IAAI,MAAM,CAAC,2BAA2B,SAAS,GAAG,EAAE,GAAG,CAAC,CAAC;AAC7E,MAAM,MAAM,GAAG,IAAI,MAAM,CAAC,mBAAmB,SAAS,GAAG,EAAE,GAAG,CAAC,CAAC;AAChE,MAAM,WAAW,GAAG,IAAI,MAAM,CAAC,2BAA2B,SAAS,GAAG,EAA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AC,CAAC,CAAE,CAAC,CAAC;IAE5C,MAAM,MAAM,GAAG,WAAW,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IACzC,IAAI,MAAM,KAAK,IAAI,IAAI,CAAC,iBAAiB,CAAC,OAAO,EAAE,MAAM,CAAC,KAAK,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,EAAE,CAAC;QACpF,OAAO,SAAS,CAAC,MAAM,CAAC,CAAC,CAAE,CAAC,CAAC;IAC/B,CAAC;IAED,OAAO,IAAI,CAAC;AACd,CAAC"}
package/package.json CHANGED
@@ -1,9 +1,14 @@
1
1
  {
2
2
  "name": "@descryy/runtime-database-observation",
3
- "version": "0.3.0",
3
+ "version": "0.4.0",
4
4
  "type": "module",
5
5
  "description": "Database query observation (plan \u00a718, checklist \u00a714): real DATABASE_QUERY capture via driver instrumentation, never parsed application logs. Driver #1 is node:sqlite.",
6
6
  "license": "UNLICENSED",
7
+ "repository": {
8
+ "type": "git",
9
+ "url": "git+https://github.com/descryhq-wq/descry-runtime.git",
10
+ "directory": "packages/database-observation"
11
+ },
7
12
  "engines": {
8
13
  "node": ">=22.5"
9
14
  },
@@ -24,9 +29,9 @@
24
29
  "build": "tsc -b"
25
30
  },
26
31
  "dependencies": {
27
- "@descryy/runtime-contracts": "0.2.0",
28
- "@descryy/runtime-backend-observation": "0.2.0",
29
- "@descryy/runtime-graph-correlator": "0.3.0"
32
+ "@descryy/runtime-contracts": "0.3.0",
33
+ "@descryy/runtime-backend-observation": "0.3.0",
34
+ "@descryy/runtime-graph-correlator": "0.4.0"
30
35
  },
31
36
  "devDependencies": {
32
37
  "@descryy/runtime-controller": "*",