Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions changes/1615-discord-managed-role.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
section: Fixed
---

## en

- Discord's checked receiver recognizes mentions of its own native managed role as addressing its bound PersonaBot, while unrelated roles and everyone/here remain non-addressing; role ownership is checked against the current guild and Bot member ([#1615](https://github.com/BotHarness/DeepSeekBot/issues/1615)).

## zh

- Discord 受检接收器将自身原生托管角色的提及识别为对已绑定 PersonaBot 的请求;无关角色和 everyone/here 不触发直接提及,角色归属按当前服务器与 Bot 成员核验([#1615](https://github.com/BotHarness/DeepSeekBot/issues/1615))。
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,22 @@ Keep the DSH-native Plugin/Fiber and checked Service Definition → Provider →

The Provider authenticates the current Bot user and associated Application using native API calls and checks the Gateway READY App/user pair. Fingerprints include App and Bot user IDs, never tokens or mutable names. Snowflakes remain strings. A Profile can explicitly set the Discord Provider's `consumerMode: external-consumer` before connecting accounts. This prevents a privileged-content/standalone Session bootstrap before the Human binds the identity. Standalone configurations retain their original mode. Claiming a checked Consumer persists external mode; missing/disposed leases and restart do not restore standalone processing.

The mention path requests `GUILDS` and `GUILD_MESSAGES`, checks the native `mentions` array and accepts bounded Human text from guild text channels or existing public threads. It does not infer direct addressing from role mentions, display names or `@everyone`. Own Bots and webhooks are suppressed. Gateway sequence plus session identifies delivery evidence; it is not a durable replay cursor or per-message acknowledgement protocol. Canonical message identity and per-Bot Admission deduplicate redelivery in Messaging.
The mention path requests `GUILDS` and `GUILD_MESSAGES`, checks native addressing evidence and accepts bounded Human text from guild text channels or existing public threads. Native `mentions` identifies user mentions. The #1615 extension below separately qualifies the authenticated Bot's own managed role; unrelated role mentions, display names, `@everyone` and `@here` do not address the Bot. Own Bots and webhooks are suppressed. Gateway sequence plus session identifies delivery evidence; it is not a durable replay cursor or per-message acknowledgement protocol. Canonical message identity and per-Bot Admission deduplicate redelivery in Messaging.

For a text channel, external conversation and native destination are that channel. For an existing public thread, external conversation is its verified parent text channel, while `threadId` is the native child channel ID. Check parent/child guild correspondence. Discord `parent_id` is a parent channel, not a parent message. No root or parent message ID is fabricated from it or from a reply reference. Thread following remains unavailable in this slice because that independent contract has not been qualified.

Before reply, read current guild roles, the Bot member and parent-channel overwrites using the official permission order and exact integers. Require VIEW_CHANNEL, READ_MESSAGE_HISTORY and the appropriate SEND_MESSAGES or SEND_MESSAGES_IN_THREADS permission; refuse timed-out members, private threads and archived/locked threads in this candidate. Read the exact source in the native destination and verify its actor/message/route. Run the latest BotHarness fence immediately before one native Create Message call with retries disabled, mentions suppressed and a required existing source reference. Verify returned native author, destination and message ID before recording a canonical receipt; its conversation ID remains the authorized parent conversation while checked `threadId` retains the actual destination. Do not redirect or blindly retry an unknown outcome.

Core platform registration, Inbox/source DTO validation and the existing Client source label admit Discord through these checked contracts. Global defaults editing, ordinary intake, context windows, files, autonomous thread following, shared Channel qualification and proactive canonical receipt are separate real tracers. Their capability ledger remains unqualified.

## Own managed-role addressing — #1615

Discord offers both the App's Bot user and its integration-managed role under the same visible name. Treat only the latter's verified native ownership as another way to address the same Bot: the mentioned role's string ID must occur in the original `mention_roles`, the current native guild role must have `managed: true` and `tags.bot_id` equal to the authenticated Bot user ID, and that Bot's current guild member must hold the role. The everyone role is excluded. Reuse the existing checked channel/guild/member query and receiver lifetime; do not add a role cache, message store, listener or Core role-name heuristic.

The Provider uses the same predicate for early ingress and final normalization. The original text, user mentions and source-bound reply route stay intact; a role is not fabricated as a user mention. Other roles and everyone/here remain non-addressing even when the Bot holds those roles. They may be retained only through separately authorized ordinary collection, without direct-mention attention. Missing or changed native ownership cannot widen intake. A disposed or replaced receiver cannot deliver a result from an earlier lookup.

This is checked addressing, not authorization to join a guild, acquire Message Content intent or access unavailable message content. Role ownership and application permission do not prove actual Gateway delivery. The controlled Runtime/Consumer regressions and fresh installed-product native/model qualification passed for the #1615 candidate on 2026-10-16 JST: own managed role and Bot-user mentions each received one source-bound reply; an unrelated role held by the Bot, everyone and here created no attention or send. The test App already had Message Content approval. See the [qualification record](../dev/verification/discord-1615-managed-role.md) for exact artifacts, cleanup and review limits. Earlier #855 evidence does not qualify this extension; public release remains separate.

## Evidence boundary

Initial Provider candidate source: `e6f0de2a989c28d20db92c0e7f43b20c6d3028b9`, based on the then product-pinned Provider `48e7a35792af5222cd40cfe1ba2607ac55a59df2`. Those controlled Provider and assembled-Core tests alone did not qualify real Discord behavior. Subsequent agent-operated native/model E2E, original-location receipts, runtime provenance and screenshots completed the narrow **development-source mention/reply qualification** in [#855](https://github.com/BotHarness/BotHarness/issues/855) / [#934](https://github.com/BotHarness/BotHarness/pull/934), under the Human's revised acceptance instruction; no manual Human QA gate remains for that slice. Additional capabilities, installed-product qualification and Provider promotion retain separate evidence and authorization. This ADR's formal status remains Proposed; merge, deployment and publication require their own authorization.
Expand Down
2 changes: 2 additions & 0 deletions docs/architecture/botharness-architecture.md
Original file line number Diff line number Diff line change
Expand Up @@ -1057,6 +1057,8 @@ The #1155 ordinary-text extension uses the same exclusive checked QQ inbound con

[#855](https://github.com/BotHarness/BotHarness/issues/855) adds a **development-source qualified mention/reply** Discord checked adapter through the same Provider/Consumer and canonical Inbox seams. App/Bot identity is authenticated and checked against Gateway READY. An explicitly external-only Profile avoids standalone bootstrap; consumer loss preserves external ownership. A public thread maps to its verified parent conversation plus exact child-channel `threadId`, without manufactured message ancestry. Replies check current native permissions/source, run the authority fence and validate native author/destination/receipt without fallback or retry. See [ADR-0128](../adr/0128-discord-checked-replies-preserve-native-child-channel-routing.md). The real channel/thread model, native identity/guild boundary and refusal/recovery checks passed under agent-operated E2E acceptance; [verification](../dev/verification/discord-855-mention-reply.md) bounds the qualification to that development runtime. Product Provider promotion and other Discord capabilities remain separate.

[#1615](https://github.com/BotHarness/DeepSeekBot/issues/1615) 将同一受检 Discord 边界扩展到认证 Bot 自身的托管身份组提及。Provider 在归一化前读取当前原生服务器与成员,核对角色归属及准确的提及 ID;其他角色与 everyone/here 不构成直接寻址,不新增接收器、持久化或 Core 身份权威。2026-10-16 JST 的实际安装包已通过自身角色/用户提及、Bot 持有的无关角色及 everyone/here 的原生浏览器与模型验收;该 App 已有 Message Content 权限,公共发布仍是独立步骤。见 [ADR-0128](../adr/0128-discord-checked-replies-preserve-native-child-channel-routing.md) 和[验证记录](../dev/verification/discord-1615-managed-role.md)。

[#855](https://github.com/BotHarness/BotHarness/issues/855) 通过相同 Provider/Consumer 和 canonical Inbox 边界增加**开发来源提及/回复已取得资格**的 Discord adapter。App/Bot 身份由认证 API 与 Gateway READY 校验,显式 external-only Profile 避免先进入独立 Session,consumer 消失仍保留外部所有权。公开 thread 使用已验证的父会话与准确子频道 `threadId`,不虚构消息祖先。回复复查原生权限/原消息,执行授权门禁并验证原生作者/目的地/回执,不转发、不重试。见 [ADR-0128](../adr/0128-discord-checked-replies-preserve-native-child-channel-routing.md)。真实频道/thread 模型、原生身份/服务器边界与拒绝/恢复检查已按 agent-operated E2E 指令通过;[验证记录](../dev/verification/discord-855-mention-reply.md) 将资格限定于该开发运行时。产品 Provider 晋升与其他 Discord 能力另行处理。

[#937](https://github.com/BotHarness/BotHarness/issues/937) extends that candidate Provider through the existing `bridge_context` / `historyChecked` seam: bounded group and existing-public-thread Human-text pages, native App content visibility plus view/history checks before and after the HTTP page, and runtime-local signed cursors bound to account, original source route, scope and limit. Canonical context retention creates no Admission or placement; a conflicting retained source rolls back the page and reports `source-conflict`. Native edits never replace the earlier source evidence. [The exact candidate checkpoint](../dev/verification/discord-937-context-reads.md) separates real single-page model success, direct native cursor checks and restored-permission/restart refusal from still-pending model continuation/conflict acceptance. Nearby, ordinary subscription, files and product dependency promotion remain outside this slice.
Expand Down
2 changes: 1 addition & 1 deletion docs/client-bridge.md
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ resolver cannot substitute workspace-linked Core/Client for the tarballs.
node scripts/dev-instance.mjs --home /tmp/bh-im-qa --port 31968 --im-provider --json
```

仅对已停止的隔离 Profile 执行;重启同一 Profile 时仍传入 `--im-provider`,以重复校验。当前 Provider 来源记录为 Git 完整提交 `7505ce6fcda26c02810781fde9d4da81dab28a68`,开发资格记录为 DSH `0.2.1-rc.2`,这些来源记录不限制实际启动的 DSH 版本;校验 Bundle、入口及运行时代码 digest 后才启动 Host;不依赖另一份 provider 本地源码。安装摘要明确标注 `upstreamReleased: false`。此完整 fork 保留附件、回显与独立回复身份契约;群/话题上下文读取绑定当前独占 Consumer 生命周期,释放或替换后拒绝返回正在读取的结果;上游 PR 是否合并不阻挡此固定提交使用([#789](https://github.com/BotHarness/BotHarness/issues/789))。默认启动不安装它,原 npm `4.32.0` 仍不满足账号校验和条件发送契约。此入口不会发布包,也不是生产启用许可([ADR-0104](adr/0104-isolated-im-profiles-pin-a-qualified-temporary-provider-fork.md))。
仅对已停止的隔离 Profile 执行;重启同一 Profile 时仍传入 `--im-provider`,以重复校验。当前 Provider 来源记录为 Git 完整提交 `518314f6cf495aea093c0a93b0107de25b66e60d`,开发资格记录为 DSH `0.2.1-rc.2`,这些来源记录不限制实际启动的 DSH 版本;校验 Bundle、入口及运行时代码 digest 后才启动 Host;不依赖另一份 provider 本地源码。安装摘要明确标注 `upstreamReleased: false`。此完整 fork 保留附件、回显与独立回复身份契约;群/话题上下文读取绑定当前独占 Consumer 生命周期,释放或替换后拒绝返回正在读取的结果;上游 PR 是否合并不阻挡此固定提交使用([#789](https://github.com/BotHarness/BotHarness/issues/789))。默认启动不安装它,原 npm `4.32.0` 仍不满足账号校验和条件发送契约。此入口不会发布包,也不是生产启用许可([ADR-0104](adr/0104-isolated-im-profiles-pin-a-qualified-temporary-provider-fork.md))。

在 dsh-im 原设置中配置测试应用,并保存、测试仅含测试者与 Bot 的目标群;凭据交由 DSH credentials service,不复制到 BotHarness。打开 PersonaBot Profile → IM connection,选择已认证账号与已测试目标,显式授权后发送一条唯一测试文本。预期 Recent sends 显示 Platform accepted,并在目标群核对同一文本;这不代表送达或已读。停止本次启动摘要中的确切 PID,再以相同参数启动:绑定与发送历史应保留,不自动重发。

Expand Down
Loading
Loading