@roarkanalytics/sdk 4.7.0 → 4.8.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.
@@ -259,6 +259,19 @@ export namespace SimulationRunPlanJobGetByIDResponse {
259
259
  */
260
260
  startedAt?: string | null;
261
261
 
262
+ /**
263
+ * For a run that swept a property (accent, background noise, speech pace and so
264
+ * on): which check failures the property caused.
265
+ *
266
+ * Each value is compared with every other value combined using a one-sided Fisher
267
+ * exact test, and every comparison in the run is corrected together with
268
+ * Benjamini-Hochberg. A value is only called worse when the difference is
269
+ * statistically significant, so a value that happened to fail a few more
270
+ * simulations by chance is not reported as a problem. Invalidated simulations and
271
+ * simulations that failed on the Roark platform are left out.
272
+ */
273
+ sweepAttribution?: Data.SweepAttribution | null;
274
+
262
275
  /**
263
276
  * Pass/fail verdict for the run, judged against the success criteria pinned on the
264
277
  * run plan when the run started.
@@ -673,6 +686,195 @@ export namespace SimulationRunPlanJobGetByIDResponse {
673
686
  }
674
687
  }
675
688
 
689
+ /**
690
+ * For a run that swept a property (accent, background noise, speech pace and so
691
+ * on): which check failures the property caused.
692
+ *
693
+ * Each value is compared with every other value combined using a one-sided Fisher
694
+ * exact test, and every comparison in the run is corrected together with
695
+ * Benjamini-Hochberg. A value is only called worse when the difference is
696
+ * statistically significant, so a value that happened to fail a few more
697
+ * simulations by chance is not reported as a problem. Invalidated simulations and
698
+ * simulations that failed on the Roark platform are left out.
699
+ */
700
+ export interface SweepAttribution {
701
+ /**
702
+ * Plain sentences on what this run could not see, ready to show to a reader.
703
+ */
704
+ caveats: Array<string>;
705
+
706
+ /**
707
+ * Every check the run was graded on: `PROPERTY_ATTRIBUTABLE` first, then
708
+ * `FOUND_UNATTRIBUTED`, then `WITHIN_NOISE`.
709
+ */
710
+ checks: Array<SweepAttribution.Check>;
711
+
712
+ /**
713
+ * The Benjamini-Hochberg false discovery rate the comparisons are held to.
714
+ */
715
+ falseDiscoveryRate: number;
716
+
717
+ /**
718
+ * The overall failure rate, 0-100, at which a check with no standout value is
719
+ * reported as `FOUND_UNATTRIBUTED`.
720
+ */
721
+ foundUnattributedFailureRate: number;
722
+
723
+ /**
724
+ * Counted simulations a value needs before it is compared.
725
+ */
726
+ minArmCalls: number;
727
+
728
+ /**
729
+ * Roughly how many percentage points more often a value would need to fail than
730
+ * the rest of the run to be flagged at this sample size. Optimistic: it uses
731
+ * simulation counts rather than the verdicts on each check and ignores the
732
+ * correction, so checks graded on fewer simulations need larger gaps. Large when
733
+ * few simulations ran per value: finding no significant difference then means the
734
+ * run could not see one, not that none exists.
735
+ */
736
+ minimumDetectableGap: number | null;
737
+
738
+ /**
739
+ * How many values had enough counted simulations to be compared.
740
+ */
741
+ testableValueCount: number;
742
+
743
+ /**
744
+ * How many value and check pairs were actually tested. A value can have enough
745
+ * simulations and still go untested (no other value graded that check, or too few
746
+ * verdicts on it). When this is 0 no comparison ran, so an empty `worseValues`
747
+ * everywhere means nothing was tested, not that no value did worse.
748
+ */
749
+ testedComparisonCount: number;
750
+
751
+ /**
752
+ * Every value of the swept property, baseline first.
753
+ */
754
+ values: Array<SweepAttribution.Value>;
755
+ }
756
+
757
+ export namespace SweepAttribution {
758
+ /**
759
+ * How one check's failures relate to the swept property.
760
+ */
761
+ export interface Check {
762
+ /**
763
+ * How this check relates to the swept property:
764
+ *
765
+ * - `PROPERTY_ATTRIBUTABLE`: at least one value failed it significantly more often
766
+ * than every other value combined. `worseValues` names them. This is the only
767
+ * case in which a value is called worse.
768
+ * - `FOUND_UNATTRIBUTED`: no value stands out, but the check failed on at least
769
+ * `foundUnattributedFailureRate`% of counted simulations overall. A real issue
770
+ * with the agent on which no value stood out, so the run cannot tie it to the
771
+ * property. It does not show the property had no effect: a small run may be
772
+ * unable to see one.
773
+ * - `WITHIN_NOISE`: neither. Any differences between values are within what chance
774
+ * produces.
775
+ */
776
+ attribution: 'PROPERTY_ATTRIBUTABLE' | 'FOUND_UNATTRIBUTED' | 'WITHIN_NOISE';
777
+
778
+ evaluated: number;
779
+
780
+ failed: number;
781
+
782
+ /**
783
+ * Share of counted simulations across every value that failed the check, 0-100.
784
+ */
785
+ failureRate: number | null;
786
+
787
+ metricDefinitionId: string;
788
+
789
+ metricName: string;
790
+
791
+ /**
792
+ * The values significantly worse than the rest, most significant first. Empty
793
+ * unless `attribution` is `PROPERTY_ATTRIBUTABLE`.
794
+ */
795
+ worseValues: Array<Check.WorseValue>;
796
+ }
797
+
798
+ export namespace Check {
799
+ /**
800
+ * A value that failed a check significantly more often than the rest of the run.
801
+ */
802
+ export interface WorseValue {
803
+ /**
804
+ * How likely a difference at least this large would be by chance alone, after
805
+ * correcting for every comparison in the run (Benjamini-Hochberg). The value is
806
+ * called worse only when this is at most `falseDiscoveryRate`.
807
+ */
808
+ adjustedPValue: number;
809
+
810
+ evaluated: number;
811
+
812
+ failed: number;
813
+
814
+ /**
815
+ * Share of the counted simulations at this value that failed the check, 0-100.
816
+ */
817
+ failureRate: number | null;
818
+
819
+ label: string;
820
+
821
+ /**
822
+ * The same share across every other value combined, 0-100. This is what the value
823
+ * is compared with.
824
+ */
825
+ restFailureRate: number | null;
826
+
827
+ value: string;
828
+ }
829
+ }
830
+
831
+ /**
832
+ * One value of the swept property.
833
+ */
834
+ export interface Value {
835
+ /**
836
+ * Simulations run at this value. Simulations that failed on the Roark platform are
837
+ * left out, since they say nothing about your agent.
838
+ */
839
+ attempted: number;
840
+
841
+ /**
842
+ * Simulations that actually tested the property: not invalidated, and graded by at
843
+ * least one check. Only these are used in the comparison.
844
+ */
845
+ counted: number;
846
+
847
+ /**
848
+ * Whether this is the baseline the plan named.
849
+ */
850
+ isBaseline: boolean;
851
+
852
+ /**
853
+ * The value in words, e.g. `American`.
854
+ */
855
+ label: string;
856
+
857
+ /**
858
+ * The mean of each check's pass rate at this value, 0-100, the same rule as the
859
+ * run's `score`. Descriptive only: a lower score alone never makes a value worse.
860
+ * Null when nothing counted.
861
+ */
862
+ score: number | null;
863
+
864
+ /**
865
+ * Whether this value had at least `minArmCalls` counted simulations. A value below
866
+ * that is "insufficient data": it is reported with its numbers but never compared
867
+ * or ranked, because a rate from one or two calls cannot be told apart from luck.
868
+ */
869
+ testable: boolean;
870
+
871
+ /**
872
+ * The stored value of the swept property, e.g. `US`.
873
+ */
874
+ value: string;
875
+ }
876
+ }
877
+
676
878
  /**
677
879
  * Pass/fail verdict for the run, judged against the success criteria pinned on the
678
880
  * run plan when the run started.
@@ -139,9 +139,11 @@ export namespace SimulationRunPlanCreateResponse {
139
139
  agentEndpoints: Array<RunPlan.AgentEndpoint>;
140
140
 
141
141
  /**
142
- * The value of `comparisonProperty` every other value is measured against, such as
143
- * `NONE` for `BACKGROUND_NOISE`. `null` when no comparison is declared, or when
144
- * the property has no obvious norm and none was chosen.
142
+ * The reference value of `comparisonProperty`, such as `NONE` for
143
+ * `BACKGROUND_NOISE`: shown first in the results. Whether a value did
144
+ * significantly worse does not depend on it: that is decided against every other
145
+ * value combined (see `sweepAttribution`). `null` when no comparison is declared,
146
+ * or when the property has no obvious norm and none was chosen.
145
147
  */
146
148
  comparisonBaseline: string | null;
147
149
 
@@ -491,9 +493,11 @@ export namespace SimulationRunPlanUpdateResponse {
491
493
  agentEndpoints: Array<Data.AgentEndpoint>;
492
494
 
493
495
  /**
494
- * The value of `comparisonProperty` every other value is measured against, such as
495
- * `NONE` for `BACKGROUND_NOISE`. `null` when no comparison is declared, or when
496
- * the property has no obvious norm and none was chosen.
496
+ * The reference value of `comparisonProperty`, such as `NONE` for
497
+ * `BACKGROUND_NOISE`: shown first in the results. Whether a value did
498
+ * significantly worse does not depend on it: that is decided against every other
499
+ * value combined (see `sweepAttribution`). `null` when no comparison is declared,
500
+ * or when the property has no obvious norm and none was chosen.
497
501
  */
498
502
  comparisonBaseline: string | null;
499
503
 
@@ -807,9 +811,11 @@ export namespace SimulationRunPlanListResponse {
807
811
  agentEndpoints: Array<Data.AgentEndpoint>;
808
812
 
809
813
  /**
810
- * The value of `comparisonProperty` every other value is measured against, such as
811
- * `NONE` for `BACKGROUND_NOISE`. `null` when no comparison is declared, or when
812
- * the property has no obvious norm and none was chosen.
814
+ * The reference value of `comparisonProperty`, such as `NONE` for
815
+ * `BACKGROUND_NOISE`: shown first in the results. Whether a value did
816
+ * significantly worse does not depend on it: that is decided against every other
817
+ * value combined (see `sweepAttribution`). `null` when no comparison is declared,
818
+ * or when the property has no obvious norm and none was chosen.
813
819
  */
814
820
  comparisonBaseline: string | null;
815
821
 
@@ -1151,9 +1157,11 @@ export namespace SimulationRunPlanGetByIDResponse {
1151
1157
  agentEndpoints: Array<Data.AgentEndpoint>;
1152
1158
 
1153
1159
  /**
1154
- * The value of `comparisonProperty` every other value is measured against, such as
1155
- * `NONE` for `BACKGROUND_NOISE`. `null` when no comparison is declared, or when
1156
- * the property has no obvious norm and none was chosen.
1160
+ * The reference value of `comparisonProperty`, such as `NONE` for
1161
+ * `BACKGROUND_NOISE`: shown first in the results. Whether a value did
1162
+ * significantly worse does not depend on it: that is decided against every other
1163
+ * value combined (see `sweepAttribution`). `null` when no comparison is declared,
1164
+ * or when the property has no obvious norm and none was chosen.
1157
1165
  */
1158
1166
  comparisonBaseline: string | null;
1159
1167
 
@@ -1477,9 +1485,11 @@ export interface SimulationRunPlanCreateParams {
1477
1485
  autoRun?: boolean;
1478
1486
 
1479
1487
  /**
1480
- * The value of `comparisonProperty` every other value is measured against, for
1481
- * example `NONE` for `BACKGROUND_NOISE` or `NORMAL` for `SPEECH_PACE`. Must be a
1482
- * value that property can take.
1488
+ * The reference value of `comparisonProperty`, for example `NONE` for
1489
+ * `BACKGROUND_NOISE` or `NORMAL` for `SPEECH_PACE`: shown first in the results.
1490
+ * Must be a value that property can take. Whether a value did significantly worse
1491
+ * does not depend on it: that is decided against every other value combined (see
1492
+ * `sweepAttribution`).
1483
1493
  *
1484
1494
  * Stored rather than assumed, so the report can say "compared against US accent"
1485
1495
  * instead of implying Roark decided which value is normal. Most properties have an
@@ -1810,7 +1820,7 @@ export interface SimulationRunPlanUpdateParams {
1810
1820
  agentEndpoints?: Array<SimulationRunPlanUpdateParams.AgentEndpoint>;
1811
1821
 
1812
1822
  /**
1813
- * The value every other value is measured against. See `POST /v1/simulation/plan`.
1823
+ * The reference value, shown first in the results. See `POST /v1/simulation/plan`.
1814
1824
  *
1815
1825
  * A real value cannot be sent on its own: the property it belongs to decides which
1816
1826
  * values are legal, and an omitted property means "leave unchanged", which this
@@ -210,9 +210,10 @@ export namespace SimulationTemplateListResponse {
210
210
  */
211
211
  export interface Sweep {
212
212
  /**
213
- * The value the others are measured against, resolved to what a plan built from
214
- * this template will actually record. `null` when the property has no obvious
215
- * norm, and the report then compares against the best-performing value instead.
213
+ * The reference value, shown first in the results, resolved to what a plan built
214
+ * from this template will actually record. `null` when the property has no obvious
215
+ * norm. It does not change the verdict: each value is compared with every other
216
+ * value combined.
216
217
  */
217
218
  baseline: string | null;
218
219
 
@@ -276,9 +276,11 @@ export declare namespace SimulationRunParams {
276
276
  metrics: Array<Plan.Metric>;
277
277
 
278
278
  /**
279
- * The value of `comparisonProperty` every other value is measured against, for
280
- * example `NONE` for `BACKGROUND_NOISE` or `NORMAL` for `SPEECH_PACE`. Must be a
281
- * value that property can take.
279
+ * The reference value of `comparisonProperty`, for example `NONE` for
280
+ * `BACKGROUND_NOISE` or `NORMAL` for `SPEECH_PACE`: shown first in the results.
281
+ * Must be a value that property can take. Whether a value did significantly worse
282
+ * does not depend on it: that is decided against every other value combined (see
283
+ * `sweepAttribution`).
282
284
  *
283
285
  * Stored rather than assumed, so the report can say "compared against US accent"
284
286
  * instead of implying Roark decided which value is normal. Most properties have an
@@ -734,8 +736,10 @@ export declare namespace SimulationRunParams {
734
736
  template: string;
735
737
 
736
738
  /**
737
- * The value of the sweep every other value is measured against. Defaults to the
738
- * template's own baseline, as returned by GET /v1/simulation/template.
739
+ * The sweep's reference value, shown first in the results. Defaults to the
740
+ * template's own baseline, as returned by GET /v1/simulation/template. Whether a
741
+ * value did significantly worse does not depend on it: that is decided against
742
+ * every other value combined.
739
743
  *
740
744
  * Send it with `comparisonValues` and it must be one of them, or the request is
741
745
  * rejected: anchoring every difference to an arm the run never made would measure
@@ -802,7 +806,9 @@ export declare namespace SimulationRunParams {
802
806
  flows?: Array<RunSimulationFromTemplate.Flow>;
803
807
 
804
808
  /**
805
- * Number of iterations to run for each test case (1-10000)
809
+ * Runs per test case (1-10000). Defaults to 1, or to 6 for a template that sweeps
810
+ * a property. A sweep needs at least 5 calls per value (test cases per value times
811
+ * iterations) to compare its values, and a lower count is refused with 400.
806
812
  */
807
813
  iterationCount?: number;
808
814
 
package/src/version.ts CHANGED
@@ -1 +1 @@
1
- export const VERSION = '4.7.0'; // x-release-please-version
1
+ export const VERSION = '4.8.0'; // x-release-please-version
package/version.d.mts CHANGED
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "4.7.0";
1
+ export declare const VERSION = "4.8.0";
2
2
  //# sourceMappingURL=version.d.mts.map
package/version.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "4.7.0";
1
+ export declare const VERSION = "4.8.0";
2
2
  //# sourceMappingURL=version.d.ts.map
package/version.js CHANGED
@@ -1,5 +1,5 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.VERSION = void 0;
4
- exports.VERSION = '4.7.0'; // x-release-please-version
4
+ exports.VERSION = '4.8.0'; // x-release-please-version
5
5
  //# sourceMappingURL=version.js.map
package/version.mjs CHANGED
@@ -1,2 +1,2 @@
1
- export const VERSION = '4.7.0'; // x-release-please-version
1
+ export const VERSION = '4.8.0'; // x-release-please-version
2
2
  //# sourceMappingURL=version.mjs.map