Skip to content

Commit bfd902c

Browse files
committed
Replay helper causal receipt schema on current main
1 parent 4883a93 commit bfd902c

1 file changed

Lines changed: 94 additions & 0 deletions

File tree

Lines changed: 94 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
1+
{
2+
"$schema": "https://json-schema.org/draft/2020-12/schema",
3+
"$id": "https://sourceos.local/schemas/helper-causal-receipts.schema.json",
4+
"title": "Helper Causal Receipts v0.1",
5+
"type": "object",
6+
"required": ["schema", "event_type", "event_id", "timestamp", "root_intent_id"],
7+
"properties": {
8+
"schema": { "const": "sourceos.helper_causal_receipt.v0.1" },
9+
"event_type": {
10+
"enum": [
11+
"root_intent.created",
12+
"helper.spawn",
13+
"capability.request",
14+
"helper.exit",
15+
"teardown.normalized",
16+
"policy.decision",
17+
"data.touch"
18+
]
19+
},
20+
"event_id": { "type": "string", "minLength": 8 },
21+
"parent_event_id": { "type": ["string", "null"] },
22+
"root_intent_id": { "type": "string", "pattern": "^intent\\." },
23+
"timestamp": { "type": "string" },
24+
"surface": { "type": ["string", "null"] },
25+
"actor": { "type": ["object", "null"], "additionalProperties": true },
26+
"declared_purpose": { "type": ["string", "null"] },
27+
"data_scope": { "type": ["object", "array", "null"] },
28+
"default_policy": { "type": ["string", "null"] },
29+
"receipt_required": { "type": ["boolean", "null"] },
30+
"parent_process": { "type": ["string", "null"] },
31+
"child_process": { "type": ["string", "null"] },
32+
"process": { "type": ["string", "null"] },
33+
"pid": { "type": ["integer", "null"] },
34+
"trigger": { "type": ["string", "null"] },
35+
"spawn_reason": { "type": ["string", "null"] },
36+
"policy_profile": { "type": ["string", "null"] },
37+
"expected_lifetime_ms": { "type": ["integer", "null"], "minimum": 0 },
38+
"capability_budget": { "type": ["object", "null"] },
39+
"requestor": { "type": ["string", "null"] },
40+
"capability": { "type": ["string", "null"] },
41+
"requested_service": { "type": ["string", "null"] },
42+
"decision": { "enum": ["allow", "deny", "degrade", "missing", "unknown", null] },
43+
"classification": {
44+
"enum": [
45+
"expected_denial",
46+
"unexpected_denial",
47+
"compatibility_probe",
48+
"policy_regression",
49+
"malicious_probe_candidate",
50+
"missing_service",
51+
"teardown_race",
52+
"duplicate_activation_coalesced",
53+
"supervisor_worker_lifecycle_kill",
54+
"unknown",
55+
null
56+
]
57+
},
58+
"policy_rule": { "type": ["string", "null"] },
59+
"data_accessed": { "type": ["boolean", "null"] },
60+
"exit_status": { "type": ["string", "null"] },
61+
"duration_ms": { "type": ["integer", "null"], "minimum": 0 },
62+
"children_cleaned": { "type": ["boolean", "null"] },
63+
"unexpected_denials": { "type": ["integer", "null"], "minimum": 0 },
64+
"network_used": { "type": ["boolean", "null"] },
65+
"receipt_complete": { "type": ["boolean", "null"] },
66+
"raw_message": { "type": ["string", "null"] },
67+
"normalized_class": { "type": ["string", "null"] },
68+
"severity": { "enum": ["trace", "info", "notice", "warning", "error", "critical", null] },
69+
"meaning": { "type": ["string", "null"] },
70+
"policy_impact": { "type": ["string", "null"] },
71+
"service_key": { "type": ["string", "null"] },
72+
"service_uuid": { "type": ["string", "null"] },
73+
"service_family_role": { "type": ["string", "null"] },
74+
"phase": { "type": ["string", "null"] },
75+
"line_no": { "type": ["integer", "null"] },
76+
"tags": { "type": ["array", "null"], "items": { "type": "string" } },
77+
"inference_confidence": { "enum": ["high", "medium", "low", "unknown", null] }
78+
},
79+
"allOf": [
80+
{
81+
"if": { "properties": { "event_type": { "const": "helper.spawn" } } },
82+
"then": { "required": ["parent_process", "child_process", "trigger", "spawn_reason", "policy_profile"] }
83+
},
84+
{
85+
"if": { "properties": { "event_type": { "const": "capability.request" } } },
86+
"then": { "required": ["requestor", "capability", "requested_service", "decision", "classification", "data_accessed"] }
87+
},
88+
{
89+
"if": { "properties": { "event_type": { "const": "helper.exit" } } },
90+
"then": { "required": ["process", "exit_status", "duration_ms", "receipt_complete"] }
91+
}
92+
],
93+
"additionalProperties": true
94+
}

0 commit comments

Comments
 (0)