@aikdna/kdna-core 0.2.3 → 0.3.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.
@@ -42,11 +42,180 @@
42
42
  "type": "object",
43
43
  "minProperties": 1,
44
44
  "properties": {
45
- "standard_terms": { "type": "array" },
46
- "preferred_terms": { "type": "array" },
47
- "banned_terms": { "type": "array" }
45
+ "standard_terms": {
46
+ "type": "array",
47
+ "items": {
48
+ "type": "object",
49
+ "required": [
50
+ "term",
51
+ "definition"
52
+ ],
53
+ "properties": {
54
+ "term": {
55
+ "type": "string"
56
+ },
57
+ "definition": {
58
+ "type": "string"
59
+ },
60
+ "applies_when": {
61
+ "type": "array",
62
+ "items": {
63
+ "type": "string"
64
+ }
65
+ },
66
+ "does_not_apply_when": {
67
+ "type": "array",
68
+ "items": {
69
+ "type": "string"
70
+ }
71
+ }
72
+ },
73
+ "additionalProperties": true
74
+ }
75
+ },
76
+ "preferred_terms": {
77
+ "type": "array",
78
+ "items": {
79
+ "type": "object",
80
+ "required": [
81
+ "term",
82
+ "definition"
83
+ ],
84
+ "properties": {
85
+ "term": {
86
+ "type": "string"
87
+ },
88
+ "definition": {
89
+ "type": "string"
90
+ },
91
+ "applies_when": {
92
+ "type": "array",
93
+ "items": {
94
+ "type": "string"
95
+ }
96
+ },
97
+ "does_not_apply_when": {
98
+ "type": "array",
99
+ "items": {
100
+ "type": "string"
101
+ }
102
+ }
103
+ },
104
+ "additionalProperties": true
105
+ }
106
+ },
107
+ "banned_terms": {
108
+ "type": "array",
109
+ "items": {
110
+ "type": "object",
111
+ "required": [
112
+ "term",
113
+ "why",
114
+ "replace_with"
115
+ ],
116
+ "properties": {
117
+ "term": {
118
+ "type": "string"
119
+ },
120
+ "why": {
121
+ "type": "string"
122
+ },
123
+ "replace_with": {
124
+ "type": "string"
125
+ },
126
+ "applies_when": {
127
+ "type": "array",
128
+ "items": {
129
+ "type": "string"
130
+ }
131
+ },
132
+ "does_not_apply_when": {
133
+ "type": "array",
134
+ "items": {
135
+ "type": "string"
136
+ }
137
+ }
138
+ },
139
+ "additionalProperties": true
140
+ }
141
+ }
142
+ },
143
+ "additionalProperties": true
144
+ },
145
+ "aesthetic_preferences": {
146
+ "type": "array",
147
+ "items": {
148
+ "type": "object",
149
+ "required": [
150
+ "prefer",
151
+ "avoid"
152
+ ],
153
+ "properties": {
154
+ "prefer": {
155
+ "type": "string"
156
+ },
157
+ "avoid": {
158
+ "type": "string"
159
+ },
160
+ "signals_good": {
161
+ "type": "string"
162
+ },
163
+ "signals_bad": {
164
+ "type": "string"
165
+ }
166
+ },
167
+ "additionalProperties": true
168
+ }
169
+ },
170
+ "boundaries": {
171
+ "type": "array",
172
+ "items": {
173
+ "type": "object",
174
+ "required": [
175
+ "rule",
176
+ "why"
177
+ ],
178
+ "properties": {
179
+ "rule": {
180
+ "type": "string"
181
+ },
182
+ "why": {
183
+ "type": "string"
184
+ },
185
+ "must_not_do": {
186
+ "type": "string"
187
+ },
188
+ "acceptable_exception": {
189
+ "type": "string"
190
+ }
191
+ },
192
+ "additionalProperties": true
48
193
  }
49
194
  },
