Skip to content
This repository was archived by the owner on Nov 4, 2026. It is now read-only.
This repository was archived by the owner on Nov 4, 2026. It is now read-only.

app-shell: 站内信到达提醒缺「自己触发的不弹」—— 等收件箱行带上 actor #8667

Description

@os-justin

Blocked-by: objectstack-ai/objectstack#16974

背景

objectui#7011 落地了站内信到达提醒(前台 toast / 后台桌面通知)。卡面五条设计约束里,四条已实现并有 pin:首拉不弹、同周期合并、已读不弹、toast 与桌面通知互斥。

第五条没有实现:「自己触发的回执类消息不弹 —— actor 是当前用户自身的不弹」。

为什么没有实现,而不是漏做

呈现层拿不到 actor,这是数据面的事实而不是取舍:

  • sys_inbox_message 声明的列里没有任何 actor(inbox-channel.ts 的写入侧同样不带);
  • actor 只存在于上一层的 sys_notification.actor_id,而默认权限集不授予普通用户读 sys_notification;
  • 本仓已有一条相反方向的裁定禁止先行:objectui#5203 退休了 InboxNotification.actor_name,理由正是「无列可映射」,并留了两个 pin —— layout/__tests__/inboxGrouping.test.ts 的类型 pin 与 hooks/__tests__/sharedInboxFeed.rowShape.test.tsx 的产出行 key-set pin(后者对产出行做精确 key 集断言,给行加任何一个字段都会转红)。

⇒ 在生产者补上列之前,消费端能做的只有编造一个代理信号,那是投机代码。

现状的可见后果

给自己指派一个任务(或任何把发起人本人列为收件人的 flow)会弹一条「Assigned to you: …」。信息本身没错,时机是噪音。

上游落地后要做的(改动很小)

  1. mergeInboxRows(hooks/sharedUserFeeds.ts)映射新列 —— 逐字段映射,⛔ 不要改成 {...m} 展开;
  2. InboxNotification(layout/inboxGrouping.ts)声明该字段,同步更新 sharedInboxFeed.rowShape 的 DECLARED_KEYS;
  3. claimInboxArrivals(hooks/inboxArrivals.ts)的 arrival 过滤加一条:actor 等于当前用户则不进 arrivals(仍要记入 seen 集);
  4. pin 用具体且可区分的 actor id 两个方向各断言一次 —— 两个 undefined 相等证明不了任何事。

关联:objectui#7011 · objectui#5203

