Skip to content

console: a personal Notification Settings page in the Account app over sys_notification_preference (per topic × channel, digest, quiet hours) #34728

Closed

Description

@objectstack-fleet

repo:cloud#5 · hotlong · session_01Q4EjjPP1zuWBNq3nBXVei9

Filing gate: ③ the maintainer's direct order, in the cloud seat 5 thread on 2026-11-17. The seat proposed three quick steps for "how do I receive platform notifications in time". The maintainer answered, verbatim: 「第一步同意,但是手机app还没上架,接 slack」. Step 1 is this card plus the @mention email card; mobile push is out, and Slack is the next channel. Reader: domain:ui. Dedupe: notification preference page account found no card. Triage grades it; the seat suggests p2 for a feature.

维护者速读

  1. 问题:每个人「哪类消息走哪个渠道、汇总、免打扰」的偏好数据和规则平台早就有了,但入口只在管理员的「设置」里,普通用户找不到,也改不了自己的。
  2. 改法:在个人账户里加一个「通知设置」页:按消息类型和渠道开关,选择即时 / 每日汇总 / 每周汇总,设置免打扰时段。
  3. 验收:普通成员能改自己的设置,改完立即按新设置收消息;看不到也改不了别人的设置和管理员的全局默认;「必达」类消息不能被关掉。
  4. 范围:只做控制台页面,用平台现有的偏好对象和接口,不改后端规则。
  5. 以后:Slack 渠道上线后,这个页面就是用户连接自己 Slack 账号、勾选 Slack 渠道的地方。
  6. 需要你做的:无。

What exists (read on objectstack main)

  • Object: sys_notification_preference (packages/services/service-messaging/src/objects/notification-preference.object.ts): user_id (empty means the admin default for everyone), topic, channel, enabled, digest (none/daily/weekly), quiet_hours.
  • Resolver: preference-resolver.ts applies it during emit. The most specific rule wins, and mandatory topics bypass it.
  • Options: GET /api/v1/messaging/preference-options (preference-options-routes.ts:58) lists the topics and channels.
  • Nav today: Setup only, "Notification Preferences" (messaging-service-plugin.ts ~:408). The Account app (packages/platform-objects/src/apps/account.app.ts) lists sys_inbox_message but not preferences.

Ask

  • A page in the Account app where the signed-in person reads and writes only their own rows (user_id = self).
    • It lists the topics × channels from preference-options, each row showing whether it is inherited from the admin default.
    • Digest choice per row, and quiet hours.
    • Mandatory topics are shown as locked.
  • It writes through the normal data door as the user. Sharing and permissions must let a person write only their own preference rows. Verify that, and fix the object's access rules if they do not hold.
  • Leave room for a future Slack row and "connect your Slack" (ADR-0013 / ADR-0022), without building it here.
  • Tests: a member edits their own, and cannot read or edit another's or the default; the change takes effect on the next emit.

Ruled: 6968686390 · letter A · 2026-11-18T04:03Z
Ruled: 6969143776 · letter A · 2026-11-18T04:32Z
Ruled: 6973785798 · letter A · 2026-11-18T08:54Z

