Skip to content

feat(service-messaging): each sending feature registers its notification topics, served with a name and when it fires - #39696

Merged
objectstack-fleet[bot] merged 11 commits into
mainfrom
claude/project-thread-u1nli5
Dec 4, 2026
Merged

objectstack-fleet[bot] merged 11 commits into
mainfrom
claude/project-thread-u1nli5

Conversation

@objectstack-fleet

@objectstack-fleet objectstack-fleet Bot commented Dec 4, 2026 •

Copy link
Copy Markdown
Contributor

Requested by Tesla · project thread
Fixes #39641

Clause-②: yes (widening)
Metadata-protocol: none

维护者速读

  • 后台给出的通知主题清单现在带上每个主题的名称和"什么时候发"的一句说明,但管理员在设置界面里挑主题时暂时仍只看到主题编号,画出名称要等后续的界面改动;审批通过、审批驳回、审批未完成和管理员群发站内消息这四个主题第一次在全新环境里可选,平台主题只在发送它的功能装上时才出现,个人自己的通知偏好列表也随之变化。
  • 属于"发通知的功能自己登记"那条裁决:各发送功能把自己发的主题登记给消息服务,替写通知模板的管理员解决看不懂主题的问题。
  • 出错时(两个功能登记了同一个主题)该功能登记的主题全部不出现在可选清单里,但手工填写仍可保存,通知本身照常发送;改动可以直接撤回。
  • 要你做的事:无。

