toDisplay([ 'type' => 'assignment_created', 'recipient' => 'tech@example.com', 'title' => '', 'body' => 'unsafe', 'deduplication_key' => 'assignment:42', ]); notification_contract_assert('', $display['title'], 'Safe display should preserve text as data, not execute or reinterpret it.'); notification_contract_assert('unsafe', $display['body'], 'Safe display should expose body as text data.'); notification_contract_assert(false, $display['is_read'], 'Display should default missing read_at to unread.'); notification_contract_assert(true, $record->validateMarkUnread(['notification_id' => '12'])['valid'], 'Unread command should accept a positive notification ID.'); notification_contract_assert(true, method_exists($queue, 'markUnread'), 'Queue should expose a mark-unread command.'); printf("Notification contract tests: 5 passed\n");