@mongrov/analytics 0.20.0 → 0.22.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":"ziva.d.ts","sourceRoot":"","sources":["../../../src/rules/defaults/ziva.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,WAAW,CAAA;AA8SrC,eAAO,MAAM,YAAY,EAAE,IAAI,EAAyC,CAAA"}
1
+ {"version":3,"file":"ziva.d.ts","sourceRoot":"","sources":["../../../src/rules/defaults/ziva.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,WAAW,CAAA;AA2UrC,eAAO,MAAM,YAAY,EAAE,IAAI,EAAyC,CAAA"}
@@ -61,25 +61,18 @@ value = 300
61
61
  minGapMinutes = 1440
62
62
  maxPerDay = 1
63
63
 
64
- [[rule]]
65
- id = "ziva.stress-elevated-day"
66
- brand = "ziva"
67
- name = "Elevated stress today"
68
- description = "Daily average stress rose 1.5 standard deviations above the 14-day baseline."
69
- metric = "stress"
70
- window = "24h"
71
- aggregation = "avg"
72
- compare = "greater_than"
73
- severity = "info"
74
-
75
- [rule.target]
76
- type = "baseline_stddev"
77
- windowDays = 14
78
- stddevs = 1.5
79
-
80
- [rule.throttle]
81
- minGapMinutes = 1440
82
- maxPerDay = 1
64
+ # ziva.stress-elevated-day was RETIRED 2026-08-19.
65
+ #
66
+ # It fired on a single day's average 1.5 stddev above a 14-day baseline. D-E
67
+ # replaced that with ziva.stress-tense-days — +10 over the 30-day p50, held for
68
+ # two consecutive days choosing persistence over a single-day trigger on
69
+ # purpose. Keeping both meant two near-identical "above your usual" notices on
70
+ # day 2 of a tense stretch, which is the fatigue throttles exist to prevent.
71
+ #
72
+ # Its throttle keys (analytics:rule:ziva.stress-elevated-day:{userId}:*) are
73
+ # left in place. Nothing reads them once the rule is unregistered, so they are
74
+ # inert; a cleanup sweep can ride a future migration rather than being its own
75
+ # risk today.
83
76
 
84
77
  [[rule]]
85
78
  id = "ziva.low-activity-week"
@@ -303,6 +296,42 @@ direction = "above"
303
296
  [rule.throttle]
304
297
  minGapMinutes = 1440
305
298
  maxPerDay = 1
299
+
300
+ # ── Heart rate (D-G + HR slot table, 2026-08-19) ────────────────────────────
301
+ #
302
+ # High-only in v1: a low resting rate is usually fitness, and alerting on it
303
+ # would be wrong far more often than right.
304
+ #
305
+ # The rule is RESTING-GATED, which is what makes it safe to state an absolute
306
+ # number. 160 bpm on a run is not a finding; 105 bpm sitting still is. The gate
307
+ # is \`context = "resting"\` — no movement within +/-15 min — corrected in
308
+ # analytics 0.20.0 from an older form that would have dropped every sample on
309
+ # a device that only reports activity while the user moves.
310
+ #
311
+ # \`consecutive = 3\` at the 10-minute HR cadence is about half an hour of
312
+ # sustained elevation at rest, slot-adjacent, so a gap breaks the run.
313
+
314
+ [[rule]]
315
+ id = "ziva.hr-flag-level"
316
+ brand = "ziva"
317
+ name = "Resting heart rate stayed high"
318
+ description = "Resting heart rate at or above your flag level for three consecutive readings."
319
+ metric = "hr_bpm"
320
+ window = "24h"
321
+ aggregation = "avg"
322
+ compare = "greater_than_or_equal"
323
+ context = "resting"
324
+ consecutive = 3
325
+ severity = "warn"
326
+
327
+ [rule.target]
328
+ type = "user_setting"
329
+ key = "user:hrFlagLevel"
330
+ defaultValue = 100
331
+
332
+ [rule.throttle]
333
+ minGapMinutes = 60
334
+ maxPerDay = 3
306
335
  `;
307
336
  export const zivaDefaults = parseCatalog(TOML, { name: 'ziva' });
308
337
  //# sourceMappingURL=ziva.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"ziva.js","sourceRoot":"","sources":["../../../src/rules/defaults/ziva.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAGH,OAAO,EAAE,YAAY,EAAE,MAAM,UAAU,CAAA;AAEvC,MAAM,IAAI,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAySZ,CAAA;AAED,MAAM,CAAC,MAAM,YAAY,GAAW,YAAY,CAAC,IAAI,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC,CAAA"}
1
+ {"version":3,"file":"ziva.js","sourceRoot":"","sources":["../../../src/rules/defaults/ziva.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAGH,OAAO,EAAE,YAAY,EAAE,MAAM,UAAU,CAAA;AAEvC,MAAM,IAAI,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAsUZ,CAAA;AAED,MAAM,CAAC,MAAM,YAAY,GAAW,YAAY,CAAC,IAAI,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC,CAAA"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mongrov/analytics",
3
- "version": "0.20.0",
3
+ "version": "0.22.0",
4
4
  "sideEffects": false,
5
5
  "description": "DuckDB + R2 Iceberg local analytics for @mongrov apps",
6
6
  "license": "MIT",
@@ -61,7 +61,7 @@
61
61
  ],
62
62
  "peerDependencies": {
63
63
  "@modelcontextprotocol/sdk": ">=1.20.0",
64
- "@mongrov/types": "^0.6.0",
64
+ "@mongrov/types": "^0.8.0",
65
65
  "ai": ">=4",
66
66
  "react": ">=19",
67
67
  "react-native": ">=0.81",
@@ -107,8 +107,8 @@
107
107
  "typescript": "^5.9.3",
108
108
  "vitest": "^2.1.9",
109
109
  "zod": "^3.23.8",
110
- "@mongrov/types": "0.7.0",
111
- "@mongrov/db": "0.3.0"
110
+ "@mongrov/db": "0.3.0",
111
+ "@mongrov/types": "0.8.0"
112
112
  },
113
113
  "scripts": {
114
114
  "build": "tsc -p tsconfig.build.json",