feat(platform): extend slash/bot span metadata for Phase 475

Add slash.invoke argCount/ephemeral/builtin and bot.install botName/permissionMask
plus bot.message contentLength to span.end for diagnostics and dev-log filters.

Co-authored-by: Cursor <[email protected]>
This commit is contained in:
Raven Scott
2026-05-24 04:22:49 -04:00
co-authored by Cursor
parent 17de4ccc51
commit 3f722f9b0f
2 changed files with 23 additions and 3 deletions
+2
View File
@@ -188,6 +188,8 @@ Primary consumer: `apps/pearcord/index.js` sidecar reading pear-pipe JSON.
**v0.8.436 (Phase 473):** `role.create`/`role.update` span.end adds `hasColor` and `permissionMask`; `permission.overwrite` adds `allowBits`/`denyBits`; `permission.overwrite.delete` adds `deleted`. UI `syncRolesPanelsDuringGuildLoading` + composer roles hint. Smokes: `test:platform-role-span-metadata-extend`, `test:platform-permission-span-metadata-extend`. Bundle: `test:phase473-roles-permissions`.
**v0.8.438 (Phase 475):** `slash.invoke` span.end adds `argCount`/`ephemeral`/`builtin`; `bot.install` adds `botName`/`permissionMask`; `bot.message` adds `contentLength`/`botId`. UI `syncSlashBotsPanelsDuringGuildLoading` + `ensureComposerContextHints` + `#composer-slash-hint`. IPC `bot-installed`/`slash-invoked`. Bundle: `test:phase475-slash-bots`.
**v0.8.437 (Phase 474):** `webhook.create` span.end adds `webhookName`/`channelId`; `webhook.delete` adds `deleted`; `webhook.execute` adds `contentLength`/`hasUsername`; `slash.register` adds `firstName`. UI `syncWebhooksPanelsDuringGuildLoading` + composer webhooks hint. Smokes: `test:platform-webhook-span-metadata-extend`, `test:platform-slash-span-metadata-extend`. Bundle: `test:phase474-webhooks-integrations`.
**v0.8.435 (Phase 472):** `ban.member`/`kick.member` span `end` adds `hasReason`; `ban.member` adds `banCount`; `timeout.member` adds `until`; `audit.export` adds `signed`. UI extended `syncModerationPanelsDuringGuildLoading` + composer moderation hint. Smokes: `test:platform-moderation-span-metadata-extend`, `test:dev-log-moderation-errors-tighten`, `test:dev-log-audit-errors-tighten`. Bundle: `test:phase472-moderation-audit`.
+21 -3
View File
@@ -9882,7 +9882,12 @@ class PearcordPlatform extends EventEmitter {
await this._ingestGuildBot(bot)
if (this.guild) this.guild.gossipBotInstall(bot)
this.emit('bot', bot)
span.end({ botId: bot.id, guildId: bot.guildId })
span.end({
botId: bot.id,
guildId: bot.guildId,
botName: String(bot.name || '').slice(0, 32),
permissionMask: Number(bot.permissions) || 0
})
return { bot, token: typeof tokenInput === 'string' ? tokenInput : null }
} catch (err) {
this.log.error('bot.install error', {
@@ -9916,7 +9921,13 @@ class PearcordPlatform extends EventEmitter {
if (prevChannel && prevChannel !== chId) await this.selectChannel(prevChannel)
if (this.guild) this.guild.gossipMessage(msg)
await this._fanoutBotEvent(BOT_EVENTS.MESSAGE_CREATE, { message: msg })
span.end({ messageId: msg?.id, guildId, channelId: chId })
span.end({
messageId: msg?.id,
guildId,
channelId: chId,
contentLength: String(content ?? '').length,
botId
})
return msg
} catch (err) {
this.log.error('bot.message error', {
@@ -10151,7 +10162,14 @@ class PearcordPlatform extends EventEmitter {
}
const reply = `${header}\n${body}`
const msg = await this._sendPlainMessage(reply, opts)
span.end({ name: inv.name, guildId, channelId })
span.end({
name: inv.name,
guildId,
channelId,
argCount: inv.args.length,
ephemeral: !!opts.ephemeral,
builtin: !!result.command?.builtin
})
return msg
} catch (err) {
this.log.error('slash.invoke error', {