Skip to content

refactor(collaboration, types)!: retire the zero-consumer useMentionNotifications hook and MentionNotification - #29732

Merged
objectstack-fleet[bot] merged 5 commits into
mainfrom
claude/project-thread-un6127
Nov 3, 2026
Merged

objectstack-fleet[bot] merged 5 commits into
mainfrom
claude/project-thread-un6127

Conversation

@objectstack-fleet

Copy link
Copy Markdown
Contributor

Requested by Steedos · project thread

Part of #25921. The umbrella stays open; this is one batch of it.

Clause-②: no (narrowing)
Metadata-protocol: none

维护者速读

  • 改了什么:删除 @object-ui/collaboration 里没有任何使用者的 useMentionNotifications 钩子(连同两个配置/结果类型),以及 @object-ui/types 里只被它读取的 MentionNotification 接口。
  • 为什么改:控制台的 @提及 铃铛读的是服务端通知(sys_notification,经 useInboxBell),这个前端内存版钩子从未被接上;留着它会让人(和 AI)误以为提及通知走的是它。
  • 风险与回滚:对外是 breaking 收窄,只影响直接 import 这几个名字的外部宿主;仓内与 hotcrm 零引用。回滚即 revert 本 PR。
  • 先看:.changeset/25921-collab-mention-notifications.md(迁移说明)、ui/packages/types/src/views.ts(删除的接口)、ui/packages/collaboration/src/index.ts(barrel 行)。
  • 两分钟验证:git grep -w -e useMentionNotifications -e MentionNotification -- ui packages apps examples content 应只剩 changeset 与 QA 清单里的历史文字,无代码命中。
  • 需要你做的:无,席位落地。

What changes

  • Delete ui/packages/collaboration/src/useMentionNotifications.ts (97 lines) and its barrel lines (useMentionNotifications, MentionNotificationsConfig, MentionNotificationsResult).
  • Delete the MentionNotification interface from ui/packages/types/src/views.ts and its barrel line in ui/packages/types/src/index.ts.
  • ui/packages/types/src/__tests__/record-id-string-survivors-10078.test.ts: doc comment only. It named MentionNotification.recordId while recounting which ids an earlier ruling covered; it now describes that interface as retired. The test pins RecordSubscription.recordId and DataSourceMutationEvent.id only, so no assertion moves.
  • One new changeset, .changeset/25921-collab-mention-notifications.md: patch for both packages, BREAKING paragraph, one FROM/TO line per retired name, ADR-0087 marker not-required (runtime-export-retired ...) naming all four operands.

Tests

Premise census on origin/main 1c1a5d4 (git grep -l -w -F NAME, excluding **/CHANGELOG.md, lockfiles and .changeset/**):

Name Files repo-wide Outside ui/packages/collaboration
useMentionNotifications 3 docs/qa/platform-checklist/areas/records-forms.json only (prose)
MentionNotificationsConfig 2 none
MentionNotificationsResult 2 none
MentionNotification 4 ui/packages/types definition, barrel and the 10078 test comment only
useRealtimeSubscription (positive control) 72 71

hotcrm and docs.objectos.ai: 0 hits for MentionNotification (case-insensitive substring). No string or dynamic import() of the module path, and neither package README names the hook or the type.

After the change (head 4d64f54). Two later merges of main brought no file of collaboration or types: d6bab30 none under ui/, 9be84e1 only ui/packages/fields (lookup cell). Readings:

  • turbo run type-check for @object-ui/types, @object-ui/collaboration, @object-ui/app-shell, @object-ui/console with their ^build closure: 74 of 74 tasks successful (lock VERDICT command-exit 0, 12m23s).
  • vitest run packages/collaboration/ packages/types/ --maxWorkers=2 from ui/: Test Files 394 passed (394), Tests 10545 passed (10545).
  • Reverse check on the rebuilt .d.ts: a temporary probe in app-shell importing the retired names answered TS2305 Module '"@object-ui/types"' has no exported member 'MentionNotification' and TS2305 ... '"@object-ui/collaboration"' has no exported member 'useMentionNotifications', while CommentEntry from the same entry still resolved. Probe deleted.
  • pnpm --dir ui run check:readme-exports: census line 0 fabricated, 0 stale omission(s); exit 1 only on the known prerequisite (packages/cli dist unbuilt: @object-ui/cli imports serve / init).
  • On 9be84e1 the census reads MentionNotificationsConfig 0, MentionNotificationsResult 0, MentionNotification 0, useMentionNotifications 1 (the QA checklist prose), control useRealtimeSubscription 72.

Acceptance notes

  • docs/qa/platform-checklist/areas/records-forms.json L3265 (a source[] line saying the hook "is exported but the console does not consume it") is now stale: the hook is no longer exported. Left untouched per the claim's file surface; L3299 is a history row and stays as written.
  • The pending precedent changeset .changeset/25921-types-comment-search-result.md says MentionNotification "stay[s] exported unchanged". This PR makes that sentence untrue for the release that consumes both. Not edited here (editing a pending 25921-* changeset reds Check Changeset); the seat may want to amend it in a docs-only follow-up before the release.
  • A director contract review is owed (narrowing batch); the seat routes it.

Verification

Derived gates (dispatch-gates --commands, head 4d64f54): 35 commands

33 of 33 run in a loop exited 0, among them check-adr-0087-registration --base origin/main, check-changeset-no-major --base origin/main, check-sdui-manifest (and --self-test), check-comment-mask-corpus, check-empty-changeset, check:published-files, check:type-check-coverage, check:undeclared-dep-imports, check:test-source-alias, check:cross-package-test-inputs, check:nul-bytes. The other two ran under the verify lock: pnpm --dir ui exec vitest run scripts/ (Test Files 170 passed, 2 skipped; Tests 4977 passed, 2 skipped; VERDICT command-exit 0) and pnpm check:type-check-debt (VERDICT command-exit 0).

Against this PR body: check-changeset-no-major exit 0, check-adr-0087-registration exit 0 (all four runtime-export-retired operands verified as retired from their entries), check-closing-keyword-parity exit 0, check-partof-closing-keyword exit 0. check-platform-checklist --changed-from origin/main: 0 anchored files in the change set.

Dogfood battery (head d6bab30)

Closure build plus pnpm --filter @objectstack/dogfood test under the verify lock: Test Files 401 passed, 3 skipped (404); Tests 3310 passed, 28 skipped (3338); VERDICT command-exit 0. The final head 9be84e1 adds only the main merge described under Tests.


Generated by Claude Code

…otifications hook and MentionNotification

The hook kept a client-side list of mention notifications that no console
surface reads: the bell reads server sys_notification rows through
useInboxBell. MentionNotification in @object-ui/types had the hook as its
only reader, so both leave their barrels together.

Co-Authored-By: Claude <[email protected]>
Claude-Session: https://claude.ai/code/session_01QsR2jSoUd7Uhw6ei5FFLD1
@github-actions github-actions Bot added size/m documentation Improvements or additions to documentation tests tooling labels Nov 3, 2026

Copy link
Copy Markdown
Collaborator

Contract-review-claim: session_01QsR2jV5sBSzCYNEDgpYLJw · head 9be84e1 · 2026-11-03T03:05Z


Generated by Claude Code

Copy link
Copy Markdown
Collaborator

director#1 · zhuangjianguo · session_01QsR2jV5sBSzCYNEDgpYLJw

Contract review

Served-tier: CONTRACT_REVIEW_TIER
Head-sha: 9be84e1ec62dcda3815249ee1ac453740c34c6b5
Local-runs: none
Scope: the PR diff at 9be84e1e (6 files, +20/−133: .changeset/25921-collab-mention-notifications.md, ui/packages/collaboration/src/index.ts, ui/packages/collaboration/src/useMentionNotifications.ts (deleted), ui/packages/types/src/index.ts, ui/packages/types/src/views.ts, ui/packages/types/src/__tests__/record-id-string-survivors-10078.test.ts), the PR body, the os-dev report 6594357327 on #25921, and on origin/main: the census of the four names (git grep -w, CHANGELOGs excluded), ui/packages/collaboration/src/index.ts L62–69, ui/packages/types/src/index.ts L1073, ui/packages/types/src/views.ts L485–509, .changeset/25921-types-comment-search-result.md, scripts/check-empty-changeset.mjs L120–135 and L541–612 (the foreign-changeset rule), AGENTS.md L646 (the CHANGELOG row)

Read-only; nothing built or run here. CI on 9be84e1e when this was written: 11 completed/skipped; 12 completed/success; 29 in_progress/null; 0 failure.

① Derived judgments

  • The diff is a pure retirement of four published names, and the census holds. On origin/main the only code sites of useMentionNotifications, MentionNotificationsConfig and MentionNotificationsResult are the hook's own file and the @object-ui/collaboration barrel (L62–69); MentionNotification has its definition (views.ts L485), the @object-ui/types barrel (L1073), the hook's imports and one doc comment in the 10078 test. The two remaining mentions are prose: the pending CommentSearchResult changeset and docs/qa/platform-checklist/areas/records-forms.json L3265/L3299. The dev's control (useRealtimeSubscription, 72 files) shows the grep sees consumers when they exist; hotcrm and docs.objectos.ai are reported at 0. The 10078 test change is a doc comment; its two assertions (RecordSubscription.recordId, DataSourceMutationEvent.id) are untouched.
  • Clause-②: no (narrowing) is the truthful form: nothing widens, and four exported names leave two package entries (clause2-line.mjs L111–117). The ADR-0087 marker is not-required (runtime-export-retired …) naming all four operands as package#Name, the tooling(adr-0087): a seventh disposition category, runtime-export-retired, for a changeset that retires published runtime exports and carries a FROM to TO block (ruling A on #22915) #22918 category for a retired entry export; the dev reports check-adr-0087-registration verifying each as retired. The FROM → TO lines give a local replacement per name, and the MentionNotification body is reproduced field for field from views.ts L485–509 (including the recordId?: string of objectui#9511), so a host can copy it.
  • The migration text itself is right. The hook never backed a console surface; the bell reads sys_notification (collab.mention) through useInboxBell, which the changeset says and the checklist's own L3299 history row confirms.

② Semver level

  • @object-ui/collaboration patch, @object-ui/types patch, Metadata-protocol: none, BREAKING banner, one marker: right. No authorable key moves; a non-protocol breaking change ships patch with its banner and disposition (AGENTS.md step 3). Both packages whose entries narrow are listed.

③ Boundary flags

  • Not Tier H. Part of #25921, umbrella open; check-partof-closing-keyword exit 0 per the body.
  • Ruling on the pending changeset 25921-types-comment-search-result.md ("CommentEntry, MentionNotification and ActivityEntry stay exported unchanged"). Leave it unedited. A PR that modifies a changeset present on its merge base is refused by check-empty-changeset under the foreign-changeset rule, in both of its classes, and the DELIBERATE CORRECTION class stays red until a person confirms it on the PR (L541–612); a docs-only follow-up is the same edit and the same red. The maintainer's confirmation is the only route, and it buys a sentence that the surviving entry can carry instead. Unlike refactor(i18n, plugin-designer)!: retire the unread designer.versionHistory key #29616's "for now", this sentence is unhedged, and both entries are @object-ui/types patch entries that changeset version will compile into the same release block, where a reader who greps MentionNotification lands on a "stays" and a "leaves" with nothing joining them. A released entry can only be amended in a dedicated docs-only PR afterwards (AGENTS.md L646), so the pre-release fix belongs in this PR's own entry: must-fix 1.
  • The checklist prose at records-forms.json L3265 ("is exported but the console does not consume it") goes stale with this PR; out of the claim's surface, carrier seat 5, named in the body.
  • Dev deviations (worktree name, dogfood at d6bab300 with the final merge touching only ui/packages/fields and non-ui files) are housekeeping; CI was in progress at writing and the seat's pre-landing checks need its green head.

④ Design judgment

  • Sound. Retiring an in-memory hook that the server-backed inbox superseded removes a false lead (the checklist item once cited it as the bell), and the four names leave together: the type had one reader, the hook, and the hook's two interfaces name the type.

Must-fix (1):

  1. In .changeset/25921-collab-mention-notifications.md, add one sentence to the BREAKING paragraph that resolves the pending CommentSearchResult entry for the release that carries both, e.g.: "The CommentSearchResult entry of this release said MentionNotification stays exported; it leaves here." Nothing else in the changeset moves; re-run check-changeset-no-major, check-adr-0087-registration and check-empty-changeset on the result.

Should-fix: none.

Implemented-by: claude/project-thread-un6127
Reviewed-by: session_01QsR2jV5sBSzCYNEDgpYLJw

VERDICT: FAIL


Generated by Claude Code

…archResult entry

The pending CommentSearchResult changeset of the same release says
MentionNotification stays exported; this entry now says it leaves here.

Co-Authored-By: Claude <[email protected]>
Claude-Session: https://claude.ai/code/session_01QsR2jSoUd7Uhw6ei5FFLD1

Copy link
Copy Markdown
Collaborator

Contract-review-claim: session_01QsR2jV5sBSzCYNEDgpYLJw · head d92625f · 2026-11-03T03:08Z


Generated by Claude Code

Copy link
Copy Markdown
Collaborator

director#1 · zhuangjianguo · session_01QsR2jV5sBSzCYNEDgpYLJw

Contract review

Served-tier: CONTRACT_REVIEW_TIER
Head-sha: d92625f88abfaa02af59f496064e24ac0f9f8ed6
Local-runs: none
Scope: the delta 9be84e1e…d92625f8 (compare API: 3 commits ahead, 0 behind; of the PR's own files one line of .changeset/25921-collab-mention-notifications.md moves, +1/−1; the merge d92625f8 brings no file under ui/packages/collaboration or ui/packages/types), the os-dev addendum 6594420535 on #25921, and record 6594389562 (the review of 9be84e1e, whose findings carry over unchanged)

Re-review of the one must-fix in record 6594389562. Read-only; nothing built or run. The six-file diff against main is otherwise byte-identical to 9be84e1e (still +20/−133), so ①, ② and ④ of that record hold.

① Derived judgments

  • The delta is the fix and nothing else. Commit fca4139e appends one sentence to the BREAKING paragraph: "The CommentSearchResult entry of this release said MentionNotification stays exported; it leaves here." The marker, the declaration lines, the FROM → TO lines and the frontmatter are untouched, and .changeset/25921-types-comment-search-result.md is not in the compare, so the foreign-changeset rule has nothing to refuse (the dev reports check-empty-changeset exit 0 on this head, with check-changeset-no-major and check-adr-0087-registration, four operands verified). The release block of @object-ui/types now carries the resolution beside the sentence it supersedes.
  • The census re-read on d92625f8 is unchanged (three names at 0, the hook at 1 QA-prose hit, control 73).

② Semver level

  • Unchanged: @object-ui/collaboration patch, @object-ui/types patch, Clause-②: no (narrowing), Metadata-protocol: none, BREAKING banner, one runtime-export-retired marker.

③ Boundary flags

  • Not Tier H. CI on d92625f8 was in progress when this was written (4 success, 3 skipped, 14 in progress, 0 failure); the reds on 9be84e1e were cancelled aggregator legs of a superseded head, not failures of this diff. The seat's pre-landing checks need this head green.
  • The records-forms.json L3265 prose staleness stays with seat 5 as carrier, per the prior record.

④ Design judgment

  • Unchanged from record 6594389562.

No must-fix. No should-fix.

Implemented-by: claude/project-thread-un6127
Reviewed-by: session_01QsR2jV5sBSzCYNEDgpYLJw

VERDICT: PASS


Generated by Claude Code

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

domain:ui#5 · zhuangjianguo · session_01QsR2jQjvWkZ7is6GXbC6DB

席位核对 — ACCEPT · domain:ui#5 · head d92625f8 · 2026-11-03T03:25Z

  • 形态: draft PR on main. The body has Part of #25921 and no closing keyword, so the umbrella stays open. 6 files, +20/−133, Tier S: check-governed-merges --pr 29732 finds 0 of 6 paths on the register and 153 lines. The body carries 维护者速读 and both declaration lines (Clause-②: no (narrowing), Metadata-protocol: none), which match the claim and the changeset.
  • 前提实测: the dev's census ran on the merged head. useMentionNotifications, MentionNotificationsConfig, MentionNotificationsResult and MentionNotification have no code consumer outside the hook and its barrel. The one prose footprint, QA records-forms.json, already says the hook is unconsumed, and history rows are left as they were. The positive control useRealtimeSubscription reads 73 files, and hotcrm reads 0. The reverse probe gives TS2305 on both names.
  • diff read: the 97-line module is deleted, and its barrel lines go from collaboration's src/index.ts. The MentionNotification interface goes from types' views.ts and its barrel line. In the record-id-string-survivors-10078 test, only the doc comment changes. The changeset 25921-collab-mention-notifications.md has patch bumps for both packages, an ADR-0087 runtime-export-retired marker naming all 4 operands, BREAKING text, and a FROM/TO per name. Its BREAKING paragraph now corrects the pending CommentSearchResult entry's "stays exported" sentence. That entry is left unedited, per the director's ruling.
  • 门禁 check-runs (pinned to head d92625f88abfaa02af59f496064e24ac0f9f8ed6): 44 success, 11 skipped, 0 failed, 0 pending (latest run per check); mergeable_state clean. Dev local gates: 35 derived, all exit 0, --ran 0 NOT-MEASURED. The body gates (changeset-no-major, adr-0087, empty-changeset) exit 0 on the new head. Type-check types, collaboration, app-shell and console: 74/74. Suites: 394 files, 10545 tests. Dogfood: VERDICT 0. check:readme-exports: 0 fabricated.
  • Contract review: director CONTRACT_REVIEW_TIER. The review on 9be84e1e (6594389562) was a FAIL with one must-fix, the stale "stays exported" sentence, and a ruling to leave the pending changeset unedited. The delta re-review on d92625f8 (6594433248) is a PASS, with no must-fix and no should-fix.
  • 接受的偏差: the worktree path is objectstack-issue-25921-b6, not the claim's objectstack-issue-25921. That is cosmetic.
  • 范围外去向: left on retire the zero-consumer surface: nine dead modules (2,211 LOC), plugin-ai, runner's publish flag, test-only reset helpers on public barrels, the providers trio, 122 dead i18n keys, root orphans #25921: the providers/upload fold, clearSharedDiscoveryCache (cross-package test readers), and the other barrel batches. Mobile's offline-queue and native exports are under active mobile work; leave them.
  • 落地条款: narrowing with a same-head PASS. Not Tier H. Land by pr_ready + automerge_enable.

@objectstack-fleet
objectstack-fleet Bot marked this pull request as ready for review November 3, 2026 03:26
@objectstack-fleet
objectstack-fleet Bot enabled auto-merge November 3, 2026 03:26
@objectstack-fleet
objectstack-fleet Bot added this pull request to the merge queue Nov 3, 2026
Merged via the queue into main with commit 3eeb81d Nov 3, 2026
56 checks passed
@objectstack-fleet
objectstack-fleet Bot deleted the claude/project-thread-un6127 branch November 3, 2026 03:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation size/m tests tooling

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants