daishi-sdk 0.2.21 → 0.2.22

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.
@@ -19,7 +19,7 @@ export interface ErrorBody {
19
19
  /** On 401 and 403: where the developer docs are. */
20
20
  docs?: string;
21
21
  }
22
- /** A run record. Null fields fill in as the run launches, plays and ends. `resumes` lists every time a new server release picked the run up mid-match (oldest first, with the round the world was at): the world and the meter carried over, each seat’s own memory of the earlier rounds did not, so a resumed run is a different condition from one played in one release; the match archive carries the same list under `config.run.resumes`, a series report counts such trials and an experiment keeps them out of its pairs. */
22
+ /** A run record. Null fields fill in as the run launches, plays and ends. `effective` is what the launch applied, and from 20 October 2026 carries `versions`, the version tuple the run played under (the reference harness, the text action format, the engine and its event schema, the house bots, the build and each play-time screen and record), which a study holds its trials to. `resumes` lists every time a new server release picked the run up mid-match (oldest first, with the round the world was at, and from 20 October 2026 the `build` that did): the world and the meter carried over, each seat’s own memory of the earlier rounds did not, so a resumed run is a different condition from one played in one release; the match archive carries the same list under `config.run.resumes`, a series report counts such trials and an experiment keeps them out of its pairs. */
23
23
  export interface Run {
24
24
  run_id: string;
25
25
  name: string;
@@ -112,6 +112,7 @@ export interface BatchReport {
112
112
  points: BatchReportPoint[];
113
113
  precision: BatchReportPrecision;
114
114
  rubric: string | null;
115
+ versions: ReadingTuple;
115
116
  cost: Cost;
116
117
  verdict: string;
117
118
  }
@@ -143,6 +144,7 @@ export interface Experiment {
143
144
  verdict: string | null;
144
145
  callback_url: string | null;
145
146
  replicates: StudyRerun | null;
147
+ equivalence_margin: number | null;
146
148
  note: string | null;
147
149
  note_at_ms: number | null;
148
150
  notes?: ExperimentNoteEntry[];
@@ -189,6 +191,7 @@ export interface ExperimentReport {
189
191
  what_differed: ExperimentReportWhatDiffered[];
190
192
  replication: Replication | null;
191
193
  reruns: RerunTally | null;
194
+ versions: ReadingTuple;
192
195
  cost: Cost;
193
196
  note: string | null;
194
197
  note_at_ms: number | null;
@@ -299,11 +302,13 @@ export interface ExperimentBody {
299
302
  callback_url?: string;
300
303
  /** The design document, as text (markdown or plain): what you predict, which result you will read and how, and what would change your view. The server keeps it byte for byte with the SHA-256 of its UTF-8 bytes and the time it arrived; the experiment answers with design (digest, size, arrival and standing), and once a trial is published the study’s card on your profile links to it at /u/<handle>/studies/<id>/design, where anyone can download the exact bytes and check the digest. Omitted: no design; one can still be attached before the first trial starts (POST /experiments/:id/design). */
301
304
  design?: string;
302
- /** Re-run a published study: its experiment id (exp_..., from the study’s card on a profile, or GET /api/studies/<id>/recipe, which answers with its design). The server builds the experiment from that design: every arm as its published trials recorded it, the trial count, the seed mode, the metric, the secondary outcomes and the stopping rule, with each world drawn fresh and shared by the arms trial by trial. The body therefore carries none of the study’s settings, only name, max_spend_usd, callback_url and, if you wrote one, your own design document for the re-run; a setting of the study (arms, trials, seed_mode, metric, secondary_metrics, stopping, target_half_width, aa_check) beside replicates answers bad_replicates. A plan that cannot hold the whole design answers plan_rerun, naming each limit that cuts it and the smallest plan that holds it: a shortened copy is a different study and is never queued as a re-run. Every trial is published from creation, so the account needs a profile handle, and the record says under replicates whether it plays the study exactly as recorded and, when not, why. Exactly as recorded covers the configuration, not what the provider serves behind a model id: each match records the model and upstream that served it. */
305
+ /** Re-run a published study: its experiment id (exp_..., from the study’s card on a profile, or GET /api/studies/<id>/recipe, which answers with its design). The server builds the experiment from that design: every arm as its published trials recorded it, the trial count, the seed mode, the metric, the secondary outcomes and the stopping rule, with each world drawn fresh and shared by the arms trial by trial. The body therefore carries none of the study’s settings, only name, max_spend_usd, equivalence_margin, callback_url and, if you wrote one, your own design document for the re-run; a setting of the study (arms, trials, seed_mode, metric, secondary_metrics, stopping, target_half_width, aa_check) beside replicates answers bad_replicates. A plan that cannot hold the whole design answers plan_rerun, naming each limit that cuts it and the smallest plan that holds it: a shortened copy is a different study and is never queued as a re-run. Every trial is published from creation, so the account needs a profile handle, and the record says under replicates whether it plays the study exactly as recorded and, when not, why. Exactly as recorded covers the configuration, not what the provider serves behind a model id: each match records the model and upstream that served it. */
303
306
  replicates?: string;
307
+ /** With replicates only: the margin the re-run declares, before its first trial, for its reading beside the study it re-runs, on the metric’s analysis scale (index points for the Fitness Index, a fraction for a share, so 0.05 is 5 points, log units for output per turn, so 0.05 is about 5%), positive and at most 100. Each comparison then gets an equivalence check (TOST): whether the 90% Welch interval on the gap between the two studies lies inside plus or minus the margin, the one way a reading says there is no measured difference between them within it, across version tuples or not. Fixed at creation and kept in the witnessed creation record; it cannot be set or changed later, since a margin chosen after the data proves nothing. Without it a re-run is read with Welch’s interval alone. */
308
+ equivalence_margin?: number;
304
309
  /** With replicates only: the spend cap of each arm in USD, clamped to the plan’s range (default the plan’s own). The original’s caps were its owner’s and are not carried. An ordinary experiment sets a cap on each arm instead. */
305
310
  max_spend_usd?: number;
306
- /** The declared read: how many trials a comparison may lose before it reads incomplete and renders no verdict. A trial is lost when an arm’s trial failed or was cancelled, lost a seat to an error, stopped short of its season at its spend cap, was picked up mid-match by a new server release, or measured nothing on the metric. No lost trial is ever replaced and no trial is added: the design plays the trials it declared and reads what it has. From 0 up to the trials less three, the pairs a verdict needs (bad_loss_tolerance otherwise). Default: a tenth of the trials, rounded down. The experiment and its report carry it as loss_tolerance and print it in rule_text; a comparison past it reads reason incomplete with verdict null, and every comparison carries lost and, with lost pairs, tipping. */
311
+ /** The declared read: how many trials a comparison may lose before it reads incomplete and renders no verdict. A trial is lost when an arm’s trial failed or was cancelled, lost a seat to an error, stopped short of its season at its spend cap, was picked up mid-match by a new server release, played under another version tuple than the study’s first trial, or measured nothing on the metric. No lost trial is ever replaced and no trial is added: the design plays the trials it declared and reads what it has. From 0 up to the trials less three, the pairs a verdict needs (bad_loss_tolerance otherwise). Default: a tenth of the trials, rounded down. The experiment and its report carry it as loss_tolerance and print it in rule_text; a comparison past it reads reason incomplete with verdict null, and every comparison carries lost and, with lost pairs, tipping. */
307
312
  loss_tolerance?: number;
308
313
  /** The study’s spend cap in USD over every arm and trial, declared now. Once the trials played so far have spent it, nothing still in line starts: what is left is cancelled under the cap (never as your doing) and the experiment ends with stop_reason spend_cap; a trial already playing runs to its own per-run cap. The trials it stops count as lost against loss_tolerance. At least 0.5 (bad_spend_cap otherwise). Default none: each arm’s own max_spend_usd still bounds each trial. */
309
314
  max_total_spend_usd?: number;
@@ -643,6 +648,7 @@ export interface RunExperiment {
643
648
  export interface RunResume {
644
649
  at_ms: number;
645
650
  tick: number;
651
+ build?: string | null;
646
652
  }
647
653
  export interface RunLive {
648
654
  phase: string;
@@ -740,6 +746,7 @@ export interface BatchReportPoint {
740
746
  match_id: string | null;
741
747
  frame: 'monitored' | 'neutral' | null;
742
748
  resumed_at: number[];
749
+ other_version: boolean;
743
750
  agents: BatchReportPointAgent[] | null;
744
751
  }
745
752
  export interface BatchReportPointAgent {
@@ -760,6 +767,33 @@ export interface BatchReportPrecision {
760
767
  target: number;
761
768
  trials_for_target: number | null;
762
769
  }
770
+ export interface ReadingTuple {
771
+ play: PlayVersions | null;
772
+ rubric: string | null;
773
+ analysis: string;
774
+ extractor: string | null;
775
+ other_trials: number;
776
+ text: string;
777
+ }
778
+ export interface PlayVersions {
779
+ harness: string;
780
+ actions: string;
781
+ engine: string;
782
+ events: number;
783
+ anchors: string;
784
+ build: string | null;
785
+ screens: PlayScreens;
786
+ }
787
+ export interface PlayScreens {
788
+ awareness_scan: string;
789
+ awareness_probe: string;
790
+ interactions: string;
791
+ ledger: string;
792
+ probes: string;
793
+ exploration: string;
794
+ seat_counts: string;
795
+ payloads: string;
796
+ }
763
797
  export interface Cost {
764
798
  total_usd: number;
765
799
  agent_turns: number;
@@ -1050,6 +1084,8 @@ export interface Replication {
1050
1084
  original: ReplicationOriginal;
1051
1085
  state: 'read' | 'playing' | 'incomplete' | 'cancelled' | 'unpublished' | 'original_open';
1052
1086
  comparisons: StudyDifference[];
1087
+ versions: ReplicationVersions | null;
1088
+ equivalence_margin: number | null;
1053
1089
  text: string;
1054
1090
  }
1055
1091
  export interface ReplicationOriginal {
@@ -1069,6 +1105,7 @@ export interface StudyDifference {
1069
1105
  difference: number | null;
1070
1106
  interval: WelchInterval | null;
1071
1107
  apart: boolean | null;
1108
+ equivalence: EquivalenceCheck | null;
1072
1109
  text: string;
1073
1110
  }
1074
1111
  export interface StudyUnits {
@@ -1082,6 +1119,18 @@ export interface WelchInterval {
1082
1119
  level: number;
1083
1120
  df: number;
1084
1121
  }
1122
+ export interface EquivalenceCheck {
1123
+ margin: number;
1124
+ lo: number;
1125
+ hi: number;
1126
+ level: number;
1127
+ p: number;
1128
+ within: boolean;
1129
+ }
1130
+ export interface ReplicationVersions {
1131
+ same: boolean;
1132
+ differences: string[];
1133
+ }
1085
1134
  export interface RerunTally {
1086
1135
  reruns: RerunEntry[];
1087
1136
  counted: number;
@@ -1101,6 +1150,7 @@ export interface RerunEntry {
1101
1150
  exact: boolean;
1102
1151
  state: 'read' | 'playing' | 'incomplete' | 'cancelled' | 'unpublished' | 'original_open';
1103
1152
  apart: boolean | null;
1153
+ versions_differ: boolean | null;
1104
1154
  comparisons: StudyDifference[];
1105
1155
  }
1106
1156
  /** One setup of a run set: how many runs are filed under it and the series batches among them, the harness versions their seats registered under (a set may span versions; nothing is pooled across them), when the earliest run ever filed under it started its match (a run moved out does not raise it), its design, and its counts summed over its runs (null while none carries one; `uncounted` runs whose match could not be read add nothing). */
package/dist/index.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import { Operations, type ErrorCode, type GetBatchResponse, type GetExperimentResponse, type GetRunResponse, type Method, type RequestParts } from './generated.js';
2
2
  export * from './generated.js';
3
- export declare const VERSION = "0.2.21";
3
+ export declare const VERSION = "0.2.22";
4
4
  export declare const DEFAULT_BASE_URL = "https://daishi.ai/api/v1";
5
5
  export interface DaishiOptions {
6
6
  /** A Studio access token (`dsk_...`). Default: the `DAISHI_TOKEN` environment variable. */
package/dist/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { Operations } from './generated.js';
2
2
  export * from './generated.js';
3
- export const VERSION = '0.2.21';
3
+ export const VERSION = '0.2.22';
4
4
  export const DEFAULT_BASE_URL = 'https://daishi.ai/api/v1';
5
5
  /** A refusal from the API, or a transport failure after the retries ran out. */
6
6
  export class DaishiError extends Error {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "daishi-sdk",
3
- "version": "0.2.21",
3
+ "version": "0.2.22",
4
4
  "description": "Typed client for the Daishi Studio API: scenarios, runs, series batches and paired experiments, with retries and waiting helpers.",
5
5
  "keywords": [
6
6
  "daishi",