195
+ "risk_model": {
196
+ "type": "object",
197
+ "properties": {
198
+ "highest_risk_errors": {
199
+ "type": "array",
200
+ "items": {
201
+ "type": "string"
202
+ }
203
+ },
204
+ "acceptable_errors": {
205
+ "type": "array",
206
+ "items": {
207
+ "type": "string"
208
+ }
209
+ },
210
+ "must_block_when": {
211
+ "type": "string"
212
+ },
213
+ "warn_when": {
214
+ "type": "string"
215
+ }
216
+ },
217
+ "additionalProperties": true
218
+ },
50
219
  "misunderstandings": {
51
220
  "type": "array",
52
221
  "items": {
@@ -57,15 +226,107 @@
57
226
  "correct",
58
227
  "key_distinction",
59
228
  "why"
60
- ]
229
+ ],
230
+ "properties": {
231
+ "id": {
232
+ "type": "string"
233
+ },
234
+ "wrong": {
235
+ "type": "string"
236
+ },
237
+ "correct": {
238
+ "type": "string"
239
+ },
240
+ "key_distinction": {
241
+ "type": "string"
242
+ },
243
+ "why": {
244
+ "type": "string"
245
+ },
246
+ "confidence": {
247
+ "type": "string"
248
+ },
249
+ "evidence_type": {
250
+ "type": "array",
251
+ "items": {
252
+ "type": "string"
253
+ }
254
+ },
255
+ "applies_when": {
256
+ "type": "array",
257
+ "items": {
258
+ "type": "string"
259
+ }
260
+ },
261
+ "does_not_apply_when": {
262
+ "type": "array",
263
+ "items": {
264
+ "type": "string"
265
+ }
266
+ },
267
+ "failure_risk": {
268
+ "type": "string"
269
+ }
270
+ },
271
+ "additionalProperties": true
61
272
  }
62
273
  },
63
274
  "self_check": {
64
275
  "type": "array",
65
276
  "items": {
66
- "type": "string"
277
+ "anyOf": [
278
+ {
279
+ "type": "string"
280
+ },
281
+ {
282
+ "type": "object",
283
+ "required": [
284
+ "question"
285
+ ],
286
+ "properties": {
287
+ "question": {
288
+ "type": "string"
289
+ },
290
+ "applies_when": {
291
+ "type": "array",
292
+ "items": {
293
+ "type": "string"
294
+ }
295
+ }
296
+ },
297
+ "additionalProperties": true
298
+ }
299
+ ]
300
+ }
301
+ },
302
+ "counterexamples": {
303
+ "type": "array",
304
+ "items": {
305
+ "type": "object",
306
+ "required": [
307
+ "bad_example",
308
+ "why_bad"
309
+ ],
310
+ "properties": {
311
+ "bad_example": {
312
+ "type": "string"
313
+ },
314
+ "why_bad": {
315
+ "type": "string"
316
+ },
317
+ "violated_axioms": {
318
+ "type": "array",
319
+ "items": {
320
+ "type": "string"
321
+ }
322
+ },
323
+ "better_direction": {
324
+ "type": "string"
325
+ }
326
+ },
327
+ "additionalProperties": true
67
328
  }
68
329
  }
69
330
  },
70
331
  "additionalProperties": true
71
- }
332
+ }
@@ -14,22 +14,11 @@
14
14
  "load_condition"
15
15
  ],
16
16
  "properties": {
17
- "version": {
18
- "type": "string"
19
- },
20
- "domain": {
21
- "type": "string",
22
- "pattern": "^[a-z][a-z0-9_]*$"
23
- },
24
- "created": {
25
- "type": "string"
26
- },
27
- "purpose": {
28
- "type": "string"
29
- },
30
- "load_condition": {
31
- "type": "string"
32
- }
17
+ "version": { "type": "string" },
18
+ "domain": { "type": "string", "pattern": "^[a-z][a-z0-9_]*$" },
19
+ "created": { "type": "string" },
20
+ "purpose": { "type": "string" },
21
+ "load_condition": { "type": "string" }
33
22
  },
34
23
  "additionalProperties": true
35
24
  },
@@ -48,9 +37,40 @@
48
37
  "one_sentence",
49
38
  "logic",
50
39
  "so_what"
51
- ]
40
+ ],
41
+ "properties": {
42
+ "id": { "type": "string" },
43
+ "one_sentence": { "type": "string" },
44
+ "logic": {
45
+ "type": "array",
46
+ "items": { "type": "string" }
47
+ },
48
+ "so_what": { "type": "string" },
49
+ "tradeoffs": {
50
+ "type": "string",
51
+ "description": "Trade-offs inherent in this reasoning chain."
52
+ },
53
+ "conflict_resolution": {
54
+ "type": "string",
55
+ "description": "How to resolve conflicts when this chain clashes with other principles."
56
+ },
57
+ "when_not_to_use": {
58
+ "type": "string",
59
+ "description": "Situations where this reasoning chain should not be applied."
60
+ },
61
+ "evidence_required": {
62
+ "type": "array",
63
+ "items": { "type": "string" },
64
+ "description": "Evidence needed before this chain can be confidently applied."
65
+ },
66
+ "uncertainty_handling": {
67
+ "type": "string",
68
+ "description": "How to proceed when evidence is incomplete or ambiguous."
69
+ }
70
+ },
71
+ "additionalProperties": true
52
72
  }
