本卡屬 FR-196(母卡 CM-3875(已建)),卡 P-5,第三期批 8。只改 jedi-python-package。依賴:P-3。
通知中心套件第五棒:即時推播的套件側。提供一個 SocketIO 頻道處理類(連上就進自己的房間)和一個「未讀數變了」的推送實作,只推訊號不推內容,瀏覽器收到再用一般 API 拉。
照型 new:handler 照 jedi-survey fill_survey_socketio_handler.py(on_connect/join_room/emit);套件只提供 handler 類與 notifier 實作,登記在宿主
repo:~/Projects/Jedicogy/module/jedi-python-package
改既有:jedi-notification-center/jedi_notification_center/plugin/contract.py(export handler 類名)
新開:jedi-notification-center/jedi_notification_center/realtime/handler.py
新開:jedi-notification-center/jedi_notification_center/realtime/socketio_notifier.py
新開:jedi-notification-center/tests/test_realtime.py(notifier 對假 socketio emit 一次、payload 無內容)
realtime/handler.py:class NotificationCenterNamespace(AuthenticatedNamespace),on_connect 後 join_room(f'user:{user_id}')(user_id 從 restore_user_context_from_session() 取);不處理其他事件。realtime/socketio_notifier.py:SocketIORealtimeNotifier(socketio).unread_changed(user_id) → socketio.emit('unread_changed', {'event':'unread_changed'}, room=f'user:{user_id}', namespace='/socket/notification-center')。tests 綠;payload 只有 {"event":"unread_changed"};handler 未帶 token 連線被 AuthenticatedNamespace 拒
~/Projects/Billows/Audit-Manager/compliance-manager-be/docs/features/FR-196-2611-notification-center/design.md §3 決策定案、§5 詳細設計(§5.1 套件職責與 port、§5.2 資料表、§5.3 API、§5.5 前端)、§6 拆卡表本卡那列、§8 風險;討論稿(Artifact,連結在 README)只在想知道「為什麼這樣裁」時看~/Projects/Billows/Audit-Manager/compliance-manager-be/docs/features/FR-196-2611-notification-center/prototype/index.html(四個分頁:鈴鐺、通知中心、通知設定、系統橫幅;純畫面,只取結構與資訊順序;文案依 i18n 重寫)infra/task_alert/(entity/model/mapper/repo+domain/task_alert/service/task_alert_notification_domain_service.py claim/mark);排程先例 core/scheduler_update.py;SocketIO 登記 config/socketio_namespaces.py(檔頭紅線)與 handler 先例 jedi-survey app/handler/fill_survey_socketio_handler.py;橫幅先例 FE src/components/ai-quota/AiQuotaBanner.vue、掛點 src/layout/AppLayout.vue 124;iam 通知接口 common/iam_ports.py;十個寄信點行號在 design.md 表 4-1jedi-bulletin/jedi_bulletin/plugin/(contract/assembly/migrations)、jedi-notification/README.md;主系統接線 core/plugins/bulletin.py、core/plugins/_host.py::host_defaults、core/plugins/license.py::TenantAdminDirectory;寄信點 app/flow_engine/service/workflow_execution_service.py:1246、stage_entered_notify_service.py:117、app/task_alert/service/scan_alert_app_service.py:74;既有投遞紀錄表 infra/task_alert/model/task_alert_notification.py;鈴鐺 FE src/layout/AppTopbar.vue 484~540、TopbarStageQueue.vue;seed 先例 scripts/sql/2026-05-22-seed-oscal-ssp-roles.sql、2026-11-10-fr194-ui-routes-entry-gates.sqldocs/claude/domain-capabilities.md、FE docs/claude/frontend-overview.md §4。三擇一、預設不新增:reuse → extend → 確認沒有才新增。回寫列出本卡 reuse 了哪些、新增了哪些、為什麼不能 reuse。本案設計已做過重複盤點(橫幅、投遞紀錄、去重戳、個人資料頁),卡上「reuse/extend/new」是結論,照它做。