Skip to content

Commit bd65cb6

Browse files
docs(spec): push vendor docblocks read ADR-0012 §6.1, not alternate channel plugins (#30631)
domain:spec#3 · os-sales · session_01L6bhgTqqeHSwZYJmApbDCa <!-- claude-projects-attribution: {"github_login":"os-sales"} --> _Requested by **Sales** · [project thread](https://claude.ai/code/project/chan_01D5bWFY3rFzgJcytD5gD4Uu?thread=cmsg_01D5bWFY3rFzgJcytD5gD4UuKB8Sg6c6sVpL96ruVvdxaf)_ Fixes #29960 Clause-②: no Metadata-protocol: none ## 维护者速读 - 改了什么:推送配置与推送设备的说明注释(含生成的参考文档页)以及推送服务文档页的一句话,改为按 ADR-0012 §6.1 的新口径描述国产安卓厂商;只改注释,不动任何 schema、导出或默认值。 - 为什么改:ADR 修订后,厂商只是发送方按其路由的令牌类型(今天是直连通道,托管中继上线后由中继路由),二期由中继接入 HMS / 荣耀 / 小米 / OPPO / vivo;旧注释仍说它们是“另一套通道插件”,会把后续扩展厂商的人引向错误架构。 - 风险与回滚:极低;纯注释与文档文字,`PushVendorSchema` 仍为 `apns | fcm`,回滚即还原本 PR 的提交。 - 先看:`packages/spec/src/system/push-config.zod.ts`(`PushVendorSchema` 注释那段)、`content/docs/kernel/runtime-services/push-service.mdx`(第 86-91 行)、`packages/spec/src/system/push-device.zod.ts`。 - 两分钟验证:`git grep -nE "alternate channel|separate channel" -- packages/spec/src content/docs/references content/docs/kernel` 预期无输出。 - 需要你做的:无,席位落地。 ## What changes The docblocks that read ADR-0012 §6 as "the domestic Android vendors plug in as alternate channel plugins / implementations" now carry the reading ADR-0012 §6 and §6.1 (as amended by PR #29952) decide: `vendor` is the token type the sender routes on (the direct transport today, where `PushService.send` picks `transports[message.vendor]`; the hosted relay, the default, once it is served), core ships `apns | fcm`, and phase 2 adds HMS / Honor / Xiaomi / OPPO / vivo behind the relay, with no per-vendor plugin and no per-vendor channel. - `packages/spec/src/system/push-config.zod.ts`: the module docblock's "Out of scope here" paragraph, and the `PushVendorSchema` docblock (still "closed on purpose"; a new value is still a spec change made together with its transport, now named as the relay's routing for that vendor). - `packages/spec/src/system/push-device.zod.ts`: the `UserDeviceSchema` docblock's "Narrowed from" paragraph. - `packages/spec/src/api/register-device-request.test.ts`: the file-header comment. - `content/docs/references/system/push-config.mdx`: regenerated by `check:generated --fix` (the only stale artifact). - `content/docs/kernel/runtime-services/push-service.mdx`: the hand-written push service page said the other Android vendors "plug in as separate channel implementations". It now says only `apns` and `fcm` ship today, and the other Android vendors (HMS / Honor / Xiaomi / OPPO / vivo) are planned for a later phase behind the hosted relay, as further values of `vendor`, the token type the sender routes on (this service's transports today, the relay once it is served), not as plugins or channels of their own. The page's own "The hosted relay: not served yet" section, which the sentence points to, is unchanged. - `.changeset/29960-push-vendor-docblocks.md`: `@objectstack/spec` patch, because the TSDoc of a `src/**/*.zod.ts` file ships in the published declarations. Comment text only: no schema, `.describe()`, export, default or test assertion moves. Citations of §6 for the device registry and its lifecycle stay as they are (`push-device.zod.ts` line 12, `push-device.test.ts` line 3, `protocol.zod.ts`, `notification-service.ts`, `platform-capabilities.ts`); only the alternate-channel reading moves, and where it moves it cites §6.1. ## Tests - `pnpm --filter @objectstack/spec exec vitest run --maxWorkers=2 src/system/push-config.test.ts src/system/push-device.test.ts src/api/register-device-request.test.ts src/api/push-relay.test.ts`: Test Files 4 passed (4), Tests 117 passed (117). - `pnpm --filter @objectstack/spec typecheck`: exit 0. - `pnpm --filter @objectstack/spec check:generated`: all 14 generated artifacts up to date (after `--fix` regenerated `check:docs`). - eslint `--no-inline-config` on the three changed `.ts` files: exit 0. ## Acceptance notes - The push service page (`content/docs/kernel/runtime-services/push-service.mdx`) carried the same retired reading. The seat widened the claim to cover it (claim amendment on #29960), and it is fixed in this PR. A re-grep of `content/docs`, `packages/spec/src`, `packages/services/service-push`, `packages/services/service-messaging/src`, `skills` and `docs` for "separate channel" / "alternate channel" / "plug in as" finds no other ADR-0012 §6 vendor reading outside the ADR's own quoted amendment text. - `push-device.zod.ts` line 12, "(ADR-0012 §6, narrowed to what core ships)", cites §6 for the stored device shape (the registry), which §6 still is, so it is unchanged. - Contract review (PASS, no must-fix) raised two should-fixes, both landed here in `86e42da79`. S1: the docblocks named only the relay as what routes on `vendor`; on `main` the relay is not served and the direct transport routes on it today (`packages/services/service-push/src/push-service.ts` line 92, `transports[message.vendor]`; `packages/services/service-messaging/src/push-channel.ts` line 147 filters devices by the configured vendors), so both docblocks, the docs page and the changeset now say "the token type the sender routes on", naming the direct transport today and the hosted relay (the default) once served. S2: the vendor list uses the ADR's five-way separators, HMS / Honor / Xiaomi / OPPO / vivo, everywhere it is written. - No ablation: no tested behaviour changed. ## Verification All readings on head `52082426b` (objectstack-ai/objectstack; `origin/main` merged in at `88640a098`). <details><summary>Derived gate families: 103 derived, 103 run, 0 NOT-MEASURED, 0 UNRUN</summary> - `node scripts/pm/dispatch-gates.mjs --commands --repo objectstack-ai/objectstack`: 103 commands, every one run after `pnpm build` under the verify lock (VERDICT command-exit 0), with its exit code captured before any pipe; all 103 exit 0 on one pass. - `--ran` reconciliation: "103 derived, 103 run, 0 NOT-MEASURED (a DERIVED zero — all 103 recorded an exit code and none of them is 3)". - Docs gates for the page: `check:doc-authoring`, `check:doc-anchors`, `check:docs-redirects`, `check:runtime-services-index`: exit 0. `check:type-check-debt`: exit 0, "0 raw tsc error(s) total, none above its recorded number". `check-changeset-no-major --base origin/main`: exit 0. `check:nul-bytes`: exit 0. </details> <details><summary>Package gates</summary> - `pnpm --filter @objectstack/spec build`, targeted vitest and `pnpm --filter @objectstack/spec typecheck` (verify lock): Test Files 4 passed (4), Tests 117 passed (117); VERDICT command-exit 0. - `pnpm --filter @objectstack/spec check:generated`: "All 14 generated artifacts are up to date" (`--fix` regenerated `push-config.mdx` in `52082426b`). - `eslint --no-inline-config` on the three changed `.ts` files: exit 0. </details> CI-carried families (the required contexts) are read from this PR's check-runs. --- _Generated by [Claude Code](https://claude.ai/code/session_01L6bhgTqqeHSwZYJmApbDCa)_ 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01L6bhgTqqeHSwZYJmApbDCa --------- Co-authored-by: Claude <noreply@anthropic.com>
1 parent 66a8822 commit bd65cb6

6 files changed

Lines changed: 38 additions & 13 deletions

File tree

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
---
2+
'@objectstack/spec': patch
3+
---
4+
5+
docs(spec): the push vendor docblocks read ADR-0012 §6.1 as amended
6+
7+
Clause-②: no
8+
Metadata-protocol: none
9+
10+
The `PushVendorSchema` docblock and the push transport and stored device docblocks (`system/push-config.zod.ts`, `system/push-device.zod.ts`) no longer say the domestic Android vendors plug in as alternate channel plugins. They now say what ADR-0012 §6.1 decides: `vendor` is the token type the sender routes on (the direct transport today, the hosted relay, the default, once served), core ships `apns` and `fcm`, and phase 2 adds HMS / Honor / Xiaomi / OPPO / vivo behind the relay, with no per-vendor plugin and no per-vendor channel. A new `PushVendorSchema` value is still a spec change made together with the relay's routing for that vendor. Comment text only: no schema, `.describe()`, export or default changes, and `PushVendorSchema` stays `apns | fcm`.

‎content/docs/kernel/runtime-services/push-service.mdx‎

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,8 +85,11 @@ service its server gets.
8585

8686
Each vendor block is optional, and at least one is required. A vendor with no
8787
block is a vendor this deployment does not push to; devices registered on it are
88-
skipped. Other Android vendors (HMS, Xiaomi, OPPO, vivo) are not transports of
89-
this service: they plug in as separate channel implementations.
88+
skipped. Only `apns` and `fcm` ship today. The other Android vendors (HMS /
89+
Honor / Xiaomi / OPPO / vivo) are planned for a later phase behind the hosted
90+
relay (below), as further values of `vendor`, the token type the sender routes
91+
on (this service's transports today, the relay once it is served), and not as
92+
plugins or channels of their own.
9093

9194
### Credential references
9295

‎content/docs/references/system/push-config.mdx‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,8 +82,10 @@ constructor instead. No `OS_PUSH_*` environment variable carries any of
8282
it: the vendor blocks hold no secret to override, and each `credentialRef`
8383
already names one.
8484

85-
Out of scope here: the other vendors ADR-0012 §6 routes to alternate
86-
channel plugins (HMS, Xiaomi, OPPO, vivo).
85+
Out of scope here: the domestic Android vendors (HMS / Honor / Xiaomi /
86+
OPPO / vivo). ADR-0012 §6.1 has the hosted relay front them in phase 2, as
87+
further values of `vendor`, the token type the sender routes on; there is
88+
no per-vendor plugin and no per-vendor channel.
8789

8890
<Callout type="info">
8991
**Source:** `packages/spec/src/system/push-config.zod.ts`

‎packages/spec/src/api/register-device-request.test.ts‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,9 @@
44
// §6): it gains an optional `vendor`, `appId` and `locale`. Pure widening, so
55
// the body every client sends today must keep parsing unchanged, and the new
66
// members are optional. The one value the widening refuses is a vendor
7-
// outside the pair core delivers through (`apns` / `fcm`); other vendors are
8-
// alternate channel plugins (ADR-0012 §6), not values of this field.
7+
// outside the pair core delivers through (`apns` / `fcm`); the domestic
8+
// Android vendors arrive in phase 2 as further values of `PushVendorSchema`,
9+
// routed by the hosted relay (ADR-0012 §6.1), not as channel plugins.
910

1011
import { describe, it, expect } from 'vitest';
1112
import {

‎packages/spec/src/system/push-config.zod.ts‎

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -82,16 +82,22 @@ import { strictObject } from '../shared/strict-object';
8282
* it: the vendor blocks hold no secret to override, and each `credentialRef`
8383
* already names one.
8484
*
85-
* Out of scope here: the other vendors ADR-0012 §6 routes to alternate
86-
* channel plugins (HMS, Xiaomi, OPPO, vivo).
85+
* Out of scope here: the domestic Android vendors (HMS / Honor / Xiaomi /
86+
* OPPO / vivo). ADR-0012 §6.1 has the hosted relay front them in phase 2, as
87+
* further values of `vendor`, the token type the sender routes on; there is
88+
* no per-vendor plugin and no per-vendor channel.
8789
*/
8890

8991
/**
9092
* Push vendors core delivers through: `apns` (Apple) and `fcm` (Firebase).
9193
*
92-
* Closed on purpose. ADR-0012 §6 plugs the domestic Android vendors in as
93-
* alternate channel implementations, not as transports of this channel, so a
94-
* new value here is a spec change made together with its transport.
94+
* Closed on purpose. `vendor` is the token type the sender routes on: the
95+
* direct transport today, the hosted relay (the default) once served (ADR-0012
96+
* §6.1). Phase 1 routes these two, and phase 2 adds the domestic Android
97+
* vendors (HMS / Honor / Xiaomi / OPPO / vivo) behind the relay, with no
98+
* per-vendor plugin and no per-vendor channel. So a new value here is
99+
* a spec change made together with its transport: the relay's routing for
100+
* that vendor.
95101
*/
96102
export const PushVendorSchema = z.enum(['apns', 'fcm'])
97103
.describe('Push vendor core delivers through: apns (Apple Push Notification service) or fcm (Firebase Cloud Messaging HTTP v1)');

‎packages/spec/src/system/push-device.zod.ts‎

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,11 @@ import { PUSH_SERVER_ORIGIN_MESSAGE, PUSH_SERVER_ORIGIN_PATTERN } from './push-s
4646
* row, and a later registration of the same device re-enables it and clears
4747
* `invalidatedAt`.
4848
*
49-
* Narrowed from ADR-0012 §6: `vendor` is the core pair (`apns` | `fcm`; the
50-
* domestic Android vendors plug in as alternate channel implementations) and
49+
* Narrowed from the ADR-0012 §6 sketch: `vendor` is the core pair (`apns` |
50+
* `fcm`; it is the token type the sender routes on: the direct transport
51+
* today, the hosted relay (the default) once served, and the domestic Android
52+
* vendors (HMS / Honor / Xiaomi / OPPO / vivo) join it in phase 2 behind the
53+
* relay, ADR-0012 §6.1) and
5154
* `platform` is the registration's own three (`ios` | `android` | `web`).
5255
*/
5356
export const UserDeviceSchema = lazySchema(() => z.object({

0 commit comments

Comments
 (0)