Expand runtime event graph service

This commit is contained in:
Jan Petykiewicz 2026-04-14 19:37:53 -07:00
commit 6ebe5fffeb
14 changed files with 1803 additions and 254 deletions

View file

@ -0,0 +1,82 @@
{
"format_version": 1,
"fixture_id": "event-follow-on-dirty-rerun-smoke",
"source": {
"kind": "synthetic",
"description": "Synthetic normalized event-service fixture covering staged follow-on record append and dirty rerun dispatch."
},
"state": {
"calendar": {
"year": 1830,
"month_slot": 0,
"phase_slot": 0,
"tick_slot": 0
},
"world_flags": {
"sandbox": false
},
"companies": [],
"event_runtime_records": [
{
"record_id": 100,
"trigger_kind": 1,
"active": true,
"marks_collection_dirty": true,
"effects": [
{
"kind": "append_event_record",
"record": {
"record_id": 101,
"trigger_kind": 10,
"active": true,
"effects": [
{
"kind": "set_world_flag",
"key": "dirty_rerun_follow_on",
"value": true
}
]
}
}
]
}
]
},
"commands": [
{
"kind": "service_trigger_kind",
"trigger_kind": 1
}
],
"expected_summary": {
"calendar": {
"year": 1830,
"month_slot": 0,
"phase_slot": 0,
"tick_slot": 0
},
"world_flag_count": 2,
"company_count": 0,
"event_runtime_record_count": 2,
"total_event_record_service_count": 2,
"periodic_boundary_call_count": 0,
"total_trigger_dispatch_count": 2,
"dirty_rerun_count": 1,
"total_company_cash": 0
},
"expected_state_fragment": {
"world_flags": {
"dirty_rerun_follow_on": true
},
"event_runtime_records": [
{
"record_id": 100,
"service_count": 1
},
{
"record_id": 101,
"service_count": 1
}
]
}
}

View file

@ -0,0 +1,157 @@
{
"format_version": 1,
"fixture_id": "event-record-lifecycle-smoke",
"source": {
"kind": "synthetic",
"description": "Synthetic normalized event-service fixture covering staged append, activate, deactivate, and remove semantics across sequential trigger passes."
},
"state": {
"calendar": {
"year": 1830,
"month_slot": 0,
"phase_slot": 0,
"tick_slot": 0
},
"world_flags": {
"sandbox": false
},
"companies": [],
"event_runtime_records": [
{
"record_id": 60,
"trigger_kind": 7,
"active": true,
"one_shot": true,
"effects": [
{
"kind": "append_event_record",
"record": {
"record_id": 64,
"trigger_kind": 7,
"active": true,
"effects": [
{
"kind": "set_candidate_availability",
"name": "Appended Industry",
"value": 1
}
]
}
},
{
"kind": "deactivate_event_record",
"record_id": 61
},
{
"kind": "activate_event_record",
"record_id": 62
},
{
"kind": "remove_event_record",
"record_id": 63
}
]
},
{
"record_id": 61,
"trigger_kind": 7,
"active": true,
"effects": [
{
"kind": "set_world_flag",
"key": "deactivated_after_first_pass",
"value": true
}
]
},
{
"record_id": 62,
"trigger_kind": 7,
"active": false,
"effects": [
{
"kind": "set_special_condition",
"label": "Activated On Second Pass",
"value": 1
}
]
},
{
"record_id": 63,
"trigger_kind": 7,
"active": true,
"effects": [
{
"kind": "set_world_flag",
"key": "removed_after_first_pass",
"value": true
}
]
}
]
},
"commands": [
{
"kind": "service_trigger_kind",
"trigger_kind": 7
},
{
"kind": "service_trigger_kind",
"trigger_kind": 7
}
],
"expected_summary": {
"calendar": {
"year": 1830,
"month_slot": 0,
"phase_slot": 0,
"tick_slot": 0
},
"world_flag_count": 3,
"company_count": 0,
"event_runtime_record_count": 4,
"candidate_availability_count": 1,
"special_condition_count": 1,
"enabled_special_condition_count": 1,
"total_event_record_service_count": 5,
"periodic_boundary_call_count": 0,
"total_trigger_dispatch_count": 2,
"dirty_rerun_count": 0,
"total_company_cash": 0
},
"expected_state_fragment": {
"candidate_availability": {
"Appended Industry": 1
},
"special_conditions": {
"Activated On Second Pass": 1
},
"world_flags": {
"deactivated_after_first_pass": true,
"removed_after_first_pass": true
},
"event_runtime_records": [
{
"record_id": 60,
"service_count": 1,
"has_fired": true,
"active": true
},
{
"record_id": 61,
"service_count": 1,
"active": false
},
{
"record_id": 62,
"service_count": 1,
"active": true
},
{
"record_id": 64,
"service_count": 1,
"active": true
}
]
}
}

