Repository navigation
Expand file tree
/
Copy pathrlp-schema.json
More file actions
345 lines (345 loc) · 10.4 KB
/
Copy pathrlp-schema.json
File metadata and controls
345 lines (345 loc) · 10.4 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://github.com/vdsx-cloud/reasoning-ledger-protocol/rlp-schema.json",
"title": "Reasoning Ledger Protocol Schema",
"description": "JSON Schema for Reasoning Ledger Protocol commits",
"type": "object",
"required": ["rlp_version", "commit_type", "timestamp"],
"properties": {
"rlp_version": {
"type": "string",
"description": "RLP protocol version",
"pattern": "^1\\.0$",
"examples": ["1.0"]
},
"commit_type": {
"type": "string",
"description": "Type of commit",
"enum": ["gene_promotion", "execution_record", "system_event", "economic_record", "promotion_record"],
"examples": ["gene_promotion"]
},
"timestamp": {
"type": "string",
"description": "ISO 8601 timestamp",
"format": "date-time",
"examples": ["2024-04-08T04:30:00Z"]
},
"gene": {
"type": "object",
"description": "Gene definition",
"required": ["id", "domain", "trigger", "action"],
"properties": {
"id": {
"type": "string",
"description": "Unique gene identifier",
"pattern": "^[a-zA-Z0-9:_-]+$",
"examples": ["research:abc123", "g_mnp9ygmf_tw6"]
},
"locus": {
"type": "string",
"description": "Human-readable gene identifier",
"examples": ["research:search for machine learning papers:navigate to https://arxiv.org and search"]
},
"domain": {
"type": "string",
"description": "Behavioral domain",
"enum": ["research", "navigation", "analysis", "universal"],
"examples": ["research"]
},
"trigger": {
"type": "string",
"description": "Context that triggers this behavior",
"minLength": 1,
"examples": ["search for machine learning papers"]
},
"action": {
"type": "string",
"description": "Executable action or thought process",
"minLength": 1,
"examples": ["navigate to https://arxiv.org and search for \"machine learning\""]
},
"type": {
"type": "string",
"description": "Gene type",
"enum": ["do", "think", "check"],
"default": "do",
"examples": ["do"]
},
"promoted": {
"type": ["boolean", "integer"],
"description": "Whether gene is actively promoted",
"examples": [true, 1, false, 0]
},
"confidence": {
"type": "number",
"description": "Match confidence score",
"minimum": 0,
"maximum": 1,
"examples": [0.9]
},
"usage_count": {
"type": "integer",
"description": "Number of times successfully used",
"minimum": 0,
"examples": [3]
}
}
},
"evidence": {
"type": "object",
"description": "Evidence supporting gene promotion",
"properties": {
"first_observed": {
"type": "string",
"description": "ISO 8601 timestamp of first observation",
"format": "date-time",
"examples": ["2024-04-08T04:15:00Z"]
},
"last_observed": {
"type": "string",
"description": "ISO 8601 timestamp of last observation",
"format": "date-time",
"examples": ["2024-04-08T04:25:00Z"]
},
"success_count": {
"type": "integer",
"description": "Number of successful executions",
"minimum": 0,
"examples": [3]
},
"failure_count": {
"type": "integer",
"description": "Number of failed executions",
"minimum": 0,
"examples": [0]
},
"token_savings": {
"type": "integer",
"description": "Total tokens saved by this gene",
"minimum": 0,
"examples": [6108]
},
"average_tokens_saved": {
"type": "number",
"description": "Average tokens saved per execution",
"minimum": 0,
"examples": [2036]
},
"promotion_threshold": {
"type": "integer",
"description": "Success count required for promotion",
"minimum": 1,
"default": 3,
"examples": [3]
}
}
},
"execution": {
"type": "object",
"description": "Execution record details",
"required": ["decision_source", "domain"],
"properties": {
"decision_source": {
"type": "string",
"description": "Source of the decision",
"enum": ["dna_gene", "dna_gene_invalid_action", "dna_PREFER__", "llm_fallback", "llm_forced_exploration"],
"examples": ["dna_gene"]
},
"metric_bucket": {
"type": "string",
"description": "Metric categorization",
"enum": ["dna_match_valid", "dna_match_invalid_action", "dna_PREFER__", "llm_fallback"],
"examples": ["dna_match_valid"]
},
"gene_id": {
"type": "string",
"description": "Gene identifier that matched",
"examples": ["research:abc123", "dna_match_1775639397809"]
},
"domain": {
"type": "string",
"description": "Behavioral domain",
"enum": ["research", "navigation", "analysis", "universal"],
"examples": ["research"]
},
"saved_tokens": {
"type": "integer",
"description": "Tokens saved by using DNA match",
"minimum": 0,
"examples": [2036, 0]
},
"confidence": {
"type": "number",
"description": "Match confidence score",
"minimum": 0,
"maximum": 1,
"examples": [0.9]
},
"match_threshold": {
"type": "number",
"description": "Confidence threshold for matching",
"minimum": 0,
"maximum": 1,
"examples": [0.3]
},
"failure_reason": {
"type": ["string", "null"],
"description": "Reason for failure if applicable",
"examples": ["EMPTY_OR_INVALID_ACTION", null]
}
}
},
"provenance": {
"type": "object",
"description": "Cryptographic provenance information",
"properties": {
"previous_commit": {
"type": "string",
"description": "Hash of previous commit",
"examples": ["sha256:abc123def456"]
},
"commit_hash": {
"type": "string",
"description": "Hash of this commit",
"examples": ["sha256:def456abc123"]
},
"system_fingerprint": {
"type": "string",
"description": "System identifier",
"examples": ["edge-node-001"]
},
"agent_version": {
"type": "string",
"description": "Agent software version",
"examples": ["1.0.0"]
},
"ledger_depth": {
"type": "integer",
"description": "Depth in the ledger",
"minimum": 0,
"examples": [1525]
}
}
},
"metadata": {
"type": "object",
"description": "Additional metadata",
"properties": {
"experiment_id": {
"type": "string",
"description": "Experiment identifier",
"examples": ["exp4"]
},
"epsilon_arch": {
"type": "number",
"description": "ε-arch exploration rate",
"minimum": 0,
"maximum": 1,
"examples": [0.2]
},
"monopoly_brakes": {
"type": "boolean",
"description": "Whether monopoly brakes are enabled",
"examples": [true]
},
"ts": {
"type": "integer",
"description": "Timestamp in milliseconds (WAL format)",
"minimum": 0,
"examples": [1775639397809]
},
"type": {
"type": "string",
"description": "Record type (WAL format)",
"examples": ["execution_record", "promotion_record"]
}
}
}
},
"oneOf": [
{
"properties": {
"commit_type": { "const": "gene_promotion" },
"gene": { "$ref": "#/properties/gene" },
"evidence": { "$ref": "#/properties/evidence" }
},
"required": ["gene", "evidence"]
},
{
"properties": {
"commit_type": { "const": "execution_record" },
"execution": { "$ref": "#/properties/execution" }
},
"required": ["execution"]
},
{
"properties": {
"commit_type": { "const": "promotion_record" }
}
},
{
"properties": {
"commit_type": { "const": "system_event" }
}
},
{
"properties": {
"commit_type": { "const": "economic_record" }
}
}
],
"additionalProperties": true,
"examples": [
{
"rlp_version": "1.0",
"commit_type": "gene_promotion",
"timestamp": "2024-04-08T04:30:00Z",
"gene": {
"id": "research:abc123",
"locus": "research:search for machine learning papers:navigate to https://arxiv.org and search",
"domain": "research",
"trigger": "search for machine learning papers",
"action": "navigate to https://arxiv.org and search for \"machine learning\"",
"type": "do",
"promoted": true,
"confidence": 0.9,
"usage_count": 0
},
"evidence": {
"first_observed": "2024-04-08T04:15:00Z",
"last_observed": "2024-04-08T04:25:00Z",
"success_count": 3,
"failure_count": 0,
"token_savings": 6108,
"average_tokens_saved": 2036,
"promotion_threshold": 3
},
"provenance": {
"previous_commit": "sha256:abc123def456",
"commit_hash": "sha256:def456abc123",
"system_fingerprint": "edge-node-001",
"agent_version": "1.0.0",
"ledger_depth": 1525
},
"metadata": {
"experiment_id": "exp4",
"epsilon_arch": 0.2,
"monopoly_brakes": true
}
},
{
"ts": 1775639397809,
"type": "execution_record",
"execution": {
"decision_source": "dna_gene_invalid_action",
"metric_bucket": "dna_match_invalid_action",
"gene_id": "dna_match_1775639397809",
"domain": "research",
"saved_tokens": 0,
"confidence": 0.9,
"match_threshold": 0.3,
"failure_reason": "EMPTY_OR_INVALID_ACTION"
}
}
]
}