53
73
  }
54
74
  },
55
75
  "additionalProperties": true
56
- }
76
+ }
@@ -15,7 +15,10 @@
15
15
  ],
16
16
  "properties": {
17
17
  "version": { "type": "string" },
18
- "domain": { "type": "string", "pattern": "^[a-z][a-z0-9_]*$" },
18
+ "domain": {
19
+ "type": "string",
20
+ "pattern": "^[a-z][a-z0-9_]*$"
21
+ },
19
22
  "created": { "type": "string" },
20
23
  "purpose": { "type": "string" },
21
24
  "load_condition": { "type": "string" }
@@ -32,16 +35,41 @@
32
35
  "type": "array",
33
36
  "items": {
34
37
  "type": "object",
35
- "required": ["id", "name", "trigger_signal"],
38
+ "required": ["id", "name"],
36
39
  "properties": {
37
40
  "id": { "type": "string" },
38
41
  "name": { "type": "string" },
39
- "trigger_signal": { "type": "string" },
42
+ "trigger_signal": {
43
+ "type": "string",
44
+ "description": "Deprecated: use trigger_signals (array) instead. Kept for backward compatibility."
45
+ },
46
+ "trigger_signals": {
47
+ "type": "array",
48
+ "items": { "type": "string" },
49
+ "description": "Signals that trigger this scene."
50
+ },
51
+ "negative_signals": {
52
+ "type": "array",
53
+ "items": { "type": "string" },
54
+ "description": "Signals that explicitly exclude this scene."
55
+ },
56
+ "classification_rule": {
57
+ "type": "string",
58
+ "description": "Rule for classifying input into this scene."
59
+ },
60
+ "risk_level": {
61
+ "type": "string",
62
+ "description": "Risk level associated with this scene."
63
+ },
64
+ "expected_judgment_shift": {
65
+ "type": "string",
66
+ "description": "How judgment should shift when this scene is detected."
67
+ },
40
68
  "sub_scenarios": {
41
69
  "type": "array",
42
70
  "items": {
43
71
  "type": "object",
44
- "required": ["id", "trap_belief", "three_questions", "action_template", "expected_result"],
72
+ "required": ["id", "trap_belief", "action_template", "expected_result"],
45
73
  "properties": {
46
74
  "id": { "type": "string" },
47
75
  "trap_belief": { "type": "string" },
@@ -70,10 +98,12 @@
70
98
  }
71
99
  },
72
100
  "expected_result": { "type": "string" }
73
- }
101
+ },
102
+ "additionalProperties": true
74
103
  }
75
104
  }
76
- }
105
+ },
106
+ "additionalProperties": true
77
107
  }
78
108
  }
79
109
  },
@@ -0,0 +1,58 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "title": "KDNA_Eval",
4
+ "type": "object",
5
+ "required": [
6
+ "id",
7
+ "domain",
8
+ "input",
9
+ "expected_classification",
10
+ "output_rubric"
11
+ ],
12
+ "properties": {
13
+ "id": {
14
+ "type": "string",
15
+ "description": "Unique identifier for this eval case."
16
+ },
17
+ "domain": {
18
+ "type": "string",
19
+ "description": "The domain this eval tests, e.g., @aikdna/writing."
20
+ },
21
+ "input": {
22
+ "type": "string",
23
+ "description": "The user input text to be evaluated."
24
+ },
25
+ "expected_classification": {
26
+ "type": "string",
27
+ "description": "The scenario or state the input should be classified into."
28
+ },
29
+ "expected_axioms": {
30
+ "type": "array",
31
+ "items": { "type": "string" },
32
+ "description": "Axiom IDs that should be triggered by this input."
33
+ },
34
+ "expected_misunderstandings_avoided": {
35
+ "type": "array",
36
+ "items": { "type": "string" },
37
+ "description": "Misunderstanding IDs the agent should avoid falling into."
38
+ },
39
+ "expected_banned_terms_avoided": {
40
+ "type": "array",
41
+ "items": { "type": "string" },
42
+ "description": "Banned terms the agent should avoid using."
43
+ },
44
+ "output_rubric": {
45
+ "type": "string",
46
+ "description": "What the judgment output should contain to pass."
47
+ },
48
+ "pass": {
49
+ "type": "boolean",
50
+ "description": "Whether this eval passed (set during verification)."
51
+ },
52
+ "evidence": {
53
+ "type": "string",
54
+ "description": "Explanation of why the eval passed or failed."
55
+ }
56
+ },
57
+ "additionalProperties": true
58
+ }