Activity

  1. added
    priority:p2
    pm:queue
    domain:ui
    on Nov 17, 2026
  2. objectstack-fleet commented on Nov 17, 2026

    @objectstack-fleet
    ContributorAuthor

    repo:cloud#5 · hotlong · session_01Q4EjjPP1zuWBNq3nBXVei9

    Regraded priority:p2 → priority:p1 2026-11-17T08:57Z, on the maintainer's direct order in the cloud seat 5 thread, verbatim: 「这三个都 p1」. The three are this card's set: #34728 (personal notification settings page), #34729 (@mention by email) and #34730 (the Slack channel with per-person binding). Seat 5 changes only the grade; routing and splitting stay with triage and the lanes.

  3. added
    priority:p1
    and removed
    priority:p2
    on Nov 17, 2026
  4. objectstack-fleet commented on Nov 17, 2026

    @objectstack-fleet
    ContributorAuthor

    triage#1 · hotlong · session_01Q4EjjMnyLqJdzuktEmRPXH

    Path: none

    Triage: first touch → p2 (was p1 at filing) · domain:ui · pm:queue · 2026-11-17T09:44Z

    ⛔ Not a claim.

  5. added
    priority:p2
    and removed
    priority:p1
    on Nov 17, 2026
  6. objectstack-fleet commented on Nov 17, 2026

    @objectstack-fleet
    ContributorAuthor

    triage#1 · hotlong · session_01Q4EjjMnyLqJdzuktEmRPXH

    Raised p2 → p1 by maintainer ruling (2026-11-17 22:5xZ, in triage's session, on triage's UI-lane p2 list): 「以上提到 p1」, covering #34972, #34765, #34991, #34629 and #34728.

    This is a grade set by ruling, so the focus-grading rules and the queue-flake single-root rule (#34152) do not move it back. Domain and state are unchanged; it is queued for a p1 seat.

  7. added
    priority:p1
    and removed
    priority:p2
    on Nov 17, 2026
  8. objectstack-fleet commented on Nov 18, 2026

    @objectstack-fleet
    ContributorAuthor

    repo:objectstack#1 · os-warren · session_01JQwxbXntjWcQfiBywqZcPo

    决策分析:个人通知设置页的「当前生效值、是否沿用管理员默认、必达锁」从哪里读 · 2026-11-18T03:55Z

    呈维护者裁决(项目的决策线程)。输入是卡线程的认领前读数与分叉,本评论在 origin/main 526282e1 上重读了前提并独立给出推荐。卡未认领、未派发,裁决前不动工。

    一句话问题

    普通成员打开「通知设置」时,页面要告诉他三件事:每一类消息现在到底发不发、这个状态是他自己设的还是沿用管理员的默认、哪些消息是必达关不掉的。今天这三件事页面都拿不到:成员读不到管理员的默认设置,系统也不告诉页面哪些消息必达。

    前提(每条带 re-check 命令)

    1. 成员今天完全读写不了通知偏好。 成员默认权限里没有这个对象的任何授权,对象说明里写的「用户写自己的行」是声明而未兑现。git grep -c sys_notification_preference origin/main -- packages/plugins/plugin-security/src/objects/default-permission-sets.ts → 0 命中。
    2. 同形先例已在同一文件。 个人偏好 sys_user_preference:读、建、改,无删除,行级规则「只能碰自己的行」。git grep -n "sys_user_preference" origin/main -- packages/plugins/plugin-security/src/objects/default-permission-sets.ts → 774 行授权,1014 行 sys_user_preference_self。
    3. 现有选项接口只回消息类型和渠道,不含「必达」。 git grep -c mandatory origin/main -- packages/services/service-messaging/src/preference-options.ts packages/services/service-messaging/src/preference-options-routes.ts → 0 命中;必达清单是服务启动参数(messaging-service-plugin.ts:156、:357)。
    4. 「生效值」不是查一行就有,是三套规则。 开关按八级「最具体优先」落到本人行、管理员默认行或系统默认开;汇总与免打扰只读「全部渠道」那一行;必达按精确或前缀匹配整类绕过。git grep -n "resolveRow\|resolveQuietHours\|resolveDigest\|isMandatory" origin/main -- packages/services/service-messaging/src/preference-resolver.ts。
    5. 未实测(交 dev 先测): 成员新建一行时把「用户」留空(等于全组织默认)或填成别人,是否被拒。协议文本说只有 using 的规则在新建时也用它判写入后的行(packages/spec/src/security/rls.zod.ts:219-221),这是读文本,不是实测。

    Governing text: ADR-0030 §Decision 4(docs/adr/0030-notification-platform-convergence.md:43,管理员默认 + 个人覆盖 + 必达类)与 §Consequences(:49,个人通知偏好界面);ADR-0090 D5 及其「移除自己的行不是删除位」注记(docs/adr/0090-permission-model-v2-concept-convergence.md:312-317);ADR-0103(该对象属 system-data,对象说明「RLS is the authz」);维护者对 member_default 的裁决(显式授权、无通配,文件 625 行起的注释)。检索式 git grep -n -iE 'notification_preference|preference-options|mandatory ?topics|my-preferences|effective preference' origin/main -- AGENTS.md docs/adr packages/spec/src:没有一条规定成员页面从哪里读生效值,所以是真分歧。三个选项都不与上述文本冲突;B 只与本卡正文的测试句「成员读不到默认行」相左,那是卡文,不是规范。

    协议:packages/spec 不改。A 新增一个公开只读路由;B 改现有路由的响应并放宽成员读面;三个选项都含一次成员权限授予。

    选项

    选项 做什么 成员看得见的后果 工作量
    A 服务端按当前登录人算好「生效表」交给页面:每类消息 × 渠道现在开还是关、来源(本人设置 / 管理员默认 / 系统默认开)、是否必达,汇总与免打扰同样给生效值。成员只读写自己的行。 页面显示的就是实际发送状态。以后加 Slack 渠道或改规则,页面不用跟着改。 全仓车道 · 1 个 PR · 先例:只读接口 #31004(+927/−35,26 个文件),控制台侧 #31069(+776/−28,24 个文件),权限授予同 sys_user_preference
    B 让成员能读管理员默认行;选项接口加「必达」字段;页面自己按规则算生效值。 今天显示一样。规则在页面里又抄了一份,服务端规则一变,页面可能显示「已关闭」而实际还在收。成员能看到全组织的默认设置(内容不敏感)。 全仓车道 · 1 个 PR · 页面内算规则无先例
    C 页面只列成员自己设过的行,不显示继承,必达不标。 管理员默认关掉的消息,页面仍显示为开;必达消息可以点「关闭」,但照样收到。 全仓车道 · 1 个 PR,三者最小 · 以后补继承显示要再做一次

    业务直译:

    • A 等于银行 App 的通知设置:你看到的每个开关就是银行实际的发送状态,灰掉的是必发的。
    • B 等于把银行的发送规则抄一份放进 App 里自己算,规则改了而 App 没更新,开关就显示错。
    • C 等于只给你一张你自己填过的表,没填过的不告诉你现状。

    四轴

    • 项目长远合理性。 两年后这项能力的样子是一个「我的通知设置」服务端读面,控制台、之后的手机 App、Slack 绑定页都读它。通知平台 Novu 与 Knock 都提供「取某个订阅者的偏好」读面(其公开 API 文档有此条目;合并细节本场未逐字核对)。A 就是这个形态。B 让同一套规则有两份实现,手机端上线时变三份。C 是必然返工的半成品。
    • 实际业务需求。 有实测拉动:维护者直令「第一步同意,但是手机app还没上架,接 slack」「这三个都 p1」「以上提到 p1」;成员今天零入口(前提 1);notifications: an @mention reaches the mentioned person by email as well as the inbox (default on, mutable per person) #34729 的 @提及邮件「每人可关」(PR feat(plugin-audit): an @mention also reaches the mentioned person by e-mail (default on, mutable per person) #34847 已落地)的个人开关就落在这一页。
    • 防 AI 写错。 A 下页面只画服务端给的值,改规则的人不可能漏改页面;权限是最简单的一条「只能碰自己的行」,写错时成员得到的是响亮的拒绝。B 需要「读可以读默认行、写只能写自己的行」两段行级规则,写错一处,成员就能改全组织的默认,而且没有人会看到报错,只是全员的通知被悄悄改了。C 的显示与实际不符同样是静默的。
    • 创业阶段不扩散。 C 最省。A 多一个只读路由,是永久义务,但在已下令的功能之内。B 不加路由,却要给响应加字段并放宽读面,同样是契约增长,并不比 A 省。

    os-decision-facets
    ① 项目长远合理性:A 缩小特例,生效规则只有服务端一份,各端共用;B 增加一份页面内的规则副本;C 留下必返工的半成品。
    ② 实际业务拉动:有。维护者直令 p1;成员今天零入口;#34729 的个人开关依赖本页。
    ③ 防 AI 犯错:A 权限形状最简单,页面不算规则,出错是响亮拒绝;B 两段行级规则写错即静默放开全组织默认;C 显示与实际不符且无人报错。
    ④ 创业阶段不扩散:C 最省,A 与 B 都是契约增长;A 多一个只读路由,在已下令的功能范围内。
    Prior rulings read: notification_preference, preference-options, mandatory topics, my-preferences, effective preference → 14 hits; ADR-0030 D4, ADR-0090 D5, ADR-0103; thread: none

    推荐

    推荐 A。 只看①选 A;②③④ 是否翻转:否。

    • 不取 B:一套规则两份实现,且权限形状更复杂,错了是静默的。
    • 不取 C:页面显示与实际发送不符,等于把一个会被当成缺陷的页面交给成员。

    置信缺口:前提 5 未实测;Novu 与 Knock 的参照只核到文档条目存在;A 的工作量按两个先例估,未逐文件拆。这些都不改字母。

    随裁决一并定下的执行参数(裁 A 时)

    1. 权限授予(人工地板,请同笔裁)。 成员默认权限加通知偏好对象的读、建、改,无删除,行级规则「只能碰自己的行」,与 sys_user_preference 同形。B 与 C 也都需要这一条;不给它,这一页做不出来。
    2. 新路由,不扩现有选项接口。 现有接口是全组织的目录,不分登录人;路由名由席位按先例定。
    3. 本次不做「恢复跟随管理员默认」。 那需要删除自己的行,ADR-0090 D5 不许成员默认权限带删除位;以后有拉动时走「移除自己的行」的专门入口,另立卡。成员改过的开关会一直算个人设置,可以手动拨回去。
    4. 带前提的裁决。 dev 动手前先测前提 5:成员不能新建「用户」为空或为他人的行,也不能把自己的行改给别人。测不过就报 fork,⛔ 不硬做,也不退回 B 或 C。

    裁后执行

    席位把裁决记在本卡,卡线程认领(lease:o1-B)并派 dev,出 draft PR,过 L1 与契约审核(Clause-② yes),再落地。维护者只在 PR 需要人批时再出现。

    相关:#34729(已关,PR #34847)、#34730(Slack 渠道,队列中)、#31004、#31069。

    State: pm:queue → needs-user-decision.

  9. added
    needs-user-decision
    and removed
    pm:queue
    on Nov 18, 2026
  10. 24 remaining items

  11. removed
    pm:dispatched
    on Nov 18, 2026
  12. objectstack-fleet commented on Nov 18, 2026

    @objectstack-fleet
    ContributorAuthor

    repo:objectstack#1 · os-warren · session_01JQwxbabAdcWyApSTGBYJNY

    Ruling: option A, the own-row policy on sys_notification_preference binds every principal that holds the grant, and organization owners and administrators get a separate widening policy; this replaces one clause of ruling 6969143776 and leaves the rest of both earlier rulings standing · recorded 2026-11-18T08:55Z

    Warren chose 「A 规则管所有人,管理员放行」 on the decision card 「选定「只能碰自己的设置」这条规则管哪些人」 in the project thread "Decide notification settings data access" (card cmsg_01U5RdnAAmkSQmZbqh6FtqZ8R8J23VNgwwRmZgB6TCWhxT) at 2026-11-18T08:54:37Z. The option as he read it, verbatim: 「规则对每个拿到权限的人都生效,另给组织所有者和管理员一条放行规则。实测成员和委派管理员只能管自己的设置,所有者和管理员后台照旧。」 The option not chosen, lettered as in comment 6973242296: 「B 只给普通成员发这项权限」. Beside the card he was told why it came back and that it exists only on the unmerged draft PR (thread message cmsg_01U5RdnAAmkSQmZbqh6FtqZ8RJ5UD8W4AzaNn1TiFqoAQR).

    Prior rulings on this card: 6968686390 — route A and the member grant, unchanged. 6969143776 — the policy's write check stands; its clause "applies to ordinary members only" (positions: ['org_member']) is replaced here, after contract review FAIL 6971590801 on PR #35122 (F1) found the policy's reach narrower than the grant's.

    Governing text: rulings 6968686390 and 6969143776 · the principle recorded at packages/plugins/plugin-security/src/objects/default-permission-sets.ts:588-594 (a positions domain belongs on a widening policy, never on the narrowing one), with sys_invitation_org_admin (:599) as its precedent · ADR-0090 D5/D9 · ADR-0058 D4.

    Workload of the chosen letter, from the analysis table: whole-repo lane · a revision on this card's one PR (#35122) · two policies and about four integration assertions · precedent sys_invitation_org_admin.

    What is ruled

    • The own-row policy carries no positions. sys_notification_preference_self: operation: 'all', using and check both user_id == current_user.id. It binds every principal that resolves the grant.
    • A widening policy for organization owners and administrators only. sys_notification_preference_org_admin: operation: 'all', using: 'id != null', check: 'topic != null', positions the organization owner and administrator identities. delegated_admin is not in it.
    • The widener's check is topic != null on purpose. It must hold for a row being created; topic is required with a default. The policy's comment names that coupling: if topic ever becomes optional, an administrator's create is refused, never widened.
    • The object grant is unchanged: read, create and edit in member_default, no delete.
    • The tests pin the measured outcome: an ordinary member and a delegated administrator each list only their own rows and write only their own rows, and every other write is refused; an organization owner and an administrator list every row and create (the default and another person's row included), edit and delete as today. The delegated-administrator persona is new in the suite.
    • The changeset sentence that says the grant goes to ordinary members is corrected to what ships.

    Not ruled

    • Option B (a permission set bound to ordinary members). Not built, not measured.
    • A literal always-true spelling for a widener's check. Not measured, and not this card's.
    • The other findings of review 6971590801 (F2 onward). They are the build's, under the lane's review.

    Readings today

    • Measured by the card thread at PR head 08d51040cf, through the real write gate and the real caller resolver, measure-only (nothing pushed): the shape above gives the outcome under "What is ruled". A control on the same harness, with the widener's check written id != null, refused every administrator create, so the harness tells a create-safe check from one that is not.
    • Read at origin/main 34834073 and PR head 08d51040cf (comment 6973242296, premises 1 to 4, each with its re-check command; premise 4's command prints lines 90 and 132, and the binding table is at 90-91): the grant sits in the set every signed-in member of the organization resolves; the membership roles reachable through the data door are owner, admin, delegated_admin, member and external; no shipped set is bound to ordinary members only.
    • Not measured: the REST face on a booted app.

    State

    needs-user-decision comes off and the card returns to pm:queue for the card thread's fresh claim under lease:o1-B, resuming from claude/issue-34728-notification-settings@08d51040cfd8df00f013717fc9191c7d5e127354 (Release 6973255983). The revision goes on draft PR #35122 and owes L1 and the contract review again at its new head.

  13. added
    pm:queue
    and removed
    needs-user-decision
    on Nov 18, 2026
  14. objectstack-fleet commented on Nov 18, 2026

    @objectstack-fleet
    ContributorAuthor

    repo:objectstack#1 · os-warren · session_01JQwxbXh6yuW2pNn3XoA8sB

    Claim: PM loop round 3 · 2026-11-18T08:58Z
    Session: session_01JQwxbXh6yuW2pNn3XoA8sB
    Thread session: session_01JQwxbXh6yuW2pNn3XoA8sB
    Account: os-warren
    Branch: claude/issue-34728-notification-settings
    Worktree: objectstack-issue-34728
    Domain: domain:ui
    Seat: repo:objectstack#1 (card thread, lease o1-B)
    File surface: packages/services/service-messaging/src/** (the new caller-scoped read route, its tests, the plugin mount and route ledger), packages/plugins/plugin-security/src/objects/default-permission-sets.ts (+ its tests), packages/platform-objects/src/apps/account.app.ts (+ generated app translations), ui/apps/console/src/** and ui/packages/app-shell/src/** (the Account page component and its registration), .changeset/34728-*.md (stop on breach; explain in the report)
    Container & model: L, mode:thread, model: default — dispatch-gates --tier: "no path-derived mandate: the surface hits none of the 4 declared glob(s)", effort: high
    Clause-②: yes
    Metadata-protocol: none
    Responsibility: n/a — not a defect card
    Thread-read: 6973785798
    Premise: holds (ruling 6973785798 rests on the card thread's measurement at head 08d5104)
    Serial constraints cleared: draft PR #34717 (security lane) edits packages/platform-objects/src/apps/translations/*.objects.generated.ts, which this card regenerates; regenerated files merge by scripts/pm/os-regen-merge.sh. Draft PR #34223 edits packages/platform-objects/src/apps/setup-nav.contributions.ts, not in this surface. No other open PR touches the surface (rescan of open PRs at 2026-11-18T04:35Z; PR #35122 is this card's own). scripts/pm/overlap-check.mjs runs on the branch before each push.
    Ruling-ref: 6968686390
    Ruling-ref: 6969143776
    Ruling-ref: 6973785798
    Resume-from: claude/issue-34728-notification-settings@08d51040cfd8df00f013717fc9191c7d5e127354 (claim 6969181499 released by 6973255983)

    Pre-claim lane: whole-repo lane repo:objectstack; paths span domain:server (packages/services/service-messaging, packages/plugins/plugin-security, packages/platform-objects) and domain:ui (ui/**); not cloud, not security.
    Pre-claim deps: none named on the card; #34729 closed; #34730 (Slack) is not a dependency.
    Prior rulings read: notification_preference,member_default,quiet_hours,preference-options,mandatorytopics → 5 hits; ADR-0056 D7, ADR-0090 D5, ADR-0092 D5, ADR-0106 D7; thread: rulings 6968686390 (route A), 6969143776 (policy check) and 6973785798 (policy reach); repo: objectstack-ai/objectstack

    Ruled (not to be re-ruled): rulings 6968686390 and 6969143776 stand except the clause 6973785798 replaces. sys_notification_preference_self carries no positions (operation: 'all', using and check both user_id == current_user.id). New widener sys_notification_preference_org_admin: operation: 'all', using: 'id != null', check: 'topic != null', positions the organization owner and administrator identities, delegated_admin not in it; its comment names the coupling to topic being required with a default. The object grant is unchanged (read, create, edit in member_default, no delete). Tests pin: an ordinary member and a delegated administrator each list and write only their own rows, every other write refused; an organization owner and an administrator list every row and create (default and another person's row included), edit and delete as today; a delegated-administrator persona is new in the suite. The changeset sentence about the grant is corrected to what ships.

  15. added
    pm:dispatched
    and removed
    pm:queue
    on Nov 18, 2026
  16. objectstack-fleet commented on Nov 18, 2026

    @objectstack-fleet
    ContributorAuthor

    repo:objectstack#1 · os-warren · session_01JQwxbXh6yuW2pNn3XoA8sB

    Closed out · 2026-11-18T11:34Z

    PR #35122 MERGED at 2026-11-18T11:34Z as c9b3f7a10eccc54bde33161b2ce8446f5f6b5467, and Fixes #34728 closed this card.

    Delivered:

    • The Account app's Notification Settings page.
    • The caller-scoped read GET /api/v1/messaging/me/preferences, served by the same resolver emit uses.
    • On sys_notification_preference in member_default: a grant of read, create and edit, with no delete; the self row policy; and the owner/administrator widener. All three follow rulings 6968686390, 6969143776 and 6973785798.

    Left with other cards:

    This stroke removes pm:dispatched and lease:o1-B. The claim is released.

  17. removed
    pm:dispatched
    on Nov 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    domain:uipriority:p1

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions