Implement real company-scoped event descriptors

This commit is contained in:
Jan Petykiewicz 2026-04-15 12:11:29 -07:00
commit 780e739daa
21 changed files with 1483 additions and 56 deletions

View file

@ -0,0 +1,58 @@
{
"format_version": 1,
"fixture_id": "packed-event-deactivate-company-overlay-fixture",
"source": {
"kind": "captured-runtime",
"description": "Fixture backed by an overlay import document so the real Deactivate Company row executes against selected-company context."
},
"state_import_path": "packed-event-deactivate-company-overlay.json",
"commands": [
{
"kind": "service_trigger_kind",
"trigger_kind": 7
}
],
"expected_summary": {
"calendar_projection_source": "base-snapshot-preserved",
"calendar_projection_is_placeholder": false,
"company_count": 3,
"active_company_count": 2,
"packed_event_collection_present": true,
"packed_event_record_count": 1,
"packed_event_decoded_record_count": 1,
"packed_event_imported_runtime_record_count": 1,
"event_runtime_record_count": 1,
"total_event_record_service_count": 1,
"total_trigger_dispatch_count": 1
},
"expected_state_fragment": {
"selected_company_id": null,
"companies": [
{
"company_id": 1,
"active": true
},
{
"company_id": 2,
"active": true
},
{
"company_id": 3,
"active": false
}
],
"packed_event_collection": {
"records": [
{
"import_outcome": "imported"
}
]
},
"event_runtime_records": [
{
"record_id": 31,
"service_count": 1
}
]
}
}

View file

@ -0,0 +1,10 @@
{
"format_version": 1,
"import_id": "packed-event-deactivate-company-overlay",
"source": {
"description": "Overlay import document for the real Deactivate Company descriptor sample.",
"notes": []
},
"base_snapshot_path": "packed-event-symbolic-company-scope-overlay-base-snapshot.json",
"save_slice_path": "packed-event-deactivate-company-save-slice.json"
}

View file

@ -0,0 +1,106 @@
{
"format_version": 1,
"save_slice_id": "packed-event-deactivate-company-save-slice",
"source": {
"description": "Tracked save-slice document with a real packed-event row for Deactivate Company.",
"original_save_filename": "captured-deactivate-company.gms",
"original_save_sha256": "deactivate-company-sample-sha256",
"notes": [
"tracked as JSON save-slice document rather than raw .smp",
"locks executable import for real descriptor 13"
]
},
"save_slice": {
"file_extension_hint": "gms",
"container_profile_family": "rt3-classic-save-container-v1",
"mechanism_family": "classic-save-rehydrate-v1",
"mechanism_confidence": "grounded",
"trailer_family": null,
"bridge_family": null,
"profile": null,
"candidate_availability_table": null,
"special_conditions_table": null,
"event_runtime_collection": {
"source_kind": "packed-event-runtime-collection",
"mechanism_family": "classic-save-rehydrate-v1",
"mechanism_confidence": "grounded",
"container_profile_family": "rt3-classic-save-container-v1",
"metadata_tag_offset": 28928,
"records_tag_offset": 29184,
"close_tag_offset": 29696,
"packed_state_version": 1001,
"packed_state_version_hex": "0x000003e9",
"live_id_bound": 31,
"live_record_count": 1,
"live_entry_ids": [31],
"decoded_record_count": 1,
"imported_runtime_record_count": 1,
"records": [
{
"record_index": 0,
"live_entry_id": 31,
"payload_offset": 29186,
"payload_len": 120,
"decode_status": "parity_only",
"payload_family": "real_packed_v1",
"trigger_kind": 7,
"one_shot": false,
"compact_control": {
"mode_byte_0x7ef": 7,
"primary_selector_0x7f0": 99,
"grouped_mode_0x7f4": 2,
"one_shot_header_0x7f5": 0,
"modifier_flag_0x7f9": 1,
"modifier_flag_0x7fa": 0,
"grouped_target_scope_ordinals_0x7fb": [1, 1, 1, 1],
"grouped_scope_checkboxes_0x7ff": [1, 0, 0, 0],
"summary_toggle_0x800": 1,
"grouped_territory_selectors_0x80f": [-1, -1, -1, -1]
},
"text_bands": [],
"standalone_condition_row_count": 0,
"standalone_condition_rows": [],
"grouped_effect_row_counts": [1, 0, 0, 0],
"grouped_effect_rows": [
{
"group_index": 0,
"row_index": 0,
"descriptor_id": 13,
"descriptor_label": "Deactivate Company",
"target_mask_bits": 1,
"parameter_family": "company_lifecycle_toggle",
"opcode": 1,
"raw_scalar_value": 1,
"value_byte_0x09": 0,
"value_dword_0x0d": 0,
"value_byte_0x11": 0,
"value_byte_0x12": 0,
"value_word_0x14": 0,
"value_word_0x16": 0,
"row_shape": "bool_toggle",
"semantic_family": "bool_toggle",
"semantic_preview": "Set Deactivate Company to TRUE",
"locomotive_name": null,
"notes": []
}
],
"decoded_actions": [
{
"kind": "deactivate_company",
"target": {
"kind": "selected_company"
}
}
],
"executable_import_ready": true,
"notes": [
"decoded from grounded real 0x4e9a row framing"
]
}
]
},
"notes": [
"real descriptor 13 sample"
]
}
}

View file

@ -0,0 +1,54 @@
{
"format_version": 1,
"fixture_id": "packed-event-mixed-company-descriptor-overlay-fixture",
"source": {
"kind": "captured-runtime",
"description": "Fixture backed by an overlay import document proving mixed real grouped-row records stay parity-only."
},
"state_import_path": "packed-event-mixed-company-descriptor-overlay.json",
"commands": [
{
"kind": "service_trigger_kind",
"trigger_kind": 7
}
],
"expected_summary": {
"calendar_projection_source": "base-snapshot-preserved",
"calendar_projection_is_placeholder": false,
"company_count": 3,
"active_company_count": 3,
"packed_event_collection_present": true,
"packed_event_record_count": 1,
"packed_event_decoded_record_count": 1,
"packed_event_imported_runtime_record_count": 0,
"packed_event_blocked_unmapped_real_descriptor_count": 1,
"event_runtime_record_count": 0,
"total_event_record_service_count": 0,
"total_trigger_dispatch_count": 1
},
"expected_state_fragment": {
"selected_company_id": 3,
"companies": [
{
"company_id": 1,
"available_track_laying_capacity": null
},
{
"company_id": 2,
"available_track_laying_capacity": null
},
{
"company_id": 3,
"available_track_laying_capacity": null
}
],
"packed_event_collection": {
"records": [
{
"import_outcome": "blocked_unmapped_real_descriptor"
}
]
},
"event_runtime_records": []
}
}

View file

@ -0,0 +1,10 @@
{
"format_version": 1,
"import_id": "packed-event-mixed-company-descriptor-overlay",
"source": {
"description": "Overlay import document for a mixed real grouped-row record that should remain parity-only.",
"notes": []
},
"base_snapshot_path": "packed-event-symbolic-company-scope-overlay-base-snapshot.json",
"save_slice_path": "packed-event-mixed-company-descriptor-save-slice.json"
}

View file