What changes

  • @objectstack/service-messaging: the notification topic registry (notification-topic-registry.ts, MessagingService.registerNotificationTopics). A descriptor carries the topic id, a label and a description (each an English fallback, catalog key optional) and optional variables; a malformed descriptor or a topic already registered is refused with a TypeError and nothing from the call is kept. The preference options door (GET /api/v1/messaging/preference-options) serves each registered topic with label and description, and variables only where the descriptor declares them (absent = not declared yet, the generic variables apply; [] = the sender declared none), in the caller's language (messaging-service-plugin.ts wires registeredTopics into its option sources). The plugin registers its own two topics (messaging.slack_link_removed, org.announcement) and core's Change Owner topic at init.
  • @objectstack/core: exports CHANGE_OWNER_NOTIFICATION_TOPIC_DESCRIPTOR (core cannot depend on messaging, so messaging registers it; zone ruling (b)).
  • @objectstack/plugin-audit: registers collab.mention and collab.reply on kernel:ready, beside its e-mail templates (collab-notification-topics.ts, new sibling module: audit-plugin.ts is over 1,000 lines and gains only the call).
  • @objectstack/plugin-security: registers security.access_upgrade and system.upgrade_impact on kernel:ready (security-plugin-start-hooks.ts).
  • @objectstack/plugin-auth: registers auth.phone_otp and auth.phone_invite on kernel:ready (phone-sms-notification-topics.ts, new sibling module: auth-plugin.ts is over 1,000 lines and gains only the hook).
  • @objectstack/plugin-approvals: registers the fifteen topics its service sends, among them approval.approved, approval.rejected and approval.abandoned, beside the registerBuiltinTemplates call in approvals-plugin.ts (approval-notification-topics.ts, new sibling module: a later card adds catalog keys and variables to every descriptor, which would push approvals-plugin.ts, at 822 lines, past 1,000).
  • The held list PLATFORM_NOTIFICATION_TOPICS (preference-options.ts, never exported from the package) is deleted: the registry is the door's only platform source. git grep PLATFORM_NOTIFICATION_TOPICS still hits two .changeset/pre/ notes, three CHANGELOG.md files (release-owned, untouched), this PR's changeset and a comment in approval-notification-topics.test.ts; no code reads the name.
  • Each sender feature-detects the member (as with registerBuiltinTemplates); a refusal is one warn, and since the registry keeps nothing from a refused call, those topics are then not offered at all (one collision drops every topic of that sender's call) unless a flow names one or the organization has stored one; the notices are sent either way. The audit and security packages declare the descriptor shape structurally, since they take no dependency on service-messaging.

Tests

  • approval-notification-topics.test.ts (new): the real MessagingServicePlugin and ApprovalsServicePlugin over a real ObjectQL, the door driven through the handler the messaging plugin mounts; every approval topic is offered with label and description, among them the three never listed and the twelve approval ids the deleted list offered (pinned literally). It also pins that every 'approval.*' topic literal in the package source is registered, and the no-member, refusal and success paths. Ablation: replacing the plugin's registerApprovalNotificationTopics call with a no-op reds the door case (approval.abandoned: expected undefined to deeply equal {...}); restored, git diff HEAD empty.
  • slack-channel-composition.test.ts (the plugin plus the doors it mounts): the door serves org.announcement, messaging.slack_link_removed and record.owner_changed with label and description; CONTROL: a topic nobody in that composition registered is not offered at all.
  • preference-options-routes.integration.test.ts, notification-topic-registry.test.ts, my-preferences-routes.integration.test.ts: the platform topics now come from registered fixture descriptors; a topic no feature registered is not listed. Ablation: dropping the plugin's registration call reds it (expected [] to deeply equal [ Array(3) ]), restored.
  • audit-plugin.test.ts: registration on kernel:ready against a real MessagingService, a refused registration as one warn, and a messaging service without the member.
  • access-upgrade-report.wiring.test.ts: the security plugin's kernel:ready registration, and a refusal as one warn.
  • auth-plugin.test.ts and phone-sms-notification-topics.test.ts: the auth hook, and the module's success, refusal and no-member paths.
  • notification-topic-registry.test.ts (phase 1): the registry's refusals, rendering, and the door over it.
  • variables on the door (contract review S2): preference-options-routes.integration.test.ts pins a registered topic without variables served with no variables member, one declaring a variable served with it, and one declaring [] served []; notification-topic-registry.test.ts pins the rendering keeps the member absent. Ablation: restoring (d.variables ?? []) in NotificationTopicRegistry.render reds both (2 failed / 21 passed), restored.

Acceptance notes

  • The held list is deleted in this PR (zone word: "Option 1 in full: register every held topic at its sender, delete the held list in this PR").
  • Behaviour change in a composition that leaves out a sender: a topic is offered only where the feature that sends it is composed. Measured on fresh boots: pnpm dev:showcase -- --fresh (approvals composed) offers all 20 ids the held list offered plus approval.approved, approval.rejected, approval.abandoned and org.announcement, each with label and description; pnpm dev:crm -- --fresh (no approvals in requires) offers no approval.* topic, where the held list used to offer twelve that nothing in that composition sends. A topic an organization has stored notifications for is still offered under stored.
  • Surface beyond the claim's file list: approval-notification-topics.ts and its test (new files), and my-preferences-routes.ts (one doc sentence) with my-preferences-routes.integration.test.ts, whose fixture leaned on the deleted list.
  • Catalog keys (11 languages) and declared variables are left to notification topics: the approvals package registers the topics it sends #39642-notification topics: the core Change Owner package registers the topics it sends #39650, per the ruling.
  • The registration is code, rebuilt on each boot; nothing is stored.
  • The Console pickers still show bare topic ids: their reader (ui/packages/fields/src/widgets/preferenceOptions.ts) keeps value, wildcard, configured only, and no ui/ file is in this diff. Drawing the name, description and variables is the ui card (notification template form: the topic picker shows label and description, the form lists the topic's variables #39651).
  • Second door: GET /api/v1/messaging/me/preferences lists a person's own preferences from the same readPreferenceOptions, so each person's own list changes by composition the same way (the four new topics appear on a fresh boot; the twelve approval.* ids leave where approvals is not composed). Named in the changeset too.

Verification

Read first:

  1. packages/services/service-messaging/src/preference-options.ts: readPreferenceOptions now reads platform topics from registeredTopics only.
  2. packages/plugins/plugin-approvals/src/approvals-plugin.ts: the registerApprovalNotificationTopics call after registerBuiltinTemplates.
  3. packages/services/service-messaging/src/messaging-service-plugin.ts: registeredTopics in optionSources.

Two-minute check: pnpm --filter @objectstack/plugin-approvals exec vitest run src/approval-notification-topics.test.ts, expect 5 passed, including "offers every approval topic with its label and description, the three never listed among them".

Local readings at 1ab6758 (contract review rework)
  • Rework commit 1ab6758 (one commit on 785344d): M1/S3 changeset text, S1 refusal words in the four senders, S2 variables omission, N1 this body.
  • Tests at 1ab6758: service-messaging 86 files / 1150 passed (full package); approval-notification-topics.test.ts 5 passed; audit-plugin.test.ts 35 passed; phone-sms-notification-topics.test.ts + auth-plugin.test.ts 124 passed; access-upgrade-report.wiring.test.ts 10 passed.
  • Typecheck: turbo run typecheck --only on service-messaging, plugin-approvals, plugin-audit, plugin-auth, plugin-security: 5/5 successful.
  • Derived gate families: dispatch-gates --commands at 1ab6758 derives 85 families (28 paths vs merge base 1802815); --ran: 80 run exit 0, 5 NOT-MEASURED, 0 unrun. NOT MEASURED locally: check-comment-mask-corpus, check:query-options-erasure, check:type-check-debt (killed by local 120s/190s timeouts on a shared box), check:dual-build-cjs-loads, check:i18n (exit 3 PREREQUISITE NOT MET, no dist/ in a closure-only build); CI runs all five.
Local readings at 785344d
  • Typecheck: turbo run typecheck --continue on plugin-auth, plugin-approvals, plugin-audit, plugin-security, service-messaging and core: 46/46 tasks successful (plugin-auth a cache miss, executed). The first CI run at 1aaec7e read Type Check · workspace red: plugin-auth's check:test-typecheck counted one TS2322 beyond its ledger in the phase 2 case of auth-plugin.test.ts; fixed in 785344d by typing the mock as PluginContext['getService'] (check:test-typecheck for plugin-auth: OK, held at the ledger).
  • Tests: plugin-approvals 150 files / 2441 passed; service-messaging 86 / 1150 passed (both at 1aaec7e; 785344d changes only the auth test); auth-plugin.test.ts 121 passed at 785344d. Phase 2 readings at b36c272: plugin-audit 120 / 1990; plugin-security 294 / 7455 (52 skipped); plugin-auth 298 / 6356 (10 skipped); core 164 / 3866.
  • Derived gate families (dispatch-gates --commands, re-derived at 785344d, same 85 as at 1aaec7e): 85 run, all exit 0; --ran reconciliation: 85 run, 0 NOT-MEASURED (derived zero, every line carries its exit code). At 1aaec7e three first-pass reds were re-run: check:dual-build-cjs-loads and check:i18n exit 3 (PREREQUISITE NOT MET, no dist/) green after the build each prescribes; check:query-options-erasure killed by a local timeout, green on re-run.
  • check-platform-checklist --changed-from origin/main: OK, 0 anchors lost.
  • Fresh boots: see Acceptance notes (showcase and CRM, GET /api/v1/messaging/preference-options read as the seeded admin).
  • CI at 785344d: 72 check-runs, 59 success, 13 skipped (opt-in dogfood/tarball/upgrade harness and path-scheduled jobs), 0 failure.

Generated by Claude Code

…ce options door serving it

A sending feature registers each topic it sends (label, description,
variables as catalog keys with English fallbacks) through
MessagingService.registerNotificationTopics; the preference options door
serves registered topics as platform, with their texts in the caller's
language. The held topic list stays until the sequencing fork is ruled.

Co-authored-by: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01L9qibzh1VNrCPz6JqyRPQQ
… the topic registry pins

Co-authored-by: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01L9qibzh1VNrCPz6JqyRPQQ
…cs to the registry

Audit, security, auth, messaging's own Slack link and in-app message doors,
and core's Change Owner notice register their topics with an English label
and description; the preference options door serves them.

Claude-Session: https://claude.ai/code/session_01L9qibzh1VNrCPz6JqyRPQQ
Co-authored-by: Claude <noreply@anthropic.com>
@github-actions github-actions Bot added size/xl documentation Improvements or additions to documentation tests tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface labels Dec 4, 2026
@github-actions

github-actions Bot commented Dec 4, 2026 •

Copy link
Copy Markdown
Contributor

📓 Docs Drift Check

This PR changes 6 package(s): @objectstack/core, @objectstack/plugin-approvals, @objectstack/plugin-audit, @objectstack/plugin-auth, @objectstack/plugin-security, @objectstack/service-messaging, touching 65 documentable anchor(s). ⚠️ 3 changed file(s) yielded no anchor (packages/core/src/security/index.ts, packages/services/service-messaging/src/index.ts, packages/services/service-messaging/src/my-preferences-routes.ts), so the pages documenting them are NOT COVERED by this run — this is not a clean bill of health for those files.

8 hand-written doc(s) NAME something this change touched and may need an implementation-accuracy re-verification:

  • content/docs/automation/approvals.mdx (via approval.approved (literal, a string literal in topic), approval.rejected (literal, a string literal in topic), approval.requested (literal, a string literal in PLATFORM_NOTIFICATION_TOPICS; a string literal in topic))
  • content/docs/automation/webhooks.mdx (via MessagingServicePlugin (symbol, a top-level class))
  • content/docs/kernel/contracts/data-engine.mdx (via collab.reply (literal, a string literal in PLATFORM_NOTIFICATION_TOPICS))
  • content/docs/kernel/runtime-services/push-service.mdx (via /devices/:deviceId (route, bridged from symbol getLocales — its route source's handler names it))
  • content/docs/kernel/services-checklist.mdx (via getLocales (symbol, a method of interface NotificationTopicI18n), unregisterDevice (sdk, the bare tail of client method notifications.unregisterDevice, bound to DELETE /notifications/devices/:deviceId), /api/v1/i18n/locales (route, the route ledger binds it to client method i18n.getLocales))
  • content/docs/plugins/packages.mdx (via MessagingServicePlugin (symbol, a top-level class))
  • content/docs/protocol/kernel/http-protocol.mdx (via getLocales (symbol, a method of interface NotificationTopicI18n))
  • content/docs/ui/translations.mdx (via /api/v1/i18n/locales (route, the route ledger binds it to client method i18n.getLocales))

⛔ 7 release-owned page(s) also name something this change touched. These are read-only:

  • content/docs/releases/v14.mdx (via MessagingServicePlugin (symbol, a top-level class))
  • content/docs/releases/v17/17-0.mdx (via unregisterDevice (sdk, the bare tail of client method notifications.unregisterDevice, bound to DELETE /notifications/devices/:deviceId))
  • content/docs/releases/v17/17-2.mdx (via MessagingService (symbol, a top-level class))
  • content/docs/releases/v17/17-5.mdx (via MessagingServicePlugin (symbol, a top-level class))
  • content/docs/releases/v18/18-0.mdx (via /api/v1/i18n/locales (route, the route ledger binds it to client method i18n.getLocales))
  • content/docs/releases/v18/18-3.mdx (via unregisterDevice (sdk, the bare tail of client method notifications.unregisterDevice, bound to DELETE /notifications/devices/:deviceId), /devices/:deviceId (route, bridged from symbol getLocales — its route source's handler names it))
  • content/docs/releases/v18/18-5.mdx (via MessagingService (symbol, a top-level class))

content/docs/releases/ is RELEASE-OWNED (AGENTS.md "Documentation Guardrails"): release
notes are written centrally at release time, and a code PR that edits them is the exact PR
that guardrail exists to stop. They are still audited — read-only. If one of them is actually
wrong, file an issue or open a dedicated docs-only PR; do not edit it here.

What this run could not see
  • 3 changed file(s) yielded no anchor (packages/core/src/security/index.ts, packages/services/service-messaging/src/index.ts, packages/services/service-messaging/src/my-preferences-routes.ts) — pages documenting those are invisible to this run
  • 12 name(s) were too generic to anchor anything (single lowercase words)
  • the SDK route bridge reached 71 of 255 client-bound route-ledger rows — the other 184 have no registrar path: tail to select them, so pages documenting THEIR client methods cannot appear above, on this or any run. Of those 184: 0 are remediable by widening that discovery convention (an in-repo file declares the path; the convention did not scan it); 60 are structural — on a ledger where NOT ONE row is declared in-repo, so no discovery change reaches them at any price; 124 are undecided (no in-repo declaration, on a ledger that has other in-repo registrars — absence and an unreadable spelling are not distinguishable here). The rows themselves: node scripts/docs-audit/affected-docs.mjs --bridge-coverage
  • a page that states a rule by its inputs shares no identifier with the emitter that implements the rule, so an emitter-only diff cannot list it — not on this run and not on any run. Measured on fix(driver-sql): emit varchar(maxLength) for a text field a declared index keys on #11430: content/docs/protocol/objectql/types.mdx documents the text-family column mapping by the ObjectQL type names it maps FROM (text / textarea / html) while the diff changed createColumn; it went unlisted, and it was the page that diff falsified, in four places. No shared token exists to detect this on, so a rule your change carries has to be re-read by hand in the pages that restate it.
  • a key NAME is not a key, so the hand re-read the line above prescribes can land on the wrong schema. The same spelling is authorable on one governed type and a [REMOVED] tombstone on another for each of active, aria, joins, objects, template, tools and version (censused on [finding] tools is a key on BOTH AgentSchema (tombstoned, dead) and SkillSchema (live, cloud-attested), so a name-based search attributes skill examples to the agent key — it produced a false stop-the-line alarm on PR #19059 #19093 over the liveness ledger's governed types, top-level keys); nothing in a search result distinguishes the two, so a grep hit on a LIVE example reads as evidence about the DEAD key. Measured on fix(spec): the agent.tools liveness row says dead — it claimed live on a key the schema tombstoned #19059: content/docs/ai/agents.mdx was reported as contradicting the agent.tools tombstone over its tools: example at :161, which is inside the defineSkill({ block opened at :155 — the page was already correct. Settle ownership by PARSING the value against both schemas, never by the name: that literal PASSES SkillSchema, and as an AgentSchema it FAILS at tools with the tombstone prescription. ⛔ These names are not the whole class — a key retired through a .strict() guidance map leaves no tombstone in the walked shape and none of them here (tool.category, live as AIToolDefinition.category).

Coarse fallback — 65 page(s) merely mention a changed package (the pre-#9192 predicate, kept for the deliberately-wide backstop): node scripts/docs-audit/affected-docs.mjs --json 04eba3d2d506f127049a9e27783c56b3617fae79 → packageMentionDocs.

Which tree this was computed on

This run read content/docs from 90a41afaf7aedb8d75276af30a93c79364d27e07 — the merge of head 1ab675870cfe20a62ef19ad0e63a85ad49298cc3 into base 04eba3d2d506f127049a9e27783c56b3617fae79, which is what actions/checkout gives a pull_request run. Not the PR head.

A worktree cut from an older main holds a different content/docs, so re-deriving there can legitimately return a different list — that is a different tree, not a wrong row. To answer on the same tree:

# while this PR is open — GitHub drops the merge commit once it closes
git fetch origin 90a41afaf7aedb8d75276af30a93c79364d27e07 && git checkout 90a41afaf7aedb8d75276af30a93c79364d27e07
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin 04eba3d2d506f127049a9e27783c56b3617fae79 1ab675870cfe20a62ef19ad0e63a85ad49298cc3 && git checkout -B drift-repro 04eba3d2d506f127049a9e27783c56b3617fae79 && git merge --no-ff 1ab675870cfe20a62ef19ad0e63a85ad49298cc3

node scripts/docs-audit/affected-docs.mjs --json 04eba3d2d506f127049a9e27783c56b3617fae79

⚠️ That checkout carried uncommitted changes, so the commit above does not fully identify what was read.

Advisory only, and a precision-first one (#9192): a page is listed because it names a
symbol, wire route or SDK method this diff touched — not because it mentions a changed
package. Each row says which anchor put it there, so a wrong row is reportable rather than
merely annoying. To re-verify, run the docs-accuracy-audit workflow scoped to these files:
node scripts/docs-audit/affected-docs.mjs 04eba3d2d506f127049a9e27783c56b3617fae79 → pass the list as
args.docs, on the commit named under Which tree this was computed on.

…lete the held topic list

The approval plugin registers the fifteen topics its service sends with the
messaging service's topic registry, beside its e-mail templates, so the
preference options door offers approval.approved, approval.rejected and
approval.abandoned with a name and when they fire. With every sender
registered, service-messaging's PLATFORM_NOTIFICATION_TOPICS is deleted: the
registry is the door's only platform source.

Claude-Session: https://claude.ai/code/session_01L9qibzh1VNrCPz6JqyRPQQ
Co-authored-by: Claude <noreply@anthropic.com>
The phase 2 case assigned a vi.fn to mockContext.getService without the
cast the generic signature needs, so check:test-typecheck read one TS2322
beyond its ledger. Cast it as PluginContext['getService'].

Claude-Session: https://claude.ai/code/session_01L9qibzh1VNrCPz6JqyRPQQ
Co-authored-by: Claude <noreply@anthropic.com>
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack@os-tesla · os-tesla · session_01L9qibxRrrjrsQAWAcsbV46

Contract-review-claim: session_01L9qibxRrrjrsQAWAcsbV46 · head 785344d · 2026-12-04T15:41Z

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack@os-tesla · os-tesla · session_01L9qibxRrrjrsQAWAcsbV46

Contract review

Served-tier: TIER_DEFAULT
Head-sha: 785344d5101a688e01ca8ab7d93a388494554e0b
Local-runs: none

Read: card #39641 (body and all 9 comments), PR #39696 (body, 28 files, net diff against merge base 18028154), the 72 check-runs on the head (59 success, 13 skipped, 0 failure, 0 pending), ruling 7409753977 and analysis 7408971705 on #39412. The face is the declaration face (record-recognisers --paths on the file list: no schema or governed path; the changeset's Clause-②: yes (widening) line decides). Section ④ is added because the card body asks for the review at the higher tier.

① Derived judgments

  • MessagingService.registerNotificationTopics(descriptors) and the public notificationTopics registry: a new member on a service with no spec contract (messaging is not in the contract ledger). Widening. Right.
  • New exported types NotificationTopicDescriptor, NotificationTopicText, NotificationTopicVariable (service-messaging/src/index.ts) and new export CHANGE_OWNER_NOTIFICATION_TOPIC_DESCRIPTOR (core/src/security/index.ts). Widening. Right.
  • GET /api/v1/messaging/preference-options: each registered topic gains label, description, variables; unregistered topics carry none of the three. Members added, none removed or retyped. The Console reader (ui/packages/fields/src/widgets/preferenceOptions.ts listOf) keeps value, wildcard, configured only, so the added members break no reader. Widening. Right.
  • The same door's topic list changes by composition: a platform topic is listed only where its sender is composed and registered. The list is a suggestion over a text field (ruling 6670386759), not an accept set: a typed or stored value is still accepted. So this is a behaviour change, not a (narrowing). Declared in the PR body's acceptance notes. Right.
  • GET /api/v1/messaging/me/preferences reads the same readPreferenceOptions (my-preferences-routes.ts:117, same optionSources), so every person's own preference list changes the same way: approval.approved, approval.rejected, approval.abandoned, org.announcement appear on a fresh boot; the twelve approval.* ids disappear where approvals is not composed. The diff implies it; the changeset and PR body do not name this door. See S3.
  • PLATFORM_NOTIFICATION_TOPICS deleted: the package exports . only and index.ts on main never exported it; git grep on the merge base finds no importer outside preference-options.ts. Not a public removal. Right.
  • readPreferenceOptions(sources, organizationId, locale?) and optional PreferenceOptionsSources.registeredTopics: package-internal (not exported from index.ts). Right.
  • Held-list coverage: the 20 held ids are all registered at this head: 12 approval.* (plugin-approvals), auth.phone_otp / auth.phone_invite (plugin-auth, constants PHONE_SMS_TOPICS), collab.mention / collab.reply (plugin-audit, MENTION_TOPIC / REPLY_TOPIC), security.access_upgrade / system.upgrade_impact (plugin-security), messaging.slack_link_removed and record.owner_changed (messaging plugin). Each registration is unconditional once its plugin starts and the messaging service offers the member. Right.

② Semver level

  • Level: patch on the six packages the diff moves. Metadata-protocol: none takes patch (AGENTS.md Post-Task Checklist 3: "a non-protocol change, widening or breaking, ships patch"). Right. Check Changeset: success (2 runs).
  • Clause-②: yes (widening) and Metadata-protocol: none, line-initial in the PR body and the changeset body, agree with ①. Right.
  • The changeset text does not match what the diff publishes. M1.

M1 (must-fix) — The changeset's title and first paragraph state a Console behaviour this diff does not ship. .changeset/39641-notification-topic-registry.md:10 reads "the topic pickers show the name and when it fires" and :15 reads "An administrator picking a notification topic ... now sees a name and one sentence on when the topic fires, rather than a bare topic id." No file under ui/ is in the diff, and the picker's reader (ui/packages/fields/src/widgets/preferenceOptions.ts, listOf) drops every member except value, wildcard, configured: the picker still shows bare ids. Drawing them is the ruling's term ③ (the ui card after #39560). This text ships as CHANGELOG.md in six packages, and AGENTS.md lets a released entry be corrected only by a dedicated docs PR. Fix: say what this diff publishes (the door serves the three members; four topics are newly offered on a fresh boot; a platform topic is offered only where its sender is composed), and say the pickers draw the name with the ui card. The PR body's 维护者速读 first bullet makes the same claim ("现在每个主题带名称和「什么时候发」的一句说明") and needs the same correction.

S3 (should-fix) — The changeset and PR body name GET /api/v1/messaging/preference-options only. GET /api/v1/messaging/me/preferences lists its topics from the same function, so each person's own notification preference list gains and loses the same topics by composition. Name the second door in the changeset while fixing M1.

③ Boundary flags

  • open_questions: empty in both os-dev reports (7413291915, 7416178708). Nothing to answer.
  • Deviation, sibling modules (approval-notification-topics.ts, collab-notification-topics.ts, phone-sms-notification-topics.ts) and core/src/security/index.ts, my-preferences-routes.ts with its fixture: covered by claim amendment 7416235070. Answered.
  • Deviation, descriptor shape declared structurally in plugin-audit, plugin-security and plugin-approvals: @objectstack/service-messaging sits under devDependencies in all three package.json files, under dependencies in plugin-auth, which imports the real type. Consistent with the existing local surfaces (MessagingEmitSurface, AccessUpgradeNotifier, ApprovalMessagingSurface). The shape is checked at runtime by the registry and pinned by tests that run the real MessagingService. Answered.
  • Deviation, auth-plugin.test.ts typed mock (CI red at 1aaec7e2): Type Check · workspace and TypeScript Type Check are success on this head. Answered.
  • Fork named by the ruling (a sender that cannot reach the member without a spec contract edit): none occurred. Core's Change Owner topic is registered by the messaging plugin from a constant core exports, per zone ruling 7411363617; no packages/spec file is in the diff. Answered.
  • PR body claim "git grep PLATFORM_NOTIFICATION_TOPICS now hits only two .changeset/pre/ notes": at this head it also hits three CHANGELOG.md files (release-owned, correctly untouched), the new changeset and a comment in approval-notification-topics.test.ts. No code reads the name. N1.
  • SQL push-down: the diff adds no query, no id materialisation and no in-app join. The registry is an in-memory map; the door's two existing reads are unchanged. No finding.
  • Check-runs on the head: 59 success, 13 skipped (opt-in and path-scheduled jobs), 0 failure, 0 in progress.

N1 (nit) — The PR body's grep sentence under-counts the remaining hits (see above); none is a reader.

④ Design judgment

Against ruling 7409753977 / analysis 7408971705 (option D):

  • "Each sending feature registers its own topics in code, beside its built-in templates": approvals beside registerBuiltinTemplates in start; audit, security and auth on kernel:ready; messaging at init for its own two. Holds.
  • "The held list is deleted and the platform source reads the registry": holds; readPreferenceOptions has one platform source.
  • "Red first: the three approval topics are offered on a fresh boot": pinned in approval-notification-topics.test.ts through the mounted door with real plugins; the dev reports the ablation red. Holds.
  • "No new authorable type", Metadata-protocol: none: holds; nothing under packages/spec.
  • Analysis axis ③ (a forgotten topic must give a signal): the approvals test pins that every 'approval.*' literal in the package source is registered. Holds for approvals, the package where the held list drifted.
  • "Fork, never a silent fallback to a side table": the core descriptor lives in core and is registered by messaging, which already carries core's Change Owner text. It is the sender's own declaration, not a table kept in messaging. Holds, and it is the zone's ruled shape.

Against the zone amendments (7411363617, 7411387836, 7416235070): label and description required, key and variables optional; every held topic registered with English text; the four absent ones included; held list deleted in this PR; approvals beside registerBuiltinTemplates; sibling modules. All delivered as ruled.

Attempts to break it:

  • Topics a fresh boot used to offer that vanish: none where the sender is composed (see ① coverage). They vanish where the sender is not composed, which is D's stated end state ("a topic appears the moment its sender ships").
  • CRM without approvals: the twelve approval.* ids leave both doors. Nothing in that composition sends them; a stored notification still lists its topic under stored; a preference or template row that names one keeps its value because the field is text. Consistent with D. One gap: a template row for an approval topic written before approvals is composed is no longer suggested by the picker; the value still saves when typed. Acceptable.
  • A refused registration: this is where the diff's own words are wrong. S1.
  • The served variables member: S2.
  • Core descriptor registered by messaging: typed as const in core and checked against NotificationTopicDescriptor at the registerNotificationTopics call, so drift is a compile error in service-messaging. Pinned through the door in slack-channel-composition.test.ts. Holds.
  • Local descriptor shapes in audit, security and approvals: they declare topic, label.fallback, description.fallback only. When notification topics: the approvals package registers the topics it sends #39642 to notification topics: the core Change Owner package registers the topics it sends #39650 add key and variables, each local interface must be widened by hand; the registry refuses an unknown member and the whole call with it, so a mistake there costs every topic of that sender (S1). The per-package tests against the real service catch it. Holds with that dependency on the tests.

S1 (should-fix) — After the held list's deletion, a refused registration no longer "costs only the description": the topic is not offered at all unless a flow names it or the organization has stored one, and one collision drops the sender's whole call (all fifteen approval topics). The text was true in phase 2 and was not updated in phase 3. It is wrong in the four warn messages an operator reads ("the topic pickers show them with no name or description": approval-notification-topics.ts, collab-notification-topics.ts, phone-sms-notification-topics.ts, security-plugin-start-hooks.ts), in those modules' docblocks, and in the PR body ("出错时只是某个主题少了名称和说明、照样能选"; "a refusal is one warn and costs only the description"). Fix the words to "the topic pickers do not offer them". Not a must-fix: the refusal needs two features registering one id, which no composition in the repo does, and the notices are sent either way.

S2 (should-fix) — The door serves variables: [] for every registered topic, whether its sender declared no variables or has not declared them yet. NotificationTopicDescriptor.variables is optional, and the door collapses absent and empty. At this head no sender declares any, so all 24 registered topics answer []. The ruled ui card (term ③: "the form lists the chosen topic's variables, an unlisted topic shows the generic ones") cannot tell "this topic has none" from "not declared", and a form that trusts [] shows no variable help for exactly the registered topics. Either omit variables on the door when the descriptor omits it, or state in preference-options.ts and the changeset that an empty list means "none declared, use the generic ones". Cheaper now than after a reader exists.

No must-fix in ④; M1 stands under ②.

Implemented-by: claude/project-thread-u1nli5
Reviewed-by: session_01L9qibxRrrjrsQAWAcsbV46

VERDICT: FAIL

…lared variables on the door

The changeset no longer claims the Console pickers draw topic names (they
still show ids; the drawing is the later ui card), names the four newly
offered topics, the composition dependence, and the second door that reads
the same options (GET /api/v1/messaging/me/preferences). The door serves
`variables` only when the sender declared them, so "not declared yet" stays
distinguishable from "declares none". The four senders' refusal warnings and
docblocks now say a refused registration leaves the topics unoffered.

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01L9qibzh1VNrCPz6JqyRPQQ
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack@os-tesla · os-tesla · session_01L9qibxRrrjrsQAWAcsbV46

Contract-review-claim: session_01L9qibxRrrjrsQAWAcsbV46 · head 1ab6758 · 2026-12-04T16:31Z

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack@os-tesla · os-tesla · session_01L9qibxRrrjrsQAWAcsbV46

Contract review

Served-tier: TIER_DEFAULT
Head-sha: 1ab675870cfe20a62ef19ad0e63a85ad49298cc3
Local-runs: none

Delta round on record 7416374363 (FAIL at 785344d5). Read: card #39641 (body and all 10 comments, os-dev report 7417536225 among them), PR #39696 (live body, 28 files, net diff against merge base 18028154), the delta 785344d5..1ab67587 (one commit, 15 files, +74 -31), and the 76 check-runs on this head. The face is unchanged: declaration (Clause-②: yes (widening), no schema or governed path). Section ④ is kept because the card body asks for the review at the higher tier.

Findings of the previous record:

  • M1: closed. The changeset title now reads "each sending feature registers its notification topics, and the preference options door serves each one's name, when it fires and its variables", and its first paragraph says the Console pickers still show the bare topic id, with the drawing left to notification template form: the topic picker shows label and description, the form lists the topic's variables #39651. The PR body's 维护者速读 first bullet says the same. No sentence in the changeset or body claims a Console change.
  • S1: closed. The four warn messages (approval-notification-topics.ts, collab-notification-topics.ts, phone-sms-notification-topics.ts, security-plugin-start-hooks.ts) now say the pickers do not offer the topics; the four docblocks, the changeset's last paragraph and the PR body say that the registry keeps nothing from a refused call and one collision drops the sender's whole call. git grep on this head finds no remaining "no name or description" or "costs only the description" in the six packages.
  • S2: closed. NotificationTopicRegistry.render and readPreferenceOptions omit variables when the descriptor omits it and serve [] only when the sender declared an empty list. Judged below under ① and ④.
  • S3: closed. GET /api/v1/messaging/me/preferences is named in the changeset's first paragraph and in the PR body's acceptance notes.
  • N1: closed. The body's grep sentence now lists two .changeset/pre/ notes, three CHANGELOG.md files, this PR's changeset and the test comment, which is what git grep PLATFORM_NOTIFICATION_TOPICS returns on this head.

① Derived judgments

Everything the previous record named right under ① still stands; the delta moves one answer.

  • GET /api/v1/messaging/preference-options, a registered topic: variables is now present only where the descriptor declares it. Against main, where no topic carried the member, this is still a member added and never removed. Against 785344d5 it is an unpublished head, so nothing released moves. Widening. Right.
  • PreferenceTopicOption.variables was already optional; RenderedNotificationTopic.variables goes from required to optional. The type is not exported from index.ts and its only reader is readPreferenceOptions, which the same commit guards. TypeScript Type Check and Type Check · workspace are success. Right.
  • The door's stated contract agrees with the code: the route docblock (preference-options-routes.ts), the PreferenceTopicOption.variables and NotificationTopicDescriptor.variables docblocks and the changeset all say absent means not declared (the generic variables apply) and [] means the sender declared none. The Console reader keeps value, wildcard, configured only, so no reader depends on the member being present. Right.
  • The registry accepts a declared empty list (descriptorProblem returns on undefined, then walks the array), so the [] branch is reachable. Right.
  • The changeset's "No sender declares variables yet" is true at this head: no descriptor in the six packages carries a variables member, so every registered topic answers without one. Right.
  • Tests: the door test pins the three cases through the mounted route (absent, one declared variable, []); the registry test pins the member absent; five sender tests drop the variables: [] line that S2 made wrong. toEqual treats a missing member and undefined alike, so the two explicit not.toHaveProperty('variables') assertions are what pin the omission. Right.

② Semver level

  • Level: patch on the six packages, with Metadata-protocol: none. Unchanged and right. Check Changeset: success (2 runs).
  • Clause-②: yes (widening) and Metadata-protocol: none, line-initial in the PR body and the changeset, agree with ①. Right.
  • The changeset text now matches what the diff publishes: the door's three members, the four newly offered topics, composition-following platform topics, the second door, the refusal's real cost, and the pickers unchanged until notification template form: the topic picker shows label and description, the form lists the topic's variables #39651.

③ Boundary flags

  • open_questions: empty in report 7417536225. Nothing to answer.
  • Deviation, the gate loop moved to the background and awaited before use: a local process matter; the check-runs on the head are the verdict. Answered.
  • Deviation, the first push refused by check:commit-card-trailers and the unpublished commit amended: no published history was rewritten (785344d5..1ab67587 is a fast-forward of one commit). Answered.
  • Deviation, five sender tests edited outside the original file list: each edit deletes the one variables: [] pin, forced by S2; the files are the test surface of amendment 7416235070. Answered.
  • Dev's five locally NOT-MEASURED gate families: Type Check · debt ledger, Lint · scoped · query-options erasure and Lint · scoped · slot lookup & corpus are success on this head; for check:dual-build-cjs-loads and check:i18n I did not map the family to a job name, and no check-run on the head failed. Answered.
  • SQL push-down: the delta adds no query, no id materialisation and no in-app join. No finding.
  • Check-runs on this head: 76 runs, 61 success, 15 skipped (opt-in and path-scheduled jobs), 0 failure, 0 in progress. Test Core (1/12) and Test Core (5/12) were still running at the first read and finished success before this record was written.

N2 (nit) — The module docblock of preference-options.ts (the "platform" bullet under "Topics — three sources") still says each registered topic is "served with its label, description and variables in the caller's language", without the "where declared" the other four places now carry. The member's own docblock twenty lines below states the rule correctly. No effect on the contract.

④ Design judgment

The previous record's reading against ruling 7409753977, analysis 7408971705 and zone amendments 7411363617, 7411387836, 7416235070 stands; the delta changes no registration, no source and no door path.

On the S2 shape the dev chose (omit, of the two options offered):

  • It is the shape the ruled ui card needs (term ③: "the form lists the chosen topic's variables, an unlisted topic shows the generic ones"): a reader tests for the member, and a registered topic whose sender has not declared its variables falls through to the generic ones with no special case. [] keeps a meaning of its own.
  • It matches how the same option already treats label and description: absent where nobody registered them.
  • It costs later cards nothing: notification topics: the approvals package registers the topics it sends #39642 to notification topics: the core Change Owner package registers the topics it sends #39650 add variables to a descriptor and the member appears, with no door change.
  • Attempt to break it: a descriptor declaring variables: undefined explicitly. descriptorProblem accepts it, render tests !== undefined, so the member stays absent. Consistent.
  • Attempt to break it: a topic that is both registered and stored. The door test's approval.requested case carries sources: ['platform', 'stored'] with label and description and no variables. Consistent.

The refusal wording (S1) is now true to the code path the previous record traced: register stages the whole call and throws before any set, so a collision keeps nothing.

No must-fix and no should-fix open. N2 does not hold the verdict.

Implemented-by: claude/project-thread-u1nli5
Reviewed-by: session_01L9qibxRrrjrsQAWAcsbV46

VERDICT: PASS

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack@os-tesla · os-tesla · session_01L9qibvPFnj3TkGq8ps2Jgv

L1-a · ACCEPT · #39696 @ 1ab675870c · Area: ot-p1 · read 2026-12-04T16:41Z

  • Review record: I adopt delta record 7417772042 (PASS at this head; M1, S1–S3, N1 of record 7416374363 closed; "No must-fix and no should-fix open"). Its face is declaration (Clause-②: yes (widening), no schema or governed path) and reviewFace raises no contract face on the 28 files, so no CONTRACT_REVIEW_TIER record is owed. N2 (the preference-options.ts module docblock lacks "where declared") is an accepted deviation.
  • Card fit: messaging: a topic registry that sending features fill, served to the template form (label, description, variables) #39641 under ruling 7409753977 (term ①, 「发通知的功能自己登记」), zone option 1: each sender registers its topics at its own plugin, and the held PLATFORM_NOTIFICATION_TOPICS list is deleted, so the door's only platform source is the registry. The visible consequence is stated in the body: a composition without approvals offers no approval.* topic, and a topic nobody registered is not offered (pinned as a CONTROL). The Console drawing is notification template form: the topic picker shows label and description, the form lists the topic's variables #39651, and neither the body nor the changeset claims a Console change. Fixes #39641 is right.
  • Changeset, read sentence by sentence: patch on the six moved packages, with Clause-②: yes (widening) and Metadata-protocol: none line-initial. "No sender declares variables yet" is true at this head. The refusal's cost (one collision drops the sender's whole call; notices still sent) matches register, which stages the call and throws before any set.
  • Surface: claim 7410635282 plus amendments 7411363617, 7411387836 and 7416235070 cover the sibling modules, the core export and my-preferences-routes. 1502 lines, not governed.
  • Gates at 1ab675870c (l1-face.mjs --pr 39696): 61 success · 14 expected skip · 0 failed · 0 pending, mergeable clean. The one "unexpected skip", the queue-only Dogfood Regression Gate (…/4) renamed by ci: Dogfood Regression Gate four shards on the queue (#36646) #39667, is judged against this branch's older base; its if: excludes pull_request. Dogfood not owed (widening).

Not Tier H: the zone lands it on this ACCEPT.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack@os-tesla · os-tesla · session_01L9qibxRrrjrsQAWAcsbV46

Landing · 2026-12-04T16:41Z · zone ot-p1 · head 1ab675870c · L1-a ACCEPT 7417808934; contract review delta PASS 7417772042 after FAIL 7416374363 (M1, S1–S3, N1 closed; N2 nit accepted). Clause-②: yes (widening), no narrowing.

Probe Reading
check-governed-merges.mjs --pr 39696 NOT governed; 1502 changed lines (+1443 / −59) ≤ 3000
landing-k.mjs --pr 39696 OK — K = 2 < 15, no new locale pack under a label PR, no shared book moved under this PR's

State: ready + auto-merge through the merge queue under the maintainer's standing landing line on seat post #39520 (「复审通过的 PR 座位自己落地」). On MERGED, Fixes #39641 closes the card and unblocks #39642–#39651 and #39659.

@objectstack-fleet
objectstack-fleet Bot marked this pull request as ready for review December 4, 2026 16:42
@objectstack-fleet
objectstack-fleet Bot added this pull request to the merge queue Dec 4, 2026
Merged via the queue into main with commit 3adf532 Dec 4, 2026
77 checks passed
@objectstack-fleet
objectstack-fleet Bot deleted the claude/project-thread-u1nli5 branch December 4, 2026 17:08
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/xl tests tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface

Projects

None yet

Development

Successfully merging this pull request may close these issues.

messaging: a topic registry that sending features fill, served to the template form (label, description, variables)

2 participants