oracular 0.13.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.
@@ -26,8 +26,8 @@ interface Prediction {
26
26
  revealedAt: number | null;
27
27
  /**
28
28
  * When the current suppression ends: the later of the reveal cooldown (after `markRevealed`)
29
- * and the outcome cooldown (after the outcome event) still running at `at`, or null when
30
- * neither is. `shouldReveal` is false while this is non-null.
29
+ * and the outcome cooldown (`outcomeCooldown` after the outcome event) still running at `at`,
30
+ * or null when neither is. `shouldReveal` is false while this is non-null.
31
31
  */
32
32
  suppressedUntil: number | null;
33
33
  }
package/dist/inspect.d.ts CHANGED
@@ -26,8 +26,8 @@ interface Prediction {
26
26
  revealedAt: number | null;
27
27
  /**
28
28
  * When the current suppression ends: the later of the reveal cooldown (after `markRevealed`)
29
- * and the outcome cooldown (after the outcome event) still running at `at`, or null when
30
- * neither is. `shouldReveal` is false while this is non-null.
29
+ * and the outcome cooldown (`outcomeCooldown` after the outcome event) still running at `at`,
30
+ * or null when neither is. `shouldReveal` is false while this is non-null.
31
31
  */
32
32
  suppressedUntil: number | null;
33
33
  }
@@ -14,6 +14,13 @@ interface RevealOptions {
14
14
  z?: number;
15
15
  /** How long after `markRevealed` the intent stays revealed and `shouldReveal` is false. Default: the intent's `halfLife`. */
16
16
  cooldown?: number;
17
+ /**
18
+ * How long after the intent's outcome event `shouldReveal` stays false. Default: `cooldown`.
19
+ * 0 is allowed: the outcome then pauses nothing, while a reveal still starts its cooldown, for
20
+ * an intent whose outcome recurs within minutes, or a "stuck" intent whose help should be back
21
+ * at the next attempt.
22
+ */
23
+ outcomeCooldown?: number;
17
24
  /**
18
25
  * How `lower` is computed. `'normal'` (default): p − z·sd, clamped to [0, 1]. `'exact'`: the
19
26
  * Beta distribution's own quantile at the same one-sided level, Φ(−z), so `z` keeps its
@@ -62,6 +69,18 @@ interface IntentConfig {
62
69
  * weight.
63
70
  */
64
71
  saturate?: boolean;
72
+ /**
73
+ * Each outcome is an episode of its own for this intent, rather than the session. After the
74
+ * outcome arrives, the intent's bookkeeping starts over: a later outcome in the same session
75
+ * counts as another episode even with nothing seen since, and signals seen after an outcome
76
+ * take a miss at the session's close (or wait under `attribution`), as a first attempt would.
77
+ * Default false: the episode is the session, a repeated outcome with nothing seen since counts
78
+ * nothing, and signals seen after an outcome are neutral at the close. For intents shaped as
79
+ * attempts (an upload that fails, then completes, then completes again), where the second
80
+ * attempt is the contrast learning needs. With it set, a duplicated outcome event counts twice:
81
+ * dedupe such events in the app.
82
+ */
83
+ episodePerOutcome?: boolean;
65
84
  /**
66
85
  * How long a closed episode's signals wait for the outcome before they take a miss, in the same
67
86
  * unit as `at`. With it set, an episode that ends without the outcome is held instead of
package/dist/presets.d.ts CHANGED
@@ -14,6 +14,13 @@ interface RevealOptions {
14
14
  z?: number;
15
15
  /** How long after `markRevealed` the intent stays revealed and `shouldReveal` is false. Default: the intent's `halfLife`. */
16
16
  cooldown?: number;
17
+ /**
18
+ * How long after the intent's outcome event `shouldReveal` stays false. Default: `cooldown`.
19
+ * 0 is allowed: the outcome then pauses nothing, while a reveal still starts its cooldown, for
20
+ * an intent whose outcome recurs within minutes, or a "stuck" intent whose help should be back
21
+ * at the next attempt.
22
+ */
23
+ outcomeCooldown?: number;
17
24
  /**
18
25
  * How `lower` is computed. `'normal'` (default): p − z·sd, clamped to [0, 1]. `'exact'`: the
19
26
  * Beta distribution's own quantile at the same one-sided level, Φ(−z), so `z` keeps its
@@ -62,6 +69,18 @@ interface IntentConfig {
62
69
  * weight.
63
70
  */
64
71
  saturate?: boolean;
72
+ /**
73
+ * Each outcome is an episode of its own for this intent, rather than the session. After the
74
+ * outcome arrives, the intent's bookkeeping starts over: a later outcome in the same session
75
+ * counts as another episode even with nothing seen since, and signals seen after an outcome
76
+ * take a miss at the session's close (or wait under `attribution`), as a first attempt would.
77
+ * Default false: the episode is the session, a repeated outcome with nothing seen since counts
78
+ * nothing, and signals seen after an outcome are neutral at the close. For intents shaped as
79
+ * attempts (an upload that fails, then completes, then completes again), where the second
80
+ * attempt is the contrast learning needs. With it set, a duplicated outcome event counts twice:
81
+ * dedupe such events in the app.
82
+ */
83
+ episodePerOutcome?: boolean;
65
84
  /**
66
85
  * How long a closed episode's signals wait for the outcome before they take a miss, in the same
67
86
  * unit as `at`. With it set, an episode that ends without the outcome is held instead of
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "oracular",
3
- "version": "0.13.0",
3
+ "version": "0.15.0",
4
4
  "description": "On-device intent engine. Your app learns when the user is ready. Nothing leaves the device.",
5
5
  "keywords": [
6
6
  "oracular",
@@ -91,6 +91,10 @@
91
91
  "type": "boolean",
92
92
  "description": "Repeats of a signal within one episode add less. Default: true when episodeTimeout is set, false otherwise."
93
93
  },
94
+ "episodePerOutcome": {
95
+ "type": "boolean",
96
+ "description": "Each outcome is an episode of its own for this intent: a later outcome in the same session counts as another episode even with nothing seen since, and signals seen after an outcome take a miss at the session's close. Default false: the episode is the session."
97
+ },
94
98
  "attribution": {
95
99
  "$ref": "#/$defs/duration",
96
100
  "description": "How long a closed episode's signals wait for the outcome before they take a miss. An outcome inside the window credits each waiting episode by 2^(−age / halfLife). Unset: a miss at once when the episode ends."
@@ -120,7 +124,12 @@
120
124
  "cooldown": {
121
125
  "type": "number",
122
126
  "minimum": 0,
123
- "description": "How long after a reveal or the outcome the intent stays quiet. Default: the intent's halfLife."
127
+ "description": "How long after a reveal the intent stays quiet. Default: the intent's halfLife. Also the pause after the outcome unless outcomeCooldown is set."
128
+ },
129
+ "outcomeCooldown": {
130
+ "type": "number",
131
+ "minimum": 0,
132
+ "description": "How long after the outcome event the intent stays quiet. Default: cooldown. 0 lets the outcome pause nothing while a reveal still starts its cooldown."
124
133
  },
125
134
  "bound": {
126
135
  "type": "string",