@ -0,0 +1,128 @@
{
"format_version": 1,
"save_slice_id": "packed-event-mixed-company-descriptor-save-slice",
"source": {
"description": "Tracked save-slice document with one supported and one unsupported real company-scoped grouped row.",
"original_save_filename": "captured-mixed-company-descriptor.gms",
"original_save_sha256": "mixed-company-descriptor-sample-sha256",
"notes": [
"tracked as JSON save-slice document rather than raw .smp",
"locks all-or-nothing import for mixed real grouped-row records"
]
},
"save_slice": {
"file_extension_hint": "gms",
"container_profile_family": "rt3-classic-save-container-v1",
"mechanism_family": "classic-save-rehydrate-v1",
"mechanism_confidence": "grounded",
"trailer_family": null,
"bridge_family": null,
"profile": null,
"candidate_availability_table": null,
"special_conditions_table": null,
"event_runtime_collection": {
"source_kind": "packed-event-runtime-collection",
"mechanism_family": "classic-save-rehydrate-v1",
"mechanism_confidence": "grounded",
"container_profile_family": "rt3-classic-save-container-v1",
"metadata_tag_offset": 28928,
"records_tag_offset": 29184,
"close_tag_offset": 29696,
"packed_state_version": 1001,
"packed_state_version_hex": "0x000003e9",
"live_id_bound": 33,
"live_record_count": 1,
"live_entry_ids": [33],
"decoded_record_count": 1,
"imported_runtime_record_count": 0,
"records": [
{
"record_index": 0,
"live_entry_id": 33,
"payload_offset": 29186,
"payload_len": 160,
"decode_status": "parity_only",
"payload_family": "real_packed_v1",
"trigger_kind": 7,
"one_shot": false,
"compact_control": {
"mode_byte_0x7ef": 7,
"primary_selector_0x7f0": 99,
"grouped_mode_0x7f4": 2,
"one_shot_header_0x7f5": 0,
"modifier_flag_0x7f9": 1,
"modifier_flag_0x7fa": 0,
"grouped_target_scope_ordinals_0x7fb": [1, 1, 1, 1],
"grouped_scope_checkboxes_0x7ff": [1, 1, 0, 0],
"summary_toggle_0x800": 1,
"grouped_territory_selectors_0x80f": [-1, -1, -1, -1]
},
"text_bands": [],
"standalone_condition_row_count": 0,
"standalone_condition_rows": [],
"grouped_effect_row_counts": [1, 1, 0, 0],
"grouped_effect_rows": [
{
"group_index": 0,
"row_index": 0,
"descriptor_id": 16,
"descriptor_label": "Company Track Pieces Buildable",
"target_mask_bits": 1,
"parameter_family": "company_build_limit_scalar",
"opcode": 3,
"raw_scalar_value": 18,
"value_byte_0x09": 0,
"value_dword_0x0d": 0,
"value_byte_0x11": 0,
"value_byte_0x12": 0,
"value_word_0x14": 0,
"value_word_0x16": 0,
"row_shape": "scalar_assignment",
"semantic_family": "scalar_assignment",
"semantic_preview": "Set Company Track Pieces Buildable to 18",
"locomotive_name": null,
"notes": []
},
{
"group_index": 1,
"row_index": 0,
"descriptor_id": 8,
"descriptor_label": "Economic Status",
"target_mask_bits": 8,
"parameter_family": "whole_game_state_enum",
"opcode": 3,
"raw_scalar_value": 2,
"value_byte_0x09": 0,
"value_dword_0x0d": 0,
"value_byte_0x11": 0,
"value_byte_0x12": 0,
"value_word_0x14": 0,
"value_word_0x16": 0,
"row_shape": "scalar_assignment",
"semantic_family": "scalar_assignment",
"semantic_preview": "Set Economic Status to 2",
"locomotive_name": null,
"notes": []
}
],
"decoded_actions": [
{
"kind": "set_company_track_laying_capacity",
"target": {
"kind": "selected_company"
},
"value": 18
}
],
"executable_import_ready": false,
"notes": [
"decoded from grounded real 0x4e9a row framing"
]
}
]
},
"notes": [
"mixed real descriptor sample"
]
}
}

View file