View file

@ -15,23 +15,52 @@
"world_flags": {
"sandbox": false
},
"companies": [],
"companies": [
{
"company_id": 1,
"current_cash": 250000,
"debt": 1000
}
],
"event_runtime_records": [
{
"record_id": 1,
"trigger_kind": 1,
"active": true,
"marks_collection_dirty": true
"marks_collection_dirty": true,
"effects": [
{
"kind": "set_world_flag",
"key": "runtime.effect_fired",
"value": true
}
]
},
{
"record_id": 2,
"trigger_kind": 4,
"active": true
"active": true,
"effects": [
{
"kind": "adjust_company_cash",
"target": {
"kind": "all_active"
},
"delta": 5
}
]
},
{
"record_id": 3,
"trigger_kind": 10,
"active": true
"active": true,
"effects": [
{
"kind": "set_special_condition",
"label": "Dirty rerun fired",
"value": 1
}
]
}
]
},
@ -47,13 +76,27 @@
"phase_slot": 0,
"tick_slot": 0
},
"world_flag_count": 1,
"company_count": 0,
"world_flag_count": 2,
"company_count": 1,
"event_runtime_record_count": 3,
"total_event_record_service_count": 3,
"periodic_boundary_call_count": 1,
"total_trigger_dispatch_count": 7,
"dirty_rerun_count": 1,
"total_company_cash": 0
"total_company_cash": 250005
},
"expected_state_fragment": {
"world_flags": {
"runtime.effect_fired": true
},
"companies": [
{
"company_id": 1,
"current_cash": 250005
}
],
"special_conditions": {
"Dirty rerun fired": 1
}
}
}

View file

@ -0,0 +1,134 @@
{
"format_version": 1,
"fixture_id": "service-trigger-kind-effects-smoke",
"source": {
"kind": "synthetic",
"description": "Synthetic normalized event-service fixture covering direct trigger dispatch, targeted company mutation, and one-shot behavior."
},
"state": {
"calendar": {
"year": 1830,
"month_slot": 0,
"phase_slot": 0,
"tick_slot": 0
},
"world_flags": {
"sandbox": false
},
"companies": [
{
"company_id": 1,
"current_cash": 10,
"debt": 5
},
{
"company_id": 2,
"current_cash": 20,
"debt": 8
}
],
"event_runtime_records": [
{
"record_id": 10,
"trigger_kind": 7,
"active": true,
"effects": [
{
"kind": "set_candidate_availability",
"name": "Steel Mill",
"value": 1
},
{
"kind": "adjust_company_cash",
"target": {
"kind": "ids",
"ids": [2]
},
"delta": 4
},
{
"kind": "adjust_company_debt",
"target": {
"kind": "ids",
"ids": [2]
},
"delta": -3
}
]
},
{
"record_id": 11,
"trigger_kind": 7,
"active": true,
"one_shot": true,
"effects": [
{
"kind": "set_special_condition",
"label": "One Shot Trigger",
"value": 1
}
]
}
]
},
"commands": [
{
"kind": "service_trigger_kind",
"trigger_kind": 7
},
{
"kind": "service_trigger_kind",
"trigger_kind": 7
}
],
"expected_summary": {
"calendar": {
"year": 1830,
"month_slot": 0,
"phase_slot": 0,
"tick_slot": 0
},
"world_flag_count": 1,
"company_count": 2,
"event_runtime_record_count": 2,
"candidate_availability_count": 1,
"special_condition_count": 1,
"enabled_special_condition_count": 1,
"total_event_record_service_count": 3,
"periodic_boundary_call_count": 0,
"total_trigger_dispatch_count": 2,
"dirty_rerun_count": 0,
"total_company_cash": 38
},
"expected_state_fragment": {
"candidate_availability": {
"Steel Mill": 1
},
"special_conditions": {
"One Shot Trigger": 1
},
"companies": [
{
"company_id": 1,
"current_cash": 10,
"debt": 5
},
{
"company_id": 2,
"current_cash": 28,
"debt": 2
}
],
"event_runtime_records": [
{
"record_id": 10,
"service_count": 2
},
{
"record_id": 11,
"service_count": 1,
"has_fired": true
}
]
}
}