Files
TREK/server/tests/integration/broadcast-parity/pending-ceiling.ts
T
Maurice 0427ccc23b test(realtime): broadcast parity for every MCP write tool
A suite under tests/integration/broadcast-parity boots the app once per
group, runs a write tool through a real MCP session the way the
assistant attaches the registry, runs its REST twin on a twin scene, and
records every broadcast. Per case it checks the exact events in order and
count, that no MCP broadcast skips a socket (the asking tab hears its own
change), that nothing is sent inside a transaction, that every payload
parses with its registered schema, that REST sends the same sequence to
the same room and recipients, and that MCP's keys cover REST's.

A registry test lists the write tools as an MCP client sees them and
fails on a tool without a row, a stale row, or an exemption without a
reason; exemptions run too and must send nothing, and the tools still
waiting for a case are frozen in a list that may only shrink.

The new events the next changes send are registered now (member:updated,
todo:reordered, trips:changed, settings:updated, tags:changed,
notification:read-all, journey:updated, journey:deleted, atlas:changed);
the client keeps them apart as awaiting a sender, and the journey page
already leaves a journey that journey:deleted says is gone.
2026-10-22 21:30:39 +00:00

213 lines
5.6 KiB
TypeScript

/**
* The write tools that may still stand in a group's `pending` list (plan
* section 3.5), so pending only shrinks. A new write tool gets a case or an
* exemption, never a pending row: BCP-REG-008 fails on a pending row that is
* not listed here. A tool that gets its case leaves this list in the same
* change, so it cannot slip back, and a listed tool no group holds as pending
* fails as well. The list goes once `pending` leaves the type (plan section
* 2.10, closing phase B).
*/
export const PENDING_CEILING: readonly string[] = [
'accept_atlas_countries',
'accept_collection_invite',
'accept_dawarich_suggestion_as_journal_entry',
'accept_dawarich_suggestion_as_place',
'accept_vacay_invite',
'add_holiday_calendar',
'add_journey_contributor',
'add_journey_provider_photos',
'add_journey_trip',
'add_route_via',
'add_route_vias',
'add_trip_member',
'add_vacay_year',
'apply_packing_template',
'assign_collection_labels',
'assign_place_to_day',
'assign_tour_track',
'bulk_delete_places',
'bulk_import_packing',
'bulk_update_places',
'cancel_collection_invite',
'cancel_vacay_invite',
'clear_bucket_list_visit',
'clear_day_assignments',
'close_collab_poll',
'confirm_bucket_list_visits',
'copy_collection_places_to_trip',
'copy_trip',
'create_and_assign_place',
'create_bucket_list_item',
'create_budget_item',
'create_budget_item_with_members',
'create_city_walk',
'create_collab_note',
'create_collab_poll',
'create_collection',
'create_collection_label',
'create_day',
'create_day_note',
'create_hike',
'create_journey',
'create_journey_entry',
'create_packing_bag',
'create_packing_item',
'create_reservation',
'create_settlement',
'create_tag',
'create_todo',
'create_transit_journey',
'create_transport',
'create_trip',
'create_trip_guest',
'decline_collection_invite',
'decline_vacay_invite',
'delete_accommodation',
'delete_bucket_list_item',
'delete_budget_item',
'delete_collab_message',
'delete_collab_note',
'delete_collab_poll',
'delete_collection',
'delete_collection_label',
'delete_collection_place',
'delete_collection_tour',
'delete_day',
'delete_day_note',
'delete_holiday_calendar',
'delete_journey',
'delete_journey_entry',
'delete_journey_recorded_day',
'delete_packing_bag',
'delete_packing_item',
'delete_place',
'delete_reservation',
'delete_settlement',
'delete_tag',
'delete_todo',
'delete_transport',
'delete_trip',
'delete_trip_guest',
'delete_vacay_year',
'dismiss_dawarich_suggestion',
'dissolve_vacay_plan',
'freeze_budget_rates',
'import_airtrail_flights',
'import_google_maps_route',
'import_places_from_url',
'import_tour_gpx',
'import_trip_gpx',
'invite_to_collection',
'leave_collection',
'leave_trip',
'link_hotel_accommodation',
'link_tour_packing',
'link_trip_file',
'link_trip_journal',
'mark_all_notifications_read',
'mark_bucket_list_item_visited_from_dawarich',
'mark_country_visited',
'mark_notification_read',
'mark_notification_unread',
'mark_region_visited',
'move_assignment',
'rate_collection_place',
'rate_place',
'react_collab_message',
'reanchor_route_vias',
'remove_collection_member',
'remove_journey_contributor',
'remove_journey_trip',
'remove_route_via',
'remove_trip_member',
'rename_trip_guest',
'reorder_collections',
'reorder_day_assignments',
'reorder_days',
'reorder_journey_entries',
'reorder_journey_entry_photos',
'reorder_packing_items',
'reorder_reservations',
'reorder_todos',
'restore_journey_suggestions',
'save_journey_recorded_day',
'save_place_to_collection',
'save_tour_change',
'save_tour_to_collection',
'save_trip_places_to_collection',
'send_collab_message',
'send_vacay_invite',
'set_assignment_end_day',
'set_assignment_participants',
'set_assignment_route_excluded',
'set_bag_members',
'set_budget_item_members',
'set_collection_member_role',
'set_collection_place_status',
'set_collection_place_status_from_trip',
'set_day_boundary',
'set_day_default_transport_mode',
'set_leg_transport_mode',
'set_packing_category_assignees',
'set_packing_item_sharing',
'set_place_image_from_file',
'set_reservation_travelers',
'set_todo_category_assignees',
'set_tour_activity_excluded',
'set_trip_journal_members',
'set_vacay_color',
'share_vacay_calendar',
'sync_trip_documents',
'take_over_collection_tour',
'take_over_journey_day_stays',
'take_over_tour',
'toggle_budget_member_paid',
'toggle_company_holiday',
'toggle_packing_item',
'toggle_todo',
'toggle_vacay_entry',
'unassign_place',
'unassign_tour_track',
'undo_tour_change',
'unlink_tour_packing',
'unlink_trip_file',
'unlink_trip_journal',
'unmark_country_visited',
'unmark_region_visited',
'unshare_vacay_calendar',
'update_accommodation',
'update_assignment_notes',
'update_assignment_time',
'update_bucket_list_item',
'update_budget_item',
'update_collab_note',
'update_collection',
'update_collection_label',
'update_collection_place',
'update_day',
'update_day_note',
'update_display_settings',
'update_holiday_calendar',
'update_journey',
'update_journey_contributor_role',
'update_journey_entry',
'update_journey_preferences',
'update_packing_bag',
'update_packing_item',
'update_place',
'update_reservation',
'update_roadtrip_settings',
'update_route_via',
'update_settlement',
'update_tag',
'update_todo',
'update_tour',
'update_transport',
'update_trip',
'update_trip_file',
'update_vacay_plan',
'update_vacay_stats',
'upload_trip_file',
'vote_collab_poll',
];