@ -162,7 +162,7 @@
"value": 7
}
],
"executable_import_ready": false,
"executable_import_ready": true,
"notes": [
"decoded from grounded real 0x4e9a row framing",
"grouped descriptor labels and target masks come from the checked-in effect table recovered around 0x006103a0"

View file

@ -0,0 +1,58 @@
{
"format_version": 1,
"fixture_id": "packed-event-track-capacity-overlay-fixture",
"source": {
"kind": "captured-runtime",
"description": "Fixture backed by an overlay import document so the real Company Track Pieces Buildable row executes against selected-company context."
},
"state_import_path": "packed-event-track-capacity-overlay.json",
"commands": [
{
"kind": "service_trigger_kind",
"trigger_kind": 7
}
],
"expected_summary": {
"calendar_projection_source": "base-snapshot-preserved",
"calendar_projection_is_placeholder": false,
"company_count": 3,
"active_company_count": 3,
"packed_event_collection_present": true,
"packed_event_record_count": 1,
"packed_event_decoded_record_count": 1,
"packed_event_imported_runtime_record_count": 1,
"event_runtime_record_count": 1,
"total_event_record_service_count": 1,
"total_trigger_dispatch_count": 1
},
"expected_state_fragment": {
"selected_company_id": 3,
"companies": [
{
"company_id": 1,
"available_track_laying_capacity": null
},
{
"company_id": 2,
"available_track_laying_capacity": null
},
{
"company_id": 3,
"available_track_laying_capacity": 18
}
],
"packed_event_collection": {
"records": [
{
"import_outcome": "imported"
}
]
},
"event_runtime_records": [
{
"record_id": 32,
"service_count": 1
}
]
}
}

View file

@ -0,0 +1,10 @@
{
"format_version": 1,
"import_id": "packed-event-track-capacity-overlay",
"source": {
"description": "Overlay import document for the real Company Track Pieces Buildable descriptor sample.",
"notes": []
},
"base_snapshot_path": "packed-event-symbolic-company-scope-overlay-base-snapshot.json",
"save_slice_path": "packed-event-track-capacity-save-slice.json"
}

View file

@ -0,0 +1,107 @@
{
"format_version": 1,
"save_slice_id": "packed-event-track-capacity-save-slice",
"source": {
"description": "Tracked save-slice document with a real packed-event row for Company Track Pieces Buildable.",
"original_save_filename": "captured-track-capacity.gms",
"original_save_sha256": "track-capacity-sample-sha256",
"notes": [
"tracked as JSON save-slice document rather than raw .smp",
"locks executable import for real descriptor 16"
]
},
"save_slice": {
"file_extension_hint": "gms",
"container_profile_family": "rt3-classic-save-container-v1",
"mechanism_family": "classic-save-rehydrate-v1",
"mechanism_confidence": "grounded",
"trailer_family": null,
"bridge_family": null,
"profile": null,
"candidate_availability_table": null,
"special_conditions_table": null,
"event_runtime_collection": {
"source_kind": "packed-event-runtime-collection",
"mechanism_family": "classic-save-rehydrate-v1",
"mechanism_confidence": "grounded",
"container_profile_family": "rt3-classic-save-container-v1",
"metadata_tag_offset": 28928,
"records_tag_offset": 29184,
"close_tag_offset": 29696,
"packed_state_version": 1001,
"packed_state_version_hex": "0x000003e9",
"live_id_bound": 32,
"live_record_count": 1,
"live_entry_ids": [32],
"decoded_record_count": 1,
"imported_runtime_record_count": 1,
"records": [
{
"record_index": 0,
"live_entry_id": 32,
"payload_offset": 29186,
"payload_len": 120,
"decode_status": "parity_only",
"payload_family": "real_packed_v1",
"trigger_kind": 7,
"one_shot": false,
"compact_control": {
"mode_byte_0x7ef": 7,
"primary_selector_0x7f0": 99,
"grouped_mode_0x7f4": 2,
"one_shot_header_0x7f5": 0,
"modifier_flag_0x7f9": 1,
"modifier_flag_0x7fa": 0,
"grouped_target_scope_ordinals_0x7fb": [1, 1, 1, 1],
"grouped_scope_checkboxes_0x7ff": [1, 0, 0, 0],
"summary_toggle_0x800": 1,
"grouped_territory_selectors_0x80f": [-1, -1, -1, -1]
},
"text_bands": [],
"standalone_condition_row_count": 0,
"standalone_condition_rows": [],
"grouped_effect_row_counts": [1, 0, 0, 0],
"grouped_effect_rows": [
{
"group_index": 0,
"row_index": 0,
"descriptor_id": 16,
"descriptor_label": "Company Track Pieces Buildable",
"target_mask_bits": 1,
"parameter_family": "company_build_limit_scalar",
"opcode": 3,
"raw_scalar_value": 18,
"value_byte_0x09": 0,
"value_dword_0x0d": 0,
"value_byte_0x11": 0,
"value_byte_0x12": 0,
"value_word_0x14": 0,
"value_word_0x16": 0,
"row_shape": "scalar_assignment",
"semantic_family": "scalar_assignment",
"semantic_preview": "Set Company Track Pieces Buildable to 18",
"locomotive_name": null,
"notes": []
}
],
"decoded_actions": [
{
"kind": "set_company_track_laying_capacity",
"target": {
"kind": "selected_company"
},
"value": 18
}
],
"executable_import_ready": true,
"notes": [
"decoded from grounded real 0x4e9a row framing"
]
}
]
},
"notes": [
"real descriptor 16 sample"
]
}
}