Activity

  1. added
    domain:ui
    on Sep 10, 2026
  2. os-litant commented on Sep 10, 2026

    @os-litant
    Contributor

    Triage: domain:ui · pm:blocked — the blocker is live, re-verified. priority:p3.

    The card already carries Blocked-by: objectstack-ai/objectstack#16974, and it is genuine rather than defensive. Re-read now:

    objectstack#16974: OPEN · pm:queue · priority:p2 · domain:services
      messaging: `sys_inbox_message` 不带 actor,消费端无法识别「自己触发的回执」
    

    ⇒ upstream is open and queued, so the fifth design constraint ("自己触发的回执类消息不弹") cannot be implemented here: the presentation layer has no actor to compare against.

    ⭐ The card is right that this is a data-surface fact, not a trade-off, and its evidence is the strong part: sys_inbox_message declares no actor column (the inbox-channel.ts write side carries none either); the actor exists only one layer up on sys_notification.actor_id, which the default permission set does not grant ordinary users; and this repo already has a ruling in the opposite direction — objectui#5203 retired InboxNotification.actor_name for exactly the reason "无列可映射", leaving two pins behind.

    ⇒ ⛔ Do not work around it. Reaching for sys_notification from the presentation layer would cross a permission boundary the default set deliberately withholds — the maintainer floor. And re-introducing an actor field on the inbox row here would reverse objectui#5203's ruling.

    ⇒ When objectstack#16974 lands, the unlock criterion for this card is installability, not merge: the actor must be present on the inbox row this repo actually consumes. ⚠️ Re-verify the four already-pinned constraints still hold at that point before adding the fifth.

    Size/model suggestion: S–M once unblocked.

    分诊席位 · session_017VGfRocA8VjczSe84fgjY3 · R+166 · 2026-09-10T14:10Z · 本评论来自分诊座位


    Generated by Claude Code

  3. added theissue type on Sep 10, 2026
  4. objectstack-fleet commented on Sep 24, 2026

    @objectstack-fleet
    Contributor

    分诊解锁扫描:pm:blocked → pm:queue —— 上游的 actor_id 列已经在 objectstack main 上;这一侧的改动在旧服务端上会自然退回今天的行为

    分诊席(session_01Tw7jnJinGHvoGSi8aFkhPJ,objectstack 座位贴 #6015),2026-09-24T17:12Z。objectui 被阻塞卡的解锁扫描(维护者「继续第③项」)。本席读完了卡面和全部 1 条评论,并在 objectstack main 上核对。

    读数

    • objectstack#16974 关闭 completed。
    • objectstack main:packages/services/service-messaging/src/objects/inbox-message.object.ts 已声明 actor_id(lookup sys_user),描述写明它正是给客户端做「自己触发的回执不弹」的本地比较用的;写入侧同文件带 actor_id: n.actorId ?? null。汇总行上为 null。

    为什么现在可以做

    • 这一列是服务端返回的数据,不是 @objectstack/spec 的类型:objectui 映射的是自己的 InboxNotification,不需要等 spec 发版。
    • 部署在旧服务端上时,行里没有 actor_id ⇒ 映射结果为 undefined ⇒ 不做过滤 ⇒ 与今天完全相同(照样弹)。所以先落地这一侧没有风险。

    ⇒ pm:blocked → pm:queue;priority:p3、domain:ui 不变。

    执行要点(卡面第 1–4 条照做,补两点)

    • 逐字段映射 actor_id,⛔ 不改成展开;同步更新 sharedInboxFeed.rowShape 的 DECLARED_KEYS。⚠️ 这等于在 objectui#5203 退休 actor_name 之后,重新加一个 actor 字段 —— 那次退休的理由是「无列可映射」,现在列已存在,理由不再成立;在 PR 里写明这一点。
    • 汇总行 actor_id 为 null:⛔ 不能当成「不是自己」之外的任何含义;null 与 undefined 都走「照样弹」。
    • 钉子用两个具体且不同的 actor id,两个方向各断言一次;再加一条「行里没有 actor_id」的对照,证明旧服务端上行为不变。

    Generated by Claude Code

  5. objectstack-fleet commented on Sep 25, 2026

    @objectstack-fleet
    Contributor

    Claim: PM loop round 1 — domain:ui execution seat 5
    Session: session_01KUxVUa7e39aNjhkKi1gsoy
    Branch: claude/issue-8667-inbox-own-receipts
    Worktree: objectui-issue-8667
    Domain: domain:ui
    Seat: domain:ui#5
    File surface: packages/app-shell/src/hooks/sharedUserFeeds.ts (mergeInboxRows's field mapping only), packages/app-shell/src/layout/inboxGrouping.ts (the InboxNotification declaration), packages/app-shell/src/hooks/inboxArrivals.ts (claimInboxArrivals's arrival filter), the row-shape pin packages/app-shell/src/hooks/__tests__/sharedInboxFeed.rowShape.test.tsx (DECLARED_KEYS) and new pins beside the arrival tests, one .changeset/8667-…md (stop on breach; explain in the report)
    Container & model: S, mode:subagent, model: opus (default judgement tier). dispatch-gates --tier: 「no path-derived mandate … floor sonnet · default opus · ceiling fable」.
    Clause-②: no
    Thread-read: 5818703956
    Serial constraints cleared: no open PR's file list and no live pm:dispatched claim names these three files or the row-shape pin. This seat's in-flight objectui#7469 edits packages/app-shell/src/layout/AppHeader.tsx, which consumes the inbox bell but is not in this surface. Upstream: objectstack#16974 is closed, and objectstack main declares actor_id on sys_inbox_message (packages/services/service-messaging/src/objects/inbox-message.object.ts:74, read in this act).

    Clause-②: no: the client maps one server-returned column onto its own InboxNotification and suppresses self-caused arrivals. No spec schema, export or accept set moves. Against an older server the row has no actor_id, so the behaviour is unchanged.

    ⇒ Fixes #8667.

    domain:ui seat 5 · session_01KUxVUa7e39aNjhkKi1gsoy · claim · 2026-09-25T05:59Z

  6. objectstack-fleet commented on Sep 25, 2026

    @objectstack-fleet
    Contributor

    os-dev-report

    {
      "issue": 8667,
      "status": "done",
      "branch": "claude/issue-8667-inbox-own-receipts",
      "pr": "https://github.com/objectstack-ai/objectui/pull/10521",
      "session": "session_01KUxVUa7e39aNjhkKi1gsoy — mode:subagent, so this is the parent's harness-stamped id (the Claude-Session line this run was handed)",
      "premise_still_valid": true,
      "summary": "BASE bc4efba732a3 (origin/main at worktree creation; the dispatch's 00715f5 and 8c929e6 were earlier mains). HEAD 9f24501 is one commit, pushed; the remote branch sha equals HEAD. Files changed (numstat +/-): packages/app-shell/src/hooks/sharedUserFeeds.ts +10/-0: mergeInboxRows maps `actor_id: typeof m.actor_id === 'string' ? m.actor_id : null` field by field, with no spread. packages/app-shell/src/layout/inboxGrouping.ts +31/-10: declares InboxNotification.actor_id?: string | null; the header records that the objectui#5203 reason ('no column to map from') no longer holds for an actor ID and still holds for a name, so actor_name stays retired. packages/app-shell/src/hooks/inboxArrivals.ts +32/-4: rule 4 plus causedBy (true only for a string equal to key); ids is unchanged, so a suppressed row is still recorded as seen. packages/app-shell/src/hooks/__tests__/inboxArrivals.test.ts +59/-0: 5 cases. packages/app-shell/src/hooks/__tests__/sharedInboxFeed.rowShape.test.tsx +48/-2: DECLARED_KEYS += actor_id; RAW_ROW.actor_id = u_zhangsan; LEGACY_ROW (key absent) control. packages/app-shell/src/hooks/__tests__/useInboxArrivalNotifier.test.tsx +27/-0: 'constraint 4' hook-wiring case. .changeset/8667-inbox-own-receipts-silent.md +20/-0: '@object-ui/app-shell': patch. H1 confirmed at bc4efba. H2: the value is a bare string id. The sys_inbox_message read in useSharedInboxFeed passes no $expand, so the adapter takes the client.data.find path, and convertQueryParams adds no expansion. Upstream ObjectQL.find expands only under `if (ast.expand && Object.keys(ast.expand).length > 0 ...)`; the inbox channel writes `actor_id: n.actorId ?? null`; the dispatcher sets no actorId on a digest group. H3: useInboxArrivalNotifier reads useAuth().user?.id (@object-ui/auth) and passes it as the claimInboxArrivals key; useSharedInboxFeed filters user_id by that same id. Installability: the objectui pnpm-lock.yaml has 0 hits for service-messaging, so the row comes from the deployed server, as unlock 5818703956 ruled. Governed surface untouched: `check-governed-queue-guard --test` over the 7 paths answers 'An ordinary pull request'. PR 10521 is a draft; assignee os-tesla was read back. Its labels `tests` and `package: app-shell` came from the labeler, not from this run. The worktree was removed without --force after `git status` was clean. Deviations: (1) commit 9f24501 ends with the harness trailer pair, whose Co-Authored-By line names a model; os-dev.md asks for model-free trailers. I report it and did not rewrite history, because objectui forbids force-push. (2) one `git fetch origin main` in the shared /home/user/objectstack checkout, to read upstream. It moved that checkout's shared refs/remotes/origin/main; there was no GitHub write. (3) The PR footer uses the os-dev.md session-URL form, not the harness reminder's form, per os-dev.md's precedence clause.",
      "tests": "HEAD 9f24501 unless marked. BASELINE at BASE bc4efba, vitest over inboxArrivals.test.ts + useInboxArrivalNotifier.test.tsx + sharedInboxFeed.rowShape.test.tsx + inboxGrouping.test.ts: exit 0, 'Test Files 4 passed (4)' / 'Tests 43 passed (43)'. The same 4 files after the change: exit 0, 'Test Files 4 passed (4)' / 'Tests 50 passed (50)'. `pnpm exec vitest run packages/app-shell/src/hooks/ packages/app-shell/src/layout/`: exit 0, 'Test Files 83 passed (83)' / 'Tests 674 passed (674)'. `pnpm turbo run type-check --filter @object-ui/app-shell --concurrency=2`: exit 0, 'Tasks: 30 successful, 30 total' (28 cached); `tsc -p tsconfig.test.json --listFilesOnly` lists all 7 edited sources. eslint on the 6 changed TS files: plain form exit 0; `--format json` counts 6 files, 0 errors, 0 warnings; `--print-config` shows parserOptions.project and projectService undefined, so linting is not type-aware and untouched files keep their verdicts; the repo-wide `pnpm lint` is declared to CI. Gates, all exit 0: check:control-bytes, check:test-path-roots, check:vi-mock-specifiers, check:vi-mock-inherit, check:vi-mock-override-shape, check:new-line-citations ('0 new citation(s), enforcement report-only'), check:changeset-claims (report-only; the pending 6730-shared-activity-type-bucket.md names sharedUserFeeds.ts for mapActivityRows, which this diff leaves untouched; re-read, still true), check:pending-changeset-literals, check-changeset-presence ('6 source file(s) of 1 released package(s) changed, and this change declares 1 changeset(s)'). Diff-derived additions, all exit 0: check-changeset-no-major, check-changeset-overwrite, check-governed-queue-guard --test, check:spec-symbols, check:i18n-keys, check:side-effects-array, check:unreferenced-sources, check:doc-example-readers. ABLATION on the committed tree 9f24501 via /home/user/objectstack/scripts/ablation-replace.mjs in WRAP mode: each anchor hit x1 and the blob changed on disk; directions were predicted before the run; 3 suites, 42 tests. No build step was needed, because the tests import the source by relative path. A, drop ' && !causedBy(row, key)': 3 failed / 39 passed (the two suppression pins + hook constraint 4). B, ids exclude self-caused rows: 1 failed / 41 passed ('still REMEMBERS'). C, producer 'actor_id: null,': 1 failed / 41 passed (row-shape mapping case). D, causedBy reads null/absent as 'me': 19 failed / 23 passed, including both the null and absent controls. RESTORE: after every leg, blob == HEAD and `git diff HEAD` is empty; final proof: inboxArrivals.ts ba699794 and sharedUserFeeds.ts bf667b40 == HEAD blobs. CI at report time, 42 check-runs on 9f24501: 23 success, 3 skipped, 16 in_progress. Status: in_progress, not awaited.",
      "mcp_calls": "0 — none",
      "api_writes": "3 — REST writes through the fleet-write relay. Each is one POST /repos/objectstack-ai/objectstack/dispatches, executed as objectstack-fleet[bot]: (1) pr_create, POST /repos/objectstack-ai/objectui/pulls with draft=true, relay run 36103257080; (2) label-write --assign os-tesla, POST /repos/objectstack-ai/objectui/issues/10521/assignees, relay run 36103331094; (3) post-stamped os-dev-report, POST /repos/objectstack-ai/objectui/issues/8667/comments (this comment). Also 2 `git push` of the branch (empty-branch probe, then 9f24501), which are not REST writes.",
      "open_questions": [],
      "out_of_scope_findings": []
    }
  7. objectstack-fleet commented on Sep 25, 2026

    @objectstack-fleet
    Contributor

    ✅ ACCEPT: objectui#10521 at 9f24501; ready + auto-merge in this act

    domain:ui seat 5, session_01KUxVUa7e39aNjhkKi1gsoy, 2026-09-25T07:46Z. Checked against the diff and CI, not against the report's own account.

    Implemented-by:  claude/issue-8667-inbox-own-receipts
    Reviewed-by:     session_01KUxVUa7e39aNjhkKi1gsoy
    
    item reading
    the fifth constraint claimInboxArrivals skips a new, unread row whose actor_id is the signed-in user's id (typeof row.actor_id === 'string' && row.actor_id === userId). The row is still recorded in the seen set
    mapping mergeInboxRows maps actor_id field by field (no spread). InboxNotification declares it, and DECLARED_KEYS gains it. actor_name stays retired (objectui#5203); the PR states why the re-add is sound now
    null and absent a digest row (null) and a pre-column server (no key) both announce as before, and each has its own pin
    pins concrete, distinct ids (u_alice / u_bob) in both directions, at the helper and the hook, with a lit toast control
    contract review PASS at CONTRACT_REVIEW_TIER on this head, record 5828827250 on the PR. The seat read the reviewer transcript: every turn was at tier
    semver '@object-ui/app-shell': patch, and every changeset sentence reads true
    governed NOT GOVERNED (7 paths)
    CI 43 check-runs on 9f24501: 40 success, 3 skipped by design, 0 red
    closing keywords the only closing reference in the body is Fixes #8667

    Findings, each with its disposition

    • The pending empty-frontmatter .changeset/inbox-actor-name-retired-5203.md says, in the present tense, that sys_inbox_message "declares no actor column". It publishes nothing and lies outside this claim ⇒ Acceptance notes. 承接者:无.
    • The commit carries a harness-written Co-Authored-By trailer. AGENTS.md exempts it, and the squash merge replaces it.

    State

    ready and auto-merge (squash) go through the relay ops pr_ready + automerge_enable in this act.

  8. objectstack-fleet commented on Sep 25, 2026

    @objectstack-fleet
    Contributor

    Landed: PR objectui#10521 merged as e2a17a5 through the merge queue

    domain:ui seat 5, session_01KUxVUa7e39aNjhkKi1gsoy, 2026-09-25T08:33Z. Verified by content on objectui origin/main, not by the sha, read at 2026-09-25T08:00Z: inboxArrivals.ts carries causedBy (2 hits), and actor_id is mapped in sharedUserFeeds.ts and declared in inboxGrouping.ts.

    The card closed completed through Fixes #8667. pm:dispatched is removed in the same stroke.

  9. added a commit that references this issue on Sep 28, 2026
    e2a17a5
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

domain:uipriority:p3

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions