@mplp/schema 1.0.4 → 1.0.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.
Files changed (43) hide show
  1. package/LICENSE +17 -0
  2. package/LICENSE.txt +201 -201
  3. package/README.md +25 -7
  4. package/dist/index.d.ts +1 -0
  5. package/dist/index.js +15 -0
  6. package/dist/kernel-duties.d.ts +9 -0
  7. package/dist/kernel-duties.js +19 -0
  8. package/package.json +17 -7
  9. package/schemas/common/common-types.schema.json +49 -49
  10. package/schemas/common/events.schema.json +66 -66
  11. package/schemas/common/identifiers.schema.json +13 -13
  12. package/schemas/common/learning-sample.schema.json +194 -194
  13. package/schemas/common/metadata.schema.json +115 -113
  14. package/schemas/common/trace-base.schema.json +43 -43
  15. package/schemas/events/mplp-event-core.schema.json +58 -58
  16. package/schemas/events/mplp-graph-update-event.schema.json +58 -58
  17. package/schemas/events/mplp-map-event.schema.json +147 -147
  18. package/schemas/events/mplp-pipeline-stage-event.schema.json +56 -56
  19. package/schemas/events/mplp-runtime-execution-event.schema.json +58 -58
  20. package/schemas/events/mplp-sa-event.schema.json +109 -109
  21. package/schemas/integration/mplp-ci-event.schema.json +130 -130
  22. package/schemas/integration/mplp-file-update-event.schema.json +70 -70
  23. package/schemas/integration/mplp-git-event.schema.json +98 -98
  24. package/schemas/integration/mplp-tool-event.schema.json +83 -83
  25. package/schemas/invariants/integration-invariants.yaml +139 -147
  26. package/schemas/invariants/learning-invariants.yaml +98 -106
  27. package/schemas/invariants/map-invariants.yaml +65 -73
  28. package/schemas/invariants/observability-invariants.yaml +98 -106
  29. package/schemas/invariants/sa-invariants.yaml +64 -72
  30. package/schemas/kernel-duties.json +18 -0
  31. package/schemas/learning/mplp-learning-sample-core.schema.json +94 -94
  32. package/schemas/learning/mplp-learning-sample-delta.schema.json +137 -137
  33. package/schemas/learning/mplp-learning-sample-intent.schema.json +119 -119
  34. package/schemas/mplp-collab.schema.json +243 -243
  35. package/schemas/mplp-confirm.schema.json +226 -226
  36. package/schemas/mplp-context.schema.json +246 -246
  37. package/schemas/mplp-core.schema.json +183 -183
  38. package/schemas/mplp-dialog.schema.json +198 -198
  39. package/schemas/mplp-extension.schema.json +179 -179
  40. package/schemas/mplp-network.schema.json +230 -230
  41. package/schemas/mplp-plan.schema.json +193 -193
  42. package/schemas/mplp-role.schema.json +139 -139
  43. package/schemas/mplp-trace.schema.json +216 -216
@@ -1,106 +1,98 @@
1
- # MPLP v1.0.0 FROZEN – Invariant Set
2
- # © 2025 邦士(北京)网络科技有限公司 – Apache-2.0
3
- # Governance: MPLP Protocol Governance Committee (MPGC)
4
-
5
- # MPLP Protocol v1.0.0 — Frozen Specification
6
- # Freeze Date: 2025-12-03
7
- # Status: FROZEN (no breaking changes permitted)
8
- # Governance: MPLP Protocol Governance Committee (MPGC)
9
- # © 2025 邦士(北京)网络科技有限公司
10
- # License: Apache-2.0
11
- # Any normative change requires a new protocol version.
12
-
13
- # MPLP Protocol 1.0.0 — Frozen Specification
14
- # Status: Frozen as of 2025-11-30
15
- # Copyright: © 2025 邦士(北京)网络科技有限公司
16
- # License: Apache-2.0 (see LICENSE at repository root)
17
- # Any normative change requires a new protocol version.
18
-
19
- invariants:
20
- # Core LearningSample Structure Invariants
21
- - id: learning_sample_id_is_uuid
22
- scope: learning_sample
23
- path: sample_id
24
- rule: uuid-v4
25
- description: "All LearningSamples must have UUID v4 sample_id"
26
-
27
- - id: learning_sample_family_non_empty
28
- scope: learning_sample
29
- path: sample_family
30
- rule: non-empty-string
31
- description: "LearningSample must have non-empty sample_family"
32
-
33
- - id: learning_sample_created_at_iso
34
- scope: learning_sample
35
- path: created_at
36
- rule: iso-datetime
37
- description: "LearningSample created_at must be ISO 8601 timestamp"
38
-
39
- # Input/Output Existence (using non-empty-string on a required sub-field if possible)
40
- - id: learning_sample_has_input_section
41
- scope: learning_sample
42
- path: input
43
- rule: exists
44
- description: "LearningSample must have input section"
45
-
46
- - id: learning_sample_has_output_section
47
- scope: learning_sample
48
- path: output
49
- rule: exists
50
- description: "LearningSample must have output section"
51
-
52
- # Meta Field Invariants (optional but validate when present)
53
- - id: learning_sample_feedback_label_valid
54
- scope: learning_sample
55
- path: meta.human_feedback_label
56
- rule: enum(approved,rejected,not_reviewed)
57
- description: "If human_feedback_label present, must be valid enum"
58
- note: "Apply only when meta.human_feedback_label exists"
59
-
60
- - id: learning_sample_source_flow_non_empty
61
- scope: learning_sample
62
- path: meta.source_flow_id
63
- rule: non-empty-string
64
- description: "If source_flow_id present, must be non-empty"
65
- note: "Apply only when meta.source_flow_id exists"
66
-
67
- # Intent Resolution Family Invariants
68
- - id: learning_intent_has_intent_id
69
- scope: learning_sample
70
- path: input.intent_id
71
- rule: non-empty-string
72
- description: "Intent resolution samples must have intent_id in input"
73
- note: "Apply when sample_family == intent_resolution"
74
-
75
- - id: learning_intent_quality_label_valid
76
- scope: learning_sample
77
- path: output.resolution_quality_label
78
- rule: enum(good,acceptable,bad,unknown)
79
- description: "Intent resolution quality label must be valid enum if present"
80
- note: "Apply when sample_family == intent_resolution AND field exists"
81
-
82
- # Delta Impact Family Invariants
83
- - id: learning_delta_has_delta_id
84
- scope: learning_sample
85
- path: input.delta_id
86
- rule: non-empty-string
87
- description: "Delta impact samples must have delta_id in input"
88
- note: "Apply when sample_family == delta_impact"
89
-
90
- - id: learning_delta_scope_valid
91
- scope: learning_sample
92
- path: output.impact_scope
93
- rule: enum(local,module,system,global)
94
- description: "Delta impact scope must be valid enum"
95
- note: "Apply when sample_family == delta_impact"
96
-
97
- - id: learning_delta_risk_valid
98
- scope: learning_sample
99
- path: state.risk_level
100
- rule: enum(low,medium,high,critical)
101
- description: "Delta risk level must be valid enum if present"
102
- note: "Apply when sample_family == delta_impact AND field exists"
103
- # Note: Conditional invariants (based on sample_family) are indicated in "note" fields.
104
- # If the invariant engine does not support conditional application, these should be
105
- # enforced at the schema level (already done in family-specific schemas) or during
106
- # runtime validation. These invariants provide an additional validation layer.
1
+ # MPLP v1.0.0 FROZEN – Invariant Set
2
+ # © 2026 Bangshi Beijing Network Technology Limited Company – Apache-2.0
3
+ # Governance: MPLP Protocol Governance Committee (MPGC)
4
+
5
+ # MPLP Protocol 1.0.0 — Frozen Specification
6
+ # Status: Frozen as of 2025-11-30
7
+ # Copyright: © 2026 Bangshi Beijing Network Technology Limited Company
8
+ # License: Apache-2.0 (see LICENSE at repository root)
9
+ # Any normative change requires a new protocol version.
10
+
11
+ invariants:
12
+ # Core LearningSample Structure Invariants
13
+ - id: learning_sample_id_is_uuid
14
+ scope: learning_sample
15
+ path: sample_id
16
+ rule: uuid-v4
17
+ description: "All LearningSamples must have UUID v4 sample_id"
18
+
19
+ - id: learning_sample_family_non_empty
20
+ scope: learning_sample
21
+ path: sample_family
22
+ rule: non-empty-string
23
+ description: "LearningSample must have non-empty sample_family"
24
+
25
+ - id: learning_sample_created_at_iso
26
+ scope: learning_sample
27
+ path: created_at
28
+ rule: iso-datetime
29
+ description: "LearningSample created_at must be ISO 8601 timestamp"
30
+
31
+ # Input/Output Existence (using non-empty-string on a required sub-field if possible)
32
+ - id: learning_sample_has_input_section
33
+ scope: learning_sample
34
+ path: input
35
+ rule: exists
36
+ description: "LearningSample must have input section"
37
+
38
+ - id: learning_sample_has_output_section
39
+ scope: learning_sample
40
+ path: output
41
+ rule: exists
42
+ description: "LearningSample must have output section"
43
+
44
+ # Meta Field Invariants (optional but validate when present)
45
+ - id: learning_sample_feedback_label_valid
46
+ scope: learning_sample
47
+ path: meta.human_feedback_label
48
+ rule: enum(approved,rejected,not_reviewed)
49
+ description: "If human_feedback_label present, must be valid enum"
50
+ note: "Apply only when meta.human_feedback_label exists"
51
+
52
+ - id: learning_sample_source_flow_non_empty
53
+ scope: learning_sample
54
+ path: meta.source_flow_id
55
+ rule: non-empty-string
56
+ description: "If source_flow_id present, must be non-empty"
57
+ note: "Apply only when meta.source_flow_id exists"
58
+
59
+ # Intent Resolution Family Invariants
60
+ - id: learning_intent_has_intent_id
61
+ scope: learning_sample
62
+ path: input.intent_id
63
+ rule: non-empty-string
64
+ description: "Intent resolution samples must have intent_id in input"
65
+ note: "Apply when sample_family == intent_resolution"
66
+
67
+ - id: learning_intent_quality_label_valid
68
+ scope: learning_sample
69
+ path: output.resolution_quality_label
70
+ rule: enum(good,acceptable,bad,unknown)
71
+ description: "Intent resolution quality label must be valid enum if present"
72
+ note: "Apply when sample_family == intent_resolution AND field exists"
73
+
74
+ # Delta Impact Family Invariants
75
+ - id: learning_delta_has_delta_id
76
+ scope: learning_sample
77
+ path: input.delta_id
78
+ rule: non-empty-string
79
+ description: "Delta impact samples must have delta_id in input"
80
+ note: "Apply when sample_family == delta_impact"
81
+
82
+ - id: learning_delta_scope_valid
83
+ scope: learning_sample
84
+ path: output.impact_scope
85
+ rule: enum(local,module,system,global)
86
+ description: "Delta impact scope must be valid enum"
87
+ note: "Apply when sample_family == delta_impact"
88
+
89
+ - id: learning_delta_risk_valid
90
+ scope: learning_sample
91
+ path: state.risk_level
92
+ rule: enum(low,medium,high,critical)
93
+ description: "Delta risk level must be valid enum if present"
94
+ note: "Apply when sample_family == delta_impact AND field exists"
95
+ # Note: Conditional invariants (based on sample_family) are indicated in "note" fields.
96
+ # If the invariant engine does not support conditional application, these should be
97
+ # enforced at the schema level (already done in family-specific schemas) or during
98
+ # runtime validation. These invariants provide an additional validation layer.
@@ -1,73 +1,65 @@
1
- # MPLP v1.0.0 FROZEN – Invariant Set
2
- # © 2025 邦士(北京)网络科技有限公司 – Apache-2.0
3
- # Governance: MPLP Protocol Governance Committee (MPGC)
4
-
5
- # MPLP Protocol v1.0.0 — Frozen Specification
6
- # Freeze Date: 2025-12-03
7
- # Status: FROZEN (no breaking changes permitted)
8
- # Governance: MPLP Protocol Governance Committee (MPGC)
9
- # © 2025 邦士(北京)网络科技有限公司
10
- # License: Apache-2.0
11
- # Any normative change requires a new protocol version.
12
-
13
- # MPLP Protocol 1.0.0 — Frozen Specification
14
- # Status: Frozen as of 2025-11-30
15
- # Copyright: © 2025 邦士(北京)网络科技有限公司
16
- # License: Apache-2.0 (see LICENSE at repository root)
17
- # Any normative change requires a new protocol version.
18
-
19
- invariants:
20
- # Session structure invariants
21
- - id: map_session_requires_multiple_participants
22
- scope: collab
23
- path: participants
24
- rule: min-length(2)
25
- description: "MAP sessions require at least 2 participants for multi-agent collaboration"
26
-
27
- - id: map_collab_mode_valid
28
- scope: collab
29
- path: mode
30
- rule: enum(broadcast,round_robin,orchestrated,swarm,pair)
31
- description: "Collab.mode must be valid collaboration pattern"
32
-
33
- - id: map_session_id_is_uuid
34
- scope: collab
35
- path: collab_id
36
- rule: uuid-v4
37
- description: "Session ID (collab_id) must be valid UUID v4"
38
-
39
- - id: map_participants_have_role_ids
40
- scope: collab
41
- path: participants[*].role_id
42
- rule: non-empty-string
43
- description: "All participants must have valid role_id binding"
44
-
45
- # Event consistency invariants (descriptive, not all auto-enforceable)
46
- - id: map_turn_completion_matches_dispatch
47
- scope: trace
48
- description: "Every MAPTurnDispatched event should have a corresponding MAPTurnCompleted event for the same session_id and role_id"
49
- note: "This is a higher-level invariant that requires trace event analysis. Mark as manual check or implement custom rule."
50
-
51
- - id: map_broadcast_has_receivers
52
- scope: trace
53
- description: "If MAPBroadcastSent exists, at least one MAPBroadcastReceived must exist for the same session_id"
54
- note: "Requires cross-event validation. Can be checked via trace event count."
55
-
56
- # Role binding invariants
57
- - id: map_role_ids_are_uuids
58
- scope: collab
59
- path: participants[*].role_id
60
- rule: uuid-v4
61
- description: "All role_id values must be valid UUID v4 format"
62
-
63
- - id: map_participant_ids_are_non_empty
64
- scope: collab
65
- path: participants[*].participant_id
66
- rule: non-empty-string
67
- description: "All participant_id values must be non-empty strings"
68
-
69
- - id: map_participant_kind_valid
70
- scope: collab
71
- path: participants[*].kind
72
- rule: enum(agent,human,system,external)
73
- description: "Participant kind must be valid enum value"
1
+ # MPLP v1.0.0 FROZEN – Invariant Set
2
+ # © 2026 Bangshi Beijing Network Technology Limited Company – Apache-2.0
3
+ # Governance: MPLP Protocol Governance Committee (MPGC)
4
+
5
+ # MPLP Protocol 1.0.0 — Frozen Specification
6
+ # Status: Frozen as of 2025-11-30
7
+ # Copyright: © 2026 Bangshi Beijing Network Technology Limited Company
8
+ # License: Apache-2.0 (see LICENSE at repository root)
9
+ # Any normative change requires a new protocol version.
10
+
11
+ invariants:
12
+ # Session structure invariants
13
+ - id: map_session_requires_multiple_participants
14
+ scope: collab
15
+ path: participants
16
+ rule: min-length(2)
17
+ description: "MAP sessions require at least 2 participants for multi-agent collaboration"
18
+
19
+ - id: map_collab_mode_valid
20
+ scope: collab
21
+ path: mode
22
+ rule: enum(broadcast,round_robin,orchestrated,swarm,pair)
23
+ description: "Collab.mode must be valid collaboration pattern"
24
+
25
+ - id: map_session_id_is_uuid
26
+ scope: collab
27
+ path: collab_id
28
+ rule: uuid-v4
29
+ description: "Session ID (collab_id) must be valid UUID v4"
30
+
31
+ - id: map_participants_have_role_ids
32
+ scope: collab
33
+ path: participants[*].role_id
34
+ rule: non-empty-string
35
+ description: "All participants must have valid role_id binding"
36
+
37
+ # Event consistency invariants (descriptive, not all auto-enforceable)
38
+ - id: map_turn_completion_matches_dispatch
39
+ scope: trace
40
+ description: "Every MAPTurnDispatched event should have a corresponding MAPTurnCompleted event for the same session_id and role_id"
41
+ note: "This is a higher-level invariant that requires trace event analysis. Mark as manual check or implement custom rule."
42
+
43
+ - id: map_broadcast_has_receivers
44
+ scope: trace
45
+ description: "If MAPBroadcastSent exists, at least one MAPBroadcastReceived must exist for the same session_id"
46
+ note: "Requires cross-event validation. Can be checked via trace event count."
47
+
48
+ # Role binding invariants
49
+ - id: map_role_ids_are_uuids
50
+ scope: collab
51
+ path: participants[*].role_id
52
+ rule: uuid-v4
53
+ description: "All role_id values must be valid UUID v4 format"
54
+
55
+ - id: map_participant_ids_are_non_empty
56
+ scope: collab
57
+ path: participants[*].participant_id
58
+ rule: non-empty-string
59
+ description: "All participant_id values must be non-empty strings"
60
+
61
+ - id: map_participant_kind_valid
62
+ scope: collab
63
+ path: participants[*].kind
64
+ rule: enum(agent,human,system,external)
65
+ description: "Participant kind must be valid enum value"
@@ -1,106 +1,98 @@
1
- # MPLP v1.0.0 FROZEN – Invariant Set
2
- # © 2025 邦士(北京)网络科技有限公司 – Apache-2.0
3
- # Governance: MPLP Protocol Governance Committee (MPGC)
4
-
5
- # MPLP Protocol v1.0.0 — Frozen Specification
6
- # Freeze Date: 2025-12-03
7
- # Status: FROZEN (no breaking changes permitted)
8
- # Governance: MPLP Protocol Governance Committee (MPGC)
9
- # © 2025 邦士(北京)网络科技有限公司
10
- # License: Apache-2.0
11
- # Any normative change requires a new protocol version.
12
-
13
- # MPLP Protocol 1.0.0 — Frozen Specification
14
- # Status: Frozen as of 2025-11-30
15
- # Copyright: © 2025 邦士(北京)网络科技有限公司
16
- # License: Apache-2.0 (see LICENSE at repository root)
17
- # Any normative change requires a new protocol version.
18
-
19
- invariants:
20
- # Core Event Structure Invariants
21
- - id: obs_event_id_is_uuid
22
- scope: event
23
- path: event_id
24
- rule: uuid-v4
25
- description: "All events must have UUID v4 event_id"
26
-
27
- - id: obs_event_type_non_empty
28
- scope: event
29
- path: event_type
30
- rule: non-empty-string
31
- description: "All events must have non-empty event_type"
32
-
33
- - id: obs_event_family_valid
34
- scope: event
35
- path: event_family
36
- rule: enum(import_process,intent,delta_intent,impact_analysis,compensation_plan,methodology,reasoning_graph,pipeline_stage,graph_update,runtime_execution,cost_budget,external_integration)
37
- description: "Event family must be valid enum value"
38
-
39
- - id: obs_timestamp_iso_format
40
- scope: event
41
- path: timestamp
42
- rule: iso-datetime
43
- description: "All events must have ISO 8601 timestamp"
44
-
45
- # PipelineStageEvent Specific Invariants
46
- - id: obs_pipeline_event_has_pipeline_id
47
- scope: event
48
- path: pipeline_id
49
- rule: uuid-v4
50
- description: "PipelineStageEvent must have valid pipeline_id"
51
- note: "Apply when event_family == pipeline_stage"
52
-
53
- - id: obs_pipeline_stage_id_non_empty
54
- scope: event
55
- path: stage_id
56
- rule: non-empty-string
57
- description: "PipelineStageEvent must have non-empty stage_id"
58
- note: "Apply when event_family == pipeline_stage"
59
-
60
- - id: obs_pipeline_stage_status_valid
61
- scope: event
62
- path: stage_status
63
- rule: enum(pending,running,completed,failed,skipped)
64
- description: "PipelineStageEvent stage_status must be valid enum"
65
- note: "Apply when event_family == pipeline_stage"
66
-
67
- # GraphUpdateEvent Specific Invariants
68
- - id: obs_graph_event_has_graph_id
69
- scope: event
70
- path: graph_id
71
- rule: uuid-v4
72
- description: "GraphUpdateEvent must have valid graph_id"
73
- note: "Apply when event_family == graph_update"
74
-
75
- - id: obs_graph_update_kind_valid
76
- scope: event
77
- path: update_kind
78
- rule: enum(node_add,node_update,node_delete,edge_add,edge_update,edge_delete,bulk)
79
- description: "GraphUpdateEvent update_kind must be valid enum"
80
- note: "Apply when event_family == graph_update"
81
-
82
- # RuntimeExecutionEvent Specific Invariants
83
- - id: obs_runtime_event_has_execution_id
84
- scope: event
85
- path: execution_id
86
- rule: uuid-v4
87
- description: "RuntimeExecutionEvent must have valid execution_id"
88
- note: "Apply when event_family == runtime_execution"
89
-
90
- - id: obs_runtime_executor_kind_valid
91
- scope: event
92
- path: executor_kind
93
- rule: enum(agent,tool,llm,worker,external)
94
- description: "RuntimeExecutionEvent executor_kind must be valid enum"
95
- note: "Apply when event_family == runtime_execution"
96
-
97
- - id: obs_runtime_status_valid
98
- scope: event
99
- path: status
100
- rule: enum(pending,running,completed,failed,cancelled)
101
- description: "RuntimeExecutionEvent status must be valid enum"
102
- note: "Apply when event_family == runtime_execution"
103
- # Note: The "note" fields indicate conditional application based on event_family.
104
- # If the invariant engine does not support conditional rules, these should be
105
- # validated at the schema level (which is already done in the event schemas).
106
- # These invariants provide additional layer of validation for runtime enforcement.
1
+ # MPLP v1.0.0 FROZEN – Invariant Set
2
+ # © 2026 Bangshi Beijing Network Technology Limited Company – Apache-2.0
3
+ # Governance: MPLP Protocol Governance Committee (MPGC)
4
+
5
+ # MPLP Protocol 1.0.0 — Frozen Specification
6
+ # Status: Frozen as of 2025-11-30
7
+ # Copyright: © 2026 Bangshi Beijing Network Technology Limited Company
8
+ # License: Apache-2.0 (see LICENSE at repository root)
9
+ # Any normative change requires a new protocol version.
10
+
11
+ invariants:
12
+ # Core Event Structure Invariants
13
+ - id: obs_event_id_is_uuid
14
+ scope: event
15
+ path: event_id
16
+ rule: uuid-v4
17
+ description: "All events must have UUID v4 event_id"
18
+
19
+ - id: obs_event_type_non_empty
20
+ scope: event
21
+ path: event_type
22
+ rule: non-empty-string
23
+ description: "All events must have non-empty event_type"
24
+
25
+ - id: obs_event_family_valid
26
+ scope: event
27
+ path: event_family
28
+ rule: enum(import_process,intent,delta_intent,impact_analysis,compensation_plan,methodology,reasoning_graph,pipeline_stage,graph_update,runtime_execution,cost_budget,external_integration)
29
+ description: "Event family must be valid enum value"
30
+
31
+ - id: obs_timestamp_iso_format
32
+ scope: event
33
+ path: timestamp
34
+ rule: iso-datetime
35
+ description: "All events must have ISO 8601 timestamp"
36
+
37
+ # PipelineStageEvent Specific Invariants
38
+ - id: obs_pipeline_event_has_pipeline_id
39
+ scope: event
40
+ path: pipeline_id
41
+ rule: uuid-v4
42
+ description: "PipelineStageEvent must have valid pipeline_id"
43
+ note: "Apply when event_family == pipeline_stage"
44
+
45
+ - id: obs_pipeline_stage_id_non_empty
46
+ scope: event
47
+ path: stage_id
48
+ rule: non-empty-string
49
+ description: "PipelineStageEvent must have non-empty stage_id"
50
+ note: "Apply when event_family == pipeline_stage"
51
+
52
+ - id: obs_pipeline_stage_status_valid
53
+ scope: event
54
+ path: stage_status
55
+ rule: enum(pending,running,completed,failed,skipped)
56
+ description: "PipelineStageEvent stage_status must be valid enum"
57
+ note: "Apply when event_family == pipeline_stage"
58
+
59
+ # GraphUpdateEvent Specific Invariants
60
+ - id: obs_graph_event_has_graph_id
61
+ scope: event
62
+ path: graph_id
63
+ rule: uuid-v4
64
+ description: "GraphUpdateEvent must have valid graph_id"
65
+ note: "Apply when event_family == graph_update"
66
+
67
+ - id: obs_graph_update_kind_valid
68
+ scope: event
69
+ path: update_kind
70
+ rule: enum(node_add,node_update,node_delete,edge_add,edge_update,edge_delete,bulk)
71
+ description: "GraphUpdateEvent update_kind must be valid enum"
72
+ note: "Apply when event_family == graph_update"
73
+
74
+ # RuntimeExecutionEvent Specific Invariants
75
+ - id: obs_runtime_event_has_execution_id
76
+ scope: event
77
+ path: execution_id
78
+ rule: uuid-v4
79
+ description: "RuntimeExecutionEvent must have valid execution_id"
80
+ note: "Apply when event_family == runtime_execution"
81
+
82
+ - id: obs_runtime_executor_kind_valid
83
+ scope: event
84
+ path: executor_kind
85
+ rule: enum(agent,tool,llm,worker,external)
86
+ description: "RuntimeExecutionEvent executor_kind must be valid enum"
87
+ note: "Apply when event_family == runtime_execution"
88
+
89
+ - id: obs_runtime_status_valid
90
+ scope: event
91
+ path: status
92
+ rule: enum(pending,running,completed,failed,cancelled)
93
+ description: "RuntimeExecutionEvent status must be valid enum"
94
+ note: "Apply when event_family == runtime_execution"
95
+ # Note: The "note" fields indicate conditional application based on event_family.
96
+ # If the invariant engine does not support conditional rules, these should be
97
+ # validated at the schema level (which is already done in the event schemas).
98
+ # These invariants provide additional layer of validation for runtime enforcement.