@lunora/advisor 1.0.0-alpha.181 → 1.0.0-alpha.183

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/README.md CHANGED
@@ -91,7 +91,7 @@ import schema from "./lunora/schema";
91
91
  const findings = runAdvisor({ schema: fromServerSchema(schema), shardTraffic, tableScans, indexHits }, { source: "runtime" });
92
92
  ```
93
93
 
94
- An Analytics-Engine-backed alternative feeder (querying AE SQL for `lunora.index.hit`/`lunora.shard.request`/`lunora.table.scan` events instead of the in-DO counters) was quarantined off the package root: nothing in the runtime ever writes those AE events, so `shardTraffic` and `tableScans` always came back empty. `indexHits` came back empty too, unless the caller passed `declaredIndexes` — then it listed every declared index with `reads: 0`, a real zero-reads fact rather than a stand-in for "no data". The `AnalyticsMetricsOptions` / `AnalyticsMetricsSource` / `AnalyticsRuntimeMetrics` types it would have produced are still exported from `@lunora/advisor` — they describe the still-valid, still-optional shape of `runAdvisor`'s runtime input — but the loader function itself is not, until something actually emits those events.
94
+ An Analytics-Engine-backed alternative feeder (querying `ctx.analyticsSql` for `lunora.index.hit`/`lunora.shard.request`/`lunora.table.scan` events instead of the in-DO counters) was quarantined off the package root: nothing in the runtime ever writes those AE events, so `shardTraffic` and `tableScans` always came back empty. `indexHits` came back empty too, unless the caller passed `declaredIndexes` — then it listed every declared index with `reads: 0`, a real zero-reads fact rather than a stand-in for "no data". The `AnalyticsMetricsOptions` / `AnalyticsMetricsSource` / `AnalyticsRuntimeMetrics` types it would have produced are still exported from `@lunora/advisor` — they describe the still-valid, still-optional shape of `runAdvisor`'s runtime input — but the loader function itself is not, until something actually emits those events.
95
95
 
96
96
  A missing metric degrades to an empty array rather than throwing, so a partially configured read path still returns what it can.
97
97
 
package/dist/index.d.mts CHANGED
@@ -2391,13 +2391,13 @@ interface Lint {
2391
2391
  title: string;
2392
2392
  }
2393
2393
  /**
2394
- * Minimal structural view of the `@lunora/bindings/analytics` SQL client — just its
2395
- * `query(sql)` method. Kept structural (not an `import type` from
2396
- * `@lunora/bindings/analytics`) so the advisor needn't depend on the analytics package;
2397
- * the real `AnalyticsSqlClient` satisfies it, as does a plain test double.
2394
+ * Minimal structural view of an Analytics SQL client — just its
2395
+ * `query(sql, params)` method. Kept structural (not an `import type` from
2396
+ * `@lunora/bindings`) so the advisor needn't depend on the bindings package;
2397
+ * `ctx.analyticsSql` satisfies it, as does a plain test double.
2398
2398
  */
2399
2399
  interface AnalyticsMetricsSource {
2400
- query: (sql: string) => Promise<{
2400
+ query: (sql: string, params: Readonly<Record<string, string>>) => Promise<{
2401
2401
  rows: ReadonlyArray<Record<string, unknown>>;
2402
2402
  }>;
2403
2403
  }
@@ -2422,6 +2422,8 @@ interface AnalyticsMetricsOptions {
2422
2422
  * Omit to read the whole deployment's shard set.
2423
2423
  */
2424
2424
  group?: string;
2425
+ /** ISO-8601 lower `timestamp` bound for every read — required by the Analytics SQL dialect. */
2426
+ since: string;
2425
2427
  }
2426
2428
  /** The runtime-lint input arrays this module reconstructs from AE. */
2427
2429
  interface AnalyticsRuntimeMetrics {
package/dist/index.d.ts CHANGED
@@ -2391,13 +2391,13 @@ interface Lint {
2391
2391
  title: string;
2392
2392
  }
2393
2393
  /**
2394
- * Minimal structural view of the `@lunora/bindings/analytics` SQL client — just its
2395
- * `query(sql)` method. Kept structural (not an `import type` from
2396
- * `@lunora/bindings/analytics`) so the advisor needn't depend on the analytics package;
2397
- * the real `AnalyticsSqlClient` satisfies it, as does a plain test double.
2394
+ * Minimal structural view of an Analytics SQL client — just its
2395
+ * `query(sql, params)` method. Kept structural (not an `import type` from
2396
+ * `@lunora/bindings`) so the advisor needn't depend on the bindings package;
2397
+ * `ctx.analyticsSql` satisfies it, as does a plain test double.
2398
2398
  */
2399
2399
  interface AnalyticsMetricsSource {
2400
- query: (sql: string) => Promise<{
2400
+ query: (sql: string, params: Readonly<Record<string, string>>) => Promise<{
2401
2401
  rows: ReadonlyArray<Record<string, unknown>>;
2402
2402
  }>;
2403
2403
  }
@@ -2422,6 +2422,8 @@ interface AnalyticsMetricsOptions {
2422
2422
  * Omit to read the whole deployment's shard set.
2423
2423
  */
2424
2424
  group?: string;
2425
+ /** ISO-8601 lower `timestamp` bound for every read — required by the Analytics SQL dialect. */
2426
+ since: string;
2425
2427
  }
2426
2428
  /** The runtime-lint input arrays this module reconstructs from AE. */
2427
2429
  interface AnalyticsRuntimeMetrics {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lunora/advisor",
3
- "version": "1.0.0-alpha.181",
3
+ "version": "1.0.0-alpha.183",
4
4
  "description": "Schema & query lints (splinter-style advisors) for Lunora, feeding the Studio Advisors view",
5
5
  "keywords": [
6
6
  "advisor",
@@ -46,8 +46,8 @@
46
46
  "access": "public"
47
47
  },
48
48
  "dependencies": {
49
- "@lunora/errors": "1.0.0-alpha.49",
50
- "@lunora/server": "1.0.0-alpha.170"
49
+ "@lunora/errors": "1.0.0-alpha.50",
50
+ "@lunora/server": "1.0.0-alpha.172"
51
51
  },
52
52
  "engines": {
53
53
  "node": "^22.15.0 || >=24.11.0"