@cultured_computer/sight 0.3.5 → 0.3.6
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 +14 -1
- package/dist/index.cjs +3 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +3 -0
- package/dist/index.js.map +1 -1
- package/package.json +5 -3
- package/schema/sight-record-v1.schema.json +227 -0
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cultured_computer/sight",
|
|
3
|
-
"version": "0.3.
|
|
4
|
-
"description": "
|
|
3
|
+
"version": "0.3.6",
|
|
4
|
+
"description": "A standard format for agent experience data: every turn, both sides \u2014 what the agent did, how the user responded, what followed \u2014 in one published schema, with behavioural measurements on top and no evals. Out of band; responses never touched.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"main": "./dist/index.cjs",
|
|
@@ -17,10 +17,12 @@
|
|
|
17
17
|
"types": "./dist/index.d.cts",
|
|
18
18
|
"default": "./dist/index.cjs"
|
|
19
19
|
}
|
|
20
|
-
}
|
|
20
|
+
},
|
|
21
|
+
"./schema/record-v1": "./schema/sight-record-v1.schema.json"
|
|
21
22
|
},
|
|
22
23
|
"files": [
|
|
23
24
|
"dist",
|
|
25
|
+
"schema",
|
|
24
26
|
"README.md",
|
|
25
27
|
"LICENSE"
|
|
26
28
|
],
|
|
@@ -0,0 +1,227 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://sight.cultured.computer/schema/sight-record-v1.schema.json",
|
|
4
|
+
"title": "Sight record v1 — one exported session (RLDS-shaped episode)",
|
|
5
|
+
"$comment": "The exact shape the self-serve export streams (application/x-ndjson: one episode per line). Source of truth is the export mapper (apps/dashboard/src/lib/rlds.ts); a lockstep test keeps this file and the mapper's output keys identical. Text fields carry the redacted record only (personal data is stripped at ingest, before storage); raw payloads never enter this shape. Envelope keys are fixed and strict; the four state payloads are deployment-specific and stay open. Nulls are honest absences, never zeros.",
|
|
6
|
+
"type": "object",
|
|
7
|
+
"additionalProperties": false,
|
|
8
|
+
"required": [
|
|
9
|
+
"episode_id",
|
|
10
|
+
"external_session_id",
|
|
11
|
+
"external_user_id",
|
|
12
|
+
"deployment",
|
|
13
|
+
"started_at",
|
|
14
|
+
"ended_at",
|
|
15
|
+
"ended_reason",
|
|
16
|
+
"turns_count",
|
|
17
|
+
"duration_ms",
|
|
18
|
+
"agent_id",
|
|
19
|
+
"experiment_id",
|
|
20
|
+
"environment_config_hash",
|
|
21
|
+
"environment_config_label",
|
|
22
|
+
"invalid",
|
|
23
|
+
"invalid_reason",
|
|
24
|
+
"steps"
|
|
25
|
+
],
|
|
26
|
+
"properties": {
|
|
27
|
+
"episode_id": { "type": "string", "description": "Sight's session id." },
|
|
28
|
+
"external_session_id": { "type": ["string", "null"], "description": "The caller's own session id, when supplied at capture." },
|
|
29
|
+
"external_user_id": { "type": ["string", "null"], "description": "The caller's stable user id — the key return behavior joins on." },
|
|
30
|
+
"deployment": { "type": "string", "description": "Deployment slug." },
|
|
31
|
+
"started_at": { "$ref": "#/$defs/timestamp" },
|
|
32
|
+
"ended_at": { "oneOf": [{ "$ref": "#/$defs/timestamp" }, { "type": "null" }] },
|
|
33
|
+
"ended_reason": { "type": ["string", "null"], "description": "Why the session ended (SDK-supplied wins; sweep fallback). Null while still open." },
|
|
34
|
+
"turns_count": { "type": "integer", "minimum": 0 },
|
|
35
|
+
"duration_ms": { "type": ["integer", "null"] },
|
|
36
|
+
"agent_id": { "type": ["string", "null"], "description": "Provenance: which agent served this session." },
|
|
37
|
+
"experiment_id": { "type": ["string", "null"], "description": "Provenance: designed-traffic tag; live aggregates exclude designed runs." },
|
|
38
|
+
"environment_config_hash": { "type": ["string", "null"], "description": "Provenance: hash of the serving configuration in force." },
|
|
39
|
+
"environment_config_label": { "type": ["string", "null"] },
|
|
40
|
+
"invalid": { "type": "boolean", "description": "Flag-don't-delete: questionable episodes export marked, never silently dropped." },
|
|
41
|
+
"invalid_reason": { "type": ["string", "null"] },
|
|
42
|
+
"steps": { "type": "array", "items": { "$ref": "#/$defs/step" } }
|
|
43
|
+
},
|
|
44
|
+
"$defs": {
|
|
45
|
+
"timestamp": {
|
|
46
|
+
"type": "string",
|
|
47
|
+
"description": "UTC, microsecond precision: YYYY-MM-DDTHH:MM:SS.ffffffZ",
|
|
48
|
+
"pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{6}Z$"
|
|
49
|
+
},
|
|
50
|
+
"step": {
|
|
51
|
+
"type": "object",
|
|
52
|
+
"description": "One turn: the fixed four-corner envelope (state / action / uptake / reward) around both actors' exchange.",
|
|
53
|
+
"additionalProperties": false,
|
|
54
|
+
"required": [
|
|
55
|
+
"turn_index",
|
|
56
|
+
"started_at",
|
|
57
|
+
"persona",
|
|
58
|
+
"is_first",
|
|
59
|
+
"is_terminal",
|
|
60
|
+
"truncated",
|
|
61
|
+
"discount",
|
|
62
|
+
"state",
|
|
63
|
+
"action",
|
|
64
|
+
"uptake",
|
|
65
|
+
"reward"
|
|
66
|
+
],
|
|
67
|
+
"properties": {
|
|
68
|
+
"turn_index": { "type": "integer", "minimum": 0 },
|
|
69
|
+
"started_at": { "$ref": "#/$defs/timestamp" },
|
|
70
|
+
"persona": { "type": ["string", "null"] },
|
|
71
|
+
"is_first": { "type": "boolean" },
|
|
72
|
+
"is_terminal": { "type": "boolean", "description": "Last step of a session that genuinely ended (natural close)." },
|
|
73
|
+
"truncated": { "type": "boolean", "description": "Last step of a session that stopped without ending (abandoned / timeout / crash). Distinct from is_terminal on purpose." },
|
|
74
|
+
"discount": { "type": "number" },
|
|
75
|
+
"state": { "$ref": "#/$defs/state" },
|
|
76
|
+
"action": { "$ref": "#/$defs/action" },
|
|
77
|
+
"uptake": { "$ref": "#/$defs/uptake" },
|
|
78
|
+
"reward": { "$ref": "#/$defs/reward" }
|
|
79
|
+
}
|
|
80
|
+
},
|
|
81
|
+
"state": {
|
|
82
|
+
"type": "object",
|
|
83
|
+
"description": "The situation the turn happened in. The three *_situation_state payloads are deployment-specific and machine-read; they stay open objects.",
|
|
84
|
+
"additionalProperties": false,
|
|
85
|
+
"required": ["situation_state", "agent_situation_state", "user_situation_state", "situation_type"],
|
|
86
|
+
"properties": {
|
|
87
|
+
"situation_state": { "type": ["object", "null"], "additionalProperties": true },
|
|
88
|
+
"agent_situation_state": { "type": ["object", "null"], "additionalProperties": true },
|
|
89
|
+
"user_situation_state": { "type": ["object", "null"], "additionalProperties": true },
|
|
90
|
+
"situation_type": { "oneOf": [{ "type": "array", "items": { "type": "string" } }, { "type": "null" }] }
|
|
91
|
+
}
|
|
92
|
+
},
|
|
93
|
+
"dimension_value": { "type": ["string", "null"], "description": "Machine-read dimension label. Null = not read on this turn, never a claim of absence." },
|
|
94
|
+
"dimension_list": { "oneOf": [{ "type": "array", "items": { "type": "string" } }, { "type": "null" }] },
|
|
95
|
+
"action": {
|
|
96
|
+
"type": "object",
|
|
97
|
+
"description": "The assistant's turn: redacted text, machine-read dimensions, selection propensities when logged, and the serving plumbing.",
|
|
98
|
+
"additionalProperties": false,
|
|
99
|
+
"required": [
|
|
100
|
+
"text",
|
|
101
|
+
"dimensions",
|
|
102
|
+
"signature_phrase_matches",
|
|
103
|
+
"read_candidates",
|
|
104
|
+
"read_scores",
|
|
105
|
+
"read_propensities",
|
|
106
|
+
"selected_index",
|
|
107
|
+
"plumbing"
|
|
108
|
+
],
|
|
109
|
+
"properties": {
|
|
110
|
+
"text": { "type": ["string", "null"], "description": "Redacted assistant text (Tier 2). Null when not captured." },
|
|
111
|
+
"dimensions": {
|
|
112
|
+
"type": "object",
|
|
113
|
+
"additionalProperties": false,
|
|
114
|
+
"required": ["speech_act", "stance_epistemic", "stance_affective", "stance_alignment", "discourse_relation", "grounding_move", "face_work"],
|
|
115
|
+
"properties": {
|
|
116
|
+
"speech_act": { "$ref": "#/$defs/dimension_value" },
|
|
117
|
+
"stance_epistemic": { "$ref": "#/$defs/dimension_value" },
|
|
118
|
+
"stance_affective": { "$ref": "#/$defs/dimension_value" },
|
|
119
|
+
"stance_alignment": { "$ref": "#/$defs/dimension_value" },
|
|
120
|
+
"discourse_relation": { "$ref": "#/$defs/dimension_value" },
|
|
121
|
+
"grounding_move": { "$ref": "#/$defs/dimension_list" },
|
|
122
|
+
"face_work": { "$ref": "#/$defs/dimension_list" }
|
|
123
|
+
}
|
|
124
|
+
},
|
|
125
|
+
"signature_phrase_matches": { "$ref": "#/$defs/dimension_list" },
|
|
126
|
+
"read_candidates": {
|
|
127
|
+
"oneOf": [
|
|
128
|
+
{
|
|
129
|
+
"type": "array",
|
|
130
|
+
"items": {
|
|
131
|
+
"type": "object",
|
|
132
|
+
"additionalProperties": false,
|
|
133
|
+
"required": ["label"],
|
|
134
|
+
"properties": { "label": { "type": "string" }, "text": { "type": "string" } }
|
|
135
|
+
}
|
|
136
|
+
},
|
|
137
|
+
{ "type": "null" }
|
|
138
|
+
]
|
|
139
|
+
},
|
|
140
|
+
"read_scores": { "oneOf": [{ "type": "array", "items": { "type": "number" } }, { "type": "null" }] },
|
|
141
|
+
"read_propensities": { "oneOf": [{ "type": "array", "items": { "type": "number" } }, { "type": "null" }] },
|
|
142
|
+
"selected_index": { "type": ["integer", "null"] },
|
|
143
|
+
"plumbing": {
|
|
144
|
+
"type": "object",
|
|
145
|
+
"additionalProperties": false,
|
|
146
|
+
"required": ["model", "provider", "finish_reason", "error", "latency_ms", "first_token_ms", "tokens_input", "tokens_output", "cost_usd", "tool_calls", "tool_names"],
|
|
147
|
+
"properties": {
|
|
148
|
+
"model": { "type": ["string", "null"] },
|
|
149
|
+
"provider": { "type": ["string", "null"] },
|
|
150
|
+
"finish_reason": { "type": ["string", "null"] },
|
|
151
|
+
"error": { "type": ["string", "null"] },
|
|
152
|
+
"latency_ms": { "type": ["integer", "null"] },
|
|
153
|
+
"first_token_ms": { "type": ["integer", "null"] },
|
|
154
|
+
"tokens_input": { "type": ["integer", "null"] },
|
|
155
|
+
"tokens_output": { "type": ["integer", "null"] },
|
|
156
|
+
"cost_usd": { "type": ["string", "null"], "description": "Decimal as a string (exact, never floated)." },
|
|
157
|
+
"tool_calls": { "type": ["integer", "null"] },
|
|
158
|
+
"tool_names": { "$ref": "#/$defs/dimension_list" }
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
},
|
|
163
|
+
"uptake": {
|
|
164
|
+
"type": "object",
|
|
165
|
+
"description": "The human's next turn — how the assistant's move landed. The pair block is the exchange-level read.",
|
|
166
|
+
"additionalProperties": false,
|
|
167
|
+
"required": ["text", "dimensions", "pair", "transition_time_ms", "transition_length_delta", "interrupted_stream", "cancelled_response"],
|
|
168
|
+
"properties": {
|
|
169
|
+
"text": { "type": ["string", "null"], "description": "Redacted user text (Tier 2). Null when not captured." },
|
|
170
|
+
"dimensions": {
|
|
171
|
+
"type": "object",
|
|
172
|
+
"additionalProperties": false,
|
|
173
|
+
"required": ["speech_act", "stance_epistemic", "stance_affective", "stance_alignment", "discourse_relation", "grounding_move"],
|
|
174
|
+
"properties": {
|
|
175
|
+
"speech_act": { "$ref": "#/$defs/dimension_value" },
|
|
176
|
+
"stance_epistemic": { "$ref": "#/$defs/dimension_value" },
|
|
177
|
+
"stance_affective": { "$ref": "#/$defs/dimension_value" },
|
|
178
|
+
"stance_alignment": { "$ref": "#/$defs/dimension_value" },
|
|
179
|
+
"discourse_relation": { "$ref": "#/$defs/dimension_value" },
|
|
180
|
+
"grounding_move": { "$ref": "#/$defs/dimension_list" }
|
|
181
|
+
}
|
|
182
|
+
},
|
|
183
|
+
"pair": {
|
|
184
|
+
"type": "object",
|
|
185
|
+
"additionalProperties": false,
|
|
186
|
+
"required": ["pair_type", "pair_completed", "uptaken_as", "accommodation_direction"],
|
|
187
|
+
"properties": {
|
|
188
|
+
"pair_type": { "$ref": "#/$defs/dimension_value" },
|
|
189
|
+
"pair_completed": { "type": ["boolean", "null"], "description": "Did the move get its completing response? Null = pair not readable on this turn." },
|
|
190
|
+
"uptaken_as": { "$ref": "#/$defs/dimension_value" },
|
|
191
|
+
"accommodation_direction": { "$ref": "#/$defs/dimension_value" }
|
|
192
|
+
}
|
|
193
|
+
},
|
|
194
|
+
"transition_time_ms": { "type": ["integer", "null"] },
|
|
195
|
+
"transition_length_delta": { "type": ["integer", "null"] },
|
|
196
|
+
"interrupted_stream": { "type": ["boolean", "null"] },
|
|
197
|
+
"cancelled_response": { "type": ["boolean", "null"] }
|
|
198
|
+
}
|
|
199
|
+
},
|
|
200
|
+
"reward": {
|
|
201
|
+
"type": "object",
|
|
202
|
+
"description": "What followed: outcome events joined back to the causing turn (hours later is fine), plus explicit user signals.",
|
|
203
|
+
"additionalProperties": false,
|
|
204
|
+
"required": ["events", "user_flagged_break", "user_explicit_rating", "user_thumbs", "contradiction_flag", "contradiction_reason"],
|
|
205
|
+
"properties": {
|
|
206
|
+
"events": {
|
|
207
|
+
"type": "array",
|
|
208
|
+
"items": {
|
|
209
|
+
"type": "object",
|
|
210
|
+
"additionalProperties": false,
|
|
211
|
+
"required": ["kind", "attributed_to", "fired_at"],
|
|
212
|
+
"properties": {
|
|
213
|
+
"kind": { "type": "string", "description": "Deployer-named outcome kind (e.g. ticket_resolved, escalated_to_human)." },
|
|
214
|
+
"attributed_to": { "type": ["string", "null"] },
|
|
215
|
+
"fired_at": { "$ref": "#/$defs/timestamp" }
|
|
216
|
+
}
|
|
217
|
+
}
|
|
218
|
+
},
|
|
219
|
+
"user_flagged_break": { "type": ["boolean", "null"] },
|
|
220
|
+
"user_explicit_rating": { "type": ["number", "null"] },
|
|
221
|
+
"user_thumbs": { "type": ["string", "null"] },
|
|
222
|
+
"contradiction_flag": { "type": ["boolean", "null"] },
|
|
223
|
+
"contradiction_reason": { "type": ["string", "null"] }
|
|
224
|
+
}
|
|
225
|
+
}
|
|
226
|
+
}
|
|
227
|
+
}
|