@onlooker-community/schema 0.1.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.
@@ -0,0 +1,246 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://onlooker.community/schemas/payload/plugins-ops.json",
4
+ "title": "Ops plugin payloads",
5
+ "description": "Payload schemas for ledger.*, echo.*, counsel.*, onlooker.*, and meridian.* events.",
6
+ "$defs": {
7
+ "ledger.budget.warning": {
8
+ "type": "object",
9
+ "additionalProperties": false,
10
+ "required": ["budget_usd", "spent_usd", "threshold_pct"],
11
+ "properties": {
12
+ "budget_usd": { "type": "number", "minimum": 0 },
13
+ "spent_usd": { "type": "number", "minimum": 0 },
14
+ "threshold_pct": { "type": "number", "minimum": 0, "maximum": 100 },
15
+ "remaining_usd": { "type": "number" }
16
+ }
17
+ },
18
+ "ledger.budget.exceeded": {
19
+ "type": "object",
20
+ "additionalProperties": false,
21
+ "required": ["budget_usd", "spent_usd", "blocked_operation"],
22
+ "properties": {
23
+ "budget_usd": { "type": "number", "minimum": 0 },
24
+ "spent_usd": { "type": "number", "minimum": 0 },
25
+ "blocked_operation": { "type": "string" }
26
+ }
27
+ },
28
+ "ledger.session.complete": {
29
+ "type": "object",
30
+ "additionalProperties": false,
31
+ "required": ["total_cost_usd", "budget_usd", "under_budget"],
32
+ "properties": {
33
+ "total_cost_usd": { "type": "number", "minimum": 0 },
34
+ "budget_usd": { "type": "number", "minimum": 0 },
35
+ "under_budget": { "type": "boolean" },
36
+ "cost_by_plugin": {
37
+ "type": "object",
38
+ "additionalProperties": { "type": "number" }
39
+ }
40
+ }
41
+ },
42
+ "echo.suite.started": {
43
+ "type": "object",
44
+ "additionalProperties": false,
45
+ "required": ["suite_id", "test_count"],
46
+ "properties": {
47
+ "suite_id": { "type": "string" },
48
+ "test_count": { "type": "integer", "minimum": 0 },
49
+ "suite_name": { "type": "string" },
50
+ "trigger": { "type": "string", "enum": ["config_change", "manual"] },
51
+ "changed_file": { "type": "string" }
52
+ }
53
+ },
54
+ "echo.suite.complete": {
55
+ "type": "object",
56
+ "additionalProperties": false,
57
+ "required": ["suite_id", "test_count", "improved", "degraded", "neutral"],
58
+ "properties": {
59
+ "suite_id": { "type": "string" },
60
+ "test_count": { "type": "integer", "minimum": 0 },
61
+ "improved": { "type": "integer", "minimum": 0 },
62
+ "degraded": { "type": "integer", "minimum": 0 },
63
+ "neutral": { "type": "integer", "minimum": 0 },
64
+ "merge_recommended": { "type": "boolean" },
65
+ "duration_ms": { "type": "integer", "minimum": 0 }
66
+ }
67
+ },
68
+ "echo.regression.detected": {
69
+ "type": "object",
70
+ "additionalProperties": false,
71
+ "required": ["suite_id", "test_id", "score_before", "score_after"],
72
+ "properties": {
73
+ "suite_id": { "type": "string" },
74
+ "test_id": { "type": "string" },
75
+ "score_before": { "type": "number", "minimum": 0, "maximum": 1 },
76
+ "score_after": { "type": "number", "minimum": 0, "maximum": 1 },
77
+ "test_name": { "type": "string" },
78
+ "delta": { "type": "number" }
79
+ }
80
+ },
81
+ "counsel.brief.generated": {
82
+ "type": "object",
83
+ "additionalProperties": false,
84
+ "required": ["period_start", "period_end", "recommendation_count"],
85
+ "properties": {
86
+ "period_start": { "type": "string", "format": "date-time" },
87
+ "period_end": { "type": "string", "format": "date-time" },
88
+ "recommendation_count": { "type": "integer", "minimum": 0 },
89
+ "sources_consulted": {
90
+ "type": "array",
91
+ "items": {
92
+ "type": "string",
93
+ "enum": [
94
+ "onlooker_events",
95
+ "tribunal_verdicts",
96
+ "echo_regressions",
97
+ "sentinel_audit",
98
+ "warden_audit",
99
+ "oracle_calibrations",
100
+ "meridian_reliance"
101
+ ]
102
+ }
103
+ }
104
+ }
105
+ },
106
+ "onlooker.session.summary": {
107
+ "type": "object",
108
+ "additionalProperties": false,
109
+ "required": ["session_id", "duration_ms", "event_count"],
110
+ "properties": {
111
+ "session_id": { "type": "string" },
112
+ "duration_ms": { "type": "integer", "minimum": 0 },
113
+ "event_count": { "type": "integer", "minimum": 0 },
114
+ "tool_counts": {
115
+ "type": "object",
116
+ "additionalProperties": false,
117
+ "properties": {
118
+ "file_reads": { "type": "integer", "minimum": 0 },
119
+ "file_writes": { "type": "integer", "minimum": 0 },
120
+ "file_edits": { "type": "integer", "minimum": 0 },
121
+ "shell_execs": { "type": "integer", "minimum": 0 },
122
+ "web_fetches": { "type": "integer", "minimum": 0 },
123
+ "agent_spawns": { "type": "integer", "minimum": 0 }
124
+ }
125
+ }
126
+ }
127
+ },
128
+ "meridian.hint.generated": {
129
+ "type": "object",
130
+ "additionalProperties": false,
131
+ "required": [
132
+ "hint_id",
133
+ "case_id",
134
+ "task_type",
135
+ "failure_type",
136
+ "hint_direction"
137
+ ],
138
+ "properties": {
139
+ "hint_id": { "type": "string" },
140
+ "case_id": { "type": "string" },
141
+ "task_type": {
142
+ "type": "string",
143
+ "enum": ["code", "reasoning", "writing", "general"]
144
+ },
145
+ "failure_type": {
146
+ "type": "string",
147
+ "enum": [
148
+ "wrong_approach",
149
+ "missing_concept",
150
+ "implementation_error",
151
+ "misunderstood_task",
152
+ "out_of_scope"
153
+ ]
154
+ },
155
+ "hint_direction": {
156
+ "type": "string",
157
+ "enum": [
158
+ "reframe",
159
+ "missing_tool",
160
+ "intermediate_goal",
161
+ "alternative_representation",
162
+ "constraint_reminder"
163
+ ]
164
+ },
165
+ "target_concept": { "type": "string" },
166
+ "signal_creation": { "type": "number", "minimum": 0, "maximum": 1 },
167
+ "signal_transfer": { "type": "number", "minimum": 0, "maximum": 1 },
168
+ "playbook_bullets_injected": { "type": "integer", "minimum": 0 }
169
+ }
170
+ },
171
+ "meridian.hint.delivered": {
172
+ "type": "object",
173
+ "additionalProperties": false,
174
+ "required": ["hint_id", "case_id", "delivery_mode"],
175
+ "properties": {
176
+ "hint_id": { "type": "string" },
177
+ "case_id": { "type": "string" },
178
+ "delivery_mode": {
179
+ "type": "string",
180
+ "enum": ["append", "comment", "inline", "aside"]
181
+ }
182
+ }
183
+ },
184
+ "meridian.outcome.recorded": {
185
+ "type": "object",
186
+ "additionalProperties": false,
187
+ "required": ["hint_id", "case_id", "succeeded", "attempts_after_hint"],
188
+ "properties": {
189
+ "hint_id": { "type": "string" },
190
+ "case_id": { "type": "string" },
191
+ "succeeded": { "type": "boolean" },
192
+ "attempts_after_hint": { "type": "integer", "minimum": 0 },
193
+ "hint_referenced": { "type": "boolean" },
194
+ "time_to_success_ms": { "type": "integer", "minimum": 0 }
195
+ }
196
+ },
197
+ "meridian.reliance.measured": {
198
+ "type": "object",
199
+ "additionalProperties": false,
200
+ "required": ["hint_id", "case_id", "score", "assessment", "method"],
201
+ "properties": {
202
+ "hint_id": { "type": "string" },
203
+ "case_id": { "type": "string" },
204
+ "score": { "type": "number", "minimum": 0, "maximum": 1 },
205
+ "assessment": { "type": "string", "enum": ["low", "medium", "high"] },
206
+ "method": { "type": "string", "enum": ["logprob", "judge"] }
207
+ }
208
+ },
209
+ "meridian.lesson.curated": {
210
+ "type": "object",
211
+ "additionalProperties": false,
212
+ "required": ["bullet_id", "case_id", "category", "task_type", "target_concept"],
213
+ "properties": {
214
+ "bullet_id": { "type": "string" },
215
+ "case_id": { "type": "string" },
216
+ "category": {
217
+ "type": "string",
218
+ "enum": ["failure_pattern", "successful_hint", "task_strategy", "tool_usage"]
219
+ },
220
+ "task_type": {
221
+ "type": "string",
222
+ "enum": ["code", "reasoning", "writing", "general"]
223
+ },
224
+ "target_concept": { "type": "string" },
225
+ "origin": {
226
+ "type": "string",
227
+ "enum": ["agent_failure", "human_session", "manual"]
228
+ }
229
+ }
230
+ },
231
+ "meridian.playbook.updated": {
232
+ "type": "object",
233
+ "additionalProperties": false,
234
+ "required": ["scope_id", "operation", "bullet_count_after"],
235
+ "properties": {
236
+ "scope_id": { "type": "string" },
237
+ "operation": {
238
+ "type": "string",
239
+ "enum": ["append", "update", "deduplicate", "promote", "retire"]
240
+ },
241
+ "bullet_count_after": { "type": "integer", "minimum": 0 },
242
+ "bullets_removed": { "type": "integer", "minimum": 0 }
243
+ }
244
+ }
245
+ }
246
+ }
@@ -0,0 +1,126 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://onlooker.community/schemas/payload/plugins-safety.json",
4
+ "title": "Safety plugin payloads",
5
+ "description": "Payload schemas for sentinel.*, tribunal.*, and warden.* events.",
6
+ "$defs": {
7
+ "sentinel.blocked": {
8
+ "type": "object",
9
+ "additionalProperties": false,
10
+ "required": ["command", "risk_level", "matched_pattern"],
11
+ "properties": {
12
+ "command": { "type": "string" },
13
+ "risk_level": { "type": "string", "enum": ["critical", "high", "medium"] },
14
+ "matched_pattern": { "type": "string" },
15
+ "reason": { "type": "string" }
16
+ }
17
+ },
18
+ "sentinel.allowed": {
19
+ "type": "object",
20
+ "additionalProperties": false,
21
+ "required": ["command", "risk_level"],
22
+ "properties": {
23
+ "command": { "type": "string" },
24
+ "risk_level": { "type": "string", "enum": ["low", "none"] },
25
+ "review_required": { "type": "boolean" }
26
+ }
27
+ },
28
+ "sentinel.reviewed": {
29
+ "type": "object",
30
+ "additionalProperties": false,
31
+ "required": ["command", "decision"],
32
+ "properties": {
33
+ "command": { "type": "string" },
34
+ "decision": { "type": "string", "enum": ["approved", "rejected"] },
35
+ "review_duration_ms": { "type": "integer", "minimum": 0 }
36
+ }
37
+ },
38
+ "tribunal.verdict": {
39
+ "type": "object",
40
+ "additionalProperties": false,
41
+ "required": ["task_id", "score", "passed", "judge_type"],
42
+ "properties": {
43
+ "task_id": { "type": "string" },
44
+ "score": { "type": "number", "minimum": 0, "maximum": 1 },
45
+ "passed": { "type": "boolean" },
46
+ "judge_type": {
47
+ "type": "string",
48
+ "enum": ["standard", "security", "maintainability", "adversarial", "domain", "meta"]
49
+ },
50
+ "feedback_summary": { "type": "string" },
51
+ "file_path": { "type": "string" }
52
+ }
53
+ },
54
+ "tribunal.actor.complete": {
55
+ "type": "object",
56
+ "additionalProperties": false,
57
+ "required": ["task_id", "success"],
58
+ "properties": {
59
+ "task_id": { "type": "string" },
60
+ "success": { "type": "boolean" },
61
+ "duration_ms": { "type": "integer", "minimum": 0 },
62
+ "skepticism_rounds": { "type": "integer", "minimum": 0 }
63
+ }
64
+ },
65
+ "tribunal.meta.complete": {
66
+ "type": "object",
67
+ "additionalProperties": false,
68
+ "required": ["task_id", "verdict_quality", "bias_detected"],
69
+ "properties": {
70
+ "task_id": { "type": "string" },
71
+ "verdict_quality": { "type": "string", "enum": ["sound", "questionable", "biased"] },
72
+ "bias_detected": { "type": "boolean" },
73
+ "override_recommendation": {
74
+ "type": "string",
75
+ "enum": ["accept", "reject", "re-evaluate"]
76
+ }
77
+ }
78
+ },
79
+ "warden.threat.detected": {
80
+ "type": "object",
81
+ "additionalProperties": false,
82
+ "required": ["source_type", "threat_type", "confidence"],
83
+ "properties": {
84
+ "source_type": { "type": "string", "enum": ["web_fetch", "file_read"] },
85
+ "threat_type": {
86
+ "type": "string",
87
+ "enum": [
88
+ "prompt_injection",
89
+ "instruction_override",
90
+ "credential_exfiltration",
91
+ "command_injection",
92
+ "social_engineering"
93
+ ]
94
+ },
95
+ "confidence": { "type": "number", "minimum": 0, "maximum": 1 },
96
+ "source_url": { "type": "string" },
97
+ "source_path": { "type": "string" },
98
+ "snippet": { "type": "string" }
99
+ }
100
+ },
101
+ "warden.threat.cleared": {
102
+ "type": "object",
103
+ "additionalProperties": false,
104
+ "required": ["source_type"],
105
+ "properties": {
106
+ "source_type": { "type": "string", "enum": ["web_fetch", "file_read"] },
107
+ "cleared_by": {
108
+ "type": "string",
109
+ "enum": ["timeout", "user_override", "subsequent_scan_clean"]
110
+ }
111
+ }
112
+ },
113
+ "warden.gate.blocked": {
114
+ "type": "object",
115
+ "additionalProperties": false,
116
+ "required": ["blocked_operation", "threat_source_type"],
117
+ "properties": {
118
+ "blocked_operation": {
119
+ "type": "string",
120
+ "enum": ["tool.file.write", "tool.file.edit", "tool.shell.exec"]
121
+ },
122
+ "threat_source_type": { "type": "string", "enum": ["web_fetch", "file_read"] }
123
+ }
124
+ }
125
+ }
126
+ }
@@ -0,0 +1,54 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://onlooker.community/schemas/payload/session.json",
4
+ "title": "Session payloads",
5
+ "description": "Payload schemas for the session.* event family.",
6
+ "$defs": {
7
+ "session.start": {
8
+ "type": "object",
9
+ "additionalProperties": false,
10
+ "required": ["working_directory"],
11
+ "properties": {
12
+ "working_directory": { "type": "string" },
13
+ "git_branch": { "type": "string" },
14
+ "git_commit": { "type": "string" },
15
+ "resume_of_session_id": { "type": "string" }
16
+ }
17
+ },
18
+ "session.end": {
19
+ "type": "object",
20
+ "additionalProperties": false,
21
+ "required": ["duration_ms", "turn_count"],
22
+ "properties": {
23
+ "duration_ms": { "type": "integer", "minimum": 0 },
24
+ "turn_count": { "type": "integer", "minimum": 0 },
25
+ "total_cost_usd": { "type": "number", "minimum": 0 },
26
+ "total_tokens": { "type": "integer", "minimum": 0 },
27
+ "end_reason": {
28
+ "type": "string",
29
+ "enum": ["user_exit", "timeout", "error", "task_complete", "unknown"]
30
+ }
31
+ }
32
+ },
33
+ "session.compact": {
34
+ "type": "object",
35
+ "additionalProperties": false,
36
+ "required": ["tokens_before", "tokens_after"],
37
+ "properties": {
38
+ "tokens_before": { "type": "integer", "minimum": 0 },
39
+ "tokens_after": { "type": "integer", "minimum": 0 },
40
+ "compression_ratio": { "type": "number", "minimum": 0, "maximum": 1 }
41
+ }
42
+ },
43
+ "session.prompt": {
44
+ "type": "object",
45
+ "additionalProperties": false,
46
+ "required": ["turn_number"],
47
+ "properties": {
48
+ "turn_number": { "type": "integer", "minimum": 1 },
49
+ "input_summary": { "type": "string" },
50
+ "context_tokens": { "type": "integer", "minimum": 0 }
51
+ }
52
+ }
53
+ }
54
+ }
@@ -0,0 +1,85 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://onlooker.community/schemas/payload/tool.json",
4
+ "title": "Tool payloads",
5
+ "description": "Payload schemas for the tool.* event family.",
6
+ "$defs": {
7
+ "tool.file.read": {
8
+ "type": "object",
9
+ "additionalProperties": false,
10
+ "required": ["path"],
11
+ "properties": {
12
+ "path": { "type": "string" },
13
+ "lines_read": { "type": "integer", "minimum": 0 },
14
+ "file_size_bytes": { "type": "integer", "minimum": 0 }
15
+ }
16
+ },
17
+ "tool.file.write": {
18
+ "type": "object",
19
+ "additionalProperties": false,
20
+ "required": ["path", "operation"],
21
+ "properties": {
22
+ "path": { "type": "string" },
23
+ "operation": { "type": "string", "enum": ["create", "overwrite"] },
24
+ "bytes_written": { "type": "integer", "minimum": 0 },
25
+ "lines_written": { "type": "integer", "minimum": 0 }
26
+ }
27
+ },
28
+ "tool.file.edit": {
29
+ "type": "object",
30
+ "additionalProperties": false,
31
+ "required": ["path"],
32
+ "properties": {
33
+ "path": { "type": "string" },
34
+ "lines_changed": { "type": "integer", "minimum": 0 }
35
+ }
36
+ },
37
+ "tool.shell.exec": {
38
+ "type": "object",
39
+ "additionalProperties": false,
40
+ "required": ["command"],
41
+ "properties": {
42
+ "command": { "type": "string" },
43
+ "exit_code": { "type": "integer" },
44
+ "duration_ms": { "type": "integer", "minimum": 0 },
45
+ "working_directory": { "type": "string" },
46
+ "blocked": { "type": "boolean" }
47
+ }
48
+ },
49
+ "tool.web.fetch": {
50
+ "type": "object",
51
+ "additionalProperties": false,
52
+ "required": ["url"],
53
+ "properties": {
54
+ "url": { "type": "string", "format": "uri" },
55
+ "status_code": { "type": "integer", "minimum": 100, "maximum": 599 },
56
+ "response_bytes": { "type": "integer", "minimum": 0 },
57
+ "blocked": { "type": "boolean" }
58
+ }
59
+ },
60
+ "tool.agent.spawn": {
61
+ "type": "object",
62
+ "additionalProperties": false,
63
+ "required": ["subagent_id"],
64
+ "properties": {
65
+ "subagent_id": { "type": "string" },
66
+ "agent_name": { "type": "string" },
67
+ "task_summary": { "type": "string" },
68
+ "blocked": { "type": "boolean" }
69
+ }
70
+ },
71
+ "tool.agent.complete": {
72
+ "type": "object",
73
+ "additionalProperties": false,
74
+ "required": ["subagent_id", "success"],
75
+ "properties": {
76
+ "subagent_id": { "type": "string" },
77
+ "success": { "type": "boolean" },
78
+ "agent_name": { "type": "string" },
79
+ "duration_ms": { "type": "integer", "minimum": 0 },
80
+ "cost_usd": { "type": "number", "minimum": 0 },
81
+ "output_summary": { "type": "string" }
82
+ }
83
+ }
84
+ }
85
+ }