remove(plugin-audit): drop kernel-built-in assignment notifications (#3403)#3404
Merged
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Contributor
📓 Docs Drift CheckThis PR changes 2 package(s): 9 hand-written doc(s) reference the affected code and may need an implementation-accuracy re-verification:
|
…3403) Deciding that an owner/assignee change warrants a bell is a business policy, not a platform default. The kernel notifier guessed "who is the assignee" from field names (owner_id, assigned_to, …), which misfired on system records like sys_file and spammed users with "…assigned to you" noise on file uploads (#3402). Removes writeAssignmentNotifications, the OWNER_FIELDS heuristic, and the messages.assignedToYou translation key (en/zh-CN/ja-JP/es-ES) plus the two assignment test cases; adds a regression test asserting no collab.assignment emit on an owner-field write. Assignment notifications now live in user-space automation (record-after-update + a notify node); see the showcase_task_assigned_notify flow. Unaffected: sys_audit_log / sys_activity capture; @mention notifications (collab.mention); service-messaging owner_of: audience + DEFAULT_OWNER_FIELDS (a separate, caller-requested mechanism — comment updated). Design docs get a deprecation note (history not rewritten). Changeset carries the FROM→TO migration. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #3403. Takes over and closes #3402.
背景
上传文件会刷「系统文件 "xxx" 已分配给你」噪音通知(#3402)。根因:分配通知作为全局行为硬编码在 plugin-audit 的
afterInsert/afterUpdate钩子(writeAssignmentNotifications),靠字段名启发式(OWNER_FIELDS含owner_id)猜「负责人」,把sys_file.owner_id(存储层 ACL 归属)误判成业务指派;sys_file由存储服务裸引擎写库(actorId=null)穿透自我分配守卫,多次写库(pending→committed)重复刷屏。经维护者讨论,结论是问题不在缺一个跳过名单或开关,而在这个功能放错了层。
决策
移除内核内置分配通知,「分配通知」回归用户态:平台只提供机制(记录变更触发器 +
notify节点 + 消息模板),通知策略由应用/管理员用自动化流程按需配置,文案可自定义。业界同类产品(Salesforce / ServiceNow / Odoo)均为「机制内置、策略配置」,且没有平台对文件/附件等系统记录发分配通知。改动
audit-writers.ts— 删writeAssignmentNotifications、OWNER_FIELDS、pickOwner及writeAudit内调用点(含makeTitle)。保留sys_audit_log/sys_activity写入、@mention 通知(writeCommentMentions)。translations/messages.ts— 删 en/zh-CN/ja-JP/es-ES 四处assignedToYoukey(mentionedYou等保留)。TranslationData['messages']是开放z.record,非枚举,spec 无需改。audit-writers.test.ts— 删两条 assignment 用例,补一条回归用例「设置 owner 字段不再产生collab.assignment」。全套 44 passed。recipient-resolver.ts—DEFAULT_OWNER_FIELDS注释更新;owner_of:audience 是独立、调用方显式请求的机制,保留。notification-platform-convergence.md/adr-0030-notification-convergence.md)assignment 段落加废弃标注,历史不重写。showcase_task_assigned_notify范例给目标对象配一条record-after-update+notify流程。迁移(FROM → TO)
真机验证(showcase :3377,真实运行,REST API 驱动)
全量 build(71/71),
plugin-audit/distgrepcollab.assignment= 0。sys_file.owner_id=admin、committedcollab.assignment、0 条「已分配给你」/文件噪音assignee→admin(owner_id 亦为 admin)showcase_task_assigned_notify照常触发,收件箱「New task assigned」collab.mention正常产生最终
sys_notificationtopic 分布:collab.mention:1, project.digest:4, task.assigned:1—— 无collab.assignment。验收
sys_saved_report/sys_report_schedule同类潜在噪音一并消除);🤖 Generated